@visitscotland/component-library 5.69.0 → 5.69.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const wt=require("./LoadingSpinner-BIBGH_VZ.js"),q=require("vue"),pa=require("pinia");let Wa=null;typeof window<"u"&&(Wa=document.currentScript);const Py={options:{div:"map",logo:"os-logo-maps",statement:"Contains OS data &copy; Crown copyright and database rights YYYY",prefix:"",suffix:""},init(y){if(typeof window<"u"){Wa&&(this.options.div=Wa.getAttribute("data-div")||this.options.div,this.options.logo=Wa.getAttribute("data-logo")||this.options.logo,this.options.statement=Wa.getAttribute("data-statement")||this.options.statement,this.options.prefix=Wa.getAttribute("data-prefix")||this.options.prefix,this.options.suffix=Wa.getAttribute("data-suffix")||this.options.suffix),y=typeof y<"u"?y:{},Object.assign(this.options,y);const _=document.getElementById(this.options.div);let b="os-api-branding logo";this.options.logo==="os-logo-maps-white"&&(b="os-api-branding logo white");let M=this.options.statement;M=M.replace("YYYY",new Date().getFullYear()),this.options.prefix!==""&&(M=`${this.options.prefix}<span>|</span>${M}`),this.options.suffix!==""&&(M=`${M}<span>|</span>${this.options.suffix}`),document.querySelectorAll(`#${this.options.div} .os-api-branding`).forEach(u=>u.remove());const E=document.createElement("div");E.className=b,_.appendChild(E);const R=document.createElement("div");R.className="os-api-branding copyright",R.innerHTML=M,_.appendChild(R)}}},Sn=pa.defineStore("map",()=>{const y=q.ref([]),_=q.ref([]),b=q.ref(null),M=q.ref(null),E=q.ref(null);function R(be){y.value.push({id:be.id,filters:be.filters,places:be.places,activePins:be.activePins,hovered:"",activePlace:null})}function u(be){y.value.forEach(ke=>{ke.id===be.mapId&&(ke.hovered=be.hoveredFeature)})}function U(be){y.value.forEach(ke=>{ke.id===be.mapId&&(ke.activePlace=be.activeFeature)})}function k(be){_.value=be}function J(be){b.value=be}function X(be){M.value=be}function ae(be){return y.value.find(ke=>ke.id===be)}function Y(be){return y.value.find(Oe=>Oe.id===be)?.hovered}function Te(be){return y.value.find(Oe=>Oe.id===be)?.activePlace}return{maps:y,activeSubcatFilters:_,selectedSubCategory:b,activeMarkerPos:M,activePlace:E,addMapInstance:R,setHoveredPlace:u,setActivePlace:U,setActiveSubcatFilters:k,setSelectedSubcat:J,setActiveMarkerPos:X,getMapById:ae,getHoveredStop:Y,getActivePlace:Te}});var _c={exports:{}},S0=_c.exports,Cy;function I0(){return Cy||(Cy=1,(function(y,_){(function(b,M){y.exports=M()})(S0,(function(){var b,M,E;function R(u,U){if(!b)b=U;else if(!M)M=U;else{var k="var sharedChunk = {}; ("+b+")(sharedChunk); ("+M+")(sharedChunk);",J={};b(J),E=U(J),typeof window<"u"&&(E.workerUrl=window.URL.createObjectURL(new Blob([k],{type:"text/javascript"})))}}return R(["exports"],(function(u){function U(e,t){return e(t={exports:{}},t.exports),t.exports}var k=J;function J(e,t,r,a){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(a-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=a,this.p2x=r,this.p2y=a}J.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},J.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},J.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},J.prototype.solveCurveX=function(e,t){var r,a,l,c,h;for(t===void 0&&(t=1e-6),l=e,h=0;h<8;h++){if(c=this.sampleCurveX(l)-e,Math.abs(c)<t)return l;var m=this.sampleCurveDerivativeX(l);if(Math.abs(m)<1e-6)break;l-=c/m}if((l=e)<(r=0))return r;if(l>(a=1))return a;for(;r<a;){if(c=this.sampleCurveX(l),Math.abs(c-e)<t)return l;e>c?r=l:a=l,l=.5*(a-r)+r}return l},J.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var X=ae;function ae(e,t){this.x=e,this.y=t}ae.prototype={clone:function(){return new ae(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},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(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),a=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=a,this},_rotateAround:function(e,t){var r=Math.cos(e),a=Math.sin(e),l=t.y+a*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-a*(this.y-t.y),this.y=l,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},ae.convert=function(e){return e instanceof ae?e:Array.isArray(e)?new ae(e[0],e[1]):e};var Y=typeof self<"u"?self:{},Te=Math.pow(2,53)-1;function be(e,t,r,a){var l=new k(e,t,r,a);return function(c){return l.solve(c)}}var ke=be(.25,.1,.25,1);function Oe(e,t,r){return Math.min(r,Math.max(t,e))}function Ve(e,t,r){var a=r-t,l=((e-t)%a+a)%a+t;return l===t?r:l}function Re(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var a=0,l=t;a<l.length;a+=1){var c=l[a];for(var h in c)e[h]=c[h]}return e}var ve=1;function Ke(){return ve++}function We(){return(function e(t){return t?(t^16*Math.random()>>t/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)})()}function It(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function we(e,t){e.forEach((function(r){t[r]&&(t[r]=t[r].bind(t))}))}function Ge(e,t){return e.indexOf(t,e.length-t.length)!==-1}function Fe(e,t,r){var a={};for(var l in e)a[l]=t.call(r||this,e[l],l,e);return a}function tt(e,t,r){var a={};for(var l in e)t.call(r||this,e[l],l,e)&&(a[l]=e[l]);return a}function kt(e){return Array.isArray(e)?e.map(kt):typeof e=="object"&&e?Fe(e,kt):e}var Wt={};function St(e){Wt[e]||(typeof console<"u"&&console.warn(e),Wt[e]=!0)}function Ut(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function Hr(e){for(var t=0,r=0,a=e.length,l=a-1,c=void 0,h=void 0;r<a;l=r++)t+=((h=e[l]).x-(c=e[r]).x)*(c.y+h.y);return t}function Er(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function bi(e){var t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(a,l,c,h){var m=c||h;return t[l]=!m||m.toLowerCase(),""})),t["max-age"]){var r=parseInt(t["max-age"],10);isNaN(r)?delete t["max-age"]:t["max-age"]=r}return t}var or=null;function Rr(e){if(or==null){var t=e.navigator?e.navigator.userAgent:null;or=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return or}function et(e){try{var t=Y[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch{return!1}}var Lr,Xr,At,Fr,Mi=Y.performance&&Y.performance.now?Y.performance.now.bind(Y.performance):Date.now.bind(Date),pi=Y.requestAnimationFrame||Y.mozRequestAnimationFrame||Y.webkitRequestAnimationFrame||Y.msRequestAnimationFrame,Or=Y.cancelAnimationFrame||Y.mozCancelAnimationFrame||Y.webkitCancelAnimationFrame||Y.msCancelAnimationFrame,Xi={now:Mi,frame:function(e){var t=pi(e);return{cancel:function(){return Or(t)}}},getImageData:function(e,t){t===void 0&&(t=0);var r=Y.document.createElement("canvas"),a=r.getContext("2d");if(!a)throw new Error("failed to create canvas 2d context");return r.width=e.width,r.height=e.height,a.drawImage(e,0,0,e.width,e.height),a.getImageData(-t,-t,e.width+2*t,e.height+2*t)},resolveURL:function(e){return Lr||(Lr=Y.document.createElement("a")),Lr.href=e,Lr.href},hardwareConcurrency:Y.navigator&&Y.navigator.hardwareConcurrency||4,get devicePixelRatio(){return Y.devicePixelRatio},get prefersReducedMotion(){return!!Y.matchMedia&&(Xr==null&&(Xr=Y.matchMedia("(prefers-reduced-motion: reduce)")),Xr.matches)}},Nt={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Nr={supported:!1,testSupport:function(e){!ar&&Fr&&(sr?lt(e):At=e)}},ar=!1,sr=!1;function lt(e){var t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,Fr),e.isContextLost())return;Nr.supported=!0}catch{}e.deleteTexture(t),ar=!0}Y.document&&((Fr=Y.document.createElement("img")).onload=function(){At&&lt(At),At=null,sr=!0},Fr.onerror=function(){ar=!0,At=null},Fr.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var mr="01",pr=function(e,t){this._transformRequestFn=e,this._customAccessToken=t,this._createSkuToken()};function jr(e){return e.indexOf("mapbox:")===0}pr.prototype._createSkuToken=function(){var e=(function(){for(var t="",r=0;r<10;r++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",mr,t].join(""),tokenExpiresAt:Date.now()+432e5}})();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt},pr.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},pr.prototype.transformRequest=function(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}},pr.prototype.normalizeStyleURL=function(e,t){if(!jr(e))return e;var r=Kr(e);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},pr.prototype.normalizeGlyphsURL=function(e,t){if(!jr(e))return e;var r=Kr(e);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},pr.prototype.normalizeSourceURL=function(e,t){if(!jr(e))return e;var r=Kr(e);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||t)},pr.prototype.normalizeSpriteURL=function(e,t,r,a){var l=Kr(e);return jr(e)?(l.path="/styles/v1"+l.path+"/sprite"+t+r,this._makeAPIURL(l,this._customAccessToken||a)):(l.path+=""+t+r,Bi(l))},pr.prototype.normalizeTileURL=function(e,t){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!jr(e))return e;var r=Kr(e);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(Xi.devicePixelRatio>=2||t===512?"@2x":"")+(Nr.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var a=this._customAccessToken||(function(l){for(var c=0,h=l;c<h.length;c+=1){var m=h[c].match(/^access_token=(.*)$/);if(m)return m[1]}return null})(r.params)||Nt.ACCESS_TOKEN;return Nt.REQUIRE_ACCESS_TOKEN&&a&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,a)},pr.prototype.canonicalizeTileURL=function(e,t){var r=Kr(e);if(!r.path.match(/(^\/v4\/)/)||!r.path.match(/\.[\w]+$/))return e;var a="mapbox://tiles/";a+=r.path.replace("/v4/","");var l=r.params;return t&&(l=l.filter((function(c){return!c.match(/^access_token=/)}))),l.length&&(a+="?"+l.join("&")),a},pr.prototype.canonicalizeTileset=function(e,t){for(var r=!!t&&jr(t),a=[],l=0,c=e.tiles||[];l<c.length;l+=1){var h=c[l];br(h)?a.push(this.canonicalizeTileURL(h,r)):a.push(h)}return a},pr.prototype._makeAPIURL=function(e,t){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",a=Kr(Nt.API_URL);if(e.protocol=a.protocol,e.authority=a.authority,e.protocol==="http"){var l=e.params.indexOf("secure");l>=0&&e.params.splice(l,1)}if(a.path!=="/"&&(e.path=""+a.path+e.path),!Nt.REQUIRE_ACCESS_TOKEN)return Bi(e);if(!(t=t||Nt.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if(t[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return e.params=e.params.filter((function(c){return c.indexOf("access_token")===-1})),e.params.push("access_token="+t),Bi(e)};var hr=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function br(e){return hr.test(e)}var dn=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Kr(e){var t=e.match(dn);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function Bi(e){var t=e.params.length?"?"+e.params.join("&"):"";return e.protocol+"://"+e.authority+e.path+t}function hi(e){if(!e)return null;var t=e.split(".");if(!t||t.length!==3)return null;try{return JSON.parse(decodeURIComponent(Y.atob(t[1]).split("").map((function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch{return null}}var ti=function(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};ti.prototype.getStorageKey=function(e){var t,r=hi(Nt.ACCESS_TOKEN);return t=r&&r.u?Y.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(function(a,l){return String.fromCharCode(+("0x"+l))}))):Nt.ACCESS_TOKEN||"",e?"mapbox.eventData."+e+":"+t:"mapbox.eventData:"+t},ti.prototype.fetchEventData=function(){var e=et("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{var a=Y.localStorage.getItem(t);a&&(this.eventData=JSON.parse(a));var l=Y.localStorage.getItem(r);l&&(this.anonId=l)}catch{St("Unable to read from LocalStorage")}},ti.prototype.saveEventData=function(){var e=et("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{Y.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&Y.localStorage.setItem(t,JSON.stringify(this.eventData))}catch{St("Unable to write to LocalStorage")}},ti.prototype.processRequests=function(e){},ti.prototype.postEvent=function(e,t,r,a){var l=this;if(Nt.EVENTS_URL){var c=Kr(Nt.EVENTS_URL);c.params.push("access_token="+(a||Nt.ACCESS_TOKEN||""));var h={event:this.type,created:new Date(e).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.3",skuId:mr,userId:this.anonId},m=t?Re(h,t):h,g={url:Bi(c),headers:{"Content-Type":"text/plain"},body:JSON.stringify([m])};this.pendingRequest=Yt(g,(function(x){l.pendingRequest=null,r(x),l.saveEventData(),l.processRequests(a)}))}},ti.prototype.queueRequest=function(e,t){this.queue.push(e),this.processRequests(t)};var ri,Vi,Ki=(function(e){function t(){e.call(this,"map.load"),this.success={},this.skuToken=""}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.postMapLoadEvent=function(r,a,l,c){this.skuToken=l;var h=!(!c&&!Nt.ACCESS_TOKEN),m=Array.isArray(r)&&r.some((function(g){return jr(g)||br(g)}));Nt.EVENTS_URL&&h&&m&&this.queueRequest({id:a,timestamp:Date.now()},c)},t.prototype.processRequests=function(r){var a=this;if(!this.pendingRequest&&this.queue.length!==0){var l=this.queue.shift(),c=l.id,h=l.timestamp;c&&this.success[c]||(this.anonId||this.fetchEventData(),It(this.anonId)||(this.anonId=We()),this.postEvent(h,{skuToken:this.skuToken},(function(m){m||c&&(a.success[c]=!0)}),r))}},t})(ti),yo=new((function(e){function t(r){e.call(this,"appUserTurnstile"),this._customAccessToken=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.postTurnstileEvent=function(r,a){Nt.EVENTS_URL&&Nt.ACCESS_TOKEN&&Array.isArray(r)&&r.some((function(l){return jr(l)||br(l)}))&&this.queueRequest(Date.now(),a)},t.prototype.processRequests=function(r){var a=this;if(!this.pendingRequest&&this.queue.length!==0){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var l=hi(Nt.ACCESS_TOKEN),c=l?l.u:Nt.ACCESS_TOKEN,h=c!==this.eventData.tokenU;It(this.anonId)||(this.anonId=We(),h=!0);var m=this.queue.shift();if(this.eventData.lastSuccess){var g=new Date(this.eventData.lastSuccess),x=new Date(m),S=(m-this.eventData.lastSuccess)/864e5;h=h||S>=1||S<-1||g.getDate()!==x.getDate()}else h=!0;if(!h)return this.processRequests();this.postEvent(m,{"enabled.telemetry":!1},(function(I){I||(a.eventData.lastSuccess=m,a.eventData.tokenU=c)}),r)}},t})(ti)),Zo=yo.postTurnstileEvent.bind(yo),mn=new Ki,Mn=mn.postMapLoadEvent.bind(mn),Bn=500,$o=50;function jn(){Y.caches&&!ri&&(ri=Y.caches.open("mapbox-tiles"))}function zn(e){var t=e.indexOf("?");return t<0?e:e.slice(0,t)}var rn,fe=1/0;function _e(){return rn==null&&(rn=Y.OffscreenCanvas&&new Y.OffscreenCanvas(1,1).getContext("2d")&&typeof Y.createImageBitmap=="function"),rn}var jt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(jt);var tr=(function(e){function t(r,a,l){a===401&&br(l)&&(r+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),e.call(this,r),this.status=a,this.url=l,this.name=this.constructor.name,this.message=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},t})(Error),Kt=Er()?function(){return self.worker&&self.worker.referrer}:function(){return(Y.location.protocol==="blob:"?Y.parent:Y).location.href},_t,fi,qi=function(e,t){if(!(/^file:/.test(r=e.url)||/^file:/.test(Kt())&&!/^\w+:/.test(r))){if(Y.fetch&&Y.Request&&Y.AbortController&&Y.Request.prototype.hasOwnProperty("signal"))return(function(a,l){var c,h=new Y.AbortController,m=new Y.Request(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,referrer:Kt(),signal:h.signal}),g=!1,x=!1,S=(c=m.url).indexOf("sku=")>0&&br(c);a.type==="json"&&m.headers.set("Accept","application/json");var I=function(z,j,G){if(!x){if(z&&z.message!=="SecurityError"&&St(z),j&&G)return C(j);var te=Date.now();Y.fetch(m).then((function(K){if(K.ok){var oe=S?K.clone():null;return C(K,oe,te)}return l(new tr(K.statusText,K.status,a.url))})).catch((function(K){K.code!==20&&l(new Error(K.message))}))}},C=function(z,j,G){(a.type==="arrayBuffer"?z.arrayBuffer():a.type==="json"?z.json():z.text()).then((function(te){x||(j&&G&&(function(K,oe,le){if(jn(),ri){var ce={status:oe.status,statusText:oe.statusText,headers:new Y.Headers};oe.headers.forEach((function(xe,Pe){return ce.headers.set(Pe,xe)}));var he=bi(oe.headers.get("Cache-Control")||"");he["no-store"]||(he["max-age"]&&ce.headers.set("Expires",new Date(le+1e3*he["max-age"]).toUTCString()),new Date(ce.headers.get("Expires")).getTime()-le<42e4||(function(xe,Pe){if(Vi===void 0)try{new Response(new ReadableStream),Vi=!0}catch{Vi=!1}Vi?Pe(xe.body):xe.blob().then(Pe)})(oe,(function(xe){var Pe=new Y.Response(xe,ce);jn(),ri&&ri.then((function(De){return De.put(zn(K.url),Pe)})).catch((function(De){return St(De.message)}))})))}})(m,j,G),g=!0,l(null,te,z.headers.get("Cache-Control"),z.headers.get("Expires")))})).catch((function(te){x||l(new Error(te.message))}))};return S?(function(z,j){if(jn(),!ri)return j(null);var G=zn(z.url);ri.then((function(te){te.match(G).then((function(K){var oe=(function(le){if(!le)return!1;var ce=new Date(le.headers.get("Expires")||0),he=bi(le.headers.get("Cache-Control")||"");return ce>Date.now()&&!he["no-cache"]})(K);te.delete(G),oe&&te.put(G,K.clone()),j(null,K,oe)})).catch(j)})).catch(j)})(m,I):I(null,null),{cancel:function(){x=!0,g||h.abort()}}})(e,t);if(Er()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var r;return(function(a,l){var c=new Y.XMLHttpRequest;for(var h in c.open(a.method||"GET",a.url,!0),a.type==="arrayBuffer"&&(c.responseType="arraybuffer"),a.headers)c.setRequestHeader(h,a.headers[h]);return a.type==="json"&&(c.responseType="text",c.setRequestHeader("Accept","application/json")),c.withCredentials=a.credentials==="include",c.onerror=function(){l(new Error(c.statusText))},c.onload=function(){if((c.status>=200&&c.status<300||c.status===0)&&c.response!==null){var m=c.response;if(a.type==="json")try{m=JSON.parse(c.response)}catch(g){return l(g)}l(null,m,c.getResponseHeader("Cache-Control"),c.getResponseHeader("Expires"))}else l(new tr(c.statusText,c.status,a.url))},c.send(a.body),{cancel:function(){return c.abort()}}})(e,t)},ii=function(e,t){return qi(Re(e,{type:"arrayBuffer"}),t)},Yt=function(e,t){return qi(Re(e,{method:"POST"}),t)},T="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";_t=[],fi=0;var P=function(e,t){if(Nr.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),fi>=Nt.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:e,callback:t,cancelled:!1,cancel:function(){this.cancelled=!0}};return _t.push(r),r}fi++;var a=!1,l=function(){if(!a)for(a=!0,fi--;_t.length&&fi<Nt.MAX_PARALLEL_IMAGE_REQUESTS;){var h=_t.shift();h.cancelled||(h.cancel=P(h.requestParameters,h.callback).cancel)}},c=ii(e,(function(h,m,g,x){l(),h?t(h):m&&(_e()?(function(S,I){var C=new Y.Blob([new Uint8Array(S)],{type:"image/png"});Y.createImageBitmap(C).then((function(z){I(null,z)})).catch((function(z){I(new Error("Could not load image because of "+z.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}))})(m,t):(function(S,I,C,z){var j=new Y.Image,G=Y.URL;j.onload=function(){I(null,j),G.revokeObjectURL(j.src),j.onload=null,Y.requestAnimationFrame((function(){j.src=T}))},j.onerror=function(){return I(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var te=new Y.Blob([new Uint8Array(S)],{type:"image/png"});j.cacheControl=C,j.expires=z,j.src=S.byteLength?G.createObjectURL(te):T})(m,t,g,x))}));return{cancel:function(){c.cancel(),l()}}};function B(e,t,r){r[e]&&r[e].indexOf(t)!==-1||(r[e]=r[e]||[],r[e].push(t))}function V(e,t,r){if(r&&r[e]){var a=r[e].indexOf(t);a!==-1&&r[e].splice(a,1)}}var Z=function(e,t){t===void 0&&(t={}),Re(this,t),this.type=e},re=(function(e){function t(r,a){a===void 0&&(a={}),e.call(this,"error",Re({error:r},a))}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(Z),ie=function(){};ie.prototype.on=function(e,t){return this._listeners=this._listeners||{},B(e,t,this._listeners),this},ie.prototype.off=function(e,t){return V(e,t,this._listeners),V(e,t,this._oneTimeListeners),this},ie.prototype.once=function(e,t){return this._oneTimeListeners=this._oneTimeListeners||{},B(e,t,this._oneTimeListeners),this},ie.prototype.fire=function(e,t){typeof e=="string"&&(e=new Z(e,t||{}));var r=e.type;if(this.listens(r)){e.target=this;for(var a=0,l=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];a<l.length;a+=1)l[a].call(this,e);for(var c=0,h=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];c<h.length;c+=1){var m=h[c];V(r,m,this._oneTimeListeners),m.call(this,e)}var g=this._eventedParent;g&&(Re(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),g.fire(e))}else e instanceof re&&console.error(e.error);return this},ie.prototype.listens=function(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)},ie.prototype.setEventedParent=function(e,t){return this._eventedParent=e,this._eventedParentData=t,this};var L={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,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:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},H=function(e,t,r,a){this.message=(e?e+": ":"")+r,a&&(this.identifier=a),t!=null&&t.__line__&&(this.line=t.__line__)};function se(e){var t=e.value;return t?[new H(e.key,t,"constants have been deprecated as of v8")]:[]}function Se(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var a=0,l=t;a<l.length;a+=1){var c=l[a];for(var h in c)e[h]=c[h]}return e}function Ee(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function me(e){if(Array.isArray(e))return e.map(me);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){var t={};for(var r in e)t[r]=me(e[r]);return t}return Ee(e)}var Ae=(function(e){function t(r,a){e.call(this,a),this.message=a,this.key=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(Error),Je=function(e,t){t===void 0&&(t=[]),this.parent=e,this.bindings={};for(var r=0,a=t;r<a.length;r+=1){var l=a[r];this.bindings[l[0]]=l[1]}};Je.prototype.concat=function(e){return new Je(this,e)},Je.prototype.get=function(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.")},Je.prototype.has=function(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)};var Ze={kind:"null"},ge={kind:"number"},Ne={kind:"string"},ze={kind:"boolean"},Be={kind:"color"},yt={kind:"object"},qe={kind:"value"},Et={kind:"collator"},rr={kind:"formatted"},Pt={kind:"resolvedImage"};function Gt(e,t){return{kind:"array",itemType:e,N:t}}function Dt(e){if(e.kind==="array"){var t=Dt(e.itemType);return typeof e.N=="number"?"array<"+t+", "+e.N+">":e.itemType.kind==="value"?"array":"array<"+t+">"}return e.kind}var wi=[Ze,ge,Ne,ze,Be,rr,yt,Gt(qe),Pt];function Ht(e,t){if(t.kind==="error")return null;if(e.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!Ht(e.itemType,t.itemType))&&(typeof e.N!="number"||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if(e.kind==="value"){for(var r=0,a=wi;r<a.length;r+=1)if(!Ht(a[r],t))return null}}return"Expected "+Dt(e)+" but found "+Dt(t)+" instead."}function Pr(e,t){return t.some((function(r){return r.kind===e.kind}))}function Qt(e,t){return t.some((function(r){return r==="null"?e===null:r==="array"?Array.isArray(e):r==="object"?e&&!Array.isArray(e)&&typeof e=="object":r===typeof e}))}var Bt=U((function(e,t){var r={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 a(m){return(m=Math.round(m))<0?0:m>255?255:m}function l(m){return a(m[m.length-1]==="%"?parseFloat(m)/100*255:parseInt(m))}function c(m){return(g=m[m.length-1]==="%"?parseFloat(m)/100:parseFloat(m))<0?0:g>1?1:g;var g}function h(m,g,x){return x<0?x+=1:x>1&&(x-=1),6*x<1?m+(g-m)*x*6:2*x<1?g:3*x<2?m+(g-m)*(2/3-x)*6:m}try{t.parseCSSColor=function(m){var g,x=m.replace(/ /g,"").toLowerCase();if(x in r)return r[x].slice();if(x[0]==="#")return x.length===4?(g=parseInt(x.substr(1),16))>=0&&g<=4095?[(3840&g)>>4|(3840&g)>>8,240&g|(240&g)>>4,15&g|(15&g)<<4,1]:null:x.length===7&&(g=parseInt(x.substr(1),16))>=0&&g<=16777215?[(16711680&g)>>16,(65280&g)>>8,255&g,1]:null;var S=x.indexOf("("),I=x.indexOf(")");if(S!==-1&&I+1===x.length){var C=x.substr(0,S),z=x.substr(S+1,I-(S+1)).split(","),j=1;switch(C){case"rgba":if(z.length!==4)return null;j=c(z.pop());case"rgb":return z.length!==3?null:[l(z[0]),l(z[1]),l(z[2]),j];case"hsla":if(z.length!==4)return null;j=c(z.pop());case"hsl":if(z.length!==3)return null;var G=(parseFloat(z[0])%360+360)%360/360,te=c(z[1]),K=c(z[2]),oe=K<=.5?K*(te+1):K+te-K*te,le=2*K-oe;return[a(255*h(le,oe,G+1/3)),a(255*h(le,oe,G)),a(255*h(le,oe,G-1/3)),j];default:return null}}return null}}catch{}})).parseCSSColor,Zt=function(e,t,r,a){a===void 0&&(a=1),this.r=e,this.g=t,this.b=r,this.a=a};Zt.parse=function(e){if(e){if(e instanceof Zt)return e;if(typeof e=="string"){var t=Bt(e);if(t)return new Zt(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},Zt.prototype.toString=function(){var e=this.toArray(),t=e[1],r=e[2],a=e[3];return"rgba("+Math.round(e[0])+","+Math.round(t)+","+Math.round(r)+","+a+")"},Zt.prototype.toArray=function(){var e=this.a;return e===0?[0,0,0,0]:[255*this.r/e,255*this.g/e,255*this.b/e,e]},Zt.black=new Zt(0,0,0,1),Zt.white=new Zt(1,1,1,1),Zt.transparent=new Zt(0,0,0,0),Zt.red=new Zt(1,0,0,1);var zi=function(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};zi.prototype.compare=function(e,t){return this.collator.compare(e,t)},zi.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var ma=function(e,t,r,a,l){this.text=e,this.image=t,this.scale=r,this.fontStack=a,this.textColor=l},ni=function(e){this.sections=e};ni.fromString=function(e){return new ni([new ma(e,null,null,null,null)])},ni.prototype.isEmpty=function(){return this.sections.length===0||!this.sections.some((function(e){return e.text.length!==0||e.image&&e.image.name.length!==0}))},ni.factory=function(e){return e instanceof ni?e:ni.fromString(e)},ni.prototype.toString=function(){return this.sections.length===0?"":this.sections.map((function(e){return e.text})).join("")},ni.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var a=r[t];if(a.image)e.push(["image",a.image.name]);else{e.push(a.text);var l={};a.fontStack&&(l["text-font"]=["literal",a.fontStack.split(",")]),a.scale&&(l["font-scale"]=a.scale),a.textColor&&(l["text-color"]=["rgba"].concat(a.textColor.toArray())),e.push(l)}}return e};var Di=function(e){this.name=e.name,this.available=e.available};function eu(e,t,r,a){return typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof r=="number"&&r>=0&&r<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:"Invalid rgba value ["+[e,t,r,a].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+(typeof a=="number"?[e,t,r,a]:[e,t,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ya(e){if(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||e instanceof Zt||e instanceof zi||e instanceof ni||e instanceof Di)return!0;if(Array.isArray(e)){for(var t=0,r=e;t<r.length;t+=1)if(!ya(r[t]))return!1;return!0}if(typeof e=="object"){for(var a in e)if(!ya(e[a]))return!1;return!0}return!1}function Cr(e){if(e===null)return Ze;if(typeof e=="string")return Ne;if(typeof e=="boolean")return ze;if(typeof e=="number")return ge;if(e instanceof Zt)return Be;if(e instanceof zi)return Et;if(e instanceof ni)return rr;if(e instanceof Di)return Pt;if(Array.isArray(e)){for(var t,r=e.length,a=0,l=e;a<l.length;a+=1){var c=Cr(l[a]);if(t){if(t===c)continue;t=qe;break}t=c}return Gt(t||qe,r)}return yt}function va(e){var t=typeof e;return e===null?"":t==="string"||t==="number"||t==="boolean"?String(e):e instanceof Zt||e instanceof ni||e instanceof Di?e.toString():JSON.stringify(e)}Di.prototype.toString=function(){return this.name},Di.fromString=function(e){return e?new Di({name:e,available:!1}):null},Di.prototype.serialize=function(){return["image",this.name]};var Si=function(e,t){this.type=e,this.value=t};Si.parse=function(e,t){if(e.length!==2)return t.error("'literal' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(!ya(e[1]))return t.error("invalid value");var r=e[1],a=Cr(r),l=t.expectedType;return a.kind!=="array"||a.N!==0||!l||l.kind!=="array"||typeof l.N=="number"&&l.N!==0||(a=l),new Si(a,r)},Si.prototype.evaluate=function(){return this.value},Si.prototype.eachChild=function(){},Si.prototype.outputDefined=function(){return!0},Si.prototype.serialize=function(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Zt?["rgba"].concat(this.value.toArray()):this.value instanceof ni?this.value.serialize():this.value};var oi=function(e){this.name="ExpressionEvaluationError",this.message=e};oi.prototype.toJSON=function(){return this.message};var nn={string:Ne,number:ge,boolean:ze,object:yt},yr=function(e,t){this.type=e,this.args=t};yr.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r,a=1,l=e[0];if(l==="array"){var c,h;if(e.length>2){var m=e[1];if(typeof m!="string"||!(m in nn)||m==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);c=nn[m],a++}else c=qe;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);h=e[2],a++}r=Gt(c,h)}else r=nn[l];for(var g=[];a<e.length;a++){var x=t.parse(e[a],a,qe);if(!x)return null;g.push(x)}return new yr(r,g)},yr.prototype.evaluate=function(e){for(var t=0;t<this.args.length;t++){var r=this.args[t].evaluate(e);if(!Ht(this.type,Cr(r)))return r;if(t===this.args.length-1)throw new oi("Expected value to be of type "+Dt(this.type)+", but found "+Dt(Cr(r))+" instead.")}return null},yr.prototype.eachChild=function(e){this.args.forEach(e)},yr.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},yr.prototype.serialize=function(){var e=this.type,t=[e.kind];if(e.kind==="array"){var r=e.itemType;if(r.kind==="string"||r.kind==="number"||r.kind==="boolean"){t.push(r.kind);var a=e.N;(typeof a=="number"||this.args.length>1)&&t.push(a)}}return t.concat(this.args.map((function(l){return l.serialize()})))};var yn=function(e){this.type=rr,this.sections=e};yn.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[1];if(!Array.isArray(r)&&typeof r=="object")return t.error("First argument must be an image or text section.");for(var a=[],l=!1,c=1;c<=e.length-1;++c){var h=e[c];if(l&&typeof h=="object"&&!Array.isArray(h)){l=!1;var m=null;if(h["font-scale"]&&!(m=t.parse(h["font-scale"],1,ge)))return null;var g=null;if(h["text-font"]&&!(g=t.parse(h["text-font"],1,Gt(Ne))))return null;var x=null;if(h["text-color"]&&!(x=t.parse(h["text-color"],1,Be)))return null;var S=a[a.length-1];S.scale=m,S.font=g,S.textColor=x}else{var I=t.parse(e[c],1,qe);if(!I)return null;var C=I.type.kind;if(C!=="string"&&C!=="value"&&C!=="null"&&C!=="resolvedImage")return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");l=!0,a.push({content:I,scale:null,font:null,textColor:null})}}return new yn(a)},yn.prototype.evaluate=function(e){return new ni(this.sections.map((function(t){var r=t.content.evaluate(e);return Cr(r)===Pt?new ma("",r,null,null,null):new ma(va(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))},yn.prototype.eachChild=function(e){for(var t=0,r=this.sections;t<r.length;t+=1){var a=r[t];e(a.content),a.scale&&e(a.scale),a.font&&e(a.font),a.textColor&&e(a.textColor)}},yn.prototype.outputDefined=function(){return!1},yn.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var a=r[t];e.push(a.content.serialize());var l={};a.scale&&(l["font-scale"]=a.scale.serialize()),a.font&&(l["text-font"]=a.font.serialize()),a.textColor&&(l["text-color"]=a.textColor.serialize()),e.push(l)}return e};var Ji=function(e){this.type=Pt,this.input=e};Ji.parse=function(e,t){if(e.length!==2)return t.error("Expected two arguments.");var r=t.parse(e[1],1,Ne);return r?new Ji(r):t.error("No image name provided.")},Ji.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=Di.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r},Ji.prototype.eachChild=function(e){e(this.input)},Ji.prototype.outputDefined=function(){return!1},Ji.prototype.serialize=function(){return["image",this.input.serialize()]};var il={"to-boolean":ze,"to-color":Be,"to-number":ge,"to-string":Ne},on=function(e,t){this.type=e,this.args=t};on.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[0];if((r==="to-boolean"||r==="to-string")&&e.length!==2)return t.error("Expected one argument.");for(var a=il[r],l=[],c=1;c<e.length;c++){var h=t.parse(e[c],c,qe);if(!h)return null;l.push(h)}return new on(a,l)},on.prototype.evaluate=function(e){if(this.type.kind==="boolean")return!!this.args[0].evaluate(e);if(this.type.kind==="color"){for(var t,r,a=0,l=this.args;a<l.length;a+=1){if(r=null,(t=l[a].evaluate(e))instanceof Zt)return t;if(typeof t=="string"){var c=e.parseColor(t);if(c)return c}else if(Array.isArray(t)&&!(r=t.length<3||t.length>4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":eu(t[0],t[1],t[2],t[3])))return new Zt(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new oi(r||"Could not parse color from value '"+(typeof t=="string"?t:String(JSON.stringify(t)))+"'")}if(this.type.kind==="number"){for(var h=null,m=0,g=this.args;m<g.length;m+=1){if((h=g[m].evaluate(e))===null)return 0;var x=Number(h);if(!isNaN(x))return x}throw new oi("Could not convert "+JSON.stringify(h)+" to number.")}return this.type.kind==="formatted"?ni.fromString(va(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?Di.fromString(va(this.args[0].evaluate(e))):va(this.args[0].evaluate(e))},on.prototype.eachChild=function(e){this.args.forEach(e)},on.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},on.prototype.serialize=function(){if(this.type.kind==="formatted")return new yn([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Ji(this.args[0]).serialize();var e=["to-"+this.type.kind];return this.eachChild((function(t){e.push(t.serialize())})),e};var Pc=["Unknown","Point","LineString","Polygon"],Dn=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};Dn.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},Dn.prototype.geometryType=function(){return this.feature?typeof this.feature.type=="number"?Pc[this.feature.type]:this.feature.type:null},Dn.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Dn.prototype.canonicalID=function(){return this.canonical},Dn.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Dn.prototype.parseColor=function(e){var t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=Zt.parse(e)),t};var di=function(e,t,r,a){this.name=e,this.type=t,this._evaluate=r,this.args=a};di.prototype.evaluate=function(e){return this._evaluate(e,this.args)},di.prototype.eachChild=function(e){this.args.forEach(e)},di.prototype.outputDefined=function(){return!1},di.prototype.serialize=function(){return[this.name].concat(this.args.map((function(e){return e.serialize()})))},di.parse=function(e,t){var r,a=e[0],l=di.definitions[a];if(!l)return t.error('Unknown expression "'+a+'". If you wanted a literal array, use ["literal", [...]].',0);for(var c=Array.isArray(l)?l[0]:l.type,h=Array.isArray(l)?[[l[1],l[2]]]:l.overloads,m=h.filter((function(ot){var je=ot[0];return!Array.isArray(je)||je.length===e.length-1})),g=null,x=0,S=m;x<S.length;x+=1){var I=S[x],C=I[0],z=I[1];g=new Wn(t.registry,t.path,null,t.scope);for(var j=[],G=!1,te=1;te<e.length;te++){var K=e[te],oe=Array.isArray(C)?C[te-1]:C.type,le=g.parse(K,1+j.length,oe);if(!le){G=!0;break}j.push(le)}if(!G)if(Array.isArray(C)&&C.length!==j.length)g.error("Expected "+C.length+" arguments, but found "+j.length+" instead.");else{for(var ce=0;ce<j.length;ce++){var he=Array.isArray(C)?C[ce]:C.type,xe=j[ce];g.concat(ce+1).checkSubtype(he,xe.type)}if(g.errors.length===0)return new di(a,c,z,j)}}if(m.length===1)(r=t.errors).push.apply(r,g.errors);else{for(var Pe=(m.length?m:h).map((function(ot){var je;return je=ot[0],Array.isArray(je)?"("+je.map(Dt).join(", ")+")":"("+Dt(je.type)+"...)"})).join(" | "),De=[],rt=1;rt<e.length;rt++){var Ue=t.parse(e[rt],1+De.length);if(!Ue)return null;De.push(Dt(Ue.type))}t.error("Expected arguments of type "+Pe+", but found ("+De.join(", ")+") instead.")}return null},di.register=function(e,t){for(var r in di.definitions=t,t)e[r]=di};var In=function(e,t,r){this.type=Et,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t};function Ii(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function vo(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function Cc(e,t){var r=(180+e[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,l=Math.pow(2,t.z);return[Math.round(r*l*8192),Math.round(a*l*8192)]}function kc(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function tu(e,t){for(var r,a,l,c,h,m,g,x=!1,S=0,I=t.length;S<I;S++)for(var C=t[S],z=0,j=C.length;z<j-1;z++){if((c=(r=e)[0]-(a=C[z])[0])*(g=r[1]-(l=C[z+1])[1])-(m=r[0]-l[0])*(h=r[1]-a[1])==0&&c*m<=0&&h*g<=0)return!1;kc(e,C[z],C[z+1])&&(x=!x)}return x}function Mc(e,t){for(var r=0;r<t.length;r++)if(tu(e,t[r]))return!0;return!1}function nl(e,t,r,a){var l=a[0]-r[0],c=a[1]-r[1],h=(e[0]-r[0])*c-l*(e[1]-r[1]),m=(t[0]-r[0])*c-l*(t[1]-r[1]);return h>0&&m<0||h<0&&m>0}function Bc(e,t,r){for(var a=0,l=r;a<l.length;a+=1)for(var c=l[a],h=0;h<c.length-1;++h)if((I=[(S=c[h+1])[0]-(x=c[h])[0],S[1]-x[1]])[0]*(C=[(g=t)[0]-(m=e)[0],g[1]-m[1]])[1]-I[1]*C[0]!=0&&nl(m,g,x,S)&&nl(x,S,m,g))return!0;var m,g,x,S,I,C;return!1}function ol(e,t){for(var r=0;r<e.length;++r)if(!tu(e[r],t))return!1;for(var a=0;a<e.length-1;++a)if(Bc(e[a],e[a+1],t))return!1;return!0}function al(e,t){for(var r=0;r<t.length;r++)if(ol(e,t[r]))return!0;return!1}function Wo(e,t,r){for(var a=[],l=0;l<e.length;l++){for(var c=[],h=0;h<e[l].length;h++){var m=Cc(e[l][h],r);Ii(t,m),c.push(m)}a.push(c)}return a}function ru(e,t,r){for(var a=[],l=0;l<e.length;l++){var c=Wo(e[l],t,r);a.push(c)}return a}function ga(e,t,r,a){if(e[0]<r[0]||e[0]>r[2]){var l=.5*a,c=e[0]-r[0]>l?-a:r[0]-e[0]>l?a:0;c===0&&(c=e[0]-r[2]>l?-a:r[2]-e[0]>l?a:0),e[0]+=c}Ii(t,e)}function sl(e,t,r,a){for(var l=8192*Math.pow(2,a.z),c=[8192*a.x,8192*a.y],h=[],m=0,g=e;m<g.length;m+=1)for(var x=0,S=g[m];x<S.length;x+=1){var I=S[x],C=[I.x+c[0],I.y+c[1]];ga(C,t,r,l),h.push(C)}return h}function Qa(e,t,r,a){for(var l,c=8192*Math.pow(2,a.z),h=[8192*a.x,8192*a.y],m=[],g=0,x=e;g<x.length;g+=1){for(var S=[],I=0,C=x[g];I<C.length;I+=1){var z=C[I],j=[z.x+h[0],z.y+h[1]];Ii(t,j),S.push(j)}m.push(S)}if(t[2]-t[0]<=c/2){(l=t)[0]=l[1]=1/0,l[2]=l[3]=-1/0;for(var G=0,te=m;G<te.length;G+=1)for(var K=0,oe=te[G];K<oe.length;K+=1)ga(oe[K],t,r,c)}return m}In.parse=function(e,t){if(e.length!==2)return t.error("Expected one argument.");var r=e[1];if(typeof r!="object"||Array.isArray(r))return t.error("Collator options argument must be an object.");var a=t.parse(r["case-sensitive"]!==void 0&&r["case-sensitive"],1,ze);if(!a)return null;var l=t.parse(r["diacritic-sensitive"]!==void 0&&r["diacritic-sensitive"],1,ze);if(!l)return null;var c=null;return r.locale&&!(c=t.parse(r.locale,1,Ne))?null:new In(a,l,c)},In.prototype.evaluate=function(e){return new zi(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)},In.prototype.eachChild=function(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)},In.prototype.outputDefined=function(){return!1},In.prototype.serialize=function(){var e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]};var an=function(e,t){this.type=ze,this.geojson=e,this.geometries=t};function Gn(e){if(e instanceof di&&(e.name==="get"&&e.args.length===1||e.name==="feature-state"||e.name==="has"&&e.args.length===1||e.name==="properties"||e.name==="geometry-type"||e.name==="id"||/^filter-/.test(e.name))||e instanceof an)return!1;var t=!0;return e.eachChild((function(r){t&&!Gn(r)&&(t=!1)})),t}function Zn(e){if(e instanceof di&&e.name==="feature-state")return!1;var t=!0;return e.eachChild((function(r){t&&!Zn(r)&&(t=!1)})),t}function go(e,t){if(e instanceof di&&t.indexOf(e.name)>=0)return!1;var r=!0;return e.eachChild((function(a){r&&!go(a,t)&&(r=!1)})),r}an.parse=function(e,t){if(e.length!==2)return t.error("'within' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(ya(e[1])){var r=e[1];if(r.type==="FeatureCollection")for(var a=0;a<r.features.length;++a){var l=r.features[a].geometry.type;if(l==="Polygon"||l==="MultiPolygon")return new an(r,r.features[a].geometry)}else if(r.type==="Feature"){var c=r.geometry.type;if(c==="Polygon"||c==="MultiPolygon")return new an(r,r.geometry)}else if(r.type==="Polygon"||r.type==="MultiPolygon")return new an(r,r)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")},an.prototype.evaluate=function(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return(function(t,r){var a=[1/0,1/0,-1/0,-1/0],l=[1/0,1/0,-1/0,-1/0],c=t.canonicalID();if(r.type==="Polygon"){var h=Wo(r.coordinates,l,c),m=sl(t.geometry(),a,l,c);if(!vo(a,l))return!1;for(var g=0,x=m;g<x.length;g+=1)if(!tu(x[g],h))return!1}if(r.type==="MultiPolygon"){var S=ru(r.coordinates,l,c),I=sl(t.geometry(),a,l,c);if(!vo(a,l))return!1;for(var C=0,z=I;C<z.length;C+=1)if(!Mc(z[C],S))return!1}return!0})(e,this.geometries);if(e.geometryType()==="LineString")return(function(t,r){var a=[1/0,1/0,-1/0,-1/0],l=[1/0,1/0,-1/0,-1/0],c=t.canonicalID();if(r.type==="Polygon"){var h=Wo(r.coordinates,l,c),m=Qa(t.geometry(),a,l,c);if(!vo(a,l))return!1;for(var g=0,x=m;g<x.length;g+=1)if(!ol(x[g],h))return!1}if(r.type==="MultiPolygon"){var S=ru(r.coordinates,l,c),I=Qa(t.geometry(),a,l,c);if(!vo(a,l))return!1;for(var C=0,z=I;C<z.length;C+=1)if(!al(z[C],S))return!1}return!0})(e,this.geometries)}return!1},an.prototype.eachChild=function(){},an.prototype.outputDefined=function(){return!0},an.prototype.serialize=function(){return["within",this.geojson]};var $n=function(e,t){this.type=t.type,this.name=e,this.boundExpression=t};$n.parse=function(e,t){if(e.length!==2||typeof e[1]!="string")return t.error("'var' expression requires exactly one string literal argument.");var r=e[1];return t.scope.has(r)?new $n(r,t.scope.get(r)):t.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},$n.prototype.evaluate=function(e){return this.boundExpression.evaluate(e)},$n.prototype.eachChild=function(){},$n.prototype.outputDefined=function(){return!1},$n.prototype.serialize=function(){return["var",this.name]};var Wn=function(e,t,r,a,l){t===void 0&&(t=[]),a===void 0&&(a=new Je),l===void 0&&(l=[]),this.registry=e,this.path=t,this.key=t.map((function(c){return"["+c+"]"})).join(""),this.scope=a,this.errors=l,this.expectedType=r};function es(e,t){for(var r,a=e.length-1,l=0,c=a,h=0;l<=c;)if((r=e[h=Math.floor((l+c)/2)])<=t){if(h===a||t<e[h+1])return h;l=h+1}else{if(!(r>t))throw new oi("Input is not a number.");c=h-1}return 0}Wn.prototype.parse=function(e,t,r,a,l){return l===void 0&&(l={}),t?this.concat(t,r,a)._parse(e,l):this._parse(e,l)},Wn.prototype._parse=function(e,t){function r(x,S,I){return I==="assert"?new yr(S,[x]):I==="coerce"?new on(S,[x]):x}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", []].');var a=e[0];if(typeof a!="string")return this.error("Expression name must be a string, but found "+typeof a+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var l=this.registry[a];if(l){var c=l.parse(e,this);if(!c)return null;if(this.expectedType){var h=this.expectedType,m=c.type;if(h.kind!=="string"&&h.kind!=="number"&&h.kind!=="boolean"&&h.kind!=="object"&&h.kind!=="array"||m.kind!=="value")if(h.kind!=="color"&&h.kind!=="formatted"&&h.kind!=="resolvedImage"||m.kind!=="value"&&m.kind!=="string"){if(this.checkSubtype(h,m))return null}else c=r(c,h,t.typeAnnotation||"coerce");else c=r(c,h,t.typeAnnotation||"assert")}if(!(c instanceof Si)&&c.type.kind!=="resolvedImage"&&(function x(S){if(S instanceof $n)return x(S.boundExpression);if(S instanceof di&&S.name==="error"||S instanceof In||S instanceof an)return!1;var I=S instanceof on||S instanceof yr,C=!0;return S.eachChild((function(z){C=I?C&&x(z):C&&z instanceof Si})),!!C&&Gn(S)&&go(S,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])})(c)){var g=new Dn;try{c=new Si(c.type,c.evaluate(g))}catch(x){return this.error(x.message),null}}return c}return this.error('Unknown expression "'+a+'". 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.")},Wn.prototype.concat=function(e,t,r){var a=typeof e=="number"?this.path.concat(e):this.path,l=r?this.scope.concat(r):this.scope;return new Wn(this.registry,a,t||null,l,this.errors)},Wn.prototype.error=function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];var a=""+this.key+t.map((function(l){return"["+l+"]"})).join("");this.errors.push(new Ae(a,e))},Wn.prototype.checkSubtype=function(e,t){var r=Ht(e,t);return r&&this.error(r),r};var Ui=function(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var a=0,l=r;a<l.length;a+=1){var c=l[a],h=c[1];this.labels.push(c[0]),this.outputs.push(h)}};function Vr(e,t,r){return e*(1-r)+t*r}Ui.parse=function(e,t){if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");var r=t.parse(e[1],1,ge);if(!r)return null;var a=[],l=null;t.expectedType&&t.expectedType.kind!=="value"&&(l=t.expectedType);for(var c=1;c<e.length;c+=2){var h=c===1?-1/0:e[c],m=e[c+1],g=c,x=c+1;if(typeof h!="number")return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',g);if(a.length&&a[a.length-1][0]>=h)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',g);var S=t.parse(m,x,l);if(!S)return null;l=l||S.type,a.push([h,S])}return new Ui(l,r,a)},Ui.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(t.length===1)return r[0].evaluate(e);var a=this.input.evaluate(e);if(a<=t[0])return r[0].evaluate(e);var l=t.length;return a>=t[l-1]?r[l-1].evaluate(e):r[es(t,a)].evaluate(e)},Ui.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1)e(r[t])},Ui.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))},Ui.prototype.serialize=function(){for(var e=["step",this.input.serialize()],t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var Ho=Object.freeze({__proto__:null,number:Vr,color:function(e,t,r){return new Zt(Vr(e.r,t.r,r),Vr(e.g,t.g,r),Vr(e.b,t.b,r),Vr(e.a,t.a,r))},array:function(e,t,r){return e.map((function(a,l){return Vr(a,t[l],r)}))}}),ul=6/29*3*(6/29),zc=Math.PI/180,Dc=180/Math.PI;function iu(e){return e>.008856451679035631?Math.pow(e,1/3):e/ul+4/29}function nu(e){return e>6/29?e*e*e:ul*(e-4/29)}function ou(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function au(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ll(e){var t=au(e.r),r=au(e.g),a=au(e.b),l=iu((.4124564*t+.3575761*r+.1804375*a)/.95047),c=iu((.2126729*t+.7151522*r+.072175*a)/1);return{l:116*c-16,a:500*(l-c),b:200*(c-iu((.0193339*t+.119192*r+.9503041*a)/1.08883)),alpha:e.a}}function cl(e){var t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,a=isNaN(e.b)?t:t-e.b/200;return t=1*nu(t),r=.95047*nu(r),a=1.08883*nu(a),new Zt(ou(3.2404542*r-1.5371385*t-.4985314*a),ou(-.969266*r+1.8760108*t+.041556*a),ou(.0556434*r-.2040259*t+1.0572252*a),e.alpha)}function Rc(e,t,r){var a=t-e;return e+r*(a>180||a<-180?a-360*Math.round(a/360):a)}var _a={forward:ll,reverse:cl,interpolate:function(e,t,r){return{l:Vr(e.l,t.l,r),a:Vr(e.a,t.a,r),b:Vr(e.b,t.b,r),alpha:Vr(e.alpha,t.alpha,r)}}},xa={forward:function(e){var t=ll(e),r=t.l,a=t.a,l=t.b,c=Math.atan2(l,a)*Dc;return{h:c<0?c+360:c,c:Math.sqrt(a*a+l*l),l:r,alpha:e.a}},reverse:function(e){var t=e.h*zc,r=e.c;return cl({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:Rc(e.h,t.h,r),c:Vr(e.c,t.c,r),l:Vr(e.l,t.l,r),alpha:Vr(e.alpha,t.alpha,r)}}},pl=Object.freeze({__proto__:null,lab:_a,hcl:xa}),mi=function(e,t,r,a,l){this.type=e,this.operator=t,this.interpolation=r,this.input=a,this.labels=[],this.outputs=[];for(var c=0,h=l;c<h.length;c+=1){var m=h[c],g=m[1];this.labels.push(m[0]),this.outputs.push(g)}};function su(e,t,r,a){var l=a-r,c=e-r;return l===0?0:t===1?c/l:(Math.pow(t,c)-1)/(Math.pow(t,l)-1)}mi.interpolationFactor=function(e,t,r,a){var l=0;if(e.name==="exponential")l=su(t,e.base,r,a);else if(e.name==="linear")l=su(t,1,r,a);else if(e.name==="cubic-bezier"){var c=e.controlPoints;l=new k(c[0],c[1],c[2],c[3]).solve(su(t,1,r,a))}return l},mi.parse=function(e,t){var r=e[0],a=e[1],l=e[2],c=e.slice(3);if(!Array.isArray(a)||a.length===0)return t.error("Expected an interpolation type expression.",1);if(a[0]==="linear")a={name:"linear"};else if(a[0]==="exponential"){var h=a[1];if(typeof h!="number")return t.error("Exponential interpolation requires a numeric base.",1,1);a={name:"exponential",base:h}}else{if(a[0]!=="cubic-bezier")return t.error("Unknown interpolation type "+String(a[0]),1,0);var m=a.slice(1);if(m.length!==4||m.some((function(te){return typeof te!="number"||te<0||te>1})))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:m}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(!(l=t.parse(l,2,ge)))return null;var g=[],x=null;r==="interpolate-hcl"||r==="interpolate-lab"?x=Be:t.expectedType&&t.expectedType.kind!=="value"&&(x=t.expectedType);for(var S=0;S<c.length;S+=2){var I=c[S],C=c[S+1],z=S+3,j=S+4;if(typeof I!="number")return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',z);if(g.length&&g[g.length-1][0]>=I)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',z);var G=t.parse(C,j,x);if(!G)return null;x=x||G.type,g.push([I,G])}return x.kind==="number"||x.kind==="color"||x.kind==="array"&&x.itemType.kind==="number"&&typeof x.N=="number"?new mi(x,r,a,l,g):t.error("Type "+Dt(x)+" is not interpolatable.")},mi.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(t.length===1)return r[0].evaluate(e);var a=this.input.evaluate(e);if(a<=t[0])return r[0].evaluate(e);var l=t.length;if(a>=t[l-1])return r[l-1].evaluate(e);var c=es(t,a),h=mi.interpolationFactor(this.interpolation,a,t[c],t[c+1]),m=r[c].evaluate(e),g=r[c+1].evaluate(e);return this.operator==="interpolate"?Ho[this.type.kind.toLowerCase()](m,g,h):this.operator==="interpolate-hcl"?xa.reverse(xa.interpolate(xa.forward(m),xa.forward(g),h)):_a.reverse(_a.interpolate(_a.forward(m),_a.forward(g),h))},mi.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1)e(r[t])},mi.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))},mi.prototype.serialize=function(){var 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);for(var t=[this.operator,e,this.input.serialize()],r=0;r<this.labels.length;r++)t.push(this.labels[r],this.outputs[r].serialize());return t};var Hn=function(e,t){this.type=e,this.args=t};Hn.parse=function(e,t){if(e.length<2)return t.error("Expectected at least one argument.");var r=null,a=t.expectedType;a&&a.kind!=="value"&&(r=a);for(var l=[],c=0,h=e.slice(1);c<h.length;c+=1){var m=t.parse(h[c],1+l.length,r,void 0,{typeAnnotation:"omit"});if(!m)return null;r=r||m.type,l.push(m)}var g=a&&l.some((function(x){return Ht(a,x.type)}));return new Hn(g?qe:r,l)},Hn.prototype.evaluate=function(e){for(var t,r=null,a=0,l=0,c=this.args;l<c.length&&(a++,(r=c[l].evaluate(e))&&r instanceof Di&&!r.available&&(t||(t=r.name),r=null,a===this.args.length&&(r=t)),r===null);l+=1);return r},Hn.prototype.eachChild=function(e){this.args.forEach(e)},Hn.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},Hn.prototype.serialize=function(){var e=["coalesce"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Xn=function(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t};Xn.prototype.evaluate=function(e){return this.result.evaluate(e)},Xn.prototype.eachChild=function(e){for(var t=0,r=this.bindings;t<r.length;t+=1)e(r[t][1]);e(this.result)},Xn.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found "+(e.length-1)+" instead.");for(var r=[],a=1;a<e.length-1;a+=2){var l=e[a];if(typeof l!="string")return t.error("Expected string, but found "+typeof l+" instead.",a);if(/[^a-zA-Z0-9_]/.test(l))return t.error("Variable names must contain only alphanumeric characters or '_'.",a);var c=t.parse(e[a+1],a+1);if(!c)return null;r.push([l,c])}var h=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return h?new Xn(r,h):null},Xn.prototype.outputDefined=function(){return this.result.outputDefined()},Xn.prototype.serialize=function(){for(var e=["let"],t=0,r=this.bindings;t<r.length;t+=1){var a=r[t];e.push(a[0],a[1].serialize())}return e.push(this.result.serialize()),e};var _o=function(e,t,r){this.type=e,this.index=t,this.input=r};_o.parse=function(e,t){if(e.length!==3)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,ge),a=t.parse(e[2],2,Gt(t.expectedType||qe));return r&&a?new _o(a.type.itemType,r,a):null},_o.prototype.evaluate=function(e){var t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new oi("Array index out of bounds: "+t+" < 0.");if(t>=r.length)throw new oi("Array index out of bounds: "+t+" > "+(r.length-1)+".");if(t!==Math.floor(t))throw new oi("Array index must be an integer, but found "+t+" instead.");return r[t]},_o.prototype.eachChild=function(e){e(this.index),e(this.input)},_o.prototype.outputDefined=function(){return!1},_o.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var xo=function(e,t){this.type=ze,this.needle=e,this.haystack=t};xo.parse=function(e,t){if(e.length!==3)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,qe),a=t.parse(e[2],2,qe);return r&&a?Pr(r.type,[ze,Ne,ge,Ze,qe])?new xo(r,a):t.error("Expected first argument to be of type boolean, string, number or null, but found "+Dt(r.type)+" instead"):null},xo.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!Qt(t,["boolean","string","number","null"]))throw new oi("Expected first argument to be of type boolean, string, number or null, but found "+Dt(Cr(t))+" instead.");if(!Qt(r,["string","array"]))throw new oi("Expected second argument to be of type array or string, but found "+Dt(Cr(r))+" instead.");return r.indexOf(t)>=0},xo.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},xo.prototype.outputDefined=function(){return!0},xo.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Kn=function(e,t,r){this.type=ge,this.needle=e,this.haystack=t,this.fromIndex=r};Kn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,qe),a=t.parse(e[2],2,qe);if(!r||!a)return null;if(!Pr(r.type,[ze,Ne,ge,Ze,qe]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+Dt(r.type)+" instead");if(e.length===4){var l=t.parse(e[3],3,ge);return l?new Kn(r,a,l):null}return new Kn(r,a)},Kn.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!Qt(t,["boolean","string","number","null"]))throw new oi("Expected first argument to be of type boolean, string, number or null, but found "+Dt(Cr(t))+" instead.");if(!Qt(r,["string","array"]))throw new oi("Expected second argument to be of type array or string, but found "+Dt(Cr(r))+" instead.");if(this.fromIndex){var a=this.fromIndex.evaluate(e);return r.indexOf(t,a)}return r.indexOf(t)},Kn.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},Kn.prototype.outputDefined=function(){return!1},Kn.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var bo=function(e,t,r,a,l,c){this.inputType=e,this.type=t,this.input=r,this.cases=a,this.outputs=l,this.otherwise=c};bo.parse=function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if(e.length%2!=1)return t.error("Expected an even number of arguments.");var r,a;t.expectedType&&t.expectedType.kind!=="value"&&(a=t.expectedType);for(var l={},c=[],h=2;h<e.length-1;h+=2){var m=e[h],g=e[h+1];Array.isArray(m)||(m=[m]);var x=t.concat(h);if(m.length===0)return x.error("Expected at least one branch label.");for(var S=0,I=m;S<I.length;S+=1){var C=I[S];if(typeof C!="number"&&typeof C!="string")return x.error("Branch labels must be numbers or strings.");if(typeof C=="number"&&Math.abs(C)>Number.MAX_SAFE_INTEGER)return x.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof C=="number"&&Math.floor(C)!==C)return x.error("Numeric branch labels must be integer values.");if(r){if(x.checkSubtype(r,Cr(C)))return null}else r=Cr(C);if(l[String(C)]!==void 0)return x.error("Branch labels must be unique.");l[String(C)]=c.length}var z=t.parse(g,h,a);if(!z)return null;a=a||z.type,c.push(z)}var j=t.parse(e[1],1,qe);if(!j)return null;var G=t.parse(e[e.length-1],e.length-1,a);return G?j.type.kind!=="value"&&t.concat(1).checkSubtype(r,j.type)?null:new bo(r,a,j,l,c,G):null},bo.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(Cr(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},bo.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},bo.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))&&this.otherwise.outputDefined()},bo.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],r=[],a={},l=0,c=Object.keys(this.cases).sort();l<c.length;l+=1){var h=c[l];(I=a[this.cases[h]])===void 0?(a[this.cases[h]]=r.length,r.push([this.cases[h],[h]])):r[I][1].push(h)}for(var m=function(z){return e.inputType.kind==="number"?Number(z):z},g=0,x=r;g<x.length;g+=1){var S=x[g],I=S[0],C=S[1];t.push(C.length===1?m(C[0]):C.map(m)),t.push(this.outputs[outputIndex$1].serialize())}return t.push(this.otherwise.serialize()),t};var wo=function(e,t,r){this.type=e,this.branches=t,this.otherwise=r};wo.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found only "+(e.length-1)+".");if(e.length%2!=0)return t.error("Expected an odd number of arguments.");var r;t.expectedType&&t.expectedType.kind!=="value"&&(r=t.expectedType);for(var a=[],l=1;l<e.length-1;l+=2){var c=t.parse(e[l],l,ze);if(!c)return null;var h=t.parse(e[l+1],l+1,r);if(!h)return null;a.push([c,h]),r=r||h.type}var m=t.parse(e[e.length-1],e.length-1,r);return m?new wo(r,a,m):null},wo.prototype.evaluate=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var a=r[t],l=a[1];if(a[0].evaluate(e))return l.evaluate(e)}return this.otherwise.evaluate(e)},wo.prototype.eachChild=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var a=r[t],l=a[1];e(a[0]),e(l)}e(this.otherwise)},wo.prototype.outputDefined=function(){return this.branches.every((function(e){return e[1].outputDefined()}))&&this.otherwise.outputDefined()},wo.prototype.serialize=function(){var e=["case"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Jn=function(e,t,r,a){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=a};function hl(e,t){return e==="=="||e==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function fl(e,t,r,a){return a.compare(t,r)===0}function ir(e,t,r){var a=e!=="=="&&e!=="!=";return(function(){function l(c,h,m){this.type=ze,this.lhs=c,this.rhs=h,this.collator=m,this.hasUntypedArgument=c.type.kind==="value"||h.type.kind==="value"}return l.parse=function(c,h){if(c.length!==3&&c.length!==4)return h.error("Expected two or three arguments.");var m=c[0],g=h.parse(c[1],1,qe);if(!g)return null;if(!hl(m,g.type))return h.concat(1).error('"'+m+`" comparisons are not supported for type '`+Dt(g.type)+"'.");var x=h.parse(c[2],2,qe);if(!x)return null;if(!hl(m,x.type))return h.concat(2).error('"'+m+`" comparisons are not supported for type '`+Dt(x.type)+"'.");if(g.type.kind!==x.type.kind&&g.type.kind!=="value"&&x.type.kind!=="value")return h.error("Cannot compare types '"+Dt(g.type)+"' and '"+Dt(x.type)+"'.");a&&(g.type.kind==="value"&&x.type.kind!=="value"?g=new yr(x.type,[g]):g.type.kind!=="value"&&x.type.kind==="value"&&(x=new yr(g.type,[x])));var S=null;if(c.length===4){if(g.type.kind!=="string"&&x.type.kind!=="string"&&g.type.kind!=="value"&&x.type.kind!=="value")return h.error("Cannot use collator to compare non-string types.");if(!(S=h.parse(c[3],3,Et)))return null}return new l(g,x,S)},l.prototype.evaluate=function(c){var h=this.lhs.evaluate(c),m=this.rhs.evaluate(c);if(a&&this.hasUntypedArgument){var g=Cr(h),x=Cr(m);if(g.kind!==x.kind||g.kind!=="string"&&g.kind!=="number")throw new oi('Expected arguments for "'+e+'" to be (string, string) or (number, number), but found ('+g.kind+", "+x.kind+") instead.")}if(this.collator&&!a&&this.hasUntypedArgument){var S=Cr(h),I=Cr(m);if(S.kind!=="string"||I.kind!=="string")return t(c,h,m)}return this.collator?r(c,h,m,this.collator.evaluate(c)):t(c,h,m)},l.prototype.eachChild=function(c){c(this.lhs),c(this.rhs),this.collator&&c(this.collator)},l.prototype.outputDefined=function(){return!0},l.prototype.serialize=function(){var c=[e];return this.eachChild((function(h){c.push(h.serialize())})),c},l})()}Jn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,qe),a=t.parse(e[2],2,ge);if(!r||!a)return null;if(!Pr(r.type,[Gt(qe),Ne,qe]))return t.error("Expected first argument to be of type array or string, but found "+Dt(r.type)+" instead");if(e.length===4){var l=t.parse(e[3],3,ge);return l?new Jn(r.type,r,a,l):null}return new Jn(r.type,r,a)},Jn.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!Qt(t,["string","array"]))throw new oi("Expected first argument to be of type array or string, but found "+Dt(Cr(t))+" instead.");if(this.endIndex){var a=this.endIndex.evaluate(e);return t.slice(r,a)}return t.slice(r)},Jn.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},Jn.prototype.outputDefined=function(){return!1},Jn.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var Lc=ir("==",(function(e,t,r){return t===r}),fl),ts=ir("!=",(function(e,t,r){return t!==r}),(function(e,t,r,a){return!fl(0,t,r,a)})),dl=ir("<",(function(e,t,r){return t<r}),(function(e,t,r,a){return a.compare(t,r)<0})),ml=ir(">",(function(e,t,r){return t>r}),(function(e,t,r,a){return a.compare(t,r)>0})),yl=ir("<=",(function(e,t,r){return t<=r}),(function(e,t,r,a){return a.compare(t,r)<=0})),vl=ir(">=",(function(e,t,r){return t>=r}),(function(e,t,r,a){return a.compare(t,r)>=0})),So=function(e,t,r,a,l){this.type=Ne,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=a,this.maxFractionDigits=l};So.parse=function(e,t){if(e.length!==3)return t.error("Expected two arguments.");var r=t.parse(e[1],1,ge);if(!r)return null;var a=e[2];if(typeof a!="object"||Array.isArray(a))return t.error("NumberFormat options argument must be an object.");var l=null;if(a.locale&&!(l=t.parse(a.locale,1,Ne)))return null;var c=null;if(a.currency&&!(c=t.parse(a.currency,1,Ne)))return null;var h=null;if(a["min-fraction-digits"]&&!(h=t.parse(a["min-fraction-digits"],1,ge)))return null;var m=null;return a["max-fraction-digits"]&&!(m=t.parse(a["max-fraction-digits"],1,ge))?null:new So(r,l,c,h,m)},So.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))},So.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},So.prototype.outputDefined=function(){return!1},So.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.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]};var Yn=function(e){this.type=ge,this.input=e};Yn.parse=function(e,t){if(e.length!==2)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1);return r?r.type.kind!=="array"&&r.type.kind!=="string"&&r.type.kind!=="value"?t.error("Expected argument of type string or array, but found "+Dt(r.type)+" instead."):new Yn(r):null},Yn.prototype.evaluate=function(e){var t=this.input.evaluate(e);if(typeof t=="string"||Array.isArray(t))return t.length;throw new oi("Expected value to be of type string or array, but found "+Dt(Cr(t))+" instead.")},Yn.prototype.eachChild=function(e){e(this.input)},Yn.prototype.outputDefined=function(){return!1},Yn.prototype.serialize=function(){var e=["length"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Io={"==":Lc,"!=":ts,">":ml,"<":dl,">=":vl,"<=":yl,array:yr,at:_o,boolean:yr,case:wo,coalesce:Hn,collator:In,format:yn,image:Ji,in:xo,"index-of":Kn,interpolate:mi,"interpolate-hcl":mi,"interpolate-lab":mi,length:Yn,let:Xn,literal:Si,match:bo,number:yr,"number-format":So,object:yr,slice:Jn,step:Ui,string:yr,"to-boolean":on,"to-color":on,"to-number":on,"to-string":on,var:$n,within:an};function gl(e,t){var r=t[0],a=t[1],l=t[2],c=t[3];r=r.evaluate(e),a=a.evaluate(e),l=l.evaluate(e);var h=c?c.evaluate(e):1,m=eu(r,a,l,h);if(m)throw new oi(m);return new Zt(r/255*h,a/255*h,l/255*h,h)}function _l(e,t){return e in t}function uu(e,t){var r=t[e];return r===void 0?null:r}function To(e){return{type:e}}function xl(e){return{result:"success",value:e}}function Ao(e){return{result:"error",value:e}}function Eo(e){return e["property-type"]==="data-driven"||e["property-type"]==="cross-faded-data-driven"}function bl(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function ba(e){return!!e.expression&&e.expression.interpolated}function ur(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":e===null?"null":typeof e}function rs(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Fc(e){return e}function Xo(e,t,r){return e!==void 0?e:t!==void 0?t:r!==void 0?r:void 0}function wl(e,t,r,a,l){return Xo(typeof r===l?a[r]:void 0,e.default,t.default)}function Oc(e,t,r){if(ur(r)!=="number")return Xo(e.default,t.default);var a=e.stops.length;if(a===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[a-1][0])return e.stops[a-1][1];var l=es(e.stops.map((function(c){return c[0]})),r);return e.stops[l][1]}function Sl(e,t,r){var a=e.base!==void 0?e.base:1;if(ur(r)!=="number")return Xo(e.default,t.default);var l=e.stops.length;if(l===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[l-1][0])return e.stops[l-1][1];var c=es(e.stops.map((function(I){return I[0]})),r),h=(function(I,C,z,j){var G=j-z,te=I-z;return G===0?0:C===1?te/G:(Math.pow(C,te)-1)/(Math.pow(C,G)-1)})(r,a,e.stops[c][0],e.stops[c+1][0]),m=e.stops[c][1],g=e.stops[c+1][1],x=Ho[t.type]||Fc;if(e.colorSpace&&e.colorSpace!=="rgb"){var S=pl[e.colorSpace];x=function(I,C){return S.reverse(S.interpolate(S.forward(I),S.forward(C),h))}}return typeof m.evaluate=="function"?{evaluate:function(){for(var I=[],C=arguments.length;C--;)I[C]=arguments[C];var z=m.evaluate.apply(void 0,I),j=g.evaluate.apply(void 0,I);if(z!==void 0&&j!==void 0)return x(z,j,h)}}:x(m,g,h)}function is(e,t,r){return t.type==="color"?r=Zt.parse(r):t.type==="formatted"?r=ni.fromString(r.toString()):t.type==="resolvedImage"?r=Di.fromString(r.toString()):ur(r)===t.type||t.type==="enum"&&t.values[r]||(r=void 0),Xo(r,e.default,t.default)}di.register(Io,{error:[{kind:"error"},[Ne],function(e,t){throw new oi(t[0].evaluate(e))}],typeof:[Ne,[qe],function(e,t){return Dt(Cr(t[0].evaluate(e)))}],"to-rgba":[Gt(ge,4),[Be],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[Be,[ge,ge,ge],gl],rgba:[Be,[ge,ge,ge,ge],gl],has:{type:ze,overloads:[[[Ne],function(e,t){return _l(t[0].evaluate(e),e.properties())}],[[Ne,yt],function(e,t){var r=t[1];return _l(t[0].evaluate(e),r.evaluate(e))}]]},get:{type:qe,overloads:[[[Ne],function(e,t){return uu(t[0].evaluate(e),e.properties())}],[[Ne,yt],function(e,t){var r=t[1];return uu(t[0].evaluate(e),r.evaluate(e))}]]},"feature-state":[qe,[Ne],function(e,t){return uu(t[0].evaluate(e),e.featureState||{})}],properties:[yt,[],function(e){return e.properties()}],"geometry-type":[Ne,[],function(e){return e.geometryType()}],id:[qe,[],function(e){return e.id()}],zoom:[ge,[],function(e){return e.globals.zoom}],"heatmap-density":[ge,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[ge,[],function(e){return e.globals.lineProgress||0}],accumulated:[qe,[],function(e){return e.globals.accumulated===void 0?null:e.globals.accumulated}],"+":[ge,To(ge),function(e,t){for(var r=0,a=0,l=t;a<l.length;a+=1)r+=l[a].evaluate(e);return r}],"*":[ge,To(ge),function(e,t){for(var r=1,a=0,l=t;a<l.length;a+=1)r*=l[a].evaluate(e);return r}],"-":{type:ge,overloads:[[[ge,ge],function(e,t){var r=t[1];return t[0].evaluate(e)-r.evaluate(e)}],[[ge],function(e,t){return-t[0].evaluate(e)}]]},"/":[ge,[ge,ge],function(e,t){var r=t[1];return t[0].evaluate(e)/r.evaluate(e)}],"%":[ge,[ge,ge],function(e,t){var r=t[1];return t[0].evaluate(e)%r.evaluate(e)}],ln2:[ge,[],function(){return Math.LN2}],pi:[ge,[],function(){return Math.PI}],e:[ge,[],function(){return Math.E}],"^":[ge,[ge,ge],function(e,t){var r=t[1];return Math.pow(t[0].evaluate(e),r.evaluate(e))}],sqrt:[ge,[ge],function(e,t){return Math.sqrt(t[0].evaluate(e))}],log10:[ge,[ge],function(e,t){return Math.log(t[0].evaluate(e))/Math.LN10}],ln:[ge,[ge],function(e,t){return Math.log(t[0].evaluate(e))}],log2:[ge,[ge],function(e,t){return Math.log(t[0].evaluate(e))/Math.LN2}],sin:[ge,[ge],function(e,t){return Math.sin(t[0].evaluate(e))}],cos:[ge,[ge],function(e,t){return Math.cos(t[0].evaluate(e))}],tan:[ge,[ge],function(e,t){return Math.tan(t[0].evaluate(e))}],asin:[ge,[ge],function(e,t){return Math.asin(t[0].evaluate(e))}],acos:[ge,[ge],function(e,t){return Math.acos(t[0].evaluate(e))}],atan:[ge,[ge],function(e,t){return Math.atan(t[0].evaluate(e))}],min:[ge,To(ge),function(e,t){return Math.min.apply(Math,t.map((function(r){return r.evaluate(e)})))}],max:[ge,To(ge),function(e,t){return Math.max.apply(Math,t.map((function(r){return r.evaluate(e)})))}],abs:[ge,[ge],function(e,t){return Math.abs(t[0].evaluate(e))}],round:[ge,[ge],function(e,t){var r=t[0].evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[ge,[ge],function(e,t){return Math.floor(t[0].evaluate(e))}],ceil:[ge,[ge],function(e,t){return Math.ceil(t[0].evaluate(e))}],"filter-==":[ze,[Ne,qe],function(e,t){var r=t[0],a=t[1];return e.properties()[r.value]===a.value}],"filter-id-==":[ze,[qe],function(e,t){var r=t[0];return e.id()===r.value}],"filter-type-==":[ze,[Ne],function(e,t){var r=t[0];return e.geometryType()===r.value}],"filter-<":[ze,[Ne,qe],function(e,t){var r=t[0],a=t[1],l=e.properties()[r.value],c=a.value;return typeof l==typeof c&&l<c}],"filter-id-<":[ze,[qe],function(e,t){var r=t[0],a=e.id(),l=r.value;return typeof a==typeof l&&a<l}],"filter->":[ze,[Ne,qe],function(e,t){var r=t[0],a=t[1],l=e.properties()[r.value],c=a.value;return typeof l==typeof c&&l>c}],"filter-id->":[ze,[qe],function(e,t){var r=t[0],a=e.id(),l=r.value;return typeof a==typeof l&&a>l}],"filter-<=":[ze,[Ne,qe],function(e,t){var r=t[0],a=t[1],l=e.properties()[r.value],c=a.value;return typeof l==typeof c&&l<=c}],"filter-id-<=":[ze,[qe],function(e,t){var r=t[0],a=e.id(),l=r.value;return typeof a==typeof l&&a<=l}],"filter->=":[ze,[Ne,qe],function(e,t){var r=t[0],a=t[1],l=e.properties()[r.value],c=a.value;return typeof l==typeof c&&l>=c}],"filter-id->=":[ze,[qe],function(e,t){var r=t[0],a=e.id(),l=r.value;return typeof a==typeof l&&a>=l}],"filter-has":[ze,[qe],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[ze,[],function(e){return e.id()!==null&&e.id()!==void 0}],"filter-type-in":[ze,[Gt(Ne)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[ze,[Gt(qe)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[ze,[Ne,Gt(qe)],function(e,t){var r=t[0];return t[1].value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[ze,[Ne,Gt(qe)],function(e,t){var r=t[0],a=t[1];return(function(l,c,h,m){for(;h<=m;){var g=h+m>>1;if(c[g]===l)return!0;c[g]>l?m=g-1:h=g+1}return!1})(e.properties()[r.value],a.value,0,a.value.length-1)}],all:{type:ze,overloads:[[[ze,ze],function(e,t){var r=t[1];return t[0].evaluate(e)&&r.evaluate(e)}],[To(ze),function(e,t){for(var r=0,a=t;r<a.length;r+=1)if(!a[r].evaluate(e))return!1;return!0}]]},any:{type:ze,overloads:[[[ze,ze],function(e,t){var r=t[1];return t[0].evaluate(e)||r.evaluate(e)}],[To(ze),function(e,t){for(var r=0,a=t;r<a.length;r+=1)if(a[r].evaluate(e))return!0;return!1}]]},"!":[ze,[ze],function(e,t){return!t[0].evaluate(e)}],"is-supported-script":[ze,[Ne],function(e,t){var r=e.globals&&e.globals.isSupportedScript;return!r||r(t[0].evaluate(e))}],upcase:[Ne,[Ne],function(e,t){return t[0].evaluate(e).toUpperCase()}],downcase:[Ne,[Ne],function(e,t){return t[0].evaluate(e).toLowerCase()}],concat:[Ne,To(qe),function(e,t){return t.map((function(r){return va(r.evaluate(e))})).join("")}],"resolved-locale":[Ne,[Et],function(e,t){return t[0].evaluate(e).resolvedLocale()}]});var Ko=function(e,t){this.expression=e,this._warningHistory={},this._evaluator=new Dn,this._defaultValue=t?(function(r){return r.type==="color"&&rs(r.default)?new Zt(0,0,0,0):r.type==="color"?Zt.parse(r.default)||null:r.default===void 0?null:r.default})(t):null,this._enumValues=t&&t.type==="enum"?t.values:null};function wa(e){return Array.isArray(e)&&e.length>0&&typeof e[0]=="string"&&e[0]in Io}function ns(e,t){var r=new Wn(Io,[],t?(function(l){var c={color:Be,string:Ne,number:ge,enum:Ne,boolean:ze,formatted:rr,resolvedImage:Pt};return l.type==="array"?Gt(c[l.value]||qe,l.length):c[l.type]})(t):void 0),a=r.parse(e,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?xl(new Ko(a,t)):Ao(r.errors)}Ko.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,l,c){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=a,this._evaluator.availableImages=l||null,this._evaluator.formattedSection=c,this.expression.evaluate(this._evaluator)},Ko.prototype.evaluate=function(e,t,r,a,l,c){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=a,this._evaluator.availableImages=l||null,this._evaluator.formattedSection=c||null;try{var h=this.expression.evaluate(this._evaluator);if(h==null||typeof h=="number"&&h!=h)return this._defaultValue;if(this._enumValues&&!(h in this._enumValues))throw new oi("Expected value to be one of "+Object.keys(this._enumValues).map((function(m){return JSON.stringify(m)})).join(", ")+", but found "+JSON.stringify(h)+" instead.");return h}catch(m){return this._warningHistory[m.message]||(this._warningHistory[m.message]=!0,typeof console<"u"&&console.warn(m.message)),this._defaultValue}};var Sa=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!Zn(t.expression)};Sa.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,l,c){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,a,l,c)},Sa.prototype.evaluate=function(e,t,r,a,l,c){return this._styleExpression.evaluate(e,t,r,a,l,c)};var Jo=function(e,t,r,a){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent=e!=="camera"&&!Zn(t.expression),this.interpolationType=a};function Il(e,t){if((e=ns(e,t)).result==="error")return e;var r=e.value.expression,a=Gn(r);if(!a&&!Eo(t))return Ao([new Ae("","data expressions not supported")]);var l=go(r,["zoom"]);if(!l&&!bl(t))return Ao([new Ae("","zoom expressions not supported")]);var c=(function h(m){var g=null;if(m instanceof Xn)g=h(m.result);else if(m instanceof Hn)for(var x=0,S=m.args;x<S.length&&!(g=h(S[x]));x+=1);else(m instanceof Ui||m instanceof mi)&&m.input instanceof di&&m.input.name==="zoom"&&(g=m);return g instanceof Ae||m.eachChild((function(I){var C=h(I);C instanceof Ae?g=C:!g&&C?g=new Ae("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):g&&C&&g!==C&&(g=new Ae("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),g})(r);return c||l?c instanceof Ae?Ao([c]):c instanceof mi&&!ba(t)?Ao([new Ae("",'"interpolate" expressions cannot be used with this property')]):xl(c?new Jo(a?"camera":"composite",e.value,c.labels,c instanceof mi?c.interpolation:void 0):new Sa(a?"constant":"source",e.value)):Ao([new Ae("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Jo.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,l,c){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,a,l,c)},Jo.prototype.evaluate=function(e,t,r,a,l,c){return this._styleExpression.evaluate(e,t,r,a,l,c)},Jo.prototype.interpolationFactor=function(e,t,r){return this.interpolationType?mi.interpolationFactor(this.interpolationType,e,t,r):0};var Yo=function(e,t){this._parameters=e,this._specification=t,Se(this,(function r(a,l){var c,h,m,g=l.type==="color",x=a.stops&&typeof a.stops[0][0]=="object",S=x||!(x||a.property!==void 0),I=a.type||(ba(l)?"exponential":"interval");if(g&&((a=Se({},a)).stops&&(a.stops=a.stops.map((function(Ue){return[Ue[0],Zt.parse(Ue[1])]}))),a.default=Zt.parse(a.default?a.default:l.default)),a.colorSpace&&a.colorSpace!=="rgb"&&!pl[a.colorSpace])throw new Error("Unknown color space: "+a.colorSpace);if(I==="exponential")c=Sl;else if(I==="interval")c=Oc;else if(I==="categorical"){c=wl,h=Object.create(null);for(var C=0,z=a.stops;C<z.length;C+=1){var j=z[C];h[j[0]]=j[1]}m=typeof a.stops[0][0]}else{if(I!=="identity")throw new Error('Unknown function type "'+I+'"');c=is}if(x){for(var G={},te=[],K=0;K<a.stops.length;K++){var oe=a.stops[K],le=oe[0].zoom;G[le]===void 0&&(G[le]={zoom:le,type:a.type,property:a.property,default:a.default,stops:[]},te.push(le)),G[le].stops.push([oe[0].value,oe[1]])}for(var ce=[],he=0,xe=te;he<xe.length;he+=1){var Pe=xe[he];ce.push([G[Pe].zoom,r(G[Pe],l)])}var De={name:"linear"};return{kind:"composite",interpolationType:De,interpolationFactor:mi.interpolationFactor.bind(void 0,De),zoomStops:ce.map((function(Ue){return Ue[0]})),evaluate:function(Ue,ot){var je=Ue.zoom;return Sl({stops:ce,base:a.base},l,je).evaluate(je,ot)}}}if(S){var rt=I==="exponential"?{name:"exponential",base:a.base!==void 0?a.base:1}:null;return{kind:"camera",interpolationType:rt,interpolationFactor:mi.interpolationFactor.bind(void 0,rt),zoomStops:a.stops.map((function(Ue){return Ue[0]})),evaluate:function(Ue){return c(a,l,Ue.zoom,h,m)}}}return{kind:"source",evaluate:function(Ue,ot){var je=ot&&ot.properties?ot.properties[a.property]:void 0;return je===void 0?Xo(a.default,l.default):c(a,l,je,h,m)}}})(this._parameters,this._specification))};function vn(e){var t=e.key,r=e.value,a=e.valueSpec||{},l=e.objectElementValidators||{},c=e.style,h=e.styleSpec,m=[],g=ur(r);if(g!=="object")return[new H(t,r,"object expected, "+g+" found")];for(var x in r){var S=x.split(".")[0],I=a[S]||a["*"],C=void 0;if(l[S])C=l[S];else if(a[S])C=zt;else if(l["*"])C=l["*"];else{if(!a["*"]){m.push(new H(t,r[x],'unknown property "'+x+'"'));continue}C=zt}m=m.concat(C({key:(t&&t+".")+x,value:r[x],valueSpec:I,style:c,styleSpec:h,object:r,objectKey:x},r))}for(var z in a)l[z]||a[z].required&&a[z].default===void 0&&r[z]===void 0&&m.push(new H(t,r,'missing required property "'+z+'"'));return m}function Tl(e){var t=e.value,r=e.valueSpec,a=e.style,l=e.styleSpec,c=e.key,h=e.arrayElementValidator||zt;if(ur(t)!=="array")return[new H(c,t,"array expected, "+ur(t)+" found")];if(r.length&&t.length!==r.length)return[new H(c,t,"array length "+r.length+" expected, length "+t.length+" found")];if(r["min-length"]&&t.length<r["min-length"])return[new H(c,t,"array length at least "+r["min-length"]+" expected, length "+t.length+" found")];var m={type:r.value,values:r.values};l.$version<7&&(m.function=r.function),ur(r.value)==="object"&&(m=r.value);for(var g=[],x=0;x<t.length;x++)g=g.concat(h({array:t,arrayIndex:x,value:t[x],valueSpec:m,style:a,styleSpec:l,key:c+"["+x+"]"}));return g}function Al(e){var t=e.key,r=e.value,a=e.valueSpec,l=ur(r);return l==="number"&&r!=r&&(l="NaN"),l!=="number"?[new H(t,r,"number expected, "+l+" found")]:"minimum"in a&&r<a.minimum?[new H(t,r,r+" is less than the minimum value "+a.minimum)]:"maximum"in a&&r>a.maximum?[new H(t,r,r+" is greater than the maximum value "+a.maximum)]:[]}function El(e){var t,r,a,l=e.valueSpec,c=Ee(e.value.type),h={},m=c!=="categorical"&&e.value.property===void 0,g=!m,x=ur(e.value.stops)==="array"&&ur(e.value.stops[0])==="array"&&ur(e.value.stops[0][0])==="object",S=vn({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(z){if(c==="identity")return[new H(z.key,z.value,'identity function may not have a "stops" property')];var j=[],G=z.value;return j=j.concat(Tl({key:z.key,value:G,valueSpec:z.valueSpec,style:z.style,styleSpec:z.styleSpec,arrayElementValidator:I})),ur(G)==="array"&&G.length===0&&j.push(new H(z.key,G,"array must have at least one stop")),j},default:function(z){return zt({key:z.key,value:z.value,valueSpec:l,style:z.style,styleSpec:z.styleSpec})}}});return c==="identity"&&m&&S.push(new H(e.key,e.value,'missing required property "property"')),c==="identity"||e.value.stops||S.push(new H(e.key,e.value,'missing required property "stops"')),c==="exponential"&&e.valueSpec.expression&&!ba(e.valueSpec)&&S.push(new H(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(g&&!Eo(e.valueSpec)?S.push(new H(e.key,e.value,"property functions not supported")):m&&!bl(e.valueSpec)&&S.push(new H(e.key,e.value,"zoom functions not supported"))),c!=="categorical"&&!x||e.value.property!==void 0||S.push(new H(e.key,e.value,'"property" property is required')),S;function I(z){var j=[],G=z.value,te=z.key;if(ur(G)!=="array")return[new H(te,G,"array expected, "+ur(G)+" found")];if(G.length!==2)return[new H(te,G,"array length 2 expected, length "+G.length+" found")];if(x){if(ur(G[0])!=="object")return[new H(te,G,"object expected, "+ur(G[0])+" found")];if(G[0].zoom===void 0)return[new H(te,G,"object stop key must have zoom")];if(G[0].value===void 0)return[new H(te,G,"object stop key must have value")];if(a&&a>Ee(G[0].zoom))return[new H(te,G[0].zoom,"stop zoom values must appear in ascending order")];Ee(G[0].zoom)!==a&&(a=Ee(G[0].zoom),r=void 0,h={}),j=j.concat(vn({key:te+"[0]",value:G[0],valueSpec:{zoom:{}},style:z.style,styleSpec:z.styleSpec,objectElementValidators:{zoom:Al,value:C}}))}else j=j.concat(C({key:te+"[0]",value:G[0],style:z.style,styleSpec:z.styleSpec},G));return wa(me(G[1]))?j.concat([new H(te+"[1]",G[1],"expressions are not allowed in function stops.")]):j.concat(zt({key:te+"[1]",value:G[1],valueSpec:l,style:z.style,styleSpec:z.styleSpec}))}function C(z,j){var G=ur(z.value),te=Ee(z.value),K=z.value!==null?z.value:j;if(t){if(G!==t)return[new H(z.key,K,G+" stop domain type must match previous stop domain type "+t)]}else t=G;if(G!=="number"&&G!=="string"&&G!=="boolean")return[new H(z.key,K,"stop domain value must be a number, string, or boolean")];if(G!=="number"&&c!=="categorical"){var oe="number expected, "+G+" found";return Eo(l)&&c===void 0&&(oe+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new H(z.key,K,oe)]}return c!=="categorical"||G!=="number"||isFinite(te)&&Math.floor(te)===te?c!=="categorical"&&G==="number"&&r!==void 0&&te<r?[new H(z.key,K,"stop domain values must appear in ascending order")]:(r=te,c==="categorical"&&te in h?[new H(z.key,K,"stop domain values must be unique")]:(h[te]=!0,[])):[new H(z.key,K,"integer expected, found "+te)]}}function Po(e){var t=(e.expressionContext==="property"?Il:ns)(me(e.value),e.valueSpec);if(t.result==="error")return t.value.map((function(a){return new H(""+e.key+a.key,e.value,a.message)}));var r=t.value.expression||t.value._styleExpression.expression;if(e.expressionContext==="property"&&e.propertyKey==="text-font"&&!r.outputDefined())return[new H(e.key,e.value,'Invalid data expression for "'+e.propertyKey+'". Output values must be contained as literals within the expression.')];if(e.expressionContext==="property"&&e.propertyType==="layout"&&!Zn(r))return[new H(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if(e.expressionContext==="filter"&&!Zn(r))return[new H(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&e.expressionContext.indexOf("cluster")===0){if(!go(r,["zoom","feature-state"]))return[new H(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(e.expressionContext==="cluster-initial"&&!Gn(r))return[new H(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Ia(e){var t=e.key,r=e.value,a=e.valueSpec,l=[];return Array.isArray(a.values)?a.values.indexOf(Ee(r))===-1&&l.push(new H(t,r,"expected one of ["+a.values.join(", ")+"], "+JSON.stringify(r)+" found")):Object.keys(a.values).indexOf(Ee(r))===-1&&l.push(new H(t,r,"expected one of ["+Object.keys(a.values).join(", ")+"], "+JSON.stringify(r)+" found")),l}function os(e){if(e===!0||e===!1)return!0;if(!Array.isArray(e)||e.length===0)return!1;switch(e[0]){case"has":return e.length>=2&&e[1]!=="$id"&&e[1]!=="$type";case"in":return e.length>=3&&(typeof e[1]!="string"||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return e.length!==3||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(var t=0,r=e.slice(1);t<r.length;t+=1){var a=r[t];if(!os(a)&&typeof a!="boolean")return!1}return!0;default:return!0}}Yo.deserialize=function(e){return new Yo(e._parameters,e._specification)},Yo.serialize=function(e){return{_parameters:e._parameters,_specification:e._specification}};var lu={type:"boolean",default:!1};function as(e){if(e==null)return{filter:function(){return!0},needGeometry:!1};os(e)||(e=ss(e));var t=ns(e,lu);if(t.result==="error")throw new Error(t.value.map((function(r){return r.key+": "+r.message})).join(", "));return{filter:function(r,a,l){return t.value.evaluate(r,a,{},l)},needGeometry:(function r(a){if(!Array.isArray(a))return!1;if(a[0]==="within")return!0;for(var l=1;l<a.length;l++)if(r(a[l]))return!0;return!1})(e)}}function Vc(e,t){return e<t?-1:e>t?1:0}function ss(e){if(!e)return!0;var t,r=e[0];return e.length<=1?r!=="any":r==="=="?cu(e[1],e[2],"=="):r==="!="?us(cu(e[1],e[2],"==")):r==="<"||r===">"||r==="<="||r===">="?cu(e[1],e[2],r):r==="any"?(t=e.slice(1),["any"].concat(t.map(ss))):r==="all"?["all"].concat(e.slice(1).map(ss)):r==="none"?["all"].concat(e.slice(1).map(ss).map(us)):r==="in"?Pl(e[1],e.slice(2)):r==="!in"?us(Pl(e[1],e.slice(2))):r==="has"?Cl(e[1]):r==="!has"?us(Cl(e[1])):r!=="within"||e}function cu(e,t,r){switch(e){case"$type":return["filter-type-"+r,t];case"$id":return["filter-id-"+r,t];default:return["filter-"+r,e,t]}}function Pl(e,t){if(t.length===0)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((function(r){return typeof r!=typeof t[0]}))?["filter-in-large",e,["literal",t.sort(Vc)]]:["filter-in-small",e,["literal",t]]}}function Cl(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function us(e){return["!",e]}function pu(e){return os(me(e.value))?Po(Se({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):(function t(r){var a=r.value,l=r.key;if(ur(a)!=="array")return[new H(l,a,"array expected, "+ur(a)+" found")];var c,h=r.styleSpec,m=[];if(a.length<1)return[new H(l,a,"filter array must have at least 1 element")];switch(m=m.concat(Ia({key:l+"[0]",value:a[0],valueSpec:h.filter_operator,style:r.style,styleSpec:r.styleSpec})),Ee(a[0])){case"<":case"<=":case">":case">=":a.length>=2&&Ee(a[1])==="$type"&&m.push(new H(l,a,'"$type" cannot be use with operator "'+a[0]+'"'));case"==":case"!=":a.length!==3&&m.push(new H(l,a,'filter array for operator "'+a[0]+'" must have 3 elements'));case"in":case"!in":a.length>=2&&(c=ur(a[1]))!=="string"&&m.push(new H(l+"[1]",a[1],"string expected, "+c+" found"));for(var g=2;g<a.length;g++)c=ur(a[g]),Ee(a[1])==="$type"?m=m.concat(Ia({key:l+"["+g+"]",value:a[g],valueSpec:h.geometry_type,style:r.style,styleSpec:r.styleSpec})):c!=="string"&&c!=="number"&&c!=="boolean"&&m.push(new H(l+"["+g+"]",a[g],"string, number, or boolean expected, "+c+" found"));break;case"any":case"all":case"none":for(var x=1;x<a.length;x++)m=m.concat(t({key:l+"["+x+"]",value:a[x],style:r.style,styleSpec:r.styleSpec}));break;case"has":case"!has":c=ur(a[1]),a.length!==2?m.push(new H(l,a,'filter array for "'+a[0]+'" operator must have 2 elements')):c!=="string"&&m.push(new H(l+"[1]",a[1],"string expected, "+c+" found"));break;case"within":c=ur(a[1]),a.length!==2?m.push(new H(l,a,'filter array for "'+a[0]+'" operator must have 2 elements')):c!=="object"&&m.push(new H(l+"[1]",a[1],"object expected, "+c+" found"))}return m})(e)}function hu(e,t){var r=e.key,a=e.style,l=e.styleSpec,c=e.value,h=e.objectKey,m=l[t+"_"+e.layerType];if(!m)return[];var g=h.match(/^(.*)-transition$/);if(t==="paint"&&g&&m[g[1]]&&m[g[1]].transition)return zt({key:r,value:c,valueSpec:l.transition,style:a,styleSpec:l});var x,S=e.valueSpec||m[h];if(!S)return[new H(r,c,'unknown property "'+h+'"')];if(ur(c)==="string"&&Eo(S)&&!S.tokens&&(x=/^{([^}]+)}$/.exec(c)))return[new H(r,c,'"'+h+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(x[1])+" }`.")];var I=[];return e.layerType==="symbol"&&(h==="text-field"&&a&&!a.glyphs&&I.push(new H(r,c,'use of "text-field" requires a style "glyphs" property')),h==="text-font"&&rs(me(c))&&Ee(c.type)==="identity"&&I.push(new H(r,c,'"text-font" does not support identity functions'))),I.concat(zt({key:e.key,value:c,valueSpec:S,style:a,styleSpec:l,expressionContext:"property",propertyType:t,propertyKey:h}))}function fu(e){return hu(e,"paint")}function Ta(e){return hu(e,"layout")}function kl(e){var t=[],r=e.value,a=e.key,l=e.style,c=e.styleSpec;r.type||r.ref||t.push(new H(a,r,'either "type" or "ref" is required'));var h,m=Ee(r.type),g=Ee(r.ref);if(r.id)for(var x=Ee(r.id),S=0;S<e.arrayIndex;S++){var I=l.layers[S];Ee(I.id)===x&&t.push(new H(a,r.id,'duplicate layer id "'+r.id+'", previously used at line '+I.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach((function(j){j in r&&t.push(new H(a,r[j],'"'+j+'" is prohibited for ref layers'))})),l.layers.forEach((function(j){Ee(j.id)===g&&(h=j)})),h?h.ref?t.push(new H(a,r.ref,"ref cannot reference another ref layer")):m=Ee(h.type):t.push(new H(a,r.ref,'ref layer "'+g+'" not found'));else if(m!=="background")if(r.source){var C=l.sources&&l.sources[r.source],z=C&&Ee(C.type);C?z==="vector"&&m==="raster"?t.push(new H(a,r.source,'layer "'+r.id+'" requires a raster source')):z==="raster"&&m!=="raster"?t.push(new H(a,r.source,'layer "'+r.id+'" requires a vector source')):z!=="vector"||r["source-layer"]?z==="raster-dem"&&m!=="hillshade"?t.push(new H(a,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):m!=="line"||!r.paint||!r.paint["line-gradient"]||z==="geojson"&&C.lineMetrics||t.push(new H(a,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):t.push(new H(a,r,'layer "'+r.id+'" must specify a "source-layer"')):t.push(new H(a,r.source,'source "'+r.source+'" not found'))}else t.push(new H(a,r,'missing required property "source"'));return t=t.concat(vn({key:a,value:r,valueSpec:c.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return zt({key:a+".type",value:r.type,valueSpec:c.layer.type,style:e.style,styleSpec:e.styleSpec,object:r,objectKey:"type"})},filter:pu,layout:function(j){return vn({layer:r,key:j.key,value:j.value,style:j.style,styleSpec:j.styleSpec,objectElementValidators:{"*":function(G){return Ta(Se({layerType:m},G))}}})},paint:function(j){return vn({layer:r,key:j.key,value:j.value,style:j.style,styleSpec:j.styleSpec,objectElementValidators:{"*":function(G){return fu(Se({layerType:m},G))}}})}}}))}function Co(e){var t=e.value,r=e.key,a=ur(t);return a!=="string"?[new H(r,t,"string expected, "+a+" found")]:[]}var vr={promoteId:function(e){var t=e.key,r=e.value;if(ur(r)==="string")return Co({key:t,value:r});var a=[];for(var l in r)a.push.apply(a,Co({key:t+"."+l,value:r[l]}));return a}};function ls(e){var t=e.value,r=e.key,a=e.styleSpec,l=e.style;if(!t.type)return[new H(r,t,'"type" is required')];var c,h=Ee(t.type);switch(h){case"vector":case"raster":case"raster-dem":return vn({key:r,value:t,valueSpec:a["source_"+h.replace("-","_")],style:e.style,styleSpec:a,objectElementValidators:vr});case"geojson":if(c=vn({key:r,value:t,valueSpec:a.source_geojson,style:l,styleSpec:a,objectElementValidators:vr}),t.cluster)for(var m in t.clusterProperties){var g=t.clusterProperties[m],x=g[0],S=typeof x=="string"?[x,["accumulated"],["get",m]]:x;c.push.apply(c,Po({key:r+"."+m+".map",value:g[1],expressionContext:"cluster-map"})),c.push.apply(c,Po({key:r+"."+m+".reduce",value:S,expressionContext:"cluster-reduce"}))}return c;case"video":return vn({key:r,value:t,valueSpec:a.source_video,style:l,styleSpec:a});case"image":return vn({key:r,value:t,valueSpec:a.source_image,style:l,styleSpec:a});case"canvas":return[new H(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Ia({key:r+".type",value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function ko(e){var t=e.value,r=e.styleSpec,a=r.light,l=e.style,c=[],h=ur(t);if(t===void 0)return c;if(h!=="object")return c.concat([new H("light",t,"object expected, "+h+" found")]);for(var m in t){var g=m.match(/^(.*)-transition$/);c=c.concat(g&&a[g[1]]&&a[g[1]].transition?zt({key:m,value:t[m],valueSpec:r.transition,style:l,styleSpec:r}):a[m]?zt({key:m,value:t[m],valueSpec:a[m],style:l,styleSpec:r}):[new H(m,t[m],'unknown property "'+m+'"')])}return c}var Qn={"*":function(){return[]},array:Tl,boolean:function(e){var t=e.value,r=e.key,a=ur(t);return a!=="boolean"?[new H(r,t,"boolean expected, "+a+" found")]:[]},number:Al,color:function(e){var t=e.key,r=e.value,a=ur(r);return a!=="string"?[new H(t,r,"color expected, "+a+" found")]:Bt(r)===null?[new H(t,r,'color expected, "'+r+'" found')]:[]},constants:se,enum:Ia,filter:pu,function:El,layer:kl,object:vn,source:ls,light:ko,string:Co,formatted:function(e){return Co(e).length===0?[]:Po(e)},resolvedImage:function(e){return Co(e).length===0?[]:Po(e)}};function zt(e){var t=e.value,r=e.valueSpec,a=e.styleSpec;return r.expression&&rs(Ee(t))?El(e):r.expression&&wa(me(t))?Po(e):r.type&&Qn[r.type]?Qn[r.type](e):vn(Se({},e,{valueSpec:r.type?a[r.type]:r}))}function lr(e){var t=e.value,r=e.key,a=Co(e);return a.length||(t.indexOf("{fontstack}")===-1&&a.push(new H(r,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&a.push(new H(r,t,'"glyphs" url must include a "{range}" token'))),a}function Yi(e,t){t===void 0&&(t=L);var r=[];return r=r.concat(zt({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,objectElementValidators:{glyphs:lr,"*":function(){return[]}}})),e.constants&&(r=r.concat(se({key:"constants",value:e.constants}))),Aa(r)}function Aa(e){return[].concat(e).sort((function(t,r){return t.line-r.line}))}function Qo(e){return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return Aa(e.apply(this,t))}}Yi.source=Qo(ls),Yi.light=Qo(ko),Yi.layer=Qo(kl),Yi.filter=Qo(pu),Yi.paintProperty=Qo(fu),Yi.layoutProperty=Qo(Ta);var Ea=Yi,qc=Ea.light,Uc=Ea.paintProperty,Pa=Ea.layoutProperty;function Ca(e,t){var r=!1;if(t&&t.length)for(var a=0,l=t;a<l.length;a+=1)e.fire(new re(new Error(l[a].message))),r=!0;return r}var Rn=Gr;function Gr(e,t,r){var a=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var l=new Int32Array(this.arrayBuffer);e=l[0],this.d=(t=l[1])+2*(r=l[2]);for(var c=0;c<this.d*this.d;c++){var h=l[3+c],m=l[3+c+1];a.push(h===m?null:l.subarray(h,m))}var g=l[3+a.length+1];this.keys=l.subarray(l[3+a.length],g),this.bboxes=l.subarray(g),this.insert=this._insertReadonly}else{this.d=t+2*r;for(var x=0;x<this.d*this.d;x++)a.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;var S=r/t*e;this.min=-S,this.max=e+S}Gr.prototype.insert=function(e,t,r,a,l){this._forEachCell(t,r,a,l,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(a),this.bboxes.push(l)},Gr.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Gr.prototype._insertCell=function(e,t,r,a,l,c){this.cells[l].push(c)},Gr.prototype.query=function(e,t,r,a,l){var c=this.min,h=this.max;if(e<=c&&t<=c&&h<=r&&h<=a&&!l)return Array.prototype.slice.call(this.keys);var m=[];return this._forEachCell(e,t,r,a,this._queryCell,m,{},l),m},Gr.prototype._queryCell=function(e,t,r,a,l,c,h,m){var g=this.cells[l];if(g!==null)for(var x=this.keys,S=this.bboxes,I=0;I<g.length;I++){var C=g[I];if(h[C]===void 0){var z=4*C;(m?m(S[z+0],S[z+1],S[z+2],S[z+3]):e<=S[z+2]&&t<=S[z+3]&&r>=S[z+0]&&a>=S[z+1])?(h[C]=!0,c.push(x[C])):h[C]=!1}}},Gr.prototype._forEachCell=function(e,t,r,a,l,c,h,m){for(var g=this._convertToCellCoord(e),x=this._convertToCellCoord(t),S=this._convertToCellCoord(r),I=this._convertToCellCoord(a),C=g;C<=S;C++)for(var z=x;z<=I;z++){var j=this.d*z+C;if((!m||m(this._convertFromCellCoord(C),this._convertFromCellCoord(z),this._convertFromCellCoord(C+1),this._convertFromCellCoord(z+1)))&&l.call(this,e,t,r,a,j,c,h,m))return}},Gr.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},Gr.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},Gr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=3+this.cells.length+1+1,r=0,a=0;a<this.cells.length;a++)r+=this.cells[a].length;var l=new Int32Array(t+r+this.keys.length+this.bboxes.length);l[0]=this.extent,l[1]=this.n,l[2]=this.padding;for(var c=t,h=0;h<e.length;h++){var m=e[h];l[3+h]=c,l.set(m,c),c+=m.length}return l[3+e.length]=c,l.set(this.keys,c),l[3+e.length+1]=c+=this.keys.length,l.set(this.bboxes,c),c+=this.bboxes.length,l.buffer};var ka=Y.ImageData,Ml=Y.ImageBitmap,qr={};function Xe(e,t,r){r===void 0&&(r={}),Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),qr[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}for(var Ni in Xe("Object",Object),Rn.serialize=function(e,t){var r=e.toArrayBuffer();return t&&t.push(r),{buffer:r}},Rn.deserialize=function(e){return new Rn(e.buffer)},Xe("Grid",Rn),Xe("Color",Zt),Xe("Error",Error),Xe("ResolvedImage",Di),Xe("StylePropertyFunction",Yo),Xe("StyleExpression",Ko,{omit:["_evaluator"]}),Xe("ZoomDependentExpression",Jo),Xe("ZoomConstantExpression",Sa),Xe("CompoundExpression",di,{omit:["_evaluate"]}),Io)Io[Ni]._classRegistryKey||Xe("Expression_"+Ni,Io[Ni]);function cs(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor&&e.constructor.name==="ArrayBuffer")}function ea(e){return Ml&&e instanceof Ml}function gn(e,t){if(e==null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(cs(e)||ea(e))return t&&t.push(e),e;if(ArrayBuffer.isView(e)){var r=e;return t&&t.push(r.buffer),r}if(e instanceof ka)return t&&t.push(e.data.buffer),e;if(Array.isArray(e)){for(var a=[],l=0,c=e;l<c.length;l+=1)a.push(gn(c[l],t));return a}if(typeof e=="object"){var h=e.constructor,m=h._classRegistryKey;if(!m)throw new Error("can't serialize object of unregistered class");var g=h.serialize?h.serialize(e,t):{};if(!h.serialize){for(var x in e)if(e.hasOwnProperty(x)&&!(qr[m].omit.indexOf(x)>=0)){var S=e[x];g[x]=qr[m].shallow.indexOf(x)>=0?S:gn(S,t)}e instanceof Error&&(g.message=e.message)}if(g.$name)throw new Error("$name property is reserved for worker serialization logic.");return m!=="Object"&&(g.$name=m),g}throw new Error("can't serialize object of type "+typeof e)}function ji(e){if(e==null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||cs(e)||ea(e)||ArrayBuffer.isView(e)||e instanceof ka)return e;if(Array.isArray(e))return e.map(ji);if(typeof e=="object"){var t=e.$name||"Object",r=qr[t].klass;if(!r)throw new Error("can't deserialize unregistered class "+t);if(r.deserialize)return r.deserialize(e);for(var a=Object.create(r.prototype),l=0,c=Object.keys(e);l<c.length;l+=1){var h=c[l];if(h!=="$name"){var m=e[h];a[h]=qr[t].shallow.indexOf(h)>=0?m:ji(m)}}return a}throw new Error("can't deserialize object of type "+typeof e)}var du=function(){this.first=!0};du.prototype.update=function(e,t){var r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=r,!0))};var Le={"Latin-1 Supplement":function(e){return e>=128&&e<=255},Arabic:function(e){return e>=1536&&e<=1791},"Arabic Supplement":function(e){return e>=1872&&e<=1919},"Arabic Extended-A":function(e){return e>=2208&&e<=2303},"Hangul Jamo":function(e){return e>=4352&&e<=4607},"Unified Canadian Aboriginal Syllabics":function(e){return e>=5120&&e<=5759},Khmer:function(e){return e>=6016&&e<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(e){return e>=6320&&e<=6399},"General Punctuation":function(e){return e>=8192&&e<=8303},"Letterlike Symbols":function(e){return e>=8448&&e<=8527},"Number Forms":function(e){return e>=8528&&e<=8591},"Miscellaneous Technical":function(e){return e>=8960&&e<=9215},"Control Pictures":function(e){return e>=9216&&e<=9279},"Optical Character Recognition":function(e){return e>=9280&&e<=9311},"Enclosed Alphanumerics":function(e){return e>=9312&&e<=9471},"Geometric Shapes":function(e){return e>=9632&&e<=9727},"Miscellaneous Symbols":function(e){return e>=9728&&e<=9983},"Miscellaneous Symbols and Arrows":function(e){return e>=11008&&e<=11263},"CJK Radicals Supplement":function(e){return e>=11904&&e<=12031},"Kangxi Radicals":function(e){return e>=12032&&e<=12255},"Ideographic Description Characters":function(e){return e>=12272&&e<=12287},"CJK Symbols and Punctuation":function(e){return e>=12288&&e<=12351},Hiragana:function(e){return e>=12352&&e<=12447},Katakana:function(e){return e>=12448&&e<=12543},Bopomofo:function(e){return e>=12544&&e<=12591},"Hangul Compatibility Jamo":function(e){return e>=12592&&e<=12687},Kanbun:function(e){return e>=12688&&e<=12703},"Bopomofo Extended":function(e){return e>=12704&&e<=12735},"CJK Strokes":function(e){return e>=12736&&e<=12783},"Katakana Phonetic Extensions":function(e){return e>=12784&&e<=12799},"Enclosed CJK Letters and Months":function(e){return e>=12800&&e<=13055},"CJK Compatibility":function(e){return e>=13056&&e<=13311},"CJK Unified Ideographs Extension A":function(e){return e>=13312&&e<=19903},"Yijing Hexagram Symbols":function(e){return e>=19904&&e<=19967},"CJK Unified Ideographs":function(e){return e>=19968&&e<=40959},"Yi Syllables":function(e){return e>=40960&&e<=42127},"Yi Radicals":function(e){return e>=42128&&e<=42191},"Hangul Jamo Extended-A":function(e){return e>=43360&&e<=43391},"Hangul Syllables":function(e){return e>=44032&&e<=55215},"Hangul Jamo Extended-B":function(e){return e>=55216&&e<=55295},"Private Use Area":function(e){return e>=57344&&e<=63743},"CJK Compatibility Ideographs":function(e){return e>=63744&&e<=64255},"Arabic Presentation Forms-A":function(e){return e>=64336&&e<=65023},"Vertical Forms":function(e){return e>=65040&&e<=65055},"CJK Compatibility Forms":function(e){return e>=65072&&e<=65103},"Small Form Variants":function(e){return e>=65104&&e<=65135},"Arabic Presentation Forms-B":function(e){return e>=65136&&e<=65279},"Halfwidth and Fullwidth Forms":function(e){return e>=65280&&e<=65519}};function mu(e){for(var t=0,r=e;t<r.length;t+=1)if(ps(r[t].charCodeAt(0)))return!0;return!1}function ps(e){return!(e!==746&&e!==747&&(e<4352||!(Le["Bopomofo Extended"](e)||Le.Bopomofo(e)||Le["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||Le["CJK Compatibility Ideographs"](e)||Le["CJK Compatibility"](e)||Le["CJK Radicals Supplement"](e)||Le["CJK Strokes"](e)||!(!Le["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||e===12336)||Le["CJK Unified Ideographs Extension A"](e)||Le["CJK Unified Ideographs"](e)||Le["Enclosed CJK Letters and Months"](e)||Le["Hangul Compatibility Jamo"](e)||Le["Hangul Jamo Extended-A"](e)||Le["Hangul Jamo Extended-B"](e)||Le["Hangul Jamo"](e)||Le["Hangul Syllables"](e)||Le.Hiragana(e)||Le["Ideographic Description Characters"](e)||Le.Kanbun(e)||Le["Kangxi Radicals"](e)||Le["Katakana Phonetic Extensions"](e)||Le.Katakana(e)&&e!==12540||!(!Le["Halfwidth and Fullwidth Forms"](e)||e===65288||e===65289||e===65293||e>=65306&&e<=65310||e===65339||e===65341||e===65343||e>=65371&&e<=65503||e===65507||e>=65512&&e<=65519)||!(!Le["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||Le["Unified Canadian Aboriginal Syllabics"](e)||Le["Unified Canadian Aboriginal Syllabics Extended"](e)||Le["Vertical Forms"](e)||Le["Yijing Hexagram Symbols"](e)||Le["Yi Syllables"](e)||Le["Yi Radicals"](e))))}function yu(e){return!(ps(e)||(function(t){return!!(Le["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||Le["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||Le["Letterlike Symbols"](t)||Le["Number Forms"](t)||Le["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||Le["Control Pictures"](t)&&t!==9251||Le["Optical Character Recognition"](t)||Le["Enclosed Alphanumerics"](t)||Le["Geometric Shapes"](t)||Le["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Le["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Le["CJK Symbols and Punctuation"](t)||Le.Katakana(t)||Le["Private Use Area"](t)||Le["CJK Compatibility Forms"](t)||Le["Small Form Variants"](t)||Le["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)})(e))}function sn(e){return e>=1424&&e<=2303||Le["Arabic Presentation Forms-A"](e)||Le["Arabic Presentation Forms-B"](e)}function Gi(e,t){return!(!t&&sn(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||Le.Khmer(e))}function hs(e){for(var t=0,r=e;t<r.length;t+=1)if(sn(r[t].charCodeAt(0)))return!0;return!1}var fs=null,Zi="unavailable",Ln=null,Bl=function(e){e&&typeof e=="string"&&e.indexOf("NetworkError")>-1&&(Zi="error"),fs&&fs(e)};function Ma(){vu.fire(new Z("pluginStateChange",{pluginStatus:Zi,pluginURL:Ln}))}var vu=new ie,gu=function(){return Zi},_n=function(){if(Zi!=="deferred"||!Ln)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Zi="loading",Ma(),Ln&&ii({url:Ln},(function(e){e?Bl(e):(Zi="loaded",Ma())}))},Qi={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Zi==="loaded"||Qi.applyArabicShaping!=null},isLoading:function(){return Zi==="loading"},setState:function(e){Zi=e.pluginStatus,Ln=e.pluginURL},isParsed:function(){return Qi.applyArabicShaping!=null&&Qi.processBidirectionalText!=null&&Qi.processStyledBidirectionalText!=null},getPluginURL:function(){return Ln}},Ct=function(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new du,this.transition={})};Ct.prototype.isSupportedScript=function(e){return(function(t,r){for(var a=0,l=t;a<l.length;a+=1)if(!Gi(l[a].charCodeAt(0),r))return!1;return!0})(e,Qi.isLoaded())},Ct.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Ct.prototype.getCrossfadeParameters=function(){var e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}};var Tn=function(e,t){this.property=e,this.value=t,this.expression=(function(r,a){if(rs(r))return new Yo(r,a);if(wa(r)){var l=Il(r,a);if(l.result==="error")throw new Error(l.value.map((function(h){return h.key+": "+h.message})).join(", "));return l.value}var c=r;return typeof r=="string"&&a.type==="color"&&(c=Zt.parse(r)),{kind:"constant",evaluate:function(){return c}}})(t===void 0?e.specification.default:t,e.specification)};Tn.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},Tn.prototype.possiblyEvaluate=function(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)};var un=function(e){this.property=e,this.value=new Tn(e,void 0)};un.prototype.transitioned=function(e,t){return new Mo(this.property,this.value,t,Re({},e.transition,this.transition),e.now)},un.prototype.untransitioned=function(){return new Mo(this.property,this.value,null,{},0)};var yi=function(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)};yi.prototype.getValue=function(e){return kt(this._values[e].value.value)},yi.prototype.setValue=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new un(this._values[e].property)),this._values[e].value=new Tn(this._values[e].property,t===null?void 0:kt(t))},yi.prototype.getTransition=function(e){return kt(this._values[e].transition)},yi.prototype.setTransition=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new un(this._values[e].property)),this._values[e].transition=kt(t)||void 0},yi.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t],l=this.getValue(a);l!==void 0&&(e[a]=l);var c=this.getTransition(a);c!==void 0&&(e[a+"-transition"]=c)}return e},yi.prototype.transitioned=function(e,t){for(var r=new eo(this._properties),a=0,l=Object.keys(this._values);a<l.length;a+=1){var c=l[a];r._values[c]=this._values[c].transitioned(e,t._values[c])}return r},yi.prototype.untransitioned=function(){for(var e=new eo(this._properties),t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t];e._values[a]=this._values[a].untransitioned()}return e};var Mo=function(e,t,r,a,l){this.property=e,this.value=t,this.begin=l+a.delay||0,this.end=this.begin+a.duration||0,e.specification.transition&&(a.delay||a.duration)&&(this.prior=r)};Mo.prototype.possiblyEvaluate=function(e,t,r){var a=e.now||0,l=this.value.possiblyEvaluate(e,t,r),c=this.prior;if(c){if(a>this.end)return this.prior=null,l;if(this.value.isDataDriven())return this.prior=null,l;if(a<this.begin)return c.possiblyEvaluate(e,t,r);var h=(a-this.begin)/(this.end-this.begin);return this.property.interpolate(c.possiblyEvaluate(e,t,r),l,(function(m){if(m<=0)return 0;if(m>=1)return 1;var g=m*m,x=g*m;return 4*(m<.5?x:3*(m-g)+x-.75)})(h))}return l};var eo=function(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)};eo.prototype.possiblyEvaluate=function(e,t,r){for(var a=new Ba(this._properties),l=0,c=Object.keys(this._values);l<c.length;l+=1){var h=c[l];a._values[h]=this._values[h].possiblyEvaluate(e,t,r)}return a},eo.prototype.hasTransition=function(){for(var e=0,t=Object.keys(this._values);e<t.length;e+=1)if(this._values[t[e]].prior)return!0;return!1};var xn=function(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)};xn.prototype.getValue=function(e){return kt(this._values[e].value)},xn.prototype.setValue=function(e,t){this._values[e]=new Tn(this._values[e].property,t===null?void 0:kt(t))},xn.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t],l=this.getValue(a);l!==void 0&&(e[a]=l)}return e},xn.prototype.possiblyEvaluate=function(e,t,r){for(var a=new Ba(this._properties),l=0,c=Object.keys(this._values);l<c.length;l+=1){var h=c[l];a._values[h]=this._values[h].possiblyEvaluate(e,t,r)}return a};var Ti=function(e,t,r){this.property=e,this.value=t,this.parameters=r};Ti.prototype.isConstant=function(){return this.value.kind==="constant"},Ti.prototype.constantOr=function(e){return this.value.kind==="constant"?this.value.value:e},Ti.prototype.evaluate=function(e,t,r,a){return this.property.evaluate(this.value,this.parameters,e,t,r,a)};var Ba=function(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)};Ba.prototype.get=function(e){return this._values[e]};var it=function(e){this.specification=e};it.prototype.possiblyEvaluate=function(e,t){return e.expression.evaluate(t)},it.prototype.interpolate=function(e,t,r){var a=Ho[this.specification.type];return a?a(e,t,r):e};var Ye=function(e,t){this.specification=e,this.overrides=t};Ye.prototype.possiblyEvaluate=function(e,t,r,a){return new Ti(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(t,null,{},r,a)}:e.expression,t)},Ye.prototype.interpolate=function(e,t,r){if(e.value.kind!=="constant"||t.value.kind!=="constant")return e;if(e.value.value===void 0||t.value.value===void 0)return new Ti(this,{kind:"constant",value:void 0},e.parameters);var a=Ho[this.specification.type];return a?new Ti(this,{kind:"constant",value:a(e.value.value,t.value.value,r)},e.parameters):e},Ye.prototype.evaluate=function(e,t,r,a,l,c){return e.kind==="constant"?e.value:e.evaluate(t,r,a,l,c)};var ds=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.possiblyEvaluate=function(r,a,l,c){if(r.value===void 0)return new Ti(this,{kind:"constant",value:void 0},a);if(r.expression.kind==="constant"){var h=r.expression.evaluate(a,null,{},l,c),m=r.property.specification.type==="resolvedImage"&&typeof h!="string"?h.name:h,g=this._calculate(m,m,m,a);return new Ti(this,{kind:"constant",value:g},a)}if(r.expression.kind==="camera"){var x=this._calculate(r.expression.evaluate({zoom:a.zoom-1}),r.expression.evaluate({zoom:a.zoom}),r.expression.evaluate({zoom:a.zoom+1}),a);return new Ti(this,{kind:"constant",value:x},a)}return new Ti(this,r.expression,a)},t.prototype.evaluate=function(r,a,l,c,h,m){if(r.kind==="source"){var g=r.evaluate(a,l,c,h,m);return this._calculate(g,g,g,a)}return r.kind==="composite"?this._calculate(r.evaluate({zoom:Math.floor(a.zoom)-1},l,c),r.evaluate({zoom:Math.floor(a.zoom)},l,c),r.evaluate({zoom:Math.floor(a.zoom)+1},l,c),a):r.value},t.prototype._calculate=function(r,a,l,c){return c.zoom>c.zoomHistory.lastIntegerZoom?{from:r,to:a}:{from:l,to:a}},t.prototype.interpolate=function(r){return r},t})(Ye),Ai=function(e){this.specification=e};Ai.prototype.possiblyEvaluate=function(e,t,r,a){if(e.value!==void 0){if(e.expression.kind==="constant"){var l=e.expression.evaluate(t,null,{},r,a);return this._calculate(l,l,l,t)}return this._calculate(e.expression.evaluate(new Ct(Math.floor(t.zoom-1),t)),e.expression.evaluate(new Ct(Math.floor(t.zoom),t)),e.expression.evaluate(new Ct(Math.floor(t.zoom+1),t)),t)}},Ai.prototype._calculate=function(e,t,r,a){return a.zoom>a.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},Ai.prototype.interpolate=function(e){return e};var bn=function(e){this.specification=e};bn.prototype.possiblyEvaluate=function(e,t,r,a){return!!e.expression.evaluate(t,null,{},r,a)},bn.prototype.interpolate=function(){return!1};var vi=function(e){for(var t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],e){var r=e[t];r.specification.overridable&&this.overridableProperties.push(t);var a=this.defaultPropertyValues[t]=new Tn(r,void 0),l=this.defaultTransitionablePropertyValues[t]=new un(r);this.defaultTransitioningPropertyValues[t]=l.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=a.possiblyEvaluate({})}};Xe("DataDrivenProperty",Ye),Xe("DataConstantProperty",it),Xe("CrossFadedDataDrivenProperty",ds),Xe("CrossFadedProperty",Ai),Xe("ColorRampProperty",bn);var An=(function(e){function t(r,a){if(e.call(this),this.id=r.id,this.type=r.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},r.type!=="custom"&&(this.metadata=(r=r).metadata,this.minzoom=r.minzoom,this.maxzoom=r.maxzoom,r.type!=="background"&&(this.source=r.source,this.sourceLayer=r["source-layer"],this.filter=r.filter),a.layout&&(this._unevaluatedLayout=new xn(a.layout)),a.paint)){for(var l in this._transitionablePaint=new yi(a.paint),r.paint)this.setPaintProperty(l,r.paint[l],{validate:!1});for(var c in r.layout)this.setLayoutProperty(c,r.layout[c],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ba(a.paint)}}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},t.prototype.getLayoutProperty=function(r){return r==="visibility"?this.visibility:this._unevaluatedLayout.getValue(r)},t.prototype.setLayoutProperty=function(r,a,l){l===void 0&&(l={}),a!=null&&this._validate(Pa,"layers."+this.id+".layout."+r,r,a,l)||(r!=="visibility"?this._unevaluatedLayout.setValue(r,a):this.visibility=a)},t.prototype.getPaintProperty=function(r){return Ge(r,"-transition")?this._transitionablePaint.getTransition(r.slice(0,-11)):this._transitionablePaint.getValue(r)},t.prototype.setPaintProperty=function(r,a,l){if(l===void 0&&(l={}),a!=null&&this._validate(Uc,"layers."+this.id+".paint."+r,r,a,l))return!1;if(Ge(r,"-transition"))return this._transitionablePaint.setTransition(r.slice(0,-11),a||void 0),!1;var c=this._transitionablePaint._values[r],h=c.property.specification["property-type"]==="cross-faded-data-driven",m=c.value.isDataDriven(),g=c.value;this._transitionablePaint.setValue(r,a),this._handleSpecialPaintPropertyUpdate(r);var x=this._transitionablePaint._values[r].value;return x.isDataDriven()||m||h||this._handleOverridablePaintPropertyUpdate(r,g,x)},t.prototype._handleSpecialPaintPropertyUpdate=function(r){},t.prototype._handleOverridablePaintPropertyUpdate=function(r,a,l){return!1},t.prototype.isHidden=function(r){return!!(this.minzoom&&r<this.minzoom)||!!(this.maxzoom&&r>=this.maxzoom)||this.visibility==="none"},t.prototype.updateTransitions=function(r){this._transitioningPaint=this._transitionablePaint.transitioned(r,this._transitioningPaint)},t.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},t.prototype.recalculate=function(r,a){r.getCrossfadeParameters&&(this._crossfadeParameters=r.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(r,void 0,a)),this.paint=this._transitioningPaint.possiblyEvaluate(r,void 0,a)},t.prototype.serialize=function(){var r={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&&(r.layout=r.layout||{},r.layout.visibility=this.visibility),tt(r,(function(a,l){return!(a===void 0||l==="layout"&&!Object.keys(a).length||l==="paint"&&!Object.keys(a).length)}))},t.prototype._validate=function(r,a,l,c,h){return h===void 0&&(h={}),(!h||h.validate!==!1)&&Ca(this,r.call(Ea,{key:a,layerType:this.type,objectKey:l,value:c,styleSpec:L,style:{glyphs:!0,sprite:!0}}))},t.prototype.is3D=function(){return!1},t.prototype.isTileClipped=function(){return!1},t.prototype.hasOffscreenPass=function(){return!1},t.prototype.resize=function(){},t.prototype.isStateDependent=function(){for(var r in this.paint._values){var a=this.paint.get(r);if(a instanceof Ti&&Eo(a.property.specification)&&(a.value.kind==="source"||a.value.kind==="composite")&&a.value.isStateDependent)return!0}return!1},t})(ie),_u={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},ms=function(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Xt=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function ai(e,t){t===void 0&&(t=1);var r=0,a=0;return{members:e.map((function(l){var c=_u[l.type].BYTES_PER_ELEMENT,h=r=zl(r,Math.max(t,c)),m=l.components||1;return a=Math.max(a,c),r+=c*m,{name:l.name,type:l.type,components:m,offset:h}})),size:zl(r,Math.max(a,t)),alignment:t}}function zl(e,t){return Math.ceil(e/t)*t}Xt.serialize=function(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}},Xt.deserialize=function(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t},Xt.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Xt.prototype.clear=function(){this.length=0},Xt.prototype.resize=function(e){this.reserve(e),this.length=e},Xt.prototype.reserve=function(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}},Xt.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Bo=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var l=this.length;return this.resize(l+1),this.emplace(l,r,a)},t.prototype.emplace=function(r,a,l){var c=2*r;return this.int16[c+0]=a,this.int16[c+1]=l,r},t})(Xt);Bo.prototype.bytesPerElement=4,Xe("StructArrayLayout2i4",Bo);var xu=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,a,l,c)},t.prototype.emplace=function(r,a,l,c,h){var m=4*r;return this.int16[m+0]=a,this.int16[m+1]=l,this.int16[m+2]=c,this.int16[m+3]=h,r},t})(Xt);xu.prototype.bytesPerElement=8,Xe("StructArrayLayout4i8",xu);var Fn=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m){var g=this.length;return this.resize(g+1),this.emplace(g,r,a,l,c,h,m)},t.prototype.emplace=function(r,a,l,c,h,m,g){var x=6*r;return this.int16[x+0]=a,this.int16[x+1]=l,this.int16[x+2]=c,this.int16[x+3]=h,this.int16[x+4]=m,this.int16[x+5]=g,r},t})(Xt);Fn.prototype.bytesPerElement=12,Xe("StructArrayLayout2i4i12",Fn);var $i=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m){var g=this.length;return this.resize(g+1),this.emplace(g,r,a,l,c,h,m)},t.prototype.emplace=function(r,a,l,c,h,m,g){var x=4*r,S=8*r;return this.int16[x+0]=a,this.int16[x+1]=l,this.uint8[S+4]=c,this.uint8[S+5]=h,this.uint8[S+6]=m,this.uint8[S+7]=g,r},t})(Xt);$i.prototype.bytesPerElement=8,Xe("StructArrayLayout2i4ub8",$i);var ta=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var l=this.length;return this.resize(l+1),this.emplace(l,r,a)},t.prototype.emplace=function(r,a,l){var c=2*r;return this.float32[c+0]=a,this.float32[c+1]=l,r},t})(Xt);ta.prototype.bytesPerElement=8,Xe("StructArrayLayout2f8",ta);var En=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,x,S,I){var C=this.length;return this.resize(C+1),this.emplace(C,r,a,l,c,h,m,g,x,S,I)},t.prototype.emplace=function(r,a,l,c,h,m,g,x,S,I,C){var z=10*r;return this.uint16[z+0]=a,this.uint16[z+1]=l,this.uint16[z+2]=c,this.uint16[z+3]=h,this.uint16[z+4]=m,this.uint16[z+5]=g,this.uint16[z+6]=x,this.uint16[z+7]=S,this.uint16[z+8]=I,this.uint16[z+9]=C,r},t})(Xt);En.prototype.bytesPerElement=20,Xe("StructArrayLayout10ui20",En);var ys=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,x,S,I,C,z){var j=this.length;return this.resize(j+1),this.emplace(j,r,a,l,c,h,m,g,x,S,I,C,z)},t.prototype.emplace=function(r,a,l,c,h,m,g,x,S,I,C,z,j){var G=12*r;return this.int16[G+0]=a,this.int16[G+1]=l,this.int16[G+2]=c,this.int16[G+3]=h,this.uint16[G+4]=m,this.uint16[G+5]=g,this.uint16[G+6]=x,this.uint16[G+7]=S,this.int16[G+8]=I,this.int16[G+9]=C,this.int16[G+10]=z,this.int16[G+11]=j,r},t})(Xt);ys.prototype.bytesPerElement=24,Xe("StructArrayLayout4i4ui4i24",ys);var ra=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,l)},t.prototype.emplace=function(r,a,l,c){var h=3*r;return this.float32[h+0]=a,this.float32[h+1]=l,this.float32[h+2]=c,r},t})(Xt);ra.prototype.bytesPerElement=12,Xe("StructArrayLayout3f12",ra);var za=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.uint32[1*r+0]=a,r},t})(Xt);za.prototype.bytesPerElement=4,Xe("StructArrayLayout1ul4",za);var bu=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,x,S){var I=this.length;return this.resize(I+1),this.emplace(I,r,a,l,c,h,m,g,x,S)},t.prototype.emplace=function(r,a,l,c,h,m,g,x,S,I){var C=10*r,z=5*r;return this.int16[C+0]=a,this.int16[C+1]=l,this.int16[C+2]=c,this.int16[C+3]=h,this.int16[C+4]=m,this.int16[C+5]=g,this.uint32[z+3]=x,this.uint16[C+8]=S,this.uint16[C+9]=I,r},t})(Xt);bu.prototype.bytesPerElement=20,Xe("StructArrayLayout6i1ul2ui20",bu);var ia=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m){var g=this.length;return this.resize(g+1),this.emplace(g,r,a,l,c,h,m)},t.prototype.emplace=function(r,a,l,c,h,m,g){var x=6*r;return this.int16[x+0]=a,this.int16[x+1]=l,this.int16[x+2]=c,this.int16[x+3]=h,this.int16[x+4]=m,this.int16[x+5]=g,r},t})(Xt);ia.prototype.bytesPerElement=12,Xe("StructArrayLayout2i2i2i12",ia);var zo=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h){var m=this.length;return this.resize(m+1),this.emplace(m,r,a,l,c,h)},t.prototype.emplace=function(r,a,l,c,h,m){var g=4*r,x=8*r;return this.float32[g+0]=a,this.float32[g+1]=l,this.float32[g+2]=c,this.int16[x+6]=h,this.int16[x+7]=m,r},t})(Xt);zo.prototype.bytesPerElement=16,Xe("StructArrayLayout2f1f2i16",zo);var wu=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,a,l,c)},t.prototype.emplace=function(r,a,l,c,h){var m=12*r,g=3*r;return this.uint8[m+0]=a,this.uint8[m+1]=l,this.float32[g+1]=c,this.float32[g+2]=h,r},t})(Xt);wu.prototype.bytesPerElement=12,Xe("StructArrayLayout2ub2f12",wu);var to=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,l)},t.prototype.emplace=function(r,a,l,c){var h=3*r;return this.uint16[h+0]=a,this.uint16[h+1]=l,this.uint16[h+2]=c,r},t})(Xt);to.prototype.bytesPerElement=6,Xe("StructArrayLayout3ui6",to);var ro=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,x,S,I,C,z,j,G,te,K,oe){var le=this.length;return this.resize(le+1),this.emplace(le,r,a,l,c,h,m,g,x,S,I,C,z,j,G,te,K,oe)},t.prototype.emplace=function(r,a,l,c,h,m,g,x,S,I,C,z,j,G,te,K,oe,le){var ce=24*r,he=12*r,xe=48*r;return this.int16[ce+0]=a,this.int16[ce+1]=l,this.uint16[ce+2]=c,this.uint16[ce+3]=h,this.uint32[he+2]=m,this.uint32[he+3]=g,this.uint32[he+4]=x,this.uint16[ce+10]=S,this.uint16[ce+11]=I,this.uint16[ce+12]=C,this.float32[he+7]=z,this.float32[he+8]=j,this.uint8[xe+36]=G,this.uint8[xe+37]=te,this.uint8[xe+38]=K,this.uint32[he+10]=oe,this.int16[ce+22]=le,r},t})(Xt);ro.prototype.bytesPerElement=48,Xe("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ro);var vs=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,x,S,I,C,z,j,G,te,K,oe,le,ce,he,xe,Pe,De,rt,Ue,ot,je,bt){var pt=this.length;return this.resize(pt+1),this.emplace(pt,r,a,l,c,h,m,g,x,S,I,C,z,j,G,te,K,oe,le,ce,he,xe,Pe,De,rt,Ue,ot,je,bt)},t.prototype.emplace=function(r,a,l,c,h,m,g,x,S,I,C,z,j,G,te,K,oe,le,ce,he,xe,Pe,De,rt,Ue,ot,je,bt,pt){var Qe=34*r,Tt=17*r;return this.int16[Qe+0]=a,this.int16[Qe+1]=l,this.int16[Qe+2]=c,this.int16[Qe+3]=h,this.int16[Qe+4]=m,this.int16[Qe+5]=g,this.int16[Qe+6]=x,this.int16[Qe+7]=S,this.uint16[Qe+8]=I,this.uint16[Qe+9]=C,this.uint16[Qe+10]=z,this.uint16[Qe+11]=j,this.uint16[Qe+12]=G,this.uint16[Qe+13]=te,this.uint16[Qe+14]=K,this.uint16[Qe+15]=oe,this.uint16[Qe+16]=le,this.uint16[Qe+17]=ce,this.uint16[Qe+18]=he,this.uint16[Qe+19]=xe,this.uint16[Qe+20]=Pe,this.uint16[Qe+21]=De,this.uint16[Qe+22]=rt,this.uint32[Tt+12]=Ue,this.float32[Tt+13]=ot,this.float32[Tt+14]=je,this.float32[Tt+15]=bt,this.float32[Tt+16]=pt,r},t})(Xt);vs.prototype.bytesPerElement=68,Xe("StructArrayLayout8i15ui1ul4f68",vs);var io=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.float32[1*r+0]=a,r},t})(Xt);io.prototype.bytesPerElement=4,Xe("StructArrayLayout1f4",io);var ln=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,l)},t.prototype.emplace=function(r,a,l,c){var h=3*r;return this.int16[h+0]=a,this.int16[h+1]=l,this.int16[h+2]=c,r},t})(Xt);ln.prototype.bytesPerElement=6,Xe("StructArrayLayout3i6",ln);var Su=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,l)},t.prototype.emplace=function(r,a,l,c){var h=4*r;return this.uint32[2*r+0]=a,this.uint16[h+2]=l,this.uint16[h+3]=c,r},t})(Xt);Su.prototype.bytesPerElement=8,Xe("StructArrayLayout1ul2ui8",Su);var Da=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var l=this.length;return this.resize(l+1),this.emplace(l,r,a)},t.prototype.emplace=function(r,a,l){var c=2*r;return this.uint16[c+0]=a,this.uint16[c+1]=l,r},t})(Xt);Da.prototype.bytesPerElement=4,Xe("StructArrayLayout2ui4",Da);var Iu=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.uint16[1*r+0]=a,r},t})(Xt);Iu.prototype.bytesPerElement=2,Xe("StructArrayLayout1ui2",Iu);var gs=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,a,l,c)},t.prototype.emplace=function(r,a,l,c,h){var m=4*r;return this.float32[m+0]=a,this.float32[m+1]=l,this.float32[m+2]=c,this.float32[m+3]=h,r},t})(Xt);gs.prototype.bytesPerElement=16,Xe("StructArrayLayout4f16",gs);var i=(function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new X(this.anchorPointX,this.anchorPointY)},Object.defineProperties(t.prototype,r),t})(ms);i.prototype.size=20;var o=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new i(this,r)},t})(bu);Xe("CollisionBoxArray",o);var n=(function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(a){this._structArray.uint8[this._pos1+37]=a},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(a){this._structArray.uint8[this._pos1+38]=a},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(a){this._structArray.uint32[this._pos4+10]=a},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(t.prototype,r),t})(ms);n.prototype.size=48;var s=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new n(this,r)},t})(ro);Xe("PlacedSymbolArray",s);var p=(function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(a){this._structArray.uint32[this._pos4+12]=a},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(t.prototype,r),t})(ms);p.prototype.size=68;var f=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new p(this,r)},t})(vs);Xe("SymbolInstanceArray",f);var d=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getoffsetX=function(r){return this.float32[1*r+0]},t})(io);Xe("GlyphOffsetArray",d);var v=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getx=function(r){return this.int16[3*r+0]},t.prototype.gety=function(r){return this.int16[3*r+1]},t.prototype.gettileUnitDistanceFromAnchor=function(r){return this.int16[3*r+2]},t})(ln);Xe("SymbolLineVertexArray",v);var w=(function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(t.prototype,r),t})(ms);w.prototype.size=8;var A=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new w(this,r)},t})(Su);Xe("FeatureIndexArray",A);var D=ai([{name:"a_pos",components:2,type:"Int16"}],4).members,F=function(e){e===void 0&&(e=[]),this.segments=e};function O(e,t){return 256*(e=Oe(Math.floor(e),0,255))+Oe(Math.floor(t),0,255)}F.prototype.prepareSegment=function(e,t,r,a){var l=this.segments[this.segments.length-1];return e>F.MAX_VERTEX_ARRAY_LENGTH&&St("Max vertices per segment is "+F.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+e),(!l||l.vertexLength+e>F.MAX_VERTEX_ARRAY_LENGTH||l.sortKey!==a)&&(l={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},a!==void 0&&(l.sortKey=a),this.segments.push(l)),l},F.prototype.get=function(){return this.segments},F.prototype.destroy=function(){for(var e=0,t=this.segments;e<t.length;e+=1){var r=t[e];for(var a in r.vaos)r.vaos[a].destroy()}},F.simpleSegment=function(e,t,r,a){return new F([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:a,vaos:{},sortKey:0}])},F.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Xe("SegmentVector",F);var W=ai([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),$=U((function(e){e.exports=function(t,r){var a,l,c,h,m,g,x,S;for(l=t.length-(a=3&t.length),c=r,m=3432918353,g=461845907,S=0;S<l;)x=255&t.charCodeAt(S)|(255&t.charCodeAt(++S))<<8|(255&t.charCodeAt(++S))<<16|(255&t.charCodeAt(++S))<<24,++S,c=27492+(65535&(h=5*(65535&(c=(c^=x=(65535&(x=(x=(65535&x)*m+(((x>>>16)*m&65535)<<16)&4294967295)<<15|x>>>17))*g+(((x>>>16)*g&65535)<<16)&4294967295)<<13|c>>>19))+((5*(c>>>16)&65535)<<16)&4294967295))+((58964+(h>>>16)&65535)<<16);switch(x=0,a){case 3:x^=(255&t.charCodeAt(S+2))<<16;case 2:x^=(255&t.charCodeAt(S+1))<<8;case 1:c^=x=(65535&(x=(x=(65535&(x^=255&t.charCodeAt(S)))*m+(((x>>>16)*m&65535)<<16)&4294967295)<<15|x>>>17))*g+(((x>>>16)*g&65535)<<16)&4294967295}return c^=t.length,c=2246822507*(65535&(c^=c>>>16))+((2246822507*(c>>>16)&65535)<<16)&4294967295,c=3266489909*(65535&(c^=c>>>13))+((3266489909*(c>>>16)&65535)<<16)&4294967295,(c^=c>>>16)>>>0}})),ee=U((function(e){e.exports=function(t,r){for(var a,l=t.length,c=r^l,h=0;l>=4;)a=1540483477*(65535&(a=255&t.charCodeAt(h)|(255&t.charCodeAt(++h))<<8|(255&t.charCodeAt(++h))<<16|(255&t.charCodeAt(++h))<<24))+((1540483477*(a>>>16)&65535)<<16),c=1540483477*(65535&c)+((1540483477*(c>>>16)&65535)<<16)^(a=1540483477*(65535&(a^=a>>>24))+((1540483477*(a>>>16)&65535)<<16)),l-=4,++h;switch(l){case 3:c^=(255&t.charCodeAt(h+2))<<16;case 2:c^=(255&t.charCodeAt(h+1))<<8;case 1:c=1540483477*(65535&(c^=255&t.charCodeAt(h)))+((1540483477*(c>>>16)&65535)<<16)}return c=1540483477*(65535&(c^=c>>>13))+((1540483477*(c>>>16)&65535)<<16),(c^=c>>>15)>>>0}})),N=$,Q=ee;N.murmur3=$,N.murmur2=Q;var ne=function(){this.ids=[],this.positions=[],this.indexed=!1};ne.prototype.add=function(e,t,r,a){this.ids.push(de(e)),this.positions.push(t,r,a)},ne.prototype.getPositions=function(e){for(var t=de(e),r=0,a=this.ids.length-1;r<a;){var l=r+a>>1;this.ids[l]>=t?a=l:r=l+1}for(var c=[];this.ids[r]===t;)c.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return c},ne.serialize=function(e,t){var r=new Float64Array(e.ids),a=new Uint32Array(e.positions);return(function l(c,h,m,g){for(;m<g;){for(var x=c[m+g>>1],S=m-1,I=g+1;;){do S++;while(c[S]<x);do I--;while(c[I]>x);if(S>=I)break;pe(c,S,I),pe(h,3*S,3*I),pe(h,3*S+1,3*I+1),pe(h,3*S+2,3*I+2)}I-m<g-I?(l(c,h,m,I),m=I+1):(l(c,h,I+1,g),g=I)}})(r,a,0,r.length-1),t&&t.push(r.buffer,a.buffer),{ids:r,positions:a}},ne.deserialize=function(e){var t=new ne;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t};var ue=Math.pow(2,53)-1;function de(e){var t=+e;return!isNaN(t)&&t<=ue?t:N(String(e))}function pe(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}Xe("FeaturePositionMap",ne);var ye=function(e,t){this.gl=e.gl,this.location=t},Ie=(function(e){function t(r,a){e.call(this,r,a),this.current=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){this.current!==r&&(this.current=r,this.gl.uniform1i(this.location,r))},t})(ye),Me=(function(e){function t(r,a){e.call(this,r,a),this.current=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){this.current!==r&&(this.current=r,this.gl.uniform1f(this.location,r))},t})(ye),Ce=(function(e){function t(r,a){e.call(this,r,a),this.current=[0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]||(this.current=r,this.gl.uniform2f(this.location,r[0],r[1]))},t})(ye),$e=(function(e){function t(r,a){e.call(this,r,a),this.current=[0,0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]||(this.current=r,this.gl.uniform3f(this.location,r[0],r[1],r[2]))},t})(ye),nt=(function(e){function t(r,a){e.call(this,r,a),this.current=[0,0,0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]&&r[3]===this.current[3]||(this.current=r,this.gl.uniform4f(this.location,r[0],r[1],r[2],r[3]))},t})(ye),ut=(function(e){function t(r,a){e.call(this,r,a),this.current=Zt.transparent}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r.r===this.current.r&&r.g===this.current.g&&r.b===this.current.b&&r.a===this.current.a||(this.current=r,this.gl.uniform4f(this.location,r.r,r.g,r.b,r.a))},t})(ye),st=new Float32Array(16),Lt=(function(e){function t(r,a){e.call(this,r,a),this.current=st}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){if(r[12]!==this.current[12]||r[0]!==this.current[0])return this.current=r,void this.gl.uniformMatrix4fv(this.location,!1,r);for(var a=1;a<16;a++)if(r[a]!==this.current[a]){this.current=r,this.gl.uniformMatrix4fv(this.location,!1,r);break}},t})(ye);function He(e){return[O(255*e.r,255*e.g),O(255*e.b,255*e.a)]}var mt=function(e,t,r){this.value=e,this.uniformNames=t.map((function(a){return"u_"+a})),this.type=r};mt.prototype.setUniform=function(e,t,r){e.set(r.constantOr(this.value))},mt.prototype.getBinding=function(e,t,r){return this.type==="color"?new ut(e,t):new Me(e,t)};var xt=function(e,t){this.uniformNames=t.map((function(r){return"u_"+r})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};xt.prototype.setConstantPatternPositions=function(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr},xt.prototype.setUniform=function(e,t,r,a){var l=a==="u_pattern_to"?this.patternTo:a==="u_pattern_from"?this.patternFrom:a==="u_pixel_ratio_to"?this.pixelRatioTo:a==="u_pixel_ratio_from"?this.pixelRatioFrom:null;l&&e.set(l)},xt.prototype.getBinding=function(e,t,r){return r.substr(0,9)==="u_pattern"?new nt(e,t):new Me(e,t)};var dt=function(e,t,r,a){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map((function(l){return{name:"a_"+l,type:"Float32",components:r==="color"?2:1,offset:0}})),this.paintVertexArray=new a};dt.prototype.populatePaintArray=function(e,t,r,a,l){var c=this.paintVertexArray.length,h=this.expression.evaluate(new Ct(0),t,{},a,[],l);this.paintVertexArray.resize(e),this._setPaintValue(c,e,h)},dt.prototype.updatePaintArray=function(e,t,r,a){var l=this.expression.evaluate({zoom:0},r,a);this._setPaintValue(e,t,l)},dt.prototype._setPaintValue=function(e,t,r){if(this.type==="color")for(var a=He(r),l=e;l<t;l++)this.paintVertexArray.emplace(l,a[0],a[1]);else{for(var c=e;c<t;c++)this.paintVertexArray.emplace(c,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}},dt.prototype.upload=function(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))},dt.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var ft=function(e,t,r,a,l,c){this.expression=e,this.uniformNames=t.map((function(h){return"u_"+h+"_t"})),this.type=r,this.useIntegerZoom=a,this.zoom=l,this.maxValue=0,this.paintVertexAttributes=t.map((function(h){return{name:"a_"+h,type:"Float32",components:r==="color"?4:2,offset:0}})),this.paintVertexArray=new c};ft.prototype.populatePaintArray=function(e,t,r,a,l){var c=this.expression.evaluate(new Ct(this.zoom),t,{},a,[],l),h=this.expression.evaluate(new Ct(this.zoom+1),t,{},a,[],l),m=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(m,e,c,h)},ft.prototype.updatePaintArray=function(e,t,r,a){var l=this.expression.evaluate({zoom:this.zoom},r,a),c=this.expression.evaluate({zoom:this.zoom+1},r,a);this._setPaintValue(e,t,l,c)},ft.prototype._setPaintValue=function(e,t,r,a){if(this.type==="color")for(var l=He(r),c=He(a),h=e;h<t;h++)this.paintVertexArray.emplace(h,l[0],l[1],c[0],c[1]);else{for(var m=e;m<t;m++)this.paintVertexArray.emplace(m,r,a);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(a))}},ft.prototype.upload=function(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))},ft.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},ft.prototype.setUniform=function(e,t){var r=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,a=Oe(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(a)},ft.prototype.getBinding=function(e,t,r){return new Me(e,t)};var gt=function(e,t,r,a,l,c){this.expression=e,this.type=t,this.useIntegerZoom=r,this.zoom=a,this.layerId=c,this.zoomInPaintVertexArray=new l,this.zoomOutPaintVertexArray=new l};gt.prototype.populatePaintArray=function(e,t,r){var a=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(a,e,t.patterns&&t.patterns[this.layerId],r)},gt.prototype.updatePaintArray=function(e,t,r,a,l){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],l)},gt.prototype._setPaintValues=function(e,t,r,a){if(a&&r){var l=a[r.min],c=a[r.mid],h=a[r.max];if(l&&c&&h)for(var m=e;m<t;m++)this.zoomInPaintVertexArray.emplace(m,c.tl[0],c.tl[1],c.br[0],c.br[1],l.tl[0],l.tl[1],l.br[0],l.br[1],c.pixelRatio,l.pixelRatio),this.zoomOutPaintVertexArray.emplace(m,c.tl[0],c.tl[1],c.br[0],c.br[1],h.tl[0],h.tl[1],h.br[0],h.br[1],c.pixelRatio,h.pixelRatio)}},gt.prototype.upload=function(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,W.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,W.members,this.expression.isStateDependent))},gt.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var ht=function(e,t,r){this.binders={},this._buffers=[];var a=[];for(var l in e.paint._values)if(r(l)){var c=e.paint.get(l);if(c instanceof Ti&&Eo(c.property.specification)){var h=Jr(l,e.type),m=c.value,g=c.property.specification.type,x=c.property.useIntegerZoom,S=c.property.specification["property-type"],I=S==="cross-faded"||S==="cross-faded-data-driven";if(m.kind==="constant")this.binders[l]=I?new xt(m.value,h):new mt(m.value,h,g),a.push("/u_"+l);else if(m.kind==="source"||I){var C=Ir(l,g,"source");this.binders[l]=I?new gt(m,g,x,t,C,e.id):new dt(m,h,g,C),a.push("/a_"+l)}else{var z=Ir(l,g,"composite");this.binders[l]=new ft(m,h,g,x,t,z),a.push("/z_"+l)}}}this.cacheKey=a.sort().join("")};ht.prototype.getMaxValue=function(e){var t=this.binders[e];return t instanceof dt||t instanceof ft?t.maxValue:0},ht.prototype.populatePaintArrays=function(e,t,r,a,l){for(var c in this.binders){var h=this.binders[c];(h instanceof dt||h instanceof ft||h instanceof gt)&&h.populatePaintArray(e,t,r,a,l)}},ht.prototype.setConstantPatternPositions=function(e,t){for(var r in this.binders){var a=this.binders[r];a instanceof xt&&a.setConstantPatternPositions(e,t)}},ht.prototype.updatePaintArrays=function(e,t,r,a,l){var c=!1;for(var h in e)for(var m=0,g=t.getPositions(h);m<g.length;m+=1){var x=g[m],S=r.feature(x.index);for(var I in this.binders){var C=this.binders[I];if((C instanceof dt||C instanceof ft||C instanceof gt)&&C.expression.isStateDependent===!0){var z=a.paint.get(I);C.expression=z.value,C.updatePaintArray(x.start,x.end,S,e[h],l),c=!0}}}return c},ht.prototype.defines=function(){var e=[];for(var t in this.binders){var r=this.binders[t];(r instanceof mt||r instanceof xt)&&e.push.apply(e,r.uniformNames.map((function(a){return"#define HAS_UNIFORM_"+a})))}return e},ht.prototype.getBinderAttributes=function(){var e=[];for(var t in this.binders){var r=this.binders[t];if(r instanceof dt||r instanceof ft)for(var a=0;a<r.paintVertexAttributes.length;a++)e.push(r.paintVertexAttributes[a].name);else if(r instanceof gt)for(var l=0;l<W.members.length;l++)e.push(W.members[l].name)}return e},ht.prototype.getBinderUniforms=function(){var e=[];for(var t in this.binders){var r=this.binders[t];if(r instanceof mt||r instanceof xt||r instanceof ft)for(var a=0,l=r.uniformNames;a<l.length;a+=1)e.push(l[a])}return e},ht.prototype.getPaintVertexBuffers=function(){return this._buffers},ht.prototype.getUniforms=function(e,t){var r=[];for(var a in this.binders){var l=this.binders[a];if(l instanceof mt||l instanceof xt||l instanceof ft)for(var c=0,h=l.uniformNames;c<h.length;c+=1){var m=h[c];if(t[m]){var g=l.getBinding(e,t[m],m);r.push({name:m,property:a,binding:g})}}}return r},ht.prototype.setUniforms=function(e,t,r,a){for(var l=0,c=t;l<c.length;l+=1){var h=c[l],m=h.name,g=h.property;this.binders[g].setUniform(h.binding,a,r.get(g),m)}},ht.prototype.updatePaintBuffers=function(e){for(var t in this._buffers=[],this.binders){var r=this.binders[t];if(e&&r instanceof gt){var a=e.fromScale===2?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;a&&this._buffers.push(a)}else(r instanceof dt||r instanceof ft)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}},ht.prototype.upload=function(e){for(var t in this.binders){var r=this.binders[t];(r instanceof dt||r instanceof ft||r instanceof gt)&&r.upload(e)}this.updatePaintBuffers()},ht.prototype.destroy=function(){for(var e in this.binders){var t=this.binders[e];(t instanceof dt||t instanceof ft||t instanceof gt)&&t.destroy()}};var ct=function(e,t,r){r===void 0&&(r=function(){return!0}),this.programConfigurations={};for(var a=0,l=e;a<l.length;a+=1){var c=l[a];this.programConfigurations[c.id]=new ht(c,t,r)}this.needsUpload=!1,this._featureMap=new ne,this._bufferOffset=0};function Jr(e,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[e]||[e.replace(t+"-","").replace(/-/g,"_")]}function Ir(e,t,r){var a={color:{source:ta,composite:gs},number:{source:io,composite:ta}},l=(function(c){return{"line-pattern":{source:En,composite:En},"fill-pattern":{source:En,composite:En},"fill-extrusion-pattern":{source:En,composite:En}}[c]})(e);return l&&l[r]||a[t][r]}ct.prototype.populatePaintArrays=function(e,t,r,a,l,c){for(var h in this.programConfigurations)this.programConfigurations[h].populatePaintArrays(e,t,a,l,c);t.id!==void 0&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0},ct.prototype.updatePaintArrays=function(e,t,r,a){for(var l=0,c=r;l<c.length;l+=1){var h=c[l];this.needsUpload=this.programConfigurations[h.id].updatePaintArrays(e,this._featureMap,t,h,a)||this.needsUpload}},ct.prototype.get=function(e){return this.programConfigurations[e]},ct.prototype.upload=function(e){if(this.needsUpload){for(var t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}},ct.prototype.destroy=function(){for(var e in this.programConfigurations)this.programConfigurations[e].destroy()},Xe("ConstantBinder",mt),Xe("CrossFadedConstantBinder",xt),Xe("SourceExpressionBinder",dt),Xe("CrossFadedCompositeBinder",gt),Xe("CompositeExpressionBinder",ft),Xe("ProgramConfiguration",ht,{omit:["_buffers"]}),Xe("ProgramConfigurationSet",ct);var gi=Math.pow(2,14)-1,si=-gi-1;function wr(e){for(var t=8192/e.extent,r=e.loadGeometry(),a=0;a<r.length;a++)for(var l=r[a],c=0;c<l.length;c++){var h=l[c],m=Math.round(h.x*t),g=Math.round(h.y*t);h.x=Oe(m,si,gi),h.y=Oe(g,si,gi),(m<h.x||m>h.x+1||g<h.y||g>h.y+1)&&St("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function kr(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?wr(e):[]}}function Wi(e,t,r,a,l){e.emplaceBack(2*t+(a+1)/2,2*r+(l+1)/2)}var Ei=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Bo,this.indexArray=new to,this.segments=new F,this.programConfigurations=new ct(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function no(e,t){for(var r=0;r<e.length;r++)if(Pn(t,e[r]))return!0;for(var a=0;a<t.length;a++)if(Pn(e,t[a]))return!0;return!!Ra(e,t)}function Ri(e,t,r){return!!Pn(e,t)||!!oo(t,e,r)}function wn(e,t){if(e.length===1)return La(t,e[0]);for(var r=0;r<t.length;r++)for(var a=t[r],l=0;l<a.length;l++)if(Pn(e,a[l]))return!0;for(var c=0;c<e.length;c++)if(La(t,e[c]))return!0;for(var h=0;h<t.length;h++)if(Ra(e,t[h]))return!0;return!1}function cn(e,t,r){if(e.length>1){if(Ra(e,t))return!0;for(var a=0;a<t.length;a++)if(oo(t[a],e,r))return!0}for(var l=0;l<e.length;l++)if(oo(e[l],t,r))return!0;return!1}function Ra(e,t){if(e.length===0||t.length===0)return!1;for(var r=0;r<e.length-1;r++)for(var a=e[r],l=e[r+1],c=0;c<t.length-1;c++)if(na(a,l,t[c],t[c+1]))return!0;return!1}function na(e,t,r,a){return Ut(e,r,a)!==Ut(t,r,a)&&Ut(e,t,r)!==Ut(e,t,a)}function oo(e,t,r){var a=r*r;if(t.length===1)return e.distSqr(t[0])<a;for(var l=1;l<t.length;l++)if(oa(e,t[l-1],t[l])<a)return!0;return!1}function oa(e,t,r){var a=t.distSqr(r);if(a===0)return e.distSqr(t);var l=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/a;return e.distSqr(l<0?t:l>1?r:r.sub(t)._mult(l)._add(t))}function La(e,t){for(var r,a,l,c=!1,h=0;h<e.length;h++)for(var m=0,g=(r=e[h]).length-1;m<r.length;g=m++)(a=r[m]).y>t.y!=(l=r[g]).y>t.y&&t.x<(l.x-a.x)*(t.y-a.y)/(l.y-a.y)+a.x&&(c=!c);return c}function Pn(e,t){for(var r=!1,a=0,l=e.length-1;a<e.length;l=a++){var c=e[a],h=e[l];c.y>t.y!=h.y>t.y&&t.x<(h.x-c.x)*(t.y-c.y)/(h.y-c.y)+c.x&&(r=!r)}return r}function Fa(e,t,r){var a=r[0],l=r[2];if(e.x<a.x&&t.x<a.x||e.x>l.x&&t.x>l.x||e.y<a.y&&t.y<a.y||e.y>l.y&&t.y>l.y)return!1;var c=Ut(e,t,r[0]);return c!==Ut(e,t,r[1])||c!==Ut(e,t,r[2])||c!==Ut(e,t,r[3])}function Cn(e,t,r){var a=t.paint.get(e).value;return a.kind==="constant"?a.value:r.programConfigurations.get(t.id).getMaxValue(e)}function Yr(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function On(e,t,r,a,l){if(!t[0]&&!t[1])return e;var c=X.convert(t)._mult(l);r==="viewport"&&c._rotate(-a);for(var h=[],m=0;m<e.length;m++)h.push(e[m].sub(c));return h}Ei.prototype.populate=function(e,t,r){var a=this.layers[0],l=[],c=null;a.type==="circle"&&(c=a.layout.get("circle-sort-key"));for(var h=0,m=e;h<m.length;h+=1){var g=m[h],x=g.feature,S=g.id,I=g.index,C=g.sourceLayerIndex,z=this.layers[0]._featureFilter.needGeometry,j=kr(x,z);if(this.layers[0]._featureFilter.filter(new Ct(this.zoom),j,r)){var G=c?c.evaluate(j,{},r):void 0,te={id:S,properties:x.properties,type:x.type,sourceLayerIndex:C,index:I,geometry:z?j.geometry:wr(x),patterns:{},sortKey:G};l.push(te)}}c&&l.sort((function(De,rt){return De.sortKey-rt.sortKey}));for(var K=0,oe=l;K<oe.length;K+=1){var le=oe[K],ce=le.geometry,he=le.index,xe=le.sourceLayerIndex,Pe=e[he].feature;this.addFeature(le,ce,he,r),t.featureIndex.insert(Pe,ce,he,xe,this.index)}},Ei.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},Ei.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Ei.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Ei.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,D),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},Ei.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Ei.prototype.addFeature=function(e,t,r,a){for(var l=0,c=t;l<c.length;l+=1)for(var h=0,m=c[l];h<m.length;h+=1){var g=m[h],x=g.x,S=g.y;if(!(x<0||x>=8192||S<0||S>=8192)){var I=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),C=I.vertexLength;Wi(this.layoutVertexArray,x,S,-1,-1),Wi(this.layoutVertexArray,x,S,1,-1),Wi(this.layoutVertexArray,x,S,1,1),Wi(this.layoutVertexArray,x,S,-1,1),this.indexArray.emplaceBack(C,C+1,C+2),this.indexArray.emplaceBack(C,C+3,C+2),I.vertexLength+=4,I.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},a)},Xe("CircleBucket",Ei,{omit:["layers"]});var ao=new vi({"circle-sort-key":new Ye(L.layout_circle["circle-sort-key"])}),Do={paint:new vi({"circle-radius":new Ye(L.paint_circle["circle-radius"]),"circle-color":new Ye(L.paint_circle["circle-color"]),"circle-blur":new Ye(L.paint_circle["circle-blur"]),"circle-opacity":new Ye(L.paint_circle["circle-opacity"]),"circle-translate":new it(L.paint_circle["circle-translate"]),"circle-translate-anchor":new it(L.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new it(L.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new it(L.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ye(L.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ye(L.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ye(L.paint_circle["circle-stroke-opacity"])}),layout:ao},$t=typeof Float32Array<"u"?Float32Array:Array;function en(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Li(e,t,r){var a=t[0],l=t[1],c=t[2],h=t[3],m=t[4],g=t[5],x=t[6],S=t[7],I=t[8],C=t[9],z=t[10],j=t[11],G=t[12],te=t[13],K=t[14],oe=t[15],le=r[0],ce=r[1],he=r[2],xe=r[3];return e[0]=le*a+ce*m+he*I+xe*G,e[1]=le*l+ce*g+he*C+xe*te,e[2]=le*c+ce*x+he*z+xe*K,e[3]=le*h+ce*S+he*j+xe*oe,e[4]=(le=r[4])*a+(ce=r[5])*m+(he=r[6])*I+(xe=r[7])*G,e[5]=le*l+ce*g+he*C+xe*te,e[6]=le*c+ce*x+he*z+xe*K,e[7]=le*h+ce*S+he*j+xe*oe,e[8]=(le=r[8])*a+(ce=r[9])*m+(he=r[10])*I+(xe=r[11])*G,e[9]=le*l+ce*g+he*C+xe*te,e[10]=le*c+ce*x+he*z+xe*K,e[11]=le*h+ce*S+he*j+xe*oe,e[12]=(le=r[12])*a+(ce=r[13])*m+(he=r[14])*I+(xe=r[15])*G,e[13]=le*l+ce*g+he*C+xe*te,e[14]=le*c+ce*x+he*z+xe*K,e[15]=le*h+ce*S+he*j+xe*oe,e}Math.hypot||(Math.hypot=function(){for(var e=arguments,t=0,r=arguments.length;r--;)t+=e[r]*e[r];return Math.sqrt(t)});var Ro,Nc=Li;function _s(e,t,r){var a=t[0],l=t[1],c=t[2],h=t[3];return e[0]=r[0]*a+r[4]*l+r[8]*c+r[12]*h,e[1]=r[1]*a+r[5]*l+r[9]*c+r[13]*h,e[2]=r[2]*a+r[6]*l+r[10]*c+r[14]*h,e[3]=r[3]*a+r[7]*l+r[11]*c+r[15]*h,e}Ro=new $t(3),$t!=Float32Array&&(Ro[0]=0,Ro[1]=0,Ro[2]=0),(function(){var e=new $t(4);$t!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0)})();var jc=((function(){var e=new $t(2);$t!=Float32Array&&(e[0]=0,e[1]=0)})(),(function(e){function t(r){e.call(this,r,Do)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new Ei(r)},t.prototype.queryRadius=function(r){var a=r;return Cn("circle-radius",this,a)+Cn("circle-stroke-width",this,a)+Yr(this.paint.get("circle-translate"))},t.prototype.queryIntersectsFeature=function(r,a,l,c,h,m,g,x){for(var S=On(r,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),m.angle,g),I=this.paint.get("circle-radius").evaluate(a,l)+this.paint.get("circle-stroke-width").evaluate(a,l),C=this.paint.get("circle-pitch-alignment")==="map",z=C?S:(function(Pe,De){return Pe.map((function(rt){return Oa(rt,De)}))})(S,x),j=C?I*g:I,G=0,te=c;G<te.length;G+=1)for(var K=0,oe=te[G];K<oe.length;K+=1){var le=oe[K],ce=C?le:Oa(le,x),he=j,xe=_s([],[le.x,le.y,0,1],x);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?he*=xe[3]/m.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(he*=m.cameraToCenterDistance/xe[3]),Ri(z,ce,he))return!0}return!1},t})(An));function Oa(e,t){var r=_s([],[e.x,e.y,0,1],t);return new X(r[0]/r[3],r[1]/r[3])}var Dl=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(Ei);function aa(e,t,r,a){var l=t.width,c=t.height;if(a){if(a instanceof Uint8ClampedArray)a=new Uint8Array(a.buffer);else if(a.length!==l*c*r)throw new RangeError("mismatched image size")}else a=new Uint8Array(l*c*r);return e.width=l,e.height=c,e.data=a,e}function xs(e,t,r){var a=t.width,l=t.height;if(a!==e.width||l!==e.height){var c=aa({},{width:a,height:l},r);Gc(e,c,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,a),height:Math.min(e.height,l)},r),e.width=a,e.height=l,e.data=c.data}}function Gc(e,t,r,a,l,c){if(l.width===0||l.height===0)return t;if(l.width>e.width||l.height>e.height||r.x>e.width-l.width||r.y>e.height-l.height)throw new RangeError("out of range source coordinates for image copy");if(l.width>t.width||l.height>t.height||a.x>t.width-l.width||a.y>t.height-l.height)throw new RangeError("out of range destination coordinates for image copy");for(var h=e.data,m=t.data,g=0;g<l.height;g++)for(var x=((r.y+g)*e.width+r.x)*c,S=((a.y+g)*t.width+a.x)*c,I=0;I<l.width*c;I++)m[S+I]=h[x+I];return t}Xe("HeatmapBucket",Dl,{omit:["layers"]});var Va=function(e,t){aa(this,e,1,t)};Va.prototype.resize=function(e){xs(this,e,1)},Va.prototype.clone=function(){return new Va({width:this.width,height:this.height},new Uint8Array(this.data))},Va.copy=function(e,t,r,a,l){Gc(e,t,r,a,l,1)};var Hi=function(e,t){aa(this,e,4,t)};Hi.prototype.resize=function(e){xs(this,e,4)},Hi.prototype.replace=function(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e},Hi.prototype.clone=function(){return new Hi({width:this.width,height:this.height},new Uint8Array(this.data))},Hi.copy=function(e,t,r,a,l){Gc(e,t,r,a,l,4)},Xe("AlphaImage",Va),Xe("RGBAImage",Hi);var Zx={paint:new vi({"heatmap-radius":new Ye(L.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ye(L.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new it(L.paint_heatmap["heatmap-intensity"]),"heatmap-color":new bn(L.paint_heatmap["heatmap-color"]),"heatmap-opacity":new it(L.paint_heatmap["heatmap-opacity"])})};function um(e){var t={},r=e.resolution||256,a=e.clips?e.clips.length:1,l=e.image||new Hi({width:r,height:a}),c=function(j,G,te){t[e.evaluationKey]=te;var K=e.expression.evaluate(t);l.data[j+G+0]=Math.floor(255*K.r/K.a),l.data[j+G+1]=Math.floor(255*K.g/K.a),l.data[j+G+2]=Math.floor(255*K.b/K.a),l.data[j+G+3]=Math.floor(255*K.a)};if(e.clips)for(var h=0,m=0;h<a;++h,m+=4*r)for(var g=0,x=0;g<r;g++,x+=4){var S=g/(r-1),I=e.clips[h];c(m,x,I.start*(1-S)+I.end*S)}else for(var C=0,z=0;C<r;C++,z+=4)c(0,z,C/(r-1));return l}var $x=(function(e){function t(r){e.call(this,r,Zx),this._updateColorRamp()}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new Dl(r)},t.prototype._handleSpecialPaintPropertyUpdate=function(r){r==="heatmap-color"&&this._updateColorRamp()},t.prototype._updateColorRamp=function(){this.colorRamp=um({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},t.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype.hasOffscreenPass=function(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"},t})(An),Wx={paint:new vi({"hillshade-illumination-direction":new it(L.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new it(L.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new it(L.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new it(L.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new it(L.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new it(L.paint_hillshade["hillshade-accent-color"])})},Hx=(function(e){function t(r){e.call(this,r,Wx)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.hasOffscreenPass=function(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"},t})(An),Xx=ai([{name:"a_pos",components:2,type:"Int16"}],4).members,Zc=Rl,Kx=Rl;function Rl(e,t,r){r=r||2;var a,l,c,h,m,g,x,S=t&&t.length,I=S?t[0]*r:e.length,C=lm(e,0,I,r,!0),z=[];if(!C||C.next===C.prev)return z;if(S&&(C=(function(G,te,K,oe){var le,ce,he,xe=[];for(le=0,ce=te.length;le<ce;le++)(he=lm(G,te[le]*oe,le<ce-1?te[le+1]*oe:G.length,oe,!1))===he.next&&(he.steiner=!0),xe.push(nb(he));for(xe.sort(tb),le=0;le<xe.length;le++)rb(xe[le],K),K=sa(K,K.next);return K})(e,t,C,r)),e.length>80*r){a=c=e[0],l=h=e[1];for(var j=r;j<I;j+=r)(m=e[j])<a&&(a=m),(g=e[j+1])<l&&(l=g),m>c&&(c=m),g>h&&(h=g);x=(x=Math.max(c-a,h-l))!==0?1/x:0}return Tu(C,z,r,a,l,x),z}function lm(e,t,r,a,l){var c,h;if(l===Hc(e,t,r,a)>0)for(c=t;c<r;c+=a)h=hm(c,e[c],e[c+1],h);else for(c=r-a;c>=t;c-=a)h=hm(c,e[c],e[c+1],h);return h&&Ll(h,h.next)&&(Eu(h),h=h.next),h}function sa(e,t){if(!e)return e;t||(t=e);var r,a=e;do if(r=!1,a.steiner||!Ll(a,a.next)&&Zr(a.prev,a,a.next)!==0)a=a.next;else{if(Eu(a),(a=t=a.prev)===a.next)break;r=!0}while(r||a!==t);return t}function Tu(e,t,r,a,l,c,h){if(e){!h&&c&&(function(S,I,C,z){var j=S;do j.z===null&&(j.z=$c(j.x,j.y,I,C,z)),j.prevZ=j.prev,j.nextZ=j.next,j=j.next;while(j!==S);j.prevZ.nextZ=null,j.prevZ=null,(function(G){var te,K,oe,le,ce,he,xe,Pe,De=1;do{for(K=G,G=null,ce=null,he=0;K;){for(he++,oe=K,xe=0,te=0;te<De&&(xe++,oe=oe.nextZ);te++);for(Pe=De;xe>0||Pe>0&&oe;)xe!==0&&(Pe===0||!oe||K.z<=oe.z)?(le=K,K=K.nextZ,xe--):(le=oe,oe=oe.nextZ,Pe--),ce?ce.nextZ=le:G=le,le.prevZ=ce,ce=le;K=oe}ce.nextZ=null,De*=2}while(he>1)})(j)})(e,a,l,c);for(var m,g,x=e;e.prev!==e.next;)if(m=e.prev,g=e.next,c?Yx(e,a,l,c):Jx(e))t.push(m.i/r),t.push(e.i/r),t.push(g.i/r),Eu(e),e=g.next,x=g.next;else if((e=g)===x){h?h===1?Tu(e=Qx(sa(e),t,r),t,r,a,l,c,2):h===2&&eb(e,t,r,a,l,c):Tu(sa(e),t,r,a,l,c,1);break}}}function Jx(e){var t=e.prev,r=e,a=e.next;if(Zr(t,r,a)>=0)return!1;for(var l=e.next.next;l!==e.prev;){if(bs(t.x,t.y,r.x,r.y,a.x,a.y,l.x,l.y)&&Zr(l.prev,l,l.next)>=0)return!1;l=l.next}return!0}function Yx(e,t,r,a){var l=e.prev,c=e,h=e.next;if(Zr(l,c,h)>=0)return!1;for(var m=l.x>c.x?l.x>h.x?l.x:h.x:c.x>h.x?c.x:h.x,g=l.y>c.y?l.y>h.y?l.y:h.y:c.y>h.y?c.y:h.y,x=$c(l.x<c.x?l.x<h.x?l.x:h.x:c.x<h.x?c.x:h.x,l.y<c.y?l.y<h.y?l.y:h.y:c.y<h.y?c.y:h.y,t,r,a),S=$c(m,g,t,r,a),I=e.prevZ,C=e.nextZ;I&&I.z>=x&&C&&C.z<=S;){if(I!==e.prev&&I!==e.next&&bs(l.x,l.y,c.x,c.y,h.x,h.y,I.x,I.y)&&Zr(I.prev,I,I.next)>=0||(I=I.prevZ,C!==e.prev&&C!==e.next&&bs(l.x,l.y,c.x,c.y,h.x,h.y,C.x,C.y)&&Zr(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;I&&I.z>=x;){if(I!==e.prev&&I!==e.next&&bs(l.x,l.y,c.x,c.y,h.x,h.y,I.x,I.y)&&Zr(I.prev,I,I.next)>=0)return!1;I=I.prevZ}for(;C&&C.z<=S;){if(C!==e.prev&&C!==e.next&&bs(l.x,l.y,c.x,c.y,h.x,h.y,C.x,C.y)&&Zr(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function Qx(e,t,r){var a=e;do{var l=a.prev,c=a.next.next;!Ll(l,c)&&cm(l,a,a.next,c)&&Au(l,c)&&Au(c,l)&&(t.push(l.i/r),t.push(a.i/r),t.push(c.i/r),Eu(a),Eu(a.next),a=e=c),a=a.next}while(a!==e);return sa(a)}function eb(e,t,r,a,l,c){var h=e;do{for(var m=h.next.next;m!==h.prev;){if(h.i!==m.i&&ob(h,m)){var g=pm(h,m);return h=sa(h,h.next),g=sa(g,g.next),Tu(h,t,r,a,l,c),void Tu(g,t,r,a,l,c)}m=m.next}h=h.next}while(h!==e)}function tb(e,t){return e.x-t.x}function rb(e,t){if(t=(function(a,l){var c,h=l,m=a.x,g=a.y,x=-1/0;do{if(g<=h.y&&g>=h.next.y&&h.next.y!==h.y){var S=h.x+(g-h.y)*(h.next.x-h.x)/(h.next.y-h.y);if(S<=m&&S>x){if(x=S,S===m){if(g===h.y)return h;if(g===h.next.y)return h.next}c=h.x<h.next.x?h:h.next}}h=h.next}while(h!==l);if(!c)return null;if(m===x)return c;var I,C=c,z=c.x,j=c.y,G=1/0;h=c;do m>=h.x&&h.x>=z&&m!==h.x&&bs(g<j?m:x,g,z,j,g<j?x:m,g,h.x,h.y)&&(I=Math.abs(g-h.y)/(m-h.x),Au(h,a)&&(I<G||I===G&&(h.x>c.x||h.x===c.x&&ib(c,h)))&&(c=h,G=I)),h=h.next;while(h!==C);return c})(e,t)){var r=pm(t,e);sa(t,t.next),sa(r,r.next)}}function ib(e,t){return Zr(e.prev,e,t.prev)<0&&Zr(t.next,e,e.next)<0}function $c(e,t,r,a,l){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*l)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-a)*l)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function nb(e){var t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function bs(e,t,r,a,l,c,h,m){return(l-h)*(t-m)-(e-h)*(c-m)>=0&&(e-h)*(a-m)-(r-h)*(t-m)>=0&&(r-h)*(c-m)-(l-h)*(a-m)>=0}function ob(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!(function(r,a){var l=r;do{if(l.i!==r.i&&l.next.i!==r.i&&l.i!==a.i&&l.next.i!==a.i&&cm(l,l.next,r,a))return!0;l=l.next}while(l!==r);return!1})(e,t)&&(Au(e,t)&&Au(t,e)&&(function(r,a){var l=r,c=!1,h=(r.x+a.x)/2,m=(r.y+a.y)/2;do l.y>m!=l.next.y>m&&l.next.y!==l.y&&h<(l.next.x-l.x)*(m-l.y)/(l.next.y-l.y)+l.x&&(c=!c),l=l.next;while(l!==r);return c})(e,t)&&(Zr(e.prev,e,t.prev)||Zr(e,t.prev,t))||Ll(e,t)&&Zr(e.prev,e,e.next)>0&&Zr(t.prev,t,t.next)>0)}function Zr(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Ll(e,t){return e.x===t.x&&e.y===t.y}function cm(e,t,r,a){var l=Ol(Zr(e,t,r)),c=Ol(Zr(e,t,a)),h=Ol(Zr(r,a,e)),m=Ol(Zr(r,a,t));return l!==c&&h!==m||!(l!==0||!Fl(e,r,t))||!(c!==0||!Fl(e,a,t))||!(h!==0||!Fl(r,e,a))||!(m!==0||!Fl(r,t,a))}function Fl(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Ol(e){return e>0?1:e<0?-1:0}function Au(e,t){return Zr(e.prev,e,e.next)<0?Zr(e,t,e.next)>=0&&Zr(e,e.prev,t)>=0:Zr(e,t,e.prev)<0||Zr(e,e.next,t)<0}function pm(e,t){var r=new Wc(e.i,e.x,e.y),a=new Wc(t.i,t.x,t.y),l=e.next,c=t.prev;return e.next=t,t.prev=e,r.next=l,l.prev=r,a.next=r,r.prev=a,c.next=a,a.prev=c,a}function hm(e,t,r,a){var l=new Wc(e,t,r);return a?(l.next=a.next,l.prev=a,a.next.prev=l,a.next=l):(l.prev=l,l.next=l),l}function Eu(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Wc(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Hc(e,t,r,a){for(var l=0,c=t,h=r-a;c<r;c+=a)l+=(e[h]-e[c])*(e[c+1]+e[h+1]),h=c;return l}function ab(e,t,r,a,l){(function c(h,m,g,x,S){for(;x>g;){if(x-g>600){var I=x-g+1,C=m-g+1,z=Math.log(I),j=.5*Math.exp(2*z/3),G=.5*Math.sqrt(z*j*(I-j)/I)*(C-I/2<0?-1:1);c(h,m,Math.max(g,Math.floor(m-C*j/I+G)),Math.min(x,Math.floor(m+(I-C)*j/I+G)),S)}var te=h[m],K=g,oe=x;for(Pu(h,g,m),S(h[x],te)>0&&Pu(h,g,x);K<oe;){for(Pu(h,K,oe),K++,oe--;S(h[K],te)<0;)K++;for(;S(h[oe],te)>0;)oe--}S(h[g],te)===0?Pu(h,g,oe):Pu(h,++oe,x),oe<=m&&(g=oe+1),m<=oe&&(x=oe-1)}})(e,t,r,a||e.length-1,l||sb)}function Pu(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function sb(e,t){return e<t?-1:e>t?1:0}function Xc(e,t){var r=e.length;if(r<=1)return[e];for(var a,l,c=[],h=0;h<r;h++){var m=Hr(e[h]);m!==0&&(e[h].area=Math.abs(m),l===void 0&&(l=m<0),l===m<0?(a&&c.push(a),a=[e[h]]):a.push(e[h]))}if(a&&c.push(a),t>1)for(var g=0;g<c.length;g++)c[g].length<=t||(ab(c[g],t,1,c[g].length-1,ub),c[g]=c[g].slice(0,t));return c}function ub(e,t){return t.area-e.area}function Kc(e,t,r){for(var a=r.patternDependencies,l=!1,c=0,h=t;c<h.length;c+=1){var m=h[c].paint.get(e+"-pattern");m.isConstant()||(l=!0);var g=m.constantOr(null);g&&(l=!0,a[g.to]=!0,a[g.from]=!0)}return l}function Jc(e,t,r,a,l){for(var c=l.patternDependencies,h=0,m=t;h<m.length;h+=1){var g=m[h],x=g.paint.get(e+"-pattern").value;if(x.kind!=="constant"){var S=x.evaluate({zoom:a-1},r,{},l.availableImages),I=x.evaluate({zoom:a},r,{},l.availableImages),C=x.evaluate({zoom:a+1},r,{},l.availableImages);I=I&&I.name?I.name:I,C=C&&C.name?C.name:C,c[S=S&&S.name?S.name:S]=!0,c[I]=!0,c[C]=!0,r.patterns[g.id]={min:S,mid:I,max:C}}}return r}Rl.deviation=function(e,t,r,a){var l=t&&t.length,c=Math.abs(Hc(e,0,l?t[0]*r:e.length,r));if(l)for(var h=0,m=t.length;h<m;h++)c-=Math.abs(Hc(e,t[h]*r,h<m-1?t[h+1]*r:e.length,r));var g=0;for(h=0;h<a.length;h+=3){var x=a[h]*r,S=a[h+1]*r,I=a[h+2]*r;g+=Math.abs((e[x]-e[I])*(e[S+1]-e[x+1])-(e[x]-e[S])*(e[I+1]-e[x+1]))}return c===0&&g===0?0:Math.abs((g-c)/c)},Rl.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},a=0,l=0;l<e.length;l++){for(var c=0;c<e[l].length;c++)for(var h=0;h<t;h++)r.vertices.push(e[l][c][h]);l>0&&r.holes.push(a+=e[l-1].length)}return r},Zc.default=Kx;var Vn=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Bo,this.indexArray=new to,this.indexArray2=new Da,this.programConfigurations=new ct(e.layers,e.zoom),this.segments=new F,this.segments2=new F,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Vn.prototype.populate=function(e,t,r){this.hasPattern=Kc("fill",this.layers,t);for(var a=this.layers[0].layout.get("fill-sort-key"),l=[],c=0,h=e;c<h.length;c+=1){var m=h[c],g=m.feature,x=m.id,S=m.index,I=m.sourceLayerIndex,C=this.layers[0]._featureFilter.needGeometry,z=kr(g,C);if(this.layers[0]._featureFilter.filter(new Ct(this.zoom),z,r)){var j=a?a.evaluate(z,{},r,t.availableImages):void 0,G={id:x,properties:g.properties,type:g.type,sourceLayerIndex:I,index:S,geometry:C?z.geometry:wr(g),patterns:{},sortKey:j};l.push(G)}}a&&l.sort((function(Pe,De){return Pe.sortKey-De.sortKey}));for(var te=0,K=l;te<K.length;te+=1){var oe=K[te],le=oe.geometry,ce=oe.index,he=oe.sourceLayerIndex;if(this.hasPattern){var xe=Jc("fill",this.layers,oe,this.zoom,t);this.patternFeatures.push(xe)}else this.addFeature(oe,le,ce,r,{});t.featureIndex.insert(e[ce].feature,le,ce,he,this.index)}},Vn.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},Vn.prototype.addFeatures=function(e,t,r){for(var a=0,l=this.patternFeatures;a<l.length;a+=1){var c=l[a];this.addFeature(c,c.geometry,c.index,t,r)}},Vn.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Vn.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Vn.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Xx),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0},Vn.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},Vn.prototype.addFeature=function(e,t,r,a,l){for(var c=0,h=Xc(t,500);c<h.length;c+=1){for(var m=h[c],g=0,x=0,S=m;x<S.length;x+=1)g+=S[x].length;for(var I=this.segments.prepareSegment(g,this.layoutVertexArray,this.indexArray),C=I.vertexLength,z=[],j=[],G=0,te=m;G<te.length;G+=1){var K=te[G];if(K.length!==0){K!==m[0]&&j.push(z.length/2);var oe=this.segments2.prepareSegment(K.length,this.layoutVertexArray,this.indexArray2),le=oe.vertexLength;this.layoutVertexArray.emplaceBack(K[0].x,K[0].y),this.indexArray2.emplaceBack(le+K.length-1,le),z.push(K[0].x),z.push(K[0].y);for(var ce=1;ce<K.length;ce++)this.layoutVertexArray.emplaceBack(K[ce].x,K[ce].y),this.indexArray2.emplaceBack(le+ce-1,le+ce),z.push(K[ce].x),z.push(K[ce].y);oe.vertexLength+=K.length,oe.primitiveLength+=K.length}}for(var he=Zc(z,j),xe=0;xe<he.length;xe+=3)this.indexArray.emplaceBack(C+he[xe],C+he[xe+1],C+he[xe+2]);I.vertexLength+=g,I.primitiveLength+=he.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,l,a)},Xe("FillBucket",Vn,{omit:["layers","patternFeatures"]});var lb=new vi({"fill-sort-key":new Ye(L.layout_fill["fill-sort-key"])}),cb={paint:new vi({"fill-antialias":new it(L.paint_fill["fill-antialias"]),"fill-opacity":new Ye(L.paint_fill["fill-opacity"]),"fill-color":new Ye(L.paint_fill["fill-color"]),"fill-outline-color":new Ye(L.paint_fill["fill-outline-color"]),"fill-translate":new it(L.paint_fill["fill-translate"]),"fill-translate-anchor":new it(L.paint_fill["fill-translate-anchor"]),"fill-pattern":new ds(L.paint_fill["fill-pattern"])}),layout:lb},pb=(function(e){function t(r){e.call(this,r,cb)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.recalculate=function(r,a){e.prototype.recalculate.call(this,r,a);var l=this.paint._values["fill-outline-color"];l.value.kind==="constant"&&l.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},t.prototype.createBucket=function(r){return new Vn(r)},t.prototype.queryRadius=function(){return Yr(this.paint.get("fill-translate"))},t.prototype.queryIntersectsFeature=function(r,a,l,c,h,m,g){return wn(On(r,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),m.angle,g),c)},t.prototype.isTileClipped=function(){return!0},t})(An),hb=ai([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,fm=ws;function ws(e,t,r,a,l){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=a,this._values=l,e.readFields(fb,this,t)}function fb(e,t,r){e==1?t.id=r.readVarint():e==2?(function(a,l){for(var c=a.readVarint()+a.pos;a.pos<c;){var h=l._keys[a.readVarint()],m=l._values[a.readVarint()];l.properties[h]=m}})(r,t):e==3?t.type=r.readVarint():e==4&&(t._geometry=r.pos)}function db(e){for(var t,r,a=0,l=0,c=e.length,h=c-1;l<c;h=l++)a+=((r=e[h]).x-(t=e[l]).x)*(t.y+r.y);return a}ws.types=["Unknown","Point","LineString","Polygon"],ws.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,a=1,l=0,c=0,h=0,m=[];e.pos<r;){if(l<=0){var g=e.readVarint();a=7&g,l=g>>3}if(l--,a===1||a===2)c+=e.readSVarint(),h+=e.readSVarint(),a===1&&(t&&m.push(t),t=[]),t.push(new X(c,h));else{if(a!==7)throw new Error("unknown command "+a);t&&t.push(t[0].clone())}}return t&&m.push(t),m},ws.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,a=0,l=0,c=0,h=1/0,m=-1/0,g=1/0,x=-1/0;e.pos<t;){if(a<=0){var S=e.readVarint();r=7&S,a=S>>3}if(a--,r===1||r===2)(l+=e.readSVarint())<h&&(h=l),l>m&&(m=l),(c+=e.readSVarint())<g&&(g=c),c>x&&(x=c);else if(r!==7)throw new Error("unknown command "+r)}return[h,g,m,x]},ws.prototype.toGeoJSON=function(e,t,r){var a,l,c=this.extent*Math.pow(2,r),h=this.extent*e,m=this.extent*t,g=this.loadGeometry(),x=ws.types[this.type];function S(z){for(var j=0;j<z.length;j++){var G=z[j];z[j]=[360*(G.x+h)/c-180,360/Math.PI*Math.atan(Math.exp((180-360*(G.y+m)/c)*Math.PI/180))-90]}}switch(this.type){case 1:var I=[];for(a=0;a<g.length;a++)I[a]=g[a][0];S(g=I);break;case 2:for(a=0;a<g.length;a++)S(g[a]);break;case 3:for(g=(function(z){var j=z.length;if(j<=1)return[z];for(var G,te,K=[],oe=0;oe<j;oe++){var le=db(z[oe]);le!==0&&(te===void 0&&(te=le<0),te===le<0?(G&&K.push(G),G=[z[oe]]):G.push(z[oe]))}return G&&K.push(G),K})(g),a=0;a<g.length;a++)for(l=0;l<g[a].length;l++)S(g[a][l])}g.length===1?g=g[0]:x="Multi"+x;var C={type:"Feature",geometry:{type:x,coordinates:g},properties:this.properties};return"id"in this&&(C.id=this.id),C};var dm=mm;function mm(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(mb,this,t),this.length=this._features.length}function mb(e,t,r){e===15?t.version=r.readVarint():e===1?t.name=r.readString():e===5?t.extent=r.readVarint():e===2?t._features.push(r.pos):e===3?t._keys.push(r.readString()):e===4&&t._values.push((function(a){for(var l=null,c=a.readVarint()+a.pos;a.pos<c;){var h=a.readVarint()>>3;l=h===1?a.readString():h===2?a.readFloat():h===3?a.readDouble():h===4?a.readVarint64():h===5?a.readVarint():h===6?a.readSVarint():h===7?a.readBoolean():null}return l})(r))}function yb(e,t,r){if(e===3){var a=new dm(r,r.readVarint()+r.pos);a.length&&(t[a.name]=a)}}mm.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new fm(this._pbf,t,this.extent,this._keys,this._values)};var Ss={VectorTile:function(e,t){this.layers=e.readFields(yb,{},t)},VectorTileFeature:fm,VectorTileLayer:dm},vb=Ss.VectorTileFeature.types,Yc=Math.pow(2,13);function Cu(e,t,r,a,l,c,h,m){e.emplaceBack(t,r,2*Math.floor(a*Yc)+h,l*Yc*2,c*Yc*2,Math.round(m))}var qn=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Fn,this.indexArray=new to,this.programConfigurations=new ct(e.layers,e.zoom),this.segments=new F,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function gb(e,t){return e.x===t.x&&(e.x<0||e.x>8192)||e.y===t.y&&(e.y<0||e.y>8192)}qn.prototype.populate=function(e,t,r){this.features=[],this.hasPattern=Kc("fill-extrusion",this.layers,t);for(var a=0,l=e;a<l.length;a+=1){var c=l[a],h=c.feature,m=c.id,g=c.index,x=c.sourceLayerIndex,S=this.layers[0]._featureFilter.needGeometry,I=kr(h,S);if(this.layers[0]._featureFilter.filter(new Ct(this.zoom),I,r)){var C={id:m,sourceLayerIndex:x,index:g,geometry:S?I.geometry:wr(h),properties:h.properties,type:h.type,patterns:{}};this.hasPattern?this.features.push(Jc("fill-extrusion",this.layers,C,this.zoom,t)):this.addFeature(C,C.geometry,g,r,{}),t.featureIndex.insert(h,C.geometry,g,x,this.index,!0)}}},qn.prototype.addFeatures=function(e,t,r){for(var a=0,l=this.features;a<l.length;a+=1){var c=l[a];this.addFeature(c,c.geometry,c.index,t,r)}},qn.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},qn.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},qn.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},qn.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,hb),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},qn.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},qn.prototype.addFeature=function(e,t,r,a,l){for(var c=0,h=Xc(t,500);c<h.length;c+=1){for(var m=h[c],g=0,x=0,S=m;x<S.length;x+=1)g+=S[x].length;for(var I=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),C=0,z=m;C<z.length;C+=1){var j=z[C];if(j.length!==0&&!((Tt=j).every((function(vt){return vt.x<0}))||Tt.every((function(vt){return vt.x>8192}))||Tt.every((function(vt){return vt.y<0}))||Tt.every((function(vt){return vt.y>8192}))))for(var G=0,te=0;te<j.length;te++){var K=j[te];if(te>=1){var oe=j[te-1];if(!gb(K,oe)){I.vertexLength+4>F.MAX_VERTEX_ARRAY_LENGTH&&(I=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var le=K.sub(oe)._perp()._unit(),ce=oe.dist(K);G+ce>32768&&(G=0),Cu(this.layoutVertexArray,K.x,K.y,le.x,le.y,0,0,G),Cu(this.layoutVertexArray,K.x,K.y,le.x,le.y,0,1,G),Cu(this.layoutVertexArray,oe.x,oe.y,le.x,le.y,0,0,G+=ce),Cu(this.layoutVertexArray,oe.x,oe.y,le.x,le.y,0,1,G);var he=I.vertexLength;this.indexArray.emplaceBack(he,he+2,he+1),this.indexArray.emplaceBack(he+1,he+2,he+3),I.vertexLength+=4,I.primitiveLength+=2}}}}if(I.vertexLength+g>F.MAX_VERTEX_ARRAY_LENGTH&&(I=this.segments.prepareSegment(g,this.layoutVertexArray,this.indexArray)),vb[e.type]==="Polygon"){for(var xe=[],Pe=[],De=I.vertexLength,rt=0,Ue=m;rt<Ue.length;rt+=1){var ot=Ue[rt];if(ot.length!==0){ot!==m[0]&&Pe.push(xe.length/2);for(var je=0;je<ot.length;je++){var bt=ot[je];Cu(this.layoutVertexArray,bt.x,bt.y,0,0,1,1,0),xe.push(bt.x),xe.push(bt.y)}}}for(var pt=Zc(xe,Pe),Qe=0;Qe<pt.length;Qe+=3)this.indexArray.emplaceBack(De+pt[Qe],De+pt[Qe+2],De+pt[Qe+1]);I.primitiveLength+=pt.length/3,I.vertexLength+=g}}var Tt;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,l,a)},Xe("FillExtrusionBucket",qn,{omit:["layers","features"]});var _b={paint:new vi({"fill-extrusion-opacity":new it(L["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ye(L["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new it(L["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new it(L["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ds(L["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ye(L["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ye(L["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new it(L["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},xb=(function(e){function t(r){e.call(this,r,_b)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new qn(r)},t.prototype.queryRadius=function(){return Yr(this.paint.get("fill-extrusion-translate"))},t.prototype.is3D=function(){return!0},t.prototype.queryIntersectsFeature=function(r,a,l,c,h,m,g,x){var S=On(r,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),m.angle,g),I=this.paint.get("fill-extrusion-height").evaluate(a,l),C=this.paint.get("fill-extrusion-base").evaluate(a,l),z=(function(G,te,K,oe){for(var le=[],ce=0,he=G;ce<he.length;ce+=1){var xe=he[ce],Pe=[xe.x,xe.y,0,1];_s(Pe,Pe,te),le.push(new X(Pe[0]/Pe[3],Pe[1]/Pe[3]))}return le})(S,x),j=(function(G,te,K,oe){for(var le=[],ce=[],he=oe[8]*te,xe=oe[9]*te,Pe=oe[10]*te,De=oe[11]*te,rt=oe[8]*K,Ue=oe[9]*K,ot=oe[10]*K,je=oe[11]*K,bt=0,pt=G;bt<pt.length;bt+=1){for(var Qe=[],Tt=[],vt=0,Rt=pt[bt];vt<Rt.length;vt+=1){var at=Rt[vt],Vt=at.x,_r=at.y,Tr=oe[0]*Vt+oe[4]*_r+oe[12],Sr=oe[1]*Vt+oe[5]*_r+oe[13],xr=oe[2]*Vt+oe[6]*_r+oe[14],Ar=oe[3]*Vt+oe[7]*_r+oe[15],Qr=xr+Pe,ei=Ar+De,Ci=Tr+rt,li=Sr+Ue,ki=xr+ot,Mr=Ar+je,ci=new X((Tr+he)/ei,(Sr+xe)/ei);ci.z=Qr/ei,Qe.push(ci);var Mt=new X(Ci/Mr,li/Mr);Mt.z=ki/Mr,Tt.push(Mt)}le.push(Qe),ce.push(Tt)}return[le,ce]})(c,C,I,x);return(function(G,te,K){var oe=1/0;wn(K,te)&&(oe=ym(K,te[0]));for(var le=0;le<te.length;le++)for(var ce=te[le],he=G[le],xe=0;xe<ce.length-1;xe++){var Pe=ce[xe],De=[Pe,ce[xe+1],he[xe+1],he[xe],Pe];no(K,De)&&(oe=Math.min(oe,ym(K,De)))}return oe!==1/0&&oe})(j[0],j[1],z)},t})(An);function ku(e,t){return e.x*t.x+e.y*t.y}function ym(e,t){if(e.length===1){for(var r,a=0,l=t[a++];!r||l.equals(r);)if(!(r=t[a++]))return 1/0;for(;a<t.length;a++){var c=t[a],h=e[0],m=r.sub(l),g=c.sub(l),x=h.sub(l),S=ku(m,m),I=ku(m,g),C=ku(g,g),z=ku(x,m),j=ku(x,g),G=S*C-I*I,te=(C*z-I*j)/G,K=(S*j-I*z)/G,oe=l.z*(1-te-K)+r.z*te+c.z*K;if(isFinite(oe))return oe}return 1/0}for(var le=1/0,ce=0,he=t;ce<he.length;ce+=1)le=Math.min(le,he[ce].z);return le}var bb=ai([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,wb=ai([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,Sb=Ss.VectorTileFeature.types,Ib=Math.cos(Math.PI/180*37.5),vm=Math.pow(2,14)/.5,Fi=function(e){var t=this;this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(r){return r.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((function(r){t.gradients[r.id]={}})),this.layoutVertexArray=new $i,this.layoutVertexArray2=new ta,this.indexArray=new to,this.programConfigurations=new ct(e.layers,e.zoom),this.segments=new F,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((function(r){return r.isStateDependent()})).map((function(r){return r.id}))};Fi.prototype.populate=function(e,t,r){this.hasPattern=Kc("line",this.layers,t);for(var a=this.layers[0].layout.get("line-sort-key"),l=[],c=0,h=e;c<h.length;c+=1){var m=h[c],g=m.feature,x=m.id,S=m.index,I=m.sourceLayerIndex,C=this.layers[0]._featureFilter.needGeometry,z=kr(g,C);if(this.layers[0]._featureFilter.filter(new Ct(this.zoom),z,r)){var j=a?a.evaluate(z,{},r):void 0,G={id:x,properties:g.properties,type:g.type,sourceLayerIndex:I,index:S,geometry:C?z.geometry:wr(g),patterns:{},sortKey:j};l.push(G)}}a&&l.sort((function(Pe,De){return Pe.sortKey-De.sortKey}));for(var te=0,K=l;te<K.length;te+=1){var oe=K[te],le=oe.geometry,ce=oe.index,he=oe.sourceLayerIndex;if(this.hasPattern){var xe=Jc("line",this.layers,oe,this.zoom,t);this.patternFeatures.push(xe)}else this.addFeature(oe,le,ce,r,{});t.featureIndex.insert(e[ce].feature,le,ce,he,this.index)}},Fi.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},Fi.prototype.addFeatures=function(e,t,r){for(var a=0,l=this.patternFeatures;a<l.length;a+=1){var c=l[a];this.addFeature(c,c.geometry,c.index,t,r)}},Fi.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Fi.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Fi.prototype.upload=function(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,wb)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,bb),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},Fi.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Fi.prototype.lineFeatureClips=function(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}},Fi.prototype.addFeature=function(e,t,r,a,l){var c=this.layers[0].layout,h=c.get("line-join").evaluate(e,{}),m=c.get("line-cap"),g=c.get("line-miter-limit"),x=c.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(var S=0,I=t;S<I.length;S+=1)this.addLine(I[S],e,h,m,g,x);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,l,a)},Fi.prototype.addLine=function(e,t,r,a,l,c){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var h=0;h<e.length-1;h++)this.totalDistance+=e[h].dist(e[h+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var m=Sb[t.type]==="Polygon",g=e.length;g>=2&&e[g-1].equals(e[g-2]);)g--;for(var x=0;x<g-1&&e[x].equals(e[x+1]);)x++;if(!(g<(m?3:2))){r==="bevel"&&(l=1.05);var S,I=this.overscaling<=16?122880/(512*this.overscaling):0,C=this.segments.prepareSegment(10*g,this.layoutVertexArray,this.indexArray),z=void 0,j=void 0,G=void 0,te=void 0;this.e1=this.e2=-1,m&&(te=e[x].sub(S=e[g-2])._unit()._perp());for(var K=x;K<g;K++)if(!(j=K===g-1?m?e[x+1]:void 0:e[K+1])||!e[K].equals(j)){te&&(G=te),S&&(z=S),S=e[K],te=j?j.sub(S)._unit()._perp():G;var oe=(G=G||te).add(te);oe.x===0&&oe.y===0||oe._unit();var le=G.x*te.x+G.y*te.y,ce=oe.x*te.x+oe.y*te.y,he=ce!==0?1/ce:1/0,xe=2*Math.sqrt(2-2*ce),Pe=ce<Ib&&z&&j,De=G.x*te.y-G.y*te.x>0;if(Pe&&K>x){var rt=S.dist(z);if(rt>2*I){var Ue=S.sub(S.sub(z)._mult(I/rt)._round());this.updateDistance(z,Ue),this.addCurrentVertex(Ue,G,0,0,C),z=Ue}}var ot=z&&j,je=ot?r:m?"butt":a;if(ot&&je==="round"&&(he<c?je="miter":he<=2&&(je="fakeround")),je==="miter"&&he>l&&(je="bevel"),je==="bevel"&&(he>2&&(je="flipbevel"),he<l&&(je="miter")),z&&this.updateDistance(z,S),je==="miter")oe._mult(he),this.addCurrentVertex(S,oe,0,0,C);else if(je==="flipbevel"){if(he>100)oe=te.mult(-1);else{var bt=he*G.add(te).mag()/G.sub(te).mag();oe._perp()._mult(bt*(De?-1:1))}this.addCurrentVertex(S,oe,0,0,C),this.addCurrentVertex(S,oe.mult(-1),0,0,C)}else if(je==="bevel"||je==="fakeround"){var pt=-Math.sqrt(he*he-1),Qe=De?pt:0,Tt=De?0:pt;if(z&&this.addCurrentVertex(S,G,Qe,Tt,C),je==="fakeround")for(var vt=Math.round(180*xe/Math.PI/20),Rt=1;Rt<vt;Rt++){var at=Rt/vt;if(at!==.5){var Vt=at-.5;at+=at*Vt*(at-1)*((1.0904+le*(le*(3.55645-1.43519*le)-3.2452))*Vt*Vt+(.848013+le*(.215638*le-1.06021)))}var _r=te.sub(G)._mult(at)._add(G)._unit()._mult(De?-1:1);this.addHalfVertex(S,_r.x,_r.y,!1,De,0,C)}j&&this.addCurrentVertex(S,te,-Qe,-Tt,C)}else if(je==="butt")this.addCurrentVertex(S,oe,0,0,C);else if(je==="square"){var Tr=z?1:-1;this.addCurrentVertex(S,oe,Tr,Tr,C)}else je==="round"&&(z&&(this.addCurrentVertex(S,G,0,0,C),this.addCurrentVertex(S,G,1,1,C,!0)),j&&(this.addCurrentVertex(S,te,-1,-1,C,!0),this.addCurrentVertex(S,te,0,0,C)));if(Pe&&K<g-1){var Sr=S.dist(j);if(Sr>2*I){var xr=S.add(j.sub(S)._mult(I/Sr)._round());this.updateDistance(S,xr),this.addCurrentVertex(xr,te,0,0,C),S=xr}}}}},Fi.prototype.addCurrentVertex=function(e,t,r,a,l,c){c===void 0&&(c=!1);var h=t.y*a-t.x,m=-t.y-t.x*a;this.addHalfVertex(e,t.x+t.y*r,t.y-t.x*r,c,!1,r,l),this.addHalfVertex(e,h,m,c,!0,-a,l),this.distance>vm/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(e,t,r,a,l,c))},Fi.prototype.addHalfVertex=function(e,t,r,a,l,c,h){var m=.5*(this.lineClips?this.scaledDistance*(vm-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e.x<<1)+(a?1:0),(e.y<<1)+(l?1:0),Math.round(63*t)+128,Math.round(63*r)+128,1+(c===0?0:c<0?-1:1)|(63&m)<<2,m>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var g=h.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,g),h.primitiveLength++),l?this.e2=g:this.e1=g},Fi.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Fi.prototype.updateDistance=function(e,t){this.distance+=e.dist(t),this.updateScaledDistance()},Xe("LineBucket",Fi,{omit:["layers","patternFeatures"]});var Tb=new vi({"line-cap":new it(L.layout_line["line-cap"]),"line-join":new Ye(L.layout_line["line-join"]),"line-miter-limit":new it(L.layout_line["line-miter-limit"]),"line-round-limit":new it(L.layout_line["line-round-limit"]),"line-sort-key":new Ye(L.layout_line["line-sort-key"])}),gm={paint:new vi({"line-opacity":new Ye(L.paint_line["line-opacity"]),"line-color":new Ye(L.paint_line["line-color"]),"line-translate":new it(L.paint_line["line-translate"]),"line-translate-anchor":new it(L.paint_line["line-translate-anchor"]),"line-width":new Ye(L.paint_line["line-width"]),"line-gap-width":new Ye(L.paint_line["line-gap-width"]),"line-offset":new Ye(L.paint_line["line-offset"]),"line-blur":new Ye(L.paint_line["line-blur"]),"line-dasharray":new Ai(L.paint_line["line-dasharray"]),"line-pattern":new ds(L.paint_line["line-pattern"]),"line-gradient":new bn(L.paint_line["line-gradient"])}),layout:Tb},_m=new((function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.possiblyEvaluate=function(r,a){return a=new Ct(Math.floor(a.zoom),{now:a.now,fadeDuration:a.fadeDuration,zoomHistory:a.zoomHistory,transition:a.transition}),e.prototype.possiblyEvaluate.call(this,r,a)},t.prototype.evaluate=function(r,a,l,c){return a=Re({},a,{zoom:Math.floor(a.zoom)}),e.prototype.evaluate.call(this,r,a,l,c)},t})(Ye))(gm.paint.properties["line-width"].specification);_m.useIntegerZoom=!0;var Ab=(function(e){function t(r){e.call(this,r,gm),this.gradientVersion=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._handleSpecialPaintPropertyUpdate=function(r){r==="line-gradient"&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Ui,this.gradientVersion=(this.gradientVersion+1)%Te)},t.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},t.prototype.recalculate=function(r,a){e.prototype.recalculate.call(this,r,a),this.paint._values["line-floorwidth"]=_m.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,r)},t.prototype.createBucket=function(r){return new Fi(r)},t.prototype.queryRadius=function(r){var a=r,l=xm(Cn("line-width",this,a),Cn("line-gap-width",this,a)),c=Cn("line-offset",this,a);return l/2+Math.abs(c)+Yr(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(r,a,l,c,h,m,g){var x=On(r,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),m.angle,g),S=g/2*xm(this.paint.get("line-width").evaluate(a,l),this.paint.get("line-gap-width").evaluate(a,l)),I=this.paint.get("line-offset").evaluate(a,l);return I&&(c=(function(C,z){for(var j=[],G=new X(0,0),te=0;te<C.length;te++){for(var K=C[te],oe=[],le=0;le<K.length;le++){var ce=K[le],he=K[le+1],xe=le===0?G:ce.sub(K[le-1])._unit()._perp(),Pe=le===K.length-1?G:he.sub(ce)._unit()._perp(),De=xe._add(Pe)._unit();De._mult(1/(De.x*Pe.x+De.y*Pe.y)),oe.push(De._mult(z)._add(ce))}j.push(oe)}return j})(c,I*g)),(function(C,z,j){for(var G=0;G<z.length;G++){var te=z[G];if(C.length>=3){for(var K=0;K<te.length;K++)if(Pn(C,te[K]))return!0}if(cn(C,te,j))return!0}return!1})(x,c,S)},t.prototype.isTileClipped=function(){return!0},t})(An);function xm(e,t){return t>0?t+2*e:e}var Eb=ai([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Pb=ai([{name:"a_projected_pos",components:3,type:"Float32"}],4),Cb=(ai([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),ai([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),bm=(ai([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),ai([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),kb=ai([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Mb(e,t,r){return e.sections.forEach((function(a){a.text=(function(l,c,h){var m=c.layout.get("text-transform").evaluate(h,{});return m==="uppercase"?l=l.toLocaleUpperCase():m==="lowercase"&&(l=l.toLocaleLowerCase()),Qi.applyArabicShaping&&(l=Qi.applyArabicShaping(l)),l})(a.text,t,r)})),e}ai([{name:"triangle",components:3,type:"Uint16"}]),ai([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),ai([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),ai([{type:"Float32",name:"offsetX"}]),ai([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Mu={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},wm=function(e,t,r,a,l){var c,h,m=8*l-a-1,g=(1<<m)-1,x=g>>1,S=-7,I=l-1,C=-1,z=e[t+I];for(I+=C,c=z&(1<<-S)-1,z>>=-S,S+=m;S>0;c=256*c+e[t+I],I+=C,S-=8);for(h=c&(1<<-S)-1,c>>=-S,S+=a;S>0;h=256*h+e[t+I],I+=C,S-=8);if(c===0)c=1-x;else{if(c===g)return h?NaN:1/0*(z?-1:1);h+=Math.pow(2,a),c-=x}return(z?-1:1)*h*Math.pow(2,c-a)},Sm=function(e,t,r,a,l,c){var h,m,g,x=8*c-l-1,S=(1<<x)-1,I=S>>1,C=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,z=0,j=1,G=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(m=isNaN(t)?1:0,h=S):(h=Math.floor(Math.log(t)/Math.LN2),t*(g=Math.pow(2,-h))<1&&(h--,g*=2),(t+=h+I>=1?C/g:C*Math.pow(2,1-I))*g>=2&&(h++,g/=2),h+I>=S?(m=0,h=S):h+I>=1?(m=(t*g-1)*Math.pow(2,l),h+=I):(m=t*Math.pow(2,I-1)*Math.pow(2,l),h=0));l>=8;e[r+z]=255&m,z+=j,m/=256,l-=8);for(h=h<<l|m,x+=l;x>0;e[r+z]=255&h,z+=j,h/=256,x-=8);e[r+z-j]|=128*G},Vl=cr;function cr(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}cr.Varint=0,cr.Fixed64=1,cr.Bytes=2,cr.Fixed32=5;var Im=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Lo(e){return e.type===cr.Bytes?e.readVarint()+e.pos:e.pos+1}function Is(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function Tm(e,t,r){var a=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(a);for(var l=r.pos-1;l>=e;l--)r.buf[l+a]=r.buf[l]}function Bb(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function zb(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function Db(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function Rb(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function Lb(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function Fb(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function Ob(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function Vb(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function qb(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function ql(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function Ts(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function Am(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function Ub(e,t,r){e===1&&r.readMessage(Nb,t)}function Nb(e,t,r){if(e===3){var a=r.readMessage(jb,{}),l=a.width,c=a.height,h=a.left,m=a.top,g=a.advance;t.push({id:a.id,bitmap:new Va({width:l+6,height:c+6},a.bitmap),metrics:{width:l,height:c,left:h,top:m,advance:g}})}}function jb(e,t,r){e===1?t.id=r.readVarint():e===2?t.bitmap=r.readBytes():e===3?t.width=r.readVarint():e===4?t.height=r.readVarint():e===5?t.left=r.readSVarint():e===6?t.top=r.readSVarint():e===7&&(t.advance=r.readVarint())}function Em(e){for(var t=0,r=0,a=0,l=e;a<l.length;a+=1){var c=l[a];t+=c.w*c.h,r=Math.max(r,c.w)}e.sort((function(G,te){return te.h-G.h}));for(var h=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}],m=0,g=0,x=0,S=e;x<S.length;x+=1)for(var I=S[x],C=h.length-1;C>=0;C--){var z=h[C];if(!(I.w>z.w||I.h>z.h)){if(I.x=z.x,I.y=z.y,g=Math.max(g,I.y+I.h),m=Math.max(m,I.x+I.w),I.w===z.w&&I.h===z.h){var j=h.pop();C<h.length&&(h[C]=j)}else I.h===z.h?(z.x+=I.w,z.w-=I.w):I.w===z.w?(z.y+=I.h,z.h-=I.h):(h.push({x:z.x+I.w,y:z.y,w:z.w-I.w,h:I.h}),z.y+=I.h,z.h-=I.h);break}}return{w:m,h:g,fill:t/(m*g)||0}}cr.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var a=this.readVarint(),l=a>>3,c=this.pos;this.type=7&a,e(l,t,this),this.pos===c&&this.skip(a)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=ql(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=Am(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=ql(this.buf,this.pos)+4294967296*ql(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=ql(this.buf,this.pos)+4294967296*Am(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=wm(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=wm(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,a=this.buf;return t=127&(r=a[this.pos++]),r<128?t:(t|=(127&(r=a[this.pos++]))<<7,r<128?t:(t|=(127&(r=a[this.pos++]))<<14,r<128?t:(t|=(127&(r=a[this.pos++]))<<21,r<128?t:(function(l,c,h){var m,g,x=h.buf;if(m=(112&(g=x[h.pos++]))>>4,g<128||(m|=(127&(g=x[h.pos++]))<<3,g<128)||(m|=(127&(g=x[h.pos++]))<<10,g<128)||(m|=(127&(g=x[h.pos++]))<<17,g<128)||(m|=(127&(g=x[h.pos++]))<<24,g<128)||(m|=(1&(g=x[h.pos++]))<<31,g<128))return Is(l,m,c);throw new Error("Expected varint not more than 10 bytes")})(t|=(15&(r=a[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&Im?(function(r,a,l){return Im.decode(r.subarray(a,l))})(this.buf,t,e):(function(r,a,l){for(var c="",h=a;h<l;){var m,g,x,S=r[h],I=null,C=S>239?4:S>223?3:S>191?2:1;if(h+C>l)break;C===1?S<128&&(I=S):C===2?(192&(m=r[h+1]))==128&&(I=(31&S)<<6|63&m)<=127&&(I=null):C===3?(g=r[h+2],(192&(m=r[h+1]))==128&&(192&g)==128&&((I=(15&S)<<12|(63&m)<<6|63&g)<=2047||I>=55296&&I<=57343)&&(I=null)):C===4&&(g=r[h+2],x=r[h+3],(192&(m=r[h+1]))==128&&(192&g)==128&&(192&x)==128&&((I=(15&S)<<18|(63&m)<<12|(63&g)<<6|63&x)<=65535||I>=1114112)&&(I=null)),I===null?(I=65533,C=1):I>65535&&(I-=65536,c+=String.fromCharCode(I>>>10&1023|55296),I=56320|1023&I),c+=String.fromCharCode(I),h+=C}return c})(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==cr.Bytes)return e.push(this.readVarint(t));var r=Lo(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==cr.Bytes)return e.push(this.readSVarint());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==cr.Bytes)return e.push(this.readBoolean());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==cr.Bytes)return e.push(this.readFloat());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==cr.Bytes)return e.push(this.readDouble());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==cr.Bytes)return e.push(this.readFixed32());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==cr.Bytes)return e.push(this.readSFixed32());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==cr.Bytes)return e.push(this.readFixed64());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==cr.Bytes)return e.push(this.readSFixed64());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===cr.Varint)for(;this.buf[this.pos++]>127;);else if(t===cr.Bytes)this.pos=this.readVarint()+this.pos;else if(t===cr.Fixed32)this.pos+=4;else{if(t!==cr.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),Ts(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),Ts(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),Ts(this.buf,-1&e,this.pos),Ts(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),Ts(this.buf,-1&e,this.pos),Ts(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?(function(t,r){var a,l;if(t>=0?(a=t%4294967296|0,l=t/4294967296|0):(l=~(-t/4294967296),4294967295^(a=~(-t%4294967296))?a=a+1|0:(a=0,l=l+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),(function(c,h,m){m.buf[m.pos++]=127&c|128,c>>>=7,m.buf[m.pos++]=127&c|128,c>>>=7,m.buf[m.pos++]=127&c|128,c>>>=7,m.buf[m.pos++]=127&c|128,m.buf[m.pos]=127&(c>>>=7)})(a,0,r),(function(c,h){var m=(7&c)<<4;h.buf[h.pos++]|=m|((c>>>=3)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c)))))})(l,r)})(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(!!e)},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=(function(a,l,c){for(var h,m,g=0;g<l.length;g++){if((h=l.charCodeAt(g))>55295&&h<57344){if(!m){h>56319||g+1===l.length?(a[c++]=239,a[c++]=191,a[c++]=189):m=h;continue}if(h<56320){a[c++]=239,a[c++]=191,a[c++]=189,m=h;continue}h=m-55296<<10|h-56320|65536,m=null}else m&&(a[c++]=239,a[c++]=191,a[c++]=189,m=null);h<128?a[c++]=h:(h<2048?a[c++]=h>>6|192:(h<65536?a[c++]=h>>12|224:(a[c++]=h>>18|240,a[c++]=h>>12&63|128),a[c++]=h>>6&63|128),a[c++]=63&h|128)}return c})(this.buf,e,this.pos);var r=this.pos-t;r>=128&&Tm(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),Sm(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Sm(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var a=this.pos-r;a>=128&&Tm(r,a,this),this.pos=r-1,this.writeVarint(a),this.pos+=a},writeMessage:function(e,t,r){this.writeTag(e,cr.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,Bb,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,zb,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,Lb,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,Db,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,Rb,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,Fb,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,Ob,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Vb,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,qb,t)},writeBytesField:function(e,t){this.writeTag(e,cr.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,cr.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,cr.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,cr.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,cr.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,cr.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,cr.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,cr.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,cr.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,cr.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,!!t)}};var Ul=function(e,t){var r=t.pixelRatio,a=t.version,l=t.stretchX,c=t.stretchY,h=t.content;this.paddedRect=e,this.pixelRatio=r,this.stretchX=l,this.stretchY=c,this.content=h,this.version=a},Bu={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Bu.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Bu.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Bu.tlbr.get=function(){return this.tl.concat(this.br)},Bu.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Ul.prototype,Bu);var zu=function(e,t){var r={},a={};this.haveRenderCallbacks=[];var l=[];this.addImages(e,r,l),this.addImages(t,a,l);var c=Em(l),h=new Hi({width:c.w||1,height:c.h||1});for(var m in e){var g=e[m],x=r[m].paddedRect;Hi.copy(g.data,h,{x:0,y:0},{x:x.x+1,y:x.y+1},g.data)}for(var S in t){var I=t[S],C=a[S].paddedRect,z=C.x+1,j=C.y+1,G=I.data.width,te=I.data.height;Hi.copy(I.data,h,{x:0,y:0},{x:z,y:j},I.data),Hi.copy(I.data,h,{x:0,y:te-1},{x:z,y:j-1},{width:G,height:1}),Hi.copy(I.data,h,{x:0,y:0},{x:z,y:j+te},{width:G,height:1}),Hi.copy(I.data,h,{x:G-1,y:0},{x:z-1,y:j},{width:1,height:te}),Hi.copy(I.data,h,{x:0,y:0},{x:z+G,y:j},{width:1,height:te})}this.image=h,this.iconPositions=r,this.patternPositions=a};zu.prototype.addImages=function(e,t,r){for(var a in e){var l=e[a],c={x:0,y:0,w:l.data.width+2,h:l.data.height+2};r.push(c),t[a]=new Ul(c,l),l.hasRenderCallback&&this.haveRenderCallbacks.push(a)}},zu.prototype.patchUpdatedImages=function(e,t){for(var r in e.dispatchRenderCallbacks(this.haveRenderCallbacks),e.updatedImages)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)},zu.prototype.patchUpdatedImage=function(e,t,r){if(e&&t&&e.version!==t.version){e.version=t.version;var a=e.tl;r.update(t.data,void 0,{x:a[0],y:a[1]})}},Xe("ImagePosition",Ul),Xe("ImageAtlas",zu);var pn={horizontal:1,vertical:2,horizontalOnly:3},As=function(){this.scale=1,this.fontStack="",this.imageName=null};As.forText=function(e,t){var r=new As;return r.scale=e||1,r.fontStack=t,r},As.forImage=function(e){var t=new As;return t.imageName=e,t};var Pi=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function Nl(e,t,r,a,l,c,h,m,g,x,S,I,C,z,j,G){var te,K=Pi.fromFeature(e,l);I===pn.vertical&&K.verticalizePunctuation();var oe=Qi.processBidirectionalText,le=Qi.processStyledBidirectionalText;if(oe&&K.sections.length===1){te=[];for(var ce=0,he=oe(K.toString(),Qc(K,x,c,t,a,z,j));ce<he.length;ce+=1){var xe=he[ce],Pe=new Pi;Pe.text=xe,Pe.sections=K.sections;for(var De=0;De<xe.length;De++)Pe.sectionIndex.push(0);te.push(Pe)}}else if(le){te=[];for(var rt=0,Ue=le(K.text,K.sectionIndex,Qc(K,x,c,t,a,z,j));rt<Ue.length;rt+=1){var ot=Ue[rt],je=new Pi;je.text=ot[0],je.sectionIndex=ot[1],je.sections=K.sections,te.push(je)}}else te=(function(Qe,Tt){for(var vt=[],Rt=Qe.text,at=0,Vt=0,_r=Tt;Vt<_r.length;Vt+=1){var Tr=_r[Vt];vt.push(Qe.substring(at,Tr)),at=Tr}return at<Rt.length&&vt.push(Qe.substring(at,Rt.length)),vt})(K,Qc(K,x,c,t,a,z,j));var bt=[],pt={positionedLines:bt,text:K.toString(),top:S[1],bottom:S[1],left:S[0],right:S[0],writingMode:I,iconsInText:!1,verticalizable:!1};return(function(Qe,Tt,vt,Rt,at,Vt,_r,Tr,Sr,xr,Ar,Qr){for(var ei=0,Ci=-17,li=0,ki=0,Mr=Tr==="right"?1:Tr==="left"?0:.5,ci=0,Mt=0,nr=at;Mt<nr.length;Mt+=1){var Jt=nr[Mt];Jt.trim();var Ft=Jt.getMaxScale(),Oi=24*(Ft-1),_i={positionedGlyphs:[],lineOffset:0};Qe.positionedLines[ci]=_i;var fr=_i.positionedGlyphs,Ur=0;if(Jt.length()){for(var xi=0;xi<Jt.length();xi++){var qt=Jt.getSection(xi),so=Jt.getSectionIndex(xi),hn=Jt.getCharCode(xi),uo=0,Br=null,lo=null,kn=null,Ds=24,ja=!(Sr===pn.horizontal||!Ar&&!ps(hn)||Ar&&(jl[hn]||(qo=hn,Le.Arabic(qo)||Le["Arabic Supplement"](qo)||Le["Arabic Extended-A"](qo)||Le["Arabic Presentation Forms-A"](qo)||Le["Arabic Presentation Forms-B"](qo))));if(qt.imageName){var Rs=Rt[qt.imageName];if(!Rs)continue;kn=qt.imageName,Qe.iconsInText=Qe.iconsInText||!0,lo=Rs.paddedRect;var Vo=Rs.displaySize;qt.scale=24*qt.scale/Qr,uo=Oi+(24-Vo[1]*qt.scale),Ds=(Br={width:Vo[0],height:Vo[1],left:1,top:-3,advance:ja?Vo[1]:Vo[0]}).advance;var Ls=ja?Vo[0]*qt.scale-24*Ft:Vo[1]*qt.scale-24*Ft;Ls>0&&Ls>Ur&&(Ur=Ls)}else{var Yl=vt[qt.fontStack],Fs=Yl&&Yl[hn];if(Fs&&Fs.rect)lo=Fs.rect,Br=Fs.metrics;else{var Lu=Tt[qt.fontStack],Ql=Lu&&Lu[hn];if(!Ql)continue;Br=Ql.metrics}uo=24*(Ft-qt.scale)}ja?(Qe.verticalizable=!0,fr.push({glyph:hn,imageName:kn,x:ei,y:Ci+uo,vertical:ja,scale:qt.scale,fontStack:qt.fontStack,sectionIndex:so,metrics:Br,rect:lo}),ei+=Ds*qt.scale+xr):(fr.push({glyph:hn,imageName:kn,x:ei,y:Ci+uo,vertical:ja,scale:qt.scale,fontStack:qt.fontStack,sectionIndex:so,metrics:Br,rect:lo}),ei+=Br.advance*qt.scale+xr)}fr.length!==0&&(li=Math.max(ei-xr,li),Zb(fr,0,fr.length-1,Mr,Ur)),ei=0;var ec=Vt*Ft+Ur;_i.lineOffset=Math.max(Ur,Oi),Ci+=ec,ki=Math.max(ec,ki),++ci}else Ci+=Vt,++ci}var qo,Fu=Ci- -17,Os=ep(_r),la=Os.horizontalAlign,Vs=Os.verticalAlign;(function(tc,rc,Ou,Vu,ic,qu,Uu,Nu,nc){var qs,oc=(rc-Ou)*ic;qs=qu!==Uu?-Nu*Vu- -17:(-Vu*nc+.5)*Uu;for(var Us=0,ju=tc;Us<ju.length;Us+=1)for(var Ga=0,Gu=ju[Us].positionedGlyphs;Ga<Gu.length;Ga+=1){var Ns=Gu[Ga];Ns.x+=oc,Ns.y+=qs}})(Qe.positionedLines,Mr,la,Vs,li,ki,Vt,Fu,at.length),Qe.top+=-Vs*Fu,Qe.bottom=Qe.top+Fu,Qe.left+=-la*li,Qe.right=Qe.left+li})(pt,t,r,a,te,h,m,g,I,x,C,G),!(function(Qe){for(var Tt=0,vt=Qe;Tt<vt.length;Tt+=1)if(vt[Tt].positionedGlyphs.length!==0)return!1;return!0})(bt)&&pt}Pi.fromFeature=function(e,t){for(var r=new Pi,a=0;a<e.sections.length;a++){var l=e.sections[a];l.image?r.addImageSection(l):r.addTextSection(l,t)}return r},Pi.prototype.length=function(){return this.text.length},Pi.prototype.getSection=function(e){return this.sections[this.sectionIndex[e]]},Pi.prototype.getSectionIndex=function(e){return this.sectionIndex[e]},Pi.prototype.getCharCode=function(e){return this.text.charCodeAt(e)},Pi.prototype.verticalizePunctuation=function(){this.text=(function(e){for(var t="",r=0;r<e.length;r++){var a=e.charCodeAt(r+1)||null,l=e.charCodeAt(r-1)||null;t+=a&&yu(a)&&!Mu[e[r+1]]||l&&yu(l)&&!Mu[e[r-1]]||!Mu[e[r]]?e[r]:Mu[e[r]]}return t})(this.text)},Pi.prototype.trim=function(){for(var e=0,t=0;t<this.text.length&&jl[this.text.charCodeAt(t)];t++)e++;for(var r=this.text.length,a=this.text.length-1;a>=0&&a>=e&&jl[this.text.charCodeAt(a)];a--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)},Pi.prototype.substring=function(e,t){var r=new Pi;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r},Pi.prototype.toString=function(){return this.text},Pi.prototype.getMaxScale=function(){var e=this;return this.sectionIndex.reduce((function(t,r){return Math.max(t,e.sections[r].scale)}),0)},Pi.prototype.addTextSection=function(e,t){this.text+=e.text,this.sections.push(As.forText(e.scale,e.fontStack||t));for(var r=this.sections.length-1,a=0;a<e.text.length;++a)this.sectionIndex.push(r)},Pi.prototype.addImageSection=function(e){var t=e.image?e.image.name:"";if(t.length!==0){var r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(As.forImage(t)),this.sectionIndex.push(this.sections.length-1)):St("Reached maximum number of images 6401")}else St("Can't add FormattedSection with an empty image.")},Pi.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var jl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},tn={};function Pm(e,t,r,a,l,c){if(t.imageName){var h=a[t.imageName];return h?h.displaySize[0]*t.scale*24/c+l:0}var m=r[t.fontStack],g=m&&m[e];return g?g.metrics.advance*t.scale+l:0}function Cm(e,t,r,a){var l=Math.pow(e-t,2);return a?e<t?l/2:2*l:l+Math.abs(r)*r}function Gb(e,t,r){var a=0;return e===10&&(a-=1e4),r&&(a+=150),e!==40&&e!==65288||(a+=50),t!==41&&t!==65289||(a+=50),a}function km(e,t,r,a,l,c){for(var h=null,m=Cm(t,r,l,c),g=0,x=a;g<x.length;g+=1){var S=x[g],I=Cm(t-S.x,r,l,c)+S.badness;I<=m&&(h=S,m=I)}return{index:e,x:t,priorBreak:h,badness:m}}function Qc(e,t,r,a,l,c,h){if(c!=="point")return[];if(!e)return[];for(var m,g=[],x=(function(te,K,oe,le,ce,he){for(var xe=0,Pe=0;Pe<te.length();Pe++){var De=te.getSection(Pe);xe+=Pm(te.getCharCode(Pe),De,le,ce,K,he)}return xe/Math.max(1,Math.ceil(xe/oe))})(e,t,r,a,l,h),S=e.text.indexOf("​")>=0,I=0,C=0;C<e.length();C++){var z=e.getSection(C),j=e.getCharCode(C);if(jl[j]||(I+=Pm(j,z,a,l,t,h)),C<e.length()-1){var G=!((m=j)<11904||!(Le["Bopomofo Extended"](m)||Le.Bopomofo(m)||Le["CJK Compatibility Forms"](m)||Le["CJK Compatibility Ideographs"](m)||Le["CJK Compatibility"](m)||Le["CJK Radicals Supplement"](m)||Le["CJK Strokes"](m)||Le["CJK Symbols and Punctuation"](m)||Le["CJK Unified Ideographs Extension A"](m)||Le["CJK Unified Ideographs"](m)||Le["Enclosed CJK Letters and Months"](m)||Le["Halfwidth and Fullwidth Forms"](m)||Le.Hiragana(m)||Le["Ideographic Description Characters"](m)||Le["Kangxi Radicals"](m)||Le["Katakana Phonetic Extensions"](m)||Le.Katakana(m)||Le["Vertical Forms"](m)||Le["Yi Radicals"](m)||Le["Yi Syllables"](m)));(tn[j]||G||z.imageName)&&g.push(km(C+1,I,x,g,Gb(j,e.getCharCode(C+1),G&&S),!1))}}return(function te(K){return K?te(K.priorBreak).concat(K.index):[]})(km(e.length(),I,x,g,0,!0))}function ep(e){var t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function Zb(e,t,r,a,l){if(a||l)for(var c=e[r],h=(e[r].x+c.metrics.advance*c.scale)*a,m=t;m<=r;m++)e[m].x-=h,e[m].y+=l}function Mm(e,t,r,a,l,c){var h,m=e.image;if(m.content){var g=m.content,x=m.pixelRatio||1;h=[g[0]/x,g[1]/x,m.displaySize[0]-g[2]/x,m.displaySize[1]-g[3]/x]}var S,I,C,z,j=t.left*c,G=t.right*c;r==="width"||r==="both"?(z=l[0]+j-a[3],I=l[0]+G+a[1]):I=(z=l[0]+(j+G-m.displaySize[0])/2)+m.displaySize[0];var te=t.top*c,K=t.bottom*c;return r==="height"||r==="both"?(S=l[1]+te-a[0],C=l[1]+K+a[2]):C=(S=l[1]+(te+K-m.displaySize[1])/2)+m.displaySize[1],{image:m,top:S,right:I,bottom:C,left:z,collisionPadding:h}}tn[10]=!0,tn[32]=!0,tn[38]=!0,tn[40]=!0,tn[41]=!0,tn[43]=!0,tn[45]=!0,tn[47]=!0,tn[173]=!0,tn[183]=!0,tn[8203]=!0,tn[8208]=!0,tn[8211]=!0,tn[8231]=!0;var Es=(function(e){function t(r,a,l,c){e.call(this,r,a),this.angle=l,c!==void 0&&(this.segment=c)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.clone=function(){return new t(this.x,this.y,this.angle,this.segment)},t})(X);function tp(e,t){var r=t.expression;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new Ct(e+1))};if(r.kind==="source")return{kind:"source"};for(var a=r.zoomStops,l=r.interpolationType,c=0;c<a.length&&a[c]<=e;)c++;for(var h=c=Math.max(0,c-1);h<a.length&&a[h]<e+1;)h++;h=Math.min(a.length-1,h);var m=a[c],g=a[h];return r.kind==="composite"?{kind:"composite",minZoom:m,maxZoom:g,interpolationType:l}:{kind:"camera",minZoom:m,maxZoom:g,minSize:r.evaluate(new Ct(m)),maxSize:r.evaluate(new Ct(g)),interpolationType:l}}function Bm(e,t,r){var a=t.uSize,l=r.lowerSize;return e.kind==="source"?l/128:e.kind==="composite"?Vr(l/128,r.upperSize/128,t.uSizeT):a}function zm(e,t){var r=0,a=0;if(e.kind==="constant")a=e.layoutSize;else if(e.kind!=="source"){var l=e.interpolationType,c=l?Oe(mi.interpolationFactor(l,t,e.minZoom,e.maxZoom),0,1):0;e.kind==="camera"?a=Vr(e.minSize,e.maxSize,c):r=c}return{uSizeT:r,uSize:a}}Xe("Anchor",Es);var $b=Object.freeze({__proto__:null,getSizeData:tp,evaluateSizeForFeature:Bm,evaluateSizeForZoom:zm,SIZE_PACK_FACTOR:128});function Dm(e,t,r,a,l){if(t.segment===void 0)return!0;for(var c=t,h=t.segment+1,m=0;m>-r/2;){if(--h<0)return!1;m-=e[h].dist(c),c=e[h]}m+=e[h].dist(e[h+1]),h++;for(var g=[],x=0;m<r/2;){var S=e[h],I=e[h+1];if(!I)return!1;var C=e[h-1].angleTo(S)-S.angleTo(I);for(C=Math.abs((C+3*Math.PI)%(2*Math.PI)-Math.PI),g.push({distance:m,angleDelta:C}),x+=C;m-g[0].distance>a;)x-=g.shift().angleDelta;if(x>l)return!1;h++,m+=S.dist(I)}return!0}function Rm(e){for(var t=0,r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function Lm(e,t,r){return e?.6*t*r:0}function Fm(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function Wb(e,t,r,a,l,c){for(var h=Lm(r,l,c),m=Fm(r,a)*c,g=0,x=Rm(e)/2,S=0;S<e.length-1;S++){var I=e[S],C=e[S+1],z=I.dist(C);if(g+z>x){var j=(x-g)/z,G=Vr(I.x,C.x,j),te=Vr(I.y,C.y,j),K=new Es(G,te,C.angleTo(I),S);return K._round(),!h||Dm(e,K,m,h,t)?K:void 0}g+=z}}function Hb(e,t,r,a,l,c,h,m,g){var x=Lm(a,c,h),S=Fm(a,l),I=S*h,C=e[0].x===0||e[0].x===g||e[0].y===0||e[0].y===g;return t-I<t/4&&(t=I+t/4),(function z(j,G,te,K,oe,le,ce,he,xe){for(var Pe=le/2,De=Rm(j),rt=0,Ue=G-te,ot=[],je=0;je<j.length-1;je++){for(var bt=j[je],pt=j[je+1],Qe=bt.dist(pt),Tt=pt.angleTo(bt);Ue+te<rt+Qe;){var vt=((Ue+=te)-rt)/Qe,Rt=Vr(bt.x,pt.x,vt),at=Vr(bt.y,pt.y,vt);if(Rt>=0&&Rt<xe&&at>=0&&at<xe&&Ue-Pe>=0&&Ue+Pe<=De){var Vt=new Es(Rt,at,Tt,je);Vt._round(),K&&!Dm(j,Vt,le,K,oe)||ot.push(Vt)}}rt+=Qe}return he||ot.length||ce||(ot=z(j,rt/2,te,K,oe,le,ce,!0,xe)),ot})(e,C?t/2*m%t:(S/2+2*c)*h*m%t,t,x,r,I,C,!1,g)}function Om(e,t,r,a,l){for(var c=[],h=0;h<e.length;h++)for(var m=e[h],g=void 0,x=0;x<m.length-1;x++){var S=m[x],I=m[x+1];S.x<t&&I.x<t||(S.x<t?S=new X(t,S.y+(t-S.x)/(I.x-S.x)*(I.y-S.y))._round():I.x<t&&(I=new X(t,S.y+(t-S.x)/(I.x-S.x)*(I.y-S.y))._round()),S.y<r&&I.y<r||(S.y<r?S=new X(S.x+(r-S.y)/(I.y-S.y)*(I.x-S.x),r)._round():I.y<r&&(I=new X(S.x+(r-S.y)/(I.y-S.y)*(I.x-S.x),r)._round()),S.x>=a&&I.x>=a||(S.x>=a?S=new X(a,S.y+(a-S.x)/(I.x-S.x)*(I.y-S.y))._round():I.x>=a&&(I=new X(a,S.y+(a-S.x)/(I.x-S.x)*(I.y-S.y))._round()),S.y>=l&&I.y>=l||(S.y>=l?S=new X(S.x+(l-S.y)/(I.y-S.y)*(I.x-S.x),l)._round():I.y>=l&&(I=new X(S.x+(l-S.y)/(I.y-S.y)*(I.x-S.x),l)._round()),g&&S.equals(g[g.length-1])||c.push(g=[S]),g.push(I)))))}return c}function Vm(e,t,r,a){var l=[],c=e.image,h=c.pixelRatio,m=c.paddedRect.w-2,g=c.paddedRect.h-2,x=e.right-e.left,S=e.bottom-e.top,I=c.stretchX||[[0,m]],C=c.stretchY||[[0,g]],z=function(Rt,at){return Rt+at[1]-at[0]},j=I.reduce(z,0),G=C.reduce(z,0),te=m-j,K=g-G,oe=0,le=j,ce=0,he=G,xe=0,Pe=te,De=0,rt=K;if(c.content&&a){var Ue=c.content;oe=Gl(I,0,Ue[0]),ce=Gl(C,0,Ue[1]),le=Gl(I,Ue[0],Ue[2]),he=Gl(C,Ue[1],Ue[3]),xe=Ue[0]-oe,De=Ue[1]-ce,Pe=Ue[2]-Ue[0]-le,rt=Ue[3]-Ue[1]-he}var ot=function(Rt,at,Vt,_r){var Tr=Zl(Rt.stretch-oe,le,x,e.left),Sr=$l(Rt.fixed-xe,Pe,Rt.stretch,j),xr=Zl(at.stretch-ce,he,S,e.top),Ar=$l(at.fixed-De,rt,at.stretch,G),Qr=Zl(Vt.stretch-oe,le,x,e.left),ei=$l(Vt.fixed-xe,Pe,Vt.stretch,j),Ci=Zl(_r.stretch-ce,he,S,e.top),li=$l(_r.fixed-De,rt,_r.stretch,G),ki=new X(Tr,xr),Mr=new X(Qr,xr),ci=new X(Qr,Ci),Mt=new X(Tr,Ci),nr=new X(Sr/h,Ar/h),Jt=new X(ei/h,li/h),Ft=t*Math.PI/180;if(Ft){var Oi=Math.sin(Ft),_i=Math.cos(Ft),fr=[_i,-Oi,Oi,_i];ki._matMult(fr),Mr._matMult(fr),Mt._matMult(fr),ci._matMult(fr)}var Ur=Rt.stretch+Rt.fixed,xi=at.stretch+at.fixed;return{tl:ki,tr:Mr,bl:Mt,br:ci,tex:{x:c.paddedRect.x+1+Ur,y:c.paddedRect.y+1+xi,w:Vt.stretch+Vt.fixed-Ur,h:_r.stretch+_r.fixed-xi},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:nr,pixelOffsetBR:Jt,minFontScaleX:Pe/h/x,minFontScaleY:rt/h/S,isSDF:r}};if(a&&(c.stretchX||c.stretchY))for(var je=qm(I,te,j),bt=qm(C,K,G),pt=0;pt<je.length-1;pt++)for(var Qe=je[pt],Tt=je[pt+1],vt=0;vt<bt.length-1;vt++)l.push(ot(Qe,bt[vt],Tt,bt[vt+1]));else l.push(ot({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:m+1},{fixed:0,stretch:g+1}));return l}function Gl(e,t,r){for(var a=0,l=0,c=e;l<c.length;l+=1){var h=c[l];a+=Math.max(t,Math.min(r,h[1]))-Math.max(t,Math.min(r,h[0]))}return a}function qm(e,t,r){for(var a=[{fixed:-1,stretch:0}],l=0,c=e;l<c.length;l+=1){var h=c[l],m=h[0],g=h[1],x=a[a.length-1];a.push({fixed:m-x.stretch,stretch:x.stretch}),a.push({fixed:m-x.stretch,stretch:x.stretch+(g-m)})}return a.push({fixed:t+1,stretch:r}),a}function Zl(e,t,r,a){return e/t*r+a}function $l(e,t,r,a){return e-t*r/a}var Wl=function(e,t,r,a,l,c,h,m,g,x){if(this.boxStartIndex=e.length,g){var S=c.top,I=c.bottom,C=c.collisionPadding;C&&(S-=C[1],I+=C[3]);var z=I-S;z>0&&(z=Math.max(10,z),this.circleDiameter=z)}else{var j=c.top*h-m,G=c.bottom*h+m,te=c.left*h-m,K=c.right*h+m,oe=c.collisionPadding;if(oe&&(te-=oe[0]*h,j-=oe[1]*h,K+=oe[2]*h,G+=oe[3]*h),x){var le=new X(te,j),ce=new X(K,j),he=new X(te,G),xe=new X(K,G),Pe=x*Math.PI/180;le._rotate(Pe),ce._rotate(Pe),he._rotate(Pe),xe._rotate(Pe),te=Math.min(le.x,ce.x,he.x,xe.x),K=Math.max(le.x,ce.x,he.x,xe.x),j=Math.min(le.y,ce.y,he.y,xe.y),G=Math.max(le.y,ce.y,he.y,xe.y)}e.emplaceBack(t.x,t.y,te,j,K,G,r,a,l)}this.boxEndIndex=e.length},Ps=function(e,t){if(e===void 0&&(e=[]),t===void 0&&(t=Xb),this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function Xb(e,t){return e<t?-1:e>t?1:0}function Kb(e,t,r){r===void 0&&(r=!1);for(var a=1/0,l=1/0,c=-1/0,h=-1/0,m=e[0],g=0;g<m.length;g++){var x=m[g];(!g||x.x<a)&&(a=x.x),(!g||x.y<l)&&(l=x.y),(!g||x.x>c)&&(c=x.x),(!g||x.y>h)&&(h=x.y)}var S=Math.min(c-a,h-l),I=S/2,C=new Ps([],Jb);if(S===0)return new X(a,l);for(var z=a;z<c;z+=S)for(var j=l;j<h;j+=S)C.push(new Cs(z+I,j+I,I,e));for(var G=(function(oe){for(var le=0,ce=0,he=0,xe=oe[0],Pe=0,De=xe.length,rt=De-1;Pe<De;rt=Pe++){var Ue=xe[Pe],ot=xe[rt],je=Ue.x*ot.y-ot.x*Ue.y;ce+=(Ue.x+ot.x)*je,he+=(Ue.y+ot.y)*je,le+=3*je}return new Cs(ce/le,he/le,0,oe)})(e),te=C.length;C.length;){var K=C.pop();(K.d>G.d||!G.d)&&(G=K,r&&console.log("found best %d after %d probes",Math.round(1e4*K.d)/1e4,te)),K.max-G.d<=t||(C.push(new Cs(K.p.x-(I=K.h/2),K.p.y-I,I,e)),C.push(new Cs(K.p.x+I,K.p.y-I,I,e)),C.push(new Cs(K.p.x-I,K.p.y+I,I,e)),C.push(new Cs(K.p.x+I,K.p.y+I,I,e)),te+=4)}return r&&(console.log("num probes: "+te),console.log("best distance: "+G.d)),G.p}function Jb(e,t){return t.max-e.max}function Cs(e,t,r,a){this.p=new X(e,t),this.h=r,this.d=(function(l,c){for(var h=!1,m=1/0,g=0;g<c.length;g++)for(var x=c[g],S=0,I=x.length,C=I-1;S<I;C=S++){var z=x[S],j=x[C];z.y>l.y!=j.y>l.y&&l.x<(j.x-z.x)*(l.y-z.y)/(j.y-z.y)+z.x&&(h=!h),m=Math.min(m,oa(l,z,j))}return(h?1:-1)*Math.sqrt(m)})(this.p,a),this.max=this.d+this.h*Math.SQRT2}Ps.prototype.push=function(e){this.data.push(e),this.length++,this._up(this.length-1)},Ps.prototype.pop=function(){if(this.length!==0){var e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}},Ps.prototype.peek=function(){return this.data[0]},Ps.prototype._up=function(e){for(var t=this.data,r=this.compare,a=t[e];e>0;){var l=e-1>>1,c=t[l];if(r(a,c)>=0)break;t[e]=c,e=l}t[e]=a},Ps.prototype._down=function(e){for(var t=this.data,r=this.compare,a=this.length>>1,l=t[e];e<a;){var c=1+(e<<1),h=t[c],m=c+1;if(m<this.length&&r(t[m],h)<0&&(c=m,h=t[m]),r(h,l)>=0)break;t[e]=h,e=c}t[e]=l};var rp=Number.POSITIVE_INFINITY;function Um(e,t){return t[1]!==rp?(function(r,a,l){var c=0,h=0;switch(a=Math.abs(a),l=Math.abs(l),r){case"top-right":case"top-left":case"top":h=l-7;break;case"bottom-right":case"bottom-left":case"bottom":h=7-l}switch(r){case"top-right":case"bottom-right":case"right":c=-a;break;case"top-left":case"bottom-left":case"left":c=a}return[c,h]})(e,t[0],t[1]):(function(r,a){var l=0,c=0;a<0&&(a=0);var h=a/Math.sqrt(2);switch(r){case"top-right":case"top-left":c=h-7;break;case"bottom-right":case"bottom-left":c=7-h;break;case"bottom":c=7-a;break;case"top":c=a-7}switch(r){case"top-right":case"bottom-right":l=-h;break;case"top-left":case"bottom-left":l=h;break;case"left":l=a;break;case"right":l=-a}return[l,c]})(e,t[0])}function ip(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Nm(e,t,r,a,l,c,h,m,g,x,S,I,C,z,j){var G=(function(ce,he,xe,Pe,De,rt,Ue,ot){for(var je=Pe.layout.get("text-rotate").evaluate(rt,{})*Math.PI/180,bt=[],pt=0,Qe=he.positionedLines;pt<Qe.length;pt+=1)for(var Tt=Qe[pt],vt=0,Rt=Tt.positionedGlyphs;vt<Rt.length;vt+=1){var at=Rt[vt];if(at.rect){var Vt=at.rect||{},_r=4,Tr=!0,Sr=1,xr=0,Ar=(De||ot)&&at.vertical,Qr=at.metrics.advance*at.scale/2;if(ot&&he.verticalizable&&(xr=Tt.lineOffset/2-(at.imageName?-(24-at.metrics.width*at.scale)/2:24*(at.scale-1))),at.imageName){var ei=Ue[at.imageName];Tr=ei.sdf,_r=1/(Sr=ei.pixelRatio)}var Ci=De?[at.x+Qr,at.y]:[0,0],li=De?[0,0]:[at.x+Qr+xe[0],at.y+xe[1]-xr],ki=[0,0];Ar&&(ki=li,li=[0,0]);var Mr=(at.metrics.left-_r)*at.scale-Qr+li[0],ci=(-at.metrics.top-_r)*at.scale+li[1],Mt=Mr+Vt.w*at.scale/Sr,nr=ci+Vt.h*at.scale/Sr,Jt=new X(Mr,ci),Ft=new X(Mt,ci),Oi=new X(Mr,nr),_i=new X(Mt,nr);if(Ar){var fr=new X(-Qr,Qr- -17),Ur=-Math.PI/2,xi=12-Qr,qt=new X(22-xi,-(at.imageName?xi:0)),so=new(Function.prototype.bind.apply(X,[null].concat(ki)));Jt._rotateAround(Ur,fr)._add(qt)._add(so),Ft._rotateAround(Ur,fr)._add(qt)._add(so),Oi._rotateAround(Ur,fr)._add(qt)._add(so),_i._rotateAround(Ur,fr)._add(qt)._add(so)}if(je){var hn=Math.sin(je),uo=Math.cos(je),Br=[uo,-hn,hn,uo];Jt._matMult(Br),Ft._matMult(Br),Oi._matMult(Br),_i._matMult(Br)}var lo=new X(0,0),kn=new X(0,0);bt.push({tl:Jt,tr:Ft,bl:Oi,br:_i,tex:Vt,writingMode:he.writingMode,glyphOffset:Ci,sectionIndex:at.sectionIndex,isSDF:Tr,pixelOffsetTL:lo,pixelOffsetBR:kn,minFontScaleX:0,minFontScaleY:0})}}return bt})(0,r,m,l,c,h,a,e.allowVerticalPlacement),te=e.textSizeData,K=null;te.kind==="source"?(K=[128*l.layout.get("text-size").evaluate(h,{})])[0]>32640&&St(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):te.kind==="composite"&&((K=[128*z.compositeTextSizes[0].evaluate(h,{},j),128*z.compositeTextSizes[1].evaluate(h,{},j)])[0]>32640||K[1]>32640)&&St(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),e.addSymbols(e.text,G,K,m,c,h,x,t,g.lineStartIndex,g.lineLength,C,j);for(var oe=0,le=S;oe<le.length;oe+=1)I[le[oe]]=e.text.placedSymbolArray.length-1;return 4*G.length}function jm(e){for(var t in e)return e[t];return null}function Yb(e,t,r,a){var l=e.compareText;if(t in l){for(var c=l[t],h=c.length-1;h>=0;h--)if(a.dist(c[h])<r)return!0}else l[t]=[];return l[t].push(a),!1}var Qb=Ss.VectorTileFeature.types,e0=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Hl(e,t,r,a,l,c,h,m,g,x,S,I,C){var z=m?Math.min(32640,Math.round(m[0])):0,j=m?Math.min(32640,Math.round(m[1])):0;e.emplaceBack(t,r,Math.round(32*a),Math.round(32*l),c,h,(z<<1)+(g?1:0),j,16*x,16*S,256*I,256*C)}function np(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}function t0(e){for(var t=0,r=e.sections;t<r.length;t+=1)if(hs(r[t].text))return!0;return!1}var ks=function(e){this.layoutVertexArray=new ys,this.indexArray=new to,this.programConfigurations=e,this.segments=new F,this.dynamicLayoutVertexArray=new ra,this.opacityVertexArray=new za,this.placedSymbolArray=new s};ks.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},ks.prototype.upload=function(e,t,r,a){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Eb.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Pb.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,e0,!0),this.opacityVertexBuffer.itemSize=1),(r||a)&&this.programConfigurations.upload(e))},ks.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Xe("SymbolBuffers",ks);var Du=function(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new F,this.collisionVertexArray=new wu};Du.prototype.upload=function(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Cb.members,!0)},Du.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Xe("CollisionBuffers",Du);var er=function(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(c){return c.id})),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=en([]),this.placementViewportMatrix=en([]);var t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=tp(this.zoom,t["text-size"]),this.iconSizeData=tp(this.zoom,t["icon-size"]);var r=this.layers[0].layout,a=r.get("symbol-sort-key"),l=r.get("symbol-z-order");this.canOverlap=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey=l!=="viewport-y"&&a.constantOr(1)!==void 0,this.sortFeaturesByY=(l==="viewport-y"||l==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,r.get("symbol-placement")==="point"&&(this.writingModes=r.get("text-writing-mode").map((function(c){return pn[c]}))),this.stateDependentLayerIds=this.layers.filter((function(c){return c.isStateDependent()})).map((function(c){return c.id})),this.sourceID=e.sourceID};er.prototype.createArrays=function(){this.text=new ks(new ct(this.layers,this.zoom,(function(e){return/^text/.test(e)}))),this.icon=new ks(new ct(this.layers,this.zoom,(function(e){return/^icon/.test(e)}))),this.glyphOffsetArray=new d,this.lineVertexArray=new v,this.symbolInstances=new f},er.prototype.calculateGlyphDependencies=function(e,t,r,a,l){for(var c=0;c<e.length;c++)if(t[e.charCodeAt(c)]=!0,(r||a)&&l){var h=Mu[e.charAt(c)];h&&(t[h.charCodeAt(0)]=!0)}},er.prototype.populate=function(e,t,r){var a=this.layers[0],l=a.layout,c=l.get("text-font"),h=l.get("text-field"),m=l.get("icon-image"),g=(h.value.kind!=="constant"||h.value.value instanceof ni&&!h.value.value.isEmpty()||h.value.value.toString().length>0)&&(c.value.kind!=="constant"||c.value.value.length>0),x=m.value.kind!=="constant"||!!m.value.value||Object.keys(m.parameters).length>0,S=l.get("symbol-sort-key");if(this.features=[],g||x){for(var I=t.iconDependencies,C=t.glyphDependencies,z=t.availableImages,j=new Ct(this.zoom),G=0,te=e;G<te.length;G+=1){var K=te[G],oe=K.feature,le=K.id,ce=K.index,he=K.sourceLayerIndex,xe=a._featureFilter.needGeometry,Pe=kr(oe,xe);if(a._featureFilter.filter(j,Pe,r)){xe||(Pe.geometry=wr(oe));var De=void 0;if(g){var rt=a.getValueAndResolveTokens("text-field",Pe,r,z),Ue=ni.factory(rt);t0(Ue)&&(this.hasRTLText=!0),(!this.hasRTLText||gu()==="unavailable"||this.hasRTLText&&Qi.isParsed())&&(De=Mb(Ue,a,Pe))}var ot=void 0;if(x){var je=a.getValueAndResolveTokens("icon-image",Pe,r,z);ot=je instanceof Di?je:Di.fromString(je)}if(De||ot){var bt=this.sortFeaturesByKey?S.evaluate(Pe,{},r):void 0;if(this.features.push({id:le,text:De,icon:ot,index:ce,sourceLayerIndex:he,geometry:Pe.geometry,properties:oe.properties,type:Qb[oe.type],sortKey:bt}),ot&&(I[ot.name]=!0),De){var pt=c.evaluate(Pe,{},r).join(","),Qe=l.get("text-rotation-alignment")==="map"&&l.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(pn.vertical)>=0;for(var Tt=0,vt=De.sections;Tt<vt.length;Tt+=1){var Rt=vt[Tt];if(Rt.image)I[Rt.image.name]=!0;else{var at=mu(De.toString()),Vt=Rt.fontStack||pt,_r=C[Vt]=C[Vt]||{};this.calculateGlyphDependencies(Rt.text,_r,Qe,this.allowVerticalPlacement,at)}}}}}}l.get("symbol-placement")==="line"&&(this.features=(function(Tr){var Sr={},xr={},Ar=[],Qr=0;function ei(fr){Ar.push(Tr[fr]),Qr++}function Ci(fr,Ur,xi){var qt=xr[fr];return delete xr[fr],xr[Ur]=qt,Ar[qt].geometry[0].pop(),Ar[qt].geometry[0]=Ar[qt].geometry[0].concat(xi[0]),qt}function li(fr,Ur,xi){var qt=Sr[Ur];return delete Sr[Ur],Sr[fr]=qt,Ar[qt].geometry[0].shift(),Ar[qt].geometry[0]=xi[0].concat(Ar[qt].geometry[0]),qt}function ki(fr,Ur,xi){var qt=xi?Ur[0][Ur[0].length-1]:Ur[0][0];return fr+":"+qt.x+":"+qt.y}for(var Mr=0;Mr<Tr.length;Mr++){var ci=Tr[Mr],Mt=ci.geometry,nr=ci.text?ci.text.toString():null;if(nr){var Jt=ki(nr,Mt),Ft=ki(nr,Mt,!0);if(Jt in xr&&Ft in Sr&&xr[Jt]!==Sr[Ft]){var Oi=li(Jt,Ft,Mt),_i=Ci(Jt,Ft,Ar[Oi].geometry);delete Sr[Jt],delete xr[Ft],xr[ki(nr,Ar[_i].geometry,!0)]=_i,Ar[Oi].geometry=null}else Jt in xr?Ci(Jt,Ft,Mt):Ft in Sr?li(Jt,Ft,Mt):(ei(Mr),Sr[Jt]=Qr-1,xr[Ft]=Qr-1)}else ei(Mr)}return Ar.filter((function(fr){return fr.geometry}))})(this.features)),this.sortFeaturesByKey&&this.features.sort((function(Tr,Sr){return Tr.sortKey-Sr.sortKey}))}},er.prototype.update=function(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,r),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,r))},er.prototype.isEmpty=function(){return this.symbolInstances.length===0&&!this.hasRTLText},er.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},er.prototype.upload=function(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},er.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},er.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},er.prototype.addToLineVertexArray=function(e,t){var r=this.lineVertexArray.length;if(e.segment!==void 0){for(var a=e.dist(t[e.segment+1]),l=e.dist(t[e.segment]),c={},h=e.segment+1;h<t.length;h++)c[h]={x:t[h].x,y:t[h].y,tileUnitDistanceFromAnchor:a},h<t.length-1&&(a+=t[h+1].dist(t[h]));for(var m=e.segment||0;m>=0;m--)c[m]={x:t[m].x,y:t[m].y,tileUnitDistanceFromAnchor:l},m>0&&(l+=t[m-1].dist(t[m]));for(var g=0;g<t.length;g++){var x=c[g];this.lineVertexArray.emplaceBack(x.x,x.y,x.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},er.prototype.addSymbols=function(e,t,r,a,l,c,h,m,g,x,S,I){for(var C=e.indexArray,z=e.layoutVertexArray,j=e.segments.prepareSegment(4*t.length,z,C,this.canOverlap?c.sortKey:void 0),G=this.glyphOffsetArray.length,te=j.vertexLength,K=this.allowVerticalPlacement&&h===pn.vertical?Math.PI/2:0,oe=c.text&&c.text.sections,le=0;le<t.length;le++){var ce=t[le],he=ce.tl,xe=ce.tr,Pe=ce.bl,De=ce.br,rt=ce.tex,Ue=ce.pixelOffsetTL,ot=ce.pixelOffsetBR,je=ce.minFontScaleX,bt=ce.minFontScaleY,pt=ce.glyphOffset,Qe=ce.isSDF,Tt=ce.sectionIndex,vt=j.vertexLength,Rt=pt[1];Hl(z,m.x,m.y,he.x,Rt+he.y,rt.x,rt.y,r,Qe,Ue.x,Ue.y,je,bt),Hl(z,m.x,m.y,xe.x,Rt+xe.y,rt.x+rt.w,rt.y,r,Qe,ot.x,Ue.y,je,bt),Hl(z,m.x,m.y,Pe.x,Rt+Pe.y,rt.x,rt.y+rt.h,r,Qe,Ue.x,ot.y,je,bt),Hl(z,m.x,m.y,De.x,Rt+De.y,rt.x+rt.w,rt.y+rt.h,r,Qe,ot.x,ot.y,je,bt),np(e.dynamicLayoutVertexArray,m,K),C.emplaceBack(vt,vt+1,vt+2),C.emplaceBack(vt+1,vt+2,vt+3),j.vertexLength+=4,j.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(pt[0]),le!==t.length-1&&Tt===t[le+1].sectionIndex||e.programConfigurations.populatePaintArrays(z.length,c,c.index,{},I,oe&&oe[Tt])}e.placedSymbolArray.emplaceBack(m.x,m.y,G,this.glyphOffsetArray.length-G,te,g,x,m.segment,r?r[0]:0,r?r[1]:0,a[0],a[1],h,0,!1,0,S)},er.prototype._addCollisionDebugVertex=function(e,t,r,a,l,c){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,a,l,Math.round(c.x),Math.round(c.y))},er.prototype.addCollisionDebugVertices=function(e,t,r,a,l,c,h){var m=l.segments.prepareSegment(4,l.layoutVertexArray,l.indexArray),g=m.vertexLength,x=l.layoutVertexArray,S=l.collisionVertexArray,I=h.anchorX,C=h.anchorY;this._addCollisionDebugVertex(x,S,c,I,C,new X(e,t)),this._addCollisionDebugVertex(x,S,c,I,C,new X(r,t)),this._addCollisionDebugVertex(x,S,c,I,C,new X(r,a)),this._addCollisionDebugVertex(x,S,c,I,C,new X(e,a)),m.vertexLength+=4;var z=l.indexArray;z.emplaceBack(g,g+1),z.emplaceBack(g+1,g+2),z.emplaceBack(g+2,g+3),z.emplaceBack(g+3,g),m.primitiveLength+=4},er.prototype.addDebugCollisionBoxes=function(e,t,r,a){for(var l=e;l<t;l++){var c=this.collisionBoxArray.get(l);this.addCollisionDebugVertices(c.x1,c.y1,c.x2,c.y2,a?this.textCollisionBox:this.iconCollisionBox,c.anchorPoint,r)}},er.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Du(ia,bm.members,Da),this.iconCollisionBox=new Du(ia,bm.members,Da);for(var e=0;e<this.symbolInstances.length;e++){var t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}},er.prototype._deserializeCollisionBoxesForSymbol=function(e,t,r,a,l,c,h,m,g){for(var x={},S=t;S<r;S++){var I=e.get(S);x.textBox={x1:I.x1,y1:I.y1,x2:I.x2,y2:I.y2,anchorPointX:I.anchorPointX,anchorPointY:I.anchorPointY},x.textFeatureIndex=I.featureIndex;break}for(var C=a;C<l;C++){var z=e.get(C);x.verticalTextBox={x1:z.x1,y1:z.y1,x2:z.x2,y2:z.y2,anchorPointX:z.anchorPointX,anchorPointY:z.anchorPointY},x.verticalTextFeatureIndex=z.featureIndex;break}for(var j=c;j<h;j++){var G=e.get(j);x.iconBox={x1:G.x1,y1:G.y1,x2:G.x2,y2:G.y2,anchorPointX:G.anchorPointX,anchorPointY:G.anchorPointY},x.iconFeatureIndex=G.featureIndex;break}for(var te=m;te<g;te++){var K=e.get(te);x.verticalIconBox={x1:K.x1,y1:K.y1,x2:K.x2,y2:K.y2,anchorPointX:K.anchorPointX,anchorPointY:K.anchorPointY},x.verticalIconFeatureIndex=K.featureIndex;break}return x},er.prototype.deserializeCollisionBoxes=function(e){this.collisionArrays=[];for(var t=0;t<this.symbolInstances.length;t++){var r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}},er.prototype.hasTextData=function(){return this.text.segments.get().length>0},er.prototype.hasIconData=function(){return this.icon.segments.get().length>0},er.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},er.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},er.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},er.prototype.addIndicesForPlacedSymbol=function(e,t){for(var r=e.placedSymbolArray.get(t),a=r.vertexStartIndex+4*r.numGlyphs,l=r.vertexStartIndex;l<a;l+=4)e.indexArray.emplaceBack(l,l+1,l+2),e.indexArray.emplaceBack(l+1,l+2,l+3)},er.prototype.getSortedSymbolIndexes=function(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var t=Math.sin(e),r=Math.cos(e),a=[],l=[],c=[],h=0;h<this.symbolInstances.length;++h){c.push(h);var m=this.symbolInstances.get(h);a.push(0|Math.round(t*m.anchorX+r*m.anchorY)),l.push(m.featureIndex)}return c.sort((function(g,x){return a[g]-a[x]||l[x]-l[g]})),c},er.prototype.addToSortKeyRanges=function(e,t){var r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})},er.prototype.sortFeatures=function(e){var t=this;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(var r=0,a=this.symbolInstanceIndexes;r<a.length;r+=1){var l=this.symbolInstances.get(a[r]);this.featureSortOrder.push(l.featureIndex),[l.rightJustifiedTextSymbolIndex,l.centerJustifiedTextSymbolIndex,l.leftJustifiedTextSymbolIndex].forEach((function(c,h,m){c>=0&&m.indexOf(c)===h&&t.addIndicesForPlacedSymbol(t.text,c)})),l.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,l.verticalPlacedTextSymbolIndex),l.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,l.placedIconSymbolIndex),l.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,l.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Xe("SymbolBucket",er,{omit:["layers","collisionBoxArray","features","compareText"]}),er.MAX_GLYPHS=65535,er.addDynamicAttributes=np;var r0=new vi({"symbol-placement":new it(L.layout_symbol["symbol-placement"]),"symbol-spacing":new it(L.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new it(L.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ye(L.layout_symbol["symbol-sort-key"]),"symbol-z-order":new it(L.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new it(L.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new it(L.layout_symbol["icon-ignore-placement"]),"icon-optional":new it(L.layout_symbol["icon-optional"]),"icon-rotation-alignment":new it(L.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ye(L.layout_symbol["icon-size"]),"icon-text-fit":new it(L.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new it(L.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ye(L.layout_symbol["icon-image"]),"icon-rotate":new Ye(L.layout_symbol["icon-rotate"]),"icon-padding":new it(L.layout_symbol["icon-padding"]),"icon-keep-upright":new it(L.layout_symbol["icon-keep-upright"]),"icon-offset":new Ye(L.layout_symbol["icon-offset"]),"icon-anchor":new Ye(L.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new it(L.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new it(L.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new it(L.layout_symbol["text-rotation-alignment"]),"text-field":new Ye(L.layout_symbol["text-field"]),"text-font":new Ye(L.layout_symbol["text-font"]),"text-size":new Ye(L.layout_symbol["text-size"]),"text-max-width":new Ye(L.layout_symbol["text-max-width"]),"text-line-height":new it(L.layout_symbol["text-line-height"]),"text-letter-spacing":new Ye(L.layout_symbol["text-letter-spacing"]),"text-justify":new Ye(L.layout_symbol["text-justify"]),"text-radial-offset":new Ye(L.layout_symbol["text-radial-offset"]),"text-variable-anchor":new it(L.layout_symbol["text-variable-anchor"]),"text-anchor":new Ye(L.layout_symbol["text-anchor"]),"text-max-angle":new it(L.layout_symbol["text-max-angle"]),"text-writing-mode":new it(L.layout_symbol["text-writing-mode"]),"text-rotate":new Ye(L.layout_symbol["text-rotate"]),"text-padding":new it(L.layout_symbol["text-padding"]),"text-keep-upright":new it(L.layout_symbol["text-keep-upright"]),"text-transform":new Ye(L.layout_symbol["text-transform"]),"text-offset":new Ye(L.layout_symbol["text-offset"]),"text-allow-overlap":new it(L.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new it(L.layout_symbol["text-ignore-placement"]),"text-optional":new it(L.layout_symbol["text-optional"])}),op={paint:new vi({"icon-opacity":new Ye(L.paint_symbol["icon-opacity"]),"icon-color":new Ye(L.paint_symbol["icon-color"]),"icon-halo-color":new Ye(L.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ye(L.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ye(L.paint_symbol["icon-halo-blur"]),"icon-translate":new it(L.paint_symbol["icon-translate"]),"icon-translate-anchor":new it(L.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ye(L.paint_symbol["text-opacity"]),"text-color":new Ye(L.paint_symbol["text-color"],{runtimeType:Be,getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new Ye(L.paint_symbol["text-halo-color"]),"text-halo-width":new Ye(L.paint_symbol["text-halo-width"]),"text-halo-blur":new Ye(L.paint_symbol["text-halo-blur"]),"text-translate":new it(L.paint_symbol["text-translate"]),"text-translate-anchor":new it(L.paint_symbol["text-translate-anchor"])}),layout:r0},Ms=function(e){this.type=e.property.overrides?e.property.overrides.runtimeType:Ze,this.defaultValue=e};Ms.prototype.evaluate=function(e){if(e.formattedSection){var t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default},Ms.prototype.eachChild=function(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)},Ms.prototype.outputDefined=function(){return!1},Ms.prototype.serialize=function(){return null},Xe("FormatSectionOverride",Ms,{omit:["defaultValue"]});var i0=(function(e){function t(r){e.call(this,r,op)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.recalculate=function(r,a){if(e.prototype.recalculate.call(this,r,a),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")),this.layout.get("symbol-placement")==="point"){var l=this.layout.get("text-writing-mode");if(l){for(var c=[],h=0,m=l;h<m.length;h+=1){var g=m[h];c.indexOf(g)<0&&c.push(g)}this.layout._values["text-writing-mode"]=c}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},t.prototype.getValueAndResolveTokens=function(r,a,l,c){var h=this.layout.get(r).evaluate(a,{},l,c),m=this._unevaluatedLayout._values[r];return m.isDataDriven()||wa(m.value)||!h?h:(function(g,x){return x.replace(/{([^{}]+)}/g,(function(S,I){return I in g?String(g[I]):""}))})(a.properties,h)},t.prototype.createBucket=function(r){return new er(r)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype._setPaintOverrides=function(){for(var r=0,a=op.paint.overridableProperties;r<a.length;r+=1){var l=a[r];if(t.hasPaintOverride(this.layout,l)){var c,h=this.paint.get(l),m=new Ms(h),g=new Ko(m,h.property.specification);c=h.value.kind==="constant"||h.value.kind==="source"?new Sa("source",g):new Jo("composite",g,h.value.zoomStops,h.value._interpolationType),this.paint._values[l]=new Ti(h.property,c,h.parameters)}}},t.prototype._handleOverridablePaintPropertyUpdate=function(r,a,l){return!(!this.layout||a.isDataDriven()||l.isDataDriven())&&t.hasPaintOverride(this.layout,r)},t.hasPaintOverride=function(r,a){var l=r.get("text-field"),c=op.paint.properties[a],h=!1,m=function(S){for(var I=0,C=S;I<C.length;I+=1)if(c.overrides&&c.overrides.hasOverride(C[I]))return void(h=!0)};if(l.value.kind==="constant"&&l.value.value instanceof ni)m(l.value.value.sections);else if(l.value.kind==="source"){var g=function(S){h||(S instanceof Si&&Cr(S.value)===rr?m(S.value.sections):S instanceof yn?m(S.sections):S.eachChild(g))},x=l.value;x._styleExpression&&g(x._styleExpression.expression)}return h},t})(An),n0={paint:new vi({"background-color":new it(L.paint_background["background-color"]),"background-pattern":new Ai(L.paint_background["background-pattern"]),"background-opacity":new it(L.paint_background["background-opacity"])})},o0=(function(e){function t(r){e.call(this,r,n0)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(An),a0={paint:new vi({"raster-opacity":new it(L.paint_raster["raster-opacity"]),"raster-hue-rotate":new it(L.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new it(L.paint_raster["raster-brightness-min"]),"raster-brightness-max":new it(L.paint_raster["raster-brightness-max"]),"raster-saturation":new it(L.paint_raster["raster-saturation"]),"raster-contrast":new it(L.paint_raster["raster-contrast"]),"raster-resampling":new it(L.paint_raster["raster-resampling"]),"raster-fade-duration":new it(L.paint_raster["raster-fade-duration"])})},s0=(function(e){function t(r){e.call(this,r,a0)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(An),u0=(function(e){function t(r){e.call(this,r,{}),this.implementation=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.is3D=function(){return this.implementation.renderingMode==="3d"},t.prototype.hasOffscreenPass=function(){return this.implementation.prerender!==void 0},t.prototype.recalculate=function(){},t.prototype.updateTransitions=function(){},t.prototype.hasTransition=function(){},t.prototype.serialize=function(){},t.prototype.onAdd=function(r){this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},t.prototype.onRemove=function(r){this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},t})(An),l0={circle:jc,heatmap:$x,hillshade:Hx,fill:pb,"fill-extrusion":xb,line:Ab,symbol:i0,background:o0,raster:s0},Gm=Y.HTMLImageElement,Zm=Y.HTMLCanvasElement,$m=Y.HTMLVideoElement,Wm=Y.ImageData,Xl=Y.ImageBitmap,qa=function(e,t,r,a){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this.update(t,a)};qa.prototype.update=function(e,t,r){var a=e.width,l=e.height,c=!(this.size&&this.size[0]===a&&this.size[1]===l||r),h=this.context,m=h.gl;if(this.useMipmap=!!(t&&t.useMipmap),m.bindTexture(m.TEXTURE_2D,this.texture),h.pixelStoreUnpackFlipY.set(!1),h.pixelStoreUnpack.set(1),h.pixelStoreUnpackPremultiplyAlpha.set(this.format===m.RGBA&&(!t||t.premultiply!==!1)),c)this.size=[a,l],e instanceof Gm||e instanceof Zm||e instanceof $m||e instanceof Wm||Xl&&e instanceof Xl?m.texImage2D(m.TEXTURE_2D,0,this.format,this.format,m.UNSIGNED_BYTE,e):m.texImage2D(m.TEXTURE_2D,0,this.format,a,l,0,this.format,m.UNSIGNED_BYTE,e.data);else{var g=r||{x:0,y:0},x=g.x,S=g.y;e instanceof Gm||e instanceof Zm||e instanceof $m||e instanceof Wm||Xl&&e instanceof Xl?m.texSubImage2D(m.TEXTURE_2D,0,x,S,m.RGBA,m.UNSIGNED_BYTE,e):m.texSubImage2D(m.TEXTURE_2D,0,x,S,a,l,m.RGBA,m.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&m.generateMipmap(m.TEXTURE_2D)},qa.prototype.bind=function(e,t,r){var a=this.context.gl;a.bindTexture(a.TEXTURE_2D,this.texture),r!==a.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=a.LINEAR),e!==this.filter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,e),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,r||e),this.filter=e),t!==this.wrap&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,t),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,t),this.wrap=t)},qa.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},qa.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var ap=function(e){var t=this;this._callback=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){t._triggered=!1,t._callback()})};ap.prototype.trigger=function(){var e=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){e._triggered=!1,e._callback()}),0))},ap.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Bs=function(e,t,r){this.target=e,this.parent=t,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},we(["receive","process"],this),this.invoker=new ap(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Er()?e:Y};function Hm(e,t,r){var a=2*Math.PI*6378137/256/Math.pow(2,r);return[e*a-2*Math.PI*6378137/2,t*a-2*Math.PI*6378137/2]}Bs.prototype.send=function(e,t,r,a,l){var c=this;l===void 0&&(l=!1);var h=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[h]=r);var m=Rr(this.globalScope)?void 0:[];return this.target.postMessage({id:h,type:e,hasCallback:!!r,targetMapId:a,mustQueue:l,sourceMapId:this.mapId,data:gn(t,m)},m),{cancel:function(){r&&delete c.callbacks[h],c.target.postMessage({id:h,type:"<cancel>",targetMapId:a,sourceMapId:c.mapId})}}},Bs.prototype.receive=function(e){var t=e.data,r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if(t.type==="<cancel>"){delete this.tasks[r];var a=this.cancelCallbacks[r];delete this.cancelCallbacks[r],a&&a()}else Er()||t.mustQueue?(this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,t)},Bs.prototype.process=function(){if(this.taskQueue.length){var e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t&&this.processTask(e,t)}},Bs.prototype.processTask=function(e,t){var r=this;if(t.type==="<response>"){var a=this.callbacks[e];delete this.callbacks[e],a&&(t.error?a(ji(t.error)):a(null,ji(t.data)))}else{var l=!1,c=Rr(this.globalScope)?void 0:[],h=t.hasCallback?function(S,I){l=!0,delete r.cancelCallbacks[e],r.target.postMessage({id:e,type:"<response>",sourceMapId:r.mapId,error:S?gn(S):null,data:gn(I,c)},c)}:function(S){l=!0},m=null,g=ji(t.data);if(this.parent[t.type])m=this.parent[t.type](t.sourceMapId,g,h);else if(this.parent.getWorkerSource){var x=t.type.split(".");m=this.parent.getWorkerSource(t.sourceMapId,x[0],g.source)[x[1]](g,h)}else h(new Error("Could not find function "+t.type));!l&&m&&m.cancel&&(this.cancelCallbacks[e]=m.cancel)}},Bs.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var $r=function(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))};$r.prototype.setNorthEast=function(e){return this._ne=e instanceof gr?new gr(e.lng,e.lat):gr.convert(e),this},$r.prototype.setSouthWest=function(e){return this._sw=e instanceof gr?new gr(e.lng,e.lat):gr.convert(e),this},$r.prototype.extend=function(e){var t,r,a=this._sw,l=this._ne;if(e instanceof gr)t=e,r=e;else{if(!(e instanceof $r))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend($r.convert(e)):this.extend(gr.convert(e)):this;if(r=e._ne,!(t=e._sw)||!r)return this}return a||l?(a.lng=Math.min(t.lng,a.lng),a.lat=Math.min(t.lat,a.lat),l.lng=Math.max(r.lng,l.lng),l.lat=Math.max(r.lat,l.lat)):(this._sw=new gr(t.lng,t.lat),this._ne=new gr(r.lng,r.lat)),this},$r.prototype.getCenter=function(){return new gr((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},$r.prototype.getSouthWest=function(){return this._sw},$r.prototype.getNorthEast=function(){return this._ne},$r.prototype.getNorthWest=function(){return new gr(this.getWest(),this.getNorth())},$r.prototype.getSouthEast=function(){return new gr(this.getEast(),this.getSouth())},$r.prototype.getWest=function(){return this._sw.lng},$r.prototype.getSouth=function(){return this._sw.lat},$r.prototype.getEast=function(){return this._ne.lng},$r.prototype.getNorth=function(){return this._ne.lat},$r.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},$r.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},$r.prototype.isEmpty=function(){return!(this._sw&&this._ne)},$r.prototype.contains=function(e){var t=gr.convert(e),r=t.lng,a=t.lat,l=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(l=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&l},$r.convert=function(e){return!e||e instanceof $r?e:new $r(e)};var gr=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: ("+e+", "+t+")");if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};gr.prototype.wrap=function(){return new gr(Ve(this.lng,-180,180),this.lat)},gr.prototype.toArray=function(){return[this.lng,this.lat]},gr.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},gr.prototype.distanceTo=function(e){var t=Math.PI/180,r=this.lat*t,a=e.lat*t,l=Math.sin(r)*Math.sin(a)+Math.cos(r)*Math.cos(a)*Math.cos((e.lng-this.lng)*t);return 63710088e-1*Math.acos(Math.min(l,1))},gr.prototype.toBounds=function(e){e===void 0&&(e=0);var t=360*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new $r(new gr(this.lng-r,this.lat-t),new gr(this.lng+r,this.lat+t))},gr.convert=function(e){if(e instanceof gr)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new gr(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new gr(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 Xm=2*Math.PI*63710088e-1;function Km(e){return Xm*Math.cos(e*Math.PI/180)}function Jm(e){return(180+e)/360}function Ym(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Qm(e,t){return e/Km(t)}function sp(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}var Ua=function(e,t,r){r===void 0&&(r=0),this.x=+e,this.y=+t,this.z=+r};Ua.fromLngLat=function(e,t){t===void 0&&(t=0);var r=gr.convert(e);return new Ua(Jm(r.lng),Ym(r.lat),Qm(t,r.lat))},Ua.prototype.toLngLat=function(){return new gr(360*this.x-180,sp(this.y))},Ua.prototype.toAltitude=function(){return this.z*Km(sp(this.y))},Ua.prototype.meterInMercatorCoordinateUnits=function(){return 1/Xm*(e=sp(this.y),1/Math.cos(e*Math.PI/180));var e};var Na=function(e,t,r){this.z=e,this.x=t,this.y=r,this.key=Ru(0,e,e,t,r)};Na.prototype.equals=function(e){return this.z===e.z&&this.x===e.x&&this.y===e.y},Na.prototype.url=function(e,t){var r,a,l,c,h,m=(a=this.y,l=this.z,c=Hm(256*(r=this.x),256*(a=Math.pow(2,l)-a-1),l),h=Hm(256*(r+1),256*(a+1),l),c[0]+","+c[1]+","+h[0]+","+h[1]),g=(function(x,S,I){for(var C,z="",j=x;j>0;j--)z+=(S&(C=1<<j-1)?1:0)+(I&C?2:0);return z})(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}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(t==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",g).replace("{bbox-epsg-3857}",m)},Na.prototype.getTilePoint=function(e){var t=Math.pow(2,this.z);return new X(8192*(e.x*t-this.x),8192*(e.y*t-this.y))},Na.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var ey=function(e,t){this.wrap=e,this.canonical=t,this.key=Ru(e,t.z,t.z,t.x,t.y)},Wr=function(e,t,r,a,l){this.overscaledZ=e,this.wrap=t,this.canonical=new Na(r,+a,+l),this.key=Ru(t,e,r,a,l)};function Ru(e,t,r,a,l){(e*=2)<0&&(e=-1*e-1);var c=1<<r;return(c*c*e+c*l+a).toString(36)+r.toString(36)+t.toString(36)}Wr.prototype.equals=function(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)},Wr.prototype.scaledTo=function(e){var t=this.canonical.z-e;return e>this.canonical.z?new Wr(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Wr(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)},Wr.prototype.calculateScaledKey=function(e,t){var r=this.canonical.z-e;return e>this.canonical.z?Ru(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):Ru(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)},Wr.prototype.isChildOf=function(e){if(e.wrap!==this.wrap)return!1;var t=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t},Wr.prototype.children=function(e){if(this.overscaledZ>=e)return[new Wr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var t=this.canonical.z+1,r=2*this.canonical.x,a=2*this.canonical.y;return[new Wr(t,this.wrap,t,r,a),new Wr(t,this.wrap,t,r+1,a),new Wr(t,this.wrap,t,r,a+1),new Wr(t,this.wrap,t,r+1,a+1)]},Wr.prototype.isLessThan=function(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))},Wr.prototype.wrapped=function(){return new Wr(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Wr.prototype.unwrapTo=function(e){return new Wr(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)},Wr.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Wr.prototype.toUnwrapped=function(){return new ey(this.wrap,this.canonical)},Wr.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Wr.prototype.getTilePoint=function(e){return this.canonical.getTilePoint(new Ua(e.x-this.wrap,e.y))},Xe("CanonicalTileID",Na),Xe("OverscaledTileID",Wr,{omit:["posMatrix"]});var Fo=function(e,t,r){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&r!=="mapbox"&&r!=="terrarium")return St('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=t.height;var a=this.dim=t.height-2;this.data=new Uint32Array(t.data.buffer),this.encoding=r||"mapbox";for(var l=0;l<a;l++)this.data[this._idx(-1,l)]=this.data[this._idx(0,l)],this.data[this._idx(a,l)]=this.data[this._idx(a-1,l)],this.data[this._idx(l,-1)]=this.data[this._idx(l,0)],this.data[this._idx(l,a)]=this.data[this._idx(l,a-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(a,-1)]=this.data[this._idx(a-1,0)],this.data[this._idx(-1,a)]=this.data[this._idx(0,a-1)],this.data[this._idx(a,a)]=this.data[this._idx(a-1,a-1)]};Fo.prototype.get=function(e,t){var r=new Uint8Array(this.data.buffer),a=4*this._idx(e,t);return(this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox)(r[a],r[a+1],r[a+2])},Fo.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Fo.prototype._idx=function(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)},Fo.prototype._unpackMapbox=function(e,t,r){return(256*e*256+256*t+r)/10-1e4},Fo.prototype._unpackTerrarium=function(e,t,r){return 256*e+t+r/256-32768},Fo.prototype.getPixels=function(){return new Hi({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Fo.prototype.backfillBorder=function(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");var a=t*this.dim,l=t*this.dim+this.dim,c=r*this.dim,h=r*this.dim+this.dim;switch(t){case-1:a=l-1;break;case 1:l=a+1}switch(r){case-1:c=h-1;break;case 1:h=c+1}for(var m=-t*this.dim,g=-r*this.dim,x=c;x<h;x++)for(var S=a;S<l;S++)this.data[this._idx(S,x)]=e.data[this._idx(S+m,x+g)]},Xe("DEMData",Fo);var Kl=function(e){this._stringToNumber={},this._numberToString=[];for(var t=0;t<e.length;t++){var r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}};Kl.prototype.encode=function(e){return this._stringToNumber[e]},Kl.prototype.decode=function(e){return this._numberToString[e]};var Jl=function(e,t,r,a,l){this.type="Feature",this._vectorTileFeature=e,e._z=t,e._x=r,e._y=a,this.properties=e.properties,this.id=l},up={geometry:{configurable:!0}};up.geometry.get=function(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},up.geometry.set=function(e){this._geometry=e},Jl.prototype.toJSON=function(){var e={geometry:this.geometry};for(var t in this)t!=="_geometry"&&t!=="_vectorTileFeature"&&(e[t]=this[t]);return e},Object.defineProperties(Jl.prototype,up);var zs=function(){this.state={},this.stateChanges={},this.deletedStates={}};zs.prototype.updateState=function(e,t,r){var a=String(t);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][a]=this.stateChanges[e][a]||{},Re(this.stateChanges[e][a],r),this.deletedStates[e]===null)for(var l in this.deletedStates[e]={},this.state[e])l!==a&&(this.deletedStates[e][l]=null);else if(this.deletedStates[e]&&this.deletedStates[e][a]===null)for(var c in this.deletedStates[e][a]={},this.state[e][a])r[c]||(this.deletedStates[e][a][c]=null);else for(var h in r)this.deletedStates[e]&&this.deletedStates[e][a]&&this.deletedStates[e][a][h]===null&&delete this.deletedStates[e][a][h]},zs.prototype.removeFeatureState=function(e,t,r){if(this.deletedStates[e]!==null){var a=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},r&&t!==void 0)this.deletedStates[e][a]!==null&&(this.deletedStates[e][a]=this.deletedStates[e][a]||{},this.deletedStates[e][a][r]=null);else if(t!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][a])for(r in this.deletedStates[e][a]={},this.stateChanges[e][a])this.deletedStates[e][a][r]=null;else this.deletedStates[e][a]=null;else this.deletedStates[e]=null}},zs.prototype.getState=function(e,t){var r=String(t),a=Re({},(this.state[e]||{})[r],(this.stateChanges[e]||{})[r]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){var l=this.deletedStates[e][t];if(l===null)return{};for(var c in l)delete a[c]}return a},zs.prototype.initializeTileState=function(e,t){e.setFeatureState(this.state,t)},zs.prototype.coalesceChanges=function(e,t){var r={};for(var a in this.stateChanges){this.state[a]=this.state[a]||{};var l={};for(var c in this.stateChanges[a])this.state[a][c]||(this.state[a][c]={}),Re(this.state[a][c],this.stateChanges[a][c]),l[c]=this.state[a][c];r[a]=l}for(var h in this.deletedStates){this.state[h]=this.state[h]||{};var m={};if(this.deletedStates[h]===null)for(var g in this.state[h])m[g]={},this.state[h][g]={};else for(var x in this.deletedStates[h]){if(this.deletedStates[h][x]===null)this.state[h][x]={};else for(var S=0,I=Object.keys(this.deletedStates[h][x]);S<I.length;S+=1)delete this.state[h][x][I[S]];m[x]=this.state[h][x]}r[h]=r[h]||{},Re(r[h],m)}if(this.stateChanges={},this.deletedStates={},Object.keys(r).length!==0)for(var C in e)e[C].setFeatureState(r,t)};var Oo=function(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Rn(8192,16,0),this.grid3D=new Rn(8192,16,0),this.featureIndexArray=new A,this.promoteId=t};function ty(e,t,r,a,l){return Fe(e,(function(c,h){var m=t instanceof Ba?t.get(h):null;return m&&m.evaluate?m.evaluate(r,a,l):m}))}function ry(e){for(var t=1/0,r=1/0,a=-1/0,l=-1/0,c=0,h=e;c<h.length;c+=1){var m=h[c];t=Math.min(t,m.x),r=Math.min(r,m.y),a=Math.max(a,m.x),l=Math.max(l,m.y)}return{minX:t,minY:r,maxX:a,maxY:l}}function c0(e,t){return t-e}Oo.prototype.insert=function(e,t,r,a,l,c){var h=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,a,l);for(var m=c?this.grid3D:this.grid,g=0;g<t.length;g++){for(var x=t[g],S=[1/0,1/0,-1/0,-1/0],I=0;I<x.length;I++){var C=x[I];S[0]=Math.min(S[0],C.x),S[1]=Math.min(S[1],C.y),S[2]=Math.max(S[2],C.x),S[3]=Math.max(S[3],C.y)}S[0]<8192&&S[1]<8192&&S[2]>=0&&S[3]>=0&&m.insert(h,S[0],S[1],S[2],S[3])}},Oo.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Ss.VectorTile(new Vl(this.rawTileData)).layers,this.sourceLayerCoder=new Kl(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Oo.prototype.query=function(e,t,r,a){var l=this;this.loadVTLayers();for(var c=e.params||{},h=8192/e.tileSize/e.scale,m=as(c.filter),g=e.queryGeometry,x=e.queryPadding*h,S=ry(g),I=this.grid.query(S.minX-x,S.minY-x,S.maxX+x,S.maxY+x),C=ry(e.cameraQueryGeometry),z=this.grid3D.query(C.minX-x,C.minY-x,C.maxX+x,C.maxY+x,(function(ce,he,xe,Pe){return(function(De,rt,Ue,ot,je){for(var bt=0,pt=De;bt<pt.length;bt+=1){var Qe=pt[bt];if(rt<=Qe.x&&Ue<=Qe.y&&ot>=Qe.x&&je>=Qe.y)return!0}var Tt=[new X(rt,Ue),new X(rt,je),new X(ot,je),new X(ot,Ue)];if(De.length>2){for(var vt=0,Rt=Tt;vt<Rt.length;vt+=1)if(Pn(De,Rt[vt]))return!0}for(var at=0;at<De.length-1;at++)if(Fa(De[at],De[at+1],Tt))return!0;return!1})(e.cameraQueryGeometry,ce-x,he-x,xe+x,Pe+x)})),j=0,G=z;j<G.length;j+=1)I.push(G[j]);I.sort(c0);for(var te,K={},oe=function(ce){var he=I[ce];if(he!==te){te=he;var xe=l.featureIndexArray.get(he),Pe=null;l.loadMatchingFeature(K,xe.bucketIndex,xe.sourceLayerIndex,xe.featureIndex,m,c.layers,c.availableImages,t,r,a,(function(De,rt,Ue){return Pe||(Pe=wr(De)),rt.queryIntersectsFeature(g,De,Ue,Pe,l.z,e.transform,h,e.pixelPosMatrix)}))}},le=0;le<I.length;le++)oe(le);return K},Oo.prototype.loadMatchingFeature=function(e,t,r,a,l,c,h,m,g,x,S){var I=this.bucketLayerIDs[t];if(!c||(function(De,rt){for(var Ue=0;Ue<De.length;Ue++)if(rt.indexOf(De[Ue])>=0)return!0;return!1})(c,I)){var C=this.sourceLayerCoder.decode(r),z=this.vtLayers[C].feature(a);if(l.needGeometry){var j=kr(z,!0);if(!l.filter(new Ct(this.tileID.overscaledZ),j,this.tileID.canonical))return}else if(!l.filter(new Ct(this.tileID.overscaledZ),z))return;for(var G=this.getId(z,C),te=0;te<I.length;te++){var K=I[te];if(!(c&&c.indexOf(K)<0)){var oe=m[K];if(oe){var le={};G!==void 0&&x&&(le=x.getState(oe.sourceLayer||"_geojsonTileLayer",G));var ce=Re({},g[K]);ce.paint=ty(ce.paint,oe.paint,z,le,h),ce.layout=ty(ce.layout,oe.layout,z,le,h);var he=!S||S(z,oe,le);if(he){var xe=new Jl(z,this.z,this.x,this.y,G);xe.layer=ce;var Pe=e[K];Pe===void 0&&(Pe=e[K]=[]),Pe.push({featureIndex:a,feature:xe,intersectionZ:he})}}}}}},Oo.prototype.lookupSymbolFeatures=function(e,t,r,a,l,c,h,m){var g={};this.loadVTLayers();for(var x=as(l),S=0,I=e;S<I.length;S+=1)this.loadMatchingFeature(g,r,a,I[S],x,c,h,m,t);return g},Oo.prototype.hasLayer=function(e){for(var t=0,r=this.bucketLayerIDs;t<r.length;t+=1)for(var a=0,l=r[t];a<l.length;a+=1)if(e===l[a])return!0;return!1},Oo.prototype.getId=function(e,t){var r=e.id;return this.promoteId&&typeof(r=e.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[t]])=="boolean"&&(r=Number(r)),r},Xe("FeatureIndex",Oo,{omit:["rawTileData","sourceLayerCoder"]});var ui=function(e,t){this.tileID=e,this.uid=Ke(),this.uses=0,this.tileSize=t,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};ui.prototype.registerFadeDuration=function(e){var t=e+this.timeAdded;t<Xi.now()||this.fadeEndTime&&t<this.fadeEndTime||(this.fadeEndTime=t)},ui.prototype.wasRequested=function(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"},ui.prototype.loadVectorData=function(e,t,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){for(var a in 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(x,S){var I={};if(!S)return I;for(var C=function(){var G=j[z],te=G.layerIds.map((function(le){return S.getLayer(le)})).filter(Boolean);if(te.length!==0){G.layers=te,G.stateDependentLayerIds&&(G.stateDependentLayers=G.stateDependentLayerIds.map((function(le){return te.filter((function(ce){return ce.id===le}))[0]})));for(var K=0,oe=te;K<oe.length;K+=1)I[oe[K].id]=G}},z=0,j=x;z<j.length;z+=1)C();return I})(e.buckets,t.style),this.hasSymbolBuckets=!1,this.buckets){var l=this.buckets[a];if(l instanceof er){if(this.hasSymbolBuckets=!0,!r)break;l.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var c in this.buckets){var h=this.buckets[c];if(h instanceof er&&h.hasRTLText){this.hasRTLText=!0,Qi.isLoading()||Qi.isLoaded()||gu()!=="deferred"||_n();break}}for(var m in this.queryPadding=0,this.buckets){var g=this.buckets[m];this.queryPadding=Math.max(this.queryPadding,t.style.getLayer(m).queryRadius(g))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new o},ui.prototype.unloadVectorData=function(){for(var e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},ui.prototype.getBucket=function(e){return this.buckets[e.id]},ui.prototype.upload=function(e){for(var t in this.buckets){var r=this.buckets[t];r.uploadPending()&&r.upload(e)}var a=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new qa(e,this.imageAtlas.image,a.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new qa(e,this.glyphAtlasImage,a.ALPHA),this.glyphAtlasImage=null)},ui.prototype.prepare=function(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)},ui.prototype.queryRenderedFeatures=function(e,t,r,a,l,c,h,m,g,x){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:a,cameraQueryGeometry:l,scale:c,tileSize:this.tileSize,pixelPosMatrix:x,transform:m,params:h,queryPadding:this.queryPadding*g},e,t,r):{}},ui.prototype.querySourceFeatures=function(e,t){var r=this.latestFeatureIndex;if(r&&r.rawTileData){var a=r.loadVTLayers(),l=t?t.sourceLayer:"",c=a._geojsonTileLayer||a[l];if(c)for(var h=as(t&&t.filter),m=this.tileID.canonical,g=m.z,x=m.x,S=m.y,I={z:g,x,y:S},C=0;C<c.length;C++){var z=c.feature(C);if(h.needGeometry){var j=kr(z,!0);if(!h.filter(new Ct(this.tileID.overscaledZ),j,this.tileID.canonical))continue}else if(!h.filter(new Ct(this.tileID.overscaledZ),z))continue;var G=r.getId(z,l),te=new Jl(z,g,x,S,G);te.tile=I,e.push(te)}}},ui.prototype.hasData=function(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"},ui.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},ui.prototype.setExpiryData=function(e){var t=this.expirationTime;if(e.cacheControl){var r=bi(e.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){var a=Date.now(),l=!1;if(this.expirationTime>a)l=!1;else if(t)if(this.expirationTime<t)l=!0;else{var c=this.expirationTime-t;c?this.expirationTime=a+Math.max(c,3e4):l=!0}else l=!0;l?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},ui.prototype.getExpiryTimeout=function(){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)},ui.prototype.setFeatureState=function(e,t){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&Object.keys(e).length!==0){var r=this.latestFeatureIndex.loadVTLayers();for(var a in this.buckets)if(t.style.hasLayer(a)){var l=this.buckets[a],c=l.layers[0].sourceLayer||"_geojsonTileLayer",h=r[c],m=e[c];if(h&&m&&Object.keys(m).length!==0){l.update(m,h,this.imageAtlas&&this.imageAtlas.patternPositions||{});var g=t&&t.style&&t.style.getLayer(a);g&&(this.queryPadding=Math.max(this.queryPadding,g.queryRadius(l)))}}}},ui.prototype.holdingForFade=function(){return this.symbolFadeHoldUntil!==void 0},ui.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Xi.now()},ui.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},ui.prototype.setHoldDuration=function(e){this.symbolFadeHoldUntil=Xi.now()+e},ui.prototype.setDependencies=function(e,t){for(var r={},a=0,l=t;a<l.length;a+=1)r[l[a]]=!0;this.dependencies[e]=r},ui.prototype.hasDependency=function(e,t){for(var r=0,a=e;r<a.length;r+=1){var l=this.dependencies[a[r]];if(l){for(var c=0,h=t;c<h.length;c+=1)if(l[h[c]])return!0}}return!1};var ua=Y.performance,iy=function(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},ua.mark(this._marks.start)};iy.prototype.finish=function(){ua.mark(this._marks.end);var e=ua.getEntriesByName(this._marks.measure);return e.length===0&&(ua.measure(this._marks.measure,this._marks.start,this._marks.end),e=ua.getEntriesByName(this._marks.measure),ua.clearMarks(this._marks.start),ua.clearMarks(this._marks.end),ua.clearMeasures(this._marks.measure)),e},u.Actor=Bs,u.AlphaImage=Va,u.CanonicalTileID=Na,u.CollisionBoxArray=o,u.Color=Zt,u.DEMData=Fo,u.DataConstantProperty=it,u.DictionaryCoder=Kl,u.EXTENT=8192,u.ErrorEvent=re,u.EvaluationParameters=Ct,u.Event=Z,u.Evented=ie,u.FeatureIndex=Oo,u.FillBucket=Vn,u.FillExtrusionBucket=qn,u.ImageAtlas=zu,u.ImagePosition=Ul,u.LineBucket=Fi,u.LngLat=gr,u.LngLatBounds=$r,u.MercatorCoordinate=Ua,u.ONE_EM=24,u.OverscaledTileID=Wr,u.Point=X,u.Point$1=X,u.Properties=vi,u.Protobuf=Vl,u.RGBAImage=Hi,u.RequestManager=pr,u.RequestPerformance=iy,u.ResourceType=jt,u.SegmentVector=F,u.SourceFeatureState=zs,u.StructArrayLayout1ui2=Iu,u.StructArrayLayout2f1f2i16=zo,u.StructArrayLayout2i4=Bo,u.StructArrayLayout3ui6=to,u.StructArrayLayout4i8=xu,u.SymbolBucket=er,u.Texture=qa,u.Tile=ui,u.Transitionable=yi,u.Uniform1f=Me,u.Uniform1i=Ie,u.Uniform2f=Ce,u.Uniform3f=$e,u.Uniform4f=nt,u.UniformColor=ut,u.UniformMatrix4f=Lt,u.UnwrappedTileID=ey,u.ValidationError=H,u.WritingMode=pn,u.ZoomHistory=du,u.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e},u.addDynamicAttributes=np,u.asyncAll=function(e,t,r){if(!e.length)return r(null,[]);var a=e.length,l=new Array(e.length),c=null;e.forEach((function(h,m){t(h,(function(g,x){g&&(c=g),l[m]=x,--a==0&&r(c,l)}))}))},u.bezier=be,u.bindAll=we,u.browser=Xi,u.cacheEntryPossiblyAdded=function(e){++fe>$o&&(e.getActor().send("enforceCacheSizeLimit",Bn),fe=0)},u.clamp=Oe,u.clearTileCache=function(e){var t=Y.caches.delete("mapbox-tiles");e&&t.catch(e).then((function(){return e()}))},u.clipLine=Om,u.clone=function(e){var t=new $t(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],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},u.clone$1=kt,u.clone$2=function(e){var t=new $t(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},u.collisionCircleLayout=kb,u.config=Nt,u.create=function(){var e=new $t(16);return $t!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},u.create$1=function(){var e=new $t(9);return $t!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e},u.create$2=function(){var e=new $t(4);return $t!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},u.createCommonjsModule=U,u.createExpression=ns,u.createLayout=ai,u.createStyleLayer=function(e){return e.type==="custom"?new u0(e):new l0[e.type](e)},u.cross=function(e,t,r){var a=t[0],l=t[1],c=t[2],h=r[0],m=r[1],g=r[2];return e[0]=l*g-c*m,e[1]=c*h-a*g,e[2]=a*m-l*h,e},u.deepEqual=function e(t,r){if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(var a=0;a<t.length;a++)if(!e(t[a],r[a]))return!1;return!0}if(typeof t=="object"&&t!==null&&r!==null){if(typeof r!="object"||Object.keys(t).length!==Object.keys(r).length)return!1;for(var l in t)if(!e(t[l],r[l]))return!1;return!0}return t===r},u.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},u.dot$1=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},u.ease=ke,u.emitValidationErrors=Ca,u.endsWith=Ge,u.enforceCacheSizeLimit=function(e){jn(),ri&&ri.then((function(t){t.keys().then((function(r){for(var a=0;a<r.length-e;a++)t.delete(r[a])}))}))},u.evaluateSizeForFeature=Bm,u.evaluateSizeForZoom=zm,u.evaluateVariableOffset=Um,u.evented=vu,u.extend=Re,u.featureFilter=as,u.filterObject=tt,u.fromRotation=function(e,t){var r=Math.sin(t),a=Math.cos(t);return e[0]=a,e[1]=r,e[2]=0,e[3]=-r,e[4]=a,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},u.getAnchorAlignment=ep,u.getAnchorJustification=ip,u.getArrayBuffer=ii,u.getImage=P,u.getJSON=function(e,t){return qi(Re(e,{type:"json"}),t)},u.getRTLTextPluginStatus=gu,u.getReferrer=Kt,u.getVideo=function(e,t){var r,a,l=Y.document.createElement("video");l.muted=!0,l.onloadstart=function(){t(null,l)};for(var c=0;c<e.length;c++){var h=Y.document.createElement("source");r=e[c],a=void 0,(a=Y.document.createElement("a")).href=r,(a.protocol!==Y.document.location.protocol||a.host!==Y.document.location.host)&&(l.crossOrigin="Anonymous"),h.src=e[c],l.appendChild(h)}return{cancel:function(){}}},u.identity=en,u.invert=function(e,t){var r=t[0],a=t[1],l=t[2],c=t[3],h=t[4],m=t[5],g=t[6],x=t[7],S=t[8],I=t[9],C=t[10],z=t[11],j=t[12],G=t[13],te=t[14],K=t[15],oe=r*m-a*h,le=r*g-l*h,ce=r*x-c*h,he=a*g-l*m,xe=a*x-c*m,Pe=l*x-c*g,De=S*G-I*j,rt=S*te-C*j,Ue=S*K-z*j,ot=I*te-C*G,je=I*K-z*G,bt=C*K-z*te,pt=oe*bt-le*je+ce*ot+he*Ue-xe*rt+Pe*De;return pt?(e[0]=(m*bt-g*je+x*ot)*(pt=1/pt),e[1]=(l*je-a*bt-c*ot)*pt,e[2]=(G*Pe-te*xe+K*he)*pt,e[3]=(C*xe-I*Pe-z*he)*pt,e[4]=(g*Ue-h*bt-x*rt)*pt,e[5]=(r*bt-l*Ue+c*rt)*pt,e[6]=(te*ce-j*Pe-K*le)*pt,e[7]=(S*Pe-C*ce+z*le)*pt,e[8]=(h*je-m*Ue+x*De)*pt,e[9]=(a*Ue-r*je-c*De)*pt,e[10]=(j*xe-G*ce+K*oe)*pt,e[11]=(I*ce-S*xe-z*oe)*pt,e[12]=(m*rt-h*ot-g*De)*pt,e[13]=(r*ot-a*rt+l*De)*pt,e[14]=(G*le-j*he-te*oe)*pt,e[15]=(S*he-I*le+C*oe)*pt,e):null},u.isChar=Le,u.isMapboxURL=jr,u.keysDifference=function(e,t){var r=[];for(var a in e)a in t||r.push(a);return r},u.makeRequest=qi,u.mapObject=Fe,u.mercatorXfromLng=Jm,u.mercatorYfromLat=Ym,u.mercatorZfromAltitude=Qm,u.mul=Nc,u.multiply=Li,u.mvt=Ss,u.nextPowerOfTwo=function(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},u.normalize=function(e,t){var r=t[0],a=t[1],l=t[2],c=r*r+a*a+l*l;return c>0&&(c=1/Math.sqrt(c)),e[0]=t[0]*c,e[1]=t[1]*c,e[2]=t[2]*c,e},u.number=Vr,u.offscreenCanvasSupported=_e,u.ortho=function(e,t,r,a,l,c,h){var m=1/(t-r),g=1/(a-l),x=1/(c-h);return e[0]=-2*m,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*g,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*x,e[11]=0,e[12]=(t+r)*m,e[13]=(l+a)*g,e[14]=(h+c)*x,e[15]=1,e},u.parseGlyphPBF=function(e){return new Vl(e).readFields(Ub,[])},u.pbf=Vl,u.performSymbolLayout=function(e,t,r,a,l,c,h){e.createArrays(),e.tilePixelRatio=8192/(512*e.overscaling),e.compareText={},e.iconsNeedLinear=!1;var m=e.layers[0].layout,g=e.layers[0]._unevaluatedLayout._values,x={};if(e.textSizeData.kind==="composite"){var S=e.textSizeData,I=S.maxZoom;x.compositeTextSizes=[g["text-size"].possiblyEvaluate(new Ct(S.minZoom),h),g["text-size"].possiblyEvaluate(new Ct(I),h)]}if(e.iconSizeData.kind==="composite"){var C=e.iconSizeData,z=C.maxZoom;x.compositeIconSizes=[g["icon-size"].possiblyEvaluate(new Ct(C.minZoom),h),g["icon-size"].possiblyEvaluate(new Ct(z),h)]}x.layoutTextSize=g["text-size"].possiblyEvaluate(new Ct(e.zoom+1),h),x.layoutIconSize=g["icon-size"].possiblyEvaluate(new Ct(e.zoom+1),h),x.textMaxSize=g["text-size"].possiblyEvaluate(new Ct(18));for(var j=24*m.get("text-line-height"),G=m.get("text-rotation-alignment")==="map"&&m.get("symbol-placement")!=="point",te=m.get("text-keep-upright"),K=m.get("text-size"),oe=function(){var he=ce[le],xe=m.get("text-font").evaluate(he,{},h).join(","),Pe=K.evaluate(he,{},h),De=x.layoutTextSize.evaluate(he,{},h),rt=x.layoutIconSize.evaluate(he,{},h),Ue={horizontal:{},vertical:void 0},ot=he.text,je=[0,0];if(ot){var bt=ot.toString(),pt=24*m.get("text-letter-spacing").evaluate(he,{},h),Qe=(function(Mt){for(var nr=0,Jt=Mt;nr<Jt.length;nr+=1)if(Ft=Jt[nr].charCodeAt(0),Le.Arabic(Ft)||Le["Arabic Supplement"](Ft)||Le["Arabic Extended-A"](Ft)||Le["Arabic Presentation Forms-A"](Ft)||Le["Arabic Presentation Forms-B"](Ft))return!1;var Ft;return!0})(bt)?pt:0,Tt=m.get("text-anchor").evaluate(he,{},h),vt=m.get("text-variable-anchor");if(!vt){var Rt=m.get("text-radial-offset").evaluate(he,{},h);je=Rt?Um(Tt,[24*Rt,rp]):m.get("text-offset").evaluate(he,{},h).map((function(Mt){return 24*Mt}))}var at=G?"center":m.get("text-justify").evaluate(he,{},h),Vt=m.get("symbol-placement"),_r=Vt==="point"?24*m.get("text-max-width").evaluate(he,{},h):0,Tr=function(){e.allowVerticalPlacement&&mu(bt)&&(Ue.vertical=Nl(ot,t,r,l,xe,_r,j,Tt,"left",Qe,je,pn.vertical,!0,Vt,De,Pe))};if(!G&&vt){for(var Sr=at==="auto"?vt.map((function(Mt){return ip(Mt)})):[at],xr=!1,Ar=0;Ar<Sr.length;Ar++){var Qr=Sr[Ar];if(!Ue.horizontal[Qr])if(xr)Ue.horizontal[Qr]=Ue.horizontal[0];else{var ei=Nl(ot,t,r,l,xe,_r,j,"center",Qr,Qe,je,pn.horizontal,!1,Vt,De,Pe);ei&&(Ue.horizontal[Qr]=ei,xr=ei.positionedLines.length===1)}}Tr()}else{at==="auto"&&(at=ip(Tt));var Ci=Nl(ot,t,r,l,xe,_r,j,Tt,at,Qe,je,pn.horizontal,!1,Vt,De,Pe);Ci&&(Ue.horizontal[at]=Ci),Tr(),mu(bt)&&G&&te&&(Ue.vertical=Nl(ot,t,r,l,xe,_r,j,Tt,at,Qe,je,pn.vertical,!1,Vt,De,Pe))}}var li=void 0,ki=!1;if(he.icon&&he.icon.name){var Mr=a[he.icon.name];Mr&&(li=(function(Mt,nr,Jt){var Ft=ep(Jt),Oi=nr[0]-Mt.displaySize[0]*Ft.horizontalAlign,_i=nr[1]-Mt.displaySize[1]*Ft.verticalAlign;return{image:Mt,top:_i,bottom:_i+Mt.displaySize[1],left:Oi,right:Oi+Mt.displaySize[0]}})(l[he.icon.name],m.get("icon-offset").evaluate(he,{},h),m.get("icon-anchor").evaluate(he,{},h)),ki=Mr.sdf,e.sdfIcons===void 0?e.sdfIcons=Mr.sdf:e.sdfIcons!==Mr.sdf&&St("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Mr.pixelRatio!==e.pixelRatio||m.get("icon-rotate").constantOr(1)!==0)&&(e.iconsNeedLinear=!0))}var ci=jm(Ue.horizontal)||Ue.vertical;e.iconsInText=!!ci&&ci.iconsInText,(ci||li)&&(function(Mt,nr,Jt,Ft,Oi,_i,fr,Ur,xi,qt,so){var hn=_i.textMaxSize.evaluate(nr,{});hn===void 0&&(hn=fr);var uo,Br=Mt.layers[0].layout,lo=Br.get("icon-offset").evaluate(nr,{},so),kn=jm(Jt.horizontal),Ds=fr/24,ja=Mt.tilePixelRatio*Ds,Rs=Mt.tilePixelRatio*hn/24,Vo=Mt.tilePixelRatio*Ur,Ls=Mt.tilePixelRatio*Br.get("symbol-spacing"),Yl=Br.get("text-padding")*Mt.tilePixelRatio,Fs=Br.get("icon-padding")*Mt.tilePixelRatio,Lu=Br.get("text-max-angle")/180*Math.PI,Ql=Br.get("text-rotation-alignment")==="map"&&Br.get("symbol-placement")!=="point",ec=Br.get("icon-rotation-alignment")==="map"&&Br.get("symbol-placement")!=="point",qo=Br.get("symbol-placement"),Fu=Ls/2,Os=Br.get("icon-text-fit");Ft&&Os!=="none"&&(Mt.allowVerticalPlacement&&Jt.vertical&&(uo=Mm(Ft,Jt.vertical,Os,Br.get("icon-text-fit-padding"),lo,Ds)),kn&&(Ft=Mm(Ft,kn,Os,Br.get("icon-text-fit-padding"),lo,Ds)));var la=function(p0,Zu){Zu.x<0||Zu.x>=8192||Zu.y<0||Zu.y>=8192||(function(zr,Un,h0,ca,hp,ay,ac,co,sc,$u,uc,lc,fp,sy,Wu,uy,ly,cy,py,hy,fn,cc,fy,po,f0){var dy,Za,js,Gs,Zs,$s=zr.addToLineVertexArray(Un,h0),my=0,yy=0,vy=0,gy=0,dp=-1,mp=-1,Uo={},_y=N(""),yp=0,vp=0;if(co._unevaluatedLayout.getValue("text-radial-offset")===void 0?(yp=(dy=co.layout.get("text-offset").evaluate(fn,{},po).map((function(Xu){return 24*Xu})))[0],vp=dy[1]):(yp=24*co.layout.get("text-radial-offset").evaluate(fn,{},po),vp=rp),zr.allowVerticalPlacement&&ca.vertical){var xy=co.layout.get("text-rotate").evaluate(fn,{},po)+90;Gs=new Wl(sc,Un,$u,uc,lc,ca.vertical,fp,sy,Wu,xy),ac&&(Zs=new Wl(sc,Un,$u,uc,lc,ac,ly,cy,Wu,xy))}if(hp){var gp=co.layout.get("icon-rotate").evaluate(fn,{}),by=co.layout.get("icon-text-fit")!=="none",wy=Vm(hp,gp,fy,by),_p=ac?Vm(ac,gp,fy,by):void 0;js=new Wl(sc,Un,$u,uc,lc,hp,ly,cy,!1,gp),my=4*wy.length;var Sy=zr.iconSizeData,Hu=null;Sy.kind==="source"?(Hu=[128*co.layout.get("icon-size").evaluate(fn,{})])[0]>32640&&St(zr.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):Sy.kind==="composite"&&((Hu=[128*cc.compositeIconSizes[0].evaluate(fn,{},po),128*cc.compositeIconSizes[1].evaluate(fn,{},po)])[0]>32640||Hu[1]>32640)&&St(zr.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),zr.addSymbols(zr.icon,wy,Hu,hy,py,fn,!1,Un,$s.lineStartIndex,$s.lineLength,-1,po),dp=zr.icon.placedSymbolArray.length-1,_p&&(yy=4*_p.length,zr.addSymbols(zr.icon,_p,Hu,hy,py,fn,pn.vertical,Un,$s.lineStartIndex,$s.lineLength,-1,po),mp=zr.icon.placedSymbolArray.length-1)}for(var Iy in ca.horizontal){var pc=ca.horizontal[Iy];if(!Za){_y=N(pc.text);var d0=co.layout.get("text-rotate").evaluate(fn,{},po);Za=new Wl(sc,Un,$u,uc,lc,pc,fp,sy,Wu,d0)}var Ty=pc.positionedLines.length===1;if(vy+=Nm(zr,Un,pc,ay,co,Wu,fn,uy,$s,ca.vertical?pn.horizontal:pn.horizontalOnly,Ty?Object.keys(ca.horizontal):[Iy],Uo,dp,cc,po),Ty)break}ca.vertical&&(gy+=Nm(zr,Un,ca.vertical,ay,co,Wu,fn,uy,$s,pn.vertical,["vertical"],Uo,mp,cc,po));var m0=Za?Za.boxStartIndex:zr.collisionBoxArray.length,y0=Za?Za.boxEndIndex:zr.collisionBoxArray.length,v0=Gs?Gs.boxStartIndex:zr.collisionBoxArray.length,g0=Gs?Gs.boxEndIndex:zr.collisionBoxArray.length,_0=js?js.boxStartIndex:zr.collisionBoxArray.length,x0=js?js.boxEndIndex:zr.collisionBoxArray.length,b0=Zs?Zs.boxStartIndex:zr.collisionBoxArray.length,w0=Zs?Zs.boxEndIndex:zr.collisionBoxArray.length,ho=-1,hc=function(Xu,Ey){return Xu&&Xu.circleDiameter?Math.max(Xu.circleDiameter,Ey):Ey};ho=hc(Za,ho),ho=hc(Gs,ho),ho=hc(js,ho);var Ay=(ho=hc(Zs,ho))>-1?1:0;Ay&&(ho*=f0/24),zr.glyphOffsetArray.length>=er.MAX_GLYPHS&&St("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),fn.sortKey!==void 0&&zr.addToSortKeyRanges(zr.symbolInstances.length,fn.sortKey),zr.symbolInstances.emplaceBack(Un.x,Un.y,Uo.right>=0?Uo.right:-1,Uo.center>=0?Uo.center:-1,Uo.left>=0?Uo.left:-1,Uo.vertical||-1,dp,mp,_y,m0,y0,v0,g0,_0,x0,b0,w0,$u,vy,gy,my,yy,Ay,0,fp,yp,vp,ho)})(Mt,Zu,p0,Jt,Ft,Oi,uo,Mt.layers[0],Mt.collisionBoxArray,nr.index,nr.sourceLayerIndex,Mt.index,ja,Yl,Ql,xi,Vo,Fs,ec,lo,nr,_i,qt,so,fr)};if(qo==="line")for(var Vs=0,tc=Om(nr.geometry,0,0,8192,8192);Vs<tc.length;Vs+=1)for(var rc=tc[Vs],Ou=0,Vu=Hb(rc,Ls,Lu,Jt.vertical||kn,Ft,24,Rs,Mt.overscaling,8192);Ou<Vu.length;Ou+=1){var ic=Vu[Ou];kn&&Yb(Mt,kn.text,Fu,ic)||la(rc,ic)}else if(qo==="line-center")for(var qu=0,Uu=nr.geometry;qu<Uu.length;qu+=1){var Nu=Uu[qu];if(Nu.length>1){var nc=Wb(Nu,Lu,Jt.vertical||kn,Ft,24,Rs);nc&&la(Nu,nc)}}else if(nr.type==="Polygon")for(var qs=0,oc=Xc(nr.geometry,0);qs<oc.length;qs+=1){var Us=oc[qs],ju=Kb(Us,16);la(Us[0],new Es(ju.x,ju.y,0))}else if(nr.type==="LineString")for(var Ga=0,Gu=nr.geometry;Ga<Gu.length;Ga+=1){var Ns=Gu[Ga];la(Ns,new Es(Ns[0].x,Ns[0].y,0))}else if(nr.type==="Point")for(var lp=0,ny=nr.geometry;lp<ny.length;lp+=1)for(var cp=0,oy=ny[lp];cp<oy.length;cp+=1){var pp=oy[cp];la([pp],new Es(pp.x,pp.y,0))}})(e,he,Ue,li,a,x,De,rt,je,ki,h)},le=0,ce=e.features;le<ce.length;le+=1)oe();c&&e.generateCollisionDebugBuffers()},u.perspective=function(e,t,r,a,l){var c,h=1/Math.tan(t/2);return e[0]=h/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=h,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,l!=null&&l!==1/0?(e[10]=(l+a)*(c=1/(a-l)),e[14]=2*l*a*c):(e[10]=-1,e[14]=-2*a),e},u.pick=function(e,t){for(var r={},a=0;a<t.length;a++){var l=t[a];l in e&&(r[l]=e[l])}return r},u.plugin=Qi,u.polygonIntersectsPolygon=no,u.postMapLoadEvent=Mn,u.postTurnstileEvent=Zo,u.potpack=Em,u.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],u.register=Xe,u.registerForPluginStateChange=function(e){return e({pluginStatus:Zi,pluginURL:Ln}),vu.on("pluginStateChange",e),e},u.renderColorRamp=um,u.rotate=function(e,t,r){var a=t[0],l=t[1],c=t[2],h=t[3],m=Math.sin(r),g=Math.cos(r);return e[0]=a*g+c*m,e[1]=l*g+h*m,e[2]=a*-m+c*g,e[3]=l*-m+h*g,e},u.rotateX=function(e,t,r){var a=Math.sin(r),l=Math.cos(r),c=t[4],h=t[5],m=t[6],g=t[7],x=t[8],S=t[9],I=t[10],C=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=c*l+x*a,e[5]=h*l+S*a,e[6]=m*l+I*a,e[7]=g*l+C*a,e[8]=x*l-c*a,e[9]=S*l-h*a,e[10]=I*l-m*a,e[11]=C*l-g*a,e},u.rotateZ=function(e,t,r){var a=Math.sin(r),l=Math.cos(r),c=t[0],h=t[1],m=t[2],g=t[3],x=t[4],S=t[5],I=t[6],C=t[7];return t!==e&&(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[0]=c*l+x*a,e[1]=h*l+S*a,e[2]=m*l+I*a,e[3]=g*l+C*a,e[4]=x*l-c*a,e[5]=S*l-h*a,e[6]=I*l-m*a,e[7]=C*l-g*a,e},u.scale=function(e,t,r){var a=r[0],l=r[1],c=r[2];return e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e[3]=t[3]*a,e[4]=t[4]*l,e[5]=t[5]*l,e[6]=t[6]*l,e[7]=t[7]*l,e[8]=t[8]*c,e[9]=t[9]*c,e[10]=t[10]*c,e[11]=t[11]*c,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},u.scale$1=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},u.scale$2=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e},u.setCacheLimits=function(e,t){Bn=e,$o=t},u.setRTLTextPlugin=function(e,t,r){if(r===void 0&&(r=!1),Zi==="deferred"||Zi==="loading"||Zi==="loaded")throw new Error("setRTLTextPlugin cannot be called multiple times.");Ln=Xi.resolveURL(e),Zi="deferred",fs=t,Ma(),r||_n()},u.sphericalToCartesian=function(e){var t=e[0],r=e[1],a=e[2];return r+=90,r*=Math.PI/180,a*=Math.PI/180,{x:t*Math.cos(r)*Math.sin(a),y:t*Math.sin(r)*Math.sin(a),z:t*Math.cos(a)}},u.sqrLen=function(e){var t=e[0],r=e[1];return t*t+r*r},u.styleSpec=L,u.sub=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e},u.symbolSize=$b,u.transformMat3=function(e,t,r){var a=t[0],l=t[1],c=t[2];return e[0]=a*r[0]+l*r[3]+c*r[6],e[1]=a*r[1]+l*r[4]+c*r[7],e[2]=a*r[2]+l*r[5]+c*r[8],e},u.transformMat4=_s,u.translate=function(e,t,r){var a,l,c,h,m,g,x,S,I,C,z,j,G=r[0],te=r[1],K=r[2];return t===e?(e[12]=t[0]*G+t[4]*te+t[8]*K+t[12],e[13]=t[1]*G+t[5]*te+t[9]*K+t[13],e[14]=t[2]*G+t[6]*te+t[10]*K+t[14],e[15]=t[3]*G+t[7]*te+t[11]*K+t[15]):(l=t[1],c=t[2],h=t[3],m=t[4],g=t[5],x=t[6],S=t[7],I=t[8],C=t[9],z=t[10],j=t[11],e[0]=a=t[0],e[1]=l,e[2]=c,e[3]=h,e[4]=m,e[5]=g,e[6]=x,e[7]=S,e[8]=I,e[9]=C,e[10]=z,e[11]=j,e[12]=a*G+m*te+I*K+t[12],e[13]=l*G+g*te+C*K+t[13],e[14]=c*G+x*te+z*K+t[14],e[15]=h*G+S*te+j*K+t[15]),e},u.triggerPluginCompletionEvent=Bl,u.uniqueId=Ke,u.validateCustomStyleLayer=function(e){var t=[],r=e.id;return r===void 0&&t.push({message:"layers."+r+': missing required property "id"'}),e.render===void 0&&t.push({message:"layers."+r+': missing required method "render"'}),e.renderingMode&&e.renderingMode!=="2d"&&e.renderingMode!=="3d"&&t.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),t},u.validateLight=qc,u.validateStyle=Ea,u.values=function(e){var t=[];for(var r in e)t.push(e[r]);return t},u.vectorTile=Ss,u.version="1.13.3",u.warnOnce=St,u.webpSupported=Nr,u.window=Y,u.wrap=Ve})),R(["./shared"],(function(u){function U(T){var P=typeof T;if(P==="number"||P==="boolean"||P==="string"||T==null)return JSON.stringify(T);if(Array.isArray(T)){for(var B="[",V=0,Z=T;V<Z.length;V+=1)B+=U(Z[V])+",";return B+"]"}for(var re=Object.keys(T).sort(),ie="{",L=0;L<re.length;L++)ie+=JSON.stringify(re[L])+":"+U(T[re[L]])+",";return ie+"}"}function k(T){for(var P="",B=0,V=u.refProperties;B<V.length;B+=1)P+="/"+U(T[V[B]]);return P}var J=function(T){this.keyCache={},T&&this.replace(T)};J.prototype.replace=function(T){this._layerConfigs={},this._layers={},this.update(T,[])},J.prototype.update=function(T,P){for(var B=this,V=0,Z=T;V<Z.length;V+=1){var re=Z[V];this._layerConfigs[re.id]=re;var ie=this._layers[re.id]=u.createStyleLayer(re);ie._featureFilter=u.featureFilter(ie.filter),this.keyCache[re.id]&&delete this.keyCache[re.id]}for(var L=0,H=P;L<H.length;L+=1){var se=H[L];delete this.keyCache[se],delete this._layerConfigs[se],delete this._layers[se]}this.familiesBySource={};for(var Se=0,Ee=(function(ze,Be){for(var yt={},qe=0;qe<ze.length;qe++){var Et=Be&&Be[ze[qe].id]||k(ze[qe]);Be&&(Be[ze[qe].id]=Et);var rr=yt[Et];rr||(rr=yt[Et]=[]),rr.push(ze[qe])}var Pt=[];for(var Gt in yt)Pt.push(yt[Gt]);return Pt})(u.values(this._layerConfigs),this.keyCache);Se<Ee.length;Se+=1){var me=Ee[Se].map((function(ze){return B._layers[ze.id]})),Ae=me[0];if(Ae.visibility!=="none"){var Je=Ae.source||"",Ze=this.familiesBySource[Je];Ze||(Ze=this.familiesBySource[Je]={});var ge=Ae.sourceLayer||"_geojsonTileLayer",Ne=Ze[ge];Ne||(Ne=Ze[ge]=[]),Ne.push(me)}}};var X=function(T){var P={},B=[];for(var V in T){var Z=T[V],re=P[V]={};for(var ie in Z){var L=Z[+ie];if(L&&L.bitmap.width!==0&&L.bitmap.height!==0){var H={x:0,y:0,w:L.bitmap.width+2,h:L.bitmap.height+2};B.push(H),re[ie]={rect:H,metrics:L.metrics}}}}var se=u.potpack(B),Se=new u.AlphaImage({width:se.w||1,height:se.h||1});for(var Ee in T){var me=T[Ee];for(var Ae in me){var Je=me[+Ae];if(Je&&Je.bitmap.width!==0&&Je.bitmap.height!==0){var Ze=P[Ee][Ae].rect;u.AlphaImage.copy(Je.bitmap,Se,{x:0,y:0},{x:Ze.x+1,y:Ze.y+1},Je.bitmap)}}}this.image=Se,this.positions=P};u.register("GlyphAtlas",X);var ae=function(T){this.tileID=new u.OverscaledTileID(T.tileID.overscaledZ,T.tileID.wrap,T.tileID.canonical.z,T.tileID.canonical.x,T.tileID.canonical.y),this.uid=T.uid,this.zoom=T.zoom,this.pixelRatio=T.pixelRatio,this.tileSize=T.tileSize,this.source=T.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=T.showCollisionBoxes,this.collectResourceTiming=!!T.collectResourceTiming,this.returnDependencies=!!T.returnDependencies,this.promoteId=T.promoteId};function Y(T,P,B){for(var V=new u.EvaluationParameters(P),Z=0,re=T;Z<re.length;Z+=1)re[Z].recalculate(V,B)}function Te(T,P){var B=u.getArrayBuffer(T.request,(function(V,Z,re,ie){V?P(V):Z&&P(null,{vectorTile:new u.vectorTile.VectorTile(new u.pbf(Z)),rawData:Z,cacheControl:re,expires:ie})}));return function(){B.cancel(),P()}}ae.prototype.parse=function(T,P,B,V,Z){var re=this;this.status="parsing",this.data=T,this.collisionBoxArray=new u.CollisionBoxArray;var ie=new u.DictionaryCoder(Object.keys(T.layers).sort()),L=new u.FeatureIndex(this.tileID,this.promoteId);L.bucketLayerIDs=[];var H,se,Se,Ee,me={},Ae={featureIndex:L,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:B},Je=P.familiesBySource[this.source];for(var Ze in Je){var ge=T.layers[Ze];if(ge){ge.version===1&&u.warnOnce('Vector tile source "'+this.source+'" layer "'+Ze+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var Ne=ie.encode(Ze),ze=[],Be=0;Be<ge.length;Be++){var yt=ge.feature(Be),qe=L.getId(yt,Ze);ze.push({feature:yt,id:qe,index:Be,sourceLayerIndex:Ne})}for(var Et=0,rr=Je[Ze];Et<rr.length;Et+=1){var Pt=rr[Et],Gt=Pt[0];Gt.minzoom&&this.zoom<Math.floor(Gt.minzoom)||Gt.maxzoom&&this.zoom>=Gt.maxzoom||Gt.visibility!=="none"&&(Y(Pt,this.zoom,B),(me[Gt.id]=Gt.createBucket({index:L.bucketLayerIDs.length,layers:Pt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Ne,sourceID:this.source})).populate(ze,Ae,this.tileID.canonical),L.bucketLayerIDs.push(Pt.map((function(Qt){return Qt.id}))))}}}var Dt=u.mapObject(Ae.glyphDependencies,(function(Qt){return Object.keys(Qt).map(Number)}));Object.keys(Dt).length?V.send("getGlyphs",{uid:this.uid,stacks:Dt},(function(Qt,Bt){H||(H=Qt,se=Bt,Pr.call(re))})):se={};var wi=Object.keys(Ae.iconDependencies);wi.length?V.send("getImages",{icons:wi,source:this.source,tileID:this.tileID,type:"icons"},(function(Qt,Bt){H||(H=Qt,Se=Bt,Pr.call(re))})):Se={};var Ht=Object.keys(Ae.patternDependencies);function Pr(){if(H)return Z(H);if(se&&Se&&Ee){var Qt=new X(se),Bt=new u.ImageAtlas(Se,Ee);for(var Zt in me){var zi=me[Zt];zi instanceof u.SymbolBucket?(Y(zi.layers,this.zoom,B),u.performSymbolLayout(zi,se,Qt.positions,Se,Bt.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):zi.hasPattern&&(zi instanceof u.LineBucket||zi instanceof u.FillBucket||zi instanceof u.FillExtrusionBucket)&&(Y(zi.layers,this.zoom,B),zi.addFeatures(Ae,this.tileID.canonical,Bt.patternPositions))}this.status="done",Z(null,{buckets:u.values(me).filter((function(ma){return!ma.isEmpty()})),featureIndex:L,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Qt.image,imageAtlas:Bt,glyphMap:this.returnDependencies?se:null,iconMap:this.returnDependencies?Se:null,glyphPositions:this.returnDependencies?Qt.positions:null})}}Ht.length?V.send("getImages",{icons:Ht,source:this.source,tileID:this.tileID,type:"patterns"},(function(Qt,Bt){H||(H=Qt,Ee=Bt,Pr.call(re))})):Ee={},Pr.call(this)};var be=function(T,P,B,V){this.actor=T,this.layerIndex=P,this.availableImages=B,this.loadVectorData=V||Te,this.loading={},this.loaded={}};be.prototype.loadTile=function(T,P){var B=this,V=T.uid;this.loading||(this.loading={});var Z=!!(T&&T.request&&T.request.collectResourceTiming)&&new u.RequestPerformance(T.request),re=this.loading[V]=new ae(T);re.abort=this.loadVectorData(T,(function(ie,L){if(delete B.loading[V],ie||!L)return re.status="done",B.loaded[V]=re,P(ie);var H=L.rawData,se={};L.expires&&(se.expires=L.expires),L.cacheControl&&(se.cacheControl=L.cacheControl);var Se={};if(Z){var Ee=Z.finish();Ee&&(Se.resourceTiming=JSON.parse(JSON.stringify(Ee)))}re.vectorTile=L.vectorTile,re.parse(L.vectorTile,B.layerIndex,B.availableImages,B.actor,(function(me,Ae){if(me||!Ae)return P(me);P(null,u.extend({rawTileData:H.slice(0)},Ae,se,Se))})),B.loaded=B.loaded||{},B.loaded[V]=re}))},be.prototype.reloadTile=function(T,P){var B=this,V=this.loaded,Z=T.uid,re=this;if(V&&V[Z]){var ie=V[Z];ie.showCollisionBoxes=T.showCollisionBoxes;var L=function(H,se){var Se=ie.reloadCallback;Se&&(delete ie.reloadCallback,ie.parse(ie.vectorTile,re.layerIndex,B.availableImages,re.actor,Se)),P(H,se)};ie.status==="parsing"?ie.reloadCallback=L:ie.status==="done"&&(ie.vectorTile?ie.parse(ie.vectorTile,this.layerIndex,this.availableImages,this.actor,L):L())}},be.prototype.abortTile=function(T,P){var B=this.loading,V=T.uid;B&&B[V]&&B[V].abort&&(B[V].abort(),delete B[V]),P()},be.prototype.removeTile=function(T,P){var B=this.loaded,V=T.uid;B&&B[V]&&delete B[V],P()};var ke=u.window.ImageBitmap,Oe=function(){this.loaded={}};function Ve(T,P){if(T.length!==0){Re(T[0],P);for(var B=1;B<T.length;B++)Re(T[B],!P)}}function Re(T,P){for(var B=0,V=0,Z=0,re=T.length,ie=re-1;Z<re;ie=Z++){var L=(T[Z][0]-T[ie][0])*(T[ie][1]+T[Z][1]),H=B+L;V+=Math.abs(B)>=Math.abs(L)?B-H+L:L-H+B,B=H}B+V>=0!=!!P&&T.reverse()}Oe.prototype.loadTile=function(T,P){var B=T.uid,V=T.encoding,Z=T.rawImageData,re=ke&&Z instanceof ke?this.getImageData(Z):Z,ie=new u.DEMData(B,re,V);this.loaded=this.loaded||{},this.loaded[B]=ie,P(null,ie)},Oe.prototype.getImageData=function(T){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(T.width,T.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=T.width,this.offscreenCanvas.height=T.height,this.offscreenCanvasContext.drawImage(T,0,0,T.width,T.height);var P=this.offscreenCanvasContext.getImageData(-1,-1,T.width+2,T.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new u.RGBAImage({width:P.width,height:P.height},P.data)},Oe.prototype.removeTile=function(T){var P=this.loaded,B=T.uid;P&&P[B]&&delete P[B]};var ve=u.vectorTile.VectorTileFeature.prototype.toGeoJSON,Ke=function(T){this._feature=T,this.extent=u.EXTENT,this.type=T.type,this.properties=T.tags,"id"in T&&!isNaN(T.id)&&(this.id=parseInt(T.id,10))};Ke.prototype.loadGeometry=function(){if(this._feature.type===1){for(var T=[],P=0,B=this._feature.geometry;P<B.length;P+=1){var V=B[P];T.push([new u.Point$1(V[0],V[1])])}return T}for(var Z=[],re=0,ie=this._feature.geometry;re<ie.length;re+=1){for(var L=[],H=0,se=ie[re];H<se.length;H+=1){var Se=se[H];L.push(new u.Point$1(Se[0],Se[1]))}Z.push(L)}return Z},Ke.prototype.toGeoJSON=function(T,P,B){return ve.call(this,T,P,B)};var We=function(T){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=u.EXTENT,this.length=T.length,this._features=T};We.prototype.feature=function(T){return new Ke(this._features[T])};var It=u.vectorTile.VectorTileFeature,we=Ge;function Ge(T,P){this.options=P||{},this.features=T,this.length=T.length}function Fe(T,P){this.id=typeof T.id=="number"?T.id:void 0,this.type=T.type,this.rawGeometry=T.type===1?[T.geometry]:T.geometry,this.properties=T.tags,this.extent=P||4096}Ge.prototype.feature=function(T){return new Fe(this.features[T],this.options.extent)},Fe.prototype.loadGeometry=function(){var T=this.rawGeometry;this.geometry=[];for(var P=0;P<T.length;P++){for(var B=T[P],V=[],Z=0;Z<B.length;Z++)V.push(new u.Point$1(B[Z][0],B[Z][1]));this.geometry.push(V)}return this.geometry},Fe.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var T=this.geometry,P=1/0,B=-1/0,V=1/0,Z=-1/0,re=0;re<T.length;re++)for(var ie=T[re],L=0;L<ie.length;L++){var H=ie[L];P=Math.min(P,H.x),B=Math.max(B,H.x),V=Math.min(V,H.y),Z=Math.max(Z,H.y)}return[P,V,B,Z]},Fe.prototype.toGeoJSON=It.prototype.toGeoJSON;var tt=Wt,kt=we;function Wt(T){var P=new u.pbf;return(function(B,V){for(var Z in B.layers)V.writeMessage(3,St,B.layers[Z])})(T,P),P.finish()}function St(T,P){var B;P.writeVarintField(15,T.version||1),P.writeStringField(1,T.name||""),P.writeVarintField(5,T.extent||4096);var V={keys:[],values:[],keycache:{},valuecache:{}};for(B=0;B<T.length;B++)V.feature=T.feature(B),P.writeMessage(2,Ut,V);var Z=V.keys;for(B=0;B<Z.length;B++)P.writeStringField(3,Z[B]);var re=V.values;for(B=0;B<re.length;B++)P.writeMessage(4,Rr,re[B])}function Ut(T,P){var B=T.feature;B.id!==void 0&&P.writeVarintField(1,B.id),P.writeMessage(2,Hr,T),P.writeVarintField(3,B.type),P.writeMessage(4,or,B)}function Hr(T,P){var B=T.feature,V=T.keys,Z=T.values,re=T.keycache,ie=T.valuecache;for(var L in B.properties){var H=re[L];H===void 0&&(V.push(L),re[L]=H=V.length-1),P.writeVarint(H);var se=B.properties[L],Se=typeof se;Se!=="string"&&Se!=="boolean"&&Se!=="number"&&(se=JSON.stringify(se));var Ee=Se+":"+se,me=ie[Ee];me===void 0&&(Z.push(se),ie[Ee]=me=Z.length-1),P.writeVarint(me)}}function Er(T,P){return(P<<3)+(7&T)}function bi(T){return T<<1^T>>31}function or(T,P){for(var B=T.loadGeometry(),V=T.type,Z=0,re=0,ie=B.length,L=0;L<ie;L++){var H=B[L],se=1;V===1&&(se=H.length),P.writeVarint(Er(1,se));for(var Se=V===3?H.length-1:H.length,Ee=0;Ee<Se;Ee++){Ee===1&&V!==1&&P.writeVarint(Er(2,Se-1));var me=H[Ee].x-Z,Ae=H[Ee].y-re;P.writeVarint(bi(me)),P.writeVarint(bi(Ae)),Z+=me,re+=Ae}V===3&&P.writeVarint(Er(7,1))}}function Rr(T,P){var B=typeof T;B==="string"?P.writeStringField(1,T):B==="boolean"?P.writeBooleanField(7,T):B==="number"&&(T%1!=0?P.writeDoubleField(3,T):T<0?P.writeSVarintField(6,T):P.writeVarintField(5,T))}function et(T,P,B,V){Lr(T,B,V),Lr(P,2*B,2*V),Lr(P,2*B+1,2*V+1)}function Lr(T,P,B){var V=T[P];T[P]=T[B],T[B]=V}function Xr(T,P,B,V){var Z=T-B,re=P-V;return Z*Z+re*re}tt.fromVectorTileJs=Wt,tt.fromGeojsonVt=function(T,P){P=P||{};var B={};for(var V in T)B[V]=new we(T[V].features,P),B[V].name=V,B[V].version=P.version,B[V].extent=P.extent;return Wt({layers:B})},tt.GeoJSONWrapper=kt;var At=function(T){return T[0]},Fr=function(T){return T[1]},Mi=function(T,P,B,V,Z){P===void 0&&(P=At),B===void 0&&(B=Fr),V===void 0&&(V=64),Z===void 0&&(Z=Float64Array),this.nodeSize=V,this.points=T;for(var re=T.length<65536?Uint16Array:Uint32Array,ie=this.ids=new re(T.length),L=this.coords=new Z(2*T.length),H=0;H<T.length;H++)ie[H]=H,L[2*H]=P(T[H]),L[2*H+1]=B(T[H]);(function se(Se,Ee,me,Ae,Je,Ze){if(!(Je-Ae<=me)){var ge=Ae+Je>>1;(function Ne(ze,Be,yt,qe,Et,rr){for(;Et>qe;){if(Et-qe>600){var Pt=Et-qe+1,Gt=yt-qe+1,Dt=Math.log(Pt),wi=.5*Math.exp(2*Dt/3),Ht=.5*Math.sqrt(Dt*wi*(Pt-wi)/Pt)*(Gt-Pt/2<0?-1:1);Ne(ze,Be,yt,Math.max(qe,Math.floor(yt-Gt*wi/Pt+Ht)),Math.min(Et,Math.floor(yt+(Pt-Gt)*wi/Pt+Ht)),rr)}var Pr=Be[2*yt+rr],Qt=qe,Bt=Et;for(et(ze,Be,qe,yt),Be[2*Et+rr]>Pr&&et(ze,Be,qe,Et);Qt<Bt;){for(et(ze,Be,Qt,Bt),Qt++,Bt--;Be[2*Qt+rr]<Pr;)Qt++;for(;Be[2*Bt+rr]>Pr;)Bt--}Be[2*qe+rr]===Pr?et(ze,Be,qe,Bt):et(ze,Be,++Bt,Et),Bt<=yt&&(qe=Bt+1),yt<=Bt&&(Et=Bt-1)}})(Se,Ee,ge,Ae,Je,Ze%2),se(Se,Ee,me,Ae,ge-1,Ze+1),se(Se,Ee,me,ge+1,Je,Ze+1)}})(ie,L,V,0,ie.length-1,0)};Mi.prototype.range=function(T,P,B,V){return(function(Z,re,ie,L,H,se,Se){for(var Ee,me,Ae=[0,Z.length-1,0],Je=[];Ae.length;){var Ze=Ae.pop(),ge=Ae.pop(),Ne=Ae.pop();if(ge-Ne<=Se)for(var ze=Ne;ze<=ge;ze++)me=re[2*ze+1],(Ee=re[2*ze])>=ie&&Ee<=H&&me>=L&&me<=se&&Je.push(Z[ze]);else{var Be=Math.floor((Ne+ge)/2);me=re[2*Be+1],(Ee=re[2*Be])>=ie&&Ee<=H&&me>=L&&me<=se&&Je.push(Z[Be]);var yt=(Ze+1)%2;(Ze===0?ie<=Ee:L<=me)&&(Ae.push(Ne),Ae.push(Be-1),Ae.push(yt)),(Ze===0?H>=Ee:se>=me)&&(Ae.push(Be+1),Ae.push(ge),Ae.push(yt))}}return Je})(this.ids,this.coords,T,P,B,V,this.nodeSize)},Mi.prototype.within=function(T,P,B){return(function(V,Z,re,ie,L,H){for(var se=[0,V.length-1,0],Se=[],Ee=L*L;se.length;){var me=se.pop(),Ae=se.pop(),Je=se.pop();if(Ae-Je<=H)for(var Ze=Je;Ze<=Ae;Ze++)Xr(Z[2*Ze],Z[2*Ze+1],re,ie)<=Ee&&Se.push(V[Ze]);else{var ge=Math.floor((Je+Ae)/2),Ne=Z[2*ge],ze=Z[2*ge+1];Xr(Ne,ze,re,ie)<=Ee&&Se.push(V[ge]);var Be=(me+1)%2;(me===0?re-L<=Ne:ie-L<=ze)&&(se.push(Je),se.push(ge-1),se.push(Be)),(me===0?re+L>=Ne:ie+L>=ze)&&(se.push(ge+1),se.push(Ae),se.push(Be))}}return Se})(this.ids,this.coords,T,P,B,this.nodeSize)};var pi={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(T){return T}},Or=function(T){this.options=mr(Object.create(pi),T),this.trees=new Array(this.options.maxZoom+1)};function Xi(T,P,B,V,Z){return{x:T,y:P,zoom:1/0,id:B,parentId:-1,numPoints:V,properties:Z}}function Nt(T,P){var B=T.geometry.coordinates,V=B[1];return{x:sr(B[0]),y:lt(V),zoom:1/0,index:P,parentId:-1}}function Nr(T){return{type:"Feature",id:T.id,properties:ar(T),geometry:{type:"Point",coordinates:[(V=T.x,360*(V-.5)),(P=T.y,B=(180-360*P)*Math.PI/180,360*Math.atan(Math.exp(B))/Math.PI-90)]}};var P,B,V}function ar(T){var P=T.numPoints,B=P>=1e4?Math.round(P/1e3)+"k":P>=1e3?Math.round(P/100)/10+"k":P;return mr(mr({},T.properties),{cluster:!0,cluster_id:T.id,point_count:P,point_count_abbreviated:B})}function sr(T){return T/360+.5}function lt(T){var P=Math.sin(T*Math.PI/180),B=.5-.25*Math.log((1+P)/(1-P))/Math.PI;return B<0?0:B>1?1:B}function mr(T,P){for(var B in P)T[B]=P[B];return T}function pr(T){return T.x}function jr(T){return T.y}function hr(T,P,B,V,Z,re){var ie=Z-B,L=re-V;if(ie!==0||L!==0){var H=((T-B)*ie+(P-V)*L)/(ie*ie+L*L);H>1?(B=Z,V=re):H>0&&(B+=ie*H,V+=L*H)}return(ie=T-B)*ie+(L=P-V)*L}function br(T,P,B,V){var Z={id:T===void 0?null:T,type:P,geometry:B,tags:V,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return(function(re){var ie=re.geometry,L=re.type;if(L==="Point"||L==="MultiPoint"||L==="LineString")dn(re,ie);else if(L==="Polygon"||L==="MultiLineString")for(var H=0;H<ie.length;H++)dn(re,ie[H]);else if(L==="MultiPolygon")for(H=0;H<ie.length;H++)for(var se=0;se<ie[H].length;se++)dn(re,ie[H][se])})(Z),Z}function dn(T,P){for(var B=0;B<P.length;B+=3)T.minX=Math.min(T.minX,P[B]),T.minY=Math.min(T.minY,P[B+1]),T.maxX=Math.max(T.maxX,P[B]),T.maxY=Math.max(T.maxY,P[B+1])}function Kr(T,P,B,V){if(P.geometry){var Z=P.geometry.coordinates,re=P.geometry.type,ie=Math.pow(B.tolerance/((1<<B.maxZoom)*B.extent),2),L=[],H=P.id;if(B.promoteId?H=P.properties[B.promoteId]:B.generateId&&(H=V||0),re==="Point")Bi(Z,L);else if(re==="MultiPoint")for(var se=0;se<Z.length;se++)Bi(Z[se],L);else if(re==="LineString")hi(Z,L,ie,!1);else if(re==="MultiLineString"){if(B.lineMetrics){for(se=0;se<Z.length;se++)hi(Z[se],L=[],ie,!1),T.push(br(H,"LineString",L,P.properties));return}ti(Z,L,ie,!1)}else if(re==="Polygon")ti(Z,L,ie,!0);else{if(re!=="MultiPolygon"){if(re==="GeometryCollection"){for(se=0;se<P.geometry.geometries.length;se++)Kr(T,{id:H,geometry:P.geometry.geometries[se],properties:P.properties},B,V);return}throw new Error("Input data is not a valid GeoJSON object.")}for(se=0;se<Z.length;se++){var Se=[];ti(Z[se],Se,ie,!0),L.push(Se)}}T.push(br(H,re,L,P.properties))}}function Bi(T,P){P.push(ri(T[0])),P.push(Vi(T[1])),P.push(0)}function hi(T,P,B,V){for(var Z,re,ie=0,L=0;L<T.length;L++){var H=ri(T[L][0]),se=Vi(T[L][1]);P.push(H),P.push(se),P.push(0),L>0&&(ie+=V?(Z*se-H*re)/2:Math.sqrt(Math.pow(H-Z,2)+Math.pow(se-re,2))),Z=H,re=se}var Se=P.length-3;P[2]=1,(function Ee(me,Ae,Je,Ze){for(var ge,Ne=Ze,ze=Je-Ae>>1,Be=Je-Ae,yt=me[Ae],qe=me[Ae+1],Et=me[Je],rr=me[Je+1],Pt=Ae+3;Pt<Je;Pt+=3){var Gt=hr(me[Pt],me[Pt+1],yt,qe,Et,rr);if(Gt>Ne)ge=Pt,Ne=Gt;else if(Gt===Ne){var Dt=Math.abs(Pt-ze);Dt<Be&&(ge=Pt,Be=Dt)}}Ne>Ze&&(ge-Ae>3&&Ee(me,Ae,ge,Ze),me[ge+2]=Ne,Je-ge>3&&Ee(me,ge,Je,Ze))})(P,0,Se,B),P[Se+2]=1,P.size=Math.abs(ie),P.start=0,P.end=P.size}function ti(T,P,B,V){for(var Z=0;Z<T.length;Z++){var re=[];hi(T[Z],re,B,V),P.push(re)}}function ri(T){return T/360+.5}function Vi(T){var P=Math.sin(T*Math.PI/180),B=.5-.25*Math.log((1+P)/(1-P))/Math.PI;return B<0?0:B>1?1:B}function Ki(T,P,B,V,Z,re,ie,L){if(V/=P,re>=(B/=P)&&ie<V)return T;if(ie<B||re>=V)return null;for(var H=[],se=0;se<T.length;se++){var Se=T[se],Ee=Se.geometry,me=Se.type,Ae=Z===0?Se.minX:Se.minY,Je=Z===0?Se.maxX:Se.maxY;if(Ae>=B&&Je<V)H.push(Se);else if(!(Je<B||Ae>=V)){var Ze=[];if(me==="Point"||me==="MultiPoint")yo(Ee,Ze,B,V,Z);else if(me==="LineString")Zo(Ee,Ze,B,V,Z,!1,L.lineMetrics);else if(me==="MultiLineString")Mn(Ee,Ze,B,V,Z,!1);else if(me==="Polygon")Mn(Ee,Ze,B,V,Z,!0);else if(me==="MultiPolygon")for(var ge=0;ge<Ee.length;ge++){var Ne=[];Mn(Ee[ge],Ne,B,V,Z,!0),Ne.length&&Ze.push(Ne)}if(Ze.length){if(L.lineMetrics&&me==="LineString"){for(ge=0;ge<Ze.length;ge++)H.push(br(Se.id,me,Ze[ge],Se.tags));continue}me!=="LineString"&&me!=="MultiLineString"||(Ze.length===1?(me="LineString",Ze=Ze[0]):me="MultiLineString"),me!=="Point"&&me!=="MultiPoint"||(me=Ze.length===3?"Point":"MultiPoint"),H.push(br(Se.id,me,Ze,Se.tags))}}}return H.length?H:null}function yo(T,P,B,V,Z){for(var re=0;re<T.length;re+=3){var ie=T[re+Z];ie>=B&&ie<=V&&(P.push(T[re]),P.push(T[re+1]),P.push(T[re+2]))}}function Zo(T,P,B,V,Z,re,ie){for(var L,H,se=mn(T),Se=Z===0?$o:jn,Ee=T.start,me=0;me<T.length-3;me+=3){var Ae=T[me],Je=T[me+1],Ze=T[me+2],ge=T[me+3],Ne=T[me+4],ze=Z===0?Ae:Je,Be=Z===0?ge:Ne,yt=!1;ie&&(L=Math.sqrt(Math.pow(Ae-ge,2)+Math.pow(Je-Ne,2))),ze<B?Be>B&&(H=Se(se,Ae,Je,ge,Ne,B),ie&&(se.start=Ee+L*H)):ze>V?Be<V&&(H=Se(se,Ae,Je,ge,Ne,V),ie&&(se.start=Ee+L*H)):Bn(se,Ae,Je,Ze),Be<B&&ze>=B&&(H=Se(se,Ae,Je,ge,Ne,B),yt=!0),Be>V&&ze<=V&&(H=Se(se,Ae,Je,ge,Ne,V),yt=!0),!re&&yt&&(ie&&(se.end=Ee+L*H),P.push(se),se=mn(T)),ie&&(Ee+=L)}var qe=T.length-3;Ae=T[qe],Je=T[qe+1],Ze=T[qe+2],(ze=Z===0?Ae:Je)>=B&&ze<=V&&Bn(se,Ae,Je,Ze),qe=se.length-3,re&&qe>=3&&(se[qe]!==se[0]||se[qe+1]!==se[1])&&Bn(se,se[0],se[1],se[2]),se.length&&P.push(se)}function mn(T){var P=[];return P.size=T.size,P.start=T.start,P.end=T.end,P}function Mn(T,P,B,V,Z,re){for(var ie=0;ie<T.length;ie++)Zo(T[ie],P,B,V,Z,re,!1)}function Bn(T,P,B,V){T.push(P),T.push(B),T.push(V)}function $o(T,P,B,V,Z,re){var ie=(re-P)/(V-P);return T.push(re),T.push(B+(Z-B)*ie),T.push(1),ie}function jn(T,P,B,V,Z,re){var ie=(re-B)/(Z-B);return T.push(P+(V-P)*ie),T.push(re),T.push(1),ie}function zn(T,P){for(var B=[],V=0;V<T.length;V++){var Z,re=T[V],ie=re.type;if(ie==="Point"||ie==="MultiPoint"||ie==="LineString")Z=rn(re.geometry,P);else if(ie==="MultiLineString"||ie==="Polygon"){Z=[];for(var L=0;L<re.geometry.length;L++)Z.push(rn(re.geometry[L],P))}else if(ie==="MultiPolygon")for(Z=[],L=0;L<re.geometry.length;L++){for(var H=[],se=0;se<re.geometry[L].length;se++)H.push(rn(re.geometry[L][se],P));Z.push(H)}B.push(br(re.id,ie,Z,re.tags))}return B}function rn(T,P){var B=[];B.size=T.size,T.start!==void 0&&(B.start=T.start,B.end=T.end);for(var V=0;V<T.length;V+=3)B.push(T[V]+P,T[V+1],T[V+2]);return B}function fe(T,P){if(T.transformed)return T;var B,V,Z,re=1<<T.z,ie=T.x,L=T.y;for(B=0;B<T.features.length;B++){var H=T.features[B],se=H.geometry,Se=H.type;if(H.geometry=[],Se===1)for(V=0;V<se.length;V+=2)H.geometry.push(_e(se[V],se[V+1],P,re,ie,L));else for(V=0;V<se.length;V++){var Ee=[];for(Z=0;Z<se[V].length;Z+=2)Ee.push(_e(se[V][Z],se[V][Z+1],P,re,ie,L));H.geometry.push(Ee)}}return T.transformed=!0,T}function _e(T,P,B,V,Z,re){return[Math.round(B*(T*V-Z)),Math.round(B*(P*V-re))]}function jt(T,P,B,V,Z){for(var re=P===Z.maxZoom?0:Z.tolerance/((1<<P)*Z.extent),ie={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:B,y:V,z:P,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},L=0;L<T.length;L++){ie.numFeatures++,tr(ie,T[L],re,Z);var H=T[L].minX,se=T[L].minY,Se=T[L].maxX,Ee=T[L].maxY;H<ie.minX&&(ie.minX=H),se<ie.minY&&(ie.minY=se),Se>ie.maxX&&(ie.maxX=Se),Ee>ie.maxY&&(ie.maxY=Ee)}return ie}function tr(T,P,B,V){var Z=P.geometry,re=P.type,ie=[];if(re==="Point"||re==="MultiPoint")for(var L=0;L<Z.length;L+=3)ie.push(Z[L]),ie.push(Z[L+1]),T.numPoints++,T.numSimplified++;else if(re==="LineString")Kt(ie,Z,T,B,!1,!1);else if(re==="MultiLineString"||re==="Polygon")for(L=0;L<Z.length;L++)Kt(ie,Z[L],T,B,re==="Polygon",L===0);else if(re==="MultiPolygon")for(var H=0;H<Z.length;H++){var se=Z[H];for(L=0;L<se.length;L++)Kt(ie,se[L],T,B,!0,L===0)}if(ie.length){var Se=P.tags||null;if(re==="LineString"&&V.lineMetrics){for(var Ee in Se={},P.tags)Se[Ee]=P.tags[Ee];Se.mapbox_clip_start=Z.start/Z.size,Se.mapbox_clip_end=Z.end/Z.size}var me={geometry:ie,type:re==="Polygon"||re==="MultiPolygon"?3:re==="LineString"||re==="MultiLineString"?2:1,tags:Se};P.id!==null&&(me.id=P.id),T.features.push(me)}}function Kt(T,P,B,V,Z,re){var ie=V*V;if(V>0&&P.size<(Z?ie:V))B.numPoints+=P.length/3;else{for(var L=[],H=0;H<P.length;H+=3)(V===0||P[H+2]>ie)&&(B.numSimplified++,L.push(P[H]),L.push(P[H+1])),B.numPoints++;Z&&(function(se,Se){for(var Ee=0,me=0,Ae=se.length,Je=Ae-2;me<Ae;Je=me,me+=2)Ee+=(se[me]-se[Je])*(se[me+1]+se[Je+1]);if(Ee>0===Se)for(me=0,Ae=se.length;me<Ae/2;me+=2){var Ze=se[me],ge=se[me+1];se[me]=se[Ae-2-me],se[me+1]=se[Ae-1-me],se[Ae-2-me]=Ze,se[Ae-1-me]=ge}})(L,re),T.push(L)}}function _t(T,P){var B=(P=this.options=(function(Z,re){for(var ie in re)Z[ie]=re[ie];return Z})(Object.create(this.options),P)).debug;if(B&&console.time("preprocess data"),P.maxZoom<0||P.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(P.promoteId&&P.generateId)throw new Error("promoteId and generateId cannot be used together.");var V=(function(Z,re){var ie=[];if(Z.type==="FeatureCollection")for(var L=0;L<Z.features.length;L++)Kr(ie,Z.features[L],re,L);else Kr(ie,Z.type==="Feature"?Z:{geometry:Z},re);return ie})(T,P);this.tiles={},this.tileCoords=[],B&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",P.indexMaxZoom,P.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(V=(function(Z,re){var ie=re.buffer/re.extent,L=Z,H=Ki(Z,1,-1-ie,ie,0,-1,2,re),se=Ki(Z,1,1-ie,2+ie,0,-1,2,re);return(H||se)&&(L=Ki(Z,1,-ie,1+ie,0,-1,2,re)||[],H&&(L=zn(H,1).concat(L)),se&&(L=L.concat(zn(se,-1)))),L})(V,P)).length&&this.splitTile(V,0,0,0),B&&(V.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 fi(T,P,B){return 32*((1<<T)*B+P)+T}function qi(T,P){var B=T.tileID.canonical;if(!this._geoJSONIndex)return P(null,null);var V=this._geoJSONIndex.getTile(B.z,B.x,B.y);if(!V)return P(null,null);var Z=new We(V.features),re=tt(Z);re.byteOffset===0&&re.byteLength===re.buffer.byteLength||(re=new Uint8Array(re)),P(null,{vectorTile:Z,rawData:re.buffer})}Or.prototype.load=function(T){var P=this.options,B=P.log,V=P.minZoom,Z=P.maxZoom,re=P.nodeSize;B&&console.time("total time");var ie="prepare "+T.length+" points";B&&console.time(ie),this.points=T;for(var L=[],H=0;H<T.length;H++)T[H].geometry&&L.push(Nt(T[H],H));this.trees[Z+1]=new Mi(L,pr,jr,re,Float32Array),B&&console.timeEnd(ie);for(var se=Z;se>=V;se--){var Se=+Date.now();L=this._cluster(L,se),this.trees[se]=new Mi(L,pr,jr,re,Float32Array),B&&console.log("z%d: %d clusters in %dms",se,L.length,+Date.now()-Se)}return B&&console.timeEnd("total time"),this},Or.prototype.getClusters=function(T,P){var B=((T[0]+180)%360+360)%360-180,V=Math.max(-90,Math.min(90,T[1])),Z=T[2]===180?180:((T[2]+180)%360+360)%360-180,re=Math.max(-90,Math.min(90,T[3]));if(T[2]-T[0]>=360)B=-180,Z=180;else if(B>Z){var ie=this.getClusters([B,V,180,re],P),L=this.getClusters([-180,V,Z,re],P);return ie.concat(L)}for(var H=this.trees[this._limitZoom(P)],se=[],Se=0,Ee=H.range(sr(B),lt(re),sr(Z),lt(V));Se<Ee.length;Se+=1){var me=H.points[Ee[Se]];se.push(me.numPoints?Nr(me):this.points[me.index])}return se},Or.prototype.getChildren=function(T){var P=this._getOriginId(T),B=this._getOriginZoom(T),V="No cluster with the specified id.",Z=this.trees[B];if(!Z)throw new Error(V);var re=Z.points[P];if(!re)throw new Error(V);for(var ie=this.options.radius/(this.options.extent*Math.pow(2,B-1)),L=[],H=0,se=Z.within(re.x,re.y,ie);H<se.length;H+=1){var Se=Z.points[se[H]];Se.parentId===T&&L.push(Se.numPoints?Nr(Se):this.points[Se.index])}if(L.length===0)throw new Error(V);return L},Or.prototype.getLeaves=function(T,P,B){var V=[];return this._appendLeaves(V,T,P=P||10,B=B||0,0),V},Or.prototype.getTile=function(T,P,B){var V=this.trees[this._limitZoom(T)],Z=Math.pow(2,T),re=this.options,ie=re.radius/re.extent,L=(B-ie)/Z,H=(B+1+ie)/Z,se={features:[]};return this._addTileFeatures(V.range((P-ie)/Z,L,(P+1+ie)/Z,H),V.points,P,B,Z,se),P===0&&this._addTileFeatures(V.range(1-ie/Z,L,1,H),V.points,Z,B,Z,se),P===Z-1&&this._addTileFeatures(V.range(0,L,ie/Z,H),V.points,-1,B,Z,se),se.features.length?se:null},Or.prototype.getClusterExpansionZoom=function(T){for(var P=this._getOriginZoom(T)-1;P<=this.options.maxZoom;){var B=this.getChildren(T);if(P++,B.length!==1)break;T=B[0].properties.cluster_id}return P},Or.prototype._appendLeaves=function(T,P,B,V,Z){for(var re=0,ie=this.getChildren(P);re<ie.length;re+=1){var L=ie[re],H=L.properties;if(H&&H.cluster?Z+H.point_count<=V?Z+=H.point_count:Z=this._appendLeaves(T,H.cluster_id,B,V,Z):Z<V?Z++:T.push(L),T.length===B)break}return Z},Or.prototype._addTileFeatures=function(T,P,B,V,Z,re){for(var ie=0,L=T;ie<L.length;ie+=1){var H=P[L[ie]],se=H.numPoints,Se={type:1,geometry:[[Math.round(this.options.extent*(H.x*Z-B)),Math.round(this.options.extent*(H.y*Z-V))]],tags:se?ar(H):this.points[H.index].properties},Ee=void 0;se?Ee=H.id:this.options.generateId?Ee=H.index:this.points[H.index].id&&(Ee=this.points[H.index].id),Ee!==void 0&&(Se.id=Ee),re.features.push(Se)}},Or.prototype._limitZoom=function(T){return Math.max(this.options.minZoom,Math.min(+T,this.options.maxZoom+1))},Or.prototype._cluster=function(T,P){for(var B=[],V=this.options,Z=V.reduce,re=V.minPoints,ie=V.radius/(V.extent*Math.pow(2,P)),L=0;L<T.length;L++){var H=T[L];if(!(H.zoom<=P)){H.zoom=P;for(var se=this.trees[P+1],Se=se.within(H.x,H.y,ie),Ee=H.numPoints||1,me=Ee,Ae=0,Je=Se;Ae<Je.length;Ae+=1){var Ze=se.points[Je[Ae]];Ze.zoom>P&&(me+=Ze.numPoints||1)}if(me>=re){for(var ge=H.x*Ee,Ne=H.y*Ee,ze=Z&&Ee>1?this._map(H,!0):null,Be=(L<<5)+(P+1)+this.points.length,yt=0,qe=Se;yt<qe.length;yt+=1){var Et=se.points[qe[yt]];if(!(Et.zoom<=P)){Et.zoom=P;var rr=Et.numPoints||1;ge+=Et.x*rr,Ne+=Et.y*rr,Et.parentId=Be,Z&&(ze||(ze=this._map(H,!0)),Z(ze,this._map(Et)))}}H.parentId=Be,B.push(Xi(ge/me,Ne/me,Be,me,ze))}else if(B.push(H),me>1)for(var Pt=0,Gt=Se;Pt<Gt.length;Pt+=1){var Dt=se.points[Gt[Pt]];Dt.zoom<=P||(Dt.zoom=P,B.push(Dt))}}}return B},Or.prototype._getOriginId=function(T){return T-this.points.length>>5},Or.prototype._getOriginZoom=function(T){return(T-this.points.length)%32},Or.prototype._map=function(T,P){if(T.numPoints)return P?mr({},T.properties):T.properties;var B=this.points[T.index].properties,V=this.options.map(B);return P&&V===B?mr({},V):V},_t.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},_t.prototype.splitTile=function(T,P,B,V,Z,re,ie){for(var L=[T,P,B,V],H=this.options,se=H.debug;L.length;){V=L.pop(),B=L.pop(),P=L.pop(),T=L.pop();var Se=1<<P,Ee=fi(P,B,V),me=this.tiles[Ee];if(!me&&(se>1&&console.time("creation"),me=this.tiles[Ee]=jt(T,P,B,V,H),this.tileCoords.push({z:P,x:B,y:V}),se)){se>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",P,B,V,me.numFeatures,me.numPoints,me.numSimplified),console.timeEnd("creation"));var Ae="z"+P;this.stats[Ae]=(this.stats[Ae]||0)+1,this.total++}if(me.source=T,Z){if(P===H.maxZoom||P===Z)continue;var Je=1<<Z-P;if(B!==Math.floor(re/Je)||V!==Math.floor(ie/Je))continue}else if(P===H.indexMaxZoom||me.numPoints<=H.indexMaxPoints)continue;if(me.source=null,T.length!==0){se>1&&console.time("clipping");var Ze,ge,Ne,ze,Be,yt,qe=.5*H.buffer/H.extent,Et=.5-qe,rr=.5+qe,Pt=1+qe;Ze=ge=Ne=ze=null,Be=Ki(T,Se,B-qe,B+rr,0,me.minX,me.maxX,H),yt=Ki(T,Se,B+Et,B+Pt,0,me.minX,me.maxX,H),T=null,Be&&(Ze=Ki(Be,Se,V-qe,V+rr,1,me.minY,me.maxY,H),ge=Ki(Be,Se,V+Et,V+Pt,1,me.minY,me.maxY,H),Be=null),yt&&(Ne=Ki(yt,Se,V-qe,V+rr,1,me.minY,me.maxY,H),ze=Ki(yt,Se,V+Et,V+Pt,1,me.minY,me.maxY,H),yt=null),se>1&&console.timeEnd("clipping"),L.push(Ze||[],P+1,2*B,2*V),L.push(ge||[],P+1,2*B,2*V+1),L.push(Ne||[],P+1,2*B+1,2*V),L.push(ze||[],P+1,2*B+1,2*V+1)}}},_t.prototype.getTile=function(T,P,B){var V=this.options,Z=V.extent,re=V.debug;if(T<0||T>24)return null;var ie=1<<T,L=fi(T,P=(P%ie+ie)%ie,B);if(this.tiles[L])return fe(this.tiles[L],Z);re>1&&console.log("drilling down to z%d-%d-%d",T,P,B);for(var H,se=T,Se=P,Ee=B;!H&&se>0;)se--,Se=Math.floor(Se/2),Ee=Math.floor(Ee/2),H=this.tiles[fi(se,Se,Ee)];return H&&H.source?(re>1&&console.log("found parent tile z%d-%d-%d",se,Se,Ee),re>1&&console.time("drilling down"),this.splitTile(H.source,se,Se,Ee,T,P,B),re>1&&console.timeEnd("drilling down"),this.tiles[L]?fe(this.tiles[L],Z):null):null};var ii=(function(T){function P(B,V,Z,re){T.call(this,B,V,Z,qi),re&&(this.loadGeoJSON=re)}return T&&(P.__proto__=T),(P.prototype=Object.create(T&&T.prototype)).constructor=P,P.prototype.loadData=function(B,V){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=V,this._pendingLoadDataParams=B,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},P.prototype._loadData=function(){var B=this;if(this._pendingCallback&&this._pendingLoadDataParams){var V=this._pendingCallback,Z=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var re=!!(Z&&Z.request&&Z.request.collectResourceTiming)&&new u.RequestPerformance(Z.request);this.loadGeoJSON(Z,(function(ie,L){if(ie||!L)return V(ie);if(typeof L!="object")return V(new Error("Input data given to '"+Z.source+"' is not a valid GeoJSON object."));(function me(Ae,Je){var Ze,ge=Ae&&Ae.type;if(ge==="FeatureCollection")for(Ze=0;Ze<Ae.features.length;Ze++)me(Ae.features[Ze],Je);else if(ge==="GeometryCollection")for(Ze=0;Ze<Ae.geometries.length;Ze++)me(Ae.geometries[Ze],Je);else if(ge==="Feature")me(Ae.geometry,Je);else if(ge==="Polygon")Ve(Ae.coordinates,Je);else if(ge==="MultiPolygon")for(Ze=0;Ze<Ae.coordinates.length;Ze++)Ve(Ae.coordinates[Ze],Je);return Ae})(L,!0);try{if(Z.filter){var H=u.createExpression(Z.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(H.result==="error")throw new Error(H.value.map((function(me){return me.key+": "+me.message})).join(", "));var se=L.features.filter((function(me){return H.value.evaluate({zoom:0},me)}));L={type:"FeatureCollection",features:se}}B._geoJSONIndex=Z.cluster?new Or((function(me){var Ae=me.superclusterOptions,Je=me.clusterProperties;if(!Je||!Ae)return Ae;for(var Ze={},ge={},Ne={accumulated:null,zoom:0},ze={properties:null},Be=Object.keys(Je),yt=0,qe=Be;yt<qe.length;yt+=1){var Et=qe[yt],rr=Je[Et],Pt=rr[0],Gt=u.createExpression(rr[1]),Dt=u.createExpression(typeof Pt=="string"?[Pt,["accumulated"],["get",Et]]:Pt);Ze[Et]=Gt.value,ge[Et]=Dt.value}return Ae.map=function(wi){ze.properties=wi;for(var Ht={},Pr=0,Qt=Be;Pr<Qt.length;Pr+=1){var Bt=Qt[Pr];Ht[Bt]=Ze[Bt].evaluate(Ne,ze)}return Ht},Ae.reduce=function(wi,Ht){ze.properties=Ht;for(var Pr=0,Qt=Be;Pr<Qt.length;Pr+=1){var Bt=Qt[Pr];Ne.accumulated=wi[Bt],wi[Bt]=ge[Bt].evaluate(Ne,ze)}},Ae})(Z)).load(L.features):(function(me,Ae){return new _t(me,Ae)})(L,Z.geojsonVtOptions)}catch(me){return V(me)}B.loaded={};var Se={};if(re){var Ee=re.finish();Ee&&(Se.resourceTiming={},Se.resourceTiming[Z.source]=JSON.parse(JSON.stringify(Ee)))}V(null,Se)}))}},P.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},P.prototype.reloadTile=function(B,V){var Z=this.loaded;return Z&&Z[B.uid]?T.prototype.reloadTile.call(this,B,V):this.loadTile(B,V)},P.prototype.loadGeoJSON=function(B,V){if(B.request)u.getJSON(B.request,V);else{if(typeof B.data!="string")return V(new Error("Input data given to '"+B.source+"' is not a valid GeoJSON object."));try{return V(null,JSON.parse(B.data))}catch{return V(new Error("Input data given to '"+B.source+"' is not a valid GeoJSON object."))}}},P.prototype.removeSource=function(B,V){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),V()},P.prototype.getClusterExpansionZoom=function(B,V){try{V(null,this._geoJSONIndex.getClusterExpansionZoom(B.clusterId))}catch(Z){V(Z)}},P.prototype.getClusterChildren=function(B,V){try{V(null,this._geoJSONIndex.getChildren(B.clusterId))}catch(Z){V(Z)}},P.prototype.getClusterLeaves=function(B,V){try{V(null,this._geoJSONIndex.getLeaves(B.clusterId,B.limit,B.offset))}catch(Z){V(Z)}},P})(be),Yt=function(T){var P=this;this.self=T,this.actor=new u.Actor(T,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:be,geojson:ii},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(B,V){if(P.workerSourceTypes[B])throw new Error('Worker source with name "'+B+'" already registered.');P.workerSourceTypes[B]=V},this.self.registerRTLTextPlugin=function(B){if(u.plugin.isParsed())throw new Error("RTL text plugin already registered.");u.plugin.applyArabicShaping=B.applyArabicShaping,u.plugin.processBidirectionalText=B.processBidirectionalText,u.plugin.processStyledBidirectionalText=B.processStyledBidirectionalText}};return Yt.prototype.setReferrer=function(T,P){this.referrer=P},Yt.prototype.setImages=function(T,P,B){for(var V in this.availableImages[T]=P,this.workerSources[T]){var Z=this.workerSources[T][V];for(var re in Z)Z[re].availableImages=P}B()},Yt.prototype.setLayers=function(T,P,B){this.getLayerIndex(T).replace(P),B()},Yt.prototype.updateLayers=function(T,P,B){this.getLayerIndex(T).update(P.layers,P.removedIds),B()},Yt.prototype.loadTile=function(T,P,B){this.getWorkerSource(T,P.type,P.source).loadTile(P,B)},Yt.prototype.loadDEMTile=function(T,P,B){this.getDEMWorkerSource(T,P.source).loadTile(P,B)},Yt.prototype.reloadTile=function(T,P,B){this.getWorkerSource(T,P.type,P.source).reloadTile(P,B)},Yt.prototype.abortTile=function(T,P,B){this.getWorkerSource(T,P.type,P.source).abortTile(P,B)},Yt.prototype.removeTile=function(T,P,B){this.getWorkerSource(T,P.type,P.source).removeTile(P,B)},Yt.prototype.removeDEMTile=function(T,P){this.getDEMWorkerSource(T,P.source).removeTile(P)},Yt.prototype.removeSource=function(T,P,B){if(this.workerSources[T]&&this.workerSources[T][P.type]&&this.workerSources[T][P.type][P.source]){var V=this.workerSources[T][P.type][P.source];delete this.workerSources[T][P.type][P.source],V.removeSource!==void 0?V.removeSource(P,B):B()}},Yt.prototype.loadWorkerSource=function(T,P,B){try{this.self.importScripts(P.url),B()}catch(V){B(V.toString())}},Yt.prototype.syncRTLPluginState=function(T,P,B){try{u.plugin.setState(P);var V=u.plugin.getPluginURL();if(u.plugin.isLoaded()&&!u.plugin.isParsed()&&V!=null){this.self.importScripts(V);var Z=u.plugin.isParsed();B(Z?void 0:new Error("RTL Text Plugin failed to import scripts from "+V),Z)}}catch(re){B(re.toString())}},Yt.prototype.getAvailableImages=function(T){var P=this.availableImages[T];return P||(P=[]),P},Yt.prototype.getLayerIndex=function(T){var P=this.layerIndexes[T];return P||(P=this.layerIndexes[T]=new J),P},Yt.prototype.getWorkerSource=function(T,P,B){var V=this;return this.workerSources[T]||(this.workerSources[T]={}),this.workerSources[T][P]||(this.workerSources[T][P]={}),this.workerSources[T][P][B]||(this.workerSources[T][P][B]=new this.workerSourceTypes[P]({send:function(Z,re,ie){V.actor.send(Z,re,ie,T)}},this.getLayerIndex(T),this.getAvailableImages(T))),this.workerSources[T][P][B]},Yt.prototype.getDEMWorkerSource=function(T,P){return this.demWorkerSources[T]||(this.demWorkerSources[T]={}),this.demWorkerSources[T][P]||(this.demWorkerSources[T][P]=new Oe),this.demWorkerSources[T][P]},Yt.prototype.enforceCacheSizeLimit=function(T,P){u.enforceCacheSizeLimit(P)},typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new Yt(self)),Yt})),R(["./shared"],(function(u){var U=u.createCommonjsModule((function(i){function o(p){return!n(p)}function n(p){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 d,v,w=new Blob([""],{type:"text/javascript"}),A=URL.createObjectURL(w);try{v=new Worker(A),d=!0}catch{d=!1}return v&&v.terminate(),URL.revokeObjectURL(A),d})()?"Uint8ClampedArray"in window?ArrayBuffer.isView?(function(){var d=document.createElement("canvas");d.width=d.height=1;var v=d.getContext("2d");if(!v)return!1;var w=v.getImageData(0,0,1,1);return w&&w.width===d.width})()?(s[f=p&&p.failIfMajorPerformanceCaveat]===void 0&&(s[f]=(function(d){var v=(function(A){var D=document.createElement("canvas"),F=Object.create(o.webGLContextAttributes);return F.failIfMajorPerformanceCaveat=A,D.probablySupportsContext?D.probablySupportsContext("webgl",F)||D.probablySupportsContext("experimental-webgl",F):D.supportsContext?D.supportsContext("webgl",F)||D.supportsContext("experimental-webgl",F):D.getContext("webgl",F)||D.getContext("experimental-webgl",F)})(d);if(!v)return!1;var w=v.createShader(v.VERTEX_SHADER);return!(!w||v.isContextLost())&&(v.shaderSource(w,"void main() {}"),v.compileShader(w),v.getShaderParameter(w,v.COMPILE_STATUS)===!0)})(f)),s[f]?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 f}i.exports?i.exports=o:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=o,window.mapboxgl.notSupportedReason=n);var s={};o.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),k={create:function(i,o,n){var s=u.window.document.createElement(i);return o!==void 0&&(s.className=o),n&&n.appendChild(s),s},createNS:function(i,o){return u.window.document.createElementNS(i,o)}},J=u.window.document&&u.window.document.documentElement.style;function X(i){if(!J)return i[0];for(var o=0;o<i.length;o++)if(i[o]in J)return i[o];return i[0]}var ae,Y=X(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);k.disableDrag=function(){J&&Y&&(ae=J[Y],J[Y]="none")},k.enableDrag=function(){J&&Y&&(J[Y]=ae)};var Te=X(["transform","WebkitTransform"]);k.setTransform=function(i,o){i.style[Te]=o};var be=!1;try{var ke=Object.defineProperty({},"passive",{get:function(){be=!0}});u.window.addEventListener("test",ke,ke),u.window.removeEventListener("test",ke,ke)}catch{be=!1}k.addEventListener=function(i,o,n,s){s===void 0&&(s={}),i.addEventListener(o,n,"passive"in s&&be?s:s.capture)},k.removeEventListener=function(i,o,n,s){s===void 0&&(s={}),i.removeEventListener(o,n,"passive"in s&&be?s:s.capture)};var Oe=function(i){i.preventDefault(),i.stopPropagation(),u.window.removeEventListener("click",Oe,!0)};function Ve(i){var o=i.userImage;return!!(o&&o.render&&o.render())&&(i.data.replace(new Uint8Array(o.data.buffer)),!0)}k.suppressClick=function(){u.window.addEventListener("click",Oe,!0),u.window.setTimeout((function(){u.window.removeEventListener("click",Oe,!0)}),0)},k.mousePos=function(i,o){var n=i.getBoundingClientRect();return new u.Point(o.clientX-n.left-i.clientLeft,o.clientY-n.top-i.clientTop)},k.touchPos=function(i,o){for(var n=i.getBoundingClientRect(),s=[],p=0;p<o.length;p++)s.push(new u.Point(o[p].clientX-n.left-i.clientLeft,o[p].clientY-n.top-i.clientTop));return s},k.mouseButton=function(i){return u.window.InstallTrigger!==void 0&&i.button===2&&i.ctrlKey&&u.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:i.button},k.remove=function(i){i.parentNode&&i.parentNode.removeChild(i)};var Re=(function(i){function o(){i.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new u.RGBAImage({width:1,height:1}),this.dirty=!0}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.isLoaded=function(){return this.loaded},o.prototype.setLoaded=function(n){if(this.loaded!==n&&(this.loaded=n,n)){for(var s=0,p=this.requestors;s<p.length;s+=1){var f=p[s];this._notify(f.ids,f.callback)}this.requestors=[]}},o.prototype.getImage=function(n){return this.images[n]},o.prototype.addImage=function(n,s){this._validate(n,s)&&(this.images[n]=s)},o.prototype._validate=function(n,s){var p=!0;return this._validateStretch(s.stretchX,s.data&&s.data.width)||(this.fire(new u.ErrorEvent(new Error('Image "'+n+'" has invalid "stretchX" value'))),p=!1),this._validateStretch(s.stretchY,s.data&&s.data.height)||(this.fire(new u.ErrorEvent(new Error('Image "'+n+'" has invalid "stretchY" value'))),p=!1),this._validateContent(s.content,s)||(this.fire(new u.ErrorEvent(new Error('Image "'+n+'" has invalid "content" value'))),p=!1),p},o.prototype._validateStretch=function(n,s){if(!n)return!0;for(var p=0,f=0,d=n;f<d.length;f+=1){var v=d[f];if(v[0]<p||v[1]<v[0]||s<v[1])return!1;p=v[1]}return!0},o.prototype._validateContent=function(n,s){return!(n&&(n.length!==4||n[0]<0||s.data.width<n[0]||n[1]<0||s.data.height<n[1]||n[2]<0||s.data.width<n[2]||n[3]<0||s.data.height<n[3]||n[2]<n[0]||n[3]<n[1]))},o.prototype.updateImage=function(n,s){s.version=this.images[n].version+1,this.images[n]=s,this.updatedImages[n]=!0},o.prototype.removeImage=function(n){var s=this.images[n];delete this.images[n],delete this.patterns[n],s.userImage&&s.userImage.onRemove&&s.userImage.onRemove()},o.prototype.listImages=function(){return Object.keys(this.images)},o.prototype.getImages=function(n,s){var p=!0;if(!this.isLoaded())for(var f=0,d=n;f<d.length;f+=1)this.images[d[f]]||(p=!1);this.isLoaded()||p?this._notify(n,s):this.requestors.push({ids:n,callback:s})},o.prototype._notify=function(n,s){for(var p={},f=0,d=n;f<d.length;f+=1){var v=d[f];this.images[v]||this.fire(new u.Event("styleimagemissing",{id:v}));var w=this.images[v];w?p[v]={data:w.data.clone(),pixelRatio:w.pixelRatio,sdf:w.sdf,version:w.version,stretchX:w.stretchX,stretchY:w.stretchY,content:w.content,hasRenderCallback:!!(w.userImage&&w.userImage.render)}:u.warnOnce('Image "'+v+'" 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.')}s(null,p)},o.prototype.getPixelSize=function(){var n=this.atlasImage;return{width:n.width,height:n.height}},o.prototype.getPattern=function(n){var s=this.patterns[n],p=this.getImage(n);if(!p)return null;if(s&&s.position.version===p.version)return s.position;if(s)s.position.version=p.version;else{var f={w:p.data.width+2,h:p.data.height+2,x:0,y:0},d=new u.ImagePosition(f,p);this.patterns[n]={bin:f,position:d}}return this._updatePatternAtlas(),this.patterns[n].position},o.prototype.bind=function(n){var s=n.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new u.Texture(n,this.atlasImage,s.RGBA),this.atlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE)},o.prototype._updatePatternAtlas=function(){var n=[];for(var s in this.patterns)n.push(this.patterns[s].bin);var p=u.potpack(n),f=p.w,d=p.h,v=this.atlasImage;for(var w in v.resize({width:f||1,height:d||1}),this.patterns){var A=this.patterns[w].bin,D=A.x+1,F=A.y+1,O=this.images[w].data,W=O.width,$=O.height;u.RGBAImage.copy(O,v,{x:0,y:0},{x:D,y:F},{width:W,height:$}),u.RGBAImage.copy(O,v,{x:0,y:$-1},{x:D,y:F-1},{width:W,height:1}),u.RGBAImage.copy(O,v,{x:0,y:0},{x:D,y:F+$},{width:W,height:1}),u.RGBAImage.copy(O,v,{x:W-1,y:0},{x:D-1,y:F},{width:1,height:$}),u.RGBAImage.copy(O,v,{x:0,y:0},{x:D+W,y:F},{width:1,height:$})}this.dirty=!0},o.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},o.prototype.dispatchRenderCallbacks=function(n){for(var s=0,p=n;s<p.length;s+=1){var f=p[s];if(!this.callbackDispatchedThisFrame[f]){this.callbackDispatchedThisFrame[f]=!0;var d=this.images[f];Ve(d)&&this.updateImage(f,d)}}},o})(u.Evented),ve=It,Ke=It,We=1e20;function It(i,o,n,s,p,f){this.fontSize=i||24,this.buffer=o===void 0?3:o,this.cutoff=s||.25,this.fontFamily=p||"sans-serif",this.fontWeight=f||"normal",this.radius=n||8;var d=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=d,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(d*d),this.gridInner=new Float64Array(d*d),this.f=new Float64Array(d),this.d=new Float64Array(d),this.z=new Float64Array(d+1),this.v=new Int16Array(d),this.middle=Math.round(d/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function we(i,o,n,s,p,f,d){for(var v=0;v<o;v++){for(var w=0;w<n;w++)s[w]=i[w*o+v];for(Ge(s,p,f,d,n),w=0;w<n;w++)i[w*o+v]=p[w]}for(w=0;w<n;w++){for(v=0;v<o;v++)s[v]=i[w*o+v];for(Ge(s,p,f,d,o),v=0;v<o;v++)i[w*o+v]=Math.sqrt(p[v])}}function Ge(i,o,n,s,p){n[0]=0,s[0]=-We,s[1]=+We;for(var f=1,d=0;f<p;f++){for(var v=(i[f]+f*f-(i[n[d]]+n[d]*n[d]))/(2*f-2*n[d]);v<=s[d];)d--,v=(i[f]+f*f-(i[n[d]]+n[d]*n[d]))/(2*f-2*n[d]);n[++d]=f,s[d]=v,s[d+1]=+We}for(f=0,d=0;f<p;f++){for(;s[d+1]<f;)d++;o[f]=(f-n[d])*(f-n[d])+i[n[d]]}}It.prototype.draw=function(i){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(i,this.buffer,this.middle);for(var o=this.ctx.getImageData(0,0,this.size,this.size),n=new Uint8ClampedArray(this.size*this.size),s=0;s<this.size*this.size;s++){var p=o.data[4*s+3]/255;this.gridOuter[s]=p===1?0:p===0?We:Math.pow(Math.max(0,.5-p),2),this.gridInner[s]=p===1?We:p===0?0:Math.pow(Math.max(0,p-.5),2)}for(we(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),we(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),s=0;s<this.size*this.size;s++)n[s]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[s]-this.gridInner[s])/this.radius+this.cutoff))));return n},ve.default=Ke;var Fe=function(i,o){this.requestManager=i,this.localIdeographFontFamily=o,this.entries={}};Fe.prototype.setURL=function(i){this.url=i},Fe.prototype.getGlyphs=function(i,o){var n=this,s=[];for(var p in i)for(var f=0,d=i[p];f<d.length;f+=1)s.push({stack:p,id:d[f]});u.asyncAll(s,(function(v,w){var A=v.stack,D=v.id,F=n.entries[A];F||(F=n.entries[A]={glyphs:{},requests:{},ranges:{}});var O=F.glyphs[D];if(O===void 0){if(O=n._tinySDF(F,A,D))return F.glyphs[D]=O,void w(null,{stack:A,id:D,glyph:O});var W=Math.floor(D/256);if(256*W>65535)w(new Error("glyphs > 65535 not supported"));else if(F.ranges[W])w(null,{stack:A,id:D,glyph:O});else{var $=F.requests[W];$||($=F.requests[W]=[],Fe.loadGlyphRange(A,W,n.url,n.requestManager,(function(ee,N){if(N){for(var Q in N)n._doesCharSupportLocalGlyph(+Q)||(F.glyphs[+Q]=N[+Q]);F.ranges[W]=!0}for(var ne=0,ue=$;ne<ue.length;ne+=1)(0,ue[ne])(ee,N);delete F.requests[W]}))),$.push((function(ee,N){ee?w(ee):N&&w(null,{stack:A,id:D,glyph:N[D]||null})}))}}else w(null,{stack:A,id:D,glyph:O})}),(function(v,w){if(v)o(v);else if(w){for(var A={},D=0,F=w;D<F.length;D+=1){var O=F[D],W=O.stack,$=O.id,ee=O.glyph;(A[W]||(A[W]={}))[$]=ee&&{id:ee.id,bitmap:ee.bitmap.clone(),metrics:ee.metrics}}o(null,A)}}))},Fe.prototype._doesCharSupportLocalGlyph=function(i){return!!this.localIdeographFontFamily&&(u.isChar["CJK Unified Ideographs"](i)||u.isChar["Hangul Syllables"](i)||u.isChar.Hiragana(i)||u.isChar.Katakana(i))},Fe.prototype._tinySDF=function(i,o,n){var s=this.localIdeographFontFamily;if(s&&this._doesCharSupportLocalGlyph(n)){var p=i.tinySDF;if(!p){var f="400";/bold/i.test(o)?f="900":/medium/i.test(o)?f="500":/light/i.test(o)&&(f="200"),p=i.tinySDF=new Fe.TinySDF(24,3,8,.25,s,f)}return{id:n,bitmap:new u.AlphaImage({width:30,height:30},p.draw(String.fromCharCode(n))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},Fe.loadGlyphRange=function(i,o,n,s,p){var f=256*o,d=f+255,v=s.transformRequest(s.normalizeGlyphsURL(n).replace("{fontstack}",i).replace("{range}",f+"-"+d),u.ResourceType.Glyphs);u.getArrayBuffer(v,(function(w,A){if(w)p(w);else if(A){for(var D={},F=0,O=u.parseGlyphPBF(A);F<O.length;F+=1){var W=O[F];D[W.id]=W}p(null,D)}}))},Fe.TinySDF=ve;var tt=function(){this.specification=u.styleSpec.light.position};tt.prototype.possiblyEvaluate=function(i,o){return u.sphericalToCartesian(i.expression.evaluate(o))},tt.prototype.interpolate=function(i,o,n){return{x:u.number(i.x,o.x,n),y:u.number(i.y,o.y,n),z:u.number(i.z,o.z,n)}};var kt=new u.Properties({anchor:new u.DataConstantProperty(u.styleSpec.light.anchor),position:new tt,color:new u.DataConstantProperty(u.styleSpec.light.color),intensity:new u.DataConstantProperty(u.styleSpec.light.intensity)}),Wt=(function(i){function o(n){i.call(this),this._transitionable=new u.Transitionable(kt),this.setLight(n),this._transitioning=this._transitionable.untransitioned()}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getLight=function(){return this._transitionable.serialize()},o.prototype.setLight=function(n,s){if(s===void 0&&(s={}),!this._validate(u.validateLight,n,s))for(var p in n){var f=n[p];u.endsWith(p,"-transition")?this._transitionable.setTransition(p.slice(0,-11),f):this._transitionable.setValue(p,f)}},o.prototype.updateTransitions=function(n){this._transitioning=this._transitionable.transitioned(n,this._transitioning)},o.prototype.hasTransition=function(){return this._transitioning.hasTransition()},o.prototype.recalculate=function(n){this.properties=this._transitioning.possiblyEvaluate(n)},o.prototype._validate=function(n,s,p){return(!p||p.validate!==!1)&&u.emitValidationErrors(this,n.call(u.validateStyle,u.extend({value:s,style:{glyphs:!0,sprite:!0},styleSpec:u.styleSpec})))},o})(u.Evented),St=function(i,o){this.width=i,this.height=o,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};St.prototype.getDash=function(i,o){var n=i.join(",")+String(o);return this.dashEntry[n]||(this.dashEntry[n]=this.addDash(i,o)),this.dashEntry[n]},St.prototype.getDashRanges=function(i,o,n){var s=[],p=i.length%2==1?-i[i.length-1]*n:0,f=i[0]*n,d=!0;s.push({left:p,right:f,isDash:d,zeroLength:i[0]===0});for(var v=i[0],w=1;w<i.length;w++){var A=i[w];s.push({left:p=v*n,right:f=(v+=A)*n,isDash:d=!d,zeroLength:A===0})}return s},St.prototype.addRoundDash=function(i,o,n){for(var s=o/2,p=-n;p<=n;p++)for(var f=this.width*(this.nextRow+n+p),d=0,v=i[d],w=0;w<this.width;w++){w/v.right>1&&(v=i[++d]);var A=Math.abs(w-v.left),D=Math.abs(w-v.right),F=Math.min(A,D),O=void 0,W=p/n*(s+1);if(v.isDash){var $=s-Math.abs(W);O=Math.sqrt(F*F+$*$)}else O=s-Math.sqrt(F*F+W*W);this.data[f+w]=Math.max(0,Math.min(255,O+128))}},St.prototype.addRegularDash=function(i){for(var o=i.length-1;o>=0;--o){var n=i[o],s=i[o+1];n.zeroLength?i.splice(o,1):s&&s.isDash===n.isDash&&(s.left=n.left,i.splice(o,1))}var p=i[0],f=i[i.length-1];p.isDash===f.isDash&&(p.left=f.left-this.width,f.right=p.right+this.width);for(var d=this.width*this.nextRow,v=0,w=i[v],A=0;A<this.width;A++){A/w.right>1&&(w=i[++v]);var D=Math.abs(A-w.left),F=Math.abs(A-w.right),O=Math.min(D,F);this.data[d+A]=Math.max(0,Math.min(255,(w.isDash?O:-O)+128))}},St.prototype.addDash=function(i,o){var n=o?7:0,s=2*n+1;if(this.nextRow+s>this.height)return u.warnOnce("LineAtlas out of space"),null;for(var p=0,f=0;f<i.length;f++)p+=i[f];if(p!==0){var d=this.width/p,v=this.getDashRanges(i,this.width,d);o?this.addRoundDash(v,d,n):this.addRegularDash(v)}var w={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:p};return this.nextRow+=s,this.dirty=!0,w},St.prototype.bind=function(i){var o=i.gl;this.texture?(o.bindTexture(o.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,o.texSubImage2D(o.TEXTURE_2D,0,0,0,this.width,this.height,o.ALPHA,o.UNSIGNED_BYTE,this.data))):(this.texture=o.createTexture(),o.bindTexture(o.TEXTURE_2D,this.texture),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.REPEAT),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.REPEAT),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texImage2D(o.TEXTURE_2D,0,o.ALPHA,this.width,this.height,0,o.ALPHA,o.UNSIGNED_BYTE,this.data))};var Ut=function i(o,n){this.workerPool=o,this.actors=[],this.currentActor=0,this.id=u.uniqueId();for(var s=this.workerPool.acquire(this.id),p=0;p<s.length;p++){var f=new i.Actor(s[p],n,this.id);f.name="Worker "+p,this.actors.push(f)}};function Hr(i,o,n){var s=function(p,f){if(p)return n(p);if(f){var d=u.pick(u.extend(f,i),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);f.vector_layers&&(d.vectorLayers=f.vector_layers,d.vectorLayerIds=d.vectorLayers.map((function(v){return v.id}))),d.tiles=o.canonicalizeTileset(d,i.url),n(null,d)}};return i.url?u.getJSON(o.transformRequest(o.normalizeSourceURL(i.url),u.ResourceType.Source),s):u.browser.frame((function(){return s(null,i)}))}Ut.prototype.broadcast=function(i,o,n){u.asyncAll(this.actors,(function(s,p){s.send(i,o,p)}),n=n||function(){})},Ut.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},Ut.prototype.remove=function(){this.actors.forEach((function(i){i.remove()})),this.actors=[],this.workerPool.release(this.id)},Ut.Actor=u.Actor;var Er=function(i,o,n){this.bounds=u.LngLatBounds.convert(this.validateBounds(i)),this.minzoom=o||0,this.maxzoom=n||24};Er.prototype.validateBounds=function(i){return Array.isArray(i)&&i.length===4?[Math.max(-180,i[0]),Math.max(-90,i[1]),Math.min(180,i[2]),Math.min(90,i[3])]:[-180,-90,180,90]},Er.prototype.contains=function(i){var o=Math.pow(2,i.z),n=Math.floor(u.mercatorXfromLng(this.bounds.getWest())*o),s=Math.floor(u.mercatorYfromLat(this.bounds.getNorth())*o),p=Math.ceil(u.mercatorXfromLng(this.bounds.getEast())*o),f=Math.ceil(u.mercatorYfromLat(this.bounds.getSouth())*o);return i.x>=n&&i.x<p&&i.y>=s&&i.y<f};var bi=(function(i){function o(n,s,p,f){if(i.call(this),this.id=n,this.dispatcher=p,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,u.extend(this,u.pick(s,["url","scheme","tileSize","promoteId"])),this._options=u.extend({type:"vector"},s),this._collectResourceTiming=s.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(f)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1,this.fire(new u.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Hr(this._options,this.map._requestManager,(function(s,p){n._tileJSONRequest=null,n._loaded=!0,s?n.fire(new u.ErrorEvent(s)):p&&(u.extend(n,p),p.bounds&&(n.tileBounds=new Er(p.bounds,n.minzoom,n.maxzoom)),u.postTurnstileEvent(p.tiles,n.map._requestManager._customAccessToken),u.postMapLoadEvent(p.tiles,n.map._getMapId(),n.map._requestManager._skuToken,n.map._requestManager._customAccessToken),n.fire(new u.Event("data",{dataType:"source",sourceDataType:"metadata"})),n.fire(new u.Event("data",{dataType:"source",sourceDataType:"content"})))}))},o.prototype.loaded=function(){return this._loaded},o.prototype.hasTile=function(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setSourceProperty=function(n){this._tileJSONRequest&&this._tileJSONRequest.cancel(),n(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},o.prototype.setTiles=function(n){var s=this;return this.setSourceProperty((function(){s._options.tiles=n})),this},o.prototype.setUrl=function(n){var s=this;return this.setSourceProperty((function(){s.url=n,s._options.url=n})),this},o.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},o.prototype.serialize=function(){return u.extend({},this._options)},o.prototype.loadTile=function(n,s){var p=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme)),f={request:this.map._requestManager.transformRequest(p,u.ResourceType.Tile),uid:n.uid,tileID:n.tileID,zoom:n.tileID.overscaledZ,tileSize:this.tileSize*n.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:u.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function d(v,w){return delete n.request,n.aborted?s(null):v&&v.status!==404?s(v):(w&&w.resourceTiming&&(n.resourceTiming=w.resourceTiming),this.map._refreshExpiredTiles&&w&&n.setExpiryData(w),n.loadVectorData(w,this.map.painter),u.cacheEntryPossiblyAdded(this.dispatcher),s(null),void(n.reloadCallback&&(this.loadTile(n,n.reloadCallback),n.reloadCallback=null)))}f.request.collectResourceTiming=this._collectResourceTiming,n.actor&&n.state!=="expired"?n.state==="loading"?n.reloadCallback=s:n.request=n.actor.send("reloadTile",f,d.bind(this)):(n.actor=this.dispatcher.getActor(),n.request=n.actor.send("loadTile",f,d.bind(this)))},o.prototype.abortTile=function(n){n.request&&(n.request.cancel(),delete n.request),n.actor&&n.actor.send("abortTile",{uid:n.uid,type:this.type,source:this.id},void 0)},o.prototype.unloadTile=function(n){n.unloadVectorData(),n.actor&&n.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id},void 0)},o.prototype.hasTransition=function(){return!1},o})(u.Evented),or=(function(i){function o(n,s,p,f){i.call(this),this.id=n,this.dispatcher=p,this.setEventedParent(f),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=u.extend({type:"raster"},s),u.extend(this,u.pick(s,["url","scheme","tileSize"]))}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1,this.fire(new u.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Hr(this._options,this.map._requestManager,(function(s,p){n._tileJSONRequest=null,n._loaded=!0,s?n.fire(new u.ErrorEvent(s)):p&&(u.extend(n,p),p.bounds&&(n.tileBounds=new Er(p.bounds,n.minzoom,n.maxzoom)),u.postTurnstileEvent(p.tiles),u.postMapLoadEvent(p.tiles,n.map._getMapId(),n.map._requestManager._skuToken),n.fire(new u.Event("data",{dataType:"source",sourceDataType:"metadata"})),n.fire(new u.Event("data",{dataType:"source",sourceDataType:"content"})))}))},o.prototype.loaded=function(){return this._loaded},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},o.prototype.serialize=function(){return u.extend({},this._options)},o.prototype.hasTile=function(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)},o.prototype.loadTile=function(n,s){var p=this,f=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);n.request=u.getImage(this.map._requestManager.transformRequest(f,u.ResourceType.Tile),(function(d,v){if(delete n.request,n.aborted)n.state="unloaded",s(null);else if(d)n.state="errored",s(d);else if(v){p.map._refreshExpiredTiles&&n.setExpiryData(v),delete v.cacheControl,delete v.expires;var w=p.map.painter.context,A=w.gl;n.texture=p.map.painter.getTileTexture(v.width),n.texture?n.texture.update(v,{useMipmap:!0}):(n.texture=new u.Texture(w,v,A.RGBA,{useMipmap:!0}),n.texture.bind(A.LINEAR,A.CLAMP_TO_EDGE,A.LINEAR_MIPMAP_NEAREST),w.extTextureFilterAnisotropic&&A.texParameterf(A.TEXTURE_2D,w.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,w.extTextureFilterAnisotropicMax)),n.state="loaded",u.cacheEntryPossiblyAdded(p.dispatcher),s(null)}}))},o.prototype.abortTile=function(n,s){n.request&&(n.request.cancel(),delete n.request),s()},o.prototype.unloadTile=function(n,s){n.texture&&this.map.painter.saveTileTexture(n.texture),s()},o.prototype.hasTransition=function(){return!1},o})(u.Evented),Rr=(function(i){function o(n,s,p,f){i.call(this,n,s,p,f),this.type="raster-dem",this.maxzoom=22,this._options=u.extend({type:"raster-dem"},s),this.encoding=s.encoding||"mapbox"}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},o.prototype.loadTile=function(n,s){var p=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function f(d,v){d&&(n.state="errored",s(d)),v&&(n.dem=v,n.needsHillshadePrepare=!0,n.state="loaded",s(null))}n.request=u.getImage(this.map._requestManager.transformRequest(p,u.ResourceType.Tile),(function(d,v){if(delete n.request,n.aborted)n.state="unloaded",s(null);else if(d)n.state="errored",s(d);else if(v){this.map._refreshExpiredTiles&&n.setExpiryData(v),delete v.cacheControl,delete v.expires;var w=u.window.ImageBitmap&&v instanceof u.window.ImageBitmap&&u.offscreenCanvasSupported()?v:u.browser.getImageData(v,1),A={uid:n.uid,coord:n.tileID,source:this.id,rawImageData:w,encoding:this.encoding};n.actor&&n.state!=="expired"||(n.actor=this.dispatcher.getActor(),n.actor.send("loadDEMTile",A,f.bind(this)))}}).bind(this)),n.neighboringTiles=this._getNeighboringTiles(n.tileID)},o.prototype._getNeighboringTiles=function(n){var s=n.canonical,p=Math.pow(2,s.z),f=(s.x-1+p)%p,d=s.x===0?n.wrap-1:n.wrap,v=(s.x+1+p)%p,w=s.x+1===p?n.wrap+1:n.wrap,A={};return A[new u.OverscaledTileID(n.overscaledZ,d,s.z,f,s.y).key]={backfilled:!1},A[new u.OverscaledTileID(n.overscaledZ,w,s.z,v,s.y).key]={backfilled:!1},s.y>0&&(A[new u.OverscaledTileID(n.overscaledZ,d,s.z,f,s.y-1).key]={backfilled:!1},A[new u.OverscaledTileID(n.overscaledZ,n.wrap,s.z,s.x,s.y-1).key]={backfilled:!1},A[new u.OverscaledTileID(n.overscaledZ,w,s.z,v,s.y-1).key]={backfilled:!1}),s.y+1<p&&(A[new u.OverscaledTileID(n.overscaledZ,d,s.z,f,s.y+1).key]={backfilled:!1},A[new u.OverscaledTileID(n.overscaledZ,n.wrap,s.z,s.x,s.y+1).key]={backfilled:!1},A[new u.OverscaledTileID(n.overscaledZ,w,s.z,v,s.y+1).key]={backfilled:!1}),A},o.prototype.unloadTile=function(n){n.demTexture&&this.map.painter.saveTileTexture(n.demTexture),n.fbo&&(n.fbo.destroy(),delete n.fbo),n.dem&&delete n.dem,delete n.neighboringTiles,n.state="unloaded",n.actor&&n.actor.send("removeDEMTile",{uid:n.uid,source:this.id})},o})(or),et=(function(i){function o(n,s,p,f){i.call(this),this.id=n,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=p.getActor(),this.setEventedParent(f),this._data=s.data,this._options=u.extend({},s),this._collectResourceTiming=s.collectResourceTiming,this._resourceTiming=[],s.maxzoom!==void 0&&(this.maxzoom=s.maxzoom),s.type&&(this.type=s.type),s.attribution&&(this.attribution=s.attribution),this.promoteId=s.promoteId;var d=u.EXTENT/this.tileSize;this.workerOptions=u.extend({source:this.id,cluster:s.cluster||!1,geojsonVtOptions:{buffer:(s.buffer!==void 0?s.buffer:128)*d,tolerance:(s.tolerance!==void 0?s.tolerance:.375)*d,extent:u.EXTENT,maxZoom:this.maxzoom,lineMetrics:s.lineMetrics||!1,generateId:s.generateId||!1},superclusterOptions:{maxZoom:s.clusterMaxZoom!==void 0?Math.min(s.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,s.clusterMinPoints||2),extent:u.EXTENT,radius:(s.clusterRadius||50)*d,log:!1,generateId:s.generateId||!1},clusterProperties:s.clusterProperties,filter:s.filter},s.workerOptions)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this.fire(new u.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(s){if(s)n.fire(new u.ErrorEvent(s));else{var p={dataType:"source",sourceDataType:"metadata"};n._collectResourceTiming&&n._resourceTiming&&n._resourceTiming.length>0&&(p.resourceTiming=n._resourceTiming,n._resourceTiming=[]),n.fire(new u.Event("data",p))}}))},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setData=function(n){var s=this;return this._data=n,this.fire(new u.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(p){if(p)s.fire(new u.ErrorEvent(p));else{var f={dataType:"source",sourceDataType:"content"};s._collectResourceTiming&&s._resourceTiming&&s._resourceTiming.length>0&&(f.resourceTiming=s._resourceTiming,s._resourceTiming=[]),s.fire(new u.Event("data",f))}})),this},o.prototype.getClusterExpansionZoom=function(n,s){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:n,source:this.id},s),this},o.prototype.getClusterChildren=function(n,s){return this.actor.send("geojson.getClusterChildren",{clusterId:n,source:this.id},s),this},o.prototype.getClusterLeaves=function(n,s,p,f){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:n,limit:s,offset:p},f),this},o.prototype._updateWorkerData=function(n){var s=this;this._loaded=!1;var p=u.extend({},this.workerOptions),f=this._data;typeof f=="string"?(p.request=this.map._requestManager.transformRequest(u.browser.resolveURL(f),u.ResourceType.Source),p.request.collectResourceTiming=this._collectResourceTiming):p.data=JSON.stringify(f),this.actor.send(this.type+".loadData",p,(function(d,v){s._removed||v&&v.abandoned||(s._loaded=!0,v&&v.resourceTiming&&v.resourceTiming[s.id]&&(s._resourceTiming=v.resourceTiming[s.id].slice(0)),s.actor.send(s.type+".coalesce",{source:p.source},null),n(d))}))},o.prototype.loaded=function(){return this._loaded},o.prototype.loadTile=function(n,s){var p=this,f=n.actor?"reloadTile":"loadTile";n.actor=this.actor,n.request=this.actor.send(f,{type:this.type,uid:n.uid,tileID:n.tileID,zoom:n.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:u.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(d,v){return delete n.request,n.unloadVectorData(),n.aborted?s(null):d?s(d):(n.loadVectorData(v,p.map.painter,f==="reloadTile"),s(null))}))},o.prototype.abortTile=function(n){n.request&&(n.request.cancel(),delete n.request),n.aborted=!0},o.prototype.unloadTile=function(n){n.unloadVectorData(),this.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id})},o.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},o.prototype.serialize=function(){return u.extend({},this._options,{type:this.type,data:this._data})},o.prototype.hasTransition=function(){return!1},o})(u.Evented),Lr=u.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),Xr=(function(i){function o(n,s,p,f){i.call(this),this.id=n,this.dispatcher=p,this.coordinates=s.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(f),this.options=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(n,s){var p=this;this._loaded=!1,this.fire(new u.Event("dataloading",{dataType:"source"})),this.url=this.options.url,u.getImage(this.map._requestManager.transformRequest(this.url,u.ResourceType.Image),(function(f,d){p._loaded=!0,f?p.fire(new u.ErrorEvent(f)):d&&(p.image=d,n&&(p.coordinates=n),s&&s(),p._finishLoading())}))},o.prototype.loaded=function(){return this._loaded},o.prototype.updateImage=function(n){var s=this;return this.image&&n.url?(this.options.url=n.url,this.load(n.coordinates,(function(){s.texture=null})),this):this},o.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new u.Event("data",{dataType:"source",sourceDataType:"metadata"})))},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setCoordinates=function(n){var s=this;this.coordinates=n;var p=n.map(u.MercatorCoordinate.fromLngLat);this.tileID=(function(d){for(var v=1/0,w=1/0,A=-1/0,D=-1/0,F=0,O=d;F<O.length;F+=1){var W=O[F];v=Math.min(v,W.x),w=Math.min(w,W.y),A=Math.max(A,W.x),D=Math.max(D,W.y)}var $=Math.max(A-v,D-w),ee=Math.max(0,Math.floor(-Math.log($)/Math.LN2)),N=Math.pow(2,ee);return new u.CanonicalTileID(ee,Math.floor((v+A)/2*N),Math.floor((w+D)/2*N))})(p),this.minzoom=this.maxzoom=this.tileID.z;var f=p.map((function(d){return s.tileID.getTilePoint(d)._round()}));return this._boundsArray=new u.StructArrayLayout4i8,this._boundsArray.emplaceBack(f[0].x,f[0].y,0,0),this._boundsArray.emplaceBack(f[1].x,f[1].y,u.EXTENT,0),this._boundsArray.emplaceBack(f[3].x,f[3].y,0,u.EXTENT),this._boundsArray.emplaceBack(f[2].x,f[2].y,u.EXTENT,u.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new u.Event("data",{dataType:"source",sourceDataType:"content"})),this},o.prototype.prepare=function(){if(Object.keys(this.tiles).length!==0&&this.image){var n=this.map.painter.context,s=n.gl;for(var p in this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,Lr.members)),this.boundsSegments||(this.boundsSegments=u.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new u.Texture(n,this.image,s.RGBA),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE)),this.tiles){var f=this.tiles[p];f.state!=="loaded"&&(f.state="loaded",f.texture=this.texture)}}},o.prototype.loadTile=function(n,s){this.tileID&&this.tileID.equals(n.tileID.canonical)?(this.tiles[String(n.tileID.wrap)]=n,n.buckets={},s(null)):(n.state="errored",s(null))},o.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},o.prototype.hasTransition=function(){return!1},o})(u.Evented),At=(function(i){function o(n,s,p,f){i.call(this,n,s,p,f),this.roundZoom=!0,this.type="video",this.options=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1;var s=this.options;this.urls=[];for(var p=0,f=s.urls;p<f.length;p+=1)this.urls.push(this.map._requestManager.transformRequest(f[p],u.ResourceType.Source).url);u.getVideo(this.urls,(function(d,v){n._loaded=!0,d?n.fire(new u.ErrorEvent(d)):v&&(n.video=v,n.video.loop=!0,n.video.setAttribute("playsinline",""),n.video.addEventListener("playing",(function(){n.map.triggerRepaint()})),n.map&&n.video.play(),n._finishLoading())}))},o.prototype.pause=function(){this.video&&this.video.pause()},o.prototype.play=function(){this.video&&this.video.play()},o.prototype.seek=function(n){if(this.video){var s=this.video.seekable;n<s.start(0)||n>s.end(0)?this.fire(new u.ErrorEvent(new u.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+s.start(0)+" and "+s.end(0)+"-second mark."))):this.video.currentTime=n}},o.prototype.getVideo=function(){return this.video},o.prototype.onAdd=function(n){this.map||(this.map=n,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},o.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var n=this.map.painter.context,s=n.gl;for(var p in this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,Lr.members)),this.boundsSegments||(this.boundsSegments=u.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE),s.texSubImage2D(s.TEXTURE_2D,0,0,0,s.RGBA,s.UNSIGNED_BYTE,this.video)):(this.texture=new u.Texture(n,this.video,s.RGBA),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE)),this.tiles){var f=this.tiles[p];f.state!=="loaded"&&(f.state="loaded",f.texture=this.texture)}}},o.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},o.prototype.hasTransition=function(){return this.video&&!this.video.paused},o})(Xr),Fr=(function(i){function o(n,s,p,f){i.call(this,n,s,p,f),s.coordinates?Array.isArray(s.coordinates)&&s.coordinates.length===4&&!s.coordinates.some((function(d){return!Array.isArray(d)||d.length!==2||d.some((function(v){return typeof v!="number"}))}))||this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,null,'missing required property "coordinates"'))),s.animate&&typeof s.animate!="boolean"&&this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,null,'optional "animate" property must be a boolean value'))),s.canvas?typeof s.canvas=="string"||s.canvas instanceof u.window.HTMLCanvasElement||this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,null,'missing required property "canvas"'))),this.options=s,this.animate=s.animate===void 0||s.animate}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof u.window.HTMLCanvasElement?this.options.canvas:u.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new u.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())},o.prototype.getCanvas=function(){return this.canvas},o.prototype.onAdd=function(n){this.map=n,this.load(),this.canvas&&this.animate&&this.play()},o.prototype.onRemove=function(){this.pause()},o.prototype.prepare=function(){var n=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,n=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,n=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var s=this.map.painter.context,p=s.gl;for(var f in this.boundsBuffer||(this.boundsBuffer=s.createVertexBuffer(this._boundsArray,Lr.members)),this.boundsSegments||(this.boundsSegments=u.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(n||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new u.Texture(s,this.canvas,p.RGBA,{premultiply:!0}),this.tiles){var d=this.tiles[f];d.state!=="loaded"&&(d.state="loaded",d.texture=this.texture)}}},o.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},o.prototype.hasTransition=function(){return this._playing},o.prototype._hasInvalidDimensions=function(){for(var n=0,s=[this.canvas.width,this.canvas.height];n<s.length;n+=1){var p=s[n];if(isNaN(p)||p<=0)return!0}return!1},o})(Xr),Mi={vector:bi,raster:or,"raster-dem":Rr,geojson:et,video:At,image:Xr,canvas:Fr};function pi(i,o){var n=u.identity([]);return u.translate(n,n,[1,1,0]),u.scale(n,n,[.5*i.width,.5*i.height,1]),u.multiply(n,n,i.calculatePosMatrix(o.toUnwrapped()))}function Or(i,o,n,s,p,f){var d=(function(ee,N,Q){if(ee)for(var ne=0,ue=ee;ne<ue.length;ne+=1){var de=N[ue[ne]];if(de&&de.source===Q&&de.type==="fill-extrusion")return!0}else for(var pe in N){var ye=N[pe];if(ye.source===Q&&ye.type==="fill-extrusion")return!0}return!1})(p&&p.layers,o,i.id),v=f.maxPitchScaleFactor(),w=i.tilesIn(s,v,d);w.sort(Xi);for(var A=[],D=0,F=w;D<F.length;D+=1){var O=F[D];A.push({wrappedTileID:O.tileID.wrapped().key,queryResults:O.tile.queryRenderedFeatures(o,n,i._state,O.queryGeometry,O.cameraQueryGeometry,O.scale,p,f,v,pi(i.transform,O.tileID))})}var W=(function(ee){for(var N={},Q={},ne=0,ue=ee;ne<ue.length;ne+=1){var de=ue[ne],pe=de.queryResults,ye=de.wrappedTileID,Ie=Q[ye]=Q[ye]||{};for(var Me in pe)for(var Ce=pe[Me],$e=Ie[Me]=Ie[Me]||{},nt=N[Me]=N[Me]||[],ut=0,st=Ce;ut<st.length;ut+=1){var Lt=st[ut];$e[Lt.featureIndex]||($e[Lt.featureIndex]=!0,nt.push(Lt))}}return N})(A);for(var $ in W)W[$].forEach((function(ee){var N=ee.feature,Q=i.getFeatureState(N.layer["source-layer"],N.id);N.source=N.layer.source,N.layer["source-layer"]&&(N.sourceLayer=N.layer["source-layer"]),N.state=Q}));return W}function Xi(i,o){var n=i.tileID,s=o.tileID;return n.overscaledZ-s.overscaledZ||n.canonical.y-s.canonical.y||n.wrap-s.wrap||n.canonical.x-s.canonical.x}var Nt=function(i,o){this.max=i,this.onRemove=o,this.reset()};Nt.prototype.reset=function(){for(var i in this.data)for(var o=0,n=this.data[i];o<n.length;o+=1){var s=n[o];s.timeout&&clearTimeout(s.timeout),this.onRemove(s.value)}return this.data={},this.order=[],this},Nt.prototype.add=function(i,o,n){var s=this,p=i.wrapped().key;this.data[p]===void 0&&(this.data[p]=[]);var f={value:o,timeout:void 0};if(n!==void 0&&(f.timeout=setTimeout((function(){s.remove(i,f)}),n)),this.data[p].push(f),this.order.push(p),this.order.length>this.max){var d=this._getAndRemoveByKey(this.order[0]);d&&this.onRemove(d)}return this},Nt.prototype.has=function(i){return i.wrapped().key in this.data},Nt.prototype.getAndRemove=function(i){return this.has(i)?this._getAndRemoveByKey(i.wrapped().key):null},Nt.prototype._getAndRemoveByKey=function(i){var o=this.data[i].shift();return o.timeout&&clearTimeout(o.timeout),this.data[i].length===0&&delete this.data[i],this.order.splice(this.order.indexOf(i),1),o.value},Nt.prototype.getByKey=function(i){var o=this.data[i];return o?o[0].value:null},Nt.prototype.get=function(i){return this.has(i)?this.data[i.wrapped().key][0].value:null},Nt.prototype.remove=function(i,o){if(!this.has(i))return this;var n=i.wrapped().key,s=o===void 0?0:this.data[n].indexOf(o),p=this.data[n][s];return this.data[n].splice(s,1),p.timeout&&clearTimeout(p.timeout),this.data[n].length===0&&delete this.data[n],this.onRemove(p.value),this.order.splice(this.order.indexOf(n),1),this},Nt.prototype.setMaxSize=function(i){for(this.max=i;this.order.length>this.max;){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},Nt.prototype.filter=function(i){var o=[];for(var n in this.data)for(var s=0,p=this.data[n];s<p.length;s+=1){var f=p[s];i(f.value)||o.push(f)}for(var d=0,v=o;d<v.length;d+=1){var w=v[d];this.remove(w.value.tileID,w)}};var Nr=function(i,o,n){this.context=i;var s=i.gl;this.buffer=s.createBuffer(),this.dynamicDraw=!!n,this.context.unbindVAO(),i.bindElementBuffer.set(this.buffer),s.bufferData(s.ELEMENT_ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?s.DYNAMIC_DRAW:s.STATIC_DRAW),this.dynamicDraw||delete o.arrayBuffer};Nr.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Nr.prototype.updateData=function(i){var o=this.context.gl;this.context.unbindVAO(),this.bind(),o.bufferSubData(o.ELEMENT_ARRAY_BUFFER,0,i.arrayBuffer)},Nr.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var ar={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},sr=function(i,o,n,s){this.length=o.length,this.attributes=n,this.itemSize=o.bytesPerElement,this.dynamicDraw=s,this.context=i;var p=i.gl;this.buffer=p.createBuffer(),i.bindVertexBuffer.set(this.buffer),p.bufferData(p.ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?p.DYNAMIC_DRAW:p.STATIC_DRAW),this.dynamicDraw||delete o.arrayBuffer};sr.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},sr.prototype.updateData=function(i){var o=this.context.gl;this.bind(),o.bufferSubData(o.ARRAY_BUFFER,0,i.arrayBuffer)},sr.prototype.enableAttributes=function(i,o){for(var n=0;n<this.attributes.length;n++){var s=o.attributes[this.attributes[n].name];s!==void 0&&i.enableVertexAttribArray(s)}},sr.prototype.setVertexAttribPointers=function(i,o,n){for(var s=0;s<this.attributes.length;s++){var p=this.attributes[s],f=o.attributes[p.name];f!==void 0&&i.vertexAttribPointer(f,p.components,i[ar[p.type]],!1,this.itemSize,p.offset+this.itemSize*(n||0))}},sr.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var lt=function(i){this.gl=i.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};lt.prototype.get=function(){return this.current},lt.prototype.set=function(i){},lt.prototype.getDefault=function(){return this.default},lt.prototype.setDefault=function(){this.set(this.default)};var mr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return u.Color.transparent},o.prototype.set=function(n){var s=this.current;(n.r!==s.r||n.g!==s.g||n.b!==s.b||n.a!==s.a||this.dirty)&&(this.gl.clearColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)},o})(lt),pr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 1},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.clearDepth(n),this.current=n,this.dirty=!1)},o})(lt),jr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.clearStencil(n),this.current=n,this.dirty=!1)},o})(lt),hr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return[!0,!0,!0,!0]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||n[3]!==s[3]||this.dirty)&&(this.gl.colorMask(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)},o})(lt),br=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.depthMask(n),this.current=n,this.dirty=!1)},o})(lt),dn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 255},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.stencilMask(n),this.current=n,this.dirty=!1)},o})(lt),Kr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},o.prototype.set=function(n){var s=this.current;(n.func!==s.func||n.ref!==s.ref||n.mask!==s.mask||this.dirty)&&(this.gl.stencilFunc(n.func,n.ref,n.mask),this.current=n,this.dirty=!1)},o})(lt),Bi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[n.KEEP,n.KEEP,n.KEEP]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||this.dirty)&&(this.gl.stencilOp(n[0],n[1],n[2]),this.current=n,this.dirty=!1)},o})(lt),hi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.STENCIL_TEST):s.disable(s.STENCIL_TEST),this.current=n,this.dirty=!1}},o})(lt),ti=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return[0,1]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||this.dirty)&&(this.gl.depthRange(n[0],n[1]),this.current=n,this.dirty=!1)},o})(lt),ri=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.DEPTH_TEST):s.disable(s.DEPTH_TEST),this.current=n,this.dirty=!1}},o})(lt),Vi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.LESS},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.depthFunc(n),this.current=n,this.dirty=!1)},o})(lt),Ki=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.BLEND):s.disable(s.BLEND),this.current=n,this.dirty=!1}},o})(lt),yo=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[n.ONE,n.ZERO]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||this.dirty)&&(this.gl.blendFunc(n[0],n[1]),this.current=n,this.dirty=!1)},o})(lt),Zo=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return u.Color.transparent},o.prototype.set=function(n){var s=this.current;(n.r!==s.r||n.g!==s.g||n.b!==s.b||n.a!==s.a||this.dirty)&&(this.gl.blendColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)},o})(lt),mn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.FUNC_ADD},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.blendEquation(n),this.current=n,this.dirty=!1)},o})(lt),Mn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.CULL_FACE):s.disable(s.CULL_FACE),this.current=n,this.dirty=!1}},o})(lt),Bn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.BACK},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.cullFace(n),this.current=n,this.dirty=!1)},o})(lt),$o=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.CCW},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.frontFace(n),this.current=n,this.dirty=!1)},o})(lt),jn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.useProgram(n),this.current=n,this.dirty=!1)},o})(lt),zn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.TEXTURE0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.activeTexture(n),this.current=n,this.dirty=!1)},o})(lt),rn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[0,0,n.drawingBufferWidth,n.drawingBufferHeight]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||n[3]!==s[3]||this.dirty)&&(this.gl.viewport(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)},o})(lt),fe=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindFramebuffer(s.FRAMEBUFFER,n),this.current=n,this.dirty=!1}},o})(lt),_e=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindRenderbuffer(s.RENDERBUFFER,n),this.current=n,this.dirty=!1}},o})(lt),jt=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindTexture(s.TEXTURE_2D,n),this.current=n,this.dirty=!1}},o})(lt),tr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindBuffer(s.ARRAY_BUFFER,n),this.current=n,this.dirty=!1}},o})(lt),Kt=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){var s=this.gl;s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,n),this.current=n,this.dirty=!1},o})(lt),_t=(function(i){function o(n){i.call(this,n),this.vao=n.extVertexArrayObject}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){this.vao&&(n!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(n),this.current=n,this.dirty=!1)},o})(lt),fi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 4},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_ALIGNMENT,n),this.current=n,this.dirty=!1}},o})(lt),qi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n),this.current=n,this.dirty=!1}},o})(lt),ii=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,n),this.current=n,this.dirty=!1}},o})(lt),Yt=(function(i){function o(n,s){i.call(this,n),this.context=n,this.parent=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o})(lt),T=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.setDirty=function(){this.dirty=!0},o.prototype.set=function(n){if(n!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var s=this.gl;s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,n,0),this.current=n,this.dirty=!1}},o})(Yt),P=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.set=function(n){if(n!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var s=this.gl;s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,n),this.current=n,this.dirty=!1}},o})(Yt),B=function(i,o,n,s){this.context=i,this.width=o,this.height=n;var p=this.framebuffer=i.gl.createFramebuffer();this.colorAttachment=new T(i,p),s&&(this.depthAttachment=new P(i,p))};B.prototype.destroy=function(){var i=this.context.gl,o=this.colorAttachment.get();if(o&&i.deleteTexture(o),this.depthAttachment){var n=this.depthAttachment.get();n&&i.deleteRenderbuffer(n)}i.deleteFramebuffer(this.framebuffer)};var V=function(i,o,n){this.func=i,this.mask=o,this.range=n};V.ReadOnly=!1,V.ReadWrite=!0,V.disabled=new V(519,V.ReadOnly,[0,1]);var Z=function(i,o,n,s,p,f){this.test=i,this.ref=o,this.mask=n,this.fail=s,this.depthFail=p,this.pass=f};Z.disabled=new Z({func:519,mask:0},0,0,7680,7680,7680);var re=function(i,o,n){this.blendFunction=i,this.blendColor=o,this.mask=n};re.disabled=new re(re.Replace=[1,0],u.Color.transparent,[!1,!1,!1,!1]),re.unblended=new re(re.Replace,u.Color.transparent,[!0,!0,!0,!0]),re.alphaBlended=new re([1,771],u.Color.transparent,[!0,!0,!0,!0]);var ie=function(i,o,n){this.enable=i,this.mode=o,this.frontFace=n};ie.disabled=new ie(!1,1029,2305),ie.backCCW=new ie(!0,1029,2305);var L=function(i){this.gl=i,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new mr(this),this.clearDepth=new pr(this),this.clearStencil=new jr(this),this.colorMask=new hr(this),this.depthMask=new br(this),this.stencilMask=new dn(this),this.stencilFunc=new Kr(this),this.stencilOp=new Bi(this),this.stencilTest=new hi(this),this.depthRange=new ti(this),this.depthTest=new ri(this),this.depthFunc=new Vi(this),this.blend=new Ki(this),this.blendFunc=new yo(this),this.blendColor=new Zo(this),this.blendEquation=new mn(this),this.cullFace=new Mn(this),this.cullFaceSide=new Bn(this),this.frontFace=new $o(this),this.program=new jn(this),this.activeTexture=new zn(this),this.viewport=new rn(this),this.bindFramebuffer=new fe(this),this.bindRenderbuffer=new _e(this),this.bindTexture=new jt(this),this.bindVertexBuffer=new tr(this),this.bindElementBuffer=new Kt(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new _t(this),this.pixelStoreUnpack=new fi(this),this.pixelStoreUnpackPremultiplyAlpha=new qi(this),this.pixelStoreUnpackFlipY=new ii(this),this.extTextureFilterAnisotropic=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=i.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=i.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(i.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=i.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=i.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE)};L.prototype.setDefault=function(){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()},L.prototype.setDirty=function(){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},L.prototype.createIndexBuffer=function(i,o){return new Nr(this,i,o)},L.prototype.createVertexBuffer=function(i,o,n){return new sr(this,i,o,n)},L.prototype.createRenderbuffer=function(i,o,n){var s=this.gl,p=s.createRenderbuffer();return this.bindRenderbuffer.set(p),s.renderbufferStorage(s.RENDERBUFFER,i,o,n),this.bindRenderbuffer.set(null),p},L.prototype.createFramebuffer=function(i,o,n){return new B(this,i,o,n)},L.prototype.clear=function(i){var o=i.color,n=i.depth,s=this.gl,p=0;o&&(p|=s.COLOR_BUFFER_BIT,this.clearColor.set(o),this.colorMask.set([!0,!0,!0,!0])),n!==void 0&&(p|=s.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(n),this.depthMask.set(!0)),s.clear(p)},L.prototype.setCullFace=function(i){i.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(i.mode),this.frontFace.set(i.frontFace))},L.prototype.setDepthMode=function(i){i.func!==this.gl.ALWAYS||i.mask?(this.depthTest.set(!0),this.depthFunc.set(i.func),this.depthMask.set(i.mask),this.depthRange.set(i.range)):this.depthTest.set(!1)},L.prototype.setStencilMode=function(i){i.test.func!==this.gl.ALWAYS||i.mask?(this.stencilTest.set(!0),this.stencilMask.set(i.mask),this.stencilOp.set([i.fail,i.depthFail,i.pass]),this.stencilFunc.set({func:i.test.func,ref:i.ref,mask:i.test.mask})):this.stencilTest.set(!1)},L.prototype.setColorMode=function(i){u.deepEqual(i.blendFunction,re.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(i.blendFunction),this.blendColor.set(i.blendColor)),this.colorMask.set(i.mask)},L.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var H=(function(i){function o(n,s,p){var f=this;i.call(this),this.id=n,this.dispatcher=p,this.on("data",(function(d){d.dataType==="source"&&d.sourceDataType==="metadata"&&(f._sourceLoaded=!0),f._sourceLoaded&&!f._paused&&d.dataType==="source"&&d.sourceDataType==="content"&&(f.reload(),f.transform&&f.update(f.transform))})),this.on("error",(function(){f._sourceErrored=!0})),this._source=(function(d,v,w,A){var D=new Mi[v.type](d,v,w,A);if(D.id!==d)throw new Error("Expected Source id to be "+d+" instead of "+D.id);return u.bindAll(["load","abort","unload","serialize","prepare"],D),D})(n,s,p,this),this._tiles={},this._cache=new Nt(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new u.SourceFeatureState}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.onAdd=function(n){this.map=n,this._maxTileCacheSize=n?n._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(n)},o.prototype.onRemove=function(n){this._source&&this._source.onRemove&&this._source.onRemove(n)},o.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(var n in this._tiles){var s=this._tiles[n];if(s.state!=="loaded"&&s.state!=="errored")return!1}return!0},o.prototype.getSource=function(){return this._source},o.prototype.pause=function(){this._paused=!0},o.prototype.resume=function(){if(this._paused){var n=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,n&&this.reload(),this.transform&&this.update(this.transform)}},o.prototype._loadTile=function(n,s){return this._source.loadTile(n,s)},o.prototype._unloadTile=function(n){if(this._source.unloadTile)return this._source.unloadTile(n,(function(){}))},o.prototype._abortTile=function(n){if(this._source.abortTile)return this._source.abortTile(n,(function(){}))},o.prototype.serialize=function(){return this._source.serialize()},o.prototype.prepare=function(n){for(var s in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var p=this._tiles[s];p.upload(n),p.prepare(this.map.style.imageManager)}},o.prototype.getIds=function(){return u.values(this._tiles).map((function(n){return n.tileID})).sort(se).map((function(n){return n.key}))},o.prototype.getRenderableIds=function(n){var s=this,p=[];for(var f in this._tiles)this._isIdRenderable(f,n)&&p.push(this._tiles[f]);return n?p.sort((function(d,v){var w=d.tileID,A=v.tileID,D=new u.Point(w.canonical.x,w.canonical.y)._rotate(s.transform.angle),F=new u.Point(A.canonical.x,A.canonical.y)._rotate(s.transform.angle);return w.overscaledZ-A.overscaledZ||F.y-D.y||F.x-D.x})).map((function(d){return d.tileID.key})):p.map((function(d){return d.tileID})).sort(se).map((function(d){return d.key}))},o.prototype.hasRenderableParent=function(n){var s=this.findLoadedParent(n,0);return!!s&&this._isIdRenderable(s.tileID.key)},o.prototype._isIdRenderable=function(n,s){return this._tiles[n]&&this._tiles[n].hasData()&&!this._coveredTiles[n]&&(s||!this._tiles[n].holdingForFade())},o.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var n in this._cache.reset(),this._tiles)this._tiles[n].state!=="errored"&&this._reloadTile(n,"reloading")},o.prototype._reloadTile=function(n,s){var p=this._tiles[n];p&&(p.state!=="loading"&&(p.state=s),this._loadTile(p,this._tileLoaded.bind(this,p,n,s)))},o.prototype._tileLoaded=function(n,s,p,f){if(f)return n.state="errored",void(f.status!==404?this._source.fire(new u.ErrorEvent(f,{tile:n})):this.update(this.transform));n.timeAdded=u.browser.now(),p==="expired"&&(n.refreshedUponExpiration=!0),this._setTileReloadTimer(s,n),this.getSource().type==="raster-dem"&&n.dem&&this._backfillDEM(n),this._state.initializeTileState(n,this.map?this.map.painter:null),this._source.fire(new u.Event("data",{dataType:"source",tile:n,coord:n.tileID}))},o.prototype._backfillDEM=function(n){for(var s=this.getRenderableIds(),p=0;p<s.length;p++){var f=s[p];if(n.neighboringTiles&&n.neighboringTiles[f]){var d=this.getTileByID(f);v(n,d),v(d,n)}}function v(w,A){w.needsHillshadePrepare=!0;var D=A.tileID.canonical.x-w.tileID.canonical.x,F=A.tileID.canonical.y-w.tileID.canonical.y,O=Math.pow(2,w.tileID.canonical.z),W=A.tileID.key;D===0&&F===0||Math.abs(F)>1||(Math.abs(D)>1&&(Math.abs(D+O)===1?D+=O:Math.abs(D-O)===1&&(D-=O)),A.dem&&w.dem&&(w.dem.backfillBorder(A.dem,D,F),w.neighboringTiles&&w.neighboringTiles[W]&&(w.neighboringTiles[W].backfilled=!0)))}},o.prototype.getTile=function(n){return this.getTileByID(n.key)},o.prototype.getTileByID=function(n){return this._tiles[n]},o.prototype._retainLoadedChildren=function(n,s,p,f){for(var d in this._tiles){var v=this._tiles[d];if(!(f[d]||!v.hasData()||v.tileID.overscaledZ<=s||v.tileID.overscaledZ>p)){for(var w=v.tileID;v&&v.tileID.overscaledZ>s+1;){var A=v.tileID.scaledTo(v.tileID.overscaledZ-1);(v=this._tiles[A.key])&&v.hasData()&&(w=A)}for(var D=w;D.overscaledZ>s;)if(n[(D=D.scaledTo(D.overscaledZ-1)).key]){f[w.key]=w;break}}}},o.prototype.findLoadedParent=function(n,s){if(n.key in this._loadedParentTiles){var p=this._loadedParentTiles[n.key];return p&&p.tileID.overscaledZ>=s?p:null}for(var f=n.overscaledZ-1;f>=s;f--){var d=n.scaledTo(f),v=this._getLoadedTile(d);if(v)return v}},o.prototype._getLoadedTile=function(n){var s=this._tiles[n.key];return s&&s.hasData()?s:this._cache.getByKey(n.wrapped().key)},o.prototype.updateCacheSize=function(n){var s=Math.ceil(n.width/this._source.tileSize)+1,p=Math.ceil(n.height/this._source.tileSize)+1,f=Math.floor(s*p*5),d=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,f):f;this._cache.setMaxSize(d)},o.prototype.handleWrapJump=function(n){var s=Math.round((n-(this._prevLng===void 0?n:this._prevLng))/360);if(this._prevLng=n,s){var p={};for(var f in this._tiles){var d=this._tiles[f];d.tileID=d.tileID.unwrapTo(d.tileID.wrap+s),p[d.tileID.key]=d}for(var v in this._tiles=p,this._timers)clearTimeout(this._timers[v]),delete this._timers[v];for(var w in this._tiles)this._setTileReloadTimer(w,this._tiles[w])}},o.prototype.update=function(n){var s=this;if(this.transform=n,this._sourceLoaded&&!this._paused){var p;this.updateCacheSize(n),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?p=n.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(Ie){return new u.OverscaledTileID(Ie.canonical.z,Ie.wrap,Ie.canonical.z,Ie.canonical.x,Ie.canonical.y)})):(p=n.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(p=p.filter((function(Ie){return s._source.hasTile(Ie)})))):p=[];var f=n.coveringZoomLevel(this._source),d=Math.max(f-o.maxOverzooming,this._source.minzoom),v=Math.max(f+o.maxUnderzooming,this._source.minzoom),w=this._updateRetainedTiles(p,f);if(Se(this._source.type)){for(var A={},D={},F=0,O=Object.keys(w);F<O.length;F+=1){var W=O[F],$=w[W],ee=this._tiles[W];if(ee&&!(ee.fadeEndTime&&ee.fadeEndTime<=u.browser.now())){var N=this.findLoadedParent($,d);N&&(this._addTile(N.tileID),A[N.tileID.key]=N.tileID),D[W]=$}}for(var Q in this._retainLoadedChildren(D,f,v,w),A)w[Q]||(this._coveredTiles[Q]=!0,w[Q]=A[Q])}for(var ne in w)this._tiles[ne].clearFadeHold();for(var ue=0,de=u.keysDifference(this._tiles,w);ue<de.length;ue+=1){var pe=de[ue],ye=this._tiles[pe];ye.hasSymbolBuckets&&!ye.holdingForFade()?ye.setHoldDuration(this.map._fadeDuration):ye.hasSymbolBuckets&&!ye.symbolFadeFinished()||this._removeTile(pe)}this._updateLoadedParentTileCache()}},o.prototype.releaseSymbolFadeTiles=function(){for(var n in this._tiles)this._tiles[n].holdingForFade()&&this._removeTile(n)},o.prototype._updateRetainedTiles=function(n,s){for(var p={},f={},d=Math.max(s-o.maxOverzooming,this._source.minzoom),v=Math.max(s+o.maxUnderzooming,this._source.minzoom),w={},A=0,D=n;A<D.length;A+=1){var F=D[A],O=this._addTile(F);p[F.key]=F,O.hasData()||s<this._source.maxzoom&&(w[F.key]=F)}this._retainLoadedChildren(w,s,v,p);for(var W=0,$=n;W<$.length;W+=1){var ee=$[W],N=this._tiles[ee.key];if(!N.hasData()){if(s+1>this._source.maxzoom){var Q=ee.children(this._source.maxzoom)[0],ne=this.getTile(Q);if(ne&&ne.hasData()){p[Q.key]=Q;continue}}else{var ue=ee.children(this._source.maxzoom);if(p[ue[0].key]&&p[ue[1].key]&&p[ue[2].key]&&p[ue[3].key])continue}for(var de=N.wasRequested(),pe=ee.overscaledZ-1;pe>=d;--pe){var ye=ee.scaledTo(pe);if(f[ye.key]||(f[ye.key]=!0,!(N=this.getTile(ye))&&de&&(N=this._addTile(ye)),N&&(p[ye.key]=ye,de=N.wasRequested(),N.hasData())))break}}}return p},o.prototype._updateLoadedParentTileCache=function(){for(var n in this._loadedParentTiles={},this._tiles){for(var s=[],p=void 0,f=this._tiles[n].tileID;f.overscaledZ>0;){if(f.key in this._loadedParentTiles){p=this._loadedParentTiles[f.key];break}s.push(f.key);var d=f.scaledTo(f.overscaledZ-1);if(p=this._getLoadedTile(d))break;f=d}for(var v=0,w=s;v<w.length;v+=1)this._loadedParentTiles[w[v]]=p}},o.prototype._addTile=function(n){var s=this._tiles[n.key];if(s)return s;(s=this._cache.getAndRemove(n))&&(this._setTileReloadTimer(n.key,s),s.tileID=n,this._state.initializeTileState(s,this.map?this.map.painter:null),this._cacheTimers[n.key]&&(clearTimeout(this._cacheTimers[n.key]),delete this._cacheTimers[n.key],this._setTileReloadTimer(n.key,s)));var p=!!s;return p||(s=new u.Tile(n,this._source.tileSize*n.overscaleFactor()),this._loadTile(s,this._tileLoaded.bind(this,s,n.key,s.state))),s?(s.uses++,this._tiles[n.key]=s,p||this._source.fire(new u.Event("dataloading",{tile:s,coord:s.tileID,dataType:"source"})),s):null},o.prototype._setTileReloadTimer=function(n,s){var p=this;n in this._timers&&(clearTimeout(this._timers[n]),delete this._timers[n]);var f=s.getExpiryTimeout();f&&(this._timers[n]=setTimeout((function(){p._reloadTile(n,"expired"),delete p._timers[n]}),f))},o.prototype._removeTile=function(n){var s=this._tiles[n];s&&(s.uses--,delete this._tiles[n],this._timers[n]&&(clearTimeout(this._timers[n]),delete this._timers[n]),s.uses>0||(s.hasData()&&s.state!=="reloading"?this._cache.add(s.tileID,s,s.getExpiryTimeout()):(s.aborted=!0,this._abortTile(s),this._unloadTile(s))))},o.prototype.clearTiles=function(){for(var n in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(n);this._cache.reset()},o.prototype.tilesIn=function(n,s,p){var f=this,d=[],v=this.transform;if(!v)return d;for(var w=p?v.getCameraQueryGeometry(n):n,A=n.map((function(pe){return v.pointCoordinate(pe)})),D=w.map((function(pe){return v.pointCoordinate(pe)})),F=this.getIds(),O=1/0,W=1/0,$=-1/0,ee=-1/0,N=0,Q=D;N<Q.length;N+=1){var ne=Q[N];O=Math.min(O,ne.x),W=Math.min(W,ne.y),$=Math.max($,ne.x),ee=Math.max(ee,ne.y)}for(var ue=function(pe){var ye=f._tiles[F[pe]];if(!ye.holdingForFade()){var Ie=ye.tileID,Me=Math.pow(2,v.zoom-ye.tileID.overscaledZ),Ce=s*ye.queryPadding*u.EXTENT/ye.tileSize/Me,$e=[Ie.getTilePoint(new u.MercatorCoordinate(O,W)),Ie.getTilePoint(new u.MercatorCoordinate($,ee))];if($e[0].x-Ce<u.EXTENT&&$e[0].y-Ce<u.EXTENT&&$e[1].x+Ce>=0&&$e[1].y+Ce>=0){var nt=A.map((function(st){return Ie.getTilePoint(st)})),ut=D.map((function(st){return Ie.getTilePoint(st)}));d.push({tile:ye,tileID:Ie,queryGeometry:nt,cameraQueryGeometry:ut,scale:Me})}}},de=0;de<F.length;de++)ue(de);return d},o.prototype.getVisibleCoordinates=function(n){for(var s=this,p=this.getRenderableIds(n).map((function(w){return s._tiles[w].tileID})),f=0,d=p;f<d.length;f+=1){var v=d[f];v.posMatrix=this.transform.calculatePosMatrix(v.toUnwrapped())}return p},o.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Se(this._source.type))for(var n in this._tiles){var s=this._tiles[n];if(s.fadeEndTime!==void 0&&s.fadeEndTime>=u.browser.now())return!0}return!1},o.prototype.setFeatureState=function(n,s,p){this._state.updateState(n=n||"_geojsonTileLayer",s,p)},o.prototype.removeFeatureState=function(n,s,p){this._state.removeFeatureState(n=n||"_geojsonTileLayer",s,p)},o.prototype.getFeatureState=function(n,s){return this._state.getState(n=n||"_geojsonTileLayer",s)},o.prototype.setDependencies=function(n,s,p){var f=this._tiles[n];f&&f.setDependencies(s,p)},o.prototype.reloadTilesForDependencies=function(n,s){for(var p in this._tiles)this._tiles[p].hasDependency(n,s)&&this._reloadTile(p,"reloading");this._cache.filter((function(f){return!f.hasDependency(n,s)}))},o})(u.Evented);function se(i,o){var n=Math.abs(2*i.wrap)-+(i.wrap<0),s=Math.abs(2*o.wrap)-+(o.wrap<0);return i.overscaledZ-o.overscaledZ||s-n||o.canonical.y-i.canonical.y||o.canonical.x-i.canonical.x}function Se(i){return i==="raster"||i==="image"||i==="video"}function Ee(){return new u.window.Worker(gs.workerUrl)}H.maxOverzooming=10,H.maxUnderzooming=3;var me="mapboxgl_preloaded_worker_pool",Ae=function(){this.active={}};Ae.prototype.acquire=function(i){if(!this.workers)for(this.workers=[];this.workers.length<Ae.workerCount;)this.workers.push(new Ee);return this.active[i]=!0,this.workers.slice()},Ae.prototype.release=function(i){delete this.active[i],this.numActive()===0&&(this.workers.forEach((function(o){o.terminate()})),this.workers=null)},Ae.prototype.isPreloaded=function(){return!!this.active[me]},Ae.prototype.numActive=function(){return Object.keys(this.active).length};var Je,Ze=Math.floor(u.browser.hardwareConcurrency/2);function ge(){return Je||(Je=new Ae),Je}function Ne(i,o){var n={};for(var s in i)s!=="ref"&&(n[s]=i[s]);return u.refProperties.forEach((function(p){p in o&&(n[p]=o[p])})),n}function ze(i){i=i.slice();for(var o=Object.create(null),n=0;n<i.length;n++)o[i[n].id]=i[n];for(var s=0;s<i.length;s++)"ref"in i[s]&&(i[s]=Ne(i[s],o[i[s].ref]));return i}Ae.workerCount=Math.max(Math.min(Ze,6),1);var Be={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"};function yt(i,o,n){n.push({command:Be.addSource,args:[i,o[i]]})}function qe(i,o,n){o.push({command:Be.removeSource,args:[i]}),n[i]=!0}function Et(i,o,n,s){qe(i,n,s),yt(i,o,n)}function rr(i,o,n){var s;for(s in i[n])if(i[n].hasOwnProperty(s)&&s!=="data"&&!u.deepEqual(i[n][s],o[n][s]))return!1;for(s in o[n])if(o[n].hasOwnProperty(s)&&s!=="data"&&!u.deepEqual(i[n][s],o[n][s]))return!1;return!0}function Pt(i,o,n,s,p,f){var d;for(d in o=o||{},i=i||{})i.hasOwnProperty(d)&&(u.deepEqual(i[d],o[d])||n.push({command:f,args:[s,d,o[d],p]}));for(d in o)o.hasOwnProperty(d)&&!i.hasOwnProperty(d)&&(u.deepEqual(i[d],o[d])||n.push({command:f,args:[s,d,o[d],p]}))}function Gt(i){return i.id}function Dt(i,o){return i[o.id]=o,i}var wi=function(i,o){this.reset(i,o)};wi.prototype.reset=function(i,o){this.points=i||[],this._distances=[0];for(var n=1;n<this.points.length;n++)this._distances[n]=this._distances[n-1]+this.points[n].dist(this.points[n-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},wi.prototype.lerp=function(i){if(this.points.length===1)return this.points[0];i=u.clamp(i,0,1);for(var o=1,n=this._distances[o],s=i*this.paddedLength+this.padding;n<s&&o<this._distances.length;)n=this._distances[++o];var p=o-1,f=this._distances[p],d=n-f,v=d>0?(s-f)/d:0;return this.points[p].mult(1-v).add(this.points[o].mult(v))};var Ht=function(i,o,n){var s=this.boxCells=[],p=this.circleCells=[];this.xCellCount=Math.ceil(i/n),this.yCellCount=Math.ceil(o/n);for(var f=0;f<this.xCellCount*this.yCellCount;f++)s.push([]),p.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=i,this.height=o,this.xScale=this.xCellCount/i,this.yScale=this.yCellCount/o,this.boxUid=0,this.circleUid=0};function Pr(i,o,n,s,p){var f=u.create();return o?(u.scale(f,f,[1/p,1/p,1]),n||u.rotateZ(f,f,s.angle)):u.multiply(f,s.labelPlaneMatrix,i),f}function Qt(i,o,n,s,p){if(o){var f=u.clone(i);return u.scale(f,f,[p,p,1]),n||u.rotateZ(f,f,-s.angle),f}return s.glCoordMatrix}function Bt(i,o){var n=[i.x,i.y,0,1];oi(n,n,o);var s=n[3];return{point:new u.Point(n[0]/s,n[1]/s),signedDistanceFromCamera:s}}function Zt(i,o){return .5+i/o*.5}function zi(i,o){var n=i[0]/i[3],s=i[1]/i[3];return n>=-o[0]&&n<=o[0]&&s>=-o[1]&&s<=o[1]}function ma(i,o,n,s,p,f,d,v){var w=s?i.textSizeData:i.iconSizeData,A=u.evaluateSizeForZoom(w,n.transform.zoom),D=[256/n.width*2+1,256/n.height*2+1],F=s?i.text.dynamicLayoutVertexArray:i.icon.dynamicLayoutVertexArray;F.clear();for(var O=i.lineVertexArray,W=s?i.text.placedSymbolArray:i.icon.placedSymbolArray,$=n.transform.width/n.transform.height,ee=!1,N=0;N<W.length;N++){var Q=W.get(N);if(Q.hidden||Q.writingMode===u.WritingMode.vertical&&!ee)Si(Q.numGlyphs,F);else{ee=!1;var ne=[Q.anchorX,Q.anchorY,0,1];if(u.transformMat4(ne,ne,o),zi(ne,D)){var ue=Zt(n.transform.cameraToCenterDistance,ne[3]),de=u.evaluateSizeForFeature(w,A,Q),pe=d?de/ue:de*ue,ye=new u.Point(Q.anchorX,Q.anchorY),Ie=Bt(ye,p).point,Me={},Ce=eu(Q,pe,!1,v,o,p,f,i.glyphOffsetArray,O,F,Ie,ye,Me,$);ee=Ce.useVertical,(Ce.notEnoughRoom||ee||Ce.needsFlipping&&eu(Q,pe,!0,v,o,p,f,i.glyphOffsetArray,O,F,Ie,ye,Me,$).notEnoughRoom)&&Si(Q.numGlyphs,F)}else Si(Q.numGlyphs,F)}}s?i.text.dynamicLayoutVertexBuffer.updateData(F):i.icon.dynamicLayoutVertexBuffer.updateData(F)}function ni(i,o,n,s,p,f,d,v,w,A,D){var F=v.glyphStartIndex+v.numGlyphs,O=v.lineStartIndex,W=v.lineStartIndex+v.lineLength,$=o.getoffsetX(v.glyphStartIndex),ee=o.getoffsetX(F-1),N=Cr(i*$,n,s,p,f,d,v.segment,O,W,w,A,D);if(!N)return null;var Q=Cr(i*ee,n,s,p,f,d,v.segment,O,W,w,A,D);return Q?{first:N,last:Q}:null}function Di(i,o,n,s){return i===u.WritingMode.horizontal&&Math.abs(n.y-o.y)>Math.abs(n.x-o.x)*s?{useVertical:!0}:(i===u.WritingMode.vertical?o.y<n.y:o.x>n.x)?{needsFlipping:!0}:null}function eu(i,o,n,s,p,f,d,v,w,A,D,F,O,W){var $,ee=o/24,N=i.lineOffsetX*ee,Q=i.lineOffsetY*ee;if(i.numGlyphs>1){var ne=i.glyphStartIndex+i.numGlyphs,ue=i.lineStartIndex,de=i.lineStartIndex+i.lineLength,pe=ni(ee,v,N,Q,n,D,F,i,w,f,O);if(!pe)return{notEnoughRoom:!0};var ye=Bt(pe.first.point,d).point,Ie=Bt(pe.last.point,d).point;if(s&&!n){var Me=Di(i.writingMode,ye,Ie,W);if(Me)return Me}$=[pe.first];for(var Ce=i.glyphStartIndex+1;Ce<ne-1;Ce++)$.push(Cr(ee*v.getoffsetX(Ce),N,Q,n,D,F,i.segment,ue,de,w,f,O));$.push(pe.last)}else{if(s&&!n){var $e=Bt(F,p).point,nt=i.lineStartIndex+i.segment+1,ut=new u.Point(w.getx(nt),w.gety(nt)),st=Bt(ut,p),Lt=st.signedDistanceFromCamera>0?st.point:ya(F,ut,$e,1,p),He=Di(i.writingMode,$e,Lt,W);if(He)return He}var mt=Cr(ee*v.getoffsetX(i.glyphStartIndex),N,Q,n,D,F,i.segment,i.lineStartIndex,i.lineStartIndex+i.lineLength,w,f,O);if(!mt)return{notEnoughRoom:!0};$=[mt]}for(var xt=0,dt=$;xt<dt.length;xt+=1){var ft=dt[xt];u.addDynamicAttributes(A,ft.point,ft.angle)}return{}}function ya(i,o,n,s,p){var f=Bt(i.add(i.sub(o)._unit()),p).point,d=n.sub(f);return n.add(d._mult(s/d.mag()))}function Cr(i,o,n,s,p,f,d,v,w,A,D,F){var O=s?i-o:i+o,W=O>0?1:-1,$=0;s&&(W*=-1,$=Math.PI),W<0&&($+=Math.PI);for(var ee=W>0?v+d:v+d+1,N=p,Q=p,ne=0,ue=0,de=Math.abs(O),pe=[];ne+ue<=de;){if((ee+=W)<v||ee>=w)return null;if(Q=N,pe.push(N),(N=F[ee])===void 0){var ye=new u.Point(A.getx(ee),A.gety(ee)),Ie=Bt(ye,D);if(Ie.signedDistanceFromCamera>0)N=F[ee]=Ie.point;else{var Me=ee-W;N=ya(ne===0?f:new u.Point(A.getx(Me),A.gety(Me)),ye,Q,de-ne+1,D)}}ne+=ue,ue=Q.dist(N)}var Ce=(de-ne)/ue,$e=N.sub(Q),nt=$e.mult(Ce)._add(Q);nt._add($e._unit()._perp()._mult(n*W));var ut=$+Math.atan2(N.y-Q.y,N.x-Q.x);return pe.push(nt),{point:nt,angle:ut,path:pe}}Ht.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Ht.prototype.insert=function(i,o,n,s,p){this._forEachCell(o,n,s,p,this._insertBoxCell,this.boxUid++),this.boxKeys.push(i),this.bboxes.push(o),this.bboxes.push(n),this.bboxes.push(s),this.bboxes.push(p)},Ht.prototype.insertCircle=function(i,o,n,s){this._forEachCell(o-s,n-s,o+s,n+s,this._insertCircleCell,this.circleUid++),this.circleKeys.push(i),this.circles.push(o),this.circles.push(n),this.circles.push(s)},Ht.prototype._insertBoxCell=function(i,o,n,s,p,f){this.boxCells[p].push(f)},Ht.prototype._insertCircleCell=function(i,o,n,s,p,f){this.circleCells[p].push(f)},Ht.prototype._query=function(i,o,n,s,p,f){if(n<0||i>this.width||s<0||o>this.height)return!p&&[];var d=[];if(i<=0&&o<=0&&this.width<=n&&this.height<=s){if(p)return!0;for(var v=0;v<this.boxKeys.length;v++)d.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(var w=0;w<this.circleKeys.length;w++){var A=this.circles[3*w],D=this.circles[3*w+1],F=this.circles[3*w+2];d.push({key:this.circleKeys[w],x1:A-F,y1:D-F,x2:A+F,y2:D+F})}return f?d.filter(f):d}return this._forEachCell(i,o,n,s,this._queryCell,d,{hitTest:p,seenUids:{box:{},circle:{}}},f),p?d.length>0:d},Ht.prototype._queryCircle=function(i,o,n,s,p){var f=i-n,d=i+n,v=o-n,w=o+n;if(d<0||f>this.width||w<0||v>this.height)return!s&&[];var A=[];return this._forEachCell(f,v,d,w,this._queryCellCircle,A,{hitTest:s,circle:{x:i,y:o,radius:n},seenUids:{box:{},circle:{}}},p),s?A.length>0:A},Ht.prototype.query=function(i,o,n,s,p){return this._query(i,o,n,s,!1,p)},Ht.prototype.hitTest=function(i,o,n,s,p){return this._query(i,o,n,s,!0,p)},Ht.prototype.hitTestCircle=function(i,o,n,s){return this._queryCircle(i,o,n,!0,s)},Ht.prototype._queryCell=function(i,o,n,s,p,f,d,v){var w=d.seenUids,A=this.boxCells[p];if(A!==null)for(var D=this.bboxes,F=0,O=A;F<O.length;F+=1){var W=O[F];if(!w.box[W]){w.box[W]=!0;var $=4*W;if(i<=D[$+2]&&o<=D[$+3]&&n>=D[$+0]&&s>=D[$+1]&&(!v||v(this.boxKeys[W]))){if(d.hitTest)return f.push(!0),!0;f.push({key:this.boxKeys[W],x1:D[$],y1:D[$+1],x2:D[$+2],y2:D[$+3]})}}}var ee=this.circleCells[p];if(ee!==null)for(var N=this.circles,Q=0,ne=ee;Q<ne.length;Q+=1){var ue=ne[Q];if(!w.circle[ue]){w.circle[ue]=!0;var de=3*ue;if(this._circleAndRectCollide(N[de],N[de+1],N[de+2],i,o,n,s)&&(!v||v(this.circleKeys[ue]))){if(d.hitTest)return f.push(!0),!0;var pe=N[de],ye=N[de+1],Ie=N[de+2];f.push({key:this.circleKeys[ue],x1:pe-Ie,y1:ye-Ie,x2:pe+Ie,y2:ye+Ie})}}}},Ht.prototype._queryCellCircle=function(i,o,n,s,p,f,d,v){var w=d.circle,A=d.seenUids,D=this.boxCells[p];if(D!==null)for(var F=this.bboxes,O=0,W=D;O<W.length;O+=1){var $=W[O];if(!A.box[$]){A.box[$]=!0;var ee=4*$;if(this._circleAndRectCollide(w.x,w.y,w.radius,F[ee+0],F[ee+1],F[ee+2],F[ee+3])&&(!v||v(this.boxKeys[$])))return f.push(!0),!0}}var N=this.circleCells[p];if(N!==null)for(var Q=this.circles,ne=0,ue=N;ne<ue.length;ne+=1){var de=ue[ne];if(!A.circle[de]){A.circle[de]=!0;var pe=3*de;if(this._circlesCollide(Q[pe],Q[pe+1],Q[pe+2],w.x,w.y,w.radius)&&(!v||v(this.circleKeys[de])))return f.push(!0),!0}}},Ht.prototype._forEachCell=function(i,o,n,s,p,f,d,v){for(var w=this._convertToXCellCoord(i),A=this._convertToYCellCoord(o),D=this._convertToXCellCoord(n),F=this._convertToYCellCoord(s),O=w;O<=D;O++)for(var W=A;W<=F;W++)if(p.call(this,i,o,n,s,this.xCellCount*W+O,f,d,v))return},Ht.prototype._convertToXCellCoord=function(i){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(i*this.xScale)))},Ht.prototype._convertToYCellCoord=function(i){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(i*this.yScale)))},Ht.prototype._circlesCollide=function(i,o,n,s,p,f){var d=s-i,v=p-o,w=n+f;return w*w>d*d+v*v},Ht.prototype._circleAndRectCollide=function(i,o,n,s,p,f,d){var v=(f-s)/2,w=Math.abs(i-(s+v));if(w>v+n)return!1;var A=(d-p)/2,D=Math.abs(o-(p+A));if(D>A+n)return!1;if(w<=v||D<=A)return!0;var F=w-v,O=D-A;return F*F+O*O<=n*n};var va=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Si(i,o){for(var n=0;n<i;n++){var s=o.length;o.resize(s+4),o.float32.set(va,3*s)}}function oi(i,o,n){var s=o[0],p=o[1];return i[0]=n[0]*s+n[4]*p+n[12],i[1]=n[1]*s+n[5]*p+n[13],i[3]=n[3]*s+n[7]*p+n[15],i}var nn=function(i,o,n){o===void 0&&(o=new Ht(i.width+200,i.height+200,25)),n===void 0&&(n=new Ht(i.width+200,i.height+200,25)),this.transform=i,this.grid=o,this.ignoredGrid=n,this.pitchfactor=Math.cos(i._pitch)*i.cameraToCenterDistance,this.screenRightBoundary=i.width+100,this.screenBottomBoundary=i.height+100,this.gridRightBoundary=i.width+200,this.gridBottomBoundary=i.height+200};function yr(i,o,n){return o*(u.EXTENT/(i.tileSize*Math.pow(2,n-i.tileID.overscaledZ)))}nn.prototype.placeCollisionBox=function(i,o,n,s,p){var f=this.projectAndGetPerspectiveRatio(s,i.anchorPointX,i.anchorPointY),d=n*f.perspectiveRatio,v=i.x1*d+f.point.x,w=i.y1*d+f.point.y,A=i.x2*d+f.point.x,D=i.y2*d+f.point.y;return!this.isInsideGrid(v,w,A,D)||!o&&this.grid.hitTest(v,w,A,D,p)?{box:[],offscreen:!1}:{box:[v,w,A,D],offscreen:this.isOffscreen(v,w,A,D)}},nn.prototype.placeCollisionCircles=function(i,o,n,s,p,f,d,v,w,A,D,F,O){var W=[],$=new u.Point(o.anchorX,o.anchorY),ee=Bt($,f),N=Zt(this.transform.cameraToCenterDistance,ee.signedDistanceFromCamera),Q=(A?p/N:p*N)/u.ONE_EM,ne=Bt($,d).point,ue=ni(Q,s,o.lineOffsetX*Q,o.lineOffsetY*Q,!1,ne,$,o,n,d,{}),de=!1,pe=!1,ye=!0;if(ue){for(var Ie=.5*F*N+O,Me=new u.Point(-100,-100),Ce=new u.Point(this.screenRightBoundary,this.screenBottomBoundary),$e=new wi,nt=ue.first,ut=ue.last,st=[],Lt=nt.path.length-1;Lt>=1;Lt--)st.push(nt.path[Lt]);for(var He=1;He<ut.path.length;He++)st.push(ut.path[He]);var mt=2.5*Ie;if(v){var xt=st.map((function(cn){return Bt(cn,v)}));st=xt.some((function(cn){return cn.signedDistanceFromCamera<=0}))?[]:xt.map((function(cn){return cn.point}))}var dt=[];if(st.length>0){for(var ft=st[0].clone(),gt=st[0].clone(),ht=1;ht<st.length;ht++)ft.x=Math.min(ft.x,st[ht].x),ft.y=Math.min(ft.y,st[ht].y),gt.x=Math.max(gt.x,st[ht].x),gt.y=Math.max(gt.y,st[ht].y);dt=ft.x>=Me.x&&gt.x<=Ce.x&&ft.y>=Me.y&&gt.y<=Ce.y?[st]:gt.x<Me.x||ft.x>Ce.x||gt.y<Me.y||ft.y>Ce.y?[]:u.clipLine([st],Me.x,Me.y,Ce.x,Ce.y)}for(var ct=0,Jr=dt;ct<Jr.length;ct+=1){var Ir;$e.reset(Jr[ct],.25*Ie),Ir=$e.length<=.5*Ie?1:Math.ceil($e.paddedLength/mt)+1;for(var gi=0;gi<Ir;gi++){var si=gi/Math.max(Ir-1,1),wr=$e.lerp(si),kr=wr.x+100,Wi=wr.y+100;W.push(kr,Wi,Ie,0);var Ei=kr-Ie,no=Wi-Ie,Ri=kr+Ie,wn=Wi+Ie;if(ye=ye&&this.isOffscreen(Ei,no,Ri,wn),pe=pe||this.isInsideGrid(Ei,no,Ri,wn),!i&&this.grid.hitTestCircle(kr,Wi,Ie,D)&&(de=!0,!w))return{circles:[],offscreen:!1,collisionDetected:de}}}}return{circles:!w&&de||!pe?[]:W,offscreen:ye,collisionDetected:de}},nn.prototype.queryRenderedSymbols=function(i){if(i.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};for(var o=[],n=1/0,s=1/0,p=-1/0,f=-1/0,d=0,v=i;d<v.length;d+=1){var w=v[d],A=new u.Point(w.x+100,w.y+100);n=Math.min(n,A.x),s=Math.min(s,A.y),p=Math.max(p,A.x),f=Math.max(f,A.y),o.push(A)}for(var D={},F={},O=0,W=this.grid.query(n,s,p,f).concat(this.ignoredGrid.query(n,s,p,f));O<W.length;O+=1){var $=W[O],ee=$.key;if(D[ee.bucketInstanceId]===void 0&&(D[ee.bucketInstanceId]={}),!D[ee.bucketInstanceId][ee.featureIndex]){var N=[new u.Point($.x1,$.y1),new u.Point($.x2,$.y1),new u.Point($.x2,$.y2),new u.Point($.x1,$.y2)];u.polygonIntersectsPolygon(o,N)&&(D[ee.bucketInstanceId][ee.featureIndex]=!0,F[ee.bucketInstanceId]===void 0&&(F[ee.bucketInstanceId]=[]),F[ee.bucketInstanceId].push(ee.featureIndex))}}return F},nn.prototype.insertCollisionBox=function(i,o,n,s,p){(o?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:s,collisionGroupID:p},i[0],i[1],i[2],i[3])},nn.prototype.insertCollisionCircles=function(i,o,n,s,p){for(var f=o?this.ignoredGrid:this.grid,d={bucketInstanceId:n,featureIndex:s,collisionGroupID:p},v=0;v<i.length;v+=4)f.insertCircle(d,i[v],i[v+1],i[v+2])},nn.prototype.projectAndGetPerspectiveRatio=function(i,o,n){var s=[o,n,0,1];return oi(s,s,i),{point:new u.Point((s[0]/s[3]+1)/2*this.transform.width+100,(-s[1]/s[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/s[3]*.5}},nn.prototype.isOffscreen=function(i,o,n,s){return n<100||i>=this.screenRightBoundary||s<100||o>this.screenBottomBoundary},nn.prototype.isInsideGrid=function(i,o,n,s){return n>=0&&i<this.gridRightBoundary&&s>=0&&o<this.gridBottomBoundary},nn.prototype.getViewportMatrix=function(){var i=u.identity([]);return u.translate(i,i,[-100,-100,0]),i};var yn=function(i,o,n,s){this.opacity=i?Math.max(0,Math.min(1,i.opacity+(i.placed?o:-o))):s&&n?1:0,this.placed=n};yn.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var Ji=function(i,o,n,s,p){this.text=new yn(i?i.text:null,o,n,p),this.icon=new yn(i?i.icon:null,o,s,p)};Ji.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var il=function(i,o,n){this.text=i,this.icon=o,this.skipFade=n},on=function(){this.invProjMatrix=u.create(),this.viewportMatrix=u.create(),this.circles=[]},Pc=function(i,o,n,s,p){this.bucketInstanceId=i,this.featureIndex=o,this.sourceLayerIndex=n,this.bucketIndex=s,this.tileID=p},Dn=function(i){this.crossSourceCollisions=i,this.maxGroupID=0,this.collisionGroups={}};function di(i,o,n,s,p){var f=u.getAnchorAlignment(i),d=-(f.horizontalAlign-.5)*o,v=-(f.verticalAlign-.5)*n,w=u.evaluateVariableOffset(i,s);return new u.Point(d+w[0]*p,v+w[1]*p)}function In(i,o,n,s,p,f){var d=i.x1,v=i.x2,w=i.y1,A=i.y2,D=i.anchorPointX,F=i.anchorPointY,O=new u.Point(o,n);return s&&O._rotate(p?f:-f),{x1:d+O.x,y1:w+O.y,x2:v+O.x,y2:A+O.y,anchorPointX:D,anchorPointY:F}}Dn.prototype.get=function(i){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[i]){var o=++this.maxGroupID;this.collisionGroups[i]={ID:o,predicate:function(n){return n.collisionGroupID===o}}}return this.collisionGroups[i]};var Ii=function(i,o,n,s){this.transform=i.clone(),this.collisionIndex=new nn(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=o,this.retainedQueryData={},this.collisionGroups=new Dn(n),this.collisionCircleArrays={},this.prevPlacement=s,s&&(s.prevPlacement=void 0),this.placedOrientations={}};function vo(i,o,n,s,p){i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0)}Ii.prototype.getBucketParts=function(i,o,n,s){var p=n.getBucket(o),f=n.latestFeatureIndex;if(p&&f&&o.id===p.layerIds[0]){var d=n.collisionBoxArray,v=p.layers[0].layout,w=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),A=n.tileSize/u.EXTENT,D=this.transform.calculatePosMatrix(n.tileID.toUnwrapped()),F=v.get("text-pitch-alignment")==="map",O=v.get("text-rotation-alignment")==="map",W=yr(n,1,this.transform.zoom),$=Pr(D,F,O,this.transform,W),ee=null;if(F){var N=Qt(D,F,O,this.transform,W);ee=u.multiply([],this.transform.labelPlaneMatrix,N)}this.retainedQueryData[p.bucketInstanceId]=new Pc(p.bucketInstanceId,f,p.sourceLayerIndex,p.index,n.tileID);var Q={bucket:p,layout:v,posMatrix:D,textLabelPlaneMatrix:$,labelToScreenMatrix:ee,scale:w,textPixelRatio:A,holdingForFade:n.holdingForFade(),collisionBoxArray:d,partiallyEvaluatedTextSize:u.evaluateSizeForZoom(p.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(p.sourceID)};if(s)for(var ne=0,ue=p.sortKeyRanges;ne<ue.length;ne+=1){var de=ue[ne];i.push({sortKey:de.sortKey,symbolInstanceStart:de.symbolInstanceStart,symbolInstanceEnd:de.symbolInstanceEnd,parameters:Q})}else i.push({symbolInstanceStart:0,symbolInstanceEnd:p.symbolInstances.length,parameters:Q})}},Ii.prototype.attemptAnchorPlacement=function(i,o,n,s,p,f,d,v,w,A,D,F,O,W,$){var ee,N=[F.textOffset0,F.textOffset1],Q=di(i,n,s,N,p),ne=this.collisionIndex.placeCollisionBox(In(o,Q.x,Q.y,f,d,this.transform.angle),D,v,w,A.predicate);if(!$||this.collisionIndex.placeCollisionBox(In($,Q.x,Q.y,f,d,this.transform.angle),D,v,w,A.predicate).box.length!==0)return ne.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[F.crossTileID]&&this.prevPlacement.placements[F.crossTileID]&&this.prevPlacement.placements[F.crossTileID].text&&(ee=this.prevPlacement.variableOffsets[F.crossTileID].anchor),this.variableOffsets[F.crossTileID]={textOffset:N,width:n,height:s,anchor:i,textBoxScale:p,prevAnchor:ee},this.markUsedJustification(O,i,F,W),O.allowVerticalPlacement&&(this.markUsedOrientation(O,W,F),this.placedOrientations[F.crossTileID]=W),{shift:Q,placedGlyphBoxes:ne}):void 0},Ii.prototype.placeLayerBucketPart=function(i,o,n){var s=this,p=i.parameters,f=p.bucket,d=p.layout,v=p.posMatrix,w=p.textLabelPlaneMatrix,A=p.labelToScreenMatrix,D=p.textPixelRatio,F=p.holdingForFade,O=p.collisionBoxArray,W=p.partiallyEvaluatedTextSize,$=p.collisionGroup,ee=d.get("text-optional"),N=d.get("icon-optional"),Q=d.get("text-allow-overlap"),ne=d.get("icon-allow-overlap"),ue=d.get("text-rotation-alignment")==="map",de=d.get("text-pitch-alignment")==="map",pe=d.get("icon-text-fit")!=="none",ye=d.get("symbol-z-order")==="viewport-y",Ie=Q&&(ne||!f.hasIconData()||N),Me=ne&&(Q||!f.hasTextData()||ee);!f.collisionArrays&&O&&f.deserializeCollisionBoxes(O);var Ce=function(He,mt){if(!o[He.crossTileID])if(F)s.placements[He.crossTileID]=new il(!1,!1,!1);else{var xt,dt=!1,ft=!1,gt=!0,ht=null,ct={box:null,offscreen:null},Jr={box:null,offscreen:null},Ir=null,gi=null,si=0,wr=0,kr=0;mt.textFeatureIndex?si=mt.textFeatureIndex:He.useRuntimeCollisionCircles&&(si=He.featureIndex),mt.verticalTextFeatureIndex&&(wr=mt.verticalTextFeatureIndex);var Wi=mt.textBox;if(Wi){var Ei=function($t){var en=u.WritingMode.horizontal;if(f.allowVerticalPlacement&&!$t&&s.prevPlacement){var Li=s.prevPlacement.placedOrientations[He.crossTileID];Li&&(s.placedOrientations[He.crossTileID]=Li,s.markUsedOrientation(f,en=Li,He))}return en},no=function($t,en){if(f.allowVerticalPlacement&&He.numVerticalGlyphVertices>0&&mt.verticalTextBox)for(var Li=0,Ro=f.writingModes;Li<Ro.length&&(Ro[Li]===u.WritingMode.vertical?(ct=en(),Jr=ct):ct=$t(),!(ct&&ct.box&&ct.box.length));Li+=1);else ct=$t()};if(d.get("text-variable-anchor")){var Ri=d.get("text-variable-anchor");if(s.prevPlacement&&s.prevPlacement.variableOffsets[He.crossTileID]){var wn=s.prevPlacement.variableOffsets[He.crossTileID];Ri.indexOf(wn.anchor)>0&&(Ri=Ri.filter((function($t){return $t!==wn.anchor}))).unshift(wn.anchor)}var cn=function($t,en,Li){for(var Ro=$t.x2-$t.x1,Nc=$t.y2-$t.y1,_s=He.textBoxScale,jc=pe&&!ne?en:null,Oa={box:[],offscreen:!1},Dl=Q?2*Ri.length:Ri.length,aa=0;aa<Dl;++aa){var xs=s.attemptAnchorPlacement(Ri[aa%Ri.length],$t,Ro,Nc,_s,ue,de,D,v,$,aa>=Ri.length,He,f,Li,jc);if(xs&&(Oa=xs.placedGlyphBoxes)&&Oa.box&&Oa.box.length){dt=!0,ht=xs.shift;break}}return Oa};no((function(){return cn(Wi,mt.iconBox,u.WritingMode.horizontal)}),(function(){var $t=mt.verticalTextBox;return f.allowVerticalPlacement&&!(ct&&ct.box&&ct.box.length)&&He.numVerticalGlyphVertices>0&&$t?cn($t,mt.verticalIconBox,u.WritingMode.vertical):{box:null,offscreen:null}})),ct&&(dt=ct.box,gt=ct.offscreen);var Ra=Ei(ct&&ct.box);if(!dt&&s.prevPlacement){var na=s.prevPlacement.variableOffsets[He.crossTileID];na&&(s.variableOffsets[He.crossTileID]=na,s.markUsedJustification(f,na.anchor,He,Ra))}}else{var oo=function($t,en){var Li=s.collisionIndex.placeCollisionBox($t,Q,D,v,$.predicate);return Li&&Li.box&&Li.box.length&&(s.markUsedOrientation(f,en,He),s.placedOrientations[He.crossTileID]=en),Li};no((function(){return oo(Wi,u.WritingMode.horizontal)}),(function(){var $t=mt.verticalTextBox;return f.allowVerticalPlacement&&He.numVerticalGlyphVertices>0&&$t?oo($t,u.WritingMode.vertical):{box:null,offscreen:null}})),Ei(ct&&ct.box&&ct.box.length)}}if(dt=(xt=ct)&&xt.box&&xt.box.length>0,gt=xt&&xt.offscreen,He.useRuntimeCollisionCircles){var oa=f.text.placedSymbolArray.get(He.centerJustifiedTextSymbolIndex),La=u.evaluateSizeForFeature(f.textSizeData,W,oa),Pn=d.get("text-padding");Ir=s.collisionIndex.placeCollisionCircles(Q,oa,f.lineVertexArray,f.glyphOffsetArray,La,v,w,A,n,de,$.predicate,He.collisionCircleDiameter,Pn),dt=Q||Ir.circles.length>0&&!Ir.collisionDetected,gt=gt&&Ir.offscreen}if(mt.iconFeatureIndex&&(kr=mt.iconFeatureIndex),mt.iconBox){var Fa=function($t){var en=pe&&ht?In($t,ht.x,ht.y,ue,de,s.transform.angle):$t;return s.collisionIndex.placeCollisionBox(en,ne,D,v,$.predicate)};ft=Jr&&Jr.box&&Jr.box.length&&mt.verticalIconBox?(gi=Fa(mt.verticalIconBox)).box.length>0:(gi=Fa(mt.iconBox)).box.length>0,gt=gt&&gi.offscreen}var Cn=ee||He.numHorizontalGlyphVertices===0&&He.numVerticalGlyphVertices===0,Yr=N||He.numIconVertices===0;if(Cn||Yr?Yr?Cn||(ft=ft&&dt):dt=ft&&dt:ft=dt=ft&&dt,dt&&xt&&xt.box&&s.collisionIndex.insertCollisionBox(xt.box,d.get("text-ignore-placement"),f.bucketInstanceId,Jr&&Jr.box&&wr?wr:si,$.ID),ft&&gi&&s.collisionIndex.insertCollisionBox(gi.box,d.get("icon-ignore-placement"),f.bucketInstanceId,kr,$.ID),Ir&&(dt&&s.collisionIndex.insertCollisionCircles(Ir.circles,d.get("text-ignore-placement"),f.bucketInstanceId,si,$.ID),n)){var On=f.bucketInstanceId,ao=s.collisionCircleArrays[On];ao===void 0&&(ao=s.collisionCircleArrays[On]=new on);for(var Do=0;Do<Ir.circles.length;Do+=4)ao.circles.push(Ir.circles[Do+0]),ao.circles.push(Ir.circles[Do+1]),ao.circles.push(Ir.circles[Do+2]),ao.circles.push(Ir.collisionDetected?1:0)}s.placements[He.crossTileID]=new il(dt||Ie,ft||Me,gt||f.justReloaded),o[He.crossTileID]=!0}};if(ye)for(var $e=f.getSortedSymbolIndexes(this.transform.angle),nt=$e.length-1;nt>=0;--nt){var ut=$e[nt];Ce(f.symbolInstances.get(ut),f.collisionArrays[ut])}else for(var st=i.symbolInstanceStart;st<i.symbolInstanceEnd;st++)Ce(f.symbolInstances.get(st),f.collisionArrays[st]);if(n&&f.bucketInstanceId in this.collisionCircleArrays){var Lt=this.collisionCircleArrays[f.bucketInstanceId];u.invert(Lt.invProjMatrix,v),Lt.viewportMatrix=this.collisionIndex.getViewportMatrix()}f.justReloaded=!1},Ii.prototype.markUsedJustification=function(i,o,n,s){var p;p=s===u.WritingMode.vertical?n.verticalPlacedTextSymbolIndex:{left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex}[u.getAnchorJustification(o)];for(var f=0,d=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];f<d.length;f+=1){var v=d[f];v>=0&&(i.text.placedSymbolArray.get(v).crossTileID=p>=0&&v!==p?0:n.crossTileID)}},Ii.prototype.markUsedOrientation=function(i,o,n){for(var s=o===u.WritingMode.horizontal||o===u.WritingMode.horizontalOnly?o:0,p=o===u.WritingMode.vertical?o:0,f=0,d=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];f<d.length;f+=1)i.text.placedSymbolArray.get(d[f]).placedOrientation=s;n.verticalPlacedTextSymbolIndex&&(i.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=p)},Ii.prototype.commit=function(i){this.commitTime=i,this.zoomAtLastRecencyCheck=this.transform.zoom;var o=this.prevPlacement,n=!1;this.prevZoomAdjustment=o?o.zoomAdjustment(this.transform.zoom):0;var s=o?o.symbolFadeChange(i):1,p=o?o.opacities:{},f=o?o.variableOffsets:{},d=o?o.placedOrientations:{};for(var v in this.placements){var w=this.placements[v],A=p[v];A?(this.opacities[v]=new Ji(A,s,w.text,w.icon),n=n||w.text!==A.text.placed||w.icon!==A.icon.placed):(this.opacities[v]=new Ji(null,s,w.text,w.icon,w.skipFade),n=n||w.text||w.icon)}for(var D in p){var F=p[D];if(!this.opacities[D]){var O=new Ji(F,s,!1,!1);O.isHidden()||(this.opacities[D]=O,n=n||F.text.placed||F.icon.placed)}}for(var W in f)this.variableOffsets[W]||!this.opacities[W]||this.opacities[W].isHidden()||(this.variableOffsets[W]=f[W]);for(var $ in d)this.placedOrientations[$]||!this.opacities[$]||this.opacities[$].isHidden()||(this.placedOrientations[$]=d[$]);n?this.lastPlacementChangeTime=i:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=o?o.lastPlacementChangeTime:i)},Ii.prototype.updateLayerOpacities=function(i,o){for(var n={},s=0,p=o;s<p.length;s+=1){var f=p[s],d=f.getBucket(i);d&&f.latestFeatureIndex&&i.id===d.layerIds[0]&&this.updateBucketOpacities(d,n,f.collisionBoxArray)}},Ii.prototype.updateBucketOpacities=function(i,o,n){var s=this;i.hasTextData()&&i.text.opacityVertexArray.clear(),i.hasIconData()&&i.icon.opacityVertexArray.clear(),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexArray.clear(),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexArray.clear();var p=i.layers[0].layout,f=new Ji(null,0,!1,!1,!0),d=p.get("text-allow-overlap"),v=p.get("icon-allow-overlap"),w=p.get("text-variable-anchor"),A=p.get("text-rotation-alignment")==="map",D=p.get("text-pitch-alignment")==="map",F=p.get("icon-text-fit")!=="none",O=new Ji(null,0,d&&(v||!i.hasIconData()||p.get("icon-optional")),v&&(d||!i.hasTextData()||p.get("text-optional")),!0);!i.collisionArrays&&n&&(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData())&&i.deserializeCollisionBoxes(n);for(var W=function(Q,ne,ue){for(var de=0;de<ne/4;de++)Q.opacityVertexArray.emplaceBack(ue)},$=function(Q){var ne=i.symbolInstances.get(Q),ue=ne.numHorizontalGlyphVertices,de=ne.numVerticalGlyphVertices,pe=ne.crossTileID,ye=s.opacities[pe];o[pe]?ye=f:ye||(s.opacities[pe]=ye=O),o[pe]=!0;var Ie=ne.numIconVertices>0,Me=s.placedOrientations[ne.crossTileID],Ce=Me===u.WritingMode.vertical,$e=Me===u.WritingMode.horizontal||Me===u.WritingMode.horizontalOnly;if(ue>0||de>0){var nt=al(ye.text);W(i.text,ue,Ce?Wo:nt),W(i.text,de,$e?Wo:nt);var ut=ye.text.isHidden();[ne.rightJustifiedTextSymbolIndex,ne.centerJustifiedTextSymbolIndex,ne.leftJustifiedTextSymbolIndex].forEach((function(ct){ct>=0&&(i.text.placedSymbolArray.get(ct).hidden=ut||Ce?1:0)})),ne.verticalPlacedTextSymbolIndex>=0&&(i.text.placedSymbolArray.get(ne.verticalPlacedTextSymbolIndex).hidden=ut||$e?1:0);var st=s.variableOffsets[ne.crossTileID];st&&s.markUsedJustification(i,st.anchor,ne,Me);var Lt=s.placedOrientations[ne.crossTileID];Lt&&(s.markUsedJustification(i,"left",ne,Lt),s.markUsedOrientation(i,Lt,ne))}if(Ie){var He=al(ye.icon),mt=!(F&&ne.verticalPlacedIconSymbolIndex&&Ce);ne.placedIconSymbolIndex>=0&&(W(i.icon,ne.numIconVertices,mt?He:Wo),i.icon.placedSymbolArray.get(ne.placedIconSymbolIndex).hidden=ye.icon.isHidden()),ne.verticalPlacedIconSymbolIndex>=0&&(W(i.icon,ne.numVerticalIconVertices,mt?Wo:He),i.icon.placedSymbolArray.get(ne.verticalPlacedIconSymbolIndex).hidden=ye.icon.isHidden())}if(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData()){var xt=i.collisionArrays[Q];if(xt){var dt=new u.Point(0,0);if(xt.textBox||xt.verticalTextBox){var ft=!0;if(w){var gt=s.variableOffsets[pe];gt?(dt=di(gt.anchor,gt.width,gt.height,gt.textOffset,gt.textBoxScale),A&&dt._rotate(D?s.transform.angle:-s.transform.angle)):ft=!1}xt.textBox&&vo(i.textCollisionBox.collisionVertexArray,ye.text.placed,!ft||Ce,dt.x,dt.y),xt.verticalTextBox&&vo(i.textCollisionBox.collisionVertexArray,ye.text.placed,!ft||$e,dt.x,dt.y)}var ht=!!(!$e&&xt.verticalIconBox);xt.iconBox&&vo(i.iconCollisionBox.collisionVertexArray,ye.icon.placed,ht,F?dt.x:0,F?dt.y:0),xt.verticalIconBox&&vo(i.iconCollisionBox.collisionVertexArray,ye.icon.placed,!ht,F?dt.x:0,F?dt.y:0)}}},ee=0;ee<i.symbolInstances.length;ee++)$(ee);if(i.sortFeatures(this.transform.angle),this.retainedQueryData[i.bucketInstanceId]&&(this.retainedQueryData[i.bucketInstanceId].featureSortOrder=i.featureSortOrder),i.hasTextData()&&i.text.opacityVertexBuffer&&i.text.opacityVertexBuffer.updateData(i.text.opacityVertexArray),i.hasIconData()&&i.icon.opacityVertexBuffer&&i.icon.opacityVertexBuffer.updateData(i.icon.opacityVertexArray),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexBuffer&&i.iconCollisionBox.collisionVertexBuffer.updateData(i.iconCollisionBox.collisionVertexArray),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexBuffer&&i.textCollisionBox.collisionVertexBuffer.updateData(i.textCollisionBox.collisionVertexArray),i.bucketInstanceId in this.collisionCircleArrays){var N=this.collisionCircleArrays[i.bucketInstanceId];i.placementInvProjMatrix=N.invProjMatrix,i.placementViewportMatrix=N.viewportMatrix,i.collisionCircleArray=N.circles,delete this.collisionCircleArrays[i.bucketInstanceId]}},Ii.prototype.symbolFadeChange=function(i){return this.fadeDuration===0?1:(i-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},Ii.prototype.zoomAdjustment=function(i){return Math.max(0,(this.transform.zoom-i)/1.5)},Ii.prototype.hasTransitions=function(i){return this.stale||i-this.lastPlacementChangeTime<this.fadeDuration},Ii.prototype.stillRecent=function(i,o){var n=this.zoomAtLastRecencyCheck===o?1-this.zoomAdjustment(o):1;return this.zoomAtLastRecencyCheck=o,this.commitTime+this.fadeDuration*n>i},Ii.prototype.setStale=function(){this.stale=!0};var Cc=Math.pow(2,25),kc=Math.pow(2,24),tu=Math.pow(2,17),Mc=Math.pow(2,16),nl=Math.pow(2,9),Bc=Math.pow(2,8),ol=Math.pow(2,1);function al(i){if(i.opacity===0&&!i.placed)return 0;if(i.opacity===1&&i.placed)return 4294967295;var o=i.placed?1:0,n=Math.floor(127*i.opacity);return n*Cc+o*kc+n*tu+o*Mc+n*nl+o*Bc+n*ol+o}var Wo=0,ru=function(i){this._sortAcrossTiles=i.layout.get("symbol-z-order")!=="viewport-y"&&i.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};ru.prototype.continuePlacement=function(i,o,n,s,p){for(var f=this._bucketParts;this._currentTileIndex<i.length;)if(o.getBucketParts(f,s,i[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,p())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,f.sort((function(d,v){return d.sortKey-v.sortKey})));this._currentPartIndex<f.length;)if(o.placeLayerBucketPart(f[this._currentPartIndex],this._seenCrossTileIDs,n),this._currentPartIndex++,p())return!0;return!1};var ga=function(i,o,n,s,p,f,d){this.placement=new Ii(i,p,f,d),this._currentPlacementIndex=o.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=s,this._done=!1};ga.prototype.isDone=function(){return this._done},ga.prototype.continuePlacement=function(i,o,n){for(var s=this,p=u.browser.now(),f=function(){var w=u.browser.now()-p;return!s._forceFullPlacement&&w>2};this._currentPlacementIndex>=0;){var d=o[i[this._currentPlacementIndex]],v=this.placement.collisionIndex.transform.zoom;if(d.type==="symbol"&&(!d.minzoom||d.minzoom<=v)&&(!d.maxzoom||d.maxzoom>v)){if(this._inProgressLayer||(this._inProgressLayer=new ru(d)),this._inProgressLayer.continuePlacement(n[d.source],this.placement,this._showCollisionBoxes,d,f))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},ga.prototype.commit=function(i){return this.placement.commit(i),this.placement};var sl=512/u.EXTENT/2,Qa=function(i,o,n){this.tileID=i,this.indexedSymbolInstances={},this.bucketInstanceId=n;for(var s=0;s<o.length;s++){var p=o.get(s),f=p.key;this.indexedSymbolInstances[f]||(this.indexedSymbolInstances[f]=[]),this.indexedSymbolInstances[f].push({crossTileID:p.crossTileID,coord:this.getScaledCoordinates(p,i)})}};Qa.prototype.getScaledCoordinates=function(i,o){var n=sl/Math.pow(2,o.canonical.z-this.tileID.canonical.z);return{x:Math.floor((o.canonical.x*u.EXTENT+i.anchorX)*n),y:Math.floor((o.canonical.y*u.EXTENT+i.anchorY)*n)}},Qa.prototype.findMatches=function(i,o,n){for(var s=this.tileID.canonical.z<o.canonical.z?1:Math.pow(2,this.tileID.canonical.z-o.canonical.z),p=0;p<i.length;p++){var f=i.get(p);if(!f.crossTileID){var d=this.indexedSymbolInstances[f.key];if(d)for(var v=this.getScaledCoordinates(f,o),w=0,A=d;w<A.length;w+=1){var D=A[w];if(Math.abs(D.coord.x-v.x)<=s&&Math.abs(D.coord.y-v.y)<=s&&!n[D.crossTileID]){n[D.crossTileID]=!0,f.crossTileID=D.crossTileID;break}}}}};var an=function(){this.maxCrossTileID=0};an.prototype.generate=function(){return++this.maxCrossTileID};var Gn=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Gn.prototype.handleWrapJump=function(i){var o=Math.round((i-this.lng)/360);if(o!==0)for(var n in this.indexes){var s=this.indexes[n],p={};for(var f in s){var d=s[f];d.tileID=d.tileID.unwrapTo(d.tileID.wrap+o),p[d.tileID.key]=d}this.indexes[n]=p}this.lng=i},Gn.prototype.addBucket=function(i,o,n){if(this.indexes[i.overscaledZ]&&this.indexes[i.overscaledZ][i.key]){if(this.indexes[i.overscaledZ][i.key].bucketInstanceId===o.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(i.overscaledZ,this.indexes[i.overscaledZ][i.key])}for(var s=0;s<o.symbolInstances.length;s++)o.symbolInstances.get(s).crossTileID=0;this.usedCrossTileIDs[i.overscaledZ]||(this.usedCrossTileIDs[i.overscaledZ]={});var p=this.usedCrossTileIDs[i.overscaledZ];for(var f in this.indexes){var d=this.indexes[f];if(Number(f)>i.overscaledZ)for(var v in d){var w=d[v];w.tileID.isChildOf(i)&&w.findMatches(o.symbolInstances,i,p)}else{var A=d[i.scaledTo(Number(f)).key];A&&A.findMatches(o.symbolInstances,i,p)}}for(var D=0;D<o.symbolInstances.length;D++){var F=o.symbolInstances.get(D);F.crossTileID||(F.crossTileID=n.generate(),p[F.crossTileID]=!0)}return this.indexes[i.overscaledZ]===void 0&&(this.indexes[i.overscaledZ]={}),this.indexes[i.overscaledZ][i.key]=new Qa(i,o.symbolInstances,o.bucketInstanceId),!0},Gn.prototype.removeBucketCrossTileIDs=function(i,o){for(var n in o.indexedSymbolInstances)for(var s=0,p=o.indexedSymbolInstances[n];s<p.length;s+=1)delete this.usedCrossTileIDs[i][p[s].crossTileID]},Gn.prototype.removeStaleBuckets=function(i){var o=!1;for(var n in this.indexes){var s=this.indexes[n];for(var p in s)i[s[p].bucketInstanceId]||(this.removeBucketCrossTileIDs(n,s[p]),delete s[p],o=!0)}return o};var Zn=function(){this.layerIndexes={},this.crossTileIDs=new an,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Zn.prototype.addLayer=function(i,o,n){var s=this.layerIndexes[i.id];s===void 0&&(s=this.layerIndexes[i.id]=new Gn);var p=!1,f={};s.handleWrapJump(n);for(var d=0,v=o;d<v.length;d+=1){var w=v[d],A=w.getBucket(i);A&&i.id===A.layerIds[0]&&(A.bucketInstanceId||(A.bucketInstanceId=++this.maxBucketInstanceId),s.addBucket(w.tileID,A,this.crossTileIDs)&&(p=!0),f[A.bucketInstanceId]=!0)}return s.removeStaleBuckets(f)&&(p=!0),p},Zn.prototype.pruneUnusedLayers=function(i){var o={};for(var n in i.forEach((function(s){o[s]=!0})),this.layerIndexes)o[n]||delete this.layerIndexes[n]};var go=function(i,o){return u.emitValidationErrors(i,o&&o.filter((function(n){return n.identifier!=="source.canvas"})))},$n=u.pick(Be,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Wn=u.pick(Be,["setCenter","setZoom","setBearing","setPitch"]),es=(function(){var i={},o=u.styleSpec.$version;for(var n in u.styleSpec.$root){var s,p=u.styleSpec.$root[n];p.required&&(s=n==="version"?o:p.type==="array"?[]:{})!=null&&(i[n]=s)}return i})(),Ui=(function(i){function o(n,s){var p=this;s===void 0&&(s={}),i.call(this),this.map=n,this.dispatcher=new Ut(ge(),this),this.imageManager=new Re,this.imageManager.setEventedParent(this),this.glyphManager=new Fe(n._requestManager,s.localIdeographFontFamily),this.lineAtlas=new St(256,512),this.crossTileSymbolIndex=new Zn,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new u.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",u.getReferrer());var f=this;this._rtlTextPluginCallback=o.registerForPluginStateChange((function(d){f.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:d.pluginStatus,pluginURL:d.pluginURL},(function(v,w){if(u.triggerPluginCompletionEvent(v),w&&w.every((function(D){return D})))for(var A in f.sourceCaches)f.sourceCaches[A].reload()}))})),this.on("data",(function(d){if(d.dataType==="source"&&d.sourceDataType==="metadata"){var v=p.sourceCaches[d.sourceId];if(v){var w=v.getSource();if(w&&w.vectorLayerIds)for(var A in p._layers){var D=p._layers[A];D.source===w.id&&p._validateLayer(D)}}}}))}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.loadURL=function(n,s){var p=this;s===void 0&&(s={}),this.fire(new u.Event("dataloading",{dataType:"style"}));var f=typeof s.validate=="boolean"?s.validate:!u.isMapboxURL(n);n=this.map._requestManager.normalizeStyleURL(n,s.accessToken);var d=this.map._requestManager.transformRequest(n,u.ResourceType.Style);this._request=u.getJSON(d,(function(v,w){p._request=null,v?p.fire(new u.ErrorEvent(v)):w&&p._load(w,f)}))},o.prototype.loadJSON=function(n,s){var p=this;s===void 0&&(s={}),this.fire(new u.Event("dataloading",{dataType:"style"})),this._request=u.browser.frame((function(){p._request=null,p._load(n,s.validate!==!1)}))},o.prototype.loadEmpty=function(){this.fire(new u.Event("dataloading",{dataType:"style"})),this._load(es,!1)},o.prototype._load=function(n,s){if(!s||!go(this,u.validateStyle(n))){for(var p in this._loaded=!0,this.stylesheet=n,n.sources)this.addSource(p,n.sources[p],{validate:!1});n.sprite?this._loadSprite(n.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(n.glyphs);var f=ze(this.stylesheet.layers);this._order=f.map((function(A){return A.id})),this._layers={},this._serializedLayers={};for(var d=0,v=f;d<v.length;d+=1){var w=v[d];(w=u.createStyleLayer(w)).setEventedParent(this,{layer:{id:w.id}}),this._layers[w.id]=w,this._serializedLayers[w.id]=w.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new Wt(this.stylesheet.light),this.fire(new u.Event("data",{dataType:"style"})),this.fire(new u.Event("style.load"))}},o.prototype._loadSprite=function(n){var s=this;this._spriteRequest=(function(p,f,d){var v,w,A,D=u.browser.devicePixelRatio>1?"@2x":"",F=u.getJSON(f.transformRequest(f.normalizeSpriteURL(p,D,".json"),u.ResourceType.SpriteJSON),(function($,ee){F=null,A||(A=$,v=ee,W())})),O=u.getImage(f.transformRequest(f.normalizeSpriteURL(p,D,".png"),u.ResourceType.SpriteImage),(function($,ee){O=null,A||(A=$,w=ee,W())}));function W(){if(A)d(A);else if(v&&w){var $=u.browser.getImageData(w),ee={};for(var N in v){var Q=v[N],ne=Q.width,ue=Q.height,de=Q.x,pe=Q.y,ye=Q.sdf,Ie=Q.pixelRatio,Me=Q.stretchX,Ce=Q.stretchY,$e=Q.content,nt=new u.RGBAImage({width:ne,height:ue});u.RGBAImage.copy($,nt,{x:de,y:pe},{x:0,y:0},{width:ne,height:ue}),ee[N]={data:nt,pixelRatio:Ie,sdf:ye,stretchX:Me,stretchY:Ce,content:$e}}d(null,ee)}}return{cancel:function(){F&&(F.cancel(),F=null),O&&(O.cancel(),O=null)}}})(n,this.map._requestManager,(function(p,f){if(s._spriteRequest=null,p)s.fire(new u.ErrorEvent(p));else if(f)for(var d in f)s.imageManager.addImage(d,f[d]);s.imageManager.setLoaded(!0),s._availableImages=s.imageManager.listImages(),s.dispatcher.broadcast("setImages",s._availableImages),s.fire(new u.Event("data",{dataType:"style"}))}))},o.prototype._validateLayer=function(n){var s=this.sourceCaches[n.source];if(s){var p=n.sourceLayer;if(p){var f=s.getSource();(f.type==="geojson"||f.vectorLayerIds&&f.vectorLayerIds.indexOf(p)===-1)&&this.fire(new u.ErrorEvent(new Error('Source layer "'+p+'" does not exist on source "'+f.id+'" as specified by style layer "'+n.id+'"')))}}},o.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var n in this.sourceCaches)if(!this.sourceCaches[n].loaded())return!1;return!!this.imageManager.isLoaded()},o.prototype._serializeLayers=function(n){for(var s=[],p=0,f=n;p<f.length;p+=1){var d=this._layers[f[p]];d.type!=="custom"&&s.push(d.serialize())}return s},o.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var n in this.sourceCaches)if(this.sourceCaches[n].hasTransition())return!0;for(var s in this._layers)if(this._layers[s].hasTransition())return!0;return!1},o.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},o.prototype.update=function(n){if(this._loaded){var s=this._changed;if(this._changed){var p=Object.keys(this._updatedLayers),f=Object.keys(this._removedLayers);for(var d in(p.length||f.length)&&this._updateWorkerLayers(p,f),this._updatedSources){var v=this._updatedSources[d];v==="reload"?this._reloadSource(d):v==="clear"&&this._clearSource(d)}for(var w in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[w].updateTransitions(n);this.light.updateTransitions(n),this._resetUpdates()}var A={};for(var D in this.sourceCaches){var F=this.sourceCaches[D];A[D]=F.used,F.used=!1}for(var O=0,W=this._order;O<W.length;O+=1){var $=this._layers[W[O]];$.recalculate(n,this._availableImages),!$.isHidden(n.zoom)&&$.source&&(this.sourceCaches[$.source].used=!0)}for(var ee in A){var N=this.sourceCaches[ee];A[ee]!==N.used&&N.fire(new u.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:ee}))}this.light.recalculate(n),this.z=n.zoom,s&&this.fire(new u.Event("data",{dataType:"style"}))}},o.prototype._updateTilesForChangedImages=function(){var n=Object.keys(this._changedImages);if(n.length){for(var s in this.sourceCaches)this.sourceCaches[s].reloadTilesForDependencies(["icons","patterns"],n);this._changedImages={}}},o.prototype._updateWorkerLayers=function(n,s){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(n),removedIds:s})},o.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},o.prototype.setState=function(n){var s=this;if(this._checkLoaded(),go(this,u.validateStyle(n)))return!1;(n=u.clone$1(n)).layers=ze(n.layers);var p=(function(d,v){if(!d)return[{command:Be.setStyle,args:[v]}];var w=[];try{if(!u.deepEqual(d.version,v.version))return[{command:Be.setStyle,args:[v]}];u.deepEqual(d.center,v.center)||w.push({command:Be.setCenter,args:[v.center]}),u.deepEqual(d.zoom,v.zoom)||w.push({command:Be.setZoom,args:[v.zoom]}),u.deepEqual(d.bearing,v.bearing)||w.push({command:Be.setBearing,args:[v.bearing]}),u.deepEqual(d.pitch,v.pitch)||w.push({command:Be.setPitch,args:[v.pitch]}),u.deepEqual(d.sprite,v.sprite)||w.push({command:Be.setSprite,args:[v.sprite]}),u.deepEqual(d.glyphs,v.glyphs)||w.push({command:Be.setGlyphs,args:[v.glyphs]}),u.deepEqual(d.transition,v.transition)||w.push({command:Be.setTransition,args:[v.transition]}),u.deepEqual(d.light,v.light)||w.push({command:Be.setLight,args:[v.light]});var A={},D=[];(function(O,W,$,ee){var N;for(N in W=W||{},O=O||{})O.hasOwnProperty(N)&&(W.hasOwnProperty(N)||qe(N,$,ee));for(N in W)W.hasOwnProperty(N)&&(O.hasOwnProperty(N)?u.deepEqual(O[N],W[N])||(O[N].type==="geojson"&&W[N].type==="geojson"&&rr(O,W,N)?$.push({command:Be.setGeoJSONSourceData,args:[N,W[N].data]}):Et(N,W,$,ee)):yt(N,W,$))})(d.sources,v.sources,D,A);var F=[];d.layers&&d.layers.forEach((function(O){A[O.source]?w.push({command:Be.removeLayer,args:[O.id]}):F.push(O)})),w=w.concat(D),(function(O,W,$){W=W||[];var ee,N,Q,ne,ue,de,pe,ye=(O=O||[]).map(Gt),Ie=W.map(Gt),Me=O.reduce(Dt,{}),Ce=W.reduce(Dt,{}),$e=ye.slice(),nt=Object.create(null);for(ee=0,N=0;ee<ye.length;ee++)Ce.hasOwnProperty(Q=ye[ee])?N++:($.push({command:Be.removeLayer,args:[Q]}),$e.splice($e.indexOf(Q,N),1));for(ee=0,N=0;ee<Ie.length;ee++)$e[$e.length-1-ee]!==(Q=Ie[Ie.length-1-ee])&&(Me.hasOwnProperty(Q)?($.push({command:Be.removeLayer,args:[Q]}),$e.splice($e.lastIndexOf(Q,$e.length-N),1)):N++,$.push({command:Be.addLayer,args:[Ce[Q],de=$e[$e.length-ee]]}),$e.splice($e.length-ee,0,Q),nt[Q]=!0);for(ee=0;ee<Ie.length;ee++)if(ne=Me[Q=Ie[ee]],ue=Ce[Q],!nt[Q]&&!u.deepEqual(ne,ue))if(u.deepEqual(ne.source,ue.source)&&u.deepEqual(ne["source-layer"],ue["source-layer"])&&u.deepEqual(ne.type,ue.type)){for(pe in Pt(ne.layout,ue.layout,$,Q,null,Be.setLayoutProperty),Pt(ne.paint,ue.paint,$,Q,null,Be.setPaintProperty),u.deepEqual(ne.filter,ue.filter)||$.push({command:Be.setFilter,args:[Q,ue.filter]}),u.deepEqual(ne.minzoom,ue.minzoom)&&u.deepEqual(ne.maxzoom,ue.maxzoom)||$.push({command:Be.setLayerZoomRange,args:[Q,ue.minzoom,ue.maxzoom]}),ne)ne.hasOwnProperty(pe)&&pe!=="layout"&&pe!=="paint"&&pe!=="filter"&&pe!=="metadata"&&pe!=="minzoom"&&pe!=="maxzoom"&&(pe.indexOf("paint.")===0?Pt(ne[pe],ue[pe],$,Q,pe.slice(6),Be.setPaintProperty):u.deepEqual(ne[pe],ue[pe])||$.push({command:Be.setLayerProperty,args:[Q,pe,ue[pe]]}));for(pe in ue)ue.hasOwnProperty(pe)&&!ne.hasOwnProperty(pe)&&pe!=="layout"&&pe!=="paint"&&pe!=="filter"&&pe!=="metadata"&&pe!=="minzoom"&&pe!=="maxzoom"&&(pe.indexOf("paint.")===0?Pt(ne[pe],ue[pe],$,Q,pe.slice(6),Be.setPaintProperty):u.deepEqual(ne[pe],ue[pe])||$.push({command:Be.setLayerProperty,args:[Q,pe,ue[pe]]}))}else $.push({command:Be.removeLayer,args:[Q]}),de=$e[$e.lastIndexOf(Q)+1],$.push({command:Be.addLayer,args:[ue,de]})})(F,v.layers,w)}catch(O){console.warn("Unable to compute style diff:",O),w=[{command:Be.setStyle,args:[v]}]}return w})(this.serialize(),n).filter((function(d){return!(d.command in Wn)}));if(p.length===0)return!1;var f=p.filter((function(d){return!(d.command in $n)}));if(f.length>0)throw new Error("Unimplemented: "+f.map((function(d){return d.command})).join(", ")+".");return p.forEach((function(d){d.command!=="setTransition"&&s[d.command].apply(s,d.args)})),this.stylesheet=n,!0},o.prototype.addImage=function(n,s){if(this.getImage(n))return this.fire(new u.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(n,s),this._afterImageUpdated(n)},o.prototype.updateImage=function(n,s){this.imageManager.updateImage(n,s)},o.prototype.getImage=function(n){return this.imageManager.getImage(n)},o.prototype.removeImage=function(n){if(!this.getImage(n))return this.fire(new u.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(n),this._afterImageUpdated(n)},o.prototype._afterImageUpdated=function(n){this._availableImages=this.imageManager.listImages(),this._changedImages[n]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new u.Event("data",{dataType:"style"}))},o.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},o.prototype.addSource=function(n,s,p){var f=this;if(p===void 0&&(p={}),this._checkLoaded(),this.sourceCaches[n]!==void 0)throw new Error("There is already a source with this ID");if(!s.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(s).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(s.type)>=0&&this._validate(u.validateStyle.source,"sources."+n,s,null,p))){this.map&&this.map._collectResourceTiming&&(s.collectResourceTiming=!0);var d=this.sourceCaches[n]=new H(n,s,this.dispatcher);d.style=this,d.setEventedParent(this,(function(){return{isSourceLoaded:f.loaded(),source:d.serialize(),sourceId:n}})),d.onAdd(this.map),this._changed=!0}},o.prototype.removeSource=function(n){if(this._checkLoaded(),this.sourceCaches[n]===void 0)throw new Error("There is no source with this ID");for(var s in this._layers)if(this._layers[s].source===n)return this.fire(new u.ErrorEvent(new Error('Source "'+n+'" cannot be removed while layer "'+s+'" is using it.')));var p=this.sourceCaches[n];delete this.sourceCaches[n],delete this._updatedSources[n],p.fire(new u.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:n})),p.setEventedParent(null),p.clearTiles(),p.onRemove&&p.onRemove(this.map),this._changed=!0},o.prototype.setGeoJSONSourceData=function(n,s){this._checkLoaded(),this.sourceCaches[n].getSource().setData(s),this._changed=!0},o.prototype.getSource=function(n){return this.sourceCaches[n]&&this.sourceCaches[n].getSource()},o.prototype.addLayer=function(n,s,p){p===void 0&&(p={}),this._checkLoaded();var f=n.id;if(this.getLayer(f))this.fire(new u.ErrorEvent(new Error('Layer with id "'+f+'" already exists on this map')));else{var d;if(n.type==="custom"){if(go(this,u.validateCustomStyleLayer(n)))return;d=u.createStyleLayer(n)}else{if(typeof n.source=="object"&&(this.addSource(f,n.source),n=u.clone$1(n),n=u.extend(n,{source:f})),this._validate(u.validateStyle.layer,"layers."+f,n,{arrayIndex:-1},p))return;d=u.createStyleLayer(n),this._validateLayer(d),d.setEventedParent(this,{layer:{id:f}}),this._serializedLayers[d.id]=d.serialize()}var v=s?this._order.indexOf(s):this._order.length;if(s&&v===-1)this.fire(new u.ErrorEvent(new Error('Layer with id "'+s+'" does not exist on this map.')));else{if(this._order.splice(v,0,f),this._layerOrderChanged=!0,this._layers[f]=d,this._removedLayers[f]&&d.source&&d.type!=="custom"){var w=this._removedLayers[f];delete this._removedLayers[f],w.type!==d.type?this._updatedSources[d.source]="clear":(this._updatedSources[d.source]="reload",this.sourceCaches[d.source].pause())}this._updateLayer(d),d.onAdd&&d.onAdd(this.map)}}},o.prototype.moveLayer=function(n,s){if(this._checkLoaded(),this._changed=!0,this._layers[n]){if(n!==s){var p=this._order.indexOf(n);this._order.splice(p,1);var f=s?this._order.indexOf(s):this._order.length;s&&f===-1?this.fire(new u.ErrorEvent(new Error('Layer with id "'+s+'" does not exist on this map.'))):(this._order.splice(f,0,n),this._layerOrderChanged=!0)}}else this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be moved.")))},o.prototype.removeLayer=function(n){this._checkLoaded();var s=this._layers[n];if(s){s.setEventedParent(null);var p=this._order.indexOf(n);this._order.splice(p,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[n]=s,delete this._layers[n],delete this._serializedLayers[n],delete this._updatedLayers[n],delete this._updatedPaintProps[n],s.onRemove&&s.onRemove(this.map)}else this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be removed.")))},o.prototype.getLayer=function(n){return this._layers[n]},o.prototype.hasLayer=function(n){return n in this._layers},o.prototype.setLayerZoomRange=function(n,s,p){this._checkLoaded();var f=this.getLayer(n);f?f.minzoom===s&&f.maxzoom===p||(s!=null&&(f.minzoom=s),p!=null&&(f.maxzoom=p),this._updateLayer(f)):this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot have zoom extent.")))},o.prototype.setFilter=function(n,s,p){p===void 0&&(p={}),this._checkLoaded();var f=this.getLayer(n);if(f){if(!u.deepEqual(f.filter,s))return s==null?(f.filter=void 0,void this._updateLayer(f)):void(this._validate(u.validateStyle.filter,"layers."+f.id+".filter",s,null,p)||(f.filter=u.clone$1(s),this._updateLayer(f)))}else this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be filtered.")))},o.prototype.getFilter=function(n){return u.clone$1(this.getLayer(n).filter)},o.prototype.setLayoutProperty=function(n,s,p,f){f===void 0&&(f={}),this._checkLoaded();var d=this.getLayer(n);d?u.deepEqual(d.getLayoutProperty(s),p)||(d.setLayoutProperty(s,p,f),this._updateLayer(d)):this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be styled.")))},o.prototype.getLayoutProperty=function(n,s){var p=this.getLayer(n);if(p)return p.getLayoutProperty(s);this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style.")))},o.prototype.setPaintProperty=function(n,s,p,f){f===void 0&&(f={}),this._checkLoaded();var d=this.getLayer(n);d?u.deepEqual(d.getPaintProperty(s),p)||(d.setPaintProperty(s,p,f)&&this._updateLayer(d),this._changed=!0,this._updatedPaintProps[n]=!0):this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be styled.")))},o.prototype.getPaintProperty=function(n,s){return this.getLayer(n).getPaintProperty(s)},o.prototype.setFeatureState=function(n,s){this._checkLoaded();var p=n.source,f=n.sourceLayer,d=this.sourceCaches[p];if(d!==void 0){var v=d.getSource().type;v==="geojson"&&f?this.fire(new u.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):v!=="vector"||f?(n.id===void 0&&this.fire(new u.ErrorEvent(new Error("The feature id parameter must be provided."))),d.setFeatureState(f,n.id,s)):this.fire(new u.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new u.ErrorEvent(new Error("The source '"+p+"' does not exist in the map's style.")))},o.prototype.removeFeatureState=function(n,s){this._checkLoaded();var p=n.source,f=this.sourceCaches[p];if(f!==void 0){var d=f.getSource().type,v=d==="vector"?n.sourceLayer:void 0;d!=="vector"||v?s&&typeof n.id!="string"&&typeof n.id!="number"?this.fire(new u.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):f.removeFeatureState(v,n.id,s):this.fire(new u.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new u.ErrorEvent(new Error("The source '"+p+"' does not exist in the map's style.")))},o.prototype.getFeatureState=function(n){this._checkLoaded();var s=n.source,p=n.sourceLayer,f=this.sourceCaches[s];if(f!==void 0){if(f.getSource().type!=="vector"||p)return n.id===void 0&&this.fire(new u.ErrorEvent(new Error("The feature id parameter must be provided."))),f.getFeatureState(p,n.id);this.fire(new u.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new u.ErrorEvent(new Error("The source '"+s+"' does not exist in the map's style.")))},o.prototype.getTransition=function(){return u.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},o.prototype.serialize=function(){return u.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,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,sources:u.mapObject(this.sourceCaches,(function(n){return n.serialize()})),layers:this._serializeLayers(this._order)},(function(n){return n!==void 0}))},o.prototype._updateLayer=function(n){this._updatedLayers[n.id]=!0,n.source&&!this._updatedSources[n.source]&&this.sourceCaches[n.source].getSource().type!=="raster"&&(this._updatedSources[n.source]="reload",this.sourceCaches[n.source].pause()),this._changed=!0},o.prototype._flattenAndSortRenderedFeatures=function(n){for(var s=this,p=function(Me){return s._layers[Me].type==="fill-extrusion"},f={},d=[],v=this._order.length-1;v>=0;v--){var w=this._order[v];if(p(w)){f[w]=v;for(var A=0,D=n;A<D.length;A+=1){var F=D[A][w];if(F)for(var O=0,W=F;O<W.length;O+=1)d.push(W[O])}}}d.sort((function(Me,Ce){return Ce.intersectionZ-Me.intersectionZ}));for(var $=[],ee=this._order.length-1;ee>=0;ee--){var N=this._order[ee];if(p(N))for(var Q=d.length-1;Q>=0;Q--){var ne=d[Q].feature;if(f[ne.layer.id]<ee)break;$.push(ne),d.pop()}else for(var ue=0,de=n;ue<de.length;ue+=1){var pe=de[ue][N];if(pe)for(var ye=0,Ie=pe;ye<Ie.length;ye+=1)$.push(Ie[ye].feature)}}return $},o.prototype.queryRenderedFeatures=function(n,s,p){s&&s.filter&&this._validate(u.validateStyle.filter,"queryRenderedFeatures.filter",s.filter,null,s);var f={};if(s&&s.layers){if(!Array.isArray(s.layers))return this.fire(new u.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var d=0,v=s.layers;d<v.length;d+=1){var w=v[d],A=this._layers[w];if(!A)return this.fire(new u.ErrorEvent(new Error("The layer '"+w+"' does not exist in the map's style and cannot be queried for features."))),[];f[A.source]=!0}}var D=[];for(var F in s.availableImages=this._availableImages,this.sourceCaches)s.layers&&!f[F]||D.push(Or(this.sourceCaches[F],this._layers,this._serializedLayers,n,s,p));return this.placement&&D.push((function(O,W,$,ee,N,Q,ne){for(var ue={},de=Q.queryRenderedSymbols(ee),pe=[],ye=0,Ie=Object.keys(de).map(Number);ye<Ie.length;ye+=1)pe.push(ne[Ie[ye]]);pe.sort(Xi);for(var Me=function(){var st=$e[Ce],Lt=st.featureIndex.lookupSymbolFeatures(de[st.bucketInstanceId],W,st.bucketIndex,st.sourceLayerIndex,N.filter,N.layers,N.availableImages,O);for(var He in Lt){var mt=ue[He]=ue[He]||[],xt=Lt[He];xt.sort((function(gt,ht){var ct=st.featureSortOrder;if(ct){var Jr=ct.indexOf(gt.featureIndex);return ct.indexOf(ht.featureIndex)-Jr}return ht.featureIndex-gt.featureIndex}));for(var dt=0,ft=xt;dt<ft.length;dt+=1)mt.push(ft[dt])}},Ce=0,$e=pe;Ce<$e.length;Ce+=1)Me();var nt=function(st){ue[st].forEach((function(Lt){var He=Lt.feature,mt=$[O[st].source].getFeatureState(He.layer["source-layer"],He.id);He.source=He.layer.source,He.layer["source-layer"]&&(He.sourceLayer=He.layer["source-layer"]),He.state=mt}))};for(var ut in ue)nt(ut);return ue})(this._layers,this._serializedLayers,this.sourceCaches,n,s,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(D)},o.prototype.querySourceFeatures=function(n,s){s&&s.filter&&this._validate(u.validateStyle.filter,"querySourceFeatures.filter",s.filter,null,s);var p=this.sourceCaches[n];return p?(function(f,d){for(var v=f.getRenderableIds().map((function(W){return f.getTileByID(W)})),w=[],A={},D=0;D<v.length;D++){var F=v[D],O=F.tileID.canonical.key;A[O]||(A[O]=!0,F.querySourceFeatures(w,d))}return w})(p,s):[]},o.prototype.addSourceType=function(n,s,p){return o.getSourceType(n)?p(new Error('A source type called "'+n+'" already exists.')):(o.setSourceType(n,s),s.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:n,url:s.workerSourceURL},p):p(null,null))},o.prototype.getLight=function(){return this.light.getLight()},o.prototype.setLight=function(n,s){s===void 0&&(s={}),this._checkLoaded();var p=this.light.getLight(),f=!1;for(var d in n)if(!u.deepEqual(n[d],p[d])){f=!0;break}if(f){var v={now:u.browser.now(),transition:u.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(n,s),this.light.updateTransitions(v)}},o.prototype._validate=function(n,s,p,f,d){return d===void 0&&(d={}),(!d||d.validate!==!1)&&go(this,n.call(u.validateStyle,u.extend({key:s,style:this.serialize(),value:p,styleSpec:u.styleSpec},f)))},o.prototype._remove=function(){for(var n in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),u.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[n].setEventedParent(null);for(var s in this.sourceCaches)this.sourceCaches[s].clearTiles(),this.sourceCaches[s].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},o.prototype._clearSource=function(n){this.sourceCaches[n].clearTiles()},o.prototype._reloadSource=function(n){this.sourceCaches[n].resume(),this.sourceCaches[n].reload()},o.prototype._updateSources=function(n){for(var s in this.sourceCaches)this.sourceCaches[s].update(n)},o.prototype._generateCollisionBoxes=function(){for(var n in this.sourceCaches)this._reloadSource(n)},o.prototype._updatePlacement=function(n,s,p,f,d){d===void 0&&(d=!1);for(var v=!1,w=!1,A={},D=0,F=this._order;D<F.length;D+=1){var O=this._layers[F[D]];if(O.type==="symbol"){if(!A[O.source]){var W=this.sourceCaches[O.source];A[O.source]=W.getRenderableIds(!0).map((function(ne){return W.getTileByID(ne)})).sort((function(ne,ue){return ue.tileID.overscaledZ-ne.tileID.overscaledZ||(ne.tileID.isLessThan(ue.tileID)?-1:1)}))}var $=this.crossTileSymbolIndex.addLayer(O,A[O.source],n.center.lng);v=v||$}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((d=d||this._layerOrderChanged||p===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(u.browser.now(),n.zoom))&&(this.pauseablePlacement=new ga(n,this._order,d,s,p,f,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,A),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(u.browser.now()),w=!0),v&&this.pauseablePlacement.placement.setStale()),w||v)for(var ee=0,N=this._order;ee<N.length;ee+=1){var Q=this._layers[N[ee]];Q.type==="symbol"&&this.placement.updateLayerOpacities(Q,A[Q.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(u.browser.now())},o.prototype._releaseSymbolFadeTiles=function(){for(var n in this.sourceCaches)this.sourceCaches[n].releaseSymbolFadeTiles()},o.prototype.getImages=function(n,s,p){this.imageManager.getImages(s.icons,p),this._updateTilesForChangedImages();var f=this.sourceCaches[s.source];f&&f.setDependencies(s.tileID.key,s.type,s.icons)},o.prototype.getGlyphs=function(n,s,p){this.glyphManager.getGlyphs(s.stacks,p)},o.prototype.getResource=function(n,s,p){return u.makeRequest(s,p)},o})(u.Evented);Ui.getSourceType=function(i){return Mi[i]},Ui.setSourceType=function(i,o){Mi[i]=o},Ui.registerForPluginStateChange=u.registerForPluginStateChange;var Vr=u.createLayout([{name:"a_pos",type:"Int16",components:2}]),Ho=ir(`#ifdef GL_ES
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const wt=require("./LoadingSpinner-BIBGH_VZ.js"),q=require("vue"),pa=require("pinia");let Wa=null;typeof window<"u"&&(Wa=document.currentScript);const Dy={options:{div:"map",logo:"os-logo-maps",statement:"Contains OS data &copy; Crown copyright and database rights YYYY",prefix:"",suffix:""},init(y){if(typeof window<"u"){Wa&&(this.options.div=Wa.getAttribute("data-div")||this.options.div,this.options.logo=Wa.getAttribute("data-logo")||this.options.logo,this.options.statement=Wa.getAttribute("data-statement")||this.options.statement,this.options.prefix=Wa.getAttribute("data-prefix")||this.options.prefix,this.options.suffix=Wa.getAttribute("data-suffix")||this.options.suffix),y=typeof y<"u"?y:{},Object.assign(this.options,y);const _=document.getElementById(this.options.div);let x="os-api-branding logo";this.options.logo==="os-logo-maps-white"&&(x="os-api-branding logo white");let k=this.options.statement;k=k.replace("YYYY",new Date().getFullYear()),this.options.prefix!==""&&(k=`${this.options.prefix}<span>|</span>${k}`),this.options.suffix!==""&&(k=`${k}<span>|</span>${this.options.suffix}`),document.querySelectorAll(`#${this.options.div} .os-api-branding`).forEach(u=>u.remove());const E=document.createElement("div");E.className=x,_.appendChild(E);const D=document.createElement("div");D.className="os-api-branding copyright",D.innerHTML=k,_.appendChild(D)}}},Sn=pa.defineStore("map",()=>{const y=q.ref([]),_=q.ref([]),x=q.ref(null),k=q.ref(null),E=q.ref(null);function D(be){y.value.push({id:be.id,filters:be.filters,places:be.places,activePins:be.activePins,hovered:"",activePlace:null})}function u(be){y.value.forEach(De=>{De.id===be.mapId&&(De.hovered=be.hoveredFeature)})}function U(be){y.value.forEach(De=>{De.id===be.mapId&&(De.activePlace=be.activeFeature)})}function M(be){_.value=be}function Y(be){x.value=be}function X(be){k.value=be}function ae(be){return y.value.find(De=>De.id===be)}function J(be){return y.value.find(Ze=>Ze.id===be)?.hovered}function Se(be){return y.value.find(Ze=>Ze.id===be)?.activePlace}return{maps:y,activeSubcatFilters:_,selectedSubCategory:x,activeMarkerPos:k,activePlace:E,addMapInstance:D,setHoveredPlace:u,setActivePlace:U,setActiveSubcatFilters:M,setSelectedSubcat:Y,setActiveMarkerPos:X,getMapById:ae,getHoveredStop:J,getActivePlace:Se}});var wc={exports:{}},D0=wc.exports,Ry;function R0(){return Ry||(Ry=1,(function(y,_){(function(x,k){y.exports=k()})(D0,(function(){var x,k,E;function D(u,U){if(!x)x=U;else if(!k)k=U;else{var M="var sharedChunk = {}; ("+x+")(sharedChunk); ("+k+")(sharedChunk);",Y={};x(Y),E=U(Y),typeof window<"u"&&(E.workerUrl=window.URL.createObjectURL(new Blob([M],{type:"text/javascript"})))}}return D(["exports"],(function(u){function U(e,t){return e(t={exports:{}},t.exports),t.exports}var M=Y;function Y(e,t,r,a){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(a-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=a,this.p2x=r,this.p2y=a}Y.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},Y.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},Y.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},Y.prototype.solveCurveX=function(e,t){var r,a,l,c,h;for(t===void 0&&(t=1e-6),l=e,h=0;h<8;h++){if(c=this.sampleCurveX(l)-e,Math.abs(c)<t)return l;var m=this.sampleCurveDerivativeX(l);if(Math.abs(m)<1e-6)break;l-=c/m}if((l=e)<(r=0))return r;if(l>(a=1))return a;for(;r<a;){if(c=this.sampleCurveX(l),Math.abs(c-e)<t)return l;e>c?r=l:a=l,l=.5*(a-r)+r}return l},Y.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var X=ae;function ae(e,t){this.x=e,this.y=t}ae.prototype={clone:function(){return new ae(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},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(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),a=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=a,this},_rotateAround:function(e,t){var r=Math.cos(e),a=Math.sin(e),l=t.y+a*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-a*(this.y-t.y),this.y=l,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},ae.convert=function(e){return e instanceof ae?e:Array.isArray(e)?new ae(e[0],e[1]):e};var J=typeof self<"u"?self:{},Se=Math.pow(2,53)-1;function be(e,t,r,a){var l=new M(e,t,r,a);return function(c){return l.solve(c)}}var De=be(.25,.1,.25,1);function Ze(e,t,r){return Math.min(r,Math.max(t,e))}function He(e,t,r){var a=r-t,l=((e-t)%a+a)%a+t;return l===t?r:l}function Ue(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var a=0,l=t;a<l.length;a+=1){var c=l[a];for(var h in c)e[h]=c[h]}return e}var fe=1;function Ke(){return fe++}function Ne(){return(function e(t){return t?(t^16*Math.random()>>t/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)})()}function It(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function we(e,t){e.forEach((function(r){t[r]&&(t[r]=t[r].bind(t))}))}function je(e,t){return e.indexOf(t,e.length-t.length)!==-1}function Le(e,t,r){var a={};for(var l in e)a[l]=t.call(r||this,e[l],l,e);return a}function tt(e,t,r){var a={};for(var l in e)t.call(r||this,e[l],l,e)&&(a[l]=e[l]);return a}function Mt(e){return Array.isArray(e)?e.map(Mt):typeof e=="object"&&e?Le(e,Mt):e}var Wt={};function St(e){Wt[e]||(typeof console<"u"&&console.warn(e),Wt[e]=!0)}function Ut(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function Hr(e){for(var t=0,r=0,a=e.length,l=a-1,c=void 0,h=void 0;r<a;l=r++)t+=((h=e[l]).x-(c=e[r]).x)*(c.y+h.y);return t}function Pr(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function bi(e){var t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(a,l,c,h){var m=c||h;return t[l]=!m||m.toLowerCase(),""})),t["max-age"]){var r=parseInt(t["max-age"],10);isNaN(r)?delete t["max-age"]:t["max-age"]=r}return t}var or=null;function Rr(e){if(or==null){var t=e.navigator?e.navigator.userAgent:null;or=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return or}function et(e){try{var t=J[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch{return!1}}var Lr,Xr,Et,Fr,Mi=J.performance&&J.performance.now?J.performance.now.bind(J.performance):Date.now.bind(Date),pi=J.requestAnimationFrame||J.mozRequestAnimationFrame||J.webkitRequestAnimationFrame||J.msRequestAnimationFrame,Or=J.cancelAnimationFrame||J.mozCancelAnimationFrame||J.webkitCancelAnimationFrame||J.msCancelAnimationFrame,Xi={now:Mi,frame:function(e){var t=pi(e);return{cancel:function(){return Or(t)}}},getImageData:function(e,t){t===void 0&&(t=0);var r=J.document.createElement("canvas"),a=r.getContext("2d");if(!a)throw new Error("failed to create canvas 2d context");return r.width=e.width,r.height=e.height,a.drawImage(e,0,0,e.width,e.height),a.getImageData(-t,-t,e.width+2*t,e.height+2*t)},resolveURL:function(e){return Lr||(Lr=J.document.createElement("a")),Lr.href=e,Lr.href},hardwareConcurrency:J.navigator&&J.navigator.hardwareConcurrency||4,get devicePixelRatio(){return J.devicePixelRatio},get prefersReducedMotion(){return!!J.matchMedia&&(Xr==null&&(Xr=J.matchMedia("(prefers-reduced-motion: reduce)")),Xr.matches)}},Nt={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Nr={supported:!1,testSupport:function(e){!ar&&Fr&&(sr?lt(e):Et=e)}},ar=!1,sr=!1;function lt(e){var t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,Fr),e.isContextLost())return;Nr.supported=!0}catch{}e.deleteTexture(t),ar=!0}J.document&&((Fr=J.document.createElement("img")).onload=function(){Et&&lt(Et),Et=null,sr=!0},Fr.onerror=function(){ar=!0,Et=null},Fr.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var mr="01",hr=function(e,t){this._transformRequestFn=e,this._customAccessToken=t,this._createSkuToken()};function jr(e){return e.indexOf("mapbox:")===0}hr.prototype._createSkuToken=function(){var e=(function(){for(var t="",r=0;r<10;r++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",mr,t].join(""),tokenExpiresAt:Date.now()+432e5}})();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt},hr.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},hr.prototype.transformRequest=function(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}},hr.prototype.normalizeStyleURL=function(e,t){if(!jr(e))return e;var r=Kr(e);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},hr.prototype.normalizeGlyphsURL=function(e,t){if(!jr(e))return e;var r=Kr(e);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},hr.prototype.normalizeSourceURL=function(e,t){if(!jr(e))return e;var r=Kr(e);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||t)},hr.prototype.normalizeSpriteURL=function(e,t,r,a){var l=Kr(e);return jr(e)?(l.path="/styles/v1"+l.path+"/sprite"+t+r,this._makeAPIURL(l,this._customAccessToken||a)):(l.path+=""+t+r,Bi(l))},hr.prototype.normalizeTileURL=function(e,t){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!jr(e))return e;var r=Kr(e);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(Xi.devicePixelRatio>=2||t===512?"@2x":"")+(Nr.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var a=this._customAccessToken||(function(l){for(var c=0,h=l;c<h.length;c+=1){var m=h[c].match(/^access_token=(.*)$/);if(m)return m[1]}return null})(r.params)||Nt.ACCESS_TOKEN;return Nt.REQUIRE_ACCESS_TOKEN&&a&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,a)},hr.prototype.canonicalizeTileURL=function(e,t){var r=Kr(e);if(!r.path.match(/(^\/v4\/)/)||!r.path.match(/\.[\w]+$/))return e;var a="mapbox://tiles/";a+=r.path.replace("/v4/","");var l=r.params;return t&&(l=l.filter((function(c){return!c.match(/^access_token=/)}))),l.length&&(a+="?"+l.join("&")),a},hr.prototype.canonicalizeTileset=function(e,t){for(var r=!!t&&jr(t),a=[],l=0,c=e.tiles||[];l<c.length;l+=1){var h=c[l];br(h)?a.push(this.canonicalizeTileURL(h,r)):a.push(h)}return a},hr.prototype._makeAPIURL=function(e,t){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",a=Kr(Nt.API_URL);if(e.protocol=a.protocol,e.authority=a.authority,e.protocol==="http"){var l=e.params.indexOf("secure");l>=0&&e.params.splice(l,1)}if(a.path!=="/"&&(e.path=""+a.path+e.path),!Nt.REQUIRE_ACCESS_TOKEN)return Bi(e);if(!(t=t||Nt.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if(t[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return e.params=e.params.filter((function(c){return c.indexOf("access_token")===-1})),e.params.push("access_token="+t),Bi(e)};var fr=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function br(e){return fr.test(e)}var dn=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Kr(e){var t=e.match(dn);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function Bi(e){var t=e.params.length?"?"+e.params.join("&"):"";return e.protocol+"://"+e.authority+e.path+t}function hi(e){if(!e)return null;var t=e.split(".");if(!t||t.length!==3)return null;try{return JSON.parse(decodeURIComponent(J.atob(t[1]).split("").map((function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch{return null}}var ti=function(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};ti.prototype.getStorageKey=function(e){var t,r=hi(Nt.ACCESS_TOKEN);return t=r&&r.u?J.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(function(a,l){return String.fromCharCode(+("0x"+l))}))):Nt.ACCESS_TOKEN||"",e?"mapbox.eventData."+e+":"+t:"mapbox.eventData:"+t},ti.prototype.fetchEventData=function(){var e=et("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{var a=J.localStorage.getItem(t);a&&(this.eventData=JSON.parse(a));var l=J.localStorage.getItem(r);l&&(this.anonId=l)}catch{St("Unable to read from LocalStorage")}},ti.prototype.saveEventData=function(){var e=et("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{J.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&J.localStorage.setItem(t,JSON.stringify(this.eventData))}catch{St("Unable to write to LocalStorage")}},ti.prototype.processRequests=function(e){},ti.prototype.postEvent=function(e,t,r,a){var l=this;if(Nt.EVENTS_URL){var c=Kr(Nt.EVENTS_URL);c.params.push("access_token="+(a||Nt.ACCESS_TOKEN||""));var h={event:this.type,created:new Date(e).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.3",skuId:mr,userId:this.anonId},m=t?Ue(h,t):h,g={url:Bi(c),headers:{"Content-Type":"text/plain"},body:JSON.stringify([m])};this.pendingRequest=Yt(g,(function(b){l.pendingRequest=null,r(b),l.saveEventData(),l.processRequests(a)}))}},ti.prototype.queueRequest=function(e,t){this.queue.push(e),this.processRequests(t)};var ri,Vi,Ki=(function(e){function t(){e.call(this,"map.load"),this.success={},this.skuToken=""}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.postMapLoadEvent=function(r,a,l,c){this.skuToken=l;var h=!(!c&&!Nt.ACCESS_TOKEN),m=Array.isArray(r)&&r.some((function(g){return jr(g)||br(g)}));Nt.EVENTS_URL&&h&&m&&this.queueRequest({id:a,timestamp:Date.now()},c)},t.prototype.processRequests=function(r){var a=this;if(!this.pendingRequest&&this.queue.length!==0){var l=this.queue.shift(),c=l.id,h=l.timestamp;c&&this.success[c]||(this.anonId||this.fetchEventData(),It(this.anonId)||(this.anonId=Ne()),this.postEvent(h,{skuToken:this.skuToken},(function(m){m||c&&(a.success[c]=!0)}),r))}},t})(ti),yo=new((function(e){function t(r){e.call(this,"appUserTurnstile"),this._customAccessToken=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.postTurnstileEvent=function(r,a){Nt.EVENTS_URL&&Nt.ACCESS_TOKEN&&Array.isArray(r)&&r.some((function(l){return jr(l)||br(l)}))&&this.queueRequest(Date.now(),a)},t.prototype.processRequests=function(r){var a=this;if(!this.pendingRequest&&this.queue.length!==0){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var l=hi(Nt.ACCESS_TOKEN),c=l?l.u:Nt.ACCESS_TOKEN,h=c!==this.eventData.tokenU;It(this.anonId)||(this.anonId=Ne(),h=!0);var m=this.queue.shift();if(this.eventData.lastSuccess){var g=new Date(this.eventData.lastSuccess),b=new Date(m),S=(m-this.eventData.lastSuccess)/864e5;h=h||S>=1||S<-1||g.getDate()!==b.getDate()}else h=!0;if(!h)return this.processRequests();this.postEvent(m,{"enabled.telemetry":!1},(function(I){I||(a.eventData.lastSuccess=m,a.eventData.tokenU=c)}),r)}},t})(ti)),$o=yo.postTurnstileEvent.bind(yo),mn=new Ki,Mn=mn.postMapLoadEvent.bind(mn),Bn=500,Zo=50;function jn(){J.caches&&!ri&&(ri=J.caches.open("mapbox-tiles"))}function zn(e){var t=e.indexOf("?");return t<0?e:e.slice(0,t)}var rn,de=1/0;function _e(){return rn==null&&(rn=J.OffscreenCanvas&&new J.OffscreenCanvas(1,1).getContext("2d")&&typeof J.createImageBitmap=="function"),rn}var jt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(jt);var tr=(function(e){function t(r,a,l){a===401&&br(l)&&(r+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),e.call(this,r),this.status=a,this.url=l,this.name=this.constructor.name,this.message=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},t})(Error),Kt=Pr()?function(){return self.worker&&self.worker.referrer}:function(){return(J.location.protocol==="blob:"?J.parent:J).location.href},_t,fi,qi=function(e,t){if(!(/^file:/.test(r=e.url)||/^file:/.test(Kt())&&!/^\w+:/.test(r))){if(J.fetch&&J.Request&&J.AbortController&&J.Request.prototype.hasOwnProperty("signal"))return(function(a,l){var c,h=new J.AbortController,m=new J.Request(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,referrer:Kt(),signal:h.signal}),g=!1,b=!1,S=(c=m.url).indexOf("sku=")>0&&br(c);a.type==="json"&&m.headers.set("Accept","application/json");var I=function(z,j,G){if(!b){if(z&&z.message!=="SecurityError"&&St(z),j&&G)return C(j);var te=Date.now();J.fetch(m).then((function(K){if(K.ok){var oe=S?K.clone():null;return C(K,oe,te)}return l(new tr(K.statusText,K.status,a.url))})).catch((function(K){K.code!==20&&l(new Error(K.message))}))}},C=function(z,j,G){(a.type==="arrayBuffer"?z.arrayBuffer():a.type==="json"?z.json():z.text()).then((function(te){b||(j&&G&&(function(K,oe,le){if(jn(),ri){var ce={status:oe.status,statusText:oe.statusText,headers:new J.Headers};oe.headers.forEach((function(xe,Pe){return ce.headers.set(Pe,xe)}));var he=bi(oe.headers.get("Cache-Control")||"");he["no-store"]||(he["max-age"]&&ce.headers.set("Expires",new Date(le+1e3*he["max-age"]).toUTCString()),new Date(ce.headers.get("Expires")).getTime()-le<42e4||(function(xe,Pe){if(Vi===void 0)try{new Response(new ReadableStream),Vi=!0}catch{Vi=!1}Vi?Pe(xe.body):xe.blob().then(Pe)})(oe,(function(xe){var Pe=new J.Response(xe,ce);jn(),ri&&ri.then((function(ze){return ze.put(zn(K.url),Pe)})).catch((function(ze){return St(ze.message)}))})))}})(m,j,G),g=!0,l(null,te,z.headers.get("Cache-Control"),z.headers.get("Expires")))})).catch((function(te){b||l(new Error(te.message))}))};return S?(function(z,j){if(jn(),!ri)return j(null);var G=zn(z.url);ri.then((function(te){te.match(G).then((function(K){var oe=(function(le){if(!le)return!1;var ce=new Date(le.headers.get("Expires")||0),he=bi(le.headers.get("Cache-Control")||"");return ce>Date.now()&&!he["no-cache"]})(K);te.delete(G),oe&&te.put(G,K.clone()),j(null,K,oe)})).catch(j)})).catch(j)})(m,I):I(null,null),{cancel:function(){b=!0,g||h.abort()}}})(e,t);if(Pr()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var r;return(function(a,l){var c=new J.XMLHttpRequest;for(var h in c.open(a.method||"GET",a.url,!0),a.type==="arrayBuffer"&&(c.responseType="arraybuffer"),a.headers)c.setRequestHeader(h,a.headers[h]);return a.type==="json"&&(c.responseType="text",c.setRequestHeader("Accept","application/json")),c.withCredentials=a.credentials==="include",c.onerror=function(){l(new Error(c.statusText))},c.onload=function(){if((c.status>=200&&c.status<300||c.status===0)&&c.response!==null){var m=c.response;if(a.type==="json")try{m=JSON.parse(c.response)}catch(g){return l(g)}l(null,m,c.getResponseHeader("Cache-Control"),c.getResponseHeader("Expires"))}else l(new tr(c.statusText,c.status,a.url))},c.send(a.body),{cancel:function(){return c.abort()}}})(e,t)},ii=function(e,t){return qi(Ue(e,{type:"arrayBuffer"}),t)},Yt=function(e,t){return qi(Ue(e,{method:"POST"}),t)},T="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";_t=[],fi=0;var P=function(e,t){if(Nr.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),fi>=Nt.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:e,callback:t,cancelled:!1,cancel:function(){this.cancelled=!0}};return _t.push(r),r}fi++;var a=!1,l=function(){if(!a)for(a=!0,fi--;_t.length&&fi<Nt.MAX_PARALLEL_IMAGE_REQUESTS;){var h=_t.shift();h.cancelled||(h.cancel=P(h.requestParameters,h.callback).cancel)}},c=ii(e,(function(h,m,g,b){l(),h?t(h):m&&(_e()?(function(S,I){var C=new J.Blob([new Uint8Array(S)],{type:"image/png"});J.createImageBitmap(C).then((function(z){I(null,z)})).catch((function(z){I(new Error("Could not load image because of "+z.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}))})(m,t):(function(S,I,C,z){var j=new J.Image,G=J.URL;j.onload=function(){I(null,j),G.revokeObjectURL(j.src),j.onload=null,J.requestAnimationFrame((function(){j.src=T}))},j.onerror=function(){return I(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var te=new J.Blob([new Uint8Array(S)],{type:"image/png"});j.cacheControl=C,j.expires=z,j.src=S.byteLength?G.createObjectURL(te):T})(m,t,g,b))}));return{cancel:function(){c.cancel(),l()}}};function B(e,t,r){r[e]&&r[e].indexOf(t)!==-1||(r[e]=r[e]||[],r[e].push(t))}function V(e,t,r){if(r&&r[e]){var a=r[e].indexOf(t);a!==-1&&r[e].splice(a,1)}}var $=function(e,t){t===void 0&&(t={}),Ue(this,t),this.type=e},re=(function(e){function t(r,a){a===void 0&&(a={}),e.call(this,"error",Ue({error:r},a))}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})($),ie=function(){};ie.prototype.on=function(e,t){return this._listeners=this._listeners||{},B(e,t,this._listeners),this},ie.prototype.off=function(e,t){return V(e,t,this._listeners),V(e,t,this._oneTimeListeners),this},ie.prototype.once=function(e,t){return this._oneTimeListeners=this._oneTimeListeners||{},B(e,t,this._oneTimeListeners),this},ie.prototype.fire=function(e,t){typeof e=="string"&&(e=new $(e,t||{}));var r=e.type;if(this.listens(r)){e.target=this;for(var a=0,l=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];a<l.length;a+=1)l[a].call(this,e);for(var c=0,h=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];c<h.length;c+=1){var m=h[c];V(r,m,this._oneTimeListeners),m.call(this,e)}var g=this._eventedParent;g&&(Ue(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),g.fire(e))}else e instanceof re&&console.error(e.error);return this},ie.prototype.listens=function(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)},ie.prototype.setEventedParent=function(e,t){return this._eventedParent=e,this._eventedParentData=t,this};var L={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,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:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},H=function(e,t,r,a){this.message=(e?e+": ":"")+r,a&&(this.identifier=a),t!=null&&t.__line__&&(this.line=t.__line__)};function se(e){var t=e.value;return t?[new H(e.key,t,"constants have been deprecated as of v8")]:[]}function Ie(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var a=0,l=t;a<l.length;a+=1){var c=l[a];for(var h in c)e[h]=c[h]}return e}function Ee(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function ye(e){if(Array.isArray(e))return e.map(ye);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){var t={};for(var r in e)t[r]=ye(e[r]);return t}return Ee(e)}var Ae=(function(e){function t(r,a){e.call(this,a),this.message=a,this.key=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(Error),Je=function(e,t){t===void 0&&(t=[]),this.parent=e,this.bindings={};for(var r=0,a=t;r<a.length;r+=1){var l=a[r];this.bindings[l[0]]=l[1]}};Je.prototype.concat=function(e){return new Je(this,e)},Je.prototype.get=function(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.")},Je.prototype.has=function(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)};var Ge={kind:"null"},ge={kind:"number"},Ve={kind:"string"},Be={kind:"boolean"},Me={kind:"color"},yt={kind:"object"},Fe={kind:"value"},Pt={kind:"collator"},rr={kind:"formatted"},Ct={kind:"resolvedImage"};function Gt(e,t){return{kind:"array",itemType:e,N:t}}function Rt(e){if(e.kind==="array"){var t=Rt(e.itemType);return typeof e.N=="number"?"array<"+t+", "+e.N+">":e.itemType.kind==="value"?"array":"array<"+t+">"}return e.kind}var wi=[Ge,ge,Ve,Be,Me,rr,yt,Gt(Fe),Ct];function Ht(e,t){if(t.kind==="error")return null;if(e.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!Ht(e.itemType,t.itemType))&&(typeof e.N!="number"||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if(e.kind==="value"){for(var r=0,a=wi;r<a.length;r+=1)if(!Ht(a[r],t))return null}}return"Expected "+Rt(e)+" but found "+Rt(t)+" instead."}function Cr(e,t){return t.some((function(r){return r.kind===e.kind}))}function Qt(e,t){return t.some((function(r){return r==="null"?e===null:r==="array"?Array.isArray(e):r==="object"?e&&!Array.isArray(e)&&typeof e=="object":r===typeof e}))}var zt=U((function(e,t){var r={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 a(m){return(m=Math.round(m))<0?0:m>255?255:m}function l(m){return a(m[m.length-1]==="%"?parseFloat(m)/100*255:parseInt(m))}function c(m){return(g=m[m.length-1]==="%"?parseFloat(m)/100:parseFloat(m))<0?0:g>1?1:g;var g}function h(m,g,b){return b<0?b+=1:b>1&&(b-=1),6*b<1?m+(g-m)*b*6:2*b<1?g:3*b<2?m+(g-m)*(2/3-b)*6:m}try{t.parseCSSColor=function(m){var g,b=m.replace(/ /g,"").toLowerCase();if(b in r)return r[b].slice();if(b[0]==="#")return b.length===4?(g=parseInt(b.substr(1),16))>=0&&g<=4095?[(3840&g)>>4|(3840&g)>>8,240&g|(240&g)>>4,15&g|(15&g)<<4,1]:null:b.length===7&&(g=parseInt(b.substr(1),16))>=0&&g<=16777215?[(16711680&g)>>16,(65280&g)>>8,255&g,1]:null;var S=b.indexOf("("),I=b.indexOf(")");if(S!==-1&&I+1===b.length){var C=b.substr(0,S),z=b.substr(S+1,I-(S+1)).split(","),j=1;switch(C){case"rgba":if(z.length!==4)return null;j=c(z.pop());case"rgb":return z.length!==3?null:[l(z[0]),l(z[1]),l(z[2]),j];case"hsla":if(z.length!==4)return null;j=c(z.pop());case"hsl":if(z.length!==3)return null;var G=(parseFloat(z[0])%360+360)%360/360,te=c(z[1]),K=c(z[2]),oe=K<=.5?K*(te+1):K+te-K*te,le=2*K-oe;return[a(255*h(le,oe,G+1/3)),a(255*h(le,oe,G)),a(255*h(le,oe,G-1/3)),j];default:return null}}return null}}catch{}})).parseCSSColor,$t=function(e,t,r,a){a===void 0&&(a=1),this.r=e,this.g=t,this.b=r,this.a=a};$t.parse=function(e){if(e){if(e instanceof $t)return e;if(typeof e=="string"){var t=zt(e);if(t)return new $t(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},$t.prototype.toString=function(){var e=this.toArray(),t=e[1],r=e[2],a=e[3];return"rgba("+Math.round(e[0])+","+Math.round(t)+","+Math.round(r)+","+a+")"},$t.prototype.toArray=function(){var e=this.a;return e===0?[0,0,0,0]:[255*this.r/e,255*this.g/e,255*this.b/e,e]},$t.black=new $t(0,0,0,1),$t.white=new $t(1,1,1,1),$t.transparent=new $t(0,0,0,0),$t.red=new $t(1,0,0,1);var zi=function(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};zi.prototype.compare=function(e,t){return this.collator.compare(e,t)},zi.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var ma=function(e,t,r,a,l){this.text=e,this.image=t,this.scale=r,this.fontStack=a,this.textColor=l},ni=function(e){this.sections=e};ni.fromString=function(e){return new ni([new ma(e,null,null,null,null)])},ni.prototype.isEmpty=function(){return this.sections.length===0||!this.sections.some((function(e){return e.text.length!==0||e.image&&e.image.name.length!==0}))},ni.factory=function(e){return e instanceof ni?e:ni.fromString(e)},ni.prototype.toString=function(){return this.sections.length===0?"":this.sections.map((function(e){return e.text})).join("")},ni.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var a=r[t];if(a.image)e.push(["image",a.image.name]);else{e.push(a.text);var l={};a.fontStack&&(l["text-font"]=["literal",a.fontStack.split(",")]),a.scale&&(l["font-scale"]=a.scale),a.textColor&&(l["text-color"]=["rgba"].concat(a.textColor.toArray())),e.push(l)}}return e};var Di=function(e){this.name=e.name,this.available=e.available};function ru(e,t,r,a){return typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof r=="number"&&r>=0&&r<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:"Invalid rgba value ["+[e,t,r,a].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+(typeof a=="number"?[e,t,r,a]:[e,t,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ya(e){if(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||e instanceof $t||e instanceof zi||e instanceof ni||e instanceof Di)return!0;if(Array.isArray(e)){for(var t=0,r=e;t<r.length;t+=1)if(!ya(r[t]))return!1;return!0}if(typeof e=="object"){for(var a in e)if(!ya(e[a]))return!1;return!0}return!1}function kr(e){if(e===null)return Ge;if(typeof e=="string")return Ve;if(typeof e=="boolean")return Be;if(typeof e=="number")return ge;if(e instanceof $t)return Me;if(e instanceof zi)return Pt;if(e instanceof ni)return rr;if(e instanceof Di)return Ct;if(Array.isArray(e)){for(var t,r=e.length,a=0,l=e;a<l.length;a+=1){var c=kr(l[a]);if(t){if(t===c)continue;t=Fe;break}t=c}return Gt(t||Fe,r)}return yt}function va(e){var t=typeof e;return e===null?"":t==="string"||t==="number"||t==="boolean"?String(e):e instanceof $t||e instanceof ni||e instanceof Di?e.toString():JSON.stringify(e)}Di.prototype.toString=function(){return this.name},Di.fromString=function(e){return e?new Di({name:e,available:!1}):null},Di.prototype.serialize=function(){return["image",this.name]};var Si=function(e,t){this.type=e,this.value=t};Si.parse=function(e,t){if(e.length!==2)return t.error("'literal' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(!ya(e[1]))return t.error("invalid value");var r=e[1],a=kr(r),l=t.expectedType;return a.kind!=="array"||a.N!==0||!l||l.kind!=="array"||typeof l.N=="number"&&l.N!==0||(a=l),new Si(a,r)},Si.prototype.evaluate=function(){return this.value},Si.prototype.eachChild=function(){},Si.prototype.outputDefined=function(){return!0},Si.prototype.serialize=function(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof $t?["rgba"].concat(this.value.toArray()):this.value instanceof ni?this.value.serialize():this.value};var oi=function(e){this.name="ExpressionEvaluationError",this.message=e};oi.prototype.toJSON=function(){return this.message};var nn={string:Ve,number:ge,boolean:Be,object:yt},yr=function(e,t){this.type=e,this.args=t};yr.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r,a=1,l=e[0];if(l==="array"){var c,h;if(e.length>2){var m=e[1];if(typeof m!="string"||!(m in nn)||m==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);c=nn[m],a++}else c=Fe;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);h=e[2],a++}r=Gt(c,h)}else r=nn[l];for(var g=[];a<e.length;a++){var b=t.parse(e[a],a,Fe);if(!b)return null;g.push(b)}return new yr(r,g)},yr.prototype.evaluate=function(e){for(var t=0;t<this.args.length;t++){var r=this.args[t].evaluate(e);if(!Ht(this.type,kr(r)))return r;if(t===this.args.length-1)throw new oi("Expected value to be of type "+Rt(this.type)+", but found "+Rt(kr(r))+" instead.")}return null},yr.prototype.eachChild=function(e){this.args.forEach(e)},yr.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},yr.prototype.serialize=function(){var e=this.type,t=[e.kind];if(e.kind==="array"){var r=e.itemType;if(r.kind==="string"||r.kind==="number"||r.kind==="boolean"){t.push(r.kind);var a=e.N;(typeof a=="number"||this.args.length>1)&&t.push(a)}}return t.concat(this.args.map((function(l){return l.serialize()})))};var yn=function(e){this.type=rr,this.sections=e};yn.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[1];if(!Array.isArray(r)&&typeof r=="object")return t.error("First argument must be an image or text section.");for(var a=[],l=!1,c=1;c<=e.length-1;++c){var h=e[c];if(l&&typeof h=="object"&&!Array.isArray(h)){l=!1;var m=null;if(h["font-scale"]&&!(m=t.parse(h["font-scale"],1,ge)))return null;var g=null;if(h["text-font"]&&!(g=t.parse(h["text-font"],1,Gt(Ve))))return null;var b=null;if(h["text-color"]&&!(b=t.parse(h["text-color"],1,Me)))return null;var S=a[a.length-1];S.scale=m,S.font=g,S.textColor=b}else{var I=t.parse(e[c],1,Fe);if(!I)return null;var C=I.type.kind;if(C!=="string"&&C!=="value"&&C!=="null"&&C!=="resolvedImage")return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");l=!0,a.push({content:I,scale:null,font:null,textColor:null})}}return new yn(a)},yn.prototype.evaluate=function(e){return new ni(this.sections.map((function(t){var r=t.content.evaluate(e);return kr(r)===Ct?new ma("",r,null,null,null):new ma(va(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))},yn.prototype.eachChild=function(e){for(var t=0,r=this.sections;t<r.length;t+=1){var a=r[t];e(a.content),a.scale&&e(a.scale),a.font&&e(a.font),a.textColor&&e(a.textColor)}},yn.prototype.outputDefined=function(){return!1},yn.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var a=r[t];e.push(a.content.serialize());var l={};a.scale&&(l["font-scale"]=a.scale.serialize()),a.font&&(l["text-font"]=a.font.serialize()),a.textColor&&(l["text-color"]=a.textColor.serialize()),e.push(l)}return e};var Ji=function(e){this.type=Ct,this.input=e};Ji.parse=function(e,t){if(e.length!==2)return t.error("Expected two arguments.");var r=t.parse(e[1],1,Ve);return r?new Ji(r):t.error("No image name provided.")},Ji.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=Di.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r},Ji.prototype.eachChild=function(e){e(this.input)},Ji.prototype.outputDefined=function(){return!1},Ji.prototype.serialize=function(){return["image",this.input.serialize()]};var al={"to-boolean":Be,"to-color":Me,"to-number":ge,"to-string":Ve},on=function(e,t){this.type=e,this.args=t};on.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[0];if((r==="to-boolean"||r==="to-string")&&e.length!==2)return t.error("Expected one argument.");for(var a=al[r],l=[],c=1;c<e.length;c++){var h=t.parse(e[c],c,Fe);if(!h)return null;l.push(h)}return new on(a,l)},on.prototype.evaluate=function(e){if(this.type.kind==="boolean")return!!this.args[0].evaluate(e);if(this.type.kind==="color"){for(var t,r,a=0,l=this.args;a<l.length;a+=1){if(r=null,(t=l[a].evaluate(e))instanceof $t)return t;if(typeof t=="string"){var c=e.parseColor(t);if(c)return c}else if(Array.isArray(t)&&!(r=t.length<3||t.length>4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":ru(t[0],t[1],t[2],t[3])))return new $t(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new oi(r||"Could not parse color from value '"+(typeof t=="string"?t:String(JSON.stringify(t)))+"'")}if(this.type.kind==="number"){for(var h=null,m=0,g=this.args;m<g.length;m+=1){if((h=g[m].evaluate(e))===null)return 0;var b=Number(h);if(!isNaN(b))return b}throw new oi("Could not convert "+JSON.stringify(h)+" to number.")}return this.type.kind==="formatted"?ni.fromString(va(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?Di.fromString(va(this.args[0].evaluate(e))):va(this.args[0].evaluate(e))},on.prototype.eachChild=function(e){this.args.forEach(e)},on.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},on.prototype.serialize=function(){if(this.type.kind==="formatted")return new yn([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Ji(this.args[0]).serialize();var e=["to-"+this.type.kind];return this.eachChild((function(t){e.push(t.serialize())})),e};var Pc=["Unknown","Point","LineString","Polygon"],Dn=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};Dn.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},Dn.prototype.geometryType=function(){return this.feature?typeof this.feature.type=="number"?Pc[this.feature.type]:this.feature.type:null},Dn.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Dn.prototype.canonicalID=function(){return this.canonical},Dn.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Dn.prototype.parseColor=function(e){var t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=$t.parse(e)),t};var di=function(e,t,r,a){this.name=e,this.type=t,this._evaluate=r,this.args=a};di.prototype.evaluate=function(e){return this._evaluate(e,this.args)},di.prototype.eachChild=function(e){this.args.forEach(e)},di.prototype.outputDefined=function(){return!1},di.prototype.serialize=function(){return[this.name].concat(this.args.map((function(e){return e.serialize()})))},di.parse=function(e,t){var r,a=e[0],l=di.definitions[a];if(!l)return t.error('Unknown expression "'+a+'". If you wanted a literal array, use ["literal", [...]].',0);for(var c=Array.isArray(l)?l[0]:l.type,h=Array.isArray(l)?[[l[1],l[2]]]:l.overloads,m=h.filter((function(ot){var qe=ot[0];return!Array.isArray(qe)||qe.length===e.length-1})),g=null,b=0,S=m;b<S.length;b+=1){var I=S[b],C=I[0],z=I[1];g=new Wn(t.registry,t.path,null,t.scope);for(var j=[],G=!1,te=1;te<e.length;te++){var K=e[te],oe=Array.isArray(C)?C[te-1]:C.type,le=g.parse(K,1+j.length,oe);if(!le){G=!0;break}j.push(le)}if(!G)if(Array.isArray(C)&&C.length!==j.length)g.error("Expected "+C.length+" arguments, but found "+j.length+" instead.");else{for(var ce=0;ce<j.length;ce++){var he=Array.isArray(C)?C[ce]:C.type,xe=j[ce];g.concat(ce+1).checkSubtype(he,xe.type)}if(g.errors.length===0)return new di(a,c,z,j)}}if(m.length===1)(r=t.errors).push.apply(r,g.errors);else{for(var Pe=(m.length?m:h).map((function(ot){var qe;return qe=ot[0],Array.isArray(qe)?"("+qe.map(Rt).join(", ")+")":"("+Rt(qe.type)+"...)"})).join(" | "),ze=[],rt=1;rt<e.length;rt++){var Oe=t.parse(e[rt],1+ze.length);if(!Oe)return null;ze.push(Rt(Oe.type))}t.error("Expected arguments of type "+Pe+", but found ("+ze.join(", ")+") instead.")}return null},di.register=function(e,t){for(var r in di.definitions=t,t)e[r]=di};var In=function(e,t,r){this.type=Pt,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t};function Ii(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function vo(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function Cc(e,t){var r=(180+e[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,l=Math.pow(2,t.z);return[Math.round(r*l*8192),Math.round(a*l*8192)]}function kc(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function iu(e,t){for(var r,a,l,c,h,m,g,b=!1,S=0,I=t.length;S<I;S++)for(var C=t[S],z=0,j=C.length;z<j-1;z++){if((c=(r=e)[0]-(a=C[z])[0])*(g=r[1]-(l=C[z+1])[1])-(m=r[0]-l[0])*(h=r[1]-a[1])==0&&c*m<=0&&h*g<=0)return!1;kc(e,C[z],C[z+1])&&(b=!b)}return b}function Mc(e,t){for(var r=0;r<t.length;r++)if(iu(e,t[r]))return!0;return!1}function sl(e,t,r,a){var l=a[0]-r[0],c=a[1]-r[1],h=(e[0]-r[0])*c-l*(e[1]-r[1]),m=(t[0]-r[0])*c-l*(t[1]-r[1]);return h>0&&m<0||h<0&&m>0}function Bc(e,t,r){for(var a=0,l=r;a<l.length;a+=1)for(var c=l[a],h=0;h<c.length-1;++h)if((I=[(S=c[h+1])[0]-(b=c[h])[0],S[1]-b[1]])[0]*(C=[(g=t)[0]-(m=e)[0],g[1]-m[1]])[1]-I[1]*C[0]!=0&&sl(m,g,b,S)&&sl(b,S,m,g))return!0;var m,g,b,S,I,C;return!1}function ul(e,t){for(var r=0;r<e.length;++r)if(!iu(e[r],t))return!1;for(var a=0;a<e.length-1;++a)if(Bc(e[a],e[a+1],t))return!1;return!0}function ll(e,t){for(var r=0;r<t.length;r++)if(ul(e,t[r]))return!0;return!1}function Wo(e,t,r){for(var a=[],l=0;l<e.length;l++){for(var c=[],h=0;h<e[l].length;h++){var m=Cc(e[l][h],r);Ii(t,m),c.push(m)}a.push(c)}return a}function nu(e,t,r){for(var a=[],l=0;l<e.length;l++){var c=Wo(e[l],t,r);a.push(c)}return a}function ga(e,t,r,a){if(e[0]<r[0]||e[0]>r[2]){var l=.5*a,c=e[0]-r[0]>l?-a:r[0]-e[0]>l?a:0;c===0&&(c=e[0]-r[2]>l?-a:r[2]-e[0]>l?a:0),e[0]+=c}Ii(t,e)}function cl(e,t,r,a){for(var l=8192*Math.pow(2,a.z),c=[8192*a.x,8192*a.y],h=[],m=0,g=e;m<g.length;m+=1)for(var b=0,S=g[m];b<S.length;b+=1){var I=S[b],C=[I.x+c[0],I.y+c[1]];ga(C,t,r,l),h.push(C)}return h}function Qa(e,t,r,a){for(var l,c=8192*Math.pow(2,a.z),h=[8192*a.x,8192*a.y],m=[],g=0,b=e;g<b.length;g+=1){for(var S=[],I=0,C=b[g];I<C.length;I+=1){var z=C[I],j=[z.x+h[0],z.y+h[1]];Ii(t,j),S.push(j)}m.push(S)}if(t[2]-t[0]<=c/2){(l=t)[0]=l[1]=1/0,l[2]=l[3]=-1/0;for(var G=0,te=m;G<te.length;G+=1)for(var K=0,oe=te[G];K<oe.length;K+=1)ga(oe[K],t,r,c)}return m}In.parse=function(e,t){if(e.length!==2)return t.error("Expected one argument.");var r=e[1];if(typeof r!="object"||Array.isArray(r))return t.error("Collator options argument must be an object.");var a=t.parse(r["case-sensitive"]!==void 0&&r["case-sensitive"],1,Be);if(!a)return null;var l=t.parse(r["diacritic-sensitive"]!==void 0&&r["diacritic-sensitive"],1,Be);if(!l)return null;var c=null;return r.locale&&!(c=t.parse(r.locale,1,Ve))?null:new In(a,l,c)},In.prototype.evaluate=function(e){return new zi(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)},In.prototype.eachChild=function(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)},In.prototype.outputDefined=function(){return!1},In.prototype.serialize=function(){var e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]};var an=function(e,t){this.type=Be,this.geojson=e,this.geometries=t};function Gn(e){if(e instanceof di&&(e.name==="get"&&e.args.length===1||e.name==="feature-state"||e.name==="has"&&e.args.length===1||e.name==="properties"||e.name==="geometry-type"||e.name==="id"||/^filter-/.test(e.name))||e instanceof an)return!1;var t=!0;return e.eachChild((function(r){t&&!Gn(r)&&(t=!1)})),t}function $n(e){if(e instanceof di&&e.name==="feature-state")return!1;var t=!0;return e.eachChild((function(r){t&&!$n(r)&&(t=!1)})),t}function go(e,t){if(e instanceof di&&t.indexOf(e.name)>=0)return!1;var r=!0;return e.eachChild((function(a){r&&!go(a,t)&&(r=!1)})),r}an.parse=function(e,t){if(e.length!==2)return t.error("'within' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(ya(e[1])){var r=e[1];if(r.type==="FeatureCollection")for(var a=0;a<r.features.length;++a){var l=r.features[a].geometry.type;if(l==="Polygon"||l==="MultiPolygon")return new an(r,r.features[a].geometry)}else if(r.type==="Feature"){var c=r.geometry.type;if(c==="Polygon"||c==="MultiPolygon")return new an(r,r.geometry)}else if(r.type==="Polygon"||r.type==="MultiPolygon")return new an(r,r)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")},an.prototype.evaluate=function(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return(function(t,r){var a=[1/0,1/0,-1/0,-1/0],l=[1/0,1/0,-1/0,-1/0],c=t.canonicalID();if(r.type==="Polygon"){var h=Wo(r.coordinates,l,c),m=cl(t.geometry(),a,l,c);if(!vo(a,l))return!1;for(var g=0,b=m;g<b.length;g+=1)if(!iu(b[g],h))return!1}if(r.type==="MultiPolygon"){var S=nu(r.coordinates,l,c),I=cl(t.geometry(),a,l,c);if(!vo(a,l))return!1;for(var C=0,z=I;C<z.length;C+=1)if(!Mc(z[C],S))return!1}return!0})(e,this.geometries);if(e.geometryType()==="LineString")return(function(t,r){var a=[1/0,1/0,-1/0,-1/0],l=[1/0,1/0,-1/0,-1/0],c=t.canonicalID();if(r.type==="Polygon"){var h=Wo(r.coordinates,l,c),m=Qa(t.geometry(),a,l,c);if(!vo(a,l))return!1;for(var g=0,b=m;g<b.length;g+=1)if(!ul(b[g],h))return!1}if(r.type==="MultiPolygon"){var S=nu(r.coordinates,l,c),I=Qa(t.geometry(),a,l,c);if(!vo(a,l))return!1;for(var C=0,z=I;C<z.length;C+=1)if(!ll(z[C],S))return!1}return!0})(e,this.geometries)}return!1},an.prototype.eachChild=function(){},an.prototype.outputDefined=function(){return!0},an.prototype.serialize=function(){return["within",this.geojson]};var Zn=function(e,t){this.type=t.type,this.name=e,this.boundExpression=t};Zn.parse=function(e,t){if(e.length!==2||typeof e[1]!="string")return t.error("'var' expression requires exactly one string literal argument.");var r=e[1];return t.scope.has(r)?new Zn(r,t.scope.get(r)):t.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},Zn.prototype.evaluate=function(e){return this.boundExpression.evaluate(e)},Zn.prototype.eachChild=function(){},Zn.prototype.outputDefined=function(){return!1},Zn.prototype.serialize=function(){return["var",this.name]};var Wn=function(e,t,r,a,l){t===void 0&&(t=[]),a===void 0&&(a=new Je),l===void 0&&(l=[]),this.registry=e,this.path=t,this.key=t.map((function(c){return"["+c+"]"})).join(""),this.scope=a,this.errors=l,this.expectedType=r};function es(e,t){for(var r,a=e.length-1,l=0,c=a,h=0;l<=c;)if((r=e[h=Math.floor((l+c)/2)])<=t){if(h===a||t<e[h+1])return h;l=h+1}else{if(!(r>t))throw new oi("Input is not a number.");c=h-1}return 0}Wn.prototype.parse=function(e,t,r,a,l){return l===void 0&&(l={}),t?this.concat(t,r,a)._parse(e,l):this._parse(e,l)},Wn.prototype._parse=function(e,t){function r(b,S,I){return I==="assert"?new yr(S,[b]):I==="coerce"?new on(S,[b]):b}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", []].');var a=e[0];if(typeof a!="string")return this.error("Expression name must be a string, but found "+typeof a+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var l=this.registry[a];if(l){var c=l.parse(e,this);if(!c)return null;if(this.expectedType){var h=this.expectedType,m=c.type;if(h.kind!=="string"&&h.kind!=="number"&&h.kind!=="boolean"&&h.kind!=="object"&&h.kind!=="array"||m.kind!=="value")if(h.kind!=="color"&&h.kind!=="formatted"&&h.kind!=="resolvedImage"||m.kind!=="value"&&m.kind!=="string"){if(this.checkSubtype(h,m))return null}else c=r(c,h,t.typeAnnotation||"coerce");else c=r(c,h,t.typeAnnotation||"assert")}if(!(c instanceof Si)&&c.type.kind!=="resolvedImage"&&(function b(S){if(S instanceof Zn)return b(S.boundExpression);if(S instanceof di&&S.name==="error"||S instanceof In||S instanceof an)return!1;var I=S instanceof on||S instanceof yr,C=!0;return S.eachChild((function(z){C=I?C&&b(z):C&&z instanceof Si})),!!C&&Gn(S)&&go(S,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])})(c)){var g=new Dn;try{c=new Si(c.type,c.evaluate(g))}catch(b){return this.error(b.message),null}}return c}return this.error('Unknown expression "'+a+'". 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.")},Wn.prototype.concat=function(e,t,r){var a=typeof e=="number"?this.path.concat(e):this.path,l=r?this.scope.concat(r):this.scope;return new Wn(this.registry,a,t||null,l,this.errors)},Wn.prototype.error=function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];var a=""+this.key+t.map((function(l){return"["+l+"]"})).join("");this.errors.push(new Ae(a,e))},Wn.prototype.checkSubtype=function(e,t){var r=Ht(e,t);return r&&this.error(r),r};var Ui=function(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var a=0,l=r;a<l.length;a+=1){var c=l[a],h=c[1];this.labels.push(c[0]),this.outputs.push(h)}};function Vr(e,t,r){return e*(1-r)+t*r}Ui.parse=function(e,t){if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");var r=t.parse(e[1],1,ge);if(!r)return null;var a=[],l=null;t.expectedType&&t.expectedType.kind!=="value"&&(l=t.expectedType);for(var c=1;c<e.length;c+=2){var h=c===1?-1/0:e[c],m=e[c+1],g=c,b=c+1;if(typeof h!="number")return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',g);if(a.length&&a[a.length-1][0]>=h)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',g);var S=t.parse(m,b,l);if(!S)return null;l=l||S.type,a.push([h,S])}return new Ui(l,r,a)},Ui.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(t.length===1)return r[0].evaluate(e);var a=this.input.evaluate(e);if(a<=t[0])return r[0].evaluate(e);var l=t.length;return a>=t[l-1]?r[l-1].evaluate(e):r[es(t,a)].evaluate(e)},Ui.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1)e(r[t])},Ui.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))},Ui.prototype.serialize=function(){for(var e=["step",this.input.serialize()],t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var Ho=Object.freeze({__proto__:null,number:Vr,color:function(e,t,r){return new $t(Vr(e.r,t.r,r),Vr(e.g,t.g,r),Vr(e.b,t.b,r),Vr(e.a,t.a,r))},array:function(e,t,r){return e.map((function(a,l){return Vr(a,t[l],r)}))}}),pl=6/29*3*(6/29),zc=Math.PI/180,Dc=180/Math.PI;function ou(e){return e>.008856451679035631?Math.pow(e,1/3):e/pl+4/29}function au(e){return e>6/29?e*e*e:pl*(e-4/29)}function su(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function uu(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function hl(e){var t=uu(e.r),r=uu(e.g),a=uu(e.b),l=ou((.4124564*t+.3575761*r+.1804375*a)/.95047),c=ou((.2126729*t+.7151522*r+.072175*a)/1);return{l:116*c-16,a:500*(l-c),b:200*(c-ou((.0193339*t+.119192*r+.9503041*a)/1.08883)),alpha:e.a}}function fl(e){var t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,a=isNaN(e.b)?t:t-e.b/200;return t=1*au(t),r=.95047*au(r),a=1.08883*au(a),new $t(su(3.2404542*r-1.5371385*t-.4985314*a),su(-.969266*r+1.8760108*t+.041556*a),su(.0556434*r-.2040259*t+1.0572252*a),e.alpha)}function Rc(e,t,r){var a=t-e;return e+r*(a>180||a<-180?a-360*Math.round(a/360):a)}var _a={forward:hl,reverse:fl,interpolate:function(e,t,r){return{l:Vr(e.l,t.l,r),a:Vr(e.a,t.a,r),b:Vr(e.b,t.b,r),alpha:Vr(e.alpha,t.alpha,r)}}},xa={forward:function(e){var t=hl(e),r=t.l,a=t.a,l=t.b,c=Math.atan2(l,a)*Dc;return{h:c<0?c+360:c,c:Math.sqrt(a*a+l*l),l:r,alpha:e.a}},reverse:function(e){var t=e.h*zc,r=e.c;return fl({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:Rc(e.h,t.h,r),c:Vr(e.c,t.c,r),l:Vr(e.l,t.l,r),alpha:Vr(e.alpha,t.alpha,r)}}},dl=Object.freeze({__proto__:null,lab:_a,hcl:xa}),mi=function(e,t,r,a,l){this.type=e,this.operator=t,this.interpolation=r,this.input=a,this.labels=[],this.outputs=[];for(var c=0,h=l;c<h.length;c+=1){var m=h[c],g=m[1];this.labels.push(m[0]),this.outputs.push(g)}};function lu(e,t,r,a){var l=a-r,c=e-r;return l===0?0:t===1?c/l:(Math.pow(t,c)-1)/(Math.pow(t,l)-1)}mi.interpolationFactor=function(e,t,r,a){var l=0;if(e.name==="exponential")l=lu(t,e.base,r,a);else if(e.name==="linear")l=lu(t,1,r,a);else if(e.name==="cubic-bezier"){var c=e.controlPoints;l=new M(c[0],c[1],c[2],c[3]).solve(lu(t,1,r,a))}return l},mi.parse=function(e,t){var r=e[0],a=e[1],l=e[2],c=e.slice(3);if(!Array.isArray(a)||a.length===0)return t.error("Expected an interpolation type expression.",1);if(a[0]==="linear")a={name:"linear"};else if(a[0]==="exponential"){var h=a[1];if(typeof h!="number")return t.error("Exponential interpolation requires a numeric base.",1,1);a={name:"exponential",base:h}}else{if(a[0]!=="cubic-bezier")return t.error("Unknown interpolation type "+String(a[0]),1,0);var m=a.slice(1);if(m.length!==4||m.some((function(te){return typeof te!="number"||te<0||te>1})))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:m}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(!(l=t.parse(l,2,ge)))return null;var g=[],b=null;r==="interpolate-hcl"||r==="interpolate-lab"?b=Me:t.expectedType&&t.expectedType.kind!=="value"&&(b=t.expectedType);for(var S=0;S<c.length;S+=2){var I=c[S],C=c[S+1],z=S+3,j=S+4;if(typeof I!="number")return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',z);if(g.length&&g[g.length-1][0]>=I)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',z);var G=t.parse(C,j,b);if(!G)return null;b=b||G.type,g.push([I,G])}return b.kind==="number"||b.kind==="color"||b.kind==="array"&&b.itemType.kind==="number"&&typeof b.N=="number"?new mi(b,r,a,l,g):t.error("Type "+Rt(b)+" is not interpolatable.")},mi.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(t.length===1)return r[0].evaluate(e);var a=this.input.evaluate(e);if(a<=t[0])return r[0].evaluate(e);var l=t.length;if(a>=t[l-1])return r[l-1].evaluate(e);var c=es(t,a),h=mi.interpolationFactor(this.interpolation,a,t[c],t[c+1]),m=r[c].evaluate(e),g=r[c+1].evaluate(e);return this.operator==="interpolate"?Ho[this.type.kind.toLowerCase()](m,g,h):this.operator==="interpolate-hcl"?xa.reverse(xa.interpolate(xa.forward(m),xa.forward(g),h)):_a.reverse(_a.interpolate(_a.forward(m),_a.forward(g),h))},mi.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1)e(r[t])},mi.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))},mi.prototype.serialize=function(){var 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);for(var t=[this.operator,e,this.input.serialize()],r=0;r<this.labels.length;r++)t.push(this.labels[r],this.outputs[r].serialize());return t};var Hn=function(e,t){this.type=e,this.args=t};Hn.parse=function(e,t){if(e.length<2)return t.error("Expectected at least one argument.");var r=null,a=t.expectedType;a&&a.kind!=="value"&&(r=a);for(var l=[],c=0,h=e.slice(1);c<h.length;c+=1){var m=t.parse(h[c],1+l.length,r,void 0,{typeAnnotation:"omit"});if(!m)return null;r=r||m.type,l.push(m)}var g=a&&l.some((function(b){return Ht(a,b.type)}));return new Hn(g?Fe:r,l)},Hn.prototype.evaluate=function(e){for(var t,r=null,a=0,l=0,c=this.args;l<c.length&&(a++,(r=c[l].evaluate(e))&&r instanceof Di&&!r.available&&(t||(t=r.name),r=null,a===this.args.length&&(r=t)),r===null);l+=1);return r},Hn.prototype.eachChild=function(e){this.args.forEach(e)},Hn.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},Hn.prototype.serialize=function(){var e=["coalesce"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Xn=function(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t};Xn.prototype.evaluate=function(e){return this.result.evaluate(e)},Xn.prototype.eachChild=function(e){for(var t=0,r=this.bindings;t<r.length;t+=1)e(r[t][1]);e(this.result)},Xn.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found "+(e.length-1)+" instead.");for(var r=[],a=1;a<e.length-1;a+=2){var l=e[a];if(typeof l!="string")return t.error("Expected string, but found "+typeof l+" instead.",a);if(/[^a-zA-Z0-9_]/.test(l))return t.error("Variable names must contain only alphanumeric characters or '_'.",a);var c=t.parse(e[a+1],a+1);if(!c)return null;r.push([l,c])}var h=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return h?new Xn(r,h):null},Xn.prototype.outputDefined=function(){return this.result.outputDefined()},Xn.prototype.serialize=function(){for(var e=["let"],t=0,r=this.bindings;t<r.length;t+=1){var a=r[t];e.push(a[0],a[1].serialize())}return e.push(this.result.serialize()),e};var _o=function(e,t,r){this.type=e,this.index=t,this.input=r};_o.parse=function(e,t){if(e.length!==3)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,ge),a=t.parse(e[2],2,Gt(t.expectedType||Fe));return r&&a?new _o(a.type.itemType,r,a):null},_o.prototype.evaluate=function(e){var t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new oi("Array index out of bounds: "+t+" < 0.");if(t>=r.length)throw new oi("Array index out of bounds: "+t+" > "+(r.length-1)+".");if(t!==Math.floor(t))throw new oi("Array index must be an integer, but found "+t+" instead.");return r[t]},_o.prototype.eachChild=function(e){e(this.index),e(this.input)},_o.prototype.outputDefined=function(){return!1},_o.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var xo=function(e,t){this.type=Be,this.needle=e,this.haystack=t};xo.parse=function(e,t){if(e.length!==3)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,Fe),a=t.parse(e[2],2,Fe);return r&&a?Cr(r.type,[Be,Ve,ge,Ge,Fe])?new xo(r,a):t.error("Expected first argument to be of type boolean, string, number or null, but found "+Rt(r.type)+" instead"):null},xo.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!Qt(t,["boolean","string","number","null"]))throw new oi("Expected first argument to be of type boolean, string, number or null, but found "+Rt(kr(t))+" instead.");if(!Qt(r,["string","array"]))throw new oi("Expected second argument to be of type array or string, but found "+Rt(kr(r))+" instead.");return r.indexOf(t)>=0},xo.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},xo.prototype.outputDefined=function(){return!0},xo.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Kn=function(e,t,r){this.type=ge,this.needle=e,this.haystack=t,this.fromIndex=r};Kn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,Fe),a=t.parse(e[2],2,Fe);if(!r||!a)return null;if(!Cr(r.type,[Be,Ve,ge,Ge,Fe]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+Rt(r.type)+" instead");if(e.length===4){var l=t.parse(e[3],3,ge);return l?new Kn(r,a,l):null}return new Kn(r,a)},Kn.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!Qt(t,["boolean","string","number","null"]))throw new oi("Expected first argument to be of type boolean, string, number or null, but found "+Rt(kr(t))+" instead.");if(!Qt(r,["string","array"]))throw new oi("Expected second argument to be of type array or string, but found "+Rt(kr(r))+" instead.");if(this.fromIndex){var a=this.fromIndex.evaluate(e);return r.indexOf(t,a)}return r.indexOf(t)},Kn.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},Kn.prototype.outputDefined=function(){return!1},Kn.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var bo=function(e,t,r,a,l,c){this.inputType=e,this.type=t,this.input=r,this.cases=a,this.outputs=l,this.otherwise=c};bo.parse=function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if(e.length%2!=1)return t.error("Expected an even number of arguments.");var r,a;t.expectedType&&t.expectedType.kind!=="value"&&(a=t.expectedType);for(var l={},c=[],h=2;h<e.length-1;h+=2){var m=e[h],g=e[h+1];Array.isArray(m)||(m=[m]);var b=t.concat(h);if(m.length===0)return b.error("Expected at least one branch label.");for(var S=0,I=m;S<I.length;S+=1){var C=I[S];if(typeof C!="number"&&typeof C!="string")return b.error("Branch labels must be numbers or strings.");if(typeof C=="number"&&Math.abs(C)>Number.MAX_SAFE_INTEGER)return b.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof C=="number"&&Math.floor(C)!==C)return b.error("Numeric branch labels must be integer values.");if(r){if(b.checkSubtype(r,kr(C)))return null}else r=kr(C);if(l[String(C)]!==void 0)return b.error("Branch labels must be unique.");l[String(C)]=c.length}var z=t.parse(g,h,a);if(!z)return null;a=a||z.type,c.push(z)}var j=t.parse(e[1],1,Fe);if(!j)return null;var G=t.parse(e[e.length-1],e.length-1,a);return G?j.type.kind!=="value"&&t.concat(1).checkSubtype(r,j.type)?null:new bo(r,a,j,l,c,G):null},bo.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(kr(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},bo.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},bo.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))&&this.otherwise.outputDefined()},bo.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],r=[],a={},l=0,c=Object.keys(this.cases).sort();l<c.length;l+=1){var h=c[l];(I=a[this.cases[h]])===void 0?(a[this.cases[h]]=r.length,r.push([this.cases[h],[h]])):r[I][1].push(h)}for(var m=function(z){return e.inputType.kind==="number"?Number(z):z},g=0,b=r;g<b.length;g+=1){var S=b[g],I=S[0],C=S[1];t.push(C.length===1?m(C[0]):C.map(m)),t.push(this.outputs[outputIndex$1].serialize())}return t.push(this.otherwise.serialize()),t};var wo=function(e,t,r){this.type=e,this.branches=t,this.otherwise=r};wo.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found only "+(e.length-1)+".");if(e.length%2!=0)return t.error("Expected an odd number of arguments.");var r;t.expectedType&&t.expectedType.kind!=="value"&&(r=t.expectedType);for(var a=[],l=1;l<e.length-1;l+=2){var c=t.parse(e[l],l,Be);if(!c)return null;var h=t.parse(e[l+1],l+1,r);if(!h)return null;a.push([c,h]),r=r||h.type}var m=t.parse(e[e.length-1],e.length-1,r);return m?new wo(r,a,m):null},wo.prototype.evaluate=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var a=r[t],l=a[1];if(a[0].evaluate(e))return l.evaluate(e)}return this.otherwise.evaluate(e)},wo.prototype.eachChild=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var a=r[t],l=a[1];e(a[0]),e(l)}e(this.otherwise)},wo.prototype.outputDefined=function(){return this.branches.every((function(e){return e[1].outputDefined()}))&&this.otherwise.outputDefined()},wo.prototype.serialize=function(){var e=["case"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Jn=function(e,t,r,a){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=a};function ml(e,t){return e==="=="||e==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function yl(e,t,r,a){return a.compare(t,r)===0}function ir(e,t,r){var a=e!=="=="&&e!=="!=";return(function(){function l(c,h,m){this.type=Be,this.lhs=c,this.rhs=h,this.collator=m,this.hasUntypedArgument=c.type.kind==="value"||h.type.kind==="value"}return l.parse=function(c,h){if(c.length!==3&&c.length!==4)return h.error("Expected two or three arguments.");var m=c[0],g=h.parse(c[1],1,Fe);if(!g)return null;if(!ml(m,g.type))return h.concat(1).error('"'+m+`" comparisons are not supported for type '`+Rt(g.type)+"'.");var b=h.parse(c[2],2,Fe);if(!b)return null;if(!ml(m,b.type))return h.concat(2).error('"'+m+`" comparisons are not supported for type '`+Rt(b.type)+"'.");if(g.type.kind!==b.type.kind&&g.type.kind!=="value"&&b.type.kind!=="value")return h.error("Cannot compare types '"+Rt(g.type)+"' and '"+Rt(b.type)+"'.");a&&(g.type.kind==="value"&&b.type.kind!=="value"?g=new yr(b.type,[g]):g.type.kind!=="value"&&b.type.kind==="value"&&(b=new yr(g.type,[b])));var S=null;if(c.length===4){if(g.type.kind!=="string"&&b.type.kind!=="string"&&g.type.kind!=="value"&&b.type.kind!=="value")return h.error("Cannot use collator to compare non-string types.");if(!(S=h.parse(c[3],3,Pt)))return null}return new l(g,b,S)},l.prototype.evaluate=function(c){var h=this.lhs.evaluate(c),m=this.rhs.evaluate(c);if(a&&this.hasUntypedArgument){var g=kr(h),b=kr(m);if(g.kind!==b.kind||g.kind!=="string"&&g.kind!=="number")throw new oi('Expected arguments for "'+e+'" to be (string, string) or (number, number), but found ('+g.kind+", "+b.kind+") instead.")}if(this.collator&&!a&&this.hasUntypedArgument){var S=kr(h),I=kr(m);if(S.kind!=="string"||I.kind!=="string")return t(c,h,m)}return this.collator?r(c,h,m,this.collator.evaluate(c)):t(c,h,m)},l.prototype.eachChild=function(c){c(this.lhs),c(this.rhs),this.collator&&c(this.collator)},l.prototype.outputDefined=function(){return!0},l.prototype.serialize=function(){var c=[e];return this.eachChild((function(h){c.push(h.serialize())})),c},l})()}Jn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,Fe),a=t.parse(e[2],2,ge);if(!r||!a)return null;if(!Cr(r.type,[Gt(Fe),Ve,Fe]))return t.error("Expected first argument to be of type array or string, but found "+Rt(r.type)+" instead");if(e.length===4){var l=t.parse(e[3],3,ge);return l?new Jn(r.type,r,a,l):null}return new Jn(r.type,r,a)},Jn.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!Qt(t,["string","array"]))throw new oi("Expected first argument to be of type array or string, but found "+Rt(kr(t))+" instead.");if(this.endIndex){var a=this.endIndex.evaluate(e);return t.slice(r,a)}return t.slice(r)},Jn.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},Jn.prototype.outputDefined=function(){return!1},Jn.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var Lc=ir("==",(function(e,t,r){return t===r}),yl),ts=ir("!=",(function(e,t,r){return t!==r}),(function(e,t,r,a){return!yl(0,t,r,a)})),vl=ir("<",(function(e,t,r){return t<r}),(function(e,t,r,a){return a.compare(t,r)<0})),gl=ir(">",(function(e,t,r){return t>r}),(function(e,t,r,a){return a.compare(t,r)>0})),_l=ir("<=",(function(e,t,r){return t<=r}),(function(e,t,r,a){return a.compare(t,r)<=0})),xl=ir(">=",(function(e,t,r){return t>=r}),(function(e,t,r,a){return a.compare(t,r)>=0})),So=function(e,t,r,a,l){this.type=Ve,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=a,this.maxFractionDigits=l};So.parse=function(e,t){if(e.length!==3)return t.error("Expected two arguments.");var r=t.parse(e[1],1,ge);if(!r)return null;var a=e[2];if(typeof a!="object"||Array.isArray(a))return t.error("NumberFormat options argument must be an object.");var l=null;if(a.locale&&!(l=t.parse(a.locale,1,Ve)))return null;var c=null;if(a.currency&&!(c=t.parse(a.currency,1,Ve)))return null;var h=null;if(a["min-fraction-digits"]&&!(h=t.parse(a["min-fraction-digits"],1,ge)))return null;var m=null;return a["max-fraction-digits"]&&!(m=t.parse(a["max-fraction-digits"],1,ge))?null:new So(r,l,c,h,m)},So.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))},So.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},So.prototype.outputDefined=function(){return!1},So.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.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]};var Yn=function(e){this.type=ge,this.input=e};Yn.parse=function(e,t){if(e.length!==2)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1);return r?r.type.kind!=="array"&&r.type.kind!=="string"&&r.type.kind!=="value"?t.error("Expected argument of type string or array, but found "+Rt(r.type)+" instead."):new Yn(r):null},Yn.prototype.evaluate=function(e){var t=this.input.evaluate(e);if(typeof t=="string"||Array.isArray(t))return t.length;throw new oi("Expected value to be of type string or array, but found "+Rt(kr(t))+" instead.")},Yn.prototype.eachChild=function(e){e(this.input)},Yn.prototype.outputDefined=function(){return!1},Yn.prototype.serialize=function(){var e=["length"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Io={"==":Lc,"!=":ts,">":gl,"<":vl,">=":xl,"<=":_l,array:yr,at:_o,boolean:yr,case:wo,coalesce:Hn,collator:In,format:yn,image:Ji,in:xo,"index-of":Kn,interpolate:mi,"interpolate-hcl":mi,"interpolate-lab":mi,length:Yn,let:Xn,literal:Si,match:bo,number:yr,"number-format":So,object:yr,slice:Jn,step:Ui,string:yr,"to-boolean":on,"to-color":on,"to-number":on,"to-string":on,var:Zn,within:an};function bl(e,t){var r=t[0],a=t[1],l=t[2],c=t[3];r=r.evaluate(e),a=a.evaluate(e),l=l.evaluate(e);var h=c?c.evaluate(e):1,m=ru(r,a,l,h);if(m)throw new oi(m);return new $t(r/255*h,a/255*h,l/255*h,h)}function wl(e,t){return e in t}function cu(e,t){var r=t[e];return r===void 0?null:r}function To(e){return{type:e}}function Sl(e){return{result:"success",value:e}}function Ao(e){return{result:"error",value:e}}function Eo(e){return e["property-type"]==="data-driven"||e["property-type"]==="cross-faded-data-driven"}function Il(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function ba(e){return!!e.expression&&e.expression.interpolated}function ur(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":e===null?"null":typeof e}function rs(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Fc(e){return e}function Xo(e,t,r){return e!==void 0?e:t!==void 0?t:r!==void 0?r:void 0}function Tl(e,t,r,a,l){return Xo(typeof r===l?a[r]:void 0,e.default,t.default)}function Oc(e,t,r){if(ur(r)!=="number")return Xo(e.default,t.default);var a=e.stops.length;if(a===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[a-1][0])return e.stops[a-1][1];var l=es(e.stops.map((function(c){return c[0]})),r);return e.stops[l][1]}function Al(e,t,r){var a=e.base!==void 0?e.base:1;if(ur(r)!=="number")return Xo(e.default,t.default);var l=e.stops.length;if(l===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[l-1][0])return e.stops[l-1][1];var c=es(e.stops.map((function(I){return I[0]})),r),h=(function(I,C,z,j){var G=j-z,te=I-z;return G===0?0:C===1?te/G:(Math.pow(C,te)-1)/(Math.pow(C,G)-1)})(r,a,e.stops[c][0],e.stops[c+1][0]),m=e.stops[c][1],g=e.stops[c+1][1],b=Ho[t.type]||Fc;if(e.colorSpace&&e.colorSpace!=="rgb"){var S=dl[e.colorSpace];b=function(I,C){return S.reverse(S.interpolate(S.forward(I),S.forward(C),h))}}return typeof m.evaluate=="function"?{evaluate:function(){for(var I=[],C=arguments.length;C--;)I[C]=arguments[C];var z=m.evaluate.apply(void 0,I),j=g.evaluate.apply(void 0,I);if(z!==void 0&&j!==void 0)return b(z,j,h)}}:b(m,g,h)}function is(e,t,r){return t.type==="color"?r=$t.parse(r):t.type==="formatted"?r=ni.fromString(r.toString()):t.type==="resolvedImage"?r=Di.fromString(r.toString()):ur(r)===t.type||t.type==="enum"&&t.values[r]||(r=void 0),Xo(r,e.default,t.default)}di.register(Io,{error:[{kind:"error"},[Ve],function(e,t){throw new oi(t[0].evaluate(e))}],typeof:[Ve,[Fe],function(e,t){return Rt(kr(t[0].evaluate(e)))}],"to-rgba":[Gt(ge,4),[Me],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[Me,[ge,ge,ge],bl],rgba:[Me,[ge,ge,ge,ge],bl],has:{type:Be,overloads:[[[Ve],function(e,t){return wl(t[0].evaluate(e),e.properties())}],[[Ve,yt],function(e,t){var r=t[1];return wl(t[0].evaluate(e),r.evaluate(e))}]]},get:{type:Fe,overloads:[[[Ve],function(e,t){return cu(t[0].evaluate(e),e.properties())}],[[Ve,yt],function(e,t){var r=t[1];return cu(t[0].evaluate(e),r.evaluate(e))}]]},"feature-state":[Fe,[Ve],function(e,t){return cu(t[0].evaluate(e),e.featureState||{})}],properties:[yt,[],function(e){return e.properties()}],"geometry-type":[Ve,[],function(e){return e.geometryType()}],id:[Fe,[],function(e){return e.id()}],zoom:[ge,[],function(e){return e.globals.zoom}],"heatmap-density":[ge,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[ge,[],function(e){return e.globals.lineProgress||0}],accumulated:[Fe,[],function(e){return e.globals.accumulated===void 0?null:e.globals.accumulated}],"+":[ge,To(ge),function(e,t){for(var r=0,a=0,l=t;a<l.length;a+=1)r+=l[a].evaluate(e);return r}],"*":[ge,To(ge),function(e,t){for(var r=1,a=0,l=t;a<l.length;a+=1)r*=l[a].evaluate(e);return r}],"-":{type:ge,overloads:[[[ge,ge],function(e,t){var r=t[1];return t[0].evaluate(e)-r.evaluate(e)}],[[ge],function(e,t){return-t[0].evaluate(e)}]]},"/":[ge,[ge,ge],function(e,t){var r=t[1];return t[0].evaluate(e)/r.evaluate(e)}],"%":[ge,[ge,ge],function(e,t){var r=t[1];return t[0].evaluate(e)%r.evaluate(e)}],ln2:[ge,[],function(){return Math.LN2}],pi:[ge,[],function(){return Math.PI}],e:[ge,[],function(){return Math.E}],"^":[ge,[ge,ge],function(e,t){var r=t[1];return Math.pow(t[0].evaluate(e),r.evaluate(e))}],sqrt:[ge,[ge],function(e,t){return Math.sqrt(t[0].evaluate(e))}],log10:[ge,[ge],function(e,t){return Math.log(t[0].evaluate(e))/Math.LN10}],ln:[ge,[ge],function(e,t){return Math.log(t[0].evaluate(e))}],log2:[ge,[ge],function(e,t){return Math.log(t[0].evaluate(e))/Math.LN2}],sin:[ge,[ge],function(e,t){return Math.sin(t[0].evaluate(e))}],cos:[ge,[ge],function(e,t){return Math.cos(t[0].evaluate(e))}],tan:[ge,[ge],function(e,t){return Math.tan(t[0].evaluate(e))}],asin:[ge,[ge],function(e,t){return Math.asin(t[0].evaluate(e))}],acos:[ge,[ge],function(e,t){return Math.acos(t[0].evaluate(e))}],atan:[ge,[ge],function(e,t){return Math.atan(t[0].evaluate(e))}],min:[ge,To(ge),function(e,t){return Math.min.apply(Math,t.map((function(r){return r.evaluate(e)})))}],max:[ge,To(ge),function(e,t){return Math.max.apply(Math,t.map((function(r){return r.evaluate(e)})))}],abs:[ge,[ge],function(e,t){return Math.abs(t[0].evaluate(e))}],round:[ge,[ge],function(e,t){var r=t[0].evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[ge,[ge],function(e,t){return Math.floor(t[0].evaluate(e))}],ceil:[ge,[ge],function(e,t){return Math.ceil(t[0].evaluate(e))}],"filter-==":[Be,[Ve,Fe],function(e,t){var r=t[0],a=t[1];return e.properties()[r.value]===a.value}],"filter-id-==":[Be,[Fe],function(e,t){var r=t[0];return e.id()===r.value}],"filter-type-==":[Be,[Ve],function(e,t){var r=t[0];return e.geometryType()===r.value}],"filter-<":[Be,[Ve,Fe],function(e,t){var r=t[0],a=t[1],l=e.properties()[r.value],c=a.value;return typeof l==typeof c&&l<c}],"filter-id-<":[Be,[Fe],function(e,t){var r=t[0],a=e.id(),l=r.value;return typeof a==typeof l&&a<l}],"filter->":[Be,[Ve,Fe],function(e,t){var r=t[0],a=t[1],l=e.properties()[r.value],c=a.value;return typeof l==typeof c&&l>c}],"filter-id->":[Be,[Fe],function(e,t){var r=t[0],a=e.id(),l=r.value;return typeof a==typeof l&&a>l}],"filter-<=":[Be,[Ve,Fe],function(e,t){var r=t[0],a=t[1],l=e.properties()[r.value],c=a.value;return typeof l==typeof c&&l<=c}],"filter-id-<=":[Be,[Fe],function(e,t){var r=t[0],a=e.id(),l=r.value;return typeof a==typeof l&&a<=l}],"filter->=":[Be,[Ve,Fe],function(e,t){var r=t[0],a=t[1],l=e.properties()[r.value],c=a.value;return typeof l==typeof c&&l>=c}],"filter-id->=":[Be,[Fe],function(e,t){var r=t[0],a=e.id(),l=r.value;return typeof a==typeof l&&a>=l}],"filter-has":[Be,[Fe],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[Be,[],function(e){return e.id()!==null&&e.id()!==void 0}],"filter-type-in":[Be,[Gt(Ve)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[Be,[Gt(Fe)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[Be,[Ve,Gt(Fe)],function(e,t){var r=t[0];return t[1].value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[Be,[Ve,Gt(Fe)],function(e,t){var r=t[0],a=t[1];return(function(l,c,h,m){for(;h<=m;){var g=h+m>>1;if(c[g]===l)return!0;c[g]>l?m=g-1:h=g+1}return!1})(e.properties()[r.value],a.value,0,a.value.length-1)}],all:{type:Be,overloads:[[[Be,Be],function(e,t){var r=t[1];return t[0].evaluate(e)&&r.evaluate(e)}],[To(Be),function(e,t){for(var r=0,a=t;r<a.length;r+=1)if(!a[r].evaluate(e))return!1;return!0}]]},any:{type:Be,overloads:[[[Be,Be],function(e,t){var r=t[1];return t[0].evaluate(e)||r.evaluate(e)}],[To(Be),function(e,t){for(var r=0,a=t;r<a.length;r+=1)if(a[r].evaluate(e))return!0;return!1}]]},"!":[Be,[Be],function(e,t){return!t[0].evaluate(e)}],"is-supported-script":[Be,[Ve],function(e,t){var r=e.globals&&e.globals.isSupportedScript;return!r||r(t[0].evaluate(e))}],upcase:[Ve,[Ve],function(e,t){return t[0].evaluate(e).toUpperCase()}],downcase:[Ve,[Ve],function(e,t){return t[0].evaluate(e).toLowerCase()}],concat:[Ve,To(Fe),function(e,t){return t.map((function(r){return va(r.evaluate(e))})).join("")}],"resolved-locale":[Ve,[Pt],function(e,t){return t[0].evaluate(e).resolvedLocale()}]});var Ko=function(e,t){this.expression=e,this._warningHistory={},this._evaluator=new Dn,this._defaultValue=t?(function(r){return r.type==="color"&&rs(r.default)?new $t(0,0,0,0):r.type==="color"?$t.parse(r.default)||null:r.default===void 0?null:r.default})(t):null,this._enumValues=t&&t.type==="enum"?t.values:null};function wa(e){return Array.isArray(e)&&e.length>0&&typeof e[0]=="string"&&e[0]in Io}function ns(e,t){var r=new Wn(Io,[],t?(function(l){var c={color:Me,string:Ve,number:ge,enum:Ve,boolean:Be,formatted:rr,resolvedImage:Ct};return l.type==="array"?Gt(c[l.value]||Fe,l.length):c[l.type]})(t):void 0),a=r.parse(e,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?Sl(new Ko(a,t)):Ao(r.errors)}Ko.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,l,c){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=a,this._evaluator.availableImages=l||null,this._evaluator.formattedSection=c,this.expression.evaluate(this._evaluator)},Ko.prototype.evaluate=function(e,t,r,a,l,c){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=a,this._evaluator.availableImages=l||null,this._evaluator.formattedSection=c||null;try{var h=this.expression.evaluate(this._evaluator);if(h==null||typeof h=="number"&&h!=h)return this._defaultValue;if(this._enumValues&&!(h in this._enumValues))throw new oi("Expected value to be one of "+Object.keys(this._enumValues).map((function(m){return JSON.stringify(m)})).join(", ")+", but found "+JSON.stringify(h)+" instead.");return h}catch(m){return this._warningHistory[m.message]||(this._warningHistory[m.message]=!0,typeof console<"u"&&console.warn(m.message)),this._defaultValue}};var Sa=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!$n(t.expression)};Sa.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,l,c){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,a,l,c)},Sa.prototype.evaluate=function(e,t,r,a,l,c){return this._styleExpression.evaluate(e,t,r,a,l,c)};var Jo=function(e,t,r,a){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent=e!=="camera"&&!$n(t.expression),this.interpolationType=a};function El(e,t){if((e=ns(e,t)).result==="error")return e;var r=e.value.expression,a=Gn(r);if(!a&&!Eo(t))return Ao([new Ae("","data expressions not supported")]);var l=go(r,["zoom"]);if(!l&&!Il(t))return Ao([new Ae("","zoom expressions not supported")]);var c=(function h(m){var g=null;if(m instanceof Xn)g=h(m.result);else if(m instanceof Hn)for(var b=0,S=m.args;b<S.length&&!(g=h(S[b]));b+=1);else(m instanceof Ui||m instanceof mi)&&m.input instanceof di&&m.input.name==="zoom"&&(g=m);return g instanceof Ae||m.eachChild((function(I){var C=h(I);C instanceof Ae?g=C:!g&&C?g=new Ae("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):g&&C&&g!==C&&(g=new Ae("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),g})(r);return c||l?c instanceof Ae?Ao([c]):c instanceof mi&&!ba(t)?Ao([new Ae("",'"interpolate" expressions cannot be used with this property')]):Sl(c?new Jo(a?"camera":"composite",e.value,c.labels,c instanceof mi?c.interpolation:void 0):new Sa(a?"constant":"source",e.value)):Ao([new Ae("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Jo.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,l,c){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,a,l,c)},Jo.prototype.evaluate=function(e,t,r,a,l,c){return this._styleExpression.evaluate(e,t,r,a,l,c)},Jo.prototype.interpolationFactor=function(e,t,r){return this.interpolationType?mi.interpolationFactor(this.interpolationType,e,t,r):0};var Yo=function(e,t){this._parameters=e,this._specification=t,Ie(this,(function r(a,l){var c,h,m,g=l.type==="color",b=a.stops&&typeof a.stops[0][0]=="object",S=b||!(b||a.property!==void 0),I=a.type||(ba(l)?"exponential":"interval");if(g&&((a=Ie({},a)).stops&&(a.stops=a.stops.map((function(Oe){return[Oe[0],$t.parse(Oe[1])]}))),a.default=$t.parse(a.default?a.default:l.default)),a.colorSpace&&a.colorSpace!=="rgb"&&!dl[a.colorSpace])throw new Error("Unknown color space: "+a.colorSpace);if(I==="exponential")c=Al;else if(I==="interval")c=Oc;else if(I==="categorical"){c=Tl,h=Object.create(null);for(var C=0,z=a.stops;C<z.length;C+=1){var j=z[C];h[j[0]]=j[1]}m=typeof a.stops[0][0]}else{if(I!=="identity")throw new Error('Unknown function type "'+I+'"');c=is}if(b){for(var G={},te=[],K=0;K<a.stops.length;K++){var oe=a.stops[K],le=oe[0].zoom;G[le]===void 0&&(G[le]={zoom:le,type:a.type,property:a.property,default:a.default,stops:[]},te.push(le)),G[le].stops.push([oe[0].value,oe[1]])}for(var ce=[],he=0,xe=te;he<xe.length;he+=1){var Pe=xe[he];ce.push([G[Pe].zoom,r(G[Pe],l)])}var ze={name:"linear"};return{kind:"composite",interpolationType:ze,interpolationFactor:mi.interpolationFactor.bind(void 0,ze),zoomStops:ce.map((function(Oe){return Oe[0]})),evaluate:function(Oe,ot){var qe=Oe.zoom;return Al({stops:ce,base:a.base},l,qe).evaluate(qe,ot)}}}if(S){var rt=I==="exponential"?{name:"exponential",base:a.base!==void 0?a.base:1}:null;return{kind:"camera",interpolationType:rt,interpolationFactor:mi.interpolationFactor.bind(void 0,rt),zoomStops:a.stops.map((function(Oe){return Oe[0]})),evaluate:function(Oe){return c(a,l,Oe.zoom,h,m)}}}return{kind:"source",evaluate:function(Oe,ot){var qe=ot&&ot.properties?ot.properties[a.property]:void 0;return qe===void 0?Xo(a.default,l.default):c(a,l,qe,h,m)}}})(this._parameters,this._specification))};function vn(e){var t=e.key,r=e.value,a=e.valueSpec||{},l=e.objectElementValidators||{},c=e.style,h=e.styleSpec,m=[],g=ur(r);if(g!=="object")return[new H(t,r,"object expected, "+g+" found")];for(var b in r){var S=b.split(".")[0],I=a[S]||a["*"],C=void 0;if(l[S])C=l[S];else if(a[S])C=Dt;else if(l["*"])C=l["*"];else{if(!a["*"]){m.push(new H(t,r[b],'unknown property "'+b+'"'));continue}C=Dt}m=m.concat(C({key:(t&&t+".")+b,value:r[b],valueSpec:I,style:c,styleSpec:h,object:r,objectKey:b},r))}for(var z in a)l[z]||a[z].required&&a[z].default===void 0&&r[z]===void 0&&m.push(new H(t,r,'missing required property "'+z+'"'));return m}function Pl(e){var t=e.value,r=e.valueSpec,a=e.style,l=e.styleSpec,c=e.key,h=e.arrayElementValidator||Dt;if(ur(t)!=="array")return[new H(c,t,"array expected, "+ur(t)+" found")];if(r.length&&t.length!==r.length)return[new H(c,t,"array length "+r.length+" expected, length "+t.length+" found")];if(r["min-length"]&&t.length<r["min-length"])return[new H(c,t,"array length at least "+r["min-length"]+" expected, length "+t.length+" found")];var m={type:r.value,values:r.values};l.$version<7&&(m.function=r.function),ur(r.value)==="object"&&(m=r.value);for(var g=[],b=0;b<t.length;b++)g=g.concat(h({array:t,arrayIndex:b,value:t[b],valueSpec:m,style:a,styleSpec:l,key:c+"["+b+"]"}));return g}function Cl(e){var t=e.key,r=e.value,a=e.valueSpec,l=ur(r);return l==="number"&&r!=r&&(l="NaN"),l!=="number"?[new H(t,r,"number expected, "+l+" found")]:"minimum"in a&&r<a.minimum?[new H(t,r,r+" is less than the minimum value "+a.minimum)]:"maximum"in a&&r>a.maximum?[new H(t,r,r+" is greater than the maximum value "+a.maximum)]:[]}function kl(e){var t,r,a,l=e.valueSpec,c=Ee(e.value.type),h={},m=c!=="categorical"&&e.value.property===void 0,g=!m,b=ur(e.value.stops)==="array"&&ur(e.value.stops[0])==="array"&&ur(e.value.stops[0][0])==="object",S=vn({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(z){if(c==="identity")return[new H(z.key,z.value,'identity function may not have a "stops" property')];var j=[],G=z.value;return j=j.concat(Pl({key:z.key,value:G,valueSpec:z.valueSpec,style:z.style,styleSpec:z.styleSpec,arrayElementValidator:I})),ur(G)==="array"&&G.length===0&&j.push(new H(z.key,G,"array must have at least one stop")),j},default:function(z){return Dt({key:z.key,value:z.value,valueSpec:l,style:z.style,styleSpec:z.styleSpec})}}});return c==="identity"&&m&&S.push(new H(e.key,e.value,'missing required property "property"')),c==="identity"||e.value.stops||S.push(new H(e.key,e.value,'missing required property "stops"')),c==="exponential"&&e.valueSpec.expression&&!ba(e.valueSpec)&&S.push(new H(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(g&&!Eo(e.valueSpec)?S.push(new H(e.key,e.value,"property functions not supported")):m&&!Il(e.valueSpec)&&S.push(new H(e.key,e.value,"zoom functions not supported"))),c!=="categorical"&&!b||e.value.property!==void 0||S.push(new H(e.key,e.value,'"property" property is required')),S;function I(z){var j=[],G=z.value,te=z.key;if(ur(G)!=="array")return[new H(te,G,"array expected, "+ur(G)+" found")];if(G.length!==2)return[new H(te,G,"array length 2 expected, length "+G.length+" found")];if(b){if(ur(G[0])!=="object")return[new H(te,G,"object expected, "+ur(G[0])+" found")];if(G[0].zoom===void 0)return[new H(te,G,"object stop key must have zoom")];if(G[0].value===void 0)return[new H(te,G,"object stop key must have value")];if(a&&a>Ee(G[0].zoom))return[new H(te,G[0].zoom,"stop zoom values must appear in ascending order")];Ee(G[0].zoom)!==a&&(a=Ee(G[0].zoom),r=void 0,h={}),j=j.concat(vn({key:te+"[0]",value:G[0],valueSpec:{zoom:{}},style:z.style,styleSpec:z.styleSpec,objectElementValidators:{zoom:Cl,value:C}}))}else j=j.concat(C({key:te+"[0]",value:G[0],style:z.style,styleSpec:z.styleSpec},G));return wa(ye(G[1]))?j.concat([new H(te+"[1]",G[1],"expressions are not allowed in function stops.")]):j.concat(Dt({key:te+"[1]",value:G[1],valueSpec:l,style:z.style,styleSpec:z.styleSpec}))}function C(z,j){var G=ur(z.value),te=Ee(z.value),K=z.value!==null?z.value:j;if(t){if(G!==t)return[new H(z.key,K,G+" stop domain type must match previous stop domain type "+t)]}else t=G;if(G!=="number"&&G!=="string"&&G!=="boolean")return[new H(z.key,K,"stop domain value must be a number, string, or boolean")];if(G!=="number"&&c!=="categorical"){var oe="number expected, "+G+" found";return Eo(l)&&c===void 0&&(oe+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new H(z.key,K,oe)]}return c!=="categorical"||G!=="number"||isFinite(te)&&Math.floor(te)===te?c!=="categorical"&&G==="number"&&r!==void 0&&te<r?[new H(z.key,K,"stop domain values must appear in ascending order")]:(r=te,c==="categorical"&&te in h?[new H(z.key,K,"stop domain values must be unique")]:(h[te]=!0,[])):[new H(z.key,K,"integer expected, found "+te)]}}function Po(e){var t=(e.expressionContext==="property"?El:ns)(ye(e.value),e.valueSpec);if(t.result==="error")return t.value.map((function(a){return new H(""+e.key+a.key,e.value,a.message)}));var r=t.value.expression||t.value._styleExpression.expression;if(e.expressionContext==="property"&&e.propertyKey==="text-font"&&!r.outputDefined())return[new H(e.key,e.value,'Invalid data expression for "'+e.propertyKey+'". Output values must be contained as literals within the expression.')];if(e.expressionContext==="property"&&e.propertyType==="layout"&&!$n(r))return[new H(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if(e.expressionContext==="filter"&&!$n(r))return[new H(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&e.expressionContext.indexOf("cluster")===0){if(!go(r,["zoom","feature-state"]))return[new H(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(e.expressionContext==="cluster-initial"&&!Gn(r))return[new H(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Ia(e){var t=e.key,r=e.value,a=e.valueSpec,l=[];return Array.isArray(a.values)?a.values.indexOf(Ee(r))===-1&&l.push(new H(t,r,"expected one of ["+a.values.join(", ")+"], "+JSON.stringify(r)+" found")):Object.keys(a.values).indexOf(Ee(r))===-1&&l.push(new H(t,r,"expected one of ["+Object.keys(a.values).join(", ")+"], "+JSON.stringify(r)+" found")),l}function os(e){if(e===!0||e===!1)return!0;if(!Array.isArray(e)||e.length===0)return!1;switch(e[0]){case"has":return e.length>=2&&e[1]!=="$id"&&e[1]!=="$type";case"in":return e.length>=3&&(typeof e[1]!="string"||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return e.length!==3||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(var t=0,r=e.slice(1);t<r.length;t+=1){var a=r[t];if(!os(a)&&typeof a!="boolean")return!1}return!0;default:return!0}}Yo.deserialize=function(e){return new Yo(e._parameters,e._specification)},Yo.serialize=function(e){return{_parameters:e._parameters,_specification:e._specification}};var pu={type:"boolean",default:!1};function as(e){if(e==null)return{filter:function(){return!0},needGeometry:!1};os(e)||(e=ss(e));var t=ns(e,pu);if(t.result==="error")throw new Error(t.value.map((function(r){return r.key+": "+r.message})).join(", "));return{filter:function(r,a,l){return t.value.evaluate(r,a,{},l)},needGeometry:(function r(a){if(!Array.isArray(a))return!1;if(a[0]==="within")return!0;for(var l=1;l<a.length;l++)if(r(a[l]))return!0;return!1})(e)}}function Vc(e,t){return e<t?-1:e>t?1:0}function ss(e){if(!e)return!0;var t,r=e[0];return e.length<=1?r!=="any":r==="=="?hu(e[1],e[2],"=="):r==="!="?us(hu(e[1],e[2],"==")):r==="<"||r===">"||r==="<="||r===">="?hu(e[1],e[2],r):r==="any"?(t=e.slice(1),["any"].concat(t.map(ss))):r==="all"?["all"].concat(e.slice(1).map(ss)):r==="none"?["all"].concat(e.slice(1).map(ss).map(us)):r==="in"?Ml(e[1],e.slice(2)):r==="!in"?us(Ml(e[1],e.slice(2))):r==="has"?Bl(e[1]):r==="!has"?us(Bl(e[1])):r!=="within"||e}function hu(e,t,r){switch(e){case"$type":return["filter-type-"+r,t];case"$id":return["filter-id-"+r,t];default:return["filter-"+r,e,t]}}function Ml(e,t){if(t.length===0)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((function(r){return typeof r!=typeof t[0]}))?["filter-in-large",e,["literal",t.sort(Vc)]]:["filter-in-small",e,["literal",t]]}}function Bl(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function us(e){return["!",e]}function fu(e){return os(ye(e.value))?Po(Ie({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):(function t(r){var a=r.value,l=r.key;if(ur(a)!=="array")return[new H(l,a,"array expected, "+ur(a)+" found")];var c,h=r.styleSpec,m=[];if(a.length<1)return[new H(l,a,"filter array must have at least 1 element")];switch(m=m.concat(Ia({key:l+"[0]",value:a[0],valueSpec:h.filter_operator,style:r.style,styleSpec:r.styleSpec})),Ee(a[0])){case"<":case"<=":case">":case">=":a.length>=2&&Ee(a[1])==="$type"&&m.push(new H(l,a,'"$type" cannot be use with operator "'+a[0]+'"'));case"==":case"!=":a.length!==3&&m.push(new H(l,a,'filter array for operator "'+a[0]+'" must have 3 elements'));case"in":case"!in":a.length>=2&&(c=ur(a[1]))!=="string"&&m.push(new H(l+"[1]",a[1],"string expected, "+c+" found"));for(var g=2;g<a.length;g++)c=ur(a[g]),Ee(a[1])==="$type"?m=m.concat(Ia({key:l+"["+g+"]",value:a[g],valueSpec:h.geometry_type,style:r.style,styleSpec:r.styleSpec})):c!=="string"&&c!=="number"&&c!=="boolean"&&m.push(new H(l+"["+g+"]",a[g],"string, number, or boolean expected, "+c+" found"));break;case"any":case"all":case"none":for(var b=1;b<a.length;b++)m=m.concat(t({key:l+"["+b+"]",value:a[b],style:r.style,styleSpec:r.styleSpec}));break;case"has":case"!has":c=ur(a[1]),a.length!==2?m.push(new H(l,a,'filter array for "'+a[0]+'" operator must have 2 elements')):c!=="string"&&m.push(new H(l+"[1]",a[1],"string expected, "+c+" found"));break;case"within":c=ur(a[1]),a.length!==2?m.push(new H(l,a,'filter array for "'+a[0]+'" operator must have 2 elements')):c!=="object"&&m.push(new H(l+"[1]",a[1],"object expected, "+c+" found"))}return m})(e)}function du(e,t){var r=e.key,a=e.style,l=e.styleSpec,c=e.value,h=e.objectKey,m=l[t+"_"+e.layerType];if(!m)return[];var g=h.match(/^(.*)-transition$/);if(t==="paint"&&g&&m[g[1]]&&m[g[1]].transition)return Dt({key:r,value:c,valueSpec:l.transition,style:a,styleSpec:l});var b,S=e.valueSpec||m[h];if(!S)return[new H(r,c,'unknown property "'+h+'"')];if(ur(c)==="string"&&Eo(S)&&!S.tokens&&(b=/^{([^}]+)}$/.exec(c)))return[new H(r,c,'"'+h+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(b[1])+" }`.")];var I=[];return e.layerType==="symbol"&&(h==="text-field"&&a&&!a.glyphs&&I.push(new H(r,c,'use of "text-field" requires a style "glyphs" property')),h==="text-font"&&rs(ye(c))&&Ee(c.type)==="identity"&&I.push(new H(r,c,'"text-font" does not support identity functions'))),I.concat(Dt({key:e.key,value:c,valueSpec:S,style:a,styleSpec:l,expressionContext:"property",propertyType:t,propertyKey:h}))}function mu(e){return du(e,"paint")}function Ta(e){return du(e,"layout")}function zl(e){var t=[],r=e.value,a=e.key,l=e.style,c=e.styleSpec;r.type||r.ref||t.push(new H(a,r,'either "type" or "ref" is required'));var h,m=Ee(r.type),g=Ee(r.ref);if(r.id)for(var b=Ee(r.id),S=0;S<e.arrayIndex;S++){var I=l.layers[S];Ee(I.id)===b&&t.push(new H(a,r.id,'duplicate layer id "'+r.id+'", previously used at line '+I.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach((function(j){j in r&&t.push(new H(a,r[j],'"'+j+'" is prohibited for ref layers'))})),l.layers.forEach((function(j){Ee(j.id)===g&&(h=j)})),h?h.ref?t.push(new H(a,r.ref,"ref cannot reference another ref layer")):m=Ee(h.type):t.push(new H(a,r.ref,'ref layer "'+g+'" not found'));else if(m!=="background")if(r.source){var C=l.sources&&l.sources[r.source],z=C&&Ee(C.type);C?z==="vector"&&m==="raster"?t.push(new H(a,r.source,'layer "'+r.id+'" requires a raster source')):z==="raster"&&m!=="raster"?t.push(new H(a,r.source,'layer "'+r.id+'" requires a vector source')):z!=="vector"||r["source-layer"]?z==="raster-dem"&&m!=="hillshade"?t.push(new H(a,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):m!=="line"||!r.paint||!r.paint["line-gradient"]||z==="geojson"&&C.lineMetrics||t.push(new H(a,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):t.push(new H(a,r,'layer "'+r.id+'" must specify a "source-layer"')):t.push(new H(a,r.source,'source "'+r.source+'" not found'))}else t.push(new H(a,r,'missing required property "source"'));return t=t.concat(vn({key:a,value:r,valueSpec:c.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Dt({key:a+".type",value:r.type,valueSpec:c.layer.type,style:e.style,styleSpec:e.styleSpec,object:r,objectKey:"type"})},filter:fu,layout:function(j){return vn({layer:r,key:j.key,value:j.value,style:j.style,styleSpec:j.styleSpec,objectElementValidators:{"*":function(G){return Ta(Ie({layerType:m},G))}}})},paint:function(j){return vn({layer:r,key:j.key,value:j.value,style:j.style,styleSpec:j.styleSpec,objectElementValidators:{"*":function(G){return mu(Ie({layerType:m},G))}}})}}}))}function Co(e){var t=e.value,r=e.key,a=ur(t);return a!=="string"?[new H(r,t,"string expected, "+a+" found")]:[]}var vr={promoteId:function(e){var t=e.key,r=e.value;if(ur(r)==="string")return Co({key:t,value:r});var a=[];for(var l in r)a.push.apply(a,Co({key:t+"."+l,value:r[l]}));return a}};function ls(e){var t=e.value,r=e.key,a=e.styleSpec,l=e.style;if(!t.type)return[new H(r,t,'"type" is required')];var c,h=Ee(t.type);switch(h){case"vector":case"raster":case"raster-dem":return vn({key:r,value:t,valueSpec:a["source_"+h.replace("-","_")],style:e.style,styleSpec:a,objectElementValidators:vr});case"geojson":if(c=vn({key:r,value:t,valueSpec:a.source_geojson,style:l,styleSpec:a,objectElementValidators:vr}),t.cluster)for(var m in t.clusterProperties){var g=t.clusterProperties[m],b=g[0],S=typeof b=="string"?[b,["accumulated"],["get",m]]:b;c.push.apply(c,Po({key:r+"."+m+".map",value:g[1],expressionContext:"cluster-map"})),c.push.apply(c,Po({key:r+"."+m+".reduce",value:S,expressionContext:"cluster-reduce"}))}return c;case"video":return vn({key:r,value:t,valueSpec:a.source_video,style:l,styleSpec:a});case"image":return vn({key:r,value:t,valueSpec:a.source_image,style:l,styleSpec:a});case"canvas":return[new H(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Ia({key:r+".type",value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function ko(e){var t=e.value,r=e.styleSpec,a=r.light,l=e.style,c=[],h=ur(t);if(t===void 0)return c;if(h!=="object")return c.concat([new H("light",t,"object expected, "+h+" found")]);for(var m in t){var g=m.match(/^(.*)-transition$/);c=c.concat(g&&a[g[1]]&&a[g[1]].transition?Dt({key:m,value:t[m],valueSpec:r.transition,style:l,styleSpec:r}):a[m]?Dt({key:m,value:t[m],valueSpec:a[m],style:l,styleSpec:r}):[new H(m,t[m],'unknown property "'+m+'"')])}return c}var Qn={"*":function(){return[]},array:Pl,boolean:function(e){var t=e.value,r=e.key,a=ur(t);return a!=="boolean"?[new H(r,t,"boolean expected, "+a+" found")]:[]},number:Cl,color:function(e){var t=e.key,r=e.value,a=ur(r);return a!=="string"?[new H(t,r,"color expected, "+a+" found")]:zt(r)===null?[new H(t,r,'color expected, "'+r+'" found')]:[]},constants:se,enum:Ia,filter:fu,function:kl,layer:zl,object:vn,source:ls,light:ko,string:Co,formatted:function(e){return Co(e).length===0?[]:Po(e)},resolvedImage:function(e){return Co(e).length===0?[]:Po(e)}};function Dt(e){var t=e.value,r=e.valueSpec,a=e.styleSpec;return r.expression&&rs(Ee(t))?kl(e):r.expression&&wa(ye(t))?Po(e):r.type&&Qn[r.type]?Qn[r.type](e):vn(Ie({},e,{valueSpec:r.type?a[r.type]:r}))}function lr(e){var t=e.value,r=e.key,a=Co(e);return a.length||(t.indexOf("{fontstack}")===-1&&a.push(new H(r,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&a.push(new H(r,t,'"glyphs" url must include a "{range}" token'))),a}function Yi(e,t){t===void 0&&(t=L);var r=[];return r=r.concat(Dt({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,objectElementValidators:{glyphs:lr,"*":function(){return[]}}})),e.constants&&(r=r.concat(se({key:"constants",value:e.constants}))),Aa(r)}function Aa(e){return[].concat(e).sort((function(t,r){return t.line-r.line}))}function Qo(e){return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return Aa(e.apply(this,t))}}Yi.source=Qo(ls),Yi.light=Qo(ko),Yi.layer=Qo(zl),Yi.filter=Qo(fu),Yi.paintProperty=Qo(mu),Yi.layoutProperty=Qo(Ta);var Ea=Yi,qc=Ea.light,Uc=Ea.paintProperty,Pa=Ea.layoutProperty;function Ca(e,t){var r=!1;if(t&&t.length)for(var a=0,l=t;a<l.length;a+=1)e.fire(new re(new Error(l[a].message))),r=!0;return r}var Rn=Gr;function Gr(e,t,r){var a=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var l=new Int32Array(this.arrayBuffer);e=l[0],this.d=(t=l[1])+2*(r=l[2]);for(var c=0;c<this.d*this.d;c++){var h=l[3+c],m=l[3+c+1];a.push(h===m?null:l.subarray(h,m))}var g=l[3+a.length+1];this.keys=l.subarray(l[3+a.length],g),this.bboxes=l.subarray(g),this.insert=this._insertReadonly}else{this.d=t+2*r;for(var b=0;b<this.d*this.d;b++)a.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;var S=r/t*e;this.min=-S,this.max=e+S}Gr.prototype.insert=function(e,t,r,a,l){this._forEachCell(t,r,a,l,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(a),this.bboxes.push(l)},Gr.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Gr.prototype._insertCell=function(e,t,r,a,l,c){this.cells[l].push(c)},Gr.prototype.query=function(e,t,r,a,l){var c=this.min,h=this.max;if(e<=c&&t<=c&&h<=r&&h<=a&&!l)return Array.prototype.slice.call(this.keys);var m=[];return this._forEachCell(e,t,r,a,this._queryCell,m,{},l),m},Gr.prototype._queryCell=function(e,t,r,a,l,c,h,m){var g=this.cells[l];if(g!==null)for(var b=this.keys,S=this.bboxes,I=0;I<g.length;I++){var C=g[I];if(h[C]===void 0){var z=4*C;(m?m(S[z+0],S[z+1],S[z+2],S[z+3]):e<=S[z+2]&&t<=S[z+3]&&r>=S[z+0]&&a>=S[z+1])?(h[C]=!0,c.push(b[C])):h[C]=!1}}},Gr.prototype._forEachCell=function(e,t,r,a,l,c,h,m){for(var g=this._convertToCellCoord(e),b=this._convertToCellCoord(t),S=this._convertToCellCoord(r),I=this._convertToCellCoord(a),C=g;C<=S;C++)for(var z=b;z<=I;z++){var j=this.d*z+C;if((!m||m(this._convertFromCellCoord(C),this._convertFromCellCoord(z),this._convertFromCellCoord(C+1),this._convertFromCellCoord(z+1)))&&l.call(this,e,t,r,a,j,c,h,m))return}},Gr.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},Gr.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},Gr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=3+this.cells.length+1+1,r=0,a=0;a<this.cells.length;a++)r+=this.cells[a].length;var l=new Int32Array(t+r+this.keys.length+this.bboxes.length);l[0]=this.extent,l[1]=this.n,l[2]=this.padding;for(var c=t,h=0;h<e.length;h++){var m=e[h];l[3+h]=c,l.set(m,c),c+=m.length}return l[3+e.length]=c,l.set(this.keys,c),l[3+e.length+1]=c+=this.keys.length,l.set(this.bboxes,c),c+=this.bboxes.length,l.buffer};var ka=J.ImageData,Dl=J.ImageBitmap,qr={};function Xe(e,t,r){r===void 0&&(r={}),Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),qr[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}for(var Ni in Xe("Object",Object),Rn.serialize=function(e,t){var r=e.toArrayBuffer();return t&&t.push(r),{buffer:r}},Rn.deserialize=function(e){return new Rn(e.buffer)},Xe("Grid",Rn),Xe("Color",$t),Xe("Error",Error),Xe("ResolvedImage",Di),Xe("StylePropertyFunction",Yo),Xe("StyleExpression",Ko,{omit:["_evaluator"]}),Xe("ZoomDependentExpression",Jo),Xe("ZoomConstantExpression",Sa),Xe("CompoundExpression",di,{omit:["_evaluate"]}),Io)Io[Ni]._classRegistryKey||Xe("Expression_"+Ni,Io[Ni]);function cs(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor&&e.constructor.name==="ArrayBuffer")}function ea(e){return Dl&&e instanceof Dl}function gn(e,t){if(e==null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(cs(e)||ea(e))return t&&t.push(e),e;if(ArrayBuffer.isView(e)){var r=e;return t&&t.push(r.buffer),r}if(e instanceof ka)return t&&t.push(e.data.buffer),e;if(Array.isArray(e)){for(var a=[],l=0,c=e;l<c.length;l+=1)a.push(gn(c[l],t));return a}if(typeof e=="object"){var h=e.constructor,m=h._classRegistryKey;if(!m)throw new Error("can't serialize object of unregistered class");var g=h.serialize?h.serialize(e,t):{};if(!h.serialize){for(var b in e)if(e.hasOwnProperty(b)&&!(qr[m].omit.indexOf(b)>=0)){var S=e[b];g[b]=qr[m].shallow.indexOf(b)>=0?S:gn(S,t)}e instanceof Error&&(g.message=e.message)}if(g.$name)throw new Error("$name property is reserved for worker serialization logic.");return m!=="Object"&&(g.$name=m),g}throw new Error("can't serialize object of type "+typeof e)}function ji(e){if(e==null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||cs(e)||ea(e)||ArrayBuffer.isView(e)||e instanceof ka)return e;if(Array.isArray(e))return e.map(ji);if(typeof e=="object"){var t=e.$name||"Object",r=qr[t].klass;if(!r)throw new Error("can't deserialize unregistered class "+t);if(r.deserialize)return r.deserialize(e);for(var a=Object.create(r.prototype),l=0,c=Object.keys(e);l<c.length;l+=1){var h=c[l];if(h!=="$name"){var m=e[h];a[h]=qr[t].shallow.indexOf(h)>=0?m:ji(m)}}return a}throw new Error("can't deserialize object of type "+typeof e)}var yu=function(){this.first=!0};yu.prototype.update=function(e,t){var r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=r,!0))};var Re={"Latin-1 Supplement":function(e){return e>=128&&e<=255},Arabic:function(e){return e>=1536&&e<=1791},"Arabic Supplement":function(e){return e>=1872&&e<=1919},"Arabic Extended-A":function(e){return e>=2208&&e<=2303},"Hangul Jamo":function(e){return e>=4352&&e<=4607},"Unified Canadian Aboriginal Syllabics":function(e){return e>=5120&&e<=5759},Khmer:function(e){return e>=6016&&e<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(e){return e>=6320&&e<=6399},"General Punctuation":function(e){return e>=8192&&e<=8303},"Letterlike Symbols":function(e){return e>=8448&&e<=8527},"Number Forms":function(e){return e>=8528&&e<=8591},"Miscellaneous Technical":function(e){return e>=8960&&e<=9215},"Control Pictures":function(e){return e>=9216&&e<=9279},"Optical Character Recognition":function(e){return e>=9280&&e<=9311},"Enclosed Alphanumerics":function(e){return e>=9312&&e<=9471},"Geometric Shapes":function(e){return e>=9632&&e<=9727},"Miscellaneous Symbols":function(e){return e>=9728&&e<=9983},"Miscellaneous Symbols and Arrows":function(e){return e>=11008&&e<=11263},"CJK Radicals Supplement":function(e){return e>=11904&&e<=12031},"Kangxi Radicals":function(e){return e>=12032&&e<=12255},"Ideographic Description Characters":function(e){return e>=12272&&e<=12287},"CJK Symbols and Punctuation":function(e){return e>=12288&&e<=12351},Hiragana:function(e){return e>=12352&&e<=12447},Katakana:function(e){return e>=12448&&e<=12543},Bopomofo:function(e){return e>=12544&&e<=12591},"Hangul Compatibility Jamo":function(e){return e>=12592&&e<=12687},Kanbun:function(e){return e>=12688&&e<=12703},"Bopomofo Extended":function(e){return e>=12704&&e<=12735},"CJK Strokes":function(e){return e>=12736&&e<=12783},"Katakana Phonetic Extensions":function(e){return e>=12784&&e<=12799},"Enclosed CJK Letters and Months":function(e){return e>=12800&&e<=13055},"CJK Compatibility":function(e){return e>=13056&&e<=13311},"CJK Unified Ideographs Extension A":function(e){return e>=13312&&e<=19903},"Yijing Hexagram Symbols":function(e){return e>=19904&&e<=19967},"CJK Unified Ideographs":function(e){return e>=19968&&e<=40959},"Yi Syllables":function(e){return e>=40960&&e<=42127},"Yi Radicals":function(e){return e>=42128&&e<=42191},"Hangul Jamo Extended-A":function(e){return e>=43360&&e<=43391},"Hangul Syllables":function(e){return e>=44032&&e<=55215},"Hangul Jamo Extended-B":function(e){return e>=55216&&e<=55295},"Private Use Area":function(e){return e>=57344&&e<=63743},"CJK Compatibility Ideographs":function(e){return e>=63744&&e<=64255},"Arabic Presentation Forms-A":function(e){return e>=64336&&e<=65023},"Vertical Forms":function(e){return e>=65040&&e<=65055},"CJK Compatibility Forms":function(e){return e>=65072&&e<=65103},"Small Form Variants":function(e){return e>=65104&&e<=65135},"Arabic Presentation Forms-B":function(e){return e>=65136&&e<=65279},"Halfwidth and Fullwidth Forms":function(e){return e>=65280&&e<=65519}};function vu(e){for(var t=0,r=e;t<r.length;t+=1)if(ps(r[t].charCodeAt(0)))return!0;return!1}function ps(e){return!(e!==746&&e!==747&&(e<4352||!(Re["Bopomofo Extended"](e)||Re.Bopomofo(e)||Re["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||Re["CJK Compatibility Ideographs"](e)||Re["CJK Compatibility"](e)||Re["CJK Radicals Supplement"](e)||Re["CJK Strokes"](e)||!(!Re["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||e===12336)||Re["CJK Unified Ideographs Extension A"](e)||Re["CJK Unified Ideographs"](e)||Re["Enclosed CJK Letters and Months"](e)||Re["Hangul Compatibility Jamo"](e)||Re["Hangul Jamo Extended-A"](e)||Re["Hangul Jamo Extended-B"](e)||Re["Hangul Jamo"](e)||Re["Hangul Syllables"](e)||Re.Hiragana(e)||Re["Ideographic Description Characters"](e)||Re.Kanbun(e)||Re["Kangxi Radicals"](e)||Re["Katakana Phonetic Extensions"](e)||Re.Katakana(e)&&e!==12540||!(!Re["Halfwidth and Fullwidth Forms"](e)||e===65288||e===65289||e===65293||e>=65306&&e<=65310||e===65339||e===65341||e===65343||e>=65371&&e<=65503||e===65507||e>=65512&&e<=65519)||!(!Re["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||Re["Unified Canadian Aboriginal Syllabics"](e)||Re["Unified Canadian Aboriginal Syllabics Extended"](e)||Re["Vertical Forms"](e)||Re["Yijing Hexagram Symbols"](e)||Re["Yi Syllables"](e)||Re["Yi Radicals"](e))))}function gu(e){return!(ps(e)||(function(t){return!!(Re["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||Re["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||Re["Letterlike Symbols"](t)||Re["Number Forms"](t)||Re["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||Re["Control Pictures"](t)&&t!==9251||Re["Optical Character Recognition"](t)||Re["Enclosed Alphanumerics"](t)||Re["Geometric Shapes"](t)||Re["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Re["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Re["CJK Symbols and Punctuation"](t)||Re.Katakana(t)||Re["Private Use Area"](t)||Re["CJK Compatibility Forms"](t)||Re["Small Form Variants"](t)||Re["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)})(e))}function sn(e){return e>=1424&&e<=2303||Re["Arabic Presentation Forms-A"](e)||Re["Arabic Presentation Forms-B"](e)}function Gi(e,t){return!(!t&&sn(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||Re.Khmer(e))}function hs(e){for(var t=0,r=e;t<r.length;t+=1)if(sn(r[t].charCodeAt(0)))return!0;return!1}var fs=null,$i="unavailable",Ln=null,Rl=function(e){e&&typeof e=="string"&&e.indexOf("NetworkError")>-1&&($i="error"),fs&&fs(e)};function Ma(){_u.fire(new $("pluginStateChange",{pluginStatus:$i,pluginURL:Ln}))}var _u=new ie,xu=function(){return $i},_n=function(){if($i!=="deferred"||!Ln)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");$i="loading",Ma(),Ln&&ii({url:Ln},(function(e){e?Rl(e):($i="loaded",Ma())}))},Qi={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return $i==="loaded"||Qi.applyArabicShaping!=null},isLoading:function(){return $i==="loading"},setState:function(e){$i=e.pluginStatus,Ln=e.pluginURL},isParsed:function(){return Qi.applyArabicShaping!=null&&Qi.processBidirectionalText!=null&&Qi.processStyledBidirectionalText!=null},getPluginURL:function(){return Ln}},kt=function(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new yu,this.transition={})};kt.prototype.isSupportedScript=function(e){return(function(t,r){for(var a=0,l=t;a<l.length;a+=1)if(!Gi(l[a].charCodeAt(0),r))return!1;return!0})(e,Qi.isLoaded())},kt.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},kt.prototype.getCrossfadeParameters=function(){var e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}};var Tn=function(e,t){this.property=e,this.value=t,this.expression=(function(r,a){if(rs(r))return new Yo(r,a);if(wa(r)){var l=El(r,a);if(l.result==="error")throw new Error(l.value.map((function(h){return h.key+": "+h.message})).join(", "));return l.value}var c=r;return typeof r=="string"&&a.type==="color"&&(c=$t.parse(r)),{kind:"constant",evaluate:function(){return c}}})(t===void 0?e.specification.default:t,e.specification)};Tn.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},Tn.prototype.possiblyEvaluate=function(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)};var un=function(e){this.property=e,this.value=new Tn(e,void 0)};un.prototype.transitioned=function(e,t){return new Mo(this.property,this.value,t,Ue({},e.transition,this.transition),e.now)},un.prototype.untransitioned=function(){return new Mo(this.property,this.value,null,{},0)};var yi=function(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)};yi.prototype.getValue=function(e){return Mt(this._values[e].value.value)},yi.prototype.setValue=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new un(this._values[e].property)),this._values[e].value=new Tn(this._values[e].property,t===null?void 0:Mt(t))},yi.prototype.getTransition=function(e){return Mt(this._values[e].transition)},yi.prototype.setTransition=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new un(this._values[e].property)),this._values[e].transition=Mt(t)||void 0},yi.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t],l=this.getValue(a);l!==void 0&&(e[a]=l);var c=this.getTransition(a);c!==void 0&&(e[a+"-transition"]=c)}return e},yi.prototype.transitioned=function(e,t){for(var r=new eo(this._properties),a=0,l=Object.keys(this._values);a<l.length;a+=1){var c=l[a];r._values[c]=this._values[c].transitioned(e,t._values[c])}return r},yi.prototype.untransitioned=function(){for(var e=new eo(this._properties),t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t];e._values[a]=this._values[a].untransitioned()}return e};var Mo=function(e,t,r,a,l){this.property=e,this.value=t,this.begin=l+a.delay||0,this.end=this.begin+a.duration||0,e.specification.transition&&(a.delay||a.duration)&&(this.prior=r)};Mo.prototype.possiblyEvaluate=function(e,t,r){var a=e.now||0,l=this.value.possiblyEvaluate(e,t,r),c=this.prior;if(c){if(a>this.end)return this.prior=null,l;if(this.value.isDataDriven())return this.prior=null,l;if(a<this.begin)return c.possiblyEvaluate(e,t,r);var h=(a-this.begin)/(this.end-this.begin);return this.property.interpolate(c.possiblyEvaluate(e,t,r),l,(function(m){if(m<=0)return 0;if(m>=1)return 1;var g=m*m,b=g*m;return 4*(m<.5?b:3*(m-g)+b-.75)})(h))}return l};var eo=function(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)};eo.prototype.possiblyEvaluate=function(e,t,r){for(var a=new Ba(this._properties),l=0,c=Object.keys(this._values);l<c.length;l+=1){var h=c[l];a._values[h]=this._values[h].possiblyEvaluate(e,t,r)}return a},eo.prototype.hasTransition=function(){for(var e=0,t=Object.keys(this._values);e<t.length;e+=1)if(this._values[t[e]].prior)return!0;return!1};var xn=function(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)};xn.prototype.getValue=function(e){return Mt(this._values[e].value)},xn.prototype.setValue=function(e,t){this._values[e]=new Tn(this._values[e].property,t===null?void 0:Mt(t))},xn.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t],l=this.getValue(a);l!==void 0&&(e[a]=l)}return e},xn.prototype.possiblyEvaluate=function(e,t,r){for(var a=new Ba(this._properties),l=0,c=Object.keys(this._values);l<c.length;l+=1){var h=c[l];a._values[h]=this._values[h].possiblyEvaluate(e,t,r)}return a};var Ti=function(e,t,r){this.property=e,this.value=t,this.parameters=r};Ti.prototype.isConstant=function(){return this.value.kind==="constant"},Ti.prototype.constantOr=function(e){return this.value.kind==="constant"?this.value.value:e},Ti.prototype.evaluate=function(e,t,r,a){return this.property.evaluate(this.value,this.parameters,e,t,r,a)};var Ba=function(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)};Ba.prototype.get=function(e){return this._values[e]};var it=function(e){this.specification=e};it.prototype.possiblyEvaluate=function(e,t){return e.expression.evaluate(t)},it.prototype.interpolate=function(e,t,r){var a=Ho[this.specification.type];return a?a(e,t,r):e};var Ye=function(e,t){this.specification=e,this.overrides=t};Ye.prototype.possiblyEvaluate=function(e,t,r,a){return new Ti(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(t,null,{},r,a)}:e.expression,t)},Ye.prototype.interpolate=function(e,t,r){if(e.value.kind!=="constant"||t.value.kind!=="constant")return e;if(e.value.value===void 0||t.value.value===void 0)return new Ti(this,{kind:"constant",value:void 0},e.parameters);var a=Ho[this.specification.type];return a?new Ti(this,{kind:"constant",value:a(e.value.value,t.value.value,r)},e.parameters):e},Ye.prototype.evaluate=function(e,t,r,a,l,c){return e.kind==="constant"?e.value:e.evaluate(t,r,a,l,c)};var ds=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.possiblyEvaluate=function(r,a,l,c){if(r.value===void 0)return new Ti(this,{kind:"constant",value:void 0},a);if(r.expression.kind==="constant"){var h=r.expression.evaluate(a,null,{},l,c),m=r.property.specification.type==="resolvedImage"&&typeof h!="string"?h.name:h,g=this._calculate(m,m,m,a);return new Ti(this,{kind:"constant",value:g},a)}if(r.expression.kind==="camera"){var b=this._calculate(r.expression.evaluate({zoom:a.zoom-1}),r.expression.evaluate({zoom:a.zoom}),r.expression.evaluate({zoom:a.zoom+1}),a);return new Ti(this,{kind:"constant",value:b},a)}return new Ti(this,r.expression,a)},t.prototype.evaluate=function(r,a,l,c,h,m){if(r.kind==="source"){var g=r.evaluate(a,l,c,h,m);return this._calculate(g,g,g,a)}return r.kind==="composite"?this._calculate(r.evaluate({zoom:Math.floor(a.zoom)-1},l,c),r.evaluate({zoom:Math.floor(a.zoom)},l,c),r.evaluate({zoom:Math.floor(a.zoom)+1},l,c),a):r.value},t.prototype._calculate=function(r,a,l,c){return c.zoom>c.zoomHistory.lastIntegerZoom?{from:r,to:a}:{from:l,to:a}},t.prototype.interpolate=function(r){return r},t})(Ye),Ai=function(e){this.specification=e};Ai.prototype.possiblyEvaluate=function(e,t,r,a){if(e.value!==void 0){if(e.expression.kind==="constant"){var l=e.expression.evaluate(t,null,{},r,a);return this._calculate(l,l,l,t)}return this._calculate(e.expression.evaluate(new kt(Math.floor(t.zoom-1),t)),e.expression.evaluate(new kt(Math.floor(t.zoom),t)),e.expression.evaluate(new kt(Math.floor(t.zoom+1),t)),t)}},Ai.prototype._calculate=function(e,t,r,a){return a.zoom>a.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},Ai.prototype.interpolate=function(e){return e};var bn=function(e){this.specification=e};bn.prototype.possiblyEvaluate=function(e,t,r,a){return!!e.expression.evaluate(t,null,{},r,a)},bn.prototype.interpolate=function(){return!1};var vi=function(e){for(var t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],e){var r=e[t];r.specification.overridable&&this.overridableProperties.push(t);var a=this.defaultPropertyValues[t]=new Tn(r,void 0),l=this.defaultTransitionablePropertyValues[t]=new un(r);this.defaultTransitioningPropertyValues[t]=l.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=a.possiblyEvaluate({})}};Xe("DataDrivenProperty",Ye),Xe("DataConstantProperty",it),Xe("CrossFadedDataDrivenProperty",ds),Xe("CrossFadedProperty",Ai),Xe("ColorRampProperty",bn);var An=(function(e){function t(r,a){if(e.call(this),this.id=r.id,this.type=r.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},r.type!=="custom"&&(this.metadata=(r=r).metadata,this.minzoom=r.minzoom,this.maxzoom=r.maxzoom,r.type!=="background"&&(this.source=r.source,this.sourceLayer=r["source-layer"],this.filter=r.filter),a.layout&&(this._unevaluatedLayout=new xn(a.layout)),a.paint)){for(var l in this._transitionablePaint=new yi(a.paint),r.paint)this.setPaintProperty(l,r.paint[l],{validate:!1});for(var c in r.layout)this.setLayoutProperty(c,r.layout[c],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ba(a.paint)}}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},t.prototype.getLayoutProperty=function(r){return r==="visibility"?this.visibility:this._unevaluatedLayout.getValue(r)},t.prototype.setLayoutProperty=function(r,a,l){l===void 0&&(l={}),a!=null&&this._validate(Pa,"layers."+this.id+".layout."+r,r,a,l)||(r!=="visibility"?this._unevaluatedLayout.setValue(r,a):this.visibility=a)},t.prototype.getPaintProperty=function(r){return je(r,"-transition")?this._transitionablePaint.getTransition(r.slice(0,-11)):this._transitionablePaint.getValue(r)},t.prototype.setPaintProperty=function(r,a,l){if(l===void 0&&(l={}),a!=null&&this._validate(Uc,"layers."+this.id+".paint."+r,r,a,l))return!1;if(je(r,"-transition"))return this._transitionablePaint.setTransition(r.slice(0,-11),a||void 0),!1;var c=this._transitionablePaint._values[r],h=c.property.specification["property-type"]==="cross-faded-data-driven",m=c.value.isDataDriven(),g=c.value;this._transitionablePaint.setValue(r,a),this._handleSpecialPaintPropertyUpdate(r);var b=this._transitionablePaint._values[r].value;return b.isDataDriven()||m||h||this._handleOverridablePaintPropertyUpdate(r,g,b)},t.prototype._handleSpecialPaintPropertyUpdate=function(r){},t.prototype._handleOverridablePaintPropertyUpdate=function(r,a,l){return!1},t.prototype.isHidden=function(r){return!!(this.minzoom&&r<this.minzoom)||!!(this.maxzoom&&r>=this.maxzoom)||this.visibility==="none"},t.prototype.updateTransitions=function(r){this._transitioningPaint=this._transitionablePaint.transitioned(r,this._transitioningPaint)},t.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},t.prototype.recalculate=function(r,a){r.getCrossfadeParameters&&(this._crossfadeParameters=r.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(r,void 0,a)),this.paint=this._transitioningPaint.possiblyEvaluate(r,void 0,a)},t.prototype.serialize=function(){var r={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&&(r.layout=r.layout||{},r.layout.visibility=this.visibility),tt(r,(function(a,l){return!(a===void 0||l==="layout"&&!Object.keys(a).length||l==="paint"&&!Object.keys(a).length)}))},t.prototype._validate=function(r,a,l,c,h){return h===void 0&&(h={}),(!h||h.validate!==!1)&&Ca(this,r.call(Ea,{key:a,layerType:this.type,objectKey:l,value:c,styleSpec:L,style:{glyphs:!0,sprite:!0}}))},t.prototype.is3D=function(){return!1},t.prototype.isTileClipped=function(){return!1},t.prototype.hasOffscreenPass=function(){return!1},t.prototype.resize=function(){},t.prototype.isStateDependent=function(){for(var r in this.paint._values){var a=this.paint.get(r);if(a instanceof Ti&&Eo(a.property.specification)&&(a.value.kind==="source"||a.value.kind==="composite")&&a.value.isStateDependent)return!0}return!1},t})(ie),bu={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},ms=function(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Xt=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function ai(e,t){t===void 0&&(t=1);var r=0,a=0;return{members:e.map((function(l){var c=bu[l.type].BYTES_PER_ELEMENT,h=r=Ll(r,Math.max(t,c)),m=l.components||1;return a=Math.max(a,c),r+=c*m,{name:l.name,type:l.type,components:m,offset:h}})),size:Ll(r,Math.max(a,t)),alignment:t}}function Ll(e,t){return Math.ceil(e/t)*t}Xt.serialize=function(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}},Xt.deserialize=function(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t},Xt.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Xt.prototype.clear=function(){this.length=0},Xt.prototype.resize=function(e){this.reserve(e),this.length=e},Xt.prototype.reserve=function(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}},Xt.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Bo=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var l=this.length;return this.resize(l+1),this.emplace(l,r,a)},t.prototype.emplace=function(r,a,l){var c=2*r;return this.int16[c+0]=a,this.int16[c+1]=l,r},t})(Xt);Bo.prototype.bytesPerElement=4,Xe("StructArrayLayout2i4",Bo);var wu=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,a,l,c)},t.prototype.emplace=function(r,a,l,c,h){var m=4*r;return this.int16[m+0]=a,this.int16[m+1]=l,this.int16[m+2]=c,this.int16[m+3]=h,r},t})(Xt);wu.prototype.bytesPerElement=8,Xe("StructArrayLayout4i8",wu);var Fn=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m){var g=this.length;return this.resize(g+1),this.emplace(g,r,a,l,c,h,m)},t.prototype.emplace=function(r,a,l,c,h,m,g){var b=6*r;return this.int16[b+0]=a,this.int16[b+1]=l,this.int16[b+2]=c,this.int16[b+3]=h,this.int16[b+4]=m,this.int16[b+5]=g,r},t})(Xt);Fn.prototype.bytesPerElement=12,Xe("StructArrayLayout2i4i12",Fn);var Zi=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m){var g=this.length;return this.resize(g+1),this.emplace(g,r,a,l,c,h,m)},t.prototype.emplace=function(r,a,l,c,h,m,g){var b=4*r,S=8*r;return this.int16[b+0]=a,this.int16[b+1]=l,this.uint8[S+4]=c,this.uint8[S+5]=h,this.uint8[S+6]=m,this.uint8[S+7]=g,r},t})(Xt);Zi.prototype.bytesPerElement=8,Xe("StructArrayLayout2i4ub8",Zi);var ta=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var l=this.length;return this.resize(l+1),this.emplace(l,r,a)},t.prototype.emplace=function(r,a,l){var c=2*r;return this.float32[c+0]=a,this.float32[c+1]=l,r},t})(Xt);ta.prototype.bytesPerElement=8,Xe("StructArrayLayout2f8",ta);var En=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,b,S,I){var C=this.length;return this.resize(C+1),this.emplace(C,r,a,l,c,h,m,g,b,S,I)},t.prototype.emplace=function(r,a,l,c,h,m,g,b,S,I,C){var z=10*r;return this.uint16[z+0]=a,this.uint16[z+1]=l,this.uint16[z+2]=c,this.uint16[z+3]=h,this.uint16[z+4]=m,this.uint16[z+5]=g,this.uint16[z+6]=b,this.uint16[z+7]=S,this.uint16[z+8]=I,this.uint16[z+9]=C,r},t})(Xt);En.prototype.bytesPerElement=20,Xe("StructArrayLayout10ui20",En);var ys=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,b,S,I,C,z){var j=this.length;return this.resize(j+1),this.emplace(j,r,a,l,c,h,m,g,b,S,I,C,z)},t.prototype.emplace=function(r,a,l,c,h,m,g,b,S,I,C,z,j){var G=12*r;return this.int16[G+0]=a,this.int16[G+1]=l,this.int16[G+2]=c,this.int16[G+3]=h,this.uint16[G+4]=m,this.uint16[G+5]=g,this.uint16[G+6]=b,this.uint16[G+7]=S,this.int16[G+8]=I,this.int16[G+9]=C,this.int16[G+10]=z,this.int16[G+11]=j,r},t})(Xt);ys.prototype.bytesPerElement=24,Xe("StructArrayLayout4i4ui4i24",ys);var ra=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,l)},t.prototype.emplace=function(r,a,l,c){var h=3*r;return this.float32[h+0]=a,this.float32[h+1]=l,this.float32[h+2]=c,r},t})(Xt);ra.prototype.bytesPerElement=12,Xe("StructArrayLayout3f12",ra);var za=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.uint32[1*r+0]=a,r},t})(Xt);za.prototype.bytesPerElement=4,Xe("StructArrayLayout1ul4",za);var Su=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,b,S){var I=this.length;return this.resize(I+1),this.emplace(I,r,a,l,c,h,m,g,b,S)},t.prototype.emplace=function(r,a,l,c,h,m,g,b,S,I){var C=10*r,z=5*r;return this.int16[C+0]=a,this.int16[C+1]=l,this.int16[C+2]=c,this.int16[C+3]=h,this.int16[C+4]=m,this.int16[C+5]=g,this.uint32[z+3]=b,this.uint16[C+8]=S,this.uint16[C+9]=I,r},t})(Xt);Su.prototype.bytesPerElement=20,Xe("StructArrayLayout6i1ul2ui20",Su);var ia=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m){var g=this.length;return this.resize(g+1),this.emplace(g,r,a,l,c,h,m)},t.prototype.emplace=function(r,a,l,c,h,m,g){var b=6*r;return this.int16[b+0]=a,this.int16[b+1]=l,this.int16[b+2]=c,this.int16[b+3]=h,this.int16[b+4]=m,this.int16[b+5]=g,r},t})(Xt);ia.prototype.bytesPerElement=12,Xe("StructArrayLayout2i2i2i12",ia);var zo=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h){var m=this.length;return this.resize(m+1),this.emplace(m,r,a,l,c,h)},t.prototype.emplace=function(r,a,l,c,h,m){var g=4*r,b=8*r;return this.float32[g+0]=a,this.float32[g+1]=l,this.float32[g+2]=c,this.int16[b+6]=h,this.int16[b+7]=m,r},t})(Xt);zo.prototype.bytesPerElement=16,Xe("StructArrayLayout2f1f2i16",zo);var Iu=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,a,l,c)},t.prototype.emplace=function(r,a,l,c,h){var m=12*r,g=3*r;return this.uint8[m+0]=a,this.uint8[m+1]=l,this.float32[g+1]=c,this.float32[g+2]=h,r},t})(Xt);Iu.prototype.bytesPerElement=12,Xe("StructArrayLayout2ub2f12",Iu);var to=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,l)},t.prototype.emplace=function(r,a,l,c){var h=3*r;return this.uint16[h+0]=a,this.uint16[h+1]=l,this.uint16[h+2]=c,r},t})(Xt);to.prototype.bytesPerElement=6,Xe("StructArrayLayout3ui6",to);var ro=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,b,S,I,C,z,j,G,te,K,oe){var le=this.length;return this.resize(le+1),this.emplace(le,r,a,l,c,h,m,g,b,S,I,C,z,j,G,te,K,oe)},t.prototype.emplace=function(r,a,l,c,h,m,g,b,S,I,C,z,j,G,te,K,oe,le){var ce=24*r,he=12*r,xe=48*r;return this.int16[ce+0]=a,this.int16[ce+1]=l,this.uint16[ce+2]=c,this.uint16[ce+3]=h,this.uint32[he+2]=m,this.uint32[he+3]=g,this.uint32[he+4]=b,this.uint16[ce+10]=S,this.uint16[ce+11]=I,this.uint16[ce+12]=C,this.float32[he+7]=z,this.float32[he+8]=j,this.uint8[xe+36]=G,this.uint8[xe+37]=te,this.uint8[xe+38]=K,this.uint32[he+10]=oe,this.int16[ce+22]=le,r},t})(Xt);ro.prototype.bytesPerElement=48,Xe("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ro);var vs=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,b,S,I,C,z,j,G,te,K,oe,le,ce,he,xe,Pe,ze,rt,Oe,ot,qe,bt){var pt=this.length;return this.resize(pt+1),this.emplace(pt,r,a,l,c,h,m,g,b,S,I,C,z,j,G,te,K,oe,le,ce,he,xe,Pe,ze,rt,Oe,ot,qe,bt)},t.prototype.emplace=function(r,a,l,c,h,m,g,b,S,I,C,z,j,G,te,K,oe,le,ce,he,xe,Pe,ze,rt,Oe,ot,qe,bt,pt){var Qe=34*r,Tt=17*r;return this.int16[Qe+0]=a,this.int16[Qe+1]=l,this.int16[Qe+2]=c,this.int16[Qe+3]=h,this.int16[Qe+4]=m,this.int16[Qe+5]=g,this.int16[Qe+6]=b,this.int16[Qe+7]=S,this.uint16[Qe+8]=I,this.uint16[Qe+9]=C,this.uint16[Qe+10]=z,this.uint16[Qe+11]=j,this.uint16[Qe+12]=G,this.uint16[Qe+13]=te,this.uint16[Qe+14]=K,this.uint16[Qe+15]=oe,this.uint16[Qe+16]=le,this.uint16[Qe+17]=ce,this.uint16[Qe+18]=he,this.uint16[Qe+19]=xe,this.uint16[Qe+20]=Pe,this.uint16[Qe+21]=ze,this.uint16[Qe+22]=rt,this.uint32[Tt+12]=Oe,this.float32[Tt+13]=ot,this.float32[Tt+14]=qe,this.float32[Tt+15]=bt,this.float32[Tt+16]=pt,r},t})(Xt);vs.prototype.bytesPerElement=68,Xe("StructArrayLayout8i15ui1ul4f68",vs);var io=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.float32[1*r+0]=a,r},t})(Xt);io.prototype.bytesPerElement=4,Xe("StructArrayLayout1f4",io);var ln=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,l)},t.prototype.emplace=function(r,a,l,c){var h=3*r;return this.int16[h+0]=a,this.int16[h+1]=l,this.int16[h+2]=c,r},t})(Xt);ln.prototype.bytesPerElement=6,Xe("StructArrayLayout3i6",ln);var Tu=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,l)},t.prototype.emplace=function(r,a,l,c){var h=4*r;return this.uint32[2*r+0]=a,this.uint16[h+2]=l,this.uint16[h+3]=c,r},t})(Xt);Tu.prototype.bytesPerElement=8,Xe("StructArrayLayout1ul2ui8",Tu);var Da=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var l=this.length;return this.resize(l+1),this.emplace(l,r,a)},t.prototype.emplace=function(r,a,l){var c=2*r;return this.uint16[c+0]=a,this.uint16[c+1]=l,r},t})(Xt);Da.prototype.bytesPerElement=4,Xe("StructArrayLayout2ui4",Da);var Au=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.uint16[1*r+0]=a,r},t})(Xt);Au.prototype.bytesPerElement=2,Xe("StructArrayLayout1ui2",Au);var gs=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,a,l,c)},t.prototype.emplace=function(r,a,l,c,h){var m=4*r;return this.float32[m+0]=a,this.float32[m+1]=l,this.float32[m+2]=c,this.float32[m+3]=h,r},t})(Xt);gs.prototype.bytesPerElement=16,Xe("StructArrayLayout4f16",gs);var i=(function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new X(this.anchorPointX,this.anchorPointY)},Object.defineProperties(t.prototype,r),t})(ms);i.prototype.size=20;var o=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new i(this,r)},t})(Su);Xe("CollisionBoxArray",o);var n=(function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(a){this._structArray.uint8[this._pos1+37]=a},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(a){this._structArray.uint8[this._pos1+38]=a},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(a){this._structArray.uint32[this._pos4+10]=a},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(t.prototype,r),t})(ms);n.prototype.size=48;var s=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new n(this,r)},t})(ro);Xe("PlacedSymbolArray",s);var p=(function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(a){this._structArray.uint32[this._pos4+12]=a},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(t.prototype,r),t})(ms);p.prototype.size=68;var f=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new p(this,r)},t})(vs);Xe("SymbolInstanceArray",f);var d=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getoffsetX=function(r){return this.float32[1*r+0]},t})(io);Xe("GlyphOffsetArray",d);var v=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getx=function(r){return this.int16[3*r+0]},t.prototype.gety=function(r){return this.int16[3*r+1]},t.prototype.gettileUnitDistanceFromAnchor=function(r){return this.int16[3*r+2]},t})(ln);Xe("SymbolLineVertexArray",v);var w=(function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(t.prototype,r),t})(ms);w.prototype.size=8;var A=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new w(this,r)},t})(Tu);Xe("FeatureIndexArray",A);var R=ai([{name:"a_pos",components:2,type:"Int16"}],4).members,F=function(e){e===void 0&&(e=[]),this.segments=e};function O(e,t){return 256*(e=Ze(Math.floor(e),0,255))+Ze(Math.floor(t),0,255)}F.prototype.prepareSegment=function(e,t,r,a){var l=this.segments[this.segments.length-1];return e>F.MAX_VERTEX_ARRAY_LENGTH&&St("Max vertices per segment is "+F.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+e),(!l||l.vertexLength+e>F.MAX_VERTEX_ARRAY_LENGTH||l.sortKey!==a)&&(l={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},a!==void 0&&(l.sortKey=a),this.segments.push(l)),l},F.prototype.get=function(){return this.segments},F.prototype.destroy=function(){for(var e=0,t=this.segments;e<t.length;e+=1){var r=t[e];for(var a in r.vaos)r.vaos[a].destroy()}},F.simpleSegment=function(e,t,r,a){return new F([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:a,vaos:{},sortKey:0}])},F.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Xe("SegmentVector",F);var W=ai([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),Z=U((function(e){e.exports=function(t,r){var a,l,c,h,m,g,b,S;for(l=t.length-(a=3&t.length),c=r,m=3432918353,g=461845907,S=0;S<l;)b=255&t.charCodeAt(S)|(255&t.charCodeAt(++S))<<8|(255&t.charCodeAt(++S))<<16|(255&t.charCodeAt(++S))<<24,++S,c=27492+(65535&(h=5*(65535&(c=(c^=b=(65535&(b=(b=(65535&b)*m+(((b>>>16)*m&65535)<<16)&4294967295)<<15|b>>>17))*g+(((b>>>16)*g&65535)<<16)&4294967295)<<13|c>>>19))+((5*(c>>>16)&65535)<<16)&4294967295))+((58964+(h>>>16)&65535)<<16);switch(b=0,a){case 3:b^=(255&t.charCodeAt(S+2))<<16;case 2:b^=(255&t.charCodeAt(S+1))<<8;case 1:c^=b=(65535&(b=(b=(65535&(b^=255&t.charCodeAt(S)))*m+(((b>>>16)*m&65535)<<16)&4294967295)<<15|b>>>17))*g+(((b>>>16)*g&65535)<<16)&4294967295}return c^=t.length,c=2246822507*(65535&(c^=c>>>16))+((2246822507*(c>>>16)&65535)<<16)&4294967295,c=3266489909*(65535&(c^=c>>>13))+((3266489909*(c>>>16)&65535)<<16)&4294967295,(c^=c>>>16)>>>0}})),ee=U((function(e){e.exports=function(t,r){for(var a,l=t.length,c=r^l,h=0;l>=4;)a=1540483477*(65535&(a=255&t.charCodeAt(h)|(255&t.charCodeAt(++h))<<8|(255&t.charCodeAt(++h))<<16|(255&t.charCodeAt(++h))<<24))+((1540483477*(a>>>16)&65535)<<16),c=1540483477*(65535&c)+((1540483477*(c>>>16)&65535)<<16)^(a=1540483477*(65535&(a^=a>>>24))+((1540483477*(a>>>16)&65535)<<16)),l-=4,++h;switch(l){case 3:c^=(255&t.charCodeAt(h+2))<<16;case 2:c^=(255&t.charCodeAt(h+1))<<8;case 1:c=1540483477*(65535&(c^=255&t.charCodeAt(h)))+((1540483477*(c>>>16)&65535)<<16)}return c=1540483477*(65535&(c^=c>>>13))+((1540483477*(c>>>16)&65535)<<16),(c^=c>>>15)>>>0}})),N=Z,Q=ee;N.murmur3=Z,N.murmur2=Q;var ne=function(){this.ids=[],this.positions=[],this.indexed=!1};ne.prototype.add=function(e,t,r,a){this.ids.push(me(e)),this.positions.push(t,r,a)},ne.prototype.getPositions=function(e){for(var t=me(e),r=0,a=this.ids.length-1;r<a;){var l=r+a>>1;this.ids[l]>=t?a=l:r=l+1}for(var c=[];this.ids[r]===t;)c.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return c},ne.serialize=function(e,t){var r=new Float64Array(e.ids),a=new Uint32Array(e.positions);return(function l(c,h,m,g){for(;m<g;){for(var b=c[m+g>>1],S=m-1,I=g+1;;){do S++;while(c[S]<b);do I--;while(c[I]>b);if(S>=I)break;pe(c,S,I),pe(h,3*S,3*I),pe(h,3*S+1,3*I+1),pe(h,3*S+2,3*I+2)}I-m<g-I?(l(c,h,m,I),m=I+1):(l(c,h,I+1,g),g=I)}})(r,a,0,r.length-1),t&&t.push(r.buffer,a.buffer),{ids:r,positions:a}},ne.deserialize=function(e){var t=new ne;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t};var ue=Math.pow(2,53)-1;function me(e){var t=+e;return!isNaN(t)&&t<=ue?t:N(String(e))}function pe(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}Xe("FeaturePositionMap",ne);var ve=function(e,t){this.gl=e.gl,this.location=t},Te=(function(e){function t(r,a){e.call(this,r,a),this.current=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){this.current!==r&&(this.current=r,this.gl.uniform1i(this.location,r))},t})(ve),ke=(function(e){function t(r,a){e.call(this,r,a),this.current=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){this.current!==r&&(this.current=r,this.gl.uniform1f(this.location,r))},t})(ve),Ce=(function(e){function t(r,a){e.call(this,r,a),this.current=[0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]||(this.current=r,this.gl.uniform2f(this.location,r[0],r[1]))},t})(ve),$e=(function(e){function t(r,a){e.call(this,r,a),this.current=[0,0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]||(this.current=r,this.gl.uniform3f(this.location,r[0],r[1],r[2]))},t})(ve),nt=(function(e){function t(r,a){e.call(this,r,a),this.current=[0,0,0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]&&r[3]===this.current[3]||(this.current=r,this.gl.uniform4f(this.location,r[0],r[1],r[2],r[3]))},t})(ve),ut=(function(e){function t(r,a){e.call(this,r,a),this.current=$t.transparent}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r.r===this.current.r&&r.g===this.current.g&&r.b===this.current.b&&r.a===this.current.a||(this.current=r,this.gl.uniform4f(this.location,r.r,r.g,r.b,r.a))},t})(ve),st=new Float32Array(16),Ft=(function(e){function t(r,a){e.call(this,r,a),this.current=st}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){if(r[12]!==this.current[12]||r[0]!==this.current[0])return this.current=r,void this.gl.uniformMatrix4fv(this.location,!1,r);for(var a=1;a<16;a++)if(r[a]!==this.current[a]){this.current=r,this.gl.uniformMatrix4fv(this.location,!1,r);break}},t})(ve);function We(e){return[O(255*e.r,255*e.g),O(255*e.b,255*e.a)]}var mt=function(e,t,r){this.value=e,this.uniformNames=t.map((function(a){return"u_"+a})),this.type=r};mt.prototype.setUniform=function(e,t,r){e.set(r.constantOr(this.value))},mt.prototype.getBinding=function(e,t,r){return this.type==="color"?new ut(e,t):new ke(e,t)};var xt=function(e,t){this.uniformNames=t.map((function(r){return"u_"+r})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};xt.prototype.setConstantPatternPositions=function(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr},xt.prototype.setUniform=function(e,t,r,a){var l=a==="u_pattern_to"?this.patternTo:a==="u_pattern_from"?this.patternFrom:a==="u_pixel_ratio_to"?this.pixelRatioTo:a==="u_pixel_ratio_from"?this.pixelRatioFrom:null;l&&e.set(l)},xt.prototype.getBinding=function(e,t,r){return r.substr(0,9)==="u_pattern"?new nt(e,t):new ke(e,t)};var dt=function(e,t,r,a){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map((function(l){return{name:"a_"+l,type:"Float32",components:r==="color"?2:1,offset:0}})),this.paintVertexArray=new a};dt.prototype.populatePaintArray=function(e,t,r,a,l){var c=this.paintVertexArray.length,h=this.expression.evaluate(new kt(0),t,{},a,[],l);this.paintVertexArray.resize(e),this._setPaintValue(c,e,h)},dt.prototype.updatePaintArray=function(e,t,r,a){var l=this.expression.evaluate({zoom:0},r,a);this._setPaintValue(e,t,l)},dt.prototype._setPaintValue=function(e,t,r){if(this.type==="color")for(var a=We(r),l=e;l<t;l++)this.paintVertexArray.emplace(l,a[0],a[1]);else{for(var c=e;c<t;c++)this.paintVertexArray.emplace(c,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}},dt.prototype.upload=function(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))},dt.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var ft=function(e,t,r,a,l,c){this.expression=e,this.uniformNames=t.map((function(h){return"u_"+h+"_t"})),this.type=r,this.useIntegerZoom=a,this.zoom=l,this.maxValue=0,this.paintVertexAttributes=t.map((function(h){return{name:"a_"+h,type:"Float32",components:r==="color"?4:2,offset:0}})),this.paintVertexArray=new c};ft.prototype.populatePaintArray=function(e,t,r,a,l){var c=this.expression.evaluate(new kt(this.zoom),t,{},a,[],l),h=this.expression.evaluate(new kt(this.zoom+1),t,{},a,[],l),m=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(m,e,c,h)},ft.prototype.updatePaintArray=function(e,t,r,a){var l=this.expression.evaluate({zoom:this.zoom},r,a),c=this.expression.evaluate({zoom:this.zoom+1},r,a);this._setPaintValue(e,t,l,c)},ft.prototype._setPaintValue=function(e,t,r,a){if(this.type==="color")for(var l=We(r),c=We(a),h=e;h<t;h++)this.paintVertexArray.emplace(h,l[0],l[1],c[0],c[1]);else{for(var m=e;m<t;m++)this.paintVertexArray.emplace(m,r,a);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(a))}},ft.prototype.upload=function(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))},ft.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},ft.prototype.setUniform=function(e,t){var r=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,a=Ze(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(a)},ft.prototype.getBinding=function(e,t,r){return new ke(e,t)};var gt=function(e,t,r,a,l,c){this.expression=e,this.type=t,this.useIntegerZoom=r,this.zoom=a,this.layerId=c,this.zoomInPaintVertexArray=new l,this.zoomOutPaintVertexArray=new l};gt.prototype.populatePaintArray=function(e,t,r){var a=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(a,e,t.patterns&&t.patterns[this.layerId],r)},gt.prototype.updatePaintArray=function(e,t,r,a,l){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],l)},gt.prototype._setPaintValues=function(e,t,r,a){if(a&&r){var l=a[r.min],c=a[r.mid],h=a[r.max];if(l&&c&&h)for(var m=e;m<t;m++)this.zoomInPaintVertexArray.emplace(m,c.tl[0],c.tl[1],c.br[0],c.br[1],l.tl[0],l.tl[1],l.br[0],l.br[1],c.pixelRatio,l.pixelRatio),this.zoomOutPaintVertexArray.emplace(m,c.tl[0],c.tl[1],c.br[0],c.br[1],h.tl[0],h.tl[1],h.br[0],h.br[1],c.pixelRatio,h.pixelRatio)}},gt.prototype.upload=function(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,W.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,W.members,this.expression.isStateDependent))},gt.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var ht=function(e,t,r){this.binders={},this._buffers=[];var a=[];for(var l in e.paint._values)if(r(l)){var c=e.paint.get(l);if(c instanceof Ti&&Eo(c.property.specification)){var h=Jr(l,e.type),m=c.value,g=c.property.specification.type,b=c.property.useIntegerZoom,S=c.property.specification["property-type"],I=S==="cross-faded"||S==="cross-faded-data-driven";if(m.kind==="constant")this.binders[l]=I?new xt(m.value,h):new mt(m.value,h,g),a.push("/u_"+l);else if(m.kind==="source"||I){var C=Ir(l,g,"source");this.binders[l]=I?new gt(m,g,b,t,C,e.id):new dt(m,h,g,C),a.push("/a_"+l)}else{var z=Ir(l,g,"composite");this.binders[l]=new ft(m,h,g,b,t,z),a.push("/z_"+l)}}}this.cacheKey=a.sort().join("")};ht.prototype.getMaxValue=function(e){var t=this.binders[e];return t instanceof dt||t instanceof ft?t.maxValue:0},ht.prototype.populatePaintArrays=function(e,t,r,a,l){for(var c in this.binders){var h=this.binders[c];(h instanceof dt||h instanceof ft||h instanceof gt)&&h.populatePaintArray(e,t,r,a,l)}},ht.prototype.setConstantPatternPositions=function(e,t){for(var r in this.binders){var a=this.binders[r];a instanceof xt&&a.setConstantPatternPositions(e,t)}},ht.prototype.updatePaintArrays=function(e,t,r,a,l){var c=!1;for(var h in e)for(var m=0,g=t.getPositions(h);m<g.length;m+=1){var b=g[m],S=r.feature(b.index);for(var I in this.binders){var C=this.binders[I];if((C instanceof dt||C instanceof ft||C instanceof gt)&&C.expression.isStateDependent===!0){var z=a.paint.get(I);C.expression=z.value,C.updatePaintArray(b.start,b.end,S,e[h],l),c=!0}}}return c},ht.prototype.defines=function(){var e=[];for(var t in this.binders){var r=this.binders[t];(r instanceof mt||r instanceof xt)&&e.push.apply(e,r.uniformNames.map((function(a){return"#define HAS_UNIFORM_"+a})))}return e},ht.prototype.getBinderAttributes=function(){var e=[];for(var t in this.binders){var r=this.binders[t];if(r instanceof dt||r instanceof ft)for(var a=0;a<r.paintVertexAttributes.length;a++)e.push(r.paintVertexAttributes[a].name);else if(r instanceof gt)for(var l=0;l<W.members.length;l++)e.push(W.members[l].name)}return e},ht.prototype.getBinderUniforms=function(){var e=[];for(var t in this.binders){var r=this.binders[t];if(r instanceof mt||r instanceof xt||r instanceof ft)for(var a=0,l=r.uniformNames;a<l.length;a+=1)e.push(l[a])}return e},ht.prototype.getPaintVertexBuffers=function(){return this._buffers},ht.prototype.getUniforms=function(e,t){var r=[];for(var a in this.binders){var l=this.binders[a];if(l instanceof mt||l instanceof xt||l instanceof ft)for(var c=0,h=l.uniformNames;c<h.length;c+=1){var m=h[c];if(t[m]){var g=l.getBinding(e,t[m],m);r.push({name:m,property:a,binding:g})}}}return r},ht.prototype.setUniforms=function(e,t,r,a){for(var l=0,c=t;l<c.length;l+=1){var h=c[l],m=h.name,g=h.property;this.binders[g].setUniform(h.binding,a,r.get(g),m)}},ht.prototype.updatePaintBuffers=function(e){for(var t in this._buffers=[],this.binders){var r=this.binders[t];if(e&&r instanceof gt){var a=e.fromScale===2?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;a&&this._buffers.push(a)}else(r instanceof dt||r instanceof ft)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}},ht.prototype.upload=function(e){for(var t in this.binders){var r=this.binders[t];(r instanceof dt||r instanceof ft||r instanceof gt)&&r.upload(e)}this.updatePaintBuffers()},ht.prototype.destroy=function(){for(var e in this.binders){var t=this.binders[e];(t instanceof dt||t instanceof ft||t instanceof gt)&&t.destroy()}};var ct=function(e,t,r){r===void 0&&(r=function(){return!0}),this.programConfigurations={};for(var a=0,l=e;a<l.length;a+=1){var c=l[a];this.programConfigurations[c.id]=new ht(c,t,r)}this.needsUpload=!1,this._featureMap=new ne,this._bufferOffset=0};function Jr(e,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[e]||[e.replace(t+"-","").replace(/-/g,"_")]}function Ir(e,t,r){var a={color:{source:ta,composite:gs},number:{source:io,composite:ta}},l=(function(c){return{"line-pattern":{source:En,composite:En},"fill-pattern":{source:En,composite:En},"fill-extrusion-pattern":{source:En,composite:En}}[c]})(e);return l&&l[r]||a[t][r]}ct.prototype.populatePaintArrays=function(e,t,r,a,l,c){for(var h in this.programConfigurations)this.programConfigurations[h].populatePaintArrays(e,t,a,l,c);t.id!==void 0&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0},ct.prototype.updatePaintArrays=function(e,t,r,a){for(var l=0,c=r;l<c.length;l+=1){var h=c[l];this.needsUpload=this.programConfigurations[h.id].updatePaintArrays(e,this._featureMap,t,h,a)||this.needsUpload}},ct.prototype.get=function(e){return this.programConfigurations[e]},ct.prototype.upload=function(e){if(this.needsUpload){for(var t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}},ct.prototype.destroy=function(){for(var e in this.programConfigurations)this.programConfigurations[e].destroy()},Xe("ConstantBinder",mt),Xe("CrossFadedConstantBinder",xt),Xe("SourceExpressionBinder",dt),Xe("CrossFadedCompositeBinder",gt),Xe("CompositeExpressionBinder",ft),Xe("ProgramConfiguration",ht,{omit:["_buffers"]}),Xe("ProgramConfigurationSet",ct);var gi=Math.pow(2,14)-1,si=-gi-1;function wr(e){for(var t=8192/e.extent,r=e.loadGeometry(),a=0;a<r.length;a++)for(var l=r[a],c=0;c<l.length;c++){var h=l[c],m=Math.round(h.x*t),g=Math.round(h.y*t);h.x=Ze(m,si,gi),h.y=Ze(g,si,gi),(m<h.x||m>h.x+1||g<h.y||g>h.y+1)&&St("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function Mr(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?wr(e):[]}}function Wi(e,t,r,a,l){e.emplaceBack(2*t+(a+1)/2,2*r+(l+1)/2)}var Ei=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Bo,this.indexArray=new to,this.segments=new F,this.programConfigurations=new ct(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function no(e,t){for(var r=0;r<e.length;r++)if(Pn(t,e[r]))return!0;for(var a=0;a<t.length;a++)if(Pn(e,t[a]))return!0;return!!Ra(e,t)}function Ri(e,t,r){return!!Pn(e,t)||!!oo(t,e,r)}function wn(e,t){if(e.length===1)return La(t,e[0]);for(var r=0;r<t.length;r++)for(var a=t[r],l=0;l<a.length;l++)if(Pn(e,a[l]))return!0;for(var c=0;c<e.length;c++)if(La(t,e[c]))return!0;for(var h=0;h<t.length;h++)if(Ra(e,t[h]))return!0;return!1}function cn(e,t,r){if(e.length>1){if(Ra(e,t))return!0;for(var a=0;a<t.length;a++)if(oo(t[a],e,r))return!0}for(var l=0;l<e.length;l++)if(oo(e[l],t,r))return!0;return!1}function Ra(e,t){if(e.length===0||t.length===0)return!1;for(var r=0;r<e.length-1;r++)for(var a=e[r],l=e[r+1],c=0;c<t.length-1;c++)if(na(a,l,t[c],t[c+1]))return!0;return!1}function na(e,t,r,a){return Ut(e,r,a)!==Ut(t,r,a)&&Ut(e,t,r)!==Ut(e,t,a)}function oo(e,t,r){var a=r*r;if(t.length===1)return e.distSqr(t[0])<a;for(var l=1;l<t.length;l++)if(oa(e,t[l-1],t[l])<a)return!0;return!1}function oa(e,t,r){var a=t.distSqr(r);if(a===0)return e.distSqr(t);var l=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/a;return e.distSqr(l<0?t:l>1?r:r.sub(t)._mult(l)._add(t))}function La(e,t){for(var r,a,l,c=!1,h=0;h<e.length;h++)for(var m=0,g=(r=e[h]).length-1;m<r.length;g=m++)(a=r[m]).y>t.y!=(l=r[g]).y>t.y&&t.x<(l.x-a.x)*(t.y-a.y)/(l.y-a.y)+a.x&&(c=!c);return c}function Pn(e,t){for(var r=!1,a=0,l=e.length-1;a<e.length;l=a++){var c=e[a],h=e[l];c.y>t.y!=h.y>t.y&&t.x<(h.x-c.x)*(t.y-c.y)/(h.y-c.y)+c.x&&(r=!r)}return r}function Fa(e,t,r){var a=r[0],l=r[2];if(e.x<a.x&&t.x<a.x||e.x>l.x&&t.x>l.x||e.y<a.y&&t.y<a.y||e.y>l.y&&t.y>l.y)return!1;var c=Ut(e,t,r[0]);return c!==Ut(e,t,r[1])||c!==Ut(e,t,r[2])||c!==Ut(e,t,r[3])}function Cn(e,t,r){var a=t.paint.get(e).value;return a.kind==="constant"?a.value:r.programConfigurations.get(t.id).getMaxValue(e)}function Yr(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function On(e,t,r,a,l){if(!t[0]&&!t[1])return e;var c=X.convert(t)._mult(l);r==="viewport"&&c._rotate(-a);for(var h=[],m=0;m<e.length;m++)h.push(e[m].sub(c));return h}Ei.prototype.populate=function(e,t,r){var a=this.layers[0],l=[],c=null;a.type==="circle"&&(c=a.layout.get("circle-sort-key"));for(var h=0,m=e;h<m.length;h+=1){var g=m[h],b=g.feature,S=g.id,I=g.index,C=g.sourceLayerIndex,z=this.layers[0]._featureFilter.needGeometry,j=Mr(b,z);if(this.layers[0]._featureFilter.filter(new kt(this.zoom),j,r)){var G=c?c.evaluate(j,{},r):void 0,te={id:S,properties:b.properties,type:b.type,sourceLayerIndex:C,index:I,geometry:z?j.geometry:wr(b),patterns:{},sortKey:G};l.push(te)}}c&&l.sort((function(ze,rt){return ze.sortKey-rt.sortKey}));for(var K=0,oe=l;K<oe.length;K+=1){var le=oe[K],ce=le.geometry,he=le.index,xe=le.sourceLayerIndex,Pe=e[he].feature;this.addFeature(le,ce,he,r),t.featureIndex.insert(Pe,ce,he,xe,this.index)}},Ei.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},Ei.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Ei.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Ei.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,R),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},Ei.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Ei.prototype.addFeature=function(e,t,r,a){for(var l=0,c=t;l<c.length;l+=1)for(var h=0,m=c[l];h<m.length;h+=1){var g=m[h],b=g.x,S=g.y;if(!(b<0||b>=8192||S<0||S>=8192)){var I=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),C=I.vertexLength;Wi(this.layoutVertexArray,b,S,-1,-1),Wi(this.layoutVertexArray,b,S,1,-1),Wi(this.layoutVertexArray,b,S,1,1),Wi(this.layoutVertexArray,b,S,-1,1),this.indexArray.emplaceBack(C,C+1,C+2),this.indexArray.emplaceBack(C,C+3,C+2),I.vertexLength+=4,I.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},a)},Xe("CircleBucket",Ei,{omit:["layers"]});var ao=new vi({"circle-sort-key":new Ye(L.layout_circle["circle-sort-key"])}),Do={paint:new vi({"circle-radius":new Ye(L.paint_circle["circle-radius"]),"circle-color":new Ye(L.paint_circle["circle-color"]),"circle-blur":new Ye(L.paint_circle["circle-blur"]),"circle-opacity":new Ye(L.paint_circle["circle-opacity"]),"circle-translate":new it(L.paint_circle["circle-translate"]),"circle-translate-anchor":new it(L.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new it(L.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new it(L.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ye(L.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ye(L.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ye(L.paint_circle["circle-stroke-opacity"])}),layout:ao},Zt=typeof Float32Array<"u"?Float32Array:Array;function en(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Li(e,t,r){var a=t[0],l=t[1],c=t[2],h=t[3],m=t[4],g=t[5],b=t[6],S=t[7],I=t[8],C=t[9],z=t[10],j=t[11],G=t[12],te=t[13],K=t[14],oe=t[15],le=r[0],ce=r[1],he=r[2],xe=r[3];return e[0]=le*a+ce*m+he*I+xe*G,e[1]=le*l+ce*g+he*C+xe*te,e[2]=le*c+ce*b+he*z+xe*K,e[3]=le*h+ce*S+he*j+xe*oe,e[4]=(le=r[4])*a+(ce=r[5])*m+(he=r[6])*I+(xe=r[7])*G,e[5]=le*l+ce*g+he*C+xe*te,e[6]=le*c+ce*b+he*z+xe*K,e[7]=le*h+ce*S+he*j+xe*oe,e[8]=(le=r[8])*a+(ce=r[9])*m+(he=r[10])*I+(xe=r[11])*G,e[9]=le*l+ce*g+he*C+xe*te,e[10]=le*c+ce*b+he*z+xe*K,e[11]=le*h+ce*S+he*j+xe*oe,e[12]=(le=r[12])*a+(ce=r[13])*m+(he=r[14])*I+(xe=r[15])*G,e[13]=le*l+ce*g+he*C+xe*te,e[14]=le*c+ce*b+he*z+xe*K,e[15]=le*h+ce*S+he*j+xe*oe,e}Math.hypot||(Math.hypot=function(){for(var e=arguments,t=0,r=arguments.length;r--;)t+=e[r]*e[r];return Math.sqrt(t)});var Ro,Nc=Li;function _s(e,t,r){var a=t[0],l=t[1],c=t[2],h=t[3];return e[0]=r[0]*a+r[4]*l+r[8]*c+r[12]*h,e[1]=r[1]*a+r[5]*l+r[9]*c+r[13]*h,e[2]=r[2]*a+r[6]*l+r[10]*c+r[14]*h,e[3]=r[3]*a+r[7]*l+r[11]*c+r[15]*h,e}Ro=new Zt(3),Zt!=Float32Array&&(Ro[0]=0,Ro[1]=0,Ro[2]=0),(function(){var e=new Zt(4);Zt!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0)})();var jc=((function(){var e=new Zt(2);Zt!=Float32Array&&(e[0]=0,e[1]=0)})(),(function(e){function t(r){e.call(this,r,Do)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new Ei(r)},t.prototype.queryRadius=function(r){var a=r;return Cn("circle-radius",this,a)+Cn("circle-stroke-width",this,a)+Yr(this.paint.get("circle-translate"))},t.prototype.queryIntersectsFeature=function(r,a,l,c,h,m,g,b){for(var S=On(r,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),m.angle,g),I=this.paint.get("circle-radius").evaluate(a,l)+this.paint.get("circle-stroke-width").evaluate(a,l),C=this.paint.get("circle-pitch-alignment")==="map",z=C?S:(function(Pe,ze){return Pe.map((function(rt){return Oa(rt,ze)}))})(S,b),j=C?I*g:I,G=0,te=c;G<te.length;G+=1)for(var K=0,oe=te[G];K<oe.length;K+=1){var le=oe[K],ce=C?le:Oa(le,b),he=j,xe=_s([],[le.x,le.y,0,1],b);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?he*=xe[3]/m.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(he*=m.cameraToCenterDistance/xe[3]),Ri(z,ce,he))return!0}return!1},t})(An));function Oa(e,t){var r=_s([],[e.x,e.y,0,1],t);return new X(r[0]/r[3],r[1]/r[3])}var Fl=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(Ei);function aa(e,t,r,a){var l=t.width,c=t.height;if(a){if(a instanceof Uint8ClampedArray)a=new Uint8Array(a.buffer);else if(a.length!==l*c*r)throw new RangeError("mismatched image size")}else a=new Uint8Array(l*c*r);return e.width=l,e.height=c,e.data=a,e}function xs(e,t,r){var a=t.width,l=t.height;if(a!==e.width||l!==e.height){var c=aa({},{width:a,height:l},r);Gc(e,c,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,a),height:Math.min(e.height,l)},r),e.width=a,e.height=l,e.data=c.data}}function Gc(e,t,r,a,l,c){if(l.width===0||l.height===0)return t;if(l.width>e.width||l.height>e.height||r.x>e.width-l.width||r.y>e.height-l.height)throw new RangeError("out of range source coordinates for image copy");if(l.width>t.width||l.height>t.height||a.x>t.width-l.width||a.y>t.height-l.height)throw new RangeError("out of range destination coordinates for image copy");for(var h=e.data,m=t.data,g=0;g<l.height;g++)for(var b=((r.y+g)*e.width+r.x)*c,S=((a.y+g)*t.width+a.x)*c,I=0;I<l.width*c;I++)m[S+I]=h[b+I];return t}Xe("HeatmapBucket",Fl,{omit:["layers"]});var Va=function(e,t){aa(this,e,1,t)};Va.prototype.resize=function(e){xs(this,e,1)},Va.prototype.clone=function(){return new Va({width:this.width,height:this.height},new Uint8Array(this.data))},Va.copy=function(e,t,r,a,l){Gc(e,t,r,a,l,1)};var Hi=function(e,t){aa(this,e,4,t)};Hi.prototype.resize=function(e){xs(this,e,4)},Hi.prototype.replace=function(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e},Hi.prototype.clone=function(){return new Hi({width:this.width,height:this.height},new Uint8Array(this.data))},Hi.copy=function(e,t,r,a,l){Gc(e,t,r,a,l,4)},Xe("AlphaImage",Va),Xe("RGBAImage",Hi);var rb={paint:new vi({"heatmap-radius":new Ye(L.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ye(L.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new it(L.paint_heatmap["heatmap-intensity"]),"heatmap-color":new bn(L.paint_heatmap["heatmap-color"]),"heatmap-opacity":new it(L.paint_heatmap["heatmap-opacity"])})};function dm(e){var t={},r=e.resolution||256,a=e.clips?e.clips.length:1,l=e.image||new Hi({width:r,height:a}),c=function(j,G,te){t[e.evaluationKey]=te;var K=e.expression.evaluate(t);l.data[j+G+0]=Math.floor(255*K.r/K.a),l.data[j+G+1]=Math.floor(255*K.g/K.a),l.data[j+G+2]=Math.floor(255*K.b/K.a),l.data[j+G+3]=Math.floor(255*K.a)};if(e.clips)for(var h=0,m=0;h<a;++h,m+=4*r)for(var g=0,b=0;g<r;g++,b+=4){var S=g/(r-1),I=e.clips[h];c(m,b,I.start*(1-S)+I.end*S)}else for(var C=0,z=0;C<r;C++,z+=4)c(0,z,C/(r-1));return l}var ib=(function(e){function t(r){e.call(this,r,rb),this._updateColorRamp()}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new Fl(r)},t.prototype._handleSpecialPaintPropertyUpdate=function(r){r==="heatmap-color"&&this._updateColorRamp()},t.prototype._updateColorRamp=function(){this.colorRamp=dm({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},t.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype.hasOffscreenPass=function(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"},t})(An),nb={paint:new vi({"hillshade-illumination-direction":new it(L.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new it(L.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new it(L.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new it(L.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new it(L.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new it(L.paint_hillshade["hillshade-accent-color"])})},ob=(function(e){function t(r){e.call(this,r,nb)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.hasOffscreenPass=function(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"},t})(An),ab=ai([{name:"a_pos",components:2,type:"Int16"}],4).members,$c=Ol,sb=Ol;function Ol(e,t,r){r=r||2;var a,l,c,h,m,g,b,S=t&&t.length,I=S?t[0]*r:e.length,C=mm(e,0,I,r,!0),z=[];if(!C||C.next===C.prev)return z;if(S&&(C=(function(G,te,K,oe){var le,ce,he,xe=[];for(le=0,ce=te.length;le<ce;le++)(he=mm(G,te[le]*oe,le<ce-1?te[le+1]*oe:G.length,oe,!1))===he.next&&(he.steiner=!0),xe.push(mb(he));for(xe.sort(hb),le=0;le<xe.length;le++)fb(xe[le],K),K=sa(K,K.next);return K})(e,t,C,r)),e.length>80*r){a=c=e[0],l=h=e[1];for(var j=r;j<I;j+=r)(m=e[j])<a&&(a=m),(g=e[j+1])<l&&(l=g),m>c&&(c=m),g>h&&(h=g);b=(b=Math.max(c-a,h-l))!==0?1/b:0}return Eu(C,z,r,a,l,b),z}function mm(e,t,r,a,l){var c,h;if(l===Hc(e,t,r,a)>0)for(c=t;c<r;c+=a)h=gm(c,e[c],e[c+1],h);else for(c=r-a;c>=t;c-=a)h=gm(c,e[c],e[c+1],h);return h&&Vl(h,h.next)&&(Cu(h),h=h.next),h}function sa(e,t){if(!e)return e;t||(t=e);var r,a=e;do if(r=!1,a.steiner||!Vl(a,a.next)&&$r(a.prev,a,a.next)!==0)a=a.next;else{if(Cu(a),(a=t=a.prev)===a.next)break;r=!0}while(r||a!==t);return t}function Eu(e,t,r,a,l,c,h){if(e){!h&&c&&(function(S,I,C,z){var j=S;do j.z===null&&(j.z=Zc(j.x,j.y,I,C,z)),j.prevZ=j.prev,j.nextZ=j.next,j=j.next;while(j!==S);j.prevZ.nextZ=null,j.prevZ=null,(function(G){var te,K,oe,le,ce,he,xe,Pe,ze=1;do{for(K=G,G=null,ce=null,he=0;K;){for(he++,oe=K,xe=0,te=0;te<ze&&(xe++,oe=oe.nextZ);te++);for(Pe=ze;xe>0||Pe>0&&oe;)xe!==0&&(Pe===0||!oe||K.z<=oe.z)?(le=K,K=K.nextZ,xe--):(le=oe,oe=oe.nextZ,Pe--),ce?ce.nextZ=le:G=le,le.prevZ=ce,ce=le;K=oe}ce.nextZ=null,ze*=2}while(he>1)})(j)})(e,a,l,c);for(var m,g,b=e;e.prev!==e.next;)if(m=e.prev,g=e.next,c?lb(e,a,l,c):ub(e))t.push(m.i/r),t.push(e.i/r),t.push(g.i/r),Cu(e),e=g.next,b=g.next;else if((e=g)===b){h?h===1?Eu(e=cb(sa(e),t,r),t,r,a,l,c,2):h===2&&pb(e,t,r,a,l,c):Eu(sa(e),t,r,a,l,c,1);break}}}function ub(e){var t=e.prev,r=e,a=e.next;if($r(t,r,a)>=0)return!1;for(var l=e.next.next;l!==e.prev;){if(bs(t.x,t.y,r.x,r.y,a.x,a.y,l.x,l.y)&&$r(l.prev,l,l.next)>=0)return!1;l=l.next}return!0}function lb(e,t,r,a){var l=e.prev,c=e,h=e.next;if($r(l,c,h)>=0)return!1;for(var m=l.x>c.x?l.x>h.x?l.x:h.x:c.x>h.x?c.x:h.x,g=l.y>c.y?l.y>h.y?l.y:h.y:c.y>h.y?c.y:h.y,b=Zc(l.x<c.x?l.x<h.x?l.x:h.x:c.x<h.x?c.x:h.x,l.y<c.y?l.y<h.y?l.y:h.y:c.y<h.y?c.y:h.y,t,r,a),S=Zc(m,g,t,r,a),I=e.prevZ,C=e.nextZ;I&&I.z>=b&&C&&C.z<=S;){if(I!==e.prev&&I!==e.next&&bs(l.x,l.y,c.x,c.y,h.x,h.y,I.x,I.y)&&$r(I.prev,I,I.next)>=0||(I=I.prevZ,C!==e.prev&&C!==e.next&&bs(l.x,l.y,c.x,c.y,h.x,h.y,C.x,C.y)&&$r(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;I&&I.z>=b;){if(I!==e.prev&&I!==e.next&&bs(l.x,l.y,c.x,c.y,h.x,h.y,I.x,I.y)&&$r(I.prev,I,I.next)>=0)return!1;I=I.prevZ}for(;C&&C.z<=S;){if(C!==e.prev&&C!==e.next&&bs(l.x,l.y,c.x,c.y,h.x,h.y,C.x,C.y)&&$r(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function cb(e,t,r){var a=e;do{var l=a.prev,c=a.next.next;!Vl(l,c)&&ym(l,a,a.next,c)&&Pu(l,c)&&Pu(c,l)&&(t.push(l.i/r),t.push(a.i/r),t.push(c.i/r),Cu(a),Cu(a.next),a=e=c),a=a.next}while(a!==e);return sa(a)}function pb(e,t,r,a,l,c){var h=e;do{for(var m=h.next.next;m!==h.prev;){if(h.i!==m.i&&yb(h,m)){var g=vm(h,m);return h=sa(h,h.next),g=sa(g,g.next),Eu(h,t,r,a,l,c),void Eu(g,t,r,a,l,c)}m=m.next}h=h.next}while(h!==e)}function hb(e,t){return e.x-t.x}function fb(e,t){if(t=(function(a,l){var c,h=l,m=a.x,g=a.y,b=-1/0;do{if(g<=h.y&&g>=h.next.y&&h.next.y!==h.y){var S=h.x+(g-h.y)*(h.next.x-h.x)/(h.next.y-h.y);if(S<=m&&S>b){if(b=S,S===m){if(g===h.y)return h;if(g===h.next.y)return h.next}c=h.x<h.next.x?h:h.next}}h=h.next}while(h!==l);if(!c)return null;if(m===b)return c;var I,C=c,z=c.x,j=c.y,G=1/0;h=c;do m>=h.x&&h.x>=z&&m!==h.x&&bs(g<j?m:b,g,z,j,g<j?b:m,g,h.x,h.y)&&(I=Math.abs(g-h.y)/(m-h.x),Pu(h,a)&&(I<G||I===G&&(h.x>c.x||h.x===c.x&&db(c,h)))&&(c=h,G=I)),h=h.next;while(h!==C);return c})(e,t)){var r=vm(t,e);sa(t,t.next),sa(r,r.next)}}function db(e,t){return $r(e.prev,e,t.prev)<0&&$r(t.next,e,e.next)<0}function Zc(e,t,r,a,l){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*l)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-a)*l)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function mb(e){var t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function bs(e,t,r,a,l,c,h,m){return(l-h)*(t-m)-(e-h)*(c-m)>=0&&(e-h)*(a-m)-(r-h)*(t-m)>=0&&(r-h)*(c-m)-(l-h)*(a-m)>=0}function yb(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!(function(r,a){var l=r;do{if(l.i!==r.i&&l.next.i!==r.i&&l.i!==a.i&&l.next.i!==a.i&&ym(l,l.next,r,a))return!0;l=l.next}while(l!==r);return!1})(e,t)&&(Pu(e,t)&&Pu(t,e)&&(function(r,a){var l=r,c=!1,h=(r.x+a.x)/2,m=(r.y+a.y)/2;do l.y>m!=l.next.y>m&&l.next.y!==l.y&&h<(l.next.x-l.x)*(m-l.y)/(l.next.y-l.y)+l.x&&(c=!c),l=l.next;while(l!==r);return c})(e,t)&&($r(e.prev,e,t.prev)||$r(e,t.prev,t))||Vl(e,t)&&$r(e.prev,e,e.next)>0&&$r(t.prev,t,t.next)>0)}function $r(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Vl(e,t){return e.x===t.x&&e.y===t.y}function ym(e,t,r,a){var l=Ul($r(e,t,r)),c=Ul($r(e,t,a)),h=Ul($r(r,a,e)),m=Ul($r(r,a,t));return l!==c&&h!==m||!(l!==0||!ql(e,r,t))||!(c!==0||!ql(e,a,t))||!(h!==0||!ql(r,e,a))||!(m!==0||!ql(r,t,a))}function ql(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Ul(e){return e>0?1:e<0?-1:0}function Pu(e,t){return $r(e.prev,e,e.next)<0?$r(e,t,e.next)>=0&&$r(e,e.prev,t)>=0:$r(e,t,e.prev)<0||$r(e,e.next,t)<0}function vm(e,t){var r=new Wc(e.i,e.x,e.y),a=new Wc(t.i,t.x,t.y),l=e.next,c=t.prev;return e.next=t,t.prev=e,r.next=l,l.prev=r,a.next=r,r.prev=a,c.next=a,a.prev=c,a}function gm(e,t,r,a){var l=new Wc(e,t,r);return a?(l.next=a.next,l.prev=a,a.next.prev=l,a.next=l):(l.prev=l,l.next=l),l}function Cu(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Wc(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Hc(e,t,r,a){for(var l=0,c=t,h=r-a;c<r;c+=a)l+=(e[h]-e[c])*(e[c+1]+e[h+1]),h=c;return l}function vb(e,t,r,a,l){(function c(h,m,g,b,S){for(;b>g;){if(b-g>600){var I=b-g+1,C=m-g+1,z=Math.log(I),j=.5*Math.exp(2*z/3),G=.5*Math.sqrt(z*j*(I-j)/I)*(C-I/2<0?-1:1);c(h,m,Math.max(g,Math.floor(m-C*j/I+G)),Math.min(b,Math.floor(m+(I-C)*j/I+G)),S)}var te=h[m],K=g,oe=b;for(ku(h,g,m),S(h[b],te)>0&&ku(h,g,b);K<oe;){for(ku(h,K,oe),K++,oe--;S(h[K],te)<0;)K++;for(;S(h[oe],te)>0;)oe--}S(h[g],te)===0?ku(h,g,oe):ku(h,++oe,b),oe<=m&&(g=oe+1),m<=oe&&(b=oe-1)}})(e,t,r,a||e.length-1,l||gb)}function ku(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function gb(e,t){return e<t?-1:e>t?1:0}function Xc(e,t){var r=e.length;if(r<=1)return[e];for(var a,l,c=[],h=0;h<r;h++){var m=Hr(e[h]);m!==0&&(e[h].area=Math.abs(m),l===void 0&&(l=m<0),l===m<0?(a&&c.push(a),a=[e[h]]):a.push(e[h]))}if(a&&c.push(a),t>1)for(var g=0;g<c.length;g++)c[g].length<=t||(vb(c[g],t,1,c[g].length-1,_b),c[g]=c[g].slice(0,t));return c}function _b(e,t){return t.area-e.area}function Kc(e,t,r){for(var a=r.patternDependencies,l=!1,c=0,h=t;c<h.length;c+=1){var m=h[c].paint.get(e+"-pattern");m.isConstant()||(l=!0);var g=m.constantOr(null);g&&(l=!0,a[g.to]=!0,a[g.from]=!0)}return l}function Jc(e,t,r,a,l){for(var c=l.patternDependencies,h=0,m=t;h<m.length;h+=1){var g=m[h],b=g.paint.get(e+"-pattern").value;if(b.kind!=="constant"){var S=b.evaluate({zoom:a-1},r,{},l.availableImages),I=b.evaluate({zoom:a},r,{},l.availableImages),C=b.evaluate({zoom:a+1},r,{},l.availableImages);I=I&&I.name?I.name:I,C=C&&C.name?C.name:C,c[S=S&&S.name?S.name:S]=!0,c[I]=!0,c[C]=!0,r.patterns[g.id]={min:S,mid:I,max:C}}}return r}Ol.deviation=function(e,t,r,a){var l=t&&t.length,c=Math.abs(Hc(e,0,l?t[0]*r:e.length,r));if(l)for(var h=0,m=t.length;h<m;h++)c-=Math.abs(Hc(e,t[h]*r,h<m-1?t[h+1]*r:e.length,r));var g=0;for(h=0;h<a.length;h+=3){var b=a[h]*r,S=a[h+1]*r,I=a[h+2]*r;g+=Math.abs((e[b]-e[I])*(e[S+1]-e[b+1])-(e[b]-e[S])*(e[I+1]-e[b+1]))}return c===0&&g===0?0:Math.abs((g-c)/c)},Ol.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},a=0,l=0;l<e.length;l++){for(var c=0;c<e[l].length;c++)for(var h=0;h<t;h++)r.vertices.push(e[l][c][h]);l>0&&r.holes.push(a+=e[l-1].length)}return r},$c.default=sb;var Vn=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Bo,this.indexArray=new to,this.indexArray2=new Da,this.programConfigurations=new ct(e.layers,e.zoom),this.segments=new F,this.segments2=new F,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Vn.prototype.populate=function(e,t,r){this.hasPattern=Kc("fill",this.layers,t);for(var a=this.layers[0].layout.get("fill-sort-key"),l=[],c=0,h=e;c<h.length;c+=1){var m=h[c],g=m.feature,b=m.id,S=m.index,I=m.sourceLayerIndex,C=this.layers[0]._featureFilter.needGeometry,z=Mr(g,C);if(this.layers[0]._featureFilter.filter(new kt(this.zoom),z,r)){var j=a?a.evaluate(z,{},r,t.availableImages):void 0,G={id:b,properties:g.properties,type:g.type,sourceLayerIndex:I,index:S,geometry:C?z.geometry:wr(g),patterns:{},sortKey:j};l.push(G)}}a&&l.sort((function(Pe,ze){return Pe.sortKey-ze.sortKey}));for(var te=0,K=l;te<K.length;te+=1){var oe=K[te],le=oe.geometry,ce=oe.index,he=oe.sourceLayerIndex;if(this.hasPattern){var xe=Jc("fill",this.layers,oe,this.zoom,t);this.patternFeatures.push(xe)}else this.addFeature(oe,le,ce,r,{});t.featureIndex.insert(e[ce].feature,le,ce,he,this.index)}},Vn.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},Vn.prototype.addFeatures=function(e,t,r){for(var a=0,l=this.patternFeatures;a<l.length;a+=1){var c=l[a];this.addFeature(c,c.geometry,c.index,t,r)}},Vn.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Vn.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Vn.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ab),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0},Vn.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},Vn.prototype.addFeature=function(e,t,r,a,l){for(var c=0,h=Xc(t,500);c<h.length;c+=1){for(var m=h[c],g=0,b=0,S=m;b<S.length;b+=1)g+=S[b].length;for(var I=this.segments.prepareSegment(g,this.layoutVertexArray,this.indexArray),C=I.vertexLength,z=[],j=[],G=0,te=m;G<te.length;G+=1){var K=te[G];if(K.length!==0){K!==m[0]&&j.push(z.length/2);var oe=this.segments2.prepareSegment(K.length,this.layoutVertexArray,this.indexArray2),le=oe.vertexLength;this.layoutVertexArray.emplaceBack(K[0].x,K[0].y),this.indexArray2.emplaceBack(le+K.length-1,le),z.push(K[0].x),z.push(K[0].y);for(var ce=1;ce<K.length;ce++)this.layoutVertexArray.emplaceBack(K[ce].x,K[ce].y),this.indexArray2.emplaceBack(le+ce-1,le+ce),z.push(K[ce].x),z.push(K[ce].y);oe.vertexLength+=K.length,oe.primitiveLength+=K.length}}for(var he=$c(z,j),xe=0;xe<he.length;xe+=3)this.indexArray.emplaceBack(C+he[xe],C+he[xe+1],C+he[xe+2]);I.vertexLength+=g,I.primitiveLength+=he.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,l,a)},Xe("FillBucket",Vn,{omit:["layers","patternFeatures"]});var xb=new vi({"fill-sort-key":new Ye(L.layout_fill["fill-sort-key"])}),bb={paint:new vi({"fill-antialias":new it(L.paint_fill["fill-antialias"]),"fill-opacity":new Ye(L.paint_fill["fill-opacity"]),"fill-color":new Ye(L.paint_fill["fill-color"]),"fill-outline-color":new Ye(L.paint_fill["fill-outline-color"]),"fill-translate":new it(L.paint_fill["fill-translate"]),"fill-translate-anchor":new it(L.paint_fill["fill-translate-anchor"]),"fill-pattern":new ds(L.paint_fill["fill-pattern"])}),layout:xb},wb=(function(e){function t(r){e.call(this,r,bb)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.recalculate=function(r,a){e.prototype.recalculate.call(this,r,a);var l=this.paint._values["fill-outline-color"];l.value.kind==="constant"&&l.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},t.prototype.createBucket=function(r){return new Vn(r)},t.prototype.queryRadius=function(){return Yr(this.paint.get("fill-translate"))},t.prototype.queryIntersectsFeature=function(r,a,l,c,h,m,g){return wn(On(r,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),m.angle,g),c)},t.prototype.isTileClipped=function(){return!0},t})(An),Sb=ai([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,_m=ws;function ws(e,t,r,a,l){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=a,this._values=l,e.readFields(Ib,this,t)}function Ib(e,t,r){e==1?t.id=r.readVarint():e==2?(function(a,l){for(var c=a.readVarint()+a.pos;a.pos<c;){var h=l._keys[a.readVarint()],m=l._values[a.readVarint()];l.properties[h]=m}})(r,t):e==3?t.type=r.readVarint():e==4&&(t._geometry=r.pos)}function Tb(e){for(var t,r,a=0,l=0,c=e.length,h=c-1;l<c;h=l++)a+=((r=e[h]).x-(t=e[l]).x)*(t.y+r.y);return a}ws.types=["Unknown","Point","LineString","Polygon"],ws.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,a=1,l=0,c=0,h=0,m=[];e.pos<r;){if(l<=0){var g=e.readVarint();a=7&g,l=g>>3}if(l--,a===1||a===2)c+=e.readSVarint(),h+=e.readSVarint(),a===1&&(t&&m.push(t),t=[]),t.push(new X(c,h));else{if(a!==7)throw new Error("unknown command "+a);t&&t.push(t[0].clone())}}return t&&m.push(t),m},ws.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,a=0,l=0,c=0,h=1/0,m=-1/0,g=1/0,b=-1/0;e.pos<t;){if(a<=0){var S=e.readVarint();r=7&S,a=S>>3}if(a--,r===1||r===2)(l+=e.readSVarint())<h&&(h=l),l>m&&(m=l),(c+=e.readSVarint())<g&&(g=c),c>b&&(b=c);else if(r!==7)throw new Error("unknown command "+r)}return[h,g,m,b]},ws.prototype.toGeoJSON=function(e,t,r){var a,l,c=this.extent*Math.pow(2,r),h=this.extent*e,m=this.extent*t,g=this.loadGeometry(),b=ws.types[this.type];function S(z){for(var j=0;j<z.length;j++){var G=z[j];z[j]=[360*(G.x+h)/c-180,360/Math.PI*Math.atan(Math.exp((180-360*(G.y+m)/c)*Math.PI/180))-90]}}switch(this.type){case 1:var I=[];for(a=0;a<g.length;a++)I[a]=g[a][0];S(g=I);break;case 2:for(a=0;a<g.length;a++)S(g[a]);break;case 3:for(g=(function(z){var j=z.length;if(j<=1)return[z];for(var G,te,K=[],oe=0;oe<j;oe++){var le=Tb(z[oe]);le!==0&&(te===void 0&&(te=le<0),te===le<0?(G&&K.push(G),G=[z[oe]]):G.push(z[oe]))}return G&&K.push(G),K})(g),a=0;a<g.length;a++)for(l=0;l<g[a].length;l++)S(g[a][l])}g.length===1?g=g[0]:b="Multi"+b;var C={type:"Feature",geometry:{type:b,coordinates:g},properties:this.properties};return"id"in this&&(C.id=this.id),C};var xm=bm;function bm(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(Ab,this,t),this.length=this._features.length}function Ab(e,t,r){e===15?t.version=r.readVarint():e===1?t.name=r.readString():e===5?t.extent=r.readVarint():e===2?t._features.push(r.pos):e===3?t._keys.push(r.readString()):e===4&&t._values.push((function(a){for(var l=null,c=a.readVarint()+a.pos;a.pos<c;){var h=a.readVarint()>>3;l=h===1?a.readString():h===2?a.readFloat():h===3?a.readDouble():h===4?a.readVarint64():h===5?a.readVarint():h===6?a.readSVarint():h===7?a.readBoolean():null}return l})(r))}function Eb(e,t,r){if(e===3){var a=new xm(r,r.readVarint()+r.pos);a.length&&(t[a.name]=a)}}bm.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new _m(this._pbf,t,this.extent,this._keys,this._values)};var Ss={VectorTile:function(e,t){this.layers=e.readFields(Eb,{},t)},VectorTileFeature:_m,VectorTileLayer:xm},Pb=Ss.VectorTileFeature.types,Yc=Math.pow(2,13);function Mu(e,t,r,a,l,c,h,m){e.emplaceBack(t,r,2*Math.floor(a*Yc)+h,l*Yc*2,c*Yc*2,Math.round(m))}var qn=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Fn,this.indexArray=new to,this.programConfigurations=new ct(e.layers,e.zoom),this.segments=new F,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Cb(e,t){return e.x===t.x&&(e.x<0||e.x>8192)||e.y===t.y&&(e.y<0||e.y>8192)}qn.prototype.populate=function(e,t,r){this.features=[],this.hasPattern=Kc("fill-extrusion",this.layers,t);for(var a=0,l=e;a<l.length;a+=1){var c=l[a],h=c.feature,m=c.id,g=c.index,b=c.sourceLayerIndex,S=this.layers[0]._featureFilter.needGeometry,I=Mr(h,S);if(this.layers[0]._featureFilter.filter(new kt(this.zoom),I,r)){var C={id:m,sourceLayerIndex:b,index:g,geometry:S?I.geometry:wr(h),properties:h.properties,type:h.type,patterns:{}};this.hasPattern?this.features.push(Jc("fill-extrusion",this.layers,C,this.zoom,t)):this.addFeature(C,C.geometry,g,r,{}),t.featureIndex.insert(h,C.geometry,g,b,this.index,!0)}}},qn.prototype.addFeatures=function(e,t,r){for(var a=0,l=this.features;a<l.length;a+=1){var c=l[a];this.addFeature(c,c.geometry,c.index,t,r)}},qn.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},qn.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},qn.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},qn.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Sb),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},qn.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},qn.prototype.addFeature=function(e,t,r,a,l){for(var c=0,h=Xc(t,500);c<h.length;c+=1){for(var m=h[c],g=0,b=0,S=m;b<S.length;b+=1)g+=S[b].length;for(var I=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),C=0,z=m;C<z.length;C+=1){var j=z[C];if(j.length!==0&&!((Tt=j).every((function(vt){return vt.x<0}))||Tt.every((function(vt){return vt.x>8192}))||Tt.every((function(vt){return vt.y<0}))||Tt.every((function(vt){return vt.y>8192}))))for(var G=0,te=0;te<j.length;te++){var K=j[te];if(te>=1){var oe=j[te-1];if(!Cb(K,oe)){I.vertexLength+4>F.MAX_VERTEX_ARRAY_LENGTH&&(I=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var le=K.sub(oe)._perp()._unit(),ce=oe.dist(K);G+ce>32768&&(G=0),Mu(this.layoutVertexArray,K.x,K.y,le.x,le.y,0,0,G),Mu(this.layoutVertexArray,K.x,K.y,le.x,le.y,0,1,G),Mu(this.layoutVertexArray,oe.x,oe.y,le.x,le.y,0,0,G+=ce),Mu(this.layoutVertexArray,oe.x,oe.y,le.x,le.y,0,1,G);var he=I.vertexLength;this.indexArray.emplaceBack(he,he+2,he+1),this.indexArray.emplaceBack(he+1,he+2,he+3),I.vertexLength+=4,I.primitiveLength+=2}}}}if(I.vertexLength+g>F.MAX_VERTEX_ARRAY_LENGTH&&(I=this.segments.prepareSegment(g,this.layoutVertexArray,this.indexArray)),Pb[e.type]==="Polygon"){for(var xe=[],Pe=[],ze=I.vertexLength,rt=0,Oe=m;rt<Oe.length;rt+=1){var ot=Oe[rt];if(ot.length!==0){ot!==m[0]&&Pe.push(xe.length/2);for(var qe=0;qe<ot.length;qe++){var bt=ot[qe];Mu(this.layoutVertexArray,bt.x,bt.y,0,0,1,1,0),xe.push(bt.x),xe.push(bt.y)}}}for(var pt=$c(xe,Pe),Qe=0;Qe<pt.length;Qe+=3)this.indexArray.emplaceBack(ze+pt[Qe],ze+pt[Qe+2],ze+pt[Qe+1]);I.primitiveLength+=pt.length/3,I.vertexLength+=g}}var Tt;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,l,a)},Xe("FillExtrusionBucket",qn,{omit:["layers","features"]});var kb={paint:new vi({"fill-extrusion-opacity":new it(L["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ye(L["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new it(L["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new it(L["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ds(L["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ye(L["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ye(L["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new it(L["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},Mb=(function(e){function t(r){e.call(this,r,kb)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new qn(r)},t.prototype.queryRadius=function(){return Yr(this.paint.get("fill-extrusion-translate"))},t.prototype.is3D=function(){return!0},t.prototype.queryIntersectsFeature=function(r,a,l,c,h,m,g,b){var S=On(r,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),m.angle,g),I=this.paint.get("fill-extrusion-height").evaluate(a,l),C=this.paint.get("fill-extrusion-base").evaluate(a,l),z=(function(G,te,K,oe){for(var le=[],ce=0,he=G;ce<he.length;ce+=1){var xe=he[ce],Pe=[xe.x,xe.y,0,1];_s(Pe,Pe,te),le.push(new X(Pe[0]/Pe[3],Pe[1]/Pe[3]))}return le})(S,b),j=(function(G,te,K,oe){for(var le=[],ce=[],he=oe[8]*te,xe=oe[9]*te,Pe=oe[10]*te,ze=oe[11]*te,rt=oe[8]*K,Oe=oe[9]*K,ot=oe[10]*K,qe=oe[11]*K,bt=0,pt=G;bt<pt.length;bt+=1){for(var Qe=[],Tt=[],vt=0,Lt=pt[bt];vt<Lt.length;vt+=1){var at=Lt[vt],Vt=at.x,_r=at.y,Tr=oe[0]*Vt+oe[4]*_r+oe[12],Sr=oe[1]*Vt+oe[5]*_r+oe[13],xr=oe[2]*Vt+oe[6]*_r+oe[14],Ar=oe[3]*Vt+oe[7]*_r+oe[15],Qr=xr+Pe,ei=Ar+ze,Ci=Tr+rt,li=Sr+Oe,ki=xr+ot,Br=Ar+qe,ci=new X((Tr+he)/ei,(Sr+xe)/ei);ci.z=Qr/ei,Qe.push(ci);var Bt=new X(Ci/Br,li/Br);Bt.z=ki/Br,Tt.push(Bt)}le.push(Qe),ce.push(Tt)}return[le,ce]})(c,C,I,b);return(function(G,te,K){var oe=1/0;wn(K,te)&&(oe=wm(K,te[0]));for(var le=0;le<te.length;le++)for(var ce=te[le],he=G[le],xe=0;xe<ce.length-1;xe++){var Pe=ce[xe],ze=[Pe,ce[xe+1],he[xe+1],he[xe],Pe];no(K,ze)&&(oe=Math.min(oe,wm(K,ze)))}return oe!==1/0&&oe})(j[0],j[1],z)},t})(An);function Bu(e,t){return e.x*t.x+e.y*t.y}function wm(e,t){if(e.length===1){for(var r,a=0,l=t[a++];!r||l.equals(r);)if(!(r=t[a++]))return 1/0;for(;a<t.length;a++){var c=t[a],h=e[0],m=r.sub(l),g=c.sub(l),b=h.sub(l),S=Bu(m,m),I=Bu(m,g),C=Bu(g,g),z=Bu(b,m),j=Bu(b,g),G=S*C-I*I,te=(C*z-I*j)/G,K=(S*j-I*z)/G,oe=l.z*(1-te-K)+r.z*te+c.z*K;if(isFinite(oe))return oe}return 1/0}for(var le=1/0,ce=0,he=t;ce<he.length;ce+=1)le=Math.min(le,he[ce].z);return le}var Bb=ai([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,zb=ai([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,Db=Ss.VectorTileFeature.types,Rb=Math.cos(Math.PI/180*37.5),Sm=Math.pow(2,14)/.5,Fi=function(e){var t=this;this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(r){return r.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((function(r){t.gradients[r.id]={}})),this.layoutVertexArray=new Zi,this.layoutVertexArray2=new ta,this.indexArray=new to,this.programConfigurations=new ct(e.layers,e.zoom),this.segments=new F,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((function(r){return r.isStateDependent()})).map((function(r){return r.id}))};Fi.prototype.populate=function(e,t,r){this.hasPattern=Kc("line",this.layers,t);for(var a=this.layers[0].layout.get("line-sort-key"),l=[],c=0,h=e;c<h.length;c+=1){var m=h[c],g=m.feature,b=m.id,S=m.index,I=m.sourceLayerIndex,C=this.layers[0]._featureFilter.needGeometry,z=Mr(g,C);if(this.layers[0]._featureFilter.filter(new kt(this.zoom),z,r)){var j=a?a.evaluate(z,{},r):void 0,G={id:b,properties:g.properties,type:g.type,sourceLayerIndex:I,index:S,geometry:C?z.geometry:wr(g),patterns:{},sortKey:j};l.push(G)}}a&&l.sort((function(Pe,ze){return Pe.sortKey-ze.sortKey}));for(var te=0,K=l;te<K.length;te+=1){var oe=K[te],le=oe.geometry,ce=oe.index,he=oe.sourceLayerIndex;if(this.hasPattern){var xe=Jc("line",this.layers,oe,this.zoom,t);this.patternFeatures.push(xe)}else this.addFeature(oe,le,ce,r,{});t.featureIndex.insert(e[ce].feature,le,ce,he,this.index)}},Fi.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},Fi.prototype.addFeatures=function(e,t,r){for(var a=0,l=this.patternFeatures;a<l.length;a+=1){var c=l[a];this.addFeature(c,c.geometry,c.index,t,r)}},Fi.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Fi.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Fi.prototype.upload=function(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,zb)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Bb),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},Fi.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Fi.prototype.lineFeatureClips=function(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}},Fi.prototype.addFeature=function(e,t,r,a,l){var c=this.layers[0].layout,h=c.get("line-join").evaluate(e,{}),m=c.get("line-cap"),g=c.get("line-miter-limit"),b=c.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(var S=0,I=t;S<I.length;S+=1)this.addLine(I[S],e,h,m,g,b);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,l,a)},Fi.prototype.addLine=function(e,t,r,a,l,c){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var h=0;h<e.length-1;h++)this.totalDistance+=e[h].dist(e[h+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var m=Db[t.type]==="Polygon",g=e.length;g>=2&&e[g-1].equals(e[g-2]);)g--;for(var b=0;b<g-1&&e[b].equals(e[b+1]);)b++;if(!(g<(m?3:2))){r==="bevel"&&(l=1.05);var S,I=this.overscaling<=16?122880/(512*this.overscaling):0,C=this.segments.prepareSegment(10*g,this.layoutVertexArray,this.indexArray),z=void 0,j=void 0,G=void 0,te=void 0;this.e1=this.e2=-1,m&&(te=e[b].sub(S=e[g-2])._unit()._perp());for(var K=b;K<g;K++)if(!(j=K===g-1?m?e[b+1]:void 0:e[K+1])||!e[K].equals(j)){te&&(G=te),S&&(z=S),S=e[K],te=j?j.sub(S)._unit()._perp():G;var oe=(G=G||te).add(te);oe.x===0&&oe.y===0||oe._unit();var le=G.x*te.x+G.y*te.y,ce=oe.x*te.x+oe.y*te.y,he=ce!==0?1/ce:1/0,xe=2*Math.sqrt(2-2*ce),Pe=ce<Rb&&z&&j,ze=G.x*te.y-G.y*te.x>0;if(Pe&&K>b){var rt=S.dist(z);if(rt>2*I){var Oe=S.sub(S.sub(z)._mult(I/rt)._round());this.updateDistance(z,Oe),this.addCurrentVertex(Oe,G,0,0,C),z=Oe}}var ot=z&&j,qe=ot?r:m?"butt":a;if(ot&&qe==="round"&&(he<c?qe="miter":he<=2&&(qe="fakeround")),qe==="miter"&&he>l&&(qe="bevel"),qe==="bevel"&&(he>2&&(qe="flipbevel"),he<l&&(qe="miter")),z&&this.updateDistance(z,S),qe==="miter")oe._mult(he),this.addCurrentVertex(S,oe,0,0,C);else if(qe==="flipbevel"){if(he>100)oe=te.mult(-1);else{var bt=he*G.add(te).mag()/G.sub(te).mag();oe._perp()._mult(bt*(ze?-1:1))}this.addCurrentVertex(S,oe,0,0,C),this.addCurrentVertex(S,oe.mult(-1),0,0,C)}else if(qe==="bevel"||qe==="fakeround"){var pt=-Math.sqrt(he*he-1),Qe=ze?pt:0,Tt=ze?0:pt;if(z&&this.addCurrentVertex(S,G,Qe,Tt,C),qe==="fakeround")for(var vt=Math.round(180*xe/Math.PI/20),Lt=1;Lt<vt;Lt++){var at=Lt/vt;if(at!==.5){var Vt=at-.5;at+=at*Vt*(at-1)*((1.0904+le*(le*(3.55645-1.43519*le)-3.2452))*Vt*Vt+(.848013+le*(.215638*le-1.06021)))}var _r=te.sub(G)._mult(at)._add(G)._unit()._mult(ze?-1:1);this.addHalfVertex(S,_r.x,_r.y,!1,ze,0,C)}j&&this.addCurrentVertex(S,te,-Qe,-Tt,C)}else if(qe==="butt")this.addCurrentVertex(S,oe,0,0,C);else if(qe==="square"){var Tr=z?1:-1;this.addCurrentVertex(S,oe,Tr,Tr,C)}else qe==="round"&&(z&&(this.addCurrentVertex(S,G,0,0,C),this.addCurrentVertex(S,G,1,1,C,!0)),j&&(this.addCurrentVertex(S,te,-1,-1,C,!0),this.addCurrentVertex(S,te,0,0,C)));if(Pe&&K<g-1){var Sr=S.dist(j);if(Sr>2*I){var xr=S.add(j.sub(S)._mult(I/Sr)._round());this.updateDistance(S,xr),this.addCurrentVertex(xr,te,0,0,C),S=xr}}}}},Fi.prototype.addCurrentVertex=function(e,t,r,a,l,c){c===void 0&&(c=!1);var h=t.y*a-t.x,m=-t.y-t.x*a;this.addHalfVertex(e,t.x+t.y*r,t.y-t.x*r,c,!1,r,l),this.addHalfVertex(e,h,m,c,!0,-a,l),this.distance>Sm/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(e,t,r,a,l,c))},Fi.prototype.addHalfVertex=function(e,t,r,a,l,c,h){var m=.5*(this.lineClips?this.scaledDistance*(Sm-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e.x<<1)+(a?1:0),(e.y<<1)+(l?1:0),Math.round(63*t)+128,Math.round(63*r)+128,1+(c===0?0:c<0?-1:1)|(63&m)<<2,m>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var g=h.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,g),h.primitiveLength++),l?this.e2=g:this.e1=g},Fi.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Fi.prototype.updateDistance=function(e,t){this.distance+=e.dist(t),this.updateScaledDistance()},Xe("LineBucket",Fi,{omit:["layers","patternFeatures"]});var Lb=new vi({"line-cap":new it(L.layout_line["line-cap"]),"line-join":new Ye(L.layout_line["line-join"]),"line-miter-limit":new it(L.layout_line["line-miter-limit"]),"line-round-limit":new it(L.layout_line["line-round-limit"]),"line-sort-key":new Ye(L.layout_line["line-sort-key"])}),Im={paint:new vi({"line-opacity":new Ye(L.paint_line["line-opacity"]),"line-color":new Ye(L.paint_line["line-color"]),"line-translate":new it(L.paint_line["line-translate"]),"line-translate-anchor":new it(L.paint_line["line-translate-anchor"]),"line-width":new Ye(L.paint_line["line-width"]),"line-gap-width":new Ye(L.paint_line["line-gap-width"]),"line-offset":new Ye(L.paint_line["line-offset"]),"line-blur":new Ye(L.paint_line["line-blur"]),"line-dasharray":new Ai(L.paint_line["line-dasharray"]),"line-pattern":new ds(L.paint_line["line-pattern"]),"line-gradient":new bn(L.paint_line["line-gradient"])}),layout:Lb},Tm=new((function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.possiblyEvaluate=function(r,a){return a=new kt(Math.floor(a.zoom),{now:a.now,fadeDuration:a.fadeDuration,zoomHistory:a.zoomHistory,transition:a.transition}),e.prototype.possiblyEvaluate.call(this,r,a)},t.prototype.evaluate=function(r,a,l,c){return a=Ue({},a,{zoom:Math.floor(a.zoom)}),e.prototype.evaluate.call(this,r,a,l,c)},t})(Ye))(Im.paint.properties["line-width"].specification);Tm.useIntegerZoom=!0;var Fb=(function(e){function t(r){e.call(this,r,Im),this.gradientVersion=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._handleSpecialPaintPropertyUpdate=function(r){r==="line-gradient"&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Ui,this.gradientVersion=(this.gradientVersion+1)%Se)},t.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},t.prototype.recalculate=function(r,a){e.prototype.recalculate.call(this,r,a),this.paint._values["line-floorwidth"]=Tm.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,r)},t.prototype.createBucket=function(r){return new Fi(r)},t.prototype.queryRadius=function(r){var a=r,l=Am(Cn("line-width",this,a),Cn("line-gap-width",this,a)),c=Cn("line-offset",this,a);return l/2+Math.abs(c)+Yr(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(r,a,l,c,h,m,g){var b=On(r,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),m.angle,g),S=g/2*Am(this.paint.get("line-width").evaluate(a,l),this.paint.get("line-gap-width").evaluate(a,l)),I=this.paint.get("line-offset").evaluate(a,l);return I&&(c=(function(C,z){for(var j=[],G=new X(0,0),te=0;te<C.length;te++){for(var K=C[te],oe=[],le=0;le<K.length;le++){var ce=K[le],he=K[le+1],xe=le===0?G:ce.sub(K[le-1])._unit()._perp(),Pe=le===K.length-1?G:he.sub(ce)._unit()._perp(),ze=xe._add(Pe)._unit();ze._mult(1/(ze.x*Pe.x+ze.y*Pe.y)),oe.push(ze._mult(z)._add(ce))}j.push(oe)}return j})(c,I*g)),(function(C,z,j){for(var G=0;G<z.length;G++){var te=z[G];if(C.length>=3){for(var K=0;K<te.length;K++)if(Pn(C,te[K]))return!0}if(cn(C,te,j))return!0}return!1})(b,c,S)},t.prototype.isTileClipped=function(){return!0},t})(An);function Am(e,t){return t>0?t+2*e:e}var Ob=ai([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Vb=ai([{name:"a_projected_pos",components:3,type:"Float32"}],4),qb=(ai([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),ai([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Em=(ai([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),ai([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Ub=ai([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Nb(e,t,r){return e.sections.forEach((function(a){a.text=(function(l,c,h){var m=c.layout.get("text-transform").evaluate(h,{});return m==="uppercase"?l=l.toLocaleUpperCase():m==="lowercase"&&(l=l.toLocaleLowerCase()),Qi.applyArabicShaping&&(l=Qi.applyArabicShaping(l)),l})(a.text,t,r)})),e}ai([{name:"triangle",components:3,type:"Uint16"}]),ai([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),ai([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),ai([{type:"Float32",name:"offsetX"}]),ai([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var zu={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Pm=function(e,t,r,a,l){var c,h,m=8*l-a-1,g=(1<<m)-1,b=g>>1,S=-7,I=l-1,C=-1,z=e[t+I];for(I+=C,c=z&(1<<-S)-1,z>>=-S,S+=m;S>0;c=256*c+e[t+I],I+=C,S-=8);for(h=c&(1<<-S)-1,c>>=-S,S+=a;S>0;h=256*h+e[t+I],I+=C,S-=8);if(c===0)c=1-b;else{if(c===g)return h?NaN:1/0*(z?-1:1);h+=Math.pow(2,a),c-=b}return(z?-1:1)*h*Math.pow(2,c-a)},Cm=function(e,t,r,a,l,c){var h,m,g,b=8*c-l-1,S=(1<<b)-1,I=S>>1,C=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,z=0,j=1,G=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(m=isNaN(t)?1:0,h=S):(h=Math.floor(Math.log(t)/Math.LN2),t*(g=Math.pow(2,-h))<1&&(h--,g*=2),(t+=h+I>=1?C/g:C*Math.pow(2,1-I))*g>=2&&(h++,g/=2),h+I>=S?(m=0,h=S):h+I>=1?(m=(t*g-1)*Math.pow(2,l),h+=I):(m=t*Math.pow(2,I-1)*Math.pow(2,l),h=0));l>=8;e[r+z]=255&m,z+=j,m/=256,l-=8);for(h=h<<l|m,b+=l;b>0;e[r+z]=255&h,z+=j,h/=256,b-=8);e[r+z-j]|=128*G},Nl=cr;function cr(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}cr.Varint=0,cr.Fixed64=1,cr.Bytes=2,cr.Fixed32=5;var km=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Lo(e){return e.type===cr.Bytes?e.readVarint()+e.pos:e.pos+1}function Is(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function Mm(e,t,r){var a=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(a);for(var l=r.pos-1;l>=e;l--)r.buf[l+a]=r.buf[l]}function jb(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function Gb(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function $b(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function Zb(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function Wb(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function Hb(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function Xb(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function Kb(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function Jb(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function jl(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function Ts(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function Bm(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function Yb(e,t,r){e===1&&r.readMessage(Qb,t)}function Qb(e,t,r){if(e===3){var a=r.readMessage(e0,{}),l=a.width,c=a.height,h=a.left,m=a.top,g=a.advance;t.push({id:a.id,bitmap:new Va({width:l+6,height:c+6},a.bitmap),metrics:{width:l,height:c,left:h,top:m,advance:g}})}}function e0(e,t,r){e===1?t.id=r.readVarint():e===2?t.bitmap=r.readBytes():e===3?t.width=r.readVarint():e===4?t.height=r.readVarint():e===5?t.left=r.readSVarint():e===6?t.top=r.readSVarint():e===7&&(t.advance=r.readVarint())}function zm(e){for(var t=0,r=0,a=0,l=e;a<l.length;a+=1){var c=l[a];t+=c.w*c.h,r=Math.max(r,c.w)}e.sort((function(G,te){return te.h-G.h}));for(var h=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}],m=0,g=0,b=0,S=e;b<S.length;b+=1)for(var I=S[b],C=h.length-1;C>=0;C--){var z=h[C];if(!(I.w>z.w||I.h>z.h)){if(I.x=z.x,I.y=z.y,g=Math.max(g,I.y+I.h),m=Math.max(m,I.x+I.w),I.w===z.w&&I.h===z.h){var j=h.pop();C<h.length&&(h[C]=j)}else I.h===z.h?(z.x+=I.w,z.w-=I.w):I.w===z.w?(z.y+=I.h,z.h-=I.h):(h.push({x:z.x+I.w,y:z.y,w:z.w-I.w,h:I.h}),z.y+=I.h,z.h-=I.h);break}}return{w:m,h:g,fill:t/(m*g)||0}}cr.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var a=this.readVarint(),l=a>>3,c=this.pos;this.type=7&a,e(l,t,this),this.pos===c&&this.skip(a)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=jl(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=Bm(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=jl(this.buf,this.pos)+4294967296*jl(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=jl(this.buf,this.pos)+4294967296*Bm(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=Pm(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Pm(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,a=this.buf;return t=127&(r=a[this.pos++]),r<128?t:(t|=(127&(r=a[this.pos++]))<<7,r<128?t:(t|=(127&(r=a[this.pos++]))<<14,r<128?t:(t|=(127&(r=a[this.pos++]))<<21,r<128?t:(function(l,c,h){var m,g,b=h.buf;if(m=(112&(g=b[h.pos++]))>>4,g<128||(m|=(127&(g=b[h.pos++]))<<3,g<128)||(m|=(127&(g=b[h.pos++]))<<10,g<128)||(m|=(127&(g=b[h.pos++]))<<17,g<128)||(m|=(127&(g=b[h.pos++]))<<24,g<128)||(m|=(1&(g=b[h.pos++]))<<31,g<128))return Is(l,m,c);throw new Error("Expected varint not more than 10 bytes")})(t|=(15&(r=a[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&km?(function(r,a,l){return km.decode(r.subarray(a,l))})(this.buf,t,e):(function(r,a,l){for(var c="",h=a;h<l;){var m,g,b,S=r[h],I=null,C=S>239?4:S>223?3:S>191?2:1;if(h+C>l)break;C===1?S<128&&(I=S):C===2?(192&(m=r[h+1]))==128&&(I=(31&S)<<6|63&m)<=127&&(I=null):C===3?(g=r[h+2],(192&(m=r[h+1]))==128&&(192&g)==128&&((I=(15&S)<<12|(63&m)<<6|63&g)<=2047||I>=55296&&I<=57343)&&(I=null)):C===4&&(g=r[h+2],b=r[h+3],(192&(m=r[h+1]))==128&&(192&g)==128&&(192&b)==128&&((I=(15&S)<<18|(63&m)<<12|(63&g)<<6|63&b)<=65535||I>=1114112)&&(I=null)),I===null?(I=65533,C=1):I>65535&&(I-=65536,c+=String.fromCharCode(I>>>10&1023|55296),I=56320|1023&I),c+=String.fromCharCode(I),h+=C}return c})(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==cr.Bytes)return e.push(this.readVarint(t));var r=Lo(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==cr.Bytes)return e.push(this.readSVarint());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==cr.Bytes)return e.push(this.readBoolean());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==cr.Bytes)return e.push(this.readFloat());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==cr.Bytes)return e.push(this.readDouble());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==cr.Bytes)return e.push(this.readFixed32());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==cr.Bytes)return e.push(this.readSFixed32());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==cr.Bytes)return e.push(this.readFixed64());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==cr.Bytes)return e.push(this.readSFixed64());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===cr.Varint)for(;this.buf[this.pos++]>127;);else if(t===cr.Bytes)this.pos=this.readVarint()+this.pos;else if(t===cr.Fixed32)this.pos+=4;else{if(t!==cr.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),Ts(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),Ts(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),Ts(this.buf,-1&e,this.pos),Ts(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),Ts(this.buf,-1&e,this.pos),Ts(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?(function(t,r){var a,l;if(t>=0?(a=t%4294967296|0,l=t/4294967296|0):(l=~(-t/4294967296),4294967295^(a=~(-t%4294967296))?a=a+1|0:(a=0,l=l+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),(function(c,h,m){m.buf[m.pos++]=127&c|128,c>>>=7,m.buf[m.pos++]=127&c|128,c>>>=7,m.buf[m.pos++]=127&c|128,c>>>=7,m.buf[m.pos++]=127&c|128,m.buf[m.pos]=127&(c>>>=7)})(a,0,r),(function(c,h){var m=(7&c)<<4;h.buf[h.pos++]|=m|((c>>>=3)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c)))))})(l,r)})(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(!!e)},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=(function(a,l,c){for(var h,m,g=0;g<l.length;g++){if((h=l.charCodeAt(g))>55295&&h<57344){if(!m){h>56319||g+1===l.length?(a[c++]=239,a[c++]=191,a[c++]=189):m=h;continue}if(h<56320){a[c++]=239,a[c++]=191,a[c++]=189,m=h;continue}h=m-55296<<10|h-56320|65536,m=null}else m&&(a[c++]=239,a[c++]=191,a[c++]=189,m=null);h<128?a[c++]=h:(h<2048?a[c++]=h>>6|192:(h<65536?a[c++]=h>>12|224:(a[c++]=h>>18|240,a[c++]=h>>12&63|128),a[c++]=h>>6&63|128),a[c++]=63&h|128)}return c})(this.buf,e,this.pos);var r=this.pos-t;r>=128&&Mm(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),Cm(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Cm(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var a=this.pos-r;a>=128&&Mm(r,a,this),this.pos=r-1,this.writeVarint(a),this.pos+=a},writeMessage:function(e,t,r){this.writeTag(e,cr.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,jb,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,Gb,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,Wb,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,$b,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,Zb,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,Hb,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,Xb,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Kb,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,Jb,t)},writeBytesField:function(e,t){this.writeTag(e,cr.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,cr.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,cr.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,cr.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,cr.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,cr.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,cr.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,cr.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,cr.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,cr.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,!!t)}};var Gl=function(e,t){var r=t.pixelRatio,a=t.version,l=t.stretchX,c=t.stretchY,h=t.content;this.paddedRect=e,this.pixelRatio=r,this.stretchX=l,this.stretchY=c,this.content=h,this.version=a},Du={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Du.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Du.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Du.tlbr.get=function(){return this.tl.concat(this.br)},Du.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Gl.prototype,Du);var Ru=function(e,t){var r={},a={};this.haveRenderCallbacks=[];var l=[];this.addImages(e,r,l),this.addImages(t,a,l);var c=zm(l),h=new Hi({width:c.w||1,height:c.h||1});for(var m in e){var g=e[m],b=r[m].paddedRect;Hi.copy(g.data,h,{x:0,y:0},{x:b.x+1,y:b.y+1},g.data)}for(var S in t){var I=t[S],C=a[S].paddedRect,z=C.x+1,j=C.y+1,G=I.data.width,te=I.data.height;Hi.copy(I.data,h,{x:0,y:0},{x:z,y:j},I.data),Hi.copy(I.data,h,{x:0,y:te-1},{x:z,y:j-1},{width:G,height:1}),Hi.copy(I.data,h,{x:0,y:0},{x:z,y:j+te},{width:G,height:1}),Hi.copy(I.data,h,{x:G-1,y:0},{x:z-1,y:j},{width:1,height:te}),Hi.copy(I.data,h,{x:0,y:0},{x:z+G,y:j},{width:1,height:te})}this.image=h,this.iconPositions=r,this.patternPositions=a};Ru.prototype.addImages=function(e,t,r){for(var a in e){var l=e[a],c={x:0,y:0,w:l.data.width+2,h:l.data.height+2};r.push(c),t[a]=new Gl(c,l),l.hasRenderCallback&&this.haveRenderCallbacks.push(a)}},Ru.prototype.patchUpdatedImages=function(e,t){for(var r in e.dispatchRenderCallbacks(this.haveRenderCallbacks),e.updatedImages)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)},Ru.prototype.patchUpdatedImage=function(e,t,r){if(e&&t&&e.version!==t.version){e.version=t.version;var a=e.tl;r.update(t.data,void 0,{x:a[0],y:a[1]})}},Xe("ImagePosition",Gl),Xe("ImageAtlas",Ru);var pn={horizontal:1,vertical:2,horizontalOnly:3},As=function(){this.scale=1,this.fontStack="",this.imageName=null};As.forText=function(e,t){var r=new As;return r.scale=e||1,r.fontStack=t,r},As.forImage=function(e){var t=new As;return t.imageName=e,t};var Pi=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function $l(e,t,r,a,l,c,h,m,g,b,S,I,C,z,j,G){var te,K=Pi.fromFeature(e,l);I===pn.vertical&&K.verticalizePunctuation();var oe=Qi.processBidirectionalText,le=Qi.processStyledBidirectionalText;if(oe&&K.sections.length===1){te=[];for(var ce=0,he=oe(K.toString(),Qc(K,b,c,t,a,z,j));ce<he.length;ce+=1){var xe=he[ce],Pe=new Pi;Pe.text=xe,Pe.sections=K.sections;for(var ze=0;ze<xe.length;ze++)Pe.sectionIndex.push(0);te.push(Pe)}}else if(le){te=[];for(var rt=0,Oe=le(K.text,K.sectionIndex,Qc(K,b,c,t,a,z,j));rt<Oe.length;rt+=1){var ot=Oe[rt],qe=new Pi;qe.text=ot[0],qe.sectionIndex=ot[1],qe.sections=K.sections,te.push(qe)}}else te=(function(Qe,Tt){for(var vt=[],Lt=Qe.text,at=0,Vt=0,_r=Tt;Vt<_r.length;Vt+=1){var Tr=_r[Vt];vt.push(Qe.substring(at,Tr)),at=Tr}return at<Lt.length&&vt.push(Qe.substring(at,Lt.length)),vt})(K,Qc(K,b,c,t,a,z,j));var bt=[],pt={positionedLines:bt,text:K.toString(),top:S[1],bottom:S[1],left:S[0],right:S[0],writingMode:I,iconsInText:!1,verticalizable:!1};return(function(Qe,Tt,vt,Lt,at,Vt,_r,Tr,Sr,xr,Ar,Qr){for(var ei=0,Ci=-17,li=0,ki=0,Br=Tr==="right"?1:Tr==="left"?0:.5,ci=0,Bt=0,nr=at;Bt<nr.length;Bt+=1){var Jt=nr[Bt];Jt.trim();var Ot=Jt.getMaxScale(),Oi=24*(Ot-1),_i={positionedGlyphs:[],lineOffset:0};Qe.positionedLines[ci]=_i;var dr=_i.positionedGlyphs,Ur=0;if(Jt.length()){for(var xi=0;xi<Jt.length();xi++){var qt=Jt.getSection(xi),so=Jt.getSectionIndex(xi),hn=Jt.getCharCode(xi),uo=0,zr=null,lo=null,kn=null,Ds=24,ja=!(Sr===pn.horizontal||!Ar&&!ps(hn)||Ar&&(Zl[hn]||(qo=hn,Re.Arabic(qo)||Re["Arabic Supplement"](qo)||Re["Arabic Extended-A"](qo)||Re["Arabic Presentation Forms-A"](qo)||Re["Arabic Presentation Forms-B"](qo))));if(qt.imageName){var Rs=Lt[qt.imageName];if(!Rs)continue;kn=qt.imageName,Qe.iconsInText=Qe.iconsInText||!0,lo=Rs.paddedRect;var Vo=Rs.displaySize;qt.scale=24*qt.scale/Qr,uo=Oi+(24-Vo[1]*qt.scale),Ds=(zr={width:Vo[0],height:Vo[1],left:1,top:-3,advance:ja?Vo[1]:Vo[0]}).advance;var Ls=ja?Vo[0]*qt.scale-24*Ot:Vo[1]*qt.scale-24*Ot;Ls>0&&Ls>Ur&&(Ur=Ls)}else{var tc=vt[qt.fontStack],Fs=tc&&tc[hn];if(Fs&&Fs.rect)lo=Fs.rect,zr=Fs.metrics;else{var Ou=Tt[qt.fontStack],rc=Ou&&Ou[hn];if(!rc)continue;zr=rc.metrics}uo=24*(Ot-qt.scale)}ja?(Qe.verticalizable=!0,dr.push({glyph:hn,imageName:kn,x:ei,y:Ci+uo,vertical:ja,scale:qt.scale,fontStack:qt.fontStack,sectionIndex:so,metrics:zr,rect:lo}),ei+=Ds*qt.scale+xr):(dr.push({glyph:hn,imageName:kn,x:ei,y:Ci+uo,vertical:ja,scale:qt.scale,fontStack:qt.fontStack,sectionIndex:so,metrics:zr,rect:lo}),ei+=zr.advance*qt.scale+xr)}dr.length!==0&&(li=Math.max(ei-xr,li),r0(dr,0,dr.length-1,Br,Ur)),ei=0;var ic=Vt*Ot+Ur;_i.lineOffset=Math.max(Ur,Oi),Ci+=ic,ki=Math.max(ic,ki),++ci}else Ci+=Vt,++ci}var qo,Vu=Ci- -17,Os=ep(_r),la=Os.horizontalAlign,Vs=Os.verticalAlign;(function(nc,oc,qu,Uu,ac,Nu,ju,Gu,sc){var qs,uc=(oc-qu)*ac;qs=Nu!==ju?-Gu*Uu- -17:(-Uu*sc+.5)*ju;for(var Us=0,$u=nc;Us<$u.length;Us+=1)for(var Ga=0,Zu=$u[Us].positionedGlyphs;Ga<Zu.length;Ga+=1){var Ns=Zu[Ga];Ns.x+=uc,Ns.y+=qs}})(Qe.positionedLines,Br,la,Vs,li,ki,Vt,Vu,at.length),Qe.top+=-Vs*Vu,Qe.bottom=Qe.top+Vu,Qe.left+=-la*li,Qe.right=Qe.left+li})(pt,t,r,a,te,h,m,g,I,b,C,G),!(function(Qe){for(var Tt=0,vt=Qe;Tt<vt.length;Tt+=1)if(vt[Tt].positionedGlyphs.length!==0)return!1;return!0})(bt)&&pt}Pi.fromFeature=function(e,t){for(var r=new Pi,a=0;a<e.sections.length;a++){var l=e.sections[a];l.image?r.addImageSection(l):r.addTextSection(l,t)}return r},Pi.prototype.length=function(){return this.text.length},Pi.prototype.getSection=function(e){return this.sections[this.sectionIndex[e]]},Pi.prototype.getSectionIndex=function(e){return this.sectionIndex[e]},Pi.prototype.getCharCode=function(e){return this.text.charCodeAt(e)},Pi.prototype.verticalizePunctuation=function(){this.text=(function(e){for(var t="",r=0;r<e.length;r++){var a=e.charCodeAt(r+1)||null,l=e.charCodeAt(r-1)||null;t+=a&&gu(a)&&!zu[e[r+1]]||l&&gu(l)&&!zu[e[r-1]]||!zu[e[r]]?e[r]:zu[e[r]]}return t})(this.text)},Pi.prototype.trim=function(){for(var e=0,t=0;t<this.text.length&&Zl[this.text.charCodeAt(t)];t++)e++;for(var r=this.text.length,a=this.text.length-1;a>=0&&a>=e&&Zl[this.text.charCodeAt(a)];a--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)},Pi.prototype.substring=function(e,t){var r=new Pi;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r},Pi.prototype.toString=function(){return this.text},Pi.prototype.getMaxScale=function(){var e=this;return this.sectionIndex.reduce((function(t,r){return Math.max(t,e.sections[r].scale)}),0)},Pi.prototype.addTextSection=function(e,t){this.text+=e.text,this.sections.push(As.forText(e.scale,e.fontStack||t));for(var r=this.sections.length-1,a=0;a<e.text.length;++a)this.sectionIndex.push(r)},Pi.prototype.addImageSection=function(e){var t=e.image?e.image.name:"";if(t.length!==0){var r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(As.forImage(t)),this.sectionIndex.push(this.sections.length-1)):St("Reached maximum number of images 6401")}else St("Can't add FormattedSection with an empty image.")},Pi.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var Zl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},tn={};function Dm(e,t,r,a,l,c){if(t.imageName){var h=a[t.imageName];return h?h.displaySize[0]*t.scale*24/c+l:0}var m=r[t.fontStack],g=m&&m[e];return g?g.metrics.advance*t.scale+l:0}function Rm(e,t,r,a){var l=Math.pow(e-t,2);return a?e<t?l/2:2*l:l+Math.abs(r)*r}function t0(e,t,r){var a=0;return e===10&&(a-=1e4),r&&(a+=150),e!==40&&e!==65288||(a+=50),t!==41&&t!==65289||(a+=50),a}function Lm(e,t,r,a,l,c){for(var h=null,m=Rm(t,r,l,c),g=0,b=a;g<b.length;g+=1){var S=b[g],I=Rm(t-S.x,r,l,c)+S.badness;I<=m&&(h=S,m=I)}return{index:e,x:t,priorBreak:h,badness:m}}function Qc(e,t,r,a,l,c,h){if(c!=="point")return[];if(!e)return[];for(var m,g=[],b=(function(te,K,oe,le,ce,he){for(var xe=0,Pe=0;Pe<te.length();Pe++){var ze=te.getSection(Pe);xe+=Dm(te.getCharCode(Pe),ze,le,ce,K,he)}return xe/Math.max(1,Math.ceil(xe/oe))})(e,t,r,a,l,h),S=e.text.indexOf("​")>=0,I=0,C=0;C<e.length();C++){var z=e.getSection(C),j=e.getCharCode(C);if(Zl[j]||(I+=Dm(j,z,a,l,t,h)),C<e.length()-1){var G=!((m=j)<11904||!(Re["Bopomofo Extended"](m)||Re.Bopomofo(m)||Re["CJK Compatibility Forms"](m)||Re["CJK Compatibility Ideographs"](m)||Re["CJK Compatibility"](m)||Re["CJK Radicals Supplement"](m)||Re["CJK Strokes"](m)||Re["CJK Symbols and Punctuation"](m)||Re["CJK Unified Ideographs Extension A"](m)||Re["CJK Unified Ideographs"](m)||Re["Enclosed CJK Letters and Months"](m)||Re["Halfwidth and Fullwidth Forms"](m)||Re.Hiragana(m)||Re["Ideographic Description Characters"](m)||Re["Kangxi Radicals"](m)||Re["Katakana Phonetic Extensions"](m)||Re.Katakana(m)||Re["Vertical Forms"](m)||Re["Yi Radicals"](m)||Re["Yi Syllables"](m)));(tn[j]||G||z.imageName)&&g.push(Lm(C+1,I,b,g,t0(j,e.getCharCode(C+1),G&&S),!1))}}return(function te(K){return K?te(K.priorBreak).concat(K.index):[]})(Lm(e.length(),I,b,g,0,!0))}function ep(e){var t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function r0(e,t,r,a,l){if(a||l)for(var c=e[r],h=(e[r].x+c.metrics.advance*c.scale)*a,m=t;m<=r;m++)e[m].x-=h,e[m].y+=l}function Fm(e,t,r,a,l,c){var h,m=e.image;if(m.content){var g=m.content,b=m.pixelRatio||1;h=[g[0]/b,g[1]/b,m.displaySize[0]-g[2]/b,m.displaySize[1]-g[3]/b]}var S,I,C,z,j=t.left*c,G=t.right*c;r==="width"||r==="both"?(z=l[0]+j-a[3],I=l[0]+G+a[1]):I=(z=l[0]+(j+G-m.displaySize[0])/2)+m.displaySize[0];var te=t.top*c,K=t.bottom*c;return r==="height"||r==="both"?(S=l[1]+te-a[0],C=l[1]+K+a[2]):C=(S=l[1]+(te+K-m.displaySize[1])/2)+m.displaySize[1],{image:m,top:S,right:I,bottom:C,left:z,collisionPadding:h}}tn[10]=!0,tn[32]=!0,tn[38]=!0,tn[40]=!0,tn[41]=!0,tn[43]=!0,tn[45]=!0,tn[47]=!0,tn[173]=!0,tn[183]=!0,tn[8203]=!0,tn[8208]=!0,tn[8211]=!0,tn[8231]=!0;var Es=(function(e){function t(r,a,l,c){e.call(this,r,a),this.angle=l,c!==void 0&&(this.segment=c)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.clone=function(){return new t(this.x,this.y,this.angle,this.segment)},t})(X);function tp(e,t){var r=t.expression;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new kt(e+1))};if(r.kind==="source")return{kind:"source"};for(var a=r.zoomStops,l=r.interpolationType,c=0;c<a.length&&a[c]<=e;)c++;for(var h=c=Math.max(0,c-1);h<a.length&&a[h]<e+1;)h++;h=Math.min(a.length-1,h);var m=a[c],g=a[h];return r.kind==="composite"?{kind:"composite",minZoom:m,maxZoom:g,interpolationType:l}:{kind:"camera",minZoom:m,maxZoom:g,minSize:r.evaluate(new kt(m)),maxSize:r.evaluate(new kt(g)),interpolationType:l}}function Om(e,t,r){var a=t.uSize,l=r.lowerSize;return e.kind==="source"?l/128:e.kind==="composite"?Vr(l/128,r.upperSize/128,t.uSizeT):a}function Vm(e,t){var r=0,a=0;if(e.kind==="constant")a=e.layoutSize;else if(e.kind!=="source"){var l=e.interpolationType,c=l?Ze(mi.interpolationFactor(l,t,e.minZoom,e.maxZoom),0,1):0;e.kind==="camera"?a=Vr(e.minSize,e.maxSize,c):r=c}return{uSizeT:r,uSize:a}}Xe("Anchor",Es);var i0=Object.freeze({__proto__:null,getSizeData:tp,evaluateSizeForFeature:Om,evaluateSizeForZoom:Vm,SIZE_PACK_FACTOR:128});function qm(e,t,r,a,l){if(t.segment===void 0)return!0;for(var c=t,h=t.segment+1,m=0;m>-r/2;){if(--h<0)return!1;m-=e[h].dist(c),c=e[h]}m+=e[h].dist(e[h+1]),h++;for(var g=[],b=0;m<r/2;){var S=e[h],I=e[h+1];if(!I)return!1;var C=e[h-1].angleTo(S)-S.angleTo(I);for(C=Math.abs((C+3*Math.PI)%(2*Math.PI)-Math.PI),g.push({distance:m,angleDelta:C}),b+=C;m-g[0].distance>a;)b-=g.shift().angleDelta;if(b>l)return!1;h++,m+=S.dist(I)}return!0}function Um(e){for(var t=0,r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function Nm(e,t,r){return e?.6*t*r:0}function jm(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function n0(e,t,r,a,l,c){for(var h=Nm(r,l,c),m=jm(r,a)*c,g=0,b=Um(e)/2,S=0;S<e.length-1;S++){var I=e[S],C=e[S+1],z=I.dist(C);if(g+z>b){var j=(b-g)/z,G=Vr(I.x,C.x,j),te=Vr(I.y,C.y,j),K=new Es(G,te,C.angleTo(I),S);return K._round(),!h||qm(e,K,m,h,t)?K:void 0}g+=z}}function o0(e,t,r,a,l,c,h,m,g){var b=Nm(a,c,h),S=jm(a,l),I=S*h,C=e[0].x===0||e[0].x===g||e[0].y===0||e[0].y===g;return t-I<t/4&&(t=I+t/4),(function z(j,G,te,K,oe,le,ce,he,xe){for(var Pe=le/2,ze=Um(j),rt=0,Oe=G-te,ot=[],qe=0;qe<j.length-1;qe++){for(var bt=j[qe],pt=j[qe+1],Qe=bt.dist(pt),Tt=pt.angleTo(bt);Oe+te<rt+Qe;){var vt=((Oe+=te)-rt)/Qe,Lt=Vr(bt.x,pt.x,vt),at=Vr(bt.y,pt.y,vt);if(Lt>=0&&Lt<xe&&at>=0&&at<xe&&Oe-Pe>=0&&Oe+Pe<=ze){var Vt=new Es(Lt,at,Tt,qe);Vt._round(),K&&!qm(j,Vt,le,K,oe)||ot.push(Vt)}}rt+=Qe}return he||ot.length||ce||(ot=z(j,rt/2,te,K,oe,le,ce,!0,xe)),ot})(e,C?t/2*m%t:(S/2+2*c)*h*m%t,t,b,r,I,C,!1,g)}function Gm(e,t,r,a,l){for(var c=[],h=0;h<e.length;h++)for(var m=e[h],g=void 0,b=0;b<m.length-1;b++){var S=m[b],I=m[b+1];S.x<t&&I.x<t||(S.x<t?S=new X(t,S.y+(t-S.x)/(I.x-S.x)*(I.y-S.y))._round():I.x<t&&(I=new X(t,S.y+(t-S.x)/(I.x-S.x)*(I.y-S.y))._round()),S.y<r&&I.y<r||(S.y<r?S=new X(S.x+(r-S.y)/(I.y-S.y)*(I.x-S.x),r)._round():I.y<r&&(I=new X(S.x+(r-S.y)/(I.y-S.y)*(I.x-S.x),r)._round()),S.x>=a&&I.x>=a||(S.x>=a?S=new X(a,S.y+(a-S.x)/(I.x-S.x)*(I.y-S.y))._round():I.x>=a&&(I=new X(a,S.y+(a-S.x)/(I.x-S.x)*(I.y-S.y))._round()),S.y>=l&&I.y>=l||(S.y>=l?S=new X(S.x+(l-S.y)/(I.y-S.y)*(I.x-S.x),l)._round():I.y>=l&&(I=new X(S.x+(l-S.y)/(I.y-S.y)*(I.x-S.x),l)._round()),g&&S.equals(g[g.length-1])||c.push(g=[S]),g.push(I)))))}return c}function $m(e,t,r,a){var l=[],c=e.image,h=c.pixelRatio,m=c.paddedRect.w-2,g=c.paddedRect.h-2,b=e.right-e.left,S=e.bottom-e.top,I=c.stretchX||[[0,m]],C=c.stretchY||[[0,g]],z=function(Lt,at){return Lt+at[1]-at[0]},j=I.reduce(z,0),G=C.reduce(z,0),te=m-j,K=g-G,oe=0,le=j,ce=0,he=G,xe=0,Pe=te,ze=0,rt=K;if(c.content&&a){var Oe=c.content;oe=Wl(I,0,Oe[0]),ce=Wl(C,0,Oe[1]),le=Wl(I,Oe[0],Oe[2]),he=Wl(C,Oe[1],Oe[3]),xe=Oe[0]-oe,ze=Oe[1]-ce,Pe=Oe[2]-Oe[0]-le,rt=Oe[3]-Oe[1]-he}var ot=function(Lt,at,Vt,_r){var Tr=Hl(Lt.stretch-oe,le,b,e.left),Sr=Xl(Lt.fixed-xe,Pe,Lt.stretch,j),xr=Hl(at.stretch-ce,he,S,e.top),Ar=Xl(at.fixed-ze,rt,at.stretch,G),Qr=Hl(Vt.stretch-oe,le,b,e.left),ei=Xl(Vt.fixed-xe,Pe,Vt.stretch,j),Ci=Hl(_r.stretch-ce,he,S,e.top),li=Xl(_r.fixed-ze,rt,_r.stretch,G),ki=new X(Tr,xr),Br=new X(Qr,xr),ci=new X(Qr,Ci),Bt=new X(Tr,Ci),nr=new X(Sr/h,Ar/h),Jt=new X(ei/h,li/h),Ot=t*Math.PI/180;if(Ot){var Oi=Math.sin(Ot),_i=Math.cos(Ot),dr=[_i,-Oi,Oi,_i];ki._matMult(dr),Br._matMult(dr),Bt._matMult(dr),ci._matMult(dr)}var Ur=Lt.stretch+Lt.fixed,xi=at.stretch+at.fixed;return{tl:ki,tr:Br,bl:Bt,br:ci,tex:{x:c.paddedRect.x+1+Ur,y:c.paddedRect.y+1+xi,w:Vt.stretch+Vt.fixed-Ur,h:_r.stretch+_r.fixed-xi},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:nr,pixelOffsetBR:Jt,minFontScaleX:Pe/h/b,minFontScaleY:rt/h/S,isSDF:r}};if(a&&(c.stretchX||c.stretchY))for(var qe=Zm(I,te,j),bt=Zm(C,K,G),pt=0;pt<qe.length-1;pt++)for(var Qe=qe[pt],Tt=qe[pt+1],vt=0;vt<bt.length-1;vt++)l.push(ot(Qe,bt[vt],Tt,bt[vt+1]));else l.push(ot({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:m+1},{fixed:0,stretch:g+1}));return l}function Wl(e,t,r){for(var a=0,l=0,c=e;l<c.length;l+=1){var h=c[l];a+=Math.max(t,Math.min(r,h[1]))-Math.max(t,Math.min(r,h[0]))}return a}function Zm(e,t,r){for(var a=[{fixed:-1,stretch:0}],l=0,c=e;l<c.length;l+=1){var h=c[l],m=h[0],g=h[1],b=a[a.length-1];a.push({fixed:m-b.stretch,stretch:b.stretch}),a.push({fixed:m-b.stretch,stretch:b.stretch+(g-m)})}return a.push({fixed:t+1,stretch:r}),a}function Hl(e,t,r,a){return e/t*r+a}function Xl(e,t,r,a){return e-t*r/a}var Kl=function(e,t,r,a,l,c,h,m,g,b){if(this.boxStartIndex=e.length,g){var S=c.top,I=c.bottom,C=c.collisionPadding;C&&(S-=C[1],I+=C[3]);var z=I-S;z>0&&(z=Math.max(10,z),this.circleDiameter=z)}else{var j=c.top*h-m,G=c.bottom*h+m,te=c.left*h-m,K=c.right*h+m,oe=c.collisionPadding;if(oe&&(te-=oe[0]*h,j-=oe[1]*h,K+=oe[2]*h,G+=oe[3]*h),b){var le=new X(te,j),ce=new X(K,j),he=new X(te,G),xe=new X(K,G),Pe=b*Math.PI/180;le._rotate(Pe),ce._rotate(Pe),he._rotate(Pe),xe._rotate(Pe),te=Math.min(le.x,ce.x,he.x,xe.x),K=Math.max(le.x,ce.x,he.x,xe.x),j=Math.min(le.y,ce.y,he.y,xe.y),G=Math.max(le.y,ce.y,he.y,xe.y)}e.emplaceBack(t.x,t.y,te,j,K,G,r,a,l)}this.boxEndIndex=e.length},Ps=function(e,t){if(e===void 0&&(e=[]),t===void 0&&(t=a0),this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function a0(e,t){return e<t?-1:e>t?1:0}function s0(e,t,r){r===void 0&&(r=!1);for(var a=1/0,l=1/0,c=-1/0,h=-1/0,m=e[0],g=0;g<m.length;g++){var b=m[g];(!g||b.x<a)&&(a=b.x),(!g||b.y<l)&&(l=b.y),(!g||b.x>c)&&(c=b.x),(!g||b.y>h)&&(h=b.y)}var S=Math.min(c-a,h-l),I=S/2,C=new Ps([],u0);if(S===0)return new X(a,l);for(var z=a;z<c;z+=S)for(var j=l;j<h;j+=S)C.push(new Cs(z+I,j+I,I,e));for(var G=(function(oe){for(var le=0,ce=0,he=0,xe=oe[0],Pe=0,ze=xe.length,rt=ze-1;Pe<ze;rt=Pe++){var Oe=xe[Pe],ot=xe[rt],qe=Oe.x*ot.y-ot.x*Oe.y;ce+=(Oe.x+ot.x)*qe,he+=(Oe.y+ot.y)*qe,le+=3*qe}return new Cs(ce/le,he/le,0,oe)})(e),te=C.length;C.length;){var K=C.pop();(K.d>G.d||!G.d)&&(G=K,r&&console.log("found best %d after %d probes",Math.round(1e4*K.d)/1e4,te)),K.max-G.d<=t||(C.push(new Cs(K.p.x-(I=K.h/2),K.p.y-I,I,e)),C.push(new Cs(K.p.x+I,K.p.y-I,I,e)),C.push(new Cs(K.p.x-I,K.p.y+I,I,e)),C.push(new Cs(K.p.x+I,K.p.y+I,I,e)),te+=4)}return r&&(console.log("num probes: "+te),console.log("best distance: "+G.d)),G.p}function u0(e,t){return t.max-e.max}function Cs(e,t,r,a){this.p=new X(e,t),this.h=r,this.d=(function(l,c){for(var h=!1,m=1/0,g=0;g<c.length;g++)for(var b=c[g],S=0,I=b.length,C=I-1;S<I;C=S++){var z=b[S],j=b[C];z.y>l.y!=j.y>l.y&&l.x<(j.x-z.x)*(l.y-z.y)/(j.y-z.y)+z.x&&(h=!h),m=Math.min(m,oa(l,z,j))}return(h?1:-1)*Math.sqrt(m)})(this.p,a),this.max=this.d+this.h*Math.SQRT2}Ps.prototype.push=function(e){this.data.push(e),this.length++,this._up(this.length-1)},Ps.prototype.pop=function(){if(this.length!==0){var e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}},Ps.prototype.peek=function(){return this.data[0]},Ps.prototype._up=function(e){for(var t=this.data,r=this.compare,a=t[e];e>0;){var l=e-1>>1,c=t[l];if(r(a,c)>=0)break;t[e]=c,e=l}t[e]=a},Ps.prototype._down=function(e){for(var t=this.data,r=this.compare,a=this.length>>1,l=t[e];e<a;){var c=1+(e<<1),h=t[c],m=c+1;if(m<this.length&&r(t[m],h)<0&&(c=m,h=t[m]),r(h,l)>=0)break;t[e]=h,e=c}t[e]=l};var rp=Number.POSITIVE_INFINITY;function Wm(e,t){return t[1]!==rp?(function(r,a,l){var c=0,h=0;switch(a=Math.abs(a),l=Math.abs(l),r){case"top-right":case"top-left":case"top":h=l-7;break;case"bottom-right":case"bottom-left":case"bottom":h=7-l}switch(r){case"top-right":case"bottom-right":case"right":c=-a;break;case"top-left":case"bottom-left":case"left":c=a}return[c,h]})(e,t[0],t[1]):(function(r,a){var l=0,c=0;a<0&&(a=0);var h=a/Math.sqrt(2);switch(r){case"top-right":case"top-left":c=h-7;break;case"bottom-right":case"bottom-left":c=7-h;break;case"bottom":c=7-a;break;case"top":c=a-7}switch(r){case"top-right":case"bottom-right":l=-h;break;case"top-left":case"bottom-left":l=h;break;case"left":l=a;break;case"right":l=-a}return[l,c]})(e,t[0])}function ip(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Hm(e,t,r,a,l,c,h,m,g,b,S,I,C,z,j){var G=(function(ce,he,xe,Pe,ze,rt,Oe,ot){for(var qe=Pe.layout.get("text-rotate").evaluate(rt,{})*Math.PI/180,bt=[],pt=0,Qe=he.positionedLines;pt<Qe.length;pt+=1)for(var Tt=Qe[pt],vt=0,Lt=Tt.positionedGlyphs;vt<Lt.length;vt+=1){var at=Lt[vt];if(at.rect){var Vt=at.rect||{},_r=4,Tr=!0,Sr=1,xr=0,Ar=(ze||ot)&&at.vertical,Qr=at.metrics.advance*at.scale/2;if(ot&&he.verticalizable&&(xr=Tt.lineOffset/2-(at.imageName?-(24-at.metrics.width*at.scale)/2:24*(at.scale-1))),at.imageName){var ei=Oe[at.imageName];Tr=ei.sdf,_r=1/(Sr=ei.pixelRatio)}var Ci=ze?[at.x+Qr,at.y]:[0,0],li=ze?[0,0]:[at.x+Qr+xe[0],at.y+xe[1]-xr],ki=[0,0];Ar&&(ki=li,li=[0,0]);var Br=(at.metrics.left-_r)*at.scale-Qr+li[0],ci=(-at.metrics.top-_r)*at.scale+li[1],Bt=Br+Vt.w*at.scale/Sr,nr=ci+Vt.h*at.scale/Sr,Jt=new X(Br,ci),Ot=new X(Bt,ci),Oi=new X(Br,nr),_i=new X(Bt,nr);if(Ar){var dr=new X(-Qr,Qr- -17),Ur=-Math.PI/2,xi=12-Qr,qt=new X(22-xi,-(at.imageName?xi:0)),so=new(Function.prototype.bind.apply(X,[null].concat(ki)));Jt._rotateAround(Ur,dr)._add(qt)._add(so),Ot._rotateAround(Ur,dr)._add(qt)._add(so),Oi._rotateAround(Ur,dr)._add(qt)._add(so),_i._rotateAround(Ur,dr)._add(qt)._add(so)}if(qe){var hn=Math.sin(qe),uo=Math.cos(qe),zr=[uo,-hn,hn,uo];Jt._matMult(zr),Ot._matMult(zr),Oi._matMult(zr),_i._matMult(zr)}var lo=new X(0,0),kn=new X(0,0);bt.push({tl:Jt,tr:Ot,bl:Oi,br:_i,tex:Vt,writingMode:he.writingMode,glyphOffset:Ci,sectionIndex:at.sectionIndex,isSDF:Tr,pixelOffsetTL:lo,pixelOffsetBR:kn,minFontScaleX:0,minFontScaleY:0})}}return bt})(0,r,m,l,c,h,a,e.allowVerticalPlacement),te=e.textSizeData,K=null;te.kind==="source"?(K=[128*l.layout.get("text-size").evaluate(h,{})])[0]>32640&&St(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):te.kind==="composite"&&((K=[128*z.compositeTextSizes[0].evaluate(h,{},j),128*z.compositeTextSizes[1].evaluate(h,{},j)])[0]>32640||K[1]>32640)&&St(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),e.addSymbols(e.text,G,K,m,c,h,b,t,g.lineStartIndex,g.lineLength,C,j);for(var oe=0,le=S;oe<le.length;oe+=1)I[le[oe]]=e.text.placedSymbolArray.length-1;return 4*G.length}function Xm(e){for(var t in e)return e[t];return null}function l0(e,t,r,a){var l=e.compareText;if(t in l){for(var c=l[t],h=c.length-1;h>=0;h--)if(a.dist(c[h])<r)return!0}else l[t]=[];return l[t].push(a),!1}var c0=Ss.VectorTileFeature.types,p0=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Jl(e,t,r,a,l,c,h,m,g,b,S,I,C){var z=m?Math.min(32640,Math.round(m[0])):0,j=m?Math.min(32640,Math.round(m[1])):0;e.emplaceBack(t,r,Math.round(32*a),Math.round(32*l),c,h,(z<<1)+(g?1:0),j,16*b,16*S,256*I,256*C)}function np(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}function h0(e){for(var t=0,r=e.sections;t<r.length;t+=1)if(hs(r[t].text))return!0;return!1}var ks=function(e){this.layoutVertexArray=new ys,this.indexArray=new to,this.programConfigurations=e,this.segments=new F,this.dynamicLayoutVertexArray=new ra,this.opacityVertexArray=new za,this.placedSymbolArray=new s};ks.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},ks.prototype.upload=function(e,t,r,a){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ob.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Vb.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,p0,!0),this.opacityVertexBuffer.itemSize=1),(r||a)&&this.programConfigurations.upload(e))},ks.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Xe("SymbolBuffers",ks);var Lu=function(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new F,this.collisionVertexArray=new Iu};Lu.prototype.upload=function(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,qb.members,!0)},Lu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Xe("CollisionBuffers",Lu);var er=function(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(c){return c.id})),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=en([]),this.placementViewportMatrix=en([]);var t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=tp(this.zoom,t["text-size"]),this.iconSizeData=tp(this.zoom,t["icon-size"]);var r=this.layers[0].layout,a=r.get("symbol-sort-key"),l=r.get("symbol-z-order");this.canOverlap=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey=l!=="viewport-y"&&a.constantOr(1)!==void 0,this.sortFeaturesByY=(l==="viewport-y"||l==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,r.get("symbol-placement")==="point"&&(this.writingModes=r.get("text-writing-mode").map((function(c){return pn[c]}))),this.stateDependentLayerIds=this.layers.filter((function(c){return c.isStateDependent()})).map((function(c){return c.id})),this.sourceID=e.sourceID};er.prototype.createArrays=function(){this.text=new ks(new ct(this.layers,this.zoom,(function(e){return/^text/.test(e)}))),this.icon=new ks(new ct(this.layers,this.zoom,(function(e){return/^icon/.test(e)}))),this.glyphOffsetArray=new d,this.lineVertexArray=new v,this.symbolInstances=new f},er.prototype.calculateGlyphDependencies=function(e,t,r,a,l){for(var c=0;c<e.length;c++)if(t[e.charCodeAt(c)]=!0,(r||a)&&l){var h=zu[e.charAt(c)];h&&(t[h.charCodeAt(0)]=!0)}},er.prototype.populate=function(e,t,r){var a=this.layers[0],l=a.layout,c=l.get("text-font"),h=l.get("text-field"),m=l.get("icon-image"),g=(h.value.kind!=="constant"||h.value.value instanceof ni&&!h.value.value.isEmpty()||h.value.value.toString().length>0)&&(c.value.kind!=="constant"||c.value.value.length>0),b=m.value.kind!=="constant"||!!m.value.value||Object.keys(m.parameters).length>0,S=l.get("symbol-sort-key");if(this.features=[],g||b){for(var I=t.iconDependencies,C=t.glyphDependencies,z=t.availableImages,j=new kt(this.zoom),G=0,te=e;G<te.length;G+=1){var K=te[G],oe=K.feature,le=K.id,ce=K.index,he=K.sourceLayerIndex,xe=a._featureFilter.needGeometry,Pe=Mr(oe,xe);if(a._featureFilter.filter(j,Pe,r)){xe||(Pe.geometry=wr(oe));var ze=void 0;if(g){var rt=a.getValueAndResolveTokens("text-field",Pe,r,z),Oe=ni.factory(rt);h0(Oe)&&(this.hasRTLText=!0),(!this.hasRTLText||xu()==="unavailable"||this.hasRTLText&&Qi.isParsed())&&(ze=Nb(Oe,a,Pe))}var ot=void 0;if(b){var qe=a.getValueAndResolveTokens("icon-image",Pe,r,z);ot=qe instanceof Di?qe:Di.fromString(qe)}if(ze||ot){var bt=this.sortFeaturesByKey?S.evaluate(Pe,{},r):void 0;if(this.features.push({id:le,text:ze,icon:ot,index:ce,sourceLayerIndex:he,geometry:Pe.geometry,properties:oe.properties,type:c0[oe.type],sortKey:bt}),ot&&(I[ot.name]=!0),ze){var pt=c.evaluate(Pe,{},r).join(","),Qe=l.get("text-rotation-alignment")==="map"&&l.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(pn.vertical)>=0;for(var Tt=0,vt=ze.sections;Tt<vt.length;Tt+=1){var Lt=vt[Tt];if(Lt.image)I[Lt.image.name]=!0;else{var at=vu(ze.toString()),Vt=Lt.fontStack||pt,_r=C[Vt]=C[Vt]||{};this.calculateGlyphDependencies(Lt.text,_r,Qe,this.allowVerticalPlacement,at)}}}}}}l.get("symbol-placement")==="line"&&(this.features=(function(Tr){var Sr={},xr={},Ar=[],Qr=0;function ei(dr){Ar.push(Tr[dr]),Qr++}function Ci(dr,Ur,xi){var qt=xr[dr];return delete xr[dr],xr[Ur]=qt,Ar[qt].geometry[0].pop(),Ar[qt].geometry[0]=Ar[qt].geometry[0].concat(xi[0]),qt}function li(dr,Ur,xi){var qt=Sr[Ur];return delete Sr[Ur],Sr[dr]=qt,Ar[qt].geometry[0].shift(),Ar[qt].geometry[0]=xi[0].concat(Ar[qt].geometry[0]),qt}function ki(dr,Ur,xi){var qt=xi?Ur[0][Ur[0].length-1]:Ur[0][0];return dr+":"+qt.x+":"+qt.y}for(var Br=0;Br<Tr.length;Br++){var ci=Tr[Br],Bt=ci.geometry,nr=ci.text?ci.text.toString():null;if(nr){var Jt=ki(nr,Bt),Ot=ki(nr,Bt,!0);if(Jt in xr&&Ot in Sr&&xr[Jt]!==Sr[Ot]){var Oi=li(Jt,Ot,Bt),_i=Ci(Jt,Ot,Ar[Oi].geometry);delete Sr[Jt],delete xr[Ot],xr[ki(nr,Ar[_i].geometry,!0)]=_i,Ar[Oi].geometry=null}else Jt in xr?Ci(Jt,Ot,Bt):Ot in Sr?li(Jt,Ot,Bt):(ei(Br),Sr[Jt]=Qr-1,xr[Ot]=Qr-1)}else ei(Br)}return Ar.filter((function(dr){return dr.geometry}))})(this.features)),this.sortFeaturesByKey&&this.features.sort((function(Tr,Sr){return Tr.sortKey-Sr.sortKey}))}},er.prototype.update=function(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,r),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,r))},er.prototype.isEmpty=function(){return this.symbolInstances.length===0&&!this.hasRTLText},er.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},er.prototype.upload=function(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},er.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},er.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},er.prototype.addToLineVertexArray=function(e,t){var r=this.lineVertexArray.length;if(e.segment!==void 0){for(var a=e.dist(t[e.segment+1]),l=e.dist(t[e.segment]),c={},h=e.segment+1;h<t.length;h++)c[h]={x:t[h].x,y:t[h].y,tileUnitDistanceFromAnchor:a},h<t.length-1&&(a+=t[h+1].dist(t[h]));for(var m=e.segment||0;m>=0;m--)c[m]={x:t[m].x,y:t[m].y,tileUnitDistanceFromAnchor:l},m>0&&(l+=t[m-1].dist(t[m]));for(var g=0;g<t.length;g++){var b=c[g];this.lineVertexArray.emplaceBack(b.x,b.y,b.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},er.prototype.addSymbols=function(e,t,r,a,l,c,h,m,g,b,S,I){for(var C=e.indexArray,z=e.layoutVertexArray,j=e.segments.prepareSegment(4*t.length,z,C,this.canOverlap?c.sortKey:void 0),G=this.glyphOffsetArray.length,te=j.vertexLength,K=this.allowVerticalPlacement&&h===pn.vertical?Math.PI/2:0,oe=c.text&&c.text.sections,le=0;le<t.length;le++){var ce=t[le],he=ce.tl,xe=ce.tr,Pe=ce.bl,ze=ce.br,rt=ce.tex,Oe=ce.pixelOffsetTL,ot=ce.pixelOffsetBR,qe=ce.minFontScaleX,bt=ce.minFontScaleY,pt=ce.glyphOffset,Qe=ce.isSDF,Tt=ce.sectionIndex,vt=j.vertexLength,Lt=pt[1];Jl(z,m.x,m.y,he.x,Lt+he.y,rt.x,rt.y,r,Qe,Oe.x,Oe.y,qe,bt),Jl(z,m.x,m.y,xe.x,Lt+xe.y,rt.x+rt.w,rt.y,r,Qe,ot.x,Oe.y,qe,bt),Jl(z,m.x,m.y,Pe.x,Lt+Pe.y,rt.x,rt.y+rt.h,r,Qe,Oe.x,ot.y,qe,bt),Jl(z,m.x,m.y,ze.x,Lt+ze.y,rt.x+rt.w,rt.y+rt.h,r,Qe,ot.x,ot.y,qe,bt),np(e.dynamicLayoutVertexArray,m,K),C.emplaceBack(vt,vt+1,vt+2),C.emplaceBack(vt+1,vt+2,vt+3),j.vertexLength+=4,j.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(pt[0]),le!==t.length-1&&Tt===t[le+1].sectionIndex||e.programConfigurations.populatePaintArrays(z.length,c,c.index,{},I,oe&&oe[Tt])}e.placedSymbolArray.emplaceBack(m.x,m.y,G,this.glyphOffsetArray.length-G,te,g,b,m.segment,r?r[0]:0,r?r[1]:0,a[0],a[1],h,0,!1,0,S)},er.prototype._addCollisionDebugVertex=function(e,t,r,a,l,c){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,a,l,Math.round(c.x),Math.round(c.y))},er.prototype.addCollisionDebugVertices=function(e,t,r,a,l,c,h){var m=l.segments.prepareSegment(4,l.layoutVertexArray,l.indexArray),g=m.vertexLength,b=l.layoutVertexArray,S=l.collisionVertexArray,I=h.anchorX,C=h.anchorY;this._addCollisionDebugVertex(b,S,c,I,C,new X(e,t)),this._addCollisionDebugVertex(b,S,c,I,C,new X(r,t)),this._addCollisionDebugVertex(b,S,c,I,C,new X(r,a)),this._addCollisionDebugVertex(b,S,c,I,C,new X(e,a)),m.vertexLength+=4;var z=l.indexArray;z.emplaceBack(g,g+1),z.emplaceBack(g+1,g+2),z.emplaceBack(g+2,g+3),z.emplaceBack(g+3,g),m.primitiveLength+=4},er.prototype.addDebugCollisionBoxes=function(e,t,r,a){for(var l=e;l<t;l++){var c=this.collisionBoxArray.get(l);this.addCollisionDebugVertices(c.x1,c.y1,c.x2,c.y2,a?this.textCollisionBox:this.iconCollisionBox,c.anchorPoint,r)}},er.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Lu(ia,Em.members,Da),this.iconCollisionBox=new Lu(ia,Em.members,Da);for(var e=0;e<this.symbolInstances.length;e++){var t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}},er.prototype._deserializeCollisionBoxesForSymbol=function(e,t,r,a,l,c,h,m,g){for(var b={},S=t;S<r;S++){var I=e.get(S);b.textBox={x1:I.x1,y1:I.y1,x2:I.x2,y2:I.y2,anchorPointX:I.anchorPointX,anchorPointY:I.anchorPointY},b.textFeatureIndex=I.featureIndex;break}for(var C=a;C<l;C++){var z=e.get(C);b.verticalTextBox={x1:z.x1,y1:z.y1,x2:z.x2,y2:z.y2,anchorPointX:z.anchorPointX,anchorPointY:z.anchorPointY},b.verticalTextFeatureIndex=z.featureIndex;break}for(var j=c;j<h;j++){var G=e.get(j);b.iconBox={x1:G.x1,y1:G.y1,x2:G.x2,y2:G.y2,anchorPointX:G.anchorPointX,anchorPointY:G.anchorPointY},b.iconFeatureIndex=G.featureIndex;break}for(var te=m;te<g;te++){var K=e.get(te);b.verticalIconBox={x1:K.x1,y1:K.y1,x2:K.x2,y2:K.y2,anchorPointX:K.anchorPointX,anchorPointY:K.anchorPointY},b.verticalIconFeatureIndex=K.featureIndex;break}return b},er.prototype.deserializeCollisionBoxes=function(e){this.collisionArrays=[];for(var t=0;t<this.symbolInstances.length;t++){var r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}},er.prototype.hasTextData=function(){return this.text.segments.get().length>0},er.prototype.hasIconData=function(){return this.icon.segments.get().length>0},er.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},er.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},er.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},er.prototype.addIndicesForPlacedSymbol=function(e,t){for(var r=e.placedSymbolArray.get(t),a=r.vertexStartIndex+4*r.numGlyphs,l=r.vertexStartIndex;l<a;l+=4)e.indexArray.emplaceBack(l,l+1,l+2),e.indexArray.emplaceBack(l+1,l+2,l+3)},er.prototype.getSortedSymbolIndexes=function(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var t=Math.sin(e),r=Math.cos(e),a=[],l=[],c=[],h=0;h<this.symbolInstances.length;++h){c.push(h);var m=this.symbolInstances.get(h);a.push(0|Math.round(t*m.anchorX+r*m.anchorY)),l.push(m.featureIndex)}return c.sort((function(g,b){return a[g]-a[b]||l[b]-l[g]})),c},er.prototype.addToSortKeyRanges=function(e,t){var r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})},er.prototype.sortFeatures=function(e){var t=this;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(var r=0,a=this.symbolInstanceIndexes;r<a.length;r+=1){var l=this.symbolInstances.get(a[r]);this.featureSortOrder.push(l.featureIndex),[l.rightJustifiedTextSymbolIndex,l.centerJustifiedTextSymbolIndex,l.leftJustifiedTextSymbolIndex].forEach((function(c,h,m){c>=0&&m.indexOf(c)===h&&t.addIndicesForPlacedSymbol(t.text,c)})),l.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,l.verticalPlacedTextSymbolIndex),l.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,l.placedIconSymbolIndex),l.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,l.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Xe("SymbolBucket",er,{omit:["layers","collisionBoxArray","features","compareText"]}),er.MAX_GLYPHS=65535,er.addDynamicAttributes=np;var f0=new vi({"symbol-placement":new it(L.layout_symbol["symbol-placement"]),"symbol-spacing":new it(L.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new it(L.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ye(L.layout_symbol["symbol-sort-key"]),"symbol-z-order":new it(L.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new it(L.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new it(L.layout_symbol["icon-ignore-placement"]),"icon-optional":new it(L.layout_symbol["icon-optional"]),"icon-rotation-alignment":new it(L.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ye(L.layout_symbol["icon-size"]),"icon-text-fit":new it(L.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new it(L.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ye(L.layout_symbol["icon-image"]),"icon-rotate":new Ye(L.layout_symbol["icon-rotate"]),"icon-padding":new it(L.layout_symbol["icon-padding"]),"icon-keep-upright":new it(L.layout_symbol["icon-keep-upright"]),"icon-offset":new Ye(L.layout_symbol["icon-offset"]),"icon-anchor":new Ye(L.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new it(L.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new it(L.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new it(L.layout_symbol["text-rotation-alignment"]),"text-field":new Ye(L.layout_symbol["text-field"]),"text-font":new Ye(L.layout_symbol["text-font"]),"text-size":new Ye(L.layout_symbol["text-size"]),"text-max-width":new Ye(L.layout_symbol["text-max-width"]),"text-line-height":new it(L.layout_symbol["text-line-height"]),"text-letter-spacing":new Ye(L.layout_symbol["text-letter-spacing"]),"text-justify":new Ye(L.layout_symbol["text-justify"]),"text-radial-offset":new Ye(L.layout_symbol["text-radial-offset"]),"text-variable-anchor":new it(L.layout_symbol["text-variable-anchor"]),"text-anchor":new Ye(L.layout_symbol["text-anchor"]),"text-max-angle":new it(L.layout_symbol["text-max-angle"]),"text-writing-mode":new it(L.layout_symbol["text-writing-mode"]),"text-rotate":new Ye(L.layout_symbol["text-rotate"]),"text-padding":new it(L.layout_symbol["text-padding"]),"text-keep-upright":new it(L.layout_symbol["text-keep-upright"]),"text-transform":new Ye(L.layout_symbol["text-transform"]),"text-offset":new Ye(L.layout_symbol["text-offset"]),"text-allow-overlap":new it(L.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new it(L.layout_symbol["text-ignore-placement"]),"text-optional":new it(L.layout_symbol["text-optional"])}),op={paint:new vi({"icon-opacity":new Ye(L.paint_symbol["icon-opacity"]),"icon-color":new Ye(L.paint_symbol["icon-color"]),"icon-halo-color":new Ye(L.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ye(L.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ye(L.paint_symbol["icon-halo-blur"]),"icon-translate":new it(L.paint_symbol["icon-translate"]),"icon-translate-anchor":new it(L.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ye(L.paint_symbol["text-opacity"]),"text-color":new Ye(L.paint_symbol["text-color"],{runtimeType:Me,getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new Ye(L.paint_symbol["text-halo-color"]),"text-halo-width":new Ye(L.paint_symbol["text-halo-width"]),"text-halo-blur":new Ye(L.paint_symbol["text-halo-blur"]),"text-translate":new it(L.paint_symbol["text-translate"]),"text-translate-anchor":new it(L.paint_symbol["text-translate-anchor"])}),layout:f0},Ms=function(e){this.type=e.property.overrides?e.property.overrides.runtimeType:Ge,this.defaultValue=e};Ms.prototype.evaluate=function(e){if(e.formattedSection){var t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default},Ms.prototype.eachChild=function(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)},Ms.prototype.outputDefined=function(){return!1},Ms.prototype.serialize=function(){return null},Xe("FormatSectionOverride",Ms,{omit:["defaultValue"]});var d0=(function(e){function t(r){e.call(this,r,op)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.recalculate=function(r,a){if(e.prototype.recalculate.call(this,r,a),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")),this.layout.get("symbol-placement")==="point"){var l=this.layout.get("text-writing-mode");if(l){for(var c=[],h=0,m=l;h<m.length;h+=1){var g=m[h];c.indexOf(g)<0&&c.push(g)}this.layout._values["text-writing-mode"]=c}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},t.prototype.getValueAndResolveTokens=function(r,a,l,c){var h=this.layout.get(r).evaluate(a,{},l,c),m=this._unevaluatedLayout._values[r];return m.isDataDriven()||wa(m.value)||!h?h:(function(g,b){return b.replace(/{([^{}]+)}/g,(function(S,I){return I in g?String(g[I]):""}))})(a.properties,h)},t.prototype.createBucket=function(r){return new er(r)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype._setPaintOverrides=function(){for(var r=0,a=op.paint.overridableProperties;r<a.length;r+=1){var l=a[r];if(t.hasPaintOverride(this.layout,l)){var c,h=this.paint.get(l),m=new Ms(h),g=new Ko(m,h.property.specification);c=h.value.kind==="constant"||h.value.kind==="source"?new Sa("source",g):new Jo("composite",g,h.value.zoomStops,h.value._interpolationType),this.paint._values[l]=new Ti(h.property,c,h.parameters)}}},t.prototype._handleOverridablePaintPropertyUpdate=function(r,a,l){return!(!this.layout||a.isDataDriven()||l.isDataDriven())&&t.hasPaintOverride(this.layout,r)},t.hasPaintOverride=function(r,a){var l=r.get("text-field"),c=op.paint.properties[a],h=!1,m=function(S){for(var I=0,C=S;I<C.length;I+=1)if(c.overrides&&c.overrides.hasOverride(C[I]))return void(h=!0)};if(l.value.kind==="constant"&&l.value.value instanceof ni)m(l.value.value.sections);else if(l.value.kind==="source"){var g=function(S){h||(S instanceof Si&&kr(S.value)===rr?m(S.value.sections):S instanceof yn?m(S.sections):S.eachChild(g))},b=l.value;b._styleExpression&&g(b._styleExpression.expression)}return h},t})(An),m0={paint:new vi({"background-color":new it(L.paint_background["background-color"]),"background-pattern":new Ai(L.paint_background["background-pattern"]),"background-opacity":new it(L.paint_background["background-opacity"])})},y0=(function(e){function t(r){e.call(this,r,m0)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(An),v0={paint:new vi({"raster-opacity":new it(L.paint_raster["raster-opacity"]),"raster-hue-rotate":new it(L.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new it(L.paint_raster["raster-brightness-min"]),"raster-brightness-max":new it(L.paint_raster["raster-brightness-max"]),"raster-saturation":new it(L.paint_raster["raster-saturation"]),"raster-contrast":new it(L.paint_raster["raster-contrast"]),"raster-resampling":new it(L.paint_raster["raster-resampling"]),"raster-fade-duration":new it(L.paint_raster["raster-fade-duration"])})},g0=(function(e){function t(r){e.call(this,r,v0)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(An),_0=(function(e){function t(r){e.call(this,r,{}),this.implementation=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.is3D=function(){return this.implementation.renderingMode==="3d"},t.prototype.hasOffscreenPass=function(){return this.implementation.prerender!==void 0},t.prototype.recalculate=function(){},t.prototype.updateTransitions=function(){},t.prototype.hasTransition=function(){},t.prototype.serialize=function(){},t.prototype.onAdd=function(r){this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},t.prototype.onRemove=function(r){this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},t})(An),x0={circle:jc,heatmap:ib,hillshade:ob,fill:wb,"fill-extrusion":Mb,line:Fb,symbol:d0,background:y0,raster:g0},Km=J.HTMLImageElement,Jm=J.HTMLCanvasElement,Ym=J.HTMLVideoElement,Qm=J.ImageData,Yl=J.ImageBitmap,qa=function(e,t,r,a){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this.update(t,a)};qa.prototype.update=function(e,t,r){var a=e.width,l=e.height,c=!(this.size&&this.size[0]===a&&this.size[1]===l||r),h=this.context,m=h.gl;if(this.useMipmap=!!(t&&t.useMipmap),m.bindTexture(m.TEXTURE_2D,this.texture),h.pixelStoreUnpackFlipY.set(!1),h.pixelStoreUnpack.set(1),h.pixelStoreUnpackPremultiplyAlpha.set(this.format===m.RGBA&&(!t||t.premultiply!==!1)),c)this.size=[a,l],e instanceof Km||e instanceof Jm||e instanceof Ym||e instanceof Qm||Yl&&e instanceof Yl?m.texImage2D(m.TEXTURE_2D,0,this.format,this.format,m.UNSIGNED_BYTE,e):m.texImage2D(m.TEXTURE_2D,0,this.format,a,l,0,this.format,m.UNSIGNED_BYTE,e.data);else{var g=r||{x:0,y:0},b=g.x,S=g.y;e instanceof Km||e instanceof Jm||e instanceof Ym||e instanceof Qm||Yl&&e instanceof Yl?m.texSubImage2D(m.TEXTURE_2D,0,b,S,m.RGBA,m.UNSIGNED_BYTE,e):m.texSubImage2D(m.TEXTURE_2D,0,b,S,a,l,m.RGBA,m.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&m.generateMipmap(m.TEXTURE_2D)},qa.prototype.bind=function(e,t,r){var a=this.context.gl;a.bindTexture(a.TEXTURE_2D,this.texture),r!==a.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=a.LINEAR),e!==this.filter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,e),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,r||e),this.filter=e),t!==this.wrap&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,t),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,t),this.wrap=t)},qa.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},qa.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var ap=function(e){var t=this;this._callback=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){t._triggered=!1,t._callback()})};ap.prototype.trigger=function(){var e=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){e._triggered=!1,e._callback()}),0))},ap.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Bs=function(e,t,r){this.target=e,this.parent=t,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},we(["receive","process"],this),this.invoker=new ap(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Pr()?e:J};function ey(e,t,r){var a=2*Math.PI*6378137/256/Math.pow(2,r);return[e*a-2*Math.PI*6378137/2,t*a-2*Math.PI*6378137/2]}Bs.prototype.send=function(e,t,r,a,l){var c=this;l===void 0&&(l=!1);var h=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[h]=r);var m=Rr(this.globalScope)?void 0:[];return this.target.postMessage({id:h,type:e,hasCallback:!!r,targetMapId:a,mustQueue:l,sourceMapId:this.mapId,data:gn(t,m)},m),{cancel:function(){r&&delete c.callbacks[h],c.target.postMessage({id:h,type:"<cancel>",targetMapId:a,sourceMapId:c.mapId})}}},Bs.prototype.receive=function(e){var t=e.data,r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if(t.type==="<cancel>"){delete this.tasks[r];var a=this.cancelCallbacks[r];delete this.cancelCallbacks[r],a&&a()}else Pr()||t.mustQueue?(this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,t)},Bs.prototype.process=function(){if(this.taskQueue.length){var e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t&&this.processTask(e,t)}},Bs.prototype.processTask=function(e,t){var r=this;if(t.type==="<response>"){var a=this.callbacks[e];delete this.callbacks[e],a&&(t.error?a(ji(t.error)):a(null,ji(t.data)))}else{var l=!1,c=Rr(this.globalScope)?void 0:[],h=t.hasCallback?function(S,I){l=!0,delete r.cancelCallbacks[e],r.target.postMessage({id:e,type:"<response>",sourceMapId:r.mapId,error:S?gn(S):null,data:gn(I,c)},c)}:function(S){l=!0},m=null,g=ji(t.data);if(this.parent[t.type])m=this.parent[t.type](t.sourceMapId,g,h);else if(this.parent.getWorkerSource){var b=t.type.split(".");m=this.parent.getWorkerSource(t.sourceMapId,b[0],g.source)[b[1]](g,h)}else h(new Error("Could not find function "+t.type));!l&&m&&m.cancel&&(this.cancelCallbacks[e]=m.cancel)}},Bs.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Zr=function(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))};Zr.prototype.setNorthEast=function(e){return this._ne=e instanceof gr?new gr(e.lng,e.lat):gr.convert(e),this},Zr.prototype.setSouthWest=function(e){return this._sw=e instanceof gr?new gr(e.lng,e.lat):gr.convert(e),this},Zr.prototype.extend=function(e){var t,r,a=this._sw,l=this._ne;if(e instanceof gr)t=e,r=e;else{if(!(e instanceof Zr))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(Zr.convert(e)):this.extend(gr.convert(e)):this;if(r=e._ne,!(t=e._sw)||!r)return this}return a||l?(a.lng=Math.min(t.lng,a.lng),a.lat=Math.min(t.lat,a.lat),l.lng=Math.max(r.lng,l.lng),l.lat=Math.max(r.lat,l.lat)):(this._sw=new gr(t.lng,t.lat),this._ne=new gr(r.lng,r.lat)),this},Zr.prototype.getCenter=function(){return new gr((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Zr.prototype.getSouthWest=function(){return this._sw},Zr.prototype.getNorthEast=function(){return this._ne},Zr.prototype.getNorthWest=function(){return new gr(this.getWest(),this.getNorth())},Zr.prototype.getSouthEast=function(){return new gr(this.getEast(),this.getSouth())},Zr.prototype.getWest=function(){return this._sw.lng},Zr.prototype.getSouth=function(){return this._sw.lat},Zr.prototype.getEast=function(){return this._ne.lng},Zr.prototype.getNorth=function(){return this._ne.lat},Zr.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Zr.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Zr.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Zr.prototype.contains=function(e){var t=gr.convert(e),r=t.lng,a=t.lat,l=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(l=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&l},Zr.convert=function(e){return!e||e instanceof Zr?e:new Zr(e)};var gr=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: ("+e+", "+t+")");if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};gr.prototype.wrap=function(){return new gr(He(this.lng,-180,180),this.lat)},gr.prototype.toArray=function(){return[this.lng,this.lat]},gr.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},gr.prototype.distanceTo=function(e){var t=Math.PI/180,r=this.lat*t,a=e.lat*t,l=Math.sin(r)*Math.sin(a)+Math.cos(r)*Math.cos(a)*Math.cos((e.lng-this.lng)*t);return 63710088e-1*Math.acos(Math.min(l,1))},gr.prototype.toBounds=function(e){e===void 0&&(e=0);var t=360*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new Zr(new gr(this.lng-r,this.lat-t),new gr(this.lng+r,this.lat+t))},gr.convert=function(e){if(e instanceof gr)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new gr(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new gr(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 ty=2*Math.PI*63710088e-1;function ry(e){return ty*Math.cos(e*Math.PI/180)}function iy(e){return(180+e)/360}function ny(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function oy(e,t){return e/ry(t)}function sp(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}var Ua=function(e,t,r){r===void 0&&(r=0),this.x=+e,this.y=+t,this.z=+r};Ua.fromLngLat=function(e,t){t===void 0&&(t=0);var r=gr.convert(e);return new Ua(iy(r.lng),ny(r.lat),oy(t,r.lat))},Ua.prototype.toLngLat=function(){return new gr(360*this.x-180,sp(this.y))},Ua.prototype.toAltitude=function(){return this.z*ry(sp(this.y))},Ua.prototype.meterInMercatorCoordinateUnits=function(){return 1/ty*(e=sp(this.y),1/Math.cos(e*Math.PI/180));var e};var Na=function(e,t,r){this.z=e,this.x=t,this.y=r,this.key=Fu(0,e,e,t,r)};Na.prototype.equals=function(e){return this.z===e.z&&this.x===e.x&&this.y===e.y},Na.prototype.url=function(e,t){var r,a,l,c,h,m=(a=this.y,l=this.z,c=ey(256*(r=this.x),256*(a=Math.pow(2,l)-a-1),l),h=ey(256*(r+1),256*(a+1),l),c[0]+","+c[1]+","+h[0]+","+h[1]),g=(function(b,S,I){for(var C,z="",j=b;j>0;j--)z+=(S&(C=1<<j-1)?1:0)+(I&C?2:0);return z})(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}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(t==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",g).replace("{bbox-epsg-3857}",m)},Na.prototype.getTilePoint=function(e){var t=Math.pow(2,this.z);return new X(8192*(e.x*t-this.x),8192*(e.y*t-this.y))},Na.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var ay=function(e,t){this.wrap=e,this.canonical=t,this.key=Fu(e,t.z,t.z,t.x,t.y)},Wr=function(e,t,r,a,l){this.overscaledZ=e,this.wrap=t,this.canonical=new Na(r,+a,+l),this.key=Fu(t,e,r,a,l)};function Fu(e,t,r,a,l){(e*=2)<0&&(e=-1*e-1);var c=1<<r;return(c*c*e+c*l+a).toString(36)+r.toString(36)+t.toString(36)}Wr.prototype.equals=function(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)},Wr.prototype.scaledTo=function(e){var t=this.canonical.z-e;return e>this.canonical.z?new Wr(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Wr(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)},Wr.prototype.calculateScaledKey=function(e,t){var r=this.canonical.z-e;return e>this.canonical.z?Fu(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):Fu(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)},Wr.prototype.isChildOf=function(e){if(e.wrap!==this.wrap)return!1;var t=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t},Wr.prototype.children=function(e){if(this.overscaledZ>=e)return[new Wr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var t=this.canonical.z+1,r=2*this.canonical.x,a=2*this.canonical.y;return[new Wr(t,this.wrap,t,r,a),new Wr(t,this.wrap,t,r+1,a),new Wr(t,this.wrap,t,r,a+1),new Wr(t,this.wrap,t,r+1,a+1)]},Wr.prototype.isLessThan=function(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))},Wr.prototype.wrapped=function(){return new Wr(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Wr.prototype.unwrapTo=function(e){return new Wr(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)},Wr.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Wr.prototype.toUnwrapped=function(){return new ay(this.wrap,this.canonical)},Wr.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Wr.prototype.getTilePoint=function(e){return this.canonical.getTilePoint(new Ua(e.x-this.wrap,e.y))},Xe("CanonicalTileID",Na),Xe("OverscaledTileID",Wr,{omit:["posMatrix"]});var Fo=function(e,t,r){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&r!=="mapbox"&&r!=="terrarium")return St('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=t.height;var a=this.dim=t.height-2;this.data=new Uint32Array(t.data.buffer),this.encoding=r||"mapbox";for(var l=0;l<a;l++)this.data[this._idx(-1,l)]=this.data[this._idx(0,l)],this.data[this._idx(a,l)]=this.data[this._idx(a-1,l)],this.data[this._idx(l,-1)]=this.data[this._idx(l,0)],this.data[this._idx(l,a)]=this.data[this._idx(l,a-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(a,-1)]=this.data[this._idx(a-1,0)],this.data[this._idx(-1,a)]=this.data[this._idx(0,a-1)],this.data[this._idx(a,a)]=this.data[this._idx(a-1,a-1)]};Fo.prototype.get=function(e,t){var r=new Uint8Array(this.data.buffer),a=4*this._idx(e,t);return(this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox)(r[a],r[a+1],r[a+2])},Fo.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Fo.prototype._idx=function(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)},Fo.prototype._unpackMapbox=function(e,t,r){return(256*e*256+256*t+r)/10-1e4},Fo.prototype._unpackTerrarium=function(e,t,r){return 256*e+t+r/256-32768},Fo.prototype.getPixels=function(){return new Hi({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Fo.prototype.backfillBorder=function(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");var a=t*this.dim,l=t*this.dim+this.dim,c=r*this.dim,h=r*this.dim+this.dim;switch(t){case-1:a=l-1;break;case 1:l=a+1}switch(r){case-1:c=h-1;break;case 1:h=c+1}for(var m=-t*this.dim,g=-r*this.dim,b=c;b<h;b++)for(var S=a;S<l;S++)this.data[this._idx(S,b)]=e.data[this._idx(S+m,b+g)]},Xe("DEMData",Fo);var Ql=function(e){this._stringToNumber={},this._numberToString=[];for(var t=0;t<e.length;t++){var r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}};Ql.prototype.encode=function(e){return this._stringToNumber[e]},Ql.prototype.decode=function(e){return this._numberToString[e]};var ec=function(e,t,r,a,l){this.type="Feature",this._vectorTileFeature=e,e._z=t,e._x=r,e._y=a,this.properties=e.properties,this.id=l},up={geometry:{configurable:!0}};up.geometry.get=function(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},up.geometry.set=function(e){this._geometry=e},ec.prototype.toJSON=function(){var e={geometry:this.geometry};for(var t in this)t!=="_geometry"&&t!=="_vectorTileFeature"&&(e[t]=this[t]);return e},Object.defineProperties(ec.prototype,up);var zs=function(){this.state={},this.stateChanges={},this.deletedStates={}};zs.prototype.updateState=function(e,t,r){var a=String(t);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][a]=this.stateChanges[e][a]||{},Ue(this.stateChanges[e][a],r),this.deletedStates[e]===null)for(var l in this.deletedStates[e]={},this.state[e])l!==a&&(this.deletedStates[e][l]=null);else if(this.deletedStates[e]&&this.deletedStates[e][a]===null)for(var c in this.deletedStates[e][a]={},this.state[e][a])r[c]||(this.deletedStates[e][a][c]=null);else for(var h in r)this.deletedStates[e]&&this.deletedStates[e][a]&&this.deletedStates[e][a][h]===null&&delete this.deletedStates[e][a][h]},zs.prototype.removeFeatureState=function(e,t,r){if(this.deletedStates[e]!==null){var a=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},r&&t!==void 0)this.deletedStates[e][a]!==null&&(this.deletedStates[e][a]=this.deletedStates[e][a]||{},this.deletedStates[e][a][r]=null);else if(t!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][a])for(r in this.deletedStates[e][a]={},this.stateChanges[e][a])this.deletedStates[e][a][r]=null;else this.deletedStates[e][a]=null;else this.deletedStates[e]=null}},zs.prototype.getState=function(e,t){var r=String(t),a=Ue({},(this.state[e]||{})[r],(this.stateChanges[e]||{})[r]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){var l=this.deletedStates[e][t];if(l===null)return{};for(var c in l)delete a[c]}return a},zs.prototype.initializeTileState=function(e,t){e.setFeatureState(this.state,t)},zs.prototype.coalesceChanges=function(e,t){var r={};for(var a in this.stateChanges){this.state[a]=this.state[a]||{};var l={};for(var c in this.stateChanges[a])this.state[a][c]||(this.state[a][c]={}),Ue(this.state[a][c],this.stateChanges[a][c]),l[c]=this.state[a][c];r[a]=l}for(var h in this.deletedStates){this.state[h]=this.state[h]||{};var m={};if(this.deletedStates[h]===null)for(var g in this.state[h])m[g]={},this.state[h][g]={};else for(var b in this.deletedStates[h]){if(this.deletedStates[h][b]===null)this.state[h][b]={};else for(var S=0,I=Object.keys(this.deletedStates[h][b]);S<I.length;S+=1)delete this.state[h][b][I[S]];m[b]=this.state[h][b]}r[h]=r[h]||{},Ue(r[h],m)}if(this.stateChanges={},this.deletedStates={},Object.keys(r).length!==0)for(var C in e)e[C].setFeatureState(r,t)};var Oo=function(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Rn(8192,16,0),this.grid3D=new Rn(8192,16,0),this.featureIndexArray=new A,this.promoteId=t};function sy(e,t,r,a,l){return Le(e,(function(c,h){var m=t instanceof Ba?t.get(h):null;return m&&m.evaluate?m.evaluate(r,a,l):m}))}function uy(e){for(var t=1/0,r=1/0,a=-1/0,l=-1/0,c=0,h=e;c<h.length;c+=1){var m=h[c];t=Math.min(t,m.x),r=Math.min(r,m.y),a=Math.max(a,m.x),l=Math.max(l,m.y)}return{minX:t,minY:r,maxX:a,maxY:l}}function b0(e,t){return t-e}Oo.prototype.insert=function(e,t,r,a,l,c){var h=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,a,l);for(var m=c?this.grid3D:this.grid,g=0;g<t.length;g++){for(var b=t[g],S=[1/0,1/0,-1/0,-1/0],I=0;I<b.length;I++){var C=b[I];S[0]=Math.min(S[0],C.x),S[1]=Math.min(S[1],C.y),S[2]=Math.max(S[2],C.x),S[3]=Math.max(S[3],C.y)}S[0]<8192&&S[1]<8192&&S[2]>=0&&S[3]>=0&&m.insert(h,S[0],S[1],S[2],S[3])}},Oo.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Ss.VectorTile(new Nl(this.rawTileData)).layers,this.sourceLayerCoder=new Ql(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Oo.prototype.query=function(e,t,r,a){var l=this;this.loadVTLayers();for(var c=e.params||{},h=8192/e.tileSize/e.scale,m=as(c.filter),g=e.queryGeometry,b=e.queryPadding*h,S=uy(g),I=this.grid.query(S.minX-b,S.minY-b,S.maxX+b,S.maxY+b),C=uy(e.cameraQueryGeometry),z=this.grid3D.query(C.minX-b,C.minY-b,C.maxX+b,C.maxY+b,(function(ce,he,xe,Pe){return(function(ze,rt,Oe,ot,qe){for(var bt=0,pt=ze;bt<pt.length;bt+=1){var Qe=pt[bt];if(rt<=Qe.x&&Oe<=Qe.y&&ot>=Qe.x&&qe>=Qe.y)return!0}var Tt=[new X(rt,Oe),new X(rt,qe),new X(ot,qe),new X(ot,Oe)];if(ze.length>2){for(var vt=0,Lt=Tt;vt<Lt.length;vt+=1)if(Pn(ze,Lt[vt]))return!0}for(var at=0;at<ze.length-1;at++)if(Fa(ze[at],ze[at+1],Tt))return!0;return!1})(e.cameraQueryGeometry,ce-b,he-b,xe+b,Pe+b)})),j=0,G=z;j<G.length;j+=1)I.push(G[j]);I.sort(b0);for(var te,K={},oe=function(ce){var he=I[ce];if(he!==te){te=he;var xe=l.featureIndexArray.get(he),Pe=null;l.loadMatchingFeature(K,xe.bucketIndex,xe.sourceLayerIndex,xe.featureIndex,m,c.layers,c.availableImages,t,r,a,(function(ze,rt,Oe){return Pe||(Pe=wr(ze)),rt.queryIntersectsFeature(g,ze,Oe,Pe,l.z,e.transform,h,e.pixelPosMatrix)}))}},le=0;le<I.length;le++)oe(le);return K},Oo.prototype.loadMatchingFeature=function(e,t,r,a,l,c,h,m,g,b,S){var I=this.bucketLayerIDs[t];if(!c||(function(ze,rt){for(var Oe=0;Oe<ze.length;Oe++)if(rt.indexOf(ze[Oe])>=0)return!0;return!1})(c,I)){var C=this.sourceLayerCoder.decode(r),z=this.vtLayers[C].feature(a);if(l.needGeometry){var j=Mr(z,!0);if(!l.filter(new kt(this.tileID.overscaledZ),j,this.tileID.canonical))return}else if(!l.filter(new kt(this.tileID.overscaledZ),z))return;for(var G=this.getId(z,C),te=0;te<I.length;te++){var K=I[te];if(!(c&&c.indexOf(K)<0)){var oe=m[K];if(oe){var le={};G!==void 0&&b&&(le=b.getState(oe.sourceLayer||"_geojsonTileLayer",G));var ce=Ue({},g[K]);ce.paint=sy(ce.paint,oe.paint,z,le,h),ce.layout=sy(ce.layout,oe.layout,z,le,h);var he=!S||S(z,oe,le);if(he){var xe=new ec(z,this.z,this.x,this.y,G);xe.layer=ce;var Pe=e[K];Pe===void 0&&(Pe=e[K]=[]),Pe.push({featureIndex:a,feature:xe,intersectionZ:he})}}}}}},Oo.prototype.lookupSymbolFeatures=function(e,t,r,a,l,c,h,m){var g={};this.loadVTLayers();for(var b=as(l),S=0,I=e;S<I.length;S+=1)this.loadMatchingFeature(g,r,a,I[S],b,c,h,m,t);return g},Oo.prototype.hasLayer=function(e){for(var t=0,r=this.bucketLayerIDs;t<r.length;t+=1)for(var a=0,l=r[t];a<l.length;a+=1)if(e===l[a])return!0;return!1},Oo.prototype.getId=function(e,t){var r=e.id;return this.promoteId&&typeof(r=e.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[t]])=="boolean"&&(r=Number(r)),r},Xe("FeatureIndex",Oo,{omit:["rawTileData","sourceLayerCoder"]});var ui=function(e,t){this.tileID=e,this.uid=Ke(),this.uses=0,this.tileSize=t,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};ui.prototype.registerFadeDuration=function(e){var t=e+this.timeAdded;t<Xi.now()||this.fadeEndTime&&t<this.fadeEndTime||(this.fadeEndTime=t)},ui.prototype.wasRequested=function(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"},ui.prototype.loadVectorData=function(e,t,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){for(var a in 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(b,S){var I={};if(!S)return I;for(var C=function(){var G=j[z],te=G.layerIds.map((function(le){return S.getLayer(le)})).filter(Boolean);if(te.length!==0){G.layers=te,G.stateDependentLayerIds&&(G.stateDependentLayers=G.stateDependentLayerIds.map((function(le){return te.filter((function(ce){return ce.id===le}))[0]})));for(var K=0,oe=te;K<oe.length;K+=1)I[oe[K].id]=G}},z=0,j=b;z<j.length;z+=1)C();return I})(e.buckets,t.style),this.hasSymbolBuckets=!1,this.buckets){var l=this.buckets[a];if(l instanceof er){if(this.hasSymbolBuckets=!0,!r)break;l.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var c in this.buckets){var h=this.buckets[c];if(h instanceof er&&h.hasRTLText){this.hasRTLText=!0,Qi.isLoading()||Qi.isLoaded()||xu()!=="deferred"||_n();break}}for(var m in this.queryPadding=0,this.buckets){var g=this.buckets[m];this.queryPadding=Math.max(this.queryPadding,t.style.getLayer(m).queryRadius(g))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new o},ui.prototype.unloadVectorData=function(){for(var e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},ui.prototype.getBucket=function(e){return this.buckets[e.id]},ui.prototype.upload=function(e){for(var t in this.buckets){var r=this.buckets[t];r.uploadPending()&&r.upload(e)}var a=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new qa(e,this.imageAtlas.image,a.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new qa(e,this.glyphAtlasImage,a.ALPHA),this.glyphAtlasImage=null)},ui.prototype.prepare=function(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)},ui.prototype.queryRenderedFeatures=function(e,t,r,a,l,c,h,m,g,b){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:a,cameraQueryGeometry:l,scale:c,tileSize:this.tileSize,pixelPosMatrix:b,transform:m,params:h,queryPadding:this.queryPadding*g},e,t,r):{}},ui.prototype.querySourceFeatures=function(e,t){var r=this.latestFeatureIndex;if(r&&r.rawTileData){var a=r.loadVTLayers(),l=t?t.sourceLayer:"",c=a._geojsonTileLayer||a[l];if(c)for(var h=as(t&&t.filter),m=this.tileID.canonical,g=m.z,b=m.x,S=m.y,I={z:g,x:b,y:S},C=0;C<c.length;C++){var z=c.feature(C);if(h.needGeometry){var j=Mr(z,!0);if(!h.filter(new kt(this.tileID.overscaledZ),j,this.tileID.canonical))continue}else if(!h.filter(new kt(this.tileID.overscaledZ),z))continue;var G=r.getId(z,l),te=new ec(z,g,b,S,G);te.tile=I,e.push(te)}}},ui.prototype.hasData=function(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"},ui.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},ui.prototype.setExpiryData=function(e){var t=this.expirationTime;if(e.cacheControl){var r=bi(e.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){var a=Date.now(),l=!1;if(this.expirationTime>a)l=!1;else if(t)if(this.expirationTime<t)l=!0;else{var c=this.expirationTime-t;c?this.expirationTime=a+Math.max(c,3e4):l=!0}else l=!0;l?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},ui.prototype.getExpiryTimeout=function(){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)},ui.prototype.setFeatureState=function(e,t){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&Object.keys(e).length!==0){var r=this.latestFeatureIndex.loadVTLayers();for(var a in this.buckets)if(t.style.hasLayer(a)){var l=this.buckets[a],c=l.layers[0].sourceLayer||"_geojsonTileLayer",h=r[c],m=e[c];if(h&&m&&Object.keys(m).length!==0){l.update(m,h,this.imageAtlas&&this.imageAtlas.patternPositions||{});var g=t&&t.style&&t.style.getLayer(a);g&&(this.queryPadding=Math.max(this.queryPadding,g.queryRadius(l)))}}}},ui.prototype.holdingForFade=function(){return this.symbolFadeHoldUntil!==void 0},ui.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Xi.now()},ui.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},ui.prototype.setHoldDuration=function(e){this.symbolFadeHoldUntil=Xi.now()+e},ui.prototype.setDependencies=function(e,t){for(var r={},a=0,l=t;a<l.length;a+=1)r[l[a]]=!0;this.dependencies[e]=r},ui.prototype.hasDependency=function(e,t){for(var r=0,a=e;r<a.length;r+=1){var l=this.dependencies[a[r]];if(l){for(var c=0,h=t;c<h.length;c+=1)if(l[h[c]])return!0}}return!1};var ua=J.performance,ly=function(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},ua.mark(this._marks.start)};ly.prototype.finish=function(){ua.mark(this._marks.end);var e=ua.getEntriesByName(this._marks.measure);return e.length===0&&(ua.measure(this._marks.measure,this._marks.start,this._marks.end),e=ua.getEntriesByName(this._marks.measure),ua.clearMarks(this._marks.start),ua.clearMarks(this._marks.end),ua.clearMeasures(this._marks.measure)),e},u.Actor=Bs,u.AlphaImage=Va,u.CanonicalTileID=Na,u.CollisionBoxArray=o,u.Color=$t,u.DEMData=Fo,u.DataConstantProperty=it,u.DictionaryCoder=Ql,u.EXTENT=8192,u.ErrorEvent=re,u.EvaluationParameters=kt,u.Event=$,u.Evented=ie,u.FeatureIndex=Oo,u.FillBucket=Vn,u.FillExtrusionBucket=qn,u.ImageAtlas=Ru,u.ImagePosition=Gl,u.LineBucket=Fi,u.LngLat=gr,u.LngLatBounds=Zr,u.MercatorCoordinate=Ua,u.ONE_EM=24,u.OverscaledTileID=Wr,u.Point=X,u.Point$1=X,u.Properties=vi,u.Protobuf=Nl,u.RGBAImage=Hi,u.RequestManager=hr,u.RequestPerformance=ly,u.ResourceType=jt,u.SegmentVector=F,u.SourceFeatureState=zs,u.StructArrayLayout1ui2=Au,u.StructArrayLayout2f1f2i16=zo,u.StructArrayLayout2i4=Bo,u.StructArrayLayout3ui6=to,u.StructArrayLayout4i8=wu,u.SymbolBucket=er,u.Texture=qa,u.Tile=ui,u.Transitionable=yi,u.Uniform1f=ke,u.Uniform1i=Te,u.Uniform2f=Ce,u.Uniform3f=$e,u.Uniform4f=nt,u.UniformColor=ut,u.UniformMatrix4f=Ft,u.UnwrappedTileID=ay,u.ValidationError=H,u.WritingMode=pn,u.ZoomHistory=yu,u.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e},u.addDynamicAttributes=np,u.asyncAll=function(e,t,r){if(!e.length)return r(null,[]);var a=e.length,l=new Array(e.length),c=null;e.forEach((function(h,m){t(h,(function(g,b){g&&(c=g),l[m]=b,--a==0&&r(c,l)}))}))},u.bezier=be,u.bindAll=we,u.browser=Xi,u.cacheEntryPossiblyAdded=function(e){++de>Zo&&(e.getActor().send("enforceCacheSizeLimit",Bn),de=0)},u.clamp=Ze,u.clearTileCache=function(e){var t=J.caches.delete("mapbox-tiles");e&&t.catch(e).then((function(){return e()}))},u.clipLine=Gm,u.clone=function(e){var t=new Zt(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],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},u.clone$1=Mt,u.clone$2=function(e){var t=new Zt(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},u.collisionCircleLayout=Ub,u.config=Nt,u.create=function(){var e=new Zt(16);return Zt!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},u.create$1=function(){var e=new Zt(9);return Zt!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e},u.create$2=function(){var e=new Zt(4);return Zt!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},u.createCommonjsModule=U,u.createExpression=ns,u.createLayout=ai,u.createStyleLayer=function(e){return e.type==="custom"?new _0(e):new x0[e.type](e)},u.cross=function(e,t,r){var a=t[0],l=t[1],c=t[2],h=r[0],m=r[1],g=r[2];return e[0]=l*g-c*m,e[1]=c*h-a*g,e[2]=a*m-l*h,e},u.deepEqual=function e(t,r){if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(var a=0;a<t.length;a++)if(!e(t[a],r[a]))return!1;return!0}if(typeof t=="object"&&t!==null&&r!==null){if(typeof r!="object"||Object.keys(t).length!==Object.keys(r).length)return!1;for(var l in t)if(!e(t[l],r[l]))return!1;return!0}return t===r},u.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},u.dot$1=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},u.ease=De,u.emitValidationErrors=Ca,u.endsWith=je,u.enforceCacheSizeLimit=function(e){jn(),ri&&ri.then((function(t){t.keys().then((function(r){for(var a=0;a<r.length-e;a++)t.delete(r[a])}))}))},u.evaluateSizeForFeature=Om,u.evaluateSizeForZoom=Vm,u.evaluateVariableOffset=Wm,u.evented=_u,u.extend=Ue,u.featureFilter=as,u.filterObject=tt,u.fromRotation=function(e,t){var r=Math.sin(t),a=Math.cos(t);return e[0]=a,e[1]=r,e[2]=0,e[3]=-r,e[4]=a,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},u.getAnchorAlignment=ep,u.getAnchorJustification=ip,u.getArrayBuffer=ii,u.getImage=P,u.getJSON=function(e,t){return qi(Ue(e,{type:"json"}),t)},u.getRTLTextPluginStatus=xu,u.getReferrer=Kt,u.getVideo=function(e,t){var r,a,l=J.document.createElement("video");l.muted=!0,l.onloadstart=function(){t(null,l)};for(var c=0;c<e.length;c++){var h=J.document.createElement("source");r=e[c],a=void 0,(a=J.document.createElement("a")).href=r,(a.protocol!==J.document.location.protocol||a.host!==J.document.location.host)&&(l.crossOrigin="Anonymous"),h.src=e[c],l.appendChild(h)}return{cancel:function(){}}},u.identity=en,u.invert=function(e,t){var r=t[0],a=t[1],l=t[2],c=t[3],h=t[4],m=t[5],g=t[6],b=t[7],S=t[8],I=t[9],C=t[10],z=t[11],j=t[12],G=t[13],te=t[14],K=t[15],oe=r*m-a*h,le=r*g-l*h,ce=r*b-c*h,he=a*g-l*m,xe=a*b-c*m,Pe=l*b-c*g,ze=S*G-I*j,rt=S*te-C*j,Oe=S*K-z*j,ot=I*te-C*G,qe=I*K-z*G,bt=C*K-z*te,pt=oe*bt-le*qe+ce*ot+he*Oe-xe*rt+Pe*ze;return pt?(e[0]=(m*bt-g*qe+b*ot)*(pt=1/pt),e[1]=(l*qe-a*bt-c*ot)*pt,e[2]=(G*Pe-te*xe+K*he)*pt,e[3]=(C*xe-I*Pe-z*he)*pt,e[4]=(g*Oe-h*bt-b*rt)*pt,e[5]=(r*bt-l*Oe+c*rt)*pt,e[6]=(te*ce-j*Pe-K*le)*pt,e[7]=(S*Pe-C*ce+z*le)*pt,e[8]=(h*qe-m*Oe+b*ze)*pt,e[9]=(a*Oe-r*qe-c*ze)*pt,e[10]=(j*xe-G*ce+K*oe)*pt,e[11]=(I*ce-S*xe-z*oe)*pt,e[12]=(m*rt-h*ot-g*ze)*pt,e[13]=(r*ot-a*rt+l*ze)*pt,e[14]=(G*le-j*he-te*oe)*pt,e[15]=(S*he-I*le+C*oe)*pt,e):null},u.isChar=Re,u.isMapboxURL=jr,u.keysDifference=function(e,t){var r=[];for(var a in e)a in t||r.push(a);return r},u.makeRequest=qi,u.mapObject=Le,u.mercatorXfromLng=iy,u.mercatorYfromLat=ny,u.mercatorZfromAltitude=oy,u.mul=Nc,u.multiply=Li,u.mvt=Ss,u.nextPowerOfTwo=function(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},u.normalize=function(e,t){var r=t[0],a=t[1],l=t[2],c=r*r+a*a+l*l;return c>0&&(c=1/Math.sqrt(c)),e[0]=t[0]*c,e[1]=t[1]*c,e[2]=t[2]*c,e},u.number=Vr,u.offscreenCanvasSupported=_e,u.ortho=function(e,t,r,a,l,c,h){var m=1/(t-r),g=1/(a-l),b=1/(c-h);return e[0]=-2*m,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*g,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*b,e[11]=0,e[12]=(t+r)*m,e[13]=(l+a)*g,e[14]=(h+c)*b,e[15]=1,e},u.parseGlyphPBF=function(e){return new Nl(e).readFields(Yb,[])},u.pbf=Nl,u.performSymbolLayout=function(e,t,r,a,l,c,h){e.createArrays(),e.tilePixelRatio=8192/(512*e.overscaling),e.compareText={},e.iconsNeedLinear=!1;var m=e.layers[0].layout,g=e.layers[0]._unevaluatedLayout._values,b={};if(e.textSizeData.kind==="composite"){var S=e.textSizeData,I=S.maxZoom;b.compositeTextSizes=[g["text-size"].possiblyEvaluate(new kt(S.minZoom),h),g["text-size"].possiblyEvaluate(new kt(I),h)]}if(e.iconSizeData.kind==="composite"){var C=e.iconSizeData,z=C.maxZoom;b.compositeIconSizes=[g["icon-size"].possiblyEvaluate(new kt(C.minZoom),h),g["icon-size"].possiblyEvaluate(new kt(z),h)]}b.layoutTextSize=g["text-size"].possiblyEvaluate(new kt(e.zoom+1),h),b.layoutIconSize=g["icon-size"].possiblyEvaluate(new kt(e.zoom+1),h),b.textMaxSize=g["text-size"].possiblyEvaluate(new kt(18));for(var j=24*m.get("text-line-height"),G=m.get("text-rotation-alignment")==="map"&&m.get("symbol-placement")!=="point",te=m.get("text-keep-upright"),K=m.get("text-size"),oe=function(){var he=ce[le],xe=m.get("text-font").evaluate(he,{},h).join(","),Pe=K.evaluate(he,{},h),ze=b.layoutTextSize.evaluate(he,{},h),rt=b.layoutIconSize.evaluate(he,{},h),Oe={horizontal:{},vertical:void 0},ot=he.text,qe=[0,0];if(ot){var bt=ot.toString(),pt=24*m.get("text-letter-spacing").evaluate(he,{},h),Qe=(function(Bt){for(var nr=0,Jt=Bt;nr<Jt.length;nr+=1)if(Ot=Jt[nr].charCodeAt(0),Re.Arabic(Ot)||Re["Arabic Supplement"](Ot)||Re["Arabic Extended-A"](Ot)||Re["Arabic Presentation Forms-A"](Ot)||Re["Arabic Presentation Forms-B"](Ot))return!1;var Ot;return!0})(bt)?pt:0,Tt=m.get("text-anchor").evaluate(he,{},h),vt=m.get("text-variable-anchor");if(!vt){var Lt=m.get("text-radial-offset").evaluate(he,{},h);qe=Lt?Wm(Tt,[24*Lt,rp]):m.get("text-offset").evaluate(he,{},h).map((function(Bt){return 24*Bt}))}var at=G?"center":m.get("text-justify").evaluate(he,{},h),Vt=m.get("symbol-placement"),_r=Vt==="point"?24*m.get("text-max-width").evaluate(he,{},h):0,Tr=function(){e.allowVerticalPlacement&&vu(bt)&&(Oe.vertical=$l(ot,t,r,l,xe,_r,j,Tt,"left",Qe,qe,pn.vertical,!0,Vt,ze,Pe))};if(!G&&vt){for(var Sr=at==="auto"?vt.map((function(Bt){return ip(Bt)})):[at],xr=!1,Ar=0;Ar<Sr.length;Ar++){var Qr=Sr[Ar];if(!Oe.horizontal[Qr])if(xr)Oe.horizontal[Qr]=Oe.horizontal[0];else{var ei=$l(ot,t,r,l,xe,_r,j,"center",Qr,Qe,qe,pn.horizontal,!1,Vt,ze,Pe);ei&&(Oe.horizontal[Qr]=ei,xr=ei.positionedLines.length===1)}}Tr()}else{at==="auto"&&(at=ip(Tt));var Ci=$l(ot,t,r,l,xe,_r,j,Tt,at,Qe,qe,pn.horizontal,!1,Vt,ze,Pe);Ci&&(Oe.horizontal[at]=Ci),Tr(),vu(bt)&&G&&te&&(Oe.vertical=$l(ot,t,r,l,xe,_r,j,Tt,at,Qe,qe,pn.vertical,!1,Vt,ze,Pe))}}var li=void 0,ki=!1;if(he.icon&&he.icon.name){var Br=a[he.icon.name];Br&&(li=(function(Bt,nr,Jt){var Ot=ep(Jt),Oi=nr[0]-Bt.displaySize[0]*Ot.horizontalAlign,_i=nr[1]-Bt.displaySize[1]*Ot.verticalAlign;return{image:Bt,top:_i,bottom:_i+Bt.displaySize[1],left:Oi,right:Oi+Bt.displaySize[0]}})(l[he.icon.name],m.get("icon-offset").evaluate(he,{},h),m.get("icon-anchor").evaluate(he,{},h)),ki=Br.sdf,e.sdfIcons===void 0?e.sdfIcons=Br.sdf:e.sdfIcons!==Br.sdf&&St("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Br.pixelRatio!==e.pixelRatio||m.get("icon-rotate").constantOr(1)!==0)&&(e.iconsNeedLinear=!0))}var ci=Xm(Oe.horizontal)||Oe.vertical;e.iconsInText=!!ci&&ci.iconsInText,(ci||li)&&(function(Bt,nr,Jt,Ot,Oi,_i,dr,Ur,xi,qt,so){var hn=_i.textMaxSize.evaluate(nr,{});hn===void 0&&(hn=dr);var uo,zr=Bt.layers[0].layout,lo=zr.get("icon-offset").evaluate(nr,{},so),kn=Xm(Jt.horizontal),Ds=dr/24,ja=Bt.tilePixelRatio*Ds,Rs=Bt.tilePixelRatio*hn/24,Vo=Bt.tilePixelRatio*Ur,Ls=Bt.tilePixelRatio*zr.get("symbol-spacing"),tc=zr.get("text-padding")*Bt.tilePixelRatio,Fs=zr.get("icon-padding")*Bt.tilePixelRatio,Ou=zr.get("text-max-angle")/180*Math.PI,rc=zr.get("text-rotation-alignment")==="map"&&zr.get("symbol-placement")!=="point",ic=zr.get("icon-rotation-alignment")==="map"&&zr.get("symbol-placement")!=="point",qo=zr.get("symbol-placement"),Vu=Ls/2,Os=zr.get("icon-text-fit");Ot&&Os!=="none"&&(Bt.allowVerticalPlacement&&Jt.vertical&&(uo=Fm(Ot,Jt.vertical,Os,zr.get("icon-text-fit-padding"),lo,Ds)),kn&&(Ot=Fm(Ot,kn,Os,zr.get("icon-text-fit-padding"),lo,Ds)));var la=function(w0,Wu){Wu.x<0||Wu.x>=8192||Wu.y<0||Wu.y>=8192||(function(Dr,Un,S0,ca,hp,hy,lc,co,cc,Hu,pc,hc,fp,fy,Xu,dy,my,yy,vy,gy,fn,fc,_y,po,I0){var xy,$a,js,Gs,$s,Zs=Dr.addToLineVertexArray(Un,S0),by=0,wy=0,Sy=0,Iy=0,dp=-1,mp=-1,Uo={},Ty=N(""),yp=0,vp=0;if(co._unevaluatedLayout.getValue("text-radial-offset")===void 0?(yp=(xy=co.layout.get("text-offset").evaluate(fn,{},po).map((function(Ju){return 24*Ju})))[0],vp=xy[1]):(yp=24*co.layout.get("text-radial-offset").evaluate(fn,{},po),vp=rp),Dr.allowVerticalPlacement&&ca.vertical){var Ay=co.layout.get("text-rotate").evaluate(fn,{},po)+90;Gs=new Kl(cc,Un,Hu,pc,hc,ca.vertical,fp,fy,Xu,Ay),lc&&($s=new Kl(cc,Un,Hu,pc,hc,lc,my,yy,Xu,Ay))}if(hp){var gp=co.layout.get("icon-rotate").evaluate(fn,{}),Ey=co.layout.get("icon-text-fit")!=="none",Py=$m(hp,gp,_y,Ey),_p=lc?$m(lc,gp,_y,Ey):void 0;js=new Kl(cc,Un,Hu,pc,hc,hp,my,yy,!1,gp),by=4*Py.length;var Cy=Dr.iconSizeData,Ku=null;Cy.kind==="source"?(Ku=[128*co.layout.get("icon-size").evaluate(fn,{})])[0]>32640&&St(Dr.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):Cy.kind==="composite"&&((Ku=[128*fc.compositeIconSizes[0].evaluate(fn,{},po),128*fc.compositeIconSizes[1].evaluate(fn,{},po)])[0]>32640||Ku[1]>32640)&&St(Dr.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),Dr.addSymbols(Dr.icon,Py,Ku,gy,vy,fn,!1,Un,Zs.lineStartIndex,Zs.lineLength,-1,po),dp=Dr.icon.placedSymbolArray.length-1,_p&&(wy=4*_p.length,Dr.addSymbols(Dr.icon,_p,Ku,gy,vy,fn,pn.vertical,Un,Zs.lineStartIndex,Zs.lineLength,-1,po),mp=Dr.icon.placedSymbolArray.length-1)}for(var ky in ca.horizontal){var dc=ca.horizontal[ky];if(!$a){Ty=N(dc.text);var T0=co.layout.get("text-rotate").evaluate(fn,{},po);$a=new Kl(cc,Un,Hu,pc,hc,dc,fp,fy,Xu,T0)}var My=dc.positionedLines.length===1;if(Sy+=Hm(Dr,Un,dc,hy,co,Xu,fn,dy,Zs,ca.vertical?pn.horizontal:pn.horizontalOnly,My?Object.keys(ca.horizontal):[ky],Uo,dp,fc,po),My)break}ca.vertical&&(Iy+=Hm(Dr,Un,ca.vertical,hy,co,Xu,fn,dy,Zs,pn.vertical,["vertical"],Uo,mp,fc,po));var A0=$a?$a.boxStartIndex:Dr.collisionBoxArray.length,E0=$a?$a.boxEndIndex:Dr.collisionBoxArray.length,P0=Gs?Gs.boxStartIndex:Dr.collisionBoxArray.length,C0=Gs?Gs.boxEndIndex:Dr.collisionBoxArray.length,k0=js?js.boxStartIndex:Dr.collisionBoxArray.length,M0=js?js.boxEndIndex:Dr.collisionBoxArray.length,B0=$s?$s.boxStartIndex:Dr.collisionBoxArray.length,z0=$s?$s.boxEndIndex:Dr.collisionBoxArray.length,ho=-1,mc=function(Ju,zy){return Ju&&Ju.circleDiameter?Math.max(Ju.circleDiameter,zy):zy};ho=mc($a,ho),ho=mc(Gs,ho),ho=mc(js,ho);var By=(ho=mc($s,ho))>-1?1:0;By&&(ho*=I0/24),Dr.glyphOffsetArray.length>=er.MAX_GLYPHS&&St("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),fn.sortKey!==void 0&&Dr.addToSortKeyRanges(Dr.symbolInstances.length,fn.sortKey),Dr.symbolInstances.emplaceBack(Un.x,Un.y,Uo.right>=0?Uo.right:-1,Uo.center>=0?Uo.center:-1,Uo.left>=0?Uo.left:-1,Uo.vertical||-1,dp,mp,Ty,A0,E0,P0,C0,k0,M0,B0,z0,Hu,Sy,Iy,by,wy,By,0,fp,yp,vp,ho)})(Bt,Wu,w0,Jt,Ot,Oi,uo,Bt.layers[0],Bt.collisionBoxArray,nr.index,nr.sourceLayerIndex,Bt.index,ja,tc,rc,xi,Vo,Fs,ic,lo,nr,_i,qt,so,dr)};if(qo==="line")for(var Vs=0,nc=Gm(nr.geometry,0,0,8192,8192);Vs<nc.length;Vs+=1)for(var oc=nc[Vs],qu=0,Uu=o0(oc,Ls,Ou,Jt.vertical||kn,Ot,24,Rs,Bt.overscaling,8192);qu<Uu.length;qu+=1){var ac=Uu[qu];kn&&l0(Bt,kn.text,Vu,ac)||la(oc,ac)}else if(qo==="line-center")for(var Nu=0,ju=nr.geometry;Nu<ju.length;Nu+=1){var Gu=ju[Nu];if(Gu.length>1){var sc=n0(Gu,Ou,Jt.vertical||kn,Ot,24,Rs);sc&&la(Gu,sc)}}else if(nr.type==="Polygon")for(var qs=0,uc=Xc(nr.geometry,0);qs<uc.length;qs+=1){var Us=uc[qs],$u=s0(Us,16);la(Us[0],new Es($u.x,$u.y,0))}else if(nr.type==="LineString")for(var Ga=0,Zu=nr.geometry;Ga<Zu.length;Ga+=1){var Ns=Zu[Ga];la(Ns,new Es(Ns[0].x,Ns[0].y,0))}else if(nr.type==="Point")for(var lp=0,cy=nr.geometry;lp<cy.length;lp+=1)for(var cp=0,py=cy[lp];cp<py.length;cp+=1){var pp=py[cp];la([pp],new Es(pp.x,pp.y,0))}})(e,he,Oe,li,a,b,ze,rt,qe,ki,h)},le=0,ce=e.features;le<ce.length;le+=1)oe();c&&e.generateCollisionDebugBuffers()},u.perspective=function(e,t,r,a,l){var c,h=1/Math.tan(t/2);return e[0]=h/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=h,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,l!=null&&l!==1/0?(e[10]=(l+a)*(c=1/(a-l)),e[14]=2*l*a*c):(e[10]=-1,e[14]=-2*a),e},u.pick=function(e,t){for(var r={},a=0;a<t.length;a++){var l=t[a];l in e&&(r[l]=e[l])}return r},u.plugin=Qi,u.polygonIntersectsPolygon=no,u.postMapLoadEvent=Mn,u.postTurnstileEvent=$o,u.potpack=zm,u.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],u.register=Xe,u.registerForPluginStateChange=function(e){return e({pluginStatus:$i,pluginURL:Ln}),_u.on("pluginStateChange",e),e},u.renderColorRamp=dm,u.rotate=function(e,t,r){var a=t[0],l=t[1],c=t[2],h=t[3],m=Math.sin(r),g=Math.cos(r);return e[0]=a*g+c*m,e[1]=l*g+h*m,e[2]=a*-m+c*g,e[3]=l*-m+h*g,e},u.rotateX=function(e,t,r){var a=Math.sin(r),l=Math.cos(r),c=t[4],h=t[5],m=t[6],g=t[7],b=t[8],S=t[9],I=t[10],C=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=c*l+b*a,e[5]=h*l+S*a,e[6]=m*l+I*a,e[7]=g*l+C*a,e[8]=b*l-c*a,e[9]=S*l-h*a,e[10]=I*l-m*a,e[11]=C*l-g*a,e},u.rotateZ=function(e,t,r){var a=Math.sin(r),l=Math.cos(r),c=t[0],h=t[1],m=t[2],g=t[3],b=t[4],S=t[5],I=t[6],C=t[7];return t!==e&&(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[0]=c*l+b*a,e[1]=h*l+S*a,e[2]=m*l+I*a,e[3]=g*l+C*a,e[4]=b*l-c*a,e[5]=S*l-h*a,e[6]=I*l-m*a,e[7]=C*l-g*a,e},u.scale=function(e,t,r){var a=r[0],l=r[1],c=r[2];return e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e[3]=t[3]*a,e[4]=t[4]*l,e[5]=t[5]*l,e[6]=t[6]*l,e[7]=t[7]*l,e[8]=t[8]*c,e[9]=t[9]*c,e[10]=t[10]*c,e[11]=t[11]*c,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},u.scale$1=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},u.scale$2=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e},u.setCacheLimits=function(e,t){Bn=e,Zo=t},u.setRTLTextPlugin=function(e,t,r){if(r===void 0&&(r=!1),$i==="deferred"||$i==="loading"||$i==="loaded")throw new Error("setRTLTextPlugin cannot be called multiple times.");Ln=Xi.resolveURL(e),$i="deferred",fs=t,Ma(),r||_n()},u.sphericalToCartesian=function(e){var t=e[0],r=e[1],a=e[2];return r+=90,r*=Math.PI/180,a*=Math.PI/180,{x:t*Math.cos(r)*Math.sin(a),y:t*Math.sin(r)*Math.sin(a),z:t*Math.cos(a)}},u.sqrLen=function(e){var t=e[0],r=e[1];return t*t+r*r},u.styleSpec=L,u.sub=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e},u.symbolSize=i0,u.transformMat3=function(e,t,r){var a=t[0],l=t[1],c=t[2];return e[0]=a*r[0]+l*r[3]+c*r[6],e[1]=a*r[1]+l*r[4]+c*r[7],e[2]=a*r[2]+l*r[5]+c*r[8],e},u.transformMat4=_s,u.translate=function(e,t,r){var a,l,c,h,m,g,b,S,I,C,z,j,G=r[0],te=r[1],K=r[2];return t===e?(e[12]=t[0]*G+t[4]*te+t[8]*K+t[12],e[13]=t[1]*G+t[5]*te+t[9]*K+t[13],e[14]=t[2]*G+t[6]*te+t[10]*K+t[14],e[15]=t[3]*G+t[7]*te+t[11]*K+t[15]):(l=t[1],c=t[2],h=t[3],m=t[4],g=t[5],b=t[6],S=t[7],I=t[8],C=t[9],z=t[10],j=t[11],e[0]=a=t[0],e[1]=l,e[2]=c,e[3]=h,e[4]=m,e[5]=g,e[6]=b,e[7]=S,e[8]=I,e[9]=C,e[10]=z,e[11]=j,e[12]=a*G+m*te+I*K+t[12],e[13]=l*G+g*te+C*K+t[13],e[14]=c*G+b*te+z*K+t[14],e[15]=h*G+S*te+j*K+t[15]),e},u.triggerPluginCompletionEvent=Rl,u.uniqueId=Ke,u.validateCustomStyleLayer=function(e){var t=[],r=e.id;return r===void 0&&t.push({message:"layers."+r+': missing required property "id"'}),e.render===void 0&&t.push({message:"layers."+r+': missing required method "render"'}),e.renderingMode&&e.renderingMode!=="2d"&&e.renderingMode!=="3d"&&t.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),t},u.validateLight=qc,u.validateStyle=Ea,u.values=function(e){var t=[];for(var r in e)t.push(e[r]);return t},u.vectorTile=Ss,u.version="1.13.3",u.warnOnce=St,u.webpSupported=Nr,u.window=J,u.wrap=He})),D(["./shared"],(function(u){function U(T){var P=typeof T;if(P==="number"||P==="boolean"||P==="string"||T==null)return JSON.stringify(T);if(Array.isArray(T)){for(var B="[",V=0,$=T;V<$.length;V+=1)B+=U($[V])+",";return B+"]"}for(var re=Object.keys(T).sort(),ie="{",L=0;L<re.length;L++)ie+=JSON.stringify(re[L])+":"+U(T[re[L]])+",";return ie+"}"}function M(T){for(var P="",B=0,V=u.refProperties;B<V.length;B+=1)P+="/"+U(T[V[B]]);return P}var Y=function(T){this.keyCache={},T&&this.replace(T)};Y.prototype.replace=function(T){this._layerConfigs={},this._layers={},this.update(T,[])},Y.prototype.update=function(T,P){for(var B=this,V=0,$=T;V<$.length;V+=1){var re=$[V];this._layerConfigs[re.id]=re;var ie=this._layers[re.id]=u.createStyleLayer(re);ie._featureFilter=u.featureFilter(ie.filter),this.keyCache[re.id]&&delete this.keyCache[re.id]}for(var L=0,H=P;L<H.length;L+=1){var se=H[L];delete this.keyCache[se],delete this._layerConfigs[se],delete this._layers[se]}this.familiesBySource={};for(var Ie=0,Ee=(function(Be,Me){for(var yt={},Fe=0;Fe<Be.length;Fe++){var Pt=Me&&Me[Be[Fe].id]||M(Be[Fe]);Me&&(Me[Be[Fe].id]=Pt);var rr=yt[Pt];rr||(rr=yt[Pt]=[]),rr.push(Be[Fe])}var Ct=[];for(var Gt in yt)Ct.push(yt[Gt]);return Ct})(u.values(this._layerConfigs),this.keyCache);Ie<Ee.length;Ie+=1){var ye=Ee[Ie].map((function(Be){return B._layers[Be.id]})),Ae=ye[0];if(Ae.visibility!=="none"){var Je=Ae.source||"",Ge=this.familiesBySource[Je];Ge||(Ge=this.familiesBySource[Je]={});var ge=Ae.sourceLayer||"_geojsonTileLayer",Ve=Ge[ge];Ve||(Ve=Ge[ge]=[]),Ve.push(ye)}}};var X=function(T){var P={},B=[];for(var V in T){var $=T[V],re=P[V]={};for(var ie in $){var L=$[+ie];if(L&&L.bitmap.width!==0&&L.bitmap.height!==0){var H={x:0,y:0,w:L.bitmap.width+2,h:L.bitmap.height+2};B.push(H),re[ie]={rect:H,metrics:L.metrics}}}}var se=u.potpack(B),Ie=new u.AlphaImage({width:se.w||1,height:se.h||1});for(var Ee in T){var ye=T[Ee];for(var Ae in ye){var Je=ye[+Ae];if(Je&&Je.bitmap.width!==0&&Je.bitmap.height!==0){var Ge=P[Ee][Ae].rect;u.AlphaImage.copy(Je.bitmap,Ie,{x:0,y:0},{x:Ge.x+1,y:Ge.y+1},Je.bitmap)}}}this.image=Ie,this.positions=P};u.register("GlyphAtlas",X);var ae=function(T){this.tileID=new u.OverscaledTileID(T.tileID.overscaledZ,T.tileID.wrap,T.tileID.canonical.z,T.tileID.canonical.x,T.tileID.canonical.y),this.uid=T.uid,this.zoom=T.zoom,this.pixelRatio=T.pixelRatio,this.tileSize=T.tileSize,this.source=T.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=T.showCollisionBoxes,this.collectResourceTiming=!!T.collectResourceTiming,this.returnDependencies=!!T.returnDependencies,this.promoteId=T.promoteId};function J(T,P,B){for(var V=new u.EvaluationParameters(P),$=0,re=T;$<re.length;$+=1)re[$].recalculate(V,B)}function Se(T,P){var B=u.getArrayBuffer(T.request,(function(V,$,re,ie){V?P(V):$&&P(null,{vectorTile:new u.vectorTile.VectorTile(new u.pbf($)),rawData:$,cacheControl:re,expires:ie})}));return function(){B.cancel(),P()}}ae.prototype.parse=function(T,P,B,V,$){var re=this;this.status="parsing",this.data=T,this.collisionBoxArray=new u.CollisionBoxArray;var ie=new u.DictionaryCoder(Object.keys(T.layers).sort()),L=new u.FeatureIndex(this.tileID,this.promoteId);L.bucketLayerIDs=[];var H,se,Ie,Ee,ye={},Ae={featureIndex:L,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:B},Je=P.familiesBySource[this.source];for(var Ge in Je){var ge=T.layers[Ge];if(ge){ge.version===1&&u.warnOnce('Vector tile source "'+this.source+'" layer "'+Ge+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var Ve=ie.encode(Ge),Be=[],Me=0;Me<ge.length;Me++){var yt=ge.feature(Me),Fe=L.getId(yt,Ge);Be.push({feature:yt,id:Fe,index:Me,sourceLayerIndex:Ve})}for(var Pt=0,rr=Je[Ge];Pt<rr.length;Pt+=1){var Ct=rr[Pt],Gt=Ct[0];Gt.minzoom&&this.zoom<Math.floor(Gt.minzoom)||Gt.maxzoom&&this.zoom>=Gt.maxzoom||Gt.visibility!=="none"&&(J(Ct,this.zoom,B),(ye[Gt.id]=Gt.createBucket({index:L.bucketLayerIDs.length,layers:Ct,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Ve,sourceID:this.source})).populate(Be,Ae,this.tileID.canonical),L.bucketLayerIDs.push(Ct.map((function(Qt){return Qt.id}))))}}}var Rt=u.mapObject(Ae.glyphDependencies,(function(Qt){return Object.keys(Qt).map(Number)}));Object.keys(Rt).length?V.send("getGlyphs",{uid:this.uid,stacks:Rt},(function(Qt,zt){H||(H=Qt,se=zt,Cr.call(re))})):se={};var wi=Object.keys(Ae.iconDependencies);wi.length?V.send("getImages",{icons:wi,source:this.source,tileID:this.tileID,type:"icons"},(function(Qt,zt){H||(H=Qt,Ie=zt,Cr.call(re))})):Ie={};var Ht=Object.keys(Ae.patternDependencies);function Cr(){if(H)return $(H);if(se&&Ie&&Ee){var Qt=new X(se),zt=new u.ImageAtlas(Ie,Ee);for(var $t in ye){var zi=ye[$t];zi instanceof u.SymbolBucket?(J(zi.layers,this.zoom,B),u.performSymbolLayout(zi,se,Qt.positions,Ie,zt.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):zi.hasPattern&&(zi instanceof u.LineBucket||zi instanceof u.FillBucket||zi instanceof u.FillExtrusionBucket)&&(J(zi.layers,this.zoom,B),zi.addFeatures(Ae,this.tileID.canonical,zt.patternPositions))}this.status="done",$(null,{buckets:u.values(ye).filter((function(ma){return!ma.isEmpty()})),featureIndex:L,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Qt.image,imageAtlas:zt,glyphMap:this.returnDependencies?se:null,iconMap:this.returnDependencies?Ie:null,glyphPositions:this.returnDependencies?Qt.positions:null})}}Ht.length?V.send("getImages",{icons:Ht,source:this.source,tileID:this.tileID,type:"patterns"},(function(Qt,zt){H||(H=Qt,Ee=zt,Cr.call(re))})):Ee={},Cr.call(this)};var be=function(T,P,B,V){this.actor=T,this.layerIndex=P,this.availableImages=B,this.loadVectorData=V||Se,this.loading={},this.loaded={}};be.prototype.loadTile=function(T,P){var B=this,V=T.uid;this.loading||(this.loading={});var $=!!(T&&T.request&&T.request.collectResourceTiming)&&new u.RequestPerformance(T.request),re=this.loading[V]=new ae(T);re.abort=this.loadVectorData(T,(function(ie,L){if(delete B.loading[V],ie||!L)return re.status="done",B.loaded[V]=re,P(ie);var H=L.rawData,se={};L.expires&&(se.expires=L.expires),L.cacheControl&&(se.cacheControl=L.cacheControl);var Ie={};if($){var Ee=$.finish();Ee&&(Ie.resourceTiming=JSON.parse(JSON.stringify(Ee)))}re.vectorTile=L.vectorTile,re.parse(L.vectorTile,B.layerIndex,B.availableImages,B.actor,(function(ye,Ae){if(ye||!Ae)return P(ye);P(null,u.extend({rawTileData:H.slice(0)},Ae,se,Ie))})),B.loaded=B.loaded||{},B.loaded[V]=re}))},be.prototype.reloadTile=function(T,P){var B=this,V=this.loaded,$=T.uid,re=this;if(V&&V[$]){var ie=V[$];ie.showCollisionBoxes=T.showCollisionBoxes;var L=function(H,se){var Ie=ie.reloadCallback;Ie&&(delete ie.reloadCallback,ie.parse(ie.vectorTile,re.layerIndex,B.availableImages,re.actor,Ie)),P(H,se)};ie.status==="parsing"?ie.reloadCallback=L:ie.status==="done"&&(ie.vectorTile?ie.parse(ie.vectorTile,this.layerIndex,this.availableImages,this.actor,L):L())}},be.prototype.abortTile=function(T,P){var B=this.loading,V=T.uid;B&&B[V]&&B[V].abort&&(B[V].abort(),delete B[V]),P()},be.prototype.removeTile=function(T,P){var B=this.loaded,V=T.uid;B&&B[V]&&delete B[V],P()};var De=u.window.ImageBitmap,Ze=function(){this.loaded={}};function He(T,P){if(T.length!==0){Ue(T[0],P);for(var B=1;B<T.length;B++)Ue(T[B],!P)}}function Ue(T,P){for(var B=0,V=0,$=0,re=T.length,ie=re-1;$<re;ie=$++){var L=(T[$][0]-T[ie][0])*(T[ie][1]+T[$][1]),H=B+L;V+=Math.abs(B)>=Math.abs(L)?B-H+L:L-H+B,B=H}B+V>=0!=!!P&&T.reverse()}Ze.prototype.loadTile=function(T,P){var B=T.uid,V=T.encoding,$=T.rawImageData,re=De&&$ instanceof De?this.getImageData($):$,ie=new u.DEMData(B,re,V);this.loaded=this.loaded||{},this.loaded[B]=ie,P(null,ie)},Ze.prototype.getImageData=function(T){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(T.width,T.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=T.width,this.offscreenCanvas.height=T.height,this.offscreenCanvasContext.drawImage(T,0,0,T.width,T.height);var P=this.offscreenCanvasContext.getImageData(-1,-1,T.width+2,T.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new u.RGBAImage({width:P.width,height:P.height},P.data)},Ze.prototype.removeTile=function(T){var P=this.loaded,B=T.uid;P&&P[B]&&delete P[B]};var fe=u.vectorTile.VectorTileFeature.prototype.toGeoJSON,Ke=function(T){this._feature=T,this.extent=u.EXTENT,this.type=T.type,this.properties=T.tags,"id"in T&&!isNaN(T.id)&&(this.id=parseInt(T.id,10))};Ke.prototype.loadGeometry=function(){if(this._feature.type===1){for(var T=[],P=0,B=this._feature.geometry;P<B.length;P+=1){var V=B[P];T.push([new u.Point$1(V[0],V[1])])}return T}for(var $=[],re=0,ie=this._feature.geometry;re<ie.length;re+=1){for(var L=[],H=0,se=ie[re];H<se.length;H+=1){var Ie=se[H];L.push(new u.Point$1(Ie[0],Ie[1]))}$.push(L)}return $},Ke.prototype.toGeoJSON=function(T,P,B){return fe.call(this,T,P,B)};var Ne=function(T){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=u.EXTENT,this.length=T.length,this._features=T};Ne.prototype.feature=function(T){return new Ke(this._features[T])};var It=u.vectorTile.VectorTileFeature,we=je;function je(T,P){this.options=P||{},this.features=T,this.length=T.length}function Le(T,P){this.id=typeof T.id=="number"?T.id:void 0,this.type=T.type,this.rawGeometry=T.type===1?[T.geometry]:T.geometry,this.properties=T.tags,this.extent=P||4096}je.prototype.feature=function(T){return new Le(this.features[T],this.options.extent)},Le.prototype.loadGeometry=function(){var T=this.rawGeometry;this.geometry=[];for(var P=0;P<T.length;P++){for(var B=T[P],V=[],$=0;$<B.length;$++)V.push(new u.Point$1(B[$][0],B[$][1]));this.geometry.push(V)}return this.geometry},Le.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var T=this.geometry,P=1/0,B=-1/0,V=1/0,$=-1/0,re=0;re<T.length;re++)for(var ie=T[re],L=0;L<ie.length;L++){var H=ie[L];P=Math.min(P,H.x),B=Math.max(B,H.x),V=Math.min(V,H.y),$=Math.max($,H.y)}return[P,V,B,$]},Le.prototype.toGeoJSON=It.prototype.toGeoJSON;var tt=Wt,Mt=we;function Wt(T){var P=new u.pbf;return(function(B,V){for(var $ in B.layers)V.writeMessage(3,St,B.layers[$])})(T,P),P.finish()}function St(T,P){var B;P.writeVarintField(15,T.version||1),P.writeStringField(1,T.name||""),P.writeVarintField(5,T.extent||4096);var V={keys:[],values:[],keycache:{},valuecache:{}};for(B=0;B<T.length;B++)V.feature=T.feature(B),P.writeMessage(2,Ut,V);var $=V.keys;for(B=0;B<$.length;B++)P.writeStringField(3,$[B]);var re=V.values;for(B=0;B<re.length;B++)P.writeMessage(4,Rr,re[B])}function Ut(T,P){var B=T.feature;B.id!==void 0&&P.writeVarintField(1,B.id),P.writeMessage(2,Hr,T),P.writeVarintField(3,B.type),P.writeMessage(4,or,B)}function Hr(T,P){var B=T.feature,V=T.keys,$=T.values,re=T.keycache,ie=T.valuecache;for(var L in B.properties){var H=re[L];H===void 0&&(V.push(L),re[L]=H=V.length-1),P.writeVarint(H);var se=B.properties[L],Ie=typeof se;Ie!=="string"&&Ie!=="boolean"&&Ie!=="number"&&(se=JSON.stringify(se));var Ee=Ie+":"+se,ye=ie[Ee];ye===void 0&&($.push(se),ie[Ee]=ye=$.length-1),P.writeVarint(ye)}}function Pr(T,P){return(P<<3)+(7&T)}function bi(T){return T<<1^T>>31}function or(T,P){for(var B=T.loadGeometry(),V=T.type,$=0,re=0,ie=B.length,L=0;L<ie;L++){var H=B[L],se=1;V===1&&(se=H.length),P.writeVarint(Pr(1,se));for(var Ie=V===3?H.length-1:H.length,Ee=0;Ee<Ie;Ee++){Ee===1&&V!==1&&P.writeVarint(Pr(2,Ie-1));var ye=H[Ee].x-$,Ae=H[Ee].y-re;P.writeVarint(bi(ye)),P.writeVarint(bi(Ae)),$+=ye,re+=Ae}V===3&&P.writeVarint(Pr(7,1))}}function Rr(T,P){var B=typeof T;B==="string"?P.writeStringField(1,T):B==="boolean"?P.writeBooleanField(7,T):B==="number"&&(T%1!=0?P.writeDoubleField(3,T):T<0?P.writeSVarintField(6,T):P.writeVarintField(5,T))}function et(T,P,B,V){Lr(T,B,V),Lr(P,2*B,2*V),Lr(P,2*B+1,2*V+1)}function Lr(T,P,B){var V=T[P];T[P]=T[B],T[B]=V}function Xr(T,P,B,V){var $=T-B,re=P-V;return $*$+re*re}tt.fromVectorTileJs=Wt,tt.fromGeojsonVt=function(T,P){P=P||{};var B={};for(var V in T)B[V]=new we(T[V].features,P),B[V].name=V,B[V].version=P.version,B[V].extent=P.extent;return Wt({layers:B})},tt.GeoJSONWrapper=Mt;var Et=function(T){return T[0]},Fr=function(T){return T[1]},Mi=function(T,P,B,V,$){P===void 0&&(P=Et),B===void 0&&(B=Fr),V===void 0&&(V=64),$===void 0&&($=Float64Array),this.nodeSize=V,this.points=T;for(var re=T.length<65536?Uint16Array:Uint32Array,ie=this.ids=new re(T.length),L=this.coords=new $(2*T.length),H=0;H<T.length;H++)ie[H]=H,L[2*H]=P(T[H]),L[2*H+1]=B(T[H]);(function se(Ie,Ee,ye,Ae,Je,Ge){if(!(Je-Ae<=ye)){var ge=Ae+Je>>1;(function Ve(Be,Me,yt,Fe,Pt,rr){for(;Pt>Fe;){if(Pt-Fe>600){var Ct=Pt-Fe+1,Gt=yt-Fe+1,Rt=Math.log(Ct),wi=.5*Math.exp(2*Rt/3),Ht=.5*Math.sqrt(Rt*wi*(Ct-wi)/Ct)*(Gt-Ct/2<0?-1:1);Ve(Be,Me,yt,Math.max(Fe,Math.floor(yt-Gt*wi/Ct+Ht)),Math.min(Pt,Math.floor(yt+(Ct-Gt)*wi/Ct+Ht)),rr)}var Cr=Me[2*yt+rr],Qt=Fe,zt=Pt;for(et(Be,Me,Fe,yt),Me[2*Pt+rr]>Cr&&et(Be,Me,Fe,Pt);Qt<zt;){for(et(Be,Me,Qt,zt),Qt++,zt--;Me[2*Qt+rr]<Cr;)Qt++;for(;Me[2*zt+rr]>Cr;)zt--}Me[2*Fe+rr]===Cr?et(Be,Me,Fe,zt):et(Be,Me,++zt,Pt),zt<=yt&&(Fe=zt+1),yt<=zt&&(Pt=zt-1)}})(Ie,Ee,ge,Ae,Je,Ge%2),se(Ie,Ee,ye,Ae,ge-1,Ge+1),se(Ie,Ee,ye,ge+1,Je,Ge+1)}})(ie,L,V,0,ie.length-1,0)};Mi.prototype.range=function(T,P,B,V){return(function($,re,ie,L,H,se,Ie){for(var Ee,ye,Ae=[0,$.length-1,0],Je=[];Ae.length;){var Ge=Ae.pop(),ge=Ae.pop(),Ve=Ae.pop();if(ge-Ve<=Ie)for(var Be=Ve;Be<=ge;Be++)ye=re[2*Be+1],(Ee=re[2*Be])>=ie&&Ee<=H&&ye>=L&&ye<=se&&Je.push($[Be]);else{var Me=Math.floor((Ve+ge)/2);ye=re[2*Me+1],(Ee=re[2*Me])>=ie&&Ee<=H&&ye>=L&&ye<=se&&Je.push($[Me]);var yt=(Ge+1)%2;(Ge===0?ie<=Ee:L<=ye)&&(Ae.push(Ve),Ae.push(Me-1),Ae.push(yt)),(Ge===0?H>=Ee:se>=ye)&&(Ae.push(Me+1),Ae.push(ge),Ae.push(yt))}}return Je})(this.ids,this.coords,T,P,B,V,this.nodeSize)},Mi.prototype.within=function(T,P,B){return(function(V,$,re,ie,L,H){for(var se=[0,V.length-1,0],Ie=[],Ee=L*L;se.length;){var ye=se.pop(),Ae=se.pop(),Je=se.pop();if(Ae-Je<=H)for(var Ge=Je;Ge<=Ae;Ge++)Xr($[2*Ge],$[2*Ge+1],re,ie)<=Ee&&Ie.push(V[Ge]);else{var ge=Math.floor((Je+Ae)/2),Ve=$[2*ge],Be=$[2*ge+1];Xr(Ve,Be,re,ie)<=Ee&&Ie.push(V[ge]);var Me=(ye+1)%2;(ye===0?re-L<=Ve:ie-L<=Be)&&(se.push(Je),se.push(ge-1),se.push(Me)),(ye===0?re+L>=Ve:ie+L>=Be)&&(se.push(ge+1),se.push(Ae),se.push(Me))}}return Ie})(this.ids,this.coords,T,P,B,this.nodeSize)};var pi={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(T){return T}},Or=function(T){this.options=mr(Object.create(pi),T),this.trees=new Array(this.options.maxZoom+1)};function Xi(T,P,B,V,$){return{x:T,y:P,zoom:1/0,id:B,parentId:-1,numPoints:V,properties:$}}function Nt(T,P){var B=T.geometry.coordinates,V=B[1];return{x:sr(B[0]),y:lt(V),zoom:1/0,index:P,parentId:-1}}function Nr(T){return{type:"Feature",id:T.id,properties:ar(T),geometry:{type:"Point",coordinates:[(V=T.x,360*(V-.5)),(P=T.y,B=(180-360*P)*Math.PI/180,360*Math.atan(Math.exp(B))/Math.PI-90)]}};var P,B,V}function ar(T){var P=T.numPoints,B=P>=1e4?Math.round(P/1e3)+"k":P>=1e3?Math.round(P/100)/10+"k":P;return mr(mr({},T.properties),{cluster:!0,cluster_id:T.id,point_count:P,point_count_abbreviated:B})}function sr(T){return T/360+.5}function lt(T){var P=Math.sin(T*Math.PI/180),B=.5-.25*Math.log((1+P)/(1-P))/Math.PI;return B<0?0:B>1?1:B}function mr(T,P){for(var B in P)T[B]=P[B];return T}function hr(T){return T.x}function jr(T){return T.y}function fr(T,P,B,V,$,re){var ie=$-B,L=re-V;if(ie!==0||L!==0){var H=((T-B)*ie+(P-V)*L)/(ie*ie+L*L);H>1?(B=$,V=re):H>0&&(B+=ie*H,V+=L*H)}return(ie=T-B)*ie+(L=P-V)*L}function br(T,P,B,V){var $={id:T===void 0?null:T,type:P,geometry:B,tags:V,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return(function(re){var ie=re.geometry,L=re.type;if(L==="Point"||L==="MultiPoint"||L==="LineString")dn(re,ie);else if(L==="Polygon"||L==="MultiLineString")for(var H=0;H<ie.length;H++)dn(re,ie[H]);else if(L==="MultiPolygon")for(H=0;H<ie.length;H++)for(var se=0;se<ie[H].length;se++)dn(re,ie[H][se])})($),$}function dn(T,P){for(var B=0;B<P.length;B+=3)T.minX=Math.min(T.minX,P[B]),T.minY=Math.min(T.minY,P[B+1]),T.maxX=Math.max(T.maxX,P[B]),T.maxY=Math.max(T.maxY,P[B+1])}function Kr(T,P,B,V){if(P.geometry){var $=P.geometry.coordinates,re=P.geometry.type,ie=Math.pow(B.tolerance/((1<<B.maxZoom)*B.extent),2),L=[],H=P.id;if(B.promoteId?H=P.properties[B.promoteId]:B.generateId&&(H=V||0),re==="Point")Bi($,L);else if(re==="MultiPoint")for(var se=0;se<$.length;se++)Bi($[se],L);else if(re==="LineString")hi($,L,ie,!1);else if(re==="MultiLineString"){if(B.lineMetrics){for(se=0;se<$.length;se++)hi($[se],L=[],ie,!1),T.push(br(H,"LineString",L,P.properties));return}ti($,L,ie,!1)}else if(re==="Polygon")ti($,L,ie,!0);else{if(re!=="MultiPolygon"){if(re==="GeometryCollection"){for(se=0;se<P.geometry.geometries.length;se++)Kr(T,{id:H,geometry:P.geometry.geometries[se],properties:P.properties},B,V);return}throw new Error("Input data is not a valid GeoJSON object.")}for(se=0;se<$.length;se++){var Ie=[];ti($[se],Ie,ie,!0),L.push(Ie)}}T.push(br(H,re,L,P.properties))}}function Bi(T,P){P.push(ri(T[0])),P.push(Vi(T[1])),P.push(0)}function hi(T,P,B,V){for(var $,re,ie=0,L=0;L<T.length;L++){var H=ri(T[L][0]),se=Vi(T[L][1]);P.push(H),P.push(se),P.push(0),L>0&&(ie+=V?($*se-H*re)/2:Math.sqrt(Math.pow(H-$,2)+Math.pow(se-re,2))),$=H,re=se}var Ie=P.length-3;P[2]=1,(function Ee(ye,Ae,Je,Ge){for(var ge,Ve=Ge,Be=Je-Ae>>1,Me=Je-Ae,yt=ye[Ae],Fe=ye[Ae+1],Pt=ye[Je],rr=ye[Je+1],Ct=Ae+3;Ct<Je;Ct+=3){var Gt=fr(ye[Ct],ye[Ct+1],yt,Fe,Pt,rr);if(Gt>Ve)ge=Ct,Ve=Gt;else if(Gt===Ve){var Rt=Math.abs(Ct-Be);Rt<Me&&(ge=Ct,Me=Rt)}}Ve>Ge&&(ge-Ae>3&&Ee(ye,Ae,ge,Ge),ye[ge+2]=Ve,Je-ge>3&&Ee(ye,ge,Je,Ge))})(P,0,Ie,B),P[Ie+2]=1,P.size=Math.abs(ie),P.start=0,P.end=P.size}function ti(T,P,B,V){for(var $=0;$<T.length;$++){var re=[];hi(T[$],re,B,V),P.push(re)}}function ri(T){return T/360+.5}function Vi(T){var P=Math.sin(T*Math.PI/180),B=.5-.25*Math.log((1+P)/(1-P))/Math.PI;return B<0?0:B>1?1:B}function Ki(T,P,B,V,$,re,ie,L){if(V/=P,re>=(B/=P)&&ie<V)return T;if(ie<B||re>=V)return null;for(var H=[],se=0;se<T.length;se++){var Ie=T[se],Ee=Ie.geometry,ye=Ie.type,Ae=$===0?Ie.minX:Ie.minY,Je=$===0?Ie.maxX:Ie.maxY;if(Ae>=B&&Je<V)H.push(Ie);else if(!(Je<B||Ae>=V)){var Ge=[];if(ye==="Point"||ye==="MultiPoint")yo(Ee,Ge,B,V,$);else if(ye==="LineString")$o(Ee,Ge,B,V,$,!1,L.lineMetrics);else if(ye==="MultiLineString")Mn(Ee,Ge,B,V,$,!1);else if(ye==="Polygon")Mn(Ee,Ge,B,V,$,!0);else if(ye==="MultiPolygon")for(var ge=0;ge<Ee.length;ge++){var Ve=[];Mn(Ee[ge],Ve,B,V,$,!0),Ve.length&&Ge.push(Ve)}if(Ge.length){if(L.lineMetrics&&ye==="LineString"){for(ge=0;ge<Ge.length;ge++)H.push(br(Ie.id,ye,Ge[ge],Ie.tags));continue}ye!=="LineString"&&ye!=="MultiLineString"||(Ge.length===1?(ye="LineString",Ge=Ge[0]):ye="MultiLineString"),ye!=="Point"&&ye!=="MultiPoint"||(ye=Ge.length===3?"Point":"MultiPoint"),H.push(br(Ie.id,ye,Ge,Ie.tags))}}}return H.length?H:null}function yo(T,P,B,V,$){for(var re=0;re<T.length;re+=3){var ie=T[re+$];ie>=B&&ie<=V&&(P.push(T[re]),P.push(T[re+1]),P.push(T[re+2]))}}function $o(T,P,B,V,$,re,ie){for(var L,H,se=mn(T),Ie=$===0?Zo:jn,Ee=T.start,ye=0;ye<T.length-3;ye+=3){var Ae=T[ye],Je=T[ye+1],Ge=T[ye+2],ge=T[ye+3],Ve=T[ye+4],Be=$===0?Ae:Je,Me=$===0?ge:Ve,yt=!1;ie&&(L=Math.sqrt(Math.pow(Ae-ge,2)+Math.pow(Je-Ve,2))),Be<B?Me>B&&(H=Ie(se,Ae,Je,ge,Ve,B),ie&&(se.start=Ee+L*H)):Be>V?Me<V&&(H=Ie(se,Ae,Je,ge,Ve,V),ie&&(se.start=Ee+L*H)):Bn(se,Ae,Je,Ge),Me<B&&Be>=B&&(H=Ie(se,Ae,Je,ge,Ve,B),yt=!0),Me>V&&Be<=V&&(H=Ie(se,Ae,Je,ge,Ve,V),yt=!0),!re&&yt&&(ie&&(se.end=Ee+L*H),P.push(se),se=mn(T)),ie&&(Ee+=L)}var Fe=T.length-3;Ae=T[Fe],Je=T[Fe+1],Ge=T[Fe+2],(Be=$===0?Ae:Je)>=B&&Be<=V&&Bn(se,Ae,Je,Ge),Fe=se.length-3,re&&Fe>=3&&(se[Fe]!==se[0]||se[Fe+1]!==se[1])&&Bn(se,se[0],se[1],se[2]),se.length&&P.push(se)}function mn(T){var P=[];return P.size=T.size,P.start=T.start,P.end=T.end,P}function Mn(T,P,B,V,$,re){for(var ie=0;ie<T.length;ie++)$o(T[ie],P,B,V,$,re,!1)}function Bn(T,P,B,V){T.push(P),T.push(B),T.push(V)}function Zo(T,P,B,V,$,re){var ie=(re-P)/(V-P);return T.push(re),T.push(B+($-B)*ie),T.push(1),ie}function jn(T,P,B,V,$,re){var ie=(re-B)/($-B);return T.push(P+(V-P)*ie),T.push(re),T.push(1),ie}function zn(T,P){for(var B=[],V=0;V<T.length;V++){var $,re=T[V],ie=re.type;if(ie==="Point"||ie==="MultiPoint"||ie==="LineString")$=rn(re.geometry,P);else if(ie==="MultiLineString"||ie==="Polygon"){$=[];for(var L=0;L<re.geometry.length;L++)$.push(rn(re.geometry[L],P))}else if(ie==="MultiPolygon")for($=[],L=0;L<re.geometry.length;L++){for(var H=[],se=0;se<re.geometry[L].length;se++)H.push(rn(re.geometry[L][se],P));$.push(H)}B.push(br(re.id,ie,$,re.tags))}return B}function rn(T,P){var B=[];B.size=T.size,T.start!==void 0&&(B.start=T.start,B.end=T.end);for(var V=0;V<T.length;V+=3)B.push(T[V]+P,T[V+1],T[V+2]);return B}function de(T,P){if(T.transformed)return T;var B,V,$,re=1<<T.z,ie=T.x,L=T.y;for(B=0;B<T.features.length;B++){var H=T.features[B],se=H.geometry,Ie=H.type;if(H.geometry=[],Ie===1)for(V=0;V<se.length;V+=2)H.geometry.push(_e(se[V],se[V+1],P,re,ie,L));else for(V=0;V<se.length;V++){var Ee=[];for($=0;$<se[V].length;$+=2)Ee.push(_e(se[V][$],se[V][$+1],P,re,ie,L));H.geometry.push(Ee)}}return T.transformed=!0,T}function _e(T,P,B,V,$,re){return[Math.round(B*(T*V-$)),Math.round(B*(P*V-re))]}function jt(T,P,B,V,$){for(var re=P===$.maxZoom?0:$.tolerance/((1<<P)*$.extent),ie={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:B,y:V,z:P,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},L=0;L<T.length;L++){ie.numFeatures++,tr(ie,T[L],re,$);var H=T[L].minX,se=T[L].minY,Ie=T[L].maxX,Ee=T[L].maxY;H<ie.minX&&(ie.minX=H),se<ie.minY&&(ie.minY=se),Ie>ie.maxX&&(ie.maxX=Ie),Ee>ie.maxY&&(ie.maxY=Ee)}return ie}function tr(T,P,B,V){var $=P.geometry,re=P.type,ie=[];if(re==="Point"||re==="MultiPoint")for(var L=0;L<$.length;L+=3)ie.push($[L]),ie.push($[L+1]),T.numPoints++,T.numSimplified++;else if(re==="LineString")Kt(ie,$,T,B,!1,!1);else if(re==="MultiLineString"||re==="Polygon")for(L=0;L<$.length;L++)Kt(ie,$[L],T,B,re==="Polygon",L===0);else if(re==="MultiPolygon")for(var H=0;H<$.length;H++){var se=$[H];for(L=0;L<se.length;L++)Kt(ie,se[L],T,B,!0,L===0)}if(ie.length){var Ie=P.tags||null;if(re==="LineString"&&V.lineMetrics){for(var Ee in Ie={},P.tags)Ie[Ee]=P.tags[Ee];Ie.mapbox_clip_start=$.start/$.size,Ie.mapbox_clip_end=$.end/$.size}var ye={geometry:ie,type:re==="Polygon"||re==="MultiPolygon"?3:re==="LineString"||re==="MultiLineString"?2:1,tags:Ie};P.id!==null&&(ye.id=P.id),T.features.push(ye)}}function Kt(T,P,B,V,$,re){var ie=V*V;if(V>0&&P.size<($?ie:V))B.numPoints+=P.length/3;else{for(var L=[],H=0;H<P.length;H+=3)(V===0||P[H+2]>ie)&&(B.numSimplified++,L.push(P[H]),L.push(P[H+1])),B.numPoints++;$&&(function(se,Ie){for(var Ee=0,ye=0,Ae=se.length,Je=Ae-2;ye<Ae;Je=ye,ye+=2)Ee+=(se[ye]-se[Je])*(se[ye+1]+se[Je+1]);if(Ee>0===Ie)for(ye=0,Ae=se.length;ye<Ae/2;ye+=2){var Ge=se[ye],ge=se[ye+1];se[ye]=se[Ae-2-ye],se[ye+1]=se[Ae-1-ye],se[Ae-2-ye]=Ge,se[Ae-1-ye]=ge}})(L,re),T.push(L)}}function _t(T,P){var B=(P=this.options=(function($,re){for(var ie in re)$[ie]=re[ie];return $})(Object.create(this.options),P)).debug;if(B&&console.time("preprocess data"),P.maxZoom<0||P.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(P.promoteId&&P.generateId)throw new Error("promoteId and generateId cannot be used together.");var V=(function($,re){var ie=[];if($.type==="FeatureCollection")for(var L=0;L<$.features.length;L++)Kr(ie,$.features[L],re,L);else Kr(ie,$.type==="Feature"?$:{geometry:$},re);return ie})(T,P);this.tiles={},this.tileCoords=[],B&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",P.indexMaxZoom,P.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(V=(function($,re){var ie=re.buffer/re.extent,L=$,H=Ki($,1,-1-ie,ie,0,-1,2,re),se=Ki($,1,1-ie,2+ie,0,-1,2,re);return(H||se)&&(L=Ki($,1,-ie,1+ie,0,-1,2,re)||[],H&&(L=zn(H,1).concat(L)),se&&(L=L.concat(zn(se,-1)))),L})(V,P)).length&&this.splitTile(V,0,0,0),B&&(V.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 fi(T,P,B){return 32*((1<<T)*B+P)+T}function qi(T,P){var B=T.tileID.canonical;if(!this._geoJSONIndex)return P(null,null);var V=this._geoJSONIndex.getTile(B.z,B.x,B.y);if(!V)return P(null,null);var $=new Ne(V.features),re=tt($);re.byteOffset===0&&re.byteLength===re.buffer.byteLength||(re=new Uint8Array(re)),P(null,{vectorTile:$,rawData:re.buffer})}Or.prototype.load=function(T){var P=this.options,B=P.log,V=P.minZoom,$=P.maxZoom,re=P.nodeSize;B&&console.time("total time");var ie="prepare "+T.length+" points";B&&console.time(ie),this.points=T;for(var L=[],H=0;H<T.length;H++)T[H].geometry&&L.push(Nt(T[H],H));this.trees[$+1]=new Mi(L,hr,jr,re,Float32Array),B&&console.timeEnd(ie);for(var se=$;se>=V;se--){var Ie=+Date.now();L=this._cluster(L,se),this.trees[se]=new Mi(L,hr,jr,re,Float32Array),B&&console.log("z%d: %d clusters in %dms",se,L.length,+Date.now()-Ie)}return B&&console.timeEnd("total time"),this},Or.prototype.getClusters=function(T,P){var B=((T[0]+180)%360+360)%360-180,V=Math.max(-90,Math.min(90,T[1])),$=T[2]===180?180:((T[2]+180)%360+360)%360-180,re=Math.max(-90,Math.min(90,T[3]));if(T[2]-T[0]>=360)B=-180,$=180;else if(B>$){var ie=this.getClusters([B,V,180,re],P),L=this.getClusters([-180,V,$,re],P);return ie.concat(L)}for(var H=this.trees[this._limitZoom(P)],se=[],Ie=0,Ee=H.range(sr(B),lt(re),sr($),lt(V));Ie<Ee.length;Ie+=1){var ye=H.points[Ee[Ie]];se.push(ye.numPoints?Nr(ye):this.points[ye.index])}return se},Or.prototype.getChildren=function(T){var P=this._getOriginId(T),B=this._getOriginZoom(T),V="No cluster with the specified id.",$=this.trees[B];if(!$)throw new Error(V);var re=$.points[P];if(!re)throw new Error(V);for(var ie=this.options.radius/(this.options.extent*Math.pow(2,B-1)),L=[],H=0,se=$.within(re.x,re.y,ie);H<se.length;H+=1){var Ie=$.points[se[H]];Ie.parentId===T&&L.push(Ie.numPoints?Nr(Ie):this.points[Ie.index])}if(L.length===0)throw new Error(V);return L},Or.prototype.getLeaves=function(T,P,B){var V=[];return this._appendLeaves(V,T,P=P||10,B=B||0,0),V},Or.prototype.getTile=function(T,P,B){var V=this.trees[this._limitZoom(T)],$=Math.pow(2,T),re=this.options,ie=re.radius/re.extent,L=(B-ie)/$,H=(B+1+ie)/$,se={features:[]};return this._addTileFeatures(V.range((P-ie)/$,L,(P+1+ie)/$,H),V.points,P,B,$,se),P===0&&this._addTileFeatures(V.range(1-ie/$,L,1,H),V.points,$,B,$,se),P===$-1&&this._addTileFeatures(V.range(0,L,ie/$,H),V.points,-1,B,$,se),se.features.length?se:null},Or.prototype.getClusterExpansionZoom=function(T){for(var P=this._getOriginZoom(T)-1;P<=this.options.maxZoom;){var B=this.getChildren(T);if(P++,B.length!==1)break;T=B[0].properties.cluster_id}return P},Or.prototype._appendLeaves=function(T,P,B,V,$){for(var re=0,ie=this.getChildren(P);re<ie.length;re+=1){var L=ie[re],H=L.properties;if(H&&H.cluster?$+H.point_count<=V?$+=H.point_count:$=this._appendLeaves(T,H.cluster_id,B,V,$):$<V?$++:T.push(L),T.length===B)break}return $},Or.prototype._addTileFeatures=function(T,P,B,V,$,re){for(var ie=0,L=T;ie<L.length;ie+=1){var H=P[L[ie]],se=H.numPoints,Ie={type:1,geometry:[[Math.round(this.options.extent*(H.x*$-B)),Math.round(this.options.extent*(H.y*$-V))]],tags:se?ar(H):this.points[H.index].properties},Ee=void 0;se?Ee=H.id:this.options.generateId?Ee=H.index:this.points[H.index].id&&(Ee=this.points[H.index].id),Ee!==void 0&&(Ie.id=Ee),re.features.push(Ie)}},Or.prototype._limitZoom=function(T){return Math.max(this.options.minZoom,Math.min(+T,this.options.maxZoom+1))},Or.prototype._cluster=function(T,P){for(var B=[],V=this.options,$=V.reduce,re=V.minPoints,ie=V.radius/(V.extent*Math.pow(2,P)),L=0;L<T.length;L++){var H=T[L];if(!(H.zoom<=P)){H.zoom=P;for(var se=this.trees[P+1],Ie=se.within(H.x,H.y,ie),Ee=H.numPoints||1,ye=Ee,Ae=0,Je=Ie;Ae<Je.length;Ae+=1){var Ge=se.points[Je[Ae]];Ge.zoom>P&&(ye+=Ge.numPoints||1)}if(ye>=re){for(var ge=H.x*Ee,Ve=H.y*Ee,Be=$&&Ee>1?this._map(H,!0):null,Me=(L<<5)+(P+1)+this.points.length,yt=0,Fe=Ie;yt<Fe.length;yt+=1){var Pt=se.points[Fe[yt]];if(!(Pt.zoom<=P)){Pt.zoom=P;var rr=Pt.numPoints||1;ge+=Pt.x*rr,Ve+=Pt.y*rr,Pt.parentId=Me,$&&(Be||(Be=this._map(H,!0)),$(Be,this._map(Pt)))}}H.parentId=Me,B.push(Xi(ge/ye,Ve/ye,Me,ye,Be))}else if(B.push(H),ye>1)for(var Ct=0,Gt=Ie;Ct<Gt.length;Ct+=1){var Rt=se.points[Gt[Ct]];Rt.zoom<=P||(Rt.zoom=P,B.push(Rt))}}}return B},Or.prototype._getOriginId=function(T){return T-this.points.length>>5},Or.prototype._getOriginZoom=function(T){return(T-this.points.length)%32},Or.prototype._map=function(T,P){if(T.numPoints)return P?mr({},T.properties):T.properties;var B=this.points[T.index].properties,V=this.options.map(B);return P&&V===B?mr({},V):V},_t.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},_t.prototype.splitTile=function(T,P,B,V,$,re,ie){for(var L=[T,P,B,V],H=this.options,se=H.debug;L.length;){V=L.pop(),B=L.pop(),P=L.pop(),T=L.pop();var Ie=1<<P,Ee=fi(P,B,V),ye=this.tiles[Ee];if(!ye&&(se>1&&console.time("creation"),ye=this.tiles[Ee]=jt(T,P,B,V,H),this.tileCoords.push({z:P,x:B,y:V}),se)){se>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",P,B,V,ye.numFeatures,ye.numPoints,ye.numSimplified),console.timeEnd("creation"));var Ae="z"+P;this.stats[Ae]=(this.stats[Ae]||0)+1,this.total++}if(ye.source=T,$){if(P===H.maxZoom||P===$)continue;var Je=1<<$-P;if(B!==Math.floor(re/Je)||V!==Math.floor(ie/Je))continue}else if(P===H.indexMaxZoom||ye.numPoints<=H.indexMaxPoints)continue;if(ye.source=null,T.length!==0){se>1&&console.time("clipping");var Ge,ge,Ve,Be,Me,yt,Fe=.5*H.buffer/H.extent,Pt=.5-Fe,rr=.5+Fe,Ct=1+Fe;Ge=ge=Ve=Be=null,Me=Ki(T,Ie,B-Fe,B+rr,0,ye.minX,ye.maxX,H),yt=Ki(T,Ie,B+Pt,B+Ct,0,ye.minX,ye.maxX,H),T=null,Me&&(Ge=Ki(Me,Ie,V-Fe,V+rr,1,ye.minY,ye.maxY,H),ge=Ki(Me,Ie,V+Pt,V+Ct,1,ye.minY,ye.maxY,H),Me=null),yt&&(Ve=Ki(yt,Ie,V-Fe,V+rr,1,ye.minY,ye.maxY,H),Be=Ki(yt,Ie,V+Pt,V+Ct,1,ye.minY,ye.maxY,H),yt=null),se>1&&console.timeEnd("clipping"),L.push(Ge||[],P+1,2*B,2*V),L.push(ge||[],P+1,2*B,2*V+1),L.push(Ve||[],P+1,2*B+1,2*V),L.push(Be||[],P+1,2*B+1,2*V+1)}}},_t.prototype.getTile=function(T,P,B){var V=this.options,$=V.extent,re=V.debug;if(T<0||T>24)return null;var ie=1<<T,L=fi(T,P=(P%ie+ie)%ie,B);if(this.tiles[L])return de(this.tiles[L],$);re>1&&console.log("drilling down to z%d-%d-%d",T,P,B);for(var H,se=T,Ie=P,Ee=B;!H&&se>0;)se--,Ie=Math.floor(Ie/2),Ee=Math.floor(Ee/2),H=this.tiles[fi(se,Ie,Ee)];return H&&H.source?(re>1&&console.log("found parent tile z%d-%d-%d",se,Ie,Ee),re>1&&console.time("drilling down"),this.splitTile(H.source,se,Ie,Ee,T,P,B),re>1&&console.timeEnd("drilling down"),this.tiles[L]?de(this.tiles[L],$):null):null};var ii=(function(T){function P(B,V,$,re){T.call(this,B,V,$,qi),re&&(this.loadGeoJSON=re)}return T&&(P.__proto__=T),(P.prototype=Object.create(T&&T.prototype)).constructor=P,P.prototype.loadData=function(B,V){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=V,this._pendingLoadDataParams=B,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},P.prototype._loadData=function(){var B=this;if(this._pendingCallback&&this._pendingLoadDataParams){var V=this._pendingCallback,$=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var re=!!($&&$.request&&$.request.collectResourceTiming)&&new u.RequestPerformance($.request);this.loadGeoJSON($,(function(ie,L){if(ie||!L)return V(ie);if(typeof L!="object")return V(new Error("Input data given to '"+$.source+"' is not a valid GeoJSON object."));(function ye(Ae,Je){var Ge,ge=Ae&&Ae.type;if(ge==="FeatureCollection")for(Ge=0;Ge<Ae.features.length;Ge++)ye(Ae.features[Ge],Je);else if(ge==="GeometryCollection")for(Ge=0;Ge<Ae.geometries.length;Ge++)ye(Ae.geometries[Ge],Je);else if(ge==="Feature")ye(Ae.geometry,Je);else if(ge==="Polygon")He(Ae.coordinates,Je);else if(ge==="MultiPolygon")for(Ge=0;Ge<Ae.coordinates.length;Ge++)He(Ae.coordinates[Ge],Je);return Ae})(L,!0);try{if($.filter){var H=u.createExpression($.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(H.result==="error")throw new Error(H.value.map((function(ye){return ye.key+": "+ye.message})).join(", "));var se=L.features.filter((function(ye){return H.value.evaluate({zoom:0},ye)}));L={type:"FeatureCollection",features:se}}B._geoJSONIndex=$.cluster?new Or((function(ye){var Ae=ye.superclusterOptions,Je=ye.clusterProperties;if(!Je||!Ae)return Ae;for(var Ge={},ge={},Ve={accumulated:null,zoom:0},Be={properties:null},Me=Object.keys(Je),yt=0,Fe=Me;yt<Fe.length;yt+=1){var Pt=Fe[yt],rr=Je[Pt],Ct=rr[0],Gt=u.createExpression(rr[1]),Rt=u.createExpression(typeof Ct=="string"?[Ct,["accumulated"],["get",Pt]]:Ct);Ge[Pt]=Gt.value,ge[Pt]=Rt.value}return Ae.map=function(wi){Be.properties=wi;for(var Ht={},Cr=0,Qt=Me;Cr<Qt.length;Cr+=1){var zt=Qt[Cr];Ht[zt]=Ge[zt].evaluate(Ve,Be)}return Ht},Ae.reduce=function(wi,Ht){Be.properties=Ht;for(var Cr=0,Qt=Me;Cr<Qt.length;Cr+=1){var zt=Qt[Cr];Ve.accumulated=wi[zt],wi[zt]=ge[zt].evaluate(Ve,Be)}},Ae})($)).load(L.features):(function(ye,Ae){return new _t(ye,Ae)})(L,$.geojsonVtOptions)}catch(ye){return V(ye)}B.loaded={};var Ie={};if(re){var Ee=re.finish();Ee&&(Ie.resourceTiming={},Ie.resourceTiming[$.source]=JSON.parse(JSON.stringify(Ee)))}V(null,Ie)}))}},P.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},P.prototype.reloadTile=function(B,V){var $=this.loaded;return $&&$[B.uid]?T.prototype.reloadTile.call(this,B,V):this.loadTile(B,V)},P.prototype.loadGeoJSON=function(B,V){if(B.request)u.getJSON(B.request,V);else{if(typeof B.data!="string")return V(new Error("Input data given to '"+B.source+"' is not a valid GeoJSON object."));try{return V(null,JSON.parse(B.data))}catch{return V(new Error("Input data given to '"+B.source+"' is not a valid GeoJSON object."))}}},P.prototype.removeSource=function(B,V){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),V()},P.prototype.getClusterExpansionZoom=function(B,V){try{V(null,this._geoJSONIndex.getClusterExpansionZoom(B.clusterId))}catch($){V($)}},P.prototype.getClusterChildren=function(B,V){try{V(null,this._geoJSONIndex.getChildren(B.clusterId))}catch($){V($)}},P.prototype.getClusterLeaves=function(B,V){try{V(null,this._geoJSONIndex.getLeaves(B.clusterId,B.limit,B.offset))}catch($){V($)}},P})(be),Yt=function(T){var P=this;this.self=T,this.actor=new u.Actor(T,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:be,geojson:ii},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(B,V){if(P.workerSourceTypes[B])throw new Error('Worker source with name "'+B+'" already registered.');P.workerSourceTypes[B]=V},this.self.registerRTLTextPlugin=function(B){if(u.plugin.isParsed())throw new Error("RTL text plugin already registered.");u.plugin.applyArabicShaping=B.applyArabicShaping,u.plugin.processBidirectionalText=B.processBidirectionalText,u.plugin.processStyledBidirectionalText=B.processStyledBidirectionalText}};return Yt.prototype.setReferrer=function(T,P){this.referrer=P},Yt.prototype.setImages=function(T,P,B){for(var V in this.availableImages[T]=P,this.workerSources[T]){var $=this.workerSources[T][V];for(var re in $)$[re].availableImages=P}B()},Yt.prototype.setLayers=function(T,P,B){this.getLayerIndex(T).replace(P),B()},Yt.prototype.updateLayers=function(T,P,B){this.getLayerIndex(T).update(P.layers,P.removedIds),B()},Yt.prototype.loadTile=function(T,P,B){this.getWorkerSource(T,P.type,P.source).loadTile(P,B)},Yt.prototype.loadDEMTile=function(T,P,B){this.getDEMWorkerSource(T,P.source).loadTile(P,B)},Yt.prototype.reloadTile=function(T,P,B){this.getWorkerSource(T,P.type,P.source).reloadTile(P,B)},Yt.prototype.abortTile=function(T,P,B){this.getWorkerSource(T,P.type,P.source).abortTile(P,B)},Yt.prototype.removeTile=function(T,P,B){this.getWorkerSource(T,P.type,P.source).removeTile(P,B)},Yt.prototype.removeDEMTile=function(T,P){this.getDEMWorkerSource(T,P.source).removeTile(P)},Yt.prototype.removeSource=function(T,P,B){if(this.workerSources[T]&&this.workerSources[T][P.type]&&this.workerSources[T][P.type][P.source]){var V=this.workerSources[T][P.type][P.source];delete this.workerSources[T][P.type][P.source],V.removeSource!==void 0?V.removeSource(P,B):B()}},Yt.prototype.loadWorkerSource=function(T,P,B){try{this.self.importScripts(P.url),B()}catch(V){B(V.toString())}},Yt.prototype.syncRTLPluginState=function(T,P,B){try{u.plugin.setState(P);var V=u.plugin.getPluginURL();if(u.plugin.isLoaded()&&!u.plugin.isParsed()&&V!=null){this.self.importScripts(V);var $=u.plugin.isParsed();B($?void 0:new Error("RTL Text Plugin failed to import scripts from "+V),$)}}catch(re){B(re.toString())}},Yt.prototype.getAvailableImages=function(T){var P=this.availableImages[T];return P||(P=[]),P},Yt.prototype.getLayerIndex=function(T){var P=this.layerIndexes[T];return P||(P=this.layerIndexes[T]=new Y),P},Yt.prototype.getWorkerSource=function(T,P,B){var V=this;return this.workerSources[T]||(this.workerSources[T]={}),this.workerSources[T][P]||(this.workerSources[T][P]={}),this.workerSources[T][P][B]||(this.workerSources[T][P][B]=new this.workerSourceTypes[P]({send:function($,re,ie){V.actor.send($,re,ie,T)}},this.getLayerIndex(T),this.getAvailableImages(T))),this.workerSources[T][P][B]},Yt.prototype.getDEMWorkerSource=function(T,P){return this.demWorkerSources[T]||(this.demWorkerSources[T]={}),this.demWorkerSources[T][P]||(this.demWorkerSources[T][P]=new Ze),this.demWorkerSources[T][P]},Yt.prototype.enforceCacheSizeLimit=function(T,P){u.enforceCacheSizeLimit(P)},typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new Yt(self)),Yt})),D(["./shared"],(function(u){var U=u.createCommonjsModule((function(i){function o(p){return!n(p)}function n(p){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 d,v,w=new Blob([""],{type:"text/javascript"}),A=URL.createObjectURL(w);try{v=new Worker(A),d=!0}catch{d=!1}return v&&v.terminate(),URL.revokeObjectURL(A),d})()?"Uint8ClampedArray"in window?ArrayBuffer.isView?(function(){var d=document.createElement("canvas");d.width=d.height=1;var v=d.getContext("2d");if(!v)return!1;var w=v.getImageData(0,0,1,1);return w&&w.width===d.width})()?(s[f=p&&p.failIfMajorPerformanceCaveat]===void 0&&(s[f]=(function(d){var v=(function(A){var R=document.createElement("canvas"),F=Object.create(o.webGLContextAttributes);return F.failIfMajorPerformanceCaveat=A,R.probablySupportsContext?R.probablySupportsContext("webgl",F)||R.probablySupportsContext("experimental-webgl",F):R.supportsContext?R.supportsContext("webgl",F)||R.supportsContext("experimental-webgl",F):R.getContext("webgl",F)||R.getContext("experimental-webgl",F)})(d);if(!v)return!1;var w=v.createShader(v.VERTEX_SHADER);return!(!w||v.isContextLost())&&(v.shaderSource(w,"void main() {}"),v.compileShader(w),v.getShaderParameter(w,v.COMPILE_STATUS)===!0)})(f)),s[f]?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 f}i.exports?i.exports=o:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=o,window.mapboxgl.notSupportedReason=n);var s={};o.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),M={create:function(i,o,n){var s=u.window.document.createElement(i);return o!==void 0&&(s.className=o),n&&n.appendChild(s),s},createNS:function(i,o){return u.window.document.createElementNS(i,o)}},Y=u.window.document&&u.window.document.documentElement.style;function X(i){if(!Y)return i[0];for(var o=0;o<i.length;o++)if(i[o]in Y)return i[o];return i[0]}var ae,J=X(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);M.disableDrag=function(){Y&&J&&(ae=Y[J],Y[J]="none")},M.enableDrag=function(){Y&&J&&(Y[J]=ae)};var Se=X(["transform","WebkitTransform"]);M.setTransform=function(i,o){i.style[Se]=o};var be=!1;try{var De=Object.defineProperty({},"passive",{get:function(){be=!0}});u.window.addEventListener("test",De,De),u.window.removeEventListener("test",De,De)}catch{be=!1}M.addEventListener=function(i,o,n,s){s===void 0&&(s={}),i.addEventListener(o,n,"passive"in s&&be?s:s.capture)},M.removeEventListener=function(i,o,n,s){s===void 0&&(s={}),i.removeEventListener(o,n,"passive"in s&&be?s:s.capture)};var Ze=function(i){i.preventDefault(),i.stopPropagation(),u.window.removeEventListener("click",Ze,!0)};function He(i){var o=i.userImage;return!!(o&&o.render&&o.render())&&(i.data.replace(new Uint8Array(o.data.buffer)),!0)}M.suppressClick=function(){u.window.addEventListener("click",Ze,!0),u.window.setTimeout((function(){u.window.removeEventListener("click",Ze,!0)}),0)},M.mousePos=function(i,o){var n=i.getBoundingClientRect();return new u.Point(o.clientX-n.left-i.clientLeft,o.clientY-n.top-i.clientTop)},M.touchPos=function(i,o){for(var n=i.getBoundingClientRect(),s=[],p=0;p<o.length;p++)s.push(new u.Point(o[p].clientX-n.left-i.clientLeft,o[p].clientY-n.top-i.clientTop));return s},M.mouseButton=function(i){return u.window.InstallTrigger!==void 0&&i.button===2&&i.ctrlKey&&u.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:i.button},M.remove=function(i){i.parentNode&&i.parentNode.removeChild(i)};var Ue=(function(i){function o(){i.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new u.RGBAImage({width:1,height:1}),this.dirty=!0}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.isLoaded=function(){return this.loaded},o.prototype.setLoaded=function(n){if(this.loaded!==n&&(this.loaded=n,n)){for(var s=0,p=this.requestors;s<p.length;s+=1){var f=p[s];this._notify(f.ids,f.callback)}this.requestors=[]}},o.prototype.getImage=function(n){return this.images[n]},o.prototype.addImage=function(n,s){this._validate(n,s)&&(this.images[n]=s)},o.prototype._validate=function(n,s){var p=!0;return this._validateStretch(s.stretchX,s.data&&s.data.width)||(this.fire(new u.ErrorEvent(new Error('Image "'+n+'" has invalid "stretchX" value'))),p=!1),this._validateStretch(s.stretchY,s.data&&s.data.height)||(this.fire(new u.ErrorEvent(new Error('Image "'+n+'" has invalid "stretchY" value'))),p=!1),this._validateContent(s.content,s)||(this.fire(new u.ErrorEvent(new Error('Image "'+n+'" has invalid "content" value'))),p=!1),p},o.prototype._validateStretch=function(n,s){if(!n)return!0;for(var p=0,f=0,d=n;f<d.length;f+=1){var v=d[f];if(v[0]<p||v[1]<v[0]||s<v[1])return!1;p=v[1]}return!0},o.prototype._validateContent=function(n,s){return!(n&&(n.length!==4||n[0]<0||s.data.width<n[0]||n[1]<0||s.data.height<n[1]||n[2]<0||s.data.width<n[2]||n[3]<0||s.data.height<n[3]||n[2]<n[0]||n[3]<n[1]))},o.prototype.updateImage=function(n,s){s.version=this.images[n].version+1,this.images[n]=s,this.updatedImages[n]=!0},o.prototype.removeImage=function(n){var s=this.images[n];delete this.images[n],delete this.patterns[n],s.userImage&&s.userImage.onRemove&&s.userImage.onRemove()},o.prototype.listImages=function(){return Object.keys(this.images)},o.prototype.getImages=function(n,s){var p=!0;if(!this.isLoaded())for(var f=0,d=n;f<d.length;f+=1)this.images[d[f]]||(p=!1);this.isLoaded()||p?this._notify(n,s):this.requestors.push({ids:n,callback:s})},o.prototype._notify=function(n,s){for(var p={},f=0,d=n;f<d.length;f+=1){var v=d[f];this.images[v]||this.fire(new u.Event("styleimagemissing",{id:v}));var w=this.images[v];w?p[v]={data:w.data.clone(),pixelRatio:w.pixelRatio,sdf:w.sdf,version:w.version,stretchX:w.stretchX,stretchY:w.stretchY,content:w.content,hasRenderCallback:!!(w.userImage&&w.userImage.render)}:u.warnOnce('Image "'+v+'" 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.')}s(null,p)},o.prototype.getPixelSize=function(){var n=this.atlasImage;return{width:n.width,height:n.height}},o.prototype.getPattern=function(n){var s=this.patterns[n],p=this.getImage(n);if(!p)return null;if(s&&s.position.version===p.version)return s.position;if(s)s.position.version=p.version;else{var f={w:p.data.width+2,h:p.data.height+2,x:0,y:0},d=new u.ImagePosition(f,p);this.patterns[n]={bin:f,position:d}}return this._updatePatternAtlas(),this.patterns[n].position},o.prototype.bind=function(n){var s=n.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new u.Texture(n,this.atlasImage,s.RGBA),this.atlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE)},o.prototype._updatePatternAtlas=function(){var n=[];for(var s in this.patterns)n.push(this.patterns[s].bin);var p=u.potpack(n),f=p.w,d=p.h,v=this.atlasImage;for(var w in v.resize({width:f||1,height:d||1}),this.patterns){var A=this.patterns[w].bin,R=A.x+1,F=A.y+1,O=this.images[w].data,W=O.width,Z=O.height;u.RGBAImage.copy(O,v,{x:0,y:0},{x:R,y:F},{width:W,height:Z}),u.RGBAImage.copy(O,v,{x:0,y:Z-1},{x:R,y:F-1},{width:W,height:1}),u.RGBAImage.copy(O,v,{x:0,y:0},{x:R,y:F+Z},{width:W,height:1}),u.RGBAImage.copy(O,v,{x:W-1,y:0},{x:R-1,y:F},{width:1,height:Z}),u.RGBAImage.copy(O,v,{x:0,y:0},{x:R+W,y:F},{width:1,height:Z})}this.dirty=!0},o.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},o.prototype.dispatchRenderCallbacks=function(n){for(var s=0,p=n;s<p.length;s+=1){var f=p[s];if(!this.callbackDispatchedThisFrame[f]){this.callbackDispatchedThisFrame[f]=!0;var d=this.images[f];He(d)&&this.updateImage(f,d)}}},o})(u.Evented),fe=It,Ke=It,Ne=1e20;function It(i,o,n,s,p,f){this.fontSize=i||24,this.buffer=o===void 0?3:o,this.cutoff=s||.25,this.fontFamily=p||"sans-serif",this.fontWeight=f||"normal",this.radius=n||8;var d=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=d,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(d*d),this.gridInner=new Float64Array(d*d),this.f=new Float64Array(d),this.d=new Float64Array(d),this.z=new Float64Array(d+1),this.v=new Int16Array(d),this.middle=Math.round(d/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function we(i,o,n,s,p,f,d){for(var v=0;v<o;v++){for(var w=0;w<n;w++)s[w]=i[w*o+v];for(je(s,p,f,d,n),w=0;w<n;w++)i[w*o+v]=p[w]}for(w=0;w<n;w++){for(v=0;v<o;v++)s[v]=i[w*o+v];for(je(s,p,f,d,o),v=0;v<o;v++)i[w*o+v]=Math.sqrt(p[v])}}function je(i,o,n,s,p){n[0]=0,s[0]=-Ne,s[1]=+Ne;for(var f=1,d=0;f<p;f++){for(var v=(i[f]+f*f-(i[n[d]]+n[d]*n[d]))/(2*f-2*n[d]);v<=s[d];)d--,v=(i[f]+f*f-(i[n[d]]+n[d]*n[d]))/(2*f-2*n[d]);n[++d]=f,s[d]=v,s[d+1]=+Ne}for(f=0,d=0;f<p;f++){for(;s[d+1]<f;)d++;o[f]=(f-n[d])*(f-n[d])+i[n[d]]}}It.prototype.draw=function(i){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(i,this.buffer,this.middle);for(var o=this.ctx.getImageData(0,0,this.size,this.size),n=new Uint8ClampedArray(this.size*this.size),s=0;s<this.size*this.size;s++){var p=o.data[4*s+3]/255;this.gridOuter[s]=p===1?0:p===0?Ne:Math.pow(Math.max(0,.5-p),2),this.gridInner[s]=p===1?Ne:p===0?0:Math.pow(Math.max(0,p-.5),2)}for(we(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),we(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),s=0;s<this.size*this.size;s++)n[s]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[s]-this.gridInner[s])/this.radius+this.cutoff))));return n},fe.default=Ke;var Le=function(i,o){this.requestManager=i,this.localIdeographFontFamily=o,this.entries={}};Le.prototype.setURL=function(i){this.url=i},Le.prototype.getGlyphs=function(i,o){var n=this,s=[];for(var p in i)for(var f=0,d=i[p];f<d.length;f+=1)s.push({stack:p,id:d[f]});u.asyncAll(s,(function(v,w){var A=v.stack,R=v.id,F=n.entries[A];F||(F=n.entries[A]={glyphs:{},requests:{},ranges:{}});var O=F.glyphs[R];if(O===void 0){if(O=n._tinySDF(F,A,R))return F.glyphs[R]=O,void w(null,{stack:A,id:R,glyph:O});var W=Math.floor(R/256);if(256*W>65535)w(new Error("glyphs > 65535 not supported"));else if(F.ranges[W])w(null,{stack:A,id:R,glyph:O});else{var Z=F.requests[W];Z||(Z=F.requests[W]=[],Le.loadGlyphRange(A,W,n.url,n.requestManager,(function(ee,N){if(N){for(var Q in N)n._doesCharSupportLocalGlyph(+Q)||(F.glyphs[+Q]=N[+Q]);F.ranges[W]=!0}for(var ne=0,ue=Z;ne<ue.length;ne+=1)(0,ue[ne])(ee,N);delete F.requests[W]}))),Z.push((function(ee,N){ee?w(ee):N&&w(null,{stack:A,id:R,glyph:N[R]||null})}))}}else w(null,{stack:A,id:R,glyph:O})}),(function(v,w){if(v)o(v);else if(w){for(var A={},R=0,F=w;R<F.length;R+=1){var O=F[R],W=O.stack,Z=O.id,ee=O.glyph;(A[W]||(A[W]={}))[Z]=ee&&{id:ee.id,bitmap:ee.bitmap.clone(),metrics:ee.metrics}}o(null,A)}}))},Le.prototype._doesCharSupportLocalGlyph=function(i){return!!this.localIdeographFontFamily&&(u.isChar["CJK Unified Ideographs"](i)||u.isChar["Hangul Syllables"](i)||u.isChar.Hiragana(i)||u.isChar.Katakana(i))},Le.prototype._tinySDF=function(i,o,n){var s=this.localIdeographFontFamily;if(s&&this._doesCharSupportLocalGlyph(n)){var p=i.tinySDF;if(!p){var f="400";/bold/i.test(o)?f="900":/medium/i.test(o)?f="500":/light/i.test(o)&&(f="200"),p=i.tinySDF=new Le.TinySDF(24,3,8,.25,s,f)}return{id:n,bitmap:new u.AlphaImage({width:30,height:30},p.draw(String.fromCharCode(n))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},Le.loadGlyphRange=function(i,o,n,s,p){var f=256*o,d=f+255,v=s.transformRequest(s.normalizeGlyphsURL(n).replace("{fontstack}",i).replace("{range}",f+"-"+d),u.ResourceType.Glyphs);u.getArrayBuffer(v,(function(w,A){if(w)p(w);else if(A){for(var R={},F=0,O=u.parseGlyphPBF(A);F<O.length;F+=1){var W=O[F];R[W.id]=W}p(null,R)}}))},Le.TinySDF=fe;var tt=function(){this.specification=u.styleSpec.light.position};tt.prototype.possiblyEvaluate=function(i,o){return u.sphericalToCartesian(i.expression.evaluate(o))},tt.prototype.interpolate=function(i,o,n){return{x:u.number(i.x,o.x,n),y:u.number(i.y,o.y,n),z:u.number(i.z,o.z,n)}};var Mt=new u.Properties({anchor:new u.DataConstantProperty(u.styleSpec.light.anchor),position:new tt,color:new u.DataConstantProperty(u.styleSpec.light.color),intensity:new u.DataConstantProperty(u.styleSpec.light.intensity)}),Wt=(function(i){function o(n){i.call(this),this._transitionable=new u.Transitionable(Mt),this.setLight(n),this._transitioning=this._transitionable.untransitioned()}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getLight=function(){return this._transitionable.serialize()},o.prototype.setLight=function(n,s){if(s===void 0&&(s={}),!this._validate(u.validateLight,n,s))for(var p in n){var f=n[p];u.endsWith(p,"-transition")?this._transitionable.setTransition(p.slice(0,-11),f):this._transitionable.setValue(p,f)}},o.prototype.updateTransitions=function(n){this._transitioning=this._transitionable.transitioned(n,this._transitioning)},o.prototype.hasTransition=function(){return this._transitioning.hasTransition()},o.prototype.recalculate=function(n){this.properties=this._transitioning.possiblyEvaluate(n)},o.prototype._validate=function(n,s,p){return(!p||p.validate!==!1)&&u.emitValidationErrors(this,n.call(u.validateStyle,u.extend({value:s,style:{glyphs:!0,sprite:!0},styleSpec:u.styleSpec})))},o})(u.Evented),St=function(i,o){this.width=i,this.height=o,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};St.prototype.getDash=function(i,o){var n=i.join(",")+String(o);return this.dashEntry[n]||(this.dashEntry[n]=this.addDash(i,o)),this.dashEntry[n]},St.prototype.getDashRanges=function(i,o,n){var s=[],p=i.length%2==1?-i[i.length-1]*n:0,f=i[0]*n,d=!0;s.push({left:p,right:f,isDash:d,zeroLength:i[0]===0});for(var v=i[0],w=1;w<i.length;w++){var A=i[w];s.push({left:p=v*n,right:f=(v+=A)*n,isDash:d=!d,zeroLength:A===0})}return s},St.prototype.addRoundDash=function(i,o,n){for(var s=o/2,p=-n;p<=n;p++)for(var f=this.width*(this.nextRow+n+p),d=0,v=i[d],w=0;w<this.width;w++){w/v.right>1&&(v=i[++d]);var A=Math.abs(w-v.left),R=Math.abs(w-v.right),F=Math.min(A,R),O=void 0,W=p/n*(s+1);if(v.isDash){var Z=s-Math.abs(W);O=Math.sqrt(F*F+Z*Z)}else O=s-Math.sqrt(F*F+W*W);this.data[f+w]=Math.max(0,Math.min(255,O+128))}},St.prototype.addRegularDash=function(i){for(var o=i.length-1;o>=0;--o){var n=i[o],s=i[o+1];n.zeroLength?i.splice(o,1):s&&s.isDash===n.isDash&&(s.left=n.left,i.splice(o,1))}var p=i[0],f=i[i.length-1];p.isDash===f.isDash&&(p.left=f.left-this.width,f.right=p.right+this.width);for(var d=this.width*this.nextRow,v=0,w=i[v],A=0;A<this.width;A++){A/w.right>1&&(w=i[++v]);var R=Math.abs(A-w.left),F=Math.abs(A-w.right),O=Math.min(R,F);this.data[d+A]=Math.max(0,Math.min(255,(w.isDash?O:-O)+128))}},St.prototype.addDash=function(i,o){var n=o?7:0,s=2*n+1;if(this.nextRow+s>this.height)return u.warnOnce("LineAtlas out of space"),null;for(var p=0,f=0;f<i.length;f++)p+=i[f];if(p!==0){var d=this.width/p,v=this.getDashRanges(i,this.width,d);o?this.addRoundDash(v,d,n):this.addRegularDash(v)}var w={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:p};return this.nextRow+=s,this.dirty=!0,w},St.prototype.bind=function(i){var o=i.gl;this.texture?(o.bindTexture(o.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,o.texSubImage2D(o.TEXTURE_2D,0,0,0,this.width,this.height,o.ALPHA,o.UNSIGNED_BYTE,this.data))):(this.texture=o.createTexture(),o.bindTexture(o.TEXTURE_2D,this.texture),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.REPEAT),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.REPEAT),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texImage2D(o.TEXTURE_2D,0,o.ALPHA,this.width,this.height,0,o.ALPHA,o.UNSIGNED_BYTE,this.data))};var Ut=function i(o,n){this.workerPool=o,this.actors=[],this.currentActor=0,this.id=u.uniqueId();for(var s=this.workerPool.acquire(this.id),p=0;p<s.length;p++){var f=new i.Actor(s[p],n,this.id);f.name="Worker "+p,this.actors.push(f)}};function Hr(i,o,n){var s=function(p,f){if(p)return n(p);if(f){var d=u.pick(u.extend(f,i),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);f.vector_layers&&(d.vectorLayers=f.vector_layers,d.vectorLayerIds=d.vectorLayers.map((function(v){return v.id}))),d.tiles=o.canonicalizeTileset(d,i.url),n(null,d)}};return i.url?u.getJSON(o.transformRequest(o.normalizeSourceURL(i.url),u.ResourceType.Source),s):u.browser.frame((function(){return s(null,i)}))}Ut.prototype.broadcast=function(i,o,n){u.asyncAll(this.actors,(function(s,p){s.send(i,o,p)}),n=n||function(){})},Ut.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},Ut.prototype.remove=function(){this.actors.forEach((function(i){i.remove()})),this.actors=[],this.workerPool.release(this.id)},Ut.Actor=u.Actor;var Pr=function(i,o,n){this.bounds=u.LngLatBounds.convert(this.validateBounds(i)),this.minzoom=o||0,this.maxzoom=n||24};Pr.prototype.validateBounds=function(i){return Array.isArray(i)&&i.length===4?[Math.max(-180,i[0]),Math.max(-90,i[1]),Math.min(180,i[2]),Math.min(90,i[3])]:[-180,-90,180,90]},Pr.prototype.contains=function(i){var o=Math.pow(2,i.z),n=Math.floor(u.mercatorXfromLng(this.bounds.getWest())*o),s=Math.floor(u.mercatorYfromLat(this.bounds.getNorth())*o),p=Math.ceil(u.mercatorXfromLng(this.bounds.getEast())*o),f=Math.ceil(u.mercatorYfromLat(this.bounds.getSouth())*o);return i.x>=n&&i.x<p&&i.y>=s&&i.y<f};var bi=(function(i){function o(n,s,p,f){if(i.call(this),this.id=n,this.dispatcher=p,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,u.extend(this,u.pick(s,["url","scheme","tileSize","promoteId"])),this._options=u.extend({type:"vector"},s),this._collectResourceTiming=s.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(f)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1,this.fire(new u.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Hr(this._options,this.map._requestManager,(function(s,p){n._tileJSONRequest=null,n._loaded=!0,s?n.fire(new u.ErrorEvent(s)):p&&(u.extend(n,p),p.bounds&&(n.tileBounds=new Pr(p.bounds,n.minzoom,n.maxzoom)),u.postTurnstileEvent(p.tiles,n.map._requestManager._customAccessToken),u.postMapLoadEvent(p.tiles,n.map._getMapId(),n.map._requestManager._skuToken,n.map._requestManager._customAccessToken),n.fire(new u.Event("data",{dataType:"source",sourceDataType:"metadata"})),n.fire(new u.Event("data",{dataType:"source",sourceDataType:"content"})))}))},o.prototype.loaded=function(){return this._loaded},o.prototype.hasTile=function(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setSourceProperty=function(n){this._tileJSONRequest&&this._tileJSONRequest.cancel(),n(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},o.prototype.setTiles=function(n){var s=this;return this.setSourceProperty((function(){s._options.tiles=n})),this},o.prototype.setUrl=function(n){var s=this;return this.setSourceProperty((function(){s.url=n,s._options.url=n})),this},o.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},o.prototype.serialize=function(){return u.extend({},this._options)},o.prototype.loadTile=function(n,s){var p=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme)),f={request:this.map._requestManager.transformRequest(p,u.ResourceType.Tile),uid:n.uid,tileID:n.tileID,zoom:n.tileID.overscaledZ,tileSize:this.tileSize*n.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:u.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function d(v,w){return delete n.request,n.aborted?s(null):v&&v.status!==404?s(v):(w&&w.resourceTiming&&(n.resourceTiming=w.resourceTiming),this.map._refreshExpiredTiles&&w&&n.setExpiryData(w),n.loadVectorData(w,this.map.painter),u.cacheEntryPossiblyAdded(this.dispatcher),s(null),void(n.reloadCallback&&(this.loadTile(n,n.reloadCallback),n.reloadCallback=null)))}f.request.collectResourceTiming=this._collectResourceTiming,n.actor&&n.state!=="expired"?n.state==="loading"?n.reloadCallback=s:n.request=n.actor.send("reloadTile",f,d.bind(this)):(n.actor=this.dispatcher.getActor(),n.request=n.actor.send("loadTile",f,d.bind(this)))},o.prototype.abortTile=function(n){n.request&&(n.request.cancel(),delete n.request),n.actor&&n.actor.send("abortTile",{uid:n.uid,type:this.type,source:this.id},void 0)},o.prototype.unloadTile=function(n){n.unloadVectorData(),n.actor&&n.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id},void 0)},o.prototype.hasTransition=function(){return!1},o})(u.Evented),or=(function(i){function o(n,s,p,f){i.call(this),this.id=n,this.dispatcher=p,this.setEventedParent(f),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=u.extend({type:"raster"},s),u.extend(this,u.pick(s,["url","scheme","tileSize"]))}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1,this.fire(new u.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Hr(this._options,this.map._requestManager,(function(s,p){n._tileJSONRequest=null,n._loaded=!0,s?n.fire(new u.ErrorEvent(s)):p&&(u.extend(n,p),p.bounds&&(n.tileBounds=new Pr(p.bounds,n.minzoom,n.maxzoom)),u.postTurnstileEvent(p.tiles),u.postMapLoadEvent(p.tiles,n.map._getMapId(),n.map._requestManager._skuToken),n.fire(new u.Event("data",{dataType:"source",sourceDataType:"metadata"})),n.fire(new u.Event("data",{dataType:"source",sourceDataType:"content"})))}))},o.prototype.loaded=function(){return this._loaded},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},o.prototype.serialize=function(){return u.extend({},this._options)},o.prototype.hasTile=function(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)},o.prototype.loadTile=function(n,s){var p=this,f=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);n.request=u.getImage(this.map._requestManager.transformRequest(f,u.ResourceType.Tile),(function(d,v){if(delete n.request,n.aborted)n.state="unloaded",s(null);else if(d)n.state="errored",s(d);else if(v){p.map._refreshExpiredTiles&&n.setExpiryData(v),delete v.cacheControl,delete v.expires;var w=p.map.painter.context,A=w.gl;n.texture=p.map.painter.getTileTexture(v.width),n.texture?n.texture.update(v,{useMipmap:!0}):(n.texture=new u.Texture(w,v,A.RGBA,{useMipmap:!0}),n.texture.bind(A.LINEAR,A.CLAMP_TO_EDGE,A.LINEAR_MIPMAP_NEAREST),w.extTextureFilterAnisotropic&&A.texParameterf(A.TEXTURE_2D,w.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,w.extTextureFilterAnisotropicMax)),n.state="loaded",u.cacheEntryPossiblyAdded(p.dispatcher),s(null)}}))},o.prototype.abortTile=function(n,s){n.request&&(n.request.cancel(),delete n.request),s()},o.prototype.unloadTile=function(n,s){n.texture&&this.map.painter.saveTileTexture(n.texture),s()},o.prototype.hasTransition=function(){return!1},o})(u.Evented),Rr=(function(i){function o(n,s,p,f){i.call(this,n,s,p,f),this.type="raster-dem",this.maxzoom=22,this._options=u.extend({type:"raster-dem"},s),this.encoding=s.encoding||"mapbox"}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},o.prototype.loadTile=function(n,s){var p=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function f(d,v){d&&(n.state="errored",s(d)),v&&(n.dem=v,n.needsHillshadePrepare=!0,n.state="loaded",s(null))}n.request=u.getImage(this.map._requestManager.transformRequest(p,u.ResourceType.Tile),(function(d,v){if(delete n.request,n.aborted)n.state="unloaded",s(null);else if(d)n.state="errored",s(d);else if(v){this.map._refreshExpiredTiles&&n.setExpiryData(v),delete v.cacheControl,delete v.expires;var w=u.window.ImageBitmap&&v instanceof u.window.ImageBitmap&&u.offscreenCanvasSupported()?v:u.browser.getImageData(v,1),A={uid:n.uid,coord:n.tileID,source:this.id,rawImageData:w,encoding:this.encoding};n.actor&&n.state!=="expired"||(n.actor=this.dispatcher.getActor(),n.actor.send("loadDEMTile",A,f.bind(this)))}}).bind(this)),n.neighboringTiles=this._getNeighboringTiles(n.tileID)},o.prototype._getNeighboringTiles=function(n){var s=n.canonical,p=Math.pow(2,s.z),f=(s.x-1+p)%p,d=s.x===0?n.wrap-1:n.wrap,v=(s.x+1+p)%p,w=s.x+1===p?n.wrap+1:n.wrap,A={};return A[new u.OverscaledTileID(n.overscaledZ,d,s.z,f,s.y).key]={backfilled:!1},A[new u.OverscaledTileID(n.overscaledZ,w,s.z,v,s.y).key]={backfilled:!1},s.y>0&&(A[new u.OverscaledTileID(n.overscaledZ,d,s.z,f,s.y-1).key]={backfilled:!1},A[new u.OverscaledTileID(n.overscaledZ,n.wrap,s.z,s.x,s.y-1).key]={backfilled:!1},A[new u.OverscaledTileID(n.overscaledZ,w,s.z,v,s.y-1).key]={backfilled:!1}),s.y+1<p&&(A[new u.OverscaledTileID(n.overscaledZ,d,s.z,f,s.y+1).key]={backfilled:!1},A[new u.OverscaledTileID(n.overscaledZ,n.wrap,s.z,s.x,s.y+1).key]={backfilled:!1},A[new u.OverscaledTileID(n.overscaledZ,w,s.z,v,s.y+1).key]={backfilled:!1}),A},o.prototype.unloadTile=function(n){n.demTexture&&this.map.painter.saveTileTexture(n.demTexture),n.fbo&&(n.fbo.destroy(),delete n.fbo),n.dem&&delete n.dem,delete n.neighboringTiles,n.state="unloaded",n.actor&&n.actor.send("removeDEMTile",{uid:n.uid,source:this.id})},o})(or),et=(function(i){function o(n,s,p,f){i.call(this),this.id=n,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=p.getActor(),this.setEventedParent(f),this._data=s.data,this._options=u.extend({},s),this._collectResourceTiming=s.collectResourceTiming,this._resourceTiming=[],s.maxzoom!==void 0&&(this.maxzoom=s.maxzoom),s.type&&(this.type=s.type),s.attribution&&(this.attribution=s.attribution),this.promoteId=s.promoteId;var d=u.EXTENT/this.tileSize;this.workerOptions=u.extend({source:this.id,cluster:s.cluster||!1,geojsonVtOptions:{buffer:(s.buffer!==void 0?s.buffer:128)*d,tolerance:(s.tolerance!==void 0?s.tolerance:.375)*d,extent:u.EXTENT,maxZoom:this.maxzoom,lineMetrics:s.lineMetrics||!1,generateId:s.generateId||!1},superclusterOptions:{maxZoom:s.clusterMaxZoom!==void 0?Math.min(s.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,s.clusterMinPoints||2),extent:u.EXTENT,radius:(s.clusterRadius||50)*d,log:!1,generateId:s.generateId||!1},clusterProperties:s.clusterProperties,filter:s.filter},s.workerOptions)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this.fire(new u.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(s){if(s)n.fire(new u.ErrorEvent(s));else{var p={dataType:"source",sourceDataType:"metadata"};n._collectResourceTiming&&n._resourceTiming&&n._resourceTiming.length>0&&(p.resourceTiming=n._resourceTiming,n._resourceTiming=[]),n.fire(new u.Event("data",p))}}))},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setData=function(n){var s=this;return this._data=n,this.fire(new u.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(p){if(p)s.fire(new u.ErrorEvent(p));else{var f={dataType:"source",sourceDataType:"content"};s._collectResourceTiming&&s._resourceTiming&&s._resourceTiming.length>0&&(f.resourceTiming=s._resourceTiming,s._resourceTiming=[]),s.fire(new u.Event("data",f))}})),this},o.prototype.getClusterExpansionZoom=function(n,s){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:n,source:this.id},s),this},o.prototype.getClusterChildren=function(n,s){return this.actor.send("geojson.getClusterChildren",{clusterId:n,source:this.id},s),this},o.prototype.getClusterLeaves=function(n,s,p,f){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:n,limit:s,offset:p},f),this},o.prototype._updateWorkerData=function(n){var s=this;this._loaded=!1;var p=u.extend({},this.workerOptions),f=this._data;typeof f=="string"?(p.request=this.map._requestManager.transformRequest(u.browser.resolveURL(f),u.ResourceType.Source),p.request.collectResourceTiming=this._collectResourceTiming):p.data=JSON.stringify(f),this.actor.send(this.type+".loadData",p,(function(d,v){s._removed||v&&v.abandoned||(s._loaded=!0,v&&v.resourceTiming&&v.resourceTiming[s.id]&&(s._resourceTiming=v.resourceTiming[s.id].slice(0)),s.actor.send(s.type+".coalesce",{source:p.source},null),n(d))}))},o.prototype.loaded=function(){return this._loaded},o.prototype.loadTile=function(n,s){var p=this,f=n.actor?"reloadTile":"loadTile";n.actor=this.actor,n.request=this.actor.send(f,{type:this.type,uid:n.uid,tileID:n.tileID,zoom:n.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:u.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(d,v){return delete n.request,n.unloadVectorData(),n.aborted?s(null):d?s(d):(n.loadVectorData(v,p.map.painter,f==="reloadTile"),s(null))}))},o.prototype.abortTile=function(n){n.request&&(n.request.cancel(),delete n.request),n.aborted=!0},o.prototype.unloadTile=function(n){n.unloadVectorData(),this.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id})},o.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},o.prototype.serialize=function(){return u.extend({},this._options,{type:this.type,data:this._data})},o.prototype.hasTransition=function(){return!1},o})(u.Evented),Lr=u.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),Xr=(function(i){function o(n,s,p,f){i.call(this),this.id=n,this.dispatcher=p,this.coordinates=s.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(f),this.options=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(n,s){var p=this;this._loaded=!1,this.fire(new u.Event("dataloading",{dataType:"source"})),this.url=this.options.url,u.getImage(this.map._requestManager.transformRequest(this.url,u.ResourceType.Image),(function(f,d){p._loaded=!0,f?p.fire(new u.ErrorEvent(f)):d&&(p.image=d,n&&(p.coordinates=n),s&&s(),p._finishLoading())}))},o.prototype.loaded=function(){return this._loaded},o.prototype.updateImage=function(n){var s=this;return this.image&&n.url?(this.options.url=n.url,this.load(n.coordinates,(function(){s.texture=null})),this):this},o.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new u.Event("data",{dataType:"source",sourceDataType:"metadata"})))},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setCoordinates=function(n){var s=this;this.coordinates=n;var p=n.map(u.MercatorCoordinate.fromLngLat);this.tileID=(function(d){for(var v=1/0,w=1/0,A=-1/0,R=-1/0,F=0,O=d;F<O.length;F+=1){var W=O[F];v=Math.min(v,W.x),w=Math.min(w,W.y),A=Math.max(A,W.x),R=Math.max(R,W.y)}var Z=Math.max(A-v,R-w),ee=Math.max(0,Math.floor(-Math.log(Z)/Math.LN2)),N=Math.pow(2,ee);return new u.CanonicalTileID(ee,Math.floor((v+A)/2*N),Math.floor((w+R)/2*N))})(p),this.minzoom=this.maxzoom=this.tileID.z;var f=p.map((function(d){return s.tileID.getTilePoint(d)._round()}));return this._boundsArray=new u.StructArrayLayout4i8,this._boundsArray.emplaceBack(f[0].x,f[0].y,0,0),this._boundsArray.emplaceBack(f[1].x,f[1].y,u.EXTENT,0),this._boundsArray.emplaceBack(f[3].x,f[3].y,0,u.EXTENT),this._boundsArray.emplaceBack(f[2].x,f[2].y,u.EXTENT,u.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new u.Event("data",{dataType:"source",sourceDataType:"content"})),this},o.prototype.prepare=function(){if(Object.keys(this.tiles).length!==0&&this.image){var n=this.map.painter.context,s=n.gl;for(var p in this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,Lr.members)),this.boundsSegments||(this.boundsSegments=u.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new u.Texture(n,this.image,s.RGBA),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE)),this.tiles){var f=this.tiles[p];f.state!=="loaded"&&(f.state="loaded",f.texture=this.texture)}}},o.prototype.loadTile=function(n,s){this.tileID&&this.tileID.equals(n.tileID.canonical)?(this.tiles[String(n.tileID.wrap)]=n,n.buckets={},s(null)):(n.state="errored",s(null))},o.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},o.prototype.hasTransition=function(){return!1},o})(u.Evented),Et=(function(i){function o(n,s,p,f){i.call(this,n,s,p,f),this.roundZoom=!0,this.type="video",this.options=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1;var s=this.options;this.urls=[];for(var p=0,f=s.urls;p<f.length;p+=1)this.urls.push(this.map._requestManager.transformRequest(f[p],u.ResourceType.Source).url);u.getVideo(this.urls,(function(d,v){n._loaded=!0,d?n.fire(new u.ErrorEvent(d)):v&&(n.video=v,n.video.loop=!0,n.video.setAttribute("playsinline",""),n.video.addEventListener("playing",(function(){n.map.triggerRepaint()})),n.map&&n.video.play(),n._finishLoading())}))},o.prototype.pause=function(){this.video&&this.video.pause()},o.prototype.play=function(){this.video&&this.video.play()},o.prototype.seek=function(n){if(this.video){var s=this.video.seekable;n<s.start(0)||n>s.end(0)?this.fire(new u.ErrorEvent(new u.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+s.start(0)+" and "+s.end(0)+"-second mark."))):this.video.currentTime=n}},o.prototype.getVideo=function(){return this.video},o.prototype.onAdd=function(n){this.map||(this.map=n,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},o.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var n=this.map.painter.context,s=n.gl;for(var p in this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,Lr.members)),this.boundsSegments||(this.boundsSegments=u.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE),s.texSubImage2D(s.TEXTURE_2D,0,0,0,s.RGBA,s.UNSIGNED_BYTE,this.video)):(this.texture=new u.Texture(n,this.video,s.RGBA),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE)),this.tiles){var f=this.tiles[p];f.state!=="loaded"&&(f.state="loaded",f.texture=this.texture)}}},o.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},o.prototype.hasTransition=function(){return this.video&&!this.video.paused},o})(Xr),Fr=(function(i){function o(n,s,p,f){i.call(this,n,s,p,f),s.coordinates?Array.isArray(s.coordinates)&&s.coordinates.length===4&&!s.coordinates.some((function(d){return!Array.isArray(d)||d.length!==2||d.some((function(v){return typeof v!="number"}))}))||this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,null,'missing required property "coordinates"'))),s.animate&&typeof s.animate!="boolean"&&this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,null,'optional "animate" property must be a boolean value'))),s.canvas?typeof s.canvas=="string"||s.canvas instanceof u.window.HTMLCanvasElement||this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,null,'missing required property "canvas"'))),this.options=s,this.animate=s.animate===void 0||s.animate}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof u.window.HTMLCanvasElement?this.options.canvas:u.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new u.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())},o.prototype.getCanvas=function(){return this.canvas},o.prototype.onAdd=function(n){this.map=n,this.load(),this.canvas&&this.animate&&this.play()},o.prototype.onRemove=function(){this.pause()},o.prototype.prepare=function(){var n=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,n=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,n=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var s=this.map.painter.context,p=s.gl;for(var f in this.boundsBuffer||(this.boundsBuffer=s.createVertexBuffer(this._boundsArray,Lr.members)),this.boundsSegments||(this.boundsSegments=u.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(n||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new u.Texture(s,this.canvas,p.RGBA,{premultiply:!0}),this.tiles){var d=this.tiles[f];d.state!=="loaded"&&(d.state="loaded",d.texture=this.texture)}}},o.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},o.prototype.hasTransition=function(){return this._playing},o.prototype._hasInvalidDimensions=function(){for(var n=0,s=[this.canvas.width,this.canvas.height];n<s.length;n+=1){var p=s[n];if(isNaN(p)||p<=0)return!0}return!1},o})(Xr),Mi={vector:bi,raster:or,"raster-dem":Rr,geojson:et,video:Et,image:Xr,canvas:Fr};function pi(i,o){var n=u.identity([]);return u.translate(n,n,[1,1,0]),u.scale(n,n,[.5*i.width,.5*i.height,1]),u.multiply(n,n,i.calculatePosMatrix(o.toUnwrapped()))}function Or(i,o,n,s,p,f){var d=(function(ee,N,Q){if(ee)for(var ne=0,ue=ee;ne<ue.length;ne+=1){var me=N[ue[ne]];if(me&&me.source===Q&&me.type==="fill-extrusion")return!0}else for(var pe in N){var ve=N[pe];if(ve.source===Q&&ve.type==="fill-extrusion")return!0}return!1})(p&&p.layers,o,i.id),v=f.maxPitchScaleFactor(),w=i.tilesIn(s,v,d);w.sort(Xi);for(var A=[],R=0,F=w;R<F.length;R+=1){var O=F[R];A.push({wrappedTileID:O.tileID.wrapped().key,queryResults:O.tile.queryRenderedFeatures(o,n,i._state,O.queryGeometry,O.cameraQueryGeometry,O.scale,p,f,v,pi(i.transform,O.tileID))})}var W=(function(ee){for(var N={},Q={},ne=0,ue=ee;ne<ue.length;ne+=1){var me=ue[ne],pe=me.queryResults,ve=me.wrappedTileID,Te=Q[ve]=Q[ve]||{};for(var ke in pe)for(var Ce=pe[ke],$e=Te[ke]=Te[ke]||{},nt=N[ke]=N[ke]||[],ut=0,st=Ce;ut<st.length;ut+=1){var Ft=st[ut];$e[Ft.featureIndex]||($e[Ft.featureIndex]=!0,nt.push(Ft))}}return N})(A);for(var Z in W)W[Z].forEach((function(ee){var N=ee.feature,Q=i.getFeatureState(N.layer["source-layer"],N.id);N.source=N.layer.source,N.layer["source-layer"]&&(N.sourceLayer=N.layer["source-layer"]),N.state=Q}));return W}function Xi(i,o){var n=i.tileID,s=o.tileID;return n.overscaledZ-s.overscaledZ||n.canonical.y-s.canonical.y||n.wrap-s.wrap||n.canonical.x-s.canonical.x}var Nt=function(i,o){this.max=i,this.onRemove=o,this.reset()};Nt.prototype.reset=function(){for(var i in this.data)for(var o=0,n=this.data[i];o<n.length;o+=1){var s=n[o];s.timeout&&clearTimeout(s.timeout),this.onRemove(s.value)}return this.data={},this.order=[],this},Nt.prototype.add=function(i,o,n){var s=this,p=i.wrapped().key;this.data[p]===void 0&&(this.data[p]=[]);var f={value:o,timeout:void 0};if(n!==void 0&&(f.timeout=setTimeout((function(){s.remove(i,f)}),n)),this.data[p].push(f),this.order.push(p),this.order.length>this.max){var d=this._getAndRemoveByKey(this.order[0]);d&&this.onRemove(d)}return this},Nt.prototype.has=function(i){return i.wrapped().key in this.data},Nt.prototype.getAndRemove=function(i){return this.has(i)?this._getAndRemoveByKey(i.wrapped().key):null},Nt.prototype._getAndRemoveByKey=function(i){var o=this.data[i].shift();return o.timeout&&clearTimeout(o.timeout),this.data[i].length===0&&delete this.data[i],this.order.splice(this.order.indexOf(i),1),o.value},Nt.prototype.getByKey=function(i){var o=this.data[i];return o?o[0].value:null},Nt.prototype.get=function(i){return this.has(i)?this.data[i.wrapped().key][0].value:null},Nt.prototype.remove=function(i,o){if(!this.has(i))return this;var n=i.wrapped().key,s=o===void 0?0:this.data[n].indexOf(o),p=this.data[n][s];return this.data[n].splice(s,1),p.timeout&&clearTimeout(p.timeout),this.data[n].length===0&&delete this.data[n],this.onRemove(p.value),this.order.splice(this.order.indexOf(n),1),this},Nt.prototype.setMaxSize=function(i){for(this.max=i;this.order.length>this.max;){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},Nt.prototype.filter=function(i){var o=[];for(var n in this.data)for(var s=0,p=this.data[n];s<p.length;s+=1){var f=p[s];i(f.value)||o.push(f)}for(var d=0,v=o;d<v.length;d+=1){var w=v[d];this.remove(w.value.tileID,w)}};var Nr=function(i,o,n){this.context=i;var s=i.gl;this.buffer=s.createBuffer(),this.dynamicDraw=!!n,this.context.unbindVAO(),i.bindElementBuffer.set(this.buffer),s.bufferData(s.ELEMENT_ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?s.DYNAMIC_DRAW:s.STATIC_DRAW),this.dynamicDraw||delete o.arrayBuffer};Nr.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Nr.prototype.updateData=function(i){var o=this.context.gl;this.context.unbindVAO(),this.bind(),o.bufferSubData(o.ELEMENT_ARRAY_BUFFER,0,i.arrayBuffer)},Nr.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var ar={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},sr=function(i,o,n,s){this.length=o.length,this.attributes=n,this.itemSize=o.bytesPerElement,this.dynamicDraw=s,this.context=i;var p=i.gl;this.buffer=p.createBuffer(),i.bindVertexBuffer.set(this.buffer),p.bufferData(p.ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?p.DYNAMIC_DRAW:p.STATIC_DRAW),this.dynamicDraw||delete o.arrayBuffer};sr.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},sr.prototype.updateData=function(i){var o=this.context.gl;this.bind(),o.bufferSubData(o.ARRAY_BUFFER,0,i.arrayBuffer)},sr.prototype.enableAttributes=function(i,o){for(var n=0;n<this.attributes.length;n++){var s=o.attributes[this.attributes[n].name];s!==void 0&&i.enableVertexAttribArray(s)}},sr.prototype.setVertexAttribPointers=function(i,o,n){for(var s=0;s<this.attributes.length;s++){var p=this.attributes[s],f=o.attributes[p.name];f!==void 0&&i.vertexAttribPointer(f,p.components,i[ar[p.type]],!1,this.itemSize,p.offset+this.itemSize*(n||0))}},sr.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var lt=function(i){this.gl=i.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};lt.prototype.get=function(){return this.current},lt.prototype.set=function(i){},lt.prototype.getDefault=function(){return this.default},lt.prototype.setDefault=function(){this.set(this.default)};var mr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return u.Color.transparent},o.prototype.set=function(n){var s=this.current;(n.r!==s.r||n.g!==s.g||n.b!==s.b||n.a!==s.a||this.dirty)&&(this.gl.clearColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)},o})(lt),hr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 1},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.clearDepth(n),this.current=n,this.dirty=!1)},o})(lt),jr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.clearStencil(n),this.current=n,this.dirty=!1)},o})(lt),fr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return[!0,!0,!0,!0]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||n[3]!==s[3]||this.dirty)&&(this.gl.colorMask(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)},o})(lt),br=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.depthMask(n),this.current=n,this.dirty=!1)},o})(lt),dn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 255},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.stencilMask(n),this.current=n,this.dirty=!1)},o})(lt),Kr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},o.prototype.set=function(n){var s=this.current;(n.func!==s.func||n.ref!==s.ref||n.mask!==s.mask||this.dirty)&&(this.gl.stencilFunc(n.func,n.ref,n.mask),this.current=n,this.dirty=!1)},o})(lt),Bi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[n.KEEP,n.KEEP,n.KEEP]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||this.dirty)&&(this.gl.stencilOp(n[0],n[1],n[2]),this.current=n,this.dirty=!1)},o})(lt),hi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.STENCIL_TEST):s.disable(s.STENCIL_TEST),this.current=n,this.dirty=!1}},o})(lt),ti=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return[0,1]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||this.dirty)&&(this.gl.depthRange(n[0],n[1]),this.current=n,this.dirty=!1)},o})(lt),ri=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.DEPTH_TEST):s.disable(s.DEPTH_TEST),this.current=n,this.dirty=!1}},o})(lt),Vi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.LESS},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.depthFunc(n),this.current=n,this.dirty=!1)},o})(lt),Ki=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.BLEND):s.disable(s.BLEND),this.current=n,this.dirty=!1}},o})(lt),yo=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[n.ONE,n.ZERO]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||this.dirty)&&(this.gl.blendFunc(n[0],n[1]),this.current=n,this.dirty=!1)},o})(lt),$o=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return u.Color.transparent},o.prototype.set=function(n){var s=this.current;(n.r!==s.r||n.g!==s.g||n.b!==s.b||n.a!==s.a||this.dirty)&&(this.gl.blendColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)},o})(lt),mn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.FUNC_ADD},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.blendEquation(n),this.current=n,this.dirty=!1)},o})(lt),Mn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.CULL_FACE):s.disable(s.CULL_FACE),this.current=n,this.dirty=!1}},o})(lt),Bn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.BACK},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.cullFace(n),this.current=n,this.dirty=!1)},o})(lt),Zo=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.CCW},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.frontFace(n),this.current=n,this.dirty=!1)},o})(lt),jn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.useProgram(n),this.current=n,this.dirty=!1)},o})(lt),zn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.TEXTURE0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.activeTexture(n),this.current=n,this.dirty=!1)},o})(lt),rn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[0,0,n.drawingBufferWidth,n.drawingBufferHeight]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||n[3]!==s[3]||this.dirty)&&(this.gl.viewport(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)},o})(lt),de=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindFramebuffer(s.FRAMEBUFFER,n),this.current=n,this.dirty=!1}},o})(lt),_e=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindRenderbuffer(s.RENDERBUFFER,n),this.current=n,this.dirty=!1}},o})(lt),jt=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindTexture(s.TEXTURE_2D,n),this.current=n,this.dirty=!1}},o})(lt),tr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindBuffer(s.ARRAY_BUFFER,n),this.current=n,this.dirty=!1}},o})(lt),Kt=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){var s=this.gl;s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,n),this.current=n,this.dirty=!1},o})(lt),_t=(function(i){function o(n){i.call(this,n),this.vao=n.extVertexArrayObject}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){this.vao&&(n!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(n),this.current=n,this.dirty=!1)},o})(lt),fi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 4},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_ALIGNMENT,n),this.current=n,this.dirty=!1}},o})(lt),qi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n),this.current=n,this.dirty=!1}},o})(lt),ii=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,n),this.current=n,this.dirty=!1}},o})(lt),Yt=(function(i){function o(n,s){i.call(this,n),this.context=n,this.parent=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o})(lt),T=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.setDirty=function(){this.dirty=!0},o.prototype.set=function(n){if(n!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var s=this.gl;s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,n,0),this.current=n,this.dirty=!1}},o})(Yt),P=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.set=function(n){if(n!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var s=this.gl;s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,n),this.current=n,this.dirty=!1}},o})(Yt),B=function(i,o,n,s){this.context=i,this.width=o,this.height=n;var p=this.framebuffer=i.gl.createFramebuffer();this.colorAttachment=new T(i,p),s&&(this.depthAttachment=new P(i,p))};B.prototype.destroy=function(){var i=this.context.gl,o=this.colorAttachment.get();if(o&&i.deleteTexture(o),this.depthAttachment){var n=this.depthAttachment.get();n&&i.deleteRenderbuffer(n)}i.deleteFramebuffer(this.framebuffer)};var V=function(i,o,n){this.func=i,this.mask=o,this.range=n};V.ReadOnly=!1,V.ReadWrite=!0,V.disabled=new V(519,V.ReadOnly,[0,1]);var $=function(i,o,n,s,p,f){this.test=i,this.ref=o,this.mask=n,this.fail=s,this.depthFail=p,this.pass=f};$.disabled=new $({func:519,mask:0},0,0,7680,7680,7680);var re=function(i,o,n){this.blendFunction=i,this.blendColor=o,this.mask=n};re.disabled=new re(re.Replace=[1,0],u.Color.transparent,[!1,!1,!1,!1]),re.unblended=new re(re.Replace,u.Color.transparent,[!0,!0,!0,!0]),re.alphaBlended=new re([1,771],u.Color.transparent,[!0,!0,!0,!0]);var ie=function(i,o,n){this.enable=i,this.mode=o,this.frontFace=n};ie.disabled=new ie(!1,1029,2305),ie.backCCW=new ie(!0,1029,2305);var L=function(i){this.gl=i,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new mr(this),this.clearDepth=new hr(this),this.clearStencil=new jr(this),this.colorMask=new fr(this),this.depthMask=new br(this),this.stencilMask=new dn(this),this.stencilFunc=new Kr(this),this.stencilOp=new Bi(this),this.stencilTest=new hi(this),this.depthRange=new ti(this),this.depthTest=new ri(this),this.depthFunc=new Vi(this),this.blend=new Ki(this),this.blendFunc=new yo(this),this.blendColor=new $o(this),this.blendEquation=new mn(this),this.cullFace=new Mn(this),this.cullFaceSide=new Bn(this),this.frontFace=new Zo(this),this.program=new jn(this),this.activeTexture=new zn(this),this.viewport=new rn(this),this.bindFramebuffer=new de(this),this.bindRenderbuffer=new _e(this),this.bindTexture=new jt(this),this.bindVertexBuffer=new tr(this),this.bindElementBuffer=new Kt(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new _t(this),this.pixelStoreUnpack=new fi(this),this.pixelStoreUnpackPremultiplyAlpha=new qi(this),this.pixelStoreUnpackFlipY=new ii(this),this.extTextureFilterAnisotropic=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=i.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=i.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(i.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=i.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=i.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE)};L.prototype.setDefault=function(){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()},L.prototype.setDirty=function(){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},L.prototype.createIndexBuffer=function(i,o){return new Nr(this,i,o)},L.prototype.createVertexBuffer=function(i,o,n){return new sr(this,i,o,n)},L.prototype.createRenderbuffer=function(i,o,n){var s=this.gl,p=s.createRenderbuffer();return this.bindRenderbuffer.set(p),s.renderbufferStorage(s.RENDERBUFFER,i,o,n),this.bindRenderbuffer.set(null),p},L.prototype.createFramebuffer=function(i,o,n){return new B(this,i,o,n)},L.prototype.clear=function(i){var o=i.color,n=i.depth,s=this.gl,p=0;o&&(p|=s.COLOR_BUFFER_BIT,this.clearColor.set(o),this.colorMask.set([!0,!0,!0,!0])),n!==void 0&&(p|=s.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(n),this.depthMask.set(!0)),s.clear(p)},L.prototype.setCullFace=function(i){i.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(i.mode),this.frontFace.set(i.frontFace))},L.prototype.setDepthMode=function(i){i.func!==this.gl.ALWAYS||i.mask?(this.depthTest.set(!0),this.depthFunc.set(i.func),this.depthMask.set(i.mask),this.depthRange.set(i.range)):this.depthTest.set(!1)},L.prototype.setStencilMode=function(i){i.test.func!==this.gl.ALWAYS||i.mask?(this.stencilTest.set(!0),this.stencilMask.set(i.mask),this.stencilOp.set([i.fail,i.depthFail,i.pass]),this.stencilFunc.set({func:i.test.func,ref:i.ref,mask:i.test.mask})):this.stencilTest.set(!1)},L.prototype.setColorMode=function(i){u.deepEqual(i.blendFunction,re.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(i.blendFunction),this.blendColor.set(i.blendColor)),this.colorMask.set(i.mask)},L.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var H=(function(i){function o(n,s,p){var f=this;i.call(this),this.id=n,this.dispatcher=p,this.on("data",(function(d){d.dataType==="source"&&d.sourceDataType==="metadata"&&(f._sourceLoaded=!0),f._sourceLoaded&&!f._paused&&d.dataType==="source"&&d.sourceDataType==="content"&&(f.reload(),f.transform&&f.update(f.transform))})),this.on("error",(function(){f._sourceErrored=!0})),this._source=(function(d,v,w,A){var R=new Mi[v.type](d,v,w,A);if(R.id!==d)throw new Error("Expected Source id to be "+d+" instead of "+R.id);return u.bindAll(["load","abort","unload","serialize","prepare"],R),R})(n,s,p,this),this._tiles={},this._cache=new Nt(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new u.SourceFeatureState}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.onAdd=function(n){this.map=n,this._maxTileCacheSize=n?n._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(n)},o.prototype.onRemove=function(n){this._source&&this._source.onRemove&&this._source.onRemove(n)},o.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(var n in this._tiles){var s=this._tiles[n];if(s.state!=="loaded"&&s.state!=="errored")return!1}return!0},o.prototype.getSource=function(){return this._source},o.prototype.pause=function(){this._paused=!0},o.prototype.resume=function(){if(this._paused){var n=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,n&&this.reload(),this.transform&&this.update(this.transform)}},o.prototype._loadTile=function(n,s){return this._source.loadTile(n,s)},o.prototype._unloadTile=function(n){if(this._source.unloadTile)return this._source.unloadTile(n,(function(){}))},o.prototype._abortTile=function(n){if(this._source.abortTile)return this._source.abortTile(n,(function(){}))},o.prototype.serialize=function(){return this._source.serialize()},o.prototype.prepare=function(n){for(var s in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var p=this._tiles[s];p.upload(n),p.prepare(this.map.style.imageManager)}},o.prototype.getIds=function(){return u.values(this._tiles).map((function(n){return n.tileID})).sort(se).map((function(n){return n.key}))},o.prototype.getRenderableIds=function(n){var s=this,p=[];for(var f in this._tiles)this._isIdRenderable(f,n)&&p.push(this._tiles[f]);return n?p.sort((function(d,v){var w=d.tileID,A=v.tileID,R=new u.Point(w.canonical.x,w.canonical.y)._rotate(s.transform.angle),F=new u.Point(A.canonical.x,A.canonical.y)._rotate(s.transform.angle);return w.overscaledZ-A.overscaledZ||F.y-R.y||F.x-R.x})).map((function(d){return d.tileID.key})):p.map((function(d){return d.tileID})).sort(se).map((function(d){return d.key}))},o.prototype.hasRenderableParent=function(n){var s=this.findLoadedParent(n,0);return!!s&&this._isIdRenderable(s.tileID.key)},o.prototype._isIdRenderable=function(n,s){return this._tiles[n]&&this._tiles[n].hasData()&&!this._coveredTiles[n]&&(s||!this._tiles[n].holdingForFade())},o.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var n in this._cache.reset(),this._tiles)this._tiles[n].state!=="errored"&&this._reloadTile(n,"reloading")},o.prototype._reloadTile=function(n,s){var p=this._tiles[n];p&&(p.state!=="loading"&&(p.state=s),this._loadTile(p,this._tileLoaded.bind(this,p,n,s)))},o.prototype._tileLoaded=function(n,s,p,f){if(f)return n.state="errored",void(f.status!==404?this._source.fire(new u.ErrorEvent(f,{tile:n})):this.update(this.transform));n.timeAdded=u.browser.now(),p==="expired"&&(n.refreshedUponExpiration=!0),this._setTileReloadTimer(s,n),this.getSource().type==="raster-dem"&&n.dem&&this._backfillDEM(n),this._state.initializeTileState(n,this.map?this.map.painter:null),this._source.fire(new u.Event("data",{dataType:"source",tile:n,coord:n.tileID}))},o.prototype._backfillDEM=function(n){for(var s=this.getRenderableIds(),p=0;p<s.length;p++){var f=s[p];if(n.neighboringTiles&&n.neighboringTiles[f]){var d=this.getTileByID(f);v(n,d),v(d,n)}}function v(w,A){w.needsHillshadePrepare=!0;var R=A.tileID.canonical.x-w.tileID.canonical.x,F=A.tileID.canonical.y-w.tileID.canonical.y,O=Math.pow(2,w.tileID.canonical.z),W=A.tileID.key;R===0&&F===0||Math.abs(F)>1||(Math.abs(R)>1&&(Math.abs(R+O)===1?R+=O:Math.abs(R-O)===1&&(R-=O)),A.dem&&w.dem&&(w.dem.backfillBorder(A.dem,R,F),w.neighboringTiles&&w.neighboringTiles[W]&&(w.neighboringTiles[W].backfilled=!0)))}},o.prototype.getTile=function(n){return this.getTileByID(n.key)},o.prototype.getTileByID=function(n){return this._tiles[n]},o.prototype._retainLoadedChildren=function(n,s,p,f){for(var d in this._tiles){var v=this._tiles[d];if(!(f[d]||!v.hasData()||v.tileID.overscaledZ<=s||v.tileID.overscaledZ>p)){for(var w=v.tileID;v&&v.tileID.overscaledZ>s+1;){var A=v.tileID.scaledTo(v.tileID.overscaledZ-1);(v=this._tiles[A.key])&&v.hasData()&&(w=A)}for(var R=w;R.overscaledZ>s;)if(n[(R=R.scaledTo(R.overscaledZ-1)).key]){f[w.key]=w;break}}}},o.prototype.findLoadedParent=function(n,s){if(n.key in this._loadedParentTiles){var p=this._loadedParentTiles[n.key];return p&&p.tileID.overscaledZ>=s?p:null}for(var f=n.overscaledZ-1;f>=s;f--){var d=n.scaledTo(f),v=this._getLoadedTile(d);if(v)return v}},o.prototype._getLoadedTile=function(n){var s=this._tiles[n.key];return s&&s.hasData()?s:this._cache.getByKey(n.wrapped().key)},o.prototype.updateCacheSize=function(n){var s=Math.ceil(n.width/this._source.tileSize)+1,p=Math.ceil(n.height/this._source.tileSize)+1,f=Math.floor(s*p*5),d=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,f):f;this._cache.setMaxSize(d)},o.prototype.handleWrapJump=function(n){var s=Math.round((n-(this._prevLng===void 0?n:this._prevLng))/360);if(this._prevLng=n,s){var p={};for(var f in this._tiles){var d=this._tiles[f];d.tileID=d.tileID.unwrapTo(d.tileID.wrap+s),p[d.tileID.key]=d}for(var v in this._tiles=p,this._timers)clearTimeout(this._timers[v]),delete this._timers[v];for(var w in this._tiles)this._setTileReloadTimer(w,this._tiles[w])}},o.prototype.update=function(n){var s=this;if(this.transform=n,this._sourceLoaded&&!this._paused){var p;this.updateCacheSize(n),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?p=n.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(Te){return new u.OverscaledTileID(Te.canonical.z,Te.wrap,Te.canonical.z,Te.canonical.x,Te.canonical.y)})):(p=n.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(p=p.filter((function(Te){return s._source.hasTile(Te)})))):p=[];var f=n.coveringZoomLevel(this._source),d=Math.max(f-o.maxOverzooming,this._source.minzoom),v=Math.max(f+o.maxUnderzooming,this._source.minzoom),w=this._updateRetainedTiles(p,f);if(Ie(this._source.type)){for(var A={},R={},F=0,O=Object.keys(w);F<O.length;F+=1){var W=O[F],Z=w[W],ee=this._tiles[W];if(ee&&!(ee.fadeEndTime&&ee.fadeEndTime<=u.browser.now())){var N=this.findLoadedParent(Z,d);N&&(this._addTile(N.tileID),A[N.tileID.key]=N.tileID),R[W]=Z}}for(var Q in this._retainLoadedChildren(R,f,v,w),A)w[Q]||(this._coveredTiles[Q]=!0,w[Q]=A[Q])}for(var ne in w)this._tiles[ne].clearFadeHold();for(var ue=0,me=u.keysDifference(this._tiles,w);ue<me.length;ue+=1){var pe=me[ue],ve=this._tiles[pe];ve.hasSymbolBuckets&&!ve.holdingForFade()?ve.setHoldDuration(this.map._fadeDuration):ve.hasSymbolBuckets&&!ve.symbolFadeFinished()||this._removeTile(pe)}this._updateLoadedParentTileCache()}},o.prototype.releaseSymbolFadeTiles=function(){for(var n in this._tiles)this._tiles[n].holdingForFade()&&this._removeTile(n)},o.prototype._updateRetainedTiles=function(n,s){for(var p={},f={},d=Math.max(s-o.maxOverzooming,this._source.minzoom),v=Math.max(s+o.maxUnderzooming,this._source.minzoom),w={},A=0,R=n;A<R.length;A+=1){var F=R[A],O=this._addTile(F);p[F.key]=F,O.hasData()||s<this._source.maxzoom&&(w[F.key]=F)}this._retainLoadedChildren(w,s,v,p);for(var W=0,Z=n;W<Z.length;W+=1){var ee=Z[W],N=this._tiles[ee.key];if(!N.hasData()){if(s+1>this._source.maxzoom){var Q=ee.children(this._source.maxzoom)[0],ne=this.getTile(Q);if(ne&&ne.hasData()){p[Q.key]=Q;continue}}else{var ue=ee.children(this._source.maxzoom);if(p[ue[0].key]&&p[ue[1].key]&&p[ue[2].key]&&p[ue[3].key])continue}for(var me=N.wasRequested(),pe=ee.overscaledZ-1;pe>=d;--pe){var ve=ee.scaledTo(pe);if(f[ve.key]||(f[ve.key]=!0,!(N=this.getTile(ve))&&me&&(N=this._addTile(ve)),N&&(p[ve.key]=ve,me=N.wasRequested(),N.hasData())))break}}}return p},o.prototype._updateLoadedParentTileCache=function(){for(var n in this._loadedParentTiles={},this._tiles){for(var s=[],p=void 0,f=this._tiles[n].tileID;f.overscaledZ>0;){if(f.key in this._loadedParentTiles){p=this._loadedParentTiles[f.key];break}s.push(f.key);var d=f.scaledTo(f.overscaledZ-1);if(p=this._getLoadedTile(d))break;f=d}for(var v=0,w=s;v<w.length;v+=1)this._loadedParentTiles[w[v]]=p}},o.prototype._addTile=function(n){var s=this._tiles[n.key];if(s)return s;(s=this._cache.getAndRemove(n))&&(this._setTileReloadTimer(n.key,s),s.tileID=n,this._state.initializeTileState(s,this.map?this.map.painter:null),this._cacheTimers[n.key]&&(clearTimeout(this._cacheTimers[n.key]),delete this._cacheTimers[n.key],this._setTileReloadTimer(n.key,s)));var p=!!s;return p||(s=new u.Tile(n,this._source.tileSize*n.overscaleFactor()),this._loadTile(s,this._tileLoaded.bind(this,s,n.key,s.state))),s?(s.uses++,this._tiles[n.key]=s,p||this._source.fire(new u.Event("dataloading",{tile:s,coord:s.tileID,dataType:"source"})),s):null},o.prototype._setTileReloadTimer=function(n,s){var p=this;n in this._timers&&(clearTimeout(this._timers[n]),delete this._timers[n]);var f=s.getExpiryTimeout();f&&(this._timers[n]=setTimeout((function(){p._reloadTile(n,"expired"),delete p._timers[n]}),f))},o.prototype._removeTile=function(n){var s=this._tiles[n];s&&(s.uses--,delete this._tiles[n],this._timers[n]&&(clearTimeout(this._timers[n]),delete this._timers[n]),s.uses>0||(s.hasData()&&s.state!=="reloading"?this._cache.add(s.tileID,s,s.getExpiryTimeout()):(s.aborted=!0,this._abortTile(s),this._unloadTile(s))))},o.prototype.clearTiles=function(){for(var n in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(n);this._cache.reset()},o.prototype.tilesIn=function(n,s,p){var f=this,d=[],v=this.transform;if(!v)return d;for(var w=p?v.getCameraQueryGeometry(n):n,A=n.map((function(pe){return v.pointCoordinate(pe)})),R=w.map((function(pe){return v.pointCoordinate(pe)})),F=this.getIds(),O=1/0,W=1/0,Z=-1/0,ee=-1/0,N=0,Q=R;N<Q.length;N+=1){var ne=Q[N];O=Math.min(O,ne.x),W=Math.min(W,ne.y),Z=Math.max(Z,ne.x),ee=Math.max(ee,ne.y)}for(var ue=function(pe){var ve=f._tiles[F[pe]];if(!ve.holdingForFade()){var Te=ve.tileID,ke=Math.pow(2,v.zoom-ve.tileID.overscaledZ),Ce=s*ve.queryPadding*u.EXTENT/ve.tileSize/ke,$e=[Te.getTilePoint(new u.MercatorCoordinate(O,W)),Te.getTilePoint(new u.MercatorCoordinate(Z,ee))];if($e[0].x-Ce<u.EXTENT&&$e[0].y-Ce<u.EXTENT&&$e[1].x+Ce>=0&&$e[1].y+Ce>=0){var nt=A.map((function(st){return Te.getTilePoint(st)})),ut=R.map((function(st){return Te.getTilePoint(st)}));d.push({tile:ve,tileID:Te,queryGeometry:nt,cameraQueryGeometry:ut,scale:ke})}}},me=0;me<F.length;me++)ue(me);return d},o.prototype.getVisibleCoordinates=function(n){for(var s=this,p=this.getRenderableIds(n).map((function(w){return s._tiles[w].tileID})),f=0,d=p;f<d.length;f+=1){var v=d[f];v.posMatrix=this.transform.calculatePosMatrix(v.toUnwrapped())}return p},o.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Ie(this._source.type))for(var n in this._tiles){var s=this._tiles[n];if(s.fadeEndTime!==void 0&&s.fadeEndTime>=u.browser.now())return!0}return!1},o.prototype.setFeatureState=function(n,s,p){this._state.updateState(n=n||"_geojsonTileLayer",s,p)},o.prototype.removeFeatureState=function(n,s,p){this._state.removeFeatureState(n=n||"_geojsonTileLayer",s,p)},o.prototype.getFeatureState=function(n,s){return this._state.getState(n=n||"_geojsonTileLayer",s)},o.prototype.setDependencies=function(n,s,p){var f=this._tiles[n];f&&f.setDependencies(s,p)},o.prototype.reloadTilesForDependencies=function(n,s){for(var p in this._tiles)this._tiles[p].hasDependency(n,s)&&this._reloadTile(p,"reloading");this._cache.filter((function(f){return!f.hasDependency(n,s)}))},o})(u.Evented);function se(i,o){var n=Math.abs(2*i.wrap)-+(i.wrap<0),s=Math.abs(2*o.wrap)-+(o.wrap<0);return i.overscaledZ-o.overscaledZ||s-n||o.canonical.y-i.canonical.y||o.canonical.x-i.canonical.x}function Ie(i){return i==="raster"||i==="image"||i==="video"}function Ee(){return new u.window.Worker(gs.workerUrl)}H.maxOverzooming=10,H.maxUnderzooming=3;var ye="mapboxgl_preloaded_worker_pool",Ae=function(){this.active={}};Ae.prototype.acquire=function(i){if(!this.workers)for(this.workers=[];this.workers.length<Ae.workerCount;)this.workers.push(new Ee);return this.active[i]=!0,this.workers.slice()},Ae.prototype.release=function(i){delete this.active[i],this.numActive()===0&&(this.workers.forEach((function(o){o.terminate()})),this.workers=null)},Ae.prototype.isPreloaded=function(){return!!this.active[ye]},Ae.prototype.numActive=function(){return Object.keys(this.active).length};var Je,Ge=Math.floor(u.browser.hardwareConcurrency/2);function ge(){return Je||(Je=new Ae),Je}function Ve(i,o){var n={};for(var s in i)s!=="ref"&&(n[s]=i[s]);return u.refProperties.forEach((function(p){p in o&&(n[p]=o[p])})),n}function Be(i){i=i.slice();for(var o=Object.create(null),n=0;n<i.length;n++)o[i[n].id]=i[n];for(var s=0;s<i.length;s++)"ref"in i[s]&&(i[s]=Ve(i[s],o[i[s].ref]));return i}Ae.workerCount=Math.max(Math.min(Ge,6),1);var Me={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"};function yt(i,o,n){n.push({command:Me.addSource,args:[i,o[i]]})}function Fe(i,o,n){o.push({command:Me.removeSource,args:[i]}),n[i]=!0}function Pt(i,o,n,s){Fe(i,n,s),yt(i,o,n)}function rr(i,o,n){var s;for(s in i[n])if(i[n].hasOwnProperty(s)&&s!=="data"&&!u.deepEqual(i[n][s],o[n][s]))return!1;for(s in o[n])if(o[n].hasOwnProperty(s)&&s!=="data"&&!u.deepEqual(i[n][s],o[n][s]))return!1;return!0}function Ct(i,o,n,s,p,f){var d;for(d in o=o||{},i=i||{})i.hasOwnProperty(d)&&(u.deepEqual(i[d],o[d])||n.push({command:f,args:[s,d,o[d],p]}));for(d in o)o.hasOwnProperty(d)&&!i.hasOwnProperty(d)&&(u.deepEqual(i[d],o[d])||n.push({command:f,args:[s,d,o[d],p]}))}function Gt(i){return i.id}function Rt(i,o){return i[o.id]=o,i}var wi=function(i,o){this.reset(i,o)};wi.prototype.reset=function(i,o){this.points=i||[],this._distances=[0];for(var n=1;n<this.points.length;n++)this._distances[n]=this._distances[n-1]+this.points[n].dist(this.points[n-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},wi.prototype.lerp=function(i){if(this.points.length===1)return this.points[0];i=u.clamp(i,0,1);for(var o=1,n=this._distances[o],s=i*this.paddedLength+this.padding;n<s&&o<this._distances.length;)n=this._distances[++o];var p=o-1,f=this._distances[p],d=n-f,v=d>0?(s-f)/d:0;return this.points[p].mult(1-v).add(this.points[o].mult(v))};var Ht=function(i,o,n){var s=this.boxCells=[],p=this.circleCells=[];this.xCellCount=Math.ceil(i/n),this.yCellCount=Math.ceil(o/n);for(var f=0;f<this.xCellCount*this.yCellCount;f++)s.push([]),p.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=i,this.height=o,this.xScale=this.xCellCount/i,this.yScale=this.yCellCount/o,this.boxUid=0,this.circleUid=0};function Cr(i,o,n,s,p){var f=u.create();return o?(u.scale(f,f,[1/p,1/p,1]),n||u.rotateZ(f,f,s.angle)):u.multiply(f,s.labelPlaneMatrix,i),f}function Qt(i,o,n,s,p){if(o){var f=u.clone(i);return u.scale(f,f,[p,p,1]),n||u.rotateZ(f,f,-s.angle),f}return s.glCoordMatrix}function zt(i,o){var n=[i.x,i.y,0,1];oi(n,n,o);var s=n[3];return{point:new u.Point(n[0]/s,n[1]/s),signedDistanceFromCamera:s}}function $t(i,o){return .5+i/o*.5}function zi(i,o){var n=i[0]/i[3],s=i[1]/i[3];return n>=-o[0]&&n<=o[0]&&s>=-o[1]&&s<=o[1]}function ma(i,o,n,s,p,f,d,v){var w=s?i.textSizeData:i.iconSizeData,A=u.evaluateSizeForZoom(w,n.transform.zoom),R=[256/n.width*2+1,256/n.height*2+1],F=s?i.text.dynamicLayoutVertexArray:i.icon.dynamicLayoutVertexArray;F.clear();for(var O=i.lineVertexArray,W=s?i.text.placedSymbolArray:i.icon.placedSymbolArray,Z=n.transform.width/n.transform.height,ee=!1,N=0;N<W.length;N++){var Q=W.get(N);if(Q.hidden||Q.writingMode===u.WritingMode.vertical&&!ee)Si(Q.numGlyphs,F);else{ee=!1;var ne=[Q.anchorX,Q.anchorY,0,1];if(u.transformMat4(ne,ne,o),zi(ne,R)){var ue=$t(n.transform.cameraToCenterDistance,ne[3]),me=u.evaluateSizeForFeature(w,A,Q),pe=d?me/ue:me*ue,ve=new u.Point(Q.anchorX,Q.anchorY),Te=zt(ve,p).point,ke={},Ce=ru(Q,pe,!1,v,o,p,f,i.glyphOffsetArray,O,F,Te,ve,ke,Z);ee=Ce.useVertical,(Ce.notEnoughRoom||ee||Ce.needsFlipping&&ru(Q,pe,!0,v,o,p,f,i.glyphOffsetArray,O,F,Te,ve,ke,Z).notEnoughRoom)&&Si(Q.numGlyphs,F)}else Si(Q.numGlyphs,F)}}s?i.text.dynamicLayoutVertexBuffer.updateData(F):i.icon.dynamicLayoutVertexBuffer.updateData(F)}function ni(i,o,n,s,p,f,d,v,w,A,R){var F=v.glyphStartIndex+v.numGlyphs,O=v.lineStartIndex,W=v.lineStartIndex+v.lineLength,Z=o.getoffsetX(v.glyphStartIndex),ee=o.getoffsetX(F-1),N=kr(i*Z,n,s,p,f,d,v.segment,O,W,w,A,R);if(!N)return null;var Q=kr(i*ee,n,s,p,f,d,v.segment,O,W,w,A,R);return Q?{first:N,last:Q}:null}function Di(i,o,n,s){return i===u.WritingMode.horizontal&&Math.abs(n.y-o.y)>Math.abs(n.x-o.x)*s?{useVertical:!0}:(i===u.WritingMode.vertical?o.y<n.y:o.x>n.x)?{needsFlipping:!0}:null}function ru(i,o,n,s,p,f,d,v,w,A,R,F,O,W){var Z,ee=o/24,N=i.lineOffsetX*ee,Q=i.lineOffsetY*ee;if(i.numGlyphs>1){var ne=i.glyphStartIndex+i.numGlyphs,ue=i.lineStartIndex,me=i.lineStartIndex+i.lineLength,pe=ni(ee,v,N,Q,n,R,F,i,w,f,O);if(!pe)return{notEnoughRoom:!0};var ve=zt(pe.first.point,d).point,Te=zt(pe.last.point,d).point;if(s&&!n){var ke=Di(i.writingMode,ve,Te,W);if(ke)return ke}Z=[pe.first];for(var Ce=i.glyphStartIndex+1;Ce<ne-1;Ce++)Z.push(kr(ee*v.getoffsetX(Ce),N,Q,n,R,F,i.segment,ue,me,w,f,O));Z.push(pe.last)}else{if(s&&!n){var $e=zt(F,p).point,nt=i.lineStartIndex+i.segment+1,ut=new u.Point(w.getx(nt),w.gety(nt)),st=zt(ut,p),Ft=st.signedDistanceFromCamera>0?st.point:ya(F,ut,$e,1,p),We=Di(i.writingMode,$e,Ft,W);if(We)return We}var mt=kr(ee*v.getoffsetX(i.glyphStartIndex),N,Q,n,R,F,i.segment,i.lineStartIndex,i.lineStartIndex+i.lineLength,w,f,O);if(!mt)return{notEnoughRoom:!0};Z=[mt]}for(var xt=0,dt=Z;xt<dt.length;xt+=1){var ft=dt[xt];u.addDynamicAttributes(A,ft.point,ft.angle)}return{}}function ya(i,o,n,s,p){var f=zt(i.add(i.sub(o)._unit()),p).point,d=n.sub(f);return n.add(d._mult(s/d.mag()))}function kr(i,o,n,s,p,f,d,v,w,A,R,F){var O=s?i-o:i+o,W=O>0?1:-1,Z=0;s&&(W*=-1,Z=Math.PI),W<0&&(Z+=Math.PI);for(var ee=W>0?v+d:v+d+1,N=p,Q=p,ne=0,ue=0,me=Math.abs(O),pe=[];ne+ue<=me;){if((ee+=W)<v||ee>=w)return null;if(Q=N,pe.push(N),(N=F[ee])===void 0){var ve=new u.Point(A.getx(ee),A.gety(ee)),Te=zt(ve,R);if(Te.signedDistanceFromCamera>0)N=F[ee]=Te.point;else{var ke=ee-W;N=ya(ne===0?f:new u.Point(A.getx(ke),A.gety(ke)),ve,Q,me-ne+1,R)}}ne+=ue,ue=Q.dist(N)}var Ce=(me-ne)/ue,$e=N.sub(Q),nt=$e.mult(Ce)._add(Q);nt._add($e._unit()._perp()._mult(n*W));var ut=Z+Math.atan2(N.y-Q.y,N.x-Q.x);return pe.push(nt),{point:nt,angle:ut,path:pe}}Ht.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Ht.prototype.insert=function(i,o,n,s,p){this._forEachCell(o,n,s,p,this._insertBoxCell,this.boxUid++),this.boxKeys.push(i),this.bboxes.push(o),this.bboxes.push(n),this.bboxes.push(s),this.bboxes.push(p)},Ht.prototype.insertCircle=function(i,o,n,s){this._forEachCell(o-s,n-s,o+s,n+s,this._insertCircleCell,this.circleUid++),this.circleKeys.push(i),this.circles.push(o),this.circles.push(n),this.circles.push(s)},Ht.prototype._insertBoxCell=function(i,o,n,s,p,f){this.boxCells[p].push(f)},Ht.prototype._insertCircleCell=function(i,o,n,s,p,f){this.circleCells[p].push(f)},Ht.prototype._query=function(i,o,n,s,p,f){if(n<0||i>this.width||s<0||o>this.height)return!p&&[];var d=[];if(i<=0&&o<=0&&this.width<=n&&this.height<=s){if(p)return!0;for(var v=0;v<this.boxKeys.length;v++)d.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(var w=0;w<this.circleKeys.length;w++){var A=this.circles[3*w],R=this.circles[3*w+1],F=this.circles[3*w+2];d.push({key:this.circleKeys[w],x1:A-F,y1:R-F,x2:A+F,y2:R+F})}return f?d.filter(f):d}return this._forEachCell(i,o,n,s,this._queryCell,d,{hitTest:p,seenUids:{box:{},circle:{}}},f),p?d.length>0:d},Ht.prototype._queryCircle=function(i,o,n,s,p){var f=i-n,d=i+n,v=o-n,w=o+n;if(d<0||f>this.width||w<0||v>this.height)return!s&&[];var A=[];return this._forEachCell(f,v,d,w,this._queryCellCircle,A,{hitTest:s,circle:{x:i,y:o,radius:n},seenUids:{box:{},circle:{}}},p),s?A.length>0:A},Ht.prototype.query=function(i,o,n,s,p){return this._query(i,o,n,s,!1,p)},Ht.prototype.hitTest=function(i,o,n,s,p){return this._query(i,o,n,s,!0,p)},Ht.prototype.hitTestCircle=function(i,o,n,s){return this._queryCircle(i,o,n,!0,s)},Ht.prototype._queryCell=function(i,o,n,s,p,f,d,v){var w=d.seenUids,A=this.boxCells[p];if(A!==null)for(var R=this.bboxes,F=0,O=A;F<O.length;F+=1){var W=O[F];if(!w.box[W]){w.box[W]=!0;var Z=4*W;if(i<=R[Z+2]&&o<=R[Z+3]&&n>=R[Z+0]&&s>=R[Z+1]&&(!v||v(this.boxKeys[W]))){if(d.hitTest)return f.push(!0),!0;f.push({key:this.boxKeys[W],x1:R[Z],y1:R[Z+1],x2:R[Z+2],y2:R[Z+3]})}}}var ee=this.circleCells[p];if(ee!==null)for(var N=this.circles,Q=0,ne=ee;Q<ne.length;Q+=1){var ue=ne[Q];if(!w.circle[ue]){w.circle[ue]=!0;var me=3*ue;if(this._circleAndRectCollide(N[me],N[me+1],N[me+2],i,o,n,s)&&(!v||v(this.circleKeys[ue]))){if(d.hitTest)return f.push(!0),!0;var pe=N[me],ve=N[me+1],Te=N[me+2];f.push({key:this.circleKeys[ue],x1:pe-Te,y1:ve-Te,x2:pe+Te,y2:ve+Te})}}}},Ht.prototype._queryCellCircle=function(i,o,n,s,p,f,d,v){var w=d.circle,A=d.seenUids,R=this.boxCells[p];if(R!==null)for(var F=this.bboxes,O=0,W=R;O<W.length;O+=1){var Z=W[O];if(!A.box[Z]){A.box[Z]=!0;var ee=4*Z;if(this._circleAndRectCollide(w.x,w.y,w.radius,F[ee+0],F[ee+1],F[ee+2],F[ee+3])&&(!v||v(this.boxKeys[Z])))return f.push(!0),!0}}var N=this.circleCells[p];if(N!==null)for(var Q=this.circles,ne=0,ue=N;ne<ue.length;ne+=1){var me=ue[ne];if(!A.circle[me]){A.circle[me]=!0;var pe=3*me;if(this._circlesCollide(Q[pe],Q[pe+1],Q[pe+2],w.x,w.y,w.radius)&&(!v||v(this.circleKeys[me])))return f.push(!0),!0}}},Ht.prototype._forEachCell=function(i,o,n,s,p,f,d,v){for(var w=this._convertToXCellCoord(i),A=this._convertToYCellCoord(o),R=this._convertToXCellCoord(n),F=this._convertToYCellCoord(s),O=w;O<=R;O++)for(var W=A;W<=F;W++)if(p.call(this,i,o,n,s,this.xCellCount*W+O,f,d,v))return},Ht.prototype._convertToXCellCoord=function(i){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(i*this.xScale)))},Ht.prototype._convertToYCellCoord=function(i){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(i*this.yScale)))},Ht.prototype._circlesCollide=function(i,o,n,s,p,f){var d=s-i,v=p-o,w=n+f;return w*w>d*d+v*v},Ht.prototype._circleAndRectCollide=function(i,o,n,s,p,f,d){var v=(f-s)/2,w=Math.abs(i-(s+v));if(w>v+n)return!1;var A=(d-p)/2,R=Math.abs(o-(p+A));if(R>A+n)return!1;if(w<=v||R<=A)return!0;var F=w-v,O=R-A;return F*F+O*O<=n*n};var va=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Si(i,o){for(var n=0;n<i;n++){var s=o.length;o.resize(s+4),o.float32.set(va,3*s)}}function oi(i,o,n){var s=o[0],p=o[1];return i[0]=n[0]*s+n[4]*p+n[12],i[1]=n[1]*s+n[5]*p+n[13],i[3]=n[3]*s+n[7]*p+n[15],i}var nn=function(i,o,n){o===void 0&&(o=new Ht(i.width+200,i.height+200,25)),n===void 0&&(n=new Ht(i.width+200,i.height+200,25)),this.transform=i,this.grid=o,this.ignoredGrid=n,this.pitchfactor=Math.cos(i._pitch)*i.cameraToCenterDistance,this.screenRightBoundary=i.width+100,this.screenBottomBoundary=i.height+100,this.gridRightBoundary=i.width+200,this.gridBottomBoundary=i.height+200};function yr(i,o,n){return o*(u.EXTENT/(i.tileSize*Math.pow(2,n-i.tileID.overscaledZ)))}nn.prototype.placeCollisionBox=function(i,o,n,s,p){var f=this.projectAndGetPerspectiveRatio(s,i.anchorPointX,i.anchorPointY),d=n*f.perspectiveRatio,v=i.x1*d+f.point.x,w=i.y1*d+f.point.y,A=i.x2*d+f.point.x,R=i.y2*d+f.point.y;return!this.isInsideGrid(v,w,A,R)||!o&&this.grid.hitTest(v,w,A,R,p)?{box:[],offscreen:!1}:{box:[v,w,A,R],offscreen:this.isOffscreen(v,w,A,R)}},nn.prototype.placeCollisionCircles=function(i,o,n,s,p,f,d,v,w,A,R,F,O){var W=[],Z=new u.Point(o.anchorX,o.anchorY),ee=zt(Z,f),N=$t(this.transform.cameraToCenterDistance,ee.signedDistanceFromCamera),Q=(A?p/N:p*N)/u.ONE_EM,ne=zt(Z,d).point,ue=ni(Q,s,o.lineOffsetX*Q,o.lineOffsetY*Q,!1,ne,Z,o,n,d,{}),me=!1,pe=!1,ve=!0;if(ue){for(var Te=.5*F*N+O,ke=new u.Point(-100,-100),Ce=new u.Point(this.screenRightBoundary,this.screenBottomBoundary),$e=new wi,nt=ue.first,ut=ue.last,st=[],Ft=nt.path.length-1;Ft>=1;Ft--)st.push(nt.path[Ft]);for(var We=1;We<ut.path.length;We++)st.push(ut.path[We]);var mt=2.5*Te;if(v){var xt=st.map((function(cn){return zt(cn,v)}));st=xt.some((function(cn){return cn.signedDistanceFromCamera<=0}))?[]:xt.map((function(cn){return cn.point}))}var dt=[];if(st.length>0){for(var ft=st[0].clone(),gt=st[0].clone(),ht=1;ht<st.length;ht++)ft.x=Math.min(ft.x,st[ht].x),ft.y=Math.min(ft.y,st[ht].y),gt.x=Math.max(gt.x,st[ht].x),gt.y=Math.max(gt.y,st[ht].y);dt=ft.x>=ke.x&&gt.x<=Ce.x&&ft.y>=ke.y&&gt.y<=Ce.y?[st]:gt.x<ke.x||ft.x>Ce.x||gt.y<ke.y||ft.y>Ce.y?[]:u.clipLine([st],ke.x,ke.y,Ce.x,Ce.y)}for(var ct=0,Jr=dt;ct<Jr.length;ct+=1){var Ir;$e.reset(Jr[ct],.25*Te),Ir=$e.length<=.5*Te?1:Math.ceil($e.paddedLength/mt)+1;for(var gi=0;gi<Ir;gi++){var si=gi/Math.max(Ir-1,1),wr=$e.lerp(si),Mr=wr.x+100,Wi=wr.y+100;W.push(Mr,Wi,Te,0);var Ei=Mr-Te,no=Wi-Te,Ri=Mr+Te,wn=Wi+Te;if(ve=ve&&this.isOffscreen(Ei,no,Ri,wn),pe=pe||this.isInsideGrid(Ei,no,Ri,wn),!i&&this.grid.hitTestCircle(Mr,Wi,Te,R)&&(me=!0,!w))return{circles:[],offscreen:!1,collisionDetected:me}}}}return{circles:!w&&me||!pe?[]:W,offscreen:ve,collisionDetected:me}},nn.prototype.queryRenderedSymbols=function(i){if(i.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};for(var o=[],n=1/0,s=1/0,p=-1/0,f=-1/0,d=0,v=i;d<v.length;d+=1){var w=v[d],A=new u.Point(w.x+100,w.y+100);n=Math.min(n,A.x),s=Math.min(s,A.y),p=Math.max(p,A.x),f=Math.max(f,A.y),o.push(A)}for(var R={},F={},O=0,W=this.grid.query(n,s,p,f).concat(this.ignoredGrid.query(n,s,p,f));O<W.length;O+=1){var Z=W[O],ee=Z.key;if(R[ee.bucketInstanceId]===void 0&&(R[ee.bucketInstanceId]={}),!R[ee.bucketInstanceId][ee.featureIndex]){var N=[new u.Point(Z.x1,Z.y1),new u.Point(Z.x2,Z.y1),new u.Point(Z.x2,Z.y2),new u.Point(Z.x1,Z.y2)];u.polygonIntersectsPolygon(o,N)&&(R[ee.bucketInstanceId][ee.featureIndex]=!0,F[ee.bucketInstanceId]===void 0&&(F[ee.bucketInstanceId]=[]),F[ee.bucketInstanceId].push(ee.featureIndex))}}return F},nn.prototype.insertCollisionBox=function(i,o,n,s,p){(o?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:s,collisionGroupID:p},i[0],i[1],i[2],i[3])},nn.prototype.insertCollisionCircles=function(i,o,n,s,p){for(var f=o?this.ignoredGrid:this.grid,d={bucketInstanceId:n,featureIndex:s,collisionGroupID:p},v=0;v<i.length;v+=4)f.insertCircle(d,i[v],i[v+1],i[v+2])},nn.prototype.projectAndGetPerspectiveRatio=function(i,o,n){var s=[o,n,0,1];return oi(s,s,i),{point:new u.Point((s[0]/s[3]+1)/2*this.transform.width+100,(-s[1]/s[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/s[3]*.5}},nn.prototype.isOffscreen=function(i,o,n,s){return n<100||i>=this.screenRightBoundary||s<100||o>this.screenBottomBoundary},nn.prototype.isInsideGrid=function(i,o,n,s){return n>=0&&i<this.gridRightBoundary&&s>=0&&o<this.gridBottomBoundary},nn.prototype.getViewportMatrix=function(){var i=u.identity([]);return u.translate(i,i,[-100,-100,0]),i};var yn=function(i,o,n,s){this.opacity=i?Math.max(0,Math.min(1,i.opacity+(i.placed?o:-o))):s&&n?1:0,this.placed=n};yn.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var Ji=function(i,o,n,s,p){this.text=new yn(i?i.text:null,o,n,p),this.icon=new yn(i?i.icon:null,o,s,p)};Ji.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var al=function(i,o,n){this.text=i,this.icon=o,this.skipFade=n},on=function(){this.invProjMatrix=u.create(),this.viewportMatrix=u.create(),this.circles=[]},Pc=function(i,o,n,s,p){this.bucketInstanceId=i,this.featureIndex=o,this.sourceLayerIndex=n,this.bucketIndex=s,this.tileID=p},Dn=function(i){this.crossSourceCollisions=i,this.maxGroupID=0,this.collisionGroups={}};function di(i,o,n,s,p){var f=u.getAnchorAlignment(i),d=-(f.horizontalAlign-.5)*o,v=-(f.verticalAlign-.5)*n,w=u.evaluateVariableOffset(i,s);return new u.Point(d+w[0]*p,v+w[1]*p)}function In(i,o,n,s,p,f){var d=i.x1,v=i.x2,w=i.y1,A=i.y2,R=i.anchorPointX,F=i.anchorPointY,O=new u.Point(o,n);return s&&O._rotate(p?f:-f),{x1:d+O.x,y1:w+O.y,x2:v+O.x,y2:A+O.y,anchorPointX:R,anchorPointY:F}}Dn.prototype.get=function(i){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[i]){var o=++this.maxGroupID;this.collisionGroups[i]={ID:o,predicate:function(n){return n.collisionGroupID===o}}}return this.collisionGroups[i]};var Ii=function(i,o,n,s){this.transform=i.clone(),this.collisionIndex=new nn(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=o,this.retainedQueryData={},this.collisionGroups=new Dn(n),this.collisionCircleArrays={},this.prevPlacement=s,s&&(s.prevPlacement=void 0),this.placedOrientations={}};function vo(i,o,n,s,p){i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0)}Ii.prototype.getBucketParts=function(i,o,n,s){var p=n.getBucket(o),f=n.latestFeatureIndex;if(p&&f&&o.id===p.layerIds[0]){var d=n.collisionBoxArray,v=p.layers[0].layout,w=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),A=n.tileSize/u.EXTENT,R=this.transform.calculatePosMatrix(n.tileID.toUnwrapped()),F=v.get("text-pitch-alignment")==="map",O=v.get("text-rotation-alignment")==="map",W=yr(n,1,this.transform.zoom),Z=Cr(R,F,O,this.transform,W),ee=null;if(F){var N=Qt(R,F,O,this.transform,W);ee=u.multiply([],this.transform.labelPlaneMatrix,N)}this.retainedQueryData[p.bucketInstanceId]=new Pc(p.bucketInstanceId,f,p.sourceLayerIndex,p.index,n.tileID);var Q={bucket:p,layout:v,posMatrix:R,textLabelPlaneMatrix:Z,labelToScreenMatrix:ee,scale:w,textPixelRatio:A,holdingForFade:n.holdingForFade(),collisionBoxArray:d,partiallyEvaluatedTextSize:u.evaluateSizeForZoom(p.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(p.sourceID)};if(s)for(var ne=0,ue=p.sortKeyRanges;ne<ue.length;ne+=1){var me=ue[ne];i.push({sortKey:me.sortKey,symbolInstanceStart:me.symbolInstanceStart,symbolInstanceEnd:me.symbolInstanceEnd,parameters:Q})}else i.push({symbolInstanceStart:0,symbolInstanceEnd:p.symbolInstances.length,parameters:Q})}},Ii.prototype.attemptAnchorPlacement=function(i,o,n,s,p,f,d,v,w,A,R,F,O,W,Z){var ee,N=[F.textOffset0,F.textOffset1],Q=di(i,n,s,N,p),ne=this.collisionIndex.placeCollisionBox(In(o,Q.x,Q.y,f,d,this.transform.angle),R,v,w,A.predicate);if(!Z||this.collisionIndex.placeCollisionBox(In(Z,Q.x,Q.y,f,d,this.transform.angle),R,v,w,A.predicate).box.length!==0)return ne.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[F.crossTileID]&&this.prevPlacement.placements[F.crossTileID]&&this.prevPlacement.placements[F.crossTileID].text&&(ee=this.prevPlacement.variableOffsets[F.crossTileID].anchor),this.variableOffsets[F.crossTileID]={textOffset:N,width:n,height:s,anchor:i,textBoxScale:p,prevAnchor:ee},this.markUsedJustification(O,i,F,W),O.allowVerticalPlacement&&(this.markUsedOrientation(O,W,F),this.placedOrientations[F.crossTileID]=W),{shift:Q,placedGlyphBoxes:ne}):void 0},Ii.prototype.placeLayerBucketPart=function(i,o,n){var s=this,p=i.parameters,f=p.bucket,d=p.layout,v=p.posMatrix,w=p.textLabelPlaneMatrix,A=p.labelToScreenMatrix,R=p.textPixelRatio,F=p.holdingForFade,O=p.collisionBoxArray,W=p.partiallyEvaluatedTextSize,Z=p.collisionGroup,ee=d.get("text-optional"),N=d.get("icon-optional"),Q=d.get("text-allow-overlap"),ne=d.get("icon-allow-overlap"),ue=d.get("text-rotation-alignment")==="map",me=d.get("text-pitch-alignment")==="map",pe=d.get("icon-text-fit")!=="none",ve=d.get("symbol-z-order")==="viewport-y",Te=Q&&(ne||!f.hasIconData()||N),ke=ne&&(Q||!f.hasTextData()||ee);!f.collisionArrays&&O&&f.deserializeCollisionBoxes(O);var Ce=function(We,mt){if(!o[We.crossTileID])if(F)s.placements[We.crossTileID]=new al(!1,!1,!1);else{var xt,dt=!1,ft=!1,gt=!0,ht=null,ct={box:null,offscreen:null},Jr={box:null,offscreen:null},Ir=null,gi=null,si=0,wr=0,Mr=0;mt.textFeatureIndex?si=mt.textFeatureIndex:We.useRuntimeCollisionCircles&&(si=We.featureIndex),mt.verticalTextFeatureIndex&&(wr=mt.verticalTextFeatureIndex);var Wi=mt.textBox;if(Wi){var Ei=function(Zt){var en=u.WritingMode.horizontal;if(f.allowVerticalPlacement&&!Zt&&s.prevPlacement){var Li=s.prevPlacement.placedOrientations[We.crossTileID];Li&&(s.placedOrientations[We.crossTileID]=Li,s.markUsedOrientation(f,en=Li,We))}return en},no=function(Zt,en){if(f.allowVerticalPlacement&&We.numVerticalGlyphVertices>0&&mt.verticalTextBox)for(var Li=0,Ro=f.writingModes;Li<Ro.length&&(Ro[Li]===u.WritingMode.vertical?(ct=en(),Jr=ct):ct=Zt(),!(ct&&ct.box&&ct.box.length));Li+=1);else ct=Zt()};if(d.get("text-variable-anchor")){var Ri=d.get("text-variable-anchor");if(s.prevPlacement&&s.prevPlacement.variableOffsets[We.crossTileID]){var wn=s.prevPlacement.variableOffsets[We.crossTileID];Ri.indexOf(wn.anchor)>0&&(Ri=Ri.filter((function(Zt){return Zt!==wn.anchor}))).unshift(wn.anchor)}var cn=function(Zt,en,Li){for(var Ro=Zt.x2-Zt.x1,Nc=Zt.y2-Zt.y1,_s=We.textBoxScale,jc=pe&&!ne?en:null,Oa={box:[],offscreen:!1},Fl=Q?2*Ri.length:Ri.length,aa=0;aa<Fl;++aa){var xs=s.attemptAnchorPlacement(Ri[aa%Ri.length],Zt,Ro,Nc,_s,ue,me,R,v,Z,aa>=Ri.length,We,f,Li,jc);if(xs&&(Oa=xs.placedGlyphBoxes)&&Oa.box&&Oa.box.length){dt=!0,ht=xs.shift;break}}return Oa};no((function(){return cn(Wi,mt.iconBox,u.WritingMode.horizontal)}),(function(){var Zt=mt.verticalTextBox;return f.allowVerticalPlacement&&!(ct&&ct.box&&ct.box.length)&&We.numVerticalGlyphVertices>0&&Zt?cn(Zt,mt.verticalIconBox,u.WritingMode.vertical):{box:null,offscreen:null}})),ct&&(dt=ct.box,gt=ct.offscreen);var Ra=Ei(ct&&ct.box);if(!dt&&s.prevPlacement){var na=s.prevPlacement.variableOffsets[We.crossTileID];na&&(s.variableOffsets[We.crossTileID]=na,s.markUsedJustification(f,na.anchor,We,Ra))}}else{var oo=function(Zt,en){var Li=s.collisionIndex.placeCollisionBox(Zt,Q,R,v,Z.predicate);return Li&&Li.box&&Li.box.length&&(s.markUsedOrientation(f,en,We),s.placedOrientations[We.crossTileID]=en),Li};no((function(){return oo(Wi,u.WritingMode.horizontal)}),(function(){var Zt=mt.verticalTextBox;return f.allowVerticalPlacement&&We.numVerticalGlyphVertices>0&&Zt?oo(Zt,u.WritingMode.vertical):{box:null,offscreen:null}})),Ei(ct&&ct.box&&ct.box.length)}}if(dt=(xt=ct)&&xt.box&&xt.box.length>0,gt=xt&&xt.offscreen,We.useRuntimeCollisionCircles){var oa=f.text.placedSymbolArray.get(We.centerJustifiedTextSymbolIndex),La=u.evaluateSizeForFeature(f.textSizeData,W,oa),Pn=d.get("text-padding");Ir=s.collisionIndex.placeCollisionCircles(Q,oa,f.lineVertexArray,f.glyphOffsetArray,La,v,w,A,n,me,Z.predicate,We.collisionCircleDiameter,Pn),dt=Q||Ir.circles.length>0&&!Ir.collisionDetected,gt=gt&&Ir.offscreen}if(mt.iconFeatureIndex&&(Mr=mt.iconFeatureIndex),mt.iconBox){var Fa=function(Zt){var en=pe&&ht?In(Zt,ht.x,ht.y,ue,me,s.transform.angle):Zt;return s.collisionIndex.placeCollisionBox(en,ne,R,v,Z.predicate)};ft=Jr&&Jr.box&&Jr.box.length&&mt.verticalIconBox?(gi=Fa(mt.verticalIconBox)).box.length>0:(gi=Fa(mt.iconBox)).box.length>0,gt=gt&&gi.offscreen}var Cn=ee||We.numHorizontalGlyphVertices===0&&We.numVerticalGlyphVertices===0,Yr=N||We.numIconVertices===0;if(Cn||Yr?Yr?Cn||(ft=ft&&dt):dt=ft&&dt:ft=dt=ft&&dt,dt&&xt&&xt.box&&s.collisionIndex.insertCollisionBox(xt.box,d.get("text-ignore-placement"),f.bucketInstanceId,Jr&&Jr.box&&wr?wr:si,Z.ID),ft&&gi&&s.collisionIndex.insertCollisionBox(gi.box,d.get("icon-ignore-placement"),f.bucketInstanceId,Mr,Z.ID),Ir&&(dt&&s.collisionIndex.insertCollisionCircles(Ir.circles,d.get("text-ignore-placement"),f.bucketInstanceId,si,Z.ID),n)){var On=f.bucketInstanceId,ao=s.collisionCircleArrays[On];ao===void 0&&(ao=s.collisionCircleArrays[On]=new on);for(var Do=0;Do<Ir.circles.length;Do+=4)ao.circles.push(Ir.circles[Do+0]),ao.circles.push(Ir.circles[Do+1]),ao.circles.push(Ir.circles[Do+2]),ao.circles.push(Ir.collisionDetected?1:0)}s.placements[We.crossTileID]=new al(dt||Te,ft||ke,gt||f.justReloaded),o[We.crossTileID]=!0}};if(ve)for(var $e=f.getSortedSymbolIndexes(this.transform.angle),nt=$e.length-1;nt>=0;--nt){var ut=$e[nt];Ce(f.symbolInstances.get(ut),f.collisionArrays[ut])}else for(var st=i.symbolInstanceStart;st<i.symbolInstanceEnd;st++)Ce(f.symbolInstances.get(st),f.collisionArrays[st]);if(n&&f.bucketInstanceId in this.collisionCircleArrays){var Ft=this.collisionCircleArrays[f.bucketInstanceId];u.invert(Ft.invProjMatrix,v),Ft.viewportMatrix=this.collisionIndex.getViewportMatrix()}f.justReloaded=!1},Ii.prototype.markUsedJustification=function(i,o,n,s){var p;p=s===u.WritingMode.vertical?n.verticalPlacedTextSymbolIndex:{left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex}[u.getAnchorJustification(o)];for(var f=0,d=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];f<d.length;f+=1){var v=d[f];v>=0&&(i.text.placedSymbolArray.get(v).crossTileID=p>=0&&v!==p?0:n.crossTileID)}},Ii.prototype.markUsedOrientation=function(i,o,n){for(var s=o===u.WritingMode.horizontal||o===u.WritingMode.horizontalOnly?o:0,p=o===u.WritingMode.vertical?o:0,f=0,d=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];f<d.length;f+=1)i.text.placedSymbolArray.get(d[f]).placedOrientation=s;n.verticalPlacedTextSymbolIndex&&(i.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=p)},Ii.prototype.commit=function(i){this.commitTime=i,this.zoomAtLastRecencyCheck=this.transform.zoom;var o=this.prevPlacement,n=!1;this.prevZoomAdjustment=o?o.zoomAdjustment(this.transform.zoom):0;var s=o?o.symbolFadeChange(i):1,p=o?o.opacities:{},f=o?o.variableOffsets:{},d=o?o.placedOrientations:{};for(var v in this.placements){var w=this.placements[v],A=p[v];A?(this.opacities[v]=new Ji(A,s,w.text,w.icon),n=n||w.text!==A.text.placed||w.icon!==A.icon.placed):(this.opacities[v]=new Ji(null,s,w.text,w.icon,w.skipFade),n=n||w.text||w.icon)}for(var R in p){var F=p[R];if(!this.opacities[R]){var O=new Ji(F,s,!1,!1);O.isHidden()||(this.opacities[R]=O,n=n||F.text.placed||F.icon.placed)}}for(var W in f)this.variableOffsets[W]||!this.opacities[W]||this.opacities[W].isHidden()||(this.variableOffsets[W]=f[W]);for(var Z in d)this.placedOrientations[Z]||!this.opacities[Z]||this.opacities[Z].isHidden()||(this.placedOrientations[Z]=d[Z]);n?this.lastPlacementChangeTime=i:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=o?o.lastPlacementChangeTime:i)},Ii.prototype.updateLayerOpacities=function(i,o){for(var n={},s=0,p=o;s<p.length;s+=1){var f=p[s],d=f.getBucket(i);d&&f.latestFeatureIndex&&i.id===d.layerIds[0]&&this.updateBucketOpacities(d,n,f.collisionBoxArray)}},Ii.prototype.updateBucketOpacities=function(i,o,n){var s=this;i.hasTextData()&&i.text.opacityVertexArray.clear(),i.hasIconData()&&i.icon.opacityVertexArray.clear(),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexArray.clear(),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexArray.clear();var p=i.layers[0].layout,f=new Ji(null,0,!1,!1,!0),d=p.get("text-allow-overlap"),v=p.get("icon-allow-overlap"),w=p.get("text-variable-anchor"),A=p.get("text-rotation-alignment")==="map",R=p.get("text-pitch-alignment")==="map",F=p.get("icon-text-fit")!=="none",O=new Ji(null,0,d&&(v||!i.hasIconData()||p.get("icon-optional")),v&&(d||!i.hasTextData()||p.get("text-optional")),!0);!i.collisionArrays&&n&&(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData())&&i.deserializeCollisionBoxes(n);for(var W=function(Q,ne,ue){for(var me=0;me<ne/4;me++)Q.opacityVertexArray.emplaceBack(ue)},Z=function(Q){var ne=i.symbolInstances.get(Q),ue=ne.numHorizontalGlyphVertices,me=ne.numVerticalGlyphVertices,pe=ne.crossTileID,ve=s.opacities[pe];o[pe]?ve=f:ve||(s.opacities[pe]=ve=O),o[pe]=!0;var Te=ne.numIconVertices>0,ke=s.placedOrientations[ne.crossTileID],Ce=ke===u.WritingMode.vertical,$e=ke===u.WritingMode.horizontal||ke===u.WritingMode.horizontalOnly;if(ue>0||me>0){var nt=ll(ve.text);W(i.text,ue,Ce?Wo:nt),W(i.text,me,$e?Wo:nt);var ut=ve.text.isHidden();[ne.rightJustifiedTextSymbolIndex,ne.centerJustifiedTextSymbolIndex,ne.leftJustifiedTextSymbolIndex].forEach((function(ct){ct>=0&&(i.text.placedSymbolArray.get(ct).hidden=ut||Ce?1:0)})),ne.verticalPlacedTextSymbolIndex>=0&&(i.text.placedSymbolArray.get(ne.verticalPlacedTextSymbolIndex).hidden=ut||$e?1:0);var st=s.variableOffsets[ne.crossTileID];st&&s.markUsedJustification(i,st.anchor,ne,ke);var Ft=s.placedOrientations[ne.crossTileID];Ft&&(s.markUsedJustification(i,"left",ne,Ft),s.markUsedOrientation(i,Ft,ne))}if(Te){var We=ll(ve.icon),mt=!(F&&ne.verticalPlacedIconSymbolIndex&&Ce);ne.placedIconSymbolIndex>=0&&(W(i.icon,ne.numIconVertices,mt?We:Wo),i.icon.placedSymbolArray.get(ne.placedIconSymbolIndex).hidden=ve.icon.isHidden()),ne.verticalPlacedIconSymbolIndex>=0&&(W(i.icon,ne.numVerticalIconVertices,mt?Wo:We),i.icon.placedSymbolArray.get(ne.verticalPlacedIconSymbolIndex).hidden=ve.icon.isHidden())}if(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData()){var xt=i.collisionArrays[Q];if(xt){var dt=new u.Point(0,0);if(xt.textBox||xt.verticalTextBox){var ft=!0;if(w){var gt=s.variableOffsets[pe];gt?(dt=di(gt.anchor,gt.width,gt.height,gt.textOffset,gt.textBoxScale),A&&dt._rotate(R?s.transform.angle:-s.transform.angle)):ft=!1}xt.textBox&&vo(i.textCollisionBox.collisionVertexArray,ve.text.placed,!ft||Ce,dt.x,dt.y),xt.verticalTextBox&&vo(i.textCollisionBox.collisionVertexArray,ve.text.placed,!ft||$e,dt.x,dt.y)}var ht=!!(!$e&&xt.verticalIconBox);xt.iconBox&&vo(i.iconCollisionBox.collisionVertexArray,ve.icon.placed,ht,F?dt.x:0,F?dt.y:0),xt.verticalIconBox&&vo(i.iconCollisionBox.collisionVertexArray,ve.icon.placed,!ht,F?dt.x:0,F?dt.y:0)}}},ee=0;ee<i.symbolInstances.length;ee++)Z(ee);if(i.sortFeatures(this.transform.angle),this.retainedQueryData[i.bucketInstanceId]&&(this.retainedQueryData[i.bucketInstanceId].featureSortOrder=i.featureSortOrder),i.hasTextData()&&i.text.opacityVertexBuffer&&i.text.opacityVertexBuffer.updateData(i.text.opacityVertexArray),i.hasIconData()&&i.icon.opacityVertexBuffer&&i.icon.opacityVertexBuffer.updateData(i.icon.opacityVertexArray),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexBuffer&&i.iconCollisionBox.collisionVertexBuffer.updateData(i.iconCollisionBox.collisionVertexArray),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexBuffer&&i.textCollisionBox.collisionVertexBuffer.updateData(i.textCollisionBox.collisionVertexArray),i.bucketInstanceId in this.collisionCircleArrays){var N=this.collisionCircleArrays[i.bucketInstanceId];i.placementInvProjMatrix=N.invProjMatrix,i.placementViewportMatrix=N.viewportMatrix,i.collisionCircleArray=N.circles,delete this.collisionCircleArrays[i.bucketInstanceId]}},Ii.prototype.symbolFadeChange=function(i){return this.fadeDuration===0?1:(i-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},Ii.prototype.zoomAdjustment=function(i){return Math.max(0,(this.transform.zoom-i)/1.5)},Ii.prototype.hasTransitions=function(i){return this.stale||i-this.lastPlacementChangeTime<this.fadeDuration},Ii.prototype.stillRecent=function(i,o){var n=this.zoomAtLastRecencyCheck===o?1-this.zoomAdjustment(o):1;return this.zoomAtLastRecencyCheck=o,this.commitTime+this.fadeDuration*n>i},Ii.prototype.setStale=function(){this.stale=!0};var Cc=Math.pow(2,25),kc=Math.pow(2,24),iu=Math.pow(2,17),Mc=Math.pow(2,16),sl=Math.pow(2,9),Bc=Math.pow(2,8),ul=Math.pow(2,1);function ll(i){if(i.opacity===0&&!i.placed)return 0;if(i.opacity===1&&i.placed)return 4294967295;var o=i.placed?1:0,n=Math.floor(127*i.opacity);return n*Cc+o*kc+n*iu+o*Mc+n*sl+o*Bc+n*ul+o}var Wo=0,nu=function(i){this._sortAcrossTiles=i.layout.get("symbol-z-order")!=="viewport-y"&&i.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};nu.prototype.continuePlacement=function(i,o,n,s,p){for(var f=this._bucketParts;this._currentTileIndex<i.length;)if(o.getBucketParts(f,s,i[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,p())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,f.sort((function(d,v){return d.sortKey-v.sortKey})));this._currentPartIndex<f.length;)if(o.placeLayerBucketPart(f[this._currentPartIndex],this._seenCrossTileIDs,n),this._currentPartIndex++,p())return!0;return!1};var ga=function(i,o,n,s,p,f,d){this.placement=new Ii(i,p,f,d),this._currentPlacementIndex=o.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=s,this._done=!1};ga.prototype.isDone=function(){return this._done},ga.prototype.continuePlacement=function(i,o,n){for(var s=this,p=u.browser.now(),f=function(){var w=u.browser.now()-p;return!s._forceFullPlacement&&w>2};this._currentPlacementIndex>=0;){var d=o[i[this._currentPlacementIndex]],v=this.placement.collisionIndex.transform.zoom;if(d.type==="symbol"&&(!d.minzoom||d.minzoom<=v)&&(!d.maxzoom||d.maxzoom>v)){if(this._inProgressLayer||(this._inProgressLayer=new nu(d)),this._inProgressLayer.continuePlacement(n[d.source],this.placement,this._showCollisionBoxes,d,f))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},ga.prototype.commit=function(i){return this.placement.commit(i),this.placement};var cl=512/u.EXTENT/2,Qa=function(i,o,n){this.tileID=i,this.indexedSymbolInstances={},this.bucketInstanceId=n;for(var s=0;s<o.length;s++){var p=o.get(s),f=p.key;this.indexedSymbolInstances[f]||(this.indexedSymbolInstances[f]=[]),this.indexedSymbolInstances[f].push({crossTileID:p.crossTileID,coord:this.getScaledCoordinates(p,i)})}};Qa.prototype.getScaledCoordinates=function(i,o){var n=cl/Math.pow(2,o.canonical.z-this.tileID.canonical.z);return{x:Math.floor((o.canonical.x*u.EXTENT+i.anchorX)*n),y:Math.floor((o.canonical.y*u.EXTENT+i.anchorY)*n)}},Qa.prototype.findMatches=function(i,o,n){for(var s=this.tileID.canonical.z<o.canonical.z?1:Math.pow(2,this.tileID.canonical.z-o.canonical.z),p=0;p<i.length;p++){var f=i.get(p);if(!f.crossTileID){var d=this.indexedSymbolInstances[f.key];if(d)for(var v=this.getScaledCoordinates(f,o),w=0,A=d;w<A.length;w+=1){var R=A[w];if(Math.abs(R.coord.x-v.x)<=s&&Math.abs(R.coord.y-v.y)<=s&&!n[R.crossTileID]){n[R.crossTileID]=!0,f.crossTileID=R.crossTileID;break}}}}};var an=function(){this.maxCrossTileID=0};an.prototype.generate=function(){return++this.maxCrossTileID};var Gn=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Gn.prototype.handleWrapJump=function(i){var o=Math.round((i-this.lng)/360);if(o!==0)for(var n in this.indexes){var s=this.indexes[n],p={};for(var f in s){var d=s[f];d.tileID=d.tileID.unwrapTo(d.tileID.wrap+o),p[d.tileID.key]=d}this.indexes[n]=p}this.lng=i},Gn.prototype.addBucket=function(i,o,n){if(this.indexes[i.overscaledZ]&&this.indexes[i.overscaledZ][i.key]){if(this.indexes[i.overscaledZ][i.key].bucketInstanceId===o.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(i.overscaledZ,this.indexes[i.overscaledZ][i.key])}for(var s=0;s<o.symbolInstances.length;s++)o.symbolInstances.get(s).crossTileID=0;this.usedCrossTileIDs[i.overscaledZ]||(this.usedCrossTileIDs[i.overscaledZ]={});var p=this.usedCrossTileIDs[i.overscaledZ];for(var f in this.indexes){var d=this.indexes[f];if(Number(f)>i.overscaledZ)for(var v in d){var w=d[v];w.tileID.isChildOf(i)&&w.findMatches(o.symbolInstances,i,p)}else{var A=d[i.scaledTo(Number(f)).key];A&&A.findMatches(o.symbolInstances,i,p)}}for(var R=0;R<o.symbolInstances.length;R++){var F=o.symbolInstances.get(R);F.crossTileID||(F.crossTileID=n.generate(),p[F.crossTileID]=!0)}return this.indexes[i.overscaledZ]===void 0&&(this.indexes[i.overscaledZ]={}),this.indexes[i.overscaledZ][i.key]=new Qa(i,o.symbolInstances,o.bucketInstanceId),!0},Gn.prototype.removeBucketCrossTileIDs=function(i,o){for(var n in o.indexedSymbolInstances)for(var s=0,p=o.indexedSymbolInstances[n];s<p.length;s+=1)delete this.usedCrossTileIDs[i][p[s].crossTileID]},Gn.prototype.removeStaleBuckets=function(i){var o=!1;for(var n in this.indexes){var s=this.indexes[n];for(var p in s)i[s[p].bucketInstanceId]||(this.removeBucketCrossTileIDs(n,s[p]),delete s[p],o=!0)}return o};var $n=function(){this.layerIndexes={},this.crossTileIDs=new an,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};$n.prototype.addLayer=function(i,o,n){var s=this.layerIndexes[i.id];s===void 0&&(s=this.layerIndexes[i.id]=new Gn);var p=!1,f={};s.handleWrapJump(n);for(var d=0,v=o;d<v.length;d+=1){var w=v[d],A=w.getBucket(i);A&&i.id===A.layerIds[0]&&(A.bucketInstanceId||(A.bucketInstanceId=++this.maxBucketInstanceId),s.addBucket(w.tileID,A,this.crossTileIDs)&&(p=!0),f[A.bucketInstanceId]=!0)}return s.removeStaleBuckets(f)&&(p=!0),p},$n.prototype.pruneUnusedLayers=function(i){var o={};for(var n in i.forEach((function(s){o[s]=!0})),this.layerIndexes)o[n]||delete this.layerIndexes[n]};var go=function(i,o){return u.emitValidationErrors(i,o&&o.filter((function(n){return n.identifier!=="source.canvas"})))},Zn=u.pick(Me,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Wn=u.pick(Me,["setCenter","setZoom","setBearing","setPitch"]),es=(function(){var i={},o=u.styleSpec.$version;for(var n in u.styleSpec.$root){var s,p=u.styleSpec.$root[n];p.required&&(s=n==="version"?o:p.type==="array"?[]:{})!=null&&(i[n]=s)}return i})(),Ui=(function(i){function o(n,s){var p=this;s===void 0&&(s={}),i.call(this),this.map=n,this.dispatcher=new Ut(ge(),this),this.imageManager=new Ue,this.imageManager.setEventedParent(this),this.glyphManager=new Le(n._requestManager,s.localIdeographFontFamily),this.lineAtlas=new St(256,512),this.crossTileSymbolIndex=new $n,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new u.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",u.getReferrer());var f=this;this._rtlTextPluginCallback=o.registerForPluginStateChange((function(d){f.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:d.pluginStatus,pluginURL:d.pluginURL},(function(v,w){if(u.triggerPluginCompletionEvent(v),w&&w.every((function(R){return R})))for(var A in f.sourceCaches)f.sourceCaches[A].reload()}))})),this.on("data",(function(d){if(d.dataType==="source"&&d.sourceDataType==="metadata"){var v=p.sourceCaches[d.sourceId];if(v){var w=v.getSource();if(w&&w.vectorLayerIds)for(var A in p._layers){var R=p._layers[A];R.source===w.id&&p._validateLayer(R)}}}}))}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.loadURL=function(n,s){var p=this;s===void 0&&(s={}),this.fire(new u.Event("dataloading",{dataType:"style"}));var f=typeof s.validate=="boolean"?s.validate:!u.isMapboxURL(n);n=this.map._requestManager.normalizeStyleURL(n,s.accessToken);var d=this.map._requestManager.transformRequest(n,u.ResourceType.Style);this._request=u.getJSON(d,(function(v,w){p._request=null,v?p.fire(new u.ErrorEvent(v)):w&&p._load(w,f)}))},o.prototype.loadJSON=function(n,s){var p=this;s===void 0&&(s={}),this.fire(new u.Event("dataloading",{dataType:"style"})),this._request=u.browser.frame((function(){p._request=null,p._load(n,s.validate!==!1)}))},o.prototype.loadEmpty=function(){this.fire(new u.Event("dataloading",{dataType:"style"})),this._load(es,!1)},o.prototype._load=function(n,s){if(!s||!go(this,u.validateStyle(n))){for(var p in this._loaded=!0,this.stylesheet=n,n.sources)this.addSource(p,n.sources[p],{validate:!1});n.sprite?this._loadSprite(n.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(n.glyphs);var f=Be(this.stylesheet.layers);this._order=f.map((function(A){return A.id})),this._layers={},this._serializedLayers={};for(var d=0,v=f;d<v.length;d+=1){var w=v[d];(w=u.createStyleLayer(w)).setEventedParent(this,{layer:{id:w.id}}),this._layers[w.id]=w,this._serializedLayers[w.id]=w.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new Wt(this.stylesheet.light),this.fire(new u.Event("data",{dataType:"style"})),this.fire(new u.Event("style.load"))}},o.prototype._loadSprite=function(n){var s=this;this._spriteRequest=(function(p,f,d){var v,w,A,R=u.browser.devicePixelRatio>1?"@2x":"",F=u.getJSON(f.transformRequest(f.normalizeSpriteURL(p,R,".json"),u.ResourceType.SpriteJSON),(function(Z,ee){F=null,A||(A=Z,v=ee,W())})),O=u.getImage(f.transformRequest(f.normalizeSpriteURL(p,R,".png"),u.ResourceType.SpriteImage),(function(Z,ee){O=null,A||(A=Z,w=ee,W())}));function W(){if(A)d(A);else if(v&&w){var Z=u.browser.getImageData(w),ee={};for(var N in v){var Q=v[N],ne=Q.width,ue=Q.height,me=Q.x,pe=Q.y,ve=Q.sdf,Te=Q.pixelRatio,ke=Q.stretchX,Ce=Q.stretchY,$e=Q.content,nt=new u.RGBAImage({width:ne,height:ue});u.RGBAImage.copy(Z,nt,{x:me,y:pe},{x:0,y:0},{width:ne,height:ue}),ee[N]={data:nt,pixelRatio:Te,sdf:ve,stretchX:ke,stretchY:Ce,content:$e}}d(null,ee)}}return{cancel:function(){F&&(F.cancel(),F=null),O&&(O.cancel(),O=null)}}})(n,this.map._requestManager,(function(p,f){if(s._spriteRequest=null,p)s.fire(new u.ErrorEvent(p));else if(f)for(var d in f)s.imageManager.addImage(d,f[d]);s.imageManager.setLoaded(!0),s._availableImages=s.imageManager.listImages(),s.dispatcher.broadcast("setImages",s._availableImages),s.fire(new u.Event("data",{dataType:"style"}))}))},o.prototype._validateLayer=function(n){var s=this.sourceCaches[n.source];if(s){var p=n.sourceLayer;if(p){var f=s.getSource();(f.type==="geojson"||f.vectorLayerIds&&f.vectorLayerIds.indexOf(p)===-1)&&this.fire(new u.ErrorEvent(new Error('Source layer "'+p+'" does not exist on source "'+f.id+'" as specified by style layer "'+n.id+'"')))}}},o.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var n in this.sourceCaches)if(!this.sourceCaches[n].loaded())return!1;return!!this.imageManager.isLoaded()},o.prototype._serializeLayers=function(n){for(var s=[],p=0,f=n;p<f.length;p+=1){var d=this._layers[f[p]];d.type!=="custom"&&s.push(d.serialize())}return s},o.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var n in this.sourceCaches)if(this.sourceCaches[n].hasTransition())return!0;for(var s in this._layers)if(this._layers[s].hasTransition())return!0;return!1},o.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},o.prototype.update=function(n){if(this._loaded){var s=this._changed;if(this._changed){var p=Object.keys(this._updatedLayers),f=Object.keys(this._removedLayers);for(var d in(p.length||f.length)&&this._updateWorkerLayers(p,f),this._updatedSources){var v=this._updatedSources[d];v==="reload"?this._reloadSource(d):v==="clear"&&this._clearSource(d)}for(var w in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[w].updateTransitions(n);this.light.updateTransitions(n),this._resetUpdates()}var A={};for(var R in this.sourceCaches){var F=this.sourceCaches[R];A[R]=F.used,F.used=!1}for(var O=0,W=this._order;O<W.length;O+=1){var Z=this._layers[W[O]];Z.recalculate(n,this._availableImages),!Z.isHidden(n.zoom)&&Z.source&&(this.sourceCaches[Z.source].used=!0)}for(var ee in A){var N=this.sourceCaches[ee];A[ee]!==N.used&&N.fire(new u.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:ee}))}this.light.recalculate(n),this.z=n.zoom,s&&this.fire(new u.Event("data",{dataType:"style"}))}},o.prototype._updateTilesForChangedImages=function(){var n=Object.keys(this._changedImages);if(n.length){for(var s in this.sourceCaches)this.sourceCaches[s].reloadTilesForDependencies(["icons","patterns"],n);this._changedImages={}}},o.prototype._updateWorkerLayers=function(n,s){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(n),removedIds:s})},o.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},o.prototype.setState=function(n){var s=this;if(this._checkLoaded(),go(this,u.validateStyle(n)))return!1;(n=u.clone$1(n)).layers=Be(n.layers);var p=(function(d,v){if(!d)return[{command:Me.setStyle,args:[v]}];var w=[];try{if(!u.deepEqual(d.version,v.version))return[{command:Me.setStyle,args:[v]}];u.deepEqual(d.center,v.center)||w.push({command:Me.setCenter,args:[v.center]}),u.deepEqual(d.zoom,v.zoom)||w.push({command:Me.setZoom,args:[v.zoom]}),u.deepEqual(d.bearing,v.bearing)||w.push({command:Me.setBearing,args:[v.bearing]}),u.deepEqual(d.pitch,v.pitch)||w.push({command:Me.setPitch,args:[v.pitch]}),u.deepEqual(d.sprite,v.sprite)||w.push({command:Me.setSprite,args:[v.sprite]}),u.deepEqual(d.glyphs,v.glyphs)||w.push({command:Me.setGlyphs,args:[v.glyphs]}),u.deepEqual(d.transition,v.transition)||w.push({command:Me.setTransition,args:[v.transition]}),u.deepEqual(d.light,v.light)||w.push({command:Me.setLight,args:[v.light]});var A={},R=[];(function(O,W,Z,ee){var N;for(N in W=W||{},O=O||{})O.hasOwnProperty(N)&&(W.hasOwnProperty(N)||Fe(N,Z,ee));for(N in W)W.hasOwnProperty(N)&&(O.hasOwnProperty(N)?u.deepEqual(O[N],W[N])||(O[N].type==="geojson"&&W[N].type==="geojson"&&rr(O,W,N)?Z.push({command:Me.setGeoJSONSourceData,args:[N,W[N].data]}):Pt(N,W,Z,ee)):yt(N,W,Z))})(d.sources,v.sources,R,A);var F=[];d.layers&&d.layers.forEach((function(O){A[O.source]?w.push({command:Me.removeLayer,args:[O.id]}):F.push(O)})),w=w.concat(R),(function(O,W,Z){W=W||[];var ee,N,Q,ne,ue,me,pe,ve=(O=O||[]).map(Gt),Te=W.map(Gt),ke=O.reduce(Rt,{}),Ce=W.reduce(Rt,{}),$e=ve.slice(),nt=Object.create(null);for(ee=0,N=0;ee<ve.length;ee++)Ce.hasOwnProperty(Q=ve[ee])?N++:(Z.push({command:Me.removeLayer,args:[Q]}),$e.splice($e.indexOf(Q,N),1));for(ee=0,N=0;ee<Te.length;ee++)$e[$e.length-1-ee]!==(Q=Te[Te.length-1-ee])&&(ke.hasOwnProperty(Q)?(Z.push({command:Me.removeLayer,args:[Q]}),$e.splice($e.lastIndexOf(Q,$e.length-N),1)):N++,Z.push({command:Me.addLayer,args:[Ce[Q],me=$e[$e.length-ee]]}),$e.splice($e.length-ee,0,Q),nt[Q]=!0);for(ee=0;ee<Te.length;ee++)if(ne=ke[Q=Te[ee]],ue=Ce[Q],!nt[Q]&&!u.deepEqual(ne,ue))if(u.deepEqual(ne.source,ue.source)&&u.deepEqual(ne["source-layer"],ue["source-layer"])&&u.deepEqual(ne.type,ue.type)){for(pe in Ct(ne.layout,ue.layout,Z,Q,null,Me.setLayoutProperty),Ct(ne.paint,ue.paint,Z,Q,null,Me.setPaintProperty),u.deepEqual(ne.filter,ue.filter)||Z.push({command:Me.setFilter,args:[Q,ue.filter]}),u.deepEqual(ne.minzoom,ue.minzoom)&&u.deepEqual(ne.maxzoom,ue.maxzoom)||Z.push({command:Me.setLayerZoomRange,args:[Q,ue.minzoom,ue.maxzoom]}),ne)ne.hasOwnProperty(pe)&&pe!=="layout"&&pe!=="paint"&&pe!=="filter"&&pe!=="metadata"&&pe!=="minzoom"&&pe!=="maxzoom"&&(pe.indexOf("paint.")===0?Ct(ne[pe],ue[pe],Z,Q,pe.slice(6),Me.setPaintProperty):u.deepEqual(ne[pe],ue[pe])||Z.push({command:Me.setLayerProperty,args:[Q,pe,ue[pe]]}));for(pe in ue)ue.hasOwnProperty(pe)&&!ne.hasOwnProperty(pe)&&pe!=="layout"&&pe!=="paint"&&pe!=="filter"&&pe!=="metadata"&&pe!=="minzoom"&&pe!=="maxzoom"&&(pe.indexOf("paint.")===0?Ct(ne[pe],ue[pe],Z,Q,pe.slice(6),Me.setPaintProperty):u.deepEqual(ne[pe],ue[pe])||Z.push({command:Me.setLayerProperty,args:[Q,pe,ue[pe]]}))}else Z.push({command:Me.removeLayer,args:[Q]}),me=$e[$e.lastIndexOf(Q)+1],Z.push({command:Me.addLayer,args:[ue,me]})})(F,v.layers,w)}catch(O){console.warn("Unable to compute style diff:",O),w=[{command:Me.setStyle,args:[v]}]}return w})(this.serialize(),n).filter((function(d){return!(d.command in Wn)}));if(p.length===0)return!1;var f=p.filter((function(d){return!(d.command in Zn)}));if(f.length>0)throw new Error("Unimplemented: "+f.map((function(d){return d.command})).join(", ")+".");return p.forEach((function(d){d.command!=="setTransition"&&s[d.command].apply(s,d.args)})),this.stylesheet=n,!0},o.prototype.addImage=function(n,s){if(this.getImage(n))return this.fire(new u.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(n,s),this._afterImageUpdated(n)},o.prototype.updateImage=function(n,s){this.imageManager.updateImage(n,s)},o.prototype.getImage=function(n){return this.imageManager.getImage(n)},o.prototype.removeImage=function(n){if(!this.getImage(n))return this.fire(new u.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(n),this._afterImageUpdated(n)},o.prototype._afterImageUpdated=function(n){this._availableImages=this.imageManager.listImages(),this._changedImages[n]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new u.Event("data",{dataType:"style"}))},o.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},o.prototype.addSource=function(n,s,p){var f=this;if(p===void 0&&(p={}),this._checkLoaded(),this.sourceCaches[n]!==void 0)throw new Error("There is already a source with this ID");if(!s.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(s).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(s.type)>=0&&this._validate(u.validateStyle.source,"sources."+n,s,null,p))){this.map&&this.map._collectResourceTiming&&(s.collectResourceTiming=!0);var d=this.sourceCaches[n]=new H(n,s,this.dispatcher);d.style=this,d.setEventedParent(this,(function(){return{isSourceLoaded:f.loaded(),source:d.serialize(),sourceId:n}})),d.onAdd(this.map),this._changed=!0}},o.prototype.removeSource=function(n){if(this._checkLoaded(),this.sourceCaches[n]===void 0)throw new Error("There is no source with this ID");for(var s in this._layers)if(this._layers[s].source===n)return this.fire(new u.ErrorEvent(new Error('Source "'+n+'" cannot be removed while layer "'+s+'" is using it.')));var p=this.sourceCaches[n];delete this.sourceCaches[n],delete this._updatedSources[n],p.fire(new u.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:n})),p.setEventedParent(null),p.clearTiles(),p.onRemove&&p.onRemove(this.map),this._changed=!0},o.prototype.setGeoJSONSourceData=function(n,s){this._checkLoaded(),this.sourceCaches[n].getSource().setData(s),this._changed=!0},o.prototype.getSource=function(n){return this.sourceCaches[n]&&this.sourceCaches[n].getSource()},o.prototype.addLayer=function(n,s,p){p===void 0&&(p={}),this._checkLoaded();var f=n.id;if(this.getLayer(f))this.fire(new u.ErrorEvent(new Error('Layer with id "'+f+'" already exists on this map')));else{var d;if(n.type==="custom"){if(go(this,u.validateCustomStyleLayer(n)))return;d=u.createStyleLayer(n)}else{if(typeof n.source=="object"&&(this.addSource(f,n.source),n=u.clone$1(n),n=u.extend(n,{source:f})),this._validate(u.validateStyle.layer,"layers."+f,n,{arrayIndex:-1},p))return;d=u.createStyleLayer(n),this._validateLayer(d),d.setEventedParent(this,{layer:{id:f}}),this._serializedLayers[d.id]=d.serialize()}var v=s?this._order.indexOf(s):this._order.length;if(s&&v===-1)this.fire(new u.ErrorEvent(new Error('Layer with id "'+s+'" does not exist on this map.')));else{if(this._order.splice(v,0,f),this._layerOrderChanged=!0,this._layers[f]=d,this._removedLayers[f]&&d.source&&d.type!=="custom"){var w=this._removedLayers[f];delete this._removedLayers[f],w.type!==d.type?this._updatedSources[d.source]="clear":(this._updatedSources[d.source]="reload",this.sourceCaches[d.source].pause())}this._updateLayer(d),d.onAdd&&d.onAdd(this.map)}}},o.prototype.moveLayer=function(n,s){if(this._checkLoaded(),this._changed=!0,this._layers[n]){if(n!==s){var p=this._order.indexOf(n);this._order.splice(p,1);var f=s?this._order.indexOf(s):this._order.length;s&&f===-1?this.fire(new u.ErrorEvent(new Error('Layer with id "'+s+'" does not exist on this map.'))):(this._order.splice(f,0,n),this._layerOrderChanged=!0)}}else this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be moved.")))},o.prototype.removeLayer=function(n){this._checkLoaded();var s=this._layers[n];if(s){s.setEventedParent(null);var p=this._order.indexOf(n);this._order.splice(p,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[n]=s,delete this._layers[n],delete this._serializedLayers[n],delete this._updatedLayers[n],delete this._updatedPaintProps[n],s.onRemove&&s.onRemove(this.map)}else this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be removed.")))},o.prototype.getLayer=function(n){return this._layers[n]},o.prototype.hasLayer=function(n){return n in this._layers},o.prototype.setLayerZoomRange=function(n,s,p){this._checkLoaded();var f=this.getLayer(n);f?f.minzoom===s&&f.maxzoom===p||(s!=null&&(f.minzoom=s),p!=null&&(f.maxzoom=p),this._updateLayer(f)):this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot have zoom extent.")))},o.prototype.setFilter=function(n,s,p){p===void 0&&(p={}),this._checkLoaded();var f=this.getLayer(n);if(f){if(!u.deepEqual(f.filter,s))return s==null?(f.filter=void 0,void this._updateLayer(f)):void(this._validate(u.validateStyle.filter,"layers."+f.id+".filter",s,null,p)||(f.filter=u.clone$1(s),this._updateLayer(f)))}else this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be filtered.")))},o.prototype.getFilter=function(n){return u.clone$1(this.getLayer(n).filter)},o.prototype.setLayoutProperty=function(n,s,p,f){f===void 0&&(f={}),this._checkLoaded();var d=this.getLayer(n);d?u.deepEqual(d.getLayoutProperty(s),p)||(d.setLayoutProperty(s,p,f),this._updateLayer(d)):this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be styled.")))},o.prototype.getLayoutProperty=function(n,s){var p=this.getLayer(n);if(p)return p.getLayoutProperty(s);this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style.")))},o.prototype.setPaintProperty=function(n,s,p,f){f===void 0&&(f={}),this._checkLoaded();var d=this.getLayer(n);d?u.deepEqual(d.getPaintProperty(s),p)||(d.setPaintProperty(s,p,f)&&this._updateLayer(d),this._changed=!0,this._updatedPaintProps[n]=!0):this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be styled.")))},o.prototype.getPaintProperty=function(n,s){return this.getLayer(n).getPaintProperty(s)},o.prototype.setFeatureState=function(n,s){this._checkLoaded();var p=n.source,f=n.sourceLayer,d=this.sourceCaches[p];if(d!==void 0){var v=d.getSource().type;v==="geojson"&&f?this.fire(new u.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):v!=="vector"||f?(n.id===void 0&&this.fire(new u.ErrorEvent(new Error("The feature id parameter must be provided."))),d.setFeatureState(f,n.id,s)):this.fire(new u.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new u.ErrorEvent(new Error("The source '"+p+"' does not exist in the map's style.")))},o.prototype.removeFeatureState=function(n,s){this._checkLoaded();var p=n.source,f=this.sourceCaches[p];if(f!==void 0){var d=f.getSource().type,v=d==="vector"?n.sourceLayer:void 0;d!=="vector"||v?s&&typeof n.id!="string"&&typeof n.id!="number"?this.fire(new u.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):f.removeFeatureState(v,n.id,s):this.fire(new u.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new u.ErrorEvent(new Error("The source '"+p+"' does not exist in the map's style.")))},o.prototype.getFeatureState=function(n){this._checkLoaded();var s=n.source,p=n.sourceLayer,f=this.sourceCaches[s];if(f!==void 0){if(f.getSource().type!=="vector"||p)return n.id===void 0&&this.fire(new u.ErrorEvent(new Error("The feature id parameter must be provided."))),f.getFeatureState(p,n.id);this.fire(new u.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new u.ErrorEvent(new Error("The source '"+s+"' does not exist in the map's style.")))},o.prototype.getTransition=function(){return u.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},o.prototype.serialize=function(){return u.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,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,sources:u.mapObject(this.sourceCaches,(function(n){return n.serialize()})),layers:this._serializeLayers(this._order)},(function(n){return n!==void 0}))},o.prototype._updateLayer=function(n){this._updatedLayers[n.id]=!0,n.source&&!this._updatedSources[n.source]&&this.sourceCaches[n.source].getSource().type!=="raster"&&(this._updatedSources[n.source]="reload",this.sourceCaches[n.source].pause()),this._changed=!0},o.prototype._flattenAndSortRenderedFeatures=function(n){for(var s=this,p=function(ke){return s._layers[ke].type==="fill-extrusion"},f={},d=[],v=this._order.length-1;v>=0;v--){var w=this._order[v];if(p(w)){f[w]=v;for(var A=0,R=n;A<R.length;A+=1){var F=R[A][w];if(F)for(var O=0,W=F;O<W.length;O+=1)d.push(W[O])}}}d.sort((function(ke,Ce){return Ce.intersectionZ-ke.intersectionZ}));for(var Z=[],ee=this._order.length-1;ee>=0;ee--){var N=this._order[ee];if(p(N))for(var Q=d.length-1;Q>=0;Q--){var ne=d[Q].feature;if(f[ne.layer.id]<ee)break;Z.push(ne),d.pop()}else for(var ue=0,me=n;ue<me.length;ue+=1){var pe=me[ue][N];if(pe)for(var ve=0,Te=pe;ve<Te.length;ve+=1)Z.push(Te[ve].feature)}}return Z},o.prototype.queryRenderedFeatures=function(n,s,p){s&&s.filter&&this._validate(u.validateStyle.filter,"queryRenderedFeatures.filter",s.filter,null,s);var f={};if(s&&s.layers){if(!Array.isArray(s.layers))return this.fire(new u.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var d=0,v=s.layers;d<v.length;d+=1){var w=v[d],A=this._layers[w];if(!A)return this.fire(new u.ErrorEvent(new Error("The layer '"+w+"' does not exist in the map's style and cannot be queried for features."))),[];f[A.source]=!0}}var R=[];for(var F in s.availableImages=this._availableImages,this.sourceCaches)s.layers&&!f[F]||R.push(Or(this.sourceCaches[F],this._layers,this._serializedLayers,n,s,p));return this.placement&&R.push((function(O,W,Z,ee,N,Q,ne){for(var ue={},me=Q.queryRenderedSymbols(ee),pe=[],ve=0,Te=Object.keys(me).map(Number);ve<Te.length;ve+=1)pe.push(ne[Te[ve]]);pe.sort(Xi);for(var ke=function(){var st=$e[Ce],Ft=st.featureIndex.lookupSymbolFeatures(me[st.bucketInstanceId],W,st.bucketIndex,st.sourceLayerIndex,N.filter,N.layers,N.availableImages,O);for(var We in Ft){var mt=ue[We]=ue[We]||[],xt=Ft[We];xt.sort((function(gt,ht){var ct=st.featureSortOrder;if(ct){var Jr=ct.indexOf(gt.featureIndex);return ct.indexOf(ht.featureIndex)-Jr}return ht.featureIndex-gt.featureIndex}));for(var dt=0,ft=xt;dt<ft.length;dt+=1)mt.push(ft[dt])}},Ce=0,$e=pe;Ce<$e.length;Ce+=1)ke();var nt=function(st){ue[st].forEach((function(Ft){var We=Ft.feature,mt=Z[O[st].source].getFeatureState(We.layer["source-layer"],We.id);We.source=We.layer.source,We.layer["source-layer"]&&(We.sourceLayer=We.layer["source-layer"]),We.state=mt}))};for(var ut in ue)nt(ut);return ue})(this._layers,this._serializedLayers,this.sourceCaches,n,s,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(R)},o.prototype.querySourceFeatures=function(n,s){s&&s.filter&&this._validate(u.validateStyle.filter,"querySourceFeatures.filter",s.filter,null,s);var p=this.sourceCaches[n];return p?(function(f,d){for(var v=f.getRenderableIds().map((function(W){return f.getTileByID(W)})),w=[],A={},R=0;R<v.length;R++){var F=v[R],O=F.tileID.canonical.key;A[O]||(A[O]=!0,F.querySourceFeatures(w,d))}return w})(p,s):[]},o.prototype.addSourceType=function(n,s,p){return o.getSourceType(n)?p(new Error('A source type called "'+n+'" already exists.')):(o.setSourceType(n,s),s.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:n,url:s.workerSourceURL},p):p(null,null))},o.prototype.getLight=function(){return this.light.getLight()},o.prototype.setLight=function(n,s){s===void 0&&(s={}),this._checkLoaded();var p=this.light.getLight(),f=!1;for(var d in n)if(!u.deepEqual(n[d],p[d])){f=!0;break}if(f){var v={now:u.browser.now(),transition:u.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(n,s),this.light.updateTransitions(v)}},o.prototype._validate=function(n,s,p,f,d){return d===void 0&&(d={}),(!d||d.validate!==!1)&&go(this,n.call(u.validateStyle,u.extend({key:s,style:this.serialize(),value:p,styleSpec:u.styleSpec},f)))},o.prototype._remove=function(){for(var n in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),u.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[n].setEventedParent(null);for(var s in this.sourceCaches)this.sourceCaches[s].clearTiles(),this.sourceCaches[s].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},o.prototype._clearSource=function(n){this.sourceCaches[n].clearTiles()},o.prototype._reloadSource=function(n){this.sourceCaches[n].resume(),this.sourceCaches[n].reload()},o.prototype._updateSources=function(n){for(var s in this.sourceCaches)this.sourceCaches[s].update(n)},o.prototype._generateCollisionBoxes=function(){for(var n in this.sourceCaches)this._reloadSource(n)},o.prototype._updatePlacement=function(n,s,p,f,d){d===void 0&&(d=!1);for(var v=!1,w=!1,A={},R=0,F=this._order;R<F.length;R+=1){var O=this._layers[F[R]];if(O.type==="symbol"){if(!A[O.source]){var W=this.sourceCaches[O.source];A[O.source]=W.getRenderableIds(!0).map((function(ne){return W.getTileByID(ne)})).sort((function(ne,ue){return ue.tileID.overscaledZ-ne.tileID.overscaledZ||(ne.tileID.isLessThan(ue.tileID)?-1:1)}))}var Z=this.crossTileSymbolIndex.addLayer(O,A[O.source],n.center.lng);v=v||Z}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((d=d||this._layerOrderChanged||p===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(u.browser.now(),n.zoom))&&(this.pauseablePlacement=new ga(n,this._order,d,s,p,f,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,A),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(u.browser.now()),w=!0),v&&this.pauseablePlacement.placement.setStale()),w||v)for(var ee=0,N=this._order;ee<N.length;ee+=1){var Q=this._layers[N[ee]];Q.type==="symbol"&&this.placement.updateLayerOpacities(Q,A[Q.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(u.browser.now())},o.prototype._releaseSymbolFadeTiles=function(){for(var n in this.sourceCaches)this.sourceCaches[n].releaseSymbolFadeTiles()},o.prototype.getImages=function(n,s,p){this.imageManager.getImages(s.icons,p),this._updateTilesForChangedImages();var f=this.sourceCaches[s.source];f&&f.setDependencies(s.tileID.key,s.type,s.icons)},o.prototype.getGlyphs=function(n,s,p){this.glyphManager.getGlyphs(s.stacks,p)},o.prototype.getResource=function(n,s,p){return u.makeRequest(s,p)},o})(u.Evented);Ui.getSourceType=function(i){return Mi[i]},Ui.setSourceType=function(i,o){Mi[i]=o},Ui.registerForPluginStateChange=u.registerForPluginStateChange;var Vr=u.createLayout([{name:"a_pos",type:"Int16",components:2}]),Ho=ir(`#ifdef GL_ES
2
2
  precision mediump float;
3
3
  #else
4
4
  #if !defined(lowp)
@@ -24,7 +24,7 @@ precision highp float;
24
24
  #endif
25
25
  #endif
26
26
  vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
27
- );}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;}`),ul=ir(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;
27
+ );}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;}`),pl=ir(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;
28
28
  #ifdef OVERDRAW_INSPECTOR
29
29
  gl_FragColor=vec4(1.0);
30
30
  #endif
@@ -68,7 +68,7 @@ void main(void) {
68
68
  #pragma mapbox: initialize highp vec4 stroke_color
69
69
  #pragma mapbox: initialize mediump float stroke_width
70
70
  #pragma mapbox: initialize lowp float stroke_opacity
71
- vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),iu=ir("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);}"),nu=ir(`uniform highp float u_intensity;varying vec2 v_extrude;
71
+ vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),ou=ir("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);}"),au=ir(`uniform highp float u_intensity;varying vec2 v_extrude;
72
72
  #pragma mapbox: define highp float weight
73
73
  #define GAUSS_COEF 0.3989422804014327
74
74
  void main() {
@@ -85,11 +85,11 @@ const highp float ZERO=1.0/255.0/16.0;
85
85
  void main(void) {
86
86
  #pragma mapbox: initialize highp float weight
87
87
  #pragma mapbox: initialize mediump float radius
88
- vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),ou=ir(`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;
88
+ vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),su=ir(`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;
89
89
  #ifdef OVERDRAW_INSPECTOR
90
90
  gl_FragColor=vec4(0.0);
91
91
  #endif
92
- }`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),au=ir("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),ll=ir("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),cl=ir("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),Rc=ir(`#pragma mapbox: define highp vec4 color
92
+ }`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),uu=ir("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),hl=ir("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),fl=ir("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),Rc=ir(`#pragma mapbox: define highp vec4 color
93
93
  #pragma mapbox: define lowp float opacity
94
94
  void main() {
95
95
  #pragma mapbox: initialize highp vec4 color
@@ -144,7 +144,7 @@ void main() {
144
144
  #pragma mapbox: initialize mediump vec4 pattern_to
145
145
  #pragma mapbox: initialize lowp float pixel_ratio_from
146
146
  #pragma mapbox: initialize lowp float pixel_ratio_to
147
- vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),pl=ir(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;
147
+ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),dl=ir(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;
148
148
  #pragma mapbox: define lowp float opacity
149
149
  #pragma mapbox: define lowp vec4 pattern_from
150
150
  #pragma mapbox: define lowp vec4 pattern_to
@@ -180,7 +180,7 @@ void main() {
180
180
  #pragma mapbox: initialize highp float base
181
181
  #pragma mapbox: initialize highp float height
182
182
  #pragma mapbox: initialize highp vec4 color
183
- vec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),su=ir(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
183
+ vec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),lu=ir(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
184
184
  #pragma mapbox: define lowp float base
185
185
  #pragma mapbox: define lowp float height
186
186
  #pragma mapbox: define lowp vec4 pattern_from
@@ -375,7 +375,7 @@ void main() {
375
375
  #pragma mapbox: initialize lowp float opacity
376
376
  vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
377
377
  camera_to_anchor_distance/u_camera_to_center_distance :
378
- u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}`),hl=ir(`#define SDF_PX 8.0
378
+ u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}`),ml=ir(`#define SDF_PX 8.0
379
379
  uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;
380
380
  #pragma mapbox: define highp vec4 fill_color
381
381
  #pragma mapbox: define highp vec4 halo_color
@@ -406,7 +406,7 @@ void main() {
406
406
  #pragma mapbox: initialize lowp float halo_blur
407
407
  vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
408
408
  camera_to_anchor_distance/u_camera_to_center_distance :
409
- u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float 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(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),fl=ir(`#define SDF_PX 8.0
409
+ u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float 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(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),yl=ir(`#define SDF_PX 8.0
410
410
  #define SDF 1.0
411
411
  #define ICON 0.0
412
412
  uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;
@@ -443,61 +443,61 @@ void main() {
443
443
  #pragma mapbox: initialize lowp float halo_blur
444
444
  vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
445
445
  camera_to_anchor_distance/u_camera_to_center_distance :
446
- u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float 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(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`);function ir(i,o){var n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,s=o.match(/attribute ([\w]+) ([\w]+)/g),p=i.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),f=o.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),d=f?f.concat(p):p,v={};return{fragmentSource:i=i.replace(n,(function(w,A,D,F,O){return v[O]=!0,A==="define"?`
446
+ u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float 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(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`);function ir(i,o){var n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,s=o.match(/attribute ([\w]+) ([\w]+)/g),p=i.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),f=o.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),d=f?f.concat(p):p,v={};return{fragmentSource:i=i.replace(n,(function(w,A,R,F,O){return v[O]=!0,A==="define"?`
447
447
  #ifndef HAS_UNIFORM_u_`+O+`
448
- varying `+D+" "+F+" "+O+`;
448
+ varying `+R+" "+F+" "+O+`;
449
449
  #else
450
- uniform `+D+" "+F+" u_"+O+`;
450
+ uniform `+R+" "+F+" u_"+O+`;
451
451
  #endif
452
452
  `:`
453
453
  #ifdef HAS_UNIFORM_u_`+O+`
454
- `+D+" "+F+" "+O+" = u_"+O+`;
454
+ `+R+" "+F+" "+O+" = u_"+O+`;
455
455
  #endif
456
- `})),vertexSource:o=o.replace(n,(function(w,A,D,F,O){var W=F==="float"?"vec2":"vec4",$=O.match(/color/)?"color":W;return v[O]?A==="define"?`
456
+ `})),vertexSource:o=o.replace(n,(function(w,A,R,F,O){var W=F==="float"?"vec2":"vec4",Z=O.match(/color/)?"color":W;return v[O]?A==="define"?`
457
457
  #ifndef HAS_UNIFORM_u_`+O+`
458
458
  uniform lowp float u_`+O+`_t;
459
- attribute `+D+" "+W+" a_"+O+`;
460
- varying `+D+" "+F+" "+O+`;
459
+ attribute `+R+" "+W+" a_"+O+`;
460
+ varying `+R+" "+F+" "+O+`;
461
461
  #else
462
- uniform `+D+" "+F+" u_"+O+`;
462
+ uniform `+R+" "+F+" u_"+O+`;
463
463
  #endif
464
- `:$==="vec4"?`
464
+ `:Z==="vec4"?`
465
465
  #ifndef HAS_UNIFORM_u_`+O+`
466
466
  `+O+" = a_"+O+`;
467
467
  #else
468
- `+D+" "+F+" "+O+" = u_"+O+`;
468
+ `+R+" "+F+" "+O+" = u_"+O+`;
469
469
  #endif
470
470
  `:`
471
471
  #ifndef HAS_UNIFORM_u_`+O+`
472
- `+O+" = unpack_mix_"+$+"(a_"+O+", u_"+O+`_t);
472
+ `+O+" = unpack_mix_"+Z+"(a_"+O+", u_"+O+`_t);
473
473
  #else
474
- `+D+" "+F+" "+O+" = u_"+O+`;
474
+ `+R+" "+F+" "+O+" = u_"+O+`;
475
475
  #endif
476
476
  `:A==="define"?`
477
477
  #ifndef HAS_UNIFORM_u_`+O+`
478
478
  uniform lowp float u_`+O+`_t;
479
- attribute `+D+" "+W+" a_"+O+`;
479
+ attribute `+R+" "+W+" a_"+O+`;
480
480
  #else
481
- uniform `+D+" "+F+" u_"+O+`;
481
+ uniform `+R+" "+F+" u_"+O+`;
482
482
  #endif
483
- `:$==="vec4"?`
483
+ `:Z==="vec4"?`
484
484
  #ifndef HAS_UNIFORM_u_`+O+`
485
- `+D+" "+F+" "+O+" = a_"+O+`;
485
+ `+R+" "+F+" "+O+" = a_"+O+`;
486
486
  #else
487
- `+D+" "+F+" "+O+" = u_"+O+`;
487
+ `+R+" "+F+" "+O+" = u_"+O+`;
488
488
  #endif
489
489
  `:`
490
490
  #ifndef HAS_UNIFORM_u_`+O+`
491
- `+D+" "+F+" "+O+" = unpack_mix_"+$+"(a_"+O+", u_"+O+`_t);
491
+ `+R+" "+F+" "+O+" = unpack_mix_"+Z+"(a_"+O+", u_"+O+`_t);
492
492
  #else
493
- `+D+" "+F+" "+O+" = u_"+O+`;
493
+ `+R+" "+F+" "+O+" = u_"+O+`;
494
494
  #endif
495
- `})),staticAttributes:s,staticUniforms:d}}var Lc=Object.freeze({__proto__:null,prelude:Ho,background:ul,backgroundPattern:zc,circle:Dc,clippingMask:iu,heatmap:nu,heatmapTexture:ou,collisionBox:au,collisionCircle:ll,debug:cl,fill:Rc,fillOutline:_a,fillOutlinePattern:xa,fillPattern:pl,fillExtrusion:mi,fillExtrusionPattern:su,hillshadePrepare:Hn,hillshade:Xn,line:_o,lineGradient:xo,linePattern:Kn,lineSDF:bo,raster:wo,symbolIcon:Jn,symbolSDF:hl,symbolTextAndIcon:fl}),ts=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function dl(i){for(var o=[],n=0;n<i.length;n++)if(i[n]!==null){var s=i[n].split(" ");o.push(s.pop())}return o}ts.prototype.bind=function(i,o,n,s,p,f,d,v){this.context=i;for(var w=this.boundPaintVertexBuffers.length!==s.length,A=0;!w&&A<s.length;A++)this.boundPaintVertexBuffers[A]!==s[A]&&(w=!0);i.extVertexArrayObject&&this.vao&&this.boundProgram===o&&this.boundLayoutVertexBuffer===n&&!w&&this.boundIndexBuffer===p&&this.boundVertexOffset===f&&this.boundDynamicVertexBuffer===d&&this.boundDynamicVertexBuffer2===v?(i.bindVertexArrayOES.set(this.vao),d&&d.bind(),p&&p.dynamicDraw&&p.bind(),v&&v.bind()):this.freshBind(o,n,s,p,f,d,v)},ts.prototype.freshBind=function(i,o,n,s,p,f,d){var v,w=i.numAttributes,A=this.context,D=A.gl;if(A.extVertexArrayObject)this.vao&&this.destroy(),this.vao=A.extVertexArrayObject.createVertexArrayOES(),A.bindVertexArrayOES.set(this.vao),v=0,this.boundProgram=i,this.boundLayoutVertexBuffer=o,this.boundPaintVertexBuffers=n,this.boundIndexBuffer=s,this.boundVertexOffset=p,this.boundDynamicVertexBuffer=f,this.boundDynamicVertexBuffer2=d;else{v=A.currentNumAttributes||0;for(var F=w;F<v;F++)D.disableVertexAttribArray(F)}o.enableAttributes(D,i);for(var O=0,W=n;O<W.length;O+=1)W[O].enableAttributes(D,i);f&&f.enableAttributes(D,i),d&&d.enableAttributes(D,i),o.bind(),o.setVertexAttribPointers(D,i,p);for(var $=0,ee=n;$<ee.length;$+=1){var N=ee[$];N.bind(),N.setVertexAttribPointers(D,i,p)}f&&(f.bind(),f.setVertexAttribPointers(D,i,p)),s&&s.bind(),d&&(d.bind(),d.setVertexAttribPointers(D,i,p)),A.currentNumAttributes=w},ts.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var ml=function(i,o,n,s,p,f){var d=i.gl;this.program=d.createProgram();for(var v=dl(n.staticAttributes),w=s?s.getBinderAttributes():[],A=v.concat(w),D=n.staticUniforms?dl(n.staticUniforms):[],F=s?s.getBinderUniforms():[],O=[],W=0,$=D.concat(F);W<$.length;W+=1){var ee=$[W];O.indexOf(ee)<0&&O.push(ee)}var N=s?s.defines():[];f&&N.push("#define OVERDRAW_INSPECTOR;");var Q=N.concat(Ho.fragmentSource,n.fragmentSource).join(`
495
+ `})),staticAttributes:s,staticUniforms:d}}var Lc=Object.freeze({__proto__:null,prelude:Ho,background:pl,backgroundPattern:zc,circle:Dc,clippingMask:ou,heatmap:au,heatmapTexture:su,collisionBox:uu,collisionCircle:hl,debug:fl,fill:Rc,fillOutline:_a,fillOutlinePattern:xa,fillPattern:dl,fillExtrusion:mi,fillExtrusionPattern:lu,hillshadePrepare:Hn,hillshade:Xn,line:_o,lineGradient:xo,linePattern:Kn,lineSDF:bo,raster:wo,symbolIcon:Jn,symbolSDF:ml,symbolTextAndIcon:yl}),ts=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function vl(i){for(var o=[],n=0;n<i.length;n++)if(i[n]!==null){var s=i[n].split(" ");o.push(s.pop())}return o}ts.prototype.bind=function(i,o,n,s,p,f,d,v){this.context=i;for(var w=this.boundPaintVertexBuffers.length!==s.length,A=0;!w&&A<s.length;A++)this.boundPaintVertexBuffers[A]!==s[A]&&(w=!0);i.extVertexArrayObject&&this.vao&&this.boundProgram===o&&this.boundLayoutVertexBuffer===n&&!w&&this.boundIndexBuffer===p&&this.boundVertexOffset===f&&this.boundDynamicVertexBuffer===d&&this.boundDynamicVertexBuffer2===v?(i.bindVertexArrayOES.set(this.vao),d&&d.bind(),p&&p.dynamicDraw&&p.bind(),v&&v.bind()):this.freshBind(o,n,s,p,f,d,v)},ts.prototype.freshBind=function(i,o,n,s,p,f,d){var v,w=i.numAttributes,A=this.context,R=A.gl;if(A.extVertexArrayObject)this.vao&&this.destroy(),this.vao=A.extVertexArrayObject.createVertexArrayOES(),A.bindVertexArrayOES.set(this.vao),v=0,this.boundProgram=i,this.boundLayoutVertexBuffer=o,this.boundPaintVertexBuffers=n,this.boundIndexBuffer=s,this.boundVertexOffset=p,this.boundDynamicVertexBuffer=f,this.boundDynamicVertexBuffer2=d;else{v=A.currentNumAttributes||0;for(var F=w;F<v;F++)R.disableVertexAttribArray(F)}o.enableAttributes(R,i);for(var O=0,W=n;O<W.length;O+=1)W[O].enableAttributes(R,i);f&&f.enableAttributes(R,i),d&&d.enableAttributes(R,i),o.bind(),o.setVertexAttribPointers(R,i,p);for(var Z=0,ee=n;Z<ee.length;Z+=1){var N=ee[Z];N.bind(),N.setVertexAttribPointers(R,i,p)}f&&(f.bind(),f.setVertexAttribPointers(R,i,p)),s&&s.bind(),d&&(d.bind(),d.setVertexAttribPointers(R,i,p)),A.currentNumAttributes=w},ts.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var gl=function(i,o,n,s,p,f){var d=i.gl;this.program=d.createProgram();for(var v=vl(n.staticAttributes),w=s?s.getBinderAttributes():[],A=v.concat(w),R=n.staticUniforms?vl(n.staticUniforms):[],F=s?s.getBinderUniforms():[],O=[],W=0,Z=R.concat(F);W<Z.length;W+=1){var ee=Z[W];O.indexOf(ee)<0&&O.push(ee)}var N=s?s.defines():[];f&&N.push("#define OVERDRAW_INSPECTOR;");var Q=N.concat(Ho.fragmentSource,n.fragmentSource).join(`
496
496
  `),ne=N.concat(Ho.vertexSource,n.vertexSource).join(`
497
- `),ue=d.createShader(d.FRAGMENT_SHADER);if(d.isContextLost())this.failedToCreate=!0;else{d.shaderSource(ue,Q),d.compileShader(ue),d.attachShader(this.program,ue);var de=d.createShader(d.VERTEX_SHADER);if(d.isContextLost())this.failedToCreate=!0;else{d.shaderSource(de,ne),d.compileShader(de),d.attachShader(this.program,de),this.attributes={};var pe={};this.numAttributes=A.length;for(var ye=0;ye<this.numAttributes;ye++)A[ye]&&(d.bindAttribLocation(this.program,ye,A[ye]),this.attributes[A[ye]]=ye);d.linkProgram(this.program),d.deleteShader(de),d.deleteShader(ue);for(var Ie=0;Ie<O.length;Ie++){var Me=O[Ie];if(Me&&!pe[Me]){var Ce=d.getUniformLocation(this.program,Me);Ce&&(pe[Me]=Ce)}}this.fixedUniforms=p(i,pe),this.binderUniforms=s?s.getUniforms(i,pe):[]}}};function yl(i,o,n){var s=1/yr(n,1,o.transform.tileZoom),p=Math.pow(2,n.tileID.overscaledZ),f=n.tileSize*Math.pow(2,o.transform.tileZoom)/p,d=f*(n.tileID.canonical.x+n.tileID.wrap*p),v=f*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[s,i.fromScale,i.toScale],u_fade:i.t,u_pixel_coord_upper:[d>>16,v>>16],u_pixel_coord_lower:[65535&d,65535&v]}}ml.prototype.draw=function(i,o,n,s,p,f,d,v,w,A,D,F,O,W,$,ee){var N,Q=i.gl;if(!this.failedToCreate){for(var ne in i.program.set(this.program),i.setDepthMode(n),i.setStencilMode(s),i.setColorMode(p),i.setCullFace(f),this.fixedUniforms)this.fixedUniforms[ne].set(d[ne]);W&&W.setUniforms(i,this.binderUniforms,F,{zoom:O});for(var ue=(N={},N[Q.LINES]=2,N[Q.TRIANGLES]=3,N[Q.LINE_STRIP]=1,N)[o],de=0,pe=D.get();de<pe.length;de+=1){var ye=pe[de],Ie=ye.vaos||(ye.vaos={});(Ie[v]||(Ie[v]=new ts)).bind(i,this,w,W?W.getPaintVertexBuffers():[],A,ye.vertexOffset,$,ee),Q.drawElements(o,ye.primitiveLength*ue,Q.UNSIGNED_SHORT,ye.primitiveOffset*ue*2)}}};var vl=function(i,o,n,s){var p=o.style.light,f=p.properties.get("position"),d=[f.x,f.y,f.z],v=u.create$1();p.properties.get("anchor")==="viewport"&&u.fromRotation(v,-o.transform.angle),u.transformMat3(d,d,v);var w=p.properties.get("color");return{u_matrix:i,u_lightpos:d,u_lightintensity:p.properties.get("intensity"),u_lightcolor:[w.r,w.g,w.b],u_vertical_gradient:+n,u_opacity:s}},So=function(i,o,n,s,p,f,d){return u.extend(vl(i,o,n,s),yl(f,o,d),{u_height_factor:-Math.pow(2,p.overscaledZ)/d.tileSize/8})},Yn=function(i){return{u_matrix:i}},Io=function(i,o,n,s){return u.extend(Yn(i),yl(n,o,s))},gl=function(i,o){return{u_matrix:i,u_world:o}},_l=function(i,o,n,s,p){return u.extend(Io(i,o,n,s),{u_world:p})},uu=function(i,o,n,s){var p,f,d=i.transform;if(s.paint.get("circle-pitch-alignment")==="map"){var v=yr(n,1,d.zoom);p=!0,f=[v,v]}else p=!1,f=d.pixelsToGLUnits;return{u_camera_to_center_distance:d.cameraToCenterDistance,u_scale_with_map:+(s.paint.get("circle-pitch-scale")==="map"),u_matrix:i.translatePosMatrix(o.posMatrix,n,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_pitch_with_map:+p,u_device_pixel_ratio:u.browser.devicePixelRatio,u_extrude_scale:f}},To=function(i,o,n){var s=yr(n,1,o.zoom),p=Math.pow(2,o.zoom-n.tileID.overscaledZ),f=n.tileID.overscaleFactor();return{u_matrix:i,u_camera_to_center_distance:o.cameraToCenterDistance,u_pixels_to_tile_units:s,u_extrude_scale:[o.pixelsToGLUnits[0]/(s*p),o.pixelsToGLUnits[1]/(s*p)],u_overscale_factor:f}},xl=function(i,o,n){return{u_matrix:i,u_inv_matrix:o,u_camera_to_center_distance:n.cameraToCenterDistance,u_viewport_size:[n.width,n.height]}},Ao=function(i,o,n){return n===void 0&&(n=1),{u_matrix:i,u_color:o,u_overlay:0,u_overlay_scale:n}},Eo=function(i){return{u_matrix:i}},bl=function(i,o,n,s){return{u_matrix:i,u_extrude_scale:yr(o,1,n),u_intensity:s}},ba=function(i,o,n){var s=i.transform;return{u_matrix:wl(i,o,n),u_ratio:1/yr(o,1,s.zoom),u_device_pixel_ratio:u.browser.devicePixelRatio,u_units_to_pixels:[1/s.pixelsToGLUnits[0],1/s.pixelsToGLUnits[1]]}},ur=function(i,o,n,s){return u.extend(ba(i,o,n),{u_image:0,u_image_height:s})},rs=function(i,o,n,s){var p=i.transform,f=Xo(o,p);return{u_matrix:wl(i,o,n),u_texsize:o.imageAtlasTexture.size,u_ratio:1/yr(o,1,p.zoom),u_device_pixel_ratio:u.browser.devicePixelRatio,u_image:0,u_scale:[f,s.fromScale,s.toScale],u_fade:s.t,u_units_to_pixels:[1/p.pixelsToGLUnits[0],1/p.pixelsToGLUnits[1]]}},Fc=function(i,o,n,s,p){var f=i.lineAtlas,d=Xo(o,i.transform),v=n.layout.get("line-cap")==="round",w=f.getDash(s.from,v),A=f.getDash(s.to,v),D=w.width*p.fromScale,F=A.width*p.toScale;return u.extend(ba(i,o,n),{u_patternscale_a:[d/D,-w.height/2],u_patternscale_b:[d/F,-A.height/2],u_sdfgamma:f.width/(256*Math.min(D,F)*u.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:w.y,u_tex_y_b:A.y,u_mix:p.t})};function Xo(i,o){return 1/yr(i,1,o.tileZoom)}function wl(i,o,n){return i.translatePosMatrix(o.tileID.posMatrix,o,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}var Oc=function(i,o,n,s,p){return{u_matrix:i,u_tl_parent:o,u_scale_parent:n,u_buffer_scale:1,u_fade_t:s.mix,u_opacity:s.opacity*p.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:p.paint.get("raster-brightness-min"),u_brightness_high:p.paint.get("raster-brightness-max"),u_saturation_factor:(d=p.paint.get("raster-saturation"),d>0?1-1/(1.001-d):-d),u_contrast_factor:(f=p.paint.get("raster-contrast"),f>0?1/(1-f):1+f),u_spin_weights:Sl(p.paint.get("raster-hue-rotate"))};var f,d};function Sl(i){i*=Math.PI/180;var o=Math.sin(i),n=Math.cos(i);return[(2*n+1)/3,(-Math.sqrt(3)*o-n+1)/3,(Math.sqrt(3)*o-n+1)/3]}var is,Ko=function(i,o,n,s,p,f,d,v,w,A){var D=p.transform;return{u_is_size_zoom_constant:+(i==="constant"||i==="source"),u_is_size_feature_constant:+(i==="constant"||i==="camera"),u_size_t:o?o.uSizeT:0,u_size:o?o.uSize:0,u_camera_to_center_distance:D.cameraToCenterDistance,u_pitch:D.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:D.width/D.height,u_fade_change:p.options.fadeDuration?p.symbolFadeChange:1,u_matrix:f,u_label_plane_matrix:d,u_coord_matrix:v,u_is_text:+w,u_pitch_with_map:+s,u_texsize:A,u_texture:0}},wa=function(i,o,n,s,p,f,d,v,w,A,D){var F=p.transform;return u.extend(Ko(i,o,n,s,p,f,d,v,w,A),{u_gamma_scale:s?Math.cos(F._pitch)*F.cameraToCenterDistance:1,u_device_pixel_ratio:u.browser.devicePixelRatio,u_is_halo:1})},ns=function(i,o,n,s,p,f,d,v,w,A){return u.extend(wa(i,o,n,s,p,f,d,v,!0,w),{u_texsize_icon:A,u_texture_icon:1})},Sa=function(i,o,n){return{u_matrix:i,u_opacity:o,u_color:n}},Jo=function(i,o,n,s,p,f){return u.extend((function(d,v,w,A){var D=w.imageManager.getPattern(d.from.toString()),F=w.imageManager.getPattern(d.to.toString()),O=w.imageManager.getPixelSize(),W=O.width,$=O.height,ee=Math.pow(2,A.tileID.overscaledZ),N=A.tileSize*Math.pow(2,w.transform.tileZoom)/ee,Q=N*(A.tileID.canonical.x+A.tileID.wrap*ee),ne=N*A.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:D.tl,u_pattern_br_a:D.br,u_pattern_tl_b:F.tl,u_pattern_br_b:F.br,u_texsize:[W,$],u_mix:v.t,u_pattern_size_a:D.displaySize,u_pattern_size_b:F.displaySize,u_scale_a:v.fromScale,u_scale_b:v.toScale,u_tile_units_to_pixels:1/yr(A,1,w.transform.tileZoom),u_pixel_coord_upper:[Q>>16,ne>>16],u_pixel_coord_lower:[65535&Q,65535&ne]}})(s,f,n,p),{u_matrix:i,u_opacity:o})},Il={fillExtrusion:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_lightpos:new u.Uniform3f(i,o.u_lightpos),u_lightintensity:new u.Uniform1f(i,o.u_lightintensity),u_lightcolor:new u.Uniform3f(i,o.u_lightcolor),u_vertical_gradient:new u.Uniform1f(i,o.u_vertical_gradient),u_opacity:new u.Uniform1f(i,o.u_opacity)}},fillExtrusionPattern:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_lightpos:new u.Uniform3f(i,o.u_lightpos),u_lightintensity:new u.Uniform1f(i,o.u_lightintensity),u_lightcolor:new u.Uniform3f(i,o.u_lightcolor),u_vertical_gradient:new u.Uniform1f(i,o.u_vertical_gradient),u_height_factor:new u.Uniform1f(i,o.u_height_factor),u_image:new u.Uniform1i(i,o.u_image),u_texsize:new u.Uniform2f(i,o.u_texsize),u_pixel_coord_upper:new u.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new u.Uniform2f(i,o.u_pixel_coord_lower),u_scale:new u.Uniform3f(i,o.u_scale),u_fade:new u.Uniform1f(i,o.u_fade),u_opacity:new u.Uniform1f(i,o.u_opacity)}},fill:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix)}},fillPattern:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_image:new u.Uniform1i(i,o.u_image),u_texsize:new u.Uniform2f(i,o.u_texsize),u_pixel_coord_upper:new u.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new u.Uniform2f(i,o.u_pixel_coord_lower),u_scale:new u.Uniform3f(i,o.u_scale),u_fade:new u.Uniform1f(i,o.u_fade)}},fillOutline:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_world:new u.Uniform2f(i,o.u_world)}},fillOutlinePattern:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_world:new u.Uniform2f(i,o.u_world),u_image:new u.Uniform1i(i,o.u_image),u_texsize:new u.Uniform2f(i,o.u_texsize),u_pixel_coord_upper:new u.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new u.Uniform2f(i,o.u_pixel_coord_lower),u_scale:new u.Uniform3f(i,o.u_scale),u_fade:new u.Uniform1f(i,o.u_fade)}},circle:function(i,o){return{u_camera_to_center_distance:new u.Uniform1f(i,o.u_camera_to_center_distance),u_scale_with_map:new u.Uniform1i(i,o.u_scale_with_map),u_pitch_with_map:new u.Uniform1i(i,o.u_pitch_with_map),u_extrude_scale:new u.Uniform2f(i,o.u_extrude_scale),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_matrix:new u.UniformMatrix4f(i,o.u_matrix)}},collisionBox:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_camera_to_center_distance:new u.Uniform1f(i,o.u_camera_to_center_distance),u_pixels_to_tile_units:new u.Uniform1f(i,o.u_pixels_to_tile_units),u_extrude_scale:new u.Uniform2f(i,o.u_extrude_scale),u_overscale_factor:new u.Uniform1f(i,o.u_overscale_factor)}},collisionCircle:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_inv_matrix:new u.UniformMatrix4f(i,o.u_inv_matrix),u_camera_to_center_distance:new u.Uniform1f(i,o.u_camera_to_center_distance),u_viewport_size:new u.Uniform2f(i,o.u_viewport_size)}},debug:function(i,o){return{u_color:new u.UniformColor(i,o.u_color),u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_overlay:new u.Uniform1i(i,o.u_overlay),u_overlay_scale:new u.Uniform1f(i,o.u_overlay_scale)}},clippingMask:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix)}},heatmap:function(i,o){return{u_extrude_scale:new u.Uniform1f(i,o.u_extrude_scale),u_intensity:new u.Uniform1f(i,o.u_intensity),u_matrix:new u.UniformMatrix4f(i,o.u_matrix)}},heatmapTexture:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_world:new u.Uniform2f(i,o.u_world),u_image:new u.Uniform1i(i,o.u_image),u_color_ramp:new u.Uniform1i(i,o.u_color_ramp),u_opacity:new u.Uniform1f(i,o.u_opacity)}},hillshade:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_image:new u.Uniform1i(i,o.u_image),u_latrange:new u.Uniform2f(i,o.u_latrange),u_light:new u.Uniform2f(i,o.u_light),u_shadow:new u.UniformColor(i,o.u_shadow),u_highlight:new u.UniformColor(i,o.u_highlight),u_accent:new u.UniformColor(i,o.u_accent)}},hillshadePrepare:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_image:new u.Uniform1i(i,o.u_image),u_dimension:new u.Uniform2f(i,o.u_dimension),u_zoom:new u.Uniform1f(i,o.u_zoom),u_unpack:new u.Uniform4f(i,o.u_unpack)}},line:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_ratio:new u.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_units_to_pixels:new u.Uniform2f(i,o.u_units_to_pixels)}},lineGradient:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_ratio:new u.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_units_to_pixels:new u.Uniform2f(i,o.u_units_to_pixels),u_image:new u.Uniform1i(i,o.u_image),u_image_height:new u.Uniform1f(i,o.u_image_height)}},linePattern:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_texsize:new u.Uniform2f(i,o.u_texsize),u_ratio:new u.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_image:new u.Uniform1i(i,o.u_image),u_units_to_pixels:new u.Uniform2f(i,o.u_units_to_pixels),u_scale:new u.Uniform3f(i,o.u_scale),u_fade:new u.Uniform1f(i,o.u_fade)}},lineSDF:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_ratio:new u.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_units_to_pixels:new u.Uniform2f(i,o.u_units_to_pixels),u_patternscale_a:new u.Uniform2f(i,o.u_patternscale_a),u_patternscale_b:new u.Uniform2f(i,o.u_patternscale_b),u_sdfgamma:new u.Uniform1f(i,o.u_sdfgamma),u_image:new u.Uniform1i(i,o.u_image),u_tex_y_a:new u.Uniform1f(i,o.u_tex_y_a),u_tex_y_b:new u.Uniform1f(i,o.u_tex_y_b),u_mix:new u.Uniform1f(i,o.u_mix)}},raster:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_tl_parent:new u.Uniform2f(i,o.u_tl_parent),u_scale_parent:new u.Uniform1f(i,o.u_scale_parent),u_buffer_scale:new u.Uniform1f(i,o.u_buffer_scale),u_fade_t:new u.Uniform1f(i,o.u_fade_t),u_opacity:new u.Uniform1f(i,o.u_opacity),u_image0:new u.Uniform1i(i,o.u_image0),u_image1:new u.Uniform1i(i,o.u_image1),u_brightness_low:new u.Uniform1f(i,o.u_brightness_low),u_brightness_high:new u.Uniform1f(i,o.u_brightness_high),u_saturation_factor:new u.Uniform1f(i,o.u_saturation_factor),u_contrast_factor:new u.Uniform1f(i,o.u_contrast_factor),u_spin_weights:new u.Uniform3f(i,o.u_spin_weights)}},symbolIcon:function(i,o){return{u_is_size_zoom_constant:new u.Uniform1i(i,o.u_is_size_zoom_constant),u_is_size_feature_constant:new u.Uniform1i(i,o.u_is_size_feature_constant),u_size_t:new u.Uniform1f(i,o.u_size_t),u_size:new u.Uniform1f(i,o.u_size),u_camera_to_center_distance:new u.Uniform1f(i,o.u_camera_to_center_distance),u_pitch:new u.Uniform1f(i,o.u_pitch),u_rotate_symbol:new u.Uniform1i(i,o.u_rotate_symbol),u_aspect_ratio:new u.Uniform1f(i,o.u_aspect_ratio),u_fade_change:new u.Uniform1f(i,o.u_fade_change),u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_label_plane_matrix:new u.UniformMatrix4f(i,o.u_label_plane_matrix),u_coord_matrix:new u.UniformMatrix4f(i,o.u_coord_matrix),u_is_text:new u.Uniform1i(i,o.u_is_text),u_pitch_with_map:new u.Uniform1i(i,o.u_pitch_with_map),u_texsize:new u.Uniform2f(i,o.u_texsize),u_texture:new u.Uniform1i(i,o.u_texture)}},symbolSDF:function(i,o){return{u_is_size_zoom_constant:new u.Uniform1i(i,o.u_is_size_zoom_constant),u_is_size_feature_constant:new u.Uniform1i(i,o.u_is_size_feature_constant),u_size_t:new u.Uniform1f(i,o.u_size_t),u_size:new u.Uniform1f(i,o.u_size),u_camera_to_center_distance:new u.Uniform1f(i,o.u_camera_to_center_distance),u_pitch:new u.Uniform1f(i,o.u_pitch),u_rotate_symbol:new u.Uniform1i(i,o.u_rotate_symbol),u_aspect_ratio:new u.Uniform1f(i,o.u_aspect_ratio),u_fade_change:new u.Uniform1f(i,o.u_fade_change),u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_label_plane_matrix:new u.UniformMatrix4f(i,o.u_label_plane_matrix),u_coord_matrix:new u.UniformMatrix4f(i,o.u_coord_matrix),u_is_text:new u.Uniform1i(i,o.u_is_text),u_pitch_with_map:new u.Uniform1i(i,o.u_pitch_with_map),u_texsize:new u.Uniform2f(i,o.u_texsize),u_texture:new u.Uniform1i(i,o.u_texture),u_gamma_scale:new u.Uniform1f(i,o.u_gamma_scale),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_is_halo:new u.Uniform1i(i,o.u_is_halo)}},symbolTextAndIcon:function(i,o){return{u_is_size_zoom_constant:new u.Uniform1i(i,o.u_is_size_zoom_constant),u_is_size_feature_constant:new u.Uniform1i(i,o.u_is_size_feature_constant),u_size_t:new u.Uniform1f(i,o.u_size_t),u_size:new u.Uniform1f(i,o.u_size),u_camera_to_center_distance:new u.Uniform1f(i,o.u_camera_to_center_distance),u_pitch:new u.Uniform1f(i,o.u_pitch),u_rotate_symbol:new u.Uniform1i(i,o.u_rotate_symbol),u_aspect_ratio:new u.Uniform1f(i,o.u_aspect_ratio),u_fade_change:new u.Uniform1f(i,o.u_fade_change),u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_label_plane_matrix:new u.UniformMatrix4f(i,o.u_label_plane_matrix),u_coord_matrix:new u.UniformMatrix4f(i,o.u_coord_matrix),u_is_text:new u.Uniform1i(i,o.u_is_text),u_pitch_with_map:new u.Uniform1i(i,o.u_pitch_with_map),u_texsize:new u.Uniform2f(i,o.u_texsize),u_texsize_icon:new u.Uniform2f(i,o.u_texsize_icon),u_texture:new u.Uniform1i(i,o.u_texture),u_texture_icon:new u.Uniform1i(i,o.u_texture_icon),u_gamma_scale:new u.Uniform1f(i,o.u_gamma_scale),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_is_halo:new u.Uniform1i(i,o.u_is_halo)}},background:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_opacity:new u.Uniform1f(i,o.u_opacity),u_color:new u.UniformColor(i,o.u_color)}},backgroundPattern:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_opacity:new u.Uniform1f(i,o.u_opacity),u_image:new u.Uniform1i(i,o.u_image),u_pattern_tl_a:new u.Uniform2f(i,o.u_pattern_tl_a),u_pattern_br_a:new u.Uniform2f(i,o.u_pattern_br_a),u_pattern_tl_b:new u.Uniform2f(i,o.u_pattern_tl_b),u_pattern_br_b:new u.Uniform2f(i,o.u_pattern_br_b),u_texsize:new u.Uniform2f(i,o.u_texsize),u_mix:new u.Uniform1f(i,o.u_mix),u_pattern_size_a:new u.Uniform2f(i,o.u_pattern_size_a),u_pattern_size_b:new u.Uniform2f(i,o.u_pattern_size_b),u_scale_a:new u.Uniform1f(i,o.u_scale_a),u_scale_b:new u.Uniform1f(i,o.u_scale_b),u_pixel_coord_upper:new u.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new u.Uniform2f(i,o.u_pixel_coord_lower),u_tile_units_to_pixels:new u.Uniform1f(i,o.u_tile_units_to_pixels)}}};function Yo(i,o,n,s,p,f,d){for(var v=i.context,w=v.gl,A=i.useProgram("collisionBox"),D=[],F=0,O=0,W=0;W<s.length;W++){var $=s[W],ee=o.getTile($),N=ee.getBucket(n);if(N){var Q=$.posMatrix;p[0]===0&&p[1]===0||(Q=i.translatePosMatrix($.posMatrix,ee,p,f));var ne=d?N.textCollisionBox:N.iconCollisionBox,ue=N.collisionCircleArray;if(ue.length>0){var de=u.create(),pe=Q;u.mul(de,N.placementInvProjMatrix,i.transform.glCoordMatrix),u.mul(de,de,N.placementViewportMatrix),D.push({circleArray:ue,circleOffset:O,transform:pe,invTransform:de}),O=F+=ue.length/4}ne&&A.draw(v,w.LINES,V.disabled,Z.disabled,i.colorModeForRenderPass(),ie.disabled,To(Q,i.transform,ee),n.id,ne.layoutVertexBuffer,ne.indexBuffer,ne.segments,null,i.transform.zoom,null,null,ne.collisionVertexBuffer)}}if(d&&D.length){var ye=i.useProgram("collisionCircle"),Ie=new u.StructArrayLayout2f1f2i16;Ie.resize(4*F),Ie._trim();for(var Me=0,Ce=0,$e=D;Ce<$e.length;Ce+=1)for(var nt=$e[Ce],ut=0;ut<nt.circleArray.length/4;ut++){var st=4*ut,Lt=nt.circleArray[st+0],He=nt.circleArray[st+1],mt=nt.circleArray[st+2],xt=nt.circleArray[st+3];Ie.emplace(Me++,Lt,He,mt,xt,0),Ie.emplace(Me++,Lt,He,mt,xt,1),Ie.emplace(Me++,Lt,He,mt,xt,2),Ie.emplace(Me++,Lt,He,mt,xt,3)}(!is||is.length<2*F)&&(is=(function(Ir){var gi=2*Ir,si=new u.StructArrayLayout3ui6;si.resize(gi),si._trim();for(var wr=0;wr<gi;wr++){var kr=6*wr;si.uint16[kr+0]=4*wr+0,si.uint16[kr+1]=4*wr+1,si.uint16[kr+2]=4*wr+2,si.uint16[kr+3]=4*wr+2,si.uint16[kr+4]=4*wr+3,si.uint16[kr+5]=4*wr+0}return si})(F));for(var dt=v.createIndexBuffer(is,!0),ft=v.createVertexBuffer(Ie,u.collisionCircleLayout.members,!0),gt=0,ht=D;gt<ht.length;gt+=1){var ct=ht[gt],Jr=xl(ct.transform,ct.invTransform,i.transform);ye.draw(v,w.TRIANGLES,V.disabled,Z.disabled,i.colorModeForRenderPass(),ie.disabled,Jr,n.id,ft,dt,u.SegmentVector.simpleSegment(0,2*ct.circleOffset,ct.circleArray.length,ct.circleArray.length/2),null,i.transform.zoom,null,null,null)}ft.destroy(),dt.destroy()}}var vn=u.identity(new Float32Array(16));function Tl(i,o,n,s,p,f){var d=u.getAnchorAlignment(i),v=-(d.horizontalAlign-.5)*o,w=-(d.verticalAlign-.5)*n,A=u.evaluateVariableOffset(i,s);return new u.Point((v/p+A[0])*f,(w/p+A[1])*f)}function Al(i,o,n,s,p,f,d,v,w,A,D){var F=i.text.placedSymbolArray,O=i.text.dynamicLayoutVertexArray,W=i.icon.dynamicLayoutVertexArray,$={};O.clear();for(var ee=0;ee<F.length;ee++){var N=F.get(ee),Q=N.hidden||!N.crossTileID||i.allowVerticalPlacement&&!N.placedOrientation?null:s[N.crossTileID];if(Q){var ne=new u.Point(N.anchorX,N.anchorY),ue=Bt(ne,n?v:d),de=Zt(f.cameraToCenterDistance,ue.signedDistanceFromCamera),pe=p.evaluateSizeForFeature(i.textSizeData,A,N)*de/u.ONE_EM;n&&(pe*=i.tilePixelRatio/w);for(var ye=Tl(Q.anchor,Q.width,Q.height,Q.textOffset,Q.textBoxScale,pe),Ie=n?Bt(ne.add(ye),d).point:ue.point.add(o?ye.rotate(-f.angle):ye),Me=i.allowVerticalPlacement&&N.placedOrientation===u.WritingMode.vertical?Math.PI/2:0,Ce=0;Ce<N.numGlyphs;Ce++)u.addDynamicAttributes(O,Ie,Me);D&&N.associatedIconIndex>=0&&($[N.associatedIconIndex]={shiftedAnchor:Ie,angle:Me})}else Si(N.numGlyphs,O)}if(D){W.clear();for(var $e=i.icon.placedSymbolArray,nt=0;nt<$e.length;nt++){var ut=$e.get(nt);if(ut.hidden)Si(ut.numGlyphs,W);else{var st=$[nt];if(st)for(var Lt=0;Lt<ut.numGlyphs;Lt++)u.addDynamicAttributes(W,st.shiftedAnchor,st.angle);else Si(ut.numGlyphs,W)}}i.icon.dynamicLayoutVertexBuffer.updateData(W)}i.text.dynamicLayoutVertexBuffer.updateData(O)}function El(i,o,n){return n.iconsInText&&o?"symbolTextAndIcon":i?"symbolSDF":"symbolIcon"}function Po(i,o,n,s,p,f,d,v,w,A,D,F){for(var O=i.context,W=O.gl,$=i.transform,ee=v==="map",N=w==="map",Q=ee&&n.layout.get("symbol-placement")!=="point",ne=ee&&!N&&!Q,ue=n.layout.get("symbol-sort-key").constantOr(1)!==void 0,de=!1,pe=i.depthModeForSublayer(0,V.ReadOnly),ye=n.layout.get("text-variable-anchor"),Ie=[],Me=0,Ce=s;Me<Ce.length;Me+=1){var $e=Ce[Me],nt=o.getTile($e),ut=nt.getBucket(n);if(ut){var st=p?ut.text:ut.icon;if(st&&st.segments.get().length){var Lt=st.programConfigurations.get(n.id),He=p||ut.sdfIcons,mt=p?ut.textSizeData:ut.iconSizeData,xt=N||$.pitch!==0,dt=i.useProgram(El(He,p,ut),Lt),ft=u.evaluateSizeForZoom(mt,$.zoom),gt=void 0,ht=[0,0],ct=void 0,Jr=void 0,Ir=null,gi=void 0;if(p)ct=nt.glyphAtlasTexture,Jr=W.LINEAR,gt=nt.glyphAtlasTexture.size,ut.iconsInText&&(ht=nt.imageAtlasTexture.size,Ir=nt.imageAtlasTexture,gi=xt||i.options.rotating||i.options.zooming||mt.kind==="composite"||mt.kind==="camera"?W.LINEAR:W.NEAREST);else{var si=n.layout.get("icon-size").constantOr(0)!==1||ut.iconsNeedLinear;ct=nt.imageAtlasTexture,Jr=He||i.options.rotating||i.options.zooming||si||xt?W.LINEAR:W.NEAREST,gt=nt.imageAtlasTexture.size}var wr=yr(nt,1,i.transform.zoom),kr=Pr($e.posMatrix,N,ee,i.transform,wr),Wi=Qt($e.posMatrix,N,ee,i.transform,wr),Ei=ye&&ut.hasTextData(),no=n.layout.get("icon-text-fit")!=="none"&&Ei&&ut.hasIconData();Q&&ma(ut,$e.posMatrix,i,p,kr,Wi,N,A);var Ri=i.translatePosMatrix($e.posMatrix,nt,f,d),wn=Q||p&&ye||no?vn:kr,cn=i.translatePosMatrix(Wi,nt,f,d,!0),Ra=He&&n.paint.get(p?"text-halo-width":"icon-halo-width").constantOr(1)!==0,na={program:dt,buffers:st,uniformValues:He?ut.iconsInText?ns(mt.kind,ft,ne,N,i,Ri,wn,cn,gt,ht):wa(mt.kind,ft,ne,N,i,Ri,wn,cn,p,gt):Ko(mt.kind,ft,ne,N,i,Ri,wn,cn,p,gt),atlasTexture:ct,atlasTextureIcon:Ir,atlasInterpolation:Jr,atlasInterpolationIcon:gi,isSDF:He,hasHalo:Ra};if(ue&&ut.canOverlap){de=!0;for(var oo=0,oa=st.segments.get();oo<oa.length;oo+=1){var La=oa[oo];Ie.push({segments:new u.SegmentVector([La]),sortKey:La.sortKey,state:na})}}else Ie.push({segments:st.segments,sortKey:0,state:na})}}}de&&Ie.sort((function(ao,Do){return ao.sortKey-Do.sortKey}));for(var Pn=0,Fa=Ie;Pn<Fa.length;Pn+=1){var Cn=Fa[Pn],Yr=Cn.state;if(O.activeTexture.set(W.TEXTURE0),Yr.atlasTexture.bind(Yr.atlasInterpolation,W.CLAMP_TO_EDGE),Yr.atlasTextureIcon&&(O.activeTexture.set(W.TEXTURE1),Yr.atlasTextureIcon&&Yr.atlasTextureIcon.bind(Yr.atlasInterpolationIcon,W.CLAMP_TO_EDGE)),Yr.isSDF){var On=Yr.uniformValues;Yr.hasHalo&&(On.u_is_halo=1,Ia(Yr.buffers,Cn.segments,n,i,Yr.program,pe,D,F,On)),On.u_is_halo=0}Ia(Yr.buffers,Cn.segments,n,i,Yr.program,pe,D,F,Yr.uniformValues)}}function Ia(i,o,n,s,p,f,d,v,w){var A=s.context;p.draw(A,A.gl.TRIANGLES,f,d,v,ie.disabled,w,n.id,i.layoutVertexBuffer,i.indexBuffer,o,n.paint,s.transform.zoom,i.programConfigurations.get(n.id),i.dynamicLayoutVertexBuffer,i.opacityVertexBuffer)}function os(i,o,n,s,p,f,d){var v,w,A,D,F,O=i.context.gl,W=n.paint.get("fill-pattern"),$=W&&W.constantOr(1),ee=n.getCrossfadeParameters();d?(w=$&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",v=O.LINES):(w=$?"fillPattern":"fill",v=O.TRIANGLES);for(var N=0,Q=s;N<Q.length;N+=1){var ne=Q[N],ue=o.getTile(ne);if(!$||ue.patternsLoaded()){var de=ue.getBucket(n);if(de){var pe=de.programConfigurations.get(n.id),ye=i.useProgram(w,pe);$&&(i.context.activeTexture.set(O.TEXTURE0),ue.imageAtlasTexture.bind(O.LINEAR,O.CLAMP_TO_EDGE),pe.updatePaintBuffers(ee));var Ie=W.constantOr(null);if(Ie&&ue.imageAtlas){var Me=ue.imageAtlas,Ce=Me.patternPositions[Ie.to.toString()],$e=Me.patternPositions[Ie.from.toString()];Ce&&$e&&pe.setConstantPatternPositions(Ce,$e)}var nt=i.translatePosMatrix(ne.posMatrix,ue,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(d){D=de.indexBuffer2,F=de.segments2;var ut=[O.drawingBufferWidth,O.drawingBufferHeight];A=w==="fillOutlinePattern"&&$?_l(nt,i,ee,ue,ut):gl(nt,ut)}else D=de.indexBuffer,F=de.segments,A=$?Io(nt,i,ee,ue):Yn(nt);ye.draw(i.context,v,p,i.stencilModeForClipping(ne),f,ie.disabled,A,n.id,de.layoutVertexBuffer,D,F,n.paint,i.transform.zoom,pe)}}}}function lu(i,o,n,s,p,f,d){for(var v=i.context,w=v.gl,A=n.paint.get("fill-extrusion-pattern"),D=A.constantOr(1),F=n.getCrossfadeParameters(),O=n.paint.get("fill-extrusion-opacity"),W=0,$=s;W<$.length;W+=1){var ee=$[W],N=o.getTile(ee),Q=N.getBucket(n);if(Q){var ne=Q.programConfigurations.get(n.id),ue=i.useProgram(D?"fillExtrusionPattern":"fillExtrusion",ne);D&&(i.context.activeTexture.set(w.TEXTURE0),N.imageAtlasTexture.bind(w.LINEAR,w.CLAMP_TO_EDGE),ne.updatePaintBuffers(F));var de=A.constantOr(null);if(de&&N.imageAtlas){var pe=N.imageAtlas,ye=pe.patternPositions[de.to.toString()],Ie=pe.patternPositions[de.from.toString()];ye&&Ie&&ne.setConstantPatternPositions(ye,Ie)}var Me=i.translatePosMatrix(ee.posMatrix,N,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),Ce=n.paint.get("fill-extrusion-vertical-gradient"),$e=D?So(Me,i,Ce,O,ee,F,N):vl(Me,i,Ce,O);ue.draw(v,v.gl.TRIANGLES,p,f,d,ie.backCCW,$e,n.id,Q.layoutVertexBuffer,Q.indexBuffer,Q.segments,n.paint,i.transform.zoom,ne)}}}function as(i,o,n,s,p,f){var d=i.context,v=d.gl,w=o.fbo;if(w){var A=i.useProgram("hillshade");d.activeTexture.set(v.TEXTURE0),v.bindTexture(v.TEXTURE_2D,w.colorAttachment.get());var D=(function(F,O,W){var $=W.paint.get("hillshade-shadow-color"),ee=W.paint.get("hillshade-highlight-color"),N=W.paint.get("hillshade-accent-color"),Q=W.paint.get("hillshade-illumination-direction")*(Math.PI/180);W.paint.get("hillshade-illumination-anchor")==="viewport"&&(Q-=F.transform.angle);var ne,ue,de,pe=!F.options.moving;return{u_matrix:F.transform.calculatePosMatrix(O.tileID.toUnwrapped(),pe),u_image:0,u_latrange:(ne=O.tileID,ue=Math.pow(2,ne.canonical.z),de=ne.canonical.y,[new u.MercatorCoordinate(0,de/ue).toLngLat().lat,new u.MercatorCoordinate(0,(de+1)/ue).toLngLat().lat]),u_light:[W.paint.get("hillshade-exaggeration"),Q],u_shadow:$,u_highlight:ee,u_accent:N}})(i,o,n);A.draw(d,v.TRIANGLES,s,p,f,ie.disabled,D,n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments)}}function Vc(i,o,n,s,p,f){var d=i.context,v=d.gl,w=o.dem;if(w&&w.data){var A=w.dim,D=w.stride,F=w.getPixels();if(d.activeTexture.set(v.TEXTURE1),d.pixelStoreUnpackPremultiplyAlpha.set(!1),o.demTexture=o.demTexture||i.getTileTexture(D),o.demTexture){var O=o.demTexture;O.update(F,{premultiply:!1}),O.bind(v.NEAREST,v.CLAMP_TO_EDGE)}else o.demTexture=new u.Texture(d,F,v.RGBA,{premultiply:!1}),o.demTexture.bind(v.NEAREST,v.CLAMP_TO_EDGE);d.activeTexture.set(v.TEXTURE0);var W=o.fbo;if(!W){var $=new u.Texture(d,{width:A,height:A,data:null},v.RGBA);$.bind(v.LINEAR,v.CLAMP_TO_EDGE),(W=o.fbo=d.createFramebuffer(A,A,!0)).colorAttachment.set($.texture)}d.bindFramebuffer.set(W.framebuffer),d.viewport.set([0,0,A,A]),i.useProgram("hillshadePrepare").draw(d,v.TRIANGLES,s,p,f,ie.disabled,(function(ee,N){var Q=N.stride,ne=u.create();return u.ortho(ne,0,u.EXTENT,-u.EXTENT,0,0,1),u.translate(ne,ne,[0,-u.EXTENT,0]),{u_matrix:ne,u_image:1,u_dimension:[Q,Q],u_zoom:ee.overscaledZ,u_unpack:N.getUnpackVector()}})(o.tileID,w),n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments),o.needsHillshadePrepare=!1}}function ss(i,o,n,s,p){var f=s.paint.get("raster-fade-duration");if(f>0){var d=u.browser.now(),v=(d-i.timeAdded)/f,w=o?(d-o.timeAdded)/f:-1,A=n.getSource(),D=p.coveringZoomLevel({tileSize:A.tileSize,roundZoom:A.roundZoom}),F=!o||Math.abs(o.tileID.overscaledZ-D)>Math.abs(i.tileID.overscaledZ-D),O=F&&i.refreshedUponExpiration?1:u.clamp(F?v:1-w,0,1);return i.refreshedUponExpiration&&v>=1&&(i.refreshedUponExpiration=!1),o?{opacity:1,mix:1-O}:{opacity:O,mix:0}}return{opacity:1,mix:0}}var cu=new u.Color(1,0,0,1),Pl=new u.Color(0,1,0,1),Cl=new u.Color(0,0,1,1),us=new u.Color(1,0,1,1),pu=new u.Color(0,1,1,1);function hu(i,o,n,s){Ta(i,0,o+n/2,i.transform.width,n,s)}function fu(i,o,n,s){Ta(i,o-n/2,0,n,i.transform.height,s)}function Ta(i,o,n,s,p,f){var d=i.context,v=d.gl;v.enable(v.SCISSOR_TEST),v.scissor(o*u.browser.devicePixelRatio,n*u.browser.devicePixelRatio,s*u.browser.devicePixelRatio,p*u.browser.devicePixelRatio),d.clear({color:f}),v.disable(v.SCISSOR_TEST)}function kl(i,o,n){var s=i.context,p=s.gl,f=n.posMatrix,d=i.useProgram("debug"),v=V.disabled,w=Z.disabled,A=i.colorModeForRenderPass();s.activeTexture.set(p.TEXTURE0),i.emptyTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),d.draw(s,p.LINE_STRIP,v,w,A,ie.disabled,Ao(f,u.Color.red),"$debug",i.debugBuffer,i.tileBorderIndexBuffer,i.debugSegments);var D=o.getTileByID(n.key).latestRawTileData,F=Math.floor((D&&D.byteLength||0)/1024),O=o.getTile(n).tileSize,W=512/Math.min(O,512)*(n.overscaledZ/i.transform.zoom)*.5,$=n.canonical.toString();n.overscaledZ!==n.canonical.z&&($+=" => "+n.overscaledZ),(function(ee,N){ee.initDebugOverlayCanvas();var Q=ee.debugOverlayCanvas,ne=ee.context.gl,ue=ee.debugOverlayCanvas.getContext("2d");ue.clearRect(0,0,Q.width,Q.height),ue.shadowColor="white",ue.shadowBlur=2,ue.lineWidth=1.5,ue.strokeStyle="white",ue.textBaseline="top",ue.font="bold 36px Open Sans, sans-serif",ue.fillText(N,5,5),ue.strokeText(N,5,5),ee.debugOverlayTexture.update(Q),ee.debugOverlayTexture.bind(ne.LINEAR,ne.CLAMP_TO_EDGE)})(i,$+" "+F+"kb"),d.draw(s,p.TRIANGLES,v,w,re.alphaBlended,ie.disabled,Ao(f,u.Color.transparent,W),"$debug",i.debugBuffer,i.quadTriangleIndexBuffer,i.debugSegments)}var Co={symbol:function(i,o,n,s,p){if(i.renderPass==="translucent"){var f=Z.disabled,d=i.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&(function(v,w,A,D,F,O,W){for(var $=w.transform,ee=F==="map",N=O==="map",Q=0,ne=v;Q<ne.length;Q+=1){var ue=ne[Q],de=D.getTile(ue),pe=de.getBucket(A);if(pe&&pe.text&&pe.text.segments.get().length){var ye=u.evaluateSizeForZoom(pe.textSizeData,$.zoom),Ie=yr(de,1,w.transform.zoom),Me=Pr(ue.posMatrix,N,ee,w.transform,Ie),Ce=A.layout.get("icon-text-fit")!=="none"&&pe.hasIconData();if(ye){var $e=Math.pow(2,$.zoom-de.tileID.overscaledZ);Al(pe,ee,N,W,u.symbolSize,$,Me,ue.posMatrix,$e,ye,Ce)}}}})(s,i,n,o,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),p),n.paint.get("icon-opacity").constantOr(1)!==0&&Po(i,o,n,s,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),f,d),n.paint.get("text-opacity").constantOr(1)!==0&&Po(i,o,n,s,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),f,d),o.map.showCollisionBoxes&&(Yo(i,o,n,s,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),Yo(i,o,n,s,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))}},circle:function(i,o,n,s){if(i.renderPass==="translucent"){var p=n.paint.get("circle-opacity"),f=n.paint.get("circle-stroke-width"),d=n.paint.get("circle-stroke-opacity"),v=n.layout.get("circle-sort-key").constantOr(1)!==void 0;if(p.constantOr(1)!==0||f.constantOr(1)!==0&&d.constantOr(1)!==0){for(var w=i.context,A=w.gl,D=i.depthModeForSublayer(0,V.ReadOnly),F=Z.disabled,O=i.colorModeForRenderPass(),W=[],$=0;$<s.length;$++){var ee=s[$],N=o.getTile(ee),Q=N.getBucket(n);if(Q){var ne=Q.programConfigurations.get(n.id),ue={programConfiguration:ne,program:i.useProgram("circle",ne),layoutVertexBuffer:Q.layoutVertexBuffer,indexBuffer:Q.indexBuffer,uniformValues:uu(i,ee,N,n)};if(v)for(var de=0,pe=Q.segments.get();de<pe.length;de+=1){var ye=pe[de];W.push({segments:new u.SegmentVector([ye]),sortKey:ye.sortKey,state:ue})}else W.push({segments:Q.segments,sortKey:0,state:ue})}}v&&W.sort((function(nt,ut){return nt.sortKey-ut.sortKey}));for(var Ie=0,Me=W;Ie<Me.length;Ie+=1){var Ce=Me[Ie],$e=Ce.state;$e.program.draw(w,A.TRIANGLES,D,F,O,ie.disabled,$e.uniformValues,n.id,$e.layoutVertexBuffer,$e.indexBuffer,Ce.segments,n.paint,i.transform.zoom,$e.programConfiguration)}}}},heatmap:function(i,o,n,s){if(n.paint.get("heatmap-opacity")!==0)if(i.renderPass==="offscreen"){var p=i.context,f=p.gl,d=Z.disabled,v=new re([f.ONE,f.ONE],u.Color.transparent,[!0,!0,!0,!0]);(function(W,$,ee){var N=W.gl;W.activeTexture.set(N.TEXTURE1),W.viewport.set([0,0,$.width/4,$.height/4]);var Q=ee.heatmapFbo;if(Q)N.bindTexture(N.TEXTURE_2D,Q.colorAttachment.get()),W.bindFramebuffer.set(Q.framebuffer);else{var ne=N.createTexture();N.bindTexture(N.TEXTURE_2D,ne),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_S,N.CLAMP_TO_EDGE),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_T,N.CLAMP_TO_EDGE),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_MIN_FILTER,N.LINEAR),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_MAG_FILTER,N.LINEAR),Q=ee.heatmapFbo=W.createFramebuffer($.width/4,$.height/4,!1),(function(ue,de,pe,ye){var Ie=ue.gl;Ie.texImage2D(Ie.TEXTURE_2D,0,Ie.RGBA,de.width/4,de.height/4,0,Ie.RGBA,ue.extRenderToTextureHalfFloat?ue.extTextureHalfFloat.HALF_FLOAT_OES:Ie.UNSIGNED_BYTE,null),ye.colorAttachment.set(pe)})(W,$,ne,Q)}})(p,i,n),p.clear({color:u.Color.transparent});for(var w=0;w<s.length;w++){var A=s[w];if(!o.hasRenderableParent(A)){var D=o.getTile(A),F=D.getBucket(n);if(F){var O=F.programConfigurations.get(n.id);i.useProgram("heatmap",O).draw(p,f.TRIANGLES,V.disabled,d,v,ie.disabled,bl(A.posMatrix,D,i.transform.zoom,n.paint.get("heatmap-intensity")),n.id,F.layoutVertexBuffer,F.indexBuffer,F.segments,n.paint,i.transform.zoom,O)}}}p.viewport.set([0,0,i.width,i.height])}else i.renderPass==="translucent"&&(i.context.setColorMode(i.colorModeForRenderPass()),(function(W,$){var ee=W.context,N=ee.gl,Q=$.heatmapFbo;if(Q){ee.activeTexture.set(N.TEXTURE0),N.bindTexture(N.TEXTURE_2D,Q.colorAttachment.get()),ee.activeTexture.set(N.TEXTURE1);var ne=$.colorRampTexture;ne||(ne=$.colorRampTexture=new u.Texture(ee,$.colorRamp,N.RGBA)),ne.bind(N.LINEAR,N.CLAMP_TO_EDGE),W.useProgram("heatmapTexture").draw(ee,N.TRIANGLES,V.disabled,Z.disabled,W.colorModeForRenderPass(),ie.disabled,(function(ue,de,pe,ye){var Ie=u.create();u.ortho(Ie,0,ue.width,ue.height,0,0,1);var Me=ue.context.gl;return{u_matrix:Ie,u_world:[Me.drawingBufferWidth,Me.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:de.paint.get("heatmap-opacity")}})(W,$),$.id,W.viewportBuffer,W.quadTriangleIndexBuffer,W.viewportSegments,$.paint,W.transform.zoom)}})(i,n))},line:function(i,o,n,s){if(i.renderPass==="translucent"){var p=n.paint.get("line-opacity"),f=n.paint.get("line-width");if(p.constantOr(1)!==0&&f.constantOr(1)!==0)for(var d=i.depthModeForSublayer(0,V.ReadOnly),v=i.colorModeForRenderPass(),w=n.paint.get("line-dasharray"),A=n.paint.get("line-pattern"),D=A.constantOr(1),F=n.paint.get("line-gradient"),O=n.getCrossfadeParameters(),W=D?"linePattern":w?"lineSDF":F?"lineGradient":"line",$=i.context,ee=$.gl,N=!0,Q=0,ne=s;Q<ne.length;Q+=1){var ue=ne[Q],de=o.getTile(ue);if(!D||de.patternsLoaded()){var pe=de.getBucket(n);if(pe){var ye=pe.programConfigurations.get(n.id),Ie=i.context.program.get(),Me=i.useProgram(W,ye),Ce=N||Me.program!==Ie,$e=A.constantOr(null);if($e&&de.imageAtlas){var nt=de.imageAtlas,ut=nt.patternPositions[$e.to.toString()],st=nt.patternPositions[$e.from.toString()];ut&&st&&ye.setConstantPatternPositions(ut,st)}var Lt=D?rs(i,de,n,O):w?Fc(i,de,n,w,O):F?ur(i,de,n,pe.lineClipsArray.length):ba(i,de,n);if(D)$.activeTexture.set(ee.TEXTURE0),de.imageAtlasTexture.bind(ee.LINEAR,ee.CLAMP_TO_EDGE),ye.updatePaintBuffers(O);else if(w&&(Ce||i.lineAtlas.dirty))$.activeTexture.set(ee.TEXTURE0),i.lineAtlas.bind($);else if(F){var He=pe.gradients[n.id],mt=He.texture;if(n.gradientVersion!==He.version){var xt=256;if(n.stepInterpolant){var dt=o.getSource().maxzoom,ft=ue.canonical.z===dt?Math.ceil(1<<i.transform.maxZoom-ue.canonical.z):1;xt=u.clamp(u.nextPowerOfTwo(pe.maxLineLength/u.EXTENT*1024*ft),256,$.maxTextureSize)}He.gradient=u.renderColorRamp({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:xt,image:He.gradient||void 0,clips:pe.lineClipsArray}),He.texture?He.texture.update(He.gradient):He.texture=new u.Texture($,He.gradient,ee.RGBA),He.version=n.gradientVersion,mt=He.texture}$.activeTexture.set(ee.TEXTURE0),mt.bind(n.stepInterpolant?ee.NEAREST:ee.LINEAR,ee.CLAMP_TO_EDGE)}Me.draw($,ee.TRIANGLES,d,i.stencilModeForClipping(ue),v,ie.disabled,Lt,n.id,pe.layoutVertexBuffer,pe.indexBuffer,pe.segments,n.paint,i.transform.zoom,ye,pe.layoutVertexBuffer2),N=!1}}}}},fill:function(i,o,n,s){var p=n.paint.get("fill-color"),f=n.paint.get("fill-opacity");if(f.constantOr(1)!==0){var d=i.colorModeForRenderPass(),v=n.paint.get("fill-pattern"),w=i.opaquePassEnabledForLayer()&&!v.constantOr(1)&&p.constantOr(u.Color.transparent).a===1&&f.constantOr(0)===1?"opaque":"translucent";if(i.renderPass===w){var A=i.depthModeForSublayer(1,i.renderPass==="opaque"?V.ReadWrite:V.ReadOnly);os(i,o,n,s,A,d,!1)}if(i.renderPass==="translucent"&&n.paint.get("fill-antialias")){var D=i.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,V.ReadOnly);os(i,o,n,s,D,d,!0)}}},"fill-extrusion":function(i,o,n,s){var p=n.paint.get("fill-extrusion-opacity");if(p!==0&&i.renderPass==="translucent"){var f=new V(i.context.gl.LEQUAL,V.ReadWrite,i.depthRangeFor3D);if(p!==1||n.paint.get("fill-extrusion-pattern").constantOr(1))lu(i,o,n,s,f,Z.disabled,re.disabled),lu(i,o,n,s,f,i.stencilModeFor3D(),i.colorModeForRenderPass());else{var d=i.colorModeForRenderPass();lu(i,o,n,s,f,Z.disabled,d)}}},hillshade:function(i,o,n,s){if(i.renderPass==="offscreen"||i.renderPass==="translucent"){for(var p=i.context,f=i.depthModeForSublayer(0,V.ReadOnly),d=i.colorModeForRenderPass(),v=i.renderPass==="translucent"?i.stencilConfigForOverlap(s):[{},s],w=v[0],A=0,D=v[1];A<D.length;A+=1){var F=D[A],O=o.getTile(F);O.needsHillshadePrepare&&i.renderPass==="offscreen"?Vc(i,O,n,f,Z.disabled,d):i.renderPass==="translucent"&&as(i,O,n,f,w[F.overscaledZ],d)}p.viewport.set([0,0,i.width,i.height])}},raster:function(i,o,n,s){if(i.renderPass==="translucent"&&n.paint.get("raster-opacity")!==0&&s.length)for(var p=i.context,f=p.gl,d=o.getSource(),v=i.useProgram("raster"),w=i.colorModeForRenderPass(),A=d instanceof Xr?[{},s]:i.stencilConfigForOverlap(s),D=A[0],F=A[1],O=F[F.length-1].overscaledZ,W=!i.options.moving,$=0,ee=F;$<ee.length;$+=1){var N=ee[$],Q=i.depthModeForSublayer(N.overscaledZ-O,n.paint.get("raster-opacity")===1?V.ReadWrite:V.ReadOnly,f.LESS),ne=o.getTile(N),ue=i.transform.calculatePosMatrix(N.toUnwrapped(),W);ne.registerFadeDuration(n.paint.get("raster-fade-duration"));var de=o.findLoadedParent(N,0),pe=ss(ne,de,o,n,i.transform),ye=void 0,Ie=void 0,Me=n.paint.get("raster-resampling")==="nearest"?f.NEAREST:f.LINEAR;p.activeTexture.set(f.TEXTURE0),ne.texture.bind(Me,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST),p.activeTexture.set(f.TEXTURE1),de?(de.texture.bind(Me,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST),ye=Math.pow(2,de.tileID.overscaledZ-ne.tileID.overscaledZ),Ie=[ne.tileID.canonical.x*ye%1,ne.tileID.canonical.y*ye%1]):ne.texture.bind(Me,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST);var Ce=Oc(ue,Ie||[0,0],ye||1,pe,n);d instanceof Xr?v.draw(p,f.TRIANGLES,Q,Z.disabled,w,ie.disabled,Ce,n.id,d.boundsBuffer,i.quadTriangleIndexBuffer,d.boundsSegments):v.draw(p,f.TRIANGLES,Q,D[N.overscaledZ],w,ie.disabled,Ce,n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments)}},background:function(i,o,n){var s=n.paint.get("background-color"),p=n.paint.get("background-opacity");if(p!==0){var f=i.context,d=f.gl,v=i.transform,w=v.tileSize,A=n.paint.get("background-pattern");if(!i.isPatternMissing(A)){var D=!A&&s.a===1&&p===1&&i.opaquePassEnabledForLayer()?"opaque":"translucent";if(i.renderPass===D){var F=Z.disabled,O=i.depthModeForSublayer(0,D==="opaque"?V.ReadWrite:V.ReadOnly),W=i.colorModeForRenderPass(),$=i.useProgram(A?"backgroundPattern":"background"),ee=v.coveringTiles({tileSize:w});A&&(f.activeTexture.set(d.TEXTURE0),i.imageManager.bind(i.context));for(var N=n.getCrossfadeParameters(),Q=0,ne=ee;Q<ne.length;Q+=1){var ue=ne[Q],de=i.transform.calculatePosMatrix(ue.toUnwrapped()),pe=A?Jo(de,p,i,A,{tileID:ue,tileSize:w},N):Sa(de,p,s);$.draw(f,d.TRIANGLES,O,F,W,ie.disabled,pe,n.id,i.tileExtentBuffer,i.quadTriangleIndexBuffer,i.tileExtentSegments)}}}}},debug:function(i,o,n){for(var s=0;s<n.length;s++)kl(i,o,n[s])},custom:function(i,o,n){var s=i.context,p=n.implementation;if(i.renderPass==="offscreen"){var f=p.prerender;f&&(i.setCustomLayerDefaults(),s.setColorMode(i.colorModeForRenderPass()),f.call(p,s.gl,i.transform.customLayerMatrix()),s.setDirty(),i.setBaseState())}else if(i.renderPass==="translucent"){i.setCustomLayerDefaults(),s.setColorMode(i.colorModeForRenderPass()),s.setStencilMode(Z.disabled);var d=p.renderingMode==="3d"?new V(i.context.gl.LEQUAL,V.ReadWrite,i.depthRangeFor3D):i.depthModeForSublayer(0,V.ReadOnly);s.setDepthMode(d),p.render(s.gl,i.transform.customLayerMatrix()),s.setDirty(),i.setBaseState(),s.bindFramebuffer.set(null)}}},vr=function(i,o){this.context=new L(i),this.transform=o,this._tileTextures={},this.setup(),this.numSublayers=H.maxUnderzooming+H.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Zn,this.gpuTimers={}};vr.prototype.resize=function(i,o){if(this.width=i*u.browser.devicePixelRatio,this.height=o*u.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,s=this.style._order;n<s.length;n+=1)this.style._layers[s[n]].resize()},vr.prototype.setup=function(){var i=this.context,o=new u.StructArrayLayout2i4;o.emplaceBack(0,0),o.emplaceBack(u.EXTENT,0),o.emplaceBack(0,u.EXTENT),o.emplaceBack(u.EXTENT,u.EXTENT),this.tileExtentBuffer=i.createVertexBuffer(o,Vr.members),this.tileExtentSegments=u.SegmentVector.simpleSegment(0,0,4,2);var n=new u.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(u.EXTENT,0),n.emplaceBack(0,u.EXTENT),n.emplaceBack(u.EXTENT,u.EXTENT),this.debugBuffer=i.createVertexBuffer(n,Vr.members),this.debugSegments=u.SegmentVector.simpleSegment(0,0,4,5);var s=new u.StructArrayLayout4i8;s.emplaceBack(0,0,0,0),s.emplaceBack(u.EXTENT,0,u.EXTENT,0),s.emplaceBack(0,u.EXTENT,0,u.EXTENT),s.emplaceBack(u.EXTENT,u.EXTENT,u.EXTENT,u.EXTENT),this.rasterBoundsBuffer=i.createVertexBuffer(s,Lr.members),this.rasterBoundsSegments=u.SegmentVector.simpleSegment(0,0,4,2);var p=new u.StructArrayLayout2i4;p.emplaceBack(0,0),p.emplaceBack(1,0),p.emplaceBack(0,1),p.emplaceBack(1,1),this.viewportBuffer=i.createVertexBuffer(p,Vr.members),this.viewportSegments=u.SegmentVector.simpleSegment(0,0,4,2);var f=new u.StructArrayLayout1ui2;f.emplaceBack(0),f.emplaceBack(1),f.emplaceBack(3),f.emplaceBack(2),f.emplaceBack(0),this.tileBorderIndexBuffer=i.createIndexBuffer(f);var d=new u.StructArrayLayout3ui6;d.emplaceBack(0,1,2),d.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=i.createIndexBuffer(d),this.emptyTexture=new u.Texture(i,{width:1,height:1,data:new Uint8Array([0,0,0,0])},i.gl.RGBA);var v=this.context.gl;this.stencilClearMode=new Z({func:v.ALWAYS,mask:0},0,255,v.ZERO,v.ZERO,v.ZERO)},vr.prototype.clearStencil=function(){var i=this.context,o=i.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var n=u.create();u.ortho(n,0,this.width,this.height,0,0,1),u.scale(n,n,[o.drawingBufferWidth,o.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(i,o.TRIANGLES,V.disabled,this.stencilClearMode,re.disabled,ie.disabled,Eo(n),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},vr.prototype._renderTileClippingMasks=function(i,o){if(this.currentStencilSource!==i.source&&i.isTileClipped()&&o&&o.length){this.currentStencilSource=i.source;var n=this.context,s=n.gl;this.nextStencilID+o.length>256&&this.clearStencil(),n.setColorMode(re.disabled),n.setDepthMode(V.disabled);var p=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var f=0,d=o;f<d.length;f+=1){var v=d[f],w=this._tileClippingMaskIDs[v.key]=this.nextStencilID++;p.draw(n,s.TRIANGLES,V.disabled,new Z({func:s.ALWAYS,mask:0},w,255,s.KEEP,s.KEEP,s.REPLACE),re.disabled,ie.disabled,Eo(v.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},vr.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var i=this.nextStencilID++,o=this.context.gl;return new Z({func:o.NOTEQUAL,mask:255},i,255,o.KEEP,o.KEEP,o.REPLACE)},vr.prototype.stencilModeForClipping=function(i){var o=this.context.gl;return new Z({func:o.EQUAL,mask:255},this._tileClippingMaskIDs[i.key],0,o.KEEP,o.KEEP,o.REPLACE)},vr.prototype.stencilConfigForOverlap=function(i){var o,n=this.context.gl,s=i.sort((function(w,A){return A.overscaledZ-w.overscaledZ})),p=s[s.length-1].overscaledZ,f=s[0].overscaledZ-p+1;if(f>1){this.currentStencilSource=void 0,this.nextStencilID+f>256&&this.clearStencil();for(var d={},v=0;v<f;v++)d[v+p]=new Z({func:n.GEQUAL,mask:255},v+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=f,[d,s]}return[(o={},o[p]=Z.disabled,o),s]},vr.prototype.colorModeForRenderPass=function(){var i=this.context.gl;return this._showOverdrawInspector?new re([i.CONSTANT_COLOR,i.ONE],new u.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?re.unblended:re.alphaBlended},vr.prototype.depthModeForSublayer=function(i,o,n){if(!this.opaquePassEnabledForLayer())return V.disabled;var s=1-((1+this.currentLayer)*this.numSublayers+i)*this.depthEpsilon;return new V(n||this.context.gl.LEQUAL,o,[s,s])},vr.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},vr.prototype.render=function(i,o){var n=this;this.style=i,this.options=o,this.lineAtlas=i.lineAtlas,this.imageManager=i.imageManager,this.glyphManager=i.glyphManager,this.symbolFadeChange=i.placement.symbolFadeChange(u.browser.now()),this.imageManager.beginFrame();var s=this.style._order,p=this.style.sourceCaches;for(var f in p){var d=p[f];d.used&&d.prepare(this.context)}var v,w,A={},D={},F={};for(var O in p){var W=p[O];A[O]=W.getVisibleCoordinates(),D[O]=A[O].slice().reverse(),F[O]=W.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var $=0;$<s.length;$++)if(this.style._layers[s[$]].is3D()){this.opaquePassCutoff=$;break}this.renderPass="offscreen";for(var ee=0,N=s;ee<N.length;ee+=1){var Q=this.style._layers[N[ee]];if(Q.hasOffscreenPass()&&!Q.isHidden(this.transform.zoom)){var ne=D[Q.source];(Q.type==="custom"||ne.length)&&this.renderLayer(this,p[Q.source],Q,ne)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:o.showOverdrawInspector?u.Color.black:u.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=o.showOverdrawInspector,this.depthRangeFor3D=[0,1-(i._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=s.length-1;this.currentLayer>=0;this.currentLayer--){var ue=this.style._layers[s[this.currentLayer]],de=p[ue.source],pe=A[ue.source];this._renderTileClippingMasks(ue,pe),this.renderLayer(this,de,ue,pe)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<s.length;this.currentLayer++){var ye=this.style._layers[s[this.currentLayer]],Ie=p[ye.source],Me=(ye.type==="symbol"?F:D)[ye.source];this._renderTileClippingMasks(ye,A[ye.source]),this.renderLayer(this,Ie,ye,Me)}this.options.showTileBoundaries&&(u.values(this.style._layers).forEach((function(Ce){Ce.source&&!Ce.isHidden(n.transform.zoom)&&(Ce.source!==(w&&w.id)&&(w=n.style.sourceCaches[Ce.source]),(!v||v.getSource().maxzoom<w.getSource().maxzoom)&&(v=w))})),v&&Co.debug(this,v,v.getVisibleCoordinates())),this.options.showPadding&&(function(Ce){var $e=Ce.transform.padding;hu(Ce,Ce.transform.height-($e.top||0),3,cu),hu(Ce,$e.bottom||0,3,Pl),fu(Ce,$e.left||0,3,Cl),fu(Ce,Ce.transform.width-($e.right||0),3,us);var nt=Ce.transform.centerPoint;(function(ut,st,Lt,He){Ta(ut,st-1,Lt-10,2,20,He),Ta(ut,st-10,Lt-1,20,2,He)})(Ce,nt.x,Ce.transform.height-nt.y,pu)})(this),this.context.setDefault()},vr.prototype.renderLayer=function(i,o,n,s){n.isHidden(this.transform.zoom)||(n.type==="background"||n.type==="custom"||s.length)&&(this.id=n.id,this.gpuTimingStart(n),Co[n.type](i,o,n,s,this.style.placement.variableOffsets),this.gpuTimingEnd())},vr.prototype.gpuTimingStart=function(i){if(this.options.gpuTiming){var o=this.context.extTimerQuery,n=this.gpuTimers[i.id];n||(n=this.gpuTimers[i.id]={calls:0,cpuTime:0,query:o.createQueryEXT()}),n.calls++,o.beginQueryEXT(o.TIME_ELAPSED_EXT,n.query)}},vr.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var i=this.context.extTimerQuery;i.endQueryEXT(i.TIME_ELAPSED_EXT)}},vr.prototype.collectGpuTimers=function(){var i=this.gpuTimers;return this.gpuTimers={},i},vr.prototype.queryGpuTimers=function(i){var o={};for(var n in i){var s=i[n],p=this.context.extTimerQuery,f=p.getQueryObjectEXT(s.query,p.QUERY_RESULT_EXT)/1e6;p.deleteQueryEXT(s.query),o[n]=f}return o},vr.prototype.translatePosMatrix=function(i,o,n,s,p){if(!n[0]&&!n[1])return i;var f=p?s==="map"?this.transform.angle:0:s==="viewport"?-this.transform.angle:0;if(f){var d=Math.sin(f),v=Math.cos(f);n=[n[0]*v-n[1]*d,n[0]*d+n[1]*v]}var w=[p?n[0]:yr(o,n[0],this.transform.zoom),p?n[1]:yr(o,n[1],this.transform.zoom),0],A=new Float32Array(16);return u.translate(A,i,w),A},vr.prototype.saveTileTexture=function(i){var o=this._tileTextures[i.size[0]];o?o.push(i):this._tileTextures[i.size[0]]=[i]},vr.prototype.getTileTexture=function(i){var o=this._tileTextures[i];return o&&o.length>0?o.pop():null},vr.prototype.isPatternMissing=function(i){if(!i)return!1;if(!i.from||!i.to)return!0;var o=this.imageManager.getPattern(i.from.toString()),n=this.imageManager.getPattern(i.to.toString());return!o||!n},vr.prototype.useProgram=function(i,o){this.cache=this.cache||{};var n=""+i+(o?o.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[n]||(this.cache[n]=new ml(this.context,i,Lc[i],o,Il[i],this._showOverdrawInspector)),this.cache[n]},vr.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},vr.prototype.setBaseState=function(){var i=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(i.FUNC_ADD)},vr.prototype.initDebugOverlayCanvas=function(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=u.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new u.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},vr.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var ls=function(i,o){this.points=i,this.planes=o};ls.fromInvProjectionMatrix=function(i,o,n){var s=Math.pow(2,n),p=[[-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((function(d){return u.transformMat4([],d,i)})).map((function(d){return u.scale$1([],d,1/d[3]/o*s)})),f=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(d){var v=u.sub([],p[d[0]],p[d[1]]),w=u.sub([],p[d[2]],p[d[1]]),A=u.normalize([],u.cross([],v,w)),D=-u.dot(A,p[d[1]]);return A.concat(D)}));return new ls(p,f)};var ko=function(i,o){this.min=i,this.max=o,this.center=u.scale$2([],u.add([],this.min,this.max),.5)};ko.prototype.quadrant=function(i){for(var o=[i%2==0,i<2],n=u.clone$2(this.min),s=u.clone$2(this.max),p=0;p<o.length;p++)n[p]=o[p]?this.min[p]:this.center[p],s[p]=o[p]?this.center[p]:this.max[p];return s[2]=this.max[2],new ko(n,s)},ko.prototype.distanceX=function(i){return Math.max(Math.min(this.max[0],i[0]),this.min[0])-i[0]},ko.prototype.distanceY=function(i){return Math.max(Math.min(this.max[1],i[1]),this.min[1])-i[1]},ko.prototype.intersects=function(i){for(var o=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],n=!0,s=0;s<i.planes.length;s++){for(var p=i.planes[s],f=0,d=0;d<o.length;d++)f+=u.dot$1(p,o[d])>=0;if(f===0)return 0;f!==o.length&&(n=!1)}if(n)return 2;for(var v=0;v<3;v++){for(var w=Number.MAX_VALUE,A=-Number.MAX_VALUE,D=0;D<i.points.length;D++){var F=i.points[D][v]-this.min[v];w=Math.min(w,F),A=Math.max(A,F)}if(A<0||w>this.max[v]-this.min[v])return 0}return 1};var Qn=function(i,o,n,s){if(i===void 0&&(i=0),o===void 0&&(o=0),n===void 0&&(n=0),s===void 0&&(s=0),isNaN(i)||i<0||isNaN(o)||o<0||isNaN(n)||n<0||isNaN(s)||s<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=i,this.bottom=o,this.left=n,this.right=s};Qn.prototype.interpolate=function(i,o,n){return o.top!=null&&i.top!=null&&(this.top=u.number(i.top,o.top,n)),o.bottom!=null&&i.bottom!=null&&(this.bottom=u.number(i.bottom,o.bottom,n)),o.left!=null&&i.left!=null&&(this.left=u.number(i.left,o.left,n)),o.right!=null&&i.right!=null&&(this.right=u.number(i.right,o.right,n)),this},Qn.prototype.getCenter=function(i,o){var n=u.clamp((this.left+i-this.right)/2,0,i),s=u.clamp((this.top+o-this.bottom)/2,0,o);return new u.Point(n,s)},Qn.prototype.equals=function(i){return this.top===i.top&&this.bottom===i.bottom&&this.left===i.left&&this.right===i.right},Qn.prototype.clone=function(){return new Qn(this.top,this.bottom,this.left,this.right)},Qn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var zt=function(i,o,n,s,p){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=p===void 0||p,this._minZoom=i||0,this._maxZoom=o||22,this._minPitch=n??0,this._maxPitch=s??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new u.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Qn,this._posMatrixCache={},this._alignedPosMatrixCache={}},lr={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};zt.prototype.clone=function(){var i=new zt(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return i.tileSize=this.tileSize,i.latRange=this.latRange,i.width=this.width,i.height=this.height,i._center=this._center,i.zoom=this.zoom,i.angle=this.angle,i._fov=this._fov,i._pitch=this._pitch,i._unmodified=this._unmodified,i._edgeInsets=this._edgeInsets.clone(),i._calcMatrices(),i},lr.minZoom.get=function(){return this._minZoom},lr.minZoom.set=function(i){this._minZoom!==i&&(this._minZoom=i,this.zoom=Math.max(this.zoom,i))},lr.maxZoom.get=function(){return this._maxZoom},lr.maxZoom.set=function(i){this._maxZoom!==i&&(this._maxZoom=i,this.zoom=Math.min(this.zoom,i))},lr.minPitch.get=function(){return this._minPitch},lr.minPitch.set=function(i){this._minPitch!==i&&(this._minPitch=i,this.pitch=Math.max(this.pitch,i))},lr.maxPitch.get=function(){return this._maxPitch},lr.maxPitch.set=function(i){this._maxPitch!==i&&(this._maxPitch=i,this.pitch=Math.min(this.pitch,i))},lr.renderWorldCopies.get=function(){return this._renderWorldCopies},lr.renderWorldCopies.set=function(i){i===void 0?i=!0:i===null&&(i=!1),this._renderWorldCopies=i},lr.worldSize.get=function(){return this.tileSize*this.scale},lr.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},lr.size.get=function(){return new u.Point(this.width,this.height)},lr.bearing.get=function(){return-this.angle/Math.PI*180},lr.bearing.set=function(i){var o=-u.wrap(i,-180,180)*Math.PI/180;this.angle!==o&&(this._unmodified=!1,this.angle=o,this._calcMatrices(),this.rotationMatrix=u.create$2(),u.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},lr.pitch.get=function(){return this._pitch/Math.PI*180},lr.pitch.set=function(i){var o=u.clamp(i,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==o&&(this._unmodified=!1,this._pitch=o,this._calcMatrices())},lr.fov.get=function(){return this._fov/Math.PI*180},lr.fov.set=function(i){i=Math.max(.01,Math.min(60,i)),this._fov!==i&&(this._unmodified=!1,this._fov=i/180*Math.PI,this._calcMatrices())},lr.zoom.get=function(){return this._zoom},lr.zoom.set=function(i){var o=Math.min(Math.max(i,this.minZoom),this.maxZoom);this._zoom!==o&&(this._unmodified=!1,this._zoom=o,this.scale=this.zoomScale(o),this.tileZoom=Math.floor(o),this.zoomFraction=o-this.tileZoom,this._constrain(),this._calcMatrices())},lr.center.get=function(){return this._center},lr.center.set=function(i){i.lat===this._center.lat&&i.lng===this._center.lng||(this._unmodified=!1,this._center=i,this._constrain(),this._calcMatrices())},lr.padding.get=function(){return this._edgeInsets.toJSON()},lr.padding.set=function(i){this._edgeInsets.equals(i)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,i,1),this._calcMatrices())},lr.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},zt.prototype.isPaddingEqual=function(i){return this._edgeInsets.equals(i)},zt.prototype.interpolatePadding=function(i,o,n){this._unmodified=!1,this._edgeInsets.interpolate(i,o,n),this._constrain(),this._calcMatrices()},zt.prototype.coveringZoomLevel=function(i){var o=(i.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/i.tileSize));return Math.max(0,o)},zt.prototype.getVisibleUnwrappedCoordinates=function(i){var o=[new u.UnwrappedTileID(0,i)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new u.Point(0,0)),s=this.pointCoordinate(new u.Point(this.width,0)),p=this.pointCoordinate(new u.Point(this.width,this.height)),f=this.pointCoordinate(new u.Point(0,this.height)),d=Math.floor(Math.min(n.x,s.x,p.x,f.x)),v=Math.floor(Math.max(n.x,s.x,p.x,f.x)),w=d-1;w<=v+1;w++)w!==0&&o.push(new u.UnwrappedTileID(w,i));return o},zt.prototype.coveringTiles=function(i){var o=this.coveringZoomLevel(i),n=o;if(i.minzoom!==void 0&&o<i.minzoom)return[];i.maxzoom!==void 0&&o>i.maxzoom&&(o=i.maxzoom);var s=u.MercatorCoordinate.fromLngLat(this.center),p=Math.pow(2,o),f=[p*s.x,p*s.y,0],d=ls.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,o),v=i.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(v=o);var w=function(Ce){return{aabb:new ko([Ce*p,0,0],[(Ce+1)*p,p,0]),zoom:0,x:0,y:0,wrap:Ce,fullyVisible:!1}},A=[],D=[],F=o,O=i.reparseOverscaled?n:o;if(this._renderWorldCopies)for(var W=1;W<=3;W++)A.push(w(-W)),A.push(w(W));for(A.push(w(0));A.length>0;){var $=A.pop(),ee=$.x,N=$.y,Q=$.fullyVisible;if(!Q){var ne=$.aabb.intersects(d);if(ne===0)continue;Q=ne===2}var ue=$.aabb.distanceX(f),de=$.aabb.distanceY(f),pe=Math.max(Math.abs(ue),Math.abs(de));if($.zoom===F||pe>3+(1<<F-$.zoom)-2&&$.zoom>=v)D.push({tileID:new u.OverscaledTileID($.zoom===F?O:$.zoom,$.wrap,$.zoom,ee,N),distanceSq:u.sqrLen([f[0]-.5-ee,f[1]-.5-N])});else for(var ye=0;ye<4;ye++){var Ie=(ee<<1)+ye%2,Me=(N<<1)+(ye>>1);A.push({aabb:$.aabb.quadrant(ye),zoom:$.zoom+1,x:Ie,y:Me,wrap:$.wrap,fullyVisible:Q})}}return D.sort((function(Ce,$e){return Ce.distanceSq-$e.distanceSq})).map((function(Ce){return Ce.tileID}))},zt.prototype.resize=function(i,o){this.width=i,this.height=o,this.pixelsToGLUnits=[2/i,-2/o],this._constrain(),this._calcMatrices()},lr.unmodified.get=function(){return this._unmodified},zt.prototype.zoomScale=function(i){return Math.pow(2,i)},zt.prototype.scaleZoom=function(i){return Math.log(i)/Math.LN2},zt.prototype.project=function(i){var o=u.clamp(i.lat,-this.maxValidLatitude,this.maxValidLatitude);return new u.Point(u.mercatorXfromLng(i.lng)*this.worldSize,u.mercatorYfromLat(o)*this.worldSize)},zt.prototype.unproject=function(i){return new u.MercatorCoordinate(i.x/this.worldSize,i.y/this.worldSize).toLngLat()},lr.point.get=function(){return this.project(this.center)},zt.prototype.setLocationAtPoint=function(i,o){var n=this.pointCoordinate(o),s=this.pointCoordinate(this.centerPoint),p=this.locationCoordinate(i),f=new u.MercatorCoordinate(p.x-(n.x-s.x),p.y-(n.y-s.y));this.center=this.coordinateLocation(f),this._renderWorldCopies&&(this.center=this.center.wrap())},zt.prototype.locationPoint=function(i){return this.coordinatePoint(this.locationCoordinate(i))},zt.prototype.pointLocation=function(i){return this.coordinateLocation(this.pointCoordinate(i))},zt.prototype.locationCoordinate=function(i){return u.MercatorCoordinate.fromLngLat(i)},zt.prototype.coordinateLocation=function(i){return i.toLngLat()},zt.prototype.pointCoordinate=function(i){var o=[i.x,i.y,0,1],n=[i.x,i.y,1,1];u.transformMat4(o,o,this.pixelMatrixInverse),u.transformMat4(n,n,this.pixelMatrixInverse);var s=o[3],p=n[3],f=o[1]/s,d=n[1]/p,v=o[2]/s,w=n[2]/p,A=v===w?0:(0-v)/(w-v);return new u.MercatorCoordinate(u.number(o[0]/s,n[0]/p,A)/this.worldSize,u.number(f,d,A)/this.worldSize)},zt.prototype.coordinatePoint=function(i){var o=[i.x*this.worldSize,i.y*this.worldSize,0,1];return u.transformMat4(o,o,this.pixelMatrix),new u.Point(o[0]/o[3],o[1]/o[3])},zt.prototype.getBounds=function(){return new u.LngLatBounds().extend(this.pointLocation(new u.Point(0,0))).extend(this.pointLocation(new u.Point(this.width,0))).extend(this.pointLocation(new u.Point(this.width,this.height))).extend(this.pointLocation(new u.Point(0,this.height)))},zt.prototype.getMaxBounds=function(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new u.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},zt.prototype.setMaxBounds=function(i){i?(this.lngRange=[i.getWest(),i.getEast()],this.latRange=[i.getSouth(),i.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},zt.prototype.calculatePosMatrix=function(i,o){o===void 0&&(o=!1);var n=i.key,s=o?this._alignedPosMatrixCache:this._posMatrixCache;if(s[n])return s[n];var p=i.canonical,f=this.worldSize/this.zoomScale(p.z),d=p.x+Math.pow(2,p.z)*i.wrap,v=u.identity(new Float64Array(16));return u.translate(v,v,[d*f,p.y*f,0]),u.scale(v,v,[f/u.EXTENT,f/u.EXTENT,1]),u.multiply(v,o?this.alignedProjMatrix:this.projMatrix,v),s[n]=new Float32Array(v),s[n]},zt.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},zt.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var i,o,n,s,p=-90,f=90,d=-180,v=180,w=this.size,A=this._unmodified;if(this.latRange){var D=this.latRange;p=u.mercatorYfromLat(D[1])*this.worldSize,i=(f=u.mercatorYfromLat(D[0])*this.worldSize)-p<w.y?w.y/(f-p):0}if(this.lngRange){var F=this.lngRange;d=u.mercatorXfromLng(F[0])*this.worldSize,o=(v=u.mercatorXfromLng(F[1])*this.worldSize)-d<w.x?w.x/(v-d):0}var O=this.point,W=Math.max(o||0,i||0);if(W)return this.center=this.unproject(new u.Point(o?(v+d)/2:O.x,i?(f+p)/2:O.y)),this.zoom+=this.scaleZoom(W),this._unmodified=A,void(this._constraining=!1);if(this.latRange){var $=O.y,ee=w.y/2;$-ee<p&&(s=p+ee),$+ee>f&&(s=f-ee)}if(this.lngRange){var N=O.x,Q=w.x/2;N-Q<d&&(n=d+Q),N+Q>v&&(n=v-Q)}n===void 0&&s===void 0||(this.center=this.unproject(new u.Point(n!==void 0?n:O.x,s!==void 0?s:O.y))),this._unmodified=A,this._constraining=!1}},zt.prototype._calcMatrices=function(){if(this.height){var i=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var o=Math.PI/2+this._pitch,n=this._fov*(.5+i.y/this.height),s=Math.sin(n)*this.cameraToCenterDistance/Math.sin(u.clamp(Math.PI-o-n,.01,Math.PI-.01)),p=this.point,f=p.x,d=p.y,v=1.01*(Math.cos(Math.PI/2-this._pitch)*s+this.cameraToCenterDistance),w=this.height/50,A=new Float64Array(16);u.perspective(A,this._fov,this.width/this.height,w,v),A[8]=2*-i.x/this.width,A[9]=2*i.y/this.height,u.scale(A,A,[1,-1,1]),u.translate(A,A,[0,0,-this.cameraToCenterDistance]),u.rotateX(A,A,this._pitch),u.rotateZ(A,A,this.angle),u.translate(A,A,[-f,-d,0]),this.mercatorMatrix=u.scale([],A,[this.worldSize,this.worldSize,this.worldSize]),u.scale(A,A,[1,1,u.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=A,this.invProjMatrix=u.invert([],this.projMatrix);var D=this.width%2/2,F=this.height%2/2,O=Math.cos(this.angle),W=Math.sin(this.angle),$=f-Math.round(f)+O*D+W*F,ee=d-Math.round(d)+O*F+W*D,N=new Float64Array(A);if(u.translate(N,N,[$>.5?$-1:$,ee>.5?ee-1:ee,0]),this.alignedProjMatrix=N,A=u.create(),u.scale(A,A,[this.width/2,-this.height/2,1]),u.translate(A,A,[1,-1,0]),this.labelPlaneMatrix=A,A=u.create(),u.scale(A,A,[1,-1,1]),u.translate(A,A,[-1,-1,0]),u.scale(A,A,[2/this.width,2/this.height,1]),this.glCoordMatrix=A,this.pixelMatrix=u.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(A=u.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=A,this._posMatrixCache={},this._alignedPosMatrixCache={}}},zt.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var i=this.pointCoordinate(new u.Point(0,0)),o=[i.x*this.worldSize,i.y*this.worldSize,0,1];return u.transformMat4(o,o,this.pixelMatrix)[3]/this.cameraToCenterDistance},zt.prototype.getCameraPoint=function(){var i=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new u.Point(0,i))},zt.prototype.getCameraQueryGeometry=function(i){var o=this.getCameraPoint();if(i.length===1)return[i[0],o];for(var n=o.x,s=o.y,p=o.x,f=o.y,d=0,v=i;d<v.length;d+=1){var w=v[d];n=Math.min(n,w.x),s=Math.min(s,w.y),p=Math.max(p,w.x),f=Math.max(f,w.y)}return[new u.Point(n,s),new u.Point(p,s),new u.Point(p,f),new u.Point(n,f),new u.Point(n,s)]},Object.defineProperties(zt.prototype,lr);var Yi=function(i){var o,n,s,p;this._hashName=i&&encodeURIComponent(i),u.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(o=this._updateHashUnthrottled.bind(this),n=!1,s=null,p=function(){s=null,n&&(o(),s=setTimeout(p,300),n=!1)},function(){return n=!0,s||p(),s})};Yi.prototype.addTo=function(i){return this._map=i,u.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},Yi.prototype.remove=function(){return u.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},Yi.prototype.getHashString=function(i){var o=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,s=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),p=Math.pow(10,s),f=Math.round(o.lng*p)/p,d=Math.round(o.lat*p)/p,v=this._map.getBearing(),w=this._map.getPitch(),A="";if(A+=i?"/"+f+"/"+d+"/"+n:n+"/"+d+"/"+f,(v||w)&&(A+="/"+Math.round(10*v)/10),w&&(A+="/"+Math.round(w)),this._hashName){var D=this._hashName,F=!1,O=u.window.location.hash.slice(1).split("&").map((function(W){var $=W.split("=")[0];return $===D?(F=!0,$+"="+A):W})).filter((function(W){return W}));return F||O.push(D+"="+A),"#"+O.join("&")}return"#"+A},Yi.prototype._getCurrentHash=function(){var i,o=this,n=u.window.location.hash.replace("#","");return this._hashName?(n.split("&").map((function(s){return s.split("=")})).forEach((function(s){s[0]===o._hashName&&(i=s)})),(i&&i[1]||"").split("/")):n.split("/")},Yi.prototype._onHashChange=function(){var i=this._getCurrentHash();if(i.length>=3&&!i.some((function(n){return isNaN(n)}))){var o=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(i[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+i[2],+i[1]],zoom:+i[0],bearing:o,pitch:+(i[4]||0)}),!0}return!1},Yi.prototype._updateHashUnthrottled=function(){var i=u.window.location.href.replace(/(#.+)?$/,this.getHashString());try{u.window.history.replaceState(u.window.history.state,null,i)}catch{}};var Aa={linearity:.3,easing:u.bezier(0,0,.3,1)},Qo=u.extend({deceleration:2500,maxSpeed:1400},Aa),Ea=u.extend({deceleration:20,maxSpeed:1400},Aa),qc=u.extend({deceleration:1e3,maxSpeed:360},Aa),Uc=u.extend({deceleration:1e3,maxSpeed:90},Aa),Pa=function(i){this._map=i,this.clear()};function Ca(i,o){(!i.duration||i.duration<o.duration)&&(i.duration=o.duration,i.easing=o.easing)}function Rn(i,o,n){var s=n.maxSpeed,p=n.linearity,f=n.deceleration,d=u.clamp(i*p/(o/1e3),-s,s),v=Math.abs(d)/(f*p);return{easing:n.easing,duration:1e3*v,amount:d*(v/2)}}Pa.prototype.clear=function(){this._inertiaBuffer=[]},Pa.prototype.record=function(i){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:u.browser.now(),settings:i})},Pa.prototype._drainInertiaBuffer=function(){for(var i=this._inertiaBuffer,o=u.browser.now();i.length>0&&o-i[0].time>160;)i.shift()},Pa.prototype._onMoveEnd=function(i){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var o={zoom:0,bearing:0,pitch:0,pan:new u.Point(0,0),pinchAround:void 0,around:void 0},n=0,s=this._inertiaBuffer;n<s.length;n+=1){var p=s[n].settings;o.zoom+=p.zoomDelta||0,o.bearing+=p.bearingDelta||0,o.pitch+=p.pitchDelta||0,p.panDelta&&o.pan._add(p.panDelta),p.around&&(o.around=p.around),p.pinchAround&&(o.pinchAround=p.pinchAround)}var f=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,d={};if(o.pan.mag()){var v=Rn(o.pan.mag(),f,u.extend({},Qo,i||{}));d.offset=o.pan.mult(v.amount/o.pan.mag()),d.center=this._map.transform.center,Ca(d,v)}if(o.zoom){var w=Rn(o.zoom,f,Ea);d.zoom=this._map.transform.zoom+w.amount,Ca(d,w)}if(o.bearing){var A=Rn(o.bearing,f,qc);d.bearing=this._map.transform.bearing+u.clamp(A.amount,-179,179),Ca(d,A)}if(o.pitch){var D=Rn(o.pitch,f,Uc);d.pitch=this._map.transform.pitch+D.amount,Ca(d,D)}if(d.zoom||d.bearing){var F=o.pinchAround===void 0?o.around:o.pinchAround;d.around=F?this._map.unproject(F):this._map.getCenter()}return this.clear(),u.extend(d,{noMoveStart:!0})}};var Gr=(function(i){function o(s,p,f,d){d===void 0&&(d={});var v=k.mousePos(p.getCanvasContainer(),f),w=p.unproject(v);i.call(this,s,u.extend({point:v,lngLat:w,originalEvent:f},d)),this._defaultPrevented=!1,this.target=p}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={defaultPrevented:{configurable:!0}};return o.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(o.prototype,n),o})(u.Event),ka=(function(i){function o(s,p,f){var d=s==="touchend"?f.changedTouches:f.touches,v=k.touchPos(p.getCanvasContainer(),d),w=v.map((function(F){return p.unproject(F)})),A=v.reduce((function(F,O,W,$){return F.add(O.div($.length))}),new u.Point(0,0)),D=p.unproject(A);i.call(this,s,{points:v,point:A,lngLats:w,lngLat:D,originalEvent:f}),this._defaultPrevented=!1}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={defaultPrevented:{configurable:!0}};return o.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(o.prototype,n),o})(u.Event),Ml=(function(i){function o(s,p,f){i.call(this,s,{originalEvent:f}),this._defaultPrevented=!1}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={defaultPrevented:{configurable:!0}};return o.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(o.prototype,n),o})(u.Event),qr=function(i,o){this._map=i,this._clickTolerance=o.clickTolerance};qr.prototype.reset=function(){delete this._mousedownPos},qr.prototype.wheel=function(i){return this._firePreventable(new Ml(i.type,this._map,i))},qr.prototype.mousedown=function(i,o){return this._mousedownPos=o,this._firePreventable(new Gr(i.type,this._map,i))},qr.prototype.mouseup=function(i){this._map.fire(new Gr(i.type,this._map,i))},qr.prototype.click=function(i,o){this._mousedownPos&&this._mousedownPos.dist(o)>=this._clickTolerance||this._map.fire(new Gr(i.type,this._map,i))},qr.prototype.dblclick=function(i){return this._firePreventable(new Gr(i.type,this._map,i))},qr.prototype.mouseover=function(i){this._map.fire(new Gr(i.type,this._map,i))},qr.prototype.mouseout=function(i){this._map.fire(new Gr(i.type,this._map,i))},qr.prototype.touchstart=function(i){return this._firePreventable(new ka(i.type,this._map,i))},qr.prototype.touchmove=function(i){this._map.fire(new ka(i.type,this._map,i))},qr.prototype.touchend=function(i){this._map.fire(new ka(i.type,this._map,i))},qr.prototype.touchcancel=function(i){this._map.fire(new ka(i.type,this._map,i))},qr.prototype._firePreventable=function(i){if(this._map.fire(i),i.defaultPrevented)return{}},qr.prototype.isEnabled=function(){return!0},qr.prototype.isActive=function(){return!1},qr.prototype.enable=function(){},qr.prototype.disable=function(){};var Xe=function(i){this._map=i};Xe.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Xe.prototype.mousemove=function(i){this._map.fire(new Gr(i.type,this._map,i))},Xe.prototype.mousedown=function(){this._delayContextMenu=!0},Xe.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Gr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Xe.prototype.contextmenu=function(i){this._delayContextMenu?this._contextMenuEvent=i:this._map.fire(new Gr(i.type,this._map,i)),this._map.listens("contextmenu")&&i.preventDefault()},Xe.prototype.isEnabled=function(){return!0},Xe.prototype.isActive=function(){return!1},Xe.prototype.enable=function(){},Xe.prototype.disable=function(){};var Ni=function(i,o){this._map=i,this._el=i.getCanvasContainer(),this._container=i.getContainer(),this._clickTolerance=o.clickTolerance||1};function cs(i,o){for(var n={},s=0;s<i.length;s++)n[i[s].identifier]=o[s];return n}Ni.prototype.isEnabled=function(){return!!this._enabled},Ni.prototype.isActive=function(){return!!this._active},Ni.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Ni.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Ni.prototype.mousedown=function(i,o){this.isEnabled()&&i.shiftKey&&i.button===0&&(k.disableDrag(),this._startPos=this._lastPos=o,this._active=!0)},Ni.prototype.mousemoveWindow=function(i,o){if(this._active){var n=o;if(!(this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)){var s=this._startPos;this._lastPos=n,this._box||(this._box=k.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",i));var p=Math.min(s.x,n.x),f=Math.max(s.x,n.x),d=Math.min(s.y,n.y),v=Math.max(s.y,n.y);k.setTransform(this._box,"translate("+p+"px,"+d+"px)"),this._box.style.width=f-p+"px",this._box.style.height=v-d+"px"}}},Ni.prototype.mouseupWindow=function(i,o){var n=this;if(this._active&&i.button===0){var s=this._startPos,p=o;if(this.reset(),k.suppressClick(),s.x!==p.x||s.y!==p.y)return this._map.fire(new u.Event("boxzoomend",{originalEvent:i})),{cameraAnimation:function(f){return f.fitScreenCoordinates(s,p,n._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",i)}},Ni.prototype.keydown=function(i){this._active&&i.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",i))},Ni.prototype.blur=function(){this.reset()},Ni.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(k.remove(this._box),this._box=null),k.enableDrag(),delete this._startPos,delete this._lastPos},Ni.prototype._fireEvent=function(i,o){return this._map.fire(new u.Event(i,{originalEvent:o}))};var ea=function(i){this.reset(),this.numTouches=i.numTouches};ea.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},ea.prototype.touchstart=function(i,o,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=i.timeStamp),n.length===this.numTouches&&(this.centroid=(function(s){for(var p=new u.Point(0,0),f=0,d=s;f<d.length;f+=1)p._add(d[f]);return p.div(s.length)})(o),this.touches=cs(n,o)))},ea.prototype.touchmove=function(i,o,n){if(!this.aborted&&this.centroid){var s=cs(n,o);for(var p in this.touches){var f=s[p];(!f||f.dist(this.touches[p])>30)&&(this.aborted=!0)}}},ea.prototype.touchend=function(i,o,n){if((!this.centroid||i.timeStamp-this.startTime>500)&&(this.aborted=!0),n.length===0){var s=!this.aborted&&this.centroid;if(this.reset(),s)return s}};var gn=function(i){this.singleTap=new ea(i),this.numTaps=i.numTaps,this.reset()};gn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},gn.prototype.touchstart=function(i,o,n){this.singleTap.touchstart(i,o,n)},gn.prototype.touchmove=function(i,o,n){this.singleTap.touchmove(i,o,n)},gn.prototype.touchend=function(i,o,n){var s=this.singleTap.touchend(i,o,n);if(s){var p=i.timeStamp-this.lastTime<500,f=!this.lastTap||this.lastTap.dist(s)<30;if(p&&f||this.reset(),this.count++,this.lastTime=i.timeStamp,this.lastTap=s,this.count===this.numTaps)return this.reset(),s}};var ji=function(){this._zoomIn=new gn({numTouches:1,numTaps:2}),this._zoomOut=new gn({numTouches:2,numTaps:1}),this.reset()};ji.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},ji.prototype.touchstart=function(i,o,n){this._zoomIn.touchstart(i,o,n),this._zoomOut.touchstart(i,o,n)},ji.prototype.touchmove=function(i,o,n){this._zoomIn.touchmove(i,o,n),this._zoomOut.touchmove(i,o,n)},ji.prototype.touchend=function(i,o,n){var s=this,p=this._zoomIn.touchend(i,o,n),f=this._zoomOut.touchend(i,o,n);return p?(this._active=!0,i.preventDefault(),setTimeout((function(){return s.reset()}),0),{cameraAnimation:function(d){return d.easeTo({duration:300,zoom:d.getZoom()+1,around:d.unproject(p)},{originalEvent:i})}}):f?(this._active=!0,i.preventDefault(),setTimeout((function(){return s.reset()}),0),{cameraAnimation:function(d){return d.easeTo({duration:300,zoom:d.getZoom()-1,around:d.unproject(f)},{originalEvent:i})}}):void 0},ji.prototype.touchcancel=function(){this.reset()},ji.prototype.enable=function(){this._enabled=!0},ji.prototype.disable=function(){this._enabled=!1,this.reset()},ji.prototype.isEnabled=function(){return this._enabled},ji.prototype.isActive=function(){return this._active};var du={0:1,2:2},Le=function(i){this.reset(),this._clickTolerance=i.clickTolerance||1};Le.prototype.blur=function(){this.reset()},Le.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Le.prototype._correctButton=function(i,o){return!1},Le.prototype._move=function(i,o){return{}},Le.prototype.mousedown=function(i,o){if(!this._lastPoint){var n=k.mouseButton(i);this._correctButton(i,n)&&(this._lastPoint=o,this._eventButton=n)}},Le.prototype.mousemoveWindow=function(i,o){var n=this._lastPoint;if(n){if(i.preventDefault(),(function(s,p){var f=du[p];return s.buttons===void 0||(s.buttons&f)!==f})(i,this._eventButton))this.reset();else if(this._moved||!(o.dist(n)<this._clickTolerance))return this._moved=!0,this._lastPoint=o,this._move(n,o)}},Le.prototype.mouseupWindow=function(i){this._lastPoint&&k.mouseButton(i)===this._eventButton&&(this._moved&&k.suppressClick(),this.reset())},Le.prototype.enable=function(){this._enabled=!0},Le.prototype.disable=function(){this._enabled=!1,this.reset()},Le.prototype.isEnabled=function(){return this._enabled},Le.prototype.isActive=function(){return this._active};var mu=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.mousedown=function(n,s){i.prototype.mousedown.call(this,n,s),this._lastPoint&&(this._active=!0)},o.prototype._correctButton=function(n,s){return s===0&&!n.ctrlKey},o.prototype._move=function(n,s){return{around:s,panDelta:s.sub(n)}},o})(Le),ps=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype._correctButton=function(n,s){return s===0&&n.ctrlKey||s===2},o.prototype._move=function(n,s){var p=.8*(s.x-n.x);if(p)return this._active=!0,{bearingDelta:p}},o.prototype.contextmenu=function(n){n.preventDefault()},o})(Le),yu=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype._correctButton=function(n,s){return s===0&&n.ctrlKey||s===2},o.prototype._move=function(n,s){var p=-.5*(s.y-n.y);if(p)return this._active=!0,{pitchDelta:p}},o.prototype.contextmenu=function(n){n.preventDefault()},o})(Le),sn=function(i){this._minTouches=1,this._clickTolerance=i.clickTolerance||1,this.reset()};sn.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new u.Point(0,0)},sn.prototype.touchstart=function(i,o,n){return this._calculateTransform(i,o,n)},sn.prototype.touchmove=function(i,o,n){if(this._active&&!(n.length<this._minTouches))return i.preventDefault(),this._calculateTransform(i,o,n)},sn.prototype.touchend=function(i,o,n){this._calculateTransform(i,o,n),this._active&&n.length<this._minTouches&&this.reset()},sn.prototype.touchcancel=function(){this.reset()},sn.prototype._calculateTransform=function(i,o,n){n.length>0&&(this._active=!0);var s=cs(n,o),p=new u.Point(0,0),f=new u.Point(0,0),d=0;for(var v in s){var w=s[v],A=this._touches[v];A&&(p._add(w),f._add(w.sub(A)),d++,s[v]=w)}if(this._touches=s,!(d<this._minTouches)&&f.mag()){var D=f.div(d);if(this._sum._add(D),!(this._sum.mag()<this._clickTolerance))return{around:p.div(d),panDelta:D}}},sn.prototype.enable=function(){this._enabled=!0},sn.prototype.disable=function(){this._enabled=!1,this.reset()},sn.prototype.isEnabled=function(){return this._enabled},sn.prototype.isActive=function(){return this._active};var Gi=function(){this.reset()};function hs(i,o,n){for(var s=0;s<i.length;s++)if(i[s].identifier===n)return o[s]}function fs(i,o){return Math.log(i/o)/Math.LN2}Gi.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},Gi.prototype._start=function(i){},Gi.prototype._move=function(i,o,n){return{}},Gi.prototype.touchstart=function(i,o,n){this._firstTwoTouches||n.length<2||(this._firstTwoTouches=[n[0].identifier,n[1].identifier],this._start([o[0],o[1]]))},Gi.prototype.touchmove=function(i,o,n){if(this._firstTwoTouches){i.preventDefault();var s=this._firstTwoTouches,p=s[1],f=hs(n,o,s[0]),d=hs(n,o,p);if(f&&d){var v=this._aroundCenter?null:f.add(d).div(2);return this._move([f,d],v,i)}}},Gi.prototype.touchend=function(i,o,n){if(this._firstTwoTouches){var s=this._firstTwoTouches,p=s[1],f=hs(n,o,s[0]),d=hs(n,o,p);f&&d||(this._active&&k.suppressClick(),this.reset())}},Gi.prototype.touchcancel=function(){this.reset()},Gi.prototype.enable=function(i){this._enabled=!0,this._aroundCenter=!!i&&i.around==="center"},Gi.prototype.disable=function(){this._enabled=!1,this.reset()},Gi.prototype.isEnabled=function(){return this._enabled},Gi.prototype.isActive=function(){return this._active};var Zi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.reset=function(){i.prototype.reset.call(this),delete this._distance,delete this._startDistance},o.prototype._start=function(n){this._startDistance=this._distance=n[0].dist(n[1])},o.prototype._move=function(n,s){var p=this._distance;if(this._distance=n[0].dist(n[1]),this._active||!(Math.abs(fs(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:fs(this._distance,p),pinchAround:s}},o})(Gi);function Ln(i,o){return 180*i.angleWith(o)/Math.PI}var Bl=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.reset=function(){i.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},o.prototype._start=function(n){this._startVector=this._vector=n[0].sub(n[1]),this._minDiameter=n[0].dist(n[1])},o.prototype._move=function(n,s){var p=this._vector;if(this._vector=n[0].sub(n[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Ln(this._vector,p),pinchAround:s}},o.prototype._isBelowThreshold=function(n){this._minDiameter=Math.min(this._minDiameter,n.mag());var s=25/(Math.PI*this._minDiameter)*360,p=Ln(n,this._startVector);return Math.abs(p)<s},o})(Gi);function Ma(i){return Math.abs(i.y)>Math.abs(i.x)}var vu=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.reset=function(){i.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},o.prototype._start=function(n){this._lastPoints=n,Ma(n[0].sub(n[1]))&&(this._valid=!1)},o.prototype._move=function(n,s,p){var f=n[0].sub(this._lastPoints[0]),d=n[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(f,d,p.timeStamp),this._valid)return this._lastPoints=n,this._active=!0,{pitchDelta:(f.y+d.y)/2*-.5}},o.prototype.gestureBeginsVertically=function(n,s,p){if(this._valid!==void 0)return this._valid;var f=n.mag()>=2,d=s.mag()>=2;if(f||d){if(!f||!d)return this._firstMove===void 0&&(this._firstMove=p),p-this._firstMove<100&&void 0;var v=n.y>0==s.y>0;return Ma(n)&&Ma(s)&&v}},o})(Gi),gu={panStep:100,bearingStep:15,pitchStep:10},_n=function(){var i=gu;this._panStep=i.panStep,this._bearingStep=i.bearingStep,this._pitchStep=i.pitchStep,this._rotationDisabled=!1};function Qi(i){return i*(2-i)}_n.prototype.blur=function(){this.reset()},_n.prototype.reset=function(){this._active=!1},_n.prototype.keydown=function(i){var o=this;if(!(i.altKey||i.ctrlKey||i.metaKey)){var n=0,s=0,p=0,f=0,d=0;switch(i.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:i.shiftKey?s=-1:(i.preventDefault(),f=-1);break;case 39:i.shiftKey?s=1:(i.preventDefault(),f=1);break;case 38:i.shiftKey?p=1:(i.preventDefault(),d=-1);break;case 40:i.shiftKey?p=-1:(i.preventDefault(),d=1);break;default:return}return this._rotationDisabled&&(s=0,p=0),{cameraAnimation:function(v){var w=v.getZoom();v.easeTo({duration:300,easeId:"keyboardHandler",easing:Qi,zoom:n?Math.round(w)+n*(i.shiftKey?2:1):w,bearing:v.getBearing()+s*o._bearingStep,pitch:v.getPitch()+p*o._pitchStep,offset:[-f*o._panStep,-d*o._panStep],center:v.getCenter()},{originalEvent:i})}}}},_n.prototype.enable=function(){this._enabled=!0},_n.prototype.disable=function(){this._enabled=!1,this.reset()},_n.prototype.isEnabled=function(){return this._enabled},_n.prototype.isActive=function(){return this._active},_n.prototype.disableRotation=function(){this._rotationDisabled=!0},_n.prototype.enableRotation=function(){this._rotationDisabled=!1};var Ct=function(i,o){this._map=i,this._el=i.getCanvasContainer(),this._handler=o,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,u.bindAll(["_onTimeout"],this)};Ct.prototype.setZoomRate=function(i){this._defaultZoomRate=i},Ct.prototype.setWheelZoomRate=function(i){this._wheelZoomRate=i},Ct.prototype.isEnabled=function(){return!!this._enabled},Ct.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},Ct.prototype.isZooming=function(){return!!this._zooming},Ct.prototype.enable=function(i){this.isEnabled()||(this._enabled=!0,this._aroundCenter=i&&i.around==="center")},Ct.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Ct.prototype.wheel=function(i){if(this.isEnabled()){var o=i.deltaMode===u.window.WheelEvent.DOM_DELTA_LINE?40*i.deltaY:i.deltaY,n=u.browser.now(),s=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,o!==0&&o%4.000244140625==0?this._type="wheel":o!==0&&Math.abs(o)<4?this._type="trackpad":s>400?(this._type=null,this._lastValue=o,this._timeout=setTimeout(this._onTimeout,40,i)):this._type||(this._type=Math.abs(s*o)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,o+=this._lastValue)),i.shiftKey&&o&&(o/=4),this._type&&(this._lastWheelEvent=i,this._delta-=o,this._active||this._start(i)),i.preventDefault()}},Ct.prototype._onTimeout=function(i){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(i)},Ct.prototype._start=function(i){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var o=k.mousePos(this._el,i);this._around=u.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(o)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},Ct.prototype.renderFrame=function(){var i=this;if(this._frameId&&(this._frameId=null,this.isActive())){var o=this._map.transform;if(this._delta!==0){var n=this._type==="wheel"&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,s=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&s!==0&&(s=1/s);var p=typeof this._targetZoom=="number"?o.zoomScale(this._targetZoom):o.scale;this._targetZoom=Math.min(o.maxZoom,Math.max(o.minZoom,o.scaleZoom(p*s))),this._type==="wheel"&&(this._startZoom=o.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var f,d=typeof this._targetZoom=="number"?this._targetZoom:o.zoom,v=this._startZoom,w=this._easing,A=!1;if(this._type==="wheel"&&v&&w){var D=Math.min((u.browser.now()-this._lastWheelEventTime)/200,1),F=w(D);f=u.number(v,d,F),D<1?this._frameId||(this._frameId=!0):A=!0}else f=d,A=!0;return this._active=!0,A&&(this._active=!1,this._finishTimeout=setTimeout((function(){i._zooming=!1,i._handler._triggerRenderFrame(),delete i._targetZoom,delete i._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!A,zoomDelta:f-o.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},Ct.prototype._smoothOutEasing=function(i){var o=u.ease;if(this._prevEase){var n=this._prevEase,s=(u.browser.now()-n.start)/n.duration,p=n.easing(s+.01)-n.easing(s),f=.27/Math.sqrt(p*p+1e-4)*.01,d=Math.sqrt(.0729-f*f);o=u.bezier(f,d,.25,1)}return this._prevEase={start:u.browser.now(),duration:i,easing:o},o},Ct.prototype.blur=function(){this.reset()},Ct.prototype.reset=function(){this._active=!1};var Tn=function(i,o){this._clickZoom=i,this._tapZoom=o};Tn.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Tn.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Tn.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Tn.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var un=function(){this.reset()};un.prototype.reset=function(){this._active=!1},un.prototype.blur=function(){this.reset()},un.prototype.dblclick=function(i,o){return i.preventDefault(),{cameraAnimation:function(n){n.easeTo({duration:300,zoom:n.getZoom()+(i.shiftKey?-1:1),around:n.unproject(o)},{originalEvent:i})}}},un.prototype.enable=function(){this._enabled=!0},un.prototype.disable=function(){this._enabled=!1,this.reset()},un.prototype.isEnabled=function(){return this._enabled},un.prototype.isActive=function(){return this._active};var yi=function(){this._tap=new gn({numTouches:1,numTaps:1}),this.reset()};yi.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},yi.prototype.touchstart=function(i,o,n){this._swipePoint||(this._tapTime&&i.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?n.length>0&&(this._swipePoint=o[0],this._swipeTouch=n[0].identifier):this._tap.touchstart(i,o,n))},yi.prototype.touchmove=function(i,o,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;var s=o[0],p=s.y-this._swipePoint.y;return this._swipePoint=s,i.preventDefault(),this._active=!0,{zoomDelta:p/128}}}else this._tap.touchmove(i,o,n)},yi.prototype.touchend=function(i,o,n){this._tapTime?this._swipePoint&&n.length===0&&this.reset():this._tap.touchend(i,o,n)&&(this._tapTime=i.timeStamp)},yi.prototype.touchcancel=function(){this.reset()},yi.prototype.enable=function(){this._enabled=!0},yi.prototype.disable=function(){this._enabled=!1,this.reset()},yi.prototype.isEnabled=function(){return this._enabled},yi.prototype.isActive=function(){return this._active};var Mo=function(i,o,n){this._el=i,this._mousePan=o,this._touchPan=n};Mo.prototype.enable=function(i){this._inertiaOptions=i||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},Mo.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},Mo.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},Mo.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var eo=function(i,o,n){this._pitchWithRotate=i.pitchWithRotate,this._mouseRotate=o,this._mousePitch=n};eo.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},eo.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},eo.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},eo.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var xn=function(i,o,n,s){this._el=i,this._touchZoom=o,this._touchRotate=n,this._tapDragZoom=s,this._rotationDisabled=!1,this._enabled=!0};xn.prototype.enable=function(i){this._touchZoom.enable(i),this._rotationDisabled||this._touchRotate.enable(i),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},xn.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},xn.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},xn.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},xn.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},xn.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Ti=function(i){return i.zoom||i.drag||i.pitch||i.rotate},Ba=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o})(u.Event);function it(i){return i.panDelta&&i.panDelta.mag()||i.zoomDelta||i.bearingDelta||i.pitchDelta}var Ye=function(i,o){this._map=i,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Pa(i),this._bearingSnap=o.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(o),u.bindAll(["handleEvent","handleWindowEvent"],this);var n=this._el;this._listeners=[[n,"touchstart",{passive:!0}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[u.window.document,"mousemove",{capture:!0}],[u.window.document,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[u.window,"blur",void 0]];for(var s=0,p=this._listeners;s<p.length;s+=1){var f=p[s],d=f[0];k.addEventListener(d,f[1],d===u.window.document?this.handleWindowEvent:this.handleEvent,f[2])}};Ye.prototype.destroy=function(){for(var i=0,o=this._listeners;i<o.length;i+=1){var n=o[i],s=n[0];k.removeEventListener(s,n[1],s===u.window.document?this.handleWindowEvent:this.handleEvent,n[2])}},Ye.prototype._addDefaultHandlers=function(i){var o=this._map,n=o.getCanvasContainer();this._add("mapEvent",new qr(o,i));var s=o.boxZoom=new Ni(o,i);this._add("boxZoom",s);var p=new ji,f=new un;o.doubleClickZoom=new Tn(f,p),this._add("tapZoom",p),this._add("clickZoom",f);var d=new yi;this._add("tapDragZoom",d);var v=o.touchPitch=new vu;this._add("touchPitch",v);var w=new ps(i),A=new yu(i);o.dragRotate=new eo(i,w,A),this._add("mouseRotate",w,["mousePitch"]),this._add("mousePitch",A,["mouseRotate"]);var D=new mu(i),F=new sn(i);o.dragPan=new Mo(n,D,F),this._add("mousePan",D),this._add("touchPan",F,["touchZoom","touchRotate"]);var O=new Bl,W=new Zi;o.touchZoomRotate=new xn(n,W,O,d),this._add("touchRotate",O,["touchPan","touchZoom"]),this._add("touchZoom",W,["touchPan","touchRotate"]);var $=o.scrollZoom=new Ct(o,this);this._add("scrollZoom",$,["mousePan"]);var ee=o.keyboard=new _n;this._add("keyboard",ee),this._add("blockableMapEvent",new Xe(o));for(var N=0,Q=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];N<Q.length;N+=1){var ne=Q[N];i.interactive&&i[ne]&&o[ne].enable(i[ne])}},Ye.prototype._add=function(i,o,n){this._handlers.push({handlerName:i,handler:o,allowed:n}),this._handlersById[i]=o},Ye.prototype.stop=function(i){if(!this._updatingCamera){for(var o=0,n=this._handlers;o<n.length;o+=1)n[o].handler.reset();this._inertia.clear(),this._fireEvents({},{},i),this._changes=[]}},Ye.prototype.isActive=function(){for(var i=0,o=this._handlers;i<o.length;i+=1)if(o[i].handler.isActive())return!0;return!1},Ye.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},Ye.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},Ye.prototype.isMoving=function(){return!!Ti(this._eventsInProgress)||this.isZooming()},Ye.prototype._blockedByActive=function(i,o,n){for(var s in i)if(s!==n&&(!o||o.indexOf(s)<0))return!0;return!1},Ye.prototype.handleWindowEvent=function(i){this.handleEvent(i,i.type+"Window")},Ye.prototype._getMapTouches=function(i){for(var o=[],n=0,s=i;n<s.length;n+=1){var p=s[n];this._el.contains(p.target)&&o.push(p)}return o},Ye.prototype.handleEvent=function(i,o){this._updatingCamera=!0;for(var n=i.type==="renderFrame"?void 0:i,s={needsRenderFrame:!1},p={},f={},d=i.touches?this._getMapTouches(i.touches):void 0,v=d?k.touchPos(this._el,d):k.mousePos(this._el,i),w=0,A=this._handlers;w<A.length;w+=1){var D=A[w],F=D.handlerName,O=D.handler,W=D.allowed;if(O.isEnabled()){var $=void 0;this._blockedByActive(f,W,F)?O.reset():O[o||i.type]&&($=O[o||i.type](i,v,d),this.mergeHandlerResult(s,p,$,F,n),$&&$.needsRenderFrame&&this._triggerRenderFrame()),($||O.isActive())&&(f[F]=O)}}var ee={};for(var N in this._previousActiveHandlers)f[N]||(ee[N]=n);this._previousActiveHandlers=f,(Object.keys(ee).length||it(s))&&(this._changes.push([s,p,ee]),this._triggerRenderFrame()),(Object.keys(f).length||it(s))&&this._map._stop(!0),this._updatingCamera=!1;var Q=s.cameraAnimation;Q&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],Q(this._map))},Ye.prototype.mergeHandlerResult=function(i,o,n,s,p){if(n){u.extend(i,n);var f={handlerName:s,originalEvent:n.originalEvent||p};n.zoomDelta!==void 0&&(o.zoom=f),n.panDelta!==void 0&&(o.drag=f),n.pitchDelta!==void 0&&(o.pitch=f),n.bearingDelta!==void 0&&(o.rotate=f)}},Ye.prototype._applyChanges=function(){for(var i={},o={},n={},s=0,p=this._changes;s<p.length;s+=1){var f=p[s],d=f[0],v=f[1],w=f[2];d.panDelta&&(i.panDelta=(i.panDelta||new u.Point(0,0))._add(d.panDelta)),d.zoomDelta&&(i.zoomDelta=(i.zoomDelta||0)+d.zoomDelta),d.bearingDelta&&(i.bearingDelta=(i.bearingDelta||0)+d.bearingDelta),d.pitchDelta&&(i.pitchDelta=(i.pitchDelta||0)+d.pitchDelta),d.around!==void 0&&(i.around=d.around),d.pinchAround!==void 0&&(i.pinchAround=d.pinchAround),d.noInertia&&(i.noInertia=d.noInertia),u.extend(o,v),u.extend(n,w)}this._updateMapTransform(i,o,n),this._changes=[]},Ye.prototype._updateMapTransform=function(i,o,n){var s=this._map,p=s.transform;if(!it(i))return this._fireEvents(o,n,!0);var f=i.panDelta,d=i.zoomDelta,v=i.bearingDelta,w=i.pitchDelta,A=i.around,D=i.pinchAround;D!==void 0&&(A=D),s._stop(!0),A=A||s.transform.centerPoint;var F=p.pointLocation(f?A.sub(f):A);v&&(p.bearing+=v),w&&(p.pitch+=w),d&&(p.zoom+=d),p.setLocationAtPoint(F,A),this._map._update(),i.noInertia||this._inertia.record(i),this._fireEvents(o,n,!0)},Ye.prototype._fireEvents=function(i,o,n){var s=this,p=Ti(this._eventsInProgress),f=Ti(i),d={};for(var v in i)this._eventsInProgress[v]||(d[v+"start"]=i[v].originalEvent),this._eventsInProgress[v]=i[v];for(var w in!p&&f&&this._fireEvent("movestart",f.originalEvent),d)this._fireEvent(w,d[w]);for(var A in f&&this._fireEvent("move",f.originalEvent),i)this._fireEvent(A,i[A].originalEvent);var D,F={};for(var O in this._eventsInProgress){var W=this._eventsInProgress[O],$=W.handlerName,ee=W.originalEvent;this._handlersById[$].isActive()||(delete this._eventsInProgress[O],F[O+"end"]=D=o[$]||ee)}for(var N in F)this._fireEvent(N,F[N]);var Q=Ti(this._eventsInProgress);if(n&&(p||f)&&!Q){this._updatingCamera=!0;var ne=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),ue=function(de){return de!==0&&-s._bearingSnap<de&&de<s._bearingSnap};ne?(ue(ne.bearing||this._map.getBearing())&&(ne.bearing=0),this._map.easeTo(ne,{originalEvent:D})):(this._map.fire(new u.Event("moveend",{originalEvent:D})),ue(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},Ye.prototype._fireEvent=function(i,o){this._map.fire(new u.Event(i,o?{originalEvent:o}:{}))},Ye.prototype._requestFrame=function(){var i=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add((function(o){delete i._frameId,i.handleEvent(new Ba("renderFrame",{timeStamp:o})),i._applyChanges()}))},Ye.prototype._triggerRenderFrame=function(){this._frameId===void 0&&(this._frameId=this._requestFrame())};var ds=(function(i){function o(n,s){i.call(this),this._moving=!1,this._zooming=!1,this.transform=n,this._bearingSnap=s.bearingSnap,u.bindAll(["_renderFrameCallback"],this)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getCenter=function(){return new u.LngLat(this.transform.center.lng,this.transform.center.lat)},o.prototype.setCenter=function(n,s){return this.jumpTo({center:n},s)},o.prototype.panBy=function(n,s,p){return n=u.Point.convert(n).mult(-1),this.panTo(this.transform.center,u.extend({offset:n},s),p)},o.prototype.panTo=function(n,s,p){return this.easeTo(u.extend({center:n},s),p)},o.prototype.getZoom=function(){return this.transform.zoom},o.prototype.setZoom=function(n,s){return this.jumpTo({zoom:n},s),this},o.prototype.zoomTo=function(n,s,p){return this.easeTo(u.extend({zoom:n},s),p)},o.prototype.zoomIn=function(n,s){return this.zoomTo(this.getZoom()+1,n,s),this},o.prototype.zoomOut=function(n,s){return this.zoomTo(this.getZoom()-1,n,s),this},o.prototype.getBearing=function(){return this.transform.bearing},o.prototype.setBearing=function(n,s){return this.jumpTo({bearing:n},s),this},o.prototype.getPadding=function(){return this.transform.padding},o.prototype.setPadding=function(n,s){return this.jumpTo({padding:n},s),this},o.prototype.rotateTo=function(n,s,p){return this.easeTo(u.extend({bearing:n},s),p)},o.prototype.resetNorth=function(n,s){return this.rotateTo(0,u.extend({duration:1e3},n),s),this},o.prototype.resetNorthPitch=function(n,s){return this.easeTo(u.extend({bearing:0,pitch:0,duration:1e3},n),s),this},o.prototype.snapToNorth=function(n,s){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(n,s):this},o.prototype.getPitch=function(){return this.transform.pitch},o.prototype.setPitch=function(n,s){return this.jumpTo({pitch:n},s),this},o.prototype.cameraForBounds=function(n,s){n=u.LngLatBounds.convert(n);var p=s&&s.bearing||0;return this._cameraForBoxAndBearing(n.getNorthWest(),n.getSouthEast(),p,s)},o.prototype._cameraForBoxAndBearing=function(n,s,p,f){var d={top:0,bottom:0,right:0,left:0};if(typeof(f=u.extend({padding:d,offset:[0,0],maxZoom:this.transform.maxZoom},f)).padding=="number"){var v=f.padding;f.padding={top:v,bottom:v,right:v,left:v}}f.padding=u.extend(d,f.padding);var w=this.transform,A=w.padding,D=w.project(u.LngLat.convert(n)),F=w.project(u.LngLat.convert(s)),O=D.rotate(-p*Math.PI/180),W=F.rotate(-p*Math.PI/180),$=new u.Point(Math.max(O.x,W.x),Math.max(O.y,W.y)),ee=new u.Point(Math.min(O.x,W.x),Math.min(O.y,W.y)),N=$.sub(ee),Q=(w.width-(A.left+A.right+f.padding.left+f.padding.right))/N.x,ne=(w.height-(A.top+A.bottom+f.padding.top+f.padding.bottom))/N.y;if(!(ne<0||Q<0)){var ue=Math.min(w.scaleZoom(w.scale*Math.min(Q,ne)),f.maxZoom),de=typeof f.offset.x=="number"?new u.Point(f.offset.x,f.offset.y):u.Point.convert(f.offset),pe=new u.Point((f.padding.left-f.padding.right)/2,(f.padding.top-f.padding.bottom)/2).rotate(p*Math.PI/180),ye=de.add(pe).mult(w.scale/w.zoomScale(ue));return{center:w.unproject(D.add(F).div(2).sub(ye)),zoom:ue,bearing:p}}u.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},o.prototype.fitBounds=function(n,s,p){return this._fitInternal(this.cameraForBounds(n,s),s,p)},o.prototype.fitScreenCoordinates=function(n,s,p,f,d){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(u.Point.convert(n)),this.transform.pointLocation(u.Point.convert(s)),p,f),f,d)},o.prototype._fitInternal=function(n,s,p){return n?(delete(s=u.extend(n,s)).padding,s.linear?this.easeTo(s,p):this.flyTo(s,p)):this},o.prototype.jumpTo=function(n,s){this.stop();var p=this.transform,f=!1,d=!1,v=!1;return"zoom"in n&&p.zoom!==+n.zoom&&(f=!0,p.zoom=+n.zoom),n.center!==void 0&&(p.center=u.LngLat.convert(n.center)),"bearing"in n&&p.bearing!==+n.bearing&&(d=!0,p.bearing=+n.bearing),"pitch"in n&&p.pitch!==+n.pitch&&(v=!0,p.pitch=+n.pitch),n.padding==null||p.isPaddingEqual(n.padding)||(p.padding=n.padding),this.fire(new u.Event("movestart",s)).fire(new u.Event("move",s)),f&&this.fire(new u.Event("zoomstart",s)).fire(new u.Event("zoom",s)).fire(new u.Event("zoomend",s)),d&&this.fire(new u.Event("rotatestart",s)).fire(new u.Event("rotate",s)).fire(new u.Event("rotateend",s)),v&&this.fire(new u.Event("pitchstart",s)).fire(new u.Event("pitch",s)).fire(new u.Event("pitchend",s)),this.fire(new u.Event("moveend",s))},o.prototype.easeTo=function(n,s){var p=this;this._stop(!1,n.easeId),((n=u.extend({offset:[0,0],duration:500,easing:u.ease},n)).animate===!1||!n.essential&&u.browser.prefersReducedMotion)&&(n.duration=0);var f=this.transform,d=this.getZoom(),v=this.getBearing(),w=this.getPitch(),A=this.getPadding(),D="zoom"in n?+n.zoom:d,F="bearing"in n?this._normalizeBearing(n.bearing,v):v,O="pitch"in n?+n.pitch:w,W="padding"in n?n.padding:f.padding,$=u.Point.convert(n.offset),ee=f.centerPoint.add($),N=f.pointLocation(ee),Q=u.LngLat.convert(n.center||N);this._normalizeCenter(Q);var ne,ue,de=f.project(N),pe=f.project(Q).sub(de),ye=f.zoomScale(D-d);n.around&&(ne=u.LngLat.convert(n.around),ue=f.locationPoint(ne));var Ie={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||D!==d,this._rotating=this._rotating||v!==F,this._pitching=this._pitching||O!==w,this._padding=!f.isPaddingEqual(W),this._easeId=n.easeId,this._prepareEase(s,n.noMoveStart,Ie),this._ease((function(Me){if(p._zooming&&(f.zoom=u.number(d,D,Me)),p._rotating&&(f.bearing=u.number(v,F,Me)),p._pitching&&(f.pitch=u.number(w,O,Me)),p._padding&&(f.interpolatePadding(A,W,Me),ee=f.centerPoint.add($)),ne)f.setLocationAtPoint(ne,ue);else{var Ce=f.zoomScale(f.zoom-d),$e=D>d?Math.min(2,ye):Math.max(.5,ye),nt=Math.pow($e,1-Me),ut=f.unproject(de.add(pe.mult(Me*nt)).mult(Ce));f.setLocationAtPoint(f.renderWorldCopies?ut.wrap():ut,ee)}p._fireMoveEvents(s)}),(function(Me){p._afterEase(s,Me)}),n),this},o.prototype._prepareEase=function(n,s,p){p===void 0&&(p={}),this._moving=!0,s||p.moving||this.fire(new u.Event("movestart",n)),this._zooming&&!p.zooming&&this.fire(new u.Event("zoomstart",n)),this._rotating&&!p.rotating&&this.fire(new u.Event("rotatestart",n)),this._pitching&&!p.pitching&&this.fire(new u.Event("pitchstart",n))},o.prototype._fireMoveEvents=function(n){this.fire(new u.Event("move",n)),this._zooming&&this.fire(new u.Event("zoom",n)),this._rotating&&this.fire(new u.Event("rotate",n)),this._pitching&&this.fire(new u.Event("pitch",n))},o.prototype._afterEase=function(n,s){if(!this._easeId||!s||this._easeId!==s){delete this._easeId;var p=this._zooming,f=this._rotating,d=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,p&&this.fire(new u.Event("zoomend",n)),f&&this.fire(new u.Event("rotateend",n)),d&&this.fire(new u.Event("pitchend",n)),this.fire(new u.Event("moveend",n))}},o.prototype.flyTo=function(n,s){var p=this;if(!n.essential&&u.browser.prefersReducedMotion){var f=u.pick(n,["center","zoom","bearing","pitch","around"]);return this.jumpTo(f,s)}this.stop(),n=u.extend({offset:[0,0],speed:1.2,curve:1.42,easing:u.ease},n);var d=this.transform,v=this.getZoom(),w=this.getBearing(),A=this.getPitch(),D=this.getPadding(),F="zoom"in n?u.clamp(+n.zoom,d.minZoom,d.maxZoom):v,O="bearing"in n?this._normalizeBearing(n.bearing,w):w,W="pitch"in n?+n.pitch:A,$="padding"in n?n.padding:d.padding,ee=d.zoomScale(F-v),N=u.Point.convert(n.offset),Q=d.centerPoint.add(N),ne=d.pointLocation(Q),ue=u.LngLat.convert(n.center||ne);this._normalizeCenter(ue);var de=d.project(ne),pe=d.project(ue).sub(de),ye=n.curve,Ie=Math.max(d.width,d.height),Me=Ie/ee,Ce=pe.mag();if("minZoom"in n){var $e=u.clamp(Math.min(n.minZoom,v,F),d.minZoom,d.maxZoom),nt=Ie/d.zoomScale($e-v);ye=Math.sqrt(nt/Ce*2)}var ut=ye*ye;function st(ht){var ct=(Me*Me-Ie*Ie+(ht?-1:1)*ut*ut*Ce*Ce)/(2*(ht?Me:Ie)*ut*Ce);return Math.log(Math.sqrt(ct*ct+1)-ct)}function Lt(ht){return(Math.exp(ht)-Math.exp(-ht))/2}function He(ht){return(Math.exp(ht)+Math.exp(-ht))/2}var mt=st(0),xt=function(ht){return He(mt)/He(mt+ye*ht)},dt=function(ht){return Ie*((He(mt)*(Lt(ct=mt+ye*ht)/He(ct))-Lt(mt))/ut)/Ce;var ct},ft=(st(1)-mt)/ye;if(Math.abs(Ce)<1e-6||!isFinite(ft)){if(Math.abs(Ie-Me)<1e-6)return this.easeTo(n,s);var gt=Me<Ie?-1:1;ft=Math.abs(Math.log(Me/Ie))/ye,dt=function(){return 0},xt=function(ht){return Math.exp(gt*ye*ht)}}return n.duration="duration"in n?+n.duration:1e3*ft/("screenSpeed"in n?+n.screenSpeed/ye:+n.speed),n.maxDuration&&n.duration>n.maxDuration&&(n.duration=0),this._zooming=!0,this._rotating=w!==O,this._pitching=W!==A,this._padding=!d.isPaddingEqual($),this._prepareEase(s,!1),this._ease((function(ht){var ct=ht*ft,Jr=1/xt(ct);d.zoom=ht===1?F:v+d.scaleZoom(Jr),p._rotating&&(d.bearing=u.number(w,O,ht)),p._pitching&&(d.pitch=u.number(A,W,ht)),p._padding&&(d.interpolatePadding(D,$,ht),Q=d.centerPoint.add(N));var Ir=ht===1?ue:d.unproject(de.add(pe.mult(dt(ct))).mult(Jr));d.setLocationAtPoint(d.renderWorldCopies?Ir.wrap():Ir,Q),p._fireMoveEvents(s)}),(function(){return p._afterEase(s)}),n),this},o.prototype.isEasing=function(){return!!this._easeFrameId},o.prototype.stop=function(){return this._stop()},o.prototype._stop=function(n,s){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var p=this._onEaseEnd;delete this._onEaseEnd,p.call(this,s)}if(!n){var f=this.handlers;f&&f.stop(!1)}return this},o.prototype._ease=function(n,s,p){p.animate===!1||p.duration===0?(n(1),s()):(this._easeStart=u.browser.now(),this._easeOptions=p,this._onEaseFrame=n,this._onEaseEnd=s,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},o.prototype._renderFrameCallback=function(){var n=Math.min((u.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(n)),n<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},o.prototype._normalizeBearing=function(n,s){n=u.wrap(n,-180,180);var p=Math.abs(n-s);return Math.abs(n-360-s)<p&&(n-=360),Math.abs(n+360-s)<p&&(n+=360),n},o.prototype._normalizeCenter=function(n){var s=this.transform;if(s.renderWorldCopies&&!s.lngRange){var p=n.lng-s.center.lng;n.lng+=p>180?-360:p<-180?360:0}},o})(u.Evented),Ai=function(i){i===void 0&&(i={}),this.options=i,u.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Ai.prototype.getDefaultPosition=function(){return"bottom-right"},Ai.prototype.onAdd=function(i){var o=this.options&&this.options.compact;return this._map=i,this._container=k.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=k.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=k.create("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},Ai.prototype.onRemove=function(){k.remove(this._container),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},Ai.prototype._setElementTitle=function(i,o){var n=this._map._getUIString("AttributionControl."+o);i.title=n,i.setAttribute("aria-label",n)},Ai.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},Ai.prototype._updateEditLink=function(){var i=this._editLink;i||(i=this._editLink=this._container.querySelector(".mapbox-improve-map"));var o=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||u.config.ACCESS_TOKEN}];if(i){var n=o.reduce((function(s,p,f){return p.value&&(s+=p.key+"="+p.value+(f<o.length-1?"&":"")),s}),"?");i.href=u.config.FEEDBACK_URL+"/"+n+(this._map._hash?this._map._hash.getHashString(!0):""),i.rel="noopener nofollow",this._setElementTitle(i,"MapFeedback")}},Ai.prototype._updateData=function(i){!i||i.sourceDataType!=="metadata"&&i.sourceDataType!=="visibility"&&i.dataType!=="style"||(this._updateAttributions(),this._updateEditLink())},Ai.prototype._updateAttributions=function(){if(this._map.style){var i=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?i=i.concat(this.options.customAttribution.map((function(v){return typeof v!="string"?"":v}))):typeof this.options.customAttribution=="string"&&i.push(this.options.customAttribution)),this._map.style.stylesheet){var o=this._map.style.stylesheet;this.styleOwner=o.owner,this.styleId=o.id}var n=this._map.style.sourceCaches;for(var s in n){var p=n[s];if(p.used){var f=p.getSource();f.attribution&&i.indexOf(f.attribution)<0&&i.push(f.attribution)}}i.sort((function(v,w){return v.length-w.length}));var d=(i=i.filter((function(v,w){for(var A=w+1;A<i.length;A++)if(i[A].indexOf(v)>=0)return!1;return!0}))).join(" | ");d!==this._attribHTML&&(this._attribHTML=d,i.length?(this._innerContainer.innerHTML=d,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Ai.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var bn=function(){u.bindAll(["_updateLogo"],this),u.bindAll(["_updateCompact"],this)};bn.prototype.onAdd=function(i){this._map=i,this._container=k.create("div","mapboxgl-ctrl");var o=k.create("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},bn.prototype.onRemove=function(){k.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},bn.prototype.getDefaultPosition=function(){return"bottom-left"},bn.prototype._updateLogo=function(i){i&&i.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")},bn.prototype._logoRequired=function(){if(this._map.style){var i=this._map.style.sourceCaches;for(var o in i)if(i[o].getSource().mapbox_logo)return!0;return!1}},bn.prototype._updateCompact=function(){var i=this._container.children;if(i.length){var o=i[0];this._map.getCanvasContainer().offsetWidth<250?o.classList.add("mapboxgl-compact"):o.classList.remove("mapboxgl-compact")}};var vi=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};vi.prototype.add=function(i){var o=++this._id;return this._queue.push({callback:i,id:o,cancelled:!1}),o},vi.prototype.remove=function(i){for(var o=this._currentlyRunning,n=0,s=o?this._queue.concat(o):this._queue;n<s.length;n+=1){var p=s[n];if(p.id===i)return void(p.cancelled=!0)}},vi.prototype.run=function(i){i===void 0&&(i=0);var o=this._currentlyRunning=this._queue;this._queue=[];for(var n=0,s=o;n<s.length;n+=1){var p=s[n];if(!p.cancelled&&(p.callback(i),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},vi.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var An={"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","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},_u=u.window.HTMLImageElement,ms=u.window.HTMLElement,Xt=u.window.ImageBitmap,ai={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},zl=(function(i){function o(s){var p=this;if((s=u.extend({},ai,s)).minZoom!=null&&s.maxZoom!=null&&s.minZoom>s.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(s.minPitch!=null&&s.maxPitch!=null&&s.minPitch>s.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(s.minPitch!=null&&s.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(s.maxPitch!=null&&s.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var f=new zt(s.minZoom,s.maxZoom,s.minPitch,s.maxPitch,s.renderWorldCopies);if(i.call(this,f,s),this._interactive=s.interactive,this._maxTileCacheSize=s.maxTileCacheSize,this._failIfMajorPerformanceCaveat=s.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=s.preserveDrawingBuffer,this._antialias=s.antialias,this._trackResize=s.trackResize,this._bearingSnap=s.bearingSnap,this._refreshExpiredTiles=s.refreshExpiredTiles,this._fadeDuration=s.fadeDuration,this._crossSourceCollisions=s.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=s.collectResourceTiming,this._renderTaskQueue=new vi,this._controls=[],this._mapId=u.uniqueId(),this._locale=u.extend({},An,s.locale),this._clickTolerance=s.clickTolerance,this._requestManager=new u.RequestManager(s.transformRequest,s.accessToken),typeof s.container=="string"){if(this._container=u.window.document.getElementById(s.container),!this._container)throw new Error("Container '"+s.container+"' not found.")}else{if(!(s.container instanceof ms))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=s.container}if(s.maxBounds&&this.setMaxBounds(s.maxBounds),u.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return p._update(!1)})),this.on("moveend",(function(){return p._update(!1)})),this.on("zoom",(function(){return p._update(!0)})),u.window!==void 0&&(u.window.addEventListener("online",this._onWindowOnline,!1),u.window.addEventListener("resize",this._onWindowResize,!1),u.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Ye(this,s),this._hash=s.hash&&new Yi(typeof s.hash=="string"&&s.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:s.center,zoom:s.zoom,bearing:s.bearing,pitch:s.pitch}),s.bounds&&(this.resize(),this.fitBounds(s.bounds,u.extend({},s.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=s.localIdeographFontFamily,s.style&&this.setStyle(s.style,{localIdeographFontFamily:s.localIdeographFontFamily}),s.attributionControl&&this.addControl(new Ai({customAttribution:s.customAttribution})),this.addControl(new bn,s.logoPosition),this.on("style.load",(function(){p.transform.unmodified&&p.jumpTo(p.style.stylesheet)})),this.on("data",(function(d){p._update(d.dataType==="style"),p.fire(new u.Event(d.dataType+"data",d))})),this.on("dataloading",(function(d){p.fire(new u.Event(d.dataType+"dataloading",d))}))}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return o.prototype._getMapId=function(){return this._mapId},o.prototype.addControl=function(s,p){if(p===void 0&&(p=s.getDefaultPosition?s.getDefaultPosition():"top-right"),!s||!s.onAdd)return this.fire(new u.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var f=s.onAdd(this);this._controls.push(s);var d=this._controlPositions[p];return p.indexOf("bottom")!==-1?d.insertBefore(f,d.firstChild):d.appendChild(f),this},o.prototype.removeControl=function(s){if(!s||!s.onRemove)return this.fire(new u.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var p=this._controls.indexOf(s);return p>-1&&this._controls.splice(p,1),s.onRemove(this),this},o.prototype.hasControl=function(s){return this._controls.indexOf(s)>-1},o.prototype.resize=function(s){var p=this._containerDimensions(),f=p[0],d=p[1];if(f===this.transform.width&&d===this.transform.height)return this;this._resizeCanvas(f,d),this.transform.resize(f,d),this.painter.resize(f,d);var v=!this._moving;return v&&this.fire(new u.Event("movestart",s)).fire(new u.Event("move",s)),this.fire(new u.Event("resize",s)),v&&this.fire(new u.Event("moveend",s)),this},o.prototype.getBounds=function(){return this.transform.getBounds()},o.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},o.prototype.setMaxBounds=function(s){return this.transform.setMaxBounds(u.LngLatBounds.convert(s)),this._update()},o.prototype.setMinZoom=function(s){if((s=s??-2)>=-2&&s<=this.transform.maxZoom)return this.transform.minZoom=s,this._update(),this.getZoom()<s&&this.setZoom(s),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},o.prototype.getMinZoom=function(){return this.transform.minZoom},o.prototype.setMaxZoom=function(s){if((s=s??22)>=this.transform.minZoom)return this.transform.maxZoom=s,this._update(),this.getZoom()>s&&this.setZoom(s),this;throw new Error("maxZoom must be greater than the current minZoom")},o.prototype.getMaxZoom=function(){return this.transform.maxZoom},o.prototype.setMinPitch=function(s){if((s=s??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(s>=0&&s<=this.transform.maxPitch)return this.transform.minPitch=s,this._update(),this.getPitch()<s&&this.setPitch(s),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},o.prototype.getMinPitch=function(){return this.transform.minPitch},o.prototype.setMaxPitch=function(s){if((s=s??60)>60)throw new Error("maxPitch must be less than or equal to 60");if(s>=this.transform.minPitch)return this.transform.maxPitch=s,this._update(),this.getPitch()>s&&this.setPitch(s),this;throw new Error("maxPitch must be greater than the current minPitch")},o.prototype.getMaxPitch=function(){return this.transform.maxPitch},o.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},o.prototype.setRenderWorldCopies=function(s){return this.transform.renderWorldCopies=s,this._update()},o.prototype.project=function(s){return this.transform.locationPoint(u.LngLat.convert(s))},o.prototype.unproject=function(s){return this.transform.pointLocation(u.Point.convert(s))},o.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},o.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},o.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},o.prototype._createDelegatedListener=function(s,p,f){var d,v=this;if(s==="mouseenter"||s==="mouseover"){var w=!1;return{layer:p,listener:f,delegates:{mousemove:function(D){var F=v.getLayer(p)?v.queryRenderedFeatures(D.point,{layers:[p]}):[];F.length?w||(w=!0,f.call(v,new Gr(s,v,D.originalEvent,{features:F}))):w=!1},mouseout:function(){w=!1}}}}if(s==="mouseleave"||s==="mouseout"){var A=!1;return{layer:p,listener:f,delegates:{mousemove:function(D){(v.getLayer(p)?v.queryRenderedFeatures(D.point,{layers:[p]}):[]).length?A=!0:A&&(A=!1,f.call(v,new Gr(s,v,D.originalEvent)))},mouseout:function(D){A&&(A=!1,f.call(v,new Gr(s,v,D.originalEvent)))}}}}return{layer:p,listener:f,delegates:(d={},d[s]=function(D){var F=v.getLayer(p)?v.queryRenderedFeatures(D.point,{layers:[p]}):[];F.length&&(D.features=F,f.call(v,D),delete D.features)},d)}},o.prototype.on=function(s,p,f){if(f===void 0)return i.prototype.on.call(this,s,p);var d=this._createDelegatedListener(s,p,f);for(var v in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[s]=this._delegatedListeners[s]||[],this._delegatedListeners[s].push(d),d.delegates)this.on(v,d.delegates[v]);return this},o.prototype.once=function(s,p,f){if(f===void 0)return i.prototype.once.call(this,s,p);var d=this._createDelegatedListener(s,p,f);for(var v in d.delegates)this.once(v,d.delegates[v]);return this},o.prototype.off=function(s,p,f){var d=this;return f===void 0?i.prototype.off.call(this,s,p):(this._delegatedListeners&&this._delegatedListeners[s]&&(function(v){for(var w=v[s],A=0;A<w.length;A++){var D=w[A];if(D.layer===p&&D.listener===f){for(var F in D.delegates)d.off(F,D.delegates[F]);return w.splice(A,1),d}}})(this._delegatedListeners),this)},o.prototype.queryRenderedFeatures=function(s,p){if(!this.style)return[];var f;if(p!==void 0||s===void 0||s instanceof u.Point||Array.isArray(s)||(p=s,s=void 0),p=p||{},(s=s||[[0,0],[this.transform.width,this.transform.height]])instanceof u.Point||typeof s[0]=="number")f=[u.Point.convert(s)];else{var d=u.Point.convert(s[0]),v=u.Point.convert(s[1]);f=[d,new u.Point(v.x,d.y),v,new u.Point(d.x,v.y),d]}return this.style.queryRenderedFeatures(f,p,this.transform)},o.prototype.querySourceFeatures=function(s,p){return this.style.querySourceFeatures(s,p)},o.prototype.setStyle=function(s,p){return(p=u.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},p)).diff!==!1&&p.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&s?(this._diffStyle(s,p),this):(this._localIdeographFontFamily=p.localIdeographFontFamily,this._updateStyle(s,p))},o.prototype._getUIString=function(s){var p=this._locale[s];if(p==null)throw new Error("Missing UI string '"+s+"'");return p},o.prototype._updateStyle=function(s,p){return this.style&&(this.style.setEventedParent(null),this.style._remove()),s?(this.style=new Ui(this,p||{}),this.style.setEventedParent(this,{style:this.style}),typeof s=="string"?this.style.loadURL(s):this.style.loadJSON(s),this):(delete this.style,this)},o.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new Ui(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},o.prototype._diffStyle=function(s,p){var f=this;if(typeof s=="string"){var d=this._requestManager.normalizeStyleURL(s),v=this._requestManager.transformRequest(d,u.ResourceType.Style);u.getJSON(v,(function(w,A){w?f.fire(new u.ErrorEvent(w)):A&&f._updateDiff(A,p)}))}else typeof s=="object"&&this._updateDiff(s,p)},o.prototype._updateDiff=function(s,p){try{this.style.setState(s)&&this._update(!0)}catch(f){u.warnOnce("Unable to perform style diff: "+(f.message||f.error||f)+". Rebuilding the style from scratch."),this._updateStyle(s,p)}},o.prototype.getStyle=function(){if(this.style)return this.style.serialize()},o.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():u.warnOnce("There is no style added to the map.")},o.prototype.addSource=function(s,p){return this._lazyInitEmptyStyle(),this.style.addSource(s,p),this._update(!0)},o.prototype.isSourceLoaded=function(s){var p=this.style&&this.style.sourceCaches[s];if(p!==void 0)return p.loaded();this.fire(new u.ErrorEvent(new Error("There is no source with ID '"+s+"'")))},o.prototype.areTilesLoaded=function(){var s=this.style&&this.style.sourceCaches;for(var p in s){var f=s[p]._tiles;for(var d in f){var v=f[d];if(v.state!=="loaded"&&v.state!=="errored")return!1}}return!0},o.prototype.addSourceType=function(s,p,f){return this._lazyInitEmptyStyle(),this.style.addSourceType(s,p,f)},o.prototype.removeSource=function(s){return this.style.removeSource(s),this._update(!0)},o.prototype.getSource=function(s){return this.style.getSource(s)},o.prototype.addImage=function(s,p,f){f===void 0&&(f={});var d=f.pixelRatio;d===void 0&&(d=1);var v=f.sdf;v===void 0&&(v=!1);var w=f.stretchX,A=f.stretchY,D=f.content;if(this._lazyInitEmptyStyle(),p instanceof _u||Xt&&p instanceof Xt){var F=u.browser.getImageData(p);this.style.addImage(s,{data:new u.RGBAImage({width:F.width,height:F.height},F.data),pixelRatio:d,stretchX:w,stretchY:A,content:D,sdf:v,version:0})}else{if(p.width===void 0||p.height===void 0)return this.fire(new u.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`")));var O=p;this.style.addImage(s,{data:new u.RGBAImage({width:p.width,height:p.height},new Uint8Array(p.data)),pixelRatio:d,stretchX:w,stretchY:A,content:D,sdf:v,version:0,userImage:O}),O.onAdd&&O.onAdd(this,s)}},o.prototype.updateImage=function(s,p){var f=this.style.getImage(s);if(!f)return this.fire(new u.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var d=p instanceof _u||Xt&&p instanceof Xt?u.browser.getImageData(p):p,v=d.width,w=d.height,A=d.data;return v===void 0||w===void 0?this.fire(new u.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`"))):v!==f.data.width||w!==f.data.height?this.fire(new u.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(f.data.replace(A,!(p instanceof _u||Xt&&p instanceof Xt)),void this.style.updateImage(s,f))},o.prototype.hasImage=function(s){return s?!!this.style.getImage(s):(this.fire(new u.ErrorEvent(new Error("Missing required image id"))),!1)},o.prototype.removeImage=function(s){this.style.removeImage(s)},o.prototype.loadImage=function(s,p){u.getImage(this._requestManager.transformRequest(s,u.ResourceType.Image),p)},o.prototype.listImages=function(){return this.style.listImages()},o.prototype.addLayer=function(s,p){return this._lazyInitEmptyStyle(),this.style.addLayer(s,p),this._update(!0)},o.prototype.moveLayer=function(s,p){return this.style.moveLayer(s,p),this._update(!0)},o.prototype.removeLayer=function(s){return this.style.removeLayer(s),this._update(!0)},o.prototype.getLayer=function(s){return this.style.getLayer(s)},o.prototype.setLayerZoomRange=function(s,p,f){return this.style.setLayerZoomRange(s,p,f),this._update(!0)},o.prototype.setFilter=function(s,p,f){return f===void 0&&(f={}),this.style.setFilter(s,p,f),this._update(!0)},o.prototype.getFilter=function(s){return this.style.getFilter(s)},o.prototype.setPaintProperty=function(s,p,f,d){return d===void 0&&(d={}),this.style.setPaintProperty(s,p,f,d),this._update(!0)},o.prototype.getPaintProperty=function(s,p){return this.style.getPaintProperty(s,p)},o.prototype.setLayoutProperty=function(s,p,f,d){return d===void 0&&(d={}),this.style.setLayoutProperty(s,p,f,d),this._update(!0)},o.prototype.getLayoutProperty=function(s,p){return this.style.getLayoutProperty(s,p)},o.prototype.setLight=function(s,p){return p===void 0&&(p={}),this._lazyInitEmptyStyle(),this.style.setLight(s,p),this._update(!0)},o.prototype.getLight=function(){return this.style.getLight()},o.prototype.setFeatureState=function(s,p){return this.style.setFeatureState(s,p),this._update()},o.prototype.removeFeatureState=function(s,p){return this.style.removeFeatureState(s,p),this._update()},o.prototype.getFeatureState=function(s){return this.style.getFeatureState(s)},o.prototype.getContainer=function(){return this._container},o.prototype.getCanvasContainer=function(){return this._canvasContainer},o.prototype.getCanvas=function(){return this._canvas},o.prototype._containerDimensions=function(){var s=0,p=0;return this._container&&(s=this._container.clientWidth||400,p=this._container.clientHeight||300),[s,p]},o.prototype._detectMissingCSS=function(){u.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&u.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 in https://www.mapbox.com/mapbox-gl-js/api/.")},o.prototype._setupContainer=function(){var s=this._container;s.classList.add("mapboxgl-map"),(this._missingCSSCanary=k.create("div","mapboxgl-canary",s)).style.visibility="hidden",this._detectMissingCSS();var p=this._canvasContainer=k.create("div","mapboxgl-canvas-container",s);this._interactive&&p.classList.add("mapboxgl-interactive"),this._canvas=k.create("canvas","mapboxgl-canvas",p),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");var f=this._containerDimensions();this._resizeCanvas(f[0],f[1]);var d=this._controlContainer=k.create("div","mapboxgl-control-container",s),v=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(w){v[w]=k.create("div","mapboxgl-ctrl-"+w,d)})),this._container.addEventListener("scroll",this._onMapScroll,!1)},o.prototype._resizeCanvas=function(s,p){var f=u.browser.devicePixelRatio||1;this._canvas.width=f*s,this._canvas.height=f*p,this._canvas.style.width=s+"px",this._canvas.style.height=p+"px"},o.prototype._setupPainter=function(){var s=u.extend({},U.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),p=this._canvas.getContext("webgl",s)||this._canvas.getContext("experimental-webgl",s);p?(this.painter=new vr(p,this.transform),u.webpSupported.testSupport(p)):this.fire(new u.ErrorEvent(new Error("Failed to initialize WebGL")))},o.prototype._contextLost=function(s){s.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new u.Event("webglcontextlost",{originalEvent:s}))},o.prototype._contextRestored=function(s){this._setupPainter(),this.resize(),this._update(),this.fire(new u.Event("webglcontextrestored",{originalEvent:s}))},o.prototype._onMapScroll=function(s){if(s.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},o.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},o.prototype._update=function(s){return this.style?(this._styleDirty=this._styleDirty||s,this._sourcesDirty=!0,this.triggerRepaint(),this):this},o.prototype._requestRenderFrame=function(s){return this._update(),this._renderTaskQueue.add(s)},o.prototype._cancelRenderFrame=function(s){this._renderTaskQueue.remove(s)},o.prototype._render=function(s){var p,f=this,d=0,v=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(p=v.createQueryEXT(),v.beginQueryEXT(v.TIME_ELAPSED_EXT,p),d=u.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(s),!this._removed){var w=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var A=this.transform.zoom,D=u.browser.now();this.style.zoomHistory.update(A,D);var F=new u.EvaluationParameters(A,{now:D,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),O=F.crossFadingFactor();O===1&&O===this._crossFadingFactor||(w=!0,this._crossFadingFactor=O),this.style.update(F)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new u.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new u.Event("load"))),this.style&&(this.style.hasTransitions()||w)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var W=u.browser.now()-d;v.endQueryEXT(v.TIME_ELAPSED_EXT,p),setTimeout((function(){var N=v.getQueryObjectEXT(p,v.QUERY_RESULT_EXT)/1e6;v.deleteQueryEXT(p),f.fire(new u.Event("gpu-timing-frame",{cpuTime:W,gpuTime:N}))}),50)}if(this.listens("gpu-timing-layer")){var $=this.painter.collectGpuTimers();setTimeout((function(){var N=f.painter.queryGpuTimers($);f.fire(new u.Event("gpu-timing-layer",{layerTimes:N}))}),50)}var ee=this._sourcesDirty||this._styleDirty||this._placementDirty;return ee||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new u.Event("idle")),!this._loaded||this._fullyLoaded||ee||(this._fullyLoaded=!0),this}},o.prototype.remove=function(){this._hash&&this._hash.remove();for(var s=0,p=this._controls;s<p.length;s+=1)p[s].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),u.window!==void 0&&(u.window.removeEventListener("resize",this._onWindowResize,!1),u.window.removeEventListener("orientationchange",this._onWindowResize,!1),u.window.removeEventListener("online",this._onWindowOnline,!1));var f=this.painter.context.gl.getExtension("WEBGL_lose_context");f&&f.loseContext(),Bo(this._canvasContainer),Bo(this._controlContainer),Bo(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new u.Event("remove"))},o.prototype.triggerRepaint=function(){var s=this;this.style&&!this._frame&&(this._frame=u.browser.frame((function(p){s._frame=null,s._render(p)})))},o.prototype._onWindowOnline=function(){this._update()},o.prototype._onWindowResize=function(s){this._trackResize&&this.resize({originalEvent:s})._update()},n.showTileBoundaries.get=function(){return!!this._showTileBoundaries},n.showTileBoundaries.set=function(s){this._showTileBoundaries!==s&&(this._showTileBoundaries=s,this._update())},n.showPadding.get=function(){return!!this._showPadding},n.showPadding.set=function(s){this._showPadding!==s&&(this._showPadding=s,this._update())},n.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},n.showCollisionBoxes.set=function(s){this._showCollisionBoxes!==s&&(this._showCollisionBoxes=s,s?this.style._generateCollisionBoxes():this._update())},n.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},n.showOverdrawInspector.set=function(s){this._showOverdrawInspector!==s&&(this._showOverdrawInspector=s,this._update())},n.repaint.get=function(){return!!this._repaint},n.repaint.set=function(s){this._repaint!==s&&(this._repaint=s,this.triggerRepaint())},n.vertices.get=function(){return!!this._vertices},n.vertices.set=function(s){this._vertices=s,this._update()},o.prototype._setCacheLimits=function(s,p){u.setCacheLimits(s,p)},n.version.get=function(){return u.version},Object.defineProperties(o.prototype,n),o})(ds);function Bo(i){i.parentNode&&i.parentNode.removeChild(i)}var xu={showCompass:!0,showZoom:!0,visualizePitch:!1},Fn=function(i){var o=this;this.options=u.extend({},xu,i),this._container=k.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(n){return n.preventDefault()})),this.options.showZoom&&(u.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(function(n){return o._map.zoomIn({},{originalEvent:n})})),k.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(function(n){return o._map.zoomOut({},{originalEvent:n})})),k.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(u.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(function(n){o.options.visualizePitch?o._map.resetNorthPitch({},{originalEvent:n}):o._map.resetNorth({},{originalEvent:n})})),this._compassIcon=k.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};Fn.prototype._updateZoomButtons=function(){var i=this._map.getZoom(),o=i===this._map.getMaxZoom(),n=i===this._map.getMinZoom();this._zoomInButton.disabled=o,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",o.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())},Fn.prototype._rotateCompassArrow=function(){var i=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=i},Fn.prototype.onAdd=function(i){return this._map=i,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new $i(this._map,this._compass,this.options.visualizePitch)),this._container},Fn.prototype.onRemove=function(){k.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},Fn.prototype._createButton=function(i,o){var n=k.create("button",i,this._container);return n.type="button",n.addEventListener("click",o),n},Fn.prototype._setButtonTitle=function(i,o){var n=this._map._getUIString("NavigationControl."+o);i.title=n,i.setAttribute("aria-label",n)};var $i=function(i,o,n){n===void 0&&(n=!1),this._clickTolerance=10,this.element=o,this.mouseRotate=new ps({clickTolerance:i.dragRotate._mouseRotate._clickTolerance}),this.map=i,n&&(this.mousePitch=new yu({clickTolerance:i.dragRotate._mousePitch._clickTolerance})),u.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),k.addEventListener(o,"mousedown",this.mousedown),k.addEventListener(o,"touchstart",this.touchstart,{passive:!1}),k.addEventListener(o,"touchmove",this.touchmove),k.addEventListener(o,"touchend",this.touchend),k.addEventListener(o,"touchcancel",this.reset)};function ta(i,o,n){if(i=new u.LngLat(i.lng,i.lat),o){var s=new u.LngLat(i.lng-360,i.lat),p=new u.LngLat(i.lng+360,i.lat),f=n.locationPoint(i).distSqr(o);n.locationPoint(s).distSqr(o)<f?i=s:n.locationPoint(p).distSqr(o)<f&&(i=p)}for(;Math.abs(i.lng-n.center.lng)>180;){var d=n.locationPoint(i);if(d.x>=0&&d.y>=0&&d.x<=n.width&&d.y<=n.height)break;i.lng>n.center.lng?i.lng-=360:i.lng+=360}return i}$i.prototype.down=function(i,o){this.mouseRotate.mousedown(i,o),this.mousePitch&&this.mousePitch.mousedown(i,o),k.disableDrag()},$i.prototype.move=function(i,o){var n=this.map,s=this.mouseRotate.mousemoveWindow(i,o);if(s&&s.bearingDelta&&n.setBearing(n.getBearing()+s.bearingDelta),this.mousePitch){var p=this.mousePitch.mousemoveWindow(i,o);p&&p.pitchDelta&&n.setPitch(n.getPitch()+p.pitchDelta)}},$i.prototype.off=function(){var i=this.element;k.removeEventListener(i,"mousedown",this.mousedown),k.removeEventListener(i,"touchstart",this.touchstart,{passive:!1}),k.removeEventListener(i,"touchmove",this.touchmove),k.removeEventListener(i,"touchend",this.touchend),k.removeEventListener(i,"touchcancel",this.reset),this.offTemp()},$i.prototype.offTemp=function(){k.enableDrag(),k.removeEventListener(u.window,"mousemove",this.mousemove),k.removeEventListener(u.window,"mouseup",this.mouseup)},$i.prototype.mousedown=function(i){this.down(u.extend({},i,{ctrlKey:!0,preventDefault:function(){return i.preventDefault()}}),k.mousePos(this.element,i)),k.addEventListener(u.window,"mousemove",this.mousemove),k.addEventListener(u.window,"mouseup",this.mouseup)},$i.prototype.mousemove=function(i){this.move(i,k.mousePos(this.element,i))},$i.prototype.mouseup=function(i){this.mouseRotate.mouseupWindow(i),this.mousePitch&&this.mousePitch.mouseupWindow(i),this.offTemp()},$i.prototype.touchstart=function(i){i.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=k.touchPos(this.element,i.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return i.preventDefault()}},this._startPos))},$i.prototype.touchmove=function(i){i.targetTouches.length!==1?this.reset():(this._lastPos=k.touchPos(this.element,i.targetTouches)[0],this.move({preventDefault:function(){return i.preventDefault()}},this._lastPos))},$i.prototype.touchend=function(i){i.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},$i.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var 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%)"};function ys(i,o,n){var s=i.classList;for(var p in En)s.remove("mapboxgl-"+n+"-anchor-"+p);s.add("mapboxgl-"+n+"-anchor-"+o)}var ra,za=(function(i){function o(n,s){if(i.call(this),(n instanceof u.window.HTMLElement||s)&&(n=u.extend({element:n},s)),u.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._scale=n&&n.scale||1,this._draggable=n&&n.draggable||!1,this._clickTolerance=n&&n.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=n&&n.rotation||0,this._rotationAlignment=n&&n.rotationAlignment||"auto",this._pitchAlignment=n&&n.pitchAlignment&&n.pitchAlignment!=="auto"?n.pitchAlignment:this._rotationAlignment,n&&n.element)this._element=n.element,this._offset=u.Point.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=k.create("div"),this._element.setAttribute("aria-label","Map marker");var p=k.createNS("http://www.w3.org/2000/svg","svg");p.setAttributeNS(null,"display","block"),p.setAttributeNS(null,"height","41px"),p.setAttributeNS(null,"width","27px"),p.setAttributeNS(null,"viewBox","0 0 27 41");var f=k.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"stroke","none"),f.setAttributeNS(null,"stroke-width","1"),f.setAttributeNS(null,"fill","none"),f.setAttributeNS(null,"fill-rule","evenodd");var d=k.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"fill-rule","nonzero");var v=k.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"transform","translate(3.0, 29.0)"),v.setAttributeNS(null,"fill","#000000");for(var w=0,A=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];w<A.length;w+=1){var D=A[w],F=k.createNS("http://www.w3.org/2000/svg","ellipse");F.setAttributeNS(null,"opacity","0.04"),F.setAttributeNS(null,"cx","10.5"),F.setAttributeNS(null,"cy","5.80029008"),F.setAttributeNS(null,"rx",D.rx),F.setAttributeNS(null,"ry",D.ry),v.appendChild(F)}var O=k.createNS("http://www.w3.org/2000/svg","g");O.setAttributeNS(null,"fill",this._color);var W=k.createNS("http://www.w3.org/2000/svg","path");W.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),O.appendChild(W);var $=k.createNS("http://www.w3.org/2000/svg","g");$.setAttributeNS(null,"opacity","0.25"),$.setAttributeNS(null,"fill","#000000");var ee=k.createNS("http://www.w3.org/2000/svg","path");ee.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),$.appendChild(ee);var N=k.createNS("http://www.w3.org/2000/svg","g");N.setAttributeNS(null,"transform","translate(6.0, 7.0)"),N.setAttributeNS(null,"fill","#FFFFFF");var Q=k.createNS("http://www.w3.org/2000/svg","g");Q.setAttributeNS(null,"transform","translate(8.0, 8.0)");var ne=k.createNS("http://www.w3.org/2000/svg","circle");ne.setAttributeNS(null,"fill","#000000"),ne.setAttributeNS(null,"opacity","0.25"),ne.setAttributeNS(null,"cx","5.5"),ne.setAttributeNS(null,"cy","5.5"),ne.setAttributeNS(null,"r","5.4999962");var ue=k.createNS("http://www.w3.org/2000/svg","circle");ue.setAttributeNS(null,"fill","#FFFFFF"),ue.setAttributeNS(null,"cx","5.5"),ue.setAttributeNS(null,"cy","5.5"),ue.setAttributeNS(null,"r","5.4999962"),Q.appendChild(ne),Q.appendChild(ue),d.appendChild(v),d.appendChild(O),d.appendChild($),d.appendChild(N),d.appendChild(Q),p.appendChild(d),p.setAttributeNS(null,"height",41*this._scale+"px"),p.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(p),this._offset=u.Point.convert(n&&n.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(function(de){de.preventDefault()})),this._element.addEventListener("mousedown",(function(de){de.preventDefault()})),ys(this._element,this._anchor,"marker"),this._popup=null}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.addTo=function(n){return this.remove(),this._map=n,n.getCanvasContainer().appendChild(this._element),n.on("move",this._update),n.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},o.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),k.remove(this._element),this._popup&&this._popup.remove(),this},o.prototype.getLngLat=function(){return this._lngLat},o.prototype.setLngLat=function(n){return this._lngLat=u.LngLat.convert(n),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},o.prototype.getElement=function(){return this._element},o.prototype.setPopup=function(n){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),n){if(!("offset"in n.options)){var s=Math.sqrt(Math.pow(13.5,2)/2);n.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[s,-1*(24.6+s)],"bottom-right":[-s,-1*(24.6+s)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=n,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},o.prototype._onKeyPress=function(n){var s=n.code,p=n.charCode||n.keyCode;s!=="Space"&&s!=="Enter"&&p!==32&&p!==13||this.togglePopup()},o.prototype._onMapClick=function(n){var s=n.originalEvent.target,p=this._element;this._popup&&(s===p||p.contains(s))&&this.togglePopup()},o.prototype.getPopup=function(){return this._popup},o.prototype.togglePopup=function(){var n=this._popup;return n?(n.isOpen()?n.remove():n.addTo(this._map),this):this},o.prototype._update=function(n){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=ta(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var s="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?s="rotateZ("+this._rotation+"deg)":this._rotationAlignment==="map"&&(s="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var p="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?p="rotateX(0deg)":this._pitchAlignment==="map"&&(p="rotateX("+this._map.getPitch()+"deg)"),n&&n.type!=="moveend"||(this._pos=this._pos.round()),k.setTransform(this._element,En[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+p+" "+s)}},o.prototype.getOffset=function(){return this._offset},o.prototype.setOffset=function(n){return this._offset=u.Point.convert(n),this._update(),this},o.prototype._onMove=function(n){if(!this._isDragging){var s=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=s}this._isDragging&&(this._pos=n.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new u.Event("dragstart"))),this.fire(new u.Event("drag")))},o.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new u.Event("dragend")),this._state="inactive"},o.prototype._addDragHandler=function(n){this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},o.prototype.setDraggable=function(n){return this._draggable=!!n,this._map&&(n?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},o.prototype.isDraggable=function(){return this._draggable},o.prototype.setRotation=function(n){return this._rotation=n||0,this._update(),this},o.prototype.getRotation=function(){return this._rotation},o.prototype.setRotationAlignment=function(n){return this._rotationAlignment=n||"auto",this._update(),this},o.prototype.getRotationAlignment=function(){return this._rotationAlignment},o.prototype.setPitchAlignment=function(n){return this._pitchAlignment=n&&n!=="auto"?n:this._rotationAlignment,this._update(),this},o.prototype.getPitchAlignment=function(){return this._pitchAlignment},o})(u.Evented),bu={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},ia=0,zo=!1,wu=(function(i){function o(n){i.call(this),this.options=u.extend({},bu,n),u.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.onAdd=function(n){var s;return this._map=n,this._container=k.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),s=this._setupUI,ra!==void 0?s(ra):u.window.navigator.permissions!==void 0?u.window.navigator.permissions.query({name:"geolocation"}).then((function(p){s(ra=p.state!=="denied")})):s(ra=!!u.window.navigator.geolocation),this._container},o.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(u.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),k.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,ia=0,zo=!1},o.prototype._isOutOfMapMaxBounds=function(n){var s=this._map.getMaxBounds(),p=n.coords;return s&&(p.longitude<s.getWest()||p.longitude>s.getEast()||p.latitude<s.getSouth()||p.latitude>s.getNorth())},o.prototype._setErrorState=function(){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")}},o.prototype._onSuccess=function(n){if(this._map){if(this._isOutOfMapMaxBounds(n))return this._setErrorState(),this.fire(new u.Event("outofmaxbounds",n)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=n,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":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(n),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(n),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new u.Event("geolocate",n)),this._finish()}},o.prototype._updateCamera=function(n){var s=new u.LngLat(n.coords.longitude,n.coords.latitude),p=n.coords.accuracy,f=this._map.getBearing(),d=u.extend({bearing:f},this.options.fitBoundsOptions);this._map.fitBounds(s.toBounds(p),d,{geolocateSource:!0})},o.prototype._updateMarker=function(n){if(n){var s=new u.LngLat(n.coords.longitude,n.coords.latitude);this._accuracyCircleMarker.setLngLat(s).addTo(this._map),this._userLocationDotMarker.setLngLat(s).addTo(this._map),this._accuracy=n.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},o.prototype._updateCircleRadius=function(){var n=this._map._container.clientHeight/2,s=this._map.unproject([0,n]),p=this._map.unproject([1,n]),f=s.distanceTo(p),d=Math.ceil(2*this._accuracy/f);this._circleElement.style.width=d+"px",this._circleElement.style.height=d+"px"},o.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},o.prototype._onError=function(n){if(this._map){if(this.options.trackUserLocation)if(n.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;var s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(n.code===3&&zo)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new u.Event("error",n)),this._finish()}},o.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},o.prototype._setupUI=function(n){var s=this;if(this._container.addEventListener("contextmenu",(function(d){return d.preventDefault()})),this._geolocateButton=k.create("button","mapboxgl-ctrl-geolocate",this._container),k.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",n===!1){u.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var p=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=p,this._geolocateButton.setAttribute("aria-label",p)}else{var f=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=f,this._geolocateButton.setAttribute("aria-label",f)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=k.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new za(this._dotElement),this._circleElement=k.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new za({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",(function(d){d.geolocateSource||s._watchState!=="ACTIVE_LOCK"||d.originalEvent&&d.originalEvent.type==="resize"||(s._watchState="BACKGROUND",s._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),s._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),s.fire(new u.Event("trackuserlocationend")))}))},o.prototype.trigger=function(){if(!this._setup)return u.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 u.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":ia--,zo=!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 u.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 u.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){var n;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++ia>1?(n={maximumAge:6e5,timeout:0},zo=!0):(n=this.options.positionOptions,zo=!1),this._geolocationWatchID=u.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,n)}}else u.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},o.prototype._clearWatch=function(){u.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},o})(u.Evented),to={maxWidth:100,unit:"metric"},ro=function(i){this.options=u.extend({},to,i),u.bindAll(["_onMove","setUnit"],this)};function vs(i,o,n){var s=n&&n.maxWidth||100,p=i._container.clientHeight/2,f=i.unproject([0,p]),d=i.unproject([s,p]),v=f.distanceTo(d);if(n&&n.unit==="imperial"){var w=3.2808*v;w>5280?io(o,s,w/5280,i._getUIString("ScaleControl.Miles")):io(o,s,w,i._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?io(o,s,v/1852,i._getUIString("ScaleControl.NauticalMiles")):v>=1e3?io(o,s,v/1e3,i._getUIString("ScaleControl.Kilometers")):io(o,s,v,i._getUIString("ScaleControl.Meters"))}function io(i,o,n,s){var p,f,d,v=(p=n,(f=Math.pow(10,(""+Math.floor(p)).length-1))*(d=(d=p/f)>=10?10:d>=5?5:d>=3?3:d>=2?2:d>=1?1:(function(w){var A=Math.pow(10,Math.ceil(-Math.log(w)/Math.LN10));return Math.round(w*A)/A})(d)));i.style.width=o*(v/n)+"px",i.innerHTML=v+"&nbsp;"+s}ro.prototype.getDefaultPosition=function(){return"bottom-left"},ro.prototype._onMove=function(){vs(this._map,this._container,this.options)},ro.prototype.onAdd=function(i){return this._map=i,this._container=k.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",i.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},ro.prototype.onRemove=function(){k.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},ro.prototype.setUnit=function(i){this.options.unit=i,vs(this._map,this._container,this.options)};var ln=function(i){this._fullscreen=!1,i&&i.container&&(i.container instanceof u.window.HTMLElement?this._container=i.container:u.warnOnce("Full screen control 'container' must be a DOM element.")),u.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in u.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in u.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in u.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in u.window.document&&(this._fullscreenchange="MSFullscreenChange")};ln.prototype.onAdd=function(i){return this._map=i,this._container||(this._container=this._map.getContainer()),this._controlContainer=k.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",u.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},ln.prototype.onRemove=function(){k.remove(this._controlContainer),this._map=null,u.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},ln.prototype._checkFullscreenSupport=function(){return!!(u.window.document.fullscreenEnabled||u.window.document.mozFullScreenEnabled||u.window.document.msFullscreenEnabled||u.window.document.webkitFullscreenEnabled)},ln.prototype._setupUI=function(){var i=this._fullscreenButton=k.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);k.create("span","mapboxgl-ctrl-icon",i).setAttribute("aria-hidden",!0),i.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),u.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},ln.prototype._updateTitle=function(){var i=this._getTitle();this._fullscreenButton.setAttribute("aria-label",i),this._fullscreenButton.title=i},ln.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},ln.prototype._isFullscreen=function(){return this._fullscreen},ln.prototype._changeIcon=function(){(u.window.document.fullscreenElement||u.window.document.mozFullScreenElement||u.window.document.webkitFullscreenElement||u.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},ln.prototype._onClickFullscreen=function(){this._isFullscreen()?u.window.document.exitFullscreen?u.window.document.exitFullscreen():u.window.document.mozCancelFullScreen?u.window.document.mozCancelFullScreen():u.window.document.msExitFullscreen?u.window.document.msExitFullscreen():u.window.document.webkitCancelFullScreen&&u.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Su={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Da=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Iu=(function(i){function o(n){i.call(this),this.options=u.extend(Object.create(Su),n),u.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.addTo=function(n){return this._map&&this.remove(),this._map=n,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new u.Event("open")),this},o.prototype.isOpen=function(){return!!this._map},o.prototype.remove=function(){return this._content&&k.remove(this._content),this._container&&(k.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new u.Event("close")),this},o.prototype.getLngLat=function(){return this._lngLat},o.prototype.setLngLat=function(n){return this._lngLat=u.LngLat.convert(n),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},o.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},o.prototype.getElement=function(){return this._container},o.prototype.setText=function(n){return this.setDOMContent(u.window.document.createTextNode(n))},o.prototype.setHTML=function(n){var s,p=u.window.document.createDocumentFragment(),f=u.window.document.createElement("body");for(f.innerHTML=n;s=f.firstChild;)p.appendChild(s);return this.setDOMContent(p)},o.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},o.prototype.setMaxWidth=function(n){return this.options.maxWidth=n,this._update(),this},o.prototype.setDOMContent=function(n){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=k.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(n),this._createCloseButton(),this._update(),this._focusFirstElement(),this},o.prototype.addClassName=function(n){this._container&&this._container.classList.add(n)},o.prototype.removeClassName=function(n){this._container&&this._container.classList.remove(n)},o.prototype.setOffset=function(n){return this.options.offset=n,this._update(),this},o.prototype.toggleClassName=function(n){if(this._container)return this._container.classList.toggle(n)},o.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=k.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))},o.prototype._onMouseUp=function(n){this._update(n.point)},o.prototype._onMouseMove=function(n){this._update(n.point)},o.prototype._onDrag=function(n){this._update(n.point)},o.prototype._update=function(n){var s=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=k.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=k.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(F){return s._container.classList.add(F)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=ta(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||n)){var p=this._pos=this._trackPointer&&n?n:this._map.project(this._lngLat),f=this.options.anchor,d=(function F(O){if(O){if(typeof O=="number"){var W=Math.round(Math.sqrt(.5*Math.pow(O,2)));return{center:new u.Point(0,0),top:new u.Point(0,O),"top-left":new u.Point(W,W),"top-right":new u.Point(-W,W),bottom:new u.Point(0,-O),"bottom-left":new u.Point(W,-W),"bottom-right":new u.Point(-W,-W),left:new u.Point(O,0),right:new u.Point(-O,0)}}if(O instanceof u.Point||Array.isArray(O)){var $=u.Point.convert(O);return{center:$,top:$,"top-left":$,"top-right":$,bottom:$,"bottom-left":$,"bottom-right":$,left:$,right:$}}return{center:u.Point.convert(O.center||[0,0]),top:u.Point.convert(O.top||[0,0]),"top-left":u.Point.convert(O["top-left"]||[0,0]),"top-right":u.Point.convert(O["top-right"]||[0,0]),bottom:u.Point.convert(O.bottom||[0,0]),"bottom-left":u.Point.convert(O["bottom-left"]||[0,0]),"bottom-right":u.Point.convert(O["bottom-right"]||[0,0]),left:u.Point.convert(O.left||[0,0]),right:u.Point.convert(O.right||[0,0])}}return F(new u.Point(0,0))})(this.options.offset);if(!f){var v,w=this._container.offsetWidth,A=this._container.offsetHeight;v=p.y+d.bottom.y<A?["top"]:p.y>this._map.transform.height-A?["bottom"]:[],p.x<w/2?v.push("left"):p.x>this._map.transform.width-w/2&&v.push("right"),f=v.length===0?"bottom":v.join("-")}var D=p.add(d[f]).round();k.setTransform(this._container,En[f]+" translate("+D.x+"px,"+D.y+"px)"),ys(this._container,f,"popup")}},o.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var n=this._container.querySelector(Da);n&&n.focus()}},o.prototype._onClose=function(){this.remove()},o})(u.Evented),gs={version:u.version,supported:U,setRTLTextPlugin:u.setRTLTextPlugin,getRTLTextPluginStatus:u.getRTLTextPluginStatus,Map:zl,NavigationControl:Fn,GeolocateControl:wu,AttributionControl:Ai,ScaleControl:ro,FullscreenControl:ln,Popup:Iu,Marker:za,Style:Ui,LngLat:u.LngLat,LngLatBounds:u.LngLatBounds,Point:u.Point,MercatorCoordinate:u.MercatorCoordinate,Evented:u.Evented,config:u.config,prewarm:function(){ge().acquire(me)},clearPrewarmedResources:function(){var i=Je;i&&(i.isPreloaded()&&i.numActive()===1?(i.release(me),Je=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 u.config.ACCESS_TOKEN},set accessToken(i){u.config.ACCESS_TOKEN=i},get baseApiUrl(){return u.config.API_URL},set baseApiUrl(i){u.config.API_URL=i},get workerCount(){return Ae.workerCount},set workerCount(i){Ae.workerCount=i},get maxParallelImageRequests(){return u.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(i){u.config.MAX_PARALLEL_IMAGE_REQUESTS=i},clearStorage:function(i){u.clearTileCache(i)},workerUrl:""};return gs})),E}))})(_c)),_c.exports}var T0=I0();const fo=wt.getDefaultExportFromCjs(T0);var Ku={exports:{}},xp,ky;function A0(){if(ky)return xp;ky=1,xp=_;var y={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"};function _(b){if(!b||!b.type)return null;var M=y[b.type];if(!M)return null;if(M==="geometry")return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:b}]};if(M==="feature")return{type:"FeatureCollection",features:[b]};if(M==="featurecollection")return b}return xp}function xc(y){switch(y&&y.type||null){case"FeatureCollection":return y.features=y.features.reduce(function(_,b){return _.concat(xc(b))},[]),y;case"Feature":return y.geometry?xc(y.geometry).map(function(_){var b={type:"Feature",properties:JSON.parse(JSON.stringify(y.properties)),geometry:_};return y.id!==void 0&&(b.id=y.id),b}):[y];case"MultiPoint":return y.coordinates.map(function(_){return{type:"Point",coordinates:_}});case"MultiPolygon":return y.coordinates.map(function(_){return{type:"Polygon",coordinates:_}});case"MultiLineString":return y.coordinates.map(function(_){return{type:"LineString",coordinates:_}});case"GeometryCollection":return y.geometries.map(xc).reduce(function(_,b){return _.concat(b)},[]);case"Point":case"Polygon":case"LineString":return[y]}}const E0=Object.freeze(Object.defineProperty({__proto__:null,default:xc},Symbol.toStringTag,{value:"Module"})),P0=wt.getAugmentedNamespace(E0);var bp,My;function C0(){return My||(My=1,bp=function(_){return b(_);function b(M){return Array.isArray(M)&&M.length&&typeof M[0]=="number"?[M]:M.reduce(function(E,R){return Array.isArray(R)&&Array.isArray(R[0])?E.concat(b(R)):(E.push(R),E)},[])}}),bp}var wp,By;function k0(){if(By)return wp;By=1;var y=A0(),_=P0,b=C0();return _ instanceof Function||(_=_.default),wp=function(M){if(!M)return[];var E=_(y(M)),R=[];return E.features.forEach(function(u){u.geometry&&(R=R.concat(b(u.geometry.coordinates)))}),R},wp}var Sp,zy;function bc(){if(zy)return Sp;zy=1;var y=Function.prototype.toString,_=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,b,M;if(typeof _=="function"&&typeof Object.defineProperty=="function")try{b=Object.defineProperty({},"length",{get:function(){throw M}}),M={},_(function(){throw 42},null,b)}catch(Re){Re!==M&&(_=null)}else _=null;var E=/^\s*class\b/,R=function(ve){try{var Ke=y.call(ve);return E.test(Ke)}catch{return!1}},u=function(ve){try{return R(ve)?!1:(y.call(ve),!0)}catch{return!1}},U=Object.prototype.toString,k="[object Object]",J="[object Function]",X="[object GeneratorFunction]",ae="[object HTMLAllCollection]",Y="[object HTML document.all class]",Te="[object HTMLCollection]",be=typeof Symbol=="function"&&!!Symbol.toStringTag,ke=!(0 in[,]),Oe=function(){return!1};if(typeof document=="object"){var Ve=document.all;U.call(Ve)===U.call(document.all)&&(Oe=function(ve){if((ke||!ve)&&(typeof ve>"u"||typeof ve=="object"))try{var Ke=U.call(ve);return(Ke===ae||Ke===Y||Ke===Te||Ke===k)&&ve("")==null}catch{}return!1})}return Sp=_?function(ve){if(Oe(ve))return!0;if(!ve||typeof ve!="function"&&typeof ve!="object")return!1;try{_(ve,null,b)}catch(Ke){if(Ke!==M)return!1}return!R(ve)&&u(ve)}:function(ve){if(Oe(ve))return!0;if(!ve||typeof ve!="function"&&typeof ve!="object")return!1;if(be)return u(ve);if(R(ve))return!1;var Ke=U.call(ve);return Ke!==J&&Ke!==X&&!/^\[object HTML/.test(Ke)?!1:u(ve)},Sp}var Ip,Dy;function $d(){if(Dy)return Ip;Dy=1;var y=bc(),_=Object.prototype.toString,b=Object.prototype.hasOwnProperty,M=function(k,J,X){for(var ae=0,Y=k.length;ae<Y;ae++)b.call(k,ae)&&(X==null?J(k[ae],ae,k):J.call(X,k[ae],ae,k))},E=function(k,J,X){for(var ae=0,Y=k.length;ae<Y;ae++)X==null?J(k.charAt(ae),ae,k):J.call(X,k.charAt(ae),ae,k)},R=function(k,J,X){for(var ae in k)b.call(k,ae)&&(X==null?J(k[ae],ae,k):J.call(X,k[ae],ae,k))};function u(U){return _.call(U)==="[object Array]"}return Ip=function(k,J,X){if(!y(J))throw new TypeError("iterator must be a function");var ae;arguments.length>=3&&(ae=X),u(k)?M(k,J,ae):typeof k=="string"?E(k,J,ae):R(k,J,ae)},Ip}var Tp,Ry;function nx(){return Ry||(Ry=1,Tp=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Tp}var Ap,Ly;function Ju(){if(Ly)return Ap;Ly=1;var y=nx(),_=typeof globalThis>"u"?wt.commonjsGlobal:globalThis;return Ap=function(){for(var M=[],E=0;E<y.length;E++)typeof _[y[E]]=="function"&&(M[M.length]=y[E]);return M},Ap}var Ep={exports:{}},Pp,Fy;function Wd(){return Fy||(Fy=1,Pp=Object),Pp}var Cp,Oy;function M0(){return Oy||(Oy=1,Cp=Error),Cp}var kp,Vy;function B0(){return Vy||(Vy=1,kp=EvalError),kp}var Mp,qy;function Hd(){return qy||(qy=1,Mp=RangeError),Mp}var Bp,Uy;function z0(){return Uy||(Uy=1,Bp=ReferenceError),Bp}var zp,Ny;function Nn(){return Ny||(Ny=1,zp=SyntaxError),zp}var Dp,jy;function Ot(){return jy||(jy=1,Dp=TypeError),Dp}var Rp,Gy;function D0(){return Gy||(Gy=1,Rp=URIError),Rp}var Lp,Zy;function wc(){return Zy||(Zy=1,Lp=Math.abs),Lp}var Fp,$y;function Ha(){return $y||($y=1,Fp=Math.floor),Fp}var Op,Wy;function Xd(){return Wy||(Wy=1,Op=Math.max),Op}var Vp,Hy;function Kd(){return Hy||(Hy=1,Vp=Math.min),Vp}var qp,Xy;function Xa(){return Xy||(Xy=1,qp=Math.pow),qp}var Up,Ky;function R0(){return Ky||(Ky=1,Up=Math.round),Up}var Np,Jy;function Ka(){return Jy||(Jy=1,Np=Number.isNaN||function(_){return _!==_}),Np}var jp,Yy;function L0(){if(Yy)return jp;Yy=1;var y=Ka();return jp=function(b){return y(b)||b===0?b:b<0?-1:1},jp}var Gp,Qy;function F0(){return Qy||(Qy=1,Gp=Object.getOwnPropertyDescriptor),Gp}var Zp,ev;function No(){if(ev)return Zp;ev=1;var y=F0();if(y)try{y([],"length")}catch{y=null}return Zp=y,Zp}var $p,tv;function Yu(){if(tv)return $p;tv=1;var y=Object.defineProperty||!1;if(y)try{y({},"a",{value:1})}catch{y=!1}return $p=y,$p}var Wp,rv;function Jd(){return rv||(rv=1,Wp=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var _={},b=Symbol("test"),M=Object(b);if(typeof b=="string"||Object.prototype.toString.call(b)!=="[object Symbol]"||Object.prototype.toString.call(M)!=="[object Symbol]")return!1;var E=42;_[b]=E;for(var R in _)return!1;if(typeof Object.keys=="function"&&Object.keys(_).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(_).length!==0)return!1;var u=Object.getOwnPropertySymbols(_);if(u.length!==1||u[0]!==b||!Object.prototype.propertyIsEnumerable.call(_,b))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var U=Object.getOwnPropertyDescriptor(_,b);if(U.value!==E||U.enumerable!==!0)return!1}return!0}),Wp}var Hp,iv;function ox(){if(iv)return Hp;iv=1;var y=typeof Symbol<"u"&&Symbol,_=Jd();return Hp=function(){return typeof y!="function"||typeof Symbol!="function"||typeof y("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:_()},Hp}var Xp,nv;function ax(){return nv||(nv=1,Xp=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Xp}var Kp,ov;function sx(){if(ov)return Kp;ov=1;var y=Wd();return Kp=y.getPrototypeOf||null,Kp}var Jp,av;function O0(){if(av)return Jp;av=1;var y="Function.prototype.bind called on incompatible ",_=Object.prototype.toString,b=Math.max,M="[object Function]",E=function(k,J){for(var X=[],ae=0;ae<k.length;ae+=1)X[ae]=k[ae];for(var Y=0;Y<J.length;Y+=1)X[Y+k.length]=J[Y];return X},R=function(k,J){for(var X=[],ae=J,Y=0;ae<k.length;ae+=1,Y+=1)X[Y]=k[ae];return X},u=function(U,k){for(var J="",X=0;X<U.length;X+=1)J+=U[X],X+1<U.length&&(J+=k);return J};return Jp=function(k){var J=this;if(typeof J!="function"||_.apply(J)!==M)throw new TypeError(y+J);for(var X=R(arguments,1),ae,Y=function(){if(this instanceof ae){var Ve=J.apply(this,E(X,arguments));return Object(Ve)===Ve?Ve:this}return J.apply(k,E(X,arguments))},Te=b(0,J.length-X.length),be=[],ke=0;ke<Te;ke++)be[ke]="$"+ke;if(ae=Function("binder","return function ("+u(be,",")+"){ return binder.apply(this,arguments); }")(Y),J.prototype){var Oe=function(){};Oe.prototype=J.prototype,ae.prototype=new Oe,Oe.prototype=null}return ae},Jp}var Yp,sv;function Qu(){if(sv)return Yp;sv=1;var y=O0();return Yp=Function.prototype.bind||y,Yp}var Qp,uv;function Yd(){return uv||(uv=1,Qp=Function.prototype.call),Qp}var eh,lv;function Qd(){return lv||(lv=1,eh=Function.prototype.apply),eh}var th,cv;function V0(){return cv||(cv=1,th=typeof Reflect<"u"&&Reflect&&Reflect.apply),th}var rh,pv;function ux(){if(pv)return rh;pv=1;var y=Qu(),_=Qd(),b=Yd(),M=V0();return rh=M||y.call(b,_),rh}var ih,hv;function em(){if(hv)return ih;hv=1;var y=Qu(),_=Ot(),b=Yd(),M=ux();return ih=function(R){if(R.length<1||typeof R[0]!="function")throw new _("a function is required");return M(y,b,R)},ih}var nh,fv;function q0(){if(fv)return nh;fv=1;var y=em(),_=No(),b;try{b=[].__proto__===Array.prototype}catch(u){if(!u||typeof u!="object"||!("code"in u)||u.code!=="ERR_PROTO_ACCESS")throw u}var M=!!b&&_&&_(Object.prototype,"__proto__"),E=Object,R=E.getPrototypeOf;return nh=M&&typeof M.get=="function"?y([M.get]):typeof R=="function"?function(U){return R(U==null?U:E(U))}:!1,nh}var oh,dv;function Ja(){if(dv)return oh;dv=1;var y=ax(),_=sx(),b=q0();return oh=y?function(E){return y(E)}:_?function(E){if(!E||typeof E!="object"&&typeof E!="function")throw new TypeError("getProto: not an object");return _(E)}:b?function(E){return b(E)}:null,oh}var ah,mv;function lx(){if(mv)return ah;mv=1;const y=(async function(){}).constructor;return ah=()=>y,ah}var sh,yv;function cx(){if(yv)return sh;yv=1;const y=(function*(){}).constructor;return sh=()=>y,sh}var uh,vv;function U0(){if(vv)return uh;vv=1;const y=(async function*(){}).constructor;return uh=()=>y,uh}var lh,gv;function jo(){if(gv)return lh;gv=1;var y=Function.prototype.call,_=Object.prototype.hasOwnProperty,b=Qu();return lh=b.call(y,_),lh}var ch,_v;function Dr(){if(_v)return ch;_v=1;var y,_=Wd(),b=M0(),M=B0(),E=Hd(),R=z0(),u=Nn(),U=Ot(),k=D0(),J=wc(),X=Ha(),ae=Xd(),Y=Kd(),Te=Xa(),be=R0(),ke=L0(),Oe=No(),Ve=Yu(),Re=function(){throw new U},ve=Oe?(function(){try{return arguments.callee,Re}catch{try{return Oe(arguments,"callee").get}catch{return Re}}})():Re,Ke=ox()(),We=Ja(),It=sx(),we=ax(),Ge=Qd(),Fe=Yd(),tt={},kt=typeof Uint8Array>"u"||!We?y:We(Uint8Array),Wt={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?y:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?y:ArrayBuffer,"%ArrayIteratorPrototype%":Ke&&We?We([][Symbol.iterator]()):y,"%AsyncFromSyncIteratorPrototype%":y,"%AsyncFunction%":tt,"%AsyncGenerator%":tt,"%AsyncGeneratorFunction%":tt,"%AsyncIteratorPrototype%":tt,"%Atomics%":typeof Atomics>"u"?y:Atomics,"%BigInt%":typeof BigInt>"u"?y:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?y:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?y:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?y:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":b,"%eval%":eval,"%EvalError%":M,"%Float16Array%":typeof Float16Array>"u"?y:Float16Array,"%Float32Array%":typeof Float32Array>"u"?y:Float32Array,"%Float64Array%":typeof Float64Array>"u"?y:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?y:FinalizationRegistry,"%Function%":Function,"%GeneratorFunction%":tt,"%Int8Array%":typeof Int8Array>"u"?y:Int8Array,"%Int16Array%":typeof Int16Array>"u"?y:Int16Array,"%Int32Array%":typeof Int32Array>"u"?y:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ke&&We?We(We([][Symbol.iterator]())):y,"%JSON%":typeof JSON=="object"?JSON:y,"%Map%":typeof Map>"u"?y:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ke||!We?y:We(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":_,"%Object.getOwnPropertyDescriptor%":Oe,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?y:Promise,"%Proxy%":typeof Proxy>"u"?y:Proxy,"%RangeError%":E,"%ReferenceError%":R,"%Reflect%":typeof Reflect>"u"?y:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?y:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ke||!We?y:We(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?y:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ke&&We?We(""[Symbol.iterator]()):y,"%Symbol%":Ke?Symbol:y,"%SyntaxError%":u,"%ThrowTypeError%":ve,"%TypedArray%":kt,"%TypeError%":U,"%Uint8Array%":typeof Uint8Array>"u"?y:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?y:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?y:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?y:Uint32Array,"%URIError%":k,"%WeakMap%":typeof WeakMap>"u"?y:WeakMap,"%WeakRef%":typeof WeakRef>"u"?y:WeakRef,"%WeakSet%":typeof WeakSet>"u"?y:WeakSet,"%Function.prototype.call%":Fe,"%Function.prototype.apply%":Ge,"%Object.defineProperty%":Ve,"%Object.getPrototypeOf%":It,"%Math.abs%":J,"%Math.floor%":X,"%Math.max%":ae,"%Math.min%":Y,"%Math.pow%":Te,"%Math.round%":be,"%Math.sign%":ke,"%Reflect.getPrototypeOf%":we};if(We)try{null.error}catch(Nr){var St=We(We(Nr));Wt["%Error.prototype%"]=St}var Ut=lx(),Hr=cx(),Er=U0(),bi=function Nr(ar){var sr;if(ar==="%AsyncFunction%")sr=Ut()||void 0;else if(ar==="%GeneratorFunction%")sr=Hr()||void 0;else if(ar==="%AsyncGeneratorFunction%")sr=Er()||void 0;else if(ar==="%AsyncGenerator%"){var lt=Nr("%AsyncGeneratorFunction%");lt&&(sr=lt.prototype)}else if(ar==="%AsyncIteratorPrototype%"){var mr=Nr("%AsyncGenerator%");mr&&We&&(sr=We(mr.prototype))}return Wt[ar]=sr,sr},or={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Rr=Qu(),et=jo(),Lr=Rr.call(Fe,Array.prototype.concat),Xr=Rr.call(Ge,Array.prototype.splice),At=Rr.call(Fe,String.prototype.replace),Fr=Rr.call(Fe,String.prototype.slice),Mi=Rr.call(Fe,RegExp.prototype.exec),pi=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Or=/\\(\\)?/g,Xi=function(ar){var sr=Fr(ar,0,1),lt=Fr(ar,-1);if(sr==="%"&&lt!=="%")throw new u("invalid intrinsic syntax, expected closing `%`");if(lt==="%"&&sr!=="%")throw new u("invalid intrinsic syntax, expected opening `%`");var mr=[];return At(ar,pi,function(pr,jr,hr,br){mr[mr.length]=hr?At(br,Or,"$1"):jr||pr}),mr},Nt=function(ar,sr){var lt=ar,mr;if(et(or,lt)&&(mr=or[lt],lt="%"+mr[0]+"%"),et(Wt,lt)){var pr=Wt[lt];if(pr===tt&&(pr=bi(lt)),typeof pr>"u"&&!sr)throw new U("intrinsic "+ar+" exists, but is not available. Please file an issue!");return{alias:mr,name:lt,value:pr}}throw new u("intrinsic "+ar+" does not exist!")};return ch=function(ar,sr){if(typeof ar!="string"||ar.length===0)throw new U("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof sr!="boolean")throw new U('"allowMissing" argument must be a boolean');if(Mi(/^%?[^%]*%?$/,ar)===null)throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var lt=Xi(ar),mr=lt.length>0?lt[0]:"",pr=Nt("%"+mr+"%",sr),jr=pr.name,hr=pr.value,br=!1,dn=pr.alias;dn&&(mr=dn[0],Xr(lt,Lr([0,1],dn)));for(var Kr=1,Bi=!0;Kr<lt.length;Kr+=1){var hi=lt[Kr],ti=Fr(hi,0,1),ri=Fr(hi,-1);if((ti==='"'||ti==="'"||ti==="`"||ri==='"'||ri==="'"||ri==="`")&&ti!==ri)throw new u("property names with quotes must have matching quotes");if((hi==="constructor"||!Bi)&&(br=!0),mr+="."+hi,jr="%"+mr+"%",et(Wt,jr))hr=Wt[jr];else if(hr!=null){if(!(hi in hr)){if(!sr)throw new U("base intrinsic for "+ar+" exists, but the property is not available.");return}if(Oe&&Kr+1>=lt.length){var Vi=Oe(hr,hi);Bi=!!Vi,Bi&&"get"in Vi&&!("originalValue"in Vi.get)?hr=Vi.get:hr=hr[hi]}else Bi=et(hr,hi),hr=hr[hi];Bi&&!br&&(Wt[jr]=hr)}}return hr},ch}var ph,xv;function tm(){if(xv)return ph;xv=1;var y=Yu(),_=Nn(),b=Ot(),M=No();return ph=function(R,u,U){if(!R||typeof R!="object"&&typeof R!="function")throw new b("`obj` must be an object or a function`");if(typeof u!="string"&&typeof u!="symbol")throw new b("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new b("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new b("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new b("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new b("`loose`, if provided, must be a boolean");var k=arguments.length>3?arguments[3]:null,J=arguments.length>4?arguments[4]:null,X=arguments.length>5?arguments[5]:null,ae=arguments.length>6?arguments[6]:!1,Y=!!M&&M(R,u);if(y)y(R,u,{configurable:X===null&&Y?Y.configurable:!X,enumerable:k===null&&Y?Y.enumerable:!k,value:U,writable:J===null&&Y?Y.writable:!J});else if(ae||!k&&!J&&!X)R[u]=U;else throw new _("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},ph}var hh,bv;function Sc(){if(bv)return hh;bv=1;var y=Yu(),_=function(){return!!y};return _.hasArrayLengthDefineBug=function(){if(!y)return null;try{return y([],"length",{value:1}).length!==1}catch{return!0}},hh=_,hh}var fh,wv;function N0(){if(wv)return fh;wv=1;var y=Dr(),_=tm(),b=Sc()(),M=No(),E=Ot(),R=y("%Math.floor%");return fh=function(U,k){if(typeof U!="function")throw new E("`fn` is not a function");if(typeof k!="number"||k<0||k>4294967295||R(k)!==k)throw new E("`length` must be a positive 32-bit integer");var J=arguments.length>2&&!!arguments[2],X=!0,ae=!0;if("length"in U&&M){var Y=M(U,"length");Y&&!Y.configurable&&(X=!1),Y&&!Y.writable&&(ae=!1)}return(X||ae||!J)&&(b?_(U,"length",k,!0,!0):_(U,"length",k)),U},fh}var dh,Sv;function j0(){if(Sv)return dh;Sv=1;var y=Qu(),_=Qd(),b=ux();return dh=function(){return b(y,_,arguments)},dh}var Iv;function ha(){return Iv||(Iv=1,(function(y){var _=N0(),b=Yu(),M=em(),E=j0();y.exports=function(u){var U=M(arguments),k=1+u.length-(arguments.length-1);return _(U,k>0?k:0,!0)},b?b(y.exports,"apply",{value:E}):y.exports.apply=E})(Ep)),Ep.exports}var mh,Tv;function dr(){if(Tv)return mh;Tv=1;var y=Dr(),_=em(),b=_([y("%String.prototype.indexOf%")]);return mh=function(E,R){var u=y(E,!!R);return typeof u=="function"&&b(E,".prototype.")>-1?_([u]):u},mh}var yh,Av;function Go(){if(Av)return yh;Av=1;var y=Jd();return yh=function(){return y()&&!!Symbol.toStringTag},yh}var vh,Ev;function Hs(){if(Ev)return vh;Ev=1;var y=$d(),_=Ju(),b=ha(),M=dr(),E=No(),R=Ja(),u=M("Object.prototype.toString"),U=Go()(),k=typeof globalThis>"u"?wt.commonjsGlobal:globalThis,J=_(),X=M("String.prototype.slice"),ae=M("Array.prototype.indexOf",!0)||function(Oe,Ve){for(var Re=0;Re<Oe.length;Re+=1)if(Oe[Re]===Ve)return Re;return-1},Y={__proto__:null};U&&E&&R?y(J,function(ke){var Oe=new k[ke];if(Symbol.toStringTag in Oe&&R){var Ve=R(Oe),Re=E(Ve,Symbol.toStringTag);if(!Re&&Ve){var ve=R(Ve);Re=E(ve,Symbol.toStringTag)}if(Re&&Re.get){var Ke=b(Re.get);Y["$"+ke]=Ke}}}):y(J,function(ke){var Oe=new k[ke],Ve=Oe.slice||Oe.set;if(Ve){var Re=b(Ve);Y["$"+ke]=Re}});var Te=function(Oe){var Ve=!1;return y(Y,function(Re,ve){if(!Ve)try{"$"+Re(Oe)===ve&&(Ve=X(ve,1))}catch{}}),Ve},be=function(Oe){var Ve=!1;return y(Y,function(Re,ve){if(!Ve)try{Re(Oe),Ve=X(ve,1)}catch{}}),Ve};return vh=function(Oe){if(!Oe||typeof Oe!="object")return!1;if(!U){var Ve=X(u(Oe),8,-1);return ae(J,Ve)>-1?Ve:Ve!=="Object"?!1:be(Oe)}return E?Te(Oe):null},vh}var gh,Pv;function px(){if(Pv)return gh;Pv=1;var y=Object.prototype.toString;return gh=function(b){var M=y.call(b),E=M==="[object Arguments]";return E||(E=M!=="[object Array]"&&b!==null&&typeof b=="object"&&typeof b.length=="number"&&b.length>=0&&y.call(b.callee)==="[object Function]"),E},gh}var _h,Cv;function G0(){if(Cv)return _h;Cv=1;var y;if(!Object.keys){var _=Object.prototype.hasOwnProperty,b=Object.prototype.toString,M=px(),E=Object.prototype.propertyIsEnumerable,R=!E.call({toString:null},"toString"),u=E.call(function(){},"prototype"),U=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],k=function(Y){var Te=Y.constructor;return Te&&Te.prototype===Y},J={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},X=(function(){if(typeof window>"u")return!1;for(var Y in window)try{if(!J["$"+Y]&&_.call(window,Y)&&window[Y]!==null&&typeof window[Y]=="object")try{k(window[Y])}catch{return!0}}catch{return!0}return!1})(),ae=function(Y){if(typeof window>"u"||!X)return k(Y);try{return k(Y)}catch{return!1}};y=function(Te){var be=Te!==null&&typeof Te=="object",ke=b.call(Te)==="[object Function]",Oe=M(Te),Ve=be&&b.call(Te)==="[object String]",Re=[];if(!be&&!ke&&!Oe)throw new TypeError("Object.keys called on a non-object");var ve=u&&ke;if(Ve&&Te.length>0&&!_.call(Te,0))for(var Ke=0;Ke<Te.length;++Ke)Re.push(String(Ke));if(Oe&&Te.length>0)for(var We=0;We<Te.length;++We)Re.push(String(We));else for(var It in Te)!(ve&&It==="prototype")&&_.call(Te,It)&&Re.push(String(It));if(R)for(var we=ae(Te),Ge=0;Ge<U.length;++Ge)!(we&&U[Ge]==="constructor")&&_.call(Te,U[Ge])&&Re.push(U[Ge]);return Re}}return _h=y,_h}var xh,kv;function Z0(){if(kv)return xh;kv=1;var y=Array.prototype.slice,_=px(),b=Object.keys,M=b?function(u){return b(u)}:G0(),E=Object.keys;return M.shim=function(){if(Object.keys){var u=(function(){var U=Object.keys(arguments);return U&&U.length===arguments.length})(1,2);u||(Object.keys=function(k){return _(k)?E(y.call(k)):E(k)})}else Object.keys=M;return Object.keys||M},xh=M,xh}var bh,Mv;function el(){if(Mv)return bh;Mv=1;var y=Z0(),_=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",b=Object.prototype.toString,M=Array.prototype.concat,E=tm(),R=function(J){return typeof J=="function"&&b.call(J)==="[object Function]"},u=Sc()(),U=function(J,X,ae,Y){if(X in J){if(Y===!0){if(J[X]===ae)return}else if(!R(Y)||!Y())return}u?E(J,X,ae,!0):E(J,X,ae)},k=function(J,X){var ae=arguments.length>2?arguments[2]:{},Y=y(X);_&&(Y=M.call(Y,Object.getOwnPropertySymbols(X)));for(var Te=0;Te<Y.length;Te+=1)U(J,Y[Te],X[Y[Te]],ae[Y[Te]])};return k.supportsDescriptors=!!u,bh=k,bh}const $0={},W0=Object.freeze(Object.defineProperty({__proto__:null,default:$0},Symbol.toStringTag,{value:"Module"})),H0=wt.getAugmentedNamespace(W0);var wh,Bv;function X0(){if(Bv)return wh;Bv=1;var y=typeof Map=="function"&&Map.prototype,_=Object.getOwnPropertyDescriptor&&y?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,b=y&&_&&typeof _.get=="function"?_.get:null,M=y&&Map.prototype.forEach,E=typeof Set=="function"&&Set.prototype,R=Object.getOwnPropertyDescriptor&&E?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=E&&R&&typeof R.get=="function"?R.get:null,U=E&&Set.prototype.forEach,k=typeof WeakMap=="function"&&WeakMap.prototype,J=k?WeakMap.prototype.has:null,X=typeof WeakSet=="function"&&WeakSet.prototype,ae=X?WeakSet.prototype.has:null,Y=typeof WeakRef=="function"&&WeakRef.prototype,Te=Y?WeakRef.prototype.deref:null,be=Boolean.prototype.valueOf,ke=Object.prototype.toString,Oe=Function.prototype.toString,Ve=String.prototype.match,Re=String.prototype.slice,ve=String.prototype.replace,Ke=String.prototype.toUpperCase,We=String.prototype.toLowerCase,It=RegExp.prototype.test,we=Array.prototype.concat,Ge=Array.prototype.join,Fe=Array.prototype.slice,tt=Math.floor,kt=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Wt=Object.getOwnPropertySymbols,St=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ut=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Hr=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ut||!0)?Symbol.toStringTag:null,Er=Object.prototype.propertyIsEnumerable,bi=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(fe){return fe.__proto__}:null);function or(fe,_e){if(fe===1/0||fe===-1/0||fe!==fe||fe&&fe>-1e3&&fe<1e3||It.call(/e/,_e))return _e;var jt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof fe=="number"){var tr=fe<0?-tt(-fe):tt(fe);if(tr!==fe){var Kt=String(tr),_t=Re.call(_e,Kt.length+1);return ve.call(Kt,jt,"$&_")+"."+ve.call(ve.call(_t,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ve.call(_e,jt,"$&_")}var Rr=H0,et=Rr.custom,Lr=mr(et)?et:null,Xr={__proto__:null,double:'"',single:"'"},At={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};wh=function fe(_e,jt,tr,Kt){var _t=jt||{};if(hr(_t,"quoteStyle")&&!hr(Xr,_t.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(hr(_t,"maxStringLength")&&(typeof _t.maxStringLength=="number"?_t.maxStringLength<0&&_t.maxStringLength!==1/0:_t.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var fi=hr(_t,"customInspect")?_t.customInspect:!0;if(typeof fi!="boolean"&&fi!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(hr(_t,"indent")&&_t.indent!==null&&_t.indent!==" "&&!(parseInt(_t.indent,10)===_t.indent&&_t.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(hr(_t,"numericSeparator")&&typeof _t.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var qi=_t.numericSeparator;if(typeof _e>"u")return"undefined";if(_e===null)return"null";if(typeof _e=="boolean")return _e?"true":"false";if(typeof _e=="string")return yo(_e,_t);if(typeof _e=="number"){if(_e===0)return 1/0/_e>0?"0":"-0";var ii=String(_e);return qi?or(_e,ii):ii}if(typeof _e=="bigint"){var Yt=String(_e)+"n";return qi?or(_e,Yt):Yt}var T=typeof _t.depth>"u"?5:_t.depth;if(typeof tr>"u"&&(tr=0),tr>=T&&T>0&&typeof _e=="object")return Or(_e)?"[Array]":"[Object]";var P=jn(_t,tr);if(typeof Kt>"u")Kt=[];else if(Kr(Kt,_e)>=0)return"[Circular]";function B(Be,yt,qe){if(yt&&(Kt=Fe.call(Kt),Kt.push(yt)),qe){var Et={depth:_t.depth};return hr(_t,"quoteStyle")&&(Et.quoteStyle=_t.quoteStyle),fe(Be,Et,tr+1,Kt)}return fe(Be,_t,tr+1,Kt)}if(typeof _e=="function"&&!Nt(_e)){var V=dn(_e),Z=rn(_e,B);return"[Function"+(V?": "+V:" (anonymous)")+"]"+(Z.length>0?" { "+Ge.call(Z,", ")+" }":"")}if(mr(_e)){var re=Ut?ve.call(String(_e),/^(Symbol\(.*\))_[^)]*$/,"$1"):St.call(_e);return typeof _e=="object"&&!Ut?mn(re):re}if(Ki(_e)){for(var ie="<"+We.call(String(_e.nodeName)),L=_e.attributes||[],H=0;H<L.length;H++)ie+=" "+L[H].name+"="+Fr(Mi(L[H].value),"double",_t);return ie+=">",_e.childNodes&&_e.childNodes.length&&(ie+="..."),ie+="</"+We.call(String(_e.nodeName))+">",ie}if(Or(_e)){if(_e.length===0)return"[]";var se=rn(_e,B);return P&&!$o(se)?"["+zn(se,P)+"]":"[ "+Ge.call(se,", ")+" ]"}if(Nr(_e)){var Se=rn(_e,B);return!("cause"in Error.prototype)&&"cause"in _e&&!Er.call(_e,"cause")?"{ ["+String(_e)+"] "+Ge.call(we.call("[cause]: "+B(_e.cause),Se),", ")+" }":Se.length===0?"["+String(_e)+"]":"{ ["+String(_e)+"] "+Ge.call(Se,", ")+" }"}if(typeof _e=="object"&&fi){if(Lr&&typeof _e[Lr]=="function"&&Rr)return Rr(_e,{depth:T-tr});if(fi!=="symbol"&&typeof _e.inspect=="function")return _e.inspect()}if(Bi(_e)){var Ee=[];return M&&M.call(_e,function(Be,yt){Ee.push(B(yt,_e,!0)+" => "+B(Be,_e))}),Bn("Map",b.call(_e),Ee,P)}if(ri(_e)){var me=[];return U&&U.call(_e,function(Be){me.push(B(Be,_e))}),Bn("Set",u.call(_e),me,P)}if(hi(_e))return Mn("WeakMap");if(Vi(_e))return Mn("WeakSet");if(ti(_e))return Mn("WeakRef");if(sr(_e))return mn(B(Number(_e)));if(pr(_e))return mn(B(kt.call(_e)));if(lt(_e))return mn(be.call(_e));if(ar(_e))return mn(B(String(_e)));if(typeof window<"u"&&_e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&_e===globalThis||typeof wt.commonjsGlobal<"u"&&_e===wt.commonjsGlobal)return"{ [object globalThis] }";if(!Xi(_e)&&!Nt(_e)){var Ae=rn(_e,B),Je=bi?bi(_e)===Object.prototype:_e instanceof Object||_e.constructor===Object,Ze=_e instanceof Object?"":"null prototype",ge=!Je&&Hr&&Object(_e)===_e&&Hr in _e?Re.call(br(_e),8,-1):Ze?"Object":"",Ne=Je||typeof _e.constructor!="function"?"":_e.constructor.name?_e.constructor.name+" ":"",ze=Ne+(ge||Ze?"["+Ge.call(we.call([],ge||[],Ze||[]),": ")+"] ":"");return Ae.length===0?ze+"{}":P?ze+"{"+zn(Ae,P)+"}":ze+"{ "+Ge.call(Ae,", ")+" }"}return String(_e)};function Fr(fe,_e,jt){var tr=jt.quoteStyle||_e,Kt=Xr[tr];return Kt+fe+Kt}function Mi(fe){return ve.call(String(fe),/"/g,"&quot;")}function pi(fe){return!Hr||!(typeof fe=="object"&&(Hr in fe||typeof fe[Hr]<"u"))}function Or(fe){return br(fe)==="[object Array]"&&pi(fe)}function Xi(fe){return br(fe)==="[object Date]"&&pi(fe)}function Nt(fe){return br(fe)==="[object RegExp]"&&pi(fe)}function Nr(fe){return br(fe)==="[object Error]"&&pi(fe)}function ar(fe){return br(fe)==="[object String]"&&pi(fe)}function sr(fe){return br(fe)==="[object Number]"&&pi(fe)}function lt(fe){return br(fe)==="[object Boolean]"&&pi(fe)}function mr(fe){if(Ut)return fe&&typeof fe=="object"&&fe instanceof Symbol;if(typeof fe=="symbol")return!0;if(!fe||typeof fe!="object"||!St)return!1;try{return St.call(fe),!0}catch{}return!1}function pr(fe){if(!fe||typeof fe!="object"||!kt)return!1;try{return kt.call(fe),!0}catch{}return!1}var jr=Object.prototype.hasOwnProperty||function(fe){return fe in this};function hr(fe,_e){return jr.call(fe,_e)}function br(fe){return ke.call(fe)}function dn(fe){if(fe.name)return fe.name;var _e=Ve.call(Oe.call(fe),/^function\s*([\w$]+)/);return _e?_e[1]:null}function Kr(fe,_e){if(fe.indexOf)return fe.indexOf(_e);for(var jt=0,tr=fe.length;jt<tr;jt++)if(fe[jt]===_e)return jt;return-1}function Bi(fe){if(!b||!fe||typeof fe!="object")return!1;try{b.call(fe);try{u.call(fe)}catch{return!0}return fe instanceof Map}catch{}return!1}function hi(fe){if(!J||!fe||typeof fe!="object")return!1;try{J.call(fe,J);try{ae.call(fe,ae)}catch{return!0}return fe instanceof WeakMap}catch{}return!1}function ti(fe){if(!Te||!fe||typeof fe!="object")return!1;try{return Te.call(fe),!0}catch{}return!1}function ri(fe){if(!u||!fe||typeof fe!="object")return!1;try{u.call(fe);try{b.call(fe)}catch{return!0}return fe instanceof Set}catch{}return!1}function Vi(fe){if(!ae||!fe||typeof fe!="object")return!1;try{ae.call(fe,ae);try{J.call(fe,J)}catch{return!0}return fe instanceof WeakSet}catch{}return!1}function Ki(fe){return!fe||typeof fe!="object"?!1:typeof HTMLElement<"u"&&fe instanceof HTMLElement?!0:typeof fe.nodeName=="string"&&typeof fe.getAttribute=="function"}function yo(fe,_e){if(fe.length>_e.maxStringLength){var jt=fe.length-_e.maxStringLength,tr="... "+jt+" more character"+(jt>1?"s":"");return yo(Re.call(fe,0,_e.maxStringLength),_e)+tr}var Kt=At[_e.quoteStyle||"single"];Kt.lastIndex=0;var _t=ve.call(ve.call(fe,Kt,"\\$1"),/[\x00-\x1f]/g,Zo);return Fr(_t,"single",_e)}function Zo(fe){var _e=fe.charCodeAt(0),jt={8:"b",9:"t",10:"n",12:"f",13:"r"}[_e];return jt?"\\"+jt:"\\x"+(_e<16?"0":"")+Ke.call(_e.toString(16))}function mn(fe){return"Object("+fe+")"}function Mn(fe){return fe+" { ? }"}function Bn(fe,_e,jt,tr){var Kt=tr?zn(jt,tr):Ge.call(jt,", ");return fe+" ("+_e+") {"+Kt+"}"}function $o(fe){for(var _e=0;_e<fe.length;_e++)if(Kr(fe[_e],`
498
- `)>=0)return!1;return!0}function jn(fe,_e){var jt;if(fe.indent===" ")jt=" ";else if(typeof fe.indent=="number"&&fe.indent>0)jt=Ge.call(Array(fe.indent+1)," ");else return null;return{base:jt,prev:Ge.call(Array(_e+1),jt)}}function zn(fe,_e){if(fe.length===0)return"";var jt=`
499
- `+_e.prev+_e.base;return jt+Ge.call(fe,","+jt)+`
500
- `+_e.prev}function rn(fe,_e){var jt=Or(fe),tr=[];if(jt){tr.length=fe.length;for(var Kt=0;Kt<fe.length;Kt++)tr[Kt]=hr(fe,Kt)?_e(fe[Kt],fe):""}var _t=typeof Wt=="function"?Wt(fe):[],fi;if(Ut){fi={};for(var qi=0;qi<_t.length;qi++)fi["$"+_t[qi]]=_t[qi]}for(var ii in fe)hr(fe,ii)&&(jt&&String(Number(ii))===ii&&ii<fe.length||Ut&&fi["$"+ii]instanceof Symbol||(It.call(/[^\w$]/,ii)?tr.push(_e(ii,fe)+": "+_e(fe[ii],fe)):tr.push(ii+": "+_e(fe[ii],fe))));if(typeof Wt=="function")for(var Yt=0;Yt<_t.length;Yt++)Er.call(fe,_t[Yt])&&tr.push("["+_e(_t[Yt])+"]: "+_e(fe[_t[Yt]],fe));return tr}return wh}var Sh,zv;function Ic(){return zv||(zv=1,Sh=function(_){return typeof _=="string"||typeof _=="symbol"}),Sh}var Ih,Dv;function fa(){return Dv||(Dv=1,Ih=function(_){return!!_&&(typeof _=="function"||typeof _=="object")}),Ih}var Th,Rv;function K0(){if(Rv)return Th;Rv=1;var y=Ot(),_=X0(),b=Ic(),M=fa();return Th=function(R,u){if(!M(R))throw new y("Assertion failed: Type(O) is not Object");if(!b(u))throw new y("Assertion failed: P is not a Property Key, got "+_(u));return R[u]},Th}var Ah,Lv;function mo(){if(Lv)return Ah;Lv=1;var y=Ka();return Ah=function(b){return(typeof b=="number"||typeof b=="bigint")&&!y(b)&&b!==1/0&&b!==-1/0},Ah}var Eh,Fv;function Tc(){if(Fv)return Eh;Fv=1;var y=wc(),_=Ha(),b=Ka(),M=mo();return Eh=function(R){if(typeof R!="number"||b(R)||!M(R))return!1;var u=y(R);return _(u)===u},Eh}var Ph,Ov;function Xs(){if(Ov)return Ph;Ov=1;var y=ha(),_=dr(),b=Dr(),M=b("%ArrayBuffer%",!0),E=_("ArrayBuffer.prototype.byteLength",!0),R=_("Object.prototype.toString"),u=!!M&&!E&&new M(0).slice,U=!!u&&y(u);return Ph=E||U?function(J){if(!J||typeof J!="object")return!1;try{return E?E(J):U(J,0),!0}catch{return!1}}:M?function(J){return R(J)==="[object ArrayBuffer]"}:function(J){return!1},Ph}var Ch,Vv;function hx(){if(Vv)return Ch;Vv=1;var y=dr(),_=y("ArrayBuffer.prototype.byteLength",!0),b=Xs();return Ch=function(E){return b(E)?_?_(E):E.byteLength:NaN},Ch}var kh,qv;function tl(){if(qv)return kh;qv=1;var y=dr(),_=y("SharedArrayBuffer.prototype.byteLength",!0);return kh=_?function(M){if(!M||typeof M!="object")return!1;try{return _(M),!0}catch{return!1}}:function(M){return!1},kh}var Mh,Uv;function Ks(){if(Uv)return Mh;Uv=1;var y=Ot(),_=hx(),b=Ju()(),M=dr(),E=Xs(),R=tl(),u=M("SharedArrayBuffer.prototype.byteLength",!0);return Mh=function(k){var J=R(k);if(!E(k)&&!J)throw new y("Assertion failed: `arrayBuffer` must be an Object with an [[ArrayBufferData]] internal slot");if((J?u:_)(k)===0)try{new wt.commonjsGlobal[b[0]](k)}catch(X){return!!X&&X.name==="TypeError"}return!1},Mh}var Bh,Nv;function fx(){if(Nv)return Bh;Nv=1;var y=Ot(),_=jo(),b=fa(),M=Ic();return Bh=function(R,u){if(!b(R))throw new y("Assertion failed: `O` must be an Object");if(!M(u))throw new y("Assertion failed: `P` must be a Property Key");return _(R,u)},Bh}var zh,jv;function dx(){if(jv)return zh;jv=1;var y=Dr(),_=y("%Array%"),b=!_.isArray&&dr()("Object.prototype.toString");return zh=_.isArray||function(E){return b(E)==="[object Array]"},zh}var Dh,Gv;function rm(){return Gv||(Gv=1,Dh=dx()),Dh}var Rh,Zv;function mx(){return Zv||(Zv=1,Rh=function(_){return _==="BIGUINT64"||_==="BIGINT64"}),Rh}var Lh,$v;function J0(){return $v||($v=1,Lh=function(_){return _==="UINT8"||_==="UINT8C"||_==="UINT16"||_==="UINT32"||_==="BIGUINT64"}),Lh}var Fh,Wv;function Y0(){if(Wv)return Fh;Wv=1;var y=Xa();return Fh=function(b){var M=b[3]&128?-1:1,E=(b[3]&127)<<1|b[2]>>7,R=(b[2]&127)<<16|b[1]<<8|b[0];return E===0&&R===0?M===1?0:-0:E===255&&R===0?M===1?1/0:-1/0:E===255&&R!==0?NaN:(E-=127,E===-127?M*R*y(2,-149):M*(1+R*y(2,-23))*y(2,E))},Fh}var Oh,Hv;function Q0(){if(Hv)return Oh;Hv=1;var y=Xa();return Oh=function(b){var M=b[7]&128?-1:1,E=(b[7]&127)<<4|(b[6]&240)>>4,R=(b[6]&15)*281474976710656+b[5]*1099511627776+b[4]*4294967296+b[3]*16777216+b[2]*65536+b[1]*256+b[0];return E===0&&R===0?M*0:E===2047&&R!==0?NaN:E===2047&&R===0?M*(1/0):(E-=1023,E===-1023?M*R*5e-324:M*(1+R/4503599627370496)*y(2,E))},Oh}var Vh,Xv;function e1(){if(Xv)return Vh;Xv=1;var y=Dr(),_=Xa(),b=y("%Number%"),M=y("%BigInt%",!0);return Vh=function(R,u,U,k){for(var J=k?M:b,X=J(0),ae=0;ae<R.length;ae++)X+=J(R[ae]*_(2,8*ae));if(!U){var Y=u*8;R[u-1]&128&&(X-=J(_(2,Y)))}return X},Vh}var qh,Kv;function t1(){return Kv||(Kv=1,qh=function(_,b){for(var M=0;M<_.length;M+=1)if(!b(_[M],M,_))return!1;return!0}),qh}var Uh,Jv;function r1(){return Jv||(Jv=1,Uh=function(_){return typeof _=="number"&&_>=0&&_<=255&&(_|0)===_}),Uh}var Nh,Yv;function Js(){return Yv||(Yv=1,Nh={__proto__:null,name:{__proto__:null,$Int8Array:"INT8",$Uint8Array:"UINT8",$Uint8ClampedArray:"UINT8C",$Int16Array:"INT16",$Uint16Array:"UINT16",$Int32Array:"INT32",$Uint32Array:"UINT32",$BigInt64Array:"BIGINT64",$BigUint64Array:"BIGUINT64",$Float32Array:"FLOAT32",$Float64Array:"FLOAT64"},size:{__proto__:null,$INT8:1,$UINT8:1,$UINT8C:1,$INT16:2,$UINT16:2,$INT32:4,$UINT32:4,$BIGINT64:8,$BIGUINT64:8,$FLOAT32:4,$FLOAT64:8},choices:'"INT8", "UINT8", "UINT8C", "INT16", "UINT16", "INT32", "UINT32", "BIGINT64", "BIGUINT64", "FLOAT32", or "FLOAT64"'}),Nh}var jh,Qv;function i1(){if(Qv)return jh;Qv=1;var y=Dr(),_=dr(),b=Hd(),M=Nn(),E=Ot(),R=y("%BigInt%",!0),u=fx(),U=rm(),k=mx(),J=J0(),X=Y0(),ae=Q0(),Y=e1(),Te=t1(),be=r1(),ke=_("Array.prototype.reverse"),Oe=_("Array.prototype.slice"),Ve=Js();return jh=function(ve,Ke,We){if(!u(Ve.size,"$"+ve))throw new E("Assertion failed: `type` must be a TypedArray element type");if(!U(Ke)||!Te(Ke,be))throw new E("Assertion failed: `rawBytes` must be an Array of bytes");if(typeof We!="boolean")throw new E("Assertion failed: `isLittleEndian` must be a Boolean");var It=Ve.size["$"+ve];if(Ke.length!==It)throw new b("Assertion failed: `rawBytes` must have a length of "+It+" for type "+ve);var we=k(ve);if(we&&!R)throw new M("this environment does not support BigInts");return Ke=Oe(Ke,0,It),We||ke(Ke),ve==="FLOAT32"?X(Ke):ve==="FLOAT64"?ae(Ke):Y(Ke,It,J(ve),we)},jh}var Gh,eg;function yx(){if(eg)return Gh;eg=1;var y={}.toString;return Gh=Array.isArray||function(_){return y.call(_)=="[object Array]"},Gh}var Zh,tg;function n1(){if(tg)return Zh;tg=1;var y=Dr(),_=y("%Array.prototype.concat%"),b=ha(),M=dr(),E=M("Array.prototype.slice"),R=Jd()(),u=R&&Symbol.isConcatSpreadable,U=[],k=u?b.apply(_,U):null,J=u?yx():null;return Zh=u?function(ae){for(var Y=0;Y<arguments.length;Y+=1){var Te=arguments[Y];if(Te&&typeof Te=="object"&&typeof Te[u]=="boolean"){U[u]||(U[u]=!0);var be=J(Te)?E(Te):[Te];be[u]=!0,arguments[Y]=be}}return k(arguments)}:b(_,U),Zh}var $h,rg;function Ys(){if(rg)return $h;rg=1;var y=Hs();return $h=function(b){return!!y(b)},$h}var Wh,ig;function rl(){if(ig)return Wh;ig=1;var y=Ot(),_=dr(),b=_("TypedArray.prototype.buffer",!0),M=Ys();return Wh=b||function(R){if(!M(R))throw new y("Not a Typed Array");return R.buffer},Wh}var Hh,ng;function vx(){if(ng)return Hh;ng=1;var y=Dr(),_=y("%Uint8Array%",!0),b=y("%Uint32Array%",!0),M=rl(),E=b&&new b([305419896]),R=E&&new _(M(E));return Hh=R?R[0]===120?"little":R[0]===18?"big":R[0]===52?"mixed":"unknown":"indeterminate",Hh}var Xh,og;function o1(){if(og)return Xh;og=1;var y=Dr(),_=Nn(),b=Ot(),M=dr(),E=Tc(),R=y("%Uint8Array%",!0),u=M("Array.prototype.slice"),U=Ks(),k=i1(),J=Xs(),X=tl(),ae=n1(),Y=Js(),Te=vx();return Xh=function(ke,Oe,Ve,Re,ve){var Ke=X(ke);if(!J(ke)&&!Ke)throw new b("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!E(Oe))throw new b("Assertion failed: `byteIndex` must be an integer");if(typeof Ve!="string"||typeof Y.size["$"+Ve]!="number")throw new b("Assertion failed: `type` must be one of "+Y.choices);if(typeof Re!="boolean")throw new b("Assertion failed: `isTypedArray` must be a boolean");if(ve!=="SEQ-CST"&&ve!=="UNORDERED")throw new b("Assertion failed: `order` must be either `SEQ-CST` or `UNORDERED`");if(arguments.length>5&&typeof arguments[5]!="boolean")throw new b("Assertion failed: `isLittleEndian` must be a boolean, if present");if(U(ke))throw new b("Assertion failed: `arrayBuffer` is detached");if(Oe<0)throw new b("Assertion failed: `byteIndex` must be non-negative");var We=Y.size["$"+Ve];if(!We)throw new b("Assertion failed: `type` must be one of "+Y.choices);var It;if(Ke)throw new _("SharedArrayBuffer is not supported by this implementation");It=u(new R(ke,Oe),0,We);var we=arguments.length>5?arguments[5]:Te==="little",Ge=we?u(ae([0,0,0,0,0,0,0,0],It),-We):u(ae(It,[0,0,0,0,0,0,0,0]),0,We);return k(Ve,Ge,we)},Xh}var Kh,ag;function gx(){if(ag)return Kh;ag=1;var y=Ka();return Kh=function(b,M){return b===M?b===0?1/b===1/M:!0:y(b)&&y(M)},Kh}var Jh,sg;function a1(){if(sg)return Jh;sg=1;var y=Ot(),_=fa(),b=Ic(),M=gx(),E=(function(){try{return delete[].length,!0}catch{return!1}})();return Jh=function(u,U,k,J){if(!_(u))throw new y("Assertion failed: `O` must be an Object");if(!b(U))throw new y("Assertion failed: `P` must be a Property Key");if(typeof J!="boolean")throw new y("Assertion failed: `Throw` must be a Boolean");if(J){if(u[U]=k,E&&!M(u[U],k))throw new y("Attempted to assign to readonly property.");return!0}try{return u[U]=k,E?M(u[U],k):!0}catch{return!1}},Jh}var Yh,ug;function s1(){if(ug)return Yh;ug=1;var y=Dr(),_=y("%BigInt%",!0),b=Ot(),M=Nn();return Yh=function(R){if(typeof R!="string")throw new b("`argument` must be a string");if(!_)throw new M("BigInts are not supported in this environment");try{return _(R)}catch{return}},Yh}var Qh,lg;function u1(){return lg||(lg=1,Qh=function(_){return _===null||typeof _!="function"&&typeof _!="object"}),Qh}var ef,cg;function _x(){if(cg)return ef;cg=1;var y=dr(),_=y("Date.prototype.getDay"),b=function(U){try{return _(U),!0}catch{return!1}},M=y("Object.prototype.toString"),E="[object Date]",R=Go()();return ef=function(U){return typeof U!="object"||U===null?!1:R?b(U):M(U)===E},ef}var fc={exports:{}},tf,pg;function xx(){if(pg)return tf;pg=1;var y=dr(),_=Go()(),b=jo(),M=No(),E;if(_){var R=y("RegExp.prototype.exec"),u={},U=function(){throw u},k={toString:U,valueOf:U};typeof Symbol.toPrimitive=="symbol"&&(k[Symbol.toPrimitive]=U),E=function(Y){if(!Y||typeof Y!="object")return!1;var Te=M(Y,"lastIndex"),be=Te&&b(Te,"value");if(!be)return!1;try{R(Y,k)}catch(ke){return ke===u}}}else{var J=y("Object.prototype.toString"),X="[object RegExp]";E=function(Y){return!Y||typeof Y!="object"&&typeof Y!="function"?!1:J(Y)===X}}return tf=E,tf}var rf,hg;function Ac(){if(hg)return rf;hg=1;var y=dr(),_=xx(),b=y("RegExp.prototype.exec"),M=Ot();return rf=function(R){if(!_(R))throw new M("`regex` must be a RegExp");return function(U){return b(R,U)!==null}},rf}var fg;function bx(){if(fg)return fc.exports;fg=1;var y=dr(),_=y("Object.prototype.toString"),b=ox()(),M=Ac();if(b){var E=y("Symbol.prototype.toString"),R=M(/^Symbol\(.*\)$/),u=function(k){return typeof k.valueOf()!="symbol"?!1:R(E(k))};fc.exports=function(k){if(typeof k=="symbol")return!0;if(!k||typeof k!="object"||_(k)!=="[object Symbol]")return!1;try{return u(k)}catch{return!1}}}else fc.exports=function(k){return!1};return fc.exports}var nf,dg;function l1(){if(dg)return nf;dg=1;var y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol",_=u1(),b=bc(),M=_x(),E=bx(),R=function(k,J){if(typeof k>"u"||k===null)throw new TypeError("Cannot call method on "+k);if(typeof J!="string"||J!=="number"&&J!=="string")throw new TypeError('hint must be "string" or "number"');var X=J==="string"?["toString","valueOf"]:["valueOf","toString"],ae,Y,Te;for(Te=0;Te<X.length;++Te)if(ae=k[X[Te]],b(ae)&&(Y=ae.call(k),_(Y)))return Y;throw new TypeError("No default value")},u=function(k,J){var X=k[J];if(X!==null&&typeof X<"u"){if(!b(X))throw new TypeError(X+" returned for property "+String(J)+" of object "+k+" is not a function");return X}};return nf=function(k){if(_(k))return k;var J="default";arguments.length>1&&(arguments[1]===String?J="string":arguments[1]===Number&&(J="number"));var X;if(y&&(Symbol.toPrimitive?X=u(k,Symbol.toPrimitive):E(k)&&(X=Symbol.prototype.valueOf)),typeof X<"u"){var ae=X.call(k,J);if(_(ae))return ae;throw new TypeError("unable to convert exotic object to primitive")}return J==="default"&&(M(k)||E(k))&&(J="string"),R(k,J==="default"?"number":J)},nf}var of,mg;function wx(){if(mg)return of;mg=1;var y=l1();return of=function(b){return arguments.length>1?y(b,arguments[1]):y(b)},of}var af,yg;function Sx(){if(yg)return af;yg=1;var y=Dr(),_=y("%BigInt%",!0),b=y("%Number%"),M=Ot(),E=Nn(),R=s1(),u=wx();return af=function(k){if(!_)throw new E("BigInts are not supported in this environment");var J=u(k,b);if(J==null)throw new M("Cannot convert null or undefined to a BigInt");if(typeof J=="boolean")return _(J?1:0);if(typeof J=="number")throw new M("Cannot convert a Number value to a BigInt");if(typeof J=="string"){var X=R(J);if(typeof X>"u")throw new M("Failed to parse String to BigInt");return X}if(typeof J=="symbol")throw new M("Cannot convert a Symbol value to a BigInt");if(typeof J!="bigint")throw new E("Assertion failed: unknown primitive type");return J},af}var sf,vg;function Ix(){if(vg)return sf;vg=1;var y=Dr(),_=y("%BigInt%",!0),b=Hd(),M=Ot(),E=_&&_(0);return sf=function(u,U){if(typeof u!="bigint"||typeof U!="bigint")throw new M("Assertion failed: `n` and `d` arguments must be BigInts");if(U===E)throw new b("Division by zero");return u===E?E:u%U},sf}var uf,gg;function Tx(){return gg||(gg=1,uf=function(_,b,M){var E=_(b,M);return E>=0?E:E+M}),uf}var lf,_g;function c1(){if(_g)return lf;_g=1;var y=Dr(),_=y("%BigInt%",!0),b=Xa(),M=Sx(),E=Ix(),R=Tx(),u=_&&BigInt(b(2,32))*BigInt(b(2,31)),U=_&&BigInt(b(2,32))*BigInt(b(2,32));return lf=function(J){var X=M(J),ae=R(E,X,U);return ae>=u?ae-U:ae},lf}var cf,xg;function p1(){if(xg)return cf;xg=1;var y=Dr(),_=y("%BigInt%",!0),b=Xa(),M=Sx(),E=Ix(),R=Tx(),u=_&&BigInt(b(2,32))*BigInt(b(2,32));return cf=function(k){var J=M(k),X=R(E,J,u);return X},cf}var pf,bg;function h1(){if(bg)return pf;bg=1;var y=Ha();return pf=function(b,M){var E=b%M;return y(E>=0?E:E+M)},pf}var hf,wg;function f1(){return wg||(wg=1,hf=h1()),hf}var ff,Sg;function Qs(){if(Sg)return ff;Sg=1;var y=f1();return ff=function(b,M){return y(b,M)},ff}var df,Ig;function d1(){return Ig||(Ig=1,df=function(_){return _===null||typeof _!="function"&&typeof _!="object"}),df}var mf,Tg;function Ax(){if(Tg)return mf;Tg=1;var y=Ot();return mf=function(b){if(b==null)throw new y(arguments.length>0&&arguments[1]||"Cannot call method on "+b);return b},mf}var yf,Ag;function Ex(){if(Ag)return yf;Ag=1;var y=Dr(),_=y("%String%"),b=Ot();return yf=function(E){if(typeof E=="symbol")throw new b("Cannot convert a Symbol value to a string");return _(E)},yf}var vf,Eg;function Px(){if(Eg)return vf;Eg=1;var y=Ax(),_=Ex(),b=dr(),M=b("String.prototype.replace"),E=/^\s$/.test("᠎"),R=E?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,u=E?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;return vf=function(){var k=_(y(this));return M(M(k,R,""),u,"")},vf}var gf,Pg;function Cx(){if(Pg)return gf;Pg=1;var y=Px(),_="​",b="᠎";return gf=function(){return String.prototype.trim&&_.trim()===_&&b.trim()===b&&("_"+b).trim()==="_"+b&&(b+"_").trim()===b+"_"?String.prototype.trim:y},gf}var _f,Cg;function m1(){if(Cg)return _f;Cg=1;var y=Sc()(),_=tm(),b=Cx();return _f=function(){var E=b();return String.prototype.trim!==E&&(y?_(String.prototype,"trim",E,!0):_(String.prototype,"trim",E)),E},_f}var xf,kg;function y1(){if(kg)return xf;kg=1;var y=ha(),_=el(),b=Ax(),M=Px(),E=Cx(),R=m1(),u=y(E()),U=function(J){return b(J),u(J)};return _(U,{getPolyfill:E,implementation:M,shim:R}),xf=U,xf}var bf,Mg;function v1(){if(Mg)return bf;Mg=1;var y=Dr(),_=y("%RegExp%"),b=Ot(),M=y("%parseInt%"),E=dr(),R=Ac(),u=E("String.prototype.slice"),U=R(/^0b[01]+$/i),k=R(/^0o[0-7]+$/i),J=R(/^[-+]0x[0-9a-f]+$/i),X=["…","​","￾"].join(""),ae=new _("["+X+"]","g"),Y=R(ae),Te=y1();return bf=function be(ke){if(typeof ke!="string")throw new b("Assertion failed: `argument` is not a String");if(U(ke))return+M(u(ke,2),2);if(k(ke))return+M(u(ke,2),8);if(Y(ke)||J(ke))return NaN;var Oe=Te(ke);return Oe!==ke?be(Oe):+ke},bf}var wf,Bg;function da(){if(Bg)return wf;Bg=1;var y=Dr(),_=Ot(),b=y("%Number%"),M=d1(),E=wx(),R=v1();return wf=function(U){var k=M(U)?U:E(U,b);if(typeof k=="symbol")throw new _("Cannot convert a Symbol value to a number");if(typeof k=="bigint")throw new _("Conversion from 'BigInt' to 'number' is not allowed.");return typeof k=="string"?R(k):+k},wf}var Sf,zg;function im(){if(zg)return Sf;zg=1;var y=Ha();return Sf=function(b){return typeof b=="bigint"?b:y(b)},Sf}var If,Dg;function Ya(){if(Dg)return If;Dg=1;var y=im(),_=Ot();return If=function(M){if(typeof M!="number"&&typeof M!="bigint")throw new _("argument must be a Number or a BigInt");var E=M<0?-y(-M):y(M);return E===0?0:E},If}var Tf,Rg;function g1(){if(Rg)return Tf;Rg=1;var y=Qs(),_=da(),b=Ya(),M=mo(),E=65536;return Tf=function(u){var U=_(u);if(!M(U)||U===0)return 0;var k=b(U),J=y(k,E);return J>=32768?J-E:J},Tf}var Af,Lg;function _1(){if(Lg)return Af;Lg=1;var y=Qs(),_=da(),b=Ya(),M=mo(),E=2147483648,R=4294967296;return Af=function(U){var k=_(U);if(!M(k)||k===0)return 0;var J=b(k),X=y(J,R),ae=X>=E?X-R:X;return ae===0?0:ae},Af}var Ef,Fg;function x1(){if(Fg)return Ef;Fg=1;var y=Qs(),_=da(),b=Ya(),M=mo();return Ef=function(R){var u=_(R);if(!M(u)||u===0)return 0;var U=b(u),k=y(U,256);return k>=128?k-256:k},Ef}var Pf,Og;function b1(){if(Og)return Pf;Og=1;var y=Qs(),_=da(),b=Ya(),M=mo(),E=65536;return Pf=function(u){var U=_(u);if(!M(U)||U===0)return 0;var k=b(U),J=y(k,E);return J===0?0:J},Pf}var Cf,Vg;function w1(){if(Vg)return Cf;Vg=1;var y=Qs(),_=da(),b=Ya(),M=mo(),E=4294967296;return Cf=function(u){var U=_(u);if(!M(U)||U===0)return 0;var k=b(U),J=y(k,E);return J===0?0:J},Cf}var kf,qg;function S1(){if(qg)return kf;qg=1;var y=mo(),_=Qs(),b=da(),M=Ya();return kf=function(R){var u=b(R);if(!y(u)||u===0)return 0;var U=M(u),k=_(U,256);return k},kf}var Mf,Ug;function I1(){if(Ug)return Mf;Ug=1;var y=Ot(),_=Xd(),b=Kd();return Mf=function(E,R,u){if(typeof E!="number"||typeof R!="number"||typeof u!="number"||!(R<=u))throw new y("Assertion failed: all three arguments must be MVs, and `lower` must be `<= upper`");return b(_(R,E),u)},Mf}var Bf,Ng;function T1(){if(Ng)return Bf;Ng=1;var y=I1(),_=da(),b=im(),M=Ka();return Bf=function(R){var u=_(R);if(M(u))return 0;var U=y(u,0,255),k=b(U);return U<k+.5?k:U>k+.5?k+1:k%2===0?k:k+1},Bf}var zf,jg;function kx(){return jg||(jg=1,zf=function(_){return _===0&&1/_===-1/0}),zf}var Df,Gg;function A1(){if(Gg)return Df;Gg=1;var y=wc(),_=Ha(),b=Xa(),M=mo(),E=Ka(),R=kx(),u=34028234663852886e22;return Df=function(k,J){if(E(k))return J?[0,0,192,127]:[127,192,0,0];var X;if(k===0)return X=R(k)?128:0,J?[0,0,0,X]:[X,0,0,0];if(y(k)>u||!M(k))return X=k<0?255:127,J?[0,0,128,X]:[X,128,0,0];var ae=k<0?1:0;k=y(k);for(var Y=0;k>=2;)Y+=1,k/=2;for(;k<1;)Y-=1,k*=2;var Te=k-1;Te*=b(2,23)+.5,Te=_(Te),Y+=127,Y<<=23;var be=ae<<31|Y|Te,ke=be&255;be>>=8;var Oe=be&255;be>>=8;var Ve=be&255;be>>=8;var Re=be&255;return J?[ke,Oe,Ve,Re]:[Re,Ve,Oe,ke]},Df}var Rf,Zg;function E1(){if(Zg)return Rf;Zg=1;var y=1075,_=54;return Rf=function(M){var E="";if(M===0)return E;for(var R=y,u,U=0;U<y;U+=1)if(u=M*2,u>=1?(M=u-1,E+="1",R===y&&(R=U)):(M=u,E+="0"),u===1||U-R>_)return E;return E},Rf}var Lf,$g;function P1(){if($g)return Lf;$g=1;var y=Ha();return Lf=function(b){for(var M="",E;b>0;)E=b/2,b=y(E),E===b?M="0"+M:M="1"+M;return M},Lf}var Ff,Wg;function C1(){return Wg||(Wg=1,Ff=Number.isNaN||function(_){return _!==_}),Ff}var Of,Hg;function k1(){if(Hg)return Of;Hg=1;var y=Dr(),_=y("%parseInt%"),b=wc(),M=Ha(),E=mo(),R=kx(),u=dr(),U=u("String.prototype.indexOf"),k=u("String.prototype.slice"),J=E1(),X=P1(),ae=C1(),Y=1023,Te="11111111111",be="00000000000",ke=be+be+be+be+"0000000";return Of=function(Ve,Re){var ve=Ve<0||R(Ve)?"1":"0",Ke,We;if(ae(Ve))Ke=Te,We="1"+ke;else if(!E(Ve))Ke=Te,We="0"+ke;else if(Ve===0)Ke=be,We="0"+ke;else{Ve=b(Ve);var It=M(Ve),we=X(It),Ge=J(Ve-It),Fe;if(we)Ke=we.length-1;else{var tt=U(Ge,"1");tt>-1&&(Fe=tt+1),Ke=-Fe}We=we+Ge,Ke<0?(Ke<=-Y&&(Fe=Y-1),We=k(We,Fe)):We=k(We,1),Ke=k(be+X(Ke+Y),-11),We=k(We+ke+"0",0,52)}for(var kt=ve+Ke+We,Wt=[],St=0;St<8;St++){var Ut=Re?8-St-1:St;Wt[Ut]=_(k(kt,St*8,(St+1)*8),2)}return Wt},Of}var Vf,Xg;function M1(){if(Xg)return Vf;Xg=1;var y=Dr(),_=y("%Number%"),b=y("%BigInt%",!0);return Vf=function(E,R,u){var U=typeof E=="bigint"?b:_;E<0&&(E>>>=0);for(var k=[],J=0;J<R;J++)k[u?J:R-1-J]=_(E&U(255)),E>>=U(8);return k},Vf}var qf,Kg;function B1(){if(Kg)return qf;Kg=1;var y=Ot(),_=fx(),b=c1(),M=p1(),E=g1(),R=_1(),u=x1(),U=b1(),k=w1(),J=S1(),X=T1(),ae=A1(),Y=k1(),Te=M1(),be=Js(),ke={__proto__:null,$INT8:u,$UINT8:J,$UINT8C:X,$INT16:E,$UINT16:U,$INT32:R,$UINT32:k,$BIGINT64:b,$BIGUINT64:M};return qf=function(Ve,Re,ve){if(typeof Ve!="string"||!_(be.size,"$"+Ve))throw new y("Assertion failed: `type` must be a TypedArray element type");if(typeof Re!="number"&&typeof Re!="bigint")throw new y("Assertion failed: `value` must be a Number or a BigInt");if(typeof ve!="boolean")throw new y("Assertion failed: `isLittleEndian` must be a Boolean");if(Ve==="FLOAT32")return ae(Re,ve);if(Ve==="FLOAT64")return Y(Re,ve);var Ke=be.size["$"+Ve],We=ke["$"+Ve],It=We(Re);return Te(It,Ke,ve)},qf}var Uf,Jg;function z1(){return Jg||(Jg=1,Uf=function(_,b){for(var M=0;M<_.length;M+=1)b(_[M],M,_)}),Uf}var Nf,Yg;function D1(){if(Yg)return Nf;Yg=1;var y=Dr(),_=Nn(),b=Ot(),M=Tc(),E=y("%Uint8Array%",!0),R=mx(),u=Ks(),U=B1(),k=Xs(),J=tl(),X=jo(),ae=Js(),Y=vx(),Te=z1();return Nf=function(ke,Oe,Ve,Re,ve,Ke){var We=J(ke);if(!k(ke)&&!We)throw new b("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!M(Oe)||Oe<0)throw new b("Assertion failed: `byteIndex` must be a non-negative integer");if(typeof Ve!="string"||!X(ae.size,"$"+Ve))throw new b("Assertion failed: `type` must be one of "+ae.choices);if(typeof Re!="number"&&typeof Re!="bigint")throw new b("Assertion failed: `value` must be a Number or a BigInt");if(typeof ve!="boolean")throw new b("Assertion failed: `isTypedArray` must be a boolean");if(Ke!=="SEQ-CST"&&Ke!=="UNORDERED"&&Ke!=="INIT")throw new b('Assertion failed: `order` must be `"SEQ-CST"`, `"UNORDERED"`, or `"INIT"`');if(arguments.length>6&&typeof arguments[6]!="boolean")throw new b("Assertion failed: `isLittleEndian` must be a boolean, if present");if(u(ke))throw new b("Assertion failed: ArrayBuffer is detached");if(R(Ve)?typeof Re!="bigint":typeof Re!="number")throw new b("Assertion failed: `value` must be a BigInt if type is ~BIGINT64~ or ~BIGUINT64~, otherwise a Number");var It=ae.size["$"+Ve],we=arguments.length>6?arguments[6]:Y==="little",Ge=U(Ve,Re,we);if(We)throw new _("SharedArrayBuffer is not supported by this implementation");var Fe=new E(ke,Oe,It);Te(Ge,function(tt,kt){Fe[kt]=tt})},Nf}var jf,Qg;function R1(){if(Qg)return jf;Qg=1;var y=da(),_=Ya(),b=Ka(),M=mo();return jf=function(R){var u=y(R);return b(u)||u===0?0:M(u)?_(u):u},jf}var Gf,e_;function nm(){if(e_)return Gf;e_=1;var y=Nn(),_=Ot(),b=Tc(),M=Hs(),E=Js();return Gf=function(u){var U=M(u);if(!U)throw new _("Assertion failed: `O` must be a TypedArray");var k=E.size["$"+E.name["$"+U]];if(!b(k)||k<0)throw new y("Assertion failed: Unknown TypedArray type `"+U+"`");return k},Gf}var Zf,t_;function L1(){if(t_)return Zf;t_=1;var y=Nn(),_=Ot(),b=Hs(),M=Js();return Zf=function(R){var u=b(R);if(!u)throw new _("Assertion failed: `O` must be a TypedArray");var U=M.name["$"+u];if(typeof U!="string")throw new y("Assertion failed: Unknown TypedArray type `"+u+"`");return U},Zf}var dc={exports:{}},$f,r_;function F1(){return r_||(r_=1,$f=Dr()),$f}var Wf,i_;function om(){if(i_)return Wf;i_=1;var y=Ot(),_=jo(),b={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};return Wf=function(E){if(!E||typeof E!="object")return!1;for(var R in E)if(_(E,R)&&!b[R])return!1;var u=_(E,"[[Value]]")||_(E,"[[Writable]]"),U=_(E,"[[Get]]")||_(E,"[[Set]]");if(u&&U)throw new y("Property Descriptors may not be both accessor and data descriptors");return!0},Wf}var Hf,n_;function O1(){if(n_)return Hf;n_=1;var y=Sc(),_=Yu(),b=y.hasArrayLengthDefineBug(),M=b&&dx(),E=dr(),R=E("Object.prototype.propertyIsEnumerable");return Hf=function(U,k,J,X,ae,Y){if(!_){if(!U(Y)||!Y["[[Configurable]]"]||!Y["[[Writable]]"]||ae in X&&R(X,ae)!==!!Y["[[Enumerable]]"])return!1;var Te=Y["[[Value]]"];return X[ae]=Te,k(X[ae],Te)}return b&&ae==="length"&&"[[Value]]"in Y&&M(X)&&X.length!==Y["[[Value]]"]?(X.length=Y["[[Value]]"],X.length===Y["[[Value]]"]):(_(X,ae,J(Y)),!0)},Hf}var Xf,o_;function V1(){return o_||(o_=1,Xf=function(_){if(typeof _>"u")return _;var b={};return"[[Value]]"in _&&(b.value=_["[[Value]]"]),"[[Writable]]"in _&&(b.writable=!!_["[[Writable]]"]),"[[Get]]"in _&&(b.get=_["[[Get]]"]),"[[Set]]"in _&&(b.set=_["[[Set]]"]),"[[Enumerable]]"in _&&(b.enumerable=!!_["[[Enumerable]]"]),"[[Configurable]]"in _&&(b.configurable=!!_["[[Configurable]]"]),b}),Xf}var Kf,a_;function q1(){if(a_)return Kf;a_=1;var y=Ot(),_=om(),b=V1();return Kf=function(E){if(typeof E<"u"&&!_(E))throw new y("Assertion failed: `Desc` must be a Property Descriptor");return b(E)},Kf}var Jf,s_;function U1(){if(s_)return Jf;s_=1;var y=Ot(),_=jo(),b=om();return Jf=function(E){if(typeof E>"u")return!1;if(!b(E))throw new y("Assertion failed: `Desc` must be a Property Descriptor");return!(!_(E,"[[Value]]")&&!_(E,"[[Writable]]"))},Jf}var Yf,u_;function Mx(){return u_||(u_=1,Yf=bc()),Yf}var Qf,l_;function N1(){return l_||(l_=1,Qf=function(_){return!!_}),Qf}var ed,c_;function j1(){if(c_)return ed;c_=1;var y=jo(),_=Ot(),b=fa(),M=Mx(),E=N1();return ed=function(u){if(!b(u))throw new _("ToPropertyDescriptor requires an object");var U={};if(y(u,"enumerable")&&(U["[[Enumerable]]"]=E(u.enumerable)),y(u,"configurable")&&(U["[[Configurable]]"]=E(u.configurable)),y(u,"value")&&(U["[[Value]]"]=u.value),y(u,"writable")&&(U["[[Writable]]"]=E(u.writable)),y(u,"get")){var k=u.get;if(typeof k<"u"&&!M(k))throw new _("getter must be a function");U["[[Get]]"]=k}if(y(u,"set")){var J=u.set;if(typeof J<"u"&&!M(J))throw new _("setter must be a function");U["[[Set]]"]=J}if((y(U,"[[Get]]")||y(U,"[[Set]]"))&&(y(U,"[[Value]]")||y(U,"[[Writable]]")))throw new _("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return U},ed}var td,p_;function G1(){if(p_)return td;p_=1;var y=Ot(),_=fa(),b=om(),M=O1(),E=q1(),R=U1(),u=Ic(),U=gx(),k=j1();return td=function(X,ae,Y){if(!_(X))throw new y("Assertion failed: Type(O) is not Object");if(!u(ae))throw new y("Assertion failed: P is not a Property Key");var Te=b(Y)?Y:k(Y);if(!b(Te))throw new y("Assertion failed: Desc is not a valid Property Descriptor");return M(R,U,E,X,ae,Te)},td}var h_;function Bx(){if(h_)return dc.exports;h_=1;var y=F1(),_=y("%Reflect.construct%",!0),b=G1();try{b({},"",{"[[Get]]":function(){}})}catch{b=null}if(b&&_){var M={},E={};b(E,"length",{"[[Get]]":function(){throw M},"[[Enumerable]]":!0}),dc.exports=function(u){try{_(u,E)}catch(U){return U===M}}}else dc.exports=function(u){return typeof u=="function"&&!!u.prototype};return dc.exports}var rd,f_;function Z1(){if(f_)return rd;f_=1;var y=Dr(),_=y("%Symbol.species%",!0),b=Ot(),M=fa(),E=Bx();return rd=function(u,U){if(!M(u))throw new b("Assertion failed: Type(O) is not Object");var k=u.constructor;if(typeof k>"u")return U;if(!M(k))throw new b("O.constructor is not an Object");var J=_?k[_]:void 0;if(J==null)return U;if(E(J))return J;throw new b("no constructor found")},rd}var id,d_;function zx(){if(d_)return id;d_=1;var y=Ot(),_=dr(),b=_("%ArrayBuffer.prototype.resizable%",!0),M=_("%SharedArrayBuffer.prototype.growable%",!0),E=Xs(),R=tl();return id=function(U){var k=E(U),J=R(U);if(!k&&!J)throw new y("Assertion failed: `arrayBuffer` must be an ArrayBuffer or SharedArrayBuffer");return k&&b?!b(U):J&&M?!M(U):!0},id}var nd,m_;function $1(){return m_||(m_=1,nd=Tc()),nd}var od,y_;function Dx(){if(y_)return od;y_=1;var y=jo(),_=Ys(),b=$1();return od=function(E){return!!E&&typeof E=="object"&&y(E,"[[Object]]")&&y(E,"[[CachedBufferByteLength]]")&&(b(E["[[CachedBufferByteLength]]"])&&E["[[CachedBufferByteLength]]"]>=0||E["[[CachedBufferByteLength]]"]==="DETACHED")&&_(E["[[Object]]"])},od}var ad,v_;function W1(){return v_||(v_=1,ad=fa()),ad}var sd,g_;function H1(){if(g_)return sd;g_=1;var y=dr(),_=y("String.prototype.valueOf"),b=function(U){try{return _(U),!0}catch{return!1}},M=y("Object.prototype.toString"),E="[object String]",R=Go()();return sd=function(U){return typeof U=="string"?!0:!U||typeof U!="object"?!1:R?b(U):M(U)===E},sd}var ud,__;function X1(){if(__)return ud;__=1;var y=dr(),_=y("Number.prototype.toString"),b=function(U){try{return _(U),!0}catch{return!1}},M=y("Object.prototype.toString"),E="[object Number]",R=Go()();return ud=function(U){return typeof U=="number"?!0:!U||typeof U!="object"?!1:R?b(U):M(U)===E},ud}var ld,x_;function K1(){if(x_)return ld;x_=1;var y=dr(),_=y("Boolean.prototype.toString"),b=y("Object.prototype.toString"),M=function(U){try{return _(U),!0}catch{return!1}},E="[object Boolean]",R=Go()();return ld=function(U){return typeof U=="boolean"?!0:U===null||typeof U!="object"?!1:R?M(U):b(U)===E},ld}var mc={exports:{}},cd,b_;function J1(){if(b_)return cd;b_=1;var y=typeof BigInt<"u"&&BigInt;return cd=function(){return typeof y=="function"&&typeof BigInt=="function"&&typeof y(42)=="bigint"&&typeof BigInt(42)=="bigint"},cd}var w_;function Y1(){if(w_)return mc.exports;w_=1;var y=J1()();if(y){var _=BigInt.prototype.valueOf,b=function(E){try{return _.call(E),!0}catch{}return!1};mc.exports=function(E){return E===null||typeof E>"u"||typeof E=="boolean"||typeof E=="string"||typeof E=="number"||typeof E=="symbol"||typeof E=="function"?!1:typeof E=="bigint"?!0:b(E)}}else mc.exports=function(E){return!1};return mc.exports}var pd,S_;function Q1(){if(S_)return pd;S_=1;var y=H1(),_=X1(),b=K1(),M=bx(),E=Y1();return pd=function(u){if(u==null||typeof u!="object"&&typeof u!="function")return null;if(y(u))return"String";if(_(u))return"Number";if(b(u))return"Boolean";if(M(u))return"Symbol";if(E(u))return"BigInt"},pd}var hd,I_;function ew(){if(I_)return hd;I_=1;var y=typeof Map=="function"&&Map.prototype?Map:null,_=typeof Set=="function"&&Set.prototype?Set:null,b;y||(b=function(u){return!1});var M=y?Map.prototype.has:null,E=_?Set.prototype.has:null;return!b&&!M&&(b=function(u){return!1}),hd=b||function(u){if(!u||typeof u!="object")return!1;try{if(M.call(u),E)try{E.call(u)}catch{return!0}return u instanceof y}catch{}return!1},hd}var fd,T_;function tw(){if(T_)return fd;T_=1;var y=typeof Map=="function"&&Map.prototype?Map:null,_=typeof Set=="function"&&Set.prototype?Set:null,b;_||(b=function(u){return!1});var M=y?Map.prototype.has:null,E=_?Set.prototype.has:null;return!b&&!E&&(b=function(u){return!1}),fd=b||function(u){if(!u||typeof u!="object")return!1;try{if(E.call(u),M)try{M.call(u)}catch{return!0}return u instanceof _}catch{}return!1},fd}var dd,A_;function rw(){if(A_)return dd;A_=1;var y=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,_=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,b;y||(b=function(u){return!1});var M=y?y.prototype.has:null,E=_?_.prototype.has:null;return!b&&!M&&(b=function(u){return!1}),dd=b||function(u){if(!u||typeof u!="object")return!1;try{if(M.call(u,M),E)try{E.call(u,E)}catch{return!0}return u instanceof y}catch{}return!1},dd}var yc={exports:{}},E_;function iw(){if(E_)return yc.exports;E_=1;var y=Dr(),_=dr(),b=y("%WeakSet%",!0),M=_("WeakSet.prototype.has",!0);if(M){var E=_("WeakMap.prototype.has",!0);yc.exports=function(u){if(!u||typeof u!="object")return!1;try{if(M(u,M),E)try{E(u,E)}catch{return!0}return u instanceof b}catch{}return!1}}else yc.exports=function(u){return!1};return yc.exports}var md,P_;function nw(){if(P_)return md;P_=1;var y=ew(),_=tw(),b=rw(),M=iw();return md=function(R){if(R&&typeof R=="object"){if(y(R))return"Map";if(_(R))return"Set";if(b(R))return"WeakMap";if(M(R))return"WeakSet"}return!1},md}var yd,C_;function ow(){if(C_)return yd;C_=1;var y=dr(),_=y("WeakRef.prototype.deref",!0);return yd=typeof WeakRef>"u"?function(M){return!1}:function(M){if(!M||typeof M!="object")return!1;try{return _(M),!0}catch{return!1}},yd}var vd,k_;function aw(){if(k_)return vd;k_=1;var y=dr(),_=y("FinalizationRegistry.prototype.register",!0);return vd=_?function(M){if(!M||typeof M!="object")return!1;try{return _(M,{},null),!0}catch{return!1}}:function(M){return!1},vd}var gd,M_;function Rx(){if(M_)return gd;M_=1;var y=function(){return typeof(function(){}).name=="string"},_=Object.getOwnPropertyDescriptor;if(_)try{_([],"length")}catch{_=null}y.functionsHaveConfigurableNames=function(){if(!y()||!_)return!1;var E=_(function(){},"name");return!!E&&!!E.configurable};var b=Function.prototype.bind;return y.boundFunctionsHaveNames=function(){return y()&&typeof b=="function"&&(function(){}).bind().name!==""},gd=y,gd}var _d,B_;function Lx(){if(B_)return _d;B_=1;var y=bc(),_=jo(),b=Rx()(),M=dr(),E=M("Function.prototype.toString"),R=M("String.prototype.match"),u=M("Object.prototype.toString"),U=/^class /,k=function(Ve){if(y(Ve)||typeof Ve!="function")return!1;try{var Re=R(E(Ve),U);return!!Re}catch{}return!1},J=/\s*function\s+([^(\s]*)\s*/,X=!(0 in[,]),ae="[object Object]",Y="[object HTMLAllCollection]",Te=Function.prototype,be=function(){return!1};if(typeof document=="object"){var ke=document.all;u(ke)===u(document.all)&&(be=function(Ve){if((X||!Ve)&&(typeof Ve>"u"||typeof Ve=="object"))try{var Re=u(Ve);return(Re===Y||Re===ae)&&Ve("")==null}catch{}return!1})}return _d=function(){if(be(this)||!k(this)&&!y(this))throw new TypeError("Function.prototype.name sham getter called on non-function");if(b&&_(this,"name"))return this.name;if(this===Te)return"";var Ve=E(this),Re=R(Ve,J),ve=Re&&Re[1];return ve},_d}var xd,z_;function Fx(){if(z_)return xd;z_=1;var y=Lx();return xd=function(){return y},xd}var bd,D_;function sw(){if(D_)return bd;D_=1;var y=el().supportsDescriptors,_=Rx()(),b=Fx(),M=Object.defineProperty,E=TypeError;return bd=function(){var u=b();if(_)return u;if(!y)throw new E("Shimming Function.prototype.name support requires ES5 property descriptor support.");var U=Function.prototype;return M(U,"name",{configurable:!0,enumerable:!1,get:function(){var k=u.call(this);return this!==U&&M(this,"name",{configurable:!0,enumerable:!1,value:k,writable:!1}),k}}),u},bd}var wd,R_;function uw(){if(R_)return wd;R_=1;var y=el(),_=ha(),b=Lx(),M=Fx(),E=sw(),R=_(b);return y(R,{getPolyfill:M,implementation:b,shim:E}),wd=R,wd}var Sd,L_;function lw(){if(L_)return Sd;L_=1;var y=dr(),_=Ac(),b=_(/^\s*(?:function)?\*/),M=Go()(),E=Ja(),R=y("Object.prototype.toString"),u=y("Function.prototype.toString"),U=cx();return Sd=function(J){if(typeof J!="function")return!1;if(b(u(J)))return!0;if(!M){var X=R(J);return X==="[object GeneratorFunction]"}if(!E)return!1;var ae=U();return ae&&E(J)===ae.prototype},Sd}var Id,F_;function cw(){if(F_)return Id;F_=1;var y=dr(),_=Ac(),b=y("Object.prototype.toString"),M=y("Function.prototype.toString"),E=_(/^\s*async(?:\s+function(?:\s+|\()|\s*\()/),R=Go()(),u=Ja(),U=lx();return Id=function(J){if(typeof J!="function")return!1;if(E(M(J)))return!0;if(!R){var X=b(J);return X==="[object AsyncFunction]"}if(!u)return!1;var ae=U();return ae&&ae.prototype===u(J)},Id}var Td,O_;function pw(){if(O_)return Td;O_=1;var y=Q1(),_=nw(),b=Hs(),M=yx(),E=_x(),R=xx(),u=ow(),U=aw(),k=uw(),J=lw(),X=cw(),ae=dr(),Y=Go()(),Te=Y&&Symbol.toStringTag,be=Object,ke=ae("Promise.prototype.then",!0),Oe=function(ve){if(!ve||typeof ve!="object"||!ke)return!1;try{return ke(ve,null,function(){}),!0}catch{}return!1},Ve=function(ve){return!!ve&&ve!=="BigInt"&&ve!=="Boolean"&&ve!=="Null"&&ve!=="Number"&&ve!=="String"&&ve!=="Symbol"&&ve!=="Undefined"&&ve!=="Math"&&ve!=="JSON"&&ve!=="Reflect"&&ve!=="Atomics"&&ve!=="Map"&&ve!=="Set"&&ve!=="WeakMap"&&ve!=="WeakSet"&&ve!=="BigInt64Array"&&ve!=="BigUint64Array"&&ve!=="Float32Array"&&ve!=="Float64Array"&&ve!=="Int16Array"&&ve!=="Int32Array"&&ve!=="Int8Array"&&ve!=="Uint16Array"&&ve!=="Uint32Array"&&ve!=="Uint8Array"&&ve!=="Uint8ClampedArray"&&ve!=="Array"&&ve!=="Date"&&ve!=="FinalizationRegistry"&&ve!=="Promise"&&ve!=="RegExp"&&ve!=="WeakRef"&&ve!=="Function"&&ve!=="GeneratorFunction"&&ve!=="AsyncFunction"};return Td=function(ve){if(ve==null)return ve;var Ke=y(be(ve))||_(ve)||b(ve);if(Ke)return Ke;if(M(ve))return"Array";if(E(ve))return"Date";if(R(ve))return"RegExp";if(u(ve))return"WeakRef";if(U(ve))return"FinalizationRegistry";if(typeof ve=="function")return J(ve)?"GeneratorFunction":X(ve)?"AsyncFunction":"Function";if(Oe(ve))return"Promise";if(Te&&Te in ve){var We=ve[Te];if(Ve(We))return We}if(typeof ve.constructor=="function"){var It=k(ve.constructor);if(Ve(It))return It}return"Object"},Td}var Ad,V_;function hw(){if(V_)return Ad;V_=1;var y=Dr(),_=Mx(),b=W1(),M=pw(),E=Ot(),R=Ja(),u=Wd();return Ad=function(k){if(!b(k))throw new E("Reflect.getPrototypeOf called on non-object");if(R)return R(k);var J=M(k);if(J){var X=y("%"+J+".prototype%",!0);if(X)return X}return _(k.constructor)?k.constructor.prototype:k instanceof Object?u.prototype:null},Ad}var Ed,q_;function Ox(){if(q_)return Ed;q_=1;var y=hw(),_=Ja();return Ed=function(){return typeof Reflect=="object"&&Reflect&&Reflect.getPrototypeOf?Reflect.getPrototypeOf:_?function(E){return _(E)}:y},Ed}var Pd,U_;function am(){if(U_)return Pd;U_=1;var y=$d(),_=ha(),b=Ox()(),M=Ju()(),E={__proto__:null},R=No(),u=Object.defineProperty;if(R){var U=function(X){return X.byteOffset};y(M,function(X){if(typeof wt.commonjsGlobal[X]=="function"||typeof wt.commonjsGlobal[X]=="object"){var ae=wt.commonjsGlobal[X].prototype,Y=R(ae,"byteOffset");if(!Y){var Te=b(ae);Y=R(Te,"byteOffset")}if(Y&&Y.get)E[X]=_(Y.get);else if(u){var be=new wt.commonjsGlobal[X](2);Y=R(be,"byteOffset"),Y&&Y.configurable&&u(be,"length",{value:3}),be.length===2&&(E[X]=U)}}})}var k=function(ae){var Y;return y(E,function(Te){if(typeof Y!="number")try{var be=Te(ae);typeof be=="number"&&(Y=be)}catch{}}),Y},J=Ys();return Pd=function(ae){return J(ae)?k(ae):!1},Pd}var Cd,N_;function Vx(){if(N_)return Cd;N_=1;var y=ha(),_=$d(),b=No(),M=Ys(),E=nx(),R=Ox()(),u={__proto__:null},U=Object.defineProperty;if(b){var k=function(X){return X.length};_(E,function(X){var ae=wt.commonjsGlobal[X];if(typeof ae=="function"||typeof ae=="object"){var Y=ae.prototype,Te=b(Y,"length");if(!Te){var be=R(Y);Te=b(be,"length")}if(Te&&Te.get)u["$"+X]=y(Te.get);else if(U){var ke=new wt.commonjsGlobal[X](2);Te=b(ke,"length"),Te&&Te.configurable&&U(ke,"length",{value:3}),ke.length===2&&(u["$"+X]=k)}}})}var J=function(ae){var Y;return _(u,function(Te){if(typeof Y!="number")try{var be=Te(ae);typeof be=="number"&&(Y=be)}catch{}}),Y};return Cd=function(ae){return M(ae)?J(ae):!1},Cd}var kd,j_;function sm(){if(j_)return kd;j_=1;var y=Ot(),_=Ks(),b=zx(),M=nm(),E=Dx(),R=rl(),u=am(),U=Vx();return kd=function(J){if(!E(J))throw new y("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");var X=J["[[Object]]"],ae=J["[[CachedBufferByteLength]]"];if(_(R(X))&&ae!=="DETACHED")throw new y("Assertion failed: typed array is detached only if the byte length is ~DETACHED~");if(ae==="DETACHED")return!0;var Y=u(X),Te=b(R(X)),be,ke=Te?U(X):"AUTO";if(ke==="AUTO")be=ae;else{var Oe=M(X);be=Y+ke*Oe}return Y>ae||be>ae},kd}var Md,G_;function fw(){if(G_)return Md;G_=1;var y=Ot(),_=im(),b=zx(),M=sm(),E=nm(),R=Dx(),u=rl(),U=am(),k=Vx();return Md=function(X){if(!R(X))throw new y("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");if(M(X))throw new y("Assertion failed: `taRecord` is out of bounds");var ae=X["[[Object]]"],Y=b(u(ae)),Te=Y?k(ae):"AUTO";if(Te!=="AUTO")return Te;if(Y)throw new y("Assertion failed: array buffer is not fixed length");var be=U(ae),ke=E(ae),Oe=X["[[CachedBufferByteLength]]"];if(Oe==="DETACHED")throw new y("Assertion failed: typed array is detached");return _((Oe-be)/ke)},Md}var Bd,Z_;function dw(){if(Z_)return Bd;Z_=1;var y=Ot(),_=Ks(),b=Xs(),M=tl(),E=hx(),R=dr(),u=R("SharedArrayBuffer.prototype.byteLength",!0);return Bd=function(k,J){var X=M(k);if(!b(k)&&!X)throw new y("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(J!=="SEQ-CST"&&J!=="UNORDERED")throw new y("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if(_(k))throw new y("Assertion failed: `arrayBuffer` must not be detached");return X?u(k):E(k)},Bd}var zd,$_;function mw(){if($_)return zd;$_=1;var y=Ot(),_=dw(),b=Ks(),M=Ys(),E=rl();return zd=function(u,U){if(!M(u))throw new y("Assertion failed: `obj` must be a Typed Array");if(U!=="SEQ-CST"&&U!=="UNORDERED")throw new y("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");var k=E(u),J=b(k)?"DETACHED":_(k,U);return{"[[Object]]":u,"[[CachedBufferByteLength]]":J}},zd}var Dd,W_;function qx(){if(W_)return Dd;W_=1;var y=Ot(),_=fa(),b=sm(),M=mw(),E=Ys();return Dd=function(u,U){if(U!=="SEQ-CST"&&U!=="UNORDERED")throw new y("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if(!_(u))throw new y("Assertion failed: `O` must be an Object");if(!E(u))throw new y("Assertion failed: `O` must be a Typed Array");var k=M(u,U);if(b(k))throw new y("`O` must be in-bounds and backed by a non-detached buffer");return k},Dd}var Rd,H_;function yw(){if(H_)return Rd;H_=1;var y=Nn(),_=Ot(),b=rm(),M=Bx(),E=sm(),R=fw(),u=qx(),U=Ju()();return Rd=function(J,X){if(!M(J))throw new _("Assertion failed: `constructor` must be a constructor");if(!b(X))throw new _("Assertion failed: `argumentList` must be a List");if(U.length===0)throw new y("Assertion failed: Typed Arrays are not supported in this environment");var ae;X.length===0?ae=new J:X.length===1?ae=new J(X[0]):X.length===2?ae=new J(X[0],X[1]):ae=new J(X[0],X[1],X[2]);var Y=u(ae,"SEQ-CST");if(X.length===1&&typeof X[0]=="number"){if(E(Y))throw new _("new Typed Array is out of bounds");var Te=R(Y);if(Te<X[0])throw new _("`argumentList[0]` must be <= `newTypedArray.length`")}return ae},Rd}var Ld,X_;function vw(){if(X_)return Ld;X_=1;var y=Dr(),_={__proto__:null,$Int8Array:y("%Int8Array%",!0),$Uint8Array:y("%Uint8Array%",!0),$Uint8ClampedArray:y("%Uint8ClampedArray%",!0),$Int16Array:y("%Int16Array%",!0),$Uint16Array:y("%Uint16Array%",!0),$Int32Array:y("%Int32Array%",!0),$Uint32Array:y("%Uint32Array%",!0),$BigInt64Array:y("%BigInt64Array%",!0),$BigUint64Array:y("%BigUint64Array%",!0),$Float16Array:y("%Float16Array%",!0),$Float32Array:y("%Float32Array%",!0),$Float64Array:y("%Float64Array%",!0)};return Ld=function(M){return _["$"+M]},Ld}var Fd,K_;function gw(){if(K_)return Fd;K_=1;var y=Nn(),_=Ot(),b=Hs(),M=Ju()(),E=rm(),R=Z1(),u=yw(),U=vw();return Fd=function(J,X){if(M.length===0)throw new y("Assertion failed: Typed Arrays are not supported in this environment");var ae=b(J);if(!ae)throw new _("Assertion failed: exemplar must be a TypedArray");if(!E(X))throw new _("Assertion failed: `argumentList` must be a List");var Y=U(ae);if(typeof Y!="function")throw new y("Assertion failed: `constructor` of `exemplar` ("+ae+") must exist. Please report this!");var Te=R(J,Y);return u(Te,X)},Fd}var Od,J_;function Ux(){if(J_)return Od;J_=1;var y=Ot(),_=K0(),b=o1(),M=Ks(),E=Xd(),R=Kd(),u=a1(),U=D1(),k=R1(),J=Ex(),X=nm(),ae=L1(),Y=gw(),Te=qx(),be=rl(),ke=am();return Od=function(Ve,Re){var ve=this;Te(ve,"SEQ-CST");var Ke=ve.length,We=k(Ve),It;We===-1/0?It=0:We<0?It=E(Ke+We,0):It=R(We,Ke);var we=typeof Re>"u"?Ke:k(Re),Ge;we===-1/0?Ge=0:we<0?Ge=E(Ke+we,0):Ge=R(we,Ke);var Fe=E(Ge-It,0),tt=Y(ve,[Fe]);if(Fe>0){if(M(be(ve)))throw new y("Cannot use a Typed Array with an underlying ArrayBuffer that is detached");var kt=ae(ve),Wt=ae(tt);if(kt===Wt)for(var St=be(ve),Ut=be(tt),Hr=X(ve),Er=ke(ve),bi=It*Hr+Er,or=ke(tt),Rr=or+Fe*Hr;or<Rr;){var et=b(St,bi,"UINT8",!0,"UNORDERED");U(Ut,or,"UINT8",et,!0,"UNORDERED"),bi+=1,or+=1}else for(var Lr=0;It<Ge;){var Xr=J(It),At=_(ve,Xr);u(tt,J(Lr),At,!0),It+=1,Lr+=1}}return tt},Od}var Vd,Y_;function Nx(){if(Y_)return Vd;Y_=1;var y=Ux();return Vd=function(){return typeof Uint8Array=="function"&&Uint8Array.prototype.slice||y},Vd}var qd,Q_;function _w(){if(Q_)return qd;Q_=1;var y=el(),_=Ja(),b=Nx();return qd=function(){if(typeof Uint8Array=="function"){var E=b(),R=_(Uint8Array.prototype);y(R,{slice:E},{slice:function(){return R.slice!==E}})}return E},qd}var Ud,ex;function xw(){if(ex)return Ud;ex=1;var y=el(),_=ha(),b=Ux(),M=Nx(),E=_w(),R=_(M());return y(R,{getPolyfill:M,implementation:b,shim:E}),Ud=R,Ud}var Nd,tx;function bw(){if(tx)return Nd;tx=1;var y=Hs(),_=xw(),b=No();function M(we){return Object.prototype.toString.call(we)}function E(we){return M(we)==="[object Date]"}function R(we){return M(we)==="[object RegExp]"}function u(we){return M(we)==="[object Error]"}function U(we){return M(we)==="[object Boolean]"}function k(we){return M(we)==="[object Number]"}function J(we){return M(we)==="[object String]"}var X=Array.isArray||function(Ge){return Object.prototype.toString.call(Ge)==="[object Array]"};function ae(we,Ge){if(we.forEach)return we.forEach(Ge);for(var Fe=0;Fe<we.length;Fe++)Ge(we[Fe],Fe,we)}var Y=Object.keys||function(Ge){var Fe=[];for(var tt in Ge)Fe[Fe.length]=tt;return Fe},Te=Object.prototype.propertyIsEnumerable,be=Object.getOwnPropertySymbols;function ke(we){var Ge=Y(we);if(be)for(var Fe=be(we),tt=0;tt<Fe.length;tt++)Te.call(we,Fe[tt])&&(Ge[Ge.length]=Fe[tt]);return Ge}var Oe=Object.prototype.hasOwnProperty||function(we,Ge){return Ge in we};function Ve(we,Ge){if(typeof b!="function")return!0;var Fe=b(we,Ge);return!Fe||!Fe.writable}function Re(we,Ge){if(typeof we=="object"&&we!==null){var Fe;if(X(we))Fe=[];else if(E(we))Fe=new Date(we.getTime?we.getTime():we);else if(R(we))Fe=new RegExp(we);else if(u(we))Fe={message:we.message};else if(U(we)||k(we)||J(we))Fe=Object(we);else{var tt=y(we);if(tt)return _(we);if(Object.create&&Object.getPrototypeOf)Fe=Object.create(Object.getPrototypeOf(we));else if(we.constructor===Object)Fe={};else{var kt=we.constructor&&we.constructor.prototype||we.__proto__||{},Wt=function(){};Wt.prototype=kt,Fe=new Wt}}var St=Ge.includeSymbols?ke:Y;return ae(St(we),function(Ut){Fe[Ut]=we[Ut]}),Fe}return we}var ve={__proto__:null};function Ke(we,Ge){var Fe=[],tt=[],kt=!0,Wt=arguments.length>2?arguments[2]:ve,St=Wt.includeSymbols?ke:Y,Ut=!!Wt.immutable;return(function Hr(Er){var bi=Ut?Re(Er,Wt):Er,or={__proto__:null},Rr=!0,et={node:bi,node_:Er,path:[].concat(Fe),parent:tt[tt.length-1],parents:tt,key:Fe[Fe.length-1],removedKeys:{__proto__:null},isRoot:Fe.length===0,level:Fe.length,circular:null,update:function(At,Fr){et.isRoot||(et.parent.node[et.key]=At),et.node=At,Fr&&(Rr=!1)},delete:function(At){delete et.parent.node[et.key],et.parent.removedKeys[et.key]=!0,At&&(Rr=!1)},remove:function(At){X(et.parent.node)?(et.parent.node.splice(et.key,1),et.parent.removedKeys[et.key]=!0,At&&(Rr=!1)):et.delete(At)},keys:null,before:function(At){or.before=At},after:function(At){or.after=At},pre:function(At){or.pre=At},post:function(At){or.post=At},stop:function(){kt=!1},block:function(){Rr=!1}};if(!kt)return et;function Lr(){if(typeof et.node=="object"&&et.node!==null){(!et.keys||et.node_!==et.node)&&(et.keys=St(et.node)),et.isLeaf=et.keys.length===0;for(var At=0;At<tt.length;At++)if(tt[At].node_===Er){et.circular=tt[At];break}}else et.isLeaf=!0,et.keys=null;et.notLeaf=!et.isLeaf,et.notRoot=!et.isRoot}Lr();var Xr=Ge.call(et,et.node);return Xr!==void 0&&et.update&&et.update(Xr),or.before&&or.before.call(et,et.node),Rr&&(typeof et.node=="object"&&et.node!==null&&!et.circular&&(tt[tt.length]=et,Lr(),ae(et.keys,function(At,Fr){var Mi=Fr-1 in et.removedKeys;Mi&&(At=et.keys[Fr-1]),Fe[Fe.length]=At,or.pre&&or.pre.call(et,et.node[At],At);var pi=Hr(et.node[At]);Ut&&Oe.call(et.node,At)&&!Ve(et.node,At)&&!Mi&&(et.node[At]=pi.node),pi.isLast=Fr===et.keys.length-1,pi.isFirst=Fr===0,or.post&&or.post.call(et,pi),Fe.pop()}),tt.pop()),or.after&&or.after.call(et,et.node)),et})(we).node}function We(we){this.options=arguments.length>1?arguments[1]:ve,this.value=we}We.prototype.get=function(we){for(var Ge=this.value,Fe=0;Ge&&Fe<we.length;Fe++){var tt=we[Fe];if(!Oe.call(Ge,tt)||!this.options.includeSymbols&&typeof tt=="symbol")return;Ge=Ge[tt]}return Ge},We.prototype.has=function(we){var Ge=this.value;if(!Ge&&we.length>0)return!1;for(var Fe=0;Ge&&Fe<we.length;Fe++){var tt=we[Fe];if(!Oe.call(Ge,tt)||!this.options.includeSymbols&&typeof tt=="symbol")return!1;Ge=Ge[tt]}return!0},We.prototype.set=function(we,Ge){for(var Fe=this.value,tt=0;tt<we.length-1;tt++){var kt=we[tt];Oe.call(Fe,kt)||(Fe[kt]={}),Fe=Fe[kt]}return Fe[we[tt]]=Ge,Ge},We.prototype.map=function(we){return Ke(this.value,we,{__proto__:null,immutable:!0,includeSymbols:!!this.options.includeSymbols})},We.prototype.forEach=function(we){return this.value=Ke(this.value,we,this.options),this.value},We.prototype.reduce=function(we,Ge){var Fe=arguments.length===1,tt=Fe?this.value:Ge;return this.forEach(function(kt){(!this.isRoot||!Fe)&&(tt=we.call(this,tt,kt))}),tt},We.prototype.paths=function(){var we=[];return this.forEach(function(){we[we.length]=this.path}),we},We.prototype.nodes=function(){var we=[];return this.forEach(function(){we[we.length]=this.node}),we},We.prototype.clone=function(){var we=[],Ge=[],Fe=this.options;return y(this.value)?_(this.value):(function tt(kt){for(var Wt=0;Wt<we.length;Wt++)if(we[Wt]===kt)return Ge[Wt];if(typeof kt=="object"&&kt!==null){var St=Re(kt,Fe);we[we.length]=kt,Ge[Ge.length]=St;var Ut=Fe.includeSymbols?ke:Y;return ae(Ut(kt),function(Hr){St[Hr]=tt(kt[Hr])}),we.pop(),Ge.pop(),St}return kt})(this.value)};function It(we){var Ge=arguments.length>1?arguments[1]:ve;return new We(we,Ge)}return ae(ke(We.prototype),function(we){It[we]=function(Ge){var Fe=[].slice.call(arguments,1),tt=new We(Ge);return tt[we].apply(tt,Fe)}}),Nd=It,Nd}var jd,rx;function ww(){if(rx)return jd;rx=1,jd=y;function y(_){if(!(this instanceof y))return new y(_);this._bbox=_||[1/0,1/0,-1/0,-1/0],this._valid=!!_}return y.prototype.include=function(_){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],_[0]),this._bbox[1]=Math.min(this._bbox[1],_[1]),this._bbox[2]=Math.max(this._bbox[2],_[0]),this._bbox[3]=Math.max(this._bbox[3],_[1]),this},y.prototype.equals=function(_){var b;return _ instanceof y?b=_.bbox():b=_,this._bbox[0]==b[0]&&this._bbox[1]==b[1]&&this._bbox[2]==b[2]&&this._bbox[3]==b[3]},y.prototype.center=function(_){return this._valid?[(this._bbox[0]+this._bbox[2])/2,(this._bbox[1]+this._bbox[3])/2]:null},y.prototype.union=function(_){this._valid=!0;var b;return _ instanceof y?b=_.bbox():b=_,this._bbox[0]=Math.min(this._bbox[0],b[0]),this._bbox[1]=Math.min(this._bbox[1],b[1]),this._bbox[2]=Math.max(this._bbox[2],b[2]),this._bbox[3]=Math.max(this._bbox[3],b[3]),this},y.prototype.bbox=function(){return this._valid?this._bbox:null},y.prototype.contains=function(_){if(!_)return this._fastContains();if(!this._valid)return null;var b=_[0],M=_[1];return this._bbox[0]<=b&&this._bbox[1]<=M&&this._bbox[2]>=b&&this._bbox[3]>=M},y.prototype.intersect=function(_){if(!this._valid)return null;var b;return _ instanceof y?b=_.bbox():b=_,!(this._bbox[0]>b[2]||this._bbox[2]<b[0]||this._bbox[3]<b[1]||this._bbox[1]>b[3])},y.prototype._fastContains=function(){if(!this._valid)return new Function("return null;");var _="return "+this._bbox[0]+"<= ll[0] &&"+this._bbox[1]+"<= ll[1] &&"+this._bbox[2]+">= ll[0] &&"+this._bbox[3]+">= ll[1]";return new Function("ll",_)},y.prototype.polygon=function(){return this._valid?{type:"Polygon",coordinates:[[[this._bbox[0],this._bbox[1]],[this._bbox[2],this._bbox[1]],[this._bbox[2],this._bbox[3]],[this._bbox[0],this._bbox[3]],[this._bbox[0],this._bbox[1]]]]}:null},jd}var ix;function Sw(){if(ix)return Ku.exports;ix=1;var y=k0(),_=bw(),b=ww(),M={features:["FeatureCollection"],coordinates:["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],geometry:["Feature"],geometries:["GeometryCollection"]},E=Object.keys(M);Ku.exports=function(u){return R(u).bbox()},Ku.exports.polygon=function(u){return R(u).polygon()},Ku.exports.bboxify=function(u){return _(u).map(function(U){if(U){var k=E.some(function(J){return U[J]?M[J].indexOf(U.type)!==-1:!1});k&&(U.bbox=R(U).bbox(),this.update(U))}})};function R(u){for(var U=b(),k=y(u),J=0;J<k.length;J++)U.include(k[J]);return U}return Ku.exports}var Iw=Sw();const Tw=wt.getDefaultExportFromCjs(Iw),Aw={methods:{getIconDetails(y){const _={};switch(y){case"cities":_.name="fa-regular fa-city";break;case"towns":_.name="fa-regular fa-house-chimney-window";break;case"islands":_.name="fa-regular fa-ship";break;case"regions":_.name="fa-regular fa-map-location-dot";break;case"national-parks":_.name="fa-kit fa-vs-icon-national-park";break;case"acco":_.name="fa-regular fa-bed";break;case"acti":_.name="fa-regular fa-person-walking";break;case"attr":_.name="fa-regular fa-camera";break;case"even":_.name="fa-regular fa-ticket";break;case"cate":_.name="fa-regular fa-utensils";break;case"reta":_.name="fa-regular fa-bag-shopping";break;case"featured":_.name="fa-solid fa-star";break;case"twnv":_.name="";break;case"vics":_.name="fa-kit fa-vs-icentre-information";break;case"outlander-castle":_.name="fa-regular fa-chess-rook";break;case"outlander-church-abbey":_.name="fa-regular fa-church";break;case"outlander-city-town-village":_.name="fa-regular fa-city";break;case"outlander-heritage":_.name="fa-regular fa-landmark";break;case"outlander-landscape-park":_.name="fa-regular fa-mountain";break;case"outlander-palace-house":_.name="fa-regular fa-crown";break;case"distilleries":_.name="fa-kit fa-vs-distillery";break;case"itinerary-stop":_.name="";break}return _}}},Ew={name:"VsMapMarkerIcon",status:"prototype",release:"0.0.1",components:{VsIcon:wt.VsIcon},mixins:[Aw],props:{id:{type:String,required:!0},isHovered:{type:Boolean,default:!1},number:{type:String,default:""},isMapMarker:{type:Boolean,default:!1}},computed:{mapMarkerType(){let y="fa-solid fa-location-pin";return this.id==="twnv"&&(y="fa-solid fa-location-dot"),y},parentClasses(){return this.isMapMarker?"vs-map-marker-icon--map-marker":""},markerClasses(){return[`vs-map-marker-icon__marker--${this.id}`,this.isHovered?"vs-map-marker-icon__marker--outline":""]}}},Pw={key:0,class:"vs-map-marker-icon__count"};function Cw(y,_,b,M,E,R){const u=q.resolveComponent("VsIcon");return q.openBlock(),q.createElementBlock("div",{"data-test":"vs-map-marker-icon",class:q.normalizeClass(["vs-map-marker-icon",R.parentClasses])},[q.createVNode(u,{icon:R.mapMarkerType,class:q.normalizeClass(["vs-map-marker-icon__marker",R.markerClasses]),size:"xl"},null,8,["icon","class"]),b.number?(q.openBlock(),q.createElementBlock("span",Pw,[_[0]||(_[0]=q.createElementVNode("span",{class:"visually-hidden"}," Stop ",-1)),q.createTextVNode(" "+q.toDisplayString(b.number),1)])):(q.openBlock(),q.createBlock(u,{key:1,class:"vs-map-marker-icon__icon",icon:y.getIconDetails(b.id).name,size:"xs"},null,8,["icon"]))],2)}const Ec=wt._export_sfc(Ew,[["render",Cw]]);let $a=null;const kw={name:"VsMapMarker",status:"prototype",release:"0.0.1",components:{VsMapMarkerIcon:Ec},props:{feature:{type:Object,required:!0},mapId:{type:String,required:!0},hasPopups:{type:Boolean,required:!0},selectedPlace:{type:String,default:null}},emits:["showDetail","setCategory"],setup(){$a=Sn()},computed:{isActive(){return!!(this.activePlace&&this.activePlace.properties&&this.activePlace.properties.id===this.feature.properties.id||this.highlightedPlace&&this.highlightedPlace.properties&&this.highlightedPlace.properties.id===this.feature.properties.id)},...pa.mapState(Sn,{highlightedPlace(y){return y.getHoveredStop(this.mapId)},activePlace(y){return y.getActivePlace(this.mapId)?y.getActivePlace(this.mapId):""},activeSubcat(y){return y.selectedSubCategory}}),getMarkerIcon(){let y;return this.feature.properties.type!==""?y=this.feature.properties.type:this.activeSubcat!==null?y=this.activeSubcat:y="featured",y==="null"&&(y=""),y}},watch:{isActive(){return this.activePlace&&this.activePlace.properties.id===this.feature.properties.id||this.highlightedPlace&&this.highlightedPlace.properties.id===this.feature.properties.id?!0:(this.activePlace&&this.activePlace.properties.id===this.feature.properties.id&&$a.setActiveMarkerPos(this.feature.geometry.coordinates),!1)},activePlace(){this.activePlace&&this.activePlace.properties.id===this.feature.properties.id&&$a.setActiveMarkerPos(this.feature.geometry.coordinates)}},mounted(){this.hasPopups&&document.body.addEventListener("click",this.handleClickEvent)},beforeUnmount(){document.body.removeEventListener("click",this.handleClickEvent)},methods:{markerClick(){$a.setActiveMarkerPos(this.feature.geometry.coordinates),$a.setActivePlace({mapId:this.mapId,activeFeature:this.feature}),this.$emit("showDetail",this.feature),this.$emit("setCategory",this.feature.properties.type)},handleHover(y){$a.setHoveredPlace({mapId:this.mapId,hoveredFeature:y})},handleClickEvent(y){const _=document.getElementsByClassName("mapboxgl-canvas");y.target===_[0]&&$a.setActivePlace({mapId:this.mapId,activeFeature:null})}}},Mw=["aria-label"];function Bw(y,_,b,M,E,R){const u=q.resolveComponent("VsMapMarkerIcon");return q.openBlock(),q.createElementBlock("button",{type:"button",class:q.normalizeClass(["vs-map-marker",R.isActive?"vs-map-marker--active":""]),"data-test":"vs-map-marker",onClick:_[0]||(_[0]=(...U)=>R.markerClick&&R.markerClick(...U)),onKeydown:_[1]||(_[1]=q.withKeys((...U)=>R.markerClick&&R.markerClick(...U),["enter"])),onMouseover:_[2]||(_[2]=U=>R.handleHover(b.feature)),onMouseleave:_[3]||(_[3]=U=>R.handleHover("")),onFocusin:_[4]||(_[4]=U=>R.handleHover(b.feature)),onFocusout:_[5]||(_[5]=U=>R.handleHover("")),"aria-label":R.getMarkerIcon},[q.createVNode(u,{id:R.getMarkerIcon,"is-map-marker":!0,number:b.feature.properties.stopCount?b.feature.properties.stopCount:""},null,8,["id","number"])],42,Mw)}const jx=wt._export_sfc(kw,[["render",Bw]]);let Ws=null;const zw={name:"VsMap",status:"prototype",release:"0.0.1",components:{VsWarning:wt.VsWarning,VsLoading:wt.VsLoading},props:{overviewMapLatitude:{type:String,default:"57.81"},overviewMapLongitude:{type:String,default:"-5.51748"},overviewMapZoom:{type:String,default:"5"},mapId:{type:String,required:!0},isVisible:{type:Boolean,required:!0},places:{type:Array,required:!0},filters:{type:Array,default(){return[]}},fitToMarkers:{type:Boolean,default:!1},showPolygons:{type:Boolean,default:!1},selectedItem:{type:Object,default:null},boundsData:{type:Object,default:()=>{}},showInfoMessage:{type:Boolean,default:null},resetZoom:{type:Boolean,default:!1},showMarkerPopups:{type:Boolean,default:!0},loadBrandingImmediately:{type:Boolean,default:!1}},emits:["map-ready","setCategory","showDetail","zoom-reset"],setup(){Ws=Sn()},data(){return{isDesktop:!1,geojsonData:{type:"FeatureCollection",features:[]},polygons:{type:"FeatureCollection",features:[]},multiPolygons:[],mapbox:{map:null,bounds:null,rotation:0,config:{container:this.$refs.mapbox,style:"https://api.visitscotland.com/maps/vector/v1/vts/resources/styles",pitchWithRotate:!1,dragRotate:!1}},markers:[],popup:null,hoveredStateId:null,activeStateId:null,showMapMessage:!0,isLoading:!0,showZoomMessage:null}},computed:{getZoom(){return this.mapbox.map?this.mapbox.map.getZoom():null},...pa.mapState(Sn,{activeMarkerPostion(y){return this.mapbox.map?y.activeMarkerPos:null},highlightedPlace(y){return this.mapbox.map?y.getHoveredStop(this.mapId):null},activePlace(y){return this.mapbox.map?y.getActivePlace(this.mapId):null}})},watch:{isVisible(y){y&&this.mapbox.map!==null&&setTimeout(()=>{this.mapbox.map.resize()},20)},places:{handler(){this.geojsonData.features=[],this.initialiseMapFeatures(),this.initialiseMapMarkers()},deep:!0},showPolygons(y){y===!0?this.showMapPolygons():this.hideMapPolygons()},highlightedPlace(y){y&&(y.length===0?this.removeHoveredPolygon():y.geometry.type!=="Point"&&this.addHoveredPolygon(y))},selectedItem(y){if(y&&y.geometry.type!=="Point"){let _=[];_=this.polygons.features.filter(b=>b.properties.id===y.properties.id),_.length>0&&this.addActivePolygon(y)}y||this.removeActivePolygon()},activeMarkerPostion(y){this.checkPointIsVisible(y)||this.centreMapOnPoint(y)},showInfoMessage(y){y?this.showMapMessage=!0:this.showMapMessage=!1},resetZoom(y){y&&(this.mapbox.map.fitBounds(this.calculateBoundingBox()),this.$emit("zoom-reset"),this.showInfoMessage&&(this.showMapMessage=!0))}},mounted(){Ws.addMapInstance({id:this.mapId,filters:this.filters,places:this.places,activePins:this.places}),this.lazyloadMapComponent(),this.isTablet=window.innerWidth>=768,window.addEventListener("resize",this.onResize),this.loadBrandingImmediately?Py.init({div:this.mapId}):window.addEventListener("DOMContentLoaded",()=>{Py.init({div:this.mapId})})},methods:{addMap(){const y=this.calculateBoundingBox();this.mapbox.config.container=this.$refs.mapbox,this.mapbox.map=new fo.Map({container:this.$refs.mapbox,style:"https://api.visitscotland.com/maps/vector/v1/vts/resources/styles",bounds:y,maxZoom:18,minZoom:4,trackResize:!0}),this.mapbox.map.scrollZoom.disable(),this.mapbox.map.on("rotate",()=>{this.mapbox.rotation=this.mapbox.map.transform.angle}),this.mapbox.map.resize(),this.mapbox.map.on("load",()=>{this.addMapPolygons(),this.showMapMessage=!1,this.isLoading=!1,this.$emit("map-ready",!0),this.mapbox.map.boxZoom.enable()}),this.mapbox.map.on("zoomend",()=>{this.mapbox.map.getZoom()===4?(this.showZoomMessage="too-far",this.showMapMessage=!0):this.mapbox.map.getZoom()===18?(this.showZoomMessage="too-close",this.showMapMessage=!0):this.showInfoMessage||(this.showZoomMessage=null,this.showMapMessage=!1)})},addMapControls(){const y=new fo.NavigationControl;this.mapbox.map.addControl(y,"top-right"),this.mapbox.map.addControl(new fo.FullscreenControl)},initialiseMapFeatures(){this.places.map(y=>{if(typeof y.geometry<"u"){const _=this.getCoordinateArray(y);return this.getMapFeatures(y,_)}return y.latitude&&y.longitude?this.getItineraryMapFeatures(y):!1})},getCoordinateArray(y){return y.geometry.type==="Polygon"?[y.geometry.coordinates[0]]:y.geometry.type==="MultiPolygon"?[y.geometry.coordinates]:[y.geometry.coordinates[0],y.geometry.coordinates[1]]},getMapFeatures(y,_){return this.geojsonData.features.push({type:"Feature",geometry:{type:y.geometry.type,coordinates:_},properties:{title:y.properties.title,imageSrc:y.image,type:typeof y.properties.category<"u"?y.properties.category.id:"",id:y.properties.id},id:y.properties.id})},getItineraryMapFeatures(y){const _=this._uid;return this.geojsonData.features.push({type:"Feature",geometry:{type:"Point",coordinates:[parseFloat(y.longitude),parseFloat(y.latitude)]},properties:{title:y.title,imageSrc:y.imageSrc,type:"itinerary-stop",stopCount:y.stopCount,id:_},id:_})},initialiseMapMarkers(){let y=0;this.initialLoad&&(y=1e3),setTimeout(()=>{if(this.markers!==null){for(let _=this.markers.length-1;_>=0;_--)this.markers[_].remove();this.markers=[]}this.geojsonData.features.forEach(_=>{_.geometry.type==="Point"&&this.createMapMarker(_)})},y)},createMapMarker(y){const _=q.h(jx,{feature:y,mapId:this.mapId,hasPopups:this.showMarkerPopups,onShowDetail:E=>{this.$emit("showDetail",E)},onSetCategory:E=>{this.$emit("setCategory",E)}}),b=document.createElement("div");this.$refs.mapboxOuter.appendChild(b),q.render(_,b),y&&this.showMarkerPopups&&this.addMapPopup(y);const M=new fo.Marker(b.children[0]).setLngLat(y.geometry.coordinates).setPopup(this.popup).addTo(this.mapbox.map);this.setupMarkerListeners(M),this.markers.push(M),b.remove()},hideMapPolygons(){this.mapbox.map.setLayoutProperty("regionFills","visibility","none"),this.mapbox.map.setLayoutProperty("regionBorders","visibility","none")},showMapPolygons(){this.mapbox.map.setLayoutProperty("regionFills","visibility","visible"),this.mapbox.map.setLayoutProperty("regionBorders","visibility","visible")},addMapPolygons(){this.geojsonData.features.forEach(y=>{y.geometry.type==="Polygon"?this.polygons.features.includes(y.properties.id)||this.polygons.features.push(y):y.geometry.type==="MultiPolygon"&&(this.polygons.features.includes(y.properties.id)||this.multiPolygons.push(y))}),this.multiPolygons.forEach(y=>{const _=y.properties;y.geometry.coordinates[0].forEach(b=>{this.polygons.features.push({geometry:{type:"Polygon",coordinates:b},id:_.id,properties:{id:_.id,imageSrc:_.imageSrc,title:_.title,type:_.type},type:"Feature"})})}),this.polygons.features.length>0&&(this.mapbox.map.addSource("regions",{type:"geojson",data:this.polygons,promoteId:"id"}),this.mapbox.map.addLayer({id:"regionFills",type:"fill",source:"regions",layout:{},paint:{"fill-color":["case",["==",["feature-state","interaction-state"],"hover"],"rgba(168,48,140,0.5)",["==",["feature-state","interaction-state"],"active"],"rgba(168,48,140,0.5)","rgba(25,200,197,0.6)"],"fill-opacity":.8}}),this.mapbox.map.addLayer({id:"regionBorders",type:"line",source:"regions",layout:{},paint:{"line-color":"#fff","line-width":1}}),this.hideMapPolygons(),this.mapbox.map.on("mousemove","regionFills",y=>{y.features.length>0&&(this.addMapPopup(y),this.removeHoveredPolygon(),this.addHoveredPolygon(y.features[0]))}),this.mapbox.map.on("mouseleave","regionFills",y=>{this.removeMapPopup(y),this.removeHoveredPolygon()}),this.mapbox.map.on("click","regionFills",y=>{this.removeActivePolygon(),this.addActivePolygon(y.features[0]),this.addMapPopup(y.features[0])}))},removeActivePolygon(){this.mapbox.map.style._layers.regionFills&&(this.mapbox.map.setFeatureState({source:"regions",id:this.activeStateId},{"interaction-state":""}),this.activeStateId=null)},addActivePolygon(y){this.activeStateId=y.properties.id,this.mapbox.map.setFeatureState({source:"regions",id:this.activeStateId},{"interaction-state":"active"}),Ws.setActivePlace({mapId:this.mapId,activeFeature:y}),this.$emit("showDetail",y),this.$emit("setCategory","regions")},removeHoveredPolygon(){if(this.hoveredStateId){let y="";this.hoveredStateId===this.activeStateId&&(y="active"),this.mapbox.map.setFeatureState({source:"regions",id:this.hoveredStateId},{"interaction-state":y})}Ws.setHoveredPlace({mapId:this.mapId,hoveredFeature:""}),this.hoveredStateId=null},addHoveredPolygon(y){this.hoveredStateId=y.properties.id,this.mapbox.map.setFeatureState({source:"regions",id:this.hoveredStateId},{"interaction-state":"hover"}),this.addMapPopup(y),Ws.setHoveredPlace({mapId:this.mapId,hoveredFeature:y})},addMapPopup(y){let _="";y.features?_=y.features[0]:_=y;const b=this.getCoordinates(_),M=this.getPopupHtml(_);_.properties.id&&(this.removeMapPopup(y),this.popup=new fo.Popup({closeButton:!1,offset:{top:[0,20],bottom:[0,-40],left:[30,-20],right:[-30,-20]}}).setLngLat(b).setHTML(M).addTo(this.mapbox.map))},removeMapPopup(y){this.popup&&(this.popup.remove(),this.popup=null),y._popup&&y._popup.remove()},getCoordinates(y){return y.geometry.type==="Polygon"?this.findFeatureCentre(y.geometry.coordinates):y.geometry.type==="MultiPolygon"?this.findFeatureCentre(y.geometry.coordinates[0]):y.geometry.coordinates},findFeatureCentre(y){const _=[],b=[];return y[0].forEach(M=>{_.push(M[1]),b.push(M[0])}),{lat:(Math.min(..._)+Math.max(..._))/2,lng:(Math.min(...b)+Math.max(...b))/2}},getPopupHtml(y){return y.properties.imageSrc&&y.properties.stopCount?`
497
+ `),ue=d.createShader(d.FRAGMENT_SHADER);if(d.isContextLost())this.failedToCreate=!0;else{d.shaderSource(ue,Q),d.compileShader(ue),d.attachShader(this.program,ue);var me=d.createShader(d.VERTEX_SHADER);if(d.isContextLost())this.failedToCreate=!0;else{d.shaderSource(me,ne),d.compileShader(me),d.attachShader(this.program,me),this.attributes={};var pe={};this.numAttributes=A.length;for(var ve=0;ve<this.numAttributes;ve++)A[ve]&&(d.bindAttribLocation(this.program,ve,A[ve]),this.attributes[A[ve]]=ve);d.linkProgram(this.program),d.deleteShader(me),d.deleteShader(ue);for(var Te=0;Te<O.length;Te++){var ke=O[Te];if(ke&&!pe[ke]){var Ce=d.getUniformLocation(this.program,ke);Ce&&(pe[ke]=Ce)}}this.fixedUniforms=p(i,pe),this.binderUniforms=s?s.getUniforms(i,pe):[]}}};function _l(i,o,n){var s=1/yr(n,1,o.transform.tileZoom),p=Math.pow(2,n.tileID.overscaledZ),f=n.tileSize*Math.pow(2,o.transform.tileZoom)/p,d=f*(n.tileID.canonical.x+n.tileID.wrap*p),v=f*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[s,i.fromScale,i.toScale],u_fade:i.t,u_pixel_coord_upper:[d>>16,v>>16],u_pixel_coord_lower:[65535&d,65535&v]}}gl.prototype.draw=function(i,o,n,s,p,f,d,v,w,A,R,F,O,W,Z,ee){var N,Q=i.gl;if(!this.failedToCreate){for(var ne in i.program.set(this.program),i.setDepthMode(n),i.setStencilMode(s),i.setColorMode(p),i.setCullFace(f),this.fixedUniforms)this.fixedUniforms[ne].set(d[ne]);W&&W.setUniforms(i,this.binderUniforms,F,{zoom:O});for(var ue=(N={},N[Q.LINES]=2,N[Q.TRIANGLES]=3,N[Q.LINE_STRIP]=1,N)[o],me=0,pe=R.get();me<pe.length;me+=1){var ve=pe[me],Te=ve.vaos||(ve.vaos={});(Te[v]||(Te[v]=new ts)).bind(i,this,w,W?W.getPaintVertexBuffers():[],A,ve.vertexOffset,Z,ee),Q.drawElements(o,ve.primitiveLength*ue,Q.UNSIGNED_SHORT,ve.primitiveOffset*ue*2)}}};var xl=function(i,o,n,s){var p=o.style.light,f=p.properties.get("position"),d=[f.x,f.y,f.z],v=u.create$1();p.properties.get("anchor")==="viewport"&&u.fromRotation(v,-o.transform.angle),u.transformMat3(d,d,v);var w=p.properties.get("color");return{u_matrix:i,u_lightpos:d,u_lightintensity:p.properties.get("intensity"),u_lightcolor:[w.r,w.g,w.b],u_vertical_gradient:+n,u_opacity:s}},So=function(i,o,n,s,p,f,d){return u.extend(xl(i,o,n,s),_l(f,o,d),{u_height_factor:-Math.pow(2,p.overscaledZ)/d.tileSize/8})},Yn=function(i){return{u_matrix:i}},Io=function(i,o,n,s){return u.extend(Yn(i),_l(n,o,s))},bl=function(i,o){return{u_matrix:i,u_world:o}},wl=function(i,o,n,s,p){return u.extend(Io(i,o,n,s),{u_world:p})},cu=function(i,o,n,s){var p,f,d=i.transform;if(s.paint.get("circle-pitch-alignment")==="map"){var v=yr(n,1,d.zoom);p=!0,f=[v,v]}else p=!1,f=d.pixelsToGLUnits;return{u_camera_to_center_distance:d.cameraToCenterDistance,u_scale_with_map:+(s.paint.get("circle-pitch-scale")==="map"),u_matrix:i.translatePosMatrix(o.posMatrix,n,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_pitch_with_map:+p,u_device_pixel_ratio:u.browser.devicePixelRatio,u_extrude_scale:f}},To=function(i,o,n){var s=yr(n,1,o.zoom),p=Math.pow(2,o.zoom-n.tileID.overscaledZ),f=n.tileID.overscaleFactor();return{u_matrix:i,u_camera_to_center_distance:o.cameraToCenterDistance,u_pixels_to_tile_units:s,u_extrude_scale:[o.pixelsToGLUnits[0]/(s*p),o.pixelsToGLUnits[1]/(s*p)],u_overscale_factor:f}},Sl=function(i,o,n){return{u_matrix:i,u_inv_matrix:o,u_camera_to_center_distance:n.cameraToCenterDistance,u_viewport_size:[n.width,n.height]}},Ao=function(i,o,n){return n===void 0&&(n=1),{u_matrix:i,u_color:o,u_overlay:0,u_overlay_scale:n}},Eo=function(i){return{u_matrix:i}},Il=function(i,o,n,s){return{u_matrix:i,u_extrude_scale:yr(o,1,n),u_intensity:s}},ba=function(i,o,n){var s=i.transform;return{u_matrix:Tl(i,o,n),u_ratio:1/yr(o,1,s.zoom),u_device_pixel_ratio:u.browser.devicePixelRatio,u_units_to_pixels:[1/s.pixelsToGLUnits[0],1/s.pixelsToGLUnits[1]]}},ur=function(i,o,n,s){return u.extend(ba(i,o,n),{u_image:0,u_image_height:s})},rs=function(i,o,n,s){var p=i.transform,f=Xo(o,p);return{u_matrix:Tl(i,o,n),u_texsize:o.imageAtlasTexture.size,u_ratio:1/yr(o,1,p.zoom),u_device_pixel_ratio:u.browser.devicePixelRatio,u_image:0,u_scale:[f,s.fromScale,s.toScale],u_fade:s.t,u_units_to_pixels:[1/p.pixelsToGLUnits[0],1/p.pixelsToGLUnits[1]]}},Fc=function(i,o,n,s,p){var f=i.lineAtlas,d=Xo(o,i.transform),v=n.layout.get("line-cap")==="round",w=f.getDash(s.from,v),A=f.getDash(s.to,v),R=w.width*p.fromScale,F=A.width*p.toScale;return u.extend(ba(i,o,n),{u_patternscale_a:[d/R,-w.height/2],u_patternscale_b:[d/F,-A.height/2],u_sdfgamma:f.width/(256*Math.min(R,F)*u.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:w.y,u_tex_y_b:A.y,u_mix:p.t})};function Xo(i,o){return 1/yr(i,1,o.tileZoom)}function Tl(i,o,n){return i.translatePosMatrix(o.tileID.posMatrix,o,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}var Oc=function(i,o,n,s,p){return{u_matrix:i,u_tl_parent:o,u_scale_parent:n,u_buffer_scale:1,u_fade_t:s.mix,u_opacity:s.opacity*p.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:p.paint.get("raster-brightness-min"),u_brightness_high:p.paint.get("raster-brightness-max"),u_saturation_factor:(d=p.paint.get("raster-saturation"),d>0?1-1/(1.001-d):-d),u_contrast_factor:(f=p.paint.get("raster-contrast"),f>0?1/(1-f):1+f),u_spin_weights:Al(p.paint.get("raster-hue-rotate"))};var f,d};function Al(i){i*=Math.PI/180;var o=Math.sin(i),n=Math.cos(i);return[(2*n+1)/3,(-Math.sqrt(3)*o-n+1)/3,(Math.sqrt(3)*o-n+1)/3]}var is,Ko=function(i,o,n,s,p,f,d,v,w,A){var R=p.transform;return{u_is_size_zoom_constant:+(i==="constant"||i==="source"),u_is_size_feature_constant:+(i==="constant"||i==="camera"),u_size_t:o?o.uSizeT:0,u_size:o?o.uSize:0,u_camera_to_center_distance:R.cameraToCenterDistance,u_pitch:R.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:R.width/R.height,u_fade_change:p.options.fadeDuration?p.symbolFadeChange:1,u_matrix:f,u_label_plane_matrix:d,u_coord_matrix:v,u_is_text:+w,u_pitch_with_map:+s,u_texsize:A,u_texture:0}},wa=function(i,o,n,s,p,f,d,v,w,A,R){var F=p.transform;return u.extend(Ko(i,o,n,s,p,f,d,v,w,A),{u_gamma_scale:s?Math.cos(F._pitch)*F.cameraToCenterDistance:1,u_device_pixel_ratio:u.browser.devicePixelRatio,u_is_halo:1})},ns=function(i,o,n,s,p,f,d,v,w,A){return u.extend(wa(i,o,n,s,p,f,d,v,!0,w),{u_texsize_icon:A,u_texture_icon:1})},Sa=function(i,o,n){return{u_matrix:i,u_opacity:o,u_color:n}},Jo=function(i,o,n,s,p,f){return u.extend((function(d,v,w,A){var R=w.imageManager.getPattern(d.from.toString()),F=w.imageManager.getPattern(d.to.toString()),O=w.imageManager.getPixelSize(),W=O.width,Z=O.height,ee=Math.pow(2,A.tileID.overscaledZ),N=A.tileSize*Math.pow(2,w.transform.tileZoom)/ee,Q=N*(A.tileID.canonical.x+A.tileID.wrap*ee),ne=N*A.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:R.tl,u_pattern_br_a:R.br,u_pattern_tl_b:F.tl,u_pattern_br_b:F.br,u_texsize:[W,Z],u_mix:v.t,u_pattern_size_a:R.displaySize,u_pattern_size_b:F.displaySize,u_scale_a:v.fromScale,u_scale_b:v.toScale,u_tile_units_to_pixels:1/yr(A,1,w.transform.tileZoom),u_pixel_coord_upper:[Q>>16,ne>>16],u_pixel_coord_lower:[65535&Q,65535&ne]}})(s,f,n,p),{u_matrix:i,u_opacity:o})},El={fillExtrusion:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_lightpos:new u.Uniform3f(i,o.u_lightpos),u_lightintensity:new u.Uniform1f(i,o.u_lightintensity),u_lightcolor:new u.Uniform3f(i,o.u_lightcolor),u_vertical_gradient:new u.Uniform1f(i,o.u_vertical_gradient),u_opacity:new u.Uniform1f(i,o.u_opacity)}},fillExtrusionPattern:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_lightpos:new u.Uniform3f(i,o.u_lightpos),u_lightintensity:new u.Uniform1f(i,o.u_lightintensity),u_lightcolor:new u.Uniform3f(i,o.u_lightcolor),u_vertical_gradient:new u.Uniform1f(i,o.u_vertical_gradient),u_height_factor:new u.Uniform1f(i,o.u_height_factor),u_image:new u.Uniform1i(i,o.u_image),u_texsize:new u.Uniform2f(i,o.u_texsize),u_pixel_coord_upper:new u.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new u.Uniform2f(i,o.u_pixel_coord_lower),u_scale:new u.Uniform3f(i,o.u_scale),u_fade:new u.Uniform1f(i,o.u_fade),u_opacity:new u.Uniform1f(i,o.u_opacity)}},fill:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix)}},fillPattern:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_image:new u.Uniform1i(i,o.u_image),u_texsize:new u.Uniform2f(i,o.u_texsize),u_pixel_coord_upper:new u.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new u.Uniform2f(i,o.u_pixel_coord_lower),u_scale:new u.Uniform3f(i,o.u_scale),u_fade:new u.Uniform1f(i,o.u_fade)}},fillOutline:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_world:new u.Uniform2f(i,o.u_world)}},fillOutlinePattern:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_world:new u.Uniform2f(i,o.u_world),u_image:new u.Uniform1i(i,o.u_image),u_texsize:new u.Uniform2f(i,o.u_texsize),u_pixel_coord_upper:new u.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new u.Uniform2f(i,o.u_pixel_coord_lower),u_scale:new u.Uniform3f(i,o.u_scale),u_fade:new u.Uniform1f(i,o.u_fade)}},circle:function(i,o){return{u_camera_to_center_distance:new u.Uniform1f(i,o.u_camera_to_center_distance),u_scale_with_map:new u.Uniform1i(i,o.u_scale_with_map),u_pitch_with_map:new u.Uniform1i(i,o.u_pitch_with_map),u_extrude_scale:new u.Uniform2f(i,o.u_extrude_scale),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_matrix:new u.UniformMatrix4f(i,o.u_matrix)}},collisionBox:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_camera_to_center_distance:new u.Uniform1f(i,o.u_camera_to_center_distance),u_pixels_to_tile_units:new u.Uniform1f(i,o.u_pixels_to_tile_units),u_extrude_scale:new u.Uniform2f(i,o.u_extrude_scale),u_overscale_factor:new u.Uniform1f(i,o.u_overscale_factor)}},collisionCircle:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_inv_matrix:new u.UniformMatrix4f(i,o.u_inv_matrix),u_camera_to_center_distance:new u.Uniform1f(i,o.u_camera_to_center_distance),u_viewport_size:new u.Uniform2f(i,o.u_viewport_size)}},debug:function(i,o){return{u_color:new u.UniformColor(i,o.u_color),u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_overlay:new u.Uniform1i(i,o.u_overlay),u_overlay_scale:new u.Uniform1f(i,o.u_overlay_scale)}},clippingMask:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix)}},heatmap:function(i,o){return{u_extrude_scale:new u.Uniform1f(i,o.u_extrude_scale),u_intensity:new u.Uniform1f(i,o.u_intensity),u_matrix:new u.UniformMatrix4f(i,o.u_matrix)}},heatmapTexture:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_world:new u.Uniform2f(i,o.u_world),u_image:new u.Uniform1i(i,o.u_image),u_color_ramp:new u.Uniform1i(i,o.u_color_ramp),u_opacity:new u.Uniform1f(i,o.u_opacity)}},hillshade:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_image:new u.Uniform1i(i,o.u_image),u_latrange:new u.Uniform2f(i,o.u_latrange),u_light:new u.Uniform2f(i,o.u_light),u_shadow:new u.UniformColor(i,o.u_shadow),u_highlight:new u.UniformColor(i,o.u_highlight),u_accent:new u.UniformColor(i,o.u_accent)}},hillshadePrepare:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_image:new u.Uniform1i(i,o.u_image),u_dimension:new u.Uniform2f(i,o.u_dimension),u_zoom:new u.Uniform1f(i,o.u_zoom),u_unpack:new u.Uniform4f(i,o.u_unpack)}},line:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_ratio:new u.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_units_to_pixels:new u.Uniform2f(i,o.u_units_to_pixels)}},lineGradient:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_ratio:new u.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_units_to_pixels:new u.Uniform2f(i,o.u_units_to_pixels),u_image:new u.Uniform1i(i,o.u_image),u_image_height:new u.Uniform1f(i,o.u_image_height)}},linePattern:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_texsize:new u.Uniform2f(i,o.u_texsize),u_ratio:new u.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_image:new u.Uniform1i(i,o.u_image),u_units_to_pixels:new u.Uniform2f(i,o.u_units_to_pixels),u_scale:new u.Uniform3f(i,o.u_scale),u_fade:new u.Uniform1f(i,o.u_fade)}},lineSDF:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_ratio:new u.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_units_to_pixels:new u.Uniform2f(i,o.u_units_to_pixels),u_patternscale_a:new u.Uniform2f(i,o.u_patternscale_a),u_patternscale_b:new u.Uniform2f(i,o.u_patternscale_b),u_sdfgamma:new u.Uniform1f(i,o.u_sdfgamma),u_image:new u.Uniform1i(i,o.u_image),u_tex_y_a:new u.Uniform1f(i,o.u_tex_y_a),u_tex_y_b:new u.Uniform1f(i,o.u_tex_y_b),u_mix:new u.Uniform1f(i,o.u_mix)}},raster:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_tl_parent:new u.Uniform2f(i,o.u_tl_parent),u_scale_parent:new u.Uniform1f(i,o.u_scale_parent),u_buffer_scale:new u.Uniform1f(i,o.u_buffer_scale),u_fade_t:new u.Uniform1f(i,o.u_fade_t),u_opacity:new u.Uniform1f(i,o.u_opacity),u_image0:new u.Uniform1i(i,o.u_image0),u_image1:new u.Uniform1i(i,o.u_image1),u_brightness_low:new u.Uniform1f(i,o.u_brightness_low),u_brightness_high:new u.Uniform1f(i,o.u_brightness_high),u_saturation_factor:new u.Uniform1f(i,o.u_saturation_factor),u_contrast_factor:new u.Uniform1f(i,o.u_contrast_factor),u_spin_weights:new u.Uniform3f(i,o.u_spin_weights)}},symbolIcon:function(i,o){return{u_is_size_zoom_constant:new u.Uniform1i(i,o.u_is_size_zoom_constant),u_is_size_feature_constant:new u.Uniform1i(i,o.u_is_size_feature_constant),u_size_t:new u.Uniform1f(i,o.u_size_t),u_size:new u.Uniform1f(i,o.u_size),u_camera_to_center_distance:new u.Uniform1f(i,o.u_camera_to_center_distance),u_pitch:new u.Uniform1f(i,o.u_pitch),u_rotate_symbol:new u.Uniform1i(i,o.u_rotate_symbol),u_aspect_ratio:new u.Uniform1f(i,o.u_aspect_ratio),u_fade_change:new u.Uniform1f(i,o.u_fade_change),u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_label_plane_matrix:new u.UniformMatrix4f(i,o.u_label_plane_matrix),u_coord_matrix:new u.UniformMatrix4f(i,o.u_coord_matrix),u_is_text:new u.Uniform1i(i,o.u_is_text),u_pitch_with_map:new u.Uniform1i(i,o.u_pitch_with_map),u_texsize:new u.Uniform2f(i,o.u_texsize),u_texture:new u.Uniform1i(i,o.u_texture)}},symbolSDF:function(i,o){return{u_is_size_zoom_constant:new u.Uniform1i(i,o.u_is_size_zoom_constant),u_is_size_feature_constant:new u.Uniform1i(i,o.u_is_size_feature_constant),u_size_t:new u.Uniform1f(i,o.u_size_t),u_size:new u.Uniform1f(i,o.u_size),u_camera_to_center_distance:new u.Uniform1f(i,o.u_camera_to_center_distance),u_pitch:new u.Uniform1f(i,o.u_pitch),u_rotate_symbol:new u.Uniform1i(i,o.u_rotate_symbol),u_aspect_ratio:new u.Uniform1f(i,o.u_aspect_ratio),u_fade_change:new u.Uniform1f(i,o.u_fade_change),u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_label_plane_matrix:new u.UniformMatrix4f(i,o.u_label_plane_matrix),u_coord_matrix:new u.UniformMatrix4f(i,o.u_coord_matrix),u_is_text:new u.Uniform1i(i,o.u_is_text),u_pitch_with_map:new u.Uniform1i(i,o.u_pitch_with_map),u_texsize:new u.Uniform2f(i,o.u_texsize),u_texture:new u.Uniform1i(i,o.u_texture),u_gamma_scale:new u.Uniform1f(i,o.u_gamma_scale),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_is_halo:new u.Uniform1i(i,o.u_is_halo)}},symbolTextAndIcon:function(i,o){return{u_is_size_zoom_constant:new u.Uniform1i(i,o.u_is_size_zoom_constant),u_is_size_feature_constant:new u.Uniform1i(i,o.u_is_size_feature_constant),u_size_t:new u.Uniform1f(i,o.u_size_t),u_size:new u.Uniform1f(i,o.u_size),u_camera_to_center_distance:new u.Uniform1f(i,o.u_camera_to_center_distance),u_pitch:new u.Uniform1f(i,o.u_pitch),u_rotate_symbol:new u.Uniform1i(i,o.u_rotate_symbol),u_aspect_ratio:new u.Uniform1f(i,o.u_aspect_ratio),u_fade_change:new u.Uniform1f(i,o.u_fade_change),u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_label_plane_matrix:new u.UniformMatrix4f(i,o.u_label_plane_matrix),u_coord_matrix:new u.UniformMatrix4f(i,o.u_coord_matrix),u_is_text:new u.Uniform1i(i,o.u_is_text),u_pitch_with_map:new u.Uniform1i(i,o.u_pitch_with_map),u_texsize:new u.Uniform2f(i,o.u_texsize),u_texsize_icon:new u.Uniform2f(i,o.u_texsize_icon),u_texture:new u.Uniform1i(i,o.u_texture),u_texture_icon:new u.Uniform1i(i,o.u_texture_icon),u_gamma_scale:new u.Uniform1f(i,o.u_gamma_scale),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_is_halo:new u.Uniform1i(i,o.u_is_halo)}},background:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_opacity:new u.Uniform1f(i,o.u_opacity),u_color:new u.UniformColor(i,o.u_color)}},backgroundPattern:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_opacity:new u.Uniform1f(i,o.u_opacity),u_image:new u.Uniform1i(i,o.u_image),u_pattern_tl_a:new u.Uniform2f(i,o.u_pattern_tl_a),u_pattern_br_a:new u.Uniform2f(i,o.u_pattern_br_a),u_pattern_tl_b:new u.Uniform2f(i,o.u_pattern_tl_b),u_pattern_br_b:new u.Uniform2f(i,o.u_pattern_br_b),u_texsize:new u.Uniform2f(i,o.u_texsize),u_mix:new u.Uniform1f(i,o.u_mix),u_pattern_size_a:new u.Uniform2f(i,o.u_pattern_size_a),u_pattern_size_b:new u.Uniform2f(i,o.u_pattern_size_b),u_scale_a:new u.Uniform1f(i,o.u_scale_a),u_scale_b:new u.Uniform1f(i,o.u_scale_b),u_pixel_coord_upper:new u.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new u.Uniform2f(i,o.u_pixel_coord_lower),u_tile_units_to_pixels:new u.Uniform1f(i,o.u_tile_units_to_pixels)}}};function Yo(i,o,n,s,p,f,d){for(var v=i.context,w=v.gl,A=i.useProgram("collisionBox"),R=[],F=0,O=0,W=0;W<s.length;W++){var Z=s[W],ee=o.getTile(Z),N=ee.getBucket(n);if(N){var Q=Z.posMatrix;p[0]===0&&p[1]===0||(Q=i.translatePosMatrix(Z.posMatrix,ee,p,f));var ne=d?N.textCollisionBox:N.iconCollisionBox,ue=N.collisionCircleArray;if(ue.length>0){var me=u.create(),pe=Q;u.mul(me,N.placementInvProjMatrix,i.transform.glCoordMatrix),u.mul(me,me,N.placementViewportMatrix),R.push({circleArray:ue,circleOffset:O,transform:pe,invTransform:me}),O=F+=ue.length/4}ne&&A.draw(v,w.LINES,V.disabled,$.disabled,i.colorModeForRenderPass(),ie.disabled,To(Q,i.transform,ee),n.id,ne.layoutVertexBuffer,ne.indexBuffer,ne.segments,null,i.transform.zoom,null,null,ne.collisionVertexBuffer)}}if(d&&R.length){var ve=i.useProgram("collisionCircle"),Te=new u.StructArrayLayout2f1f2i16;Te.resize(4*F),Te._trim();for(var ke=0,Ce=0,$e=R;Ce<$e.length;Ce+=1)for(var nt=$e[Ce],ut=0;ut<nt.circleArray.length/4;ut++){var st=4*ut,Ft=nt.circleArray[st+0],We=nt.circleArray[st+1],mt=nt.circleArray[st+2],xt=nt.circleArray[st+3];Te.emplace(ke++,Ft,We,mt,xt,0),Te.emplace(ke++,Ft,We,mt,xt,1),Te.emplace(ke++,Ft,We,mt,xt,2),Te.emplace(ke++,Ft,We,mt,xt,3)}(!is||is.length<2*F)&&(is=(function(Ir){var gi=2*Ir,si=new u.StructArrayLayout3ui6;si.resize(gi),si._trim();for(var wr=0;wr<gi;wr++){var Mr=6*wr;si.uint16[Mr+0]=4*wr+0,si.uint16[Mr+1]=4*wr+1,si.uint16[Mr+2]=4*wr+2,si.uint16[Mr+3]=4*wr+2,si.uint16[Mr+4]=4*wr+3,si.uint16[Mr+5]=4*wr+0}return si})(F));for(var dt=v.createIndexBuffer(is,!0),ft=v.createVertexBuffer(Te,u.collisionCircleLayout.members,!0),gt=0,ht=R;gt<ht.length;gt+=1){var ct=ht[gt],Jr=Sl(ct.transform,ct.invTransform,i.transform);ve.draw(v,w.TRIANGLES,V.disabled,$.disabled,i.colorModeForRenderPass(),ie.disabled,Jr,n.id,ft,dt,u.SegmentVector.simpleSegment(0,2*ct.circleOffset,ct.circleArray.length,ct.circleArray.length/2),null,i.transform.zoom,null,null,null)}ft.destroy(),dt.destroy()}}var vn=u.identity(new Float32Array(16));function Pl(i,o,n,s,p,f){var d=u.getAnchorAlignment(i),v=-(d.horizontalAlign-.5)*o,w=-(d.verticalAlign-.5)*n,A=u.evaluateVariableOffset(i,s);return new u.Point((v/p+A[0])*f,(w/p+A[1])*f)}function Cl(i,o,n,s,p,f,d,v,w,A,R){var F=i.text.placedSymbolArray,O=i.text.dynamicLayoutVertexArray,W=i.icon.dynamicLayoutVertexArray,Z={};O.clear();for(var ee=0;ee<F.length;ee++){var N=F.get(ee),Q=N.hidden||!N.crossTileID||i.allowVerticalPlacement&&!N.placedOrientation?null:s[N.crossTileID];if(Q){var ne=new u.Point(N.anchorX,N.anchorY),ue=zt(ne,n?v:d),me=$t(f.cameraToCenterDistance,ue.signedDistanceFromCamera),pe=p.evaluateSizeForFeature(i.textSizeData,A,N)*me/u.ONE_EM;n&&(pe*=i.tilePixelRatio/w);for(var ve=Pl(Q.anchor,Q.width,Q.height,Q.textOffset,Q.textBoxScale,pe),Te=n?zt(ne.add(ve),d).point:ue.point.add(o?ve.rotate(-f.angle):ve),ke=i.allowVerticalPlacement&&N.placedOrientation===u.WritingMode.vertical?Math.PI/2:0,Ce=0;Ce<N.numGlyphs;Ce++)u.addDynamicAttributes(O,Te,ke);R&&N.associatedIconIndex>=0&&(Z[N.associatedIconIndex]={shiftedAnchor:Te,angle:ke})}else Si(N.numGlyphs,O)}if(R){W.clear();for(var $e=i.icon.placedSymbolArray,nt=0;nt<$e.length;nt++){var ut=$e.get(nt);if(ut.hidden)Si(ut.numGlyphs,W);else{var st=Z[nt];if(st)for(var Ft=0;Ft<ut.numGlyphs;Ft++)u.addDynamicAttributes(W,st.shiftedAnchor,st.angle);else Si(ut.numGlyphs,W)}}i.icon.dynamicLayoutVertexBuffer.updateData(W)}i.text.dynamicLayoutVertexBuffer.updateData(O)}function kl(i,o,n){return n.iconsInText&&o?"symbolTextAndIcon":i?"symbolSDF":"symbolIcon"}function Po(i,o,n,s,p,f,d,v,w,A,R,F){for(var O=i.context,W=O.gl,Z=i.transform,ee=v==="map",N=w==="map",Q=ee&&n.layout.get("symbol-placement")!=="point",ne=ee&&!N&&!Q,ue=n.layout.get("symbol-sort-key").constantOr(1)!==void 0,me=!1,pe=i.depthModeForSublayer(0,V.ReadOnly),ve=n.layout.get("text-variable-anchor"),Te=[],ke=0,Ce=s;ke<Ce.length;ke+=1){var $e=Ce[ke],nt=o.getTile($e),ut=nt.getBucket(n);if(ut){var st=p?ut.text:ut.icon;if(st&&st.segments.get().length){var Ft=st.programConfigurations.get(n.id),We=p||ut.sdfIcons,mt=p?ut.textSizeData:ut.iconSizeData,xt=N||Z.pitch!==0,dt=i.useProgram(kl(We,p,ut),Ft),ft=u.evaluateSizeForZoom(mt,Z.zoom),gt=void 0,ht=[0,0],ct=void 0,Jr=void 0,Ir=null,gi=void 0;if(p)ct=nt.glyphAtlasTexture,Jr=W.LINEAR,gt=nt.glyphAtlasTexture.size,ut.iconsInText&&(ht=nt.imageAtlasTexture.size,Ir=nt.imageAtlasTexture,gi=xt||i.options.rotating||i.options.zooming||mt.kind==="composite"||mt.kind==="camera"?W.LINEAR:W.NEAREST);else{var si=n.layout.get("icon-size").constantOr(0)!==1||ut.iconsNeedLinear;ct=nt.imageAtlasTexture,Jr=We||i.options.rotating||i.options.zooming||si||xt?W.LINEAR:W.NEAREST,gt=nt.imageAtlasTexture.size}var wr=yr(nt,1,i.transform.zoom),Mr=Cr($e.posMatrix,N,ee,i.transform,wr),Wi=Qt($e.posMatrix,N,ee,i.transform,wr),Ei=ve&&ut.hasTextData(),no=n.layout.get("icon-text-fit")!=="none"&&Ei&&ut.hasIconData();Q&&ma(ut,$e.posMatrix,i,p,Mr,Wi,N,A);var Ri=i.translatePosMatrix($e.posMatrix,nt,f,d),wn=Q||p&&ve||no?vn:Mr,cn=i.translatePosMatrix(Wi,nt,f,d,!0),Ra=We&&n.paint.get(p?"text-halo-width":"icon-halo-width").constantOr(1)!==0,na={program:dt,buffers:st,uniformValues:We?ut.iconsInText?ns(mt.kind,ft,ne,N,i,Ri,wn,cn,gt,ht):wa(mt.kind,ft,ne,N,i,Ri,wn,cn,p,gt):Ko(mt.kind,ft,ne,N,i,Ri,wn,cn,p,gt),atlasTexture:ct,atlasTextureIcon:Ir,atlasInterpolation:Jr,atlasInterpolationIcon:gi,isSDF:We,hasHalo:Ra};if(ue&&ut.canOverlap){me=!0;for(var oo=0,oa=st.segments.get();oo<oa.length;oo+=1){var La=oa[oo];Te.push({segments:new u.SegmentVector([La]),sortKey:La.sortKey,state:na})}}else Te.push({segments:st.segments,sortKey:0,state:na})}}}me&&Te.sort((function(ao,Do){return ao.sortKey-Do.sortKey}));for(var Pn=0,Fa=Te;Pn<Fa.length;Pn+=1){var Cn=Fa[Pn],Yr=Cn.state;if(O.activeTexture.set(W.TEXTURE0),Yr.atlasTexture.bind(Yr.atlasInterpolation,W.CLAMP_TO_EDGE),Yr.atlasTextureIcon&&(O.activeTexture.set(W.TEXTURE1),Yr.atlasTextureIcon&&Yr.atlasTextureIcon.bind(Yr.atlasInterpolationIcon,W.CLAMP_TO_EDGE)),Yr.isSDF){var On=Yr.uniformValues;Yr.hasHalo&&(On.u_is_halo=1,Ia(Yr.buffers,Cn.segments,n,i,Yr.program,pe,R,F,On)),On.u_is_halo=0}Ia(Yr.buffers,Cn.segments,n,i,Yr.program,pe,R,F,Yr.uniformValues)}}function Ia(i,o,n,s,p,f,d,v,w){var A=s.context;p.draw(A,A.gl.TRIANGLES,f,d,v,ie.disabled,w,n.id,i.layoutVertexBuffer,i.indexBuffer,o,n.paint,s.transform.zoom,i.programConfigurations.get(n.id),i.dynamicLayoutVertexBuffer,i.opacityVertexBuffer)}function os(i,o,n,s,p,f,d){var v,w,A,R,F,O=i.context.gl,W=n.paint.get("fill-pattern"),Z=W&&W.constantOr(1),ee=n.getCrossfadeParameters();d?(w=Z&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",v=O.LINES):(w=Z?"fillPattern":"fill",v=O.TRIANGLES);for(var N=0,Q=s;N<Q.length;N+=1){var ne=Q[N],ue=o.getTile(ne);if(!Z||ue.patternsLoaded()){var me=ue.getBucket(n);if(me){var pe=me.programConfigurations.get(n.id),ve=i.useProgram(w,pe);Z&&(i.context.activeTexture.set(O.TEXTURE0),ue.imageAtlasTexture.bind(O.LINEAR,O.CLAMP_TO_EDGE),pe.updatePaintBuffers(ee));var Te=W.constantOr(null);if(Te&&ue.imageAtlas){var ke=ue.imageAtlas,Ce=ke.patternPositions[Te.to.toString()],$e=ke.patternPositions[Te.from.toString()];Ce&&$e&&pe.setConstantPatternPositions(Ce,$e)}var nt=i.translatePosMatrix(ne.posMatrix,ue,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(d){R=me.indexBuffer2,F=me.segments2;var ut=[O.drawingBufferWidth,O.drawingBufferHeight];A=w==="fillOutlinePattern"&&Z?wl(nt,i,ee,ue,ut):bl(nt,ut)}else R=me.indexBuffer,F=me.segments,A=Z?Io(nt,i,ee,ue):Yn(nt);ve.draw(i.context,v,p,i.stencilModeForClipping(ne),f,ie.disabled,A,n.id,me.layoutVertexBuffer,R,F,n.paint,i.transform.zoom,pe)}}}}function pu(i,o,n,s,p,f,d){for(var v=i.context,w=v.gl,A=n.paint.get("fill-extrusion-pattern"),R=A.constantOr(1),F=n.getCrossfadeParameters(),O=n.paint.get("fill-extrusion-opacity"),W=0,Z=s;W<Z.length;W+=1){var ee=Z[W],N=o.getTile(ee),Q=N.getBucket(n);if(Q){var ne=Q.programConfigurations.get(n.id),ue=i.useProgram(R?"fillExtrusionPattern":"fillExtrusion",ne);R&&(i.context.activeTexture.set(w.TEXTURE0),N.imageAtlasTexture.bind(w.LINEAR,w.CLAMP_TO_EDGE),ne.updatePaintBuffers(F));var me=A.constantOr(null);if(me&&N.imageAtlas){var pe=N.imageAtlas,ve=pe.patternPositions[me.to.toString()],Te=pe.patternPositions[me.from.toString()];ve&&Te&&ne.setConstantPatternPositions(ve,Te)}var ke=i.translatePosMatrix(ee.posMatrix,N,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),Ce=n.paint.get("fill-extrusion-vertical-gradient"),$e=R?So(ke,i,Ce,O,ee,F,N):xl(ke,i,Ce,O);ue.draw(v,v.gl.TRIANGLES,p,f,d,ie.backCCW,$e,n.id,Q.layoutVertexBuffer,Q.indexBuffer,Q.segments,n.paint,i.transform.zoom,ne)}}}function as(i,o,n,s,p,f){var d=i.context,v=d.gl,w=o.fbo;if(w){var A=i.useProgram("hillshade");d.activeTexture.set(v.TEXTURE0),v.bindTexture(v.TEXTURE_2D,w.colorAttachment.get());var R=(function(F,O,W){var Z=W.paint.get("hillshade-shadow-color"),ee=W.paint.get("hillshade-highlight-color"),N=W.paint.get("hillshade-accent-color"),Q=W.paint.get("hillshade-illumination-direction")*(Math.PI/180);W.paint.get("hillshade-illumination-anchor")==="viewport"&&(Q-=F.transform.angle);var ne,ue,me,pe=!F.options.moving;return{u_matrix:F.transform.calculatePosMatrix(O.tileID.toUnwrapped(),pe),u_image:0,u_latrange:(ne=O.tileID,ue=Math.pow(2,ne.canonical.z),me=ne.canonical.y,[new u.MercatorCoordinate(0,me/ue).toLngLat().lat,new u.MercatorCoordinate(0,(me+1)/ue).toLngLat().lat]),u_light:[W.paint.get("hillshade-exaggeration"),Q],u_shadow:Z,u_highlight:ee,u_accent:N}})(i,o,n);A.draw(d,v.TRIANGLES,s,p,f,ie.disabled,R,n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments)}}function Vc(i,o,n,s,p,f){var d=i.context,v=d.gl,w=o.dem;if(w&&w.data){var A=w.dim,R=w.stride,F=w.getPixels();if(d.activeTexture.set(v.TEXTURE1),d.pixelStoreUnpackPremultiplyAlpha.set(!1),o.demTexture=o.demTexture||i.getTileTexture(R),o.demTexture){var O=o.demTexture;O.update(F,{premultiply:!1}),O.bind(v.NEAREST,v.CLAMP_TO_EDGE)}else o.demTexture=new u.Texture(d,F,v.RGBA,{premultiply:!1}),o.demTexture.bind(v.NEAREST,v.CLAMP_TO_EDGE);d.activeTexture.set(v.TEXTURE0);var W=o.fbo;if(!W){var Z=new u.Texture(d,{width:A,height:A,data:null},v.RGBA);Z.bind(v.LINEAR,v.CLAMP_TO_EDGE),(W=o.fbo=d.createFramebuffer(A,A,!0)).colorAttachment.set(Z.texture)}d.bindFramebuffer.set(W.framebuffer),d.viewport.set([0,0,A,A]),i.useProgram("hillshadePrepare").draw(d,v.TRIANGLES,s,p,f,ie.disabled,(function(ee,N){var Q=N.stride,ne=u.create();return u.ortho(ne,0,u.EXTENT,-u.EXTENT,0,0,1),u.translate(ne,ne,[0,-u.EXTENT,0]),{u_matrix:ne,u_image:1,u_dimension:[Q,Q],u_zoom:ee.overscaledZ,u_unpack:N.getUnpackVector()}})(o.tileID,w),n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments),o.needsHillshadePrepare=!1}}function ss(i,o,n,s,p){var f=s.paint.get("raster-fade-duration");if(f>0){var d=u.browser.now(),v=(d-i.timeAdded)/f,w=o?(d-o.timeAdded)/f:-1,A=n.getSource(),R=p.coveringZoomLevel({tileSize:A.tileSize,roundZoom:A.roundZoom}),F=!o||Math.abs(o.tileID.overscaledZ-R)>Math.abs(i.tileID.overscaledZ-R),O=F&&i.refreshedUponExpiration?1:u.clamp(F?v:1-w,0,1);return i.refreshedUponExpiration&&v>=1&&(i.refreshedUponExpiration=!1),o?{opacity:1,mix:1-O}:{opacity:O,mix:0}}return{opacity:1,mix:0}}var hu=new u.Color(1,0,0,1),Ml=new u.Color(0,1,0,1),Bl=new u.Color(0,0,1,1),us=new u.Color(1,0,1,1),fu=new u.Color(0,1,1,1);function du(i,o,n,s){Ta(i,0,o+n/2,i.transform.width,n,s)}function mu(i,o,n,s){Ta(i,o-n/2,0,n,i.transform.height,s)}function Ta(i,o,n,s,p,f){var d=i.context,v=d.gl;v.enable(v.SCISSOR_TEST),v.scissor(o*u.browser.devicePixelRatio,n*u.browser.devicePixelRatio,s*u.browser.devicePixelRatio,p*u.browser.devicePixelRatio),d.clear({color:f}),v.disable(v.SCISSOR_TEST)}function zl(i,o,n){var s=i.context,p=s.gl,f=n.posMatrix,d=i.useProgram("debug"),v=V.disabled,w=$.disabled,A=i.colorModeForRenderPass();s.activeTexture.set(p.TEXTURE0),i.emptyTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),d.draw(s,p.LINE_STRIP,v,w,A,ie.disabled,Ao(f,u.Color.red),"$debug",i.debugBuffer,i.tileBorderIndexBuffer,i.debugSegments);var R=o.getTileByID(n.key).latestRawTileData,F=Math.floor((R&&R.byteLength||0)/1024),O=o.getTile(n).tileSize,W=512/Math.min(O,512)*(n.overscaledZ/i.transform.zoom)*.5,Z=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(Z+=" => "+n.overscaledZ),(function(ee,N){ee.initDebugOverlayCanvas();var Q=ee.debugOverlayCanvas,ne=ee.context.gl,ue=ee.debugOverlayCanvas.getContext("2d");ue.clearRect(0,0,Q.width,Q.height),ue.shadowColor="white",ue.shadowBlur=2,ue.lineWidth=1.5,ue.strokeStyle="white",ue.textBaseline="top",ue.font="bold 36px Open Sans, sans-serif",ue.fillText(N,5,5),ue.strokeText(N,5,5),ee.debugOverlayTexture.update(Q),ee.debugOverlayTexture.bind(ne.LINEAR,ne.CLAMP_TO_EDGE)})(i,Z+" "+F+"kb"),d.draw(s,p.TRIANGLES,v,w,re.alphaBlended,ie.disabled,Ao(f,u.Color.transparent,W),"$debug",i.debugBuffer,i.quadTriangleIndexBuffer,i.debugSegments)}var Co={symbol:function(i,o,n,s,p){if(i.renderPass==="translucent"){var f=$.disabled,d=i.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&(function(v,w,A,R,F,O,W){for(var Z=w.transform,ee=F==="map",N=O==="map",Q=0,ne=v;Q<ne.length;Q+=1){var ue=ne[Q],me=R.getTile(ue),pe=me.getBucket(A);if(pe&&pe.text&&pe.text.segments.get().length){var ve=u.evaluateSizeForZoom(pe.textSizeData,Z.zoom),Te=yr(me,1,w.transform.zoom),ke=Cr(ue.posMatrix,N,ee,w.transform,Te),Ce=A.layout.get("icon-text-fit")!=="none"&&pe.hasIconData();if(ve){var $e=Math.pow(2,Z.zoom-me.tileID.overscaledZ);Cl(pe,ee,N,W,u.symbolSize,Z,ke,ue.posMatrix,$e,ve,Ce)}}}})(s,i,n,o,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),p),n.paint.get("icon-opacity").constantOr(1)!==0&&Po(i,o,n,s,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),f,d),n.paint.get("text-opacity").constantOr(1)!==0&&Po(i,o,n,s,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),f,d),o.map.showCollisionBoxes&&(Yo(i,o,n,s,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),Yo(i,o,n,s,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))}},circle:function(i,o,n,s){if(i.renderPass==="translucent"){var p=n.paint.get("circle-opacity"),f=n.paint.get("circle-stroke-width"),d=n.paint.get("circle-stroke-opacity"),v=n.layout.get("circle-sort-key").constantOr(1)!==void 0;if(p.constantOr(1)!==0||f.constantOr(1)!==0&&d.constantOr(1)!==0){for(var w=i.context,A=w.gl,R=i.depthModeForSublayer(0,V.ReadOnly),F=$.disabled,O=i.colorModeForRenderPass(),W=[],Z=0;Z<s.length;Z++){var ee=s[Z],N=o.getTile(ee),Q=N.getBucket(n);if(Q){var ne=Q.programConfigurations.get(n.id),ue={programConfiguration:ne,program:i.useProgram("circle",ne),layoutVertexBuffer:Q.layoutVertexBuffer,indexBuffer:Q.indexBuffer,uniformValues:cu(i,ee,N,n)};if(v)for(var me=0,pe=Q.segments.get();me<pe.length;me+=1){var ve=pe[me];W.push({segments:new u.SegmentVector([ve]),sortKey:ve.sortKey,state:ue})}else W.push({segments:Q.segments,sortKey:0,state:ue})}}v&&W.sort((function(nt,ut){return nt.sortKey-ut.sortKey}));for(var Te=0,ke=W;Te<ke.length;Te+=1){var Ce=ke[Te],$e=Ce.state;$e.program.draw(w,A.TRIANGLES,R,F,O,ie.disabled,$e.uniformValues,n.id,$e.layoutVertexBuffer,$e.indexBuffer,Ce.segments,n.paint,i.transform.zoom,$e.programConfiguration)}}}},heatmap:function(i,o,n,s){if(n.paint.get("heatmap-opacity")!==0)if(i.renderPass==="offscreen"){var p=i.context,f=p.gl,d=$.disabled,v=new re([f.ONE,f.ONE],u.Color.transparent,[!0,!0,!0,!0]);(function(W,Z,ee){var N=W.gl;W.activeTexture.set(N.TEXTURE1),W.viewport.set([0,0,Z.width/4,Z.height/4]);var Q=ee.heatmapFbo;if(Q)N.bindTexture(N.TEXTURE_2D,Q.colorAttachment.get()),W.bindFramebuffer.set(Q.framebuffer);else{var ne=N.createTexture();N.bindTexture(N.TEXTURE_2D,ne),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_S,N.CLAMP_TO_EDGE),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_T,N.CLAMP_TO_EDGE),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_MIN_FILTER,N.LINEAR),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_MAG_FILTER,N.LINEAR),Q=ee.heatmapFbo=W.createFramebuffer(Z.width/4,Z.height/4,!1),(function(ue,me,pe,ve){var Te=ue.gl;Te.texImage2D(Te.TEXTURE_2D,0,Te.RGBA,me.width/4,me.height/4,0,Te.RGBA,ue.extRenderToTextureHalfFloat?ue.extTextureHalfFloat.HALF_FLOAT_OES:Te.UNSIGNED_BYTE,null),ve.colorAttachment.set(pe)})(W,Z,ne,Q)}})(p,i,n),p.clear({color:u.Color.transparent});for(var w=0;w<s.length;w++){var A=s[w];if(!o.hasRenderableParent(A)){var R=o.getTile(A),F=R.getBucket(n);if(F){var O=F.programConfigurations.get(n.id);i.useProgram("heatmap",O).draw(p,f.TRIANGLES,V.disabled,d,v,ie.disabled,Il(A.posMatrix,R,i.transform.zoom,n.paint.get("heatmap-intensity")),n.id,F.layoutVertexBuffer,F.indexBuffer,F.segments,n.paint,i.transform.zoom,O)}}}p.viewport.set([0,0,i.width,i.height])}else i.renderPass==="translucent"&&(i.context.setColorMode(i.colorModeForRenderPass()),(function(W,Z){var ee=W.context,N=ee.gl,Q=Z.heatmapFbo;if(Q){ee.activeTexture.set(N.TEXTURE0),N.bindTexture(N.TEXTURE_2D,Q.colorAttachment.get()),ee.activeTexture.set(N.TEXTURE1);var ne=Z.colorRampTexture;ne||(ne=Z.colorRampTexture=new u.Texture(ee,Z.colorRamp,N.RGBA)),ne.bind(N.LINEAR,N.CLAMP_TO_EDGE),W.useProgram("heatmapTexture").draw(ee,N.TRIANGLES,V.disabled,$.disabled,W.colorModeForRenderPass(),ie.disabled,(function(ue,me,pe,ve){var Te=u.create();u.ortho(Te,0,ue.width,ue.height,0,0,1);var ke=ue.context.gl;return{u_matrix:Te,u_world:[ke.drawingBufferWidth,ke.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:me.paint.get("heatmap-opacity")}})(W,Z),Z.id,W.viewportBuffer,W.quadTriangleIndexBuffer,W.viewportSegments,Z.paint,W.transform.zoom)}})(i,n))},line:function(i,o,n,s){if(i.renderPass==="translucent"){var p=n.paint.get("line-opacity"),f=n.paint.get("line-width");if(p.constantOr(1)!==0&&f.constantOr(1)!==0)for(var d=i.depthModeForSublayer(0,V.ReadOnly),v=i.colorModeForRenderPass(),w=n.paint.get("line-dasharray"),A=n.paint.get("line-pattern"),R=A.constantOr(1),F=n.paint.get("line-gradient"),O=n.getCrossfadeParameters(),W=R?"linePattern":w?"lineSDF":F?"lineGradient":"line",Z=i.context,ee=Z.gl,N=!0,Q=0,ne=s;Q<ne.length;Q+=1){var ue=ne[Q],me=o.getTile(ue);if(!R||me.patternsLoaded()){var pe=me.getBucket(n);if(pe){var ve=pe.programConfigurations.get(n.id),Te=i.context.program.get(),ke=i.useProgram(W,ve),Ce=N||ke.program!==Te,$e=A.constantOr(null);if($e&&me.imageAtlas){var nt=me.imageAtlas,ut=nt.patternPositions[$e.to.toString()],st=nt.patternPositions[$e.from.toString()];ut&&st&&ve.setConstantPatternPositions(ut,st)}var Ft=R?rs(i,me,n,O):w?Fc(i,me,n,w,O):F?ur(i,me,n,pe.lineClipsArray.length):ba(i,me,n);if(R)Z.activeTexture.set(ee.TEXTURE0),me.imageAtlasTexture.bind(ee.LINEAR,ee.CLAMP_TO_EDGE),ve.updatePaintBuffers(O);else if(w&&(Ce||i.lineAtlas.dirty))Z.activeTexture.set(ee.TEXTURE0),i.lineAtlas.bind(Z);else if(F){var We=pe.gradients[n.id],mt=We.texture;if(n.gradientVersion!==We.version){var xt=256;if(n.stepInterpolant){var dt=o.getSource().maxzoom,ft=ue.canonical.z===dt?Math.ceil(1<<i.transform.maxZoom-ue.canonical.z):1;xt=u.clamp(u.nextPowerOfTwo(pe.maxLineLength/u.EXTENT*1024*ft),256,Z.maxTextureSize)}We.gradient=u.renderColorRamp({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:xt,image:We.gradient||void 0,clips:pe.lineClipsArray}),We.texture?We.texture.update(We.gradient):We.texture=new u.Texture(Z,We.gradient,ee.RGBA),We.version=n.gradientVersion,mt=We.texture}Z.activeTexture.set(ee.TEXTURE0),mt.bind(n.stepInterpolant?ee.NEAREST:ee.LINEAR,ee.CLAMP_TO_EDGE)}ke.draw(Z,ee.TRIANGLES,d,i.stencilModeForClipping(ue),v,ie.disabled,Ft,n.id,pe.layoutVertexBuffer,pe.indexBuffer,pe.segments,n.paint,i.transform.zoom,ve,pe.layoutVertexBuffer2),N=!1}}}}},fill:function(i,o,n,s){var p=n.paint.get("fill-color"),f=n.paint.get("fill-opacity");if(f.constantOr(1)!==0){var d=i.colorModeForRenderPass(),v=n.paint.get("fill-pattern"),w=i.opaquePassEnabledForLayer()&&!v.constantOr(1)&&p.constantOr(u.Color.transparent).a===1&&f.constantOr(0)===1?"opaque":"translucent";if(i.renderPass===w){var A=i.depthModeForSublayer(1,i.renderPass==="opaque"?V.ReadWrite:V.ReadOnly);os(i,o,n,s,A,d,!1)}if(i.renderPass==="translucent"&&n.paint.get("fill-antialias")){var R=i.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,V.ReadOnly);os(i,o,n,s,R,d,!0)}}},"fill-extrusion":function(i,o,n,s){var p=n.paint.get("fill-extrusion-opacity");if(p!==0&&i.renderPass==="translucent"){var f=new V(i.context.gl.LEQUAL,V.ReadWrite,i.depthRangeFor3D);if(p!==1||n.paint.get("fill-extrusion-pattern").constantOr(1))pu(i,o,n,s,f,$.disabled,re.disabled),pu(i,o,n,s,f,i.stencilModeFor3D(),i.colorModeForRenderPass());else{var d=i.colorModeForRenderPass();pu(i,o,n,s,f,$.disabled,d)}}},hillshade:function(i,o,n,s){if(i.renderPass==="offscreen"||i.renderPass==="translucent"){for(var p=i.context,f=i.depthModeForSublayer(0,V.ReadOnly),d=i.colorModeForRenderPass(),v=i.renderPass==="translucent"?i.stencilConfigForOverlap(s):[{},s],w=v[0],A=0,R=v[1];A<R.length;A+=1){var F=R[A],O=o.getTile(F);O.needsHillshadePrepare&&i.renderPass==="offscreen"?Vc(i,O,n,f,$.disabled,d):i.renderPass==="translucent"&&as(i,O,n,f,w[F.overscaledZ],d)}p.viewport.set([0,0,i.width,i.height])}},raster:function(i,o,n,s){if(i.renderPass==="translucent"&&n.paint.get("raster-opacity")!==0&&s.length)for(var p=i.context,f=p.gl,d=o.getSource(),v=i.useProgram("raster"),w=i.colorModeForRenderPass(),A=d instanceof Xr?[{},s]:i.stencilConfigForOverlap(s),R=A[0],F=A[1],O=F[F.length-1].overscaledZ,W=!i.options.moving,Z=0,ee=F;Z<ee.length;Z+=1){var N=ee[Z],Q=i.depthModeForSublayer(N.overscaledZ-O,n.paint.get("raster-opacity")===1?V.ReadWrite:V.ReadOnly,f.LESS),ne=o.getTile(N),ue=i.transform.calculatePosMatrix(N.toUnwrapped(),W);ne.registerFadeDuration(n.paint.get("raster-fade-duration"));var me=o.findLoadedParent(N,0),pe=ss(ne,me,o,n,i.transform),ve=void 0,Te=void 0,ke=n.paint.get("raster-resampling")==="nearest"?f.NEAREST:f.LINEAR;p.activeTexture.set(f.TEXTURE0),ne.texture.bind(ke,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST),p.activeTexture.set(f.TEXTURE1),me?(me.texture.bind(ke,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST),ve=Math.pow(2,me.tileID.overscaledZ-ne.tileID.overscaledZ),Te=[ne.tileID.canonical.x*ve%1,ne.tileID.canonical.y*ve%1]):ne.texture.bind(ke,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST);var Ce=Oc(ue,Te||[0,0],ve||1,pe,n);d instanceof Xr?v.draw(p,f.TRIANGLES,Q,$.disabled,w,ie.disabled,Ce,n.id,d.boundsBuffer,i.quadTriangleIndexBuffer,d.boundsSegments):v.draw(p,f.TRIANGLES,Q,R[N.overscaledZ],w,ie.disabled,Ce,n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments)}},background:function(i,o,n){var s=n.paint.get("background-color"),p=n.paint.get("background-opacity");if(p!==0){var f=i.context,d=f.gl,v=i.transform,w=v.tileSize,A=n.paint.get("background-pattern");if(!i.isPatternMissing(A)){var R=!A&&s.a===1&&p===1&&i.opaquePassEnabledForLayer()?"opaque":"translucent";if(i.renderPass===R){var F=$.disabled,O=i.depthModeForSublayer(0,R==="opaque"?V.ReadWrite:V.ReadOnly),W=i.colorModeForRenderPass(),Z=i.useProgram(A?"backgroundPattern":"background"),ee=v.coveringTiles({tileSize:w});A&&(f.activeTexture.set(d.TEXTURE0),i.imageManager.bind(i.context));for(var N=n.getCrossfadeParameters(),Q=0,ne=ee;Q<ne.length;Q+=1){var ue=ne[Q],me=i.transform.calculatePosMatrix(ue.toUnwrapped()),pe=A?Jo(me,p,i,A,{tileID:ue,tileSize:w},N):Sa(me,p,s);Z.draw(f,d.TRIANGLES,O,F,W,ie.disabled,pe,n.id,i.tileExtentBuffer,i.quadTriangleIndexBuffer,i.tileExtentSegments)}}}}},debug:function(i,o,n){for(var s=0;s<n.length;s++)zl(i,o,n[s])},custom:function(i,o,n){var s=i.context,p=n.implementation;if(i.renderPass==="offscreen"){var f=p.prerender;f&&(i.setCustomLayerDefaults(),s.setColorMode(i.colorModeForRenderPass()),f.call(p,s.gl,i.transform.customLayerMatrix()),s.setDirty(),i.setBaseState())}else if(i.renderPass==="translucent"){i.setCustomLayerDefaults(),s.setColorMode(i.colorModeForRenderPass()),s.setStencilMode($.disabled);var d=p.renderingMode==="3d"?new V(i.context.gl.LEQUAL,V.ReadWrite,i.depthRangeFor3D):i.depthModeForSublayer(0,V.ReadOnly);s.setDepthMode(d),p.render(s.gl,i.transform.customLayerMatrix()),s.setDirty(),i.setBaseState(),s.bindFramebuffer.set(null)}}},vr=function(i,o){this.context=new L(i),this.transform=o,this._tileTextures={},this.setup(),this.numSublayers=H.maxUnderzooming+H.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new $n,this.gpuTimers={}};vr.prototype.resize=function(i,o){if(this.width=i*u.browser.devicePixelRatio,this.height=o*u.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,s=this.style._order;n<s.length;n+=1)this.style._layers[s[n]].resize()},vr.prototype.setup=function(){var i=this.context,o=new u.StructArrayLayout2i4;o.emplaceBack(0,0),o.emplaceBack(u.EXTENT,0),o.emplaceBack(0,u.EXTENT),o.emplaceBack(u.EXTENT,u.EXTENT),this.tileExtentBuffer=i.createVertexBuffer(o,Vr.members),this.tileExtentSegments=u.SegmentVector.simpleSegment(0,0,4,2);var n=new u.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(u.EXTENT,0),n.emplaceBack(0,u.EXTENT),n.emplaceBack(u.EXTENT,u.EXTENT),this.debugBuffer=i.createVertexBuffer(n,Vr.members),this.debugSegments=u.SegmentVector.simpleSegment(0,0,4,5);var s=new u.StructArrayLayout4i8;s.emplaceBack(0,0,0,0),s.emplaceBack(u.EXTENT,0,u.EXTENT,0),s.emplaceBack(0,u.EXTENT,0,u.EXTENT),s.emplaceBack(u.EXTENT,u.EXTENT,u.EXTENT,u.EXTENT),this.rasterBoundsBuffer=i.createVertexBuffer(s,Lr.members),this.rasterBoundsSegments=u.SegmentVector.simpleSegment(0,0,4,2);var p=new u.StructArrayLayout2i4;p.emplaceBack(0,0),p.emplaceBack(1,0),p.emplaceBack(0,1),p.emplaceBack(1,1),this.viewportBuffer=i.createVertexBuffer(p,Vr.members),this.viewportSegments=u.SegmentVector.simpleSegment(0,0,4,2);var f=new u.StructArrayLayout1ui2;f.emplaceBack(0),f.emplaceBack(1),f.emplaceBack(3),f.emplaceBack(2),f.emplaceBack(0),this.tileBorderIndexBuffer=i.createIndexBuffer(f);var d=new u.StructArrayLayout3ui6;d.emplaceBack(0,1,2),d.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=i.createIndexBuffer(d),this.emptyTexture=new u.Texture(i,{width:1,height:1,data:new Uint8Array([0,0,0,0])},i.gl.RGBA);var v=this.context.gl;this.stencilClearMode=new $({func:v.ALWAYS,mask:0},0,255,v.ZERO,v.ZERO,v.ZERO)},vr.prototype.clearStencil=function(){var i=this.context,o=i.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var n=u.create();u.ortho(n,0,this.width,this.height,0,0,1),u.scale(n,n,[o.drawingBufferWidth,o.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(i,o.TRIANGLES,V.disabled,this.stencilClearMode,re.disabled,ie.disabled,Eo(n),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},vr.prototype._renderTileClippingMasks=function(i,o){if(this.currentStencilSource!==i.source&&i.isTileClipped()&&o&&o.length){this.currentStencilSource=i.source;var n=this.context,s=n.gl;this.nextStencilID+o.length>256&&this.clearStencil(),n.setColorMode(re.disabled),n.setDepthMode(V.disabled);var p=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var f=0,d=o;f<d.length;f+=1){var v=d[f],w=this._tileClippingMaskIDs[v.key]=this.nextStencilID++;p.draw(n,s.TRIANGLES,V.disabled,new $({func:s.ALWAYS,mask:0},w,255,s.KEEP,s.KEEP,s.REPLACE),re.disabled,ie.disabled,Eo(v.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},vr.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var i=this.nextStencilID++,o=this.context.gl;return new $({func:o.NOTEQUAL,mask:255},i,255,o.KEEP,o.KEEP,o.REPLACE)},vr.prototype.stencilModeForClipping=function(i){var o=this.context.gl;return new $({func:o.EQUAL,mask:255},this._tileClippingMaskIDs[i.key],0,o.KEEP,o.KEEP,o.REPLACE)},vr.prototype.stencilConfigForOverlap=function(i){var o,n=this.context.gl,s=i.sort((function(w,A){return A.overscaledZ-w.overscaledZ})),p=s[s.length-1].overscaledZ,f=s[0].overscaledZ-p+1;if(f>1){this.currentStencilSource=void 0,this.nextStencilID+f>256&&this.clearStencil();for(var d={},v=0;v<f;v++)d[v+p]=new $({func:n.GEQUAL,mask:255},v+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=f,[d,s]}return[(o={},o[p]=$.disabled,o),s]},vr.prototype.colorModeForRenderPass=function(){var i=this.context.gl;return this._showOverdrawInspector?new re([i.CONSTANT_COLOR,i.ONE],new u.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?re.unblended:re.alphaBlended},vr.prototype.depthModeForSublayer=function(i,o,n){if(!this.opaquePassEnabledForLayer())return V.disabled;var s=1-((1+this.currentLayer)*this.numSublayers+i)*this.depthEpsilon;return new V(n||this.context.gl.LEQUAL,o,[s,s])},vr.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},vr.prototype.render=function(i,o){var n=this;this.style=i,this.options=o,this.lineAtlas=i.lineAtlas,this.imageManager=i.imageManager,this.glyphManager=i.glyphManager,this.symbolFadeChange=i.placement.symbolFadeChange(u.browser.now()),this.imageManager.beginFrame();var s=this.style._order,p=this.style.sourceCaches;for(var f in p){var d=p[f];d.used&&d.prepare(this.context)}var v,w,A={},R={},F={};for(var O in p){var W=p[O];A[O]=W.getVisibleCoordinates(),R[O]=A[O].slice().reverse(),F[O]=W.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var Z=0;Z<s.length;Z++)if(this.style._layers[s[Z]].is3D()){this.opaquePassCutoff=Z;break}this.renderPass="offscreen";for(var ee=0,N=s;ee<N.length;ee+=1){var Q=this.style._layers[N[ee]];if(Q.hasOffscreenPass()&&!Q.isHidden(this.transform.zoom)){var ne=R[Q.source];(Q.type==="custom"||ne.length)&&this.renderLayer(this,p[Q.source],Q,ne)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:o.showOverdrawInspector?u.Color.black:u.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=o.showOverdrawInspector,this.depthRangeFor3D=[0,1-(i._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=s.length-1;this.currentLayer>=0;this.currentLayer--){var ue=this.style._layers[s[this.currentLayer]],me=p[ue.source],pe=A[ue.source];this._renderTileClippingMasks(ue,pe),this.renderLayer(this,me,ue,pe)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<s.length;this.currentLayer++){var ve=this.style._layers[s[this.currentLayer]],Te=p[ve.source],ke=(ve.type==="symbol"?F:R)[ve.source];this._renderTileClippingMasks(ve,A[ve.source]),this.renderLayer(this,Te,ve,ke)}this.options.showTileBoundaries&&(u.values(this.style._layers).forEach((function(Ce){Ce.source&&!Ce.isHidden(n.transform.zoom)&&(Ce.source!==(w&&w.id)&&(w=n.style.sourceCaches[Ce.source]),(!v||v.getSource().maxzoom<w.getSource().maxzoom)&&(v=w))})),v&&Co.debug(this,v,v.getVisibleCoordinates())),this.options.showPadding&&(function(Ce){var $e=Ce.transform.padding;du(Ce,Ce.transform.height-($e.top||0),3,hu),du(Ce,$e.bottom||0,3,Ml),mu(Ce,$e.left||0,3,Bl),mu(Ce,Ce.transform.width-($e.right||0),3,us);var nt=Ce.transform.centerPoint;(function(ut,st,Ft,We){Ta(ut,st-1,Ft-10,2,20,We),Ta(ut,st-10,Ft-1,20,2,We)})(Ce,nt.x,Ce.transform.height-nt.y,fu)})(this),this.context.setDefault()},vr.prototype.renderLayer=function(i,o,n,s){n.isHidden(this.transform.zoom)||(n.type==="background"||n.type==="custom"||s.length)&&(this.id=n.id,this.gpuTimingStart(n),Co[n.type](i,o,n,s,this.style.placement.variableOffsets),this.gpuTimingEnd())},vr.prototype.gpuTimingStart=function(i){if(this.options.gpuTiming){var o=this.context.extTimerQuery,n=this.gpuTimers[i.id];n||(n=this.gpuTimers[i.id]={calls:0,cpuTime:0,query:o.createQueryEXT()}),n.calls++,o.beginQueryEXT(o.TIME_ELAPSED_EXT,n.query)}},vr.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var i=this.context.extTimerQuery;i.endQueryEXT(i.TIME_ELAPSED_EXT)}},vr.prototype.collectGpuTimers=function(){var i=this.gpuTimers;return this.gpuTimers={},i},vr.prototype.queryGpuTimers=function(i){var o={};for(var n in i){var s=i[n],p=this.context.extTimerQuery,f=p.getQueryObjectEXT(s.query,p.QUERY_RESULT_EXT)/1e6;p.deleteQueryEXT(s.query),o[n]=f}return o},vr.prototype.translatePosMatrix=function(i,o,n,s,p){if(!n[0]&&!n[1])return i;var f=p?s==="map"?this.transform.angle:0:s==="viewport"?-this.transform.angle:0;if(f){var d=Math.sin(f),v=Math.cos(f);n=[n[0]*v-n[1]*d,n[0]*d+n[1]*v]}var w=[p?n[0]:yr(o,n[0],this.transform.zoom),p?n[1]:yr(o,n[1],this.transform.zoom),0],A=new Float32Array(16);return u.translate(A,i,w),A},vr.prototype.saveTileTexture=function(i){var o=this._tileTextures[i.size[0]];o?o.push(i):this._tileTextures[i.size[0]]=[i]},vr.prototype.getTileTexture=function(i){var o=this._tileTextures[i];return o&&o.length>0?o.pop():null},vr.prototype.isPatternMissing=function(i){if(!i)return!1;if(!i.from||!i.to)return!0;var o=this.imageManager.getPattern(i.from.toString()),n=this.imageManager.getPattern(i.to.toString());return!o||!n},vr.prototype.useProgram=function(i,o){this.cache=this.cache||{};var n=""+i+(o?o.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[n]||(this.cache[n]=new gl(this.context,i,Lc[i],o,El[i],this._showOverdrawInspector)),this.cache[n]},vr.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},vr.prototype.setBaseState=function(){var i=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(i.FUNC_ADD)},vr.prototype.initDebugOverlayCanvas=function(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=u.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new u.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},vr.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var ls=function(i,o){this.points=i,this.planes=o};ls.fromInvProjectionMatrix=function(i,o,n){var s=Math.pow(2,n),p=[[-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((function(d){return u.transformMat4([],d,i)})).map((function(d){return u.scale$1([],d,1/d[3]/o*s)})),f=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(d){var v=u.sub([],p[d[0]],p[d[1]]),w=u.sub([],p[d[2]],p[d[1]]),A=u.normalize([],u.cross([],v,w)),R=-u.dot(A,p[d[1]]);return A.concat(R)}));return new ls(p,f)};var ko=function(i,o){this.min=i,this.max=o,this.center=u.scale$2([],u.add([],this.min,this.max),.5)};ko.prototype.quadrant=function(i){for(var o=[i%2==0,i<2],n=u.clone$2(this.min),s=u.clone$2(this.max),p=0;p<o.length;p++)n[p]=o[p]?this.min[p]:this.center[p],s[p]=o[p]?this.center[p]:this.max[p];return s[2]=this.max[2],new ko(n,s)},ko.prototype.distanceX=function(i){return Math.max(Math.min(this.max[0],i[0]),this.min[0])-i[0]},ko.prototype.distanceY=function(i){return Math.max(Math.min(this.max[1],i[1]),this.min[1])-i[1]},ko.prototype.intersects=function(i){for(var o=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],n=!0,s=0;s<i.planes.length;s++){for(var p=i.planes[s],f=0,d=0;d<o.length;d++)f+=u.dot$1(p,o[d])>=0;if(f===0)return 0;f!==o.length&&(n=!1)}if(n)return 2;for(var v=0;v<3;v++){for(var w=Number.MAX_VALUE,A=-Number.MAX_VALUE,R=0;R<i.points.length;R++){var F=i.points[R][v]-this.min[v];w=Math.min(w,F),A=Math.max(A,F)}if(A<0||w>this.max[v]-this.min[v])return 0}return 1};var Qn=function(i,o,n,s){if(i===void 0&&(i=0),o===void 0&&(o=0),n===void 0&&(n=0),s===void 0&&(s=0),isNaN(i)||i<0||isNaN(o)||o<0||isNaN(n)||n<0||isNaN(s)||s<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=i,this.bottom=o,this.left=n,this.right=s};Qn.prototype.interpolate=function(i,o,n){return o.top!=null&&i.top!=null&&(this.top=u.number(i.top,o.top,n)),o.bottom!=null&&i.bottom!=null&&(this.bottom=u.number(i.bottom,o.bottom,n)),o.left!=null&&i.left!=null&&(this.left=u.number(i.left,o.left,n)),o.right!=null&&i.right!=null&&(this.right=u.number(i.right,o.right,n)),this},Qn.prototype.getCenter=function(i,o){var n=u.clamp((this.left+i-this.right)/2,0,i),s=u.clamp((this.top+o-this.bottom)/2,0,o);return new u.Point(n,s)},Qn.prototype.equals=function(i){return this.top===i.top&&this.bottom===i.bottom&&this.left===i.left&&this.right===i.right},Qn.prototype.clone=function(){return new Qn(this.top,this.bottom,this.left,this.right)},Qn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Dt=function(i,o,n,s,p){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=p===void 0||p,this._minZoom=i||0,this._maxZoom=o||22,this._minPitch=n??0,this._maxPitch=s??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new u.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Qn,this._posMatrixCache={},this._alignedPosMatrixCache={}},lr={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Dt.prototype.clone=function(){var i=new Dt(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return i.tileSize=this.tileSize,i.latRange=this.latRange,i.width=this.width,i.height=this.height,i._center=this._center,i.zoom=this.zoom,i.angle=this.angle,i._fov=this._fov,i._pitch=this._pitch,i._unmodified=this._unmodified,i._edgeInsets=this._edgeInsets.clone(),i._calcMatrices(),i},lr.minZoom.get=function(){return this._minZoom},lr.minZoom.set=function(i){this._minZoom!==i&&(this._minZoom=i,this.zoom=Math.max(this.zoom,i))},lr.maxZoom.get=function(){return this._maxZoom},lr.maxZoom.set=function(i){this._maxZoom!==i&&(this._maxZoom=i,this.zoom=Math.min(this.zoom,i))},lr.minPitch.get=function(){return this._minPitch},lr.minPitch.set=function(i){this._minPitch!==i&&(this._minPitch=i,this.pitch=Math.max(this.pitch,i))},lr.maxPitch.get=function(){return this._maxPitch},lr.maxPitch.set=function(i){this._maxPitch!==i&&(this._maxPitch=i,this.pitch=Math.min(this.pitch,i))},lr.renderWorldCopies.get=function(){return this._renderWorldCopies},lr.renderWorldCopies.set=function(i){i===void 0?i=!0:i===null&&(i=!1),this._renderWorldCopies=i},lr.worldSize.get=function(){return this.tileSize*this.scale},lr.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},lr.size.get=function(){return new u.Point(this.width,this.height)},lr.bearing.get=function(){return-this.angle/Math.PI*180},lr.bearing.set=function(i){var o=-u.wrap(i,-180,180)*Math.PI/180;this.angle!==o&&(this._unmodified=!1,this.angle=o,this._calcMatrices(),this.rotationMatrix=u.create$2(),u.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},lr.pitch.get=function(){return this._pitch/Math.PI*180},lr.pitch.set=function(i){var o=u.clamp(i,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==o&&(this._unmodified=!1,this._pitch=o,this._calcMatrices())},lr.fov.get=function(){return this._fov/Math.PI*180},lr.fov.set=function(i){i=Math.max(.01,Math.min(60,i)),this._fov!==i&&(this._unmodified=!1,this._fov=i/180*Math.PI,this._calcMatrices())},lr.zoom.get=function(){return this._zoom},lr.zoom.set=function(i){var o=Math.min(Math.max(i,this.minZoom),this.maxZoom);this._zoom!==o&&(this._unmodified=!1,this._zoom=o,this.scale=this.zoomScale(o),this.tileZoom=Math.floor(o),this.zoomFraction=o-this.tileZoom,this._constrain(),this._calcMatrices())},lr.center.get=function(){return this._center},lr.center.set=function(i){i.lat===this._center.lat&&i.lng===this._center.lng||(this._unmodified=!1,this._center=i,this._constrain(),this._calcMatrices())},lr.padding.get=function(){return this._edgeInsets.toJSON()},lr.padding.set=function(i){this._edgeInsets.equals(i)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,i,1),this._calcMatrices())},lr.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Dt.prototype.isPaddingEqual=function(i){return this._edgeInsets.equals(i)},Dt.prototype.interpolatePadding=function(i,o,n){this._unmodified=!1,this._edgeInsets.interpolate(i,o,n),this._constrain(),this._calcMatrices()},Dt.prototype.coveringZoomLevel=function(i){var o=(i.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/i.tileSize));return Math.max(0,o)},Dt.prototype.getVisibleUnwrappedCoordinates=function(i){var o=[new u.UnwrappedTileID(0,i)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new u.Point(0,0)),s=this.pointCoordinate(new u.Point(this.width,0)),p=this.pointCoordinate(new u.Point(this.width,this.height)),f=this.pointCoordinate(new u.Point(0,this.height)),d=Math.floor(Math.min(n.x,s.x,p.x,f.x)),v=Math.floor(Math.max(n.x,s.x,p.x,f.x)),w=d-1;w<=v+1;w++)w!==0&&o.push(new u.UnwrappedTileID(w,i));return o},Dt.prototype.coveringTiles=function(i){var o=this.coveringZoomLevel(i),n=o;if(i.minzoom!==void 0&&o<i.minzoom)return[];i.maxzoom!==void 0&&o>i.maxzoom&&(o=i.maxzoom);var s=u.MercatorCoordinate.fromLngLat(this.center),p=Math.pow(2,o),f=[p*s.x,p*s.y,0],d=ls.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,o),v=i.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(v=o);var w=function(Ce){return{aabb:new ko([Ce*p,0,0],[(Ce+1)*p,p,0]),zoom:0,x:0,y:0,wrap:Ce,fullyVisible:!1}},A=[],R=[],F=o,O=i.reparseOverscaled?n:o;if(this._renderWorldCopies)for(var W=1;W<=3;W++)A.push(w(-W)),A.push(w(W));for(A.push(w(0));A.length>0;){var Z=A.pop(),ee=Z.x,N=Z.y,Q=Z.fullyVisible;if(!Q){var ne=Z.aabb.intersects(d);if(ne===0)continue;Q=ne===2}var ue=Z.aabb.distanceX(f),me=Z.aabb.distanceY(f),pe=Math.max(Math.abs(ue),Math.abs(me));if(Z.zoom===F||pe>3+(1<<F-Z.zoom)-2&&Z.zoom>=v)R.push({tileID:new u.OverscaledTileID(Z.zoom===F?O:Z.zoom,Z.wrap,Z.zoom,ee,N),distanceSq:u.sqrLen([f[0]-.5-ee,f[1]-.5-N])});else for(var ve=0;ve<4;ve++){var Te=(ee<<1)+ve%2,ke=(N<<1)+(ve>>1);A.push({aabb:Z.aabb.quadrant(ve),zoom:Z.zoom+1,x:Te,y:ke,wrap:Z.wrap,fullyVisible:Q})}}return R.sort((function(Ce,$e){return Ce.distanceSq-$e.distanceSq})).map((function(Ce){return Ce.tileID}))},Dt.prototype.resize=function(i,o){this.width=i,this.height=o,this.pixelsToGLUnits=[2/i,-2/o],this._constrain(),this._calcMatrices()},lr.unmodified.get=function(){return this._unmodified},Dt.prototype.zoomScale=function(i){return Math.pow(2,i)},Dt.prototype.scaleZoom=function(i){return Math.log(i)/Math.LN2},Dt.prototype.project=function(i){var o=u.clamp(i.lat,-this.maxValidLatitude,this.maxValidLatitude);return new u.Point(u.mercatorXfromLng(i.lng)*this.worldSize,u.mercatorYfromLat(o)*this.worldSize)},Dt.prototype.unproject=function(i){return new u.MercatorCoordinate(i.x/this.worldSize,i.y/this.worldSize).toLngLat()},lr.point.get=function(){return this.project(this.center)},Dt.prototype.setLocationAtPoint=function(i,o){var n=this.pointCoordinate(o),s=this.pointCoordinate(this.centerPoint),p=this.locationCoordinate(i),f=new u.MercatorCoordinate(p.x-(n.x-s.x),p.y-(n.y-s.y));this.center=this.coordinateLocation(f),this._renderWorldCopies&&(this.center=this.center.wrap())},Dt.prototype.locationPoint=function(i){return this.coordinatePoint(this.locationCoordinate(i))},Dt.prototype.pointLocation=function(i){return this.coordinateLocation(this.pointCoordinate(i))},Dt.prototype.locationCoordinate=function(i){return u.MercatorCoordinate.fromLngLat(i)},Dt.prototype.coordinateLocation=function(i){return i.toLngLat()},Dt.prototype.pointCoordinate=function(i){var o=[i.x,i.y,0,1],n=[i.x,i.y,1,1];u.transformMat4(o,o,this.pixelMatrixInverse),u.transformMat4(n,n,this.pixelMatrixInverse);var s=o[3],p=n[3],f=o[1]/s,d=n[1]/p,v=o[2]/s,w=n[2]/p,A=v===w?0:(0-v)/(w-v);return new u.MercatorCoordinate(u.number(o[0]/s,n[0]/p,A)/this.worldSize,u.number(f,d,A)/this.worldSize)},Dt.prototype.coordinatePoint=function(i){var o=[i.x*this.worldSize,i.y*this.worldSize,0,1];return u.transformMat4(o,o,this.pixelMatrix),new u.Point(o[0]/o[3],o[1]/o[3])},Dt.prototype.getBounds=function(){return new u.LngLatBounds().extend(this.pointLocation(new u.Point(0,0))).extend(this.pointLocation(new u.Point(this.width,0))).extend(this.pointLocation(new u.Point(this.width,this.height))).extend(this.pointLocation(new u.Point(0,this.height)))},Dt.prototype.getMaxBounds=function(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new u.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Dt.prototype.setMaxBounds=function(i){i?(this.lngRange=[i.getWest(),i.getEast()],this.latRange=[i.getSouth(),i.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Dt.prototype.calculatePosMatrix=function(i,o){o===void 0&&(o=!1);var n=i.key,s=o?this._alignedPosMatrixCache:this._posMatrixCache;if(s[n])return s[n];var p=i.canonical,f=this.worldSize/this.zoomScale(p.z),d=p.x+Math.pow(2,p.z)*i.wrap,v=u.identity(new Float64Array(16));return u.translate(v,v,[d*f,p.y*f,0]),u.scale(v,v,[f/u.EXTENT,f/u.EXTENT,1]),u.multiply(v,o?this.alignedProjMatrix:this.projMatrix,v),s[n]=new Float32Array(v),s[n]},Dt.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Dt.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var i,o,n,s,p=-90,f=90,d=-180,v=180,w=this.size,A=this._unmodified;if(this.latRange){var R=this.latRange;p=u.mercatorYfromLat(R[1])*this.worldSize,i=(f=u.mercatorYfromLat(R[0])*this.worldSize)-p<w.y?w.y/(f-p):0}if(this.lngRange){var F=this.lngRange;d=u.mercatorXfromLng(F[0])*this.worldSize,o=(v=u.mercatorXfromLng(F[1])*this.worldSize)-d<w.x?w.x/(v-d):0}var O=this.point,W=Math.max(o||0,i||0);if(W)return this.center=this.unproject(new u.Point(o?(v+d)/2:O.x,i?(f+p)/2:O.y)),this.zoom+=this.scaleZoom(W),this._unmodified=A,void(this._constraining=!1);if(this.latRange){var Z=O.y,ee=w.y/2;Z-ee<p&&(s=p+ee),Z+ee>f&&(s=f-ee)}if(this.lngRange){var N=O.x,Q=w.x/2;N-Q<d&&(n=d+Q),N+Q>v&&(n=v-Q)}n===void 0&&s===void 0||(this.center=this.unproject(new u.Point(n!==void 0?n:O.x,s!==void 0?s:O.y))),this._unmodified=A,this._constraining=!1}},Dt.prototype._calcMatrices=function(){if(this.height){var i=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var o=Math.PI/2+this._pitch,n=this._fov*(.5+i.y/this.height),s=Math.sin(n)*this.cameraToCenterDistance/Math.sin(u.clamp(Math.PI-o-n,.01,Math.PI-.01)),p=this.point,f=p.x,d=p.y,v=1.01*(Math.cos(Math.PI/2-this._pitch)*s+this.cameraToCenterDistance),w=this.height/50,A=new Float64Array(16);u.perspective(A,this._fov,this.width/this.height,w,v),A[8]=2*-i.x/this.width,A[9]=2*i.y/this.height,u.scale(A,A,[1,-1,1]),u.translate(A,A,[0,0,-this.cameraToCenterDistance]),u.rotateX(A,A,this._pitch),u.rotateZ(A,A,this.angle),u.translate(A,A,[-f,-d,0]),this.mercatorMatrix=u.scale([],A,[this.worldSize,this.worldSize,this.worldSize]),u.scale(A,A,[1,1,u.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=A,this.invProjMatrix=u.invert([],this.projMatrix);var R=this.width%2/2,F=this.height%2/2,O=Math.cos(this.angle),W=Math.sin(this.angle),Z=f-Math.round(f)+O*R+W*F,ee=d-Math.round(d)+O*F+W*R,N=new Float64Array(A);if(u.translate(N,N,[Z>.5?Z-1:Z,ee>.5?ee-1:ee,0]),this.alignedProjMatrix=N,A=u.create(),u.scale(A,A,[this.width/2,-this.height/2,1]),u.translate(A,A,[1,-1,0]),this.labelPlaneMatrix=A,A=u.create(),u.scale(A,A,[1,-1,1]),u.translate(A,A,[-1,-1,0]),u.scale(A,A,[2/this.width,2/this.height,1]),this.glCoordMatrix=A,this.pixelMatrix=u.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(A=u.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=A,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Dt.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var i=this.pointCoordinate(new u.Point(0,0)),o=[i.x*this.worldSize,i.y*this.worldSize,0,1];return u.transformMat4(o,o,this.pixelMatrix)[3]/this.cameraToCenterDistance},Dt.prototype.getCameraPoint=function(){var i=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new u.Point(0,i))},Dt.prototype.getCameraQueryGeometry=function(i){var o=this.getCameraPoint();if(i.length===1)return[i[0],o];for(var n=o.x,s=o.y,p=o.x,f=o.y,d=0,v=i;d<v.length;d+=1){var w=v[d];n=Math.min(n,w.x),s=Math.min(s,w.y),p=Math.max(p,w.x),f=Math.max(f,w.y)}return[new u.Point(n,s),new u.Point(p,s),new u.Point(p,f),new u.Point(n,f),new u.Point(n,s)]},Object.defineProperties(Dt.prototype,lr);var Yi=function(i){var o,n,s,p;this._hashName=i&&encodeURIComponent(i),u.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(o=this._updateHashUnthrottled.bind(this),n=!1,s=null,p=function(){s=null,n&&(o(),s=setTimeout(p,300),n=!1)},function(){return n=!0,s||p(),s})};Yi.prototype.addTo=function(i){return this._map=i,u.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},Yi.prototype.remove=function(){return u.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},Yi.prototype.getHashString=function(i){var o=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,s=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),p=Math.pow(10,s),f=Math.round(o.lng*p)/p,d=Math.round(o.lat*p)/p,v=this._map.getBearing(),w=this._map.getPitch(),A="";if(A+=i?"/"+f+"/"+d+"/"+n:n+"/"+d+"/"+f,(v||w)&&(A+="/"+Math.round(10*v)/10),w&&(A+="/"+Math.round(w)),this._hashName){var R=this._hashName,F=!1,O=u.window.location.hash.slice(1).split("&").map((function(W){var Z=W.split("=")[0];return Z===R?(F=!0,Z+"="+A):W})).filter((function(W){return W}));return F||O.push(R+"="+A),"#"+O.join("&")}return"#"+A},Yi.prototype._getCurrentHash=function(){var i,o=this,n=u.window.location.hash.replace("#","");return this._hashName?(n.split("&").map((function(s){return s.split("=")})).forEach((function(s){s[0]===o._hashName&&(i=s)})),(i&&i[1]||"").split("/")):n.split("/")},Yi.prototype._onHashChange=function(){var i=this._getCurrentHash();if(i.length>=3&&!i.some((function(n){return isNaN(n)}))){var o=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(i[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+i[2],+i[1]],zoom:+i[0],bearing:o,pitch:+(i[4]||0)}),!0}return!1},Yi.prototype._updateHashUnthrottled=function(){var i=u.window.location.href.replace(/(#.+)?$/,this.getHashString());try{u.window.history.replaceState(u.window.history.state,null,i)}catch{}};var Aa={linearity:.3,easing:u.bezier(0,0,.3,1)},Qo=u.extend({deceleration:2500,maxSpeed:1400},Aa),Ea=u.extend({deceleration:20,maxSpeed:1400},Aa),qc=u.extend({deceleration:1e3,maxSpeed:360},Aa),Uc=u.extend({deceleration:1e3,maxSpeed:90},Aa),Pa=function(i){this._map=i,this.clear()};function Ca(i,o){(!i.duration||i.duration<o.duration)&&(i.duration=o.duration,i.easing=o.easing)}function Rn(i,o,n){var s=n.maxSpeed,p=n.linearity,f=n.deceleration,d=u.clamp(i*p/(o/1e3),-s,s),v=Math.abs(d)/(f*p);return{easing:n.easing,duration:1e3*v,amount:d*(v/2)}}Pa.prototype.clear=function(){this._inertiaBuffer=[]},Pa.prototype.record=function(i){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:u.browser.now(),settings:i})},Pa.prototype._drainInertiaBuffer=function(){for(var i=this._inertiaBuffer,o=u.browser.now();i.length>0&&o-i[0].time>160;)i.shift()},Pa.prototype._onMoveEnd=function(i){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var o={zoom:0,bearing:0,pitch:0,pan:new u.Point(0,0),pinchAround:void 0,around:void 0},n=0,s=this._inertiaBuffer;n<s.length;n+=1){var p=s[n].settings;o.zoom+=p.zoomDelta||0,o.bearing+=p.bearingDelta||0,o.pitch+=p.pitchDelta||0,p.panDelta&&o.pan._add(p.panDelta),p.around&&(o.around=p.around),p.pinchAround&&(o.pinchAround=p.pinchAround)}var f=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,d={};if(o.pan.mag()){var v=Rn(o.pan.mag(),f,u.extend({},Qo,i||{}));d.offset=o.pan.mult(v.amount/o.pan.mag()),d.center=this._map.transform.center,Ca(d,v)}if(o.zoom){var w=Rn(o.zoom,f,Ea);d.zoom=this._map.transform.zoom+w.amount,Ca(d,w)}if(o.bearing){var A=Rn(o.bearing,f,qc);d.bearing=this._map.transform.bearing+u.clamp(A.amount,-179,179),Ca(d,A)}if(o.pitch){var R=Rn(o.pitch,f,Uc);d.pitch=this._map.transform.pitch+R.amount,Ca(d,R)}if(d.zoom||d.bearing){var F=o.pinchAround===void 0?o.around:o.pinchAround;d.around=F?this._map.unproject(F):this._map.getCenter()}return this.clear(),u.extend(d,{noMoveStart:!0})}};var Gr=(function(i){function o(s,p,f,d){d===void 0&&(d={});var v=M.mousePos(p.getCanvasContainer(),f),w=p.unproject(v);i.call(this,s,u.extend({point:v,lngLat:w,originalEvent:f},d)),this._defaultPrevented=!1,this.target=p}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={defaultPrevented:{configurable:!0}};return o.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(o.prototype,n),o})(u.Event),ka=(function(i){function o(s,p,f){var d=s==="touchend"?f.changedTouches:f.touches,v=M.touchPos(p.getCanvasContainer(),d),w=v.map((function(F){return p.unproject(F)})),A=v.reduce((function(F,O,W,Z){return F.add(O.div(Z.length))}),new u.Point(0,0)),R=p.unproject(A);i.call(this,s,{points:v,point:A,lngLats:w,lngLat:R,originalEvent:f}),this._defaultPrevented=!1}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={defaultPrevented:{configurable:!0}};return o.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(o.prototype,n),o})(u.Event),Dl=(function(i){function o(s,p,f){i.call(this,s,{originalEvent:f}),this._defaultPrevented=!1}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={defaultPrevented:{configurable:!0}};return o.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(o.prototype,n),o})(u.Event),qr=function(i,o){this._map=i,this._clickTolerance=o.clickTolerance};qr.prototype.reset=function(){delete this._mousedownPos},qr.prototype.wheel=function(i){return this._firePreventable(new Dl(i.type,this._map,i))},qr.prototype.mousedown=function(i,o){return this._mousedownPos=o,this._firePreventable(new Gr(i.type,this._map,i))},qr.prototype.mouseup=function(i){this._map.fire(new Gr(i.type,this._map,i))},qr.prototype.click=function(i,o){this._mousedownPos&&this._mousedownPos.dist(o)>=this._clickTolerance||this._map.fire(new Gr(i.type,this._map,i))},qr.prototype.dblclick=function(i){return this._firePreventable(new Gr(i.type,this._map,i))},qr.prototype.mouseover=function(i){this._map.fire(new Gr(i.type,this._map,i))},qr.prototype.mouseout=function(i){this._map.fire(new Gr(i.type,this._map,i))},qr.prototype.touchstart=function(i){return this._firePreventable(new ka(i.type,this._map,i))},qr.prototype.touchmove=function(i){this._map.fire(new ka(i.type,this._map,i))},qr.prototype.touchend=function(i){this._map.fire(new ka(i.type,this._map,i))},qr.prototype.touchcancel=function(i){this._map.fire(new ka(i.type,this._map,i))},qr.prototype._firePreventable=function(i){if(this._map.fire(i),i.defaultPrevented)return{}},qr.prototype.isEnabled=function(){return!0},qr.prototype.isActive=function(){return!1},qr.prototype.enable=function(){},qr.prototype.disable=function(){};var Xe=function(i){this._map=i};Xe.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Xe.prototype.mousemove=function(i){this._map.fire(new Gr(i.type,this._map,i))},Xe.prototype.mousedown=function(){this._delayContextMenu=!0},Xe.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Gr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Xe.prototype.contextmenu=function(i){this._delayContextMenu?this._contextMenuEvent=i:this._map.fire(new Gr(i.type,this._map,i)),this._map.listens("contextmenu")&&i.preventDefault()},Xe.prototype.isEnabled=function(){return!0},Xe.prototype.isActive=function(){return!1},Xe.prototype.enable=function(){},Xe.prototype.disable=function(){};var Ni=function(i,o){this._map=i,this._el=i.getCanvasContainer(),this._container=i.getContainer(),this._clickTolerance=o.clickTolerance||1};function cs(i,o){for(var n={},s=0;s<i.length;s++)n[i[s].identifier]=o[s];return n}Ni.prototype.isEnabled=function(){return!!this._enabled},Ni.prototype.isActive=function(){return!!this._active},Ni.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Ni.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Ni.prototype.mousedown=function(i,o){this.isEnabled()&&i.shiftKey&&i.button===0&&(M.disableDrag(),this._startPos=this._lastPos=o,this._active=!0)},Ni.prototype.mousemoveWindow=function(i,o){if(this._active){var n=o;if(!(this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)){var s=this._startPos;this._lastPos=n,this._box||(this._box=M.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",i));var p=Math.min(s.x,n.x),f=Math.max(s.x,n.x),d=Math.min(s.y,n.y),v=Math.max(s.y,n.y);M.setTransform(this._box,"translate("+p+"px,"+d+"px)"),this._box.style.width=f-p+"px",this._box.style.height=v-d+"px"}}},Ni.prototype.mouseupWindow=function(i,o){var n=this;if(this._active&&i.button===0){var s=this._startPos,p=o;if(this.reset(),M.suppressClick(),s.x!==p.x||s.y!==p.y)return this._map.fire(new u.Event("boxzoomend",{originalEvent:i})),{cameraAnimation:function(f){return f.fitScreenCoordinates(s,p,n._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",i)}},Ni.prototype.keydown=function(i){this._active&&i.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",i))},Ni.prototype.blur=function(){this.reset()},Ni.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(M.remove(this._box),this._box=null),M.enableDrag(),delete this._startPos,delete this._lastPos},Ni.prototype._fireEvent=function(i,o){return this._map.fire(new u.Event(i,{originalEvent:o}))};var ea=function(i){this.reset(),this.numTouches=i.numTouches};ea.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},ea.prototype.touchstart=function(i,o,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=i.timeStamp),n.length===this.numTouches&&(this.centroid=(function(s){for(var p=new u.Point(0,0),f=0,d=s;f<d.length;f+=1)p._add(d[f]);return p.div(s.length)})(o),this.touches=cs(n,o)))},ea.prototype.touchmove=function(i,o,n){if(!this.aborted&&this.centroid){var s=cs(n,o);for(var p in this.touches){var f=s[p];(!f||f.dist(this.touches[p])>30)&&(this.aborted=!0)}}},ea.prototype.touchend=function(i,o,n){if((!this.centroid||i.timeStamp-this.startTime>500)&&(this.aborted=!0),n.length===0){var s=!this.aborted&&this.centroid;if(this.reset(),s)return s}};var gn=function(i){this.singleTap=new ea(i),this.numTaps=i.numTaps,this.reset()};gn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},gn.prototype.touchstart=function(i,o,n){this.singleTap.touchstart(i,o,n)},gn.prototype.touchmove=function(i,o,n){this.singleTap.touchmove(i,o,n)},gn.prototype.touchend=function(i,o,n){var s=this.singleTap.touchend(i,o,n);if(s){var p=i.timeStamp-this.lastTime<500,f=!this.lastTap||this.lastTap.dist(s)<30;if(p&&f||this.reset(),this.count++,this.lastTime=i.timeStamp,this.lastTap=s,this.count===this.numTaps)return this.reset(),s}};var ji=function(){this._zoomIn=new gn({numTouches:1,numTaps:2}),this._zoomOut=new gn({numTouches:2,numTaps:1}),this.reset()};ji.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},ji.prototype.touchstart=function(i,o,n){this._zoomIn.touchstart(i,o,n),this._zoomOut.touchstart(i,o,n)},ji.prototype.touchmove=function(i,o,n){this._zoomIn.touchmove(i,o,n),this._zoomOut.touchmove(i,o,n)},ji.prototype.touchend=function(i,o,n){var s=this,p=this._zoomIn.touchend(i,o,n),f=this._zoomOut.touchend(i,o,n);return p?(this._active=!0,i.preventDefault(),setTimeout((function(){return s.reset()}),0),{cameraAnimation:function(d){return d.easeTo({duration:300,zoom:d.getZoom()+1,around:d.unproject(p)},{originalEvent:i})}}):f?(this._active=!0,i.preventDefault(),setTimeout((function(){return s.reset()}),0),{cameraAnimation:function(d){return d.easeTo({duration:300,zoom:d.getZoom()-1,around:d.unproject(f)},{originalEvent:i})}}):void 0},ji.prototype.touchcancel=function(){this.reset()},ji.prototype.enable=function(){this._enabled=!0},ji.prototype.disable=function(){this._enabled=!1,this.reset()},ji.prototype.isEnabled=function(){return this._enabled},ji.prototype.isActive=function(){return this._active};var yu={0:1,2:2},Re=function(i){this.reset(),this._clickTolerance=i.clickTolerance||1};Re.prototype.blur=function(){this.reset()},Re.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Re.prototype._correctButton=function(i,o){return!1},Re.prototype._move=function(i,o){return{}},Re.prototype.mousedown=function(i,o){if(!this._lastPoint){var n=M.mouseButton(i);this._correctButton(i,n)&&(this._lastPoint=o,this._eventButton=n)}},Re.prototype.mousemoveWindow=function(i,o){var n=this._lastPoint;if(n){if(i.preventDefault(),(function(s,p){var f=yu[p];return s.buttons===void 0||(s.buttons&f)!==f})(i,this._eventButton))this.reset();else if(this._moved||!(o.dist(n)<this._clickTolerance))return this._moved=!0,this._lastPoint=o,this._move(n,o)}},Re.prototype.mouseupWindow=function(i){this._lastPoint&&M.mouseButton(i)===this._eventButton&&(this._moved&&M.suppressClick(),this.reset())},Re.prototype.enable=function(){this._enabled=!0},Re.prototype.disable=function(){this._enabled=!1,this.reset()},Re.prototype.isEnabled=function(){return this._enabled},Re.prototype.isActive=function(){return this._active};var vu=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.mousedown=function(n,s){i.prototype.mousedown.call(this,n,s),this._lastPoint&&(this._active=!0)},o.prototype._correctButton=function(n,s){return s===0&&!n.ctrlKey},o.prototype._move=function(n,s){return{around:s,panDelta:s.sub(n)}},o})(Re),ps=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype._correctButton=function(n,s){return s===0&&n.ctrlKey||s===2},o.prototype._move=function(n,s){var p=.8*(s.x-n.x);if(p)return this._active=!0,{bearingDelta:p}},o.prototype.contextmenu=function(n){n.preventDefault()},o})(Re),gu=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype._correctButton=function(n,s){return s===0&&n.ctrlKey||s===2},o.prototype._move=function(n,s){var p=-.5*(s.y-n.y);if(p)return this._active=!0,{pitchDelta:p}},o.prototype.contextmenu=function(n){n.preventDefault()},o})(Re),sn=function(i){this._minTouches=1,this._clickTolerance=i.clickTolerance||1,this.reset()};sn.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new u.Point(0,0)},sn.prototype.touchstart=function(i,o,n){return this._calculateTransform(i,o,n)},sn.prototype.touchmove=function(i,o,n){if(this._active&&!(n.length<this._minTouches))return i.preventDefault(),this._calculateTransform(i,o,n)},sn.prototype.touchend=function(i,o,n){this._calculateTransform(i,o,n),this._active&&n.length<this._minTouches&&this.reset()},sn.prototype.touchcancel=function(){this.reset()},sn.prototype._calculateTransform=function(i,o,n){n.length>0&&(this._active=!0);var s=cs(n,o),p=new u.Point(0,0),f=new u.Point(0,0),d=0;for(var v in s){var w=s[v],A=this._touches[v];A&&(p._add(w),f._add(w.sub(A)),d++,s[v]=w)}if(this._touches=s,!(d<this._minTouches)&&f.mag()){var R=f.div(d);if(this._sum._add(R),!(this._sum.mag()<this._clickTolerance))return{around:p.div(d),panDelta:R}}},sn.prototype.enable=function(){this._enabled=!0},sn.prototype.disable=function(){this._enabled=!1,this.reset()},sn.prototype.isEnabled=function(){return this._enabled},sn.prototype.isActive=function(){return this._active};var Gi=function(){this.reset()};function hs(i,o,n){for(var s=0;s<i.length;s++)if(i[s].identifier===n)return o[s]}function fs(i,o){return Math.log(i/o)/Math.LN2}Gi.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},Gi.prototype._start=function(i){},Gi.prototype._move=function(i,o,n){return{}},Gi.prototype.touchstart=function(i,o,n){this._firstTwoTouches||n.length<2||(this._firstTwoTouches=[n[0].identifier,n[1].identifier],this._start([o[0],o[1]]))},Gi.prototype.touchmove=function(i,o,n){if(this._firstTwoTouches){i.preventDefault();var s=this._firstTwoTouches,p=s[1],f=hs(n,o,s[0]),d=hs(n,o,p);if(f&&d){var v=this._aroundCenter?null:f.add(d).div(2);return this._move([f,d],v,i)}}},Gi.prototype.touchend=function(i,o,n){if(this._firstTwoTouches){var s=this._firstTwoTouches,p=s[1],f=hs(n,o,s[0]),d=hs(n,o,p);f&&d||(this._active&&M.suppressClick(),this.reset())}},Gi.prototype.touchcancel=function(){this.reset()},Gi.prototype.enable=function(i){this._enabled=!0,this._aroundCenter=!!i&&i.around==="center"},Gi.prototype.disable=function(){this._enabled=!1,this.reset()},Gi.prototype.isEnabled=function(){return this._enabled},Gi.prototype.isActive=function(){return this._active};var $i=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.reset=function(){i.prototype.reset.call(this),delete this._distance,delete this._startDistance},o.prototype._start=function(n){this._startDistance=this._distance=n[0].dist(n[1])},o.prototype._move=function(n,s){var p=this._distance;if(this._distance=n[0].dist(n[1]),this._active||!(Math.abs(fs(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:fs(this._distance,p),pinchAround:s}},o})(Gi);function Ln(i,o){return 180*i.angleWith(o)/Math.PI}var Rl=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.reset=function(){i.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},o.prototype._start=function(n){this._startVector=this._vector=n[0].sub(n[1]),this._minDiameter=n[0].dist(n[1])},o.prototype._move=function(n,s){var p=this._vector;if(this._vector=n[0].sub(n[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Ln(this._vector,p),pinchAround:s}},o.prototype._isBelowThreshold=function(n){this._minDiameter=Math.min(this._minDiameter,n.mag());var s=25/(Math.PI*this._minDiameter)*360,p=Ln(n,this._startVector);return Math.abs(p)<s},o})(Gi);function Ma(i){return Math.abs(i.y)>Math.abs(i.x)}var _u=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.reset=function(){i.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},o.prototype._start=function(n){this._lastPoints=n,Ma(n[0].sub(n[1]))&&(this._valid=!1)},o.prototype._move=function(n,s,p){var f=n[0].sub(this._lastPoints[0]),d=n[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(f,d,p.timeStamp),this._valid)return this._lastPoints=n,this._active=!0,{pitchDelta:(f.y+d.y)/2*-.5}},o.prototype.gestureBeginsVertically=function(n,s,p){if(this._valid!==void 0)return this._valid;var f=n.mag()>=2,d=s.mag()>=2;if(f||d){if(!f||!d)return this._firstMove===void 0&&(this._firstMove=p),p-this._firstMove<100&&void 0;var v=n.y>0==s.y>0;return Ma(n)&&Ma(s)&&v}},o})(Gi),xu={panStep:100,bearingStep:15,pitchStep:10},_n=function(){var i=xu;this._panStep=i.panStep,this._bearingStep=i.bearingStep,this._pitchStep=i.pitchStep,this._rotationDisabled=!1};function Qi(i){return i*(2-i)}_n.prototype.blur=function(){this.reset()},_n.prototype.reset=function(){this._active=!1},_n.prototype.keydown=function(i){var o=this;if(!(i.altKey||i.ctrlKey||i.metaKey)){var n=0,s=0,p=0,f=0,d=0;switch(i.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:i.shiftKey?s=-1:(i.preventDefault(),f=-1);break;case 39:i.shiftKey?s=1:(i.preventDefault(),f=1);break;case 38:i.shiftKey?p=1:(i.preventDefault(),d=-1);break;case 40:i.shiftKey?p=-1:(i.preventDefault(),d=1);break;default:return}return this._rotationDisabled&&(s=0,p=0),{cameraAnimation:function(v){var w=v.getZoom();v.easeTo({duration:300,easeId:"keyboardHandler",easing:Qi,zoom:n?Math.round(w)+n*(i.shiftKey?2:1):w,bearing:v.getBearing()+s*o._bearingStep,pitch:v.getPitch()+p*o._pitchStep,offset:[-f*o._panStep,-d*o._panStep],center:v.getCenter()},{originalEvent:i})}}}},_n.prototype.enable=function(){this._enabled=!0},_n.prototype.disable=function(){this._enabled=!1,this.reset()},_n.prototype.isEnabled=function(){return this._enabled},_n.prototype.isActive=function(){return this._active},_n.prototype.disableRotation=function(){this._rotationDisabled=!0},_n.prototype.enableRotation=function(){this._rotationDisabled=!1};var kt=function(i,o){this._map=i,this._el=i.getCanvasContainer(),this._handler=o,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,u.bindAll(["_onTimeout"],this)};kt.prototype.setZoomRate=function(i){this._defaultZoomRate=i},kt.prototype.setWheelZoomRate=function(i){this._wheelZoomRate=i},kt.prototype.isEnabled=function(){return!!this._enabled},kt.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},kt.prototype.isZooming=function(){return!!this._zooming},kt.prototype.enable=function(i){this.isEnabled()||(this._enabled=!0,this._aroundCenter=i&&i.around==="center")},kt.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},kt.prototype.wheel=function(i){if(this.isEnabled()){var o=i.deltaMode===u.window.WheelEvent.DOM_DELTA_LINE?40*i.deltaY:i.deltaY,n=u.browser.now(),s=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,o!==0&&o%4.000244140625==0?this._type="wheel":o!==0&&Math.abs(o)<4?this._type="trackpad":s>400?(this._type=null,this._lastValue=o,this._timeout=setTimeout(this._onTimeout,40,i)):this._type||(this._type=Math.abs(s*o)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,o+=this._lastValue)),i.shiftKey&&o&&(o/=4),this._type&&(this._lastWheelEvent=i,this._delta-=o,this._active||this._start(i)),i.preventDefault()}},kt.prototype._onTimeout=function(i){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(i)},kt.prototype._start=function(i){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var o=M.mousePos(this._el,i);this._around=u.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(o)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},kt.prototype.renderFrame=function(){var i=this;if(this._frameId&&(this._frameId=null,this.isActive())){var o=this._map.transform;if(this._delta!==0){var n=this._type==="wheel"&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,s=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&s!==0&&(s=1/s);var p=typeof this._targetZoom=="number"?o.zoomScale(this._targetZoom):o.scale;this._targetZoom=Math.min(o.maxZoom,Math.max(o.minZoom,o.scaleZoom(p*s))),this._type==="wheel"&&(this._startZoom=o.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var f,d=typeof this._targetZoom=="number"?this._targetZoom:o.zoom,v=this._startZoom,w=this._easing,A=!1;if(this._type==="wheel"&&v&&w){var R=Math.min((u.browser.now()-this._lastWheelEventTime)/200,1),F=w(R);f=u.number(v,d,F),R<1?this._frameId||(this._frameId=!0):A=!0}else f=d,A=!0;return this._active=!0,A&&(this._active=!1,this._finishTimeout=setTimeout((function(){i._zooming=!1,i._handler._triggerRenderFrame(),delete i._targetZoom,delete i._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!A,zoomDelta:f-o.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},kt.prototype._smoothOutEasing=function(i){var o=u.ease;if(this._prevEase){var n=this._prevEase,s=(u.browser.now()-n.start)/n.duration,p=n.easing(s+.01)-n.easing(s),f=.27/Math.sqrt(p*p+1e-4)*.01,d=Math.sqrt(.0729-f*f);o=u.bezier(f,d,.25,1)}return this._prevEase={start:u.browser.now(),duration:i,easing:o},o},kt.prototype.blur=function(){this.reset()},kt.prototype.reset=function(){this._active=!1};var Tn=function(i,o){this._clickZoom=i,this._tapZoom=o};Tn.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Tn.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Tn.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Tn.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var un=function(){this.reset()};un.prototype.reset=function(){this._active=!1},un.prototype.blur=function(){this.reset()},un.prototype.dblclick=function(i,o){return i.preventDefault(),{cameraAnimation:function(n){n.easeTo({duration:300,zoom:n.getZoom()+(i.shiftKey?-1:1),around:n.unproject(o)},{originalEvent:i})}}},un.prototype.enable=function(){this._enabled=!0},un.prototype.disable=function(){this._enabled=!1,this.reset()},un.prototype.isEnabled=function(){return this._enabled},un.prototype.isActive=function(){return this._active};var yi=function(){this._tap=new gn({numTouches:1,numTaps:1}),this.reset()};yi.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},yi.prototype.touchstart=function(i,o,n){this._swipePoint||(this._tapTime&&i.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?n.length>0&&(this._swipePoint=o[0],this._swipeTouch=n[0].identifier):this._tap.touchstart(i,o,n))},yi.prototype.touchmove=function(i,o,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;var s=o[0],p=s.y-this._swipePoint.y;return this._swipePoint=s,i.preventDefault(),this._active=!0,{zoomDelta:p/128}}}else this._tap.touchmove(i,o,n)},yi.prototype.touchend=function(i,o,n){this._tapTime?this._swipePoint&&n.length===0&&this.reset():this._tap.touchend(i,o,n)&&(this._tapTime=i.timeStamp)},yi.prototype.touchcancel=function(){this.reset()},yi.prototype.enable=function(){this._enabled=!0},yi.prototype.disable=function(){this._enabled=!1,this.reset()},yi.prototype.isEnabled=function(){return this._enabled},yi.prototype.isActive=function(){return this._active};var Mo=function(i,o,n){this._el=i,this._mousePan=o,this._touchPan=n};Mo.prototype.enable=function(i){this._inertiaOptions=i||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},Mo.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},Mo.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},Mo.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var eo=function(i,o,n){this._pitchWithRotate=i.pitchWithRotate,this._mouseRotate=o,this._mousePitch=n};eo.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},eo.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},eo.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},eo.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var xn=function(i,o,n,s){this._el=i,this._touchZoom=o,this._touchRotate=n,this._tapDragZoom=s,this._rotationDisabled=!1,this._enabled=!0};xn.prototype.enable=function(i){this._touchZoom.enable(i),this._rotationDisabled||this._touchRotate.enable(i),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},xn.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},xn.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},xn.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},xn.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},xn.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Ti=function(i){return i.zoom||i.drag||i.pitch||i.rotate},Ba=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o})(u.Event);function it(i){return i.panDelta&&i.panDelta.mag()||i.zoomDelta||i.bearingDelta||i.pitchDelta}var Ye=function(i,o){this._map=i,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Pa(i),this._bearingSnap=o.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(o),u.bindAll(["handleEvent","handleWindowEvent"],this);var n=this._el;this._listeners=[[n,"touchstart",{passive:!0}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[u.window.document,"mousemove",{capture:!0}],[u.window.document,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[u.window,"blur",void 0]];for(var s=0,p=this._listeners;s<p.length;s+=1){var f=p[s],d=f[0];M.addEventListener(d,f[1],d===u.window.document?this.handleWindowEvent:this.handleEvent,f[2])}};Ye.prototype.destroy=function(){for(var i=0,o=this._listeners;i<o.length;i+=1){var n=o[i],s=n[0];M.removeEventListener(s,n[1],s===u.window.document?this.handleWindowEvent:this.handleEvent,n[2])}},Ye.prototype._addDefaultHandlers=function(i){var o=this._map,n=o.getCanvasContainer();this._add("mapEvent",new qr(o,i));var s=o.boxZoom=new Ni(o,i);this._add("boxZoom",s);var p=new ji,f=new un;o.doubleClickZoom=new Tn(f,p),this._add("tapZoom",p),this._add("clickZoom",f);var d=new yi;this._add("tapDragZoom",d);var v=o.touchPitch=new _u;this._add("touchPitch",v);var w=new ps(i),A=new gu(i);o.dragRotate=new eo(i,w,A),this._add("mouseRotate",w,["mousePitch"]),this._add("mousePitch",A,["mouseRotate"]);var R=new vu(i),F=new sn(i);o.dragPan=new Mo(n,R,F),this._add("mousePan",R),this._add("touchPan",F,["touchZoom","touchRotate"]);var O=new Rl,W=new $i;o.touchZoomRotate=new xn(n,W,O,d),this._add("touchRotate",O,["touchPan","touchZoom"]),this._add("touchZoom",W,["touchPan","touchRotate"]);var Z=o.scrollZoom=new kt(o,this);this._add("scrollZoom",Z,["mousePan"]);var ee=o.keyboard=new _n;this._add("keyboard",ee),this._add("blockableMapEvent",new Xe(o));for(var N=0,Q=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];N<Q.length;N+=1){var ne=Q[N];i.interactive&&i[ne]&&o[ne].enable(i[ne])}},Ye.prototype._add=function(i,o,n){this._handlers.push({handlerName:i,handler:o,allowed:n}),this._handlersById[i]=o},Ye.prototype.stop=function(i){if(!this._updatingCamera){for(var o=0,n=this._handlers;o<n.length;o+=1)n[o].handler.reset();this._inertia.clear(),this._fireEvents({},{},i),this._changes=[]}},Ye.prototype.isActive=function(){for(var i=0,o=this._handlers;i<o.length;i+=1)if(o[i].handler.isActive())return!0;return!1},Ye.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},Ye.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},Ye.prototype.isMoving=function(){return!!Ti(this._eventsInProgress)||this.isZooming()},Ye.prototype._blockedByActive=function(i,o,n){for(var s in i)if(s!==n&&(!o||o.indexOf(s)<0))return!0;return!1},Ye.prototype.handleWindowEvent=function(i){this.handleEvent(i,i.type+"Window")},Ye.prototype._getMapTouches=function(i){for(var o=[],n=0,s=i;n<s.length;n+=1){var p=s[n];this._el.contains(p.target)&&o.push(p)}return o},Ye.prototype.handleEvent=function(i,o){this._updatingCamera=!0;for(var n=i.type==="renderFrame"?void 0:i,s={needsRenderFrame:!1},p={},f={},d=i.touches?this._getMapTouches(i.touches):void 0,v=d?M.touchPos(this._el,d):M.mousePos(this._el,i),w=0,A=this._handlers;w<A.length;w+=1){var R=A[w],F=R.handlerName,O=R.handler,W=R.allowed;if(O.isEnabled()){var Z=void 0;this._blockedByActive(f,W,F)?O.reset():O[o||i.type]&&(Z=O[o||i.type](i,v,d),this.mergeHandlerResult(s,p,Z,F,n),Z&&Z.needsRenderFrame&&this._triggerRenderFrame()),(Z||O.isActive())&&(f[F]=O)}}var ee={};for(var N in this._previousActiveHandlers)f[N]||(ee[N]=n);this._previousActiveHandlers=f,(Object.keys(ee).length||it(s))&&(this._changes.push([s,p,ee]),this._triggerRenderFrame()),(Object.keys(f).length||it(s))&&this._map._stop(!0),this._updatingCamera=!1;var Q=s.cameraAnimation;Q&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],Q(this._map))},Ye.prototype.mergeHandlerResult=function(i,o,n,s,p){if(n){u.extend(i,n);var f={handlerName:s,originalEvent:n.originalEvent||p};n.zoomDelta!==void 0&&(o.zoom=f),n.panDelta!==void 0&&(o.drag=f),n.pitchDelta!==void 0&&(o.pitch=f),n.bearingDelta!==void 0&&(o.rotate=f)}},Ye.prototype._applyChanges=function(){for(var i={},o={},n={},s=0,p=this._changes;s<p.length;s+=1){var f=p[s],d=f[0],v=f[1],w=f[2];d.panDelta&&(i.panDelta=(i.panDelta||new u.Point(0,0))._add(d.panDelta)),d.zoomDelta&&(i.zoomDelta=(i.zoomDelta||0)+d.zoomDelta),d.bearingDelta&&(i.bearingDelta=(i.bearingDelta||0)+d.bearingDelta),d.pitchDelta&&(i.pitchDelta=(i.pitchDelta||0)+d.pitchDelta),d.around!==void 0&&(i.around=d.around),d.pinchAround!==void 0&&(i.pinchAround=d.pinchAround),d.noInertia&&(i.noInertia=d.noInertia),u.extend(o,v),u.extend(n,w)}this._updateMapTransform(i,o,n),this._changes=[]},Ye.prototype._updateMapTransform=function(i,o,n){var s=this._map,p=s.transform;if(!it(i))return this._fireEvents(o,n,!0);var f=i.panDelta,d=i.zoomDelta,v=i.bearingDelta,w=i.pitchDelta,A=i.around,R=i.pinchAround;R!==void 0&&(A=R),s._stop(!0),A=A||s.transform.centerPoint;var F=p.pointLocation(f?A.sub(f):A);v&&(p.bearing+=v),w&&(p.pitch+=w),d&&(p.zoom+=d),p.setLocationAtPoint(F,A),this._map._update(),i.noInertia||this._inertia.record(i),this._fireEvents(o,n,!0)},Ye.prototype._fireEvents=function(i,o,n){var s=this,p=Ti(this._eventsInProgress),f=Ti(i),d={};for(var v in i)this._eventsInProgress[v]||(d[v+"start"]=i[v].originalEvent),this._eventsInProgress[v]=i[v];for(var w in!p&&f&&this._fireEvent("movestart",f.originalEvent),d)this._fireEvent(w,d[w]);for(var A in f&&this._fireEvent("move",f.originalEvent),i)this._fireEvent(A,i[A].originalEvent);var R,F={};for(var O in this._eventsInProgress){var W=this._eventsInProgress[O],Z=W.handlerName,ee=W.originalEvent;this._handlersById[Z].isActive()||(delete this._eventsInProgress[O],F[O+"end"]=R=o[Z]||ee)}for(var N in F)this._fireEvent(N,F[N]);var Q=Ti(this._eventsInProgress);if(n&&(p||f)&&!Q){this._updatingCamera=!0;var ne=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),ue=function(me){return me!==0&&-s._bearingSnap<me&&me<s._bearingSnap};ne?(ue(ne.bearing||this._map.getBearing())&&(ne.bearing=0),this._map.easeTo(ne,{originalEvent:R})):(this._map.fire(new u.Event("moveend",{originalEvent:R})),ue(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},Ye.prototype._fireEvent=function(i,o){this._map.fire(new u.Event(i,o?{originalEvent:o}:{}))},Ye.prototype._requestFrame=function(){var i=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add((function(o){delete i._frameId,i.handleEvent(new Ba("renderFrame",{timeStamp:o})),i._applyChanges()}))},Ye.prototype._triggerRenderFrame=function(){this._frameId===void 0&&(this._frameId=this._requestFrame())};var ds=(function(i){function o(n,s){i.call(this),this._moving=!1,this._zooming=!1,this.transform=n,this._bearingSnap=s.bearingSnap,u.bindAll(["_renderFrameCallback"],this)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getCenter=function(){return new u.LngLat(this.transform.center.lng,this.transform.center.lat)},o.prototype.setCenter=function(n,s){return this.jumpTo({center:n},s)},o.prototype.panBy=function(n,s,p){return n=u.Point.convert(n).mult(-1),this.panTo(this.transform.center,u.extend({offset:n},s),p)},o.prototype.panTo=function(n,s,p){return this.easeTo(u.extend({center:n},s),p)},o.prototype.getZoom=function(){return this.transform.zoom},o.prototype.setZoom=function(n,s){return this.jumpTo({zoom:n},s),this},o.prototype.zoomTo=function(n,s,p){return this.easeTo(u.extend({zoom:n},s),p)},o.prototype.zoomIn=function(n,s){return this.zoomTo(this.getZoom()+1,n,s),this},o.prototype.zoomOut=function(n,s){return this.zoomTo(this.getZoom()-1,n,s),this},o.prototype.getBearing=function(){return this.transform.bearing},o.prototype.setBearing=function(n,s){return this.jumpTo({bearing:n},s),this},o.prototype.getPadding=function(){return this.transform.padding},o.prototype.setPadding=function(n,s){return this.jumpTo({padding:n},s),this},o.prototype.rotateTo=function(n,s,p){return this.easeTo(u.extend({bearing:n},s),p)},o.prototype.resetNorth=function(n,s){return this.rotateTo(0,u.extend({duration:1e3},n),s),this},o.prototype.resetNorthPitch=function(n,s){return this.easeTo(u.extend({bearing:0,pitch:0,duration:1e3},n),s),this},o.prototype.snapToNorth=function(n,s){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(n,s):this},o.prototype.getPitch=function(){return this.transform.pitch},o.prototype.setPitch=function(n,s){return this.jumpTo({pitch:n},s),this},o.prototype.cameraForBounds=function(n,s){n=u.LngLatBounds.convert(n);var p=s&&s.bearing||0;return this._cameraForBoxAndBearing(n.getNorthWest(),n.getSouthEast(),p,s)},o.prototype._cameraForBoxAndBearing=function(n,s,p,f){var d={top:0,bottom:0,right:0,left:0};if(typeof(f=u.extend({padding:d,offset:[0,0],maxZoom:this.transform.maxZoom},f)).padding=="number"){var v=f.padding;f.padding={top:v,bottom:v,right:v,left:v}}f.padding=u.extend(d,f.padding);var w=this.transform,A=w.padding,R=w.project(u.LngLat.convert(n)),F=w.project(u.LngLat.convert(s)),O=R.rotate(-p*Math.PI/180),W=F.rotate(-p*Math.PI/180),Z=new u.Point(Math.max(O.x,W.x),Math.max(O.y,W.y)),ee=new u.Point(Math.min(O.x,W.x),Math.min(O.y,W.y)),N=Z.sub(ee),Q=(w.width-(A.left+A.right+f.padding.left+f.padding.right))/N.x,ne=(w.height-(A.top+A.bottom+f.padding.top+f.padding.bottom))/N.y;if(!(ne<0||Q<0)){var ue=Math.min(w.scaleZoom(w.scale*Math.min(Q,ne)),f.maxZoom),me=typeof f.offset.x=="number"?new u.Point(f.offset.x,f.offset.y):u.Point.convert(f.offset),pe=new u.Point((f.padding.left-f.padding.right)/2,(f.padding.top-f.padding.bottom)/2).rotate(p*Math.PI/180),ve=me.add(pe).mult(w.scale/w.zoomScale(ue));return{center:w.unproject(R.add(F).div(2).sub(ve)),zoom:ue,bearing:p}}u.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},o.prototype.fitBounds=function(n,s,p){return this._fitInternal(this.cameraForBounds(n,s),s,p)},o.prototype.fitScreenCoordinates=function(n,s,p,f,d){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(u.Point.convert(n)),this.transform.pointLocation(u.Point.convert(s)),p,f),f,d)},o.prototype._fitInternal=function(n,s,p){return n?(delete(s=u.extend(n,s)).padding,s.linear?this.easeTo(s,p):this.flyTo(s,p)):this},o.prototype.jumpTo=function(n,s){this.stop();var p=this.transform,f=!1,d=!1,v=!1;return"zoom"in n&&p.zoom!==+n.zoom&&(f=!0,p.zoom=+n.zoom),n.center!==void 0&&(p.center=u.LngLat.convert(n.center)),"bearing"in n&&p.bearing!==+n.bearing&&(d=!0,p.bearing=+n.bearing),"pitch"in n&&p.pitch!==+n.pitch&&(v=!0,p.pitch=+n.pitch),n.padding==null||p.isPaddingEqual(n.padding)||(p.padding=n.padding),this.fire(new u.Event("movestart",s)).fire(new u.Event("move",s)),f&&this.fire(new u.Event("zoomstart",s)).fire(new u.Event("zoom",s)).fire(new u.Event("zoomend",s)),d&&this.fire(new u.Event("rotatestart",s)).fire(new u.Event("rotate",s)).fire(new u.Event("rotateend",s)),v&&this.fire(new u.Event("pitchstart",s)).fire(new u.Event("pitch",s)).fire(new u.Event("pitchend",s)),this.fire(new u.Event("moveend",s))},o.prototype.easeTo=function(n,s){var p=this;this._stop(!1,n.easeId),((n=u.extend({offset:[0,0],duration:500,easing:u.ease},n)).animate===!1||!n.essential&&u.browser.prefersReducedMotion)&&(n.duration=0);var f=this.transform,d=this.getZoom(),v=this.getBearing(),w=this.getPitch(),A=this.getPadding(),R="zoom"in n?+n.zoom:d,F="bearing"in n?this._normalizeBearing(n.bearing,v):v,O="pitch"in n?+n.pitch:w,W="padding"in n?n.padding:f.padding,Z=u.Point.convert(n.offset),ee=f.centerPoint.add(Z),N=f.pointLocation(ee),Q=u.LngLat.convert(n.center||N);this._normalizeCenter(Q);var ne,ue,me=f.project(N),pe=f.project(Q).sub(me),ve=f.zoomScale(R-d);n.around&&(ne=u.LngLat.convert(n.around),ue=f.locationPoint(ne));var Te={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||R!==d,this._rotating=this._rotating||v!==F,this._pitching=this._pitching||O!==w,this._padding=!f.isPaddingEqual(W),this._easeId=n.easeId,this._prepareEase(s,n.noMoveStart,Te),this._ease((function(ke){if(p._zooming&&(f.zoom=u.number(d,R,ke)),p._rotating&&(f.bearing=u.number(v,F,ke)),p._pitching&&(f.pitch=u.number(w,O,ke)),p._padding&&(f.interpolatePadding(A,W,ke),ee=f.centerPoint.add(Z)),ne)f.setLocationAtPoint(ne,ue);else{var Ce=f.zoomScale(f.zoom-d),$e=R>d?Math.min(2,ve):Math.max(.5,ve),nt=Math.pow($e,1-ke),ut=f.unproject(me.add(pe.mult(ke*nt)).mult(Ce));f.setLocationAtPoint(f.renderWorldCopies?ut.wrap():ut,ee)}p._fireMoveEvents(s)}),(function(ke){p._afterEase(s,ke)}),n),this},o.prototype._prepareEase=function(n,s,p){p===void 0&&(p={}),this._moving=!0,s||p.moving||this.fire(new u.Event("movestart",n)),this._zooming&&!p.zooming&&this.fire(new u.Event("zoomstart",n)),this._rotating&&!p.rotating&&this.fire(new u.Event("rotatestart",n)),this._pitching&&!p.pitching&&this.fire(new u.Event("pitchstart",n))},o.prototype._fireMoveEvents=function(n){this.fire(new u.Event("move",n)),this._zooming&&this.fire(new u.Event("zoom",n)),this._rotating&&this.fire(new u.Event("rotate",n)),this._pitching&&this.fire(new u.Event("pitch",n))},o.prototype._afterEase=function(n,s){if(!this._easeId||!s||this._easeId!==s){delete this._easeId;var p=this._zooming,f=this._rotating,d=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,p&&this.fire(new u.Event("zoomend",n)),f&&this.fire(new u.Event("rotateend",n)),d&&this.fire(new u.Event("pitchend",n)),this.fire(new u.Event("moveend",n))}},o.prototype.flyTo=function(n,s){var p=this;if(!n.essential&&u.browser.prefersReducedMotion){var f=u.pick(n,["center","zoom","bearing","pitch","around"]);return this.jumpTo(f,s)}this.stop(),n=u.extend({offset:[0,0],speed:1.2,curve:1.42,easing:u.ease},n);var d=this.transform,v=this.getZoom(),w=this.getBearing(),A=this.getPitch(),R=this.getPadding(),F="zoom"in n?u.clamp(+n.zoom,d.minZoom,d.maxZoom):v,O="bearing"in n?this._normalizeBearing(n.bearing,w):w,W="pitch"in n?+n.pitch:A,Z="padding"in n?n.padding:d.padding,ee=d.zoomScale(F-v),N=u.Point.convert(n.offset),Q=d.centerPoint.add(N),ne=d.pointLocation(Q),ue=u.LngLat.convert(n.center||ne);this._normalizeCenter(ue);var me=d.project(ne),pe=d.project(ue).sub(me),ve=n.curve,Te=Math.max(d.width,d.height),ke=Te/ee,Ce=pe.mag();if("minZoom"in n){var $e=u.clamp(Math.min(n.minZoom,v,F),d.minZoom,d.maxZoom),nt=Te/d.zoomScale($e-v);ve=Math.sqrt(nt/Ce*2)}var ut=ve*ve;function st(ht){var ct=(ke*ke-Te*Te+(ht?-1:1)*ut*ut*Ce*Ce)/(2*(ht?ke:Te)*ut*Ce);return Math.log(Math.sqrt(ct*ct+1)-ct)}function Ft(ht){return(Math.exp(ht)-Math.exp(-ht))/2}function We(ht){return(Math.exp(ht)+Math.exp(-ht))/2}var mt=st(0),xt=function(ht){return We(mt)/We(mt+ve*ht)},dt=function(ht){return Te*((We(mt)*(Ft(ct=mt+ve*ht)/We(ct))-Ft(mt))/ut)/Ce;var ct},ft=(st(1)-mt)/ve;if(Math.abs(Ce)<1e-6||!isFinite(ft)){if(Math.abs(Te-ke)<1e-6)return this.easeTo(n,s);var gt=ke<Te?-1:1;ft=Math.abs(Math.log(ke/Te))/ve,dt=function(){return 0},xt=function(ht){return Math.exp(gt*ve*ht)}}return n.duration="duration"in n?+n.duration:1e3*ft/("screenSpeed"in n?+n.screenSpeed/ve:+n.speed),n.maxDuration&&n.duration>n.maxDuration&&(n.duration=0),this._zooming=!0,this._rotating=w!==O,this._pitching=W!==A,this._padding=!d.isPaddingEqual(Z),this._prepareEase(s,!1),this._ease((function(ht){var ct=ht*ft,Jr=1/xt(ct);d.zoom=ht===1?F:v+d.scaleZoom(Jr),p._rotating&&(d.bearing=u.number(w,O,ht)),p._pitching&&(d.pitch=u.number(A,W,ht)),p._padding&&(d.interpolatePadding(R,Z,ht),Q=d.centerPoint.add(N));var Ir=ht===1?ue:d.unproject(me.add(pe.mult(dt(ct))).mult(Jr));d.setLocationAtPoint(d.renderWorldCopies?Ir.wrap():Ir,Q),p._fireMoveEvents(s)}),(function(){return p._afterEase(s)}),n),this},o.prototype.isEasing=function(){return!!this._easeFrameId},o.prototype.stop=function(){return this._stop()},o.prototype._stop=function(n,s){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var p=this._onEaseEnd;delete this._onEaseEnd,p.call(this,s)}if(!n){var f=this.handlers;f&&f.stop(!1)}return this},o.prototype._ease=function(n,s,p){p.animate===!1||p.duration===0?(n(1),s()):(this._easeStart=u.browser.now(),this._easeOptions=p,this._onEaseFrame=n,this._onEaseEnd=s,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},o.prototype._renderFrameCallback=function(){var n=Math.min((u.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(n)),n<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},o.prototype._normalizeBearing=function(n,s){n=u.wrap(n,-180,180);var p=Math.abs(n-s);return Math.abs(n-360-s)<p&&(n-=360),Math.abs(n+360-s)<p&&(n+=360),n},o.prototype._normalizeCenter=function(n){var s=this.transform;if(s.renderWorldCopies&&!s.lngRange){var p=n.lng-s.center.lng;n.lng+=p>180?-360:p<-180?360:0}},o})(u.Evented),Ai=function(i){i===void 0&&(i={}),this.options=i,u.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Ai.prototype.getDefaultPosition=function(){return"bottom-right"},Ai.prototype.onAdd=function(i){var o=this.options&&this.options.compact;return this._map=i,this._container=M.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=M.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=M.create("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},Ai.prototype.onRemove=function(){M.remove(this._container),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},Ai.prototype._setElementTitle=function(i,o){var n=this._map._getUIString("AttributionControl."+o);i.title=n,i.setAttribute("aria-label",n)},Ai.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},Ai.prototype._updateEditLink=function(){var i=this._editLink;i||(i=this._editLink=this._container.querySelector(".mapbox-improve-map"));var o=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||u.config.ACCESS_TOKEN}];if(i){var n=o.reduce((function(s,p,f){return p.value&&(s+=p.key+"="+p.value+(f<o.length-1?"&":"")),s}),"?");i.href=u.config.FEEDBACK_URL+"/"+n+(this._map._hash?this._map._hash.getHashString(!0):""),i.rel="noopener nofollow",this._setElementTitle(i,"MapFeedback")}},Ai.prototype._updateData=function(i){!i||i.sourceDataType!=="metadata"&&i.sourceDataType!=="visibility"&&i.dataType!=="style"||(this._updateAttributions(),this._updateEditLink())},Ai.prototype._updateAttributions=function(){if(this._map.style){var i=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?i=i.concat(this.options.customAttribution.map((function(v){return typeof v!="string"?"":v}))):typeof this.options.customAttribution=="string"&&i.push(this.options.customAttribution)),this._map.style.stylesheet){var o=this._map.style.stylesheet;this.styleOwner=o.owner,this.styleId=o.id}var n=this._map.style.sourceCaches;for(var s in n){var p=n[s];if(p.used){var f=p.getSource();f.attribution&&i.indexOf(f.attribution)<0&&i.push(f.attribution)}}i.sort((function(v,w){return v.length-w.length}));var d=(i=i.filter((function(v,w){for(var A=w+1;A<i.length;A++)if(i[A].indexOf(v)>=0)return!1;return!0}))).join(" | ");d!==this._attribHTML&&(this._attribHTML=d,i.length?(this._innerContainer.innerHTML=d,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Ai.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var bn=function(){u.bindAll(["_updateLogo"],this),u.bindAll(["_updateCompact"],this)};bn.prototype.onAdd=function(i){this._map=i,this._container=M.create("div","mapboxgl-ctrl");var o=M.create("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},bn.prototype.onRemove=function(){M.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},bn.prototype.getDefaultPosition=function(){return"bottom-left"},bn.prototype._updateLogo=function(i){i&&i.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")},bn.prototype._logoRequired=function(){if(this._map.style){var i=this._map.style.sourceCaches;for(var o in i)if(i[o].getSource().mapbox_logo)return!0;return!1}},bn.prototype._updateCompact=function(){var i=this._container.children;if(i.length){var o=i[0];this._map.getCanvasContainer().offsetWidth<250?o.classList.add("mapboxgl-compact"):o.classList.remove("mapboxgl-compact")}};var vi=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};vi.prototype.add=function(i){var o=++this._id;return this._queue.push({callback:i,id:o,cancelled:!1}),o},vi.prototype.remove=function(i){for(var o=this._currentlyRunning,n=0,s=o?this._queue.concat(o):this._queue;n<s.length;n+=1){var p=s[n];if(p.id===i)return void(p.cancelled=!0)}},vi.prototype.run=function(i){i===void 0&&(i=0);var o=this._currentlyRunning=this._queue;this._queue=[];for(var n=0,s=o;n<s.length;n+=1){var p=s[n];if(!p.cancelled&&(p.callback(i),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},vi.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var An={"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","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},bu=u.window.HTMLImageElement,ms=u.window.HTMLElement,Xt=u.window.ImageBitmap,ai={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Ll=(function(i){function o(s){var p=this;if((s=u.extend({},ai,s)).minZoom!=null&&s.maxZoom!=null&&s.minZoom>s.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(s.minPitch!=null&&s.maxPitch!=null&&s.minPitch>s.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(s.minPitch!=null&&s.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(s.maxPitch!=null&&s.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var f=new Dt(s.minZoom,s.maxZoom,s.minPitch,s.maxPitch,s.renderWorldCopies);if(i.call(this,f,s),this._interactive=s.interactive,this._maxTileCacheSize=s.maxTileCacheSize,this._failIfMajorPerformanceCaveat=s.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=s.preserveDrawingBuffer,this._antialias=s.antialias,this._trackResize=s.trackResize,this._bearingSnap=s.bearingSnap,this._refreshExpiredTiles=s.refreshExpiredTiles,this._fadeDuration=s.fadeDuration,this._crossSourceCollisions=s.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=s.collectResourceTiming,this._renderTaskQueue=new vi,this._controls=[],this._mapId=u.uniqueId(),this._locale=u.extend({},An,s.locale),this._clickTolerance=s.clickTolerance,this._requestManager=new u.RequestManager(s.transformRequest,s.accessToken),typeof s.container=="string"){if(this._container=u.window.document.getElementById(s.container),!this._container)throw new Error("Container '"+s.container+"' not found.")}else{if(!(s.container instanceof ms))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=s.container}if(s.maxBounds&&this.setMaxBounds(s.maxBounds),u.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return p._update(!1)})),this.on("moveend",(function(){return p._update(!1)})),this.on("zoom",(function(){return p._update(!0)})),u.window!==void 0&&(u.window.addEventListener("online",this._onWindowOnline,!1),u.window.addEventListener("resize",this._onWindowResize,!1),u.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Ye(this,s),this._hash=s.hash&&new Yi(typeof s.hash=="string"&&s.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:s.center,zoom:s.zoom,bearing:s.bearing,pitch:s.pitch}),s.bounds&&(this.resize(),this.fitBounds(s.bounds,u.extend({},s.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=s.localIdeographFontFamily,s.style&&this.setStyle(s.style,{localIdeographFontFamily:s.localIdeographFontFamily}),s.attributionControl&&this.addControl(new Ai({customAttribution:s.customAttribution})),this.addControl(new bn,s.logoPosition),this.on("style.load",(function(){p.transform.unmodified&&p.jumpTo(p.style.stylesheet)})),this.on("data",(function(d){p._update(d.dataType==="style"),p.fire(new u.Event(d.dataType+"data",d))})),this.on("dataloading",(function(d){p.fire(new u.Event(d.dataType+"dataloading",d))}))}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return o.prototype._getMapId=function(){return this._mapId},o.prototype.addControl=function(s,p){if(p===void 0&&(p=s.getDefaultPosition?s.getDefaultPosition():"top-right"),!s||!s.onAdd)return this.fire(new u.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var f=s.onAdd(this);this._controls.push(s);var d=this._controlPositions[p];return p.indexOf("bottom")!==-1?d.insertBefore(f,d.firstChild):d.appendChild(f),this},o.prototype.removeControl=function(s){if(!s||!s.onRemove)return this.fire(new u.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var p=this._controls.indexOf(s);return p>-1&&this._controls.splice(p,1),s.onRemove(this),this},o.prototype.hasControl=function(s){return this._controls.indexOf(s)>-1},o.prototype.resize=function(s){var p=this._containerDimensions(),f=p[0],d=p[1];if(f===this.transform.width&&d===this.transform.height)return this;this._resizeCanvas(f,d),this.transform.resize(f,d),this.painter.resize(f,d);var v=!this._moving;return v&&this.fire(new u.Event("movestart",s)).fire(new u.Event("move",s)),this.fire(new u.Event("resize",s)),v&&this.fire(new u.Event("moveend",s)),this},o.prototype.getBounds=function(){return this.transform.getBounds()},o.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},o.prototype.setMaxBounds=function(s){return this.transform.setMaxBounds(u.LngLatBounds.convert(s)),this._update()},o.prototype.setMinZoom=function(s){if((s=s??-2)>=-2&&s<=this.transform.maxZoom)return this.transform.minZoom=s,this._update(),this.getZoom()<s&&this.setZoom(s),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},o.prototype.getMinZoom=function(){return this.transform.minZoom},o.prototype.setMaxZoom=function(s){if((s=s??22)>=this.transform.minZoom)return this.transform.maxZoom=s,this._update(),this.getZoom()>s&&this.setZoom(s),this;throw new Error("maxZoom must be greater than the current minZoom")},o.prototype.getMaxZoom=function(){return this.transform.maxZoom},o.prototype.setMinPitch=function(s){if((s=s??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(s>=0&&s<=this.transform.maxPitch)return this.transform.minPitch=s,this._update(),this.getPitch()<s&&this.setPitch(s),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},o.prototype.getMinPitch=function(){return this.transform.minPitch},o.prototype.setMaxPitch=function(s){if((s=s??60)>60)throw new Error("maxPitch must be less than or equal to 60");if(s>=this.transform.minPitch)return this.transform.maxPitch=s,this._update(),this.getPitch()>s&&this.setPitch(s),this;throw new Error("maxPitch must be greater than the current minPitch")},o.prototype.getMaxPitch=function(){return this.transform.maxPitch},o.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},o.prototype.setRenderWorldCopies=function(s){return this.transform.renderWorldCopies=s,this._update()},o.prototype.project=function(s){return this.transform.locationPoint(u.LngLat.convert(s))},o.prototype.unproject=function(s){return this.transform.pointLocation(u.Point.convert(s))},o.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},o.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},o.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},o.prototype._createDelegatedListener=function(s,p,f){var d,v=this;if(s==="mouseenter"||s==="mouseover"){var w=!1;return{layer:p,listener:f,delegates:{mousemove:function(R){var F=v.getLayer(p)?v.queryRenderedFeatures(R.point,{layers:[p]}):[];F.length?w||(w=!0,f.call(v,new Gr(s,v,R.originalEvent,{features:F}))):w=!1},mouseout:function(){w=!1}}}}if(s==="mouseleave"||s==="mouseout"){var A=!1;return{layer:p,listener:f,delegates:{mousemove:function(R){(v.getLayer(p)?v.queryRenderedFeatures(R.point,{layers:[p]}):[]).length?A=!0:A&&(A=!1,f.call(v,new Gr(s,v,R.originalEvent)))},mouseout:function(R){A&&(A=!1,f.call(v,new Gr(s,v,R.originalEvent)))}}}}return{layer:p,listener:f,delegates:(d={},d[s]=function(R){var F=v.getLayer(p)?v.queryRenderedFeatures(R.point,{layers:[p]}):[];F.length&&(R.features=F,f.call(v,R),delete R.features)},d)}},o.prototype.on=function(s,p,f){if(f===void 0)return i.prototype.on.call(this,s,p);var d=this._createDelegatedListener(s,p,f);for(var v in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[s]=this._delegatedListeners[s]||[],this._delegatedListeners[s].push(d),d.delegates)this.on(v,d.delegates[v]);return this},o.prototype.once=function(s,p,f){if(f===void 0)return i.prototype.once.call(this,s,p);var d=this._createDelegatedListener(s,p,f);for(var v in d.delegates)this.once(v,d.delegates[v]);return this},o.prototype.off=function(s,p,f){var d=this;return f===void 0?i.prototype.off.call(this,s,p):(this._delegatedListeners&&this._delegatedListeners[s]&&(function(v){for(var w=v[s],A=0;A<w.length;A++){var R=w[A];if(R.layer===p&&R.listener===f){for(var F in R.delegates)d.off(F,R.delegates[F]);return w.splice(A,1),d}}})(this._delegatedListeners),this)},o.prototype.queryRenderedFeatures=function(s,p){if(!this.style)return[];var f;if(p!==void 0||s===void 0||s instanceof u.Point||Array.isArray(s)||(p=s,s=void 0),p=p||{},(s=s||[[0,0],[this.transform.width,this.transform.height]])instanceof u.Point||typeof s[0]=="number")f=[u.Point.convert(s)];else{var d=u.Point.convert(s[0]),v=u.Point.convert(s[1]);f=[d,new u.Point(v.x,d.y),v,new u.Point(d.x,v.y),d]}return this.style.queryRenderedFeatures(f,p,this.transform)},o.prototype.querySourceFeatures=function(s,p){return this.style.querySourceFeatures(s,p)},o.prototype.setStyle=function(s,p){return(p=u.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},p)).diff!==!1&&p.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&s?(this._diffStyle(s,p),this):(this._localIdeographFontFamily=p.localIdeographFontFamily,this._updateStyle(s,p))},o.prototype._getUIString=function(s){var p=this._locale[s];if(p==null)throw new Error("Missing UI string '"+s+"'");return p},o.prototype._updateStyle=function(s,p){return this.style&&(this.style.setEventedParent(null),this.style._remove()),s?(this.style=new Ui(this,p||{}),this.style.setEventedParent(this,{style:this.style}),typeof s=="string"?this.style.loadURL(s):this.style.loadJSON(s),this):(delete this.style,this)},o.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new Ui(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},o.prototype._diffStyle=function(s,p){var f=this;if(typeof s=="string"){var d=this._requestManager.normalizeStyleURL(s),v=this._requestManager.transformRequest(d,u.ResourceType.Style);u.getJSON(v,(function(w,A){w?f.fire(new u.ErrorEvent(w)):A&&f._updateDiff(A,p)}))}else typeof s=="object"&&this._updateDiff(s,p)},o.prototype._updateDiff=function(s,p){try{this.style.setState(s)&&this._update(!0)}catch(f){u.warnOnce("Unable to perform style diff: "+(f.message||f.error||f)+". Rebuilding the style from scratch."),this._updateStyle(s,p)}},o.prototype.getStyle=function(){if(this.style)return this.style.serialize()},o.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():u.warnOnce("There is no style added to the map.")},o.prototype.addSource=function(s,p){return this._lazyInitEmptyStyle(),this.style.addSource(s,p),this._update(!0)},o.prototype.isSourceLoaded=function(s){var p=this.style&&this.style.sourceCaches[s];if(p!==void 0)return p.loaded();this.fire(new u.ErrorEvent(new Error("There is no source with ID '"+s+"'")))},o.prototype.areTilesLoaded=function(){var s=this.style&&this.style.sourceCaches;for(var p in s){var f=s[p]._tiles;for(var d in f){var v=f[d];if(v.state!=="loaded"&&v.state!=="errored")return!1}}return!0},o.prototype.addSourceType=function(s,p,f){return this._lazyInitEmptyStyle(),this.style.addSourceType(s,p,f)},o.prototype.removeSource=function(s){return this.style.removeSource(s),this._update(!0)},o.prototype.getSource=function(s){return this.style.getSource(s)},o.prototype.addImage=function(s,p,f){f===void 0&&(f={});var d=f.pixelRatio;d===void 0&&(d=1);var v=f.sdf;v===void 0&&(v=!1);var w=f.stretchX,A=f.stretchY,R=f.content;if(this._lazyInitEmptyStyle(),p instanceof bu||Xt&&p instanceof Xt){var F=u.browser.getImageData(p);this.style.addImage(s,{data:new u.RGBAImage({width:F.width,height:F.height},F.data),pixelRatio:d,stretchX:w,stretchY:A,content:R,sdf:v,version:0})}else{if(p.width===void 0||p.height===void 0)return this.fire(new u.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`")));var O=p;this.style.addImage(s,{data:new u.RGBAImage({width:p.width,height:p.height},new Uint8Array(p.data)),pixelRatio:d,stretchX:w,stretchY:A,content:R,sdf:v,version:0,userImage:O}),O.onAdd&&O.onAdd(this,s)}},o.prototype.updateImage=function(s,p){var f=this.style.getImage(s);if(!f)return this.fire(new u.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var d=p instanceof bu||Xt&&p instanceof Xt?u.browser.getImageData(p):p,v=d.width,w=d.height,A=d.data;return v===void 0||w===void 0?this.fire(new u.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`"))):v!==f.data.width||w!==f.data.height?this.fire(new u.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(f.data.replace(A,!(p instanceof bu||Xt&&p instanceof Xt)),void this.style.updateImage(s,f))},o.prototype.hasImage=function(s){return s?!!this.style.getImage(s):(this.fire(new u.ErrorEvent(new Error("Missing required image id"))),!1)},o.prototype.removeImage=function(s){this.style.removeImage(s)},o.prototype.loadImage=function(s,p){u.getImage(this._requestManager.transformRequest(s,u.ResourceType.Image),p)},o.prototype.listImages=function(){return this.style.listImages()},o.prototype.addLayer=function(s,p){return this._lazyInitEmptyStyle(),this.style.addLayer(s,p),this._update(!0)},o.prototype.moveLayer=function(s,p){return this.style.moveLayer(s,p),this._update(!0)},o.prototype.removeLayer=function(s){return this.style.removeLayer(s),this._update(!0)},o.prototype.getLayer=function(s){return this.style.getLayer(s)},o.prototype.setLayerZoomRange=function(s,p,f){return this.style.setLayerZoomRange(s,p,f),this._update(!0)},o.prototype.setFilter=function(s,p,f){return f===void 0&&(f={}),this.style.setFilter(s,p,f),this._update(!0)},o.prototype.getFilter=function(s){return this.style.getFilter(s)},o.prototype.setPaintProperty=function(s,p,f,d){return d===void 0&&(d={}),this.style.setPaintProperty(s,p,f,d),this._update(!0)},o.prototype.getPaintProperty=function(s,p){return this.style.getPaintProperty(s,p)},o.prototype.setLayoutProperty=function(s,p,f,d){return d===void 0&&(d={}),this.style.setLayoutProperty(s,p,f,d),this._update(!0)},o.prototype.getLayoutProperty=function(s,p){return this.style.getLayoutProperty(s,p)},o.prototype.setLight=function(s,p){return p===void 0&&(p={}),this._lazyInitEmptyStyle(),this.style.setLight(s,p),this._update(!0)},o.prototype.getLight=function(){return this.style.getLight()},o.prototype.setFeatureState=function(s,p){return this.style.setFeatureState(s,p),this._update()},o.prototype.removeFeatureState=function(s,p){return this.style.removeFeatureState(s,p),this._update()},o.prototype.getFeatureState=function(s){return this.style.getFeatureState(s)},o.prototype.getContainer=function(){return this._container},o.prototype.getCanvasContainer=function(){return this._canvasContainer},o.prototype.getCanvas=function(){return this._canvas},o.prototype._containerDimensions=function(){var s=0,p=0;return this._container&&(s=this._container.clientWidth||400,p=this._container.clientHeight||300),[s,p]},o.prototype._detectMissingCSS=function(){u.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&u.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 in https://www.mapbox.com/mapbox-gl-js/api/.")},o.prototype._setupContainer=function(){var s=this._container;s.classList.add("mapboxgl-map"),(this._missingCSSCanary=M.create("div","mapboxgl-canary",s)).style.visibility="hidden",this._detectMissingCSS();var p=this._canvasContainer=M.create("div","mapboxgl-canvas-container",s);this._interactive&&p.classList.add("mapboxgl-interactive"),this._canvas=M.create("canvas","mapboxgl-canvas",p),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");var f=this._containerDimensions();this._resizeCanvas(f[0],f[1]);var d=this._controlContainer=M.create("div","mapboxgl-control-container",s),v=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(w){v[w]=M.create("div","mapboxgl-ctrl-"+w,d)})),this._container.addEventListener("scroll",this._onMapScroll,!1)},o.prototype._resizeCanvas=function(s,p){var f=u.browser.devicePixelRatio||1;this._canvas.width=f*s,this._canvas.height=f*p,this._canvas.style.width=s+"px",this._canvas.style.height=p+"px"},o.prototype._setupPainter=function(){var s=u.extend({},U.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),p=this._canvas.getContext("webgl",s)||this._canvas.getContext("experimental-webgl",s);p?(this.painter=new vr(p,this.transform),u.webpSupported.testSupport(p)):this.fire(new u.ErrorEvent(new Error("Failed to initialize WebGL")))},o.prototype._contextLost=function(s){s.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new u.Event("webglcontextlost",{originalEvent:s}))},o.prototype._contextRestored=function(s){this._setupPainter(),this.resize(),this._update(),this.fire(new u.Event("webglcontextrestored",{originalEvent:s}))},o.prototype._onMapScroll=function(s){if(s.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},o.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},o.prototype._update=function(s){return this.style?(this._styleDirty=this._styleDirty||s,this._sourcesDirty=!0,this.triggerRepaint(),this):this},o.prototype._requestRenderFrame=function(s){return this._update(),this._renderTaskQueue.add(s)},o.prototype._cancelRenderFrame=function(s){this._renderTaskQueue.remove(s)},o.prototype._render=function(s){var p,f=this,d=0,v=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(p=v.createQueryEXT(),v.beginQueryEXT(v.TIME_ELAPSED_EXT,p),d=u.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(s),!this._removed){var w=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var A=this.transform.zoom,R=u.browser.now();this.style.zoomHistory.update(A,R);var F=new u.EvaluationParameters(A,{now:R,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),O=F.crossFadingFactor();O===1&&O===this._crossFadingFactor||(w=!0,this._crossFadingFactor=O),this.style.update(F)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new u.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new u.Event("load"))),this.style&&(this.style.hasTransitions()||w)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var W=u.browser.now()-d;v.endQueryEXT(v.TIME_ELAPSED_EXT,p),setTimeout((function(){var N=v.getQueryObjectEXT(p,v.QUERY_RESULT_EXT)/1e6;v.deleteQueryEXT(p),f.fire(new u.Event("gpu-timing-frame",{cpuTime:W,gpuTime:N}))}),50)}if(this.listens("gpu-timing-layer")){var Z=this.painter.collectGpuTimers();setTimeout((function(){var N=f.painter.queryGpuTimers(Z);f.fire(new u.Event("gpu-timing-layer",{layerTimes:N}))}),50)}var ee=this._sourcesDirty||this._styleDirty||this._placementDirty;return ee||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new u.Event("idle")),!this._loaded||this._fullyLoaded||ee||(this._fullyLoaded=!0),this}},o.prototype.remove=function(){this._hash&&this._hash.remove();for(var s=0,p=this._controls;s<p.length;s+=1)p[s].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),u.window!==void 0&&(u.window.removeEventListener("resize",this._onWindowResize,!1),u.window.removeEventListener("orientationchange",this._onWindowResize,!1),u.window.removeEventListener("online",this._onWindowOnline,!1));var f=this.painter.context.gl.getExtension("WEBGL_lose_context");f&&f.loseContext(),Bo(this._canvasContainer),Bo(this._controlContainer),Bo(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new u.Event("remove"))},o.prototype.triggerRepaint=function(){var s=this;this.style&&!this._frame&&(this._frame=u.browser.frame((function(p){s._frame=null,s._render(p)})))},o.prototype._onWindowOnline=function(){this._update()},o.prototype._onWindowResize=function(s){this._trackResize&&this.resize({originalEvent:s})._update()},n.showTileBoundaries.get=function(){return!!this._showTileBoundaries},n.showTileBoundaries.set=function(s){this._showTileBoundaries!==s&&(this._showTileBoundaries=s,this._update())},n.showPadding.get=function(){return!!this._showPadding},n.showPadding.set=function(s){this._showPadding!==s&&(this._showPadding=s,this._update())},n.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},n.showCollisionBoxes.set=function(s){this._showCollisionBoxes!==s&&(this._showCollisionBoxes=s,s?this.style._generateCollisionBoxes():this._update())},n.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},n.showOverdrawInspector.set=function(s){this._showOverdrawInspector!==s&&(this._showOverdrawInspector=s,this._update())},n.repaint.get=function(){return!!this._repaint},n.repaint.set=function(s){this._repaint!==s&&(this._repaint=s,this.triggerRepaint())},n.vertices.get=function(){return!!this._vertices},n.vertices.set=function(s){this._vertices=s,this._update()},o.prototype._setCacheLimits=function(s,p){u.setCacheLimits(s,p)},n.version.get=function(){return u.version},Object.defineProperties(o.prototype,n),o})(ds);function Bo(i){i.parentNode&&i.parentNode.removeChild(i)}var wu={showCompass:!0,showZoom:!0,visualizePitch:!1},Fn=function(i){var o=this;this.options=u.extend({},wu,i),this._container=M.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(n){return n.preventDefault()})),this.options.showZoom&&(u.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(function(n){return o._map.zoomIn({},{originalEvent:n})})),M.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(function(n){return o._map.zoomOut({},{originalEvent:n})})),M.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(u.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(function(n){o.options.visualizePitch?o._map.resetNorthPitch({},{originalEvent:n}):o._map.resetNorth({},{originalEvent:n})})),this._compassIcon=M.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};Fn.prototype._updateZoomButtons=function(){var i=this._map.getZoom(),o=i===this._map.getMaxZoom(),n=i===this._map.getMinZoom();this._zoomInButton.disabled=o,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",o.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())},Fn.prototype._rotateCompassArrow=function(){var i=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=i},Fn.prototype.onAdd=function(i){return this._map=i,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Zi(this._map,this._compass,this.options.visualizePitch)),this._container},Fn.prototype.onRemove=function(){M.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},Fn.prototype._createButton=function(i,o){var n=M.create("button",i,this._container);return n.type="button",n.addEventListener("click",o),n},Fn.prototype._setButtonTitle=function(i,o){var n=this._map._getUIString("NavigationControl."+o);i.title=n,i.setAttribute("aria-label",n)};var Zi=function(i,o,n){n===void 0&&(n=!1),this._clickTolerance=10,this.element=o,this.mouseRotate=new ps({clickTolerance:i.dragRotate._mouseRotate._clickTolerance}),this.map=i,n&&(this.mousePitch=new gu({clickTolerance:i.dragRotate._mousePitch._clickTolerance})),u.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),M.addEventListener(o,"mousedown",this.mousedown),M.addEventListener(o,"touchstart",this.touchstart,{passive:!1}),M.addEventListener(o,"touchmove",this.touchmove),M.addEventListener(o,"touchend",this.touchend),M.addEventListener(o,"touchcancel",this.reset)};function ta(i,o,n){if(i=new u.LngLat(i.lng,i.lat),o){var s=new u.LngLat(i.lng-360,i.lat),p=new u.LngLat(i.lng+360,i.lat),f=n.locationPoint(i).distSqr(o);n.locationPoint(s).distSqr(o)<f?i=s:n.locationPoint(p).distSqr(o)<f&&(i=p)}for(;Math.abs(i.lng-n.center.lng)>180;){var d=n.locationPoint(i);if(d.x>=0&&d.y>=0&&d.x<=n.width&&d.y<=n.height)break;i.lng>n.center.lng?i.lng-=360:i.lng+=360}return i}Zi.prototype.down=function(i,o){this.mouseRotate.mousedown(i,o),this.mousePitch&&this.mousePitch.mousedown(i,o),M.disableDrag()},Zi.prototype.move=function(i,o){var n=this.map,s=this.mouseRotate.mousemoveWindow(i,o);if(s&&s.bearingDelta&&n.setBearing(n.getBearing()+s.bearingDelta),this.mousePitch){var p=this.mousePitch.mousemoveWindow(i,o);p&&p.pitchDelta&&n.setPitch(n.getPitch()+p.pitchDelta)}},Zi.prototype.off=function(){var i=this.element;M.removeEventListener(i,"mousedown",this.mousedown),M.removeEventListener(i,"touchstart",this.touchstart,{passive:!1}),M.removeEventListener(i,"touchmove",this.touchmove),M.removeEventListener(i,"touchend",this.touchend),M.removeEventListener(i,"touchcancel",this.reset),this.offTemp()},Zi.prototype.offTemp=function(){M.enableDrag(),M.removeEventListener(u.window,"mousemove",this.mousemove),M.removeEventListener(u.window,"mouseup",this.mouseup)},Zi.prototype.mousedown=function(i){this.down(u.extend({},i,{ctrlKey:!0,preventDefault:function(){return i.preventDefault()}}),M.mousePos(this.element,i)),M.addEventListener(u.window,"mousemove",this.mousemove),M.addEventListener(u.window,"mouseup",this.mouseup)},Zi.prototype.mousemove=function(i){this.move(i,M.mousePos(this.element,i))},Zi.prototype.mouseup=function(i){this.mouseRotate.mouseupWindow(i),this.mousePitch&&this.mousePitch.mouseupWindow(i),this.offTemp()},Zi.prototype.touchstart=function(i){i.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=M.touchPos(this.element,i.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return i.preventDefault()}},this._startPos))},Zi.prototype.touchmove=function(i){i.targetTouches.length!==1?this.reset():(this._lastPos=M.touchPos(this.element,i.targetTouches)[0],this.move({preventDefault:function(){return i.preventDefault()}},this._lastPos))},Zi.prototype.touchend=function(i){i.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},Zi.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var 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%)"};function ys(i,o,n){var s=i.classList;for(var p in En)s.remove("mapboxgl-"+n+"-anchor-"+p);s.add("mapboxgl-"+n+"-anchor-"+o)}var ra,za=(function(i){function o(n,s){if(i.call(this),(n instanceof u.window.HTMLElement||s)&&(n=u.extend({element:n},s)),u.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._scale=n&&n.scale||1,this._draggable=n&&n.draggable||!1,this._clickTolerance=n&&n.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=n&&n.rotation||0,this._rotationAlignment=n&&n.rotationAlignment||"auto",this._pitchAlignment=n&&n.pitchAlignment&&n.pitchAlignment!=="auto"?n.pitchAlignment:this._rotationAlignment,n&&n.element)this._element=n.element,this._offset=u.Point.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=M.create("div"),this._element.setAttribute("aria-label","Map marker");var p=M.createNS("http://www.w3.org/2000/svg","svg");p.setAttributeNS(null,"display","block"),p.setAttributeNS(null,"height","41px"),p.setAttributeNS(null,"width","27px"),p.setAttributeNS(null,"viewBox","0 0 27 41");var f=M.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"stroke","none"),f.setAttributeNS(null,"stroke-width","1"),f.setAttributeNS(null,"fill","none"),f.setAttributeNS(null,"fill-rule","evenodd");var d=M.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"fill-rule","nonzero");var v=M.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"transform","translate(3.0, 29.0)"),v.setAttributeNS(null,"fill","#000000");for(var w=0,A=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];w<A.length;w+=1){var R=A[w],F=M.createNS("http://www.w3.org/2000/svg","ellipse");F.setAttributeNS(null,"opacity","0.04"),F.setAttributeNS(null,"cx","10.5"),F.setAttributeNS(null,"cy","5.80029008"),F.setAttributeNS(null,"rx",R.rx),F.setAttributeNS(null,"ry",R.ry),v.appendChild(F)}var O=M.createNS("http://www.w3.org/2000/svg","g");O.setAttributeNS(null,"fill",this._color);var W=M.createNS("http://www.w3.org/2000/svg","path");W.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),O.appendChild(W);var Z=M.createNS("http://www.w3.org/2000/svg","g");Z.setAttributeNS(null,"opacity","0.25"),Z.setAttributeNS(null,"fill","#000000");var ee=M.createNS("http://www.w3.org/2000/svg","path");ee.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),Z.appendChild(ee);var N=M.createNS("http://www.w3.org/2000/svg","g");N.setAttributeNS(null,"transform","translate(6.0, 7.0)"),N.setAttributeNS(null,"fill","#FFFFFF");var Q=M.createNS("http://www.w3.org/2000/svg","g");Q.setAttributeNS(null,"transform","translate(8.0, 8.0)");var ne=M.createNS("http://www.w3.org/2000/svg","circle");ne.setAttributeNS(null,"fill","#000000"),ne.setAttributeNS(null,"opacity","0.25"),ne.setAttributeNS(null,"cx","5.5"),ne.setAttributeNS(null,"cy","5.5"),ne.setAttributeNS(null,"r","5.4999962");var ue=M.createNS("http://www.w3.org/2000/svg","circle");ue.setAttributeNS(null,"fill","#FFFFFF"),ue.setAttributeNS(null,"cx","5.5"),ue.setAttributeNS(null,"cy","5.5"),ue.setAttributeNS(null,"r","5.4999962"),Q.appendChild(ne),Q.appendChild(ue),d.appendChild(v),d.appendChild(O),d.appendChild(Z),d.appendChild(N),d.appendChild(Q),p.appendChild(d),p.setAttributeNS(null,"height",41*this._scale+"px"),p.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(p),this._offset=u.Point.convert(n&&n.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(function(me){me.preventDefault()})),this._element.addEventListener("mousedown",(function(me){me.preventDefault()})),ys(this._element,this._anchor,"marker"),this._popup=null}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.addTo=function(n){return this.remove(),this._map=n,n.getCanvasContainer().appendChild(this._element),n.on("move",this._update),n.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},o.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),M.remove(this._element),this._popup&&this._popup.remove(),this},o.prototype.getLngLat=function(){return this._lngLat},o.prototype.setLngLat=function(n){return this._lngLat=u.LngLat.convert(n),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},o.prototype.getElement=function(){return this._element},o.prototype.setPopup=function(n){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),n){if(!("offset"in n.options)){var s=Math.sqrt(Math.pow(13.5,2)/2);n.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[s,-1*(24.6+s)],"bottom-right":[-s,-1*(24.6+s)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=n,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},o.prototype._onKeyPress=function(n){var s=n.code,p=n.charCode||n.keyCode;s!=="Space"&&s!=="Enter"&&p!==32&&p!==13||this.togglePopup()},o.prototype._onMapClick=function(n){var s=n.originalEvent.target,p=this._element;this._popup&&(s===p||p.contains(s))&&this.togglePopup()},o.prototype.getPopup=function(){return this._popup},o.prototype.togglePopup=function(){var n=this._popup;return n?(n.isOpen()?n.remove():n.addTo(this._map),this):this},o.prototype._update=function(n){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=ta(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var s="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?s="rotateZ("+this._rotation+"deg)":this._rotationAlignment==="map"&&(s="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var p="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?p="rotateX(0deg)":this._pitchAlignment==="map"&&(p="rotateX("+this._map.getPitch()+"deg)"),n&&n.type!=="moveend"||(this._pos=this._pos.round()),M.setTransform(this._element,En[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+p+" "+s)}},o.prototype.getOffset=function(){return this._offset},o.prototype.setOffset=function(n){return this._offset=u.Point.convert(n),this._update(),this},o.prototype._onMove=function(n){if(!this._isDragging){var s=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=s}this._isDragging&&(this._pos=n.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new u.Event("dragstart"))),this.fire(new u.Event("drag")))},o.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new u.Event("dragend")),this._state="inactive"},o.prototype._addDragHandler=function(n){this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},o.prototype.setDraggable=function(n){return this._draggable=!!n,this._map&&(n?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},o.prototype.isDraggable=function(){return this._draggable},o.prototype.setRotation=function(n){return this._rotation=n||0,this._update(),this},o.prototype.getRotation=function(){return this._rotation},o.prototype.setRotationAlignment=function(n){return this._rotationAlignment=n||"auto",this._update(),this},o.prototype.getRotationAlignment=function(){return this._rotationAlignment},o.prototype.setPitchAlignment=function(n){return this._pitchAlignment=n&&n!=="auto"?n:this._rotationAlignment,this._update(),this},o.prototype.getPitchAlignment=function(){return this._pitchAlignment},o})(u.Evented),Su={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},ia=0,zo=!1,Iu=(function(i){function o(n){i.call(this),this.options=u.extend({},Su,n),u.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.onAdd=function(n){var s;return this._map=n,this._container=M.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),s=this._setupUI,ra!==void 0?s(ra):u.window.navigator.permissions!==void 0?u.window.navigator.permissions.query({name:"geolocation"}).then((function(p){s(ra=p.state!=="denied")})):s(ra=!!u.window.navigator.geolocation),this._container},o.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(u.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),M.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,ia=0,zo=!1},o.prototype._isOutOfMapMaxBounds=function(n){var s=this._map.getMaxBounds(),p=n.coords;return s&&(p.longitude<s.getWest()||p.longitude>s.getEast()||p.latitude<s.getSouth()||p.latitude>s.getNorth())},o.prototype._setErrorState=function(){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")}},o.prototype._onSuccess=function(n){if(this._map){if(this._isOutOfMapMaxBounds(n))return this._setErrorState(),this.fire(new u.Event("outofmaxbounds",n)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=n,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":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(n),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(n),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new u.Event("geolocate",n)),this._finish()}},o.prototype._updateCamera=function(n){var s=new u.LngLat(n.coords.longitude,n.coords.latitude),p=n.coords.accuracy,f=this._map.getBearing(),d=u.extend({bearing:f},this.options.fitBoundsOptions);this._map.fitBounds(s.toBounds(p),d,{geolocateSource:!0})},o.prototype._updateMarker=function(n){if(n){var s=new u.LngLat(n.coords.longitude,n.coords.latitude);this._accuracyCircleMarker.setLngLat(s).addTo(this._map),this._userLocationDotMarker.setLngLat(s).addTo(this._map),this._accuracy=n.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},o.prototype._updateCircleRadius=function(){var n=this._map._container.clientHeight/2,s=this._map.unproject([0,n]),p=this._map.unproject([1,n]),f=s.distanceTo(p),d=Math.ceil(2*this._accuracy/f);this._circleElement.style.width=d+"px",this._circleElement.style.height=d+"px"},o.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},o.prototype._onError=function(n){if(this._map){if(this.options.trackUserLocation)if(n.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;var s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(n.code===3&&zo)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new u.Event("error",n)),this._finish()}},o.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},o.prototype._setupUI=function(n){var s=this;if(this._container.addEventListener("contextmenu",(function(d){return d.preventDefault()})),this._geolocateButton=M.create("button","mapboxgl-ctrl-geolocate",this._container),M.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",n===!1){u.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var p=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=p,this._geolocateButton.setAttribute("aria-label",p)}else{var f=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=f,this._geolocateButton.setAttribute("aria-label",f)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=M.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new za(this._dotElement),this._circleElement=M.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new za({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",(function(d){d.geolocateSource||s._watchState!=="ACTIVE_LOCK"||d.originalEvent&&d.originalEvent.type==="resize"||(s._watchState="BACKGROUND",s._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),s._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),s.fire(new u.Event("trackuserlocationend")))}))},o.prototype.trigger=function(){if(!this._setup)return u.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 u.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":ia--,zo=!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 u.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 u.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){var n;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++ia>1?(n={maximumAge:6e5,timeout:0},zo=!0):(n=this.options.positionOptions,zo=!1),this._geolocationWatchID=u.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,n)}}else u.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},o.prototype._clearWatch=function(){u.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},o})(u.Evented),to={maxWidth:100,unit:"metric"},ro=function(i){this.options=u.extend({},to,i),u.bindAll(["_onMove","setUnit"],this)};function vs(i,o,n){var s=n&&n.maxWidth||100,p=i._container.clientHeight/2,f=i.unproject([0,p]),d=i.unproject([s,p]),v=f.distanceTo(d);if(n&&n.unit==="imperial"){var w=3.2808*v;w>5280?io(o,s,w/5280,i._getUIString("ScaleControl.Miles")):io(o,s,w,i._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?io(o,s,v/1852,i._getUIString("ScaleControl.NauticalMiles")):v>=1e3?io(o,s,v/1e3,i._getUIString("ScaleControl.Kilometers")):io(o,s,v,i._getUIString("ScaleControl.Meters"))}function io(i,o,n,s){var p,f,d,v=(p=n,(f=Math.pow(10,(""+Math.floor(p)).length-1))*(d=(d=p/f)>=10?10:d>=5?5:d>=3?3:d>=2?2:d>=1?1:(function(w){var A=Math.pow(10,Math.ceil(-Math.log(w)/Math.LN10));return Math.round(w*A)/A})(d)));i.style.width=o*(v/n)+"px",i.innerHTML=v+"&nbsp;"+s}ro.prototype.getDefaultPosition=function(){return"bottom-left"},ro.prototype._onMove=function(){vs(this._map,this._container,this.options)},ro.prototype.onAdd=function(i){return this._map=i,this._container=M.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",i.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},ro.prototype.onRemove=function(){M.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},ro.prototype.setUnit=function(i){this.options.unit=i,vs(this._map,this._container,this.options)};var ln=function(i){this._fullscreen=!1,i&&i.container&&(i.container instanceof u.window.HTMLElement?this._container=i.container:u.warnOnce("Full screen control 'container' must be a DOM element.")),u.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in u.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in u.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in u.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in u.window.document&&(this._fullscreenchange="MSFullscreenChange")};ln.prototype.onAdd=function(i){return this._map=i,this._container||(this._container=this._map.getContainer()),this._controlContainer=M.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",u.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},ln.prototype.onRemove=function(){M.remove(this._controlContainer),this._map=null,u.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},ln.prototype._checkFullscreenSupport=function(){return!!(u.window.document.fullscreenEnabled||u.window.document.mozFullScreenEnabled||u.window.document.msFullscreenEnabled||u.window.document.webkitFullscreenEnabled)},ln.prototype._setupUI=function(){var i=this._fullscreenButton=M.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);M.create("span","mapboxgl-ctrl-icon",i).setAttribute("aria-hidden",!0),i.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),u.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},ln.prototype._updateTitle=function(){var i=this._getTitle();this._fullscreenButton.setAttribute("aria-label",i),this._fullscreenButton.title=i},ln.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},ln.prototype._isFullscreen=function(){return this._fullscreen},ln.prototype._changeIcon=function(){(u.window.document.fullscreenElement||u.window.document.mozFullScreenElement||u.window.document.webkitFullscreenElement||u.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},ln.prototype._onClickFullscreen=function(){this._isFullscreen()?u.window.document.exitFullscreen?u.window.document.exitFullscreen():u.window.document.mozCancelFullScreen?u.window.document.mozCancelFullScreen():u.window.document.msExitFullscreen?u.window.document.msExitFullscreen():u.window.document.webkitCancelFullScreen&&u.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Tu={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Da=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Au=(function(i){function o(n){i.call(this),this.options=u.extend(Object.create(Tu),n),u.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.addTo=function(n){return this._map&&this.remove(),this._map=n,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new u.Event("open")),this},o.prototype.isOpen=function(){return!!this._map},o.prototype.remove=function(){return this._content&&M.remove(this._content),this._container&&(M.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new u.Event("close")),this},o.prototype.getLngLat=function(){return this._lngLat},o.prototype.setLngLat=function(n){return this._lngLat=u.LngLat.convert(n),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},o.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},o.prototype.getElement=function(){return this._container},o.prototype.setText=function(n){return this.setDOMContent(u.window.document.createTextNode(n))},o.prototype.setHTML=function(n){var s,p=u.window.document.createDocumentFragment(),f=u.window.document.createElement("body");for(f.innerHTML=n;s=f.firstChild;)p.appendChild(s);return this.setDOMContent(p)},o.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},o.prototype.setMaxWidth=function(n){return this.options.maxWidth=n,this._update(),this},o.prototype.setDOMContent=function(n){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=M.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(n),this._createCloseButton(),this._update(),this._focusFirstElement(),this},o.prototype.addClassName=function(n){this._container&&this._container.classList.add(n)},o.prototype.removeClassName=function(n){this._container&&this._container.classList.remove(n)},o.prototype.setOffset=function(n){return this.options.offset=n,this._update(),this},o.prototype.toggleClassName=function(n){if(this._container)return this._container.classList.toggle(n)},o.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=M.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))},o.prototype._onMouseUp=function(n){this._update(n.point)},o.prototype._onMouseMove=function(n){this._update(n.point)},o.prototype._onDrag=function(n){this._update(n.point)},o.prototype._update=function(n){var s=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=M.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=M.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(F){return s._container.classList.add(F)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=ta(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||n)){var p=this._pos=this._trackPointer&&n?n:this._map.project(this._lngLat),f=this.options.anchor,d=(function F(O){if(O){if(typeof O=="number"){var W=Math.round(Math.sqrt(.5*Math.pow(O,2)));return{center:new u.Point(0,0),top:new u.Point(0,O),"top-left":new u.Point(W,W),"top-right":new u.Point(-W,W),bottom:new u.Point(0,-O),"bottom-left":new u.Point(W,-W),"bottom-right":new u.Point(-W,-W),left:new u.Point(O,0),right:new u.Point(-O,0)}}if(O instanceof u.Point||Array.isArray(O)){var Z=u.Point.convert(O);return{center:Z,top:Z,"top-left":Z,"top-right":Z,bottom:Z,"bottom-left":Z,"bottom-right":Z,left:Z,right:Z}}return{center:u.Point.convert(O.center||[0,0]),top:u.Point.convert(O.top||[0,0]),"top-left":u.Point.convert(O["top-left"]||[0,0]),"top-right":u.Point.convert(O["top-right"]||[0,0]),bottom:u.Point.convert(O.bottom||[0,0]),"bottom-left":u.Point.convert(O["bottom-left"]||[0,0]),"bottom-right":u.Point.convert(O["bottom-right"]||[0,0]),left:u.Point.convert(O.left||[0,0]),right:u.Point.convert(O.right||[0,0])}}return F(new u.Point(0,0))})(this.options.offset);if(!f){var v,w=this._container.offsetWidth,A=this._container.offsetHeight;v=p.y+d.bottom.y<A?["top"]:p.y>this._map.transform.height-A?["bottom"]:[],p.x<w/2?v.push("left"):p.x>this._map.transform.width-w/2&&v.push("right"),f=v.length===0?"bottom":v.join("-")}var R=p.add(d[f]).round();M.setTransform(this._container,En[f]+" translate("+R.x+"px,"+R.y+"px)"),ys(this._container,f,"popup")}},o.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var n=this._container.querySelector(Da);n&&n.focus()}},o.prototype._onClose=function(){this.remove()},o})(u.Evented),gs={version:u.version,supported:U,setRTLTextPlugin:u.setRTLTextPlugin,getRTLTextPluginStatus:u.getRTLTextPluginStatus,Map:Ll,NavigationControl:Fn,GeolocateControl:Iu,AttributionControl:Ai,ScaleControl:ro,FullscreenControl:ln,Popup:Au,Marker:za,Style:Ui,LngLat:u.LngLat,LngLatBounds:u.LngLatBounds,Point:u.Point,MercatorCoordinate:u.MercatorCoordinate,Evented:u.Evented,config:u.config,prewarm:function(){ge().acquire(ye)},clearPrewarmedResources:function(){var i=Je;i&&(i.isPreloaded()&&i.numActive()===1?(i.release(ye),Je=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 u.config.ACCESS_TOKEN},set accessToken(i){u.config.ACCESS_TOKEN=i},get baseApiUrl(){return u.config.API_URL},set baseApiUrl(i){u.config.API_URL=i},get workerCount(){return Ae.workerCount},set workerCount(i){Ae.workerCount=i},get maxParallelImageRequests(){return u.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(i){u.config.MAX_PARALLEL_IMAGE_REQUESTS=i},clearStorage:function(i){u.clearTileCache(i)},workerUrl:""};return gs})),E}))})(wc)),wc.exports}var L0=R0();const fo=wt.getDefaultExportFromCjs(L0);var Yu={exports:{}},xp,Ly;function F0(){if(Ly)return xp;Ly=1,xp=_;var y={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"};function _(x){if(!x||!x.type)return null;var k=y[x.type];if(!k)return null;if(k==="geometry")return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:x}]};if(k==="feature")return{type:"FeatureCollection",features:[x]};if(k==="featurecollection")return x}return xp}function Sc(y){switch(y&&y.type||null){case"FeatureCollection":return y.features=y.features.reduce(function(_,x){return _.concat(Sc(x))},[]),y;case"Feature":return y.geometry?Sc(y.geometry).map(function(_){var x={type:"Feature",properties:JSON.parse(JSON.stringify(y.properties)),geometry:_};return y.id!==void 0&&(x.id=y.id),x}):[y];case"MultiPoint":return y.coordinates.map(function(_){return{type:"Point",coordinates:_}});case"MultiPolygon":return y.coordinates.map(function(_){return{type:"Polygon",coordinates:_}});case"MultiLineString":return y.coordinates.map(function(_){return{type:"LineString",coordinates:_}});case"GeometryCollection":return y.geometries.map(Sc).reduce(function(_,x){return _.concat(x)},[]);case"Point":case"Polygon":case"LineString":return[y]}}const O0=Object.freeze(Object.defineProperty({__proto__:null,default:Sc},Symbol.toStringTag,{value:"Module"})),V0=wt.getAugmentedNamespace(O0);var bp,Fy;function q0(){return Fy||(Fy=1,bp=function(_){return x(_);function x(k){return Array.isArray(k)&&k.length&&typeof k[0]=="number"?[k]:k.reduce(function(E,D){return Array.isArray(D)&&Array.isArray(D[0])?E.concat(x(D)):(E.push(D),E)},[])}}),bp}var wp,Oy;function U0(){if(Oy)return wp;Oy=1;var y=F0(),_=V0,x=q0();return _ instanceof Function||(_=_.default),wp=function(k){if(!k)return[];var E=_(y(k)),D=[];return E.features.forEach(function(u){u.geometry&&(D=D.concat(x(u.geometry.coordinates)))}),D},wp}var Sp,Vy;function Qu(){if(Vy)return Sp;Vy=1;var y=Function.prototype.toString,_=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,x,k;if(typeof _=="function"&&typeof Object.defineProperty=="function")try{x=Object.defineProperty({},"length",{get:function(){throw k}}),k={},_(function(){throw 42},null,x)}catch(Ue){Ue!==k&&(_=null)}else _=null;var E=/^\s*class\b/,D=function(fe){try{var Ke=y.call(fe);return E.test(Ke)}catch{return!1}},u=function(fe){try{return D(fe)?!1:(y.call(fe),!0)}catch{return!1}},U=Object.prototype.toString,M="[object Object]",Y="[object Function]",X="[object GeneratorFunction]",ae="[object HTMLAllCollection]",J="[object HTML document.all class]",Se="[object HTMLCollection]",be=typeof Symbol=="function"&&!!Symbol.toStringTag,De=!(0 in[,]),Ze=function(){return!1};if(typeof document=="object"){var He=document.all;U.call(He)===U.call(document.all)&&(Ze=function(fe){if((De||!fe)&&(typeof fe>"u"||typeof fe=="object"))try{var Ke=U.call(fe);return(Ke===ae||Ke===J||Ke===Se||Ke===M)&&fe("")==null}catch{}return!1})}return Sp=_?function(fe){if(Ze(fe))return!0;if(!fe||typeof fe!="function"&&typeof fe!="object")return!1;try{_(fe,null,x)}catch(Ke){if(Ke!==k)return!1}return!D(fe)&&u(fe)}:function(fe){if(Ze(fe))return!0;if(!fe||typeof fe!="function"&&typeof fe!="object")return!1;if(be)return u(fe);if(D(fe))return!1;var Ke=U.call(fe);return Ke!==Y&&Ke!==X&&!/^\[object HTML/.test(Ke)?!1:u(fe)},Sp}var Ip,qy;function Kd(){if(qy)return Ip;qy=1;var y=Qu(),_=Object.prototype.toString,x=Object.prototype.hasOwnProperty,k=function(M,Y,X){for(var ae=0,J=M.length;ae<J;ae++)x.call(M,ae)&&(X==null?Y(M[ae],ae,M):Y.call(X,M[ae],ae,M))},E=function(M,Y,X){for(var ae=0,J=M.length;ae<J;ae++)X==null?Y(M.charAt(ae),ae,M):Y.call(X,M.charAt(ae),ae,M)},D=function(M,Y,X){for(var ae in M)x.call(M,ae)&&(X==null?Y(M[ae],ae,M):Y.call(X,M[ae],ae,M))};function u(U){return _.call(U)==="[object Array]"}return Ip=function(M,Y,X){if(!y(Y))throw new TypeError("iterator must be a function");var ae;arguments.length>=3&&(ae=X),u(M)?k(M,Y,ae):typeof M=="string"?E(M,Y,ae):D(M,Y,ae)},Ip}var Tp,Uy;function mx(){return Uy||(Uy=1,Tp=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Tp}var Ap,Ny;function el(){if(Ny)return Ap;Ny=1;var y=mx(),_=typeof globalThis>"u"?wt.commonjsGlobal:globalThis;return Ap=function(){for(var k=[],E=0;E<y.length;E++)typeof _[y[E]]=="function"&&(k[k.length]=y[E]);return k},Ap}var Ep={exports:{}},Pp,jy;function Jd(){return jy||(jy=1,Pp=Object),Pp}var Cp,Gy;function N0(){return Gy||(Gy=1,Cp=Error),Cp}var kp,$y;function j0(){return $y||($y=1,kp=EvalError),kp}var Mp,Zy;function Yd(){return Zy||(Zy=1,Mp=RangeError),Mp}var Bp,Wy;function G0(){return Wy||(Wy=1,Bp=ReferenceError),Bp}var zp,Hy;function Nn(){return Hy||(Hy=1,zp=SyntaxError),zp}var Dp,Xy;function At(){return Xy||(Xy=1,Dp=TypeError),Dp}var Rp,Ky;function $0(){return Ky||(Ky=1,Rp=URIError),Rp}var Lp,Jy;function Ic(){return Jy||(Jy=1,Lp=Math.abs),Lp}var Fp,Yy;function Ha(){return Yy||(Yy=1,Fp=Math.floor),Fp}var Op,Qy;function Qd(){return Qy||(Qy=1,Op=Math.max),Op}var Vp,ev;function em(){return ev||(ev=1,Vp=Math.min),Vp}var qp,tv;function Xa(){return tv||(tv=1,qp=Math.pow),qp}var Up,rv;function Z0(){return rv||(rv=1,Up=Math.round),Up}var Np,iv;function Ka(){return iv||(iv=1,Np=Number.isNaN||function(_){return _!==_}),Np}var jp,nv;function W0(){if(nv)return jp;nv=1;var y=Ka();return jp=function(x){return y(x)||x===0?x:x<0?-1:1},jp}var Gp,ov;function H0(){return ov||(ov=1,Gp=Object.getOwnPropertyDescriptor),Gp}var $p,av;function No(){if(av)return $p;av=1;var y=H0();if(y)try{y([],"length")}catch{y=null}return $p=y,$p}var Zp,sv;function Xs(){if(sv)return Zp;sv=1;var y=Object.defineProperty||!1;if(y)try{y({},"a",{value:1})}catch{y=!1}return Zp=y,Zp}var Wp,uv;function tm(){return uv||(uv=1,Wp=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var _={},x=Symbol("test"),k=Object(x);if(typeof x=="string"||Object.prototype.toString.call(x)!=="[object Symbol]"||Object.prototype.toString.call(k)!=="[object Symbol]")return!1;var E=42;_[x]=E;for(var D in _)return!1;if(typeof Object.keys=="function"&&Object.keys(_).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(_).length!==0)return!1;var u=Object.getOwnPropertySymbols(_);if(u.length!==1||u[0]!==x||!Object.prototype.propertyIsEnumerable.call(_,x))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var U=Object.getOwnPropertyDescriptor(_,x);if(U.value!==E||U.enumerable!==!0)return!1}return!0}),Wp}var Hp,lv;function yx(){if(lv)return Hp;lv=1;var y=typeof Symbol<"u"&&Symbol,_=tm();return Hp=function(){return typeof y!="function"||typeof Symbol!="function"||typeof y("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:_()},Hp}var Xp,cv;function vx(){return cv||(cv=1,Xp=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Xp}var Kp,pv;function gx(){if(pv)return Kp;pv=1;var y=Jd();return Kp=y.getPrototypeOf||null,Kp}var Jp,hv;function X0(){if(hv)return Jp;hv=1;var y="Function.prototype.bind called on incompatible ",_=Object.prototype.toString,x=Math.max,k="[object Function]",E=function(M,Y){for(var X=[],ae=0;ae<M.length;ae+=1)X[ae]=M[ae];for(var J=0;J<Y.length;J+=1)X[J+M.length]=Y[J];return X},D=function(M,Y){for(var X=[],ae=Y,J=0;ae<M.length;ae+=1,J+=1)X[J]=M[ae];return X},u=function(U,M){for(var Y="",X=0;X<U.length;X+=1)Y+=U[X],X+1<U.length&&(Y+=M);return Y};return Jp=function(M){var Y=this;if(typeof Y!="function"||_.apply(Y)!==k)throw new TypeError(y+Y);for(var X=D(arguments,1),ae,J=function(){if(this instanceof ae){var He=Y.apply(this,E(X,arguments));return Object(He)===He?He:this}return Y.apply(M,E(X,arguments))},Se=x(0,Y.length-X.length),be=[],De=0;De<Se;De++)be[De]="$"+De;if(ae=Function("binder","return function ("+u(be,",")+"){ return binder.apply(this,arguments); }")(J),Y.prototype){var Ze=function(){};Ze.prototype=Y.prototype,ae.prototype=new Ze,Ze.prototype=null}return ae},Jp}var Yp,fv;function tl(){if(fv)return Yp;fv=1;var y=X0();return Yp=Function.prototype.bind||y,Yp}var Qp,dv;function rm(){return dv||(dv=1,Qp=Function.prototype.call),Qp}var eh,mv;function im(){return mv||(mv=1,eh=Function.prototype.apply),eh}var th,yv;function K0(){return yv||(yv=1,th=typeof Reflect<"u"&&Reflect&&Reflect.apply),th}var rh,vv;function _x(){if(vv)return rh;vv=1;var y=tl(),_=im(),x=rm(),k=K0();return rh=k||y.call(x,_),rh}var ih,gv;function nm(){if(gv)return ih;gv=1;var y=tl(),_=At(),x=rm(),k=_x();return ih=function(D){if(D.length<1||typeof D[0]!="function")throw new _("a function is required");return k(y,x,D)},ih}var nh,_v;function J0(){if(_v)return nh;_v=1;var y=nm(),_=No(),x;try{x=[].__proto__===Array.prototype}catch(u){if(!u||typeof u!="object"||!("code"in u)||u.code!=="ERR_PROTO_ACCESS")throw u}var k=!!x&&_&&_(Object.prototype,"__proto__"),E=Object,D=E.getPrototypeOf;return nh=k&&typeof k.get=="function"?y([k.get]):typeof D=="function"?function(U){return D(U==null?U:E(U))}:!1,nh}var oh,xv;function Ja(){if(xv)return oh;xv=1;var y=vx(),_=gx(),x=J0();return oh=y?function(E){return y(E)}:_?function(E){if(!E||typeof E!="object"&&typeof E!="function")throw new TypeError("getProto: not an object");return _(E)}:x?function(E){return x(E)}:null,oh}var ah,bv;function xx(){if(bv)return ah;bv=1;const y=(async function(){}).constructor;return ah=()=>y,ah}var sh,wv;function bx(){if(wv)return sh;wv=1;const y=(function*(){}).constructor;return sh=()=>y,sh}var uh,Sv;function Y0(){if(Sv)return uh;Sv=1;const y=(async function*(){}).constructor;return uh=()=>y,uh}var lh,Iv;function jo(){if(Iv)return lh;Iv=1;var y=Function.prototype.call,_=Object.prototype.hasOwnProperty,x=tl();return lh=x.call(y,_),lh}var ch,Tv;function Er(){if(Tv)return ch;Tv=1;var y,_=Jd(),x=N0(),k=j0(),E=Yd(),D=G0(),u=Nn(),U=At(),M=$0(),Y=Ic(),X=Ha(),ae=Qd(),J=em(),Se=Xa(),be=Z0(),De=W0(),Ze=No(),He=Xs(),Ue=function(){throw new U},fe=Ze?(function(){try{return arguments.callee,Ue}catch{try{return Ze(arguments,"callee").get}catch{return Ue}}})():Ue,Ke=yx()(),Ne=Ja(),It=gx(),we=vx(),je=im(),Le=rm(),tt={},Mt=typeof Uint8Array>"u"||!Ne?y:Ne(Uint8Array),Wt={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?y:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?y:ArrayBuffer,"%ArrayIteratorPrototype%":Ke&&Ne?Ne([][Symbol.iterator]()):y,"%AsyncFromSyncIteratorPrototype%":y,"%AsyncFunction%":tt,"%AsyncGenerator%":tt,"%AsyncGeneratorFunction%":tt,"%AsyncIteratorPrototype%":tt,"%Atomics%":typeof Atomics>"u"?y:Atomics,"%BigInt%":typeof BigInt>"u"?y:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?y:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?y:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?y:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":x,"%eval%":eval,"%EvalError%":k,"%Float16Array%":typeof Float16Array>"u"?y:Float16Array,"%Float32Array%":typeof Float32Array>"u"?y:Float32Array,"%Float64Array%":typeof Float64Array>"u"?y:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?y:FinalizationRegistry,"%Function%":Function,"%GeneratorFunction%":tt,"%Int8Array%":typeof Int8Array>"u"?y:Int8Array,"%Int16Array%":typeof Int16Array>"u"?y:Int16Array,"%Int32Array%":typeof Int32Array>"u"?y:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ke&&Ne?Ne(Ne([][Symbol.iterator]())):y,"%JSON%":typeof JSON=="object"?JSON:y,"%Map%":typeof Map>"u"?y:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ke||!Ne?y:Ne(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":_,"%Object.getOwnPropertyDescriptor%":Ze,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?y:Promise,"%Proxy%":typeof Proxy>"u"?y:Proxy,"%RangeError%":E,"%ReferenceError%":D,"%Reflect%":typeof Reflect>"u"?y:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?y:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ke||!Ne?y:Ne(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?y:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ke&&Ne?Ne(""[Symbol.iterator]()):y,"%Symbol%":Ke?Symbol:y,"%SyntaxError%":u,"%ThrowTypeError%":fe,"%TypedArray%":Mt,"%TypeError%":U,"%Uint8Array%":typeof Uint8Array>"u"?y:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?y:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?y:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?y:Uint32Array,"%URIError%":M,"%WeakMap%":typeof WeakMap>"u"?y:WeakMap,"%WeakRef%":typeof WeakRef>"u"?y:WeakRef,"%WeakSet%":typeof WeakSet>"u"?y:WeakSet,"%Function.prototype.call%":Le,"%Function.prototype.apply%":je,"%Object.defineProperty%":He,"%Object.getPrototypeOf%":It,"%Math.abs%":Y,"%Math.floor%":X,"%Math.max%":ae,"%Math.min%":J,"%Math.pow%":Se,"%Math.round%":be,"%Math.sign%":De,"%Reflect.getPrototypeOf%":we};if(Ne)try{null.error}catch(Nr){var St=Ne(Ne(Nr));Wt["%Error.prototype%"]=St}var Ut=xx(),Hr=bx(),Pr=Y0(),bi=function Nr(ar){var sr;if(ar==="%AsyncFunction%")sr=Ut()||void 0;else if(ar==="%GeneratorFunction%")sr=Hr()||void 0;else if(ar==="%AsyncGeneratorFunction%")sr=Pr()||void 0;else if(ar==="%AsyncGenerator%"){var lt=Nr("%AsyncGeneratorFunction%");lt&&(sr=lt.prototype)}else if(ar==="%AsyncIteratorPrototype%"){var mr=Nr("%AsyncGenerator%");mr&&Ne&&(sr=Ne(mr.prototype))}return Wt[ar]=sr,sr},or={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Rr=tl(),et=jo(),Lr=Rr.call(Le,Array.prototype.concat),Xr=Rr.call(je,Array.prototype.splice),Et=Rr.call(Le,String.prototype.replace),Fr=Rr.call(Le,String.prototype.slice),Mi=Rr.call(Le,RegExp.prototype.exec),pi=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Or=/\\(\\)?/g,Xi=function(ar){var sr=Fr(ar,0,1),lt=Fr(ar,-1);if(sr==="%"&&lt!=="%")throw new u("invalid intrinsic syntax, expected closing `%`");if(lt==="%"&&sr!=="%")throw new u("invalid intrinsic syntax, expected opening `%`");var mr=[];return Et(ar,pi,function(hr,jr,fr,br){mr[mr.length]=fr?Et(br,Or,"$1"):jr||hr}),mr},Nt=function(ar,sr){var lt=ar,mr;if(et(or,lt)&&(mr=or[lt],lt="%"+mr[0]+"%"),et(Wt,lt)){var hr=Wt[lt];if(hr===tt&&(hr=bi(lt)),typeof hr>"u"&&!sr)throw new U("intrinsic "+ar+" exists, but is not available. Please file an issue!");return{alias:mr,name:lt,value:hr}}throw new u("intrinsic "+ar+" does not exist!")};return ch=function(ar,sr){if(typeof ar!="string"||ar.length===0)throw new U("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof sr!="boolean")throw new U('"allowMissing" argument must be a boolean');if(Mi(/^%?[^%]*%?$/,ar)===null)throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var lt=Xi(ar),mr=lt.length>0?lt[0]:"",hr=Nt("%"+mr+"%",sr),jr=hr.name,fr=hr.value,br=!1,dn=hr.alias;dn&&(mr=dn[0],Xr(lt,Lr([0,1],dn)));for(var Kr=1,Bi=!0;Kr<lt.length;Kr+=1){var hi=lt[Kr],ti=Fr(hi,0,1),ri=Fr(hi,-1);if((ti==='"'||ti==="'"||ti==="`"||ri==='"'||ri==="'"||ri==="`")&&ti!==ri)throw new u("property names with quotes must have matching quotes");if((hi==="constructor"||!Bi)&&(br=!0),mr+="."+hi,jr="%"+mr+"%",et(Wt,jr))fr=Wt[jr];else if(fr!=null){if(!(hi in fr)){if(!sr)throw new U("base intrinsic for "+ar+" exists, but the property is not available.");return}if(Ze&&Kr+1>=lt.length){var Vi=Ze(fr,hi);Bi=!!Vi,Bi&&"get"in Vi&&!("originalValue"in Vi.get)?fr=Vi.get:fr=fr[hi]}else Bi=et(fr,hi),fr=fr[hi];Bi&&!br&&(Wt[jr]=fr)}}return fr},ch}var ph,Av;function om(){if(Av)return ph;Av=1;var y=Xs(),_=Nn(),x=At(),k=No();return ph=function(D,u,U){if(!D||typeof D!="object"&&typeof D!="function")throw new x("`obj` must be an object or a function`");if(typeof u!="string"&&typeof u!="symbol")throw new x("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new x("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new x("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new x("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new x("`loose`, if provided, must be a boolean");var M=arguments.length>3?arguments[3]:null,Y=arguments.length>4?arguments[4]:null,X=arguments.length>5?arguments[5]:null,ae=arguments.length>6?arguments[6]:!1,J=!!k&&k(D,u);if(y)y(D,u,{configurable:X===null&&J?J.configurable:!X,enumerable:M===null&&J?J.enumerable:!M,value:U,writable:Y===null&&J?J.writable:!Y});else if(ae||!M&&!Y&&!X)D[u]=U;else throw new _("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},ph}var hh,Ev;function rl(){if(Ev)return hh;Ev=1;var y=Xs(),_=function(){return!!y};return _.hasArrayLengthDefineBug=function(){if(!y)return null;try{return y([],"length",{value:1}).length!==1}catch{return!0}},hh=_,hh}var fh,Pv;function Q0(){if(Pv)return fh;Pv=1;var y=Er(),_=om(),x=rl()(),k=No(),E=At(),D=y("%Math.floor%");return fh=function(U,M){if(typeof U!="function")throw new E("`fn` is not a function");if(typeof M!="number"||M<0||M>4294967295||D(M)!==M)throw new E("`length` must be a positive 32-bit integer");var Y=arguments.length>2&&!!arguments[2],X=!0,ae=!0;if("length"in U&&k){var J=k(U,"length");J&&!J.configurable&&(X=!1),J&&!J.writable&&(ae=!1)}return(X||ae||!Y)&&(x?_(U,"length",M,!0,!0):_(U,"length",M)),U},fh}var dh,Cv;function e1(){if(Cv)return dh;Cv=1;var y=tl(),_=im(),x=_x();return dh=function(){return x(y,_,arguments)},dh}var kv;function ha(){return kv||(kv=1,(function(y){var _=Q0(),x=Xs(),k=nm(),E=e1();y.exports=function(u){var U=k(arguments),M=1+u.length-(arguments.length-1);return _(U,M>0?M:0,!0)},x?x(y.exports,"apply",{value:E}):y.exports.apply=E})(Ep)),Ep.exports}var mh,Mv;function pr(){if(Mv)return mh;Mv=1;var y=Er(),_=nm(),x=_([y("%String.prototype.indexOf%")]);return mh=function(E,D){var u=y(E,!!D);return typeof u=="function"&&x(E,".prototype.")>-1?_([u]):u},mh}var yh,Bv;function Go(){if(Bv)return yh;Bv=1;var y=tm();return yh=function(){return y()&&!!Symbol.toStringTag},yh}var vh,zv;function Ks(){if(zv)return vh;zv=1;var y=Kd(),_=el(),x=ha(),k=pr(),E=No(),D=Ja(),u=k("Object.prototype.toString"),U=Go()(),M=typeof globalThis>"u"?wt.commonjsGlobal:globalThis,Y=_(),X=k("String.prototype.slice"),ae=k("Array.prototype.indexOf",!0)||function(He,Ue){for(var fe=0;fe<He.length;fe+=1)if(He[fe]===Ue)return fe;return-1},J={__proto__:null};U&&E&&D?y(Y,function(Ze){var He=new M[Ze];if(Symbol.toStringTag in He&&D){var Ue=D(He),fe=E(Ue,Symbol.toStringTag);if(!fe&&Ue){var Ke=D(Ue);fe=E(Ke,Symbol.toStringTag)}if(fe&&fe.get){var Ne=x(fe.get);J["$"+Ze]=Ne}}}):y(Y,function(Ze){var He=new M[Ze],Ue=He.slice||He.set;if(Ue){var fe=x(Ue);J["$"+Ze]=fe}});function Se(Ze){var He=!1;return y(J,function(Ue,fe){if(!He)try{"$"+Ue(Ze)===fe&&(He=X(fe,1))}catch{}}),He}function be(Ze){var He=!1;return y(J,function(Ue,fe){if(!He)try{Ue(Ze),He=X(fe,1)}catch{}}),He}function De(Ze){return ae(Y,Ze)>-1}return vh=function(He){if(!He||typeof He!="object")return!1;if(!U){var Ue=X(u(He),8,-1);return De(Ue)?Ue:Ue!=="Object"?!1:be(He)}return E?Se(He):null},vh}var gh,Dv;function wx(){if(Dv)return gh;Dv=1;var y=Object.prototype.toString;return gh=function(x){var k=y.call(x),E=k==="[object Arguments]";return E||(E=k!=="[object Array]"&&x!==null&&typeof x=="object"&&typeof x.length=="number"&&x.length>=0&&y.call(x.callee)==="[object Function]"),E},gh}var _h,Rv;function t1(){if(Rv)return _h;Rv=1;var y;if(!Object.keys){var _=Object.prototype.hasOwnProperty,x=Object.prototype.toString,k=wx(),E=Object.prototype.propertyIsEnumerable,D=!E.call({toString:null},"toString"),u=E.call(function(){},"prototype"),U=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],M=function(J){var Se=J.constructor;return Se&&Se.prototype===J},Y={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},X=(function(){if(typeof window>"u")return!1;for(var J in window)try{if(!Y["$"+J]&&_.call(window,J)&&window[J]!==null&&typeof window[J]=="object")try{M(window[J])}catch{return!0}}catch{return!0}return!1})(),ae=function(J){if(typeof window>"u"||!X)return M(J);try{return M(J)}catch{return!1}};y=function(Se){var be=Se!==null&&typeof Se=="object",De=x.call(Se)==="[object Function]",Ze=k(Se),He=be&&x.call(Se)==="[object String]",Ue=[];if(!be&&!De&&!Ze)throw new TypeError("Object.keys called on a non-object");var fe=u&&De;if(He&&Se.length>0&&!_.call(Se,0))for(var Ke=0;Ke<Se.length;++Ke)Ue.push(String(Ke));if(Ze&&Se.length>0)for(var Ne=0;Ne<Se.length;++Ne)Ue.push(String(Ne));else for(var It in Se)!(fe&&It==="prototype")&&_.call(Se,It)&&Ue.push(String(It));if(D)for(var we=ae(Se),je=0;je<U.length;++je)!(we&&U[je]==="constructor")&&_.call(Se,U[je])&&Ue.push(U[je]);return Ue}}return _h=y,_h}var xh,Lv;function r1(){if(Lv)return xh;Lv=1;var y=Array.prototype.slice,_=wx(),x=Object.keys,k=x?function(u){return x(u)}:t1(),E=Object.keys;return k.shim=function(){if(Object.keys){var u=(function(){var U=Object.keys(arguments);return U&&U.length===arguments.length})(1,2);u||(Object.keys=function(M){return _(M)?E(y.call(M)):E(M)})}else Object.keys=k;return Object.keys||k},xh=k,xh}var bh,Fv;function am(){if(Fv)return bh;Fv=1;var y=r1(),_=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",x=Object.prototype.toString,k=Array.prototype.concat,E=om(),D=function(Y){return typeof Y=="function"&&x.call(Y)==="[object Function]"},u=rl()(),U=function(Y,X,ae,J){if(X in Y){if(J===!0){if(Y[X]===ae)return}else if(!D(J)||!J())return}u?E(Y,X,ae,!0):E(Y,X,ae)},M=function(Y,X){var ae=arguments.length>2?arguments[2]:{},J=y(X);_&&(J=k.call(J,Object.getOwnPropertySymbols(X)));for(var Se=0;Se<J.length;Se+=1)U(Y,J[Se],X[J[Se]],ae[J[Se]])};return M.supportsDescriptors=!!u,bh=M,bh}const i1={},n1=Object.freeze(Object.defineProperty({__proto__:null,default:i1},Symbol.toStringTag,{value:"Module"})),o1=wt.getAugmentedNamespace(n1);var wh,Ov;function sm(){if(Ov)return wh;Ov=1;var y=typeof Map=="function"&&Map.prototype,_=Object.getOwnPropertyDescriptor&&y?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,x=y&&_&&typeof _.get=="function"?_.get:null,k=y&&Map.prototype.forEach,E=typeof Set=="function"&&Set.prototype,D=Object.getOwnPropertyDescriptor&&E?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=E&&D&&typeof D.get=="function"?D.get:null,U=E&&Set.prototype.forEach,M=typeof WeakMap=="function"&&WeakMap.prototype,Y=M?WeakMap.prototype.has:null,X=typeof WeakSet=="function"&&WeakSet.prototype,ae=X?WeakSet.prototype.has:null,J=typeof WeakRef=="function"&&WeakRef.prototype,Se=J?WeakRef.prototype.deref:null,be=Boolean.prototype.valueOf,De=Object.prototype.toString,Ze=Function.prototype.toString,He=String.prototype.match,Ue=String.prototype.slice,fe=String.prototype.replace,Ke=String.prototype.toUpperCase,Ne=String.prototype.toLowerCase,It=RegExp.prototype.test,we=Array.prototype.concat,je=Array.prototype.join,Le=Array.prototype.slice,tt=Math.floor,Mt=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Wt=Object.getOwnPropertySymbols,St=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ut=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Hr=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ut||!0)?Symbol.toStringTag:null,Pr=Object.prototype.propertyIsEnumerable,bi=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(de){return de.__proto__}:null);function or(de,_e){if(de===1/0||de===-1/0||de!==de||de&&de>-1e3&&de<1e3||It.call(/e/,_e))return _e;var jt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof de=="number"){var tr=de<0?-tt(-de):tt(de);if(tr!==de){var Kt=String(tr),_t=Ue.call(_e,Kt.length+1);return fe.call(Kt,jt,"$&_")+"."+fe.call(fe.call(_t,/([0-9]{3})/g,"$&_"),/_$/,"")}}return fe.call(_e,jt,"$&_")}var Rr=o1,et=Rr.custom,Lr=mr(et)?et:null,Xr={__proto__:null,double:'"',single:"'"},Et={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};wh=function de(_e,jt,tr,Kt){var _t=jt||{};if(fr(_t,"quoteStyle")&&!fr(Xr,_t.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(fr(_t,"maxStringLength")&&(typeof _t.maxStringLength=="number"?_t.maxStringLength<0&&_t.maxStringLength!==1/0:_t.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var fi=fr(_t,"customInspect")?_t.customInspect:!0;if(typeof fi!="boolean"&&fi!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(fr(_t,"indent")&&_t.indent!==null&&_t.indent!==" "&&!(parseInt(_t.indent,10)===_t.indent&&_t.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(fr(_t,"numericSeparator")&&typeof _t.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var qi=_t.numericSeparator;if(typeof _e>"u")return"undefined";if(_e===null)return"null";if(typeof _e=="boolean")return _e?"true":"false";if(typeof _e=="string")return yo(_e,_t);if(typeof _e=="number"){if(_e===0)return 1/0/_e>0?"0":"-0";var ii=String(_e);return qi?or(_e,ii):ii}if(typeof _e=="bigint"){var Yt=String(_e)+"n";return qi?or(_e,Yt):Yt}var T=typeof _t.depth>"u"?5:_t.depth;if(typeof tr>"u"&&(tr=0),tr>=T&&T>0&&typeof _e=="object")return Or(_e)?"[Array]":"[Object]";var P=jn(_t,tr);if(typeof Kt>"u")Kt=[];else if(Kr(Kt,_e)>=0)return"[Circular]";function B(Me,yt,Fe){if(yt&&(Kt=Le.call(Kt),Kt.push(yt)),Fe){var Pt={depth:_t.depth};return fr(_t,"quoteStyle")&&(Pt.quoteStyle=_t.quoteStyle),de(Me,Pt,tr+1,Kt)}return de(Me,_t,tr+1,Kt)}if(typeof _e=="function"&&!Nt(_e)){var V=dn(_e),$=rn(_e,B);return"[Function"+(V?": "+V:" (anonymous)")+"]"+($.length>0?" { "+je.call($,", ")+" }":"")}if(mr(_e)){var re=Ut?fe.call(String(_e),/^(Symbol\(.*\))_[^)]*$/,"$1"):St.call(_e);return typeof _e=="object"&&!Ut?mn(re):re}if(Ki(_e)){for(var ie="<"+Ne.call(String(_e.nodeName)),L=_e.attributes||[],H=0;H<L.length;H++)ie+=" "+L[H].name+"="+Fr(Mi(L[H].value),"double",_t);return ie+=">",_e.childNodes&&_e.childNodes.length&&(ie+="..."),ie+="</"+Ne.call(String(_e.nodeName))+">",ie}if(Or(_e)){if(_e.length===0)return"[]";var se=rn(_e,B);return P&&!Zo(se)?"["+zn(se,P)+"]":"[ "+je.call(se,", ")+" ]"}if(Nr(_e)){var Ie=rn(_e,B);return!("cause"in Error.prototype)&&"cause"in _e&&!Pr.call(_e,"cause")?"{ ["+String(_e)+"] "+je.call(we.call("[cause]: "+B(_e.cause),Ie),", ")+" }":Ie.length===0?"["+String(_e)+"]":"{ ["+String(_e)+"] "+je.call(Ie,", ")+" }"}if(typeof _e=="object"&&fi){if(Lr&&typeof _e[Lr]=="function"&&Rr)return Rr(_e,{depth:T-tr});if(fi!=="symbol"&&typeof _e.inspect=="function")return _e.inspect()}if(Bi(_e)){var Ee=[];return k&&k.call(_e,function(Me,yt){Ee.push(B(yt,_e,!0)+" => "+B(Me,_e))}),Bn("Map",x.call(_e),Ee,P)}if(ri(_e)){var ye=[];return U&&U.call(_e,function(Me){ye.push(B(Me,_e))}),Bn("Set",u.call(_e),ye,P)}if(hi(_e))return Mn("WeakMap");if(Vi(_e))return Mn("WeakSet");if(ti(_e))return Mn("WeakRef");if(sr(_e))return mn(B(Number(_e)));if(hr(_e))return mn(B(Mt.call(_e)));if(lt(_e))return mn(be.call(_e));if(ar(_e))return mn(B(String(_e)));if(typeof window<"u"&&_e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&_e===globalThis||typeof wt.commonjsGlobal<"u"&&_e===wt.commonjsGlobal)return"{ [object globalThis] }";if(!Xi(_e)&&!Nt(_e)){var Ae=rn(_e,B),Je=bi?bi(_e)===Object.prototype:_e instanceof Object||_e.constructor===Object,Ge=_e instanceof Object?"":"null prototype",ge=!Je&&Hr&&Object(_e)===_e&&Hr in _e?Ue.call(br(_e),8,-1):Ge?"Object":"",Ve=Je||typeof _e.constructor!="function"?"":_e.constructor.name?_e.constructor.name+" ":"",Be=Ve+(ge||Ge?"["+je.call(we.call([],ge||[],Ge||[]),": ")+"] ":"");return Ae.length===0?Be+"{}":P?Be+"{"+zn(Ae,P)+"}":Be+"{ "+je.call(Ae,", ")+" }"}return String(_e)};function Fr(de,_e,jt){var tr=jt.quoteStyle||_e,Kt=Xr[tr];return Kt+de+Kt}function Mi(de){return fe.call(String(de),/"/g,"&quot;")}function pi(de){return!Hr||!(typeof de=="object"&&(Hr in de||typeof de[Hr]<"u"))}function Or(de){return br(de)==="[object Array]"&&pi(de)}function Xi(de){return br(de)==="[object Date]"&&pi(de)}function Nt(de){return br(de)==="[object RegExp]"&&pi(de)}function Nr(de){return br(de)==="[object Error]"&&pi(de)}function ar(de){return br(de)==="[object String]"&&pi(de)}function sr(de){return br(de)==="[object Number]"&&pi(de)}function lt(de){return br(de)==="[object Boolean]"&&pi(de)}function mr(de){if(Ut)return de&&typeof de=="object"&&de instanceof Symbol;if(typeof de=="symbol")return!0;if(!de||typeof de!="object"||!St)return!1;try{return St.call(de),!0}catch{}return!1}function hr(de){if(!de||typeof de!="object"||!Mt)return!1;try{return Mt.call(de),!0}catch{}return!1}var jr=Object.prototype.hasOwnProperty||function(de){return de in this};function fr(de,_e){return jr.call(de,_e)}function br(de){return De.call(de)}function dn(de){if(de.name)return de.name;var _e=He.call(Ze.call(de),/^function\s*([\w$]+)/);return _e?_e[1]:null}function Kr(de,_e){if(de.indexOf)return de.indexOf(_e);for(var jt=0,tr=de.length;jt<tr;jt++)if(de[jt]===_e)return jt;return-1}function Bi(de){if(!x||!de||typeof de!="object")return!1;try{x.call(de);try{u.call(de)}catch{return!0}return de instanceof Map}catch{}return!1}function hi(de){if(!Y||!de||typeof de!="object")return!1;try{Y.call(de,Y);try{ae.call(de,ae)}catch{return!0}return de instanceof WeakMap}catch{}return!1}function ti(de){if(!Se||!de||typeof de!="object")return!1;try{return Se.call(de),!0}catch{}return!1}function ri(de){if(!u||!de||typeof de!="object")return!1;try{u.call(de);try{x.call(de)}catch{return!0}return de instanceof Set}catch{}return!1}function Vi(de){if(!ae||!de||typeof de!="object")return!1;try{ae.call(de,ae);try{Y.call(de,Y)}catch{return!0}return de instanceof WeakSet}catch{}return!1}function Ki(de){return!de||typeof de!="object"?!1:typeof HTMLElement<"u"&&de instanceof HTMLElement?!0:typeof de.nodeName=="string"&&typeof de.getAttribute=="function"}function yo(de,_e){if(de.length>_e.maxStringLength){var jt=de.length-_e.maxStringLength,tr="... "+jt+" more character"+(jt>1?"s":"");return yo(Ue.call(de,0,_e.maxStringLength),_e)+tr}var Kt=Et[_e.quoteStyle||"single"];Kt.lastIndex=0;var _t=fe.call(fe.call(de,Kt,"\\$1"),/[\x00-\x1f]/g,$o);return Fr(_t,"single",_e)}function $o(de){var _e=de.charCodeAt(0),jt={8:"b",9:"t",10:"n",12:"f",13:"r"}[_e];return jt?"\\"+jt:"\\x"+(_e<16?"0":"")+Ke.call(_e.toString(16))}function mn(de){return"Object("+de+")"}function Mn(de){return de+" { ? }"}function Bn(de,_e,jt,tr){var Kt=tr?zn(jt,tr):je.call(jt,", ");return de+" ("+_e+") {"+Kt+"}"}function Zo(de){for(var _e=0;_e<de.length;_e++)if(Kr(de[_e],`
498
+ `)>=0)return!1;return!0}function jn(de,_e){var jt;if(de.indent===" ")jt=" ";else if(typeof de.indent=="number"&&de.indent>0)jt=je.call(Array(de.indent+1)," ");else return null;return{base:jt,prev:je.call(Array(_e+1),jt)}}function zn(de,_e){if(de.length===0)return"";var jt=`
499
+ `+_e.prev+_e.base;return jt+je.call(de,","+jt)+`
500
+ `+_e.prev}function rn(de,_e){var jt=Or(de),tr=[];if(jt){tr.length=de.length;for(var Kt=0;Kt<de.length;Kt++)tr[Kt]=fr(de,Kt)?_e(de[Kt],de):""}var _t=typeof Wt=="function"?Wt(de):[],fi;if(Ut){fi={};for(var qi=0;qi<_t.length;qi++)fi["$"+_t[qi]]=_t[qi]}for(var ii in de)fr(de,ii)&&(jt&&String(Number(ii))===ii&&ii<de.length||Ut&&fi["$"+ii]instanceof Symbol||(It.call(/[^\w$]/,ii)?tr.push(_e(ii,de)+": "+_e(de[ii],de)):tr.push(ii+": "+_e(de[ii],de))));if(typeof Wt=="function")for(var Yt=0;Yt<_t.length;Yt++)Pr.call(de,_t[Yt])&&tr.push("["+_e(_t[Yt])+"]: "+_e(de[_t[Yt]],de));return tr}return wh}var Sh,Vv;function Tc(){return Vv||(Vv=1,Sh=function(_){return typeof _=="string"||typeof _=="symbol"}),Sh}var Ih,qv;function fa(){return qv||(qv=1,Ih=function(_){return!!_&&(typeof _=="function"||typeof _=="object")}),Ih}var Th,Uv;function a1(){if(Uv)return Th;Uv=1;var y=At(),_=sm(),x=Tc(),k=fa();return Th=function(D,u){if(!k(D))throw new y("Assertion failed: Type(O) is not Object");if(!x(u))throw new y("Assertion failed: P is not a Property Key, got "+_(u));return D[u]},Th}var Ah,Nv;function mo(){if(Nv)return Ah;Nv=1;var y=Ka();return Ah=function(x){return(typeof x=="number"||typeof x=="bigint")&&!y(x)&&x!==1/0&&x!==-1/0},Ah}var Eh,jv;function Ac(){if(jv)return Eh;jv=1;var y=Ic(),_=Ha(),x=Ka(),k=mo();return Eh=function(D){if(typeof D!="number"||x(D)||!k(D))return!1;var u=y(D);return _(u)===u},Eh}var Ph,Gv;function Js(){if(Gv)return Ph;Gv=1;var y=ha(),_=pr(),x=Er(),k=x("%ArrayBuffer%",!0),E=_("ArrayBuffer.prototype.byteLength",!0),D=_("Object.prototype.toString"),u=!!k&&!E&&new k(0).slice,U=!!u&&y(u);return Ph=E||U?function(Y){if(!Y||typeof Y!="object")return!1;try{return E?E(Y):U(Y,0),!0}catch{return!1}}:k?function(Y){return D(Y)==="[object ArrayBuffer]"}:function(Y){return!1},Ph}var Ch,$v;function Sx(){if($v)return Ch;$v=1;var y=pr(),_=y("ArrayBuffer.prototype.byteLength",!0),x=Js();return Ch=function(E){return x(E)?_?_(E):E.byteLength:NaN},Ch}var kh,Zv;function il(){if(Zv)return kh;Zv=1;var y=pr(),_=y("SharedArrayBuffer.prototype.byteLength",!0);return kh=_?function(k){if(!k||typeof k!="object")return!1;try{return _(k),!0}catch{return!1}}:function(k){return!1},kh}var Mh,Wv;function Ys(){if(Wv)return Mh;Wv=1;var y=At(),_=Sx(),x=el()(),k=pr(),E=Js(),D=il(),u=k("SharedArrayBuffer.prototype.byteLength",!0);return Mh=function(M){var Y=D(M);if(!E(M)&&!Y)throw new y("Assertion failed: `arrayBuffer` must be an Object with an [[ArrayBufferData]] internal slot");if((Y?u:_)(M)===0)try{new wt.commonjsGlobal[x[0]](M)}catch(X){return!!X&&X.name==="TypeError"}return!1},Mh}var Bh,Hv;function Ix(){if(Hv)return Bh;Hv=1;var y=At(),_=jo(),x=fa(),k=Tc();return Bh=function(D,u){if(!x(D))throw new y("Assertion failed: `O` must be an Object");if(!k(u))throw new y("Assertion failed: `P` must be a Property Key");return _(D,u)},Bh}var zh,Xv;function Tx(){if(Xv)return zh;Xv=1;var y=Er(),_=y("%Array%"),x=!_.isArray&&pr()("Object.prototype.toString");return zh=_.isArray||function(E){return x(E)==="[object Array]"},zh}var Dh,Kv;function um(){return Kv||(Kv=1,Dh=Tx()),Dh}var Rh,Jv;function Ax(){return Jv||(Jv=1,Rh=function(_){return _==="BIGUINT64"||_==="BIGINT64"}),Rh}var Lh,Yv;function s1(){return Yv||(Yv=1,Lh=function(_){return _==="UINT8"||_==="UINT8C"||_==="UINT16"||_==="UINT32"||_==="BIGUINT64"}),Lh}var Fh,Qv;function u1(){if(Qv)return Fh;Qv=1;var y=Xa();return Fh=function(x){var k=x[3]&128?-1:1,E=(x[3]&127)<<1|x[2]>>7,D=(x[2]&127)<<16|x[1]<<8|x[0];return E===0&&D===0?k===1?0:-0:E===255&&D===0?k===1?1/0:-1/0:E===255&&D!==0?NaN:(E-=127,E===-127?k*D*y(2,-149):k*(1+D*y(2,-23))*y(2,E))},Fh}var Oh,eg;function l1(){if(eg)return Oh;eg=1;var y=Xa();return Oh=function(x){var k=x[7]&128?-1:1,E=(x[7]&127)<<4|(x[6]&240)>>4,D=(x[6]&15)*281474976710656+x[5]*1099511627776+x[4]*4294967296+x[3]*16777216+x[2]*65536+x[1]*256+x[0];return E===0&&D===0?k*0:E===2047&&D!==0?NaN:E===2047&&D===0?k*(1/0):(E-=1023,E===-1023?k*D*5e-324:k*(1+D/4503599627370496)*y(2,E))},Oh}var Vh,tg;function c1(){if(tg)return Vh;tg=1;var y=Er(),_=Xa(),x=y("%Number%"),k=y("%BigInt%",!0);return Vh=function(D,u,U,M){for(var Y=M?k:x,X=Y(0),ae=0;ae<D.length;ae++)X+=Y(D[ae]*_(2,8*ae));if(!U){var J=u*8;D[u-1]&128&&(X-=Y(_(2,J)))}return X},Vh}var qh,rg;function p1(){return rg||(rg=1,qh=function(_,x){for(var k=0;k<_.length;k+=1)if(!x(_[k],k,_))return!1;return!0}),qh}var Uh,ig;function h1(){return ig||(ig=1,Uh=function(_){return typeof _=="number"&&_>=0&&_<=255&&(_|0)===_}),Uh}var Nh,ng;function Qs(){return ng||(ng=1,Nh={__proto__:null,name:{__proto__:null,$Int8Array:"INT8",$Uint8Array:"UINT8",$Uint8ClampedArray:"UINT8C",$Int16Array:"INT16",$Uint16Array:"UINT16",$Int32Array:"INT32",$Uint32Array:"UINT32",$BigInt64Array:"BIGINT64",$BigUint64Array:"BIGUINT64",$Float32Array:"FLOAT32",$Float64Array:"FLOAT64"},size:{__proto__:null,$INT8:1,$UINT8:1,$UINT8C:1,$INT16:2,$UINT16:2,$INT32:4,$UINT32:4,$BIGINT64:8,$BIGUINT64:8,$FLOAT32:4,$FLOAT64:8},choices:'"INT8", "UINT8", "UINT8C", "INT16", "UINT16", "INT32", "UINT32", "BIGINT64", "BIGUINT64", "FLOAT32", or "FLOAT64"'}),Nh}var jh,og;function f1(){if(og)return jh;og=1;var y=Er(),_=pr(),x=Yd(),k=Nn(),E=At(),D=y("%BigInt%",!0),u=Ix(),U=um(),M=Ax(),Y=s1(),X=u1(),ae=l1(),J=c1(),Se=p1(),be=h1(),De=_("Array.prototype.reverse"),Ze=_("Array.prototype.slice"),He=Qs();return jh=function(fe,Ke,Ne){if(!u(He.size,"$"+fe))throw new E("Assertion failed: `type` must be a TypedArray element type");if(!U(Ke)||!Se(Ke,be))throw new E("Assertion failed: `rawBytes` must be an Array of bytes");if(typeof Ne!="boolean")throw new E("Assertion failed: `isLittleEndian` must be a Boolean");var It=He.size["$"+fe];if(Ke.length!==It)throw new x("Assertion failed: `rawBytes` must have a length of "+It+" for type "+fe);var we=M(fe);if(we&&!D)throw new k("this environment does not support BigInts");return Ke=Ze(Ke,0,It),Ne||De(Ke),fe==="FLOAT32"?X(Ke):fe==="FLOAT64"?ae(Ke):J(Ke,It,Y(fe),we)},jh}var Gh,ag;function Ex(){if(ag)return Gh;ag=1;var y={}.toString;return Gh=Array.isArray||function(_){return y.call(_)=="[object Array]"},Gh}var $h,sg;function d1(){if(sg)return $h;sg=1;var y=Er(),_=y("%Array.prototype.concat%"),x=ha(),k=pr(),E=k("Array.prototype.slice"),D=tm()(),u=D&&Symbol.isConcatSpreadable,U=[],M=u?x.apply(_,U):null,Y=u?Ex():null;return $h=u?function(ae){for(var J=0;J<arguments.length;J+=1){var Se=arguments[J];if(Se&&typeof Se=="object"&&typeof Se[u]=="boolean"){U[u]||(U[u]=!0);var be=Y(Se)?E(Se):[Se];be[u]=!0,arguments[J]=be}}return M(arguments)}:x(_,U),$h}var Zh,ug;function eu(){if(ug)return Zh;ug=1;var y=Ks();return Zh=function(x){return!!y(x)},Zh}var Wh,lg;function nl(){if(lg)return Wh;lg=1;var y=At(),_=pr(),x=_("TypedArray.prototype.buffer",!0),k=eu();return Wh=x||function(D){if(!k(D))throw new y("Not a Typed Array");return D.buffer},Wh}var Hh,cg;function Px(){if(cg)return Hh;cg=1;var y=Er(),_=y("%Uint8Array%",!0),x=y("%Uint32Array%",!0),k=nl(),E=x&&new x([305419896]),D=E&&new _(k(E));return Hh=D?D[0]===120?"little":D[0]===18?"big":D[0]===52?"mixed":"unknown":"indeterminate",Hh}var Xh,pg;function m1(){if(pg)return Xh;pg=1;var y=Er(),_=Nn(),x=At(),k=pr(),E=Ac(),D=y("%Uint8Array%",!0),u=k("Array.prototype.slice"),U=Ys(),M=f1(),Y=Js(),X=il(),ae=d1(),J=Qs(),Se=Px();return Xh=function(De,Ze,He,Ue,fe){var Ke=X(De);if(!Y(De)&&!Ke)throw new x("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!E(Ze))throw new x("Assertion failed: `byteIndex` must be an integer");if(typeof He!="string"||typeof J.size["$"+He]!="number")throw new x("Assertion failed: `type` must be one of "+J.choices);if(typeof Ue!="boolean")throw new x("Assertion failed: `isTypedArray` must be a boolean");if(fe!=="SEQ-CST"&&fe!=="UNORDERED")throw new x("Assertion failed: `order` must be either `SEQ-CST` or `UNORDERED`");if(arguments.length>5&&typeof arguments[5]!="boolean")throw new x("Assertion failed: `isLittleEndian` must be a boolean, if present");if(U(De))throw new x("Assertion failed: `arrayBuffer` is detached");if(Ze<0)throw new x("Assertion failed: `byteIndex` must be non-negative");var Ne=J.size["$"+He];if(!Ne)throw new x("Assertion failed: `type` must be one of "+J.choices);var It;if(Ke)throw new _("SharedArrayBuffer is not supported by this implementation");It=u(new D(De,Ze),0,Ne);var we=arguments.length>5?arguments[5]:Se==="little",je=we?u(ae([0,0,0,0,0,0,0,0],It),-Ne):u(ae(It,[0,0,0,0,0,0,0,0]),0,Ne);return M(He,je,we)},Xh}var Kh,hg;function Cx(){if(hg)return Kh;hg=1;var y=Ka();return Kh=function(x,k){return x===k?x===0?1/x===1/k:!0:y(x)&&y(k)},Kh}var Jh,fg;function y1(){if(fg)return Jh;fg=1;var y=At(),_=fa(),x=Tc(),k=Cx(),E=(function(){try{return delete[].length,!0}catch{return!1}})();return Jh=function(u,U,M,Y){if(!_(u))throw new y("Assertion failed: `O` must be an Object");if(!x(U))throw new y("Assertion failed: `P` must be a Property Key");if(typeof Y!="boolean")throw new y("Assertion failed: `Throw` must be a Boolean");if(Y){if(u[U]=M,E&&!k(u[U],M))throw new y("Attempted to assign to readonly property.");return!0}try{return u[U]=M,E?k(u[U],M):!0}catch{return!1}},Jh}var Yh,dg;function v1(){if(dg)return Yh;dg=1;var y=Er(),_=y("%BigInt%",!0),x=At(),k=Nn();return Yh=function(D){if(typeof D!="string")throw new x("`argument` must be a string");if(!_)throw new k("BigInts are not supported in this environment");try{return _(D)}catch{return}},Yh}var Qh,mg;function kx(){if(mg)return Qh;mg=1;var y=pr(),_=y("Date.prototype.getDay"),x=function(U){try{return _(U),!0}catch{return!1}},k=y("Object.prototype.toString"),E="[object Date]",D=Go()();return Qh=function(U){return typeof U!="object"||U===null?!1:D?x(U):k(U)===E},Qh}var yc={exports:{}},ef,yg;function Mx(){if(yg)return ef;yg=1;var y=pr(),_=Go()(),x=jo(),k=No(),E;if(_){var D=y("RegExp.prototype.exec"),u={},U=function(){throw u},M={toString:U,valueOf:U};typeof Symbol.toPrimitive=="symbol"&&(M[Symbol.toPrimitive]=U),E=function(J){if(!J||typeof J!="object")return!1;var Se=k(J,"lastIndex"),be=Se&&x(Se,"value");if(!be)return!1;try{D(J,M)}catch(De){return De===u}}}else{var Y=y("Object.prototype.toString"),X="[object RegExp]";E=function(J){return!J||typeof J!="object"&&typeof J!="function"?!1:Y(J)===X}}return ef=E,ef}var tf,vg;function ol(){if(vg)return tf;vg=1;var y=pr(),_=Mx(),x=y("RegExp.prototype.exec"),k=At();return tf=function(D){if(!_(D))throw new k("`regex` must be a RegExp");return function(U){return x(D,U)!==null}},tf}var gg;function Bx(){if(gg)return yc.exports;gg=1;var y=pr(),_=y("Object.prototype.toString"),x=yx()(),k=ol();if(x){var E=y("Symbol.prototype.toString"),D=k(/^Symbol\(.*\)$/),u=function(M){return typeof M.valueOf()!="symbol"?!1:D(E(M))};yc.exports=function(M){if(typeof M=="symbol")return!0;if(!M||typeof M!="object"||_(M)!=="[object Symbol]")return!1;try{return u(M)}catch{return!1}}}else yc.exports=function(M){return!1};return yc.exports}var rf,_g;function g1(){return _g||(_g=1,rf=function(_){return _===null||typeof _!="function"&&typeof _!="object"}),rf}var nf,xg;function zx(){return xg||(xg=1,nf=function(_){return typeof _=="string"||typeof _=="symbol"}),nf}var of,bg;function _1(){if(bg)return of;bg=1;var y=At(),_=sm(),x=zx();return of=function(E,D){if(!x(D))throw new y("Assertion failed: P is not a Property Key, got "+_(D));return E[D]},of}var af,wg;function x1(){if(wg)return af;wg=1;var y=At(),_=Qu(),x=sm(),k=_1(),E=zx();return af=function(u,U){if(!E(U))throw new y("Assertion failed: P is not a Property Key");var M=k(u,U);if(M!=null){if(!_(M))throw new y(x(U)+" is not a function: "+x(M));return M}},af}var sf,Sg;function b1(){if(Sg)return sf;Sg=1;var y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol",_=Qu(),x=kx(),k=Bx(),E=At(),D=g1();function u(M,Y){if(typeof M>"u"||M===null)throw new E("Cannot call method on "+M);if(typeof Y!="string"||Y!=="number"&&Y!=="string")throw new E('hint must be "string" or "number"');var X=Y==="string"?["toString","valueOf"]:["valueOf","toString"],ae,J,Se;for(Se=0;Se<X.length;++Se)if(ae=M[X[Se]],_(ae)&&(J=ae.call(M),D(J)))return J;throw new E("No default value")}var U=x1();return sf=function(Y){if(D(Y))return Y;var X="default";arguments.length>1&&(arguments[1]===String?X="string":arguments[1]===Number&&(X="number"));var ae;if(y&&(Symbol.toPrimitive?ae=U(Y,Symbol.toPrimitive):k(Y)&&(ae=Symbol.prototype.valueOf)),typeof ae<"u"){var J=ae.call(Y,X);if(D(J))return J;throw new E("unable to convert exotic object to primitive")}return X==="default"&&(x(Y)||k(Y))&&(X="string"),u(Y,X==="default"?"number":X)},sf}var uf,Ig;function Dx(){if(Ig)return uf;Ig=1;var y=b1();return uf=function(x){return arguments.length>1?y(x,arguments[1]):y(x)},uf}var lf,Tg;function Rx(){if(Tg)return lf;Tg=1;var y=Er(),_=y("%BigInt%",!0),x=y("%Number%"),k=At(),E=Nn(),D=v1(),u=Dx();return lf=function(M){if(!_)throw new E("BigInts are not supported in this environment");var Y=u(M,x);if(Y==null)throw new k("Cannot convert null or undefined to a BigInt");if(typeof Y=="boolean")return _(Y?1:0);if(typeof Y=="number")throw new k("Cannot convert a Number value to a BigInt");if(typeof Y=="string"){var X=D(Y);if(typeof X>"u")throw new k("Failed to parse String to BigInt");return X}if(typeof Y=="symbol")throw new k("Cannot convert a Symbol value to a BigInt");if(typeof Y!="bigint")throw new E("Assertion failed: unknown primitive type");return Y},lf}var cf,Ag;function Lx(){if(Ag)return cf;Ag=1;var y=Er(),_=y("%BigInt%",!0),x=Yd(),k=At(),E=_&&_(0);return cf=function(u,U){if(typeof u!="bigint"||typeof U!="bigint")throw new k("Assertion failed: `n` and `d` arguments must be BigInts");if(U===E)throw new x("Division by zero");return u===E?E:u%U},cf}var pf,Eg;function Fx(){return Eg||(Eg=1,pf=function(_,x,k){var E=_(x,k);return E>=0?E:E+k}),pf}var hf,Pg;function w1(){if(Pg)return hf;Pg=1;var y=Er(),_=y("%BigInt%",!0),x=Xa(),k=Rx(),E=Lx(),D=Fx(),u=_&&BigInt(x(2,32))*BigInt(x(2,31)),U=_&&BigInt(x(2,32))*BigInt(x(2,32));return hf=function(Y){var X=k(Y),ae=D(E,X,U);return ae>=u?ae-U:ae},hf}var ff,Cg;function S1(){if(Cg)return ff;Cg=1;var y=Er(),_=y("%BigInt%",!0),x=Xa(),k=Rx(),E=Lx(),D=Fx(),u=_&&BigInt(x(2,32))*BigInt(x(2,32));return ff=function(M){var Y=k(M),X=D(E,Y,u);return X},ff}var df,kg;function I1(){if(kg)return df;kg=1;var y=Ha();return df=function(x,k){var E=x%k;return y(E>=0?E:E+k)},df}var mf,Mg;function T1(){return Mg||(Mg=1,mf=I1()),mf}var yf,Bg;function tu(){if(Bg)return yf;Bg=1;var y=T1();return yf=function(x,k){return y(x,k)},yf}var vf,zg;function A1(){return zg||(zg=1,vf=function(_){return _===null||typeof _!="function"&&typeof _!="object"}),vf}var gf,Dg;function Ox(){if(Dg)return gf;Dg=1;var y=At();return gf=function(x){if(x==null)throw new y(arguments.length>0&&arguments[1]||"Cannot call method on "+x);return x},gf}var _f,Rg;function E1(){if(Rg)return _f;Rg=1;var y=Er(),_=y("%String%"),x=At();return _f=function(E){if(typeof E=="symbol")throw new x("Cannot convert a Symbol value to a string");return _(E)},_f}var xf,Lg;function Vx(){if(Lg)return xf;Lg=1;var y=Ox(),_=E1(),x=pr(),k=ol(),E=x("String.prototype.replace"),D=x("String.prototype.charAt"),u=x("String.prototype.slice"),U=/^\s$/.test("᠎"),M=U?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,Y=k(U?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]$/);return xf=function(){for(var ae=E(_(y(this)),M,""),J=ae.length;J>0&&Y(D(ae,J-1));)J-=1;return u(ae,0,J)},xf}var bf,Fg;function qx(){if(Fg)return bf;Fg=1;var y=Vx(),_="​",x="᠎";return bf=function(){return String.prototype.trim&&_.trim()===_&&x.trim()===x&&("_"+x).trim()==="_"+x&&(x+"_").trim()===x+"_"?String.prototype.trim:y},bf}var wf,Og;function P1(){if(Og)return wf;Og=1;var y=rl()(),_=om(),x=qx();return wf=function(){var E=x();return String.prototype.trim!==E&&(y?_(String.prototype,"trim",E,!0):_(String.prototype,"trim",E)),E},wf}var Sf,Vg;function C1(){if(Vg)return Sf;Vg=1;var y=ha(),_=am(),x=Ox(),k=Vx(),E=qx(),D=P1(),u=y(E()),U=function(Y){return x(Y),u(Y)};return _(U,{getPolyfill:E,implementation:k,shim:D}),Sf=U,Sf}var If,qg;function k1(){if(qg)return If;qg=1;var y=Er(),_=y("%RegExp%"),x=At(),k=y("%parseInt%"),E=pr(),D=ol(),u=E("String.prototype.slice"),U=D(/^0b[01]+$/i),M=D(/^0o[0-7]+$/i),Y=D(/^[-+]0x[0-9a-f]+$/i),X=["…","​","￾"].join(""),ae=new _("["+X+"]","g"),J=D(ae),Se=C1();return If=function be(De){if(typeof De!="string")throw new x("Assertion failed: `argument` is not a String");if(U(De))return+k(u(De,2),2);if(M(De))return+k(u(De,2),8);if(J(De)||Y(De))return NaN;var Ze=Se(De);return Ze!==De?be(Ze):+De},If}var Tf,Ug;function da(){if(Ug)return Tf;Ug=1;var y=Er(),_=At(),x=y("%Number%"),k=A1(),E=Dx(),D=k1();return Tf=function(U){var M=k(U)?U:E(U,x);if(typeof M=="symbol")throw new _("Cannot convert a Symbol value to a number");if(typeof M=="bigint")throw new _("Conversion from 'BigInt' to 'number' is not allowed.");return typeof M=="string"?D(M):+M},Tf}var Af,Ng;function lm(){if(Ng)return Af;Ng=1;var y=Ha();return Af=function(x){return typeof x=="bigint"?x:y(x)},Af}var Ef,jg;function Ya(){if(jg)return Ef;jg=1;var y=lm(),_=At();return Ef=function(k){if(typeof k!="number"&&typeof k!="bigint")throw new _("argument must be a Number or a BigInt");var E=k<0?-y(-k):y(k);return E===0?0:E},Ef}var Pf,Gg;function M1(){if(Gg)return Pf;Gg=1;var y=tu(),_=da(),x=Ya(),k=mo(),E=65536;return Pf=function(u){var U=_(u);if(!k(U)||U===0)return 0;var M=x(U),Y=y(M,E);return Y>=32768?Y-E:Y},Pf}var Cf,$g;function B1(){if($g)return Cf;$g=1;var y=tu(),_=da(),x=Ya(),k=mo(),E=2147483648,D=4294967296;return Cf=function(U){var M=_(U);if(!k(M)||M===0)return 0;var Y=x(M),X=y(Y,D),ae=X>=E?X-D:X;return ae===0?0:ae},Cf}var kf,Zg;function z1(){if(Zg)return kf;Zg=1;var y=tu(),_=da(),x=Ya(),k=mo();return kf=function(D){var u=_(D);if(!k(u)||u===0)return 0;var U=x(u),M=y(U,256);return M>=128?M-256:M},kf}var Mf,Wg;function D1(){if(Wg)return Mf;Wg=1;var y=tu(),_=da(),x=Ya(),k=mo(),E=65536;return Mf=function(u){var U=_(u);if(!k(U)||U===0)return 0;var M=x(U),Y=y(M,E);return Y===0?0:Y},Mf}var Bf,Hg;function R1(){if(Hg)return Bf;Hg=1;var y=tu(),_=da(),x=Ya(),k=mo(),E=4294967296;return Bf=function(u){var U=_(u);if(!k(U)||U===0)return 0;var M=x(U),Y=y(M,E);return Y===0?0:Y},Bf}var zf,Xg;function L1(){if(Xg)return zf;Xg=1;var y=mo(),_=tu(),x=da(),k=Ya();return zf=function(D){var u=x(D);if(!y(u)||u===0)return 0;var U=k(u),M=_(U,256);return M},zf}var Df,Kg;function F1(){if(Kg)return Df;Kg=1;var y=At(),_=Qd(),x=em();return Df=function(E,D,u){if(typeof E!="number"||typeof D!="number"||typeof u!="number"||!(D<=u))throw new y("Assertion failed: all three arguments must be MVs, and `lower` must be `<= upper`");return x(_(D,E),u)},Df}var Rf,Jg;function O1(){if(Jg)return Rf;Jg=1;var y=F1(),_=da(),x=lm(),k=Ka();return Rf=function(D){var u=_(D);if(k(u))return 0;var U=y(u,0,255),M=x(U);return U<M+.5?M:U>M+.5?M+1:M%2===0?M:M+1},Rf}var Lf,Yg;function Ux(){return Yg||(Yg=1,Lf=function(_){return _===0&&1/_===-1/0}),Lf}var Ff,Qg;function V1(){if(Qg)return Ff;Qg=1;var y=Ic(),_=Ha(),x=Xa(),k=mo(),E=Ka(),D=Ux(),u=34028234663852886e22;return Ff=function(M,Y){if(E(M))return Y?[0,0,192,127]:[127,192,0,0];var X;if(M===0)return X=D(M)?128:0,Y?[0,0,0,X]:[X,0,0,0];if(y(M)>u||!k(M))return X=M<0?255:127,Y?[0,0,128,X]:[X,128,0,0];var ae=M<0?1:0;M=y(M);for(var J=0;M>=2;)J+=1,M/=2;for(;M<1;)J-=1,M*=2;var Se=M-1;Se*=x(2,23)+.5,Se=_(Se),J+=127,J<<=23;var be=ae<<31|J|Se,De=be&255;be>>=8;var Ze=be&255;be>>=8;var He=be&255;be>>=8;var Ue=be&255;return Y?[De,Ze,He,Ue]:[Ue,He,Ze,De]},Ff}var Of,e_;function q1(){if(e_)return Of;e_=1;var y=1075,_=54;return Of=function(k){var E="";if(k===0)return E;for(var D=y,u,U=0;U<y;U+=1)if(u=k*2,u>=1?(k=u-1,E+="1",D===y&&(D=U)):(k=u,E+="0"),u===1||U-D>_)return E;return E},Of}var Vf,t_;function U1(){if(t_)return Vf;t_=1;var y=Ha();return Vf=function(x){for(var k="",E;x>0;)E=x/2,x=y(E),E===x?k="0"+k:k="1"+k;return k},Vf}var qf,r_;function N1(){return r_||(r_=1,qf=Number.isNaN||function(_){return _!==_}),qf}var Uf,i_;function j1(){if(i_)return Uf;i_=1;var y=Er(),_=y("%parseInt%"),x=Ic(),k=Ha(),E=mo(),D=Ux(),u=pr(),U=u("String.prototype.indexOf"),M=u("String.prototype.slice"),Y=q1(),X=U1(),ae=N1(),J=1023,Se="11111111111",be="00000000000",De=be+be+be+be+"0000000";return Uf=function(He,Ue){var fe=He<0||D(He)?"1":"0",Ke,Ne;if(ae(He))Ke=Se,Ne="1"+De;else if(!E(He))Ke=Se,Ne="0"+De;else if(He===0)Ke=be,Ne="0"+De;else{He=x(He);var It=k(He),we=X(It),je=Y(He-It),Le;if(we)Ke=we.length-1;else{var tt=U(je,"1");tt>-1&&(Le=tt+1),Ke=-Le}Ne=we+je,Ke<0?(Ke<=-J&&(Le=J-1),Ne=M(Ne,Le)):Ne=M(Ne,1),Ke=M(be+X(Ke+J),-11),Ne=M(Ne+De+"0",0,52)}for(var Mt=fe+Ke+Ne,Wt=[],St=0;St<8;St++){var Ut=Ue?8-St-1:St;Wt[Ut]=_(M(Mt,St*8,(St+1)*8),2)}return Wt},Uf}var Nf,n_;function G1(){if(n_)return Nf;n_=1;var y=Er(),_=y("%Number%"),x=y("%BigInt%",!0);return Nf=function(E,D,u){var U=typeof E=="bigint"?x:_;E<0&&(E>>>=0);for(var M=[],Y=0;Y<D;Y++)M[u?Y:D-1-Y]=_(E&U(255)),E>>=U(8);return M},Nf}var jf,o_;function $1(){if(o_)return jf;o_=1;var y=At(),_=Ix(),x=w1(),k=S1(),E=M1(),D=B1(),u=z1(),U=D1(),M=R1(),Y=L1(),X=O1(),ae=V1(),J=j1(),Se=G1(),be=Qs(),De={__proto__:null,$INT8:u,$UINT8:Y,$UINT8C:X,$INT16:E,$UINT16:U,$INT32:D,$UINT32:M,$BIGINT64:x,$BIGUINT64:k};return jf=function(He,Ue,fe){if(typeof He!="string"||!_(be.size,"$"+He))throw new y("Assertion failed: `type` must be a TypedArray element type");if(typeof Ue!="number"&&typeof Ue!="bigint")throw new y("Assertion failed: `value` must be a Number or a BigInt");if(typeof fe!="boolean")throw new y("Assertion failed: `isLittleEndian` must be a Boolean");if(He==="FLOAT32")return ae(Ue,fe);if(He==="FLOAT64")return J(Ue,fe);var Ke=be.size["$"+He],Ne=De["$"+He],It=Ne(Ue);return Se(It,Ke,fe)},jf}var Gf,a_;function Z1(){return a_||(a_=1,Gf=function(_,x){for(var k=0;k<_.length;k+=1)x(_[k],k,_)}),Gf}var $f,s_;function W1(){if(s_)return $f;s_=1;var y=Er(),_=Nn(),x=At(),k=Ac(),E=y("%Uint8Array%",!0),D=Ax(),u=Ys(),U=$1(),M=Js(),Y=il(),X=jo(),ae=Qs(),J=Px(),Se=Z1();return $f=function(De,Ze,He,Ue,fe,Ke){var Ne=Y(De);if(!M(De)&&!Ne)throw new x("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!k(Ze)||Ze<0)throw new x("Assertion failed: `byteIndex` must be a non-negative integer");if(typeof He!="string"||!X(ae.size,"$"+He))throw new x("Assertion failed: `type` must be one of "+ae.choices);if(typeof Ue!="number"&&typeof Ue!="bigint")throw new x("Assertion failed: `value` must be a Number or a BigInt");if(typeof fe!="boolean")throw new x("Assertion failed: `isTypedArray` must be a boolean");if(Ke!=="SEQ-CST"&&Ke!=="UNORDERED"&&Ke!=="INIT")throw new x('Assertion failed: `order` must be `"SEQ-CST"`, `"UNORDERED"`, or `"INIT"`');if(arguments.length>6&&typeof arguments[6]!="boolean")throw new x("Assertion failed: `isLittleEndian` must be a boolean, if present");if(u(De))throw new x("Assertion failed: ArrayBuffer is detached");if(D(He)?typeof Ue!="bigint":typeof Ue!="number")throw new x("Assertion failed: `value` must be a BigInt if type is ~BIGINT64~ or ~BIGUINT64~, otherwise a Number");var It=ae.size["$"+He],we=arguments.length>6?arguments[6]:J==="little",je=U(He,Ue,we);if(Ne)throw new _("SharedArrayBuffer is not supported by this implementation");var Le=new E(De,Ze,It);Se(je,function(tt,Mt){Le[Mt]=tt})},$f}var Zf,u_;function H1(){if(u_)return Zf;u_=1;var y=da(),_=Ya(),x=Ka(),k=mo();return Zf=function(D){var u=y(D);return x(u)||u===0?0:k(u)?_(u):u},Zf}var Wf,l_;function X1(){if(l_)return Wf;l_=1;var y=Er(),_=y("%String%"),x=At();return Wf=function(E){if(typeof E=="symbol")throw new x("Cannot convert a Symbol value to a string");return _(E)},Wf}var Hf,c_;function cm(){if(c_)return Hf;c_=1;var y=Nn(),_=At(),x=Ac(),k=Ks(),E=Qs();return Hf=function(u){var U=k(u);if(!U)throw new _("Assertion failed: `O` must be a TypedArray");var M=E.size["$"+E.name["$"+U]];if(!x(M)||M<0)throw new y("Assertion failed: Unknown TypedArray type `"+U+"`");return M},Hf}var Xf,p_;function K1(){if(p_)return Xf;p_=1;var y=Nn(),_=At(),x=Ks(),k=Qs();return Xf=function(D){var u=x(D);if(!u)throw new _("Assertion failed: `O` must be a TypedArray");var U=k.name["$"+u];if(typeof U!="string")throw new y("Assertion failed: Unknown TypedArray type `"+u+"`");return U},Xf}var vc={exports:{}},Kf,h_;function J1(){return h_||(h_=1,Kf=Er()),Kf}var Jf,f_;function pm(){if(f_)return Jf;f_=1;var y=At(),_=jo(),x={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};return Jf=function(E){if(!E||typeof E!="object")return!1;for(var D in E)if(_(E,D)&&!x[D])return!1;var u=_(E,"[[Value]]")||_(E,"[[Writable]]"),U=_(E,"[[Get]]")||_(E,"[[Set]]");if(u&&U)throw new y("Property Descriptors may not be both accessor and data descriptors");return!0},Jf}var Yf,d_;function Y1(){if(d_)return Yf;d_=1;var y=rl(),_=Xs(),x=y.hasArrayLengthDefineBug(),k=x&&Tx(),E=pr(),D=E("Object.prototype.propertyIsEnumerable");return Yf=function(U,M,Y,X,ae,J){if(!_){if(!U(J)||!J["[[Configurable]]"]||!J["[[Writable]]"]||ae in X&&D(X,ae)!==!!J["[[Enumerable]]"])return!1;var Se=J["[[Value]]"];return X[ae]=Se,M(X[ae],Se)}return x&&ae==="length"&&"[[Value]]"in J&&k(X)&&X.length!==J["[[Value]]"]?(X.length=J["[[Value]]"],X.length===J["[[Value]]"]):(_(X,ae,Y(J)),!0)},Yf}var Qf,m_;function Q1(){return m_||(m_=1,Qf=function(_){if(typeof _>"u")return _;var x={};return"[[Value]]"in _&&(x.value=_["[[Value]]"]),"[[Writable]]"in _&&(x.writable=!!_["[[Writable]]"]),"[[Get]]"in _&&(x.get=_["[[Get]]"]),"[[Set]]"in _&&(x.set=_["[[Set]]"]),"[[Enumerable]]"in _&&(x.enumerable=!!_["[[Enumerable]]"]),"[[Configurable]]"in _&&(x.configurable=!!_["[[Configurable]]"]),x}),Qf}var ed,y_;function ew(){if(y_)return ed;y_=1;var y=At(),_=pm(),x=Q1();return ed=function(E){if(typeof E<"u"&&!_(E))throw new y("Assertion failed: `Desc` must be a Property Descriptor");return x(E)},ed}var td,v_;function tw(){if(v_)return td;v_=1;var y=At(),_=jo(),x=pm();return td=function(E){if(typeof E>"u")return!1;if(!x(E))throw new y("Assertion failed: `Desc` must be a Property Descriptor");return!(!_(E,"[[Value]]")&&!_(E,"[[Writable]]"))},td}var rd,g_;function Nx(){return g_||(g_=1,rd=Qu()),rd}var id,__;function rw(){return __||(__=1,id=function(_){return!!_}),id}var nd,x_;function iw(){if(x_)return nd;x_=1;var y=jo(),_=At(),x=fa(),k=Nx(),E=rw();return nd=function(u){if(!x(u))throw new _("ToPropertyDescriptor requires an object");var U={};if(y(u,"enumerable")&&(U["[[Enumerable]]"]=E(u.enumerable)),y(u,"configurable")&&(U["[[Configurable]]"]=E(u.configurable)),y(u,"value")&&(U["[[Value]]"]=u.value),y(u,"writable")&&(U["[[Writable]]"]=E(u.writable)),y(u,"get")){var M=u.get;if(typeof M<"u"&&!k(M))throw new _("getter must be a function");U["[[Get]]"]=M}if(y(u,"set")){var Y=u.set;if(typeof Y<"u"&&!k(Y))throw new _("setter must be a function");U["[[Set]]"]=Y}if((y(U,"[[Get]]")||y(U,"[[Set]]"))&&(y(U,"[[Value]]")||y(U,"[[Writable]]")))throw new _("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return U},nd}var od,b_;function nw(){if(b_)return od;b_=1;var y=At(),_=fa(),x=pm(),k=Y1(),E=ew(),D=tw(),u=Tc(),U=Cx(),M=iw();return od=function(X,ae,J){if(!_(X))throw new y("Assertion failed: Type(O) is not Object");if(!u(ae))throw new y("Assertion failed: P is not a Property Key");var Se=x(J)?J:M(J);if(!x(Se))throw new y("Assertion failed: Desc is not a valid Property Descriptor");return k(D,U,E,X,ae,Se)},od}var w_;function jx(){if(w_)return vc.exports;w_=1;var y=J1(),_=y("%Reflect.construct%",!0),x=nw();try{x({},"",{"[[Get]]":function(){}})}catch{x=null}if(x&&_){var k={},E={};x(E,"length",{"[[Get]]":function(){throw k},"[[Enumerable]]":!0}),vc.exports=function(u){try{_(u,E)}catch(U){return U===k}}}else vc.exports=function(u){return typeof u=="function"&&!!u.prototype};return vc.exports}var ad,S_;function ow(){if(S_)return ad;S_=1;var y=Er(),_=y("%Symbol.species%",!0),x=At(),k=fa(),E=jx();return ad=function(u,U){if(!k(u))throw new x("Assertion failed: Type(O) is not Object");var M=u.constructor;if(typeof M>"u")return U;if(!k(M))throw new x("O.constructor is not an Object");var Y=_?M[_]:void 0;if(Y==null)return U;if(E(Y))return Y;throw new x("no constructor found")},ad}var sd,I_;function Gx(){if(I_)return sd;I_=1;var y=At(),_=pr(),x=_("%ArrayBuffer.prototype.resizable%",!0),k=_("%SharedArrayBuffer.prototype.growable%",!0),E=Js(),D=il();return sd=function(U){var M=E(U),Y=D(U);if(!M&&!Y)throw new y("Assertion failed: `arrayBuffer` must be an ArrayBuffer or SharedArrayBuffer");return M&&x?!x(U):Y&&k?!k(U):!0},sd}var ud,T_;function aw(){return T_||(T_=1,ud=Ac()),ud}var ld,A_;function $x(){if(A_)return ld;A_=1;var y=jo(),_=eu(),x=aw();return ld=function(E){return!!E&&typeof E=="object"&&y(E,"[[Object]]")&&y(E,"[[CachedBufferByteLength]]")&&(x(E["[[CachedBufferByteLength]]"])&&E["[[CachedBufferByteLength]]"]>=0||E["[[CachedBufferByteLength]]"]==="DETACHED")&&_(E["[[Object]]"])},ld}var cd,E_;function sw(){return E_||(E_=1,cd=fa()),cd}var pd,P_;function uw(){if(P_)return pd;P_=1;var y=pr(),_=y("String.prototype.valueOf"),x=function(U){try{return _(U),!0}catch{return!1}},k=y("Object.prototype.toString"),E="[object String]",D=Go()();return pd=function(U){return typeof U=="string"?!0:!U||typeof U!="object"?!1:D?x(U):k(U)===E},pd}var hd,C_;function lw(){if(C_)return hd;C_=1;var y=pr(),_=y("Number.prototype.toString"),x=function(U){try{return _(U),!0}catch{return!1}},k=y("Object.prototype.toString"),E="[object Number]",D=Go()();return hd=function(U){return typeof U=="number"?!0:!U||typeof U!="object"?!1:D?x(U):k(U)===E},hd}var fd,k_;function cw(){if(k_)return fd;k_=1;var y=pr(),_=y("Boolean.prototype.toString"),x=y("Object.prototype.toString"),k=function(U){try{return _(U),!0}catch{return!1}},E="[object Boolean]",D=Go()();return fd=function(U){return typeof U=="boolean"?!0:U===null||typeof U!="object"?!1:D?k(U):x(U)===E},fd}var gc={exports:{}},dd,M_;function pw(){if(M_)return dd;M_=1;var y=typeof BigInt<"u"&&BigInt;return dd=function(){return typeof y=="function"&&typeof BigInt=="function"&&typeof y(42)=="bigint"&&typeof BigInt(42)=="bigint"},dd}var B_;function hw(){if(B_)return gc.exports;B_=1;var y=pw()();if(y){var _=BigInt.prototype.valueOf,x=function(E){try{return _.call(E),!0}catch{}return!1};gc.exports=function(E){return E===null||typeof E>"u"||typeof E=="boolean"||typeof E=="string"||typeof E=="number"||typeof E=="symbol"||typeof E=="function"?!1:typeof E=="bigint"?!0:x(E)}}else gc.exports=function(E){return!1};return gc.exports}var md,z_;function fw(){if(z_)return md;z_=1;var y=uw(),_=lw(),x=cw(),k=Bx(),E=hw();return md=function(u){if(u==null||typeof u!="object"&&typeof u!="function")return null;if(y(u))return"String";if(_(u))return"Number";if(x(u))return"Boolean";if(k(u))return"Symbol";if(E(u))return"BigInt"},md}var yd,D_;function dw(){if(D_)return yd;D_=1;var y=typeof Map=="function"&&Map.prototype?Map:null,_=typeof Set=="function"&&Set.prototype?Set:null,x;y||(x=function(u){return!1});var k=y?Map.prototype.has:null,E=_?Set.prototype.has:null;return!x&&!k&&(x=function(u){return!1}),yd=x||function(u){if(!u||typeof u!="object")return!1;try{if(k.call(u),E)try{E.call(u)}catch{return!0}return u instanceof y}catch{}return!1},yd}var vd,R_;function mw(){if(R_)return vd;R_=1;var y=typeof Map=="function"&&Map.prototype?Map:null,_=typeof Set=="function"&&Set.prototype?Set:null,x;_||(x=function(u){return!1});var k=y?Map.prototype.has:null,E=_?Set.prototype.has:null;return!x&&!E&&(x=function(u){return!1}),vd=x||function(u){if(!u||typeof u!="object")return!1;try{if(E.call(u),k)try{k.call(u)}catch{return!0}return u instanceof _}catch{}return!1},vd}var gd,L_;function yw(){if(L_)return gd;L_=1;var y=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,_=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,x;y||(x=function(u){return!1});var k=y?y.prototype.has:null,E=_?_.prototype.has:null;return!x&&!k&&(x=function(u){return!1}),gd=x||function(u){if(!u||typeof u!="object")return!1;try{if(k.call(u,k),E)try{E.call(u,E)}catch{return!0}return u instanceof y}catch{}return!1},gd}var _c={exports:{}},F_;function vw(){if(F_)return _c.exports;F_=1;var y=Er(),_=pr(),x=y("%WeakSet%",!0),k=_("WeakSet.prototype.has",!0);if(k){var E=_("WeakMap.prototype.has",!0);_c.exports=function(u){if(!u||typeof u!="object")return!1;try{if(k(u,k),E)try{E(u,E)}catch{return!0}return u instanceof x}catch{}return!1}}else _c.exports=function(u){return!1};return _c.exports}var _d,O_;function gw(){if(O_)return _d;O_=1;var y=dw(),_=mw(),x=yw(),k=vw();return _d=function(D){if(D&&typeof D=="object"){if(y(D))return"Map";if(_(D))return"Set";if(x(D))return"WeakMap";if(k(D))return"WeakSet"}return!1},_d}var xd,V_;function _w(){if(V_)return xd;V_=1;var y=pr(),_=y("WeakRef.prototype.deref",!0);return xd=typeof WeakRef>"u"?function(k){return!1}:function(k){if(!k||typeof k!="object")return!1;try{return _(k),!0}catch{return!1}},xd}var bd,q_;function xw(){if(q_)return bd;q_=1;var y=pr(),_=y("FinalizationRegistry.prototype.register",!0);return bd=_?function(k){if(!k||typeof k!="object")return!1;try{return _(k,{},null),!0}catch{return!1}}:function(k){return!1},bd}var Ws={exports:{}},wd,U_;function Zx(){if(U_)return wd;U_=1;var y=function(){return typeof(function(){}).name=="string"},_=Object.getOwnPropertyDescriptor;if(_)try{_([],"length")}catch{_=null}y.functionsHaveConfigurableNames=function(){if(!y()||!_)return!1;var E=_(function(){},"name");return!!E&&!!E.configurable};var x=Function.prototype.bind;return y.boundFunctionsHaveNames=function(){return y()&&typeof x=="function"&&(function(){}).bind().name!==""},wd=y,wd}var Sd,N_;function bw(){if(N_)return Sd;N_=1;var y=pr(),_=y("Object.prototype.toString"),x=!(0 in[,]),k="[object Object]",E="[object HTMLAllCollection]",D=function(){return!1};if(typeof document=="object"){var u=document.all;_(u)===_(document.all)&&(D=(function(M){if((x||!M)&&(typeof M>"u"||typeof M=="object"))try{var Y=_(M);return(Y===E||Y===k)&&M("")==null}catch{}return!1}))}return Sd=D,Sd}var Id,j_;function Wx(){if(j_)return Id;j_=1;var y=Qu(),_=jo(),x=Zx()(),k=At(),E=pr(),D=bw(),u=E("Function.prototype.toString"),U=E("String.prototype.match"),M=/^class /,Y=function(Se){if(y(Se)||typeof Se!="function")return!1;try{var be=U(u(Se),M);return!!be}catch{}return!1},X=/\s*function\s+([^(\s]*)\s*/,ae=Function.prototype;return Id=function(){if(D(this)||!Y(this)&&!y(this))throw new k("Function.prototype.name sham getter called on non-function");if(x&&_(this,"name"))return this.name;if(this===ae)return"";var Se=u(this),be=U(Se,X),De=be&&be[1];return De},Id}var Td,G_;function Hx(){if(G_)return Td;G_=1;var y=Wx();return Td=function(){return y},Td}var Ad,$_;function ww(){if($_)return Ad;$_=1;var y=rl()(),_=Zx()(),x=At(),k=Hx(),E=Xs();return Ad=function(){var u=k();if(_)return u;if(!y||!E)throw new x("Shimming Function.prototype.name support requires ES5 property descriptor support.");var U=Function.prototype;return E(U,"name",{configurable:!0,enumerable:!1,get:function(){var M=u.call(this);return this!==U&&E(this,"name",{configurable:!0,enumerable:!1,value:M,writable:!1}),M}}),u},Ad}var Z_;function Sw(){if(Z_)return Ws.exports;Z_=1;var y=ha(),_=Wx(),x=Hx(),k=ww(),E=y(_);return Ws.exports=E,Ws.exports.getPolyfill=x,Ws.exports.implementation=_,Ws.exports.shim=k,Ws.exports}var Ed,W_;function Iw(){if(W_)return Ed;W_=1;var y=pr(),_=ol(),x=_(/^\s*(?:function)?\*/),k=Go()(),E=Ja(),D=y("Object.prototype.toString"),u=y("Function.prototype.toString"),U=bx();return Ed=function(Y){if(typeof Y!="function")return!1;if(x(u(Y)))return!0;if(!k){var X=D(Y);return X==="[object GeneratorFunction]"}if(!E)return!1;var ae=U();return ae&&E(Y)===ae.prototype},Ed}var Pd,H_;function Tw(){if(H_)return Pd;H_=1;var y=pr(),_=ol(),x=y("Object.prototype.toString"),k=y("Function.prototype.toString"),E=_(/^\s*async(?:\s+function(?:\s+|\()|\s*\()/),D=Go()(),u=Ja(),U=xx();return Pd=function(Y){if(typeof Y!="function")return!1;if(E(k(Y)))return!0;if(!D){var X=x(Y);return X==="[object AsyncFunction]"}if(!u)return!1;var ae=U();return ae&&ae.prototype===u(Y)},Pd}var Cd,X_;function Aw(){if(X_)return Cd;X_=1;var y=fw(),_=gw(),x=Ks(),k=Ex(),E=kx(),D=Mx(),u=_w(),U=xw(),M=Sw(),Y=Iw(),X=Tw(),ae=pr(),J=Go()(),Se=J&&Symbol.toStringTag,be=Object,De=ae("Promise.prototype.then",!0),Ze=function(fe){if(!fe||typeof fe!="object"||!De)return!1;try{return De(fe,null,function(){}),!0}catch{}return!1},He=function(fe){return!!fe&&fe!=="BigInt"&&fe!=="Boolean"&&fe!=="Null"&&fe!=="Number"&&fe!=="String"&&fe!=="Symbol"&&fe!=="Undefined"&&fe!=="Math"&&fe!=="JSON"&&fe!=="Reflect"&&fe!=="Atomics"&&fe!=="Map"&&fe!=="Set"&&fe!=="WeakMap"&&fe!=="WeakSet"&&fe!=="BigInt64Array"&&fe!=="BigUint64Array"&&fe!=="Float32Array"&&fe!=="Float64Array"&&fe!=="Int16Array"&&fe!=="Int32Array"&&fe!=="Int8Array"&&fe!=="Uint16Array"&&fe!=="Uint32Array"&&fe!=="Uint8Array"&&fe!=="Uint8ClampedArray"&&fe!=="Array"&&fe!=="Date"&&fe!=="FinalizationRegistry"&&fe!=="Promise"&&fe!=="RegExp"&&fe!=="WeakRef"&&fe!=="Function"&&fe!=="GeneratorFunction"&&fe!=="AsyncFunction"};return Cd=function(fe){if(fe==null)return fe;var Ke=y(be(fe))||_(fe)||x(fe);if(Ke)return Ke;if(k(fe))return"Array";if(E(fe))return"Date";if(D(fe))return"RegExp";if(u(fe))return"WeakRef";if(U(fe))return"FinalizationRegistry";if(typeof fe=="function")return Y(fe)?"GeneratorFunction":X(fe)?"AsyncFunction":"Function";if(Ze(fe))return"Promise";if(Se&&Se in fe){var Ne=fe[Se];if(He(Ne))return Ne}if(typeof fe.constructor=="function"){var It=M(fe.constructor);if(He(It))return It}return"Object"},Cd}var kd,K_;function Ew(){if(K_)return kd;K_=1;var y=Er(),_=Nx(),x=sw(),k=Aw(),E=At(),D=Ja(),u=Jd();return kd=function(M){if(!x(M))throw new E("Reflect.getPrototypeOf called on non-object");if(D)return D(M);var Y=k(M);if(Y){var X=y("%"+Y+".prototype%",!0);if(X)return X}return _(M.constructor)?M.constructor.prototype:M instanceof Object?u.prototype:null},kd}var Md,J_;function Xx(){if(J_)return Md;J_=1;var y=Ew(),_=Ja();return Md=function(){return typeof Reflect=="object"&&Reflect&&Reflect.getPrototypeOf?Reflect.getPrototypeOf:_?function(E){return _(E)}:y},Md}var Bd,Y_;function hm(){if(Y_)return Bd;Y_=1;var y=Kd(),_=ha(),x=Xx()(),k=el()(),E={__proto__:null},D=No(),u=Object.defineProperty;if(D){var U=function(X){return X.byteOffset};y(k,function(X){if(typeof wt.commonjsGlobal[X]=="function"||typeof wt.commonjsGlobal[X]=="object"){var ae=wt.commonjsGlobal[X].prototype,J=D(ae,"byteOffset");if(!J){var Se=x(ae);J=D(Se,"byteOffset")}if(J&&J.get)E[X]=_(J.get);else if(u){var be=new wt.commonjsGlobal[X](2);J=D(be,"byteOffset"),J&&J.configurable&&u(be,"length",{value:3}),be.length===2&&(E[X]=U)}}})}var M=function(ae){var J;return y(E,function(Se){if(typeof J!="number")try{var be=Se(ae);typeof be=="number"&&(J=be)}catch{}}),J},Y=eu();return Bd=function(ae){return Y(ae)?M(ae):!1},Bd}var zd,Q_;function Kx(){if(Q_)return zd;Q_=1;var y=ha(),_=Kd(),x=No(),k=eu(),E=mx(),D=Xx()(),u={__proto__:null},U=Object.defineProperty;if(x){var M=function(X){return X.length};_(E,function(X){var ae=wt.commonjsGlobal[X];if(typeof ae=="function"||typeof ae=="object"){var J=ae.prototype,Se=x(J,"length");if(!Se){var be=D(J);Se=x(be,"length")}if(Se&&Se.get)u["$"+X]=y(Se.get);else if(U){var De=new wt.commonjsGlobal[X](2);Se=x(De,"length"),Se&&Se.configurable&&U(De,"length",{value:3}),De.length===2&&(u["$"+X]=M)}}})}var Y=function(ae){var J;return _(u,function(Se){if(typeof J!="number")try{var be=Se(ae);typeof be=="number"&&(J=be)}catch{}}),J};return zd=function(ae){return k(ae)?Y(ae):!1},zd}var Dd,ex;function fm(){if(ex)return Dd;ex=1;var y=At(),_=Ys(),x=Gx(),k=cm(),E=$x(),D=nl(),u=hm(),U=Kx();return Dd=function(Y){if(!E(Y))throw new y("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");var X=Y["[[Object]]"],ae=Y["[[CachedBufferByteLength]]"];if(_(D(X))&&ae!=="DETACHED")throw new y("Assertion failed: typed array is detached only if the byte length is ~DETACHED~");if(ae==="DETACHED")return!0;var J=u(X),Se=x(D(X)),be,De=Se?U(X):"AUTO";if(De==="AUTO")be=ae;else{var Ze=k(X);be=J+De*Ze}return J>ae||be>ae},Dd}var Rd,tx;function Pw(){if(tx)return Rd;tx=1;var y=At(),_=lm(),x=Gx(),k=fm(),E=cm(),D=$x(),u=nl(),U=hm(),M=Kx();return Rd=function(X){if(!D(X))throw new y("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");if(k(X))throw new y("Assertion failed: `taRecord` is out of bounds");var ae=X["[[Object]]"],J=x(u(ae)),Se=J?M(ae):"AUTO";if(Se!=="AUTO")return Se;if(J)throw new y("Assertion failed: array buffer is not fixed length");var be=U(ae),De=E(ae),Ze=X["[[CachedBufferByteLength]]"];if(Ze==="DETACHED")throw new y("Assertion failed: typed array is detached");return _((Ze-be)/De)},Rd}var Ld,rx;function Cw(){if(rx)return Ld;rx=1;var y=At(),_=Ys(),x=Js(),k=il(),E=Sx(),D=pr(),u=D("SharedArrayBuffer.prototype.byteLength",!0);return Ld=function(M,Y){var X=k(M);if(!x(M)&&!X)throw new y("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(Y!=="SEQ-CST"&&Y!=="UNORDERED")throw new y("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if(_(M))throw new y("Assertion failed: `arrayBuffer` must not be detached");return X?u(M):E(M)},Ld}var Fd,ix;function kw(){if(ix)return Fd;ix=1;var y=At(),_=Cw(),x=Ys(),k=eu(),E=nl();return Fd=function(u,U){if(!k(u))throw new y("Assertion failed: `obj` must be a Typed Array");if(U!=="SEQ-CST"&&U!=="UNORDERED")throw new y("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");var M=E(u),Y=x(M)?"DETACHED":_(M,U);return{"[[Object]]":u,"[[CachedBufferByteLength]]":Y}},Fd}var Od,nx;function Jx(){if(nx)return Od;nx=1;var y=At(),_=fa(),x=fm(),k=kw(),E=eu();return Od=function(u,U){if(U!=="SEQ-CST"&&U!=="UNORDERED")throw new y("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if(!_(u))throw new y("Assertion failed: `O` must be an Object");if(!E(u))throw new y("Assertion failed: `O` must be a Typed Array");var M=k(u,U);if(x(M))throw new y("`O` must be in-bounds and backed by a non-detached buffer");return M},Od}var Vd,ox;function Mw(){if(ox)return Vd;ox=1;var y=Nn(),_=At(),x=um(),k=jx(),E=fm(),D=Pw(),u=Jx(),U=el()();return Vd=function(Y,X){if(!k(Y))throw new _("Assertion failed: `constructor` must be a constructor");if(!x(X))throw new _("Assertion failed: `argumentList` must be a List");if(U.length===0)throw new y("Assertion failed: Typed Arrays are not supported in this environment");var ae;X.length===0?ae=new Y:X.length===1?ae=new Y(X[0]):X.length===2?ae=new Y(X[0],X[1]):ae=new Y(X[0],X[1],X[2]);var J=u(ae,"SEQ-CST");if(X.length===1&&typeof X[0]=="number"){if(E(J))throw new _("new Typed Array is out of bounds");var Se=D(J);if(Se<X[0])throw new _("`argumentList[0]` must be <= `newTypedArray.length`")}return ae},Vd}var qd,ax;function Bw(){if(ax)return qd;ax=1;var y=Er(),_={__proto__:null,$Int8Array:y("%Int8Array%",!0),$Uint8Array:y("%Uint8Array%",!0),$Uint8ClampedArray:y("%Uint8ClampedArray%",!0),$Int16Array:y("%Int16Array%",!0),$Uint16Array:y("%Uint16Array%",!0),$Int32Array:y("%Int32Array%",!0),$Uint32Array:y("%Uint32Array%",!0),$BigInt64Array:y("%BigInt64Array%",!0),$BigUint64Array:y("%BigUint64Array%",!0),$Float16Array:y("%Float16Array%",!0),$Float32Array:y("%Float32Array%",!0),$Float64Array:y("%Float64Array%",!0)};return qd=function(k){return _["$"+k]},qd}var Ud,sx;function zw(){if(sx)return Ud;sx=1;var y=Nn(),_=At(),x=Ks(),k=el()(),E=um(),D=ow(),u=Mw(),U=Bw();return Ud=function(Y,X){if(k.length===0)throw new y("Assertion failed: Typed Arrays are not supported in this environment");var ae=x(Y);if(!ae)throw new _("Assertion failed: exemplar must be a TypedArray");if(!E(X))throw new _("Assertion failed: `argumentList` must be a List");var J=U(ae);if(typeof J!="function")throw new y("Assertion failed: `constructor` of `exemplar` ("+ae+") must exist. Please report this!");var Se=D(Y,J);return u(Se,X)},Ud}var Nd,ux;function Yx(){if(ux)return Nd;ux=1;var y=At(),_=a1(),x=m1(),k=Ys(),E=Qd(),D=em(),u=y1(),U=W1(),M=H1(),Y=X1(),X=cm(),ae=K1(),J=zw(),Se=Jx(),be=nl(),De=hm();return Nd=function(He,Ue){var fe=this;Se(fe,"SEQ-CST");var Ke=fe.length,Ne=M(He),It;Ne===-1/0?It=0:Ne<0?It=E(Ke+Ne,0):It=D(Ne,Ke);var we=typeof Ue>"u"?Ke:M(Ue),je;we===-1/0?je=0:we<0?je=E(Ke+we,0):je=D(we,Ke);var Le=E(je-It,0),tt=J(fe,[Le]);if(Le>0){if(k(be(fe)))throw new y("Cannot use a Typed Array with an underlying ArrayBuffer that is detached");var Mt=ae(fe),Wt=ae(tt);if(Mt===Wt)for(var St=be(fe),Ut=be(tt),Hr=X(fe),Pr=De(fe),bi=It*Hr+Pr,or=De(tt),Rr=or+Le*Hr;or<Rr;){var et=x(St,bi,"UINT8",!0,"UNORDERED");U(Ut,or,"UINT8",et,!0,"UNORDERED"),bi+=1,or+=1}else for(var Lr=0;It<je;){var Xr=Y(It),Et=_(fe,Xr);u(tt,Y(Lr),Et,!0),It+=1,Lr+=1}}return tt},Nd}var jd,lx;function Qx(){if(lx)return jd;lx=1;var y=Yx();return jd=function(){return typeof Uint8Array=="function"&&Uint8Array.prototype.slice||y},jd}var Gd,cx;function Dw(){if(cx)return Gd;cx=1;var y=am(),_=Ja(),x=Qx();return Gd=function(){if(typeof Uint8Array=="function"){var E=x(),D=_(Uint8Array.prototype);y(D,{slice:E},{slice:function(){return D.slice!==E}})}return E},Gd}var $d,px;function Rw(){if(px)return $d;px=1;var y=am(),_=ha(),x=Yx(),k=Qx(),E=Dw(),D=_(k());return y(D,{getPolyfill:k,implementation:x,shim:E}),$d=D,$d}var Zd,hx;function Lw(){if(hx)return Zd;hx=1;var y=Ks(),_=Rw(),x=No();function k(we){return Object.prototype.toString.call(we)}function E(we){return k(we)==="[object Date]"}function D(we){return k(we)==="[object RegExp]"}function u(we){return k(we)==="[object Error]"}function U(we){return k(we)==="[object Boolean]"}function M(we){return k(we)==="[object Number]"}function Y(we){return k(we)==="[object String]"}var X=Array.isArray||function(je){return Object.prototype.toString.call(je)==="[object Array]"};function ae(we,je){if(we.forEach)return we.forEach(je);for(var Le=0;Le<we.length;Le++)je(we[Le],Le,we)}var J=Object.keys||function(je){var Le=[];for(var tt in je)Le[Le.length]=tt;return Le},Se=Object.prototype.propertyIsEnumerable,be=Object.getOwnPropertySymbols;function De(we){var je=J(we);if(be)for(var Le=be(we),tt=0;tt<Le.length;tt++)Se.call(we,Le[tt])&&(je[je.length]=Le[tt]);return je}var Ze=Object.prototype.hasOwnProperty||function(we,je){return je in we};function He(we,je){if(typeof x!="function")return!0;var Le=x(we,je);return!Le||!Le.writable}function Ue(we,je){if(typeof we=="object"&&we!==null){var Le;if(X(we))Le=[];else if(E(we))Le=new Date(we.getTime?we.getTime():we);else if(D(we))Le=new RegExp(we);else if(u(we))Le={message:we.message};else if(U(we)||M(we)||Y(we))Le=Object(we);else{var tt=y(we);if(tt)return _(we);if(Object.create&&Object.getPrototypeOf)Le=Object.create(Object.getPrototypeOf(we));else if(we.constructor===Object)Le={};else{var Mt=we.constructor&&we.constructor.prototype||we.__proto__||{},Wt=function(){};Wt.prototype=Mt,Le=new Wt}}var St=je.includeSymbols?De:J;return ae(St(we),function(Ut){Le[Ut]=we[Ut]}),Le}return we}var fe={__proto__:null};function Ke(we,je){var Le=[],tt=[],Mt=!0,Wt=arguments.length>2?arguments[2]:fe,St=Wt.includeSymbols?De:J,Ut=!!Wt.immutable;return(function Hr(Pr){var bi=Ut?Ue(Pr,Wt):Pr,or={__proto__:null},Rr=!0,et={node:bi,node_:Pr,path:[].concat(Le),parent:tt[tt.length-1],parents:tt,key:Le[Le.length-1],removedKeys:{__proto__:null},isRoot:Le.length===0,level:Le.length,circular:null,update:function(Et,Fr){et.isRoot||(et.parent.node[et.key]=Et),et.node=Et,Fr&&(Rr=!1)},delete:function(Et){delete et.parent.node[et.key],et.parent.removedKeys[et.key]=!0,Et&&(Rr=!1)},remove:function(Et){X(et.parent.node)?(et.parent.node.splice(et.key,1),et.parent.removedKeys[et.key]=!0,Et&&(Rr=!1)):et.delete(Et)},keys:null,before:function(Et){or.before=Et},after:function(Et){or.after=Et},pre:function(Et){or.pre=Et},post:function(Et){or.post=Et},stop:function(){Mt=!1},block:function(){Rr=!1}};if(!Mt)return et;function Lr(){if(typeof et.node=="object"&&et.node!==null){(!et.keys||et.node_!==et.node)&&(et.keys=St(et.node)),et.isLeaf=et.keys.length===0;for(var Et=0;Et<tt.length;Et++)if(tt[Et].node_===Pr){et.circular=tt[Et];break}}else et.isLeaf=!0,et.keys=null;et.notLeaf=!et.isLeaf,et.notRoot=!et.isRoot}Lr();var Xr=je.call(et,et.node);return Xr!==void 0&&et.update&&et.update(Xr),or.before&&or.before.call(et,et.node),Rr&&(typeof et.node=="object"&&et.node!==null&&!et.circular&&(tt[tt.length]=et,Lr(),ae(et.keys,function(Et,Fr){var Mi=Fr-1 in et.removedKeys;Mi&&(Et=et.keys[Fr-1]),Le[Le.length]=Et,or.pre&&or.pre.call(et,et.node[Et],Et);var pi=Hr(et.node[Et]);Ut&&Ze.call(et.node,Et)&&!He(et.node,Et)&&!Mi&&(et.node[Et]=pi.node),pi.isLast=Fr===et.keys.length-1,pi.isFirst=Fr===0,or.post&&or.post.call(et,pi),Le.pop()}),tt.pop()),or.after&&or.after.call(et,et.node)),et})(we).node}function Ne(we){this.options=arguments.length>1?arguments[1]:fe,this.value=we}Ne.prototype.get=function(we){for(var je=this.value,Le=0;je&&Le<we.length;Le++){var tt=we[Le];if(!Ze.call(je,tt)||!this.options.includeSymbols&&typeof tt=="symbol")return;je=je[tt]}return je},Ne.prototype.has=function(we){var je=this.value;if(!je&&we.length>0)return!1;for(var Le=0;je&&Le<we.length;Le++){var tt=we[Le];if(!Ze.call(je,tt)||!this.options.includeSymbols&&typeof tt=="symbol")return!1;je=je[tt]}return!0},Ne.prototype.set=function(we,je){for(var Le=this.value,tt=0;tt<we.length-1;tt++){var Mt=we[tt];Ze.call(Le,Mt)||(Le[Mt]={}),Le=Le[Mt]}return Le[we[tt]]=je,je},Ne.prototype.map=function(we){return Ke(this.value,we,{__proto__:null,immutable:!0,includeSymbols:!!this.options.includeSymbols})},Ne.prototype.forEach=function(we){return this.value=Ke(this.value,we,this.options),this.value},Ne.prototype.reduce=function(we,je){var Le=arguments.length===1,tt=Le?this.value:je;return this.forEach(function(Mt){(!this.isRoot||!Le)&&(tt=we.call(this,tt,Mt))}),tt},Ne.prototype.paths=function(){var we=[];return this.forEach(function(){we[we.length]=this.path}),we},Ne.prototype.nodes=function(){var we=[];return this.forEach(function(){we[we.length]=this.node}),we},Ne.prototype.clone=function(){var we=[],je=[],Le=this.options;return y(this.value)?_(this.value):(function tt(Mt){for(var Wt=0;Wt<we.length;Wt++)if(we[Wt]===Mt)return je[Wt];if(typeof Mt=="object"&&Mt!==null){var St=Ue(Mt,Le);we[we.length]=Mt,je[je.length]=St;var Ut=Le.includeSymbols?De:J;return ae(Ut(Mt),function(Hr){St[Hr]=tt(Mt[Hr])}),we.pop(),je.pop(),St}return Mt})(this.value)};function It(we){var je=arguments.length>1?arguments[1]:fe;return new Ne(we,je)}return ae(De(Ne.prototype),function(we){It[we]=function(je){var Le=[].slice.call(arguments,1),tt=new Ne(je);return tt[we].apply(tt,Le)}}),Zd=It,Zd}var Wd,fx;function Fw(){if(fx)return Wd;fx=1,Wd=y;function y(_){if(!(this instanceof y))return new y(_);this._bbox=_||[1/0,1/0,-1/0,-1/0],this._valid=!!_}return y.prototype.include=function(_){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],_[0]),this._bbox[1]=Math.min(this._bbox[1],_[1]),this._bbox[2]=Math.max(this._bbox[2],_[0]),this._bbox[3]=Math.max(this._bbox[3],_[1]),this},y.prototype.equals=function(_){var x;return _ instanceof y?x=_.bbox():x=_,this._bbox[0]==x[0]&&this._bbox[1]==x[1]&&this._bbox[2]==x[2]&&this._bbox[3]==x[3]},y.prototype.center=function(_){return this._valid?[(this._bbox[0]+this._bbox[2])/2,(this._bbox[1]+this._bbox[3])/2]:null},y.prototype.union=function(_){this._valid=!0;var x;return _ instanceof y?x=_.bbox():x=_,this._bbox[0]=Math.min(this._bbox[0],x[0]),this._bbox[1]=Math.min(this._bbox[1],x[1]),this._bbox[2]=Math.max(this._bbox[2],x[2]),this._bbox[3]=Math.max(this._bbox[3],x[3]),this},y.prototype.bbox=function(){return this._valid?this._bbox:null},y.prototype.contains=function(_){if(!_)return this._fastContains();if(!this._valid)return null;var x=_[0],k=_[1];return this._bbox[0]<=x&&this._bbox[1]<=k&&this._bbox[2]>=x&&this._bbox[3]>=k},y.prototype.intersect=function(_){if(!this._valid)return null;var x;return _ instanceof y?x=_.bbox():x=_,!(this._bbox[0]>x[2]||this._bbox[2]<x[0]||this._bbox[3]<x[1]||this._bbox[1]>x[3])},y.prototype._fastContains=function(){if(!this._valid)return new Function("return null;");var _="return "+this._bbox[0]+"<= ll[0] &&"+this._bbox[1]+"<= ll[1] &&"+this._bbox[2]+">= ll[0] &&"+this._bbox[3]+">= ll[1]";return new Function("ll",_)},y.prototype.polygon=function(){return this._valid?{type:"Polygon",coordinates:[[[this._bbox[0],this._bbox[1]],[this._bbox[2],this._bbox[1]],[this._bbox[2],this._bbox[3]],[this._bbox[0],this._bbox[3]],[this._bbox[0],this._bbox[1]]]]}:null},Wd}var dx;function Ow(){if(dx)return Yu.exports;dx=1;var y=U0(),_=Lw(),x=Fw(),k={features:["FeatureCollection"],coordinates:["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],geometry:["Feature"],geometries:["GeometryCollection"]},E=Object.keys(k);Yu.exports=function(u){return D(u).bbox()},Yu.exports.polygon=function(u){return D(u).polygon()},Yu.exports.bboxify=function(u){return _(u).map(function(U){if(U){var M=E.some(function(Y){return U[Y]?k[Y].indexOf(U.type)!==-1:!1});M&&(U.bbox=D(U).bbox(),this.update(U))}})};function D(u){for(var U=x(),M=y(u),Y=0;Y<M.length;Y++)U.include(M[Y]);return U}return Yu.exports}var Vw=Ow();const qw=wt.getDefaultExportFromCjs(Vw),Uw={methods:{getIconDetails(y){const _={};switch(y){case"cities":_.name="fa-regular fa-city";break;case"towns":_.name="fa-regular fa-house-chimney-window";break;case"islands":_.name="fa-regular fa-ship";break;case"regions":_.name="fa-regular fa-map-location-dot";break;case"national-parks":_.name="fa-kit fa-vs-icon-national-park";break;case"acco":_.name="fa-regular fa-bed";break;case"acti":_.name="fa-regular fa-person-walking";break;case"attr":_.name="fa-regular fa-camera";break;case"even":_.name="fa-regular fa-ticket";break;case"cate":_.name="fa-regular fa-utensils";break;case"reta":_.name="fa-regular fa-bag-shopping";break;case"featured":_.name="fa-solid fa-star";break;case"twnv":_.name="";break;case"vics":_.name="fa-kit fa-vs-icentre-information";break;case"outlander-castle":_.name="fa-regular fa-chess-rook";break;case"outlander-church-abbey":_.name="fa-regular fa-church";break;case"outlander-city-town-village":_.name="fa-regular fa-city";break;case"outlander-heritage":_.name="fa-regular fa-landmark";break;case"outlander-landscape-park":_.name="fa-regular fa-mountain";break;case"outlander-palace-house":_.name="fa-regular fa-crown";break;case"distilleries":_.name="fa-kit fa-vs-distillery";break;case"itinerary-stop":_.name="";break}return _}}},Nw={name:"VsMapMarkerIcon",status:"prototype",release:"0.0.1",components:{VsIcon:wt.VsIcon},mixins:[Uw],props:{id:{type:String,required:!0},isHovered:{type:Boolean,default:!1},number:{type:String,default:""},isMapMarker:{type:Boolean,default:!1}},computed:{mapMarkerType(){let y="fa-solid fa-location-pin";return this.id==="twnv"&&(y="fa-solid fa-location-dot"),y},parentClasses(){return this.isMapMarker?"vs-map-marker-icon--map-marker":""},markerClasses(){return[`vs-map-marker-icon__marker--${this.id}`,this.isHovered?"vs-map-marker-icon__marker--outline":""]}}},jw={key:0,class:"vs-map-marker-icon__count"};function Gw(y,_,x,k,E,D){const u=q.resolveComponent("VsIcon");return q.openBlock(),q.createElementBlock("div",{"data-test":"vs-map-marker-icon",class:q.normalizeClass(["vs-map-marker-icon",D.parentClasses])},[q.createVNode(u,{icon:D.mapMarkerType,class:q.normalizeClass(["vs-map-marker-icon__marker",D.markerClasses]),size:"xl"},null,8,["icon","class"]),x.number?(q.openBlock(),q.createElementBlock("span",jw,[_[0]||(_[0]=q.createElementVNode("span",{class:"visually-hidden"}," Stop ",-1)),q.createTextVNode(" "+q.toDisplayString(x.number),1)])):(q.openBlock(),q.createBlock(u,{key:1,class:"vs-map-marker-icon__icon",icon:y.getIconDetails(x.id).name,size:"xs"},null,8,["icon"]))],2)}const Ec=wt._export_sfc(Nw,[["render",Gw]]);let Za=null;const $w={name:"VsMapMarker",status:"prototype",release:"0.0.1",components:{VsMapMarkerIcon:Ec},props:{feature:{type:Object,required:!0},mapId:{type:String,required:!0},hasPopups:{type:Boolean,required:!0},selectedPlace:{type:String,default:null}},emits:["showDetail","setCategory"],setup(){Za=Sn()},computed:{isActive(){return!!(this.activePlace&&this.activePlace.properties&&this.activePlace.properties.id===this.feature.properties.id||this.highlightedPlace&&this.highlightedPlace.properties&&this.highlightedPlace.properties.id===this.feature.properties.id)},...pa.mapState(Sn,{highlightedPlace(y){return y.getHoveredStop(this.mapId)},activePlace(y){return y.getActivePlace(this.mapId)?y.getActivePlace(this.mapId):""},activeSubcat(y){return y.selectedSubCategory}}),getMarkerIcon(){let y;return this.feature.properties.type!==""?y=this.feature.properties.type:this.activeSubcat!==null?y=this.activeSubcat:y="featured",y==="null"&&(y=""),y}},watch:{isActive(){return this.activePlace&&this.activePlace.properties.id===this.feature.properties.id||this.highlightedPlace&&this.highlightedPlace.properties.id===this.feature.properties.id?!0:(this.activePlace&&this.activePlace.properties.id===this.feature.properties.id&&Za.setActiveMarkerPos(this.feature.geometry.coordinates),!1)},activePlace(){this.activePlace&&this.activePlace.properties.id===this.feature.properties.id&&Za.setActiveMarkerPos(this.feature.geometry.coordinates)}},mounted(){this.hasPopups&&document.body.addEventListener("click",this.handleClickEvent)},beforeUnmount(){document.body.removeEventListener("click",this.handleClickEvent)},methods:{markerClick(){Za.setActiveMarkerPos(this.feature.geometry.coordinates),Za.setActivePlace({mapId:this.mapId,activeFeature:this.feature}),this.$emit("showDetail",this.feature),this.$emit("setCategory",this.feature.properties.type)},handleHover(y){Za.setHoveredPlace({mapId:this.mapId,hoveredFeature:y})},handleClickEvent(y){const _=document.getElementsByClassName("mapboxgl-canvas");y.target===_[0]&&Za.setActivePlace({mapId:this.mapId,activeFeature:null})}}},Zw=["aria-label"];function Ww(y,_,x,k,E,D){const u=q.resolveComponent("VsMapMarkerIcon");return q.openBlock(),q.createElementBlock("button",{type:"button",class:q.normalizeClass(["vs-map-marker",D.isActive?"vs-map-marker--active":""]),"data-test":"vs-map-marker",onClick:_[0]||(_[0]=(...U)=>D.markerClick&&D.markerClick(...U)),onKeydown:_[1]||(_[1]=q.withKeys((...U)=>D.markerClick&&D.markerClick(...U),["enter"])),onMouseover:_[2]||(_[2]=U=>D.handleHover(x.feature)),onMouseleave:_[3]||(_[3]=U=>D.handleHover("")),onFocusin:_[4]||(_[4]=U=>D.handleHover(x.feature)),onFocusout:_[5]||(_[5]=U=>D.handleHover("")),"aria-label":D.getMarkerIcon},[q.createVNode(u,{id:D.getMarkerIcon,"is-map-marker":!0,number:x.feature.properties.stopCount?x.feature.properties.stopCount:""},null,8,["id","number"])],42,Zw)}const eb=wt._export_sfc($w,[["render",Ww]]);let Hs=null;const Hw={name:"VsMap",status:"prototype",release:"0.0.1",components:{VsWarning:wt.VsWarning,VsLoading:wt.VsLoading},props:{overviewMapLatitude:{type:String,default:"57.81"},overviewMapLongitude:{type:String,default:"-5.51748"},overviewMapZoom:{type:String,default:"5"},mapId:{type:String,required:!0},isVisible:{type:Boolean,required:!0},places:{type:Array,required:!0},filters:{type:Array,default(){return[]}},fitToMarkers:{type:Boolean,default:!1},showPolygons:{type:Boolean,default:!1},selectedItem:{type:Object,default:null},boundsData:{type:Object,default:()=>{}},showInfoMessage:{type:Boolean,default:null},resetZoom:{type:Boolean,default:!1},showMarkerPopups:{type:Boolean,default:!0},loadBrandingImmediately:{type:Boolean,default:!1}},emits:["map-ready","setCategory","showDetail","zoom-reset"],setup(){Hs=Sn()},data(){return{isDesktop:!1,geojsonData:{type:"FeatureCollection",features:[]},polygons:{type:"FeatureCollection",features:[]},multiPolygons:[],mapbox:{map:null,bounds:null,rotation:0,config:{container:this.$refs.mapbox,style:"https://api.visitscotland.com/maps/vector/v1/vts/resources/styles",pitchWithRotate:!1,dragRotate:!1}},markers:[],popup:null,hoveredStateId:null,activeStateId:null,showMapMessage:!0,isLoading:!0,showZoomMessage:null}},computed:{getZoom(){return this.mapbox.map?this.mapbox.map.getZoom():null},...pa.mapState(Sn,{activeMarkerPostion(y){return this.mapbox.map?y.activeMarkerPos:null},highlightedPlace(y){return this.mapbox.map?y.getHoveredStop(this.mapId):null},activePlace(y){return this.mapbox.map?y.getActivePlace(this.mapId):null}})},watch:{isVisible(y){y&&this.mapbox.map!==null&&setTimeout(()=>{this.mapbox.map.resize()},20)},places:{handler(){this.geojsonData.features=[],this.initialiseMapFeatures(),this.initialiseMapMarkers()},deep:!0},showPolygons(y){y===!0?this.showMapPolygons():this.hideMapPolygons()},highlightedPlace(y){y&&(y.length===0?this.removeHoveredPolygon():y.geometry.type!=="Point"&&this.addHoveredPolygon(y))},selectedItem(y){if(y&&y.geometry.type!=="Point"){let _=[];_=this.polygons.features.filter(x=>x.properties.id===y.properties.id),_.length>0&&this.addActivePolygon(y)}y||this.removeActivePolygon()},activeMarkerPostion(y){this.checkPointIsVisible(y)||this.centreMapOnPoint(y)},showInfoMessage(y){y?this.showMapMessage=!0:this.showMapMessage=!1},resetZoom(y){y&&(this.mapbox.map.fitBounds(this.calculateBoundingBox()),this.$emit("zoom-reset"),this.showInfoMessage&&(this.showMapMessage=!0))}},mounted(){Hs.addMapInstance({id:this.mapId,filters:this.filters,places:this.places,activePins:this.places}),this.lazyloadMapComponent(),this.isTablet=window.innerWidth>=768,window.addEventListener("resize",this.onResize),this.loadBrandingImmediately?Dy.init({div:this.mapId}):window.addEventListener("DOMContentLoaded",()=>{Dy.init({div:this.mapId})})},methods:{addMap(){const y=this.calculateBoundingBox();this.mapbox.config.container=this.$refs.mapbox,this.mapbox.map=new fo.Map({container:this.$refs.mapbox,style:"https://api.visitscotland.com/maps/vector/v1/vts/resources/styles",bounds:y,maxZoom:18,minZoom:4,trackResize:!0}),this.mapbox.map.scrollZoom.disable(),this.mapbox.map.on("rotate",()=>{this.mapbox.rotation=this.mapbox.map.transform.angle}),this.mapbox.map.resize(),this.mapbox.map.on("load",()=>{this.addMapPolygons(),this.showMapMessage=!1,this.isLoading=!1,this.$emit("map-ready",!0),this.mapbox.map.boxZoom.enable()}),this.mapbox.map.on("zoomend",()=>{this.mapbox.map.getZoom()===4?(this.showZoomMessage="too-far",this.showMapMessage=!0):this.mapbox.map.getZoom()===18?(this.showZoomMessage="too-close",this.showMapMessage=!0):this.showInfoMessage||(this.showZoomMessage=null,this.showMapMessage=!1)})},addMapControls(){const y=new fo.NavigationControl;this.mapbox.map.addControl(y,"top-right"),this.mapbox.map.addControl(new fo.FullscreenControl)},initialiseMapFeatures(){this.places.map(y=>{if(typeof y.geometry<"u"){const _=this.getCoordinateArray(y);return this.getMapFeatures(y,_)}return y.latitude&&y.longitude?this.getItineraryMapFeatures(y):!1})},getCoordinateArray(y){return y.geometry.type==="Polygon"?[y.geometry.coordinates[0]]:y.geometry.type==="MultiPolygon"?[y.geometry.coordinates]:[y.geometry.coordinates[0],y.geometry.coordinates[1]]},getMapFeatures(y,_){return this.geojsonData.features.push({type:"Feature",geometry:{type:y.geometry.type,coordinates:_},properties:{title:y.properties.title,imageSrc:y.image,type:typeof y.properties.category<"u"?y.properties.category.id:"",id:y.properties.id},id:y.properties.id})},getItineraryMapFeatures(y){const _=this._uid;return this.geojsonData.features.push({type:"Feature",geometry:{type:"Point",coordinates:[parseFloat(y.longitude),parseFloat(y.latitude)]},properties:{title:y.title,imageSrc:y.imageSrc,type:"itinerary-stop",stopCount:y.stopCount,id:_},id:_})},initialiseMapMarkers(){let y=0;this.initialLoad&&(y=1e3),setTimeout(()=>{if(this.markers!==null){for(let _=this.markers.length-1;_>=0;_--)this.markers[_].remove();this.markers=[]}this.geojsonData.features.forEach(_=>{_.geometry.type==="Point"&&this.createMapMarker(_)})},y)},createMapMarker(y){const _=q.h(eb,{feature:y,mapId:this.mapId,hasPopups:this.showMarkerPopups,onShowDetail:E=>{this.$emit("showDetail",E)},onSetCategory:E=>{this.$emit("setCategory",E)}}),x=document.createElement("div");this.$refs.mapboxOuter.appendChild(x),q.render(_,x),y&&this.showMarkerPopups&&this.addMapPopup(y);const k=new fo.Marker(x.children[0]).setLngLat(y.geometry.coordinates).setPopup(this.popup).addTo(this.mapbox.map);this.setupMarkerListeners(k),this.markers.push(k),x.remove()},hideMapPolygons(){this.mapbox.map.setLayoutProperty("regionFills","visibility","none"),this.mapbox.map.setLayoutProperty("regionBorders","visibility","none")},showMapPolygons(){this.mapbox.map.setLayoutProperty("regionFills","visibility","visible"),this.mapbox.map.setLayoutProperty("regionBorders","visibility","visible")},addMapPolygons(){this.geojsonData.features.forEach(y=>{y.geometry.type==="Polygon"?this.polygons.features.includes(y.properties.id)||this.polygons.features.push(y):y.geometry.type==="MultiPolygon"&&(this.polygons.features.includes(y.properties.id)||this.multiPolygons.push(y))}),this.multiPolygons.forEach(y=>{const _=y.properties;y.geometry.coordinates[0].forEach(x=>{this.polygons.features.push({geometry:{type:"Polygon",coordinates:x},id:_.id,properties:{id:_.id,imageSrc:_.imageSrc,title:_.title,type:_.type},type:"Feature"})})}),this.polygons.features.length>0&&(this.mapbox.map.addSource("regions",{type:"geojson",data:this.polygons,promoteId:"id"}),this.mapbox.map.addLayer({id:"regionFills",type:"fill",source:"regions",layout:{},paint:{"fill-color":["case",["==",["feature-state","interaction-state"],"hover"],"rgba(168,48,140,0.5)",["==",["feature-state","interaction-state"],"active"],"rgba(168,48,140,0.5)","rgba(25,200,197,0.6)"],"fill-opacity":.8}}),this.mapbox.map.addLayer({id:"regionBorders",type:"line",source:"regions",layout:{},paint:{"line-color":"#fff","line-width":1}}),this.hideMapPolygons(),this.mapbox.map.on("mousemove","regionFills",y=>{y.features.length>0&&(this.addMapPopup(y),this.removeHoveredPolygon(),this.addHoveredPolygon(y.features[0]))}),this.mapbox.map.on("mouseleave","regionFills",y=>{this.removeMapPopup(y),this.removeHoveredPolygon()}),this.mapbox.map.on("click","regionFills",y=>{this.removeActivePolygon(),this.addActivePolygon(y.features[0]),this.addMapPopup(y.features[0])}))},removeActivePolygon(){this.mapbox.map.style._layers.regionFills&&(this.mapbox.map.setFeatureState({source:"regions",id:this.activeStateId},{"interaction-state":""}),this.activeStateId=null)},addActivePolygon(y){this.activeStateId=y.properties.id,this.mapbox.map.setFeatureState({source:"regions",id:this.activeStateId},{"interaction-state":"active"}),Hs.setActivePlace({mapId:this.mapId,activeFeature:y}),this.$emit("showDetail",y),this.$emit("setCategory","regions")},removeHoveredPolygon(){if(this.hoveredStateId){let y="";this.hoveredStateId===this.activeStateId&&(y="active"),this.mapbox.map.setFeatureState({source:"regions",id:this.hoveredStateId},{"interaction-state":y})}Hs.setHoveredPlace({mapId:this.mapId,hoveredFeature:""}),this.hoveredStateId=null},addHoveredPolygon(y){this.hoveredStateId=y.properties.id,this.mapbox.map.setFeatureState({source:"regions",id:this.hoveredStateId},{"interaction-state":"hover"}),this.addMapPopup(y),Hs.setHoveredPlace({mapId:this.mapId,hoveredFeature:y})},addMapPopup(y){let _="";y.features?_=y.features[0]:_=y;const x=this.getCoordinates(_),k=this.getPopupHtml(_);_.properties.id&&(this.removeMapPopup(y),this.popup=new fo.Popup({closeButton:!1,offset:{top:[0,20],bottom:[0,-40],left:[30,-20],right:[-30,-20]}}).setLngLat(x).setHTML(k).addTo(this.mapbox.map))},removeMapPopup(y){this.popup&&(this.popup.remove(),this.popup=null),y._popup&&y._popup.remove()},getCoordinates(y){return y.geometry.type==="Polygon"?this.findFeatureCentre(y.geometry.coordinates):y.geometry.type==="MultiPolygon"?this.findFeatureCentre(y.geometry.coordinates[0]):y.geometry.coordinates},findFeatureCentre(y){const _=[],x=[];return y[0].forEach(k=>{_.push(k[1]),x.push(k[0])}),{lat:(Math.min(..._)+Math.max(..._))/2,lng:(Math.min(...x)+Math.max(...x))/2}},getPopupHtml(y){return y.properties.imageSrc&&y.properties.stopCount?`
501
501
  <img class="vs-map__popup-image" src="${y.properties.imageSrc}" />
502
502
  <div>
503
503
  <h4 class="vs-map__popup-subtitle">Stop ${y.properties.stopCount}</h4>
@@ -505,4 +505,4 @@ uniform `+D+" "+F+" u_"+O+`;
505
505
  </div>
506
506
  `:`
507
507
  <p class="vs-map__popup-title">${y.properties.title}</p>
508
- `},setupMarkerListeners(y){document.body.addEventListener("keyup",b=>{(b.key==="Escape"||b.key==="Tab")&&(this.removeMapPopup(y),this.showMarkerPopups&&Ws.setActivePlace({mapId:this.mapId,activeFeature:null}))}),y.getElement().addEventListener("keyup",b=>{b.key==="Enter"&&(y._popup.isOpen()||y._popup.addTo(this.mapbox.map))})},fitToBounds(){this.mapbox.map.fitBounds(Tw(this.geojsonData),{padding:{top:100,bottom:100,left:100,right:100}})},initialiseMapComponent(){this.addMap(),this.addMapControls(),this.places.length&&this.initialiseMapFeatures(),this.geojsonData.features.length&&(this.initialiseMapMarkers(),this.fitToMarkers&&this.fitToBounds())},lazyloadMapComponent(){if(fo.supported({failIfMajorPerformanceCaveat:!0}),!("IntersectionObserver"in window)){this.initialiseMapComponent();return}this.observer=new IntersectionObserver(y=>{y[0].intersectionRatio>0&&(this.observer.unobserve(this.$el),this.initialiseMapComponent())}),this.observer.observe(this.$el)},onResize(){this.isTablet=window.innerWidth>=768},getBoundsFromPolygon(){const y=this.boundsData.coordinates[0];return y.reduce((_,b)=>_.extend(b),new fo.LngLatBounds(y[0],y[0]))},checkPointIsVisible(){return this.mapbox.map.getBounds().contains(this.activeMarkerPostion)},centreMapOnPoint(y){this.mapbox.map.flyTo({center:y})},calculateBoundingBox(){let y;if(typeof this.boundsData>"u"||this.boundsData.type==="undefined")y=[[-7.555827,54.608836],[-.778285,60.880894]];else if(this.boundsData.type==="bounds"){const _=new fo.LngLat(this.boundsData.coordinates[1][0],this.boundsData.coordinates[1][1]),b=new fo.LngLat(this.boundsData.coordinates[0][0],this.boundsData.coordinates[0][1]);y=new fo.LngLatBounds(_,b)}else this.boundsData.type==="Polygon"?y=this.getBoundsFromPolygon():y=[[-7.555827,54.608836],[-.778285,60.880894]];return y}}},Dw={class:"vs-map","data-test":"vs-map"},Rw={class:"vs-map__message-box"},Lw={class:"vs-map__message-text"},Fw={ref:"mapboxOuter",class:"vs-map__map-outer"},Ow=["id"];function Vw(y,_,b,M,E,R){const u=q.resolveComponent("VsLoading"),U=q.resolveComponent("VsWarning");return q.openBlock(),q.createElementBlock("div",Dw,[E.showMapMessage?(q.openBlock(),q.createElementBlock("div",{key:0,class:q.normalizeClass(["vs-map__message",E.showZoomMessage?"":"vs-map__message--with-overlay"]),"data-test":"vs-map__message"},[q.createElementVNode("div",Rw,[E.isLoading?(q.openBlock(),q.createBlock(u,{key:0,class:"vs-map__loading"})):q.createCommentVNode("",!0),q.createElementVNode("p",Lw,[E.isLoading?q.renderSlot(y.$slots,"map-loading-text",{key:0}):b.showInfoMessage?q.renderSlot(y.$slots,"info-message",{key:1}):E.showZoomMessage==="too-close"?q.renderSlot(y.$slots,"zoom-too-close",{key:2}):E.showZoomMessage==="too-far"?q.renderSlot(y.$slots,"zoom-too-far",{key:3}):q.createCommentVNode("",!0)])])],2)):q.createCommentVNode("",!0),q.createElementVNode("div",Fw,[q.createElementVNode("div",{id:b.mapId,class:"vs-map__map",ref:"mapbox"},null,8,Ow)],512),q.createVNode(U,{class:"vs-map__no-js"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"no-js")]),_:3})])}const Gx=wt._export_sfc(zw,[["render",Vw]]),qw={name:"VsMapWithSidebarCategories",status:"prototype",release:"0.0.1",components:{VsMapMarkerIcon:Ec,VsIcon:wt.VsIcon},props:{categoryName:{type:String,required:!0},type:{type:String,required:!0},hasSubCat:{type:Boolean,default:!1}},data(){return{isHovered:!1}},methods:{selectCategory(y){this.hasSubCat?this.$parent.$emit("set-subcategory",y):(this.$parent.$emit("set-category",y),this.$parent.$emit("set-stage",1))}}},Uw={class:"vs-main-map-category","data-test":"vs-main-map-category"};function Nw(y,_,b,M,E,R){const u=q.resolveComponent("VsMapMarkerIcon"),U=q.resolveComponent("VsIcon");return q.openBlock(),q.createElementBlock("div",Uw,[q.createElementVNode("button",{type:"button",class:q.normalizeClass(["vs-main-map-category__button",`vs-main-map-category__button--${b.type}`]),"data-test":"vs-main-map-category__button",onClick:_[0]||(_[0]=k=>R.selectCategory(b.type)),onMouseover:_[1]||(_[1]=k=>E.isHovered=!0),onMouseout:_[2]||(_[2]=k=>E.isHovered=!1),onFocusin:_[3]||(_[3]=k=>E.isHovered=!0),onFocusout:_[4]||(_[4]=k=>E.isHovered=!1)},[q.createElementVNode("div",null,[q.createVNode(u,{class:"vs-main-map-category__icon",id:b.type,"is-hovered":E.isHovered},null,8,["id","is-hovered"]),q.createTextVNode(" "+q.toDisplayString(b.categoryName),1)]),q.createVNode(U,{icon:"fa-regular fa-arrow-right",variant:"highlight",size:"xs",class:"vs-main-map-category__icon align-self-center me-0"})],34)])}const jw=wt._export_sfc(qw,[["render",Nw]]);let vc=null;const Gw={name:"VsMapWithSidebarSubCategories",status:"prototype",release:"0.0.1",components:{BFormGroup:wt.BFormGroup_default,BFormCheckboxGroup:wt.BFormCheckboxGroup_default,BFormCheckbox:wt.BFormCheckbox_default,VsMapMarkerIcon:Ec},props:{data:{type:Array,required:!0},selectedSubCategory:{type:String,required:!0}},data(){return{selected:[]}},computed:{activeSubcatFilters(){return vc?vc.activeSubcatFilters:null},...pa.mapState(Sn,{activeSubcatFilters(y){return y.activeSubcatFilters}})},mounted(){vc=Sn(),this.selected=this.activeSubcatFilters,this.emitter&&(this.emitter.on("clearSelectedSubcats",()=>{this.selected=[]}),this.emitter.on("submitCheckboxData",()=>{this.checkboxesChangeSubmit()}));const y=document.getElementsByClassName("vs-main-map-subcategory")[0];y&&y.querySelectorAll('input[type="checkbox"]')[0].focus()},beforeUnmount(){this.emitter&&this.emitter.off("submitCheckboxData")},methods:{checkboxesChangeSubmit(){vc.setActiveSubcatFilters(this.selected),this.$parent.$emit("subcategories-filtered",this.selected)},emitChange(){this.emitter&&this.emitter.emit("checkboxes-selected",this.selected)}}},Zw={class:"vs-main-map-subcategory","data-test":"vs-main-map-subcategory"};function $w(y,_,b,M,E,R){const u=q.resolveComponent("VsMapMarkerIcon"),U=q.resolveComponent("BFormCheckbox"),k=q.resolveComponent("BFormCheckboxGroup"),J=q.resolveComponent("BFormGroup");return q.openBlock(),q.createElementBlock("div",Zw,[q.createVNode(J,null,{default:q.withCtx(()=>[q.createVNode(k,{id:"checkbox-group-1",modelValue:E.selected,"onUpdate:modelValue":_[0]||(_[0]=X=>E.selected=X),name:b.data.name},{default:q.withCtx(()=>[(q.openBlock(!0),q.createElementBlock(q.Fragment,null,q.renderList(b.data,X=>(q.openBlock(),q.createBlock(U,{key:X.id,value:X.id,onChange:R.emitChange},{default:q.withCtx(()=>[q.createVNode(u,{class:"vs-main-map-subcategory__icon",id:b.selectedSubCategory},null,8,["id"]),q.createTextVNode(" "+q.toDisplayString(X.name),1)]),_:2},1032,["value","onChange"]))),128))]),_:1},8,["modelValue","name"])]),_:1})])}const Ww=wt._export_sfc(Gw,[["render",$w]]);let Gd=null;const Hw={name:"VsMapWithSidebarListItem",status:"prototype",release:"0.0.1",components:{VsImg:wt.VsImg,VsIcon:wt.VsIcon},inject:["mapId"],props:{itemData:{type:Object,required:!0},fromEndpoint:{type:Boolean,default:!1},focussed:{type:Boolean,default:!1}},data(){return{formattedData:{}}},computed:{isActive(){return!!(this.highlightedPlace&&this.formattedData&&this.highlightedPlace.properties.id===this.formattedData.properties.id)},...pa.mapState(Sn,{highlightedPlace(y){return y.getHoveredStop(this.mapId)}})},created(){this.fromEndpoint?this.formatApiData():this.formattedData=this.itemData},mounted(){Gd=Sn(),this.focussed&&this.$refs.btn.focus()},methods:{showItemDetail(y){Gd.setActivePlace({mapId:this.mapId,activeFeature:y}),this.$parent.$emit("show-item-detail",y),this.$parent.$emit("set-stage",2)},itemHover(y){Gd.setHoveredPlace({mapId:this.mapId,hoveredFeature:y})},formatApiData(){this.formattedData={geometry:{coordinates:[this.itemData.longitude,this.itemData.latitude],type:"Point"},properties:{category:this.itemData.category[0],description:this.itemData.description,id:this.itemData.id,image:typeof this.itemData.images<"u"?this.itemData.images[0].mediaUrl:"",title:this.itemData.name,link:{label:this.itemData.website.label,link:this.itemData.website.link,type:this.itemData.website.type}},type:"Point"}}}},Xw={class:"vs-map-with-sidebar-list-item__img-container"},Kw={class:"vs-map-with-sidebar-list-item__text"};function Jw(y,_,b,M,E,R){const u=q.resolveComponent("VsImg"),U=q.resolveComponent("VsIcon");return q.openBlock(),q.createElementBlock("button",{type:"button",class:q.normalizeClass(["vs-map-with-sidebar-list-item",R.isActive?"vs-map-with-sidebar-list-item--hovered":""]),"data-test":"vs-map-with-sidebar-list-item",onClick:_[0]||(_[0]=k=>R.showItemDetail(E.formattedData)),onKeyup:_[1]||(_[1]=q.withKeys(k=>R.showItemDetail(E.formattedData),["enter"])),onMouseover:_[2]||(_[2]=k=>R.itemHover(E.formattedData)),onMouseleave:_[3]||(_[3]=k=>R.itemHover("")),onFocusin:_[4]||(_[4]=k=>R.itemHover(E.formattedData)),onFocusout:_[5]||(_[5]=k=>R.itemHover("")),ref:"btn"},[q.createElementVNode("div",Xw,[typeof E.formattedData.properties.image<"u"?(q.openBlock(),q.createBlock(u,{key:0,src:E.formattedData.properties.image,class:"vs-map-with-sidebar-list-item__img"},null,8,["src"])):q.createCommentVNode("",!0)]),q.createElementVNode("span",Kw,q.toDisplayString(E.formattedData.properties.title),1),q.createVNode(U,{icon:"fa-regular fa-arrow-right",variant:"highlight",size:"xxs",class:"vs-map-with-sidebar-list-item__icon"})],34)}const Yw=wt._export_sfc(Hw,[["render",Jw]]),Qw={name:"VsMapWithSidebarDetail",status:"prototype",release:"0.0.1",components:{VsImg:wt.VsImg,VsHeading:wt.VsHeading},props:{contentData:{type:Object,required:!0},headingLevel:{type:String,default:"3"}},computed:{showTitle(){return typeof this.contentData.properties.title<"u"||typeof this.contentData.properties.placeTitle<"u"}}},e2={class:"vs-map-with-sidebar-detail","data-test":"vs-map-with-sidebar-detail"},t2={key:2,"data-test":"vs-map-with-sidebar-detail__address",class:"vs-map-with-sidebar-detail__address"},r2={key:3,class:"mt-100"},i2=["innerHTML"];function n2(y,_,b,M,E,R){const u=q.resolveComponent("VsImg"),U=q.resolveComponent("VsHeading");return q.openBlock(),q.createElementBlock("div",e2,[typeof b.contentData.properties.image<"u"?(q.openBlock(),q.createBlock(u,{key:0,src:b.contentData.properties.image,class:"vs-map-with-sidebar-detail__image mb-125 mb-lg-075"},null,8,["src"])):q.createCommentVNode("",!0),R.showTitle?(q.openBlock(),q.createBlock(U,{key:1,level:b.headingLevel,"heading-style":"heading-xxs",class:"vs-map-with-sidebar-detail__heading mt-0","data-test":"vs-map-with-sidebar-detail__heading"},{default:q.withCtx(()=>[typeof b.contentData.properties.placeTitle<"u"?(q.openBlock(),q.createElementBlock(q.Fragment,{key:0},[q.createTextVNode(q.toDisplayString(b.contentData.properties.placeTitle),1)],64)):(q.openBlock(),q.createElementBlock(q.Fragment,{key:1},[q.createTextVNode(q.toDisplayString(b.contentData.properties.title),1)],64))]),_:1},8,["level"])):q.createCommentVNode("",!0),typeof b.contentData.properties.address<"u"?(q.openBlock(),q.createElementBlock("p",t2,q.toDisplayString(b.contentData.properties.address.shortAddress),1)):q.createCommentVNode("",!0),b.contentData.properties.subtitle?(q.openBlock(),q.createElementBlock("p",r2,q.toDisplayString(b.contentData.properties.subtitle),1)):q.createCommentVNode("",!0),q.createElementVNode("div",{"data-test":"vs-map-with-sidebar-detail__description",class:"vs-map-with-sidebar-detail__description mb-150",innerHTML:b.contentData.properties.description},null,8,i2)])}const o2=wt._export_sfc(Qw,[["render",n2]]),a2={name:"VsMapWithSidebarButtons",status:"prototype",release:"0.0.1",components:{VsButton:wt.VsButton},inject:["filtersAppliedText","clearFiltersText"],props:{contentData:{type:Object,required:!0},filterCount:{type:Number,default:null}},emits:["clear-filters"],computed:{websiteDataExists(){return typeof this.contentData.properties.website<"u"&&this.contentData.properties.website.link!==this.contentData.properties.link.link}},methods:{filtersClick(){this.$parent.$emit("set-stage",0)},clearFiltersClick(){this.$emit("clear-filters")}}};function s2(y,_,b,M,E,R){const u=q.resolveComponent("VsButton");return q.openBlock(),q.createElementBlock("div",{class:q.normalizeClass(["vs-map-with-sidebar-buttons",b.filterCount!==null?"vs-map-with-sidebar-buttons--filters":""]),"data-test":"vs-map-with-sidebar-buttons"},[b.filterCount!==null?(q.openBlock(),q.createElementBlock(q.Fragment,{key:0},[q.createVNode(u,{class:"vs-map-with-sidebar-buttons__clear-filters","data-test":"vs-map-with-sidebar-buttons__clear-filters",variant:"secondary",size:"sm",onClick:R.clearFiltersClick},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(R.clearFiltersText),1)]),_:1},8,["onClick"]),q.createVNode(u,{class:"vs-map-with-sidebar-buttons__filters","data-test":"vs-map-with-sidebar-buttons__filters",variant:"secondary",icon:"vs-icon-control-filters",size:"sm",onClick:R.filtersClick},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(b.filterCount)+" "+q.toDisplayString(R.filtersAppliedText),1)]),_:1},8,["onClick"])],64)):(q.openBlock(),q.createElementBlock(q.Fragment,{key:1},[q.createVNode(u,{href:b.contentData.properties.link.link,"data-test":"vs-map-with-sidebar-buttons__discover",class:"mb-050"},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(b.contentData.properties.link.label),1)]),_:1},8,["href"]),R.websiteDataExists?(q.openBlock(),q.createBlock(u,{key:0,href:b.contentData.properties.website.link,target:"_blank",rel:"noopener noreferrer","data-test":"vs-map-with-sidebar-buttons__website",variant:"secondary"},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(b.contentData.properties.website.label),1)]),_:1},8,["href"])):q.createCommentVNode("",!0)],64))],2)}const u2=wt._export_sfc(a2,[["render",s2]]),l2={name:"VsMapWithSidebarControls",status:"prototype",release:"0.0.1",components:{VsButton:wt.VsButton},inject:["clearSelectionText","applyFiltersText"],data(){return{isDisabled:!0}},computed:{...pa.mapState(Sn,{getSubcatFilters(y){return y.activeSubcatFilters}})},mounted(){this.disableSubmitButton()},methods:{clearSelection(){this.emitter&&this.emitter.emit("clearSelectedSubcats"),this.isDisabled=!0},submitCheckboxes(){this.emitter&&this.emitter.emit("submitCheckboxData")},disableSubmitButton(){this.emitter&&this.emitter.on("checkboxes-selected",y=>{y.length>0?this.isDisabled=!1:this.isDisabled=!0}),this.getSubcatFilters.length>0&&(this.isDisabled=!1)}}},c2={class:"vs-main-map-controls","data-test":"vs-main-map-controls"};function p2(y,_,b,M,E,R){const u=q.resolveComponent("VsButton");return q.openBlock(),q.createElementBlock("div",c2,[q.createVNode(u,{class:"vs-main-map-controls__clear-selection","data-test":"vs-main-map-subcategory__clear-selection",size:"sm",variant:"secondary",onClick:R.clearSelection,onKeyup:q.withKeys(R.clearSelection,["enter"])},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(R.clearSelectionText),1)]),_:1},8,["onClick","onKeyup"]),q.createVNode(u,{class:"vs-main-map-controls__apply-filters","data-test":"vs-main-map-subcategory__apply-filters",size:"sm",onKeypress:q.withKeys(R.submitCheckboxes,["enter"]),onClick:R.submitCheckboxes,"aria-disabled":E.isDisabled,disabled:E.isDisabled},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(R.applyFiltersText),1)]),_:1},8,["onKeypress","onClick","aria-disabled","disabled"])])}const h2=wt._export_sfc(l2,[["render",p2]]);let Zd=null;const f2={name:"VsMapWithSidebarPanel",status:"prototype",release:"0.0.1",components:{VsButton:wt.VsButton,VsMapWithSidebarCategory:jw,VsMapWithSidebarSubcategory:Ww,VsHeading:wt.VsHeading,VsMapWithSidebarListItem:Yw,VsMapWithSidebarDetail:o2,VsMapWithSidebarButtons:u2,VsMapWithSidebarControls:h2},inject:["filters","filtersWithLocations","placesData","regions","mapId","focussedListItem"],props:{categoryHeading:{type:String,default:""},headingLevel:{type:String,default:"2"},selectedCategory:{type:String,default:""},selectedSubcategory:{type:String,default:null},currentStage:{type:Number,required:!0},selectedItem:{type:Object,default:null},hovered:{type:String,default:""},subcategoryLocations:{type:Array,default:null},currentEndpointData:{type:Array,default:()=>[]},panelStatus:{type:String,default:null},panelMessage:{type:String,default:null},totalPins:{type:Number,default:0},currentListItemFocus:{type:Number,default:0}},emits:["close-panel","load-more-places","set-stage","set-subcategory"],data(){return{placesLoaded:1}},computed:{currentHeading(){let y="";if(this.selectedSubcategory!==null)y=this.selectedSubcategoryData[0].label;else switch(this.currentStage){case 0:y=this.categoryHeading;break;case 1:case 2:y=this.currentFilter.label;break}return y},currentData(){return this.selectedCategory==="regions"?this.regions:this.placesData},panelClasses(){let y="";return this.currentStage===2&&(y+=" vs-map-with-sidebar-panel--small-padding"),y},headerClasses(){return this.currentStage===1?"vs-map-with-sidebar-panel__header-section--with-spacer":this.currentStage===2?"vs-map-with-sidebar-panel__header-section--overlapped":""},currentFilter(){let y="";return this.filters.forEach(_=>{_.id===this.selectedCategory&&(y=_)}),y},currentPlaceData(){let y=this.placesData;return this.selectedCategory==="regions"&&(y=this.regions),this.currentEndpointData.length>0?this.refineEndpointData(this.currentEndpointData):y.filter(_=>typeof _.properties<"u"&&this.selectedItem?_.properties.id===this.selectedItem.properties.id:!1)},selectedSubcategoryData(){return this.selectedSubcategory?this.filters.filter(_=>_.id===this.selectedSubcategory):[]},...pa.mapState(Sn,{subCatFilterCount(y){return y.activeSubcatFilters.length}}),detailHeadingLevel(){return(parseInt(this.headingLevel,10)+1).toString()},showLoadMore(){return!(this.subcategoryLocations.length>=this.totalPins||this.subcategoryLocations.length===0)}},watch:{currentFilter(){this.placesLoaded=1}},mounted(){Zd=Sn()},methods:{closePanel(){this.$emit("close-panel"),window.innerWidth>=1292&&this.currentStage===2&&this.$emit("set-subcategory",null)},stageBack(){if(this.selectedSubcategory&&this.currentStage===0)this.$emit("set-subcategory",null);else if(this.selectedSubcategory!==null&&this.subcategoryLocations===null)this.setStage(0);else{const y=this.currentStage-1;this.setStage(y)}},resetPanel(){Zd.setSelectedSubcat(null),this.setStage(0)},setStage(y){y===0&&(this.placesLoaded=1),this.$emit("set-stage",y)},subCatExists(y){return typeof y.subCategory<"u"&&y.subCategory.length>0},refineEndpointData(y){const _=[{isEndpoint:!0,properties:{category:y[0].category[0].id,id:y[0].id,image:y[0].images[0].mediaUrl,placeTitle:y[0].name,description:y[0].description,link:{label:y[0].productLink.label,link:y[0].productLink.link,type:y[0].productLink.type},website:{label:y[0].website.label,link:y[0].website.link,type:y[0].website.type},address:{shortAddress:""}}}];return typeof y[0].address<"u"&&(_[0].properties.address.shortAddress=y[0].address.shortAddress),_},clearSubCatFilters(){Zd.setActiveSubcatFilters([]),this.setStage(0)},loadMorePlaces(){this.placesLoaded+=1,this.$emit("load-more-places",this.placesLoaded)}}},d2={class:"vs-map-with-sidebar-panel__buttons d-lg-none"},m2={key:0,class:"vs-map-with-sidebar-panel__back"},y2={key:1,class:"vs-map-with-sidebar-panel__back"},v2={class:"vs-map-with-sidebar-panel__close"},g2={key:0,class:"vs-map-with-sidebar-panel__back d-none d-lg-block"},_2={key:2,class:"vs-map-with-sidebar-panel__bottom-message"},x2={class:"vs-map-with-sidebar-panel__list-container"},b2={key:3,class:"vs-map-with-sidebar-panel__overlay"},w2={key:0,class:"vs-map-with-sidebar-panel__overlay-box"},S2={class:"vs-map-with-sidebar-panel__overlay-text"};function I2(y,_,b,M,E,R){const u=q.resolveComponent("VsButton"),U=q.resolveComponent("VsHeading"),k=q.resolveComponent("VsMapWithSidebarSubcategory"),J=q.resolveComponent("VsMapWithSidebarControls"),X=q.resolveComponent("VsMapWithSidebarCategory"),ae=q.resolveComponent("VsMapWithSidebarListItem"),Y=q.resolveComponent("VsMapWithSidebarButtons"),Te=q.resolveComponent("VsMapWithSidebarDetail");return q.openBlock(),q.createElementBlock("section",{"data-test":"vs-map-with-sidebar-panel",class:q.normalizeClass(["vs-map-with-sidebar-panel",R.panelClasses])},[q.createElementVNode("div",{class:q.normalizeClass(["vs-map-with-sidebar-panel__header-section",R.headerClasses])},[q.createElementVNode("div",d2,[b.currentStage>1||b.selectedSubcategory?(q.openBlock(),q.createElementBlock("div",m2,[q.createVNode(u,{class:"vs-map-with-sidebar-panel_menu",icon:"vs-icon-control-menu",size:"sm",onClick:R.stageBack,"data-test":"vs-map-with-sidebar__menu-toggle",variant:"secondary"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"menu-btn-text")]),_:3},8,["onClick"])])):q.createCommentVNode("",!0),b.currentStage===1||b.selectedSubcategory?(q.openBlock(),q.createElementBlock("div",y2,[q.createVNode(u,{"icon-only":"",icon:"fa-regular fa-arrow-left",size:"md",variant:"subtle",onClick:R.stageBack,"data-test":"vs-map-with-sidebar-panel--btn-back"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"back-btn-text")]),_:3},8,["onClick"])])):q.createCommentVNode("",!0),q.createElementVNode("div",v2,[q.createVNode(u,{"icon-only":"",icon:"vs-icon-control-dismiss",size:"md",variant:"subtle",onClick:R.closePanel,"data-test":"vs-map-with-sidebar-panel--btn-close"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"close-side-panel-text")]),_:3},8,["onClick"])])]),b.currentStage>0||b.selectedSubcategory?(q.openBlock(),q.createElementBlock("div",g2,[q.createVNode(u,{"icon-only":"",icon:"fa-regular fa-arrow-left",size:"md",variant:"subtle",onClick:R.stageBack,"data-test":"vs-map-with-sidebar-panel--btn-back"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"back-btn-text")]),_:3},8,["onClick"])])):q.createCommentVNode("",!0),R.currentHeading!==""?(q.openBlock(),q.createBlock(U,{key:1,level:b.headingLevel,"heading-style":b.currentStage===0?"heading-m":"heading-xs",class:q.normalizeClass(["vs-map-with-sidebar-panel__heading text-center mt-200 mt-lg-0",b.currentStage===2?"d-none d-lg-block":""]),"data-test":"vs-map-with-sidebar-panel__heading"},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(R.currentHeading),1)]),_:1},8,["level","heading-style","class"])):q.createCommentVNode("",!0),q.createElementVNode("div",{class:q.normalizeClass(["vs-map-with-sidebar-panel__reset",b.currentStage<2?"d-lg-none":""])},[q.createVNode(u,{"icon-only":"",icon:"vs-icon-control-dismiss",size:"md",variant:"subtle",onClick:R.resetPanel,"data-test":"vs-map-with-sidebar-panel--btn-reset"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"reset-side-panel-text")]),_:3},8,["onClick"])],2)],2),b.currentStage===0?(q.openBlock(),q.createElementBlock(q.Fragment,{key:0},[b.selectedSubcategory!==null?(q.openBlock(),q.createElementBlock(q.Fragment,{key:0},[q.createVNode(k,{data:R.selectedSubcategoryData[0].subCategory,"selected-sub-category":b.selectedSubcategory},null,8,["data","selected-sub-category"]),q.createVNode(J)],64)):(q.openBlock(!0),q.createElementBlock(q.Fragment,{key:1},q.renderList(R.filtersWithLocations,be=>(q.openBlock(),q.createBlock(X,{key:be.id,"category-name":be.label,type:be.id,"has-sub-cat":R.subCatExists(be)},null,8,["category-name","type","has-sub-cat"]))),128)),b.panelMessage!==null?(q.openBlock(),q.createElementBlock("div",_2,[q.createElementVNode("p",null,q.toDisplayString(b.panelMessage),1)])):q.createCommentVNode("",!0)],64)):q.createCommentVNode("",!0),b.currentStage===1?(q.openBlock(),q.createElementBlock(q.Fragment,{key:1},[b.selectedSubcategory!==null?(q.openBlock(),q.createElementBlock(q.Fragment,{key:0},[q.createElementVNode("div",x2,[(q.openBlock(!0),q.createElementBlock(q.Fragment,null,q.renderList(b.subcategoryLocations,(be,ke)=>(q.openBlock(),q.createBlock(ae,{key:be.id,"item-data":be,"from-endpoint":!0,focussed:ke===b.currentListItemFocus,onShowItemDetail:Oe=>y.showDetail(be)},null,8,["item-data","focussed","onShowItemDetail"]))),128)),R.showLoadMore?(q.openBlock(),q.createBlock(u,{key:0,class:"vs-map-with-sidebar-panel__load-more","data-test":"vs-map-with-sidebar-panel__load-more",onClick:_[0]||(_[0]=be=>R.loadMorePlaces()),onKeyup:_[1]||(_[1]=q.withKeys(be=>R.loadMorePlaces(),["enter"]))},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"load-more-text")]),_:3})):q.createCommentVNode("",!0)]),q.createVNode(Y,{"content-data":{},"filter-count":y.subCatFilterCount,onClearFilters:R.clearSubCatFilters},null,8,["filter-count","onClearFilters"])],64)):(q.openBlock(!0),q.createElementBlock(q.Fragment,{key:1},q.renderList(R.currentData,be=>(q.openBlock(),q.createElementBlock("div",{key:be.id},[typeof be.properties<"u"&&be.properties.category.id===b.selectedCategory?(q.openBlock(),q.createBlock(ae,{key:0,"item-data":be,onShowItemDetail:ke=>y.showDetail(be)},null,8,["item-data","onShowItemDetail"])):q.createCommentVNode("",!0)]))),128))],64)):q.createCommentVNode("",!0),b.currentStage===2?(q.openBlock(),q.createElementBlock(q.Fragment,{key:2},[q.createVNode(Te,{"heading-level":R.detailHeadingLevel,"content-data":R.currentPlaceData[0]},null,8,["heading-level","content-data"]),q.createVNode(Y,{"content-data":R.currentPlaceData[0]},null,8,["content-data"])],64)):q.createCommentVNode("",!0),b.panelStatus!==null?(q.openBlock(),q.createElementBlock("div",b2,[y.$slots["panel-loading-message"]&&b.panelStatus!=="map-loading"?(q.openBlock(),q.createElementBlock("div",w2,[q.createElementVNode("p",S2,[q.renderSlot(y.$slots,"panel-loading-message")])])):q.createCommentVNode("",!0)])):q.createCommentVNode("",!0)],2)}const T2=wt._export_sfc(f2,[["render",I2]]);let gc=null;const A2={name:"VsMapWithSidebar",status:"prototype",release:"0.0.1",components:{VsContainer:wt.VsContainer,VsRow:wt.VsRow,VsCol:wt.VsCol,VsMap:Gx,VsButton:wt.VsButton,VsMapWithSidebarPanel:T2,VsButtonToggleGroup:wt.VsButtonToggleGroup,VsWarning:wt.VsWarning},provide(){return{filters:this.filters,filtersWithLocations:this.filtersWithLocations,placesData:this.placesData,mapId:this.mapId,regions:this.regionsData,clearSelectionText:this.clearSelectionText,applyFiltersText:this.applyFiltersText,subCatList:this.subCatList,filtersAppliedText:this.filtersAppliedText,clearFiltersText:this.clearFiltersText,focussedListItem:this.focussedListItem}},props:{categoryHeading:{type:String,default:""},filters:{type:Array,required:!0},placesData:{type:Array,required:!0},mapId:{type:String,required:!0},mainHeadingExists:{type:Boolean,default:!1},initialSelected:{type:String,default:""},toggleData:{type:Array,default:()=>[]},buttonsLabel:{type:String,default:""},clearSelectionText:{type:String,required:!0},applyFiltersText:{type:String,required:!0},detailsEndpoint:{type:String,default:""},regionBounds:{type:Object,default:()=>{}},clearFiltersText:{type:String,required:!0},filtersAppliedText:{type:String,required:!0},placeId:{type:String,default:null},mapFilterMessage:{type:String,required:!0},mapNoResultsMessage:{type:String,required:!0},panelMessage:{type:String,default:null},loadBrandingImmediately:{type:Boolean,default:!1}},data(){return{panelVisible:!1,selectedCategory:"",filterCategories:this.filters,selectedItem:null,activePins:this.placesData,currentlyHovered:"",showRegions:!1,regions:[],subCatList:null,selectedToggle:"",currentEndpointData:[],mapStatus:"",panelStatus:"map-loading",mapReady:!1,showPanelMessage:null,currentPanelEndpointFilters:"",totalEndpointPins:0,focussedListItem:0,resetZoom:!1,currentStage:0,selectedSubCategory:null}},computed:{mapDisplayClass(){return this.panelVisible?"d-none d-lg-block":""},panelDisplayClass(){return this.panelVisible?"":"d-none d-lg-block"},regionsData(){return this.placesData.filter(y=>y.geometry.type==="Polygon"||y.geometry.type==="MultiPolygon")},...pa.mapState(Sn,{subCatActiveFilters(y){return y.activeSubcatFilters}}),infoMessage(){let y="";switch(this.mapStatus){case"no-results":y=this.mapNoResultsMessage;break;case"filter-results":y=this.mapFilterMessage;break}return y},existingCategories(){return this.placesData?[...new Set(this.placesData.map(y=>y.properties.category.id))]:[]},filtersWithLocations(){return this.filters.filter(y=>!!(this.existingCategories.includes(y.id)||y.subCategory&&y.subCategory.length))},togglesWithLocations(){return this.existingCategories.indexOf("vics")===-1?this.toggleData.filter(y=>y.value!=="icentres"):this.toggleData}},watch:{selectedSubCategory(y){y===null&&(this.mapStatus="",this.resetZoom=!0)}},mounted(){gc=Sn(),this.selectedToggle=this.initialSelected,this.emitter&&this.emitter.on("clearSelectedSubcats",()=>{this.resetZoom=!0})},methods:{openMenu(){this.setStage(0),this.openPanel()},closePanel(){this.panelVisible=!1},openPanel(){this.panelVisible=!0},showDetail(y){document.fullscreenElement&&document.exitFullscreen(),this.selectedItem=y,this.setStage(2),this.openPanel(),this.selectedSubCategory===null&&this.filterPlaces(this.selectedCategory)},setCategory(y){this.selectedCategory=y,this.selectedSubCategory===null&&this.filterPlaces(y)},setSubCategory(y){gc.setSelectedSubcat(y),this.selectedSubCategory=y,y!==null?(this.getSubcatMarkerData(),this.selectedCategory=y):(gc.setActiveSubcatFilters([]),this.showAllPlaces())},filterSubCategories(y){let _="";y.forEach(b=>{const M=`&cat=${b}`;_+=M}),this.currentPanelEndpointFilters=_,this.getSubcatMarkerData(_),this.getSubcatPanelData(_,0)},getSubcatMarkerData(y){const _=this.filters.filter(b=>b.id===this.selectedSubCategory);if(_.length>0){let b=_[0].pinsEndpoint;typeof y<"u"&&(b+=y),this.activePins=[],typeof y>"u"?(this.activePins=[],this.mapStatus="filter-results"):wt.axios.get(b).then(M=>{this.totalEndpointPins=M.data.features.length,this.totalEndpointPins===0?this.mapStatus="no-results":(M.data.features.forEach(E=>{const R=E;R.properties.apiData=!0,this.activePins.push(R)}),this.mapStatus="")})}},getSubcatPanelData(y,_){let M=this.filters.filter(E=>E.id===this.selectedSubCategory)[0].listProductsEndPoint;typeof y<"u"&&(M+=y),_!==0&&(M+=`${y}&page=${_}`),this.panelStatus="loading-data",wt.axios.get(M).then(E=>{typeof E.data.data.products<"u"?(this.setStage(1),_===0?(this.subCatList=E.data.data.products,this.focussedListItem=0):(this.focussedListItem=_*24,this.subCatList=this.subCatList.concat(E.data.data.products))):this.mapStatus="no-results",this.panelStatus=null})},setStage(y){if(y===2&&this.detailsEndpoint!==""&&this.selectedSubCategory!==null){const _=`${this.detailsEndpoint}${this.selectedItem.properties.id}`;wt.axios.get(_).then(b=>{const M=[];M.push(b.data.data),this.currentEndpointData=M,this.currentStage=y})}else this.currentStage=y,this.currentStage===0?(this.currentEndpointData=[],this.selectedSubCategory===null?(this.resetZoom=!0,this.showAllPlaces(),this.mapStatus=""):this.getSubcatMarkerData(),this.selectedToggle="places"):this.currentStage===1&&this.selectedSubCategory===null&&this.filterPlaces(this.selectedCategory);y!==2&&(gc.setActivePlace({mapId:this.mapId,activeFeature:""}),this.selectedItem=null)},filterPlaces(y){if(y==="regions")this.showRegions=!0,this.activePins=[],this.selectedToggle="regions";else{this.showRegions=!1,this.selectedToggle="places";const _=this.placesData.filter(b=>typeof b.properties<"u"?b.properties.category.id===y:!1);this.activePins=_}},loadMorePlaces(y){this.getSubcatPanelData(this.currentPanelEndpointFilters,y)},showAllPlaces(){this.activePins=this.placesData,this.showRegions=!1},onToggleChanged(y){y==="regions"?(this.setCategory("regions"),this.setStage(1)):y==="icentres"?(this.setCategory("vics"),this.setStage(1)):y==="places-regional"?(this.setCategory("twnv"),this.setStage(1)):(this.showAllPlaces(),this.setStage(0))},setMapReady(y){this.mapReady=y,y?this.panelStatus=null:this.panelStatus="loading"},categoryHasData(y){return this.existingCategories.indexOf(y)!==-1}}};function E2(y,_,b,M,E,R){const u=q.resolveComponent("VsMapWithSidebarPanel"),U=q.resolveComponent("VsButton"),k=q.resolveComponent("VsMap"),J=q.resolveComponent("VsButtonToggleGroup"),X=q.resolveComponent("VsWarning"),ae=q.resolveComponent("VsCol"),Y=q.resolveComponent("VsRow"),Te=q.resolveComponent("VsContainer");return q.openBlock(),q.createBlock(Te,{"data-test":"vs-map-with-sidebar"},{default:q.withCtx(()=>[q.createVNode(Y,null,{default:q.withCtx(()=>[q.createVNode(ae,null,{default:q.withCtx(()=>[q.createElementVNode("div",{class:"vs-map-with-sidebar",ref:b.mapId},[q.createElementVNode("div",{class:q.normalizeClass(["vs-map-with-sidebar__side-panel",R.panelDisplayClass]),"data-test":"vs-map-with-sidebar__side-panel"},[q.createVNode(u,{"category-heading":b.categoryHeading,"selected-category":E.selectedCategory,"selected-subcategory":E.selectedSubCategory,"current-stage":E.currentStage,"selected-item":E.selectedItem,"heading-level":b.mainHeadingExists?"3":"2","subcategory-locations":E.subCatList,"current-endpoint-data":E.currentEndpointData,"panel-status":E.panelStatus,"panel-message":E.currentStage===0?b.panelMessage:null,"total-pins":E.totalEndpointPins,"current-list-item-focus":E.focussedListItem,onSetCategory:R.setCategory,onSetSubcategory:R.setSubCategory,onSubcategoriesFiltered:R.filterSubCategories,onSetStage:R.setStage,onClosePanel:R.closePanel,onShowItemDetail:R.showDetail,onFilterPlaces:R.filterPlaces,onLoadMorePlaces:R.loadMorePlaces},{closePanelText:q.withCtx(()=>[q.renderSlot(y.$slots,"close-side-panel-text")]),"reset-side-panel-text":q.withCtx(()=>[q.renderSlot(y.$slots,"reset-side-panel-text")]),"menu-btn-text":q.withCtx(()=>[q.renderSlot(y.$slots,"menu-btn-text")]),"panel-loading-message":q.withCtx(()=>[q.renderSlot(y.$slots,"panel-loading-message")]),"load-more-text":q.withCtx(()=>[q.renderSlot(y.$slots,"load-more-text")]),_:3},8,["category-heading","selected-category","selected-subcategory","current-stage","selected-item","heading-level","subcategory-locations","current-endpoint-data","panel-status","panel-message","total-pins","current-list-item-focus","onSetCategory","onSetSubcategory","onSubcategoriesFiltered","onSetStage","onClosePanel","onShowItemDetail","onFilterPlaces","onLoadMorePlaces"])],2),q.createElementVNode("div",{class:q.normalizeClass(["vs-map-with-sidebar__map",R.mapDisplayClass])},[q.createVNode(U,{class:"vs-map-with-sidebar__map-toggle",icon:"vs-icon-control-menu",size:"sm",onClick:R.openMenu,"data-test":"vs-map-with-sidebar__map-toggle",variant:"secondary"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"open-side-panel-text")]),_:3},8,["onClick"]),q.createVNode(k,{"is-visible":!E.panelVisible,labels:{},filters:R.filtersWithLocations,places:E.activePins,"selected-item":E.selectedItem,"map-id":b.mapId,"show-polygons":E.showRegions,"show-info-message":E.mapStatus!=="",onShowDetail:R.showDetail,onSetCategory:R.setCategory,onMapReady:R.setMapReady,onZoomReset:_[0]||(_[0]=be=>E.resetZoom=!1),"bounds-data":b.regionBounds,"reset-zoom":E.resetZoom,"show-marker-popups":!1,"load-branding-immediately":b.loadBrandingImmediately},{"map-loading-text":q.withCtx(()=>[q.renderSlot(y.$slots,"map-loading-text")]),"info-message":q.withCtx(()=>[q.createTextVNode(q.toDisplayString(R.infoMessage),1)]),"zoom-too-close":q.withCtx(()=>[q.renderSlot(y.$slots,"zoom-too-close")]),"zoom-too-far":q.withCtx(()=>[q.renderSlot(y.$slots,"zoom-too-far")]),"no-js":q.withCtx(()=>[q.renderSlot(y.$slots,"no-js")]),_:3},8,["is-visible","filters","places","selected-item","map-id","show-polygons","show-info-message","onShowDetail","onSetCategory","onMapReady","bounds-data","reset-zoom","load-branding-immediately"]),R.togglesWithLocations.length>1?(q.openBlock(),q.createBlock(J,{key:0,"data-test":"vs-map-with-sidebar__map-toggle-group","initial-selected":E.selectedToggle,options:R.togglesWithLocations,"buttons-label":b.buttonsLabel,onToggleChanged:R.onToggleChanged},null,8,["initial-selected","options","buttons-label","onToggleChanged"])):q.createCommentVNode("",!0)],2)],512),q.createVNode(X,{class:"vs-map-with-sidebar__no-js"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"no-js")]),_:3})]),_:3})]),_:3})]),_:3})}const P2=wt._export_sfc(A2,[["render",E2]]);exports.VsMap=Gx;exports.VsMapMarker=jx;exports.VsMapMarkerIcon=Ec;exports.VsMapWithSidebar=P2;
508
+ `},setupMarkerListeners(y){document.body.addEventListener("keyup",x=>{(x.key==="Escape"||x.key==="Tab")&&(this.removeMapPopup(y),this.showMarkerPopups&&Hs.setActivePlace({mapId:this.mapId,activeFeature:null}))}),y.getElement().addEventListener("keyup",x=>{x.key==="Enter"&&(y._popup.isOpen()||y._popup.addTo(this.mapbox.map))})},fitToBounds(){this.mapbox.map.fitBounds(qw(this.geojsonData),{padding:{top:100,bottom:100,left:100,right:100}})},initialiseMapComponent(){this.addMap(),this.addMapControls(),this.places.length&&this.initialiseMapFeatures(),this.geojsonData.features.length&&(this.initialiseMapMarkers(),this.fitToMarkers&&this.fitToBounds())},lazyloadMapComponent(){if(fo.supported({failIfMajorPerformanceCaveat:!0}),!("IntersectionObserver"in window)){this.initialiseMapComponent();return}this.observer=new IntersectionObserver(y=>{y[0].intersectionRatio>0&&(this.observer.unobserve(this.$el),this.initialiseMapComponent())}),this.observer.observe(this.$el)},onResize(){this.isTablet=window.innerWidth>=768},getBoundsFromPolygon(){const y=this.boundsData.coordinates[0];return y.reduce((_,x)=>_.extend(x),new fo.LngLatBounds(y[0],y[0]))},checkPointIsVisible(){return this.mapbox.map.getBounds().contains(this.activeMarkerPostion)},centreMapOnPoint(y){this.mapbox.map.flyTo({center:y})},calculateBoundingBox(){let y;if(typeof this.boundsData>"u"||this.boundsData.type==="undefined")y=[[-7.555827,54.608836],[-.778285,60.880894]];else if(this.boundsData.type==="bounds"){const _=new fo.LngLat(this.boundsData.coordinates[1][0],this.boundsData.coordinates[1][1]),x=new fo.LngLat(this.boundsData.coordinates[0][0],this.boundsData.coordinates[0][1]);y=new fo.LngLatBounds(_,x)}else this.boundsData.type==="Polygon"?y=this.getBoundsFromPolygon():y=[[-7.555827,54.608836],[-.778285,60.880894]];return y}}},Xw={class:"vs-map","data-test":"vs-map"},Kw={class:"vs-map__message-box"},Jw={class:"vs-map__message-text"},Yw={ref:"mapboxOuter",class:"vs-map__map-outer"},Qw=["id"];function e2(y,_,x,k,E,D){const u=q.resolveComponent("VsLoading"),U=q.resolveComponent("VsWarning");return q.openBlock(),q.createElementBlock("div",Xw,[E.showMapMessage?(q.openBlock(),q.createElementBlock("div",{key:0,class:q.normalizeClass(["vs-map__message",E.showZoomMessage?"":"vs-map__message--with-overlay"]),"data-test":"vs-map__message"},[q.createElementVNode("div",Kw,[E.isLoading?(q.openBlock(),q.createBlock(u,{key:0,class:"vs-map__loading"})):q.createCommentVNode("",!0),q.createElementVNode("p",Jw,[E.isLoading?q.renderSlot(y.$slots,"map-loading-text",{key:0}):x.showInfoMessage?q.renderSlot(y.$slots,"info-message",{key:1}):E.showZoomMessage==="too-close"?q.renderSlot(y.$slots,"zoom-too-close",{key:2}):E.showZoomMessage==="too-far"?q.renderSlot(y.$slots,"zoom-too-far",{key:3}):q.createCommentVNode("",!0)])])],2)):q.createCommentVNode("",!0),q.createElementVNode("div",Yw,[q.createElementVNode("div",{id:x.mapId,class:"vs-map__map",ref:"mapbox"},null,8,Qw)],512),q.createVNode(U,{class:"vs-map__no-js"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"no-js")]),_:3})])}const tb=wt._export_sfc(Hw,[["render",e2]]),t2={name:"VsMapWithSidebarCategories",status:"prototype",release:"0.0.1",components:{VsMapMarkerIcon:Ec,VsIcon:wt.VsIcon},props:{categoryName:{type:String,required:!0},type:{type:String,required:!0},hasSubCat:{type:Boolean,default:!1}},data(){return{isHovered:!1}},methods:{selectCategory(y){this.hasSubCat?this.$parent.$emit("set-subcategory",y):(this.$parent.$emit("set-category",y),this.$parent.$emit("set-stage",1))}}},r2={class:"vs-main-map-category","data-test":"vs-main-map-category"};function i2(y,_,x,k,E,D){const u=q.resolveComponent("VsMapMarkerIcon"),U=q.resolveComponent("VsIcon");return q.openBlock(),q.createElementBlock("div",r2,[q.createElementVNode("button",{type:"button",class:q.normalizeClass(["vs-main-map-category__button",`vs-main-map-category__button--${x.type}`]),"data-test":"vs-main-map-category__button",onClick:_[0]||(_[0]=M=>D.selectCategory(x.type)),onMouseover:_[1]||(_[1]=M=>E.isHovered=!0),onMouseout:_[2]||(_[2]=M=>E.isHovered=!1),onFocusin:_[3]||(_[3]=M=>E.isHovered=!0),onFocusout:_[4]||(_[4]=M=>E.isHovered=!1)},[q.createElementVNode("div",null,[q.createVNode(u,{class:"vs-main-map-category__icon",id:x.type,"is-hovered":E.isHovered},null,8,["id","is-hovered"]),q.createTextVNode(" "+q.toDisplayString(x.categoryName),1)]),q.createVNode(U,{icon:"fa-regular fa-arrow-right",variant:"highlight",size:"xs",class:"vs-main-map-category__icon align-self-center me-0"})],34)])}const n2=wt._export_sfc(t2,[["render",i2]]);let xc=null;const o2={name:"VsMapWithSidebarSubCategories",status:"prototype",release:"0.0.1",components:{BFormGroup:wt.BFormGroup_default,BFormCheckboxGroup:wt.BFormCheckboxGroup_default,BFormCheckbox:wt.BFormCheckbox_default,VsMapMarkerIcon:Ec},props:{data:{type:Array,required:!0},selectedSubCategory:{type:String,required:!0}},data(){return{selected:[]}},computed:{activeSubcatFilters(){return xc?xc.activeSubcatFilters:null},...pa.mapState(Sn,{activeSubcatFilters(y){return y.activeSubcatFilters}})},mounted(){xc=Sn(),this.selected=this.activeSubcatFilters,this.emitter&&(this.emitter.on("clearSelectedSubcats",()=>{this.selected=[]}),this.emitter.on("submitCheckboxData",()=>{this.checkboxesChangeSubmit()}));const y=document.getElementsByClassName("vs-main-map-subcategory")[0];y&&y.querySelectorAll('input[type="checkbox"]')[0].focus()},beforeUnmount(){this.emitter&&this.emitter.off("submitCheckboxData")},methods:{checkboxesChangeSubmit(){xc.setActiveSubcatFilters(this.selected),this.$parent.$emit("subcategories-filtered",this.selected)},emitChange(){this.emitter&&this.emitter.emit("checkboxes-selected",this.selected)}}},a2={class:"vs-main-map-subcategory","data-test":"vs-main-map-subcategory"};function s2(y,_,x,k,E,D){const u=q.resolveComponent("VsMapMarkerIcon"),U=q.resolveComponent("BFormCheckbox"),M=q.resolveComponent("BFormCheckboxGroup"),Y=q.resolveComponent("BFormGroup");return q.openBlock(),q.createElementBlock("div",a2,[q.createVNode(Y,null,{default:q.withCtx(()=>[q.createVNode(M,{id:"checkbox-group-1",modelValue:E.selected,"onUpdate:modelValue":_[0]||(_[0]=X=>E.selected=X),name:x.data.name},{default:q.withCtx(()=>[(q.openBlock(!0),q.createElementBlock(q.Fragment,null,q.renderList(x.data,X=>(q.openBlock(),q.createBlock(U,{key:X.id,value:X.id,onChange:D.emitChange},{default:q.withCtx(()=>[q.createVNode(u,{class:"vs-main-map-subcategory__icon",id:x.selectedSubCategory},null,8,["id"]),q.createTextVNode(" "+q.toDisplayString(X.name),1)]),_:2},1032,["value","onChange"]))),128))]),_:1},8,["modelValue","name"])]),_:1})])}const u2=wt._export_sfc(o2,[["render",s2]]);let Hd=null;const l2={name:"VsMapWithSidebarListItem",status:"prototype",release:"0.0.1",components:{VsImg:wt.VsImg,VsIcon:wt.VsIcon},inject:["mapId"],props:{itemData:{type:Object,required:!0},fromEndpoint:{type:Boolean,default:!1},focussed:{type:Boolean,default:!1}},data(){return{formattedData:{}}},computed:{isActive(){return!!(this.highlightedPlace&&this.formattedData&&this.highlightedPlace.properties.id===this.formattedData.properties.id)},...pa.mapState(Sn,{highlightedPlace(y){return y.getHoveredStop(this.mapId)}})},created(){this.fromEndpoint?this.formatApiData():this.formattedData=this.itemData},mounted(){Hd=Sn(),this.focussed&&this.$refs.btn.focus()},methods:{showItemDetail(y){Hd.setActivePlace({mapId:this.mapId,activeFeature:y}),this.$parent.$emit("show-item-detail",y),this.$parent.$emit("set-stage",2)},itemHover(y){Hd.setHoveredPlace({mapId:this.mapId,hoveredFeature:y})},formatApiData(){this.formattedData={geometry:{coordinates:[this.itemData.longitude,this.itemData.latitude],type:"Point"},properties:{category:this.itemData.category[0],description:this.itemData.description,id:this.itemData.id,image:typeof this.itemData.images<"u"?this.itemData.images[0].mediaUrl:"",title:this.itemData.name,link:{label:this.itemData.website.label,link:this.itemData.website.link,type:this.itemData.website.type}},type:"Point"}}}},c2={class:"vs-map-with-sidebar-list-item__img-container"},p2={class:"vs-map-with-sidebar-list-item__text"};function h2(y,_,x,k,E,D){const u=q.resolveComponent("VsImg"),U=q.resolveComponent("VsIcon");return q.openBlock(),q.createElementBlock("button",{type:"button",class:q.normalizeClass(["vs-map-with-sidebar-list-item",D.isActive?"vs-map-with-sidebar-list-item--hovered":""]),"data-test":"vs-map-with-sidebar-list-item",onClick:_[0]||(_[0]=M=>D.showItemDetail(E.formattedData)),onKeyup:_[1]||(_[1]=q.withKeys(M=>D.showItemDetail(E.formattedData),["enter"])),onMouseover:_[2]||(_[2]=M=>D.itemHover(E.formattedData)),onMouseleave:_[3]||(_[3]=M=>D.itemHover("")),onFocusin:_[4]||(_[4]=M=>D.itemHover(E.formattedData)),onFocusout:_[5]||(_[5]=M=>D.itemHover("")),ref:"btn"},[q.createElementVNode("div",c2,[typeof E.formattedData.properties.image<"u"?(q.openBlock(),q.createBlock(u,{key:0,src:E.formattedData.properties.image,class:"vs-map-with-sidebar-list-item__img"},null,8,["src"])):q.createCommentVNode("",!0)]),q.createElementVNode("span",p2,q.toDisplayString(E.formattedData.properties.title),1),q.createVNode(U,{icon:"fa-regular fa-arrow-right",variant:"highlight",size:"xxs",class:"vs-map-with-sidebar-list-item__icon"})],34)}const f2=wt._export_sfc(l2,[["render",h2]]),d2={name:"VsMapWithSidebarDetail",status:"prototype",release:"0.0.1",components:{VsImg:wt.VsImg,VsHeading:wt.VsHeading},props:{contentData:{type:Object,required:!0},headingLevel:{type:String,default:"3"}},computed:{showTitle(){return typeof this.contentData.properties.title<"u"||typeof this.contentData.properties.placeTitle<"u"}}},m2={class:"vs-map-with-sidebar-detail","data-test":"vs-map-with-sidebar-detail"},y2={key:2,"data-test":"vs-map-with-sidebar-detail__address",class:"vs-map-with-sidebar-detail__address"},v2={key:3,class:"mt-100"},g2=["innerHTML"];function _2(y,_,x,k,E,D){const u=q.resolveComponent("VsImg"),U=q.resolveComponent("VsHeading");return q.openBlock(),q.createElementBlock("div",m2,[typeof x.contentData.properties.image<"u"?(q.openBlock(),q.createBlock(u,{key:0,src:x.contentData.properties.image,class:"vs-map-with-sidebar-detail__image mb-125 mb-lg-075"},null,8,["src"])):q.createCommentVNode("",!0),D.showTitle?(q.openBlock(),q.createBlock(U,{key:1,level:x.headingLevel,"heading-style":"heading-xxs",class:"vs-map-with-sidebar-detail__heading mt-0","data-test":"vs-map-with-sidebar-detail__heading"},{default:q.withCtx(()=>[typeof x.contentData.properties.placeTitle<"u"?(q.openBlock(),q.createElementBlock(q.Fragment,{key:0},[q.createTextVNode(q.toDisplayString(x.contentData.properties.placeTitle),1)],64)):(q.openBlock(),q.createElementBlock(q.Fragment,{key:1},[q.createTextVNode(q.toDisplayString(x.contentData.properties.title),1)],64))]),_:1},8,["level"])):q.createCommentVNode("",!0),typeof x.contentData.properties.address<"u"?(q.openBlock(),q.createElementBlock("p",y2,q.toDisplayString(x.contentData.properties.address.shortAddress),1)):q.createCommentVNode("",!0),x.contentData.properties.subtitle?(q.openBlock(),q.createElementBlock("p",v2,q.toDisplayString(x.contentData.properties.subtitle),1)):q.createCommentVNode("",!0),q.createElementVNode("div",{"data-test":"vs-map-with-sidebar-detail__description",class:"vs-map-with-sidebar-detail__description mb-150",innerHTML:x.contentData.properties.description},null,8,g2)])}const x2=wt._export_sfc(d2,[["render",_2]]),b2={name:"VsMapWithSidebarButtons",status:"prototype",release:"0.0.1",components:{VsButton:wt.VsButton},inject:["filtersAppliedText","clearFiltersText"],props:{contentData:{type:Object,required:!0},filterCount:{type:Number,default:null}},emits:["clear-filters"],computed:{websiteDataExists(){return typeof this.contentData.properties.website<"u"&&this.contentData.properties.website.link!==this.contentData.properties.link.link}},methods:{filtersClick(){this.$parent.$emit("set-stage",0)},clearFiltersClick(){this.$emit("clear-filters")}}};function w2(y,_,x,k,E,D){const u=q.resolveComponent("VsButton");return q.openBlock(),q.createElementBlock("div",{class:q.normalizeClass(["vs-map-with-sidebar-buttons",x.filterCount!==null?"vs-map-with-sidebar-buttons--filters":""]),"data-test":"vs-map-with-sidebar-buttons"},[x.filterCount!==null?(q.openBlock(),q.createElementBlock(q.Fragment,{key:0},[q.createVNode(u,{class:"vs-map-with-sidebar-buttons__clear-filters","data-test":"vs-map-with-sidebar-buttons__clear-filters",variant:"secondary",size:"sm",onClick:D.clearFiltersClick},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(D.clearFiltersText),1)]),_:1},8,["onClick"]),q.createVNode(u,{class:"vs-map-with-sidebar-buttons__filters","data-test":"vs-map-with-sidebar-buttons__filters",variant:"secondary",icon:"vs-icon-control-filters",size:"sm",onClick:D.filtersClick},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(x.filterCount)+" "+q.toDisplayString(D.filtersAppliedText),1)]),_:1},8,["onClick"])],64)):(q.openBlock(),q.createElementBlock(q.Fragment,{key:1},[q.createVNode(u,{href:x.contentData.properties.link.link,"data-test":"vs-map-with-sidebar-buttons__discover",class:"mb-050"},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(x.contentData.properties.link.label),1)]),_:1},8,["href"]),D.websiteDataExists?(q.openBlock(),q.createBlock(u,{key:0,href:x.contentData.properties.website.link,target:"_blank",rel:"noopener noreferrer","data-test":"vs-map-with-sidebar-buttons__website",variant:"secondary"},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(x.contentData.properties.website.label),1)]),_:1},8,["href"])):q.createCommentVNode("",!0)],64))],2)}const S2=wt._export_sfc(b2,[["render",w2]]),I2={name:"VsMapWithSidebarControls",status:"prototype",release:"0.0.1",components:{VsButton:wt.VsButton},inject:["clearSelectionText","applyFiltersText"],data(){return{isDisabled:!0}},computed:{...pa.mapState(Sn,{getSubcatFilters(y){return y.activeSubcatFilters}})},mounted(){this.disableSubmitButton()},methods:{clearSelection(){this.emitter&&this.emitter.emit("clearSelectedSubcats"),this.isDisabled=!0},submitCheckboxes(){this.emitter&&this.emitter.emit("submitCheckboxData")},disableSubmitButton(){this.emitter&&this.emitter.on("checkboxes-selected",y=>{y.length>0?this.isDisabled=!1:this.isDisabled=!0}),this.getSubcatFilters.length>0&&(this.isDisabled=!1)}}},T2={class:"vs-main-map-controls","data-test":"vs-main-map-controls"};function A2(y,_,x,k,E,D){const u=q.resolveComponent("VsButton");return q.openBlock(),q.createElementBlock("div",T2,[q.createVNode(u,{class:"vs-main-map-controls__clear-selection","data-test":"vs-main-map-subcategory__clear-selection",size:"sm",variant:"secondary",onClick:D.clearSelection,onKeyup:q.withKeys(D.clearSelection,["enter"])},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(D.clearSelectionText),1)]),_:1},8,["onClick","onKeyup"]),q.createVNode(u,{class:"vs-main-map-controls__apply-filters","data-test":"vs-main-map-subcategory__apply-filters",size:"sm",onKeypress:q.withKeys(D.submitCheckboxes,["enter"]),onClick:D.submitCheckboxes,"aria-disabled":E.isDisabled,disabled:E.isDisabled},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(D.applyFiltersText),1)]),_:1},8,["onKeypress","onClick","aria-disabled","disabled"])])}const E2=wt._export_sfc(I2,[["render",A2]]);let Xd=null;const P2={name:"VsMapWithSidebarPanel",status:"prototype",release:"0.0.1",components:{VsButton:wt.VsButton,VsMapWithSidebarCategory:n2,VsMapWithSidebarSubcategory:u2,VsHeading:wt.VsHeading,VsMapWithSidebarListItem:f2,VsMapWithSidebarDetail:x2,VsMapWithSidebarButtons:S2,VsMapWithSidebarControls:E2},inject:["filters","filtersWithLocations","placesData","regions","mapId","focussedListItem"],props:{categoryHeading:{type:String,default:""},headingLevel:{type:String,default:"2"},selectedCategory:{type:String,default:""},selectedSubcategory:{type:String,default:null},currentStage:{type:Number,required:!0},selectedItem:{type:Object,default:null},hovered:{type:String,default:""},subcategoryLocations:{type:Array,default:null},currentEndpointData:{type:Array,default:()=>[]},panelStatus:{type:String,default:null},panelMessage:{type:String,default:null},totalPins:{type:Number,default:0},currentListItemFocus:{type:Number,default:0}},emits:["close-panel","load-more-places","set-stage","set-subcategory"],data(){return{placesLoaded:1}},computed:{currentHeading(){let y="";if(this.selectedSubcategory!==null)y=this.selectedSubcategoryData[0].label;else switch(this.currentStage){case 0:y=this.categoryHeading;break;case 1:case 2:y=this.currentFilter.label;break}return y},currentData(){return this.selectedCategory==="regions"?this.regions:this.placesData},panelClasses(){let y="";return this.currentStage===2&&(y+=" vs-map-with-sidebar-panel--small-padding"),y},headerClasses(){return this.currentStage===1?"vs-map-with-sidebar-panel__header-section--with-spacer":this.currentStage===2?"vs-map-with-sidebar-panel__header-section--overlapped":""},currentFilter(){let y="";return this.filters.forEach(_=>{_.id===this.selectedCategory&&(y=_)}),y},currentPlaceData(){let y=this.placesData;return this.selectedCategory==="regions"&&(y=this.regions),this.currentEndpointData.length>0?this.refineEndpointData(this.currentEndpointData):y.filter(_=>typeof _.properties<"u"&&this.selectedItem?_.properties.id===this.selectedItem.properties.id:!1)},selectedSubcategoryData(){return this.selectedSubcategory?this.filters.filter(_=>_.id===this.selectedSubcategory):[]},...pa.mapState(Sn,{subCatFilterCount(y){return y.activeSubcatFilters.length}}),detailHeadingLevel(){return(parseInt(this.headingLevel,10)+1).toString()},showLoadMore(){return!(this.subcategoryLocations.length>=this.totalPins||this.subcategoryLocations.length===0)}},watch:{currentFilter(){this.placesLoaded=1}},mounted(){Xd=Sn()},methods:{closePanel(){this.$emit("close-panel"),window.innerWidth>=1292&&this.currentStage===2&&this.$emit("set-subcategory",null)},stageBack(){if(this.selectedSubcategory&&this.currentStage===0)this.$emit("set-subcategory",null);else if(this.selectedSubcategory!==null&&this.subcategoryLocations===null)this.setStage(0);else{const y=this.currentStage-1;this.setStage(y)}},resetPanel(){Xd.setSelectedSubcat(null),this.setStage(0)},setStage(y){y===0&&(this.placesLoaded=1),this.$emit("set-stage",y)},subCatExists(y){return typeof y.subCategory<"u"&&y.subCategory.length>0},refineEndpointData(y){const _=[{isEndpoint:!0,properties:{category:y[0].category[0].id,id:y[0].id,image:y[0].images[0].mediaUrl,placeTitle:y[0].name,description:y[0].description,link:{label:y[0].productLink.label,link:y[0].productLink.link,type:y[0].productLink.type},website:{label:y[0].website.label,link:y[0].website.link,type:y[0].website.type},address:{shortAddress:""}}}];return typeof y[0].address<"u"&&(_[0].properties.address.shortAddress=y[0].address.shortAddress),_},clearSubCatFilters(){Xd.setActiveSubcatFilters([]),this.setStage(0)},loadMorePlaces(){this.placesLoaded+=1,this.$emit("load-more-places",this.placesLoaded)}}},C2={class:"vs-map-with-sidebar-panel__buttons d-lg-none"},k2={key:0,class:"vs-map-with-sidebar-panel__back"},M2={key:1,class:"vs-map-with-sidebar-panel__back"},B2={class:"vs-map-with-sidebar-panel__close"},z2={key:0,class:"vs-map-with-sidebar-panel__back d-none d-lg-block"},D2={key:2,class:"vs-map-with-sidebar-panel__bottom-message"},R2={class:"vs-map-with-sidebar-panel__list-container"},L2={key:3,class:"vs-map-with-sidebar-panel__overlay"},F2={key:0,class:"vs-map-with-sidebar-panel__overlay-box"},O2={class:"vs-map-with-sidebar-panel__overlay-text"};function V2(y,_,x,k,E,D){const u=q.resolveComponent("VsButton"),U=q.resolveComponent("VsHeading"),M=q.resolveComponent("VsMapWithSidebarSubcategory"),Y=q.resolveComponent("VsMapWithSidebarControls"),X=q.resolveComponent("VsMapWithSidebarCategory"),ae=q.resolveComponent("VsMapWithSidebarListItem"),J=q.resolveComponent("VsMapWithSidebarButtons"),Se=q.resolveComponent("VsMapWithSidebarDetail");return q.openBlock(),q.createElementBlock("section",{"data-test":"vs-map-with-sidebar-panel",class:q.normalizeClass(["vs-map-with-sidebar-panel",D.panelClasses])},[q.createElementVNode("div",{class:q.normalizeClass(["vs-map-with-sidebar-panel__header-section",D.headerClasses])},[q.createElementVNode("div",C2,[x.currentStage>1||x.selectedSubcategory?(q.openBlock(),q.createElementBlock("div",k2,[q.createVNode(u,{class:"vs-map-with-sidebar-panel_menu",icon:"vs-icon-control-menu",size:"sm",onClick:D.stageBack,"data-test":"vs-map-with-sidebar__menu-toggle",variant:"secondary"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"menu-btn-text")]),_:3},8,["onClick"])])):q.createCommentVNode("",!0),x.currentStage===1||x.selectedSubcategory?(q.openBlock(),q.createElementBlock("div",M2,[q.createVNode(u,{"icon-only":"",icon:"fa-regular fa-arrow-left",size:"md",variant:"subtle",onClick:D.stageBack,"data-test":"vs-map-with-sidebar-panel--btn-back"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"back-btn-text")]),_:3},8,["onClick"])])):q.createCommentVNode("",!0),q.createElementVNode("div",B2,[q.createVNode(u,{"icon-only":"",icon:"vs-icon-control-dismiss",size:"md",variant:"subtle",onClick:D.closePanel,"data-test":"vs-map-with-sidebar-panel--btn-close"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"close-side-panel-text")]),_:3},8,["onClick"])])]),x.currentStage>0||x.selectedSubcategory?(q.openBlock(),q.createElementBlock("div",z2,[q.createVNode(u,{"icon-only":"",icon:"fa-regular fa-arrow-left",size:"md",variant:"subtle",onClick:D.stageBack,"data-test":"vs-map-with-sidebar-panel--btn-back"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"back-btn-text")]),_:3},8,["onClick"])])):q.createCommentVNode("",!0),D.currentHeading!==""?(q.openBlock(),q.createBlock(U,{key:1,level:x.headingLevel,"heading-style":x.currentStage===0?"heading-m":"heading-xs",class:q.normalizeClass(["vs-map-with-sidebar-panel__heading text-center mt-200 mt-lg-0",x.currentStage===2?"d-none d-lg-block":""]),"data-test":"vs-map-with-sidebar-panel__heading"},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(D.currentHeading),1)]),_:1},8,["level","heading-style","class"])):q.createCommentVNode("",!0),q.createElementVNode("div",{class:q.normalizeClass(["vs-map-with-sidebar-panel__reset",x.currentStage<2?"d-lg-none":""])},[q.createVNode(u,{"icon-only":"",icon:"vs-icon-control-dismiss",size:"md",variant:"subtle",onClick:D.resetPanel,"data-test":"vs-map-with-sidebar-panel--btn-reset"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"reset-side-panel-text")]),_:3},8,["onClick"])],2)],2),x.currentStage===0?(q.openBlock(),q.createElementBlock(q.Fragment,{key:0},[x.selectedSubcategory!==null?(q.openBlock(),q.createElementBlock(q.Fragment,{key:0},[q.createVNode(M,{data:D.selectedSubcategoryData[0].subCategory,"selected-sub-category":x.selectedSubcategory},null,8,["data","selected-sub-category"]),q.createVNode(Y)],64)):(q.openBlock(!0),q.createElementBlock(q.Fragment,{key:1},q.renderList(D.filtersWithLocations,be=>(q.openBlock(),q.createBlock(X,{key:be.id,"category-name":be.label,type:be.id,"has-sub-cat":D.subCatExists(be)},null,8,["category-name","type","has-sub-cat"]))),128)),x.panelMessage!==null?(q.openBlock(),q.createElementBlock("div",D2,[q.createElementVNode("p",null,q.toDisplayString(x.panelMessage),1)])):q.createCommentVNode("",!0)],64)):q.createCommentVNode("",!0),x.currentStage===1?(q.openBlock(),q.createElementBlock(q.Fragment,{key:1},[x.selectedSubcategory!==null?(q.openBlock(),q.createElementBlock(q.Fragment,{key:0},[q.createElementVNode("div",R2,[(q.openBlock(!0),q.createElementBlock(q.Fragment,null,q.renderList(x.subcategoryLocations,(be,De)=>(q.openBlock(),q.createBlock(ae,{key:be.id,"item-data":be,"from-endpoint":!0,focussed:De===x.currentListItemFocus,onShowItemDetail:Ze=>y.showDetail(be)},null,8,["item-data","focussed","onShowItemDetail"]))),128)),D.showLoadMore?(q.openBlock(),q.createBlock(u,{key:0,class:"vs-map-with-sidebar-panel__load-more","data-test":"vs-map-with-sidebar-panel__load-more",onClick:_[0]||(_[0]=be=>D.loadMorePlaces()),onKeyup:_[1]||(_[1]=q.withKeys(be=>D.loadMorePlaces(),["enter"]))},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"load-more-text")]),_:3})):q.createCommentVNode("",!0)]),q.createVNode(J,{"content-data":{},"filter-count":y.subCatFilterCount,onClearFilters:D.clearSubCatFilters},null,8,["filter-count","onClearFilters"])],64)):(q.openBlock(!0),q.createElementBlock(q.Fragment,{key:1},q.renderList(D.currentData,be=>(q.openBlock(),q.createElementBlock("div",{key:be.id},[typeof be.properties<"u"&&be.properties.category.id===x.selectedCategory?(q.openBlock(),q.createBlock(ae,{key:0,"item-data":be,onShowItemDetail:De=>y.showDetail(be)},null,8,["item-data","onShowItemDetail"])):q.createCommentVNode("",!0)]))),128))],64)):q.createCommentVNode("",!0),x.currentStage===2?(q.openBlock(),q.createElementBlock(q.Fragment,{key:2},[q.createVNode(Se,{"heading-level":D.detailHeadingLevel,"content-data":D.currentPlaceData[0]},null,8,["heading-level","content-data"]),q.createVNode(J,{"content-data":D.currentPlaceData[0]},null,8,["content-data"])],64)):q.createCommentVNode("",!0),x.panelStatus!==null?(q.openBlock(),q.createElementBlock("div",L2,[y.$slots["panel-loading-message"]&&x.panelStatus!=="map-loading"?(q.openBlock(),q.createElementBlock("div",F2,[q.createElementVNode("p",O2,[q.renderSlot(y.$slots,"panel-loading-message")])])):q.createCommentVNode("",!0)])):q.createCommentVNode("",!0)],2)}const q2=wt._export_sfc(P2,[["render",V2]]);let bc=null;const U2={name:"VsMapWithSidebar",status:"prototype",release:"0.0.1",components:{VsContainer:wt.VsContainer,VsRow:wt.VsRow,VsCol:wt.VsCol,VsMap:tb,VsButton:wt.VsButton,VsMapWithSidebarPanel:q2,VsButtonToggleGroup:wt.VsButtonToggleGroup,VsWarning:wt.VsWarning},provide(){return{filters:this.filters,filtersWithLocations:this.filtersWithLocations,placesData:this.placesData,mapId:this.mapId,regions:this.regionsData,clearSelectionText:this.clearSelectionText,applyFiltersText:this.applyFiltersText,subCatList:this.subCatList,filtersAppliedText:this.filtersAppliedText,clearFiltersText:this.clearFiltersText,focussedListItem:this.focussedListItem}},props:{categoryHeading:{type:String,default:""},filters:{type:Array,required:!0},placesData:{type:Array,required:!0},mapId:{type:String,required:!0},mainHeadingExists:{type:Boolean,default:!1},initialSelected:{type:String,default:""},toggleData:{type:Array,default:()=>[]},buttonsLabel:{type:String,default:""},clearSelectionText:{type:String,required:!0},applyFiltersText:{type:String,required:!0},detailsEndpoint:{type:String,default:""},regionBounds:{type:Object,default:()=>{}},clearFiltersText:{type:String,required:!0},filtersAppliedText:{type:String,required:!0},placeId:{type:String,default:null},mapFilterMessage:{type:String,required:!0},mapNoResultsMessage:{type:String,required:!0},panelMessage:{type:String,default:null},loadBrandingImmediately:{type:Boolean,default:!1}},data(){return{panelVisible:!1,selectedCategory:"",filterCategories:this.filters,selectedItem:null,activePins:this.placesData,currentlyHovered:"",showRegions:!1,regions:[],subCatList:null,selectedToggle:"",currentEndpointData:[],mapStatus:"",panelStatus:"map-loading",mapReady:!1,showPanelMessage:null,currentPanelEndpointFilters:"",totalEndpointPins:0,focussedListItem:0,resetZoom:!1,currentStage:0,selectedSubCategory:null}},computed:{mapDisplayClass(){return this.panelVisible?"d-none d-lg-block":""},panelDisplayClass(){return this.panelVisible?"":"d-none d-lg-block"},regionsData(){return this.placesData.filter(y=>y.geometry.type==="Polygon"||y.geometry.type==="MultiPolygon")},...pa.mapState(Sn,{subCatActiveFilters(y){return y.activeSubcatFilters}}),infoMessage(){let y="";switch(this.mapStatus){case"no-results":y=this.mapNoResultsMessage;break;case"filter-results":y=this.mapFilterMessage;break}return y},existingCategories(){return this.placesData?[...new Set(this.placesData.map(y=>y.properties.category.id))]:[]},filtersWithLocations(){return this.filters.filter(y=>!!(this.existingCategories.includes(y.id)||y.subCategory&&y.subCategory.length))},togglesWithLocations(){return this.existingCategories.indexOf("vics")===-1?this.toggleData.filter(y=>y.value!=="icentres"):this.toggleData}},watch:{selectedSubCategory(y){y===null&&(this.mapStatus="",this.resetZoom=!0)}},mounted(){bc=Sn(),this.selectedToggle=this.initialSelected,this.emitter&&this.emitter.on("clearSelectedSubcats",()=>{this.resetZoom=!0})},methods:{openMenu(){this.setStage(0),this.openPanel()},closePanel(){this.panelVisible=!1},openPanel(){this.panelVisible=!0},showDetail(y){document.fullscreenElement&&document.exitFullscreen(),this.selectedItem=y,this.setStage(2),this.openPanel(),this.selectedSubCategory===null&&this.filterPlaces(this.selectedCategory)},setCategory(y){this.selectedCategory=y,this.selectedSubCategory===null&&this.filterPlaces(y)},setSubCategory(y){bc.setSelectedSubcat(y),this.selectedSubCategory=y,y!==null?(this.getSubcatMarkerData(),this.selectedCategory=y):(bc.setActiveSubcatFilters([]),this.showAllPlaces())},filterSubCategories(y){let _="";y.forEach(x=>{const k=`&cat=${x}`;_+=k}),this.currentPanelEndpointFilters=_,this.getSubcatMarkerData(_),this.getSubcatPanelData(_,0)},getSubcatMarkerData(y){const _=this.filters.filter(x=>x.id===this.selectedSubCategory);if(_.length>0){let x=_[0].pinsEndpoint;typeof y<"u"&&(x+=y),this.activePins=[],typeof y>"u"?(this.activePins=[],this.mapStatus="filter-results"):wt.axios.get(x).then(k=>{this.totalEndpointPins=k.data.features.length,this.totalEndpointPins===0?this.mapStatus="no-results":(k.data.features.forEach(E=>{const D=E;D.properties.apiData=!0,this.activePins.push(D)}),this.mapStatus="")})}},getSubcatPanelData(y,_){let k=this.filters.filter(E=>E.id===this.selectedSubCategory)[0].listProductsEndPoint;typeof y<"u"&&(k+=y),_!==0&&(k+=`${y}&page=${_}`),this.panelStatus="loading-data",wt.axios.get(k).then(E=>{typeof E.data.data.products<"u"?(this.setStage(1),_===0?(this.subCatList=E.data.data.products,this.focussedListItem=0):(this.focussedListItem=_*24,this.subCatList=this.subCatList.concat(E.data.data.products))):this.mapStatus="no-results",this.panelStatus=null})},setStage(y){if(y===2&&this.detailsEndpoint!==""&&this.selectedSubCategory!==null){const _=`${this.detailsEndpoint}${this.selectedItem.properties.id}`;wt.axios.get(_).then(x=>{const k=[];k.push(x.data.data),this.currentEndpointData=k,this.currentStage=y})}else this.currentStage=y,this.currentStage===0?(this.currentEndpointData=[],this.selectedSubCategory===null?(this.resetZoom=!0,this.showAllPlaces(),this.mapStatus=""):this.getSubcatMarkerData(),this.selectedToggle="places"):this.currentStage===1&&this.selectedSubCategory===null&&this.filterPlaces(this.selectedCategory);y!==2&&(bc.setActivePlace({mapId:this.mapId,activeFeature:""}),this.selectedItem=null)},filterPlaces(y){if(y==="regions")this.showRegions=!0,this.activePins=[],this.selectedToggle="regions";else{this.showRegions=!1,this.selectedToggle="places";const _=this.placesData.filter(x=>typeof x.properties<"u"?x.properties.category.id===y:!1);this.activePins=_}},loadMorePlaces(y){this.getSubcatPanelData(this.currentPanelEndpointFilters,y)},showAllPlaces(){this.activePins=this.placesData,this.showRegions=!1},onToggleChanged(y){y==="regions"?(this.setCategory("regions"),this.setStage(1)):y==="icentres"?(this.setCategory("vics"),this.setStage(1)):y==="places-regional"?(this.setCategory("twnv"),this.setStage(1)):(this.showAllPlaces(),this.setStage(0))},setMapReady(y){this.mapReady=y,y?this.panelStatus=null:this.panelStatus="loading"},categoryHasData(y){return this.existingCategories.indexOf(y)!==-1}}};function N2(y,_,x,k,E,D){const u=q.resolveComponent("VsMapWithSidebarPanel"),U=q.resolveComponent("VsButton"),M=q.resolveComponent("VsMap"),Y=q.resolveComponent("VsButtonToggleGroup"),X=q.resolveComponent("VsWarning"),ae=q.resolveComponent("VsCol"),J=q.resolveComponent("VsRow"),Se=q.resolveComponent("VsContainer");return q.openBlock(),q.createBlock(Se,{"data-test":"vs-map-with-sidebar"},{default:q.withCtx(()=>[q.createVNode(J,null,{default:q.withCtx(()=>[q.createVNode(ae,null,{default:q.withCtx(()=>[q.createElementVNode("div",{class:"vs-map-with-sidebar",ref:x.mapId},[q.createElementVNode("div",{class:q.normalizeClass(["vs-map-with-sidebar__side-panel",D.panelDisplayClass]),"data-test":"vs-map-with-sidebar__side-panel"},[q.createVNode(u,{"category-heading":x.categoryHeading,"selected-category":E.selectedCategory,"selected-subcategory":E.selectedSubCategory,"current-stage":E.currentStage,"selected-item":E.selectedItem,"heading-level":x.mainHeadingExists?"3":"2","subcategory-locations":E.subCatList,"current-endpoint-data":E.currentEndpointData,"panel-status":E.panelStatus,"panel-message":E.currentStage===0?x.panelMessage:null,"total-pins":E.totalEndpointPins,"current-list-item-focus":E.focussedListItem,onSetCategory:D.setCategory,onSetSubcategory:D.setSubCategory,onSubcategoriesFiltered:D.filterSubCategories,onSetStage:D.setStage,onClosePanel:D.closePanel,onShowItemDetail:D.showDetail,onFilterPlaces:D.filterPlaces,onLoadMorePlaces:D.loadMorePlaces},{closePanelText:q.withCtx(()=>[q.renderSlot(y.$slots,"close-side-panel-text")]),"reset-side-panel-text":q.withCtx(()=>[q.renderSlot(y.$slots,"reset-side-panel-text")]),"menu-btn-text":q.withCtx(()=>[q.renderSlot(y.$slots,"menu-btn-text")]),"panel-loading-message":q.withCtx(()=>[q.renderSlot(y.$slots,"panel-loading-message")]),"load-more-text":q.withCtx(()=>[q.renderSlot(y.$slots,"load-more-text")]),_:3},8,["category-heading","selected-category","selected-subcategory","current-stage","selected-item","heading-level","subcategory-locations","current-endpoint-data","panel-status","panel-message","total-pins","current-list-item-focus","onSetCategory","onSetSubcategory","onSubcategoriesFiltered","onSetStage","onClosePanel","onShowItemDetail","onFilterPlaces","onLoadMorePlaces"])],2),q.createElementVNode("div",{class:q.normalizeClass(["vs-map-with-sidebar__map",D.mapDisplayClass])},[q.createVNode(U,{class:"vs-map-with-sidebar__map-toggle",icon:"vs-icon-control-menu",size:"sm",onClick:D.openMenu,"data-test":"vs-map-with-sidebar__map-toggle",variant:"secondary"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"open-side-panel-text")]),_:3},8,["onClick"]),q.createVNode(M,{"is-visible":!E.panelVisible,labels:{},filters:D.filtersWithLocations,places:E.activePins,"selected-item":E.selectedItem,"map-id":x.mapId,"show-polygons":E.showRegions,"show-info-message":E.mapStatus!=="",onShowDetail:D.showDetail,onSetCategory:D.setCategory,onMapReady:D.setMapReady,onZoomReset:_[0]||(_[0]=be=>E.resetZoom=!1),"bounds-data":x.regionBounds,"reset-zoom":E.resetZoom,"show-marker-popups":!1,"load-branding-immediately":x.loadBrandingImmediately},{"map-loading-text":q.withCtx(()=>[q.renderSlot(y.$slots,"map-loading-text")]),"info-message":q.withCtx(()=>[q.createTextVNode(q.toDisplayString(D.infoMessage),1)]),"zoom-too-close":q.withCtx(()=>[q.renderSlot(y.$slots,"zoom-too-close")]),"zoom-too-far":q.withCtx(()=>[q.renderSlot(y.$slots,"zoom-too-far")]),"no-js":q.withCtx(()=>[q.renderSlot(y.$slots,"no-js")]),_:3},8,["is-visible","filters","places","selected-item","map-id","show-polygons","show-info-message","onShowDetail","onSetCategory","onMapReady","bounds-data","reset-zoom","load-branding-immediately"]),D.togglesWithLocations.length>1?(q.openBlock(),q.createBlock(Y,{key:0,"data-test":"vs-map-with-sidebar__map-toggle-group","initial-selected":E.selectedToggle,options:D.togglesWithLocations,"buttons-label":x.buttonsLabel,onToggleChanged:D.onToggleChanged},null,8,["initial-selected","options","buttons-label","onToggleChanged"])):q.createCommentVNode("",!0)],2)],512),q.createVNode(X,{class:"vs-map-with-sidebar__no-js"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"no-js")]),_:3})]),_:3})]),_:3})]),_:3})}const j2=wt._export_sfc(U2,[["render",N2]]);exports.VsMap=tb;exports.VsMapMarker=eb;exports.VsMapMarkerIcon=Ec;exports.VsMapWithSidebar=j2;