import{r as Yr,w as Nh,u as Ve,g as hr,i as Lr,j as Ct,o as F_,f as O_,k as dc,t as Dr,x as $i,p as mo,q as Da,y as U_,M as j_,B as N_,v as mc,l as Jm,F as V_,n as G_,A as $_}from"./runtime-dom.esm-bundler-b86dec10.js";import{a as Qm}from"./axios-a342f982.js";import{_ as Vh}from"./_plugin-vue_export-helper-c27b6911.js";import{A as ef}from"./arrow-down-icon-70d67001.js";import{_ as Zr}from"./helpers-ef17e989.js";import{c as q_,g as Z_}from"./_commonjsHelpers-de833af9.js";import{h as X_,S as W_}from"./transition-b36bc189.js";var tf;const Y_=typeof window<"u",rf=()=>{};Y_&&((tf=window==null?void 0:window.navigator)!=null&&tf.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function of(zt){return typeof zt=="function"?zt():Ve(zt)}function H_(zt,Vt){function xt(...Pt){return new Promise((Ht,Qt)=>{Promise.resolve(zt(()=>Vt.apply(this,Pt),{fn:Vt,thisArg:this,args:Pt})).then(Ht).catch(Qt)})}return xt}function K_(zt,Vt={}){let xt,Pt,Ht=rf;const Qt=s=>{clearTimeout(s),Ht(),Ht=rf};return s=>{const ve=of(zt),yt=of(Vt.maxWait);return xt&&Qt(xt),ve<=0||yt!==void 0&&yt<=0?(Pt&&(Qt(Pt),Pt=null),Promise.resolve(s())):new Promise((Xt,He)=>{Ht=Vt.rejectOnCancel?He:Xt,yt&&!Pt&&(Pt=setTimeout(()=>{xt&&Qt(xt),Pt=null,Xt(s())},yt)),xt=setTimeout(()=>{Pt&&Qt(Pt),Pt=null,Xt(s())},ve)})}}function J_(zt,Vt=200,xt={}){return H_(K_(Vt,xt),zt)}function Q_(zt,Vt=200,xt={}){const Pt=Yr(zt.value),Ht=J_(()=>{Pt.value=zt.value},Vt,xt);return Nh(zt,()=>Ht()),Pt}const ey={},ty={id:"Livello_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 21 24"},ry=Ct("path",{d:"m20.88,23.2h0s-.01-.02-.01-.02c0,0,0-.01-.01-.02l-5.89-7c2.2-1.8,3.44-4.26,3.44-7.06C18.4,4.1,14.3,0,9.2,0S0,4.1,0,9.1s4.1,9.1,9.2,9.1c1.8,0,3.55-.45,4.95-1.45l5.87,6.95.11.12c.09.11.24.19.39.19.27,0,.49-.22.49-.49,0-.12-.05-.23-.12-.32Zm-11.68-5.9c-4.5,0-8.2-3.7-8.2-8.2S4.7,1,9.2,1s8.2,3.7,8.2,8.1-3.7,8.2-8.2,8.2Z"},null,-1),iy=[ry];function oy(zt,Vt){return hr(),Lr("svg",ty,iy)}const ny=Vh(ey,[["render",oy]]),ay={},sy={id:"Livello_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 12"},ly=Ct("path",{d:"m23.44,12.02c-.16,0-.31-.06-.43-.17L12.31,1.3.98,11.86c-.22.21-.59.21-.82.01-.23-.2-.24-.53-.01-.74L11.9.18c.11-.1.26-.16.42-.16h0c.16,0,.31.06.42.17l11.11,10.95c.22.21.2.54-.04.74-.11.09-.25.14-.39.14"},null,-1),cy=[ly];function hy(zt,Vt){return hr(),Lr("svg",sy,cy)}const uy=Vh(ay,[["render",hy]]),af=(zt,Vt)=>{const xt=function(yt){return zt[yt]??""},Pt=function(){const yt=zt.commercial_email??xt("email");return yt?`
        <div class="flex items-center gap-2">
            <div class="rounded-full w-4 h-4 bg-gray-300"></div>
            <a data-gtm="dealers_dealer_mail" href="mailto:${yt}" class="text-xs">${yt}</a>
        </div>
        `:""},Ht=function(){return xt("phone")?`
        <div class="flex items-center gap-2">
            <div class="rounded-full w-4 h-4 bg-gray-300"></div>
            <a data-gtm="dealers_dealer_phone" href="tel:${xt("phone")}" class="text-xs">${xt("phone")}</a>
        </div>
        `:""},Qt=function(){return Vt.display_fax_numbers&&xt("fax")?`
        <div class="flex items-center gap-2">
            <div class="rounded-full w-4 h-4 bg-gray-300"></div>
            <a data-gtm="dealers_dealer_fax" href="fax:${xt("fax")}" class="text-xs">${xt("fax")}</a>
        </div>
        `:""},Pi=function(){let yt=xt("homepage");return yt?(yt=yt.startsWith("http")?yt:"https://"+yt,`
        <div class="flex items-center gap-2">
            <div class="rounded-full w-4 h-4 bg-gray-300"></div>
            <a data-gtm="dealers_dealer_homepage" href="${yt}" class="text-xs">${xt("homepage")}</a>
        </div>
        `):""},s=function(){let yt=xt("model_stock_status");if(yt){let Xt="bg-green-500";return yt==="coming_soon"&&(Xt="bg-yellow-500"),`
        <div class="flex items-center gap-2">
            <div class="rounded-full w-4 h-4 ${Xt}"></div>
            <span class="text-xs">${xt("model_stock_status_title")}</span>
        </div>
        `}return""},ve=function(){var yt,Xt,He,Je;return(yt=zt.contact_your_dealer)!=null&&yt.url?`
        <div class="mb-4">
            <a href="${(Xt=zt.contact_your_dealer)==null?void 0:Xt.url}"
              target="${(He=zt.contact_your_dealer)==null?void 0:He.target}"
              data-gtm="dealers_dealer_contact_your_dealer"
              class="bg-black hover:bg-gray-900 rounded-lg text-white flex justify-center items-center text-center px-4 py-3
              uppercase tracking-widest text-12 font-bold ${Vt.width??"w-full"}">
              ${(Je=zt.contact_your_dealer)==null?void 0:Je.title}
            </a>
        </div>
      `:""};return`
        <div class="space-y-4 py-4 xl:py-8 cursor-pointer">
            <h3 class="font-bold">${xt("name")}</h3>
            ${s()}
            <div class="grid grid-cols-1 xl:grid-cols-2 gap-4 xl:gap-2">
              <div class="text-xs text-gray-600">
                ${xt("street")}, ${xt("post_code")} ${xt("city")}
              </div>
              <div class="flex flex-wrap gap-4">
                ${Pt()}
                ${Ht()}
                ${Qt()}
                ${Pi()}
              </div>
            </div>
            ${ve()}
        </div>
    `},py=["data-gtm-value","innerHTML"],dy={__name:"dealer",props:{dealer:{type:Object,required:!0},display_fax_numbers:{type:Boolean,default:!1}},setup(zt){const Vt=zt;let xt=af(Vt.dealer,{display_fax_numbers:Vt.display_fax_numbers,width:"w-96"});return(Pt,Ht)=>(hr(),Lr("div",null,[Ct("div",{"data-gtm":"dealers_dealer","data-gtm-value":zt.dealer.id,onClick:Ht[0]||(Ht[0]=Qt=>Pt.$emit("clickContent",!0)),innerHTML:Ve(xt)},null,8,py)]))}};var sf={exports:{}};(function(zt,Vt){(function(xt,Pt){zt.exports=Pt()})(q_,function(){var xt,Pt,Ht;function Qt(s,ve){if(!xt)xt=ve;else if(!Pt)Pt=ve;else{var yt="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+xt+")(sharedChunk); ("+Pt+")(sharedChunk); self.onerror = null;",Xt={};xt(Xt),Ht=ve(Xt),typeof window<"u"&&window&&window.URL&&window.URL.createObjectURL&&(Ht.workerUrl=window.URL.createObjectURL(new Blob([yt],{type:"text/javascript"})))}}Qt(["exports"],function(s){var ve=typeof self<"u"?self:{},yt="2.15.0";let Xt;const He={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(Xt==null){const t=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{Xt={}.API_URL_REGEX!=null?new RegExp({}.API_URL_REGEX):t}catch{Xt=t}}return Xt},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!He.API_URL)return null;try{const t=new URL(He.API_URL);return t.hostname==="api.mapbox.cn"?"https://events.mapbox.cn/events/v2":t.hostname==="api.mapbox.com"?"https://events.mapbox.com/events/v2":null}catch{return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Je={supported:!1,testSupport:function(t){!kr&&er&&(Dt?Ei(t):vt=t)}};let vt,er,kr=!1,Dt=!1;function Ei(t){const e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,er),t.isContextLost())return;Je.supported=!0}catch{}t.deleteTexture(e),kr=!0}ve.document&&(er=ve.document.createElement("img"),er.onload=function(){vt&&Ei(vt),vt=null,Dt=!0},er.onerror=function(){kr=!0,vt=null},er.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const ki="01";function ai(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var fo=Ur;function Ur(t,e,r,o){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(o-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=r,this.p2y=o}Ur.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(e===void 0&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var r=t,o=0;o<8;o++){var a=this.sampleCurveX(r)-t;if(Math.abs(a)<e)return r;var c=this.sampleCurveDerivativeX(r);if(Math.abs(c)<1e-6)break;r-=a/c}var u=0,d=1;for(r=t,o=0;o<20&&(a=this.sampleCurveX(r),!(Math.abs(a-t)<e));o++)t>a?u=r:d=r,r=.5*(d-u)+u;return r},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var Rr=ai(fo),jr=br;function br(t,e){this.x=t,this.y=e}br.prototype={clone:function(){return new br(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),o=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=o,this},_rotateAround:function(t,e){var r=Math.cos(t),o=Math.sin(t),a=e.y+o*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-o*(this.y-e.y),this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},br.convert=function(t){return t instanceof br?t:Array.isArray(t)?new br(t[0],t[1]):t};var De=ai(jr);const Un=Math.PI/180,jn=180/Math.PI;function lt(t){return t*Un}function Ke(t){return t*jn}const Ge=[[0,0],[1,0],[1,1],[0,1]];function wt(t){if(t<=0)return 0;if(t>=1)return 1;const e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function Hr(t,e,r,o){const a=new Rr(t,e,r,o);return function(c){return a.solve(c)}}const Sr=Hr(.25,.1,.25,1);function it(t,e,r){return Math.min(r,Math.max(e,t))}function pi(t,e,r){return(r=it((r-t)/(e-t),0,1))*r*(3-2*r)}function tr(t,e,r){const o=r-e,a=((t-e)%o+o)%o+e;return a===e?r:a}function rr(t,e,r){if(!t.length)return r(null,[]);let o=t.length;const a=new Array(t.length);let c=null;t.forEach((u,d)=>{e(u,(f,g)=>{f&&(c=f),a[d]=g,--o==0&&r(c,a)})})}function Kr(t){const e=[];for(const r in t)e.push(t[r]);return e}function sr(t,...e){for(const r of e)for(const o in r)t[o]=r[o];return t}let go=1;function tn(){return go++}function _o(){return function t(e){return e?(e^Math.random()*(16>>e/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function qi(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function La(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function Po(t,e){t.forEach(r=>{e[r]&&(e[r]=e[r].bind(e))})}function rn(t,e){return t.indexOf(e,t.length-e.length)!==-1}function gt(t,e,r){const o={};for(const a in t)o[a]=e.call(r||this,t[a],a,t);return o}function on(t,e,r){const o={};for(const a in t)e.call(r||this,t[a],a,t)&&(o[a]=t[a]);return o}function si(t){return Array.isArray(t)?t.map(si):typeof t=="object"&&t?gt(t,si):t}const Nn={};function ir(t){Nn[t]||(typeof console<"u"&&console.warn(t),Nn[t]=!0)}function di(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function Ra(t){let e=0;for(let r,o,a=0,c=t.length,u=c-1;a<c;u=a++)r=t[a],o=t[u],e+=(o.x-r.x)*(r.y+o.y);return e}function Zi(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function li(t){const e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(r,o,a,c)=>{const u=a||c;return e[o]=!u||u.toLowerCase(),""}),e["max-age"]){const r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}let Vn=null;function nn(t){if(Vn==null){const e=t.navigator?t.navigator.userAgent:null;Vn=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return Vn}function Gn(t){try{const e=ve[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch{return!1}}function yo(t,e){return[t[4*e],t[4*e+1],t[4*e+2],t[4*e+3]]}const an="mapbox-tiles";let Ba=500,Fa=50,mi,xo;function $n(){try{return ve.caches}catch{}}function Do(){$n()&&!mi&&(mi=ve.caches.open(an))}function sn(t){const e=t.indexOf("?");if(e<0)return t;const r=function(a){const c=a.indexOf("?");return c>0?a.slice(c+1).split("&"):[]}(t),o=r.filter(a=>{const c=a.split("=");return c[0]==="language"||c[0]==="worldview"});return o.length?`${t.slice(0,e)}?${o.join("&")}`:t.slice(0,e)}let qn=1/0;const Lo={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(Lo);class vo extends Error{constructor(e,r,o){r===401&&oe(o)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=r,this.url=o}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const Ro=Zi()?()=>self.worker&&self.worker.referrer:()=>(ve.location.protocol==="blob:"?ve.parent:ve).location.href,Bo=function(t,e){if(!(/^file:/.test(r=t.url)||/^file:/.test(Ro())&&!/^\w+:/.test(r))){if(ve.fetch&&ve.Request&&ve.AbortController&&ve.Request.prototype.hasOwnProperty("signal"))return function(o,a){const c=new ve.AbortController,u=new ve.Request(o.url,{method:o.method||"GET",body:o.body,credentials:o.credentials,headers:o.headers,referrer:Ro(),referrerPolicy:o.referrerPolicy,signal:c.signal});let d=!1,f=!1;const g=(x=u.url).indexOf("sku=")>0&&oe(x);var x;o.type==="json"&&u.headers.set("Accept","application/json");const w=(k,S,I)=>{if(f)return;if(k&&k.message!=="SecurityError"&&ir(k.toString()),S&&I)return b(S);const D=Date.now();ve.fetch(u).then(U=>{if(U.ok){const Z=g?U.clone():null;return b(U,Z,D)}return a(new vo(U.statusText,U.status,o.url))}).catch(U=>{U.name!=="AbortError"&&a(new Error(`${U.message} ${o.url}`))})},b=(k,S,I)=>{(o.type==="arrayBuffer"?k.arrayBuffer():o.type==="json"?k.json():k.text()).then(D=>{f||(S&&I&&function(U,Z,j){if(Do(),!mi)return;const $={status:Z.status,statusText:Z.statusText,headers:new ve.Headers};Z.headers.forEach((ce,ae)=>$.headers.set(ae,ce));const W=li(Z.headers.get("Cache-Control")||"");if(W["no-store"])return;W["max-age"]&&$.headers.set("Expires",new Date(j+1e3*W["max-age"]).toUTCString());const X=$.headers.get("Expires");X&&(new Date(X).getTime()-j<42e4||function(ce,ae){if(xo===void 0)try{new Response(new ReadableStream),xo=!0}catch{xo=!1}xo?ae(ce.body):ce.blob().then(ae)}(Z,ce=>{const ae=new ve.Response(ce,$);Do(),mi&&mi.then(fe=>fe.put(sn(U.url),ae)).catch(fe=>ir(fe.message))}))}(u,S,I),d=!0,a(null,D,k.headers.get("Cache-Control"),k.headers.get("Expires")))}).catch(D=>{f||a(new Error(D.message))})};return g?function(k,S){if(Do(),!mi)return S(null);const I=sn(k.url);mi.then(D=>{D.match(I).then(U=>{const Z=function(j){if(!j)return!1;const $=new Date(j.headers.get("Expires")||0),W=li(j.headers.get("Cache-Control")||"");return $>Date.now()&&!W["no-cache"]}(U);D.delete(I),Z&&D.put(I,U.clone()),S(null,U,Z)}).catch(S)}).catch(S)}(u,w):w(null,null),{cancel:()=>{f=!0,d||c.abort()}}}(t,e);if(Zi()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(o,a){const c=new ve.XMLHttpRequest;c.open(o.method||"GET",o.url,!0),o.type==="arrayBuffer"&&(c.responseType="arraybuffer");for(const u in o.headers)c.setRequestHeader(u,o.headers[u]);return o.type==="json"&&(c.responseType="text",c.setRequestHeader("Accept","application/json")),c.withCredentials=o.credentials==="include",c.onerror=()=>{a(new Error(c.statusText))},c.onload=()=>{if((c.status>=200&&c.status<300||c.status===0)&&c.response!==null){let u=c.response;if(o.type==="json")try{u=JSON.parse(c.response)}catch(d){return a(d)}a(null,u,c.getResponseHeader("Cache-Control"),c.getResponseHeader("Expires"))}else a(new vo(c.statusText,c.status,o.url))},c.send(o.body),{cancel:()=>c.abort()}}(t,e)},ln=function(t,e){return Bo(sr(t,{type:"arrayBuffer"}),e)};function Oa(t){const e=ve.document.createElement("a");return e.href=t,e.protocol===ve.document.location.protocol&&e.host===ve.document.location.host}const q="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let C,z;C=[],z=0;const G=function(t,e){if(Je.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),z>=He.MAX_PARALLEL_IMAGE_REQUESTS){const c={requestParameters:t,callback:e,cancelled:!1,cancel(){this.cancelled=!0}};return C.push(c),c}z++;let r=!1;const o=()=>{if(!r)for(r=!0,z--;C.length&&z<He.MAX_PARALLEL_IMAGE_REQUESTS;){const c=C.shift(),{requestParameters:u,callback:d,cancelled:f}=c;f||(c.cancel=G(u,d).cancel)}},a=ln(t,(c,u,d,f)=>{o(),c?e(c):u&&(ve.createImageBitmap?function(g,x){const w=new ve.Blob([new Uint8Array(g)],{type:"image/png"});ve.createImageBitmap(w).then(b=>{x(null,b)}).catch(b=>{x(new Error(`Could not load image because of ${b.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(u,(g,x)=>e(g,x,d,f)):function(g,x){const w=new ve.Image,b=ve.URL;w.onload=()=>{x(null,w),b.revokeObjectURL(w.src),w.onload=null,ve.requestAnimationFrame(()=>{w.src=q})},w.onerror=()=>x(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const k=new ve.Blob([new Uint8Array(g)],{type:"image/png"});w.src=g.byteLength?b.createObjectURL(k):q}(u,(g,x)=>e(g,x,d,f)))});return{cancel:()=>{a.cancel(),o()}}},Y="NO_ACCESS_TOKEN";function ee(t){return t.indexOf("mapbox:")===0}function oe(t){return He.API_URL_REGEX.test(t)}function ie(t){return He.API_CDN_URL_REGEX.test(t)}function Q(t){return He.API_STYLE_REGEX.test(t)&&!pe(t)}function pe(t){return He.API_SPRITE_REGEX.test(t)}const ze=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Pe(t){const e=t.match(ze);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function Ae(t){const e=t.params.length?`?${t.params.join("&")}`:"";return`${t.protocol}://${t.authority}${t.path}${e}`}const ot="mapbox.eventData";function ct(t){if(!t)return null;const e=t.split(".");if(!e||e.length!==3)return null;try{return JSON.parse(decodeURIComponent(ve.atob(e[1]).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join("")))}catch{return null}}class nt{constructor(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(e){const r=ct(He.ACCESS_TOKEN);let o="";return o=r&&r.u?ve.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(a,c)=>String.fromCharCode(+("0x"+c)))):He.ACCESS_TOKEN||"",e?`${ot}.${e}:${o}`:`${ot}:${o}`}fetchEventData(){const e=Gn("localStorage"),r=this.getStorageKey(),o=this.getStorageKey("uuid");if(e)try{const a=ve.localStorage.getItem(r);a&&(this.eventData=JSON.parse(a));const c=ve.localStorage.getItem(o);c&&(this.anonId=c)}catch{ir("Unable to read from LocalStorage")}}saveEventData(){const e=Gn("localStorage"),r=this.getStorageKey(),o=this.getStorageKey("uuid");if(e)try{ve.localStorage.setItem(o,this.anonId),Object.keys(this.eventData).length>=1&&ve.localStorage.setItem(r,JSON.stringify(this.eventData))}catch{ir("Unable to write to LocalStorage")}}processRequests(e){}postEvent(e,r,o,a){if(!He.EVENTS_URL)return;const c=Pe(He.EVENTS_URL);c.params.push(`access_token=${a||He.ACCESS_TOKEN||""}`);const u={event:this.type,created:new Date(e).toISOString()},d=r?sr(u,r):u,f={url:Ae(c),headers:{"Content-Type":"text/plain"},body:JSON.stringify([d])};this.pendingRequest=function(g,x){return Bo(sr(g,{method:"POST"}),x)}(f,g=>{this.pendingRequest=null,o(g),this.saveEventData(),this.processRequests(a)})}queueRequest(e,r){this.queue.push(e),this.processRequests(r)}}const ht=new class extends nt{constructor(t){super("appUserTurnstile"),this._customAccessToken=t}postTurnstileEvent(t,e){He.EVENTS_URL&&He.ACCESS_TOKEN&&Array.isArray(t)&&t.some(r=>ee(r)||oe(r))&&this.queueRequest(Date.now(),e)}processRequests(t){if(this.pendingRequest||this.queue.length===0)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const e=ct(He.ACCESS_TOKEN),r=e?e.u:He.ACCESS_TOKEN;let o=r!==this.eventData.tokenU;La(this.anonId)||(this.anonId=_o(),o=!0);const a=this.queue.shift();if(this.eventData.lastSuccess){const c=new Date(this.eventData.lastSuccess),u=new Date(a),d=(a-this.eventData.lastSuccess)/864e5;o=o||d>=1||d<-1||c.getDate()!==u.getDate()}else o=!0;o?this.postEvent(a,{sdkIdentifier:"mapbox-gl-js",sdkVersion:yt,skuId:ki,"enabled.telemetry":!1,userId:this.anonId},c=>{c||(this.eventData.lastSuccess=a,this.eventData.tokenU=r)},t):this.processRequests()}},_t=ht.postTurnstileEvent.bind(ht),or=new class extends nt{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(t,e,r,o){this.skuToken=e,this.errorCb=o,He.EVENTS_URL&&(r||He.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},r):this.errorCb(new Error(Y)))}processRequests(t){if(this.pendingRequest||this.queue.length===0)return;const{id:e,timestamp:r}=this.queue.shift();e&&this.success[e]||(this.anonId||this.fetchEventData(),La(this.anonId)||(this.anonId=_o()),this.postEvent(r,{sdkIdentifier:"mapbox-gl-js",sdkVersion:yt,skuId:ki,skuToken:this.skuToken,userId:this.anonId},o=>{o?this.errorCb(o):e&&(this.success[e]=!0)},t))}},dr=or.postMapLoadEvent.bind(or),Nr=new class extends nt{constructor(){super("gljs.performance")}postPerformanceEvent(t,e){He.EVENTS_URL&&(t||He.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:e},t)}processRequests(t){if(this.pendingRequest||this.queue.length===0)return;const{timestamp:e,performanceData:r}=this.queue.shift(),o=function(a){const c=ve.performance.getEntriesByType("resource"),u=ve.performance.getEntriesByType("mark"),d=function(b){const k={};if(b){for(const S in b)if(S!=="other")for(const I of b[S]){const D=`${S}ResolveRangeMin`,U=`${S}ResolveRangeMax`,Z=`${S}RequestCount`,j=`${S}RequestCachedCount`;k[D]=Math.min(k[D]||1/0,I.startTime),k[U]=Math.max(k[U]||-1/0,I.responseEnd);const $=W=>{k[W]===void 0&&(k[W]=0),++k[W]};I.transferSize!==void 0&&I.transferSize===0&&$(j),$(Z)}}return k}(function(b,k){const S={};if(b)for(const I of b){const D=k(I);S[D]===void 0&&(S[D]=[]),S[D].push(I)}return S}(c,gc)),f=ve.devicePixelRatio,g=ve.navigator.connection||ve.navigator.mozConnection||ve.navigator.webkitConnection,x={counters:[],metadata:[],attributes:[]},w=(b,k,S)=>{S!=null&&b.push({name:k,value:S.toString()})};for(const b in d)w(x.counters,b,d[b]);if(a.interactionRange[0]!==1/0&&a.interactionRange[1]!==-1/0&&(w(x.counters,"interactionRangeMin",a.interactionRange[0]),w(x.counters,"interactionRangeMax",a.interactionRange[1])),u)for(const b of Object.keys(cn)){const k=cn[b],S=u.find(I=>I.name===k);S&&w(x.counters,k,S.startTime)}return w(x.counters,"visibilityHidden",a.visibilityHidden),w(x.attributes,"style",function(b){if(b)for(const k of b){const S=k.name.split("?")[0];if(Q(S)){const I=S.split("/").slice(-2);if(I.length===2)return`mapbox://styles/${I[0]}/${I[1]}`}}}(c)),w(x.attributes,"terrainEnabled",a.terrainEnabled?"true":"false"),w(x.attributes,"fogEnabled",a.fogEnabled?"true":"false"),w(x.attributes,"projection",a.projection),w(x.attributes,"zoom",a.zoom),w(x.metadata,"devicePixelRatio",f),w(x.metadata,"connectionEffectiveType",g?g.effectiveType:void 0),w(x.metadata,"navigatorUserAgent",ve.navigator.userAgent),w(x.metadata,"screenWidth",ve.screen.width),w(x.metadata,"screenHeight",ve.screen.height),w(x.metadata,"windowWidth",ve.innerWidth),w(x.metadata,"windowHeight",ve.innerHeight),w(x.metadata,"mapWidth",a.width/f),w(x.metadata,"mapHeight",a.height/f),w(x.metadata,"webglRenderer",a.renderer),w(x.metadata,"webglVendor",a.vendor),w(x.metadata,"sdkVersion",yt),w(x.metadata,"sdkIdentifier","mapbox-gl-js"),x}(r);for(const a of o.metadata);for(const a of o.counters);for(const a of o.attributes);this.postEvent(e,o,()=>{},t)}},Tr=Nr.postPerformanceEvent.bind(Nr),Di=new class extends nt{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(t,e,r,o){if(!He.API_URL||!He.SESSION_PATH)return;const a=Pe(He.API_URL+He.SESSION_PATH);a.params.push(`sku=${e||""}`),a.params.push(`access_token=${o||He.ACCESS_TOKEN||""}`);const c={url:Ae(a),headers:{"Content-Type":"text/plain"}};this.pendingRequest=function(u,d){return Bo(sr(u,{method:"GET"}),d)}(c,u=>{this.pendingRequest=null,r(u),this.saveEventData(),this.processRequests(o)})}getSessionAPI(t,e,r,o){this.skuToken=e,this.errorCb=o,He.SESSION_PATH&&He.API_URL&&(r||He.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},r):this.errorCb(new Error(Y)))}processRequests(t){if(this.pendingRequest||this.queue.length===0)return;const{id:e,timestamp:r}=this.queue.shift();e&&this.success[e]||this.getSession(r,this.skuToken,o=>{o?this.errorCb(o):e&&(this.success[e]=!0)},t)}},Mr=Di.getSessionAPI.bind(Di),Xr=new Set,cn={create:"create",load:"load",fullLoad:"fullLoad"},Gh={mark(t){ve.performance.mark(t)},measure(t,e,r){ve.performance.measure(t,e,r)}};function gc(t){const e=t.name.split("?")[0];return ie(e)&&e.includes("mapbox-gl.js")?"javascript":ie(e)&&e.includes("mapbox-gl.css")?"css":function(r){return He.API_FONTS_REGEX.test(r)}(e)?"fontRange":pe(e)?"sprite":Q(e)?"style":function(r){return He.API_TILEJSON_REGEX.test(r)}(e)?"tilejson":"other"}const Mt=ve.performance;function Bs(t){const e=t?t.url.toString():void 0;return Mt.getEntriesByName(e)}let Zn,Fs,Ua,Li;const Xi={now:()=>Ua!==void 0?Ua:ve.performance.now(),setNow(t){Ua=t},restoreNow(){Ua=void 0},frame(t){const e=ve.requestAnimationFrame(t);return{cancel:()=>ve.cancelAnimationFrame(e)}},getImageData(t,e=0){const{width:r,height:o}=t;Li||(Li=ve.document.createElement("canvas"));const a=Li.getContext("2d",{willReadFrequently:!0});if(!a)throw new Error("failed to create canvas 2d context");return(r>Li.width||o>Li.height)&&(Li.width=r,Li.height=o),a.clearRect(-e,-e,r+2*e,o+2*e),a.drawImage(t,0,0,r,o),a.getImageData(-e,-e,r+2*e,o+2*e)},resolveURL:t=>(Zn||(Zn=ve.document.createElement("a")),Zn.href=t,Zn.href),get devicePixelRatio(){return ve.devicePixelRatio},get prefersReducedMotion(){return!!ve.matchMedia&&(Fs==null&&(Fs=ve.matchMedia("(prefers-reduced-motion: reduce)")),Fs.matches)}};function Os(t,e,r){r[t]&&r[t].indexOf(e)!==-1||(r[t]=r[t]||[],r[t].push(e))}function Us(t,e,r){if(r&&r[t]){const o=r[t].indexOf(e);o!==-1&&r[t].splice(o,1)}}class Fo{constructor(e,r={}){sr(this,r),this.type=e}}class Wi extends Fo{constructor(e,r={}){super("error",sr({error:e},r))}}class Xn{on(e,r){return this._listeners=this._listeners||{},Os(e,r,this._listeners),this}off(e,r){return Us(e,r,this._listeners),Us(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},Os(e,r,this._oneTimeListeners),this):new Promise(o=>this.once(e,o))}fire(e,r){typeof e=="string"&&(e=new Fo(e,r||{}));const o=e.type;if(this.listens(o)){e.target=this;const a=this._listeners&&this._listeners[o]?this._listeners[o].slice():[];for(const d of a)d.call(this,e);const c=this._oneTimeListeners&&this._oneTimeListeners[o]?this._oneTimeListeners[o].slice():[];for(const d of c)Us(o,d,this._oneTimeListeners),d.call(this,e);const u=this._eventedParent;u&&(sr(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),u.fire(e))}else e instanceof Wi&&console.error(e.error);return this}listens(e){return!!(this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e))}setEventedParent(e,r){return this._eventedParent=e,this._eventedParentData=r,this}}var me=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8]},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360,"units":"degrees"},"pitch":{"type":"number","default":0,"units":"degrees"},"light":{"type":"light"},"terrain":{"type":"terrain"},"fog":{"type":"fog"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"type":"array","value":"layer"}},"sources":{"*":{"type":"source"}},"source":["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],"source_vector":{"type":{"required":true,"type":"enum","values":{"vector":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"scheme":{"type":"enum","values":{"xyz":{},"tms":{}},"default":"xyz"},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"attribution":{"type":"string"},"promoteId":{"type":"promoteId"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"type":"enum","values":{"raster":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512,"units":"pixels"},"scheme":{"type":"enum","values":{"xyz":{},"tms":{}},"default":"xyz"},"attribution":{"type":"string"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"type":"enum","values":{"raster-dem":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512,"units":"pixels"},"attribution":{"type":"string"},"encoding":{"type":"enum","values":{"terrarium":{},"mapbox":{}},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{}}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{}}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{}}},"url":{"required":true,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"hillshade":{},"background":{},"sky":{}},"required":true},"metadata":{"type":"*"},"source":{"type":"string"},"source-layer":{"type":"string"},"minzoom":{"type":"number","minimum":0,"maximum":24},"maxzoom":{"type":"number","minimum":0,"maximum":24},"filter":{"type":"filter"},"layout":{"type":"layout"},"paint":{"type":"paint"}},"layout":["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_circle":{"circle-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1,"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":{},"round":{},"square":{}},"default":"butt","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":{},"round":{},"miter":{}},"default":"miter","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"requires":[{"line-join":"miter"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"requires":[{"line-join":"round"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":{},"line":{},"line-center":{}},"default":"point","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"units":"pixels","requires":[{"symbol-placement":"line"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":{},"viewport-y":{},"source":{}},"default":"auto","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-size":{"type":"number","default":1,"minimum":0,"units":"factor of the original icon size","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{"type":"enum","values":{"none":{},"width":{},"height":{},"both":{}},"default":"none","requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"units":"pixels","requires":["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{"type":"enum","values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"default":"center","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-font":{"type":"array","value":"string","default":["Open Sans Regular","Arial Unicode MS Regular"],"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":{},"left":{},"center":{},"right":{}},"default":"center","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","units":"ems","default":0,"requires":["text-field"],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["zoom","feature"]}},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-anchor":{"type":"enum","values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"default":"center","requires":["text-field",{"!":"text-variable-anchor"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"units":"degrees","requires":["text-field",{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":{},"vertical":{}},"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":{},"uppercase":{},"lowercase":{}},"default":"none","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-offset":{"type":"array","value":"number","units":"ems","length":2,"default":[0,0],"requires":["text-field",{"!":"text-radial-offset"}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"requires":["text-field","icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},"in":{},"!in":{},"all":{},"any":{},"none":{},"has":{},"!has":{},"within":{}}},"geometry_type":{"type":"enum","values":{"Point":{},"LineString":{},"Polygon":{}}},"function":{"expression":{"type":"expression"},"stops":{"type":"array","value":"function_stop"},"base":{"type":"number","default":1,"minimum":0},"property":{"type":"string","default":"$zoom"},"type":{"type":"enum","values":{"identity":{},"exponential":{},"interval":{},"categorical":{}},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":{},"lab":{},"hcl":{}},"default":"rgb"},"default":{"type":"*","required":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{},"viewport":{}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":{},"equalEarth":{},"equirectangular":{},"lambertConformalConic":{},"mercator":{},"naturalEarth":{},"winkelTripel":{},"globe":{}},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["source"]}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-extrusion-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-extrusion-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"requires":["fill-extrusion-height"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["fill-extrusion-edge-radius"]},"fill-extrusion-rounded-roof":{"type":"boolean","default":true,"requires":["fill-extrusion-edge-radius"],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"line-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["line-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"transition":false,"units":"line widths","requires":[{"!":"line-pattern"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","transition":false,"requires":[{"!":"line-pattern"},{"source":"geojson","has":{"lineMetrics":true}}],"expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"transition":false,"requires":[{"source":"geojson","has":{"lineMetrics":true}}],"property-type":"constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["circle-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"transition":false,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"transition":false,"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["icon-image","icon-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["text-field","text-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"units":"degrees","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":{},"nearest":{}},"default":"linear","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"transition":false,"units":"milliseconds","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"transition":false,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"background-pattern"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{},"atmosphere":{}},"default":"atmosphere","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"transition":false,"requires":[{"sky-type":"gradient"}],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"transition":{"duration":{"type":"number","default":300,"minimum":0,"units":"milliseconds"},"delay":{"type":"number","default":0,"minimum":0,"units":"milliseconds"}},"property-type":{"data-driven":{"type":"property-type"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');function Yi(t,...e){for(const r of e)for(const o in r)t[o]=r[o];return t}function mr(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Ar(t){if(Array.isArray(t))return t.map(Ar);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const r in t)e[r]=Ar(t[r]);return e}return mr(t)}class _c extends Error{constructor(e,r){super(r),this.message=r,this.key=e}}var Ri=_c;class js{constructor(e,r=[]){this.parent=e,this.bindings={};for(const[o,a]of r)this.bindings[o]=a}concat(e){return new js(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}var yc=js;const hn={kind:"null"},Fe={kind:"number"},ft={kind:"string"},pt={kind:"boolean"},ci={kind:"color"},Si={kind:"object"},dt={kind:"value"},hi={kind:"collator"},Wn={kind:"formatted"},Oo={kind:"resolvedImage"};function fi(t,e){return{kind:"array",itemType:t,N:e}}function Kt(t){if(t.kind==="array"){const e=Kt(t.itemType);return typeof t.N=="number"?`array<${e}, ${t.N}>`:t.itemType.kind==="value"?"array":`array<${e}>`}return t.kind}const xc=[hn,Fe,ft,pt,ci,Wn,Si,fi(dt),Oo];function Hi(t,e){if(e.kind==="error")return null;if(t.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Hi(t.itemType,e.itemType))&&(typeof t.N!="number"||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if(t.kind==="value"){for(const r of xc)if(!Hi(r,e))return null}}return`Expected ${Kt(t)} but found ${Kt(e)} instead.`}function Yn(t,e){return e.some(r=>r.kind===t.kind)}function Hn(t,e){return e.some(r=>r==="null"?t===null:r==="array"?Array.isArray(t):r==="object"?t&&!Array.isArray(t)&&typeof t=="object":r===typeof t)}var Ns,vc={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 Kn(t){return(t=Math.round(t))<0?0:t>255?255:t}function Jn(t){return Kn(t[t.length-1]==="%"?parseFloat(t)/100*255:parseInt(t))}function ja(t){return(e=t[t.length-1]==="%"?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function un(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{Ns={}.parseCSSColor=function(t){var e,r=t.replace(/ /g,"").toLowerCase();if(r in vc)return vc[r].slice();if(r[0]==="#")return r.length===4?(e=parseInt(r.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:r.length===7&&(e=parseInt(r.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var o=r.indexOf("("),a=r.indexOf(")");if(o!==-1&&a+1===r.length){var c=r.substr(0,o),u=r.substr(o+1,a-(o+1)).split(","),d=1;switch(c){case"rgba":if(u.length!==4)return null;d=ja(u.pop());case"rgb":return u.length!==3?null:[Jn(u[0]),Jn(u[1]),Jn(u[2]),d];case"hsla":if(u.length!==4)return null;d=ja(u.pop());case"hsl":if(u.length!==3)return null;var f=(parseFloat(u[0])%360+360)%360/360,g=ja(u[1]),x=ja(u[2]),w=x<=.5?x*(g+1):x+g-x*g,b=2*x-w;return[Kn(255*un(b,w,f+1/3)),Kn(255*un(b,w,f)),Kn(255*un(b,w,f-1/3)),d];default:return null}}return null}}catch{}class Jr{constructor(e,r,o,a=1){this.r=e,this.g=r,this.b=o,this.a=a}static parse(e){if(!e)return;if(e instanceof Jr)return e;if(typeof e!="string")return;const r=Ns(e);return r?new Jr(r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]):void 0}toString(){const[e,r,o,a]=this.toArray();return`rgba(${Math.round(e)},${Math.round(r)},${Math.round(o)},${a})`}toArray(){const{r:e,g:r,b:o,a}=this;return a===0?[0,0,0,0]:[255*e/a,255*r/a,255*o/a,a]}toArray01(){const{r:e,g:r,b:o,a}=this;return a===0?[0,0,0,0]:[e/a,r/a,o/a,a]}toArray01PremultipliedAlpha(){const{r:e,g:r,b:o,a}=this;return[e,r,o,a]}}Jr.black=new Jr(0,0,0,1),Jr.white=new Jr(1,1,1,1),Jr.transparent=new Jr(0,0,0,0),Jr.red=new Jr(1,0,0,1),Jr.blue=new Jr(0,0,1,1);var ur=Jr;class Vs{constructor(e,r,o){this.sensitivity=e?r?"variant":"case":r?"accent":"base",this.locale=o,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Gs{constructor(e,r,o,a,c){this.text=e.normalize?e.normalize():e,this.image=r,this.scale=o,this.fontStack=a,this.textColor=c}}class Qr{constructor(e){this.sections=e}static fromString(e){return new Qr([new Gs(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof Qr?e:Qr.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}serialize(){const e=["format"];for(const r of this.sections){if(r.image){e.push(["image",r.image.name]);continue}e.push(r.text);const o={};r.fontStack&&(o["text-font"]=["literal",r.fontStack.split(",")]),r.scale&&(o["font-scale"]=r.scale),r.textColor&&(o["text-color"]=["rgba"].concat(r.textColor.toArray())),e.push(o)}return e}}class gi{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new gi({name:e,available:!1}):null}serialize(){return["image",this.name]}}function wc(t,e,r,o){return typeof t=="number"&&t>=0&&t<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?o===void 0||typeof o=="number"&&o>=0&&o<=1?null:`Invalid rgba value [${[t,e,r,o].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof o=="number"?[t,e,r,o]:[t,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Qn(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||t instanceof ur||t instanceof Vs||t instanceof Qr||t instanceof gi)return!0;if(Array.isArray(t)){for(const e of t)if(!Qn(e))return!1;return!0}if(typeof t=="object"){for(const e in t)if(!Qn(t[e]))return!1;return!0}return!1}function lr(t){if(t===null)return hn;if(typeof t=="string")return ft;if(typeof t=="boolean")return pt;if(typeof t=="number")return Fe;if(t instanceof ur)return ci;if(t instanceof Vs)return hi;if(t instanceof Qr)return Wn;if(t instanceof gi)return Oo;if(Array.isArray(t)){const e=t.length;let r;for(const o of t){const a=lr(o);if(r){if(r===a)continue;r=dt;break}r=a}return fi(r||dt,e)}return Si}function ea(t){const e=typeof t;return t===null?"":e==="string"||e==="number"||e==="boolean"?String(t):t instanceof ur||t instanceof Qr||t instanceof gi?t.toString():JSON.stringify(t)}class $s{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Qn(e[1]))return r.error("invalid value");const o=e[1];let a=lr(o);const c=r.expectedType;return a.kind!=="array"||a.N!==0||!c||c.kind!=="array"||typeof c.N=="number"&&c.N!==0||(a=c),new $s(a,o)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof ur?["rgba"].concat(this.value.toArray()):this.value instanceof Qr?this.value.serialize():this.value}}var Uo=$s,Br=class{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}};const qs={string:ft,number:Fe,boolean:pt,object:Si};class Zs{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let o,a=1;const c=e[0];if(c==="array"){let d,f;if(e.length>2){const g=e[1];if(typeof g!="string"||!(g in qs)||g==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);d=qs[g],a++}else d=dt;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);f=e[2],a++}o=fi(d,f)}else o=qs[c];const u=[];for(;a<e.length;a++){const d=r.parse(e[a],a,dt);if(!d)return null;u.push(d)}return new Zs(o,u)}evaluate(e){for(let r=0;r<this.args.length;r++){const o=this.args[r].evaluate(e);if(!Hi(this.type,lr(o)))return o;if(r===this.args.length-1)throw new Br(`Expected value to be of type ${Kt(this.type)}, but found ${Kt(lr(o))} instead.`)}return null}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=this.type,r=[e.kind];if(e.kind==="array"){const o=e.itemType;if(o.kind==="string"||o.kind==="number"||o.kind==="boolean"){r.push(o.kind);const a=e.N;(typeof a=="number"||this.args.length>1)&&r.push(a)}}return r.concat(this.args.map(o=>o.serialize()))}}var Ki=Zs;class wo{constructor(e){this.type=Wn,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const o=e[1];if(!Array.isArray(o)&&typeof o=="object")return r.error("First argument must be an image or text section.");const a=[];let c=!1;for(let u=1;u<=e.length-1;++u){const d=e[u];if(c&&typeof d=="object"&&!Array.isArray(d)){c=!1;let f=null;if(d["font-scale"]&&(f=r.parse(d["font-scale"],1,Fe),!f))return null;let g=null;if(d["text-font"]&&(g=r.parse(d["text-font"],1,fi(ft)),!g))return null;let x=null;if(d["text-color"]&&(x=r.parse(d["text-color"],1,ci),!x))return null;const w=a[a.length-1];w.scale=f,w.font=g,w.textColor=x}else{const f=r.parse(e[u],1,dt);if(!f)return null;const g=f.type.kind;if(g!=="string"&&g!=="value"&&g!=="null"&&g!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");c=!0,a.push({content:f,scale:null,font:null,textColor:null})}}return new wo(a)}evaluate(e){return new Qr(this.sections.map(r=>{const o=r.content.evaluate(e);return lr(o)===Oo?new Gs("",o,null,null,null):new Gs(ea(o),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null)}))}eachChild(e){for(const r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const r of this.sections){e.push(r.content.serialize());const o={};r.scale&&(o["font-scale"]=r.scale.serialize()),r.font&&(o["text-font"]=r.font.serialize()),r.textColor&&(o["text-color"]=r.textColor.serialize()),e.push(o)}return e}}class Na{constructor(e){this.type=Oo,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");const o=r.parse(e[1],1,ft);return o?new Na(o):r.error("No image name provided.")}evaluate(e){const r=this.input.evaluate(e),o=gi.fromString(r);return o&&e.availableImages&&(o.available=e.availableImages.indexOf(r)>-1),o}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const $h={"to-boolean":pt,"to-color":ci,"to-number":Fe,"to-string":ft};class Xs{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const o=e[0];if((o==="to-boolean"||o==="to-string")&&e.length!==2)return r.error("Expected one argument.");const a=$h[o],c=[];for(let u=1;u<e.length;u++){const d=r.parse(e[u],u,dt);if(!d)return null;c.push(d)}return new Xs(a,c)}evaluate(e){if(this.type.kind==="boolean")return!!this.args[0].evaluate(e);if(this.type.kind==="color"){let r,o;for(const a of this.args){if(r=a.evaluate(e),o=null,r instanceof ur)return r;if(typeof r=="string"){const c=e.parseColor(r);if(c)return c}else if(Array.isArray(r)&&(o=r.length<3||r.length>4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:wc(r[0],r[1],r[2],r[3]),!o))return new ur(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new Br(o||`Could not parse color from value '${typeof r=="string"?r:String(JSON.stringify(r))}'`)}if(this.type.kind==="number"){let r=null;for(const o of this.args){if(r=o.evaluate(e),r===null)return 0;const a=Number(r);if(!isNaN(a))return a}throw new Br(`Could not convert ${JSON.stringify(r)} to number.`)}return this.type.kind==="formatted"?Qr.fromString(ea(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?gi.fromString(ea(this.args[0].evaluate(e))):ea(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){if(this.type.kind==="formatted")return new wo([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Na(this.args[0]).serialize();const e=[`to-${this.type.kind}`];return this.eachChild(r=>{e.push(r.serialize())}),e}}var pn=Xs;const Bi=["Unknown","Point","LineString","Polygon"];var Ws=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&this.feature.id!==void 0?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Bi[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const t=this.featureDistanceData.center,e=this.featureDistanceData.scale,{x:r,y:o}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(r*e-t[0])+this.featureDistanceData.bearing[1]*(o*e-t[1])}return 0}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=ur.parse(t)),e}};class jo{constructor(e,r,o,a){this.name=e,this.type=r,this._evaluate=o,this.args=a}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(e=>e.serialize()))}static parse(e,r){const o=e[0],a=jo.definitions[o];if(!a)return r.error(`Unknown expression "${o}". If you wanted a literal array, use ["literal", [...]].`,0);const c=Array.isArray(a)?a[0]:a.type,u=Array.isArray(a)?[[a[1],a[2]]]:a.overloads,d=u.filter(([g])=>!Array.isArray(g)||g.length===e.length-1);let f=null;for(const[g,x]of d){f=new el(r.registry,r.path,null,r.scope);const w=[];let b=!1;for(let k=1;k<e.length;k++){const S=e[k],I=Array.isArray(g)?g[k-1]:g.type,D=f.parse(S,1+w.length,I);if(!D){b=!0;break}w.push(D)}if(!b)if(Array.isArray(g)&&g.length!==w.length)f.error(`Expected ${g.length} arguments, but found ${w.length} instead.`);else{for(let k=0;k<w.length;k++){const S=Array.isArray(g)?g[k]:g.type,I=w[k];f.concat(k+1).checkSubtype(S,I.type)}if(f.errors.length===0)return new jo(o,c,x,w)}}if(d.length===1)r.errors.push(...f.errors);else{const g=(d.length?d:u).map(([w])=>{return b=w,Array.isArray(b)?`(${b.map(Kt).join(", ")})`:`(${Kt(b.type)}...)`;var b}).join(" | "),x=[];for(let w=1;w<e.length;w++){const b=r.parse(e[w],1+x.length);if(!b)return null;x.push(Kt(b.type))}r.error(`Expected arguments of type ${g}, but found (${x.join(", ")}) instead.`)}return null}static register(e,r){jo.definitions=r;for(const o in r)e[o]=jo}}var Ji=jo;class ta{constructor(e,r,o){this.type=hi,this.locale=o,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");const o=e[1];if(typeof o!="object"||Array.isArray(o))return r.error("Collator options argument must be an object.");const a=r.parse(o["case-sensitive"]!==void 0&&o["case-sensitive"],1,pt);if(!a)return null;const c=r.parse(o["diacritic-sensitive"]!==void 0&&o["diacritic-sensitive"],1,pt);if(!c)return null;let u=null;return o.locale&&(u=r.parse(o.locale,1,ft),!u)?null:new ta(a,c,u)}evaluate(e){return new Vs(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}serialize(){const e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]}}const Qi=8192;function Va(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function dn(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function ra(t,e){const r=(180+t[0])/360,o=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,a=Math.pow(2,e.z);return[Math.round(r*a*Qi),Math.round(o*a*Qi)]}function bc(t,e,r){const o=t[0]-e[0],a=t[1]-e[1],c=t[0]-r[0],u=t[1]-r[1];return o*u-c*a==0&&o*c<=0&&a*u<=0}function Ga(t,e){let r=!1;for(let u=0,d=e.length;u<d;u++){const f=e[u];for(let g=0,x=f.length;g<x-1;g++){if(bc(t,f[g],f[g+1]))return!1;(a=f[g])[1]>(o=t)[1]!=(c=f[g+1])[1]>o[1]&&o[0]<(c[0]-a[0])*(o[1]-a[1])/(c[1]-a[1])+a[0]&&(r=!r)}}var o,a,c;return r}function Ys(t,e){for(let r=0;r<e.length;r++)if(Ga(t,e[r]))return!0;return!1}function Hs(t,e,r,o){const a=o[0]-r[0],c=o[1]-r[1],u=(t[0]-r[0])*c-a*(t[1]-r[1]),d=(e[0]-r[0])*c-a*(e[1]-r[1]);return u>0&&d<0||u<0&&d>0}function mn(t,e,r){for(const g of r)for(let x=0;x<g.length-1;++x)if((d=[(u=g[x+1])[0]-(c=g[x])[0],u[1]-c[1]])[0]*(f=[(a=e)[0]-(o=t)[0],a[1]-o[1]])[1]-d[1]*f[0]!=0&&Hs(o,a,c,u)&&Hs(c,u,o,a))return!0;var o,a,c,u,d,f;return!1}function At(t,e){for(let r=0;r<t.length;++r)if(!Ga(t[r],e))return!1;for(let r=0;r<t.length-1;++r)if(mn(t[r],t[r+1],e))return!1;return!0}function qh(t,e){for(let r=0;r<e.length;r++)if(At(t,e[r]))return!0;return!1}function Ks(t,e,r){const o=[];for(let a=0;a<t.length;a++){const c=[];for(let u=0;u<t[a].length;u++){const d=ra(t[a][u],r);Va(e,d),c.push(d)}o.push(c)}return o}function Tc(t,e,r){const o=[];for(let a=0;a<t.length;a++){const c=Ks(t[a],e,r);o.push(c)}return o}function Js(t,e,r,o){if(t[0]<r[0]||t[0]>r[2]){const a=.5*o;let c=t[0]-r[0]>a?-o:r[0]-t[0]>a?o:0;c===0&&(c=t[0]-r[2]>a?-o:r[2]-t[0]>a?o:0),t[0]+=c}Va(e,t)}function Ec(t,e,r,o){const a=Math.pow(2,o.z)*Qi,c=[o.x*Qi,o.y*Qi],u=[];if(!t)return u;for(const d of t)for(const f of d){const g=[f.x+c[0],f.y+c[1]];Js(g,e,r,a),u.push(g)}return u}function Qs(t,e,r,o){const a=Math.pow(2,o.z)*Qi,c=[o.x*Qi,o.y*Qi],u=[];if(!t)return u;for(const f of t){const g=[];for(const x of f){const w=[x.x+c[0],x.y+c[1]];Va(e,w),g.push(w)}u.push(g)}if(e[2]-e[0]<=a/2){(d=e)[0]=d[1]=1/0,d[2]=d[3]=-1/0;for(const f of u)for(const g of f)Js(g,e,r,a)}var d;return u}class fn{constructor(e,r){this.type=pt,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Qn(e[1])){const o=e[1];if(o.type==="FeatureCollection")for(let a=0;a<o.features.length;++a){const c=o.features[a].geometry.type;if(c==="Polygon"||c==="MultiPolygon")return new fn(o,o.features[a].geometry)}else if(o.type==="Feature"){const a=o.geometry.type;if(a==="Polygon"||a==="MultiPolygon")return new fn(o,o.geometry)}else if(o.type==="Polygon"||o.type==="MultiPolygon")return new fn(o,o)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return function(r,o){const a=[1/0,1/0,-1/0,-1/0],c=[1/0,1/0,-1/0,-1/0],u=r.canonicalID();if(!u)return!1;if(o.type==="Polygon"){const d=Ks(o.coordinates,c,u),f=Ec(r.geometry(),a,c,u);if(!dn(a,c))return!1;for(const g of f)if(!Ga(g,d))return!1}if(o.type==="MultiPolygon"){const d=Tc(o.coordinates,c,u),f=Ec(r.geometry(),a,c,u);if(!dn(a,c))return!1;for(const g of f)if(!Ys(g,d))return!1}return!0}(e,this.geometries);if(e.geometryType()==="LineString")return function(r,o){const a=[1/0,1/0,-1/0,-1/0],c=[1/0,1/0,-1/0,-1/0],u=r.canonicalID();if(!u)return!1;if(o.type==="Polygon"){const d=Ks(o.coordinates,c,u),f=Qs(r.geometry(),a,c,u);if(!dn(a,c))return!1;for(const g of f)if(!At(g,d))return!1}if(o.type==="MultiPolygon"){const d=Tc(o.coordinates,c,u),f=Qs(r.geometry(),a,c,u);if(!dn(a,c))return!1;for(const g of f)if(!qh(g,d))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}var $a=fn;function gn(t){if(t instanceof Ji&&(t.name==="get"&&t.args.length===1||t.name==="feature-state"||t.name==="has"&&t.args.length===1||t.name==="properties"||t.name==="geometry-type"||t.name==="id"||/^filter-/.test(t.name))||t instanceof $a)return!1;let e=!0;return t.eachChild(r=>{e&&!gn(r)&&(e=!1)}),e}function eo(t){if(t instanceof Ji&&t.name==="feature-state")return!1;let e=!0;return t.eachChild(r=>{e&&!eo(r)&&(e=!1)}),e}function No(t,e){if(t instanceof Ji&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild(o=>{r&&!No(o,e)&&(r=!1)}),r}class qa{constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(e.length!==2||typeof e[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");const o=e[1];return r.scope.has(o)?new qa(o,r.scope.get(o)):r.error(`Unknown variable "${o}". Make sure "${o}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var kc=qa;class ia{constructor(e,r=[],o,a=new yc,c=[]){this.registry=e,this.path=r,this.key=r.map(u=>`[${u}]`).join(""),this.scope=a,this.errors=c,this.expectedType=o}parse(e,r,o,a,c={}){return r?this.concat(r,o,a)._parse(e,c):this._parse(e,c)}_parse(e,r){function o(a,c,u){return u==="assert"?new Ki(c,[a]):u==="coerce"?new pn(c,[a]):a}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const 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;const c=this.registry[a];if(c){let u=c.parse(e,this);if(!u)return null;if(this.expectedType){const d=this.expectedType,f=u.type;if(d.kind!=="string"&&d.kind!=="number"&&d.kind!=="boolean"&&d.kind!=="object"&&d.kind!=="array"||f.kind!=="value")if(d.kind!=="color"&&d.kind!=="formatted"&&d.kind!=="resolvedImage"||f.kind!=="value"&&f.kind!=="string"){if(this.checkSubtype(d,f))return null}else u=o(u,d,r.typeAnnotation||"coerce");else u=o(u,d,r.typeAnnotation||"assert")}if(!(u instanceof Uo)&&u.type.kind!=="resolvedImage"&&tl(u)){const d=new Ws;try{u=new Uo(u.type,u.evaluate(d))}catch(f){return this.error(f.message),null}}return u}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.`)}concat(e,r,o){const a=typeof e=="number"?this.path.concat(e):this.path,c=o?this.scope.concat(o):this.scope;return new ia(this.registry,a,r||null,c,this.errors)}error(e,...r){const o=`${this.key}${r.map(a=>`[${a}]`).join("")}`;this.errors.push(new Ri(o,e))}checkSubtype(e,r){const o=Hi(e,r);return o&&this.error(o),o}}var el=ia;function tl(t){if(t instanceof kc)return tl(t.boundExpression);if(t instanceof Ji&&t.name==="error"||t instanceof ta||t instanceof $a)return!1;const e=t instanceof pn||t instanceof Ki;let r=!0;return t.eachChild(o=>{r=e?r&&tl(o):r&&o instanceof Uo}),!!r&&gn(t)&&No(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function Za(t,e){const r=t.length-1;let o,a,c=0,u=r,d=0;for(;c<=u;)if(d=Math.floor((c+u)/2),o=t[d],a=t[d+1],o<=e){if(d===r||e<a)return d;c=d+1}else{if(!(o>e))throw new Br("Input is not a number.");u=d-1}return 0}class Xa{constructor(e,r,o){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(const[a,c]of o)this.labels.push(a),this.outputs.push(c)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");const o=r.parse(e[1],1,Fe);if(!o)return null;const a=[];let c=null;r.expectedType&&r.expectedType.kind!=="value"&&(c=r.expectedType);for(let u=1;u<e.length;u+=2){const d=u===1?-1/0:e[u],f=e[u+1],g=u,x=u+1;if(typeof d!="number")return r.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]>=d)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',g);const w=r.parse(f,x,c);if(!w)return null;c=c||w.type,a.push([d,w])}return new Xa(c,o,a)}evaluate(e){const r=this.labels,o=this.outputs;if(r.length===1)return o[0].evaluate(e);const a=this.input.evaluate(e);if(a<=r[0])return o[0].evaluate(e);const c=r.length;return a>=r[c-1]?o[c-1].evaluate(e):o[Za(r,a)].evaluate(e)}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){const e=["step",this.input.serialize()];for(let r=0;r<this.labels.length;r++)r>0&&e.push(this.labels[r]),e.push(this.outputs[r].serialize());return e}}var rl=Xa;function bt(t,e,r){return t*(1-r)+e*r}var oa=Object.freeze({__proto__:null,array:function(t,e,r){return t.map((o,a)=>bt(o,e[a],r))},color:function(t,e,r){return new ur(bt(t.r,e.r,r),bt(t.g,e.g,r),bt(t.b,e.b,r),bt(t.a,e.a,r))},number:bt});const Sc=.95047,il=1.08883,Mc=4/29,Vo=6/29,ol=3*Vo*Vo,Zh=Vo*Vo*Vo,Xh=Math.PI/180,Wh=180/Math.PI;function nl(t){return t>Zh?Math.pow(t,1/3):t/ol+Mc}function al(t){return t>Vo?t*t*t:ol*(t-Mc)}function sl(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Wa(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ac(t){const e=Wa(t.r),r=Wa(t.g),o=Wa(t.b),a=nl((.4124564*e+.3575761*r+.1804375*o)/Sc),c=nl((.2126729*e+.7151522*r+.072175*o)/1);return{l:116*c-16,a:500*(a-c),b:200*(c-nl((.0193339*e+.119192*r+.9503041*o)/il)),alpha:t.a}}function Ic(t){let e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,o=isNaN(t.b)?e:e-t.b/200;return e=1*al(e),r=Sc*al(r),o=il*al(o),new ur(sl(3.2404542*r-1.5371385*e-.4985314*o),sl(-.969266*r+1.8760108*e+.041556*o),sl(.0556434*r-.2040259*e+1.0572252*o),t.alpha)}function Yh(t,e,r){const o=e-t;return t+r*(o>180||o<-180?o-360*Math.round(o/360):o)}const na={forward:Ac,reverse:Ic,interpolate:function(t,e,r){return{l:bt(t.l,e.l,r),a:bt(t.a,e.a,r),b:bt(t.b,e.b,r),alpha:bt(t.alpha,e.alpha,r)}}},_n={forward:function(t){const{l:e,a:r,b:o}=Ac(t),a=Math.atan2(o,r)*Wh;return{h:a<0?a+360:a,c:Math.sqrt(r*r+o*o),l:e,alpha:t.a}},reverse:function(t){const e=t.h*Xh,r=t.c;return Ic({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:Yh(t.h,e.h,r),c:bt(t.c,e.c,r),l:bt(t.l,e.l,r),alpha:bt(t.alpha,e.alpha,r)}}};var ll=Object.freeze({__proto__:null,hcl:_n,lab:na});class aa{constructor(e,r,o,a,c){this.type=e,this.operator=r,this.interpolation=o,this.input=a,this.labels=[],this.outputs=[];for(const[u,d]of c)this.labels.push(u),this.outputs.push(d)}static interpolationFactor(e,r,o,a){let c=0;if(e.name==="exponential")c=cl(r,e.base,o,a);else if(e.name==="linear")c=cl(r,1,o,a);else if(e.name==="cubic-bezier"){const u=e.controlPoints;c=new Rr(u[0],u[1],u[2],u[3]).solve(cl(r,1,o,a))}return c}static parse(e,r){let[o,a,c,...u]=e;if(!Array.isArray(a)||a.length===0)return r.error("Expected an interpolation type expression.",1);if(a[0]==="linear")a={name:"linear"};else if(a[0]==="exponential"){const g=a[1];if(typeof g!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);a={name:"exponential",base:g}}else{if(a[0]!=="cubic-bezier")return r.error(`Unknown interpolation type ${String(a[0])}`,1,0);{const g=a.slice(1);if(g.length!==4||g.some(x=>typeof x!="number"||x<0||x>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:g}}}if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(c=r.parse(c,2,Fe),!c)return null;const d=[];let f=null;o==="interpolate-hcl"||o==="interpolate-lab"?f=ci:r.expectedType&&r.expectedType.kind!=="value"&&(f=r.expectedType);for(let g=0;g<u.length;g+=2){const x=u[g],w=u[g+1],b=g+3,k=g+4;if(typeof x!="number")return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',b);if(d.length&&d[d.length-1][0]>=x)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',b);const S=r.parse(w,k,f);if(!S)return null;f=f||S.type,d.push([x,S])}return f.kind==="number"||f.kind==="color"||f.kind==="array"&&f.itemType.kind==="number"&&typeof f.N=="number"?new aa(f,o,a,c,d):r.error(`Type ${Kt(f)} is not interpolatable.`)}evaluate(e){const r=this.labels,o=this.outputs;if(r.length===1)return o[0].evaluate(e);const a=this.input.evaluate(e);if(a<=r[0])return o[0].evaluate(e);const c=r.length;if(a>=r[c-1])return o[c-1].evaluate(e);const u=Za(r,a),d=aa.interpolationFactor(this.interpolation,a,r[u],r[u+1]),f=o[u].evaluate(e),g=o[u+1].evaluate(e);return this.operator==="interpolate"?oa[this.type.kind.toLowerCase()](f,g,d):this.operator==="interpolate-hcl"?_n.reverse(_n.interpolate(_n.forward(f),_n.forward(g),d)):na.reverse(na.interpolate(na.forward(f),na.forward(g),d))}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){let e;e=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const r=[this.operator,e,this.input.serialize()];for(let o=0;o<this.labels.length;o++)r.push(this.labels[o],this.outputs[o].serialize());return r}}function cl(t,e,r,o){const a=o-r,c=t-r;return a===0?0:e===1?c/a:(Math.pow(e,c)-1)/(Math.pow(e,a)-1)}var Fi=aa;class Ya{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expectected at least one argument.");let o=null;const a=r.expectedType;a&&a.kind!=="value"&&(o=a);const c=[];for(const d of e.slice(1)){const f=r.parse(d,1+c.length,o,void 0,{typeAnnotation:"omit"});if(!f)return null;o=o||f.type,c.push(f)}const u=a&&c.some(d=>Hi(a,d.type));return new Ya(u?dt:o,c)}evaluate(e){let r,o=null,a=0;for(const c of this.args){if(a++,o=c.evaluate(e),o&&o instanceof gi&&!o.available&&(r||(r=o),o=null,a===this.args.length))return r;if(o!==null)break}return o}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=["coalesce"];return this.eachChild(r=>{e.push(r.serialize())}),e}}var hl=Ya;class Ha{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const o=[];for(let c=1;c<e.length-1;c+=2){const u=e[c];if(typeof u!="string")return r.error(`Expected string, but found ${typeof u} instead.`,c);if(/[^a-zA-Z0-9_]/.test(u))return r.error("Variable names must contain only alphanumeric characters or '_'.",c);const d=r.parse(e[c+1],c+1);if(!d)return null;o.push([u,d])}const a=r.parse(e[e.length-1],e.length-1,r.expectedType,o);return a?new Ha(o,a):null}outputDefined(){return this.result.outputDefined()}serialize(){const e=["let"];for(const[r,o]of this.bindings)e.push(r,o.serialize());return e.push(this.result.serialize()),e}}var Cc=Ha;class ul{constructor(e,r,o){this.type=e,this.index=r,this.input=o}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const o=r.parse(e[1],1,Fe),a=r.parse(e[2],2,fi(r.expectedType||dt));return o&&a?new ul(a.type.itemType,o,a):null}evaluate(e){const r=this.index.evaluate(e),o=this.input.evaluate(e);if(r<0)throw new Br(`Array index out of bounds: ${r} < 0.`);if(r>=o.length)throw new Br(`Array index out of bounds: ${r} > ${o.length-1}.`);if(r!==Math.floor(r))throw new Br(`Array index must be an integer, but found ${r} instead.`);return o[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var Hh=ul;class pl{constructor(e,r){this.type=pt,this.needle=e,this.haystack=r}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const o=r.parse(e[1],1,dt),a=r.parse(e[2],2,dt);return o&&a?Yn(o.type,[pt,ft,Fe,hn,dt])?new pl(o,a):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${Kt(o.type)} instead`):null}evaluate(e){const r=this.needle.evaluate(e),o=this.haystack.evaluate(e);if(o==null)return!1;if(!Hn(r,["boolean","string","number","null"]))throw new Br(`Expected first argument to be of type boolean, string, number or null, but found ${Kt(lr(r))} instead.`);if(!Hn(o,["string","array"]))throw new Br(`Expected second argument to be of type array or string, but found ${Kt(lr(o))} instead.`);return o.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Ka=pl;class sa{constructor(e,r,o){this.type=Fe,this.needle=e,this.haystack=r,this.fromIndex=o}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const o=r.parse(e[1],1,dt),a=r.parse(e[2],2,dt);if(!o||!a)return null;if(!Yn(o.type,[pt,ft,Fe,hn,dt]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${Kt(o.type)} instead`);if(e.length===4){const c=r.parse(e[3],3,Fe);return c?new sa(o,a,c):null}return new sa(o,a)}evaluate(e){const r=this.needle.evaluate(e),o=this.haystack.evaluate(e);if(!Hn(r,["boolean","string","number","null"]))throw new Br(`Expected first argument to be of type boolean, string, number or null, but found ${Kt(lr(r))} instead.`);if(!Hn(o,["string","array"]))throw new Br(`Expected second argument to be of type array or string, but found ${Kt(lr(o))} instead.`);if(this.fromIndex){const a=this.fromIndex.evaluate(e);return o.indexOf(r,a)}return o.indexOf(r)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(this.fromIndex!=null&&this.fromIndex!==void 0){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var zc=sa;class dl{constructor(e,r,o,a,c,u){this.inputType=e,this.type=r,this.input=o,this.cases=a,this.outputs=c,this.otherwise=u}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let o,a;r.expectedType&&r.expectedType.kind!=="value"&&(a=r.expectedType);const c={},u=[];for(let g=2;g<e.length-1;g+=2){let x=e[g];const w=e[g+1];Array.isArray(x)||(x=[x]);const b=r.concat(g);if(x.length===0)return b.error("Expected at least one branch label.");for(const S of x){if(typeof S!="number"&&typeof S!="string")return b.error("Branch labels must be numbers or strings.");if(typeof S=="number"&&Math.abs(S)>Number.MAX_SAFE_INTEGER)return b.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof S=="number"&&Math.floor(S)!==S)return b.error("Numeric branch labels must be integer values.");if(o){if(b.checkSubtype(o,lr(S)))return null}else o=lr(S);if(c[String(S)]!==void 0)return b.error("Branch labels must be unique.");c[String(S)]=u.length}const k=r.parse(w,g,a);if(!k)return null;a=a||k.type,u.push(k)}const d=r.parse(e[1],1,dt);if(!d)return null;const f=r.parse(e[e.length-1],e.length-1,a);return f?d.type.kind!=="value"&&r.concat(1).checkSubtype(o,d.type)?null:new dl(o,a,d,c,u,f):null}evaluate(e){const r=this.input.evaluate(e);return(lr(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],r=Object.keys(this.cases).sort(),o=[],a={};for(const u of r){const d=a[this.cases[u]];d===void 0?(a[this.cases[u]]=o.length,o.push([this.cases[u],[u]])):o[d][1].push(u)}const c=u=>this.inputType.kind==="number"?Number(u):u;for(const[u,d]of o)e.push(d.length===1?c(d[0]):d.map(c)),e.push(this.outputs[u].serialize());return e.push(this.otherwise.serialize()),e}}var Kh=dl;class ml{constructor(e,r,o){this.type=e,this.branches=r,this.otherwise=o}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let o;r.expectedType&&r.expectedType.kind!=="value"&&(o=r.expectedType);const a=[];for(let u=1;u<e.length-1;u+=2){const d=r.parse(e[u],u,pt);if(!d)return null;const f=r.parse(e[u+1],u+1,o);if(!f)return null;a.push([d,f]),o=o||f.type}const c=r.parse(e[e.length-1],e.length-1,o);return c?new ml(o,a,c):null}evaluate(e){for(const[r,o]of this.branches)if(r.evaluate(e))return o.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[r,o]of this.branches)e(r),e(o);e(this.otherwise)}outputDefined(){return this.branches.every(([e,r])=>r.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild(r=>{e.push(r.serialize())}),e}}var Pc=ml;class la{constructor(e,r,o,a){this.type=e,this.input=r,this.beginIndex=o,this.endIndex=a}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const o=r.parse(e[1],1,dt),a=r.parse(e[2],2,Fe);if(!o||!a)return null;if(!Yn(o.type,[fi(dt),ft,dt]))return r.error(`Expected first argument to be of type array or string, but found ${Kt(o.type)} instead`);if(e.length===4){const c=r.parse(e[3],3,Fe);return c?new la(o.type,o,a,c):null}return new la(o.type,o,a)}evaluate(e){const r=this.input.evaluate(e),o=this.beginIndex.evaluate(e);if(!Hn(r,["string","array"]))throw new Br(`Expected first argument to be of type array or string, but found ${Kt(lr(r))} instead.`);if(this.endIndex){const a=this.endIndex.evaluate(e);return r.slice(o,a)}return r.slice(o)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(this.endIndex!=null&&this.endIndex!==void 0){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var Dc=la;function Ja(t,e){return t==="=="||t==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function Lc(t,e,r,o){return o.compare(e,r)===0}function yn(t,e,r){const o=t!=="=="&&t!=="!=";return class lf{constructor(c,u,d){this.type=pt,this.lhs=c,this.rhs=u,this.collator=d,this.hasUntypedArgument=c.type.kind==="value"||u.type.kind==="value"}static parse(c,u){if(c.length!==3&&c.length!==4)return u.error("Expected two or three arguments.");const d=c[0];let f=u.parse(c[1],1,dt);if(!f)return null;if(!Ja(d,f.type))return u.concat(1).error(`"${d}" comparisons are not supported for type '${Kt(f.type)}'.`);let g=u.parse(c[2],2,dt);if(!g)return null;if(!Ja(d,g.type))return u.concat(2).error(`"${d}" comparisons are not supported for type '${Kt(g.type)}'.`);if(f.type.kind!==g.type.kind&&f.type.kind!=="value"&&g.type.kind!=="value")return u.error(`Cannot compare types '${Kt(f.type)}' and '${Kt(g.type)}'.`);o&&(f.type.kind==="value"&&g.type.kind!=="value"?f=new Ki(g.type,[f]):f.type.kind!=="value"&&g.type.kind==="value"&&(g=new Ki(f.type,[g])));let x=null;if(c.length===4){if(f.type.kind!=="string"&&g.type.kind!=="string"&&f.type.kind!=="value"&&g.type.kind!=="value")return u.error("Cannot use collator to compare non-string types.");if(x=u.parse(c[3],3,hi),!x)return null}return new lf(f,g,x)}evaluate(c){const u=this.lhs.evaluate(c),d=this.rhs.evaluate(c);if(o&&this.hasUntypedArgument){const f=lr(u),g=lr(d);if(f.kind!==g.kind||f.kind!=="string"&&f.kind!=="number")throw new Br(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${f.kind}, ${g.kind}) instead.`)}if(this.collator&&!o&&this.hasUntypedArgument){const f=lr(u),g=lr(d);if(f.kind!=="string"||g.kind!=="string")return e(c,u,d)}return this.collator?r(c,u,d,this.collator.evaluate(c)):e(c,u,d)}eachChild(c){c(this.lhs),c(this.rhs),this.collator&&c(this.collator)}outputDefined(){return!0}serialize(){const c=[t];return this.eachChild(u=>{c.push(u.serialize())}),c}}}const Jh=yn("==",function(t,e,r){return e===r},Lc),Qh=yn("!=",function(t,e,r){return e!==r},function(t,e,r,o){return!Lc(0,e,r,o)}),eu=yn("<",function(t,e,r){return e<r},function(t,e,r,o){return o.compare(e,r)<0}),tu=yn(">",function(t,e,r){return e>r},function(t,e,r,o){return o.compare(e,r)>0}),ru=yn("<=",function(t,e,r){return e<=r},function(t,e,r,o){return o.compare(e,r)<=0}),Rc=yn(">=",function(t,e,r){return e>=r},function(t,e,r,o){return o.compare(e,r)>=0});class Qa{constructor(e,r,o,a,c,u){this.type=ft,this.number=e,this.locale=r,this.currency=o,this.unit=a,this.minFractionDigits=c,this.maxFractionDigits=u}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");const o=r.parse(e[1],1,Fe);if(!o)return null;const a=e[2];if(typeof a!="object"||Array.isArray(a))return r.error("NumberFormat options argument must be an object.");let c=null;if(a.locale&&(c=r.parse(a.locale,1,ft),!c))return null;let u=null;if(a.currency&&(u=r.parse(a.currency,1,ft),!u))return null;let d=null;if(a.unit&&(d=r.parse(a.unit,1,ft),!d))return null;let f=null;if(a["min-fraction-digits"]&&(f=r.parse(a["min-fraction-digits"],1,Fe),!f))return null;let g=null;return a["max-fraction-digits"]&&(g=r.parse(a["max-fraction-digits"],1,Fe),!g)?null:new Qa(o,c,u,d,f,g)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class xn{constructor(e){this.type=Fe,this.input=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);const o=r.parse(e[1],1);return o?o.type.kind!=="array"&&o.type.kind!=="string"&&o.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${Kt(o.type)} instead.`):new xn(o):null}evaluate(e){const r=this.input.evaluate(e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new Br(`Expected value to be of type string or array, but found ${Kt(lr(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild(r=>{e.push(r.serialize())}),e}}const Bc={"==":Jh,"!=":Qh,">":tu,"<":eu,">=":Rc,"<=":ru,array:Ki,at:Hh,boolean:Ki,case:Pc,coalesce:hl,collator:ta,format:wo,image:Na,in:Ka,"index-of":zc,interpolate:Fi,"interpolate-hcl":Fi,"interpolate-lab":Fi,length:xn,let:Cc,literal:Uo,match:Kh,number:Ki,"number-format":Qa,object:Ki,slice:Dc,step:rl,string:Ki,"to-boolean":pn,"to-color":pn,"to-number":pn,"to-string":pn,var:kc,within:$a};function Fc(t,[e,r,o,a]){e=e.evaluate(t),r=r.evaluate(t),o=o.evaluate(t);const c=a?a.evaluate(t):1,u=wc(e,r,o,c);if(u)throw new Br(u);return new ur(e/255*c,r/255*c,o/255*c,c)}function to(t,e){return t in e}function es(t,e){const r=e[t];return r===void 0?null:r}function _i(t){return{type:t}}Ji.register(Bc,{error:[{kind:"error"},[ft],(t,[e])=>{throw new Br(e.evaluate(t))}],typeof:[ft,[dt],(t,[e])=>Kt(lr(e.evaluate(t)))],"to-rgba":[fi(Fe,4),[ci],(t,[e])=>e.evaluate(t).toArray()],rgb:[ci,[Fe,Fe,Fe],Fc],rgba:[ci,[Fe,Fe,Fe,Fe],Fc],has:{type:pt,overloads:[[[ft],(t,[e])=>to(e.evaluate(t),t.properties())],[[ft,Si],(t,[e,r])=>to(e.evaluate(t),r.evaluate(t))]]},get:{type:dt,overloads:[[[ft],(t,[e])=>es(e.evaluate(t),t.properties())],[[ft,Si],(t,[e,r])=>es(e.evaluate(t),r.evaluate(t))]]},"feature-state":[dt,[ft],(t,[e])=>es(e.evaluate(t),t.featureState||{})],properties:[Si,[],t=>t.properties()],"geometry-type":[ft,[],t=>t.geometryType()],id:[dt,[],t=>t.id()],zoom:[Fe,[],t=>t.globals.zoom],pitch:[Fe,[],t=>t.globals.pitch||0],"distance-from-center":[Fe,[],t=>t.distanceFromCenter()],"heatmap-density":[Fe,[],t=>t.globals.heatmapDensity||0],"line-progress":[Fe,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[Fe,[],t=>t.globals.skyRadialProgress||0],accumulated:[dt,[],t=>t.globals.accumulated===void 0?null:t.globals.accumulated],"+":[Fe,_i(Fe),(t,e)=>{let r=0;for(const o of e)r+=o.evaluate(t);return r}],"*":[Fe,_i(Fe),(t,e)=>{let r=1;for(const o of e)r*=o.evaluate(t);return r}],"-":{type:Fe,overloads:[[[Fe,Fe],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[Fe],(t,[e])=>-e.evaluate(t)]]},"/":[Fe,[Fe,Fe],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],"%":[Fe,[Fe,Fe],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[Fe,[],()=>Math.LN2],pi:[Fe,[],()=>Math.PI],e:[Fe,[],()=>Math.E],"^":[Fe,[Fe,Fe],(t,[e,r])=>Math.pow(e.evaluate(t),r.evaluate(t))],sqrt:[Fe,[Fe],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[Fe,[Fe],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[Fe,[Fe],(t,[e])=>Math.log(e.evaluate(t))],log2:[Fe,[Fe],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[Fe,[Fe],(t,[e])=>Math.sin(e.evaluate(t))],cos:[Fe,[Fe],(t,[e])=>Math.cos(e.evaluate(t))],tan:[Fe,[Fe],(t,[e])=>Math.tan(e.evaluate(t))],asin:[Fe,[Fe],(t,[e])=>Math.asin(e.evaluate(t))],acos:[Fe,[Fe],(t,[e])=>Math.acos(e.evaluate(t))],atan:[Fe,[Fe],(t,[e])=>Math.atan(e.evaluate(t))],min:[Fe,_i(Fe),(t,e)=>Math.min(...e.map(r=>r.evaluate(t)))],max:[Fe,_i(Fe),(t,e)=>Math.max(...e.map(r=>r.evaluate(t)))],abs:[Fe,[Fe],(t,[e])=>Math.abs(e.evaluate(t))],round:[Fe,[Fe],(t,[e])=>{const r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[Fe,[Fe],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[Fe,[Fe],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[pt,[ft,dt],(t,[e,r])=>t.properties()[e.value]===r.value],"filter-id-==":[pt,[dt],(t,[e])=>t.id()===e.value],"filter-type-==":[pt,[ft],(t,[e])=>t.geometryType()===e.value],"filter-<":[pt,[ft,dt],(t,[e,r])=>{const o=t.properties()[e.value],a=r.value;return typeof o==typeof a&&o<a}],"filter-id-<":[pt,[dt],(t,[e])=>{const r=t.id(),o=e.value;return typeof r==typeof o&&r<o}],"filter->":[pt,[ft,dt],(t,[e,r])=>{const o=t.properties()[e.value],a=r.value;return typeof o==typeof a&&o>a}],"filter-id->":[pt,[dt],(t,[e])=>{const r=t.id(),o=e.value;return typeof r==typeof o&&r>o}],"filter-<=":[pt,[ft,dt],(t,[e,r])=>{const o=t.properties()[e.value],a=r.value;return typeof o==typeof a&&o<=a}],"filter-id-<=":[pt,[dt],(t,[e])=>{const r=t.id(),o=e.value;return typeof r==typeof o&&r<=o}],"filter->=":[pt,[ft,dt],(t,[e,r])=>{const o=t.properties()[e.value],a=r.value;return typeof o==typeof a&&o>=a}],"filter-id->=":[pt,[dt],(t,[e])=>{const r=t.id(),o=e.value;return typeof r==typeof o&&r>=o}],"filter-has":[pt,[dt],(t,[e])=>e.value in t.properties()],"filter-has-id":[pt,[],t=>t.id()!==null&&t.id()!==void 0],"filter-type-in":[pt,[fi(ft)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[pt,[fi(dt)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[pt,[ft,fi(dt)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[pt,[ft,fi(dt)],(t,[e,r])=>function(o,a,c,u){for(;c<=u;){const d=c+u>>1;if(a[d]===o)return!0;a[d]>o?u=d-1:c=d+1}return!1}(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:pt,overloads:[[[pt,pt],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[_i(pt),(t,e)=>{for(const r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:pt,overloads:[[[pt,pt],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[_i(pt),(t,e)=>{for(const r of e)if(r.evaluate(t))return!0;return!1}]]},"!":[pt,[pt],(t,[e])=>!e.evaluate(t)],"is-supported-script":[pt,[ft],(t,[e])=>{const r=t.globals&&t.globals.isSupportedScript;return!r||r(e.evaluate(t))}],upcase:[ft,[ft],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[ft,[ft],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[ft,_i(dt),(t,e)=>e.map(r=>ea(r.evaluate(t))).join("")],"resolved-locale":[ft,[hi],(t,[e])=>e.evaluate(t).resolvedLocale()]});var ca=Bc;function Oc(t){return{result:"success",value:t}}function Go(t){return{result:"error",value:t}}function vn(t){return t["property-type"]==="data-driven"}function ts(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function rs(t){return!!t.expression&&t.expression.interpolated}function Tt(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":t===null?"null":typeof t}function ha(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Uc(t){return t}function is(t,e){const r=e.type==="color",o=t.stops&&typeof t.stops[0][0]=="object",a=o||!(o||t.property!==void 0),c=t.type||(rs(e)?"exponential":"interval");if(r&&((t=Yi({},t)).stops&&(t.stops=t.stops.map(g=>[g[0],ur.parse(g[1])])),t.default=ur.parse(t.default?t.default:e.default)),t.colorSpace&&t.colorSpace!=="rgb"&&!ll[t.colorSpace])throw new Error(`Unknown color space: ${t.colorSpace}`);let u,d,f;if(c==="exponential")u=ro;else if(c==="interval")u=os;else if(c==="categorical"){u=jc,d=Object.create(null);for(const g of t.stops)d[g[0]]=g[1];f=typeof t.stops[0][0]}else{if(c!=="identity")throw new Error(`Unknown function type "${c}"`);u=Nc}if(o){const g={},x=[];for(let k=0;k<t.stops.length;k++){const S=t.stops[k],I=S[0].zoom;g[I]===void 0&&(g[I]={zoom:I,type:t.type,property:t.property,default:t.default,stops:[]},x.push(I)),g[I].stops.push([S[0].value,S[1]])}const w=[];for(const k of x)w.push([g[k].zoom,is(g[k],e)]);const b={name:"linear"};return{kind:"composite",interpolationType:b,interpolationFactor:Fi.interpolationFactor.bind(void 0,b),zoomStops:w.map(k=>k[0]),evaluate:({zoom:k},S)=>ro({stops:w,base:t.base},e,k).evaluate(k,S)}}if(a){const g=c==="exponential"?{name:"exponential",base:t.base!==void 0?t.base:1}:null;return{kind:"camera",interpolationType:g,interpolationFactor:Fi.interpolationFactor.bind(void 0,g),zoomStops:t.stops.map(x=>x[0]),evaluate:({zoom:x})=>u(t,e,x,d,f)}}return{kind:"source",evaluate(g,x){const w=x&&x.properties?x.properties[t.property]:void 0;return w===void 0?wn(t.default,e.default):u(t,e,w,d,f)}}}function wn(t,e,r){return t!==void 0?t:e!==void 0?e:r!==void 0?r:void 0}function jc(t,e,r,o,a){return wn(typeof r===a?o[r]:void 0,t.default,e.default)}function os(t,e,r){if(Tt(r)!=="number")return wn(t.default,e.default);const o=t.stops.length;if(o===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[o-1][0])return t.stops[o-1][1];const a=Za(t.stops.map(c=>c[0]),r);return t.stops[a][1]}function ro(t,e,r){const o=t.base!==void 0?t.base:1;if(Tt(r)!=="number")return wn(t.default,e.default);const a=t.stops.length;if(a===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[a-1][0])return t.stops[a-1][1];const c=Za(t.stops.map(x=>x[0]),r),u=function(x,w,b,k){const S=k-b,I=x-b;return S===0?0:w===1?I/S:(Math.pow(w,I)-1)/(Math.pow(w,S)-1)}(r,o,t.stops[c][0],t.stops[c+1][0]),d=t.stops[c][1],f=t.stops[c+1][1];let g=oa[e.type]||Uc;if(t.colorSpace&&t.colorSpace!=="rgb"){const x=ll[t.colorSpace];g=(w,b)=>x.reverse(x.interpolate(x.forward(w),x.forward(b),u))}return typeof d.evaluate=="function"?{evaluate(...x){const w=d.evaluate.apply(void 0,x),b=f.evaluate.apply(void 0,x);if(w!==void 0&&b!==void 0)return g(w,b,u)}}:g(d,f,u)}function Nc(t,e,r){return e.type==="color"?r=ur.parse(r):e.type==="formatted"?r=Qr.fromString(r.toString()):e.type==="resolvedImage"?r=gi.fromString(r.toString()):Tt(r)===e.type||e.type==="enum"&&e.values[r]||(r=void 0),wn(r,t.default,e.default)}class ns{constructor(e,r){this.expression=e,this._warningHistory={},this._evaluator=new Ws,this._defaultValue=r?function(o){return o.type==="color"&&(ha(o.default)||Array.isArray(o.default))?new ur(0,0,0,0):o.type==="color"?ur.parse(o.default)||null:o.default===void 0?null:o.default}(r):null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(e,r,o,a,c,u,d,f){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=o,this._evaluator.canonical=a||null,this._evaluator.availableImages=c||null,this._evaluator.formattedSection=u,this._evaluator.featureTileCoord=d||null,this._evaluator.featureDistanceData=f||null,this.expression.evaluate(this._evaluator)}evaluate(e,r,o,a,c,u,d,f){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=o||null,this._evaluator.canonical=a||null,this._evaluator.availableImages=c||null,this._evaluator.formattedSection=u||null,this._evaluator.featureTileCoord=d||null,this._evaluator.featureDistanceData=f||null;try{const g=this.expression.evaluate(this._evaluator);if(g==null||typeof g=="number"&&g!=g)return this._defaultValue;if(this._enumValues&&!(g in this._enumValues))throw new Br(`Expected value to be one of ${Object.keys(this._enumValues).map(x=>JSON.stringify(x)).join(", ")}, but found ${JSON.stringify(g)} instead.`);return g}catch(g){return this._warningHistory[g.message]||(this._warningHistory[g.message]=!0,typeof console<"u"&&console.warn(g.message)),this._defaultValue}}}function bn(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="string"&&t[0]in ca}function Tn(t,e){const r=new el(ca,[],e?function(a){const c={color:ci,string:ft,number:Fe,enum:ft,boolean:pt,formatted:Wn,resolvedImage:Oo};return a.type==="array"?fi(c[a.value]||dt,a.length):c[a.type]}(e):void 0),o=r.parse(t,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return o?Oc(new ns(o,e)):Go(r.errors)}class fl{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!eo(r.expression)}evaluateWithoutErrorHandling(e,r,o,a,c,u){return this._styleExpression.evaluateWithoutErrorHandling(e,r,o,a,c,u)}evaluate(e,r,o,a,c,u){return this._styleExpression.evaluate(e,r,o,a,c,u)}}class ua{constructor(e,r,o,a){this.kind=e,this.zoomStops=o,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!eo(r.expression),this.interpolationType=a}evaluateWithoutErrorHandling(e,r,o,a,c,u){return this._styleExpression.evaluateWithoutErrorHandling(e,r,o,a,c,u)}evaluate(e,r,o,a,c,u){return this._styleExpression.evaluate(e,r,o,a,c,u)}interpolationFactor(e,r,o){return this.interpolationType?Fi.interpolationFactor(this.interpolationType,e,r,o):0}}function pa(t,e){if((t=Tn(t,e)).result==="error")return t;const r=t.value.expression,o=gn(r);if(!o&&!vn(e))return Go([new Ri("","data expressions not supported")]);const a=No(r,["zoom","pitch","distance-from-center"]);if(!a&&!ts(e))return Go([new Ri("","zoom expressions not supported")]);const c=ss(r);return c||a?c instanceof Ri?Go([c]):c instanceof Fi&&!rs(e)?Go([new Ri("",'"interpolate" expressions cannot be used with this property')]):Oc(c?new ua(o?"camera":"composite",t.value,c.labels,c instanceof Fi?c.interpolation:void 0):new fl(o?"constant":"source",t.value)):Go([new Ri("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class as{constructor(e,r){this._parameters=e,this._specification=r,Yi(this,is(this._parameters,this._specification))}static deserialize(e){return new as(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function ss(t){let e=null;if(t instanceof Cc)e=ss(t.result);else if(t instanceof hl){for(const r of t.args)if(e=ss(r),e)break}else(t instanceof rl||t instanceof Fi)&&t.input instanceof Ji&&t.input.name==="zoom"&&(e=t);return e instanceof Ri||t.eachChild(r=>{const o=ss(r);o instanceof Ri?e=o:!e&&o?e=new Ri("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&o&&e!==o&&(e=new Ri("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}class Oe{constructor(e,r,o,a){this.message=(e?`${e}: `:"")+o,a&&(this.identifier=a),r!=null&&r.__line__&&(this.line=r.__line__)}}function Mi(t){const e=t.key,r=t.value,o=t.valueSpec||{},a=t.objectElementValidators||{},c=t.style,u=t.styleSpec;let d=[];const f=Tt(r);if(f!=="object")return[new Oe(e,r,`object expected, ${f} found`)];for(const g in r){const x=g.split(".")[0];let w;a[x]?w=a[x]:o[x]?w=Vr:a["*"]?w=a["*"]:o["*"]&&(w=Vr),w?d=d.concat(w({key:(e&&`${e}.`)+g,value:r[g],valueSpec:o[x]||o["*"],style:c,styleSpec:u,object:r,objectKey:g},r)):d.push(new Oe(e,r[g],`unknown property "${g}"`))}for(const g in o)a[g]||o[g].required&&o[g].default===void 0&&r[g]===void 0&&d.push(new Oe(e,r,`missing required property "${g}"`));return d}function Vc(t){const e=t.value,r=t.valueSpec,o=t.style,a=t.styleSpec,c=t.key,u=t.arrayElementValidator||Vr;if(Tt(e)!=="array")return[new Oe(c,e,`array expected, ${Tt(e)} found`)];if(r.length&&e.length!==r.length)return[new Oe(c,e,`array length ${r.length} expected, length ${e.length} found`)];if(r["min-length"]&&e.length<r["min-length"])return[new Oe(c,e,`array length at least ${r["min-length"]} expected, length ${e.length} found`)];let d={type:r.value,values:r.values,minimum:r.minimum,maximum:r.maximum,function:void 0};a.$version<7&&(d.function=r.function),Tt(r.value)==="object"&&(d=r.value);let f=[];for(let g=0;g<e.length;g++)f=f.concat(u({array:e,arrayIndex:g,value:e[g],valueSpec:d,style:o,styleSpec:a,key:`${c}[${g}]`}));return f}function da(t){const e=t.key,r=t.value,o=t.valueSpec;let a=Tt(r);if(a==="number"&&r!=r&&(a="NaN"),a!=="number")return[new Oe(e,r,`number expected, ${a} found`)];if("minimum"in o){let c=o.minimum;if(Tt(o.minimum)==="array"&&(c=o.minimum[t.arrayIndex]),r<c)return[new Oe(e,r,`${r} is less than the minimum value ${c}`)]}if("maximum"in o){let c=o.maximum;if(Tt(o.maximum)==="array"&&(c=o.maximum[t.arrayIndex]),r>c)return[new Oe(e,r,`${r} is greater than the maximum value ${c}`)]}return[]}function ma(t){const e=t.valueSpec,r=mr(t.value.type);let o,a,c,u={};const d=r!=="categorical"&&t.value.property===void 0,f=!d,g=Tt(t.value.stops)==="array"&&Tt(t.value.stops[0])==="array"&&Tt(t.value.stops[0][0])==="object",x=Mi({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(k){if(r==="identity")return[new Oe(k.key,k.value,'identity function may not have a "stops" property')];let S=[];const I=k.value;return S=S.concat(Vc({key:k.key,value:I,valueSpec:k.valueSpec,style:k.style,styleSpec:k.styleSpec,arrayElementValidator:w})),Tt(I)==="array"&&I.length===0&&S.push(new Oe(k.key,I,"array must have at least one stop")),S},default:function(k){return Vr({key:k.key,value:k.value,valueSpec:e,style:k.style,styleSpec:k.styleSpec})}}});return r==="identity"&&d&&x.push(new Oe(t.key,t.value,'missing required property "property"')),r==="identity"||t.value.stops||x.push(new Oe(t.key,t.value,'missing required property "stops"')),r==="exponential"&&t.valueSpec.expression&&!rs(t.valueSpec)&&x.push(new Oe(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(f&&!vn(t.valueSpec)?x.push(new Oe(t.key,t.value,"property functions not supported")):d&&!ts(t.valueSpec)&&x.push(new Oe(t.key,t.value,"zoom functions not supported"))),r!=="categorical"&&!g||t.value.property!==void 0||x.push(new Oe(t.key,t.value,'"property" property is required')),x;function w(k){let S=[];const I=k.value,D=k.key;if(Tt(I)!=="array")return[new Oe(D,I,`array expected, ${Tt(I)} found`)];if(I.length!==2)return[new Oe(D,I,`array length 2 expected, length ${I.length} found`)];if(g){if(Tt(I[0])!=="object")return[new Oe(D,I,`object expected, ${Tt(I[0])} found`)];if(I[0].zoom===void 0)return[new Oe(D,I,"object stop key must have zoom")];if(I[0].value===void 0)return[new Oe(D,I,"object stop key must have value")];const U=mr(I[0].zoom);if(typeof U!="number")return[new Oe(D,I[0].zoom,"stop zoom values must be numbers")];if(c&&c>U)return[new Oe(D,I[0].zoom,"stop zoom values must appear in ascending order")];U!==c&&(c=U,a=void 0,u={}),S=S.concat(Mi({key:`${D}[0]`,value:I[0],valueSpec:{zoom:{}},style:k.style,styleSpec:k.styleSpec,objectElementValidators:{zoom:da,value:b}}))}else S=S.concat(b({key:`${D}[0]`,value:I[0],valueSpec:{},style:k.style,styleSpec:k.styleSpec},I));return bn(Ar(I[1]))?S.concat([new Oe(`${D}[1]`,I[1],"expressions are not allowed in function stops.")]):S.concat(Vr({key:`${D}[1]`,value:I[1],valueSpec:e,style:k.style,styleSpec:k.styleSpec}))}function b(k,S){const I=Tt(k.value),D=mr(k.value),U=k.value!==null?k.value:S;if(o){if(I!==o)return[new Oe(k.key,U,`${I} stop domain type must match previous stop domain type ${o}`)]}else o=I;if(I!=="number"&&I!=="string"&&I!=="boolean"&&typeof D!="number"&&typeof D!="string"&&typeof D!="boolean")return[new Oe(k.key,U,"stop domain value must be a number, string, or boolean")];if(I!=="number"&&r!=="categorical"){let Z=`number expected, ${I} found`;return vn(e)&&r===void 0&&(Z+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Oe(k.key,U,Z)]}return r!=="categorical"||I!=="number"||typeof D=="number"&&isFinite(D)&&Math.floor(D)===D?r!=="categorical"&&I==="number"&&typeof D=="number"&&typeof a=="number"&&a!==void 0&&D<a?[new Oe(k.key,U,"stop domain values must appear in ascending order")]:(a=D,r==="categorical"&&D in u?[new Oe(k.key,U,"stop domain values must be unique")]:(u[D]=!0,[])):[new Oe(k.key,U,`integer expected, found ${String(D)}`)]}}function Ir(t){const e=(t.expressionContext==="property"?pa:Tn)(Ar(t.value),t.valueSpec);if(e.result==="error")return e.value.map(o=>new Oe(`${t.key}${o.key}`,t.value,o.message));const r=e.value.expression||e.value._styleExpression.expression;if(t.expressionContext==="property"&&t.propertyKey==="text-font"&&!r.outputDefined())return[new Oe(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if(t.expressionContext==="property"&&t.propertyType==="layout"&&!eo(r))return[new Oe(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if(t.expressionContext==="filter")return fa(r,t);if(t.expressionContext&&t.expressionContext.indexOf("cluster")===0){if(!No(r,["zoom","feature-state"]))return[new Oe(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(t.expressionContext==="cluster-initial"&&!gn(r))return[new Oe(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function fa(t,e){const r=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(e.valueSpec&&e.valueSpec.expression)for(const a of e.valueSpec.expression.parameters)r.delete(a);if(r.size===0)return[];const o=[];return t instanceof Ji&&r.has(t.name)?[new Oe(e.key,e.value,`["${t.name}"] expression is not supported in a filter for a ${e.object.type} layer with id: ${e.object.id}`)]:(t.eachChild(a=>{o.push(...fa(a,e))}),o)}function ls(t){const e=t.key,r=t.value,o=t.valueSpec,a=[];return Array.isArray(o.values)?o.values.indexOf(mr(r))===-1&&a.push(new Oe(e,r,`expected one of [${o.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(o.values).indexOf(mr(r))===-1&&a.push(new Oe(e,r,`expected one of [${Object.keys(o.values).join(", ")}], ${JSON.stringify(r)} found`)),a}function gl(t){if(t===!0||t===!1)return!0;if(!Array.isArray(t)||t.length===0)return!1;switch(t[0]){case"has":return t.length>=2&&t[1]!=="$id"&&t[1]!=="$type";case"in":return t.length>=3&&(typeof t[1]!="string"||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!gl(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}function cs(t,e="fill"){if(t==null)return{filter:()=>!0,needGeometry:!1,needFeature:!1};gl(t)||(t=kn(t));const r=t;let o=!0;try{o=function(g){if(!En(g))return g;let x=Ar(g);return hs(x),x=Gc(x),x}(r)}catch{console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.
This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md
and paste the contents of this message in the report.
Thank you!
Filter Expression:
${JSON.stringify(r,null,2)}
        `)}const a=me[`filter_${e}`],c=Tn(o,a);let u=null;if(c.result==="error")throw new Error(c.value.map(g=>`${g.key}: ${g.message}`).join(", "));u=(g,x,w)=>c.value.evaluate(g,x,{},w);let d=null,f=null;if(o!==r){const g=Tn(r,a);if(g.result==="error")throw new Error(g.value.map(x=>`${x.key}: ${x.message}`).join(", "));d=(x,w,b,k,S)=>g.value.evaluate(x,w,{},b,void 0,void 0,k,S),f=!gn(g.value.expression)}return{filter:u,dynamicFilter:d||void 0,needGeometry:$c(o),needFeature:!!f}}function Gc(t){if(!Array.isArray(t))return t;const e=function(r){if(_l.has(r[0])){for(let o=1;o<r.length;o++)if(En(r[o]))return!0}return r}(t);return e===!0?e:e.map(r=>Gc(r))}function hs(t){let e=!1;const r=[];if(t[0]==="case"){for(let o=1;o<t.length-1;o+=2)e=e||En(t[o]),r.push(t[o+1]);r.push(t[t.length-1])}else if(t[0]==="match"){e=e||En(t[1]);for(let o=2;o<t.length-1;o+=2)r.push(t[o+1]);r.push(t[t.length-1])}else if(t[0]==="step"){e=e||En(t[1]);for(let o=1;o<t.length-1;o+=2)r.push(t[o+1])}e&&(t.length=0,t.push("any",...r));for(let o=1;o<t.length;o++)hs(t[o])}function En(t){if(!Array.isArray(t))return!1;if((e=t[0])==="pitch"||e==="distance-from-center")return!0;var e;for(let r=1;r<t.length;r++)if(En(t[r]))return!0;return!1}const _l=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function iu(t,e){return t<e?-1:t>e?1:0}function $c(t){if(!Array.isArray(t))return!1;if(t[0]==="within")return!0;for(let e=1;e<t.length;e++)if($c(t[e]))return!0;return!1}function kn(t){if(!t)return!0;const e=t[0];return t.length<=1?e!=="any":e==="=="?yl(t[1],t[2],"=="):e==="!="?us(yl(t[1],t[2],"==")):e==="<"||e===">"||e==="<="||e===">="?yl(t[1],t[2],e):e==="any"?(r=t.slice(1),["any"].concat(r.map(kn))):e==="all"?["all"].concat(t.slice(1).map(kn)):e==="none"?["all"].concat(t.slice(1).map(kn).map(us)):e==="in"?xl(t[1],t.slice(2)):e==="!in"?us(xl(t[1],t.slice(2))):e==="has"?vl(t[1]):e==="!has"?us(vl(t[1])):e!=="within"||t;var r}function yl(t,e,r){switch(t){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}function xl(t,e){if(e.length===0)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?["filter-in-large",t,["literal",e.sort(iu)]]:["filter-in-small",t,["literal",e]]}}function vl(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function us(t){return["!",t]}function ga(t){return gl(Ar(t.value))?Ir(Yi({},t,{expressionContext:"filter",valueSpec:t.styleSpec[`filter_${t.layerType||"fill"}`]})):_a(t)}function _a(t){const e=t.value,r=t.key;if(Tt(e)!=="array")return[new Oe(r,e,`array expected, ${Tt(e)} found`)];const o=t.styleSpec;let a,c=[];if(e.length<1)return[new Oe(r,e,"filter array must have at least 1 element")];switch(c=c.concat(ls({key:`${r}[0]`,value:e[0],valueSpec:o.filter_operator,style:t.style,styleSpec:t.styleSpec})),mr(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&mr(e[1])==="$type"&&c.push(new Oe(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&c.push(new Oe(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(a=Tt(e[1]),a!=="string"&&c.push(new Oe(`${r}[1]`,e[1],`string expected, ${a} found`)));for(let u=2;u<e.length;u++)a=Tt(e[u]),mr(e[1])==="$type"?c=c.concat(ls({key:`${r}[${u}]`,value:e[u],valueSpec:o.geometry_type,style:t.style,styleSpec:t.styleSpec})):a!=="string"&&a!=="number"&&a!=="boolean"&&c.push(new Oe(`${r}[${u}]`,e[u],`string, number, or boolean expected, ${a} found`));break;case"any":case"all":case"none":for(let u=1;u<e.length;u++)c=c.concat(_a({key:`${r}[${u}]`,value:e[u],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":a=Tt(e[1]),e.length!==2?c.push(new Oe(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):a!=="string"&&c.push(new Oe(`${r}[1]`,e[1],`string expected, ${a} found`));break;case"within":a=Tt(e[1]),e.length!==2?c.push(new Oe(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):a!=="object"&&c.push(new Oe(`${r}[1]`,e[1],`object expected, ${a} found`))}return c}function wl(t,e){const r=t.key,o=t.style,a=t.styleSpec,c=t.value,u=t.objectKey,d=a[`${e}_${t.layerType}`];if(!d)return[];const f=u.match(/^(.*)-transition$/);if(e==="paint"&&f&&d[f[1]]&&d[f[1]].transition)return Vr({key:r,value:c,valueSpec:a.transition,style:o,styleSpec:a});const g=t.valueSpec||d[u];if(!g)return[new Oe(r,c,`unknown property "${u}"`)];let x;if(Tt(c)==="string"&&vn(g)&&!g.tokens&&(x=/^{([^}]+)}$/.exec(c))){const b=`\`{ "type": "identity", "property": ${x?JSON.stringify(x[1]):'"_"'} }\``;return[new Oe(r,c,`"${u}" does not support interpolation syntax
Use an identity property function instead: ${b}.`)]}const w=[];return t.layerType==="symbol"&&(u==="text-field"&&o&&!o.glyphs&&w.push(new Oe(r,c,'use of "text-field" requires a style "glyphs" property')),u==="text-font"&&ha(Ar(c))&&mr(c.type)==="identity"&&w.push(new Oe(r,c,'"text-font" does not support identity functions'))),w.concat(Vr({key:t.key,value:c,valueSpec:g,style:o,styleSpec:a,expressionContext:"property",propertyType:e,propertyKey:u}))}function qc(t){return wl(t,"paint")}function bl(t){return wl(t,"layout")}function Zc(t){let e=[];const r=t.value,o=t.key,a=t.style,c=t.styleSpec;r.type||r.ref||e.push(new Oe(o,r,'either "type" or "ref" is required'));let u=mr(r.type);const d=mr(r.ref);if(r.id){const f=mr(r.id);for(let g=0;g<t.arrayIndex;g++){const x=a.layers[g];mr(x.id)===f&&e.push(new Oe(o,r.id,`duplicate layer id "${r.id}", previously used at line ${x.id.__line__}`))}}if("ref"in r){let f;["type","source","source-layer","filter","layout"].forEach(g=>{g in r&&e.push(new Oe(o,r[g],`"${g}" is prohibited for ref layers`))}),a.layers.forEach(g=>{mr(g.id)===d&&(f=g)}),f?f.ref?e.push(new Oe(o,r.ref,"ref cannot reference another ref layer")):u=mr(f.type):typeof d=="string"&&e.push(new Oe(o,r.ref,`ref layer "${d}" not found`))}else if(u!=="background"&&u!=="sky")if(r.source){const f=a.sources&&a.sources[r.source],g=f&&mr(f.type);f?g==="vector"&&u==="raster"?e.push(new Oe(o,r.source,`layer "${r.id}" requires a raster source`)):g==="raster"&&u!=="raster"?e.push(new Oe(o,r.source,`layer "${r.id}" requires a vector source`)):g!=="vector"||r["source-layer"]?g==="raster-dem"&&u!=="hillshade"?e.push(new Oe(o,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):u!=="line"||!r.paint||!r.paint["line-gradient"]&&!r.paint["line-trim-offset"]||g==="geojson"&&f.lineMetrics||e.push(new Oe(o,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new Oe(o,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new Oe(o,r.source,`source "${r.source}" not found`))}else e.push(new Oe(o,r,'missing required property "source"'));return e=e.concat(Mi({key:o,value:r,valueSpec:c.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":()=>[],type:()=>Vr({key:`${o}.type`,value:r.type,valueSpec:c.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"}),filter:f=>ga(Yi({layerType:u},f)),layout:f=>Mi({layer:r,key:f.key,value:f.value,valueSpec:{},style:f.style,styleSpec:f.styleSpec,objectElementValidators:{"*":g=>bl(Yi({layerType:u},g))}}),paint:f=>Mi({layer:r,key:f.key,value:f.value,valueSpec:{},style:f.style,styleSpec:f.styleSpec,objectElementValidators:{"*":g=>qc(Yi({layerType:u},g))}})}})),e}function bo(t){const e=t.value,r=t.key,o=Tt(e);return o!=="string"?[new Oe(r,e,`string expected, ${o} found`)]:[]}const Xc={promoteId:function({key:t,value:e}){if(Tt(e)==="string")return bo({key:t,value:e});{const r=[];for(const o in e)r.push(...bo({key:`${t}.${o}`,value:e[o]}));return r}}};function Wc(t){const e=t.value,r=t.key,o=t.styleSpec,a=t.style;if(!e.type)return[new Oe(r,e,'"type" is required')];const c=mr(e.type);let u;switch(c){case"vector":case"raster":case"raster-dem":return u=Mi({key:r,value:e,valueSpec:o[`source_${c.replace("-","_")}`],style:t.style,styleSpec:o,objectElementValidators:Xc}),u;case"geojson":if(u=Mi({key:r,value:e,valueSpec:o.source_geojson,style:a,styleSpec:o,objectElementValidators:Xc}),e.cluster)for(const d in e.clusterProperties){const[f,g]=e.clusterProperties[d],x=typeof f=="string"?[f,["accumulated"],["get",d]]:f;u.push(...Ir({key:`${r}.${d}.map`,value:g,expressionContext:"cluster-map"})),u.push(...Ir({key:`${r}.${d}.reduce`,value:x,expressionContext:"cluster-reduce"}))}return u;case"video":return Mi({key:r,value:e,valueSpec:o.source_video,style:a,styleSpec:o});case"image":return Mi({key:r,value:e,valueSpec:o.source_image,style:a,styleSpec:o});case"canvas":return[new Oe(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return ls({key:`${r}.type`,value:e.type,valueSpec:{values:ou(o)},style:a,styleSpec:o})}}function ou(t){return t.source.reduce((e,r)=>{const o=t[r];return o.type.type==="enum"&&(e=e.concat(Object.keys(o.type.values))),e},[])}function Yc(t){const e=t.value,r=t.styleSpec,o=r.light,a=t.style;let c=[];const u=Tt(e);if(e===void 0)return c;if(u!=="object")return c=c.concat([new Oe("light",e,`object expected, ${u} found`)]),c;for(const d in e){const f=d.match(/^(.*)-transition$/);c=c.concat(f&&o[f[1]]&&o[f[1]].transition?Vr({key:d,value:e[d],valueSpec:r.transition,style:a,styleSpec:r}):o[d]?Vr({key:d,value:e[d],valueSpec:o[d],style:a,styleSpec:r}):[new Oe(d,e[d],`unknown property "${d}"`)])}return c}function Tl(t){const e=t.value,r=t.key,o=t.style,a=t.styleSpec,c=a.terrain;let u=[];const d=Tt(e);if(e===void 0)return u;if(d!=="object")return u=u.concat([new Oe("terrain",e,`object expected, ${d} found`)]),u;for(const f in e){const g=f.match(/^(.*)-transition$/);u=u.concat(g&&c[g[1]]&&c[g[1]].transition?Vr({key:f,value:e[f],valueSpec:a.transition,style:o,styleSpec:a}):c[f]?Vr({key:f,value:e[f],valueSpec:c[f],style:o,styleSpec:a}):[new Oe(f,e[f],`unknown property "${f}"`)])}if(e.source){const f=o.sources&&o.sources[e.source],g=f&&mr(f.type);f?g!=="raster-dem"&&u.push(new Oe(r,e.source,`terrain cannot be used with a source of type ${String(g)}, it only be used with a "raster-dem" source type`)):u.push(new Oe(r,e.source,`source "${e.source}" not found`))}else u.push(new Oe(r,e,'terrain is missing required property "source"'));return u}function Hc(t){const e=t.value,r=t.style,o=t.styleSpec,a=o.fog;let c=[];const u=Tt(e);if(e===void 0)return c;if(u!=="object")return c=c.concat([new Oe("fog",e,`object expected, ${u} found`)]),c;for(const d in e){const f=d.match(/^(.*)-transition$/);c=c.concat(f&&a[f[1]]&&a[f[1]].transition?Vr({key:d,value:e[d],valueSpec:o.transition,style:r,styleSpec:o}):a[d]?Vr({key:d,value:e[d],valueSpec:a[d],style:r,styleSpec:o}):[new Oe(d,e[d],`unknown property "${d}"`)])}return c}const Kc={"*":()=>[],array:Vc,boolean:function(t){const e=t.value,r=t.key,o=Tt(e);return o!=="boolean"?[new Oe(r,e,`boolean expected, ${o} found`)]:[]},number:da,color:function(t){const e=t.key,r=t.value,o=Tt(r);return o!=="string"?[new Oe(e,r,`color expected, ${o} found`)]:Ns(r)===null?[new Oe(e,r,`color expected, "${r}" found`)]:[]},enum:ls,filter:ga,function:ma,layer:Zc,object:Mi,source:Wc,light:Yc,terrain:Tl,fog:Hc,string:bo,formatted:function(t){return bo(t).length===0?[]:Ir(t)},resolvedImage:function(t){return bo(t).length===0?[]:Ir(t)},projection:function(t){const e=t.value,r=t.styleSpec,o=r.projection,a=t.style;let c=[];const u=Tt(e);if(u==="object")for(const d in e)c=c.concat(Vr({key:d,value:e[d],valueSpec:o[d],style:a,styleSpec:r}));else u!=="string"&&(c=c.concat([new Oe("projection",e,`object or string expected, ${u} found`)]));return c}};function Vr(t){const e=t.value,r=t.valueSpec,o=t.styleSpec;return r.expression&&ha(mr(e))?ma(t):r.expression&&bn(Ar(e))?Ir(t):r.type&&Kc[r.type]?Kc[r.type](t):Mi(Yi({},t,{valueSpec:r.type?o[r.type]:r}))}function nu(t){const e=t.value,r=t.key,o=bo(t);return o.length||(e.indexOf("{fontstack}")===-1&&o.push(new Oe(r,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&o.push(new Oe(r,e,'"glyphs" url must include a "{range}" token'))),o}function Jc(t,e=me){return yi(Vr({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:nu,"*":()=>[]}}))}const au=t=>yi(qc(t)),su=t=>yi(bl(t));function yi(t){return t.slice().sort((e,r)=>e.line&&r.line?e.line-r.line:0)}function Qc(t,e){let r=!1;if(e&&e.length)for(const o of e)t.fire(new Wi(new Error(o.message))),r=!0;return r}var lu=Oi,Ai=3;function Oi(t,e,r){var o=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var a=new Int32Array(this.arrayBuffer);t=a[0],this.d=(e=a[1])+2*(r=a[2]);for(var c=0;c<this.d*this.d;c++){var u=a[Ai+c],d=a[Ai+c+1];o.push(u===d?null:a.subarray(u,d))}var f=a[Ai+o.length+1];this.keys=a.subarray(a[Ai+o.length],f),this.bboxes=a.subarray(f),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var g=0;g<this.d*this.d;g++)o.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var x=r/e*t;this.min=-x,this.max=t+x}Oi.prototype.insert=function(t,e,r,o,a){this._forEachCell(e,r,o,a,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(o),this.bboxes.push(a)},Oi.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Oi.prototype._insertCell=function(t,e,r,o,a,c){this.cells[a].push(c)},Oi.prototype.query=function(t,e,r,o,a){var c=this.min,u=this.max;if(t<=c&&e<=c&&u<=r&&u<=o&&!a)return Array.prototype.slice.call(this.keys);var d=[];return this._forEachCell(t,e,r,o,this._queryCell,d,{},a),d},Oi.prototype._queryCell=function(t,e,r,o,a,c,u,d){var f=this.cells[a];if(f!==null)for(var g=this.keys,x=this.bboxes,w=0;w<f.length;w++){var b=f[w];if(u[b]===void 0){var k=4*b;(d?d(x[k+0],x[k+1],x[k+2],x[k+3]):t<=x[k+2]&&e<=x[k+3]&&r>=x[k+0]&&o>=x[k+1])?(u[b]=!0,c.push(g[b])):u[b]=!1}}},Oi.prototype._forEachCell=function(t,e,r,o,a,c,u,d){for(var f=this._convertToCellCoord(t),g=this._convertToCellCoord(e),x=this._convertToCellCoord(r),w=this._convertToCellCoord(o),b=f;b<=x;b++)for(var k=g;k<=w;k++){var S=this.d*k+b;if((!d||d(this._convertFromCellCoord(b),this._convertFromCellCoord(k),this._convertFromCellCoord(b+1),this._convertFromCellCoord(k+1)))&&a.call(this,t,e,r,o,S,c,u,d))return}},Oi.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Oi.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Oi.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=Ai+this.cells.length+1+1,r=0,o=0;o<this.cells.length;o++)r+=this.cells[o].length;var a=new Int32Array(e+r+this.keys.length+this.bboxes.length);a[0]=this.extent,a[1]=this.n,a[2]=this.padding;for(var c=e,u=0;u<t.length;u++){var d=t[u];a[Ai+u]=c,a.set(d,c),c+=d.length}return a[Ai+t.length]=c,a.set(this.keys,c),a[Ai+t.length+1]=c+=this.keys.length,a.set(this.bboxes,c),c+=this.bboxes.length,a.buffer};var $o=ai(lu);const ps={};function Ue(t,e,r={}){Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),ps[e]={klass:t,omit:r.omit||[]}}Ue(Object,"Object"),$o.serialize=function(t,e){const r=t.toArrayBuffer();return e&&e.push(r),{buffer:r}},$o.deserialize=function(t){return new $o(t.buffer)},Object.defineProperty($o,"name",{value:"Grid"}),Ue($o,"Grid"),Ue(ur,"Color"),Ue(Error,"Error"),Ue(vo,"AJAXError"),Ue(gi,"ResolvedImage"),Ue(as,"StylePropertyFunction"),Ue(ns,"StyleExpression",{omit:["_evaluator"]}),Ue(ua,"ZoomDependentExpression"),Ue(fl,"ZoomConstantExpression"),Ue(Ji,"CompoundExpression",{omit:["_evaluate"]});for(const t in ca)ps[ca[t]._classRegistryKey]||Ue(ca[t],`Expression${t}`);function El(t){return t&&typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||t.constructor&&t.constructor.name==="ArrayBuffer")}function kl(t){return ve.ImageBitmap&&t instanceof ve.ImageBitmap}function Sn(t,e){if(t==null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(El(t)||kl(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){const r=t;return e&&e.push(r.buffer),r}if(t instanceof ve.ImageData)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){const r=[];for(const o of t)r.push(Sn(o,e));return r}if(typeof t=="object"){const r=t.constructor,o=r._classRegistryKey;if(!o)throw new Error(`can't serialize object of unregistered class ${o}`);const a=r.serialize?r.serialize(t,e):{};if(!r.serialize){for(const c in t)t.hasOwnProperty(c)&&(ps[o].omit.indexOf(c)>=0||(a[c]=Sn(t[c],e)));t instanceof Error&&(a.message=t.message)}if(a.$name)throw new Error("$name property is reserved for worker serialization logic.");return o!=="Object"&&(a.$name=o),a}throw new Error("can't serialize object of type "+typeof t)}function qo(t){if(t==null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||El(t)||kl(t)||ArrayBuffer.isView(t)||t instanceof ve.ImageData)return t;if(Array.isArray(t))return t.map(qo);if(typeof t=="object"){const e=t.$name||"Object",{klass:r}=ps[e];if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(t);const o=Object.create(r.prototype);for(const a of Object.keys(t))a!=="$name"&&(o[a]=qo(t[a]));return o}throw new Error("can't deserialize object of type "+typeof t)}const Be={"Latin-1 Supplement":t=>t>=128&&t<=255,Arabic:t=>t>=1536&&t<=1791,"Arabic Supplement":t=>t>=1872&&t<=1919,"Arabic Extended-A":t=>t>=2208&&t<=2303,"Hangul Jamo":t=>t>=4352&&t<=4607,"Unified Canadian Aboriginal Syllabics":t=>t>=5120&&t<=5759,Khmer:t=>t>=6016&&t<=6143,"Unified Canadian Aboriginal Syllabics Extended":t=>t>=6320&&t<=6399,"General Punctuation":t=>t>=8192&&t<=8303,"Letterlike Symbols":t=>t>=8448&&t<=8527,"Number Forms":t=>t>=8528&&t<=8591,"Miscellaneous Technical":t=>t>=8960&&t<=9215,"Control Pictures":t=>t>=9216&&t<=9279,"Optical Character Recognition":t=>t>=9280&&t<=9311,"Enclosed Alphanumerics":t=>t>=9312&&t<=9471,"Geometric Shapes":t=>t>=9632&&t<=9727,"Miscellaneous Symbols":t=>t>=9728&&t<=9983,"Miscellaneous Symbols and Arrows":t=>t>=11008&&t<=11263,"CJK Radicals Supplement":t=>t>=11904&&t<=12031,"Kangxi Radicals":t=>t>=12032&&t<=12255,"Ideographic Description Characters":t=>t>=12272&&t<=12287,"CJK Symbols and Punctuation":t=>t>=12288&&t<=12351,Hiragana:t=>t>=12352&&t<=12447,Katakana:t=>t>=12448&&t<=12543,Bopomofo:t=>t>=12544&&t<=12591,"Hangul Compatibility Jamo":t=>t>=12592&&t<=12687,Kanbun:t=>t>=12688&&t<=12703,"Bopomofo Extended":t=>t>=12704&&t<=12735,"CJK Strokes":t=>t>=12736&&t<=12783,"Katakana Phonetic Extensions":t=>t>=12784&&t<=12799,"Enclosed CJK Letters and Months":t=>t>=12800&&t<=13055,"CJK Compatibility":t=>t>=13056&&t<=13311,"CJK Unified Ideographs Extension A":t=>t>=13312&&t<=19903,"Yijing Hexagram Symbols":t=>t>=19904&&t<=19967,"CJK Unified Ideographs":t=>t>=19968&&t<=40959,"Yi Syllables":t=>t>=40960&&t<=42127,"Yi Radicals":t=>t>=42128&&t<=42191,"Hangul Jamo Extended-A":t=>t>=43360&&t<=43391,"Hangul Syllables":t=>t>=44032&&t<=55215,"Hangul Jamo Extended-B":t=>t>=55216&&t<=55295,"Private Use Area":t=>t>=57344&&t<=63743,"CJK Compatibility Ideographs":t=>t>=63744&&t<=64255,"Arabic Presentation Forms-A":t=>t>=64336&&t<=65023,"Vertical Forms":t=>t>=65040&&t<=65055,"CJK Compatibility Forms":t=>t>=65072&&t<=65103,"Small Form Variants":t=>t>=65104&&t<=65135,"Arabic Presentation Forms-B":t=>t>=65136&&t<=65279,"Halfwidth and Fullwidth Forms":t=>t>=65280&&t<=65519};function Sl(t){for(const e of t)if(Ml(e.charCodeAt(0)))return!0;return!1}function cu(t){for(const e of t)if(!eh(e.charCodeAt(0)))return!1;return!0}function eh(t){return!(Be.Arabic(t)||Be["Arabic Supplement"](t)||Be["Arabic Extended-A"](t)||Be["Arabic Presentation Forms-A"](t)||Be["Arabic Presentation Forms-B"](t))}function Ml(t){return!(t!==746&&t!==747&&(t<4352||!(Be["Bopomofo Extended"](t)||Be.Bopomofo(t)||Be["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Be["CJK Compatibility Ideographs"](t)||Be["CJK Compatibility"](t)||Be["CJK Radicals Supplement"](t)||Be["CJK Strokes"](t)||!(!Be["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||t===12336)||Be["CJK Unified Ideographs Extension A"](t)||Be["CJK Unified Ideographs"](t)||Be["Enclosed CJK Letters and Months"](t)||Be["Hangul Compatibility Jamo"](t)||Be["Hangul Jamo Extended-A"](t)||Be["Hangul Jamo Extended-B"](t)||Be["Hangul Jamo"](t)||Be["Hangul Syllables"](t)||Be.Hiragana(t)||Be["Ideographic Description Characters"](t)||Be.Kanbun(t)||Be["Kangxi Radicals"](t)||Be["Katakana Phonetic Extensions"](t)||Be.Katakana(t)&&t!==12540||!(!Be["Halfwidth and Fullwidth Forms"](t)||t===65288||t===65289||t===65293||t>=65306&&t<=65310||t===65339||t===65341||t===65343||t>=65371&&t<=65503||t===65507||t>=65512&&t<=65519)||!(!Be["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Be["Unified Canadian Aboriginal Syllabics"](t)||Be["Unified Canadian Aboriginal Syllabics Extended"](t)||Be["Vertical Forms"](t)||Be["Yijing Hexagram Symbols"](t)||Be["Yi Syllables"](t)||Be["Yi Radicals"](t))))}function th(t){return!(Ml(t)||function(e){return!!(Be["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||Be["General Punctuation"](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||Be["Letterlike Symbols"](e)||Be["Number Forms"](e)||Be["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||Be["Control Pictures"](e)&&e!==9251||Be["Optical Character Recognition"](e)||Be["Enclosed Alphanumerics"](e)||Be["Geometric Shapes"](e)||Be["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||Be["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Be["CJK Symbols and Punctuation"](e)||Be.Katakana(e)||Be["Private Use Area"](e)||Be["CJK Compatibility Forms"](e)||Be["Small Form Variants"](e)||Be["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(t))}function rh(t){return t>=1424&&t<=2303||Be["Arabic Presentation Forms-A"](t)||Be["Arabic Presentation Forms-B"](t)}function hu(t,e){return!(!e&&rh(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Be.Khmer(t))}function uu(t){for(const e of t)if(rh(e.charCodeAt(0)))return!0;return!1}const Al="deferred",Il="loading",Cl="loaded";let Mn=null,l="unavailable",i=null;const n=function(t){t&&typeof t=="string"&&t.indexOf("NetworkError")>-1&&(l="error"),Mn&&Mn(t)};function h(){p.fire(new Fo("pluginStateChange",{pluginStatus:l,pluginURL:i}))}const p=new Xn,m=function(){return l},_=function(){if(l!==Al||!i)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");l=Il,h(),i&&ln({url:i},t=>{t?n(t):(l=Cl,h())})},y={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>l===Cl||y.applyArabicShaping!=null,isLoading:()=>l===Il,setState(t){l=t.pluginStatus,i=t.pluginURL},isParsed:()=>y.applyArabicShaping!=null&&y.processBidirectionalText!=null&&y.processStyledBidirectionalText!=null,getPluginURL:()=>i};class v{constructor(e,r){this.zoom=e,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.transition=r.transition,this.pitch=r.pitch):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0)}isSupportedScript(e){return function(r,o){for(const a of r)if(!hu(a.charCodeAt(0),o))return!1;return!0}(e,y.isLoaded())}}class E{constructor(e,r){this.property=e,this.value=r,this.expression=function(o,a){if(ha(o))return new as(o,a);if(bn(o)){const c=pa(o,a);if(c.result==="error")throw new Error(c.value.map(u=>`${u.key}: ${u.message}`).join(", "));return c.value}{let c=o;return typeof o=="string"&&a.type==="color"&&(c=ur.parse(o)),{kind:"constant",evaluate:()=>c}}}(r===void 0?e.specification.default:r,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,r,o){return this.property.possiblyEvaluate(this,e,r,o)}}class T{constructor(e){this.property=e,this.value=new E(e,void 0)}transitioned(e,r){return new P(this.property,this.value,r,sr({},e.transition,this.transition),e.now)}untransitioned(){return new P(this.property,this.value,null,{},0)}}class M{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return si(this._values[e].value.value)}setValue(e,r){this._values.hasOwnProperty(e)||(this._values[e]=new T(this._values[e].property)),this._values[e].value=new E(this._values[e].property,r===null?void 0:si(r))}getTransition(e){return si(this._values[e].transition)}setTransition(e,r){this._values.hasOwnProperty(e)||(this._values[e]=new T(this._values[e].property)),this._values[e].transition=si(r)||void 0}serialize(){const e={};for(const r of Object.keys(this._values)){const o=this.getValue(r);o!==void 0&&(e[r]=o);const a=this.getTransition(r);a!==void 0&&(e[`${r}-transition`]=a)}return e}transitioned(e,r){const o=new R(this._properties);for(const a of Object.keys(this._values))o._values[a]=this._values[a].transitioned(e,r._values[a]);return o}untransitioned(){const e=new R(this._properties);for(const r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}}class P{constructor(e,r,o,a,c){const u=a.delay||0,d=a.duration||0;c=c||0,this.property=e,this.value=r,this.begin=c+u,this.end=this.begin+d,e.specification.transition&&(a.delay||a.duration)&&(this.prior=o)}possiblyEvaluate(e,r,o){const a=e.now||0,c=this.value.possiblyEvaluate(e,r,o),u=this.prior;if(u){if(a>this.end)return this.prior=null,c;if(this.value.isDataDriven())return this.prior=null,c;if(a<this.begin)return u.possiblyEvaluate(e,r,o);{const d=(a-this.begin)/(this.end-this.begin);return this.property.interpolate(u.possiblyEvaluate(e,r,o),c,wt(d))}}return c}}class R{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,o){const a=new O(this._properties);for(const c of Object.keys(this._values))a._values[c]=this._values[c].possiblyEvaluate(e,r,o);return a}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class F{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}getValue(e){return si(this._values[e].value)}setValue(e,r){this._values[e]=new E(this._values[e].property,r===null?void 0:si(r))}serialize(){const e={};for(const r of Object.keys(this._values)){const o=this.getValue(r);o!==void 0&&(e[r]=o)}return e}possiblyEvaluate(e,r,o){const a=new O(this._properties);for(const c of Object.keys(this._values))a._values[c]=this._values[c].possiblyEvaluate(e,r,o);return a}}class B{constructor(e,r,o){this.property=e,this.value=r,this.parameters=o}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,r,o,a){return this.property.evaluate(this.value,this.parameters,e,r,o,a)}}class O{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class A{constructor(e){this.specification=e}possiblyEvaluate(e,r){return e.expression.evaluate(r)}interpolate(e,r,o){const a=oa[this.specification.type];return a?a(e,r,o):e}}class L{constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,o,a){return new B(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(r,null,{},o,a)}:e.expression,r)}interpolate(e,r,o){if(e.value.kind!=="constant"||r.value.kind!=="constant")return e;if(e.value.value===void 0||r.value.value===void 0)return new B(this,{kind:"constant",value:void 0},e.parameters);const a=oa[this.specification.type];return a?new B(this,{kind:"constant",value:a(e.value.value,r.value.value,o)},e.parameters):e}evaluate(e,r,o,a,c,u){return e.kind==="constant"?e.value:e.evaluate(r,o,a,c,u)}}class N{constructor(e){this.specification=e}possiblyEvaluate(e,r,o,a){return!!e.expression.evaluate(r,null,{},o,a)}interpolate(){return!1}}class V{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];const r=new v(0,{});for(const o in e){const a=e[o];a.specification.overridable&&this.overridableProperties.push(o);const c=this.defaultPropertyValues[o]=new E(a,void 0),u=this.defaultTransitionablePropertyValues[o]=new T(a);this.defaultTransitioningPropertyValues[o]=u.untransitioned(),this.defaultPossiblyEvaluatedValues[o]=c.possiblyEvaluate(r)}}}function H(t,e){return 256*(t=it(Math.floor(t),0,255))+it(Math.floor(e),0,255)}Ue(L,"DataDrivenProperty"),Ue(A,"DataConstantProperty"),Ue(N,"ColorRampProperty");const J={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class K{constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class re{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function te(t,e=1){let r=0,o=0;return{members:t.map(a=>{const c=J[a.type].BYTES_PER_ELEMENT,u=r=le(r,Math.max(e,c)),d=a.components||1;return o=Math.max(o,c),r+=c*d,{name:a.name,type:a.type,components:d,offset:u}}),size:le(r,Math.max(o,e)),alignment:e}}function le(t,e){return Math.ceil(t/e)*e}class Ee extends re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){const o=this.length;return this.resize(o+1),this.emplace(o,e,r)}emplace(e,r,o){const a=2*e;return this.int16[a+0]=r,this.int16[a+1]=o,e}}Ee.prototype.bytesPerElement=4,Ue(Ee,"StructArrayLayout2i4");class ne extends re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,r,o)}emplace(e,r,o,a){const c=3*e;return this.int16[c+0]=r,this.int16[c+1]=o,this.int16[c+2]=a,e}}ne.prototype.bytesPerElement=6,Ue(ne,"StructArrayLayout3i6");class _e extends re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,o,a){const c=this.length;return this.resize(c+1),this.emplace(c,e,r,o,a)}emplace(e,r,o,a,c){const u=4*e;return this.int16[u+0]=r,this.int16[u+1]=o,this.int16[u+2]=a,this.int16[u+3]=c,e}}_e.prototype.bytesPerElement=8,Ue(_e,"StructArrayLayout4i8");class he extends re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,o,a,c,u,d){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,o,a,c,u,d)}emplace(e,r,o,a,c,u,d,f){const g=6*e,x=12*e,w=3*e;return this.int16[g+0]=r,this.int16[g+1]=o,this.uint8[x+4]=a,this.uint8[x+5]=c,this.uint8[x+6]=u,this.uint8[x+7]=d,this.float32[w+2]=f,e}}he.prototype.bytesPerElement=12,Ue(he,"StructArrayLayout2i4ub1f12");class Te extends re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,o,a){const c=this.length;return this.resize(c+1),this.emplace(c,e,r,o,a)}emplace(e,r,o,a,c){const u=4*e;return this.float32[u+0]=r,this.float32[u+1]=o,this.float32[u+2]=a,this.float32[u+3]=c,e}}Te.prototype.bytesPerElement=16,Ue(Te,"StructArrayLayout4f16");class se extends re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,o,a,c){const u=this.length;return this.resize(u+1),this.emplace(u,e,r,o,a,c)}emplace(e,r,o,a,c,u){const d=6*e,f=3*e;return this.uint16[d+0]=r,this.uint16[d+1]=o,this.uint16[d+2]=a,this.uint16[d+3]=c,this.float32[f+2]=u,e}}se.prototype.bytesPerElement=12,Ue(se,"StructArrayLayout4ui1f12");class ge extends re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,o,a){const c=this.length;return this.resize(c+1),this.emplace(c,e,r,o,a)}emplace(e,r,o,a,c){const u=4*e;return this.uint16[u+0]=r,this.uint16[u+1]=o,this.uint16[u+2]=a,this.uint16[u+3]=c,e}}ge.prototype.bytesPerElement=8,Ue(ge,"StructArrayLayout4ui8");class Se extends re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,o,a,c,u){const d=this.length;return this.resize(d+1),this.emplace(d,e,r,o,a,c,u)}emplace(e,r,o,a,c,u,d){const f=6*e;return this.int16[f+0]=r,this.int16[f+1]=o,this.int16[f+2]=a,this.int16[f+3]=c,this.int16[f+4]=u,this.int16[f+5]=d,e}}Se.prototype.bytesPerElement=12,Ue(Se,"StructArrayLayout6i12");class we extends re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,o,a,c,u,d,f,g,x,w,b){const k=this.length;return this.resize(k+1),this.emplace(k,e,r,o,a,c,u,d,f,g,x,w,b)}emplace(e,r,o,a,c,u,d,f,g,x,w,b,k){const S=12*e;return this.int16[S+0]=r,this.int16[S+1]=o,this.int16[S+2]=a,this.int16[S+3]=c,this.uint16[S+4]=u,this.uint16[S+5]=d,this.uint16[S+6]=f,this.uint16[S+7]=g,this.int16[S+8]=x,this.int16[S+9]=w,this.int16[S+10]=b,this.int16[S+11]=k,e}}we.prototype.bytesPerElement=24,Ue(we,"StructArrayLayout4i4ui4i24");class Me extends re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,o,a,c,u){const d=this.length;return this.resize(d+1),this.emplace(d,e,r,o,a,c,u)}emplace(e,r,o,a,c,u,d){const f=10*e,g=5*e;return this.int16[f+0]=r,this.int16[f+1]=o,this.int16[f+2]=a,this.float32[g+2]=c,this.float32[g+3]=u,this.float32[g+4]=d,e}}Me.prototype.bytesPerElement=20,Ue(Me,"StructArrayLayout3i3f20");class qe extends re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint32[1*e+0]=r,e}}qe.prototype.bytesPerElement=4,Ue(qe,"StructArrayLayout1ul4");class Qe extends re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,o,a,c,u,d,f,g,x,w,b,k){const S=this.length;return this.resize(S+1),this.emplace(S,e,r,o,a,c,u,d,f,g,x,w,b,k)}emplace(e,r,o,a,c,u,d,f,g,x,w,b,k,S){const I=20*e,D=10*e;return this.int16[I+0]=r,this.int16[I+1]=o,this.int16[I+2]=a,this.int16[I+3]=c,this.int16[I+4]=u,this.float32[D+3]=d,this.float32[D+4]=f,this.float32[D+5]=g,this.float32[D+6]=x,this.int16[I+14]=w,this.uint32[D+8]=b,this.uint16[I+18]=k,this.uint16[I+19]=S,e}}Qe.prototype.bytesPerElement=40,Ue(Qe,"StructArrayLayout5i4f1i1ul2ui40");class je extends re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,o,a,c,u,d){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,o,a,c,u,d)}emplace(e,r,o,a,c,u,d,f){const g=8*e;return this.int16[g+0]=r,this.int16[g+1]=o,this.int16[g+2]=a,this.int16[g+4]=c,this.int16[g+5]=u,this.int16[g+6]=d,this.int16[g+7]=f,e}}je.prototype.bytesPerElement=16,Ue(je,"StructArrayLayout3i2i2i16");class We extends re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,o,a,c){const u=this.length;return this.resize(u+1),this.emplace(u,e,r,o,a,c)}emplace(e,r,o,a,c,u){const d=4*e,f=8*e;return this.float32[d+0]=r,this.float32[d+1]=o,this.float32[d+2]=a,this.int16[f+6]=c,this.int16[f+7]=u,e}}We.prototype.bytesPerElement=16,Ue(We,"StructArrayLayout2f1f2i16");class mt extends re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,o,a){const c=this.length;return this.resize(c+1),this.emplace(c,e,r,o,a)}emplace(e,r,o,a,c){const u=12*e,d=3*e;return this.uint8[u+0]=r,this.uint8[u+1]=o,this.float32[d+1]=a,this.float32[d+2]=c,e}}mt.prototype.bytesPerElement=12,Ue(mt,"StructArrayLayout2ub2f12");class ut extends re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,r,o)}emplace(e,r,o,a){const c=3*e;return this.float32[c+0]=r,this.float32[c+1]=o,this.float32[c+2]=a,e}}ut.prototype.bytesPerElement=12,Ue(ut,"StructArrayLayout3f12");class $e extends re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,r,o)}emplace(e,r,o,a){const c=3*e;return this.uint16[c+0]=r,this.uint16[c+1]=o,this.uint16[c+2]=a,e}}$e.prototype.bytesPerElement=6,Ue($e,"StructArrayLayout3ui6");class It extends re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,r,o,a,c,u,d,f,g,x,w,b,k,S,I,D,U,Z,j,$,W){const X=this.length;return this.resize(X+1),this.emplace(X,e,r,o,a,c,u,d,f,g,x,w,b,k,S,I,D,U,Z,j,$,W)}emplace(e,r,o,a,c,u,d,f,g,x,w,b,k,S,I,D,U,Z,j,$,W,X){const ce=30*e,ae=15*e,fe=60*e;return this.int16[ce+0]=r,this.int16[ce+1]=o,this.int16[ce+2]=a,this.float32[ae+2]=c,this.float32[ae+3]=u,this.uint16[ce+8]=d,this.uint16[ce+9]=f,this.uint32[ae+5]=g,this.uint32[ae+6]=x,this.uint32[ae+7]=w,this.uint16[ce+16]=b,this.uint16[ce+17]=k,this.uint16[ce+18]=S,this.float32[ae+10]=I,this.float32[ae+11]=D,this.uint8[fe+48]=U,this.uint8[fe+49]=Z,this.uint8[fe+50]=j,this.uint32[ae+13]=$,this.int16[ce+28]=W,this.uint8[fe+58]=X,e}}It.prototype.bytesPerElement=60,Ue(It,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class Lt extends re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,r,o,a,c,u,d,f,g,x,w,b,k,S,I,D,U,Z,j,$,W,X,ce,ae,fe,ke,ue,ye,xe,be){const Ie=this.length;return this.resize(Ie+1),this.emplace(Ie,e,r,o,a,c,u,d,f,g,x,w,b,k,S,I,D,U,Z,j,$,W,X,ce,ae,fe,ke,ue,ye,xe,be)}emplace(e,r,o,a,c,u,d,f,g,x,w,b,k,S,I,D,U,Z,j,$,W,X,ce,ae,fe,ke,ue,ye,xe,be,Ie){const de=38*e,Le=19*e;return this.int16[de+0]=r,this.int16[de+1]=o,this.int16[de+2]=a,this.float32[Le+2]=c,this.float32[Le+3]=u,this.int16[de+8]=d,this.int16[de+9]=f,this.int16[de+10]=g,this.int16[de+11]=x,this.int16[de+12]=w,this.int16[de+13]=b,this.uint16[de+14]=k,this.uint16[de+15]=S,this.uint16[de+16]=I,this.uint16[de+17]=D,this.uint16[de+18]=U,this.uint16[de+19]=Z,this.uint16[de+20]=j,this.uint16[de+21]=$,this.uint16[de+22]=W,this.uint16[de+23]=X,this.uint16[de+24]=ce,this.uint16[de+25]=ae,this.uint16[de+26]=fe,this.uint16[de+27]=ke,this.uint16[de+28]=ue,this.uint32[Le+15]=ye,this.float32[Le+16]=xe,this.float32[Le+17]=be,this.float32[Le+18]=Ie,e}}Lt.prototype.bytesPerElement=76,Ue(Lt,"StructArrayLayout3i2f6i15ui1ul3f76");class Rt extends re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.float32[1*e+0]=r,e}}Rt.prototype.bytesPerElement=4,Ue(Rt,"StructArrayLayout1f4");class Bt extends re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,o,a,c){const u=this.length;return this.resize(u+1),this.emplace(u,e,r,o,a,c)}emplace(e,r,o,a,c,u){const d=5*e;return this.float32[d+0]=r,this.float32[d+1]=o,this.float32[d+2]=a,this.float32[d+3]=c,this.float32[d+4]=u,e}}Bt.prototype.bytesPerElement=20,Ue(Bt,"StructArrayLayout5f20");class Gr extends re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,o,a){const c=this.length;return this.resize(c+1),this.emplace(c,e,r,o,a)}emplace(e,r,o,a,c){const u=6*e;return this.uint32[3*e+0]=r,this.uint16[u+2]=o,this.uint16[u+3]=a,this.uint16[u+4]=c,e}}Gr.prototype.bytesPerElement=12,Ue(Gr,"StructArrayLayout1ul3ui12");class Cr extends re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){const o=this.length;return this.resize(o+1),this.emplace(o,e,r)}emplace(e,r,o){const a=2*e;return this.uint16[a+0]=r,this.uint16[a+1]=o,e}}Cr.prototype.bytesPerElement=4,Ue(Cr,"StructArrayLayout2ui4");class xi extends re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint16[1*e+0]=r,e}}xi.prototype.bytesPerElement=2,Ue(xi,"StructArrayLayout1ui2");class Ui extends re{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){const o=this.length;return this.resize(o+1),this.emplace(o,e,r)}emplace(e,r,o){const a=2*e;return this.float32[a+0]=r,this.float32[a+1]=o,e}}Ui.prototype.bytesPerElement=8,Ue(Ui,"StructArrayLayout2f8");class Jt extends K{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}Jt.prototype.size=40;class Ft extends Qe{get(e){return new Jt(this,e)}}Ue(Ft,"CollisionBoxArray");class kt extends K{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(e){this._structArray.uint8[this._pos1+49]=e}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(e){this._structArray.uint8[this._pos1+50]=e}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(e){this._structArray.uint32[this._pos4+13]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(e){this._structArray.uint8[this._pos1+58]=e}}kt.prototype.size=60;class fr extends It{get(e){return new kt(this,e)}}Ue(fr,"PlacedSymbolArray");class Wr extends K{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+11]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+13]}get key(){return this._structArray.uint16[this._pos2+14]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+17]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+19]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+21]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+22]}get featureIndex(){return this._structArray.uint16[this._pos2+23]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+25]}get numIconVertices(){return this._structArray.uint16[this._pos2+26]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+27]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+28]}get crossTileID(){return this._structArray.uint32[this._pos4+15]}set crossTileID(e){this._structArray.uint32[this._pos4+15]=e}get textOffset0(){return this._structArray.float32[this._pos4+16]}get textOffset1(){return this._structArray.float32[this._pos4+17]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+18]}}Wr.prototype.size=76;class Yt extends Lt{get(e){return new Wr(this,e)}}Ue(Yt,"SymbolInstanceArray");class ei extends Rt{getoffsetX(e){return this.float32[1*e+0]}}Ue(ei,"GlyphOffsetArray");class ds extends Ee{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}Ue(ds,"SymbolLineVertexArray");class Zo extends K{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}Zo.prototype.size=12;class ya extends Gr{get(e){return new Zo(this,e)}}Ue(ya,"FeatureIndexArray");class io extends Cr{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}Ue(io,"FillExtrusionCentroidArray");const To=te([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),Xo=te([{name:"a_dash",components:4,type:"Uint16"}]);var ms={exports:{}},xa={exports:{}};xa.exports=function(t,e){var r,o,a,c,u,d,f,g;for(o=t.length-(r=3&t.length),a=e,u=3432918353,d=461845907,g=0;g<o;)f=255&t.charCodeAt(g)|(255&t.charCodeAt(++g))<<8|(255&t.charCodeAt(++g))<<16|(255&t.charCodeAt(++g))<<24,++g,a=27492+(65535&(c=5*(65535&(a=(a^=f=(65535&(f=(f=(65535&f)*u+(((f>>>16)*u&65535)<<16)&4294967295)<<15|f>>>17))*d+(((f>>>16)*d&65535)<<16)&4294967295)<<13|a>>>19))+((5*(a>>>16)&65535)<<16)&4294967295))+((58964+(c>>>16)&65535)<<16);switch(f=0,r){case 3:f^=(255&t.charCodeAt(g+2))<<16;case 2:f^=(255&t.charCodeAt(g+1))<<8;case 1:a^=f=(65535&(f=(f=(65535&(f^=255&t.charCodeAt(g)))*u+(((f>>>16)*u&65535)<<16)&4294967295)<<15|f>>>17))*d+(((f>>>16)*d&65535)<<16)&4294967295}return a^=t.length,a=2246822507*(65535&(a^=a>>>16))+((2246822507*(a>>>16)&65535)<<16)&4294967295,a=3266489909*(65535&(a^=a>>>13))+((3266489909*(a>>>16)&65535)<<16)&4294967295,(a^=a>>>16)>>>0};var zl=xa.exports,bp={exports:{}};bp.exports=function(t,e){for(var r,o=t.length,a=e^o,c=0;o>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24))+((1540483477*(r>>>16)&65535)<<16),a=1540483477*(65535&a)+((1540483477*(a>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),o-=4,++c;switch(o){case 3:a^=(255&t.charCodeAt(c+2))<<16;case 2:a^=(255&t.charCodeAt(c+1))<<8;case 1:a=1540483477*(65535&(a^=255&t.charCodeAt(c)))+((1540483477*(a>>>16)&65535)<<16)}return a=1540483477*(65535&(a^=a>>>13))+((1540483477*(a>>>16)&65535)<<16),(a^=a>>>15)>>>0};var Tp=zl,cf=bp.exports;ms.exports=Tp,ms.exports.murmur3=Tp,ms.exports.murmur2=cf;var pu=ai(ms.exports);class ih{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,o,a){this.ids.push(Ep(e)),this.positions.push(r,o,a)}getPositions(e){const r=Ep(e);let o=0,a=this.ids.length-1;for(;o<a;){const u=o+a>>1;this.ids[u]>=r?a=u:o=u+1}const c=[];for(;this.ids[o]===r;)c.push({index:this.positions[3*o],start:this.positions[3*o+1],end:this.positions[3*o+2]}),o++;return c}static serialize(e,r){const o=new Float64Array(e.ids),a=new Uint32Array(e.positions);return du(o,a,0,o.length-1),r&&r.push(o.buffer,a.buffer),{ids:o,positions:a}}static deserialize(e){const r=new ih;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}}function Ep(t){const e=+t;return!isNaN(e)&&Number.MIN_SAFE_INTEGER<=e&&e<=Number.MAX_SAFE_INTEGER?e:pu(String(t))}function du(t,e,r,o){for(;r<o;){const a=t[r+o>>1];let c=r-1,u=o+1;for(;;){do c++;while(t[c]<a);do u--;while(t[u]>a);if(c>=u)break;oh(t,c,u),oh(e,3*c,3*u),oh(e,3*c+1,3*u+1),oh(e,3*c+2,3*u+2)}u-r<o-u?(du(t,e,r,u),r=u+1):(du(t,e,u+1,o),o=u)}}function oh(t,e,r){const o=t[e];t[e]=t[r],t[r]=o}Ue(ih,"FeaturePositionMap");class Wo{constructor(e){this.gl=e.gl,this.initialized=!1}fetchUniformLocation(e,r){return this.location||this.initialized||(this.location=this.gl.getUniformLocation(e,r),this.initialized=!0),!!this.location}}class nh extends Wo{constructor(e){super(e),this.current=0}set(e,r,o){this.fetchUniformLocation(e,r)&&this.current!==o&&(this.current=o,this.gl.uniform1f(this.location,o))}}class kp extends Wo{constructor(e){super(e),this.current=[0,0,0,0]}set(e,r,o){this.fetchUniformLocation(e,r)&&(o[0]===this.current[0]&&o[1]===this.current[1]&&o[2]===this.current[2]&&o[3]===this.current[3]||(this.current=o,this.gl.uniform4f(this.location,o[0],o[1],o[2],o[3])))}}class Sp extends Wo{constructor(e){super(e),this.current=ur.transparent}set(e,r,o){this.fetchUniformLocation(e,r)&&(o.r===this.current.r&&o.g===this.current.g&&o.b===this.current.b&&o.a===this.current.a||(this.current=o,this.gl.uniform4f(this.location,o.r,o.g,o.b,o.a)))}}const hf=new Float32Array(16),uf=new Float32Array(9),pf=new Float32Array(4);function mu(t){return[H(255*t.r,255*t.g),H(255*t.b,255*t.a)]}class Pl{constructor(e,r,o){this.value=e,this.uniformNames=r.map(a=>`u_${a}`),this.type=o}setUniform(e,r,o,a,c){r.set(e,c,a.constantOr(this.value))}getBinding(e,r){return this.type==="color"?new Sp(e):new nh(e)}}class fs{constructor(e,r){this.uniformNames=r.map(o=>`u_${o}`),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(e){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br)}setUniform(e,r,o,a,c){const u=c==="u_pattern"||c==="u_dash"?this.pattern:c==="u_pixel_ratio"?this.pixelRatio:null;u&&r.set(e,c,u)}getBinding(e,r){return r==="u_pattern"||r==="u_dash"?new kp(e):new nh(e)}}class Yo{constructor(e,r,o,a){this.expression=e,this.type=o,this.maxValue=0,this.paintVertexAttributes=r.map(c=>({name:`a_${c}`,type:"Float32",components:o==="color"?2:1,offset:0})),this.paintVertexArray=new a}populatePaintArray(e,r,o,a,c,u){const d=this.paintVertexArray.length,f=this.expression.evaluate(new v(0),r,{},c,a,u);this.paintVertexArray.resize(e),this._setPaintValue(d,e,f)}updatePaintArray(e,r,o,a,c){const u=this.expression.evaluate({zoom:0},o,a,void 0,c);this._setPaintValue(e,r,u)}_setPaintValue(e,r,o){if(this.type==="color"){const a=mu(o);for(let c=e;c<r;c++)this.paintVertexArray.emplace(c,a[0],a[1])}else{for(let a=e;a<r;a++)this.paintVertexArray.emplace(a,o);this.maxValue=Math.max(this.maxValue,Math.abs(o))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class oo{constructor(e,r,o,a,c,u){this.expression=e,this.uniformNames=r.map(d=>`u_${d}_t`),this.type=o,this.useIntegerZoom=a,this.zoom=c,this.maxValue=0,this.paintVertexAttributes=r.map(d=>({name:`a_${d}`,type:"Float32",components:o==="color"?4:2,offset:0})),this.paintVertexArray=new u}populatePaintArray(e,r,o,a,c,u){const d=this.expression.evaluate(new v(this.zoom),r,{},c,a,u),f=this.expression.evaluate(new v(this.zoom+1),r,{},c,a,u),g=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(g,e,d,f)}updatePaintArray(e,r,o,a,c){const u=this.expression.evaluate({zoom:this.zoom},o,a,void 0,c),d=this.expression.evaluate({zoom:this.zoom+1},o,a,void 0,c);this._setPaintValue(e,r,u,d)}_setPaintValue(e,r,o,a){if(this.type==="color"){const c=mu(o),u=mu(a);for(let d=e;d<r;d++)this.paintVertexArray.emplace(d,c[0],c[1],u[0],u[1])}else{for(let c=e;c<r;c++)this.paintVertexArray.emplace(c,o,a);this.maxValue=Math.max(this.maxValue,Math.abs(o),Math.abs(a))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,r,o,a,c){const u=this.useIntegerZoom?Math.floor(o.zoom):o.zoom,d=it(this.expression.interpolationFactor(u,this.zoom,this.zoom+1),0,1);r.set(e,c,d)}getBinding(e,r){return new nh(e)}}class An{constructor(e,r,o,a,c){this.expression=e,this.layerId=c,this.paintVertexAttributes=(o==="array"?Xo:To).members;for(let u=0;u<r.length;++u);this.paintVertexArray=new a}populatePaintArray(e,r,o){const a=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValues(a,e,r.patterns&&r.patterns[this.layerId],o)}updatePaintArray(e,r,o,a,c,u){this._setPaintValues(e,r,o.patterns&&o.patterns[this.layerId],u)}_setPaintValues(e,r,o,a){if(!a||!o)return;const c=a[o];if(!c)return;const{tl:u,br:d,pixelRatio:f}=c;for(let g=e;g<r;g++)this.paintVertexArray.emplace(g,u[0],u[1],d[0],d[1],f)}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class In{constructor(e,r,o=()=>!0){this.binders={},this._buffers=[];const a=[];for(const c in e.paint._values){if(!o(c))continue;const u=e.paint.get(c);if(!(u instanceof B&&vn(u.property.specification)))continue;const d=mf(c,e.type),f=u.value,g=u.property.specification.type,x=!!u.property.useIntegerZoom,w=c==="line-dasharray"||c.endsWith("pattern"),b=c==="line-dasharray"&&e.layout.get("line-cap").value.kind!=="constant";if(f.kind!=="constant"||b)if(f.kind==="source"||b||w){const k=Mp(c,g,"source");this.binders[c]=w?new An(f,d,g,k,e.id):new Yo(f,d,g,k),a.push(`/a_${c}`)}else{const k=Mp(c,g,"composite");this.binders[c]=new oo(f,d,g,x,r,k),a.push(`/z_${c}`)}else this.binders[c]=w?new fs(f.value,d):new Pl(f.value,d,g),a.push(`/u_${c}`)}this.cacheKey=a.sort().join("")}getMaxValue(e){const r=this.binders[e];return r instanceof Yo||r instanceof oo?r.maxValue:0}populatePaintArrays(e,r,o,a,c,u){for(const d in this.binders){const f=this.binders[d];(f instanceof Yo||f instanceof oo||f instanceof An)&&f.populatePaintArray(e,r,o,a,c,u)}}setConstantPatternPositions(e){for(const r in this.binders){const o=this.binders[r];o instanceof fs&&o.setConstantPatternPositions(e)}}updatePaintArrays(e,r,o,a,c,u){let d=!1;for(const f in e){const g=r.getPositions(f);for(const x of g){const w=o.feature(x.index);for(const b in this.binders){const k=this.binders[b];if((k instanceof Yo||k instanceof oo||k instanceof An)&&k.expression.isStateDependent===!0){const S=a.paint.get(b);k.expression=S.value,k.updatePaintArray(x.start,x.end,w,e[f],c,u),d=!0}}}}return d}defines(){const e=[];for(const r in this.binders){const o=this.binders[r];(o instanceof Pl||o instanceof fs)&&e.push(...o.uniformNames.map(a=>`#define HAS_UNIFORM_${a}`))}return e}getBinderAttributes(){const e=[];for(const r in this.binders){const o=this.binders[r];if(o instanceof Yo||o instanceof oo||o instanceof An)for(let a=0;a<o.paintVertexAttributes.length;a++)e.push(o.paintVertexAttributes[a].name)}return e}getBinderUniforms(){const e=[];for(const r in this.binders){const o=this.binders[r];if(o instanceof Pl||o instanceof fs||o instanceof oo)for(const a of o.uniformNames)e.push(a)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e){const r=[];for(const o in this.binders){const a=this.binders[o];if(a instanceof Pl||a instanceof fs||a instanceof oo)for(const c of a.uniformNames)r.push({name:c,property:o,binding:a.getBinding(e,c)})}return r}setUniforms(e,r,o,a,c){for(const{name:u,property:d,binding:f}of o)this.binders[d].setUniform(e,f,c,a.get(d),u)}updatePaintBuffers(){this._buffers=[];for(const e in this.binders){const r=this.binders[e];(r instanceof Yo||r instanceof oo||r instanceof An)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(e){for(const r in this.binders){const o=this.binders[r];(o instanceof Yo||o instanceof oo||o instanceof An)&&o.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const r=this.binders[e];(r instanceof Yo||r instanceof oo||r instanceof An)&&r.destroy()}}}class va{constructor(e,r,o=()=>!0){this.programConfigurations={};for(const a of e)this.programConfigurations[a.id]=new In(a,r,o);this.needsUpload=!1,this._featureMap=new ih,this._bufferOffset=0}populatePaintArrays(e,r,o,a,c,u,d){for(const f in this.programConfigurations)this.programConfigurations[f].populatePaintArrays(e,r,a,c,u,d);r.id!==void 0&&this._featureMap.add(r.id,o,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,o,a,c){for(const u of o)this.needsUpload=this.programConfigurations[u.id].updatePaintArrays(e,this._featureMap,r,u,a,c)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}const df={"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","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function mf(t,e){return df[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}const ff={"line-pattern":{source:se,composite:se},"fill-pattern":{source:se,composite:se},"fill-extrusion-pattern":{source:se,composite:se},"line-dasharray":{source:ge,composite:ge}},gf={color:{source:Ui,composite:Te},number:{source:Rt,composite:Ui}};function Mp(t,e,r){const o=ff[t];return o&&o[r]||gf[e][r]}Ue(Pl,"ConstantBinder"),Ue(fs,"PatternConstantBinder"),Ue(Yo,"SourceExpressionBinder"),Ue(An,"PatternCompositeBinder"),Ue(oo,"CompositeExpressionBinder"),Ue(In,"ProgramConfiguration",{omit:["_buffers"]}),Ue(va,"ProgramConfigurationSet");const Ap="-transition";class no extends Xn{constructor(e,r){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&e.type!=="sky"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new F(r.layout)),r.paint)){this._transitionablePaint=new M(r.paint);for(const o in e.paint)this.setPaintProperty(o,e.paint[o],{validate:!1});for(const o in e.layout)this.setLayoutProperty(o,e.layout[o],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new O(r.paint)}}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,r,o={}){r!=null&&this._validate(su,`layers.${this.id}.layout.${e}`,e,r,o)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,r):this.visibility=r)}getPaintProperty(e){return rn(e,Ap)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r,o={}){if(r!=null&&this._validate(au,`layers.${this.id}.paint.${e}`,e,r,o))return!1;if(rn(e,Ap))return this._transitionablePaint.setTransition(e.slice(0,-11),r||void 0),!1;{const a=this._transitionablePaint._values[e],c=a.value.isDataDriven(),u=a.value;this._transitionablePaint.setValue(e,r),this._handleSpecialPaintPropertyUpdate(e);const d=this._transitionablePaint._values[e].value,f=d.isDataDriven(),g=rn(e,"pattern")||e==="line-dasharray";return f||c||g||this._handleOverridablePaintPropertyUpdate(e,u,d)}}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getProgramConfiguration(e){return null}_handleOverridablePaintPropertyUpdate(e,r,o){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,r){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,r)}serialize(){const e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),on(e,(r,o)=>!(r===void 0||o==="layout"&&!Object.keys(r).length||o==="paint"&&!Object.keys(r).length))}_validate(e,r,o,a,c={}){return(!c||c.validate!==!1)&&Qc(this,e.call(Jc,{key:r,layerType:this.type,objectKey:o,value:a,styleSpec:me,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const r=this.paint.get(e);if(r instanceof B&&vn(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=cs(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}}const _f=te([{name:"a_pos",components:2,type:"Int16"}],4),yf=te([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class gr{constructor(e=[]){this.segments=e}prepareSegment(e,r,o,a){let c=this.segments[this.segments.length-1];return e>gr.MAX_VERTEX_ARRAY_LENGTH&&ir(`Max vertices per segment is ${gr.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!c||c.vertexLength+e>gr.MAX_VERTEX_ARRAY_LENGTH||c.sortKey!==a)&&(c={vertexOffset:r.length,primitiveOffset:o.length,vertexLength:0,primitiveLength:0},a!==void 0&&(c.sortKey=a),this.segments.push(c)),c}get(){return this.segments}destroy(){for(const e of this.segments)for(const r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,o,a){return new gr([{vertexOffset:e,primitiveOffset:r,vertexLength:o,primitiveLength:a,vaos:{},sortKey:0}])}}gr.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ue(gr,"SegmentVector");var Xe=8192;class Cn{constructor(e,r){e&&(r?this.setSouthWest(e).setNorthEast(r):e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))}setNorthEast(e){return this._ne=e instanceof Ot?new Ot(e.lng,e.lat):Ot.convert(e),this}setSouthWest(e){return this._sw=e instanceof Ot?new Ot(e.lng,e.lat):Ot.convert(e),this}extend(e){const r=this._sw,o=this._ne;let a,c;if(e instanceof Ot)a=e,c=e;else{if(!(e instanceof Cn))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(Cn.convert(e)):this.extend(Ot.convert(e)):typeof e=="object"&&e!==null&&e.hasOwnProperty("lat")&&(e.hasOwnProperty("lon")||e.hasOwnProperty("lng"))?this.extend(Ot.convert(e)):this;if(a=e._sw,c=e._ne,!a||!c)return this}return r||o?(r.lng=Math.min(a.lng,r.lng),r.lat=Math.min(a.lat,r.lat),o.lng=Math.max(c.lng,o.lng),o.lat=Math.max(c.lat,o.lat)):(this._sw=new Ot(a.lng,a.lat),this._ne=new Ot(c.lng,c.lat)),this}getCenter(){return new Ot((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new Ot(this.getWest(),this.getNorth())}getSouthEast(){return new Ot(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:r,lat:o}=Ot.convert(e);let a=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=o&&o<=this._ne.lat&&a}static convert(e){return!e||e instanceof Cn?e:new Cn(e)}}var ah=1e-6,vi=typeof Float32Array<"u"?Float32Array:Array;function Ip(){var t=new vi(9);return vi!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function Cp(t,e,r){var o=e[0],a=e[1],c=e[2],u=e[3],d=e[4],f=e[5],g=e[6],x=e[7],w=e[8],b=r[0],k=r[1],S=r[2],I=r[3],D=r[4],U=r[5],Z=r[6],j=r[7],$=r[8];return t[0]=b*o+k*u+S*g,t[1]=b*a+k*d+S*x,t[2]=b*c+k*f+S*w,t[3]=I*o+D*u+U*g,t[4]=I*a+D*d+U*x,t[5]=I*c+D*f+U*w,t[6]=Z*o+j*u+$*g,t[7]=Z*a+j*d+$*x,t[8]=Z*c+j*f+$*w,t}function ao(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function fu(t,e){var r=e[0],o=e[1],a=e[2],c=e[3],u=e[4],d=e[5],f=e[6],g=e[7],x=e[8],w=e[9],b=e[10],k=e[11],S=e[12],I=e[13],D=e[14],U=e[15],Z=r*d-o*u,j=r*f-a*u,$=r*g-c*u,W=o*f-a*d,X=o*g-c*d,ce=a*g-c*f,ae=x*I-w*S,fe=x*D-b*S,ke=x*U-k*S,ue=w*D-b*I,ye=w*U-k*I,xe=b*U-k*D,be=Z*xe-j*ye+$*ue+W*ke-X*fe+ce*ae;return be?(t[0]=(d*xe-f*ye+g*ue)*(be=1/be),t[1]=(a*ye-o*xe-c*ue)*be,t[2]=(I*ce-D*X+U*W)*be,t[3]=(b*X-w*ce-k*W)*be,t[4]=(f*ke-u*xe-g*fe)*be,t[5]=(r*xe-a*ke+c*fe)*be,t[6]=(D*$-S*ce-U*j)*be,t[7]=(x*ce-b*$+k*j)*be,t[8]=(u*ye-d*ke+g*ae)*be,t[9]=(o*ke-r*ye-c*ae)*be,t[10]=(S*X-I*$+U*Z)*be,t[11]=(w*$-x*X-k*Z)*be,t[12]=(d*fe-u*ue-f*ae)*be,t[13]=(r*ue-o*fe+a*ae)*be,t[14]=(I*j-S*W-D*Z)*be,t[15]=(x*W-w*j+b*Z)*be,t):null}function wa(t,e,r){var o=e[0],a=e[1],c=e[2],u=e[3],d=e[4],f=e[5],g=e[6],x=e[7],w=e[8],b=e[9],k=e[10],S=e[11],I=e[12],D=e[13],U=e[14],Z=e[15],j=r[0],$=r[1],W=r[2],X=r[3];return t[0]=j*o+$*d+W*w+X*I,t[1]=j*a+$*f+W*b+X*D,t[2]=j*c+$*g+W*k+X*U,t[3]=j*u+$*x+W*S+X*Z,t[4]=(j=r[4])*o+($=r[5])*d+(W=r[6])*w+(X=r[7])*I,t[5]=j*a+$*f+W*b+X*D,t[6]=j*c+$*g+W*k+X*U,t[7]=j*u+$*x+W*S+X*Z,t[8]=(j=r[8])*o+($=r[9])*d+(W=r[10])*w+(X=r[11])*I,t[9]=j*a+$*f+W*b+X*D,t[10]=j*c+$*g+W*k+X*U,t[11]=j*u+$*x+W*S+X*Z,t[12]=(j=r[12])*o+($=r[13])*d+(W=r[14])*w+(X=r[15])*I,t[13]=j*a+$*f+W*b+X*D,t[14]=j*c+$*g+W*k+X*U,t[15]=j*u+$*x+W*S+X*Z,t}function Dl(t,e,r){var o,a,c,u,d,f,g,x,w,b,k,S,I=r[0],D=r[1],U=r[2];return e===t?(t[12]=e[0]*I+e[4]*D+e[8]*U+e[12],t[13]=e[1]*I+e[5]*D+e[9]*U+e[13],t[14]=e[2]*I+e[6]*D+e[10]*U+e[14],t[15]=e[3]*I+e[7]*D+e[11]*U+e[15]):(a=e[1],c=e[2],u=e[3],d=e[4],f=e[5],g=e[6],x=e[7],w=e[8],b=e[9],k=e[10],S=e[11],t[0]=o=e[0],t[1]=a,t[2]=c,t[3]=u,t[4]=d,t[5]=f,t[6]=g,t[7]=x,t[8]=w,t[9]=b,t[10]=k,t[11]=S,t[12]=o*I+d*D+w*U+e[12],t[13]=a*I+f*D+b*U+e[13],t[14]=c*I+g*D+k*U+e[14],t[15]=u*I+x*D+S*U+e[15]),t}function ba(t,e,r){var o=r[0],a=r[1],c=r[2];return t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t[3]=e[3]*o,t[4]=e[4]*a,t[5]=e[5]*a,t[6]=e[6]*a,t[7]=e[7]*a,t[8]=e[8]*c,t[9]=e[9]*c,t[10]=e[10]*c,t[11]=e[11]*c,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function gu(t,e,r){var o=Math.sin(r),a=Math.cos(r),c=e[4],u=e[5],d=e[6],f=e[7],g=e[8],x=e[9],w=e[10],b=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=c*a+g*o,t[5]=u*a+x*o,t[6]=d*a+w*o,t[7]=f*a+b*o,t[8]=g*a-c*o,t[9]=x*a-u*o,t[10]=w*a-d*o,t[11]=b*a-f*o,t}function sh(t,e,r){var o=Math.sin(r),a=Math.cos(r),c=e[0],u=e[1],d=e[2],f=e[3],g=e[8],x=e[9],w=e[10],b=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=c*a-g*o,t[1]=u*a-x*o,t[2]=d*a-w*o,t[3]=f*a-b*o,t[8]=c*o+g*a,t[9]=u*o+x*a,t[10]=d*o+w*a,t[11]=f*o+b*a,t}function zp(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Pp(t,e,r){var o,a,c,u=r[0],d=r[1],f=r[2],g=Math.hypot(u,d,f);return g<ah?null:(u*=g=1/g,d*=g,f*=g,o=Math.sin(e),a=Math.cos(e),t[0]=u*u*(c=1-a)+a,t[1]=d*u*c+f*o,t[2]=f*u*c-d*o,t[3]=0,t[4]=u*d*c-f*o,t[5]=d*d*c+a,t[6]=f*d*c+u*o,t[7]=0,t[8]=u*f*c+d*o,t[9]=d*f*c-u*o,t[10]=f*f*c+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var xf=wa;function _u(){var t=new vi(3);return vi!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Dp(t){var e=new vi(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Ll(t){return Math.hypot(t[0],t[1],t[2])}function gs(t,e,r){var o=new vi(3);return o[0]=t,o[1]=e,o[2]=r,o}function Ho(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function yu(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function Lp(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function Rl(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function Bl(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function Ii(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function Fl(t,e,r,o){return t[0]=e[0]+r[0]*o,t[1]=e[1]+r[1]*o,t[2]=e[2]+r[2]*o,t}function ti(t,e){var r=e[0],o=e[1],a=e[2],c=r*r+o*o+a*a;return c>0&&(c=1/Math.sqrt(c)),t[0]=e[0]*c,t[1]=e[1]*c,t[2]=e[2]*c,t}function ji(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function xu(t,e,r){var o=e[0],a=e[1],c=e[2],u=r[0],d=r[1],f=r[2];return t[0]=a*f-c*d,t[1]=c*u-o*f,t[2]=o*d-a*u,t}function pr(t,e,r){var o=e[0],a=e[1],c=e[2],u=r[3]*o+r[7]*a+r[11]*c+r[15];return t[0]=(r[0]*o+r[4]*a+r[8]*c+r[12])/(u=u||1),t[1]=(r[1]*o+r[5]*a+r[9]*c+r[13])/u,t[2]=(r[2]*o+r[6]*a+r[10]*c+r[14])/u,t}function Rp(t,e,r){var o=r[0],a=r[1],c=r[2],u=e[0],d=e[1],f=e[2],g=a*f-c*d,x=c*u-o*f,w=o*d-a*u,b=a*w-c*x,k=c*g-o*w,S=o*x-a*g,I=2*r[3];return x*=I,w*=I,k*=2,S*=2,t[0]=u+(g*=I)+(b*=2),t[1]=d+x+k,t[2]=f+w+S,t}var Ol,so=yu,vf=Lp,wf=Ll;function Bp(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function Fp(t,e){var r=e[0],o=e[1],a=e[2],c=e[3],u=r*r+o*o+a*a+c*c;return u>0&&(u=1/Math.sqrt(u)),t[0]=r*u,t[1]=o*u,t[2]=a*u,t[3]=c*u,t}function Ta(t,e,r){var o=e[0],a=e[1],c=e[2],u=e[3];return t[0]=r[0]*o+r[4]*a+r[8]*c+r[12]*u,t[1]=r[1]*o+r[5]*a+r[9]*c+r[13]*u,t[2]=r[2]*o+r[6]*a+r[10]*c+r[14]*u,t[3]=r[3]*o+r[7]*a+r[11]*c+r[15]*u,t}function Op(){var t=new vi(4);return vi!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Up(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function jp(t,e,r){r*=.5;var o=e[0],a=e[1],c=e[2],u=e[3],d=Math.sin(r),f=Math.cos(r);return t[0]=o*f+u*d,t[1]=a*f+c*d,t[2]=c*f-a*d,t[3]=u*f-o*d,t}function Np(t,e,r){r*=.5;var o=e[0],a=e[1],c=e[2],u=e[3],d=Math.sin(r),f=Math.cos(r);return t[0]=o*f-c*d,t[1]=a*f+u*d,t[2]=c*f+o*d,t[3]=u*f-a*d,t}_u(),Ol=new vi(4),vi!=Float32Array&&(Ol[0]=0,Ol[1]=0,Ol[2]=0,Ol[3]=0);var bf=Fp;_u(),gs(1,0,0),gs(0,1,0),Op(),Op(),Ip();const Tf=te([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:Vp}=Tf,Gp=te([{name:"a_pos_3",components:3,type:"Int16"}]);var Ul=te([{name:"a_pos",type:"Int16",components:2}]);class vu{constructor(e,r){this.pos=e,this.dir=r}intersectsPlane(e,r,o){const a=ji(r,this.dir);if(Math.abs(a)<1e-6)return!1;const c=((e[0]-this.pos[0])*r[0]+(e[1]-this.pos[1])*r[1]+(e[2]-this.pos[2])*r[2])/a;return o[0]=this.pos[0]+this.dir[0]*c,o[1]=this.pos[1]+this.dir[1]*c,o[2]=this.pos[2]+this.dir[2]*c,!0}closestPointOnSphere(e,r,o){if(function(k,S){var I=k[0],D=k[1],U=k[2],Z=S[0],j=S[1],$=S[2];return Math.abs(I-Z)<=ah*Math.max(1,Math.abs(I),Math.abs(Z))&&Math.abs(D-j)<=ah*Math.max(1,Math.abs(D),Math.abs(j))&&Math.abs(U-$)<=ah*Math.max(1,Math.abs(U),Math.abs($))}(this.pos,e)||r===0)return o[0]=o[1]=o[2]=0,!1;const[a,c,u]=this.dir,d=this.pos[0]-e[0],f=this.pos[1]-e[1],g=this.pos[2]-e[2],x=a*a+c*c+u*u,w=2*(d*a+f*c+g*u),b=w*w-4*x*(d*d+f*f+g*g-r*r);if(b<0){const k=Math.max(-w/2,0),S=d+a*k,I=f+c*k,D=g+u*k,U=Math.hypot(S,I,D);return o[0]=S*r/U,o[1]=I*r/U,o[2]=D*r/U,!1}{const k=(-w-Math.sqrt(b))/(2*x);if(k<0){const S=Math.hypot(d,f,g);return o[0]=d*r/S,o[1]=f*r/S,o[2]=g*r/S,!1}return o[0]=d+a*k,o[1]=f+c*k,o[2]=g+u*k,!0}}}class wu{constructor(e,r,o,a,c){this.TL=e,this.TR=r,this.BR=o,this.BL=a,this.horizon=c}static fromInvProjectionMatrix(e,r,o){const a=[-1,1,1],c=[1,1,1],u=[1,-1,1],d=[-1,-1,1],f=pr(a,a,e),g=pr(c,c,e),x=pr(u,u,e),w=pr(d,d,e);return new wu(f,g,x,w,r/o)}}class bu{constructor(e,r){this.points=e,this.planes=r}static fromInvProjectionMatrix(e,r,o,a){const c=Math.pow(2,o),u=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(f=>{const g=Ta([],f,e),x=1/g[3]/r*c;return function(w,b,k){return w[0]=b[0]*k[0],w[1]=b[1]*k[1],w[2]=b[2]*k[2],w[3]=b[3]*k[3],w}(g,g,[x,x,a?1/g[3]:x,x])}),d=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(f=>{const g=ti([],xu([],so([],u[f[0]],u[f[1]]),so([],u[f[2]],u[f[1]]))),x=-ji(g,u[f[1]]);return g.concat(x)});return new bu(u,d)}}class ri{static fromPoints(e){const r=[1/0,1/0,1/0],o=[-1/0,-1/0,-1/0];for(const a of e)Rl(r,r,a),Bl(o,o,a);return new ri(r,o)}static applyTransform(e,r){const o=e.getCorners();for(let a=0;a<o.length;++a)pr(o[a],o[a],r);return ri.fromPoints(o)}constructor(e,r){this.min=e,this.max=r,this.center=Ii([],Ho([],this.min,this.max),.5)}quadrant(e){const r=[e%2==0,e<2],o=Dp(this.min),a=Dp(this.max);for(let c=0;c<r.length;c++)o[c]=r[c]?this.min[c]:this.center[c],a[c]=r[c]?this.center[c]:this.max[c];return a[2]=this.max[2],new ri(o,a)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}distanceZ(e){return Math.max(Math.min(this.max[2],e[2]),this.min[2])-e[2]}getCorners(){const e=this.min,r=this.max;return[[e[0],e[1],e[2]],[r[0],e[1],e[2]],[r[0],r[1],e[2]],[e[0],r[1],e[2]],[e[0],e[1],r[2]],[r[0],e[1],r[2]],[r[0],r[1],r[2]],[e[0],r[1],r[2]]]}intersects(e){const r=this.getCorners();let o=!0;for(let a=0;a<e.planes.length;a++){const c=e.planes[a];let u=0;for(let d=0;d<r.length;d++)u+=ji(c,r[d])+c[3]>=0;if(u===0)return 0;u!==r.length&&(o=!1)}if(o)return 2;for(let a=0;a<3;a++){let c=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let d=0;d<e.points.length;d++){const f=e.points[d][a]-this.min[a];c=Math.min(c,f),u=Math.max(u,f)}if(u<0||c>this.max[a]-this.min[a])return 0}return 1}}const Tu=5,$p=6,Eo=Xe/Math.PI/2,Ef=16383,Ea=64,jl=[Ea,32,16],Ni=-Eo,Vi=Eo,kf=[new ri([Ni,Ni,Ni],[Vi,Vi,Vi]),new ri([Ni,Ni,Ni],[0,0,Vi]),new ri([0,Ni,Ni],[Vi,0,Vi]),new ri([Ni,0,Ni],[0,Vi,Vi]),new ri([0,0,Ni],[Vi,Vi,Vi])];function lh(t){return t*Eo/Gl}function qp(t,e,r,o=!0){const a=Ii([],t._camera.position,t.worldSize),c=[e,r,1,1];Ta(c,c,t.pixelMatrixInverse),Bp(c,c,1/c[3]);const u=ti([],so([],c,a)),d=t.globeMatrix,f=[d[12],d[13],d[14]],g=so([],f,a),x=Ll(g),w=ti([],g),b=t.worldSize/(2*Math.PI),k=ji(w,u),S=Math.asin(b/x);if(S<Math.acos(k)){if(!o)return null;const ke=[],ue=[];Ii(ke,u,x/k),ti(ue,so(ue,ke,g)),ti(u,Ho(u,g,Ii(u,ue,Math.tan(S)*x)))}const I=[];new vu(a,u).closestPointOnSphere(f,b,I);const D=ti([],yo(d,0)),U=ti([],yo(d,1)),Z=ti([],yo(d,2)),j=ji(D,I),$=ji(U,I),W=ji(Z,I),X=Ke(Math.asin(-$/b));let ce=Ke(Math.atan2(j,W));ce=t.center.lng+function(ke,ue){const ye=(ue-ke+180)%360-180;return ye<-180?ye+360:ye}(t.center.lng,ce);const ae=So(ce),fe=it(Mo(X),0,1);return new vs(ae,fe)}class Sf{constructor(e,r,o){this.a=so([],e,o),this.b=so([],r,o),this.center=o;const a=ti([],this.a),c=ti([],this.b);this.angle=Math.acos(ji(a,c))}}function Eu(t,e){if(t.angle===0)return null;let r;return r=t.a[e]===0?1/t.angle*.5*Math.PI:1/t.angle*Math.atan(t.b[e]/t.a[e]/Math.sin(t.angle)-1/Math.tan(t.angle)),r<0||r>1?null:function(o,a,c,u){const d=Math.sin(c);return o*(Math.sin((1-u)*c)/d)+a*(Math.sin(u*c)/d)}(t.a[e],t.b[e],t.angle,it(r,0,1))+t.center[e]}function ko(t){if(t.z<=1)return kf[t.z+2*t.y+t.x];const e=ku(ch(t));return ri.fromPoints(e)}function ka(t,e,r){return Ii(t,t,1-r),Fl(t,t,e,r)}function Zp(t,e){const r=xs(e.zoom);if(r===0)return ko(t);const o=ch(t),a=ku(o),c=So(o.getWest())*e.worldSize,u=So(o.getEast())*e.worldSize,d=Mo(o.getNorth())*e.worldSize,f=Mo(o.getSouth())*e.worldSize,g=[c,d,0],x=[u,d,0],w=[c,f,0],b=[u,f,0],k=fu([],e.globeMatrix);return pr(g,g,k),pr(x,x,k),pr(w,w,k),pr(b,b,k),a[0]=ka(a[0],w,r),a[1]=ka(a[1],b,r),a[2]=ka(a[2],x,r),a[3]=ka(a[3],g,r),ri.fromPoints(a)}function Xp(t,e,r){for(const o of t)pr(o,o,e),Ii(o,o,r)}function Mf(t,e,r){const o=e/t.worldSize,a=t.globeMatrix;if(r.z<=1){const ae=ko(r).getCorners();return Xp(ae,a,o),ri.fromPoints(ae)}const c=ch(r),u=ku(c);Xp(u,a,o);const d=Number.MAX_VALUE,f=[-d,-d,-d],g=[d,d,d];if(c.contains(t.center)){for(const ke of u)Rl(g,g,ke),Bl(f,f,ke);f[2]=0;const ae=t.point,fe=[ae.x*o,ae.y*o,0];return Rl(g,g,fe),Bl(f,f,fe),new ri(g,f)}const x=[a[12]*o,a[13]*o,a[14]*o],w=c.getCenter(),b=it(t.center.lat,-qr,qr),k=it(w.lat,-qr,qr),S=So(t.center.lng),I=Mo(b);let D=S-So(w.lng);const U=I-Mo(k);D>.5?D-=1:D<-.5&&(D+=1);let Z=0;Math.abs(D)>Math.abs(U)?Z=D>=0?1:3:(Z=U>=0?0:2,Fl(x,x,[a[4]*o,a[5]*o,a[6]*o],-Math.sin(lt(U>=0?c.getSouth():c.getNorth()))*Eo));const j=u[Z],$=u[(Z+1)%4],W=new Sf(j,$,x),X=[Eu(W,0)||j[0],Eu(W,1)||j[1],Eu(W,2)||j[2]],ce=xs(t.zoom);if(ce>0){const ae=function({x:ke,y:ue,z:ye},xe,be,Ie,de){const Le=1/(1<<ye);let Ne=ke*Le,Re=Ne+Le,et=ue*Le,Ce=et+Le,Ze=0;const tt=(Ne+Re)/2-Ie;return tt>.5?Ze=-1:tt<-.5&&(Ze=1),Ne=((Ne+Ze)*xe-(Ie*=xe))*be+Ie,Re=((Re+Ze)*xe-Ie)*be+Ie,et=(et*xe-(de*=xe))*be+de,Ce=(Ce*xe-de)*be+de,[[Ne,Ce,0],[Re,Ce,0],[Re,et,0],[Ne,et,0]]}(r,e,t._pixelsPerMercatorPixel,S,I);for(let ke=0;ke<u.length;ke++)ka(u[ke],ae[ke],ce);const fe=Ho([],ae[Z],ae[(Z+1)%4]);Ii(fe,fe,.5),ka(X,fe,ce)}for(const ae of u)Rl(g,g,ae),Bl(f,f,ae);return g[2]=Math.min(j[2],$[2]),Rl(g,g,X),Bl(f,f,X),new ri(g,f)}function ch({x:t,y:e,z:r}){const o=1/(1<<r),a=new Ot(Ci(t*o),$r((e+1)*o)),c=new Ot(Ci((t+1)*o),$r(e*o));return new Cn(a,c)}function ku(t){const e=lt(t.getNorth()),r=lt(t.getSouth()),o=Math.cos(e),a=Math.cos(r),c=Math.sin(e),u=Math.sin(r),d=t.getWest(),f=t.getEast();return[_s(a,u,d),_s(a,u,f),_s(o,c,f),_s(o,c,d)]}function _s(t,e,r,o=Eo){return r=lt(r),[t*Math.sin(r)*o,-e*o,t*Math.cos(r)*o]}function ys(t,e,r){return _s(Math.cos(lt(t)),Math.sin(lt(t)),e,r)}function Nl(t,e,r,o){const a=1<<r.z,c=(t/Xe+r.x)/a;return ys($r((e/Xe+r.y)/a),Ci(c),o)}function hh({min:t,max:e}){return Ef/Math.max(e[0]-t[0],e[1]-t[1],e[2]-t[2])}const Wp=new Float64Array(16);function Vl(t){const e=hh(t),r=zp(Wp,[e,e,e]);return Dl(r,r,((o=[])[0]=-(a=t.min)[0],o[1]=-a[1],o[2]=-a[2],o));var o,a}function Su(t){const e=(o=t.min,(r=Wp)[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=o[0],r[13]=o[1],r[14]=o[2],r[15]=1,r);var r,o;const a=1/hh(t);return ba(e,e,[a,a,a])}function Yp(t,e,r,o,a){const c=function(f){const g=Xe/(2*Math.PI);return f/(2*Math.PI)/g}(r),u=[t,e,-r/(2*Math.PI)],d=ao(new Float64Array(16));return Dl(d,d,u),ba(d,d,[c,c,c]),gu(d,d,lt(-a)),sh(d,d,lt(-o)),d}function xs(t){return pi(Tu,$p,t)}function Hp(t,e){const r=ys(e.lat,e.lng),o=function(S){const I=ys(S._center.lat,S._center.lng);let D=xu([],gs(0,1,0),I);const U=Pp([],-S.angle,I);D=pr(D,D,U),Pp(U,-S._pitch,D);const Z=ti([],I);return Ii(Z,Z,lh(S.cameraToCenterDistance/S.pixelsPerMeter)),pr(Z,Z,U),Ho([],I,Z)}(t);return u=(a=yu([],o,r))[0],d=a[1],f=a[2],g=(c=r)[0],x=c[1],w=c[2],k=(b=Math.sqrt(u*u+d*d+f*f)*Math.sqrt(g*g+x*x+w*w))&&ji(a,c)/b,Math.acos(Math.min(Math.max(k,-1),1));var a,c,u,d,f,g,x,w,b,k}function Mu(t,e){return Hp(t,e)>Math.PI/2*1.01}const Kp=lt(85),Af=Math.cos(Kp),If=Math.sin(Kp),Gl=63710088e-1,Jp=2*Math.PI*Gl;class zn{constructor(e,r){if(isNaN(e)||isNaN(r))throw new Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new zn(tr(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const r=Math.PI/180,o=this.lat*r,a=e.lat*r,c=Math.sin(o)*Math.sin(a)+Math.cos(o)*Math.cos(a)*Math.cos((e.lng-this.lng)*r);return Gl*Math.acos(Math.min(c,1))}toBounds(e=0){const r=360*e/40075017,o=r/Math.cos(Math.PI/180*this.lat);return new Cn(new zn(this.lng-o,this.lat-r),new zn(this.lng+o,this.lat+r))}toEcef(e){const r=lh(e);return ys(this.lat,this.lng,Eo+r)}static convert(e){if(e instanceof zn)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new zn(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new zn(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 Ot=zn;function Au(t){return Jp*Math.cos(t*Math.PI/180)}function So(t){return(180+t)/360}function Mo(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function lo(t,e){return t/Au(e)}function Ci(t){return 360*t-180}function $r(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}function Qp(t,e){return t*Au($r(e))}const qr=85.051129;function ed(t){return 1/Math.cos(t*Math.PI/180)}class vs{constructor(e,r,o=0){this.x=+e,this.y=+r,this.z=+o}static fromLngLat(e,r=0){const o=Ot.convert(e);return new vs(So(o.lng),Mo(o.lat),lo(r,o.lat))}toLngLat(){return new Ot(Ci(this.x),$r(this.y))}toAltitude(){return Qp(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Jp*ed($r(this.y))}}function Iu(t,e,r,o,a,c,u,d,f){const g=(e+o)/2,x=(r+a)/2,w=new De(g,x);d(w),function(b,k,S,I,D,U){const Z=S-D,j=I-U;return Math.abs((I-k)*Z-(S-b)*j)/Math.hypot(Z,j)}(w.x,w.y,c.x,c.y,u.x,u.y)>=f?(Iu(t,e,r,g,x,c,w,d,f),Iu(t,g,x,o,a,w,u,d,f)):t.push(u)}function td(t,e,r){let o=t[0],a=o.x,c=o.y;e(o);const u=[o];for(let d=1;d<t.length;d++){const f=t[d],{x:g,y:x}=f;e(f),Iu(u,a,c,g,x,o,f,e,r),a=g,c=x,o=f}return u}function Cu(t,e,r,o){if(o(e,r)){const a=e.add(r)._mult(.5);Cu(t,e,a,o),Cu(t,a,r,o)}else t.push(r)}function Cf(t,e){let r=t[0];const o=[r];for(let a=1;a<t.length;a++){const c=t[a];Cu(o,r,c,e),r=c}return o}const zu=Math.pow(2,14)-1,rd=-zu-1;function zf(t,e){const r=Math.round(t.x*e),o=Math.round(t.y*e);return t.x=it(r,rd,zu),t.y=it(o,rd,zu),(r<t.x||r>t.x+1||o<t.y||o>t.y+1)&&ir("Geometry exceeds allowed extent, reduce your vector tile buffer size"),t}function Ko(t,e,r){const o=t.loadGeometry(),a=t.extent,c=Xe/a;if(e&&r&&r.projection.isReprojectedInTileSpace){const u=1<<e.z,{scale:d,x:f,y:g,projection:x}=r,w=b=>{const k=Ci((e.x+b.x/a)/u),S=$r((e.y+b.y/a)/u),I=x.project(k,S);b.x=(I.x*d-f)*a,b.y=(I.y*d-g)*a};for(let b=0;b<o.length;b++)if(t.type!==1)o[b]=td(o[b],w,1);else{const k=[];for(const S of o[b])S.x<0||S.x>=a||S.y<0||S.y>=a||(w(S),k.push(S));o[b]=k}}for(const u of o)for(const d of u)zf(d,c);return o}function Sa(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Ko(t):[]}}function uh(t,e,r,o,a){t.emplaceBack(2*e+(o+1)/2,2*r+(a+1)/2)}function ph(t,e,r){t.emplaceBack(e.x,e.y,e.z,r[0]*16384,r[1]*16384,r[2]*16384)}class Pu{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new Ee,this.indexArray=new $e,this.segments=new gr,this.programConfigurations=new va(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,o,a){const c=this.layers[0],u=[];let d=null;c.type==="circle"&&(d=c.layout.get("circle-sort-key"));for(const{feature:g,id:x,index:w,sourceLayerIndex:b}of e){const k=this.layers[0]._featureFilter.needGeometry,S=Sa(g,k);if(!this.layers[0]._featureFilter.filter(new v(this.zoom),S,o))continue;const I=d?d.evaluate(S,{},o):void 0,D={id:x,properties:g.properties,type:g.type,sourceLayerIndex:b,index:w,geometry:k?S.geometry:Ko(g,o,a),patterns:{},sortKey:I};u.push(D)}d&&u.sort((g,x)=>g.sortKey-x.sortKey);let f=null;a.projection.name==="globe"&&(this.globeExtVertexArray=new Se,f=a.projection);for(const g of u){const{geometry:x,index:w,sourceLayerIndex:b}=g,k=e[w].feature;this.addFeature(g,x,w,r.availableImages,o,f),r.featureIndex.insert(k,x,w,b,this.index)}}update(e,r,o,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,o,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,_f.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,yf.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(e,r,o,a,c,u){for(const d of r)for(const f of d){const g=f.x,x=f.y;if(g<0||g>=Xe||x<0||x>=Xe)continue;if(u){const k=u.projectTilePoint(g,x,c),S=u.upVector(c,g,x),I=this.globeExtVertexArray;ph(I,k,S),ph(I,k,S),ph(I,k,S),ph(I,k,S)}const w=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),b=w.vertexLength;uh(this.layoutVertexArray,g,x,-1,-1),uh(this.layoutVertexArray,g,x,1,-1),uh(this.layoutVertexArray,g,x,1,1),uh(this.layoutVertexArray,g,x,-1,1),this.indexArray.emplaceBack(b,b+1,b+2),this.indexArray.emplaceBack(b,b+2,b+3),w.vertexLength+=4,w.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,{},a,c)}}function id(t,e){for(let r=0;r<t.length;r++)if(Ma(e,t[r]))return!0;for(let r=0;r<e.length;r++)if(Ma(t,e[r]))return!0;return!!Du(t,e)}function Pf(t,e,r){return!!Ma(t,e)||!!Lu(e,t,r)}function od(t,e){if(t.length===1)return ad(e,t[0]);for(let r=0;r<e.length;r++){const o=e[r];for(let a=0;a<o.length;a++)if(Ma(t,o[a]))return!0}for(let r=0;r<t.length;r++)if(ad(e,t[r]))return!0;for(let r=0;r<e.length;r++)if(Du(t,e[r]))return!0;return!1}function Df(t,e,r){if(t.length>1){if(Du(t,e))return!0;for(let o=0;o<e.length;o++)if(Lu(e[o],t,r))return!0}for(let o=0;o<t.length;o++)if(Lu(t[o],e,r))return!0;return!1}function Du(t,e){if(t.length===0||e.length===0)return!1;for(let r=0;r<t.length-1;r++){const o=t[r],a=t[r+1];for(let c=0;c<e.length-1;c++)if(Lf(o,a,e[c],e[c+1]))return!0}return!1}function Lf(t,e,r,o){return di(t,r,o)!==di(e,r,o)&&di(t,e,r)!==di(t,e,o)}function Lu(t,e,r){const o=r*r;if(e.length===1)return t.distSqr(e[0])<o;for(let a=1;a<e.length;a++)if(nd(t,e[a-1],e[a])<o)return!0;return!1}function nd(t,e,r){const o=e.distSqr(r);if(o===0)return t.distSqr(e);const a=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/o;return t.distSqr(a<0?e:a>1?r:r.sub(e)._mult(a)._add(e))}function ad(t,e){let r,o,a,c=!1;for(let u=0;u<t.length;u++){r=t[u];for(let d=0,f=r.length-1;d<r.length;f=d++)o=r[d],a=r[f],o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(c=!c)}return c}function Ma(t,e){let r=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const c=t[o],u=t[a];c.y>e.y!=u.y>e.y&&e.x<(u.x-c.x)*(e.y-c.y)/(u.y-c.y)+c.x&&(r=!r)}return r}function sd(t,e,r,o,a){for(const u of t)if(e<=u.x&&r<=u.y&&o>=u.x&&a>=u.y)return!0;const c=[new De(e,r),new De(e,a),new De(o,a),new De(o,r)];if(t.length>2){for(const u of c)if(Ma(t,u))return!0}for(let u=0;u<t.length-1;u++)if(Rf(t[u],t[u+1],c))return!0;return!1}function Rf(t,e,r){const o=r[0],a=r[2];if(t.x<o.x&&e.x<o.x||t.x>a.x&&e.x>a.x||t.y<o.y&&e.y<o.y||t.y>a.y&&e.y>a.y)return!1;const c=di(t,e,r[0]);return c!==di(t,e,r[1])||c!==di(t,e,r[2])||c!==di(t,e,r[3])}function ws(t,e,r){const o=e.paint.get(t).value;return o.kind==="constant"?o.value:r.programConfigurations.get(e.id).getMaxValue(t)}function dh(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ld(t,e,r,o,a){if(!e[0]&&!e[1])return t;const c=De.convert(e)._mult(a);r==="viewport"&&c._rotate(-o);const u=[];for(let d=0;d<t.length;d++)u.push(t[d].sub(c));return u}function cd(t,e,r,o){const a=De.convert(t)._mult(o);return e==="viewport"&&a._rotate(-r),a}Ue(Pu,"CircleBucket",{omit:["layers"]});const Bf=new V({"circle-sort-key":new L(me.layout_circle["circle-sort-key"])});var Ff={paint:new V({"circle-radius":new L(me.paint_circle["circle-radius"]),"circle-color":new L(me.paint_circle["circle-color"]),"circle-blur":new L(me.paint_circle["circle-blur"]),"circle-opacity":new L(me.paint_circle["circle-opacity"]),"circle-translate":new A(me.paint_circle["circle-translate"]),"circle-translate-anchor":new A(me.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new A(me.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new A(me.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new L(me.paint_circle["circle-stroke-width"]),"circle-stroke-color":new L(me.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new L(me.paint_circle["circle-stroke-opacity"])}),layout:Bf};function hd(t,e,r,o,a,c,u,d,f){if(c&&t.queryGeometry.isAboveHorizon)return!1;c&&(f*=t.pixelToTileUnitsFactor);const g=t.tileID.canonical,x=r.projection.upVectorScale(g,r.center.lat,r.worldSize).metersToTile;for(const w of e)for(const b of w){const k=b.add(d),S=a&&r.elevation?r.elevation.exaggeration()*a.getElevationAt(k.x,k.y,!0):0,I=r.projection.projectTilePoint(k.x,k.y,g);if(S>0){const j=r.projection.upVector(g,k.x,k.y);I.x+=j[0]*x*S,I.y+=j[1]*x*S,I.z+=j[2]*x*S}const D=c?k:Of(I.x,I.y,I.z,o),U=c?t.tilespaceRays.map(j=>jf(j,S)):t.queryGeometry.screenGeometry,Z=Ta([],[I.x,I.y,I.z,1],o);if(!u&&c?f*=Z[3]/r.cameraToCenterDistance:u&&!c&&(f*=r.cameraToCenterDistance/Z[3]),c){const j=$r((b.y/Xe+g.y)/(1<<g.z));f/=r.projection.pixelsPerMeter(j,1)/lo(1,j)}if(Pf(U,D,f))return!0}return!1}function Of(t,e,r,o){const a=Ta([],[t,e,r,1],o);return new De(a[0]/a[3],a[1]/a[3])}const ud=gs(0,0,0),Uf=gs(0,0,1);function jf(t,e){const r=_u();return ud[2]=e,t.intersectsPlane(ud,Uf,r),new De(r[0],r[1])}class pd extends Pu{}function dd(t,{width:e,height:r},o,a){if(a){if(a instanceof Uint8ClampedArray)a=new Uint8Array(a.buffer);else if(a.length!==e*r*o)throw new RangeError("mismatched image size")}else a=new Uint8Array(e*r*o);return t.width=e,t.height=r,t.data=a,t}function md(t,e,r){const{width:o,height:a}=e;o===t.width&&a===t.height||(Ru(t,e,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,o),height:Math.min(t.height,a)},r),t.width=o,t.height=a,t.data=e.data)}function Ru(t,e,r,o,a,c){if(a.width===0||a.height===0)return e;if(a.width>t.width||a.height>t.height||r.x>t.width-a.width||r.y>t.height-a.height)throw new RangeError("out of range source coordinates for image copy");if(a.width>e.width||a.height>e.height||o.x>e.width-a.width||o.y>e.height-a.height)throw new RangeError("out of range destination coordinates for image copy");const u=t.data,d=e.data;for(let f=0;f<a.height;f++){const g=((r.y+f)*t.width+r.x)*c,x=((o.y+f)*e.width+o.x)*c;for(let w=0;w<a.width*c;w++)d[x+w]=u[g+w]}return e}Ue(pd,"HeatmapBucket",{omit:["layers"]});class Jo{constructor(e,r){dd(this,e,1,r)}resize(e){md(this,new Jo(e),1)}clone(){return new Jo({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,o,a,c){Ru(e,r,o,a,c,1)}}class wi{constructor(e,r){dd(this,e,4,r)}resize(e){md(this,new wi(e),4)}replace(e,r){r?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new wi({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,o,a,c){Ru(e,r,o,a,c,4)}}Ue(Jo,"AlphaImage"),Ue(wi,"RGBAImage");var Nf={paint:new V({"heatmap-radius":new L(me.paint_heatmap["heatmap-radius"]),"heatmap-weight":new L(me.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new A(me.paint_heatmap["heatmap-intensity"]),"heatmap-color":new N(me.paint_heatmap["heatmap-color"]),"heatmap-opacity":new A(me.paint_heatmap["heatmap-opacity"])})};function Bu(t){const e={},r=t.resolution||256,o=t.clips?t.clips.length:1,a=t.image||new wi({width:r,height:o}),c=(u,d,f)=>{e[t.evaluationKey]=f;const g=t.expression.evaluate(e);a.data[u+d+0]=Math.floor(255*g.r/g.a),a.data[u+d+1]=Math.floor(255*g.g/g.a),a.data[u+d+2]=Math.floor(255*g.b/g.a),a.data[u+d+3]=Math.floor(255*g.a)};if(t.clips)for(let u=0,d=0;u<o;++u,d+=4*r)for(let f=0,g=0;f<r;f++,g+=4){const x=f/(r-1),{start:w,end:b}=t.clips[u];c(d,g,w*(1-x)+b*x)}else for(let u=0,d=0;u<r;u++,d+=4)c(0,d,u/(r-1));return a}var Vf={paint:new V({"hillshade-illumination-direction":new A(me.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new A(me.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new A(me.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new A(me.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new A(me.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new A(me.paint_hillshade["hillshade-accent-color"])})};const Gf=te([{name:"a_pos",components:2,type:"Int16"}],4),{members:$f}=Gf;var Fu={exports:{}};function mh(t,e,r){r=r||2;var o,a,c,u,d,f,g,x=e&&e.length,w=x?e[0]*r:t.length,b=fd(t,0,w,r,!0),k=[];if(!b||b.next===b.prev)return k;if(x&&(b=function(I,D,U,Z){var j,$,W,X=[];for(j=0,$=D.length;j<$;j++)(W=fd(I,D[j]*Z,j<$-1?D[j+1]*Z:I.length,Z,!1))===W.next&&(W.steiner=!0),X.push(Jf(W));for(X.sort(Yf),j=0;j<X.length;j++)U=Hf(X[j],U);return U}(t,e,b,r)),t.length>80*r){o=c=t[0],a=u=t[1];for(var S=r;S<w;S+=r)(d=t[S])<o&&(o=d),(f=t[S+1])<a&&(a=f),d>c&&(c=d),f>u&&(u=f);g=(g=Math.max(c-o,u-a))!==0?32767/g:0}return $l(b,k,r,o,a,g,0),k}function fd(t,e,r,o,a){var c,u;if(a===ju(t,e,r,o)>0)for(c=e;c<r;c+=o)u=yd(c,t[c],t[c+1],u);else for(c=r-o;c>=e;c-=o)u=yd(c,t[c],t[c+1],u);return u&&fh(u,u.next)&&(Zl(u),u=u.next),u}function Aa(t,e){if(!t)return t;e||(e=t);var r,o=t;do if(r=!1,o.steiner||!fh(o,o.next)&&_r(o.prev,o,o.next)!==0)o=o.next;else{if(Zl(o),(o=e=o.prev)===o.next)break;r=!0}while(r||o!==e);return e}function $l(t,e,r,o,a,c,u){if(t){!u&&c&&function(x,w,b,k){var S=x;do S.z===0&&(S.z=Ou(S.x,S.y,w,b,k)),S.prevZ=S.prev,S.nextZ=S.next,S=S.next;while(S!==x);S.prevZ.nextZ=null,S.prevZ=null,function(I){var D,U,Z,j,$,W,X,ce,ae=1;do{for(U=I,I=null,$=null,W=0;U;){for(W++,Z=U,X=0,D=0;D<ae&&(X++,Z=Z.nextZ);D++);for(ce=ae;X>0||ce>0&&Z;)X!==0&&(ce===0||!Z||U.z<=Z.z)?(j=U,U=U.nextZ,X--):(j=Z,Z=Z.nextZ,ce--),$?$.nextZ=j:I=j,j.prevZ=$,$=j;U=Z}$.nextZ=null,ae*=2}while(W>1)}(S)}(t,o,a,c);for(var d,f,g=t;t.prev!==t.next;)if(d=t.prev,f=t.next,c?Zf(t,o,a,c):qf(t))e.push(d.i/r|0),e.push(t.i/r|0),e.push(f.i/r|0),Zl(t),t=f.next,g=f.next;else if((t=f)===g){u?u===1?$l(t=Xf(Aa(t),e,r),e,r,o,a,c,2):u===2&&Wf(t,e,r,o,a,c):$l(Aa(t),e,r,o,a,c,1);break}}}function qf(t){var e=t.prev,r=t,o=t.next;if(_r(e,r,o)>=0)return!1;for(var a=e.x,c=r.x,u=o.x,d=e.y,f=r.y,g=o.y,x=a<c?a<u?a:u:c<u?c:u,w=d<f?d<g?d:g:f<g?f:g,b=a>c?a>u?a:u:c>u?c:u,k=d>f?d>g?d:g:f>g?f:g,S=o.next;S!==e;){if(S.x>=x&&S.x<=b&&S.y>=w&&S.y<=k&&bs(a,d,c,f,u,g,S.x,S.y)&&_r(S.prev,S,S.next)>=0)return!1;S=S.next}return!0}function Zf(t,e,r,o){var a=t.prev,c=t,u=t.next;if(_r(a,c,u)>=0)return!1;for(var d=a.x,f=c.x,g=u.x,x=a.y,w=c.y,b=u.y,k=d<f?d<g?d:g:f<g?f:g,S=x<w?x<b?x:b:w<b?w:b,I=d>f?d>g?d:g:f>g?f:g,D=x>w?x>b?x:b:w>b?w:b,U=Ou(k,S,e,r,o),Z=Ou(I,D,e,r,o),j=t.prevZ,$=t.nextZ;j&&j.z>=U&&$&&$.z<=Z;){if(j.x>=k&&j.x<=I&&j.y>=S&&j.y<=D&&j!==a&&j!==u&&bs(d,x,f,w,g,b,j.x,j.y)&&_r(j.prev,j,j.next)>=0||(j=j.prevZ,$.x>=k&&$.x<=I&&$.y>=S&&$.y<=D&&$!==a&&$!==u&&bs(d,x,f,w,g,b,$.x,$.y)&&_r($.prev,$,$.next)>=0))return!1;$=$.nextZ}for(;j&&j.z>=U;){if(j.x>=k&&j.x<=I&&j.y>=S&&j.y<=D&&j!==a&&j!==u&&bs(d,x,f,w,g,b,j.x,j.y)&&_r(j.prev,j,j.next)>=0)return!1;j=j.prevZ}for(;$&&$.z<=Z;){if($.x>=k&&$.x<=I&&$.y>=S&&$.y<=D&&$!==a&&$!==u&&bs(d,x,f,w,g,b,$.x,$.y)&&_r($.prev,$,$.next)>=0)return!1;$=$.nextZ}return!0}function Xf(t,e,r){var o=t;do{var a=o.prev,c=o.next.next;!fh(a,c)&&gd(a,o,o.next,c)&&ql(a,c)&&ql(c,a)&&(e.push(a.i/r|0),e.push(o.i/r|0),e.push(c.i/r|0),Zl(o),Zl(o.next),o=t=c),o=o.next}while(o!==t);return Aa(o)}function Wf(t,e,r,o,a,c){var u=t;do{for(var d=u.next.next;d!==u.prev;){if(u.i!==d.i&&Qf(u,d)){var f=_d(u,d);return u=Aa(u,u.next),f=Aa(f,f.next),$l(u,e,r,o,a,c,0),void $l(f,e,r,o,a,c,0)}d=d.next}u=u.next}while(u!==t)}function Yf(t,e){return t.x-e.x}function Hf(t,e){var r=function(a,c){var u,d=c,f=a.x,g=a.y,x=-1/0;do{if(g<=d.y&&g>=d.next.y&&d.next.y!==d.y){var w=d.x+(g-d.y)*(d.next.x-d.x)/(d.next.y-d.y);if(w<=f&&w>x&&(x=w,u=d.x<d.next.x?d:d.next,w===f))return u}d=d.next}while(d!==c);if(!u)return null;var b,k=u,S=u.x,I=u.y,D=1/0;d=u;do f>=d.x&&d.x>=S&&f!==d.x&&bs(g<I?f:x,g,S,I,g<I?x:f,g,d.x,d.y)&&(b=Math.abs(g-d.y)/(f-d.x),ql(d,a)&&(b<D||b===D&&(d.x>u.x||d.x===u.x&&Kf(u,d)))&&(u=d,D=b)),d=d.next;while(d!==k);return u}(t,e);if(!r)return e;var o=_d(r,t);return Aa(o,o.next),Aa(r,r.next)}function Kf(t,e){return _r(t.prev,t,e.prev)<0&&_r(e.next,t,t.next)<0}function Ou(t,e,r,o,a){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*a|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-o)*a|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Jf(t){var e=t,r=t;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==t);return r}function bs(t,e,r,o,a,c,u,d){return(a-u)*(e-d)>=(t-u)*(c-d)&&(t-u)*(o-d)>=(r-u)*(e-d)&&(r-u)*(c-d)>=(a-u)*(o-d)}function Qf(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(r,o){var a=r;do{if(a.i!==r.i&&a.next.i!==r.i&&a.i!==o.i&&a.next.i!==o.i&&gd(a,a.next,r,o))return!0;a=a.next}while(a!==r);return!1}(t,e)&&(ql(t,e)&&ql(e,t)&&function(r,o){var a=r,c=!1,u=(r.x+o.x)/2,d=(r.y+o.y)/2;do a.y>d!=a.next.y>d&&a.next.y!==a.y&&u<(a.next.x-a.x)*(d-a.y)/(a.next.y-a.y)+a.x&&(c=!c),a=a.next;while(a!==r);return c}(t,e)&&(_r(t.prev,t,e.prev)||_r(t,e.prev,e))||fh(t,e)&&_r(t.prev,t,t.next)>0&&_r(e.prev,e,e.next)>0)}function _r(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function fh(t,e){return t.x===e.x&&t.y===e.y}function gd(t,e,r,o){var a=_h(_r(t,e,r)),c=_h(_r(t,e,o)),u=_h(_r(r,o,t)),d=_h(_r(r,o,e));return a!==c&&u!==d||!(a!==0||!gh(t,r,e))||!(c!==0||!gh(t,o,e))||!(u!==0||!gh(r,t,o))||!(d!==0||!gh(r,e,o))}function gh(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function _h(t){return t>0?1:t<0?-1:0}function ql(t,e){return _r(t.prev,t,t.next)<0?_r(t,e,t.next)>=0&&_r(t,t.prev,e)>=0:_r(t,e,t.prev)<0||_r(t,t.next,e)<0}function _d(t,e){var r=new Uu(t.i,t.x,t.y),o=new Uu(e.i,e.x,e.y),a=t.next,c=e.prev;return t.next=e,e.prev=t,r.next=a,a.prev=r,o.next=r,r.prev=o,c.next=o,o.prev=c,o}function yd(t,e,r,o){var a=new Uu(t,e,r);return o?(a.next=o.next,a.prev=o,o.next.prev=a,o.next=a):(a.prev=a,a.next=a),a}function Zl(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Uu(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ju(t,e,r,o){for(var a=0,c=e,u=r-o;c<r;c+=o)a+=(t[u]-t[c])*(t[c+1]+t[u+1]),u=c;return a}Fu.exports=mh,Fu.exports.default=mh,mh.deviation=function(t,e,r,o){var a=e&&e.length,c=Math.abs(ju(t,0,a?e[0]*r:t.length,r));if(a)for(var u=0,d=e.length;u<d;u++)c-=Math.abs(ju(t,e[u]*r,u<d-1?e[u+1]*r:t.length,r));var f=0;for(u=0;u<o.length;u+=3){var g=o[u]*r,x=o[u+1]*r,w=o[u+2]*r;f+=Math.abs((t[g]-t[w])*(t[x+1]-t[g+1])-(t[g]-t[x])*(t[w+1]-t[g+1]))}return c===0&&f===0?0:Math.abs((f-c)/c)},mh.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},o=0,a=0;a<t.length;a++){for(var c=0;c<t[a].length;c++)for(var u=0;u<e;u++)r.vertices.push(t[a][c][u]);a>0&&r.holes.push(o+=t[a-1].length)}return r};var Nu=ai(Fu.exports);function eg(t,e,r,o,a){xd(t,e,r||0,o||t.length-1,a||tg)}function xd(t,e,r,o,a){for(;o>r;){if(o-r>600){var c=o-r+1,u=e-r+1,d=Math.log(c),f=.5*Math.exp(2*d/3),g=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1);xd(t,e,Math.max(r,Math.floor(e-u*f/c+g)),Math.min(o,Math.floor(e+(c-u)*f/c+g)),a)}var x=t[e],w=r,b=o;for(Xl(t,r,e),a(t[o],x)>0&&Xl(t,r,o);w<b;){for(Xl(t,w,b),w++,b--;a(t[w],x)<0;)w++;for(;a(t[b],x)>0;)b--}a(t[r],x)===0?Xl(t,r,b):Xl(t,++b,o),b<=e&&(r=b+1),e<=b&&(o=b-1)}}function Xl(t,e,r){var o=t[e];t[e]=t[r],t[r]=o}function tg(t,e){return t<e?-1:t>e?1:0}function Vu(t,e){const r=t.length;if(r<=1)return[t];const o=[];let a,c;for(let u=0;u<r;u++){const d=Ra(t[u]);d!==0&&(t[u].area=Math.abs(d),c===void 0&&(c=d<0),c===d<0?(a&&o.push(a),a=[t[u]]):a.push(t[u]))}if(a&&o.push(a),e>1)for(let u=0;u<o.length;u++)o[u].length<=e||(eg(o[u],e,1,o[u].length-1,rg),o[u]=o[u].slice(0,e));return o}function rg(t,e){return e.area-t.area}function Gu(t,e,r){const o=r.patternDependencies;let a=!1;for(const c of e){const u=c.paint.get(`${t}-pattern`);u.isConstant()||(a=!0);const d=u.constantOr(null);d&&(a=!0,o[d]=!0)}return a}function $u(t,e,r,o,a){const c=a.patternDependencies;for(const u of e){const d=u.paint.get(`${t}-pattern`).value;if(d.kind!=="constant"){let f=d.evaluate({zoom:o},r,{},a.availableImages);f=f&&f.name?f.name:f,c[f]=!0,r.patterns[u.id]=f}}return r}class yh{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Ee,this.indexArray=new $e,this.indexArray2=new Cr,this.programConfigurations=new va(e.layers,e.zoom),this.segments=new gr,this.segments2=new gr,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id),this.projection=e.projection}populate(e,r,o,a){this.hasPattern=Gu("fill",this.layers,r);const c=this.layers[0].layout.get("fill-sort-key"),u=[];for(const{feature:d,id:f,index:g,sourceLayerIndex:x}of e){const w=this.layers[0]._featureFilter.needGeometry,b=Sa(d,w);if(!this.layers[0]._featureFilter.filter(new v(this.zoom),b,o))continue;const k=c?c.evaluate(b,{},o,r.availableImages):void 0,S={id:f,properties:d.properties,type:d.type,sourceLayerIndex:x,index:g,geometry:w?b.geometry:Ko(d,o,a),patterns:{},sortKey:k};u.push(S)}c&&u.sort((d,f)=>d.sortKey-f.sortKey);for(const d of u){const{geometry:f,index:g,sourceLayerIndex:x}=d;if(this.hasPattern){const w=$u("fill",this.layers,d,this.zoom,r);this.patternFeatures.push(w)}else this.addFeature(d,f,g,o,{},r.availableImages);r.featureIndex.insert(e[g].feature,f,g,x,this.index)}}update(e,r,o,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,o,a)}addFeatures(e,r,o,a,c){for(const u of this.patternFeatures)this.addFeature(u,u.geometry,u.index,r,o,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,$f),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,r,o,a,c,u=[]){for(const d of Vu(r,500)){let f=0;for(const S of d)f+=S.length;const g=this.segments.prepareSegment(f,this.layoutVertexArray,this.indexArray),x=g.vertexLength,w=[],b=[];for(const S of d){if(S.length===0)continue;S!==d[0]&&b.push(w.length/2);const I=this.segments2.prepareSegment(S.length,this.layoutVertexArray,this.indexArray2),D=I.vertexLength;this.layoutVertexArray.emplaceBack(S[0].x,S[0].y),this.indexArray2.emplaceBack(D+S.length-1,D),w.push(S[0].x),w.push(S[0].y);for(let U=1;U<S.length;U++)this.layoutVertexArray.emplaceBack(S[U].x,S[U].y),this.indexArray2.emplaceBack(D+U-1,D+U),w.push(S[U].x),w.push(S[U].y);I.vertexLength+=S.length,I.primitiveLength+=S.length}const k=Nu(w,b);for(let S=0;S<k.length;S+=3)this.indexArray.emplaceBack(x+k[S],x+k[S+1],x+k[S+2]);g.vertexLength+=f,g.primitiveLength+=k.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,c,u,a)}}Ue(yh,"FillBucket",{omit:["layers","patternFeatures"]});const ig=new V({"fill-sort-key":new L(me.layout_fill["fill-sort-key"])});var og={paint:new V({"fill-antialias":new A(me.paint_fill["fill-antialias"]),"fill-opacity":new L(me.paint_fill["fill-opacity"]),"fill-color":new L(me.paint_fill["fill-color"]),"fill-outline-color":new L(me.paint_fill["fill-outline-color"]),"fill-translate":new A(me.paint_fill["fill-translate"]),"fill-translate-anchor":new A(me.paint_fill["fill-translate-anchor"]),"fill-pattern":new L(me.paint_fill["fill-pattern"])}),layout:ig};const ng=te([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),ag=te([{name:"a_centroid_pos",components:2,type:"Uint16"}]),sg=te([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),{members:lg}=ng;var xh={},cg=jr,vd=Ts;function Ts(t,e,r,o,a){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=o,this._values=a,t.readFields(hg,this,e)}function hg(t,e,r){t==1?e.id=r.readVarint():t==2?function(o,a){for(var c=o.readVarint()+o.pos;o.pos<c;){var u=a._keys[o.readVarint()],d=a._values[o.readVarint()];a.properties[u]=d}}(r,e):t==3?e.type=r.readVarint():t==4&&(e._geometry=r.pos)}function ug(t){for(var e,r,o=0,a=0,c=t.length,u=c-1;a<c;u=a++)o+=((r=t[u]).x-(e=t[a]).x)*(e.y+r.y);return o}Ts.types=["Unknown","Point","LineString","Polygon"],Ts.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,o=1,a=0,c=0,u=0,d=[];t.pos<r;){if(a<=0){var f=t.readVarint();o=7&f,a=f>>3}if(a--,o===1||o===2)c+=t.readSVarint(),u+=t.readSVarint(),o===1&&(e&&d.push(e),e=[]),e.push(new cg(c,u));else{if(o!==7)throw new Error("unknown command "+o);e&&e.push(e[0].clone())}}return e&&d.push(e),d},Ts.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,o=0,a=0,c=0,u=1/0,d=-1/0,f=1/0,g=-1/0;t.pos<e;){if(o<=0){var x=t.readVarint();r=7&x,o=x>>3}if(o--,r===1||r===2)(a+=t.readSVarint())<u&&(u=a),a>d&&(d=a),(c+=t.readSVarint())<f&&(f=c),c>g&&(g=c);else if(r!==7)throw new Error("unknown command "+r)}return[u,f,d,g]},Ts.prototype.toGeoJSON=function(t,e,r){var o,a,c=this.extent*Math.pow(2,r),u=this.extent*t,d=this.extent*e,f=this.loadGeometry(),g=Ts.types[this.type];function x(k){for(var S=0;S<k.length;S++){var I=k[S];k[S]=[360*(I.x+u)/c-180,360/Math.PI*Math.atan(Math.exp((180-360*(I.y+d)/c)*Math.PI/180))-90]}}switch(this.type){case 1:var w=[];for(o=0;o<f.length;o++)w[o]=f[o][0];x(f=w);break;case 2:for(o=0;o<f.length;o++)x(f[o]);break;case 3:for(f=function(k){var S=k.length;if(S<=1)return[k];for(var I,D,U=[],Z=0;Z<S;Z++){var j=ug(k[Z]);j!==0&&(D===void 0&&(D=j<0),D===j<0?(I&&U.push(I),I=[k[Z]]):I.push(k[Z]))}return I&&U.push(I),U}(f),o=0;o<f.length;o++)for(a=0;a<f[o].length;a++)x(f[o][a])}f.length===1?f=f[0]:g="Multi"+g;var b={type:"Feature",geometry:{type:g,coordinates:f},properties:this.properties};return"id"in this&&(b.id=this.id),b};var pg=vd,wd=bd;function bd(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(dg,this,e),this.length=this._features.length}function dg(t,e,r){t===15?e.version=r.readVarint():t===1?e.name=r.readString():t===5?e.extent=r.readVarint():t===2?e._features.push(r.pos):t===3?e._keys.push(r.readString()):t===4&&e._values.push(function(o){for(var a=null,c=o.readVarint()+o.pos;o.pos<c;){var u=o.readVarint()>>3;a=u===1?o.readString():u===2?o.readFloat():u===3?o.readDouble():u===4?o.readVarint64():u===5?o.readVarint():u===6?o.readSVarint():u===7?o.readBoolean():null}return a}(r))}bd.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new pg(this._pbf,e,this.extent,this._keys,this._values)};var mg=wd;function fg(t,e,r){if(t===3){var o=new mg(r,r.readVarint()+r.pos);o.length&&(e[o.name]=o)}}var qu=xh.VectorTile=function(t,e){this.layers=t.readFields(fg,{},e)},vh=xh.VectorTileFeature=vd;function wh(t,e,r,o){const a=[],c=o===0?(u,d,f,g,x,w)=>{u.push(new De(w,f+(w-d)/(g-d)*(x-f)))}:(u,d,f,g,x,w)=>{u.push(new De(d+(w-f)/(x-f)*(g-d),w))};for(const u of t){const d=[];for(const f of u){if(f.length<=2)continue;const g=[];for(let b=0;b<f.length-1;b++){const k=f[b].x,S=f[b].y,I=f[b+1].x,D=f[b+1].y,U=o===0?k:S,Z=o===0?I:D;U<e?Z>e&&c(g,k,S,I,D,e):U>r?Z<r&&c(g,k,S,I,D,r):g.push(f[b]),Z<e&&U>=e&&c(g,k,S,I,D,e),Z>r&&U<=r&&c(g,k,S,I,D,r)}let x=f[f.length-1];const w=o===0?x.x:x.y;w>=e&&w<=r&&g.push(x),g.length&&(x=g[g.length-1],g[0].x===x.x&&g[0].y===x.y||g.push(g[0]),d.push(g))}d.length&&a.push(d)}return a}xh.VectorTileLayer=wd;const gg=vh.types,_g=Math.pow(2,13);function Wl(t,e,r,o,a,c,u,d){t.emplaceBack((e<<1)+u,(r<<1)+c,(Math.floor(o*_g)<<1)+a,Math.round(d))}function Yl(t,e,r){t.emplaceBack(e.x,e.y,e.z,r[0]*16384,r[1]*16384,r[2]*16384)}class Td{constructor(){this.acc=new De(0,0),this.polyCount=[]}startRing(e){this.currentPolyCount={edges:0,top:0},this.polyCount.push(this.currentPolyCount),this.min||(this.min=new De(e.x,e.y),this.max=new De(e.x,e.y))}append(e,r){this.currentPolyCount.edges++,this.acc._add(e);const o=this.min,a=this.max;e.x<o.x?o.x=e.x:e.x>a.x&&(a.x=e.x),e.y<o.y?o.y=e.y:e.y>a.y&&(a.y=e.y),((e.x===0||e.x===Xe)&&e.x===r.x)!=((e.y===0||e.y===Xe)&&e.y===r.y)&&this.processBorderOverlap(e,r),r.x<0!=e.x<0&&this.addBorderIntersection(0,bt(r.y,e.y,(0-r.x)/(e.x-r.x))),r.x>Xe!=e.x>Xe&&this.addBorderIntersection(1,bt(r.y,e.y,(Xe-r.x)/(e.x-r.x))),r.y<0!=e.y<0&&this.addBorderIntersection(2,bt(r.x,e.x,(0-r.y)/(e.y-r.y))),r.y>Xe!=e.y>Xe&&this.addBorderIntersection(3,bt(r.x,e.x,(Xe-r.y)/(e.y-r.y)))}addBorderIntersection(e,r){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const o=this.borders[e];r<o[0]&&(o[0]=r),r>o[1]&&(o[1]=r)}processBorderOverlap(e,r){if(e.x===r.x){if(e.y===r.y)return;const o=e.x===0?0:1;this.addBorderIntersection(o,r.y),this.addBorderIntersection(o,e.y)}else{const o=e.y===0?2:3;this.addBorderIntersection(o,r.x),this.addBorderIntersection(o,e.x)}}centroid(){const e=this.polyCount.reduce((r,o)=>r+o.edges,0);return e!==0?this.acc.div(e)._round():new De(0,0)}span(){return new De(this.max.x-this.min.x,this.max.y-this.min.y)}intersectsCount(){return this.borders.reduce((e,r)=>e+ +(r[0]!==Number.MAX_VALUE),0)}}class Hl{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.layoutVertexArray=new _e,this.centroidVertexArray=new io,this.indexArray=new $e,this.programConfigurations=new va(e.layers,e.zoom),this.segments=new gr,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id),this.enableTerrain=e.enableTerrain}populate(e,r,o,a){this.features=[],this.hasPattern=Gu("fill-extrusion",this.layers,r),this.featuresOnBorder=[],this.borders=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=function(c){const u=Math.exp(Math.PI*(1-c.y/(1<<c.z)*2));return 80150034*u/(u*u+1)/Xe/(1<<c.z)}(o),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter;for(const{feature:c,id:u,index:d,sourceLayerIndex:f}of e){const g=this.layers[0]._featureFilter.needGeometry,x=Sa(c,g);if(!this.layers[0]._featureFilter.filter(new v(this.zoom),x,o))continue;const w={id:u,sourceLayerIndex:f,index:d,geometry:g?x.geometry:Ko(c,o,a),properties:c.properties,type:c.type,patterns:{}},b=this.layoutVertexArray.length;this.hasPattern?this.features.push($u("fill-extrusion",this.layers,w,this.zoom,r)):this.addFeature(w,w.geometry,d,o,{},r.availableImages,a),r.featureIndex.insert(c,w.geometry,d,f,this.index,b)}this.sortBorders()}addFeatures(e,r,o,a,c){for(const u of this.features){const{geometry:d}=u;this.addFeature(u,d,u.index,r,o,a,c)}this.sortBorders()}update(e,r,o,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,o,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,lg),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=e.createVertexBuffer(this.layoutVertexExtArray,sg.members,!0))),this.programConfigurations.upload(e),this.uploaded=!0}uploadCentroid(e){this.centroidVertexArray.length!==0&&(this.centroidVertexBuffer?this.needsCentroidUpdate&&this.centroidVertexBuffer.updateData(this.centroidVertexArray):this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,ag.members,!0),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,r,o,a,c,u,d){const f=[new De(0,0),new De(Xe,Xe)],g=d.projection,x=g.name==="globe",w=this.enableTerrain&&!x?new Td:null,b=gg[e.type]==="Polygon";x&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new Se);const k=Vu(r,500);for(let U=k.length-1;U>=0;U--){const Z=k[U];(Z.length===0||(S=Z[0]).every(j=>j.x<=0)||S.every(j=>j.x>=Xe)||S.every(j=>j.y<=0)||S.every(j=>j.y>=Xe))&&k.splice(U,1)}var S;let I;if(x)I=Cd(k,f,a);else{I=[];for(const U of k)I.push({polygon:U,bounds:f})}const D=b?this.edgeRadius:0;for(const{polygon:U,bounds:Z}of I){let j=0,$=0;for(const X of U)b&&!X[0].equals(X[X.length-1])&&X.push(X[0]),$+=b?X.length-1:X.length;const W=this.segments.prepareSegment((b?5:4)*$,this.layoutVertexArray,this.indexArray);if(b){const X=[],ce=[];j=W.vertexLength;for(const fe of U){let ke,ue;fe.length&&fe!==U[0]&&ce.push(X.length/2),ke=fe[1].sub(fe[0])._perp()._unit();for(let ye=1;ye<fe.length;ye++){const xe=fe[ye],be=fe[ye===fe.length-1?1:ye+1];let{x:Ie,y:de}=xe;if(D){ue=be.sub(xe)._perp()._unit();const Le=ke.add(ue)._unit(),Ne=D*Math.min(4,1/(ke.x*Le.x+ke.y*Le.y));Ie+=Ne*Le.x,de+=Ne*Le.y,ke=ue}Wl(this.layoutVertexArray,Ie,de,0,0,1,1,0),W.vertexLength++,X.push(xe.x,xe.y),x&&Yl(this.layoutVertexExtArray,g.projectTilePoint(Ie,de,a),g.upVector(a,Ie,de))}}const ae=Nu(X,ce);for(let fe=0;fe<ae.length;fe+=3)this.indexArray.emplaceBack(j+ae[fe],j+ae[fe+2],j+ae[fe+1]),W.primitiveLength++}for(const X of U){w&&X.length&&w.startRing(X[0]);let ce,ae,fe,ke=X.length>4&&Md(X[X.length-2],X[0],X[1]),ue=D?yg(X[X.length-2],X[0],X[1],D):0;ae=X[1].sub(X[0])._perp()._unit();let ye=!0;for(let xe=1,be=0;xe<X.length;xe++){let Ie=X[xe-1],de=X[xe];const Le=X[xe===X.length-1?1:xe+1];if(w&&b&&w.currentPolyCount.top++,Sd(de,Ie,Z)){D&&(ae=Le.sub(de)._perp()._unit(),ye=!ye);continue}w&&w.append(de,Ie);const Ne=de.sub(Ie)._perp(),Re=Ne.x/(Math.abs(Ne.x)+Math.abs(Ne.y)),et=Ne.y>0?1:0,Ce=Ie.dist(de);if(be+Ce>32768&&(be=0),D){fe=Le.sub(de)._perp()._unit();let rt=kd(Ie,de,Le,Ed(ae,fe),D);isNaN(rt)&&(rt=0);const Ye=de.sub(Ie)._unit();Ie=Ie.add(Ye.mult(ue))._round(),de=de.add(Ye.mult(-rt))._round(),ue=rt,ae=fe}const Ze=W.vertexLength,tt=X.length>4&&Md(Ie,de,Le);let Et=Ad(be,ke,ye);if(Wl(this.layoutVertexArray,Ie.x,Ie.y,Re,et,0,0,Et),Wl(this.layoutVertexArray,Ie.x,Ie.y,Re,et,0,1,Et),be+=Ce,Et=Ad(be,tt,!ye),ke=tt,Wl(this.layoutVertexArray,de.x,de.y,Re,et,0,0,Et),Wl(this.layoutVertexArray,de.x,de.y,Re,et,0,1,Et),W.vertexLength+=4,this.indexArray.emplaceBack(Ze+0,Ze+1,Ze+2),this.indexArray.emplaceBack(Ze+1,Ze+3,Ze+2),W.primitiveLength+=2,D){const rt=j+(xe===1?X.length-2:xe-2),Ye=xe===1?j:rt+1;if(this.indexArray.emplaceBack(Ze+1,rt,Ze+3),this.indexArray.emplaceBack(rt,Ye,Ze+3),W.primitiveLength+=2,ce===void 0&&(ce=Ze),!Sd(Le,X[xe],Z)){const Wt=xe===X.length-1?ce:W.vertexLength;this.indexArray.emplaceBack(Ze+2,Ze+3,Wt),this.indexArray.emplaceBack(Ze+3,Wt+1,Wt),this.indexArray.emplaceBack(Ze+3,Ye,Wt+1),W.primitiveLength+=3}ye=!ye}if(x){const rt=this.layoutVertexExtArray,Ye=g.projectTilePoint(Ie.x,Ie.y,a),Wt=g.projectTilePoint(de.x,de.y,a),at=g.upVector(a,Ie.x,Ie.y),st=g.upVector(a,de.x,de.y);Yl(rt,Ye,at),Yl(rt,Ye,at),Yl(rt,Wt,st),Yl(rt,Wt,st)}}b&&(j+=X.length-1)}}if(w&&w.polyCount.length>0){if(w.borders){w.vertexArrayOffset=this.centroidVertexArray.length;const U=w.borders,Z=this.featuresOnBorder.push(w)-1;for(let j=0;j<4;j++)U[j][0]!==Number.MAX_VALUE&&this.borders[j].push(Z)}this.encodeCentroid(w.borders?void 0:w.centroid(),w)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,c,u,a)}sortBorders(){for(let e=0;e<4;e++)this.borders[e].sort((r,o)=>this.featuresOnBorder[r].borders[e][0]-this.featuresOnBorder[o].borders[e][0])}encodeCentroid(e,r,o=!0){let a,c;if(e)if(e.y!==0){const d=r.span()._mult(this.tileToMeter);a=(Math.max(e.x,1)<<3)+Math.min(7,Math.round(d.x/10)),c=(Math.max(e.y,1)<<3)+Math.min(7,Math.round(d.y/10))}else a=Math.ceil(7*(e.x+450)),c=0;else a=0,c=+o;let u=o?this.centroidVertexArray.length:r.vertexArrayOffset;for(const d of r.polyCount){o&&this.centroidVertexArray.resize(this.centroidVertexArray.length+4*d.edges+d.top);for(let f=0;f<d.top;f++)this.centroidVertexArray.emplace(u++,a,c);for(let f=0;f<2*d.edges;f++)this.centroidVertexArray.emplace(u++,0,c),this.centroidVertexArray.emplace(u++,a,c)}}}function Ed(t,e){const r=t.add(e)._unit();return t.x*r.x+t.y*r.y}function yg(t,e,r,o){const a=e.sub(t)._perp()._unit(),c=r.sub(e)._perp()._unit();return kd(t,e,r,Ed(a,c),o)}function kd(t,e,r,o,a){const c=Math.sqrt(1-o*o);return Math.min(t.dist(e)/3,e.dist(r)/3,a*c/o)}function Sd(t,e,r){return t.x<r[0].x&&e.x<r[0].x||t.x>r[1].x&&e.x>r[1].x||t.y<r[0].y&&e.y<r[0].y||t.y>r[1].y&&e.y>r[1].y}function Md(t,e,r){if(t.x<0||t.x>=Xe||e.x<0||e.x>=Xe||r.x<0||r.x>=Xe)return!1;const o=r.sub(e),a=o.perp(),c=t.sub(e);return(o.x*c.x+o.y*c.y)/Math.sqrt((o.x*o.x+o.y*o.y)*(c.x*c.x+c.y*c.y))>-.866&&a.x*c.x+a.y*c.y<0}function Ad(t,e,r){const o=e?2|t:-3&t;return r?1|o:-2&o}function Id(){const t=Math.PI/32,e=Math.tan(t),r=Gl;return r*Math.sqrt(1+2*e*e)-r}function Cd(t,e,r){const o=1<<r.z,a=Ci(r.x/o),c=Ci((r.x+1)/o),u=$r(r.y/o),d=$r((r.y+1)/o);return function(f,g,x,w,b=0,k){const S=[];if(!f.length||!x||!w)return S;const I=(X,ce)=>{for(const ae of X)S.push({polygon:ae,bounds:ce})},D=Math.ceil(Math.log2(x)),U=Math.ceil(Math.log2(w)),Z=D-U,j=[];for(let X=0;X<Math.abs(Z);X++)j.push(Z>0?0:1);for(let X=0;X<Math.min(D,U);X++)j.push(0),j.push(1);let $=f;if($=wh($,g[0].y-b,g[1].y+b,1),$=wh($,g[0].x-b,g[1].x+b,0),!$.length)return S;const W=[];for(j.length?W.push({polygons:$,bounds:g,depth:0}):I($,g);W.length;){const X=W.pop(),ce=X.depth,ae=j[ce],fe=X.bounds[0],ke=X.bounds[1],ue=ae===0?fe.x:fe.y,ye=ae===0?ke.x:ke.y,xe=k?k(ae,ue,ye):.5*(ue+ye),be=wh(X.polygons,ue-b,xe+b,ae),Ie=wh(X.polygons,xe-b,ye+b,ae);if(be.length){const de=[fe,new De(ae===0?xe:ke.x,ae===1?xe:ke.y)];j.length>ce+1?W.push({polygons:be,bounds:de,depth:ce+1}):I(be,de)}if(Ie.length){const de=[new De(ae===0?xe:fe.x,ae===1?xe:fe.y),ke];j.length>ce+1?W.push({polygons:Ie,bounds:de,depth:ce+1}):I(Ie,de)}}return S}(t,e,Math.ceil((c-a)/11.25),Math.ceil((u-d)/11.25),1,(f,g,x)=>{if(f===0)return .5*(g+x);{const w=$r((r.y+g/Xe)/o);return(Mo(.5*($r((r.y+x/Xe)/o)+w))*o-r.y)*Xe}})}Ue(Hl,"FillExtrusionBucket",{omit:["layers","features"]}),Ue(Td,"PartMetadata");const xg=new V({"fill-extrusion-edge-radius":new A(me["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var vg={paint:new V({"fill-extrusion-opacity":new A(me["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new L(me["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new A(me["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new A(me["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new L(me["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new L(me["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new L(me["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new A(me["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new A(me["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new A(me["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-rounded-roof":new A(me["paint_fill-extrusion"]["fill-extrusion-rounded-roof"])}),layout:xg};function zd(t,e,r){var o=2*Math.PI*6378137/256/Math.pow(2,r);return[t*o-2*Math.PI*6378137/2,e*o-2*Math.PI*6378137/2]}class bh{constructor(e,r,o){this.z=e,this.x=r,this.y=o,this.key=Kl(0,e,e,r,o)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r){const o=function(c,u,d){var f=zd(256*c,256*(u=Math.pow(2,d)-u-1),d),g=zd(256*(c+1),256*(u+1),d);return f[0]+","+f[1]+","+g[0]+","+g[1]}(this.x,this.y,this.z),a=function(c,u,d){let f,g="";for(let x=c;x>0;x--)f=1<<x-1,g+=(u&f?1:0)+(d&f?2:0);return g}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(r==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",a).replace("{bbox-epsg-3857}",o)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Pd{constructor(e,r){this.wrap=e,this.canonical=r,this.key=Kl(e,r.z,r.z,r.x,r.y)}}class ii{constructor(e,r,o,a,c){this.overscaledZ=e,this.wrap=r,this.canonical=new bh(o,+a,+c),this.key=r===0&&e===o?this.canonical.key:Kl(r,e,o,a,c)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){const r=this.canonical.z-e;return e>this.canonical.z?new ii(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ii(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,r=!0){if(this.overscaledZ===e&&r)return this.key;if(e>this.canonical.z)return Kl(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y);{const o=this.canonical.z-e;return Kl(this.wrap*+r,e,e,this.canonical.x>>o,this.canonical.y>>o)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;const r=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new ii(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const r=this.canonical.z+1,o=2*this.canonical.x,a=2*this.canonical.y;return[new ii(r,this.wrap,r,o,a),new ii(r,this.wrap,r,o+1,a),new ii(r,this.wrap,r,o,a+1),new ii(r,this.wrap,r,o+1,a+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new ii(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new ii(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Pd(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}}function Kl(t,e,r,o,a){const c=1<<Math.min(r,22);let u=c*(a%c)+o%c;return t&&r<22&&(u+=c*c*((t<0?-2*t-1:2*t)%(1<<2*(22-r)))),16*(32*u+r)+(e-r)}Ue(bh,"CanonicalTileID"),Ue(ii,"OverscaledTileID",{omit:["projMatrix"]});class Es extends De{constructor(e,r,o){super(e,r),this.z=o}}function Jl(t,e){return t.x*e.x+t.y*e.y}function Dd(t,e){if(t.length===1){let r=0;const o=e[r++];let a;for(;!a||o.equals(a);)if(a=e[r++],!a)return 1/0;for(;r<e.length;r++){const c=e[r],u=t[0],d=a.sub(o),f=c.sub(o),g=u.sub(o),x=Jl(d,d),w=Jl(d,f),b=Jl(f,f),k=Jl(g,d),S=Jl(g,f),I=x*b-w*w,D=(b*k-w*S)/I,U=(x*S-w*k)/I,Z=o.z*(1-D-U)+a.z*D+c.z*U;if(isFinite(Z))return Z}return 1/0}{let r=1/0;for(const o of e)r=Math.min(r,o.z);return r}}function Ld(t,e,r,o,a,c,u,d){const f=u*a.getElevationAt(t,e,!0,!0),g=c[0]!==0,x=g?c[1]===0?u*(c[0]/7-450):u*function(w,b,k){const S=Math.floor(b[0]/8),I=Math.floor(b[1]/8),D=10*(b[0]-8*S),U=10*(b[1]-8*I),Z=w.getElevationAt(S,I,!0,!0),j=w.getMeterToDEM(k),$=Math.floor(.5*(D*j-1)),W=Math.floor(.5*(U*j-1)),X=w.tileCoordToPixel(S,I),ce=2*$+1,ae=2*W+1,fe=function(Ie,de,Le,Ne,Re){return[Ie.getElevationAtPixel(de,Le,!0),Ie.getElevationAtPixel(de+Re,Le,!0),Ie.getElevationAtPixel(de,Le+Re,!0),Ie.getElevationAtPixel(de+Ne,Le+Re,!0)]}(w,X.x-$,X.y-W,ce,ae),ke=Math.abs(fe[0]-fe[1]),ue=Math.abs(fe[2]-fe[3]),ye=Math.abs(fe[0]-fe[2])+Math.abs(fe[1]-fe[3]),xe=Math.min(.25,.5*j*(ke+ue)/ce),be=Math.min(.25,.5*j*ye/ae);return Z+Math.max(xe*D,be*U)}(a,c,d):f;return{base:f+(r===0)?-1:r,top:g?Math.max(x+o,f+r+2):f+o}}const wg=te([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),{members:bg}=wg,Tg=te([{name:"a_packed",components:4,type:"Float32"}]),{members:Eg}=Tg,kg=vh.types,Sg=Math.cos(Math.PI/180*37.5);class Th{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new he,this.layoutVertexArray2=new Te,this.indexArray=new $e,this.programConfigurations=new va(e.layers,e.zoom),this.segments=new gr,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,o,a){this.hasPattern=Gu("line",this.layers,r);const c=this.layers[0].layout.get("line-sort-key"),u=[];for(const{feature:x,id:w,index:b,sourceLayerIndex:k}of e){const S=this.layers[0]._featureFilter.needGeometry,I=Sa(x,S);if(!this.layers[0]._featureFilter.filter(new v(this.zoom),I,o))continue;const D=c?c.evaluate(I,{},o):void 0,U={id:w,properties:x.properties,type:x.type,sourceLayerIndex:k,index:b,geometry:S?I.geometry:Ko(x,o,a),patterns:{},sortKey:D};u.push(U)}c&&u.sort((x,w)=>x.sortKey-w.sortKey);const{lineAtlas:d,featureIndex:f}=r,g=this.addConstantDashes(d);for(const x of u){const{geometry:w,index:b,sourceLayerIndex:k}=x;if(g&&this.addFeatureDashes(x,d),this.hasPattern){const S=$u("line",this.layers,x,this.zoom,r);this.patternFeatures.push(S)}else this.addFeature(x,w,b,o,d.positions,r.availableImages);f.insert(e[b].feature,w,b,k,this.index)}}addConstantDashes(e){let r=!1;for(const o of this.layers){const a=o.paint.get("line-dasharray").value,c=o.layout.get("line-cap").value;if(a.kind!=="constant"||c.kind!=="constant")r=!0;else{const u=c.value,d=a.value;if(!d)continue;e.addDash(d,u)}}return r}addFeatureDashes(e,r){const o=this.zoom;for(const a of this.layers){const c=a.paint.get("line-dasharray").value,u=a.layout.get("line-cap").value;if(c.kind==="constant"&&u.kind==="constant")continue;let d,f;if(c.kind==="constant"){if(d=c.value,!d)continue}else d=c.evaluate({zoom:o},e);f=u.kind==="constant"?u.value:u.evaluate({zoom:o},e),r.addDash(d,f),e.patterns[a.id]=r.getKey(d,f)}}update(e,r,o,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,o,a)}addFeatures(e,r,o,a,c){for(const u of this.patternFeatures)this.addFeature(u,u.geometry,u.index,r,o,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,Eg)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,bg),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,r,o,a,c,u){const d=this.layers[0].layout,f=d.get("line-join").evaluate(e,{}),g=d.get("line-cap").evaluate(e,{}),x=d.get("line-miter-limit"),w=d.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const b of r)this.addLine(b,e,f,g,x,w);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,c,u,a)}addLine(e,r,o,a,c,u){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let U=0;U<e.length-1;U++)this.totalDistance+=e[U].dist(e[U+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const d=kg[r.type]==="Polygon";let f=e.length;for(;f>=2&&e[f-1].equals(e[f-2]);)f--;let g=0;for(;g<f-1&&e[g].equals(e[g+1]);)g++;if(f<(d?3:2))return;o==="bevel"&&(c=1.05);const x=this.overscaling<=16?15*Xe/(512*this.overscaling):0,w=this.segments.prepareSegment(10*f,this.layoutVertexArray,this.indexArray);let b,k,S,I,D;this.e1=this.e2=-1,d&&(b=e[f-2],D=e[g].sub(b)._unit()._perp());for(let U=g;U<f;U++){if(S=U===f-1?d?e[g+1]:void 0:e[U+1],S&&e[U].equals(S))continue;D&&(I=D),b&&(k=b),b=e[U],D=S?S.sub(b)._unit()._perp():I,I=I||D;let Z=I.add(D);Z.x===0&&Z.y===0||Z._unit();const j=I.x*D.x+I.y*D.y,$=Z.x*D.x+Z.y*D.y,W=$!==0?1/$:1/0,X=2*Math.sqrt(2-2*$),ce=$<Sg&&k&&S,ae=I.x*D.y-I.y*D.x>0;if(ce&&U>g){const ue=b.dist(k);if(ue>2*x){const ye=b.sub(b.sub(k)._mult(x/ue)._round());this.updateDistance(k,ye),this.addCurrentVertex(ye,I,0,0,w),k=ye}}const fe=k&&S;let ke=fe?o:d?"butt":a;if(fe&&ke==="round"&&(W<u?ke="miter":W<=2&&(ke="fakeround")),ke==="miter"&&W>c&&(ke="bevel"),ke==="bevel"&&(W>2&&(ke="flipbevel"),W<c&&(ke="miter")),k&&this.updateDistance(k,b),ke==="miter")Z._mult(W),this.addCurrentVertex(b,Z,0,0,w);else if(ke==="flipbevel"){if(W>100)Z=D.mult(-1);else{const ue=W*I.add(D).mag()/I.sub(D).mag();Z._perp()._mult(ue*(ae?-1:1))}this.addCurrentVertex(b,Z,0,0,w),this.addCurrentVertex(b,Z.mult(-1),0,0,w)}else if(ke==="bevel"||ke==="fakeround"){const ue=-Math.sqrt(W*W-1),ye=ae?ue:0,xe=ae?0:ue;if(k&&this.addCurrentVertex(b,I,ye,xe,w),ke==="fakeround"){const be=Math.round(180*X/Math.PI/20);for(let Ie=1;Ie<be;Ie++){let de=Ie/be;if(de!==.5){const Ne=de-.5;de+=de*Ne*(de-1)*((1.0904+j*(j*(3.55645-1.43519*j)-3.2452))*Ne*Ne+(.848013+j*(.215638*j-1.06021)))}const Le=D.sub(I)._mult(de)._add(I)._unit()._mult(ae?-1:1);this.addHalfVertex(b,Le.x,Le.y,!1,ae,0,w)}}S&&this.addCurrentVertex(b,D,-ye,-xe,w)}else if(ke==="butt")this.addCurrentVertex(b,Z,0,0,w);else if(ke==="square"){const ue=k?1:-1;k||this.addCurrentVertex(b,Z,ue,ue,w),this.addCurrentVertex(b,Z,0,0,w),k&&this.addCurrentVertex(b,Z,ue,ue,w)}else ke==="round"&&(k&&(this.addCurrentVertex(b,I,0,0,w),this.addCurrentVertex(b,I,1,1,w,!0)),S&&(this.addCurrentVertex(b,D,-1,-1,w,!0),this.addCurrentVertex(b,D,0,0,w)));if(ce&&U<f-1){const ue=b.dist(S);if(ue>2*x){const ye=b.add(S.sub(b)._mult(x/ue)._round());this.updateDistance(b,ye),this.addCurrentVertex(ye,D,0,0,w),b=ye}}}}addCurrentVertex(e,r,o,a,c,u=!1){const d=r.y*a-r.x,f=-r.y-r.x*a;this.addHalfVertex(e,r.x+r.y*o,r.y-r.x*o,u,!1,o,c),this.addHalfVertex(e,d,f,u,!0,-a,c)}addHalfVertex({x:e,y:r},o,a,c,u,d,f){this.layoutVertexArray.emplaceBack((e<<1)+(c?1:0),(r<<1)+(u?1:0),Math.round(63*o)+128,Math.round(63*a)+128,1+(d===0?0:d<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);const g=f.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,g),f.primitiveLength++),u?this.e2=g:this.e1=g}updateScaledDistance(){if(this.lineClips){const e=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=e*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(e,r){this.distance+=e.dist(r),this.updateScaledDistance()}}Ue(Th,"LineBucket",{omit:["layers","patternFeatures"]});const Mg=new V({"line-cap":new L(me.layout_line["line-cap"]),"line-join":new L(me.layout_line["line-join"]),"line-miter-limit":new A(me.layout_line["line-miter-limit"]),"line-round-limit":new A(me.layout_line["line-round-limit"]),"line-sort-key":new L(me.layout_line["line-sort-key"])});var Rd={paint:new V({"line-opacity":new L(me.paint_line["line-opacity"]),"line-color":new L(me.paint_line["line-color"]),"line-translate":new A(me.paint_line["line-translate"]),"line-translate-anchor":new A(me.paint_line["line-translate-anchor"]),"line-width":new L(me.paint_line["line-width"]),"line-gap-width":new L(me.paint_line["line-gap-width"]),"line-offset":new L(me.paint_line["line-offset"]),"line-blur":new L(me.paint_line["line-blur"]),"line-dasharray":new L(me.paint_line["line-dasharray"]),"line-pattern":new L(me.paint_line["line-pattern"]),"line-gradient":new N(me.paint_line["line-gradient"]),"line-trim-offset":new A(me.paint_line["line-trim-offset"])}),layout:Mg};const Bd=new class extends L{possiblyEvaluate(t,e){return e=new v(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,r,o){return e=sr({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,r,o)}}(Rd.paint.properties["line-width"].specification);function Fd(t,e){return e>0?e+2*t:t}Bd.useIntegerZoom=!0;const Ag=te([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Ig=te([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),Cg=te([{name:"a_projected_pos",components:4,type:"Float32"}],4);te([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const zg=te([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),Pg=te([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"}]);te([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Od=te([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Dg=te([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);te([{name:"triangle",components:3,type:"Uint16"}]),te([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Uint8",name:"flipState"}]),te([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),te([{type:"Float32",name:"offsetX"}]),te([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var Fr=24;const co=128;function Zu(t,e){const{expression:r}=e;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new v(t+1))};if(r.kind==="source")return{kind:"source"};{const{zoomStops:o,interpolationType:a}=r;let c=0;for(;c<o.length&&o[c]<=t;)c++;c=Math.max(0,c-1);let u=c;for(;u<o.length&&o[u]<t+1;)u++;u=Math.min(o.length-1,u);const d=o[c],f=o[u];return r.kind==="composite"?{kind:"composite",minZoom:d,maxZoom:f,interpolationType:a}:{kind:"camera",minZoom:d,maxZoom:f,minSize:r.evaluate(new v(d)),maxSize:r.evaluate(new v(f)),interpolationType:a}}}function Eh(t,{uSize:e,uSizeT:r},{lowerSize:o,upperSize:a}){return t.kind==="source"?o/co:t.kind==="composite"?bt(o/co,a/co,r):e}function ks(t,e){let r=0,o=0;if(t.kind==="constant")o=t.layoutSize;else if(t.kind!=="source"){const{interpolationType:a,minZoom:c,maxZoom:u}=t,d=a?it(Fi.interpolationFactor(a,e,c,u),0,1):0;t.kind==="camera"?o=bt(t.minSize,t.maxSize,d):r=d}return{uSizeT:r,uSize:o}}var Lg=Object.freeze({__proto__:null,SIZE_PACK_FACTOR:co,evaluateSizeForFeature:Eh,evaluateSizeForZoom:ks,getSizeData:Zu});function Rg(t,e,r){return t.sections.forEach(o=>{o.text=function(a,c,u){const d=c.layout.get("text-transform").evaluate(u,{});return d==="uppercase"?a=a.toLocaleUpperCase():d==="lowercase"&&(a=a.toLocaleLowerCase()),y.applyArabicShaping&&(a=y.applyArabicShaping(a)),a}(o.text,e,r)}),t}const Ql={"!":"︕","#":"＃",$:"＄","%":"％","&":"＆","(":"︵",")":"︶","*":"＊","+":"＋",",":"︐","-":"︲",".":"・","/":"／",":":"︓",";":"︔","<":"︿","=":"＝",">":"﹀","?":"︖","@":"＠","[":"﹇","\\":"＼","]":"﹈","^":"＾",_:"︳","`":"｀","{":"︷","|":"―","}":"︸","~":"～","¢":"￠","£":"￡","¥":"￥","¦":"￤","¬":"￢","¯":"￣","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"￦","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","！":"︕","（":"︵","）":"︶","，":"︐","－":"︲","．":"・","：":"︓","；":"︔","＜":"︿","＞":"﹀","？":"︖","［":"﹇","］":"﹈","＿":"︳","｛":"︷","｜":"―","｝":"︸","｟":"︵","｠":"︶","｡":"︒","｢":"﹁","｣":"﹂","←":"↑","→":"↓"};function Bg(t){return t==="︶"||t==="﹈"||t==="︸"||t==="﹄"||t==="﹂"||t==="︾"||t==="︼"||t==="︺"||t==="︘"||t==="﹀"||t==="︐"||t==="︓"||t==="︔"||t==="｀"||t==="￣"||t==="︑"||t==="︒"}function Fg(t){return t==="︵"||t==="﹇"||t==="︷"||t==="﹃"||t==="﹁"||t==="︽"||t==="︻"||t==="︹"||t==="︗"||t==="︿"}var Ud=Gt,jd=function(t,e,r,o,a){var c,u,d=8*a-o-1,f=(1<<d)-1,g=f>>1,x=-7,w=r?a-1:0,b=r?-1:1,k=t[e+w];for(w+=b,c=k&(1<<-x)-1,k>>=-x,x+=d;x>0;c=256*c+t[e+w],w+=b,x-=8);for(u=c&(1<<-x)-1,c>>=-x,x+=o;x>0;u=256*u+t[e+w],w+=b,x-=8);if(c===0)c=1-g;else{if(c===f)return u?NaN:1/0*(k?-1:1);u+=Math.pow(2,o),c-=g}return(k?-1:1)*u*Math.pow(2,c-o)},Nd=function(t,e,r,o,a,c){var u,d,f,g=8*c-a-1,x=(1<<g)-1,w=x>>1,b=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,k=o?0:c-1,S=o?1:-1,I=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(d=isNaN(e)?1:0,u=x):(u=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-u))<1&&(u--,f*=2),(e+=u+w>=1?b/f:b*Math.pow(2,1-w))*f>=2&&(u++,f/=2),u+w>=x?(d=0,u=x):u+w>=1?(d=(e*f-1)*Math.pow(2,a),u+=w):(d=e*Math.pow(2,w-1)*Math.pow(2,a),u=0));a>=8;t[r+k]=255&d,k+=S,d/=256,a-=8);for(u=u<<a|d,g+=a;g>0;t[r+k]=255&u,k+=S,u/=256,g-=8);t[r+k-S]|=128*I};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */function Gt(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Gt.Varint=0,Gt.Fixed64=1,Gt.Bytes=2,Gt.Fixed32=5;var Xu=4294967296,Vd=1/Xu,Gd=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Qo(t){return t.type===Gt.Bytes?t.readVarint()+t.pos:t.pos+1}function Ss(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function $d(t,e,r){var o=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(o);for(var a=r.pos-1;a>=t;a--)r.buf[a+o]=r.buf[a]}function Og(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function Ug(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function jg(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function Ng(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function Vg(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function Gg(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function $g(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function qg(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function Zg(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function kh(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Ms(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function qd(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Gt.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var o=this.readVarint(),a=o>>3,c=this.pos;this.type=7&o,t(a,e,this),this.pos===c&&this.skip(o)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=kh(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=qd(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=kh(this.buf,this.pos)+kh(this.buf,this.pos+4)*Xu;return this.pos+=8,t},readSFixed64:function(){var t=kh(this.buf,this.pos)+qd(this.buf,this.pos+4)*Xu;return this.pos+=8,t},readFloat:function(){var t=jd(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=jd(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,o=this.buf;return e=127&(r=o[this.pos++]),r<128?e:(e|=(127&(r=o[this.pos++]))<<7,r<128?e:(e|=(127&(r=o[this.pos++]))<<14,r<128?e:(e|=(127&(r=o[this.pos++]))<<21,r<128?e:function(a,c,u){var d,f,g=u.buf;if(d=(112&(f=g[u.pos++]))>>4,f<128||(d|=(127&(f=g[u.pos++]))<<3,f<128)||(d|=(127&(f=g[u.pos++]))<<10,f<128)||(d|=(127&(f=g[u.pos++]))<<17,f<128)||(d|=(127&(f=g[u.pos++]))<<24,f<128)||(d|=(1&(f=g[u.pos++]))<<31,f<128))return Ss(a,d,c);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=o[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Gd?function(r,o,a){return Gd.decode(r.subarray(o,a))}(this.buf,e,t):function(r,o,a){for(var c="",u=o;u<a;){var d,f,g,x=r[u],w=null,b=x>239?4:x>223?3:x>191?2:1;if(u+b>a)break;b===1?x<128&&(w=x):b===2?(192&(d=r[u+1]))==128&&(w=(31&x)<<6|63&d)<=127&&(w=null):b===3?(f=r[u+2],(192&(d=r[u+1]))==128&&(192&f)==128&&((w=(15&x)<<12|(63&d)<<6|63&f)<=2047||w>=55296&&w<=57343)&&(w=null)):b===4&&(f=r[u+2],g=r[u+3],(192&(d=r[u+1]))==128&&(192&f)==128&&(192&g)==128&&((w=(15&x)<<18|(63&d)<<12|(63&f)<<6|63&g)<=65535||w>=1114112)&&(w=null)),w===null?(w=65533,b=1):w>65535&&(w-=65536,c+=String.fromCharCode(w>>>10&1023|55296),w=56320|1023&w),c+=String.fromCharCode(w),u+=b}return c}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Gt.Bytes)return t.push(this.readVarint(e));var r=Qo(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Gt.Bytes)return t.push(this.readSVarint());var e=Qo(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Gt.Bytes)return t.push(this.readBoolean());var e=Qo(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Gt.Bytes)return t.push(this.readFloat());var e=Qo(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Gt.Bytes)return t.push(this.readDouble());var e=Qo(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Gt.Bytes)return t.push(this.readFixed32());var e=Qo(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Gt.Bytes)return t.push(this.readSFixed32());var e=Qo(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Gt.Bytes)return t.push(this.readFixed64());var e=Qo(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Gt.Bytes)return t.push(this.readSFixed64());var e=Qo(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Gt.Varint)for(;this.buf[this.pos++]>127;);else if(e===Gt.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Gt.Fixed32)this.pos+=4;else{if(e!==Gt.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Ms(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Ms(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Ms(this.buf,-1&t,this.pos),Ms(this.buf,Math.floor(t*Vd),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Ms(this.buf,-1&t,this.pos),Ms(this.buf,Math.floor(t*Vd),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(e,r){var o,a;if(e>=0?(o=e%4294967296|0,a=e/4294967296|0):(a=~(-e/4294967296),4294967295^(o=~(-e%4294967296))?o=o+1|0:(o=0,a=a+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),function(c,u,d){d.buf[d.pos++]=127&c|128,c>>>=7,d.buf[d.pos++]=127&c|128,c>>>=7,d.buf[d.pos++]=127&c|128,c>>>=7,d.buf[d.pos++]=127&c|128,d.buf[d.pos]=127&(c>>>=7)}(o,0,r),function(c,u){var d=(7&c)<<4;u.buf[u.pos++]|=d|((c>>>=3)?128:0),c&&(u.buf[u.pos++]=127&c|((c>>>=7)?128:0),c&&(u.buf[u.pos++]=127&c|((c>>>=7)?128:0),c&&(u.buf[u.pos++]=127&c|((c>>>=7)?128:0),c&&(u.buf[u.pos++]=127&c|((c>>>=7)?128:0),c&&(u.buf[u.pos++]=127&c)))))}(a,r)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(!!t)},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(o,a,c){for(var u,d,f=0;f<a.length;f++){if((u=a.charCodeAt(f))>55295&&u<57344){if(!d){u>56319||f+1===a.length?(o[c++]=239,o[c++]=191,o[c++]=189):d=u;continue}if(u<56320){o[c++]=239,o[c++]=191,o[c++]=189,d=u;continue}u=d-55296<<10|u-56320|65536,d=null}else d&&(o[c++]=239,o[c++]=191,o[c++]=189,d=null);u<128?o[c++]=u:(u<2048?o[c++]=u>>6|192:(u<65536?o[c++]=u>>12|224:(o[c++]=u>>18|240,o[c++]=u>>12&63|128),o[c++]=u>>6&63|128),o[c++]=63&u|128)}return c}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&$d(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Nd(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Nd(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var o=this.pos-r;o>=128&&$d(r,o,this),this.pos=r-1,this.writeVarint(o),this.pos+=o},writeMessage:function(t,e,r){this.writeTag(t,Gt.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Og,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Ug,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Vg,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,jg,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Ng,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Gg,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,$g,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,qg,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Zg,e)},writeBytesField:function(t,e){this.writeTag(t,Gt.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Gt.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Gt.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Gt.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Gt.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Gt.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Gt.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Gt.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Gt.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Gt.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,!!e)}};var Sh=ai(Ud);const Wu=3;function Xg(t,e,r){e.glyphs=[],t===1&&r.readMessage(Wg,e)}function Wg(t,e,r){if(t===3){const{id:o,bitmap:a,width:c,height:u,left:d,top:f,advance:g}=r.readMessage(Yg,{});e.glyphs.push({id:o,bitmap:new Jo({width:c+2*Wu,height:u+2*Wu},a),metrics:{width:c,height:u,left:d,top:f,advance:g}})}else t===4?e.ascender=r.readSVarint():t===5&&(e.descender=r.readSVarint())}function Yg(t,e,r){t===1?e.id=r.readVarint():t===2?e.bitmap=r.readBytes():t===3?e.width=r.readVarint():t===4?e.height=r.readVarint():t===5?e.left=r.readSVarint():t===6?e.top=r.readSVarint():t===7&&(e.advance=r.readVarint())}const Zd=Wu;function Yu(t){let e=0,r=0;for(const u of t)e+=u.w*u.h,r=Math.max(r,u.w);t.sort((u,d)=>d.h-u.h);const o=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}];let a=0,c=0;for(const u of t)for(let d=o.length-1;d>=0;d--){const f=o[d];if(!(u.w>f.w||u.h>f.h)){if(u.x=f.x,u.y=f.y,c=Math.max(c,u.y+u.h),a=Math.max(a,u.x+u.w),u.w===f.w&&u.h===f.h){const g=o.pop();d<o.length&&(o[d]=g)}else u.h===f.h?(f.x+=u.w,f.w-=u.w):u.w===f.w?(f.y+=u.h,f.h-=u.h):(o.push({x:f.x+u.w,y:f.y,w:f.w-u.w,h:u.h}),f.y+=u.h,f.h-=u.h);break}}return{w:a,h:c,fill:e/(a*c)||0}}const ui=1;class Hu{constructor(e,{pixelRatio:r,version:o,stretchX:a,stretchY:c,content:u}){this.paddedRect=e,this.pixelRatio=r,this.stretchX=a,this.stretchY=c,this.content=u,this.version=o}get tl(){return[this.paddedRect.x+ui,this.paddedRect.y+ui]}get br(){return[this.paddedRect.x+this.paddedRect.w-ui,this.paddedRect.y+this.paddedRect.h-ui]}get displaySize(){return[(this.paddedRect.w-2*ui)/this.pixelRatio,(this.paddedRect.h-2*ui)/this.pixelRatio]}}class Xd{constructor(e,r){const o={},a={};this.haveRenderCallbacks=[];const c=[];this.addImages(e,o,c),this.addImages(r,a,c);const{w:u,h:d}=Yu(c),f=new wi({width:u||1,height:d||1});for(const g in e){const x=e[g],w=o[g].paddedRect;wi.copy(x.data,f,{x:0,y:0},{x:w.x+ui,y:w.y+ui},x.data)}for(const g in r){const x=r[g],w=a[g].paddedRect,b=w.x+ui,k=w.y+ui,S=x.data.width,I=x.data.height;wi.copy(x.data,f,{x:0,y:0},{x:b,y:k},x.data),wi.copy(x.data,f,{x:0,y:I-1},{x:b,y:k-1},{width:S,height:1}),wi.copy(x.data,f,{x:0,y:0},{x:b,y:k+I},{width:S,height:1}),wi.copy(x.data,f,{x:S-1,y:0},{x:b-1,y:k},{width:1,height:I}),wi.copy(x.data,f,{x:0,y:0},{x:b+S,y:k},{width:1,height:I})}this.image=f,this.iconPositions=o,this.patternPositions=a}addImages(e,r,o){for(const a in e){const c=e[a],u={x:0,y:0,w:c.data.width+2*ui,h:c.data.height+2*ui};o.push(u),r[a]=new Hu(u,c),c.hasRenderCallback&&this.haveRenderCallbacks.push(a)}}patchUpdatedImages(e,r){this.haveRenderCallbacks=this.haveRenderCallbacks.filter(o=>e.hasImage(o)),e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const o in e.updatedImages)this.patchUpdatedImage(this.iconPositions[o],e.getImage(o),r),this.patchUpdatedImage(this.patternPositions[o],e.getImage(o),r)}patchUpdatedImage(e,r,o){if(!e||!r||e.version===r.version)return;e.version=r.version;const[a,c]=e.tl;o.update(r.data,void 0,{x:a,y:c})}}Ue(Hu,"ImagePosition"),Ue(Xd,"ImageAtlas");const zi={horizontal:1,vertical:2,horizontalOnly:3},Wd=-17;class ec{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,r){const o=new ec;return o.scale=e||1,o.fontStack=r,o}static forImage(e){const r=new ec;return r.imageName=e,r}}class As{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,r){const o=new As;for(let a=0;a<e.sections.length;a++){const c=e.sections[a];c.image?o.addImageSection(c):o.addTextSection(c,r)}return o}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSections(){return this.sections}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(e){this.text=function(r,o){let a="";for(let c=0;c<r.length;c++){const u=r.charCodeAt(c+1)||null,d=r.charCodeAt(c-1)||null;a+=!o&&(u&&th(u)&&!Ql[r[c+1]]||d&&th(d)&&!Ql[r[c-1]])||!Ql[r[c]]?r[c]:Ql[r[c]]}return a}(this.text,e)}trim(){let e=0;for(let o=0;o<this.text.length&&Mh[this.text.charCodeAt(o)];o++)e++;let r=this.text.length;for(let o=this.text.length-1;o>=0&&o>=e&&Mh[this.text.charCodeAt(o)];o--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)}substring(e,r){const o=new As;return o.text=this.text.substring(e,r),o.sectionIndex=this.sectionIndex.slice(e,r),o.sections=this.sections,o}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}addTextSection(e,r){this.text+=e.text,this.sections.push(ec.forText(e.scale,e.fontStack||r));const o=this.sections.length-1;for(let a=0;a<e.text.length;++a)this.sectionIndex.push(o)}addImageSection(e){const r=e.image?e.image.name:"";if(r.length===0)return void ir("Can't add FormattedSection with an empty image.");const o=this.getNextImageSectionCharCode();o?(this.text+=String.fromCharCode(o),this.sections.push(ec.forImage(r)),this.sectionIndex.push(this.sections.length-1)):ir("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Ku(t,e,r,o,a,c,u,d,f,g,x,w,b,k,S){const I=As.fromFeature(t,a);w===zi.vertical&&I.verticalizePunctuation(b);let D=[];const U=function(X,ce,ae,fe,ke,ue){if(!X)return[];const ye=[],xe=function(Le,Ne,Re,et,Ce,Ze){let tt=0;for(let Et=0;Et<Le.length();Et++){const rt=Le.getSection(Et);tt+=Yd(Le.getCharCode(Et),rt,et,Ce,Ne,Ze)}return tt/Math.max(1,Math.ceil(tt/Re))}(X,ce,ae,fe,ke,ue),be=X.text.indexOf("​")>=0;let Ie=0;for(let Le=0;Le<X.length();Le++){const Ne=X.getSection(Le),Re=X.getCharCode(Le);if(Mh[Re]||(Ie+=Yd(Re,Ne,fe,ke,ce,ue)),Le<X.length()-1){const et=!((de=Re)<11904||!(Be["Bopomofo Extended"](de)||Be.Bopomofo(de)||Be["CJK Compatibility Forms"](de)||Be["CJK Compatibility Ideographs"](de)||Be["CJK Compatibility"](de)||Be["CJK Radicals Supplement"](de)||Be["CJK Strokes"](de)||Be["CJK Symbols and Punctuation"](de)||Be["CJK Unified Ideographs Extension A"](de)||Be["CJK Unified Ideographs"](de)||Be["Enclosed CJK Letters and Months"](de)||Be["Halfwidth and Fullwidth Forms"](de)||Be.Hiragana(de)||Be["Ideographic Description Characters"](de)||Be["Kangxi Radicals"](de)||Be["Katakana Phonetic Extensions"](de)||Be.Katakana(de)||Be["Vertical Forms"](de)||Be["Yi Radicals"](de)||Be["Yi Syllables"](de)));(Hg[Re]||et||Ne.imageName)&&ye.push(Kd(Le+1,Ie,xe,ye,Kg(Re,X.getCharCode(Le+1),et&&be),!1))}}var de;return Jd(Kd(X.length(),Ie,xe,ye,0,!0))}(I,g,c,e,o,k),{processBidirectionalText:Z,processStyledBidirectionalText:j}=y;if(Z&&I.sections.length===1){const X=Z(I.toString(),U);for(const ce of X){const ae=new As;ae.text=ce,ae.sections=I.sections;for(let fe=0;fe<ce.length;fe++)ae.sectionIndex.push(0);D.push(ae)}}else if(j){const X=j(I.text,I.sectionIndex,U);for(const ce of X){const ae=new As;ae.text=ce[0],ae.sectionIndex=ce[1],ae.sections=I.sections,D.push(ae)}}else D=function(X,ce){const ae=[],fe=X.text;let ke=0;for(const ue of ce)ae.push(X.substring(ke,ue)),ke=ue;return ke<fe.length&&ae.push(X.substring(ke,fe.length)),ae}(I,U);const $=[],W={positionedLines:$,text:I.toString(),top:x[1],bottom:x[1],left:x[0],right:x[0],writingMode:w,iconsInText:!1,verticalizable:!1,hasBaseline:!1};return function(X,ce,ae,fe,ke,ue,ye,xe,be,Ie,de,Le){let Ne=0,Re=0,et=0;const Ce=xe==="right"?1:xe==="left"?0:.5;let Ze=!1;for(const at of ke){const st=at.getSections();for(const Ut of st){if(Ut.imageName)continue;const $t=ce[Ut.fontStack];if($t&&(Ze=$t.ascender!==void 0&&$t.descender!==void 0,!Ze))break}if(!Ze)break}let tt=0;for(const at of ke){at.trim();const st=at.getMaxScale(),Ut=(st-1)*Fr,$t={positionedGlyphs:[],lineOffset:0};X.positionedLines[tt]=$t;const qt=$t.positionedGlyphs;let jt=0;if(!at.length()){Re+=ue,++tt;continue}let nr=0,cr=0;for(let Nt=0;Nt<at.length();Nt++){const Er=at.getSection(Nt),xr=at.getSectionIndex(Nt),ar=at.getCharCode(Nt);let St=Er.scale,vr=null,Zt=null,oi=null,wr=Fr,Or=0;const zr=!(be===zi.horizontal||!de&&!Ml(ar)||de&&(Mh[ar]||(Et=ar,Be.Arabic(Et)||Be["Arabic Supplement"](Et)||Be["Arabic Extended-A"](Et)||Be["Arabic Presentation Forms-A"](Et)||Be["Arabic Presentation Forms-B"](Et))));if(Er.imageName){const ni=fe[Er.imageName];if(!ni)continue;oi=Er.imageName,X.iconsInText=X.iconsInText||!0,Zt=ni.paddedRect;const Pr=ni.displaySize;St=St*Fr/Le,vr={width:Pr[0],height:Pr[1],left:ui,top:-Zd,advance:zr?Pr[1]:Pr[0],localGlyph:!1},Or=Ze?-vr.height*St:Wd+st*Fr-Pr[1]*St,wr=vr.advance;const po=(zr?Pr[0]:Pr[1])*St-Fr*st;po>0&&po>jt&&(jt=po)}else{const ni=ae[Er.fontStack];if(!ni)continue;ni[ar]&&(Zt=ni[ar]);const Pr=ce[Er.fontStack];if(!Pr)continue;const po=Pr.glyphs[ar];if(!po)continue;if(vr=po.metrics,wr=ar!==8203?Fr:0,Ze){const Rs=Pr.ascender!==void 0?Math.abs(Pr.ascender):0,hc=Pr.descender!==void 0?Math.abs(Pr.descender):0,uc=(Rs+hc)*St;nr<uc&&(nr=uc,cr=(Rs-hc)/2*St),Or=-Rs*St}else Or=Wd+(st-St)*Fr}zr?(X.verticalizable=!0,qt.push({glyph:ar,imageName:oi,x:Ne,y:Re+Or,vertical:zr,scale:St,localGlyph:vr.localGlyph,fontStack:Er.fontStack,sectionIndex:xr,metrics:vr,rect:Zt}),Ne+=wr*St+Ie):(qt.push({glyph:ar,imageName:oi,x:Ne,y:Re+Or,vertical:zr,scale:St,localGlyph:vr.localGlyph,fontStack:Er.fontStack,sectionIndex:xr,metrics:vr,rect:Zt}),Ne+=vr.advance*St+Ie)}qt.length!==0&&(et=Math.max(Ne-Ie,et),Ze?Qd(qt,Ce,jt,cr,ue*st/2):Qd(qt,Ce,jt,0,ue/2)),Ne=0;const yr=ue*st+jt;$t.lineOffset=Math.max(jt,Ut),Re+=yr,++tt}var Et;const rt=Re,{horizontalAlign:Ye,verticalAlign:Wt}=Ju(ye);(function(at,st,Ut,$t,qt,jt){const nr=(st-Ut)*qt,cr=-jt*$t;for(const yr of at)for(const Nt of yr.positionedGlyphs)Nt.x+=nr,Nt.y+=cr})(X.positionedLines,Ce,Ye,Wt,et,rt),X.top+=-Wt*rt,X.bottom=X.top+rt,X.left+=-Ye*et,X.right=X.left+et,X.hasBaseline=Ze}(W,e,r,o,D,u,d,f,w,g,b,S),!function(X){for(const ce of X)if(ce.positionedGlyphs.length!==0)return!1;return!0}($)&&W}const Mh={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Hg={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function Yd(t,e,r,o,a,c){if(e.imageName){const u=o[e.imageName];return u?u.displaySize[0]*e.scale*Fr/c+a:0}{const u=r[e.fontStack],d=u&&u.glyphs[t];return d?d.metrics.advance*e.scale+a:0}}function Hd(t,e,r,o){const a=Math.pow(t-e,2);return o?t<e?a/2:2*a:a+Math.abs(r)*r}function Kg(t,e,r){let o=0;return t===10&&(o-=1e4),r&&(o+=150),t!==40&&t!==65288||(o+=50),e!==41&&e!==65289||(o+=50),o}function Kd(t,e,r,o,a,c){let u=null,d=Hd(e,r,a,c);for(const f of o){const g=Hd(e-f.x,r,a,c)+f.badness;g<=d&&(u=f,d=g)}return{index:t,x:e,priorBreak:u,badness:d}}function Jd(t){return t?Jd(t.priorBreak).concat(t.index):[]}function Ju(t){let e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function Qd(t,e,r,o,a){if(!(e||r||o||a))return;const c=t.length-1,u=t[c],d=(u.x+u.metrics.advance*u.scale)*e;for(let f=0;f<=c;f++)t[f].x-=d,t[f].y+=r+o+a}function Jg(t,e,r){const{horizontalAlign:o,verticalAlign:a}=Ju(r),c=e[0]-t.displaySize[0]*o,u=e[1]-t.displaySize[1]*a;return{image:t,top:u,bottom:u+t.displaySize[1],left:c,right:c+t.displaySize[0]}}function em(t,e,r,o,a,c){const u=t.image;let d;if(u.content){const D=u.content,U=u.pixelRatio||1;d=[D[0]/U,D[1]/U,u.displaySize[0]-D[2]/U,u.displaySize[1]-D[3]/U]}const f=e.left*c,g=e.right*c;let x,w,b,k;r==="width"||r==="both"?(k=a[0]+f-o[3],w=a[0]+g+o[1]):(k=a[0]+(f+g-u.displaySize[0])/2,w=k+u.displaySize[0]);const S=e.top*c,I=e.bottom*c;return r==="height"||r==="both"?(x=a[1]+S-o[0],b=a[1]+I+o[2]):(x=a[1]+(S+I-u.displaySize[1])/2,b=x+u.displaySize[1]),{image:u,top:x,right:w,bottom:b,left:k,collisionPadding:d}}class en extends De{constructor(e,r,o,a,c){super(e,r),this.angle=a,this.z=o,c!==void 0&&(this.segment=c)}clone(){return new en(this.x,this.y,this.z,this.angle,this.segment)}}function tm(t,e,r,o,a){if(e.segment===void 0)return!0;let c=e,u=e.segment+1,d=0;for(;d>-r/2;){if(u--,u<0)return!1;d-=t[u].dist(c),c=t[u]}d+=t[u].dist(t[u+1]),u++;const f=[];let g=0;for(;d<r/2;){const x=t[u],w=t[u+1];if(!w)return!1;let b=t[u-1].angleTo(x)-x.angleTo(w);for(b=Math.abs((b+3*Math.PI)%(2*Math.PI)-Math.PI),f.push({distance:d,angleDelta:b}),g+=b;d-f[0].distance>o;)g-=f.shift().angleDelta;if(g>a)return!1;u++,d+=x.dist(w)}return!0}function rm(t){let e=0;for(let r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function im(t,e,r){return t?.6*e*r:0}function om(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Qg(t,e,r,o,a,c){const u=im(r,a,c),d=om(r,o)*c;let f=0;const g=rm(t)/2;for(let x=0;x<t.length-1;x++){const w=t[x],b=t[x+1],k=w.dist(b);if(f+k>g){const S=(g-f)/k,I=bt(w.x,b.x,S),D=bt(w.y,b.y,S),U=new en(I,D,0,b.angleTo(w),x);return!u||tm(t,U,d,u,e)?U:void 0}f+=k}}function e_(t,e,r,o,a,c,u,d,f){const g=im(o,c,u),x=om(o,a),w=x*u,b=t[0].x===0||t[0].x===f||t[0].y===0||t[0].y===f;return e-w<e/4&&(e=w+e/4),nm(t,b?e/2*d%e:(x/2+2*c)*u*d%e,e,g,r,w,b,!1,f)}function nm(t,e,r,o,a,c,u,d,f){const g=c/2,x=rm(t);let w=0,b=e-r,k=[];for(let S=0;S<t.length-1;S++){const I=t[S],D=t[S+1],U=I.dist(D),Z=D.angleTo(I);for(;b+r<w+U;){b+=r;const j=(b-w)/U,$=bt(I.x,D.x,j),W=bt(I.y,D.y,j);if($>=0&&$<f&&W>=0&&W<f&&b-g>=0&&b+g<=x){const X=new en($,W,0,Z,S);X._round(),o&&!tm(t,X,c,o,a)||k.push(X)}}w+=U}return d||k.length||u||(k=nm(t,w/2,r,o,a,c,u,!0,f)),k}function am(t,e,r,o,a){const c=[];for(let u=0;u<t.length;u++){const d=t[u];let f;for(let g=0;g<d.length-1;g++){let x=d[g],w=d[g+1];x.x<e&&w.x<e||(x.x<e?x=new De(e,x.y+(e-x.x)/(w.x-x.x)*(w.y-x.y))._round():w.x<e&&(w=new De(e,x.y+(e-x.x)/(w.x-x.x)*(w.y-x.y))._round()),x.y<r&&w.y<r||(x.y<r?x=new De(x.x+(r-x.y)/(w.y-x.y)*(w.x-x.x),r)._round():w.y<r&&(w=new De(x.x+(r-x.y)/(w.y-x.y)*(w.x-x.x),r)._round()),x.x>=o&&w.x>=o||(x.x>=o?x=new De(o,x.y+(o-x.x)/(w.x-x.x)*(w.y-x.y))._round():w.x>=o&&(w=new De(o,x.y+(o-x.x)/(w.x-x.x)*(w.y-x.y))._round()),x.y>=a&&w.y>=a||(x.y>=a?x=new De(x.x+(a-x.y)/(w.y-x.y)*(w.x-x.x),a)._round():w.y>=a&&(w=new De(x.x+(a-x.y)/(w.y-x.y)*(w.x-x.x),a)._round()),f&&x.equals(f[f.length-1])||(f=[x],c.push(f)),f.push(w)))))}}return c}Ue(en,"Anchor");const tc=1e20;function sm(t,e,r,o,a,c,u,d,f){for(let g=e;g<e+o;g++)lm(t,r*c+g,c,a,u,d,f);for(let g=r;g<r+a;g++)lm(t,g*c+e,1,o,u,d,f)}function lm(t,e,r,o,a,c,u){c[0]=0,u[0]=-tc,u[1]=tc,a[0]=t[e];for(let d=1,f=0,g=0;d<o;d++){a[d]=t[e+d*r];const x=d*d;do{const w=c[f];g=(a[d]-a[w]+x-w*w)/(d-w)/2}while(g<=u[f]&&--f>-1);f++,c[f]=d,u[f]=g,u[f+1]=tc}for(let d=0,f=0;d<o;d++){for(;u[f+1]<d;)f++;const g=c[f],x=d-g;t[e+d*r]=a[g]+x*x}}const ho=2,Qu={none:0,ideographs:1,all:2};class Is{constructor(e,r,o){this.requestManager=e,this.localGlyphMode=r,this.localFontFamily=o,this.entries={},this.localGlyphs={200:{},400:{},500:{},900:{}}}setURL(e){this.url=e}getGlyphs(e,r){const o=[];for(const a in e)for(const c of e[a])o.push({stack:a,id:c});rr(o,({stack:a,id:c},u)=>{let d=this.entries[a];d||(d=this.entries[a]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let f=d.glyphs[c];if(f!==void 0)return void u(null,{stack:a,id:c,glyph:f});if(f=this._tinySDF(d,a,c),f)return d.glyphs[c]=f,void u(null,{stack:a,id:c,glyph:f});const g=Math.floor(c/256);if(256*g>65535)return void u(new Error("glyphs > 65535 not supported"));if(d.ranges[g])return void u(null,{stack:a,id:c,glyph:f});let x=d.requests[g];x||(x=d.requests[g]=[],Is.loadGlyphRange(a,g,this.url,this.requestManager,(w,b)=>{if(b){d.ascender=b.ascender,d.descender=b.descender;for(const k in b.glyphs)this._doesCharSupportLocalGlyph(+k)||(d.glyphs[+k]=b.glyphs[+k]);d.ranges[g]=!0}for(const k of x)k(w,b);delete d.requests[g]})),x.push((w,b)=>{w?u(w):b&&u(null,{stack:a,id:c,glyph:b.glyphs[c]||null})})},(a,c)=>{if(a)r(a);else if(c){const u={};for(const{stack:d,id:f,glyph:g}of c)u[d]===void 0&&(u[d]={}),u[d].glyphs===void 0&&(u[d].glyphs={}),u[d].glyphs[f]=g&&{id:g.id,bitmap:g.bitmap.clone(),metrics:g.metrics},u[d].ascender=this.entries[d].ascender,u[d].descender=this.entries[d].descender;r(null,u)}})}_doesCharSupportLocalGlyph(e){return this.localGlyphMode!==Qu.none&&(this.localGlyphMode===Qu.all?!!this.localFontFamily:!!this.localFontFamily&&(Be["CJK Unified Ideographs"](e)||Be["Hangul Syllables"](e)||Be.Hiragana(e)||Be.Katakana(e)||Be["CJK Symbols and Punctuation"](e)))}_tinySDF(e,r,o){const a=this.localFontFamily;if(!a||!this._doesCharSupportLocalGlyph(o))return;let c=e.tinySDF;if(!c){let I="400";/bold/i.test(r)?I="900":/medium/i.test(r)?I="500":/light/i.test(r)&&(I="200"),c=e.tinySDF=new Is.TinySDF({fontFamily:a,fontWeight:I,fontSize:24*ho,buffer:3*ho,radius:8*ho}),c.fontWeight=I}if(this.localGlyphs[c.fontWeight][o])return this.localGlyphs[c.fontWeight][o];const u=String.fromCharCode(o),{data:d,width:f,height:g,glyphWidth:x,glyphHeight:w,glyphLeft:b,glyphTop:k,glyphAdvance:S}=c.draw(u);return this.localGlyphs[c.fontWeight][o]={id:o,bitmap:new Jo({width:f,height:g},d),metrics:{width:x/ho,height:w/ho,left:b/ho,top:k/ho-27,advance:S/ho,localGlyph:!0}}}}Is.loadGlyphRange=function(t,e,r,o,a){const c=256*e,u=c+255,d=o.transformRequest(o.normalizeGlyphsURL(r).replace("{fontstack}",t).replace("{range}",`${c}-${u}`),Lo.Glyphs);ln(d,(f,g)=>{if(f)a(f);else if(g){const x={},w=function(b){return new Sh(b).readFields(Xg,{})}(g);for(const b of w.glyphs)x[b.id]=b;a(null,{glyphs:x,ascender:w.ascender,descender:w.descender})}})},Is.TinySDF=class{constructor({fontSize:t=24,buffer:e=3,radius:r=8,cutoff:o=.25,fontFamily:a="sans-serif",fontWeight:c="normal",fontStyle:u="normal"}={}){this.buffer=e,this.cutoff=o,this.radius=r;const d=this.size=t+4*e,f=this._createCanvas(d),g=this.ctx=f.getContext("2d",{willReadFrequently:!0});g.font=`${u} ${c} ${t}px ${a}`,g.textBaseline="alphabetic",g.textAlign="left",g.fillStyle="black",this.gridOuter=new Float64Array(d*d),this.gridInner=new Float64Array(d*d),this.f=new Float64Array(d),this.z=new Float64Array(d+1),this.v=new Uint16Array(d)}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){const{width:e,actualBoundingBoxAscent:r,actualBoundingBoxDescent:o,actualBoundingBoxLeft:a,actualBoundingBoxRight:c}=this.ctx.measureText(t),u=Math.ceil(r),d=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(c-a))),f=Math.min(this.size-this.buffer,u+Math.ceil(o)),g=d+2*this.buffer,x=f+2*this.buffer,w=Math.max(g*x,0),b=new Uint8ClampedArray(w),k={data:b,width:g,height:x,glyphWidth:d,glyphHeight:f,glyphTop:u,glyphLeft:0,glyphAdvance:e};if(d===0||f===0)return k;const{ctx:S,buffer:I,gridInner:D,gridOuter:U}=this;S.clearRect(I,I,d,f),S.fillText(t,I,I+u);const Z=S.getImageData(I,I,d,f);U.fill(tc,0,w),D.fill(0,0,w);for(let j=0;j<f;j++)for(let $=0;$<d;$++){const W=Z.data[4*(j*d+$)+3]/255;if(W===0)continue;const X=(j+I)*g+$+I;if(W===1)U[X]=0,D[X]=tc;else{const ce=.5-W;U[X]=ce>0?ce*ce:0,D[X]=ce<0?ce*ce:0}}sm(U,0,0,g,x,g,this.f,this.v,this.z),sm(D,I,I,d,f,g,this.f,this.v,this.z);for(let j=0;j<w;j++){const $=Math.sqrt(U[j])-Math.sqrt(D[j]);b[j]=Math.round(255-255*($/this.radius+this.cutoff))}return k}};const Cs=ui;function cm(t,e,r,o){const a=[],c=t.image,u=c.pixelRatio,d=c.paddedRect.w-2*Cs,f=c.paddedRect.h-2*Cs,g=t.right-t.left,x=t.bottom-t.top,w=c.stretchX||[[0,d]],b=c.stretchY||[[0,f]],k=(ue,ye)=>ue+ye[1]-ye[0],S=w.reduce(k,0),I=b.reduce(k,0),D=d-S,U=f-I;let Z=0,j=S,$=0,W=I,X=0,ce=D,ae=0,fe=U;if(c.content&&o){const ue=c.content;Z=Ah(w,0,ue[0]),$=Ah(b,0,ue[1]),j=Ah(w,ue[0],ue[2]),W=Ah(b,ue[1],ue[3]),X=ue[0]-Z,ae=ue[1]-$,ce=ue[2]-ue[0]-j,fe=ue[3]-ue[1]-W}const ke=(ue,ye,xe,be)=>{const Ie=Ih(ue.stretch-Z,j,g,t.left),de=Ch(ue.fixed-X,ce,ue.stretch,S),Le=Ih(ye.stretch-$,W,x,t.top),Ne=Ch(ye.fixed-ae,fe,ye.stretch,I),Re=Ih(xe.stretch-Z,j,g,t.left),et=Ch(xe.fixed-X,ce,xe.stretch,S),Ce=Ih(be.stretch-$,W,x,t.top),Ze=Ch(be.fixed-ae,fe,be.stretch,I),tt=new De(Ie,Le),Et=new De(Re,Le),rt=new De(Re,Ce),Ye=new De(Ie,Ce),Wt=new De(de/u,Ne/u),at=new De(et/u,Ze/u),st=e*Math.PI/180;if(st){const qt=Math.sin(st),jt=Math.cos(st),nr=[jt,-qt,qt,jt];tt._matMult(nr),Et._matMult(nr),Ye._matMult(nr),rt._matMult(nr)}const Ut=ue.stretch+ue.fixed,$t=ye.stretch+ye.fixed;return{tl:tt,tr:Et,bl:Ye,br:rt,tex:{x:c.paddedRect.x+Cs+Ut,y:c.paddedRect.y+Cs+$t,w:xe.stretch+xe.fixed-Ut,h:be.stretch+be.fixed-$t},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Wt,pixelOffsetBR:at,minFontScaleX:ce/u/g,minFontScaleY:fe/u/x,isSDF:r}};if(o&&(c.stretchX||c.stretchY)){const ue=hm(w,D,S),ye=hm(b,U,I);for(let xe=0;xe<ue.length-1;xe++){const be=ue[xe],Ie=ue[xe+1];for(let de=0;de<ye.length-1;de++)a.push(ke(be,ye[de],Ie,ye[de+1]))}}else a.push(ke({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:d+1},{fixed:0,stretch:f+1}));return a}function Ah(t,e,r){let o=0;for(const a of t)o+=Math.max(e,Math.min(r,a[1]))-Math.max(e,Math.min(r,a[0]));return o}function hm(t,e,r){const o=[{fixed:-Cs,stretch:0}];for(const[a,c]of t){const u=o[o.length-1];o.push({fixed:a-u.stretch,stretch:u.stretch}),o.push({fixed:a-u.stretch,stretch:u.stretch+(c-a)})}return o.push({fixed:e+Cs,stretch:r}),o}function Ih(t,e,r,o){return t/e*r+o}function Ch(t,e,r,o){return t-e*r/o}function t_(t,e,r,o){const a=e+t.positionedLines[o].lineOffset;return o===0?r+a/2:r+(a+(e+t.positionedLines[o-1].lineOffset))/2}class r_{constructor(e=[],r=i_){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let o=(this.length>>1)-1;o>=0;o--)this._down(o)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],r=this.data.pop();return this.length--,this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:r,compare:o}=this,a=r[e];for(;e>0;){const c=e-1>>1,u=r[c];if(o(a,u)>=0)break;r[e]=u,e=c}r[e]=a}_down(e){const{data:r,compare:o}=this,a=this.length>>1,c=r[e];for(;e<a;){let u=1+(e<<1),d=r[u];const f=u+1;if(f<this.length&&o(r[f],d)<0&&(u=f,d=r[f]),o(d,c)>=0)break;r[e]=d,e=u}r[e]=c}}function i_(t,e){return t<e?-1:t>e?1:0}function o_(t,e=1,r=!1){let o=1/0,a=1/0,c=-1/0,u=-1/0;const d=t[0];for(let k=0;k<d.length;k++){const S=d[k];(!k||S.x<o)&&(o=S.x),(!k||S.y<a)&&(a=S.y),(!k||S.x>c)&&(c=S.x),(!k||S.y>u)&&(u=S.y)}const f=Math.min(c-o,u-a);let g=f/2;const x=new r_([],n_);if(f===0)return new De(o,a);for(let k=o;k<c;k+=f)for(let S=a;S<u;S+=f)x.push(new zs(k+g,S+g,g,t));let w=function(k){let S=0,I=0,D=0;const U=k[0];for(let Z=0,j=U.length,$=j-1;Z<j;$=Z++){const W=U[Z],X=U[$],ce=W.x*X.y-X.x*W.y;I+=(W.x+X.x)*ce,D+=(W.y+X.y)*ce,S+=3*ce}return new zs(I/S,D/S,0,k)}(t),b=x.length;for(;x.length;){const k=x.pop();(k.d>w.d||!w.d)&&(w=k,r&&console.log("found best %d after %d probes",Math.round(1e4*k.d)/1e4,b)),k.max-w.d<=e||(g=k.h/2,x.push(new zs(k.p.x-g,k.p.y-g,g,t)),x.push(new zs(k.p.x+g,k.p.y-g,g,t)),x.push(new zs(k.p.x-g,k.p.y+g,g,t)),x.push(new zs(k.p.x+g,k.p.y+g,g,t)),b+=4)}return r&&(console.log(`num probes: ${b}`),console.log(`best distance: ${w.d}`)),w.p}function n_(t,e){return e.max-t.max}class zs{constructor(e,r,o,a){this.p=new De(e,r),this.h=o,this.d=function(c,u){let d=!1,f=1/0;for(let g=0;g<u.length;g++){const x=u[g];for(let w=0,b=x.length,k=b-1;w<b;k=w++){const S=x[w],I=x[k];S.y>c.y!=I.y>c.y&&c.x<(I.x-S.x)*(c.y-S.y)/(I.y-S.y)+S.x&&(d=!d),f=Math.min(f,nd(c,S,I))}}return(d?1:-1)*Math.sqrt(f)}(this.p,a),this.max=this.d+this.h*Math.SQRT2}}const Ps=7,ep=Number.POSITIVE_INFINITY,a_=Math.sqrt(2);function um(t,[e,r]){let o=0,a=0;if(r===ep){e<0&&(e=0);const c=e/a_;switch(t){case"top-right":case"top-left":a=c-Ps;break;case"bottom-right":case"bottom-left":a=-c+Ps;break;case"bottom":a=-e+Ps;break;case"top":a=e-Ps}switch(t){case"top-right":case"bottom-right":o=-c;break;case"top-left":case"bottom-left":o=c;break;case"left":o=e;break;case"right":o=-e}}else{switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":a=r-Ps;break;case"bottom-right":case"bottom-left":case"bottom":a=-r+Ps}switch(t){case"top-right":case"bottom-right":case"right":o=-e;break;case"top-left":case"bottom-left":case"left":o=e}}return[o,a]}function s_(t,e,r,o,a,c,u,d,f,g){t.createArrays(),t.tilePixelRatio=Xe/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;const x=t.layers[0].layout,w=t.layers[0]._unevaluatedLayout._values,b={};if(t.textSizeData.kind==="composite"){const{minZoom:I,maxZoom:D}=t.textSizeData;b.compositeTextSizes=[w["text-size"].possiblyEvaluate(new v(I),d),w["text-size"].possiblyEvaluate(new v(D),d)]}if(t.iconSizeData.kind==="composite"){const{minZoom:I,maxZoom:D}=t.iconSizeData;b.compositeIconSizes=[w["icon-size"].possiblyEvaluate(new v(I),d),w["icon-size"].possiblyEvaluate(new v(D),d)]}b.layoutTextSize=w["text-size"].possiblyEvaluate(new v(f+1),d),b.layoutIconSize=w["icon-size"].possiblyEvaluate(new v(f+1),d),b.textMaxSize=w["text-size"].possiblyEvaluate(new v(18),d);const k=x.get("text-rotation-alignment")==="map"&&x.get("symbol-placement")!=="point",S=x.get("text-size");for(const I of t.features){const D=x.get("text-font").evaluate(I,{},d).join(","),U=S.evaluate(I,{},d),Z=b.layoutTextSize.evaluate(I,{},d),j=(b.layoutIconSize.evaluate(I,{},d),{horizontal:{},vertical:void 0}),$=I.text;let W,X=[0,0];if($){const fe=$.toString(),ke=x.get("text-letter-spacing").evaluate(I,{},d)*Fr,ue=x.get("text-line-height").evaluate(I,{},d)*Fr,ye=cu(fe)?ke:0,xe=x.get("text-anchor").evaluate(I,{},d),be=x.get("text-variable-anchor");if(!be){const Re=x.get("text-radial-offset").evaluate(I,{},d);X=Re?um(xe,[Re*Fr,ep]):x.get("text-offset").evaluate(I,{},d).map(et=>et*Fr)}let Ie=k?"center":x.get("text-justify").evaluate(I,{},d);const de=x.get("symbol-placement")==="point",Le=de?x.get("text-max-width").evaluate(I,{},d)*Fr:1/0,Ne=Re=>{t.allowVerticalPlacement&&Sl(fe)&&(j.vertical=Ku($,e,r,a,D,Le,ue,xe,Re,ye,X,zi.vertical,!0,Z,U))};if(!k&&be){const Re=Ie==="auto"?be.map(Ce=>tp(Ce)):[Ie];let et=!1;for(let Ce=0;Ce<Re.length;Ce++){const Ze=Re[Ce];if(!j.horizontal[Ze])if(et)j.horizontal[Ze]=j.horizontal[0];else{const tt=Ku($,e,r,a,D,Le,ue,"center",Ze,ye,X,zi.horizontal,!1,Z,U);tt&&(j.horizontal[Ze]=tt,et=tt.positionedLines.length===1)}}Ne("left")}else{if(Ie==="auto"&&(Ie=tp(xe)),de||x.get("text-writing-mode").indexOf("horizontal")>=0||!Sl(fe)){const Re=Ku($,e,r,a,D,Le,ue,xe,Ie,ye,X,zi.horizontal,!1,Z,U);Re&&(j.horizontal[Ie]=Re)}Ne(de?"left":Ie)}}let ce=!1;if(I.icon&&I.icon.name){const fe=o[I.icon.name];fe&&(W=Jg(a[I.icon.name],x.get("icon-offset").evaluate(I,{},d),x.get("icon-anchor").evaluate(I,{},d)),ce=fe.sdf,t.sdfIcons===void 0?t.sdfIcons=fe.sdf:t.sdfIcons!==fe.sdf&&ir("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(fe.pixelRatio!==t.pixelRatio||x.get("icon-rotate").constantOr(1)!==0)&&(t.iconsNeedLinear=!0))}const ae=dm(j.horizontal)||j.vertical;t.iconsInText||(t.iconsInText=!!ae&&ae.iconsInText),(ae||W)&&l_(t,I,j,W,o,b,Z,0,X,ce,u,d,g)}c&&t.generateCollisionDebugBuffers(f,t.collisionBoxArray)}function tp(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function l_(t,e,r,o,a,c,u,d,f,g,x,w,b){let k=c.textMaxSize.evaluate(e,{},w);k===void 0&&(k=u);const S=t.layers[0].layout,I=S.get("icon-offset").evaluate(e,{},w),D=dm(r.horizontal)||r.vertical,U=b.name==="globe",Z=Fr,j=u/Z,$=t.tilePixelRatio*k/Z,W=(xe=t.overscaling,t.zoom>18&&xe>2&&(xe>>=1),Math.max(Xe/(512*xe),1)*S.get("symbol-spacing")),X=S.get("text-padding")*t.tilePixelRatio,ce=S.get("icon-padding")*t.tilePixelRatio,ae=lt(S.get("text-max-angle")),fe=S.get("text-rotation-alignment")==="map"&&S.get("symbol-placement")!=="point",ke=S.get("icon-rotation-alignment")==="map"&&S.get("symbol-placement")!=="point",ue=S.get("symbol-placement"),ye=W/2;var xe;const be=S.get("icon-text-fit");let Ie;o&&be!=="none"&&(t.allowVerticalPlacement&&r.vertical&&(Ie=em(o,r.vertical,be,S.get("icon-text-fit-padding"),I,j)),D&&(o=em(o,D,be,S.get("icon-text-fit-padding"),I,j)));const de=(Le,Ne,Re)=>{if(Ne.x<0||Ne.x>=Xe||Ne.y<0||Ne.y>=Xe)return;let et=null;if(U){const{x:Ce,y:Ze,z:tt}=b.projectTilePoint(Ne.x,Ne.y,Re);et={anchor:new en(Ce,Ze,tt,0,void 0),up:b.upVector(Re,Ne.x,Ne.y)}}(function(Ce,Ze,tt,Et,rt,Ye,Wt,at,st,Ut,$t,qt,jt,nr,cr,yr,Nt,Er,xr,ar,St,vr,Zt,oi,wr){const Or=Ce.addToLineVertexArray(Ze,Et);let zr,ni,Pr,po,Rs,hc,uc,Zm=0,Xm=0,Wm=0,Ym=0,gp=-1,_p=-1;const zo={};let Hm=pu("");const za=tt?tt.anchor:Ze;let yp=0,xp=0;if(st._unevaluatedLayout.getValue("text-radial-offset")===void 0?[yp,xp]=st.layout.get("text-offset").evaluate(St,{},wr).map(bi=>bi*Fr):(yp=st.layout.get("text-radial-offset").evaluate(St,{},wr)*Fr,xp=ep),Ce.allowVerticalPlacement&&rt.vertical){const bi=rt.vertical;if(cr)hc=rp(bi),at&&(uc=rp(at));else{const Ti=st.layout.get("text-rotate").evaluate(St,{},wr)+90;Pr=zh(Ut,za,Ze,$t,qt,jt,bi,nr,Ti,yr),at&&(po=zh(Ut,za,Ze,$t,qt,jt,at,Er,Ti))}}if(Ye){const bi=st.layout.get("icon-rotate").evaluate(St,{},wr),Ti=st.layout.get("icon-text-fit")!=="none",pc=cm(Ye,bi,Zt,Ti),wp=at?cm(at,bi,Zt,Ti):void 0;ni=zh(Ut,za,Ze,$t,qt,jt,Ye,Er,bi),Zm=4*pc.length;const Km=Ce.iconSizeData;let Pa=null;Km.kind==="source"?(Pa=[co*st.layout.get("icon-size").evaluate(St,{},wr)],Pa[0]>Pn&&ir(`${Ce.layerIds[0]}: Value for "icon-size" is >= ${rc}. Reduce your "icon-size".`)):Km.kind==="composite"&&(Pa=[co*vr.compositeIconSizes[0].evaluate(St,{},wr),co*vr.compositeIconSizes[1].evaluate(St,{},wr)],(Pa[0]>Pn||Pa[1]>Pn)&&ir(`${Ce.layerIds[0]}: Value for "icon-size" is >= ${rc}. Reduce your "icon-size".`)),Ce.addSymbols(Ce.icon,pc,Pa,ar,xr,St,!1,tt,Ze,Or.lineStartIndex,Or.lineLength,-1,oi,wr),gp=Ce.icon.placedSymbolArray.length-1,wp&&(Xm=4*wp.length,Ce.addSymbols(Ce.icon,wp,Pa,ar,xr,St,zi.vertical,tt,Ze,Or.lineStartIndex,Or.lineLength,-1,oi,wr),_p=Ce.icon.placedSymbolArray.length-1)}for(const bi in rt.horizontal){const Ti=rt.horizontal[bi];zr||(Hm=pu(Ti.text),cr?Rs=rp(Ti):zr=zh(Ut,za,Ze,$t,qt,jt,Ti,nr,st.layout.get("text-rotate").evaluate(St,{},wr),yr));const pc=Ti.positionedLines.length===1;if(Wm+=pm(Ce,tt,Ze,Ti,Wt,st,cr,St,yr,Or,rt.vertical?zi.horizontal:zi.horizontalOnly,pc?Object.keys(rt.horizontal):[bi],zo,gp,vr,oi,wr),pc)break}rt.vertical&&(Ym+=pm(Ce,tt,Ze,rt.vertical,Wt,st,cr,St,yr,Or,zi.vertical,["vertical"],zo,_p,vr,oi,wr));let On=-1;const vp=(bi,Ti)=>bi?Math.max(bi,Ti):Ti;On=vp(Rs,On),On=vp(hc,On),On=vp(uc,On);const B_=On>-1?1:0;Ce.glyphOffsetArray.length>=Ln.MAX_GLYPHS&&ir("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),St.sortKey!==void 0&&Ce.addToSortKeyRanges(Ce.symbolInstances.length,St.sortKey),Ce.symbolInstances.emplaceBack(za.x,za.y,za.z,Ze.x,Ze.y,zo.right>=0?zo.right:-1,zo.center>=0?zo.center:-1,zo.left>=0?zo.left:-1,zo.vertical>=0?zo.vertical:-1,gp,_p,Hm,zr!==void 0?zr:Ce.collisionBoxArray.length,zr!==void 0?zr+1:Ce.collisionBoxArray.length,Pr!==void 0?Pr:Ce.collisionBoxArray.length,Pr!==void 0?Pr+1:Ce.collisionBoxArray.length,ni!==void 0?ni:Ce.collisionBoxArray.length,ni!==void 0?ni+1:Ce.collisionBoxArray.length,po||Ce.collisionBoxArray.length,po?po+1:Ce.collisionBoxArray.length,$t,Wm,Ym,Zm,Xm,B_,0,yp,xp,On)})(t,Ne,et,Le,r,o,a,Ie,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,X,fe,f,0,ce,ke,I,e,c,g,x,w)};if(ue==="line")for(const Le of am(e.geometry,0,0,Xe,Xe)){const Ne=e_(Le,W,ae,r.vertical||D,o,Z,$,t.overscaling,Xe);for(const Re of Ne)D&&c_(t,D.text,ye,Re)||de(Le,Re,w)}else if(ue==="line-center"){for(const Le of e.geometry)if(Le.length>1){const Ne=Qg(Le,ae,r.vertical||D,o,Z,$);Ne&&de(Le,Ne,w)}}else if(e.type==="Polygon")for(const Le of Vu(e.geometry,0)){const Ne=o_(Le,16);de(Le[0],new en(Ne.x,Ne.y,0,0,void 0),w)}else if(e.type==="LineString")for(const Le of e.geometry)de(Le,new en(Le[0].x,Le[0].y,0,0,void 0),w);else if(e.type==="Point")for(const Le of e.geometry)for(const Ne of Le)de([Ne],new en(Ne.x,Ne.y,0,0,void 0),w)}const rc=255,Pn=rc*co;function pm(t,e,r,o,a,c,u,d,f,g,x,w,b,k,S,I,D){const U=function($,W,X,ce,ae,fe,ke,ue){const ye=[];if(W.positionedLines.length===0)return ye;const xe=ce.layout.get("text-rotate").evaluate(fe,{})*Math.PI/180,be=function(Re){const et=Re[0],Ce=Re[1],Ze=et*Ce;return Ze>0?[et,-Ce]:Ze<0?[-et,Ce]:et===0?[Ce,et]:[Ce,-et]}(X);let Ie=Math.abs(W.top-W.bottom);for(const Re of W.positionedLines)Ie-=Re.lineOffset;const de=W.positionedLines.length,Le=Ie/de;let Ne=W.top-X[1];for(let Re=0;Re<de;++Re){const et=W.positionedLines[Re];Ne=t_(W,Le,Ne,Re);for(const Ce of et.positionedGlyphs){if(!Ce.rect)continue;const Ze=Ce.rect||{};let tt=Zd+1,Et=!0,rt=1,Ye=0;if(Ce.imageName){const Zt=ke[Ce.imageName];if(!Zt)continue;if(Zt.sdf){ir("SDF images are not supported in formatted text and will be ignored.");continue}Et=!1,rt=Zt.pixelRatio,tt=ui/rt}const Wt=(ae||ue)&&Ce.vertical,at=Ce.metrics.advance*Ce.scale/2,st=Ce.metrics,Ut=Ce.rect;if(Ut===null)continue;ue&&W.verticalizable&&(Ye=Ce.imageName?at-Ce.metrics.width*Ce.scale/2:0);const $t=ae?[Ce.x+at,Ce.y]:[0,0];let qt=[0,0],jt=[0,0],nr=!1;ae||(Wt?(jt=[Ce.x+at+be[0],Ce.y+be[1]-Ye],nr=!0):qt=[Ce.x+at+X[0],Ce.y+X[1]-Ye]);const cr=Ut.w*Ce.scale/(rt*(Ce.localGlyph?ho:1)),yr=Ut.h*Ce.scale/(rt*(Ce.localGlyph?ho:1));let Nt,Er,xr,ar;if(Wt){const Zt=Ce.y-Ne,oi=new De(-at,at-Zt),wr=-Math.PI/2,Or=new De(...jt);Nt=new De(-at+qt[0],qt[1]),Nt._rotateAround(wr,oi)._add(Or),Nt.x+=-Zt+at,Nt.y-=(st.left-tt)*Ce.scale;const zr=Ce.imageName?st.advance*Ce.scale:Fr*Ce.scale,ni=String.fromCharCode(Ce.glyph);Bg(ni)?Nt.x+=(1-tt)*Ce.scale:Fg(ni)?Nt.x+=zr-st.height*Ce.scale+(-tt-1)*Ce.scale:Nt.x+=Ce.imageName||st.width+2*tt===Ut.w&&st.height+2*tt===Ut.h?(zr-yr)/2:(zr-(st.height+2*tt)*Ce.scale)/2,Er=new De(Nt.x,Nt.y-cr),xr=new De(Nt.x+yr,Nt.y),ar=new De(Nt.x+yr,Nt.y-cr)}else{const Zt=(st.left-tt)*Ce.scale-at+qt[0],oi=(-st.top-tt)*Ce.scale+qt[1],wr=Zt+cr,Or=oi+yr;Nt=new De(Zt,oi),Er=new De(wr,oi),xr=new De(Zt,Or),ar=new De(wr,Or)}if(xe){let Zt;Zt=ae?new De(0,0):nr?new De(be[0],be[1]):new De(X[0],X[1]),Nt._rotateAround(xe,Zt),Er._rotateAround(xe,Zt),xr._rotateAround(xe,Zt),ar._rotateAround(xe,Zt)}const St=new De(0,0),vr=new De(0,0);ye.push({tl:Nt,tr:Er,bl:xr,br:ar,tex:Ze,writingMode:W.writingMode,glyphOffset:$t,sectionIndex:Ce.sectionIndex,isSDF:Et,pixelOffsetTL:St,pixelOffsetBR:vr,minFontScaleX:0,minFontScaleY:0})}}return ye}(0,o,f,c,u,d,a,t.allowVerticalPlacement),Z=t.textSizeData;let j=null;Z.kind==="source"?(j=[co*c.layout.get("text-size").evaluate(d,{},D)],j[0]>Pn&&ir(`${t.layerIds[0]}: Value for "text-size" is >= ${rc}. Reduce your "text-size".`)):Z.kind==="composite"&&(j=[co*S.compositeTextSizes[0].evaluate(d,{},D),co*S.compositeTextSizes[1].evaluate(d,{},D)],(j[0]>Pn||j[1]>Pn)&&ir(`${t.layerIds[0]}: Value for "text-size" is >= ${rc}. Reduce your "text-size".`)),t.addSymbols(t.text,U,j,f,u,d,x,e,r,g.lineStartIndex,g.lineLength,k,I,D);for(const $ of w)b[$]=t.text.placedSymbolArray.length-1;return 4*U.length}function dm(t){for(const e in t)return t[e];return null}function zh(t,e,r,o,a,c,u,d,f,g){let x=u.top,w=u.bottom,b=u.left,k=u.right;const S=u.collisionPadding;if(S&&(b-=S[0],x-=S[1],k+=S[2],w+=S[3]),f){const I=new De(b,x),D=new De(k,x),U=new De(b,w),Z=new De(k,w),j=lt(f);let $=new De(0,0);g&&($=new De(g[0],g[1])),I._rotateAround(j,$),D._rotateAround(j,$),U._rotateAround(j,$),Z._rotateAround(j,$),b=Math.min(I.x,D.x,U.x,Z.x),k=Math.max(I.x,D.x,U.x,Z.x),x=Math.min(I.y,D.y,U.y,Z.y),w=Math.max(I.y,D.y,U.y,Z.y)}return t.emplaceBack(e.x,e.y,e.z,r.x,r.y,b,x,k,w,d,o,a,c),t.length-1}function rp(t){t.collisionPadding&&(t.top-=t.collisionPadding[1],t.bottom+=t.collisionPadding[3]);const e=t.bottom-t.top;return e>0?Math.max(10,e):null}function c_(t,e,r,o){const a=t.compareText;if(e in a){const c=a[e];for(let u=c.length-1;u>=0;u--)if(o.dist(c[u])<r)return!0}else a[e]=[];return a[e].push(o),!1}function mm(t,e){const r=t.fovAboveCenter,o=t.elevation?t.elevation.getMinElevationBelowMSL()*e:0,a=(t._camera.position[2]*t.worldSize-o)/Math.cos(t._pitch),c=Math.sin(r)*a/Math.sin(Math.max(Math.PI/2-t._pitch-r,.01)),u=Math.sin(t._pitch)*c+a;return Math.min(1.01*u,a*(1/t._horizonShift))}function Ia(t,e){if(!e.isReprojectedInTileSpace)return{scale:1<<t.z,x:t.x,y:t.y,x2:t.x+1,y2:t.y+1,projection:e};const r=Math.pow(2,-t.z),o=t.x*r,a=(t.x+1)*r,c=t.y*r,u=(t.y+1)*r,d=Ci(o),f=Ci(a),g=$r(c),x=$r(u),w=e.project(d,g),b=e.project(f,g),k=e.project(f,x),S=e.project(d,x);let I=Math.min(w.x,b.x,k.x,S.x),D=Math.min(w.y,b.y,k.y,S.y),U=Math.max(w.x,b.x,k.x,S.x),Z=Math.max(w.y,b.y,k.y,S.y);const j=r/16;function $(X,ce,ae,fe,ke,ue){const ye=(ae+ke)/2,xe=(fe+ue)/2,be=e.project(Ci(ye),$r(xe)),Ie=Math.max(0,I-be.x,D-be.y,be.x-U,be.y-Z);I=Math.min(I,be.x),U=Math.max(U,be.x),D=Math.min(D,be.y),Z=Math.max(Z,be.y),Ie>j&&($(X,be,ae,fe,ye,xe),$(be,ce,ye,xe,ke,ue))}$(w,b,o,c,a,c),$(b,k,a,c,a,u),$(k,S,a,u,o,u),$(S,w,o,u,o,c),I-=j,D-=j,U+=j,Z+=j;const W=1/Math.max(U-I,Z-D);return{scale:W,x:I*W,y:D*W,x2:U*W,y2:Z*W,projection:e}}const h_=ao(new Float32Array(16));class Dn{constructor(e){this.spec=e,this.name=e.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(e,r){return{x:0,y:0,z:0}}unproject(e,r){return new Ot(0,0)}projectTilePoint(e,r,o){return{x:e,y:r,z:0}}locationPoint(e,r,o=!0){return e._coordinatePoint(e.locationCoordinate(r),o)}pixelsPerMeter(e,r){return lo(1,e)*r}pixelSpaceConversion(e,r,o){return 1}farthestPixelDistance(e){return mm(e,e.pixelsPerMeter)}pointCoordinate(e,r,o,a){const c=e.horizonLineFromTop(!1),u=new De(r,Math.max(c,o));return e.rayIntersectionCoordinate(e.pointRayIntersection(u,a))}pointCoordinate3D(e,r,o){const a=new De(r,o);if(e.elevation)return e.elevation.pointCoordinate(a);{const c=this.pointCoordinate(e,a.x,a.y,0);return[c.x,c.y,c.z]}}isPointAboveHorizon(e,r){if(e.elevation)return!this.pointCoordinate3D(e,r.x,r.y);const o=e.horizonLineFromTop();return r.y<o}createInversionMatrix(e,r){return h_}createTileMatrix(e,r,o){let a,c,u;const d=o.canonical,f=ao(new Float64Array(16));if(this.isReprojectedInTileSpace){const g=Ia(d,this);a=1,c=g.x+o.wrap*g.scale,u=g.y,ba(f,f,[a/g.scale,a/g.scale,e.pixelsPerMeter/r])}else a=r/e.zoomScale(d.z),c=(d.x+Math.pow(2,d.z)*o.wrap)*a,u=d.y*a;return Dl(f,f,[c,u,0]),ba(f,f,[a/Xe,a/Xe,1]),f}upVector(e,r,o){return[0,0,1]}upVectorScale(e,r,o){return{metersToTile:1}}}class u_ extends Dn{constructor(e){super(e),this.range=[4,7],this.center=e.center||[-96,37.5];const[r,o]=this.parallels=e.parallels||[29.5,45.5],a=Math.sin(lt(r));this.n=(a+Math.sin(lt(o)))/2,this.c=1+a*(2*this.n-a),this.r0=Math.sqrt(this.c)/this.n}project(e,r){const{n:o,c:a,r0:c}=this,u=lt(e-this.center[0]),d=lt(r),f=Math.sqrt(a-2*o*Math.sin(d))/o;return{x:f*Math.sin(u*o),y:f*Math.cos(u*o)-c,z:0}}unproject(e,r){const{n:o,c:a,r0:c}=this,u=c+r;let d=Math.atan2(e,Math.abs(u))*Math.sign(u);u*o<0&&(d-=Math.PI*Math.sign(e)*Math.sign(u));const f=lt(this.center[0])*o;d=tr(d,-Math.PI-f,Math.PI-f);const g=it(Ke(d/o)+this.center[0],-180,180),x=Math.asin(it((a-(e*e+u*u)*o*o)/(2*o),-1,1)),w=it(Ke(x),-qr,qr);return new Ot(g,w)}}const ic=1.340264,oc=-.081106,nc=893e-6,ac=.003796,Ph=Math.sqrt(3)/2;class p_ extends Dn{project(e,r){r=r/180*Math.PI,e=e/180*Math.PI;const o=Math.asin(Ph*Math.sin(r)),a=o*o,c=a*a*a;return{x:.5*(e*Math.cos(o)/(Ph*(ic+3*oc*a+c*(7*nc+9*ac*a)))/Math.PI+.5),y:1-.5*(o*(ic+oc*a+c*(nc+ac*a))/Math.PI+1),z:0}}unproject(e,r){e=(2*e-.5)*Math.PI;let o=r=(2*(1-r)-1)*Math.PI,a=o*o,c=a*a*a;for(let x,w,b,k=0;k<12&&(w=o*(ic+oc*a+c*(nc+ac*a))-r,b=ic+3*oc*a+c*(7*nc+9*ac*a),x=w/b,o=it(o-x,-Math.PI/3,Math.PI/3),a=o*o,c=a*a*a,!(Math.abs(x)<1e-12));++k);const u=Ph*e*(ic+3*oc*a+c*(7*nc+9*ac*a))/Math.cos(o),d=Math.asin(Math.sin(o)/Ph),f=it(180*u/Math.PI,-180,180),g=it(180*d/Math.PI,-qr,qr);return new Ot(f,g)}}class d_ extends Dn{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0}project(e,r){return{x:.5+e/360,y:.5-r/360,z:0}}unproject(e,r){const o=360*(e-.5),a=it(360*(.5-r),-qr,qr);return new Ot(o,a)}}const Ds=Math.PI/2;function Dh(t){return Math.tan((Ds+t)/2)}class m_ extends Dn{constructor(e){super(e),this.center=e.center||[0,30];const[r,o]=this.parallels=e.parallels||[30,30];let a=lt(r),c=lt(o);this.southernCenter=a+c<0,this.southernCenter&&(a=-a,c=-c);const u=Math.cos(a),d=Dh(a);this.n=a===c?Math.sin(a):Math.log(u/Math.cos(c))/Math.log(Dh(c)/d),this.f=u*Math.pow(Dh(a),this.n)/this.n}project(e,r){r=lt(r),this.southernCenter&&(r=-r),e=lt(e-this.center[0]);const o=1e-6,{n:a,f:c}=this;c>0?r<-Ds+o&&(r=-Ds+o):r>Ds-o&&(r=Ds-o);const u=c/Math.pow(Dh(r),a);let d=u*Math.sin(a*e),f=c-u*Math.cos(a*e);return d=.5*(d/Math.PI+.5),f=.5*(f/Math.PI+.5),{x:d,y:this.southernCenter?f:1-f,z:0}}unproject(e,r){e=(2*e-.5)*Math.PI,this.southernCenter&&(r=1-r),r=(2*(1-r)-.5)*Math.PI;const{n:o,f:a}=this,c=a-r,u=Math.sign(c),d=Math.sign(o)*Math.sqrt(e*e+c*c);let f=Math.atan2(e,Math.abs(c))*u;c*o<0&&(f-=Math.PI*Math.sign(e)*u);const g=it(Ke(f/o)+this.center[0],-180,180),x=it(Ke(2*Math.atan(Math.pow(a/d,1/o))-Ds),-qr,qr);return new Ot(g,this.southernCenter?-x:x)}}class fm extends Dn{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(e,r){return{x:So(e),y:Mo(r),z:0}}unproject(e,r){const o=Ci(e),a=$r(r);return new Ot(o,a)}}const gm=lt(qr);class f_ extends Dn{project(e,r){const o=(r=lt(r))*r,a=o*o;return{x:.5*((e=lt(e))*(.8707-.131979*o+a*(a*(.003971*o-.001529*a)-.013791))/Math.PI+.5),y:1-.5*(r*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))/Math.PI+1),z:0}}unproject(e,r){e=(2*e-.5)*Math.PI;let o=r=(2*(1-r)-1)*Math.PI,a=25,c=0,u=o*o;do{u=o*o;const g=u*u;c=(o*(1.007226+u*(.015085+g*(.028874*u-.044475-.005916*g)))-r)/(1.007226+u*(.045255+g*(.259866*u-.311325-.005916*11*g))),o=it(o-c,-gm,gm)}while(Math.abs(c)>1e-6&&--a>0);u=o*o;const d=it(Ke(e/(.8707+u*(u*(u*u*u*(.003971-.001529*u)-.013791)-.131979))),-180,180),f=Ke(o);return new Ot(d,f)}}const _m=lt(qr);class g_ extends Dn{project(e,r){r=lt(r),e=lt(e);const o=Math.cos(r),a=2/Math.PI,c=Math.acos(o*Math.cos(e/2)),u=Math.sin(c)/c,d=.5*(e*a+2*o*Math.sin(e/2)/u)||0,f=.5*(r+Math.sin(r)/u)||0;return{x:.5*(d/Math.PI+.5),y:1-.5*(f/Math.PI+1),z:0}}unproject(e,r){let o=e=(2*e-.5)*Math.PI,a=r=(2*(1-r)-1)*Math.PI,c=25;const u=1e-6;let d=0,f=0;do{const g=Math.cos(a),x=Math.sin(a),w=2*x*g,b=x*x,k=g*g,S=Math.cos(o/2),I=Math.sin(o/2),D=2*S*I,U=I*I,Z=1-k*S*S,j=Z?1/Z:0,$=Z?Math.acos(g*S)*Math.sqrt(1/Z):0,W=.5*(2*$*g*I+2*o/Math.PI)-e,X=.5*($*x+a)-r,ce=.5*j*(k*U+$*g*S*b)+1/Math.PI,ae=j*(D*w/4-$*x*I),fe=.125*j*(w*I-$*x*k*D),ke=.5*j*(b*S+$*U*g)+.5,ue=ae*fe-ke*ce;d=(X*ae-W*ke)/ue,f=(W*fe-X*ce)/ue,o=it(o-d,-Math.PI,Math.PI),a=it(a-f,-_m,_m)}while((Math.abs(d)>u||Math.abs(f)>u)&&--c>0);return new Ot(Ke(o),Ke(a))}}class ym extends Dn{constructor(e){super(e),this.center=e.center||[0,0],this.parallels=e.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(lt(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(e,r){const{scale:o,cosPhi:a}=this;return{x:lt(e)*a*o+.5,y:-Math.sin(lt(r))/a*o+.5,z:0}}unproject(e,r){const{scale:o,cosPhi:a}=this,c=-(r-.5)/o,u=it(Ke((e-.5)/o)/a,-180,180),d=Math.asin(it(c*a,-1,1)),f=it(Ke(d),-qr,qr);return new Ot(u,f)}}class __ extends fm{constructor(e){super(e),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(e,r,o){const a=Nl(e,r,o);return pr(a,a,Vl(ko(o))),{x:a[0],y:a[1],z:a[2]}}locationPoint(e,r){const o=ys(r.lat,r.lng),a=ti([],o),c=e.elevation?e.elevation.getAtPointOrZero(e.locationCoordinate(r),e._centerAltitude):e._centerAltitude;Fl(o,o,a,lo(1,0)*Xe*c);const u=ao(new Float64Array(16));return wa(u,e.pixelMatrix,e.globeMatrix),pr(o,o,u),new De(o[0],o[1])}pixelsPerMeter(e,r){return lo(1,0)*r}pixelSpaceConversion(e,r,o){const a=lo(1,e)*r,c=bt(lo(1,45)*r,a,o);return this.pixelsPerMeter(e,r)/c}createTileMatrix(e,r,o){const a=Su(ko(o.canonical));return wa(new Float64Array(16),e.globeMatrix,a)}createInversionMatrix(e,r){const{center:o}=e,a=Vl(ko(r));return sh(a,a,lt(o.lng)),gu(a,a,lt(o.lat)),ba(a,a,[e._pixelsPerMercatorPixel,e._pixelsPerMercatorPixel,1]),Float32Array.from(a)}pointCoordinate(e,r,o,a){return qp(e,r,o,!0)||new vs(0,0)}pointCoordinate3D(e,r,o){const a=this.pointCoordinate(e,r,o,0);return[a.x,a.y,a.z]}isPointAboveHorizon(e,r){return!qp(e,r.x,r.y,!1)}farthestPixelDistance(e){const r=function(a,c){const u=a.cameraToCenterDistance,d=a._centerAltitude*c,f=a._camera,g=a._camera.forward(),x=Ho([],Ii([],g,-u),[0,0,d]),w=a.worldSize/(2*Math.PI),b=[0,0,-w],k=a.width/a.height,S=Math.tan(a.fovAboveCenter),I=Ii([],f.up(),S),D=Ii([],f.right(),S*k),U=ti([],Ho([],Ho([],g,I),D)),Z=[];let j;if(new vu(x,U).closestPointOnSphere(b,w,Z)){const $=Ho([],Z,b),W=so([],$,x);j=Math.cos(a.fovAboveCenter)*Ll(W)}else{const $=so([],x,b),W=so([],b,x);ti(W,W);const X=Ll($)-w;j=Math.sqrt(X*(X+2*w));const ce=Math.acos(j/(w+X))-Math.acos(ji(g,W));j*=Math.cos(ce)}return 1.01*j}(e,this.pixelsPerMeter(e.center.lat,e.worldSize)),o=xs(e.zoom);if(o>0){const a=mm(e,lo(1,e.center.lat)*e.worldSize),c=e.worldSize/(2*Math.PI),u=Math.max(e.width,e.height)/e.worldSize*Math.PI;return bt(r,a+c*(1-Math.cos(u)),Math.pow(o,10))}return r}upVector(e,r,o){return Nl(r,o,e,1)}upVectorScale(e){return{metersToTile:lh(hh(ko(e)))}}}function xm(t){const e=t.parallels,r=!!e&&Math.abs(e[0]+e[1])<.01;switch(t.name){case"mercator":return new fm(t);case"equirectangular":return new d_(t);case"naturalEarth":return new f_(t);case"equalEarth":return new p_(t);case"winkelTripel":return new g_(t);case"albers":return r?new ym(t):new u_(t);case"lambertConformalConic":return r?new ym(t):new m_(t);case"globe":return new __(t)}throw new Error(`Invalid projection name: ${t.name}`)}const y_=vh.types,x_=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Lh(t,e,r,o,a,c,u,d,f,g,x,w,b){const k=d?Math.min(Pn,Math.round(d[0])):0,S=d?Math.min(Pn,Math.round(d[1])):0;t.emplaceBack(e,r,Math.round(32*o),Math.round(32*a),c,u,(k<<1)+(f?1:0),S,16*g,16*x,256*w,256*b)}function Rh(t,e,r,o,a,c,u){t.emplaceBack(e,r,o,a,c,u)}function Bh(t,e,r,o,a){t.emplaceBack(e,r,o,a),t.emplaceBack(e,r,o,a),t.emplaceBack(e,r,o,a),t.emplaceBack(e,r,o,a)}function v_(t){for(const e of t.sections)if(uu(e.text))return!0;return!1}class ip{constructor(e){this.layoutVertexArray=new we,this.indexArray=new $e,this.programConfigurations=e,this.segments=new gr,this.dynamicLayoutVertexArray=new Te,this.opacityVertexArray=new qe,this.placedSymbolArray=new fr,this.globeExtVertexArray=new Me}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,r,o,a){this.isEmpty()||(o&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ag.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Cg.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,x_,!0),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,Ig.members,!0)),this.opacityVertexBuffer.itemSize=1),(o||a)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}}Ue(ip,"SymbolBuffers");class op{constructor(e,r,o){this.layoutVertexArray=new e,this.layoutAttributes=r,this.indexArray=new o,this.segments=new gr,this.collisionVertexArray=new mt,this.collisionVertexArrayExt=new ut}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,zg.members,!0),this.collisionVertexBufferExt=e.createVertexBuffer(this.collisionVertexArrayExt,Pg.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}Ue(op,"CollisionBuffers");class Ln{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(u=>u.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=ao([]),this.placementViewportMatrix=ao([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Zu(this.zoom,r["text-size"]),this.iconSizeData=Zu(this.zoom,r["icon-size"]);const o=this.layers[0].layout,a=o.get("symbol-sort-key"),c=o.get("symbol-z-order");this.canOverlap=o.get("text-allow-overlap")||o.get("icon-allow-overlap")||o.get("text-ignore-placement")||o.get("icon-ignore-placement"),this.sortFeaturesByKey=c!=="viewport-y"&&a.constantOr(1)!==void 0,this.sortFeaturesByY=(c==="viewport-y"||c==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=o.get("text-writing-mode").map(u=>zi[u]),this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id),this.sourceID=e.sourceID,this.projection=e.projection}createArrays(){this.text=new ip(new va(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new ip(new va(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new ei,this.lineVertexArray=new ds,this.symbolInstances=new Yt}calculateGlyphDependencies(e,r,o,a,c){for(let u=0;u<e.length;u++)if(r[e.charCodeAt(u)]=!0,a&&c){const d=Ql[e.charAt(u)];d&&(r[d.charCodeAt(0)]=!0)}}populate(e,r,o,a){const c=this.layers[0],u=c.layout,d=this.projection.name==="globe",f=u.get("text-font"),g=u.get("text-field"),x=u.get("icon-image"),w=(g.value.kind!=="constant"||g.value.value instanceof Qr&&!g.value.value.isEmpty()||g.value.value.toString().length>0)&&(f.value.kind!=="constant"||f.value.value.length>0),b=x.value.kind!=="constant"||!!x.value.value||Object.keys(x.parameters).length>0,k=u.get("symbol-sort-key");if(this.features=[],!w&&!b)return;const S=r.iconDependencies,I=r.glyphDependencies,D=r.availableImages,U=new v(this.zoom);for(const{feature:Z,id:j,index:$,sourceLayerIndex:W}of e){const X=c._featureFilter.needGeometry,ce=Sa(Z,X);if(!c._featureFilter.filter(U,ce,o))continue;if(X||(ce.geometry=Ko(Z,o,a)),d&&Z.type!==1&&o.z<=5){const ue=ce.geometry,ye=.98078528056,xe=(be,Ie)=>ji(Nl(be.x,be.y,o,1),Nl(Ie.x,Ie.y,o,1))<ye;for(let be=0;be<ue.length;be++)ue[be]=Cf(ue[be],xe)}let ae,fe;if(w){const ue=c.getValueAndResolveTokens("text-field",ce,o,D),ye=Qr.factory(ue);v_(ye)&&(this.hasRTLText=!0),(!this.hasRTLText||m()==="unavailable"||this.hasRTLText&&y.isParsed())&&(ae=Rg(ye,c,ce))}if(b){const ue=c.getValueAndResolveTokens("icon-image",ce,o,D);fe=ue instanceof gi?ue:gi.fromString(ue)}if(!ae&&!fe)continue;const ke=this.sortFeaturesByKey?k.evaluate(ce,{},o):void 0;if(this.features.push({id:j,text:ae,icon:fe,index:$,sourceLayerIndex:W,geometry:ce.geometry,properties:Z.properties,type:y_[Z.type],sortKey:ke}),fe&&(S[fe.name]=!0),ae){const ue=f.evaluate(ce,{},o).join(","),ye=u.get("text-rotation-alignment")==="map"&&u.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(zi.vertical)>=0;for(const xe of ae.sections)if(xe.image)S[xe.image.name]=!0;else{const be=Sl(ae.toString()),Ie=xe.fontStack||ue,de=I[Ie]=I[Ie]||{};this.calculateGlyphDependencies(xe.text,de,ye,this.allowVerticalPlacement,be)}}}u.get("symbol-placement")==="line"&&(this.features=function(Z){const j={},$={},W=[];let X=0;function ce(ue){W.push(Z[ue]),X++}function ae(ue,ye,xe){const be=$[ue];return delete $[ue],$[ye]=be,W[be].geometry[0].pop(),W[be].geometry[0]=W[be].geometry[0].concat(xe[0]),be}function fe(ue,ye,xe){const be=j[ye];return delete j[ye],j[ue]=be,W[be].geometry[0].shift(),W[be].geometry[0]=xe[0].concat(W[be].geometry[0]),be}function ke(ue,ye,xe){const be=xe?ye[0][ye[0].length-1]:ye[0][0];return`${ue}:${be.x}:${be.y}`}for(let ue=0;ue<Z.length;ue++){const ye=Z[ue],xe=ye.geometry,be=ye.text?ye.text.toString():null;if(!be){ce(ue);continue}const Ie=ke(be,xe),de=ke(be,xe,!0);if(Ie in $&&de in j&&$[Ie]!==j[de]){const Le=fe(Ie,de,xe),Ne=ae(Ie,de,W[Le].geometry);delete j[Ie],delete $[de],$[ke(be,W[Ne].geometry,!0)]=Ne,W[Le].geometry=null}else Ie in $?ae(Ie,de,xe):de in j?fe(Ie,de,xe):(ce(ue),j[Ie]=X-1,$[de]=X-1)}return W.filter(ue=>ue.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((Z,j)=>Z.sortKey-j.sortKey)}update(e,r,o,a){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,r,this.layers,o,a),this.icon.programConfigurations.updatePaintArrays(e,r,this.layers,o,a))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=xm(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,r){const o=this.lineVertexArray.length;if(e.segment!==void 0)for(const{x:a,y:c}of r)this.lineVertexArray.emplaceBack(a,c);return{lineStartIndex:o,lineLength:this.lineVertexArray.length-o}}addSymbols(e,r,o,a,c,u,d,f,g,x,w,b,k,S){const I=e.indexArray,D=e.layoutVertexArray,U=e.globeExtVertexArray,Z=e.segments.prepareSegment(4*r.length,D,I,this.canOverlap?u.sortKey:void 0),j=this.glyphOffsetArray.length,$=Z.vertexLength,W=this.allowVerticalPlacement&&d===zi.vertical?Math.PI/2:0,X=u.text&&u.text.sections;for(let ae=0;ae<r.length;ae++){const{tl:fe,tr:ke,bl:ue,br:ye,tex:xe,pixelOffsetTL:be,pixelOffsetBR:Ie,minFontScaleX:de,minFontScaleY:Le,glyphOffset:Ne,isSDF:Re,sectionIndex:et}=r[ae],Ce=Z.vertexLength,Ze=Ne[1];if(Lh(D,g.x,g.y,fe.x,Ze+fe.y,xe.x,xe.y,o,Re,be.x,be.y,de,Le),Lh(D,g.x,g.y,ke.x,Ze+ke.y,xe.x+xe.w,xe.y,o,Re,Ie.x,be.y,de,Le),Lh(D,g.x,g.y,ue.x,Ze+ue.y,xe.x,xe.y+xe.h,o,Re,be.x,Ie.y,de,Le),Lh(D,g.x,g.y,ye.x,Ze+ye.y,xe.x+xe.w,xe.y+xe.h,o,Re,Ie.x,Ie.y,de,Le),f){const{x:tt,y:Et,z:rt}=f.anchor,[Ye,Wt,at]=f.up;Rh(U,tt,Et,rt,Ye,Wt,at),Rh(U,tt,Et,rt,Ye,Wt,at),Rh(U,tt,Et,rt,Ye,Wt,at),Rh(U,tt,Et,rt,Ye,Wt,at),Bh(e.dynamicLayoutVertexArray,tt,Et,rt,W)}else Bh(e.dynamicLayoutVertexArray,g.x,g.y,g.z,W);I.emplaceBack(Ce,Ce+1,Ce+2),I.emplaceBack(Ce+1,Ce+2,Ce+3),Z.vertexLength+=4,Z.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Ne[0]),ae!==r.length-1&&et===r[ae+1].sectionIndex||e.programConfigurations.populatePaintArrays(D.length,u,u.index,{},k,S,X&&X[et])}const ce=f?f.anchor:g;e.placedSymbolArray.emplaceBack(ce.x,ce.y,ce.z,g.x,g.y,j,this.glyphOffsetArray.length-j,$,x,w,g.segment,o?o[0]:0,o?o[1]:0,a[0],a[1],d,0,!1,0,b,0)}_commitLayoutVertex(e,r,o,a,c,u,d){e.emplaceBack(r,o,a,c,u,Math.round(d.x),Math.round(d.y))}_addCollisionDebugVertices(e,r,o,a,c,u,d){const f=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),g=f.vertexLength,x=d.tileAnchorX,w=d.tileAnchorY;for(let k=0;k<4;k++)o.collisionVertexArray.emplaceBack(0,0,0,0);o.collisionVertexArrayExt.emplaceBack(r,-e.padding,-e.padding),o.collisionVertexArrayExt.emplaceBack(r,e.padding,-e.padding),o.collisionVertexArrayExt.emplaceBack(r,e.padding,e.padding),o.collisionVertexArrayExt.emplaceBack(r,-e.padding,e.padding),this._commitLayoutVertex(o.layoutVertexArray,a,c,u,x,w,new De(e.x1,e.y1)),this._commitLayoutVertex(o.layoutVertexArray,a,c,u,x,w,new De(e.x2,e.y1)),this._commitLayoutVertex(o.layoutVertexArray,a,c,u,x,w,new De(e.x2,e.y2)),this._commitLayoutVertex(o.layoutVertexArray,a,c,u,x,w,new De(e.x1,e.y2)),f.vertexLength+=4;const b=o.indexArray;b.emplaceBack(g,g+1),b.emplaceBack(g+1,g+2),b.emplaceBack(g+2,g+3),b.emplaceBack(g+3,g),f.primitiveLength+=4}_addTextDebugCollisionBoxes(e,r,o,a,c,u){for(let d=a;d<c;d++){const f=o.get(d),g=this.getSymbolInstanceTextSize(e,u,r,d);this._addCollisionDebugVertices(f,g,this.textCollisionBox,f.projectedAnchorX,f.projectedAnchorY,f.projectedAnchorZ,u)}}_addIconDebugCollisionBoxes(e,r,o,a,c,u){for(let d=a;d<c;d++){const f=o.get(d),g=this.getSymbolInstanceIconSize(e,r,u.placedIconSymbolIndex);this._addCollisionDebugVertices(f,g,this.iconCollisionBox,f.projectedAnchorX,f.projectedAnchorY,f.projectedAnchorZ,u)}}generateCollisionDebugBuffers(e,r){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new op(je,Od.members,Cr),this.iconCollisionBox=new op(je,Od.members,Cr);const o=ks(this.iconSizeData,e),a=ks(this.textSizeData,e);for(let c=0;c<this.symbolInstances.length;c++){const u=this.symbolInstances.get(c);this._addTextDebugCollisionBoxes(a,e,r,u.textBoxStartIndex,u.textBoxEndIndex,u),this._addTextDebugCollisionBoxes(a,e,r,u.verticalTextBoxStartIndex,u.verticalTextBoxEndIndex,u),this._addIconDebugCollisionBoxes(o,e,r,u.iconBoxStartIndex,u.iconBoxEndIndex,u),this._addIconDebugCollisionBoxes(o,e,r,u.verticalIconBoxStartIndex,u.verticalIconBoxEndIndex,u)}}getSymbolInstanceTextSize(e,r,o,a){const c=this.text.placedSymbolArray.get(r.rightJustifiedTextSymbolIndex>=0?r.rightJustifiedTextSymbolIndex:r.centerJustifiedTextSymbolIndex>=0?r.centerJustifiedTextSymbolIndex:r.leftJustifiedTextSymbolIndex>=0?r.leftJustifiedTextSymbolIndex:r.verticalPlacedTextSymbolIndex>=0?r.verticalPlacedTextSymbolIndex:a),u=Eh(this.textSizeData,e,c)/Fr;return this.tilePixelRatio*u}getSymbolInstanceIconSize(e,r,o){const a=this.icon.placedSymbolArray.get(o),c=Eh(this.iconSizeData,e,a);return this.tilePixelRatio*c}_commitDebugCollisionVertexUpdate(e,r,o){e.emplaceBack(r,-o,-o),e.emplaceBack(r,o,-o),e.emplaceBack(r,o,o),e.emplaceBack(r,-o,o)}_updateTextDebugCollisionBoxes(e,r,o,a,c,u){for(let d=a;d<c;d++){const f=o.get(d),g=this.getSymbolInstanceTextSize(e,u,r,d);this._commitDebugCollisionVertexUpdate(this.textCollisionBox.collisionVertexArrayExt,g,f.padding)}}_updateIconDebugCollisionBoxes(e,r,o,a,c,u){for(let d=a;d<c;d++){const f=o.get(d),g=this.getSymbolInstanceIconSize(e,r,u);this._commitDebugCollisionVertexUpdate(this.iconCollisionBox.collisionVertexArrayExt,g,f.padding)}}updateCollisionDebugBuffers(e,r){if(!this.hasDebugData())return;this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexArrayExt.clear(),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexArrayExt.clear();const o=ks(this.iconSizeData,e),a=ks(this.textSizeData,e);for(let c=0;c<this.symbolInstances.length;c++){const u=this.symbolInstances.get(c);this._updateTextDebugCollisionBoxes(a,e,r,u.textBoxStartIndex,u.textBoxEndIndex,u),this._updateTextDebugCollisionBoxes(a,e,r,u.verticalTextBoxStartIndex,u.verticalTextBoxEndIndex,u),this._updateIconDebugCollisionBoxes(o,e,r,u.iconBoxStartIndex,u.iconBoxEndIndex,u.placedIconSymbolIndex),this._updateIconDebugCollisionBoxes(o,e,r,u.verticalIconBoxStartIndex,u.verticalIconBoxEndIndex,u.placedIconSymbolIndex)}this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexBufferExt&&this.textCollisionBox.collisionVertexBufferExt.updateData(this.textCollisionBox.collisionVertexArrayExt),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexBufferExt&&this.iconCollisionBox.collisionVertexBufferExt.updateData(this.iconCollisionBox.collisionVertexArrayExt)}_deserializeCollisionBoxesForSymbol(e,r,o,a,c,u,d,f,g){const x={};if(r<o){const{x1:w,y1:b,x2:k,y2:S,padding:I,projectedAnchorX:D,projectedAnchorY:U,projectedAnchorZ:Z,tileAnchorX:j,tileAnchorY:$,featureIndex:W}=e.get(r);x.textBox={x1:w,y1:b,x2:k,y2:S,padding:I,projectedAnchorX:D,projectedAnchorY:U,projectedAnchorZ:Z,tileAnchorX:j,tileAnchorY:$},x.textFeatureIndex=W}if(a<c){const{x1:w,y1:b,x2:k,y2:S,padding:I,projectedAnchorX:D,projectedAnchorY:U,projectedAnchorZ:Z,tileAnchorX:j,tileAnchorY:$,featureIndex:W}=e.get(a);x.verticalTextBox={x1:w,y1:b,x2:k,y2:S,padding:I,projectedAnchorX:D,projectedAnchorY:U,projectedAnchorZ:Z,tileAnchorX:j,tileAnchorY:$},x.verticalTextFeatureIndex=W}if(u<d){const{x1:w,y1:b,x2:k,y2:S,padding:I,projectedAnchorX:D,projectedAnchorY:U,projectedAnchorZ:Z,tileAnchorX:j,tileAnchorY:$,featureIndex:W}=e.get(u);x.iconBox={x1:w,y1:b,x2:k,y2:S,padding:I,projectedAnchorX:D,projectedAnchorY:U,projectedAnchorZ:Z,tileAnchorX:j,tileAnchorY:$},x.iconFeatureIndex=W}if(f<g){const{x1:w,y1:b,x2:k,y2:S,padding:I,projectedAnchorX:D,projectedAnchorY:U,projectedAnchorZ:Z,tileAnchorX:j,tileAnchorY:$,featureIndex:W}=e.get(f);x.verticalIconBox={x1:w,y1:b,x2:k,y2:S,padding:I,projectedAnchorX:D,projectedAnchorY:U,projectedAnchorZ:Z,tileAnchorX:j,tileAnchorY:$},x.verticalIconFeatureIndex=W}return x}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let r=0;r<this.symbolInstances.length;r++){const o=this.symbolInstances.get(r);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,o.textBoxStartIndex,o.textBoxEndIndex,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o.iconBoxStartIndex,o.iconBoxEndIndex,o.verticalIconBoxStartIndex,o.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,r){const o=e.placedSymbolArray.get(r),a=o.vertexStartIndex+4*o.numGlyphs;for(let c=o.vertexStartIndex;c<a;c+=4)e.indexArray.emplaceBack(c,c+1,c+2),e.indexArray.emplaceBack(c+1,c+2,c+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const r=Math.sin(e),o=Math.cos(e),a=[],c=[],u=[];for(let d=0;d<this.symbolInstances.length;++d){u.push(d);const f=this.symbolInstances.get(d);a.push(0|Math.round(r*f.tileAnchorX+o*f.tileAnchorY)),c.push(f.featureIndex)}return u.sort((d,f)=>a[d]-a[f]||c[f]-c[d]),u}addToSortKeyRanges(e,r){const o=this.sortKeyRanges[this.sortKeyRanges.length-1];o&&o.sortKey===r?o.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const r of this.symbolInstanceIndexes){const o=this.symbolInstances.get(r);this.featureSortOrder.push(o.featureIndex);const{rightJustifiedTextSymbolIndex:a,centerJustifiedTextSymbolIndex:c,leftJustifiedTextSymbolIndex:u,verticalPlacedTextSymbolIndex:d,placedIconSymbolIndex:f,verticalPlacedIconSymbolIndex:g}=o;a>=0&&this.addIndicesForPlacedSymbol(this.text,a),c>=0&&c!==a&&this.addIndicesForPlacedSymbol(this.text,c),u>=0&&u!==c&&u!==a&&this.addIndicesForPlacedSymbol(this.text,u),d>=0&&this.addIndicesForPlacedSymbol(this.text,d),f>=0&&this.addIndicesForPlacedSymbol(this.icon,f),g>=0&&this.addIndicesForPlacedSymbol(this.icon,g)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}Ue(Ln,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),Ln.MAX_GLYPHS=65535,Ln.addDynamicAttributes=Bh;const w_=new V({"symbol-placement":new A(me.layout_symbol["symbol-placement"]),"symbol-spacing":new A(me.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new A(me.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new L(me.layout_symbol["symbol-sort-key"]),"symbol-z-order":new A(me.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new A(me.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new A(me.layout_symbol["icon-ignore-placement"]),"icon-optional":new A(me.layout_symbol["icon-optional"]),"icon-rotation-alignment":new A(me.layout_symbol["icon-rotation-alignment"]),"icon-size":new L(me.layout_symbol["icon-size"]),"icon-text-fit":new A(me.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new A(me.layout_symbol["icon-text-fit-padding"]),"icon-image":new L(me.layout_symbol["icon-image"]),"icon-rotate":new L(me.layout_symbol["icon-rotate"]),"icon-padding":new A(me.layout_symbol["icon-padding"]),"icon-keep-upright":new A(me.layout_symbol["icon-keep-upright"]),"icon-offset":new L(me.layout_symbol["icon-offset"]),"icon-anchor":new L(me.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new A(me.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new A(me.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new A(me.layout_symbol["text-rotation-alignment"]),"text-field":new L(me.layout_symbol["text-field"]),"text-font":new L(me.layout_symbol["text-font"]),"text-size":new L(me.layout_symbol["text-size"]),"text-max-width":new L(me.layout_symbol["text-max-width"]),"text-line-height":new L(me.layout_symbol["text-line-height"]),"text-letter-spacing":new L(me.layout_symbol["text-letter-spacing"]),"text-justify":new L(me.layout_symbol["text-justify"]),"text-radial-offset":new L(me.layout_symbol["text-radial-offset"]),"text-variable-anchor":new A(me.layout_symbol["text-variable-anchor"]),"text-anchor":new L(me.layout_symbol["text-anchor"]),"text-max-angle":new A(me.layout_symbol["text-max-angle"]),"text-writing-mode":new A(me.layout_symbol["text-writing-mode"]),"text-rotate":new L(me.layout_symbol["text-rotate"]),"text-padding":new A(me.layout_symbol["text-padding"]),"text-keep-upright":new A(me.layout_symbol["text-keep-upright"]),"text-transform":new L(me.layout_symbol["text-transform"]),"text-offset":new L(me.layout_symbol["text-offset"]),"text-allow-overlap":new A(me.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new A(me.layout_symbol["text-ignore-placement"]),"text-optional":new A(me.layout_symbol["text-optional"])});var np={paint:new V({"icon-opacity":new L(me.paint_symbol["icon-opacity"]),"icon-color":new L(me.paint_symbol["icon-color"]),"icon-halo-color":new L(me.paint_symbol["icon-halo-color"]),"icon-halo-width":new L(me.paint_symbol["icon-halo-width"]),"icon-halo-blur":new L(me.paint_symbol["icon-halo-blur"]),"icon-translate":new A(me.paint_symbol["icon-translate"]),"icon-translate-anchor":new A(me.paint_symbol["icon-translate-anchor"]),"text-opacity":new L(me.paint_symbol["text-opacity"]),"text-color":new L(me.paint_symbol["text-color"],{runtimeType:ci,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new L(me.paint_symbol["text-halo-color"]),"text-halo-width":new L(me.paint_symbol["text-halo-width"]),"text-halo-blur":new L(me.paint_symbol["text-halo-blur"]),"text-translate":new A(me.paint_symbol["text-translate"]),"text-translate-anchor":new A(me.paint_symbol["text-translate-anchor"])}),layout:w_};class vm{constructor(e){this.type=e.property.overrides?e.property.overrides.runtimeType:hn,this.defaultValue=e}evaluate(e){if(e.formattedSection){const r=this.defaultValue.property.overrides;if(r&&r.hasOverride(e.formattedSection))return r.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Ue(vm,"FormatSectionOverride",{omit:["defaultValue"]});class Fh extends no{constructor(e){super(e,np)}recalculate(e,r){super.recalculate(e,r),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const o=this.layout.get("text-writing-mode");if(o){const a=[];for(const c of o)a.indexOf(c)<0&&a.push(c);this.layout._values["text-writing-mode"]=a}else this.layout._values["text-writing-mode"]=this.layout.get("symbol-placement")==="point"?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getValueAndResolveTokens(e,r,o,a){const c=this.layout.get(e).evaluate(r,{},o,a),u=this._unevaluatedLayout._values[e];return u.isDataDriven()||bn(u.value)||!c?c:function(d,f){return f.replace(/{([^{}]+)}/g,(g,x)=>x in d?String(d[x]):"")}(r.properties,c)}createBucket(e){return new Ln(e)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const e of np.paint.overridableProperties){if(!Fh.hasPaintOverride(this.layout,e))continue;const r=this.paint.get(e),o=new vm(r),a=new ns(o,r.property.specification);let c=null;c=r.value.kind==="constant"||r.value.kind==="source"?new fl("source",a):new ua("composite",a,r.value.zoomStops,r.value._interpolationType),this.paint._values[e]=new B(r.property,c,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,o){return!(!this.layout||r.isDataDriven()||o.isDataDriven())&&Fh.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){const o=e.get("text-field"),a=np.paint.properties[r];let c=!1;const u=d=>{for(const f of d)if(a.overrides&&a.overrides.hasOverride(f))return void(c=!0)};if(o.value.kind==="constant"&&o.value.value instanceof Qr)u(o.value.value.sections);else if(o.value.kind==="source"){const d=g=>{c||(g instanceof Uo&&lr(g.value)===Wn?u(g.value.sections):g instanceof wo?u(g.sections):g.eachChild(d))},f=o.value;f._styleExpression&&d(f._styleExpression.expression)}return c}getProgramConfiguration(e){return new In(this,e)}}var b_={paint:new V({"background-color":new A(me.paint_background["background-color"]),"background-pattern":new A(me.paint_background["background-pattern"]),"background-opacity":new A(me.paint_background["background-opacity"])})},T_={paint:new V({"raster-opacity":new A(me.paint_raster["raster-opacity"]),"raster-hue-rotate":new A(me.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new A(me.paint_raster["raster-brightness-min"]),"raster-brightness-max":new A(me.paint_raster["raster-brightness-max"]),"raster-saturation":new A(me.paint_raster["raster-saturation"]),"raster-contrast":new A(me.paint_raster["raster-contrast"]),"raster-resampling":new A(me.paint_raster["raster-resampling"]),"raster-fade-duration":new A(me.paint_raster["raster-fade-duration"])})};class E_ extends no{constructor(e){super(e,{}),this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}isLayerDraped(){return this.implementation.renderToTile!==void 0}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(e){this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)}onRemove(e){this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)}}var k_={paint:new V({"sky-type":new A(me.paint_sky["sky-type"]),"sky-atmosphere-sun":new A(me.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new A(me.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new A(me.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new A(me.paint_sky["sky-gradient-radius"]),"sky-gradient":new N(me.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new A(me.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new A(me.paint_sky["sky-atmosphere-color"]),"sky-opacity":new A(me.paint_sky["sky-opacity"])})};function ap(t,e,r){const o=[0,0,1],a=Up([]);return Np(a,a,r?-lt(t)+Math.PI:lt(t)),jp(a,a,-lt(e)),Rp(o,o,a),ti(o,o)}const S_={circle:class extends no{constructor(t){super(t,Ff)}createBucket(t){return new Pu(t)}queryRadius(t){const e=t;return ws("circle-radius",this,e)+ws("circle-stroke-width",this,e)+dh(this.paint.get("circle-translate"))}queryIntersectsFeature(t,e,r,o,a,c,u,d){const f=cd(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),c.angle,t.pixelToTileUnitsFactor),g=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r);return hd(t,o,c,u,d,this.paint.get("circle-pitch-alignment")==="map",this.paint.get("circle-pitch-scale")==="map",f,g)}getProgramIds(){return["circle"]}getProgramConfiguration(t){return new In(this,t)}},heatmap:class extends no{createBucket(t){return new pd(t)}constructor(t){super(t,Nf),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){t==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Bu({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(t){return ws("heatmap-radius",this,t)}queryIntersectsFeature(t,e,r,o,a,c,u,d){const f=this.paint.get("heatmap-radius").evaluate(e,r);return hd(t,o,c,u,d,!0,!0,new De(0,0),f)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}getProgramIds(){return["heatmap","heatmapTexture"]}getProgramConfiguration(t){return new In(this,t)}},hillshade:class extends no{constructor(t){super(t,Vf)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}getProgramIds(){return["hillshade","hillshadePrepare"]}},fill:class extends no{constructor(t){super(t,og)}getProgramIds(){const t=this.paint.get("fill-pattern"),e=t&&t.constantOr(1),r=[e?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&r.push(e&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),r}getProgramConfiguration(t){return new In(this,t)}recalculate(t,e){super.recalculate(t,e);const r=this.paint._values["fill-outline-color"];r.value.kind==="constant"&&r.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new yh(t)}queryRadius(){return dh(this.paint.get("fill-translate"))}queryIntersectsFeature(t,e,r,o,a,c){return!t.queryGeometry.isAboveHorizon&&od(ld(t.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),c.angle,t.pixelToTileUnitsFactor),o)}isTileClipped(){return!0}},"fill-extrusion":class extends no{constructor(t){super(t,vg)}createBucket(t){return new Hl(t)}queryRadius(){return dh(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}getProgramConfiguration(t){return new In(this,t)}queryIntersectsFeature(t,e,r,o,a,c,u,d,f){const g=cd(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),c.angle,t.pixelToTileUnitsFactor),x=this.paint.get("fill-extrusion-height").evaluate(e,r),w=this.paint.get("fill-extrusion-base").evaluate(e,r),b=[0,0],k=d&&c.elevation,S=c.elevation?c.elevation.exaggeration():1,I=t.tile.getBucket(this);if(k&&I instanceof Hl){const $=I.centroidVertexArray,W=f+1;W<$.length&&(b[0]=$.geta_centroid_pos0(W),b[1]=$.geta_centroid_pos1(W))}if(b[0]===0&&b[1]===1)return!1;c.projection.name==="globe"&&(o=Cd([o],[new De(0,0),new De(Xe,Xe)],t.tileID.canonical).map($=>$.polygon).flat());const D=k?d:null,[U,Z]=function($,W,X,ce,ae,fe,ke,ue,ye,xe,be){return $.projection.name==="globe"?function(Ie,de,Le,Ne,Re,et,Ce,Ze,tt,Et,rt){const Ye=[],Wt=[],at=Ie.projection.upVectorScale(rt,Ie.center.lat,Ie.worldSize).metersToTile,st=[0,0,0,1],Ut=[0,0,0,1],$t=(jt,nr,cr,yr)=>{jt[0]=nr,jt[1]=cr,jt[2]=yr,jt[3]=1},qt=Id();Le>0&&(Le+=qt),Ne+=qt;for(const jt of de){const nr=[],cr=[];for(const yr of jt){const Nt=yr.x+Re.x,Er=yr.y+Re.y,xr=Ie.projection.projectTilePoint(Nt,Er,rt),ar=Ie.projection.upVector(rt,yr.x,yr.y);let St=Le,vr=Ne;if(Ce){const Zt=Ld(Nt,Er,Le,Ne,Ce,Ze,tt,Et);St+=Zt.base,vr+=Zt.top}Le!==0?$t(st,xr.x+ar[0]*at*St,xr.y+ar[1]*at*St,xr.z+ar[2]*at*St):$t(st,xr.x,xr.y,xr.z),$t(Ut,xr.x+ar[0]*at*vr,xr.y+ar[1]*at*vr,xr.z+ar[2]*at*vr),pr(st,st,et),pr(Ut,Ut,et),nr.push(new Es(st[0],st[1],st[2])),cr.push(new Es(Ut[0],Ut[1],Ut[2]))}Ye.push(nr),Wt.push(cr)}return[Ye,Wt]}($,W,X,ce,ae,fe,ke,ue,ye,xe,be):ke?function(Ie,de,Le,Ne,Re,et,Ce,Ze,tt){const Et=[],rt=[],Ye=[0,0,0,1];for(const Wt of Ie){const at=[],st=[];for(const Ut of Wt){const $t=Ut.x+Ne.x,qt=Ut.y+Ne.y,jt=Ld($t,qt,de,Le,et,Ce,Ze,tt);Ye[0]=$t,Ye[1]=qt,Ye[2]=jt.base,Ye[3]=1,Ta(Ye,Ye,Re),Ye[3]=Math.max(Ye[3],1e-5);const nr=new Es(Ye[0]/Ye[3],Ye[1]/Ye[3],Ye[2]/Ye[3]);Ye[0]=$t,Ye[1]=qt,Ye[2]=jt.top,Ye[3]=1,Ta(Ye,Ye,Re),Ye[3]=Math.max(Ye[3],1e-5);const cr=new Es(Ye[0]/Ye[3],Ye[1]/Ye[3],Ye[2]/Ye[3]);at.push(nr),st.push(cr)}Et.push(at),rt.push(st)}return[Et,rt]}(W,X,ce,ae,fe,ke,ue,ye,xe):function(Ie,de,Le,Ne,Re){const et=[],Ce=[],Ze=Re[8]*de,tt=Re[9]*de,Et=Re[10]*de,rt=Re[11]*de,Ye=Re[8]*Le,Wt=Re[9]*Le,at=Re[10]*Le,st=Re[11]*Le;for(const Ut of Ie){const $t=[],qt=[];for(const jt of Ut){const nr=jt.x+Ne.x,cr=jt.y+Ne.y,yr=Re[0]*nr+Re[4]*cr+Re[12],Nt=Re[1]*nr+Re[5]*cr+Re[13],Er=Re[2]*nr+Re[6]*cr+Re[14],xr=Re[3]*nr+Re[7]*cr+Re[15],ar=yr+Ze,St=Nt+tt,vr=Er+Et,Zt=Math.max(xr+rt,1e-5),oi=yr+Ye,wr=Nt+Wt,Or=Er+at,zr=Math.max(xr+st,1e-5);$t.push(new Es(ar/Zt,St/Zt,vr/Zt)),qt.push(new Es(oi/zr,wr/zr,Or/zr))}et.push($t),Ce.push(qt)}return[et,Ce]}(W,X,ce,ae,fe)}(c,o,w,x,g,u,D,b,S,c.center.lat,t.tileID.canonical),j=t.queryGeometry;return function($,W,X){let ce=1/0;od(X,W)&&(ce=Dd(X,W[0]));for(let ae=0;ae<W.length;ae++){const fe=W[ae],ke=$[ae];for(let ue=0;ue<fe.length-1;ue++){const ye=fe[ue],xe=[ye,fe[ue+1],ke[ue+1],ke[ue],ye];id(X,xe)&&(ce=Math.min(ce,Dd(X,xe)))}}return ce!==1/0&&ce}(U,Z,j.isPointQuery()?j.screenBounds:j.screenGeometry)}},line:class extends no{constructor(t){super(t,Rd),this.gradientVersion=0}_handleSpecialPaintPropertyUpdate(t){if(t==="line-gradient"){const e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=e._styleExpression&&e._styleExpression.expression instanceof rl,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}widthExpression(){return this._transitionablePaint._values["line-width"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=Bd.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new Th(t)}getProgramIds(){return[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"]}getProgramConfiguration(t){return new In(this,t)}queryRadius(t){const e=t,r=Fd(ws("line-width",this,e),ws("line-gap-width",this,e)),o=ws("line-offset",this,e);return r/2+Math.abs(o)+dh(this.paint.get("line-translate"))}queryIntersectsFeature(t,e,r,o,a,c){if(t.queryGeometry.isAboveHorizon)return!1;const u=ld(t.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),c.angle,t.pixelToTileUnitsFactor),d=t.pixelToTileUnitsFactor/2*Fd(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),f=this.paint.get("line-offset").evaluate(e,r);return f&&(o=function(g,x){const w=[],b=new De(0,0);for(let k=0;k<g.length;k++){const S=g[k],I=[];for(let D=0;D<S.length;D++){const U=S[D],Z=S[D+1],j=D===0?b:U.sub(S[D-1])._unit()._perp(),$=D===S.length-1?b:Z.sub(U)._unit()._perp(),W=j._add($)._unit();W._mult(1/(W.x*$.x+W.y*$.y)),I.push(W._mult(x)._add(U))}w.push(I)}return w}(o,f*t.pixelToTileUnitsFactor)),function(g,x,w){for(let b=0;b<x.length;b++){const k=x[b];if(g.length>=3){for(let S=0;S<k.length;S++)if(Ma(g,k[S]))return!0}if(Df(g,k,w))return!0}return!1}(u,o,d)}isTileClipped(){return!0}},symbol:Fh,background:class extends no{constructor(t){super(t,b_)}getProgramIds(){return[this.paint.get("background-pattern")?"backgroundPattern":"background"]}},raster:class extends no{constructor(t){super(t,T_)}getProgramIds(){return["raster"]}},sky:class extends no{constructor(t){super(t,k_),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){t==="sky-gradient"?this._updateColorRamp():t!=="sky-atmosphere-sun"&&t!=="sky-atmosphere-halo-color"&&t!=="sky-atmosphere-color"&&t!=="sky-atmosphere-sun-intensity"||(this._skyboxInvalidated=!0)}_updateColorRamp(){this.colorRamp=Bu({expression:this._transitionablePaint._values["sky-gradient"].value.expression,evaluationKey:"skyRadialProgress"}),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}needsSkyboxCapture(t){if(this._skyboxInvalidated||!this.skyboxTexture||!this.skyboxGeometry)return!0;if(!this.paint.get("sky-atmosphere-sun")){const e=t.style.light.properties.get("position");return this._lightPosition.azimuthal!==e.azimuthal||this._lightPosition.polar!==e.polar}return!1}getCenter(t,e){if(this.paint.get("sky-type")==="atmosphere"){const o=this.paint.get("sky-atmosphere-sun"),a=!o,c=t.style.light,u=c.properties.get("position");return a&&c.properties.get("anchor")==="viewport"&&ir("The sun direction is attached to a light with viewport anchor, lighting may behave unexpectedly."),a?ap(u.azimuthal,90-u.polar,e):ap(o[0],90-o[1],e)}const r=this.paint.get("sky-gradient-center");return ap(r[0],90-r[1],e)}is3D(){return!1}isSky(){return!0}markSkyboxValid(t){this._skyboxInvalidated=!1,this._lightPosition=t.style.light.properties.get("position")}hasOffscreenPass(){return!0}getProgramIds(){const t=this.paint.get("sky-type");return t==="atmosphere"?["skyboxCapture","skybox"]:t==="gradient"?["skyboxGradient"]:null}}};class sc{constructor(e,r,o,a){this.context=e,this.format=o,this.texture=e.gl.createTexture(),this.update(r,a)}update(e,r,o){const{width:a,height:c}=e,{context:u}=this,{gl:d}=u,{HTMLImageElement:f,HTMLCanvasElement:g,HTMLVideoElement:x,ImageData:w,ImageBitmap:b}=ve;if(d.bindTexture(d.TEXTURE_2D,this.texture),u.pixelStoreUnpackFlipY.set(!1),u.pixelStoreUnpack.set(1),u.pixelStoreUnpackPremultiplyAlpha.set(this.format===d.RGBA&&(!r||r.premultiply!==!1)),o||this.size&&this.size[0]===a&&this.size[1]===c){const{x:k,y:S}=o||{x:0,y:0};e instanceof f||e instanceof g||e instanceof x||e instanceof w||b&&e instanceof b?d.texSubImage2D(d.TEXTURE_2D,0,k,S,d.RGBA,d.UNSIGNED_BYTE,e):d.texSubImage2D(d.TEXTURE_2D,0,k,S,a,c,d.RGBA,d.UNSIGNED_BYTE,e.data)}else this.size=[a,c],e instanceof f||e instanceof g||e instanceof x||e instanceof w||b&&e instanceof b?d.texImage2D(d.TEXTURE_2D,0,this.format,this.format,d.UNSIGNED_BYTE,e):d.texImage2D(d.TEXTURE_2D,0,this.format,a,c,0,this.format,d.UNSIGNED_BYTE,e.data);this.useMipmap=!!(r&&r.useMipmap&&this.isSizePowerOfTwo()),this.useMipmap&&d.generateMipmap(d.TEXTURE_2D)}bind(e,r){const{context:o}=this,{gl:a}=o;a.bindTexture(a.TEXTURE_2D,this.texture),e!==this.filter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,e),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,this.useMipmap?e===a.NEAREST?a.NEAREST_MIPMAP_NEAREST:a.LINEAR_MIPMAP_NEAREST:e),this.filter=e),r!==this.wrap&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,r),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,r),this.wrap=r)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}class M_{constructor(e){this._callback=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){this._channel=void 0,this._callback=()=>{}}}class A_{constructor(){this.tasks={},this.taskQueue=[],Po(["process"],this),this.invoker=new M_(this.process),this.nextId=0}add(e,r){const o=this.nextId++,a=function({type:c,isSymbolTile:u,zoom:d}){return d=d||0,c==="message"?0:c!=="maybePrepare"||u?c!=="parseTile"||u?c==="parseTile"&&u?300-d:c==="maybePrepare"&&u?400-d:500:200-d:100-d}(r);if(a===0){Zi();try{e()}finally{}return{cancel:()=>{}}}return this.tasks[o]={fn:e,metadata:r,priority:a,id:o},this.taskQueue.push(o),this.invoker.trigger(),{cancel:()=>{delete this.tasks[o]}}}process(){Zi();try{if(this.taskQueue=this.taskQueue.filter(o=>!!this.tasks[o]),!this.taskQueue.length)return;const e=this.pick();if(e===null)return;const r=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),!r)return;r.fn()}finally{}}pick(){let e=null,r=1/0;for(let a=0;a<this.taskQueue.length;a++){const c=this.tasks[this.taskQueue[a]];c.priority<r&&(r=c.priority,e=a)}if(e===null)return null;const o=this.taskQueue[e];return this.taskQueue.splice(e,1),o}remove(){this.invoker.remove()}}class wm{constructor(e){this._stringToNumber={},this._numberToString=[];for(let r=0;r<e.length;r++){const o=e[r];this._stringToNumber[o]=r,this._numberToString[r]=o}}encode(e){return this._stringToNumber[e]}decode(e){return this._numberToString[e]}}const I_=["tile","layer","source","sourceLayer","state"];class bm{constructor(e,r,o,a,c){this.type="Feature",this._vectorTileFeature=e,this._z=r,this._x=o,this._y=a,this.properties=e.properties,this.id=c}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._x,this._y,this._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={type:"Feature",state:void 0,geometry:this.geometry,properties:this.properties};this.id!==void 0&&(e.id=this.id);for(const r of I_)this[r]!==void 0&&(e[r]=this[r]);return e}}const Gi=32,Ao=33,Rn=new Uint16Array(8184);for(let t=0;t<2046;t++){let e=t+2,r=0,o=0,a=0,c=0,u=0,d=0;for(1&e?a=c=u=Gi:r=o=d=Gi;(e>>=1)>1;){const g=r+a>>1,x=o+c>>1;1&e?(a=r,c=o,r=u,o=d):(r=a,o=c,a=u,c=d),u=g,d=x}const f=4*t;Rn[f+0]=r,Rn[f+1]=o,Rn[f+2]=a,Rn[f+3]=c}const Io=new Uint16Array(2178),Bn=new Uint8Array(1089),Oh=new Uint16Array(1089);function Tm(t){return t===0?-.03125:t===32?.03125:0}var Em=te([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);const km={type:2,extent:Xe,loadGeometry:()=>[[new De(0,0),new De(Xe+1,0),new De(Xe+1,Xe+1),new De(0,Xe+1),new De(0,0)]]};class sp{constructor(e,r,o,a,c){this.tileID=e,this.uid=tn(),this.uses=0,this.tileSize=r,this.tileZoom=o,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=c,this.expiredRequestCount=0,this.state="loading",a&&a.transform&&(this.projection=a.transform.projection)}registerFadeDuration(e){const r=e+this.timeAdded;r<Xi.now()||this.fadeEndTime&&r<this.fadeEndTime||(this.fadeEndTime=r)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}get tileTransform(){return this._tileTransform||(this._tileTransform=Ia(this.tileID.canonical,this.projection)),this._tileTransform}loadVectorData(e,r,o){if(this.unloadVectorData(),this.state="loaded",e){e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=function(a,c){const u={};if(!c)return u;for(const d of a){const f=d.layerIds.map(g=>c.getLayer(g)).filter(Boolean);if(f.length!==0){d.layers=f,d.stateDependentLayerIds&&(d.stateDependentLayers=d.stateDependentLayerIds.map(g=>f.filter(x=>x.id===g)[0]));for(const g of f)u[g.id]=d}}return u}(e.buckets,r.style),this.hasSymbolBuckets=!1;for(const a in this.buckets){const c=this.buckets[a];if(c instanceof Ln){if(this.hasSymbolBuckets=!0,!o)break;c.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const a in this.buckets){const c=this.buckets[a];if(c instanceof Ln&&c.hasRTLText){this.hasRTLText=!0,y.isLoading()||y.isLoaded()||m()!=="deferred"||_();break}}this.queryPadding=0;for(const a in this.buckets){const c=this.buckets[a];this.queryPadding=Math.max(this.queryPadding,r.style.getLayer(a).queryRadius(c))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),e.lineAtlas&&(this.lineAtlas=e.lineAtlas)}else this.collisionBoxArray=new Ft}unloadVectorData(){if(this.hasData()){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}getBucket(e){return this.buckets[e.id]}upload(e){for(const o in this.buckets){const a=this.buckets[o];a.uploadPending()&&a.upload(e)}const r=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new sc(e,this.imageAtlas.image,r.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new sc(e,this.glyphAtlasImage,r.ALPHA),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new sc(e,this.lineAtlas.image,r.ALPHA),this.lineAtlas.uploaded=!0)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,r,o,a,c,u,d,f){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({tileResult:a,pixelPosMatrix:d,transform:u,params:c,tileTransform:this.tileTransform},e,r,o):{}}querySourceFeatures(e,r){const o=this.latestFeatureIndex;if(!o||!o.rawTileData)return;const a=o.loadVTLayers(),c=r?r.sourceLayer:"",u=a._geojsonTileLayer||a[c];if(!u)return;const d=cs(r&&r.filter),{z:f,x:g,y:x}=this.tileID.canonical,w={z:f,x:g,y:x};for(let b=0;b<u.length;b++){const k=u.feature(b);if(d.needGeometry){const D=Sa(k,!0);if(!d.filter(new v(this.tileID.overscaledZ),D,this.tileID.canonical))continue}else if(!d.filter(new v(this.tileID.overscaledZ),k))continue;const S=o.getId(k,c),I=new bm(k,f,g,x,S);I.tile=w,e.push(I)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return!!this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){const r=this.expirationTime;if(e.cacheControl){const o=li(e.cacheControl);o["max-age"]&&(this.expirationTime=Date.now()+1e3*o["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){const o=Date.now();let a=!1;if(this.expirationTime>o)a=!1;else if(r)if(this.expirationTime<r)a=!0;else{const c=this.expirationTime-r;c?this.expirationTime=o+Math.max(c,3e4):a=!0}else a=!0;a?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)}setFeatureState(e,r){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(e).length===0||!r)return;const o=this.latestFeatureIndex.loadVTLayers(),a=r.style.listImages();for(const c in this.buckets){if(!r.style.hasLayer(c))continue;const u=this.buckets[c],d=u.layers[0].sourceLayer||"_geojsonTileLayer",f=o[d],g=e[d];if(!f||!g||Object.keys(g).length===0)continue;if(u.update(g,f,a,this.imageAtlas&&this.imageAtlas.patternPositions||{}),u instanceof Th||u instanceof yh){const w=r.style._getSourceCache(u.layers[0].source);r._terrain&&r._terrain.enabled&&w&&u.programConfigurations.needsUpload&&r._terrain._clearRenderCacheForTile(w.id,this.tileID)}const x=r&&r.style&&r.style.getLayer(c);x&&(this.queryPadding=Math.max(this.queryPadding,x.queryRadius(u)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Xi.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(e){this.symbolFadeHoldUntil=Xi.now()+e}setTexture(e,r){const o=r.context,a=o.gl;this.texture=this.texture||r.getTileTexture(e.width),this.texture?this.texture.update(e,{useMipmap:!0}):(this.texture=new sc(o,e,a.RGBA,{useMipmap:!0}),this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE))}setDependencies(e,r){const o={};for(const a of r)o[a]=!0;this.dependencies[e]=o}hasDependency(e,r){for(const o of e){const a=this.dependencies[o];if(a){for(const c of r)if(a[c])return!0}}return!1}clearQueryDebugViz(){}_makeDebugTileBoundsBuffers(e,r){if(!r||r.name==="mercator"||this._tileDebugBuffer)return;const o=Ko(km,this.tileID.canonical,this.tileTransform)[0],a=new Ee,c=new xi;for(let u=0;u<o.length;u++){const{x:d,y:f}=o[u];a.emplaceBack(d,f),c.emplaceBack(u)}c.emplaceBack(0),this._tileDebugIndexBuffer=e.createIndexBuffer(c),this._tileDebugBuffer=e.createVertexBuffer(a,Ul.members),this._tileDebugSegments=gr.simpleSegment(0,0,a.length,c.length)}_makeTileBoundsBuffers(e,r){if(this._tileBoundsBuffer||!r||r.name==="mercator")return;const o=Ko(km,this.tileID.canonical,this.tileTransform)[0];let a,c;if(this.isRaster){const u=function(d,f){const g=Ia(d,f),x=Math.pow(2,d.z);for(let D=0;D<Ao;D++)for(let U=0;U<Ao;U++){const Z=Ci((d.x+(U+Tm(U))/Gi)/x),j=$r((d.y+(D+Tm(D))/Gi)/x),$=f.project(Z,j),W=D*Ao+U;Io[2*W+0]=Math.round(($.x*g.scale-g.x)*Xe),Io[2*W+1]=Math.round(($.y*g.scale-g.y)*Xe)}Bn.fill(0),Oh.fill(0);for(let D=2045;D>=0;D--){const U=4*D,Z=Rn[U+0],j=Rn[U+1],$=Rn[U+2],W=Rn[U+3],X=Z+$>>1,ce=j+W>>1,ae=X+ce-j,fe=ce+Z-X,ke=j*Ao+Z,ue=W*Ao+$,ye=ce*Ao+X,xe=Math.hypot((Io[2*ke+0]+Io[2*ue+0])/2-Io[2*ye+0],(Io[2*ke+1]+Io[2*ue+1])/2-Io[2*ye+1])>=16;Bn[ye]=Bn[ye]||(xe?1:0),D<1022&&(Bn[ye]=Bn[ye]||Bn[(j+fe>>1)*Ao+(Z+ae>>1)]||Bn[(W+fe>>1)*Ao+($+ae>>1)])}const w=new _e,b=new $e;let k=0;function S(D,U){const Z=U*Ao+D;return Oh[Z]===0&&(w.emplaceBack(Io[2*Z+0],Io[2*Z+1],D*Xe/Gi,U*Xe/Gi),Oh[Z]=++k),Oh[Z]-1}function I(D,U,Z,j,$,W){const X=D+Z>>1,ce=U+j>>1;if(Math.abs(D-$)+Math.abs(U-W)>1&&Bn[ce*Ao+X])I($,W,D,U,X,ce),I(Z,j,$,W,X,ce);else{const ae=S(D,U),fe=S(Z,j),ke=S($,W);b.emplaceBack(ae,fe,ke)}}return I(0,0,Gi,Gi,Gi,0),I(Gi,Gi,0,0,0,Gi),{vertices:w,indices:b}}(this.tileID.canonical,r);a=u.vertices,c=u.indices}else{a=new _e,c=new $e;for(const{x:d,y:f}of o)a.emplaceBack(d,f,0,0);const u=Nu(a.int16,void 0,4);for(let d=0;d<u.length;d+=3)c.emplaceBack(u[d],u[d+1],u[d+2])}this._tileBoundsBuffer=e.createVertexBuffer(a,Em.members),this._tileBoundsIndexBuffer=e.createIndexBuffer(c),this._tileBoundsSegments=gr.simpleSegment(0,0,a.length,c.length)}_makeGlobeTileDebugBuffers(e,r){const o=r.projection;if(!o||o.name!=="globe"||r.freezeTileCoverage)return;const a=this.tileID.canonical,c=Vl(Zp(a,r)),u=xs(r.zoom);let d;u>0&&(d=fu(new Float64Array(16),r.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(e,a,r,c,d,u),this._makeGlobeTileDebugTextBuffer(e,a,r,c,d,u)}_globePoint(e,r,o,a,c,u,d){let f=Nl(e,r,o);if(u){const g=1<<o.z,x=So(a.center.lng),w=Mo(a.center.lat),b=(o.x+.5)/g-x;let k=0;b>.5?k=-1:b<-.5&&(k=1);let S=(e/Xe+o.x)/g+k,I=(r/Xe+o.y)/g;S=(S-x)*a._pixelsPerMercatorPixel+x,I=(I-w)*a._pixelsPerMercatorPixel+w;const D=[S*a.worldSize,I*a.worldSize,0];pr(D,D,u),f=ka(f,D,d)}return pr(f,f,c)}_makeGlobeTileDebugBorderBuffer(e,r,o,a,c,u){const d=new Ee,f=new xi,g=new ne,x=(b,k,S,I,D)=>{const U=(S-b)/(D-1),Z=(I-k)/(D-1),j=d.length;for(let $=0;$<D;$++){const W=b+$*U,X=k+$*Z;d.emplaceBack(W,X);const ce=this._globePoint(W,X,r,o,a,c,u);g.emplaceBack(ce[0],ce[1],ce[2]),f.emplaceBack(j+$)}},w=Xe;x(0,0,w,0,16),x(w,0,w,w,16),x(w,w,0,w,16),x(0,w,0,0,16),this._tileDebugIndexBuffer=e.createIndexBuffer(f),this._tileDebugBuffer=e.createVertexBuffer(d,Ul.members),this._globeTileDebugBorderBuffer=e.createVertexBuffer(g,Gp.members),this._tileDebugSegments=gr.simpleSegment(0,0,d.length,f.length)}_makeGlobeTileDebugTextBuffer(e,r,o,a,c,u){const d=Xe/4,f=new Ee,g=new $e,x=new ne,w=25;g.reserve(32),f.reserve(w),x.reserve(w);const b=(k,S)=>w*k+S;for(let k=0;k<w;k++){const S=k*d;for(let I=0;I<w;I++){const D=I*d;f.emplaceBack(D,S);const U=this._globePoint(D,S,r,o,a,c,u);x.emplaceBack(U[0],U[1],U[2])}}for(let k=0;k<4;k++)for(let S=0;S<4;S++){const I=b(k,S),D=b(k,S+1),U=b(k+1,S),Z=b(k+1,S+1);g.emplaceBack(I,D,U),g.emplaceBack(U,D,Z)}this._tileDebugTextIndexBuffer=e.createIndexBuffer(g),this._tileDebugTextBuffer=e.createVertexBuffer(f,Ul.members),this._globeTileDebugTextBuffer=e.createVertexBuffer(x,Gp.members),this._tileDebugTextSegments=gr.simpleSegment(0,0,w,32)}}class C_{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,r,o){const a=String(r);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][a]=this.stateChanges[e][a]||{},sr(this.stateChanges[e][a],o),this.deletedStates[e]===null){this.deletedStates[e]={};for(const c in this.state[e])c!==a&&(this.deletedStates[e][c]=null)}else if(this.deletedStates[e]&&this.deletedStates[e][a]===null){this.deletedStates[e][a]={};for(const c in this.state[e][a])o[c]||(this.deletedStates[e][a][c]=null)}else for(const c in o)this.deletedStates[e]&&this.deletedStates[e][a]&&this.deletedStates[e][a][c]===null&&delete this.deletedStates[e][a][c]}removeFeatureState(e,r,o){if(this.deletedStates[e]===null)return;const a=String(r);if(this.deletedStates[e]=this.deletedStates[e]||{},o&&r!==void 0)this.deletedStates[e][a]!==null&&(this.deletedStates[e][a]=this.deletedStates[e][a]||{},this.deletedStates[e][a][o]=null);else if(r!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][a])for(o in this.deletedStates[e][a]={},this.stateChanges[e][a])this.deletedStates[e][a][o]=null;else this.deletedStates[e][a]=null;else this.deletedStates[e]=null}getState(e,r){const o=String(r),a=sr({},(this.state[e]||{})[o],(this.stateChanges[e]||{})[o]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){const c=this.deletedStates[e][r];if(c===null)return{};for(const u in c)delete a[u]}return a}initializeTileState(e,r){e.setFeatureState(this.state,r)}coalesceChanges(e,r){const o={};for(const a in this.stateChanges){this.state[a]=this.state[a]||{};const c={};for(const u in this.stateChanges[a])this.state[a][u]||(this.state[a][u]={}),sr(this.state[a][u],this.stateChanges[a][u]),c[u]=this.state[a][u];o[a]=c}for(const a in this.deletedStates){this.state[a]=this.state[a]||{};const c={};if(this.deletedStates[a]===null)for(const u in this.state[a])c[u]={},this.state[a][u]={};else for(const u in this.deletedStates[a]){if(this.deletedStates[a][u]===null)this.state[a][u]={};else if(this.state[a][u])for(const d of Object.keys(this.deletedStates[a][u]))delete this.state[a][u][d];c[u]=this.state[a][u]}o[a]=o[a]||{},sr(o[a],c)}if(this.stateChanges={},this.deletedStates={},Object.keys(o).length!==0)for(const a in e)e[a].setFeatureState(o,r)}}class Sm{constructor(e){this.size=e,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(e,r){const o=this.toIdx(e,r);return{min:this.minimums[o],max:this.maximums[o]}}isLeaf(e,r){return this.leaves[this.toIdx(e,r)]}toIdx(e,r){return r*this.size+e}}function Mm(t,e,r,o){let a=0,c=Number.MAX_VALUE;for(let u=0;u<3;u++)if(Math.abs(o[u])<1e-15){if(r[u]<t[u]||r[u]>e[u])return null}else{const d=1/o[u];let f=(t[u]-r[u])*d,g=(e[u]-r[u])*d;if(f>g){const x=f;f=g,g=x}if(f>a&&(a=f),g<c&&(c=g),a>c)return null}return a}function Am(t,e,r,o,a,c,u,d,f,g,x){const w=o-t,b=a-e,k=c-r,S=u-t,I=d-e,D=f-r,U=x[1]*D-x[2]*I,Z=x[2]*S-x[0]*D,j=x[0]*I-x[1]*S,$=w*U+b*Z+k*j;if(Math.abs($)<1e-15)return null;const W=1/$,X=g[0]-t,ce=g[1]-e,ae=g[2]-r,fe=(X*U+ce*Z+ae*j)*W;if(fe<0||fe>1)return null;const ke=ce*k-ae*b,ue=ae*w-X*k,ye=X*b-ce*w,xe=(x[0]*ke+x[1]*ue+x[2]*ye)*W;return xe<0||fe+xe>1?null:(S*ke+I*ue+D*ye)*W}function Im(t,e,r){return(t-e)/(r-e)}function Cm(t,e,r,o,a,c,u,d,f){const g=1<<r,x=c-o,w=u-a,b=(t+1)/g*x+o,k=(e+0)/g*w+a,S=(e+1)/g*w+a;d[0]=(t+0)/g*x+o,d[1]=k,f[0]=b,f[1]=S}class zm{constructor(e){if(this.maximums=[],this.minimums=[],this.leaves=[],this.childOffsets=[],this.nodeCount=0,this.dem=e,this._siblingOffset=[[0,0],[1,0],[0,1],[1,1]],!this.dem)return;const r=function(c){const u=Math.ceil(Math.log2(c.dim/8)),d=[];let f=Math.ceil(Math.pow(2,u));const g=1/f,x=(k,S,I,D,U)=>{const Z=D?1:0,j=(k+1)*I-Z,$=S*I,W=(S+1)*I-Z;U[0]=k*I,U[1]=$,U[2]=j,U[3]=W};let w=new Sm(f);const b=[];for(let k=0;k<f*f;k++){x(k%f,Math.floor(k/f),g,!1,b);const S=Fn(b[0],b[1],c),I=Fn(b[2],b[1],c),D=Fn(b[2],b[3],c),U=Fn(b[0],b[3],c);w.minimums.push(Math.min(S,I,D,U)),w.maximums.push(Math.max(S,I,D,U)),w.leaves.push(1)}for(d.push(w),f/=2;f>=1;f/=2){const k=d[d.length-1];w=new Sm(f);for(let S=0;S<f*f;S++){x(S%f,Math.floor(S/f),2,!0,b);const I=k.getElevation(b[0],b[1]),D=k.getElevation(b[2],b[1]),U=k.getElevation(b[2],b[3]),Z=k.getElevation(b[0],b[3]),j=k.isLeaf(b[0],b[1]),$=k.isLeaf(b[2],b[1]),W=k.isLeaf(b[2],b[3]),X=k.isLeaf(b[0],b[3]),ce=Math.min(I.min,D.min,U.min,Z.min),ae=Math.max(I.max,D.max,U.max,Z.max),fe=j&&$&&W&&X;w.maximums.push(ae),w.minimums.push(ce),w.leaves.push(ae-ce<=5&&fe?1:0)}d.push(w)}return d}(this.dem),o=r.length-1,a=r[o];this._addNode(a.minimums[0],a.maximums[0],a.leaves[0]),this._construct(r,0,0,o,0)}raycastRoot(e,r,o,a,c,u,d=1){return Mm([e,r,-100],[o,a,this.maximums[0]*d],c,u)}raycast(e,r,o,a,c,u,d=1){if(!this.nodeCount)return null;const f=this.raycastRoot(e,r,o,a,c,u,d);if(f==null)return null;const g=[],x=[],w=[],b=[],k=[{idx:0,t:f,nodex:0,nodey:0,depth:0}];for(;k.length>0;){const{idx:S,t:I,nodex:D,nodey:U,depth:Z}=k.pop();if(this.leaves[S]){Cm(D,U,Z,e,r,o,a,w,b);const $=1<<Z,W=(D+0)/$,X=(D+1)/$,ce=(U+0)/$,ae=(U+1)/$,fe=Fn(W,ce,this.dem)*d,ke=Fn(X,ce,this.dem)*d,ue=Fn(X,ae,this.dem)*d,ye=Fn(W,ae,this.dem)*d,xe=Am(w[0],w[1],fe,b[0],w[1],ke,b[0],b[1],ue,c,u),be=Am(b[0],b[1],ue,w[0],b[1],ye,w[0],w[1],fe,c,u),Ie=Math.min(xe!==null?xe:Number.MAX_VALUE,be!==null?be:Number.MAX_VALUE);if(Ie!==Number.MAX_VALUE)return Ie;{const de=Fl([],c,u,I);if(Pm(fe,ke,ye,ue,Im(de[0],w[0],b[0]),Im(de[1],w[1],b[1]))>=de[2])return I}continue}let j=0;for(let $=0;$<this._siblingOffset.length;$++){Cm((D<<1)+this._siblingOffset[$][0],(U<<1)+this._siblingOffset[$][1],Z+1,e,r,o,a,w,b),w[2]=-100,b[2]=this.maximums[this.childOffsets[S]+$]*d;const W=Mm(w,b,c,u);if(W!=null){const X=W;g[$]=X;let ce=!1;for(let ae=0;ae<j&&!ce;ae++)X>=g[x[ae]]&&(x.splice(ae,0,$),ce=!0);ce||(x[j]=$),j++}}for(let $=0;$<j;$++){const W=x[$];k.push({idx:this.childOffsets[S]+W,t:g[W],nodex:(D<<1)+this._siblingOffset[W][0],nodey:(U<<1)+this._siblingOffset[W][1],depth:Z+1})}}return null}_addNode(e,r,o){return this.minimums.push(e),this.maximums.push(r),this.leaves.push(o),this.childOffsets.push(0),this.nodeCount++}_construct(e,r,o,a,c){if(e[a].isLeaf(r,o)===1)return;this.childOffsets[c]||(this.childOffsets[c]=this.nodeCount);const u=a-1,d=e[u];let f=0,g=0;for(let x=0;x<this._siblingOffset.length;x++){const w=2*r+this._siblingOffset[x][0],b=2*o+this._siblingOffset[x][1],k=d.getElevation(w,b),S=d.isLeaf(w,b),I=this._addNode(k.min,k.max,S);S&&(f|=1<<x),g||(g=I)}for(let x=0;x<this._siblingOffset.length;x++)f&1<<x||this._construct(e,2*r+this._siblingOffset[x][0],2*o+this._siblingOffset[x][1],u,g+x)}}function Pm(t,e,r,o,a,c){return bt(bt(t,r,c),bt(e,o,c),a)}function Fn(t,e,r){const o=r.dim,a=it(t*o-.5,0,o-1),c=it(e*o-.5,0,o-1),u=Math.floor(a),d=Math.floor(c),f=Math.min(u+1,o-1),g=Math.min(d+1,o-1);return Pm(r.get(u,d),r.get(f,d),r.get(u,g),r.get(f,g),a-u,c-d)}const Dm={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};function z_(t,e,r){return(256*t*256+256*e+r)/10-1e4}function P_(t,e,r){return 256*t+e+r/256-32768}class Uh{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(e,r,o,a=!1,c=!1){if(this.uid=e,r.height!==r.width)throw new RangeError("DEM tiles must be square");if(o&&o!=="mapbox"&&o!=="terrarium")return ir(`"${o}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=r.height;const u=this.dim=r.height-2,d=new Uint32Array(r.data.buffer);if(this.pixels=new Uint8Array(r.data.buffer),this.encoding=o||"mapbox",this.borderReady=a,!a){for(let f=0;f<u;f++)d[this._idx(-1,f)]=d[this._idx(0,f)],d[this._idx(u,f)]=d[this._idx(u-1,f)],d[this._idx(f,-1)]=d[this._idx(f,0)],d[this._idx(f,u)]=d[this._idx(f,u-1)];d[this._idx(-1,-1)]=d[this._idx(0,0)],d[this._idx(u,-1)]=d[this._idx(u-1,0)],d[this._idx(-1,u)]=d[this._idx(0,u-1)],d[this._idx(u,u)]=d[this._idx(u-1,u-1)],c&&this._buildQuadTree()}}_buildQuadTree(){this._tree=new zm(this)}get(e,r,o=!1){o&&(e=it(e,-1,this.dim),r=it(r,-1,this.dim));const a=4*this._idx(e,r);return(this.encoding==="terrarium"?P_:z_)(this.pixels[a],this.pixels[a+1],this.pixels[a+2])}static getUnpackVector(e){return Dm[e]}get unpackVector(){return Dm[this.encoding]}_idx(e,r){if(e<-1||e>=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(e+1)}static pack(e,r){const o=[0,0,0,0],a=Uh.getUnpackVector(r);let c=Math.floor((e+a[3])/a[2]);return o[2]=c%256,c=Math.floor(c/256),o[1]=c%256,c=Math.floor(c/256),o[0]=c,o}getPixels(){return new wi({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,r,o){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let a=r*this.dim,c=r*this.dim+this.dim,u=o*this.dim,d=o*this.dim+this.dim;switch(r){case-1:a=c-1;break;case 1:c=a+1}switch(o){case-1:u=d-1;break;case 1:d=u+1}const f=-r*this.dim,g=-o*this.dim;for(let x=u;x<d;x++)for(let w=a;w<c;w++){const b=4*this._idx(w,x),k=4*this._idx(w+f,x+g);this.pixels[b+0]=e.pixels[k+0],this.pixels[b+1]=e.pixels[k+1],this.pixels[b+2]=e.pixels[k+2],this.pixels[b+3]=e.pixels[k+3]}}onDeserialize(){this._tree&&(this._tree.dem=this)}}Ue(Uh,"DEMData"),Ue(zm,"DemMinMaxQuadTree",{omit:["dem"]});class D_{constructor(e,r){this.max=e,this.onRemove=r,this.reset()}reset(){for(const e in this.data)for(const r of this.data[e])r.timeout&&clearTimeout(r.timeout),this.onRemove(r.value);return this.data={},this.order=[],this}add(e,r,o){const a=e.wrapped().key;this.data[a]===void 0&&(this.data[a]=[]);const c={value:r,timeout:void 0};if(o!==void 0&&(c.timeout=setTimeout(()=>{this.remove(e,c)},o)),this.data[a].push(c),this.order.push(a),this.order.length>this.max){const u=this._getAndRemoveByKey(this.order[0]);u&&this.onRemove(u)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const r=this.data[e].shift();return r.timeout&&clearTimeout(r.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),r.value}getByKey(e){const r=this.data[e];return r?r[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,r){if(!this.has(e))return this;const o=e.wrapped().key,a=r===void 0?0:this.data[o].indexOf(r),c=this.data[o][a];return this.data[o].splice(a,1),c.timeout&&clearTimeout(c.timeout),this.data[o].length===0&&delete this.data[o],this.onRemove(c.value),this.order.splice(this.order.indexOf(o),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const r=this._getAndRemoveByKey(this.order[0]);r&&this.onRemove(r)}return this}filter(e){const r=[];for(const o in this.data)for(const a of this.data[o])e(a.value)||r.push(a);for(const o of r)this.remove(o.value.tileID,o)}}class Ls{constructor(e,r,o){this.func=e,this.mask=r,this.range=o}}Ls.ReadOnly=!1,Ls.ReadWrite=!0,Ls.disabled=new Ls(519,Ls.ReadOnly,[0,1]);const lp=7680;class cp{constructor(e,r,o,a,c,u){this.test=e,this.ref=r,this.mask=o,this.fail=a,this.depthFail=c,this.pass=u}}cp.disabled=new cp({func:519,mask:0},0,0,lp,lp,lp);class Co{constructor(e,r,o){this.blendFunction=e,this.blendColor=r,this.mask=o}}Co.Replace=[1,0],Co.disabled=new Co(Co.Replace,ur.transparent,[!1,!1,!1,!1]),Co.unblended=new Co(Co.Replace,ur.transparent,[!0,!0,!0,!0]),Co.alphaBlended=new Co([1,771],ur.transparent,[!0,!0,!0,!0]);const hp=1029,up=2305;class uo{constructor(e,r,o){this.enable=e,this.mode=r,this.frontFace=o}}uo.disabled=new uo(!1,hp,up),uo.backCCW=new uo(!0,hp,up),uo.backCW=new uo(!0,hp,2304),uo.frontCW=new uo(!0,1028,2304),uo.frontCCW=new uo(!0,1028,up);class Ca extends Xn{constructor(e,r,o){super(),this.id=e,this._onlySymbols=o,r.on("data",a=>{a.dataType==="source"&&a.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&a.dataType==="source"&&a.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform))}),r.on("error",()=>{this._sourceErrored=!0}),this._source=r,this._tiles={},this._cache=new D_(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=r.minTileCacheSize,this._maxTileCacheSize=r.maxTileCacheSize,this._loadedParentTiles={},this._coveredTiles={},this._state=new C_,this._isRaster=this._source.type==="raster"||this._source.type==="raster-dem"||this._source.type==="custom"&&this._source._dataType==="raster"}onAdd(e){this.map=e,this._minTileCacheSize=this._minTileCacheSize===void 0&&e?e._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=this._maxTileCacheSize===void 0&&e?e._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const e in this._tiles){const r=this._tiles[e];if(r.state!=="loaded"&&r.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(e,r){return e.isSymbolTile=this._onlySymbols,this._source.loadTile(e,r)}_unloadTile(e){if(this._source.unloadTile)return this._source.unloadTile(e,()=>{})}_abortTile(e){if(this._source.abortTile)return this._source.abortTile(e,()=>{})}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const r in this._tiles){const o=this._tiles[r];o.upload(e),o.prepare(this.map.style.imageManager)}}getIds(){return Kr(this._tiles).map(e=>e.tileID).sort(Lm).map(e=>e.key)}getRenderableIds(e){const r=[];for(const o in this._tiles)this._isIdRenderable(+o,e)&&r.push(this._tiles[o]);return e?r.sort((o,a)=>{const c=o.tileID,u=a.tileID,d=new De(c.canonical.x,c.canonical.y)._rotate(this.transform.angle),f=new De(u.canonical.x,u.canonical.y)._rotate(this.transform.angle);return c.overscaledZ-u.overscaledZ||f.y-d.y||f.x-d.x}).map(o=>o.tileID.key):r.map(o=>o.tileID).sort(Lm).map(o=>o.key)}hasRenderableParent(e){const r=this.findLoadedParent(e,0);return!!r&&this._isIdRenderable(r.tileID.key)}_isIdRenderable(e,r){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(r||!this._tiles[e].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)this._tiles[e].state!=="errored"&&this._reloadTile(+e,"reloading")}}_reloadTile(e,r){const o=this._tiles[e];o&&(o.state!=="loading"&&(o.state=r),this._loadTile(o,this._tileLoaded.bind(this,o,e,r)))}_tileLoaded(e,r,o,a){if(a)if(e.state="errored",a.status!==404)this._source.fire(new Wi(a,{tile:e}));else if(this._source.type==="raster-dem"&&this.usedForTerrain&&this.map.painter.terrain){const c=this.map.painter.terrain;this.update(this.transform,c.getScaledDemTileSize(),!0),c.resetTileLookupCache(this.id)}else this.update(this.transform);else e.timeAdded=Xi.now(),o==="expired"&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(r,e),this._source.type==="raster-dem"&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new Fo("data",{dataType:"source",tile:e,coord:e.tileID,sourceCacheId:this.id}))}_backfillDEM(e){const r=this.getRenderableIds();for(let a=0;a<r.length;a++){const c=r[a];if(e.neighboringTiles&&e.neighboringTiles[c]){const u=this.getTileByID(c);o(e,u),o(u,e)}}function o(a,c){if(!a.dem||a.dem.borderReady)return;a.needsHillshadePrepare=!0,a.needsDEMTextureUpload=!0;let u=c.tileID.canonical.x-a.tileID.canonical.x;const d=c.tileID.canonical.y-a.tileID.canonical.y,f=Math.pow(2,a.tileID.canonical.z),g=c.tileID.key;u===0&&d===0||Math.abs(d)>1||(Math.abs(u)>1&&(Math.abs(u+f)===1?u+=f:Math.abs(u-f)===1&&(u-=f)),c.dem&&a.dem&&(a.dem.backfillBorder(c.dem,u,d),a.neighboringTiles&&a.neighboringTiles[g]&&(a.neighboringTiles[g].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,r,o,a){for(const c in this._tiles){let u=this._tiles[c];if(a[c]||!u.hasData()||u.tileID.overscaledZ<=r||u.tileID.overscaledZ>o)continue;let d=u.tileID;for(;u&&u.tileID.overscaledZ>r+1;){const g=u.tileID.scaledTo(u.tileID.overscaledZ-1);u=this._tiles[g.key],u&&u.hasData()&&(d=g)}let f=d;for(;f.overscaledZ>r;)if(f=f.scaledTo(f.overscaledZ-1),e[f.key]){a[d.key]=d;break}}}findLoadedParent(e,r){if(e.key in this._loadedParentTiles){const o=this._loadedParentTiles[e.key];return o&&o.tileID.overscaledZ>=r?o:null}for(let o=e.overscaledZ-1;o>=r;o--){const a=e.scaledTo(o),c=this._getLoadedTile(a);if(c)return c}}_getLoadedTile(e){const r=this._tiles[e.key];return r&&r.hasData()?r:this._cache.getByKey(this._source.reparseOverscaled?e.wrapped().key:e.canonical.key)}updateCacheSize(e,r){r=r||this._source.tileSize;const o=Math.ceil(e.width/r)+1,a=Math.ceil(e.height/r)+1,c=Math.floor(o*a*5),u=typeof this._minTileCacheSize=="number"?Math.max(this._minTileCacheSize,c):c,d=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,u):u;this._cache.setMaxSize(d)}handleWrapJump(e){const r=Math.round((e-(this._prevLng===void 0?e:this._prevLng))/360);if(this._prevLng=e,r){const o={};for(const a in this._tiles){const c=this._tiles[a];c.tileID=c.tileID.unwrapTo(c.tileID.wrap+r),o[c.tileID.key]=c}this._tiles=o;for(const a in this._timers)clearTimeout(this._timers[a]),delete this._timers[a];for(const a in this._tiles)this._setTileReloadTimer(+a,this._tiles[a])}}update(e,r,o){if(this.transform=e,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage||this.usedForTerrain&&!o)return;let a;this.updateCacheSize(e,r),this.transform.projection.name!=="globe"&&this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?a=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(d=>new ii(d.canonical.z,d.wrap,d.canonical.z,d.canonical.x,d.canonical.y)):(a=e.coveringTiles({tileSize:r||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!o,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.hasTile&&(a=a.filter(d=>this._source.hasTile(d)))):a=[];const c=this._updateRetainedTiles(a);if(Rm(this._source.type)&&a.length!==0){const d={},f={},g=Object.keys(c);for(const w of g){const b=c[w],k=this._tiles[w];if(!k||k.fadeEndTime&&k.fadeEndTime<=Xi.now())continue;const S=this.findLoadedParent(b,Math.max(b.overscaledZ-Ca.maxOverzooming,this._source.minzoom));S&&(this._addTile(S.tileID),d[S.tileID.key]=S.tileID),f[w]=b}const x=a[a.length-1].overscaledZ;for(const w in this._tiles){const b=this._tiles[w];if(c[w]||!b.hasData())continue;let k=b.tileID;for(;k.overscaledZ>x;){k=k.scaledTo(k.overscaledZ-1);const S=this._tiles[k.key];if(S&&S.hasData()&&f[k.key]){c[w]=b.tileID;break}}}for(const w in d)c[w]||(this._coveredTiles[w]=!0,c[w]=d[w])}for(const d in c)this._tiles[d].clearFadeHold();const u=function(d,f){const g=[];for(const x in d)x in f||g.push(x);return g}(this._tiles,c);for(const d of u){const f=this._tiles[d];f.hasSymbolBuckets&&!f.holdingForFade()?f.setHoldDuration(this.map._fadeDuration):f.hasSymbolBuckets&&!f.symbolFadeFinished()||this._removeTile(+d)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(+e)}_updateRetainedTiles(e){const r={};if(e.length===0)return r;const o={},a=e.reduce((g,x)=>Math.min(g,x.overscaledZ),1/0),c=e[0].overscaledZ,u=Math.max(c-Ca.maxOverzooming,this._source.minzoom),d=Math.max(c+Ca.maxUnderzooming,this._source.minzoom),f={};for(const g of e){const x=this._addTile(g);r[g.key]=g,x.hasData()||a<this._source.maxzoom&&(f[g.key]=g)}this._retainLoadedChildren(f,a,d,r);for(const g of e){let x=this._tiles[g.key];if(x.hasData())continue;if(g.canonical.z>=this._source.maxzoom){const b=g.children(this._source.maxzoom)[0],k=this.getTile(b);if(k&&k.hasData()){r[b.key]=b;continue}}else{const b=g.children(this._source.maxzoom);if(r[b[0].key]&&r[b[1].key]&&r[b[2].key]&&r[b[3].key])continue}let w=x.wasRequested();for(let b=g.overscaledZ-1;b>=u;--b){const k=g.scaledTo(b);if(o[k.key]||(o[k.key]=!0,x=this.getTile(k),!x&&w&&(x=this._addTile(k)),x&&(r[k.key]=k,w=x.wasRequested(),x.hasData())))break}}return r}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const r=[];let o,a=this._tiles[e].tileID;for(;a.overscaledZ>0;){if(a.key in this._loadedParentTiles){o=this._loadedParentTiles[a.key];break}r.push(a.key);const c=a.scaledTo(a.overscaledZ-1);if(o=this._getLoadedTile(c),o)break;a=c}for(const c of r)this._loadedParentTiles[c]=o}}_addTile(e){let r=this._tiles[e.key];if(r)return r;r=this._cache.getAndRemove(e),r&&(this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,r)));const o=!!r;if(!o){const a=this.map?this.map.painter:null;r=new sp(e,this._source.tileSize*e.overscaleFactor(),this.transform.tileZoom,a,this._isRaster),this._loadTile(r,this._tileLoaded.bind(this,r,e.key,r.state))}return r?(r.uses++,this._tiles[e.key]=r,o||this._source.fire(new Fo("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r):null}_setTileReloadTimer(e,r){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const o=r.getExpiryTimeout();o&&(this._timers[e]=setTimeout(()=>{this._reloadTile(e,"expired"),delete this._timers[e]},o))}_removeTile(e){const r=this._tiles[e];r&&(r.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),r.uses>0||(r.hasData()&&r.state!=="reloading"?this._cache.add(r.tileID,r,r.getExpiryTimeout()):(r.aborted=!0,this._abortTile(r),this._unloadTile(r))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(+e);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(e,r,o){const a=[],c=this.transform;if(!c)return a;const u=c.projection.name==="globe",d=So(c.center.lng);for(const f in this._tiles){const g=this._tiles[f];if(o&&g.clearQueryDebugViz(),g.holdingForFade())continue;let x;if(u){const w=g.tileID.canonical;if(w.z===0){const b=[Math.abs(it(d,...lc(w,-1))-d),Math.abs(it(d,...lc(w,1))-d)];x=[0,2*b.indexOf(Math.min(...b))-1]}else{const b=[Math.abs(it(d,...lc(w,-1))-d),Math.abs(it(d,...lc(w,0))-d),Math.abs(it(d,...lc(w,1))-d)];x=[b.indexOf(Math.min(...b))-1]}}else x=[0];for(const w of x){const b=e.containsTile(g,c,r,w);b&&a.push(b)}}return a}getVisibleCoordinates(e){const r=this.getRenderableIds(e).map(o=>this._tiles[o].tileID);for(const o of r)o.projMatrix=this.transform.calculateProjMatrix(o.toUnwrapped());return r}hasTransition(){if(this._source.hasTransition())return!0;if(Rm(this._source.type))for(const e in this._tiles){const r=this._tiles[e];if(r.fadeEndTime!==void 0&&r.fadeEndTime>=Xi.now())return!0}return!1}setFeatureState(e,r,o){this._state.updateState(e=e||"_geojsonTileLayer",r,o)}removeFeatureState(e,r,o){this._state.removeFeatureState(e=e||"_geojsonTileLayer",r,o)}getFeatureState(e,r){return this._state.getState(e=e||"_geojsonTileLayer",r)}setDependencies(e,r,o){const a=this._tiles[e];a&&a.setDependencies(r,o)}reloadTilesForDependencies(e,r){for(const o in this._tiles)this._tiles[o].hasDependency(e,r)&&this._reloadTile(+o,"reloading");this._cache.filter(o=>!o.hasDependency(e,r))}_preloadTiles(e,r){if(!this._sourceLoaded){const d=()=>{this._sourceLoaded&&(this._source.off("data",d),this._preloadTiles(e,r))};return void this._source.on("data",d)}const o=new Map,a=Array.isArray(e)?e:[e],c=this.map.painter.terrain,u=this.usedForTerrain&&c?c.getScaledDemTileSize():this._source.tileSize;for(const d of a){const f=d.coveringTiles({tileSize:u,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const g of f)o.set(g.key,g);this.usedForTerrain&&d.updateElevation(!1)}rr(Array.from(o.values()),(d,f)=>{const g=new sp(d,this._source.tileSize*d.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(g,x=>{this._source.type==="raster-dem"&&g.dem&&this._backfillDEM(g),f(x,g)})},r)}}function Lm(t,e){const r=Math.abs(2*t.wrap)-+(t.wrap<0),o=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||o-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Rm(t){return t==="raster"||t==="image"||t==="video"||t==="custom"}function lc(t,e){const r=1<<t.z;return[t.x/r+e,(t.x+1)/r+e]}Ca.maxOverzooming=10,Ca.maxUnderzooming=3;class jh{constructor(e,r,o){this._demTile=e,this._dem=this._demTile.dem,this._scale=r,this._offset=o}static create(e,r,o){const a=o||e.findDEMTileFor(r);if(!a||!a.dem)return;const c=a.dem,u=a.tileID,d=1<<r.canonical.z-u.canonical.z;return new jh(a,a.tileSize/Xe/d,[(r.canonical.x/d-u.canonical.x)*c.dim,(r.canonical.y/d-u.canonical.y)*c.dim])}tileCoordToPixel(e,r){const o=r*this._scale+this._offset[1],a=Math.floor(e*this._scale+this._offset[0]),c=Math.floor(o);return new De(a,c)}getElevationAt(e,r,o,a){const c=e*this._scale+this._offset[0],u=r*this._scale+this._offset[1],d=Math.floor(c),f=Math.floor(u),g=this._dem;return a=!!a,o?bt(bt(g.get(d,f,a),g.get(d,f+1,a),u-f),bt(g.get(d+1,f,a),g.get(d+1,f+1,a),u-f),c-d):g.get(d,f,a)}getElevationAtPixel(e,r,o){return this._dem.get(e,r,!!o)}getMeterToDEM(e){return(1<<this._demTile.tileID.canonical.z)*lo(1,e)*this._dem.stride}}class Bm{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new $o(Xe,16,0),this.featureIndexArray=new ya,this.promoteId=r}insert(e,r,o,a,c,u=0){const d=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(o,a,c,u);const f=this.grid;for(let g=0;g<r.length;g++){const x=r[g],w=[1/0,1/0,-1/0,-1/0];for(let b=0;b<x.length;b++){const k=x[b];w[0]=Math.min(w[0],k.x),w[1]=Math.min(w[1],k.y),w[2]=Math.max(w[2],k.x),w[3]=Math.max(w[3],k.y)}w[0]<Xe&&w[1]<Xe&&w[2]>=0&&w[3]>=0&&f.insert(d,w[0],w[1],w[2],w[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new qu(new Sh(this.rawTileData)).layers,this.sourceLayerCoder=new wm(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const e in this.vtLayers)this.vtFeatures[e]=[]}return this.vtLayers}query(e,r,o,a){this.loadVTLayers();const c=e.params||{},u=cs(c.filter),d=e.tileResult,f=e.transform,g=d.bufferedTilespaceBounds,x=this.grid.query(g.min.x,g.min.y,g.max.x,g.max.y,(S,I,D,U)=>sd(d.bufferedTilespaceGeometry,S,I,D,U));x.sort(L_);let w=null;f.elevation&&x.length>0&&(w=jh.create(f.elevation,this.tileID));const b={};let k;for(let S=0;S<x.length;S++){const I=x[S];if(I===k)continue;k=I;const D=this.featureIndexArray.get(I);let U=null;this.loadMatchingFeature(b,D,u,c.layers,c.availableImages,r,o,a,(Z,j,$,W=0)=>(U||(U=Ko(Z,this.tileID.canonical,e.tileTransform)),j.queryIntersectsFeature(d,Z,$,U,this.z,e.transform,e.pixelPosMatrix,w,W)))}return b}loadMatchingFeature(e,r,o,a,c,u,d,f,g){const{featureIndex:x,bucketIndex:w,sourceLayerIndex:b,layoutVertexArrayOffset:k}=r,S=this.bucketLayerIDs[w];if(a&&!function(Z,j){for(let $=0;$<Z.length;$++)if(j.indexOf(Z[$])>=0)return!0;return!1}(a,S))return;const I=this.sourceLayerCoder.decode(b),D=this.vtLayers[I].feature(x);if(o.needGeometry){const Z=Sa(D,!0);if(!o.filter(new v(this.tileID.overscaledZ),Z,this.tileID.canonical))return}else if(!o.filter(new v(this.tileID.overscaledZ),D))return;const U=this.getId(D,I);for(let Z=0;Z<S.length;Z++){const j=S[Z];if(a&&a.indexOf(j)<0)continue;const $=u[j];if(!$)continue;let W={};U!==void 0&&f&&(W=f.getState($.sourceLayer||"_geojsonTileLayer",U));const X=sr({},d[j]);X.paint=Fm(X.paint,$.paint,D,W,c),X.layout=Fm(X.layout,$.layout,D,W,c);const ce=!g||g(D,$,W,k);if(!ce)continue;const ae=new bm(D,this.z,this.x,this.y,U);ae.layer=X;let fe=e[j];fe===void 0&&(fe=e[j]=[]),fe.push({featureIndex:x,feature:ae,intersectionZ:ce})}}lookupSymbolFeatures(e,r,o,a,c,u,d,f){const g={};this.loadVTLayers();const x=cs(c);for(const w of e)this.loadMatchingFeature(g,{bucketIndex:o,sourceLayerIndex:a,featureIndex:w,layoutVertexArrayOffset:0},x,u,d,f,r);return g}loadFeature(e){const{featureIndex:r,sourceLayerIndex:o}=e;this.loadVTLayers();const a=this.sourceLayerCoder.decode(o),c=this.vtFeatures[a];if(c[r])return c[r];const u=this.vtLayers[a].feature(r);return c[r]=u,u}hasLayer(e){for(const r of this.bucketLayerIDs)for(const o of r)if(e===o)return!0;return!1}getId(e,r){let o=e.id;if(this.promoteId){const a=typeof this.promoteId=="string"?this.promoteId:this.promoteId[r];a!=null&&(o=e.properties[a]),typeof o=="boolean"&&(o=Number(o))}return o}}function Fm(t,e,r,o,a){return gt(t,(c,u)=>{const d=e instanceof O?e.get(u):null;return d&&d.evaluate?d.evaluate(r,o,a):d})}function L_(t,e){return e-t}Ue(Bm,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});class Om{constructor(e,r){this.width=e,this.height=r,this.nextRow=0,this.image=new Jo({width:e,height:r}),this.positions={},this.uploaded=!1}getDash(e,r){const o=this.getKey(e,r);return this.positions[o]}trim(){const e=this.width,r=this.height=qi(this.nextRow);this.image.resize({width:e,height:r})}getKey(e,r){return e.join(",")+r}getDashRanges(e,r,o){const a=[];let c=e.length%2==1?-e[e.length-1]*o:0,u=e[0]*o,d=!0;a.push({left:c,right:u,isDash:d,zeroLength:e[0]===0});let f=e[0];for(let g=1;g<e.length;g++){d=!d;const x=e[g];c=f*o,f+=x,u=f*o,a.push({left:c,right:u,isDash:d,zeroLength:x===0})}return a}addRoundDash(e,r,o){const a=r/2;for(let c=-o;c<=o;c++){const u=this.width*(this.nextRow+o+c);let d=0,f=e[d];for(let g=0;g<this.width;g++){g/f.right>1&&(f=e[++d]);const x=Math.abs(g-f.left),w=Math.abs(g-f.right),b=Math.min(x,w);let k;const S=c/o*(a+1);if(f.isDash){const I=a-Math.abs(S);k=Math.sqrt(b*b+I*I)}else k=a-Math.sqrt(b*b+S*S);this.image.data[u+g]=Math.max(0,Math.min(255,k+128))}}}addRegularDash(e,r){for(let f=e.length-1;f>=0;--f){const g=e[f],x=e[f+1];g.zeroLength?e.splice(f,1):x&&x.isDash===g.isDash&&(x.left=g.left,e.splice(f,1))}const o=e[0],a=e[e.length-1];o.isDash===a.isDash&&(o.left=a.left-this.width,a.right=o.right+this.width);const c=this.width*this.nextRow;let u=0,d=e[u];for(let f=0;f<this.width;f++){f/d.right>1&&(d=e[++u]);const g=Math.abs(f-d.left),x=Math.abs(f-d.right),w=Math.min(g,x);this.image.data[c+f]=Math.max(0,Math.min(255,(d.isDash?w:-w)+r+128))}}addDash(e,r){const o=this.getKey(e,r);if(this.positions[o])return this.positions[o];const a=r==="round",c=a?7:0,u=2*c+1;if(this.nextRow+u>this.height)return ir("LineAtlas out of space"),null;e.length===0&&e.push(1);let d=0;for(let x=0;x<e.length;x++)e[x]<0&&(ir("Negative value is found in line dasharray, replacing values with 0"),e[x]=0),d+=e[x];if(d!==0){const x=this.width/d,w=this.getDashRanges(e,this.width,x);a?this.addRoundDash(w,x,c):this.addRegularDash(w,r==="square"?.5*x:0)}const f=this.nextRow+c;this.nextRow+=u;const g={tl:[f,c],br:[d,0]};return this.positions[o]=g,g}}Ue(Om,"LineAtlas");const Um=1*ho;class jm{constructor(e){const r={},o=[];for(const d in e){const f=e[d],g=r[d]={};for(const x in f.glyphs){const w=f.glyphs[+x];if(!w||w.bitmap.width===0||w.bitmap.height===0)continue;const b=w.metrics.localGlyph?Um:1,k={x:0,y:0,w:w.bitmap.width+2*b,h:w.bitmap.height+2*b};o.push(k),g[x]=k}}const{w:a,h:c}=Yu(o),u=new Jo({width:a||1,height:c||1});for(const d in e){const f=e[d];for(const g in f.glyphs){const x=f.glyphs[+g];if(!x||x.bitmap.width===0||x.bitmap.height===0)continue;const w=r[d][g],b=x.metrics.localGlyph?Um:1;Jo.copy(x.bitmap,u,{x:0,y:0},{x:w.x+b,y:w.y+b},x.bitmap)}}this.image=u,this.positions=r}}Ue(jm,"GlyphAtlas");class R_{constructor(e){this.tileID=new ii(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.tileZoom=e.tileZoom,this.uid=e.uid,this.zoom=e.zoom,this.canonical=e.tileID.canonical,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.enableTerrain=!!e.enableTerrain,this.isSymbolTile=e.isSymbolTile,this.tileTransform=Ia(e.tileID.canonical,e.projection),this.projection=e.projection}parse(e,r,o,a,c){this.status="parsing",this.data=e,this.collisionBoxArray=new Ft;const u=new wm(Object.keys(e.layers).sort()),d=new Bm(this.tileID,this.promoteId);d.bucketLayerIDs=[];const f={},g=new Om(256,256),x={featureIndex:d,iconDependencies:{},patternDependencies:{},glyphDependencies:{},lineAtlas:g,availableImages:o},w=r.familiesBySource[this.source];for(const W in w){const X=e.layers[W];if(!X)continue;let ce=!1,ae=!1;for(const ue of w[W])ue[0].type==="symbol"?ce=!0:ae=!0;if(this.isSymbolTile===!0&&!ce||this.isSymbolTile===!1&&!ae)continue;X.version===1&&ir(`Vector tile source "${this.source}" layer "${W}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const fe=u.encode(W),ke=[];for(let ue=0;ue<X.length;ue++){const ye=X.feature(ue),xe=d.getId(ye,W);ke.push({feature:ye,id:xe,index:ue,sourceLayerIndex:fe})}for(const ue of w[W]){const ye=ue[0];this.isSymbolTile!==void 0&&ye.type==="symbol"!==this.isSymbolTile||ye.minzoom&&this.zoom<Math.floor(ye.minzoom)||ye.maxzoom&&this.zoom>=ye.maxzoom||ye.visibility!=="none"&&(pp(ue,this.zoom,o),(f[ye.id]=ye.createBucket({index:d.bucketLayerIDs.length,layers:ue,zoom:this.zoom,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:fe,sourceID:this.source,enableTerrain:this.enableTerrain,projection:this.projection.spec,availableImages:o})).populate(ke,x,this.tileID.canonical,this.tileTransform),d.bucketLayerIDs.push(ue.map(xe=>xe.id)))}}let b,k,S,I;g.trim();const D={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},U=()=>{if(b)return c(b);if(k&&S&&I){const W=new jm(k),X=new Xd(S,I);for(const ce in f){const ae=f[ce];ae instanceof Ln?(pp(ae.layers,this.zoom,o),s_(ae,k,W.positions,S,X.iconPositions,this.showCollisionBoxes,o,this.tileID.canonical,this.tileZoom,this.projection)):ae.hasPattern&&(ae instanceof Th||ae instanceof yh||ae instanceof Hl)&&(pp(ae.layers,this.zoom,o),ae.addFeatures(x,this.tileID.canonical,X.patternPositions,o,this.tileTransform))}this.status="done",c(null,{buckets:Kr(f).filter(ce=>!ce.isEmpty()),featureIndex:d,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:W.image,lineAtlas:g,imageAtlas:X,glyphMap:this.returnDependencies?k:null,iconMap:this.returnDependencies?S:null,glyphPositions:this.returnDependencies?W.positions:null})}},Z=gt(x.glyphDependencies,W=>Object.keys(W).map(Number));Object.keys(Z).length?a.send("getGlyphs",{uid:this.uid,stacks:Z},(W,X)=>{b||(b=W,k=X,U())},void 0,!1,D):k={};const j=Object.keys(x.iconDependencies);j.length?a.send("getImages",{icons:j,source:this.source,tileID:this.tileID,type:"icons"},(W,X)=>{b||(b=W,S=X,U())},void 0,!1,D):S={};const $=Object.keys(x.patternDependencies);$.length?a.send("getImages",{icons:$,source:this.source,tileID:this.tileID,type:"patterns"},(W,X)=>{b||(b=W,I=X,U())},void 0,!1,D):I={},U()}}function pp(t,e,r){const o=new v(e);for(const a of t)a.recalculate(o,r)}class Nm{constructor(e){this.entries={},this.scheduler=e}request(e,r,o,a){const c=this.entries[e]=this.entries[e]||{callbacks:[]};if(c.result){const[u,d]=c.result;return this.scheduler?this.scheduler.add(()=>{a(u,d)},r):a(u,d),()=>{}}return c.callbacks.push(a),c.cancel||(c.cancel=o((u,d)=>{c.result=[u,d];for(const f of c.callbacks)this.scheduler?this.scheduler.add(()=>{f(u,d)},r):f(u,d);setTimeout(()=>delete this.entries[e],3e3)})),()=>{c.result||(c.callbacks=c.callbacks.filter(u=>u!==a),c.callbacks.length||(c.cancel(),delete this.entries[e]))}}}function Vm(t,e,r){const o=JSON.stringify(t.request);return t.data&&(this.deduped.entries[o]={result:[null,t.data]}),this.deduped.request(o,{type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom},a=>{const c=ln(t.request,(u,d,f,g)=>{u?a(u):d&&a(null,{vectorTile:r?void 0:new qu(new Sh(d)),rawData:d,cacheControl:f,expires:g})});return()=>{c.cancel(),a()}},e)}const Gm=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class dp{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[r,o]=new Uint8Array(e,0,2);if(r!==219)throw new Error("Data does not appear to be in a KDBush format.");const a=o>>4;if(a!==1)throw new Error(`Got v${a} data when expected v1.`);const c=Gm[15&o];if(!c)throw new Error("Unrecognized array type.");const[u]=new Uint16Array(e,2,1),[d]=new Uint32Array(e,4,1);return new dp(d,u,c,e)}constructor(e,r=64,o=Float64Array,a){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=o,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const c=Gm.indexOf(this.ArrayType),u=2*e*this.ArrayType.BYTES_PER_ELEMENT,d=e*this.IndexArrayType.BYTES_PER_ELEMENT,f=(8-d%8)%8;if(c<0)throw new Error(`Unexpected typed array class: ${o}.`);a&&a instanceof ArrayBuffer?(this.data=a,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+d+f,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+u+d+f),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+d+f,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+c]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=e)}add(e,r){const o=this._pos>>1;return this.ids[o]=o,this.coords[this._pos++]=e,this.coords[this._pos++]=r,o}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return mp(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,o,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:c,coords:u,nodeSize:d}=this,f=[0,c.length-1,0],g=[];for(;f.length;){const x=f.pop()||0,w=f.pop()||0,b=f.pop()||0;if(w-b<=d){for(let D=b;D<=w;D++){const U=u[2*D],Z=u[2*D+1];U>=e&&U<=o&&Z>=r&&Z<=a&&g.push(c[D])}continue}const k=b+w>>1,S=u[2*k],I=u[2*k+1];S>=e&&S<=o&&I>=r&&I<=a&&g.push(c[k]),(x===0?e<=S:r<=I)&&(f.push(b),f.push(k-1),f.push(1-x)),(x===0?o>=S:a>=I)&&(f.push(k+1),f.push(w),f.push(1-x))}return g}within(e,r,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:a,coords:c,nodeSize:u}=this,d=[0,a.length-1,0],f=[],g=o*o;for(;d.length;){const x=d.pop()||0,w=d.pop()||0,b=d.pop()||0;if(w-b<=u){for(let D=b;D<=w;D++)qm(c[2*D],c[2*D+1],e,r)<=g&&f.push(a[D]);continue}const k=b+w>>1,S=c[2*k],I=c[2*k+1];qm(S,I,e,r)<=g&&f.push(a[k]),(x===0?e-o<=S:r-o<=I)&&(d.push(b),d.push(k-1),d.push(1-x)),(x===0?e+o>=S:r+o>=I)&&(d.push(k+1),d.push(w),d.push(1-x))}return f}}function mp(t,e,r,o,a,c){if(a-o<=r)return;const u=o+a>>1;$m(t,e,u,o,a,c),mp(t,e,r,o,u-1,1-c),mp(t,e,r,u+1,a,1-c)}function $m(t,e,r,o,a,c){for(;a>o;){if(a-o>600){const g=a-o+1,x=r-o+1,w=Math.log(g),b=.5*Math.exp(2*w/3),k=.5*Math.sqrt(w*b*(g-b)/g)*(x-g/2<0?-1:1);$m(t,e,r,Math.max(o,Math.floor(r-x*b/g+k)),Math.min(a,Math.floor(r+(g-x)*b/g+k)),c)}const u=e[2*r+c];let d=o,f=a;for(cc(t,e,o,r),e[2*a+c]>u&&cc(t,e,o,a);d<f;){for(cc(t,e,d,f),d++,f--;e[2*d+c]<u;)d++;for(;e[2*f+c]>u;)f--}e[2*o+c]===u?cc(t,e,o,f):(f++,cc(t,e,f,a)),f<=r&&(o=f+1),r<=f&&(a=f-1)}}function cc(t,e,r,o){fp(t,r,o),fp(e,2*r,2*o),fp(e,2*r+1,2*o+1)}function fp(t,e,r){const o=t[e];t[e]=t[r],t[r]=o}function qm(t,e,r,o){const a=t-r,c=e-o;return a*a+c*c}s.ARRAY_TYPE=vi,s.AUTH_ERR_MSG=Y,s.Aabb=ri,s.Actor=class{constructor(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.cancelCallbacks={},Po(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.globalScope=Zi()?t:ve,this.scheduler=new A_}send(t,e,r,o,a=!1,c){const u=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(r.metadata=c,this.callbacks[u]=r);const d=nn(this.globalScope)?void 0:[];return this.target.postMessage({id:u,type:t,hasCallback:!!r,targetMapId:o,mustQueue:a,sourceMapId:this.mapId,data:Sn(e,d)},d),{cancel:()=>{r&&delete this.callbacks[u],this.target.postMessage({id:u,type:"<cancel>",targetMapId:o,sourceMapId:this.mapId})}}}receive(t){const e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(e.type==="<cancel>"){const o=this.cancelCallbacks[r];delete this.cancelCallbacks[r],o&&o.cancel()}else if(e.mustQueue||Zi()){const o=this.callbacks[r];this.cancelCallbacks[r]=this.scheduler.add(()=>this.processTask(r,e),o&&o.metadata||{type:"message"})}else this.processTask(r,e)}processTask(t,e){if(e.type==="<response>"){const r=this.callbacks[t];delete this.callbacks[t],r&&(e.error?r(qo(e.error)):r(null,qo(e.data)))}else{const r=nn(this.globalScope)?void 0:[],o=e.hasCallback?(c,u)=>{delete this.cancelCallbacks[t],this.target.postMessage({id:t,type:"<response>",sourceMapId:this.mapId,error:c?Sn(c):null,data:Sn(u,r)},r)}:c=>{},a=qo(e.data);if(this.parent[e.type])this.parent[e.type](e.sourceMapId,a,o);else if(this.parent.getWorkerSource){const c=e.type.split(".");this.parent.getWorkerSource(e.sourceMapId,c[0],a.source)[c[1]](a,o)}else o(new Error(`Could not find function ${e.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}},s.CanonicalTileID=bh,s.Color=ur,s.ColorMode=Co,s.CullFaceMode=uo,s.DEMData=Uh,s.DataConstantProperty=A,s.DedupedRequest=Nm,s.DepthMode=Ls,s.EXTENT=Xe,s.Elevation=class{isDataAvailableAtPoint(t){const e=this._source();if(this.isUsingMockSource()||!e||t.y<0||t.y>1)return!1;const r=e.getSource().maxzoom,o=1<<r,a=Math.floor(t.x),c=Math.floor((t.x-a)*o),u=Math.floor(t.y*o),d=this.findDEMTileFor(new ii(r,a,r,c,u));return!(!d||!d.dem)}getAtPointOrZero(t,e=0){return this.getAtPoint(t,e)||0}getAtPoint(t,e,r=!0){if(this.isUsingMockSource())return null;e==null&&(e=null);const o=this._source();if(!o||t.y<0||t.y>1)return e;const a=o.getSource().maxzoom,c=1<<a,u=Math.floor(t.x),d=t.x-u,f=new ii(a,u,a,Math.floor(d*c),Math.floor(t.y*c)),g=this.findDEMTileFor(f);if(!g||!g.dem)return e;const x=g.dem,w=1<<g.tileID.canonical.z,b=(d*w-g.tileID.canonical.x)*x.dim,k=(t.y*w-g.tileID.canonical.y)*x.dim,S=Math.floor(b),I=Math.floor(k);return(r?this.exaggeration():1)*bt(bt(x.get(S,I),x.get(S,I+1),k-I),bt(x.get(S+1,I),x.get(S+1,I+1),k-I),b-S)}getAtTileOffset(t,e,r){const o=1<<t.canonical.z;return this.getAtPointOrZero(new vs(t.wrap+(t.canonical.x+e/Xe)/o,(t.canonical.y+r/Xe)/o))}getAtTileOffsetFunc(t,e,r,o){return a=>{const c=this.getAtTileOffset(t,a.x,a.y),u=o.upVector(t.canonical,a.x,a.y);return Ii(u,u,c*o.upVectorScale(t.canonical,e,r).metersToTile),u}}getForTilePoints(t,e,r,o){if(this.isUsingMockSource())return!1;const a=jh.create(this,t,o);return!!a&&(e.forEach(c=>{c[2]=this.exaggeration()*a.getElevationAt(c[0],c[1],r)}),!0)}getMinMaxForTile(t){if(this.isUsingMockSource())return null;const e=this.findDEMTileFor(t);if(!e||!e.dem)return null;const r=e.dem.tree,o=e.tileID,a=1<<t.canonical.z-o.canonical.z;let c=t.canonical.x/a-o.canonical.x,u=t.canonical.y/a-o.canonical.y,d=0;for(let f=0;f<t.canonical.z-o.canonical.z&&!r.leaves[d];f++){c*=2,u*=2;const g=2*Math.floor(u)+Math.floor(c);d=r.childOffsets[d]+g,c%=1,u%=1}return{min:this.exaggeration()*r.minimums[d],max:this.exaggeration()*r.maximums[d]}}getMinElevationBelowMSL(){throw new Error("Pure virtual method called.")}raycast(t,e,r){throw new Error("Pure virtual method called.")}pointCoordinate(t){throw new Error("Pure virtual method called.")}_source(){throw new Error("Pure virtual method called.")}isUsingMockSource(){throw new Error("Pure virtual method called.")}exaggeration(){throw new Error("Pure virtual method called.")}findDEMTileFor(t){throw new Error("Pure virtual method called.")}get visibleDemTiles(){throw new Error("Getter must be implemented in subclass.")}},s.ErrorEvent=Wi,s.EvaluationParameters=v,s.Event=Fo,s.Evented=Xn,s.FillExtrusionBucket=Hl,s.Frustum=bu,s.FrustumCorners=wu,s.GLOBE_RADIUS=Eo,s.GLOBE_SCALE_MATCH_LATITUDE=45,s.GLOBE_ZOOM_THRESHOLD_MAX=$p,s.GLOBE_ZOOM_THRESHOLD_MIN=Tu,s.GlobeSharedBuffers=class{constructor(t){this._createGrid(t),this._createPoles(t)}destroy(){this._poleIndexBuffer.destroy(),this._gridBuffer.destroy(),this._gridIndexBuffer.destroy(),this._poleNorthVertexBuffer.destroy(),this._poleSouthVertexBuffer.destroy();for(const t of this._poleSegments)t.destroy();for(const t of this._gridSegments)t.withSkirts.destroy(),t.withoutSkirts.destroy();if(this._wireframeIndexBuffer){this._wireframeIndexBuffer.destroy();for(const t of this._wireframeSegments)t.destroy()}}_fillGridMeshWithLods(t,e){const r=new Ee,o=new $e,a=[],c=t+1+2,u=e[0]+1,d=e[0]+1+(1+e.length),f=(g,x,w)=>{let b=g===c-1?g-2:g===0?g:g-1;return b+=w?24575:0,[b,x]};for(let g=0;g<c;++g)r.emplaceBack(...f(g,0,!0));for(let g=0;g<u;++g)for(let x=0;x<c;++x)r.emplaceBack(...f(x,g,(x===0||x===c-1)&&!0));for(let g=0;g<e.length;++g){const x=e[g];for(let w=0;w<c;++w)r.emplaceBack(...f(w,x,!0))}for(let g=0;g<e.length;++g){const x=o.length,w=e[g]+1+2,b=new $e;for(let I=0;I<w-1;I++){const D=I===w-2,U=D?c*(d-e.length+g-I):c;for(let Z=0;Z<c-1;Z++){const j=I*c+Z;I===0||D||Z===0||Z===c-2?(b.emplaceBack(j+1,j,j+U),b.emplaceBack(j+U,j+U+1,j+1)):(o.emplaceBack(j+1,j,j+U),o.emplaceBack(j+U,j+U+1,j+1))}}const k=gr.simpleSegment(0,x,r.length,o.length-x);for(let I=0;I<b.uint16.length;I+=3)o.emplaceBack(b.uint16[I],b.uint16[I+1],b.uint16[I+2]);const S=gr.simpleSegment(0,x,r.length,o.length-x);a.push({withoutSkirts:k,withSkirts:S})}return{vertices:r,indices:o,segments:a}}_createGrid(t){const e=this._fillGridMeshWithLods(Ea,jl);this._gridSegments=e.segments,this._gridBuffer=t.createVertexBuffer(e.vertices,Ul.members),this._gridIndexBuffer=t.createIndexBuffer(e.indices,!0)}_createPoles(t){const e=new $e;for(let a=0;a<=Ea;a++)e.emplaceBack(0,a+1,a+2);this._poleIndexBuffer=t.createIndexBuffer(e,!0);const r=new Bt,o=new Bt;this._poleSegments=[];for(let a=0,c=0;a<Tu;a++){const u=360/(1<<a);r.emplaceBack(0,-Eo,0,.5,0),o.emplaceBack(0,-Eo,0,.5,1);for(let d=0;d<=Ea;d++){const f=d/Ea,g=bt(0,u,f),[x,w,b]=_s(Af,If,g,Eo);r.emplaceBack(x,w,b,f,0),o.emplaceBack(x,w,b,f,1)}this._poleSegments.push(gr.simpleSegment(c,0,66,64)),c+=66}this._poleNorthVertexBuffer=t.createVertexBuffer(r,Vp,!1),this._poleSouthVertexBuffer=t.createVertexBuffer(o,Vp,!1)}getGridBuffers(t,e){return[this._gridBuffer,this._gridIndexBuffer,e?this._gridSegments[t].withSkirts:this._gridSegments[t].withoutSkirts]}getPoleBuffers(t){return[this._poleNorthVertexBuffer,this._poleSouthVertexBuffer,this._poleIndexBuffer,this._poleSegments[t]]}getWirefameBuffers(t,e){if(!this._wireframeSegments){const r=new Cr,o=Ea,a=o+1+2,c=1;this._wireframeSegments=[];for(let u=0,d=0;u<jl.length;u++){const f=jl[u];for(let x=c;x<f+c;x++)for(let w=c;w<o+c;w++){const b=x*a+w;r.emplaceBack(b,b+1),r.emplaceBack(b,b+a),r.emplaceBack(b,b+a+1)}const g=f*o*3;this._wireframeSegments.push(gr.simpleSegment(0,d,(f+1)*a,g)),d+=g}this._wireframeIndexBuffer=t.createIndexBuffer(r)}return[this._gridBuffer,this._wireframeIndexBuffer,this._wireframeSegments[e]]}},s.GlyphManager=Is,s.ImagePosition=Hu,s.KDBush=dp,s.LivePerformanceUtils=Gh,s.LngLat=Ot,s.LngLatBounds=Cn,s.LocalGlyphMode=Qu,s.MAX_MERCATOR_LATITUDE=qr,s.MercatorCoordinate=vs,s.ONE_EM=Fr,s.OverscaledTileID=ii,s.PerformanceMarkers=cn,s.Point=De,s.Properties=V,s.RGBAImage=wi,s.Ray=vu,s.RequestManager=class{constructor(t,e,r){this._transformRequestFn=t,this._customAccessToken=e,this._silenceAuthErrors=!!r,this._createSkuToken()}_createSkuToken(){const t=function(){let e="";for(let r=0;r<10;r++)e+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",ki,e].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt}_isSkuTokenExpired(){return Date.now()>this._skuTokenExpiresAt}transformRequest(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}}normalizeStyleURL(t,e){if(!ee(t))return t;const r=Pe(t);return r.path=`/styles/v1${r.path}`,this._makeAPIURL(r,this._customAccessToken||e)}normalizeGlyphsURL(t,e){if(!ee(t))return t;const r=Pe(t);return r.path=`/fonts/v1${r.path}`,this._makeAPIURL(r,this._customAccessToken||e)}normalizeSourceURL(t,e,r,o){if(!ee(t))return t;const a=Pe(t);return a.path=`/v4/${a.authority}.json`,a.params.push("secure"),r&&a.params.push(`language=${r}`),o&&a.params.push(`worldview=${o}`),this._makeAPIURL(a,this._customAccessToken||e)}normalizeSpriteURL(t,e,r,o){const a=Pe(t);return ee(t)?(a.path=`/styles/v1${a.path}/sprite${e}${r}`,this._makeAPIURL(a,this._customAccessToken||o)):(a.path+=`${e}${r}`,Ae(a))}normalizeTileURL(t,e,r){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!ee(t))return t;const o=Pe(t);o.path=o.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${e||r&&o.authority!=="raster"&&r===512?"@2x":""}${Je.supported?".webp":"$1"}`),o.authority==="raster"?o.path=`/${He.RASTER_URL_PREFIX}${o.path}`:(o.path=o.path.replace(/^.+\/v4\//,"/"),o.path=`/${He.TILE_URL_VERSION}${o.path}`);const a=this._customAccessToken||function(c){for(const u of c){const d=u.match(/^access_token=(.*)$/);if(d)return d[1]}return null}(o.params)||He.ACCESS_TOKEN;return He.REQUIRE_ACCESS_TOKEN&&a&&this._skuToken&&o.params.push(`sku=${this._skuToken}`),this._makeAPIURL(o,a)}canonicalizeTileURL(t,e){const r=Pe(t);if(!r.path.match(/^(\/v4\/|\/raster\/v1\/)/)||!r.path.match(/\.[\w]+$/))return t;let o="mapbox://";r.path.match(/^\/raster\/v1\//)?o+=`raster/${r.path.replace(`/${He.RASTER_URL_PREFIX}/`,"")}`:o+=`tiles/${r.path.replace(`/${He.TILE_URL_VERSION}/`,"")}`;let a=r.params;return e&&(a=a.filter(c=>!c.match(/^access_token=/))),a.length&&(o+=`?${a.join("&")}`),o}canonicalizeTileset(t,e){const r=!!e&&ee(e),o=[];for(const a of t.tiles||[])oe(a)?o.push(this.canonicalizeTileURL(a,r)):o.push(a);return o}_makeAPIURL(t,e){const r="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",o=Pe(He.API_URL);if(t.protocol=o.protocol,t.authority=o.authority,t.protocol==="http"){const a=t.params.indexOf("secure");a>=0&&t.params.splice(a,1)}if(o.path!=="/"&&(t.path=`${o.path}${t.path}`),!He.REQUIRE_ACCESS_TOKEN)return Ae(t);if(e=e||He.ACCESS_TOKEN,!this._silenceAuthErrors){if(!e)throw new Error(`An API access token is required to use Mapbox GL. ${r}`);if(e[0]==="s")throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${r}`)}return t.params=t.params.filter(a=>a.indexOf("access_token")===-1),t.params.push(`access_token=${e||""}`),Ae(t)}},s.ResourceType=Lo,s.SegmentVector=gr,s.SourceCache=Ca,s.StencilMode=cp,s.StructArrayLayout1ui2=xi,s.StructArrayLayout2f1f2i16=We,s.StructArrayLayout2i4=Ee,s.StructArrayLayout2ui4=Cr,s.StructArrayLayout3f12=ut,s.StructArrayLayout3ui6=$e,s.StructArrayLayout4i8=_e,s.StructArrayLayout5f20=Bt,s.Texture=sc,s.Tile=sp,s.Transitionable=M,s.Uniform1f=nh,s.Uniform1i=class extends Wo{constructor(t){super(t),this.current=0}set(t,e,r){this.fetchUniformLocation(t,e)&&this.current!==r&&(this.current=r,this.gl.uniform1i(this.location,r))}},s.Uniform2f=class extends Wo{constructor(t){super(t),this.current=[0,0]}set(t,e,r){this.fetchUniformLocation(t,e)&&(r[0]===this.current[0]&&r[1]===this.current[1]||(this.current=r,this.gl.uniform2f(this.location,r[0],r[1])))}},s.Uniform3f=class extends Wo{constructor(t){super(t),this.current=[0,0,0]}set(t,e,r){this.fetchUniformLocation(t,e)&&(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])))}},s.Uniform4f=kp,s.UniformColor=Sp,s.UniformMatrix2f=class extends Wo{constructor(t){super(t),this.current=pf}set(t,e,r){if(this.fetchUniformLocation(t,e)){for(let o=0;o<4;o++)if(r[o]!==this.current[o]){this.current=r,this.gl.uniformMatrix2fv(this.location,!1,r);break}}}},s.UniformMatrix3f=class extends Wo{constructor(t){super(t),this.current=uf}set(t,e,r){if(this.fetchUniformLocation(t,e)){for(let o=0;o<9;o++)if(r[o]!==this.current[o]){this.current=r,this.gl.uniformMatrix3fv(this.location,!1,r);break}}}},s.UniformMatrix4f=class extends Wo{constructor(t){super(t),this.current=hf}set(t,e,r){if(this.fetchUniformLocation(t,e)){if(r[12]!==this.current[12]||r[0]!==this.current[0])return this.current=r,void this.gl.uniformMatrix4fv(this.location,!1,r);for(let o=1;o<16;o++)if(r[o]!==this.current[o]){this.current=r,this.gl.uniformMatrix4fv(this.location,!1,r);break}}}},s.UnwrappedTileID=Pd,s.ValidationError=Oe,s.VectorTileFeature=vh,s.VectorTileWorkerSource=class extends Xn{constructor(t,e,r,o,a){super(),this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=a||Vm,this.loading={},this.loaded={},this.deduped=new Nm(t.scheduler),this.isSpriteLoaded=o,this.scheduler=t.scheduler}loadTile(t,e){const r=t.uid,o=t&&t.request,a=o&&o.collectResourceTiming,c=this.loading[r]=new R_(t);c.abort=this.loadVectorData(t,(u,d)=>{const f=!this.loading[r];if(delete this.loading[r],f||u||!d)return c.status="done",f||(this.loaded[r]=c),e(u);const g=d.rawData,x={};d.expires&&(x.expires=d.expires),d.cacheControl&&(x.cacheControl=d.cacheControl),c.vectorTile=d.vectorTile||new qu(new Sh(g));const w=()=>{c.parse(c.vectorTile,this.layerIndex,this.availableImages,this.actor,(b,k)=>{if(b||!k)return e(b);const S={};if(a){const I=Bs(o);I.length>0&&(S.resourceTiming=JSON.parse(JSON.stringify(I)))}e(null,sr({rawTileData:g.slice(0)},k,x,S))})};this.isSpriteLoaded?w():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(w,{type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom}):w()}),this.loaded=this.loaded||{},this.loaded[r]=c})}reloadTile(t,e){const r=this.loaded,o=t.uid,a=this;if(r&&r[o]){const c=r[o];c.showCollisionBoxes=t.showCollisionBoxes,c.enableTerrain=!!t.enableTerrain,c.projection=t.projection,c.tileTransform=Ia(t.tileID.canonical,t.projection);const u=(d,f)=>{const g=c.reloadCallback;g&&(delete c.reloadCallback,c.parse(c.vectorTile,a.layerIndex,this.availableImages,a.actor,g)),e(d,f)};c.status==="parsing"?c.reloadCallback=u:c.status==="done"&&(c.vectorTile?c.parse(c.vectorTile,this.layerIndex,this.availableImages,this.actor,u):u())}}abortTile(t,e){const r=t.uid,o=this.loading[r];o&&(o.abort&&o.abort(),delete this.loading[r]),e()}removeTile(t,e){const r=this.loaded,o=t.uid;r&&r[o]&&delete r[o],e()}},s.WritingMode=zi,s.ZoomDependentExpression=ua,s.add=Ho,s.addDynamicAttributes=Bh,s.adjoint=function(t,e){var r=e[0],o=e[1],a=e[2],c=e[3],u=e[4],d=e[5],f=e[6],g=e[7],x=e[8];return t[0]=u*x-d*g,t[1]=a*g-o*x,t[2]=o*d-a*u,t[3]=d*f-c*x,t[4]=r*x-a*f,t[5]=a*c-r*d,t[6]=c*g-u*f,t[7]=o*f-r*g,t[8]=r*u-o*c,t},s.asyncAll=rr,s.bezier=Hr,s.bindAll=Po,s.boundsAttributes=Em,s.bufferConvexPolygon=function(t,e){const r=[];for(let o=0;o<t.length;o++){const a=tr(o-1,-1,t.length-1),c=tr(o+1,-1,t.length-1),u=t[o],d=t[c],f=t[a].sub(u).unit(),g=d.sub(u).unit(),x=g.angleWithSep(f.x,f.y),w=f.add(g).unit().mult(-1*e/Math.sin(x/2));r.push(u.add(w))}return r},s.cacheEntryPossiblyAdded=function(t){qn++,qn>Fa&&(t.getActor().send("enforceCacheSizeLimit",Ba),qn=0)},s.calculateGlobeLabelMatrix=function(t,e){const{x:r,y:o}=t.point,a=Yp(r,o,t.worldSize/t._pixelsPerMercatorPixel,0,0);return wa(a,a,Su(ko(e)))},s.calculateGlobeMatrix=function(t){const{x:e,y:r}=t.point,{lng:o,lat:a}=t._center;return Yp(e,r,t.worldSize,o,a)},s.calculateGlobeMercatorMatrix=function(t){const e=t.pixelsPerMeter,r=e/lo(1,t.center.lat),o=ao(new Float64Array(16));return Dl(o,o,[t.point.x,t.point.y,0]),ba(o,o,[r,r,e]),Float32Array.from(o)},s.circumferenceAtLatitude=Au,s.clamp=it,s.clearTileCache=function(t){if(!$n())return;const e=ve.caches.delete(an);t&&e.catch(t).then(()=>t())},s.clipLine=am,s.clone=function(t){var e=new vi(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},s.clone$1=si,s.collisionCircleLayout=Dg,s.config=He,s.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},s.create=function(){var t=new vi(16);return vi!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},s.create$1=Ip,s.createExpression=Tn,s.createLayout=te,s.createStyleLayer=function(t){return t.type==="custom"?new E_(t):new S_[t.type](t)},s.cross=xu,s.degToRad=lt,s.distance=function(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},s.div=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t},s.dot=ji,s.earthRadius=Gl,s.ease=Sr,s.easeCubicInOut=wt,s.ecefToLatLng=function([t,e,r]){const o=Math.hypot(t,e,r),a=Math.atan2(t,r),c=.5*Math.PI-Math.acos(-e/o);return new Ot(Ke(a),Ke(c))},s.emitValidationErrors=Qc,s.endsWith=rn,s.enforceCacheSizeLimit=function(t){Do(),mi&&mi.then(e=>{e.keys().then(r=>{for(let o=0;o<r.length-t;o++)e.delete(r[o])})})},s.evaluateSizeForFeature=Eh,s.evaluateSizeForZoom=ks,s.evaluateVariableOffset=um,s.evented=p,s.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},s.exactEquals$1=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},s.exported=Xi,s.exported$1=Je,s.extend=sr,s.extend$1=Yi,s.fillExtrusionHeightLift=Id,s.filterObject=on,s.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},s.fromQuat=function(t,e){var r=e[0],o=e[1],a=e[2],c=e[3],u=r+r,d=o+o,f=a+a,g=r*u,x=o*u,w=o*d,b=a*u,k=a*d,S=a*f,I=c*u,D=c*d,U=c*f;return t[0]=1-w-S,t[1]=x+U,t[2]=b-D,t[3]=0,t[4]=x-U,t[5]=1-g-S,t[6]=k+I,t[7]=0,t[8]=b+D,t[9]=k-I,t[10]=1-g-w,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},s.fromRotation=function(t,e){var r=Math.sin(e),o=Math.cos(e);return t[0]=o,t[1]=r,t[2]=0,t[3]=-r,t[4]=o,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},s.fromScaling=zp,s.furthestTileCorner=function(t){const e=Math.round((t+45+360)%360/90)%4;return Ge[e]},s.getAABBPointSquareDist=function(t,e,r){let o=0;for(let a=0;a<2;++a){const c=r?r[a]:0;t[a]>c&&(o+=(t[a]-c)*(t[a]-c)),e[a]<c&&(o+=(c-e[a])*(c-e[a]))}return o},s.getAnchorAlignment=Ju,s.getAnchorJustification=tp,s.getBounds=function(t){let e=1/0,r=1/0,o=-1/0,a=-1/0;for(const c of t)e=Math.min(e,c.x),r=Math.min(r,c.y),o=Math.max(o,c.x),a=Math.max(a,c.y);return{min:new De(e,r),max:new De(o,a)}},s.getColumn=yo,s.getDefaultExportFromCjs=ai,s.getGridMatrix=function(t,e,r,o){const a=e.getNorth(),c=e.getSouth(),u=e.getWest(),d=e.getEast(),f=1<<t.z,g=d-u,x=a-c,w=g/Ea,b=-x/jl[r],k=[0,w,0,b,0,0,a,u,0];if(t.z>0){const S=180/o;Cp(k,k,[S/g+1,0,0,0,S/x+1,0,-.5*S/w,.5*S/b,1])}return k[2]=f,k[5]=t.x,k[8]=t.y,k},s.getImage=G,s.getJSON=function(t,e){return Bo(sr(t,{type:"json"}),e)},s.getLatitudinalLod=function(t){const e=qr-5;t=it(t,-e,e)/e*90;const r=Math.pow(Math.abs(Math.sin(lt(t))),3);return Math.round(r*(jl.length-1))},s.getMapSessionAPI=Mr,s.getPerformanceMeasurement=Bs,s.getProjection=xm,s.getRTLTextPluginStatus=m,s.getReferrer=Ro,s.getTilePoint=function(t,{x:e,y:r},o=0){return new De(((e-o)*t.scale-t.x)*Xe,(r*t.scale-t.y)*Xe)},s.getTileVec3=function(t,e,r=0){return gs(((e.x-r)*t.scale-t.x)*Xe,(e.y*t.scale-t.y)*Xe,Qp(e.z,e.y))},s.getVideo=function(t,e){const r=ve.document.createElement("video");r.muted=!0,r.onloadstart=function(){e(null,r)};for(let o=0;o<t.length;o++){const a=ve.document.createElement("source");Oa(t[o])||(r.crossOrigin="Anonymous"),a.src=t[o],r.appendChild(a)}return{cancel:()=>{}}},s.globeCenterToScreenPoint=function(t){const e=[0,0,0],r=ao(new Float64Array(16));return wa(r,t.pixelMatrix,t.globeMatrix),pr(e,e,r),new De(e[0],e[1])},s.globeDenormalizeECEF=Su,s.globeECEFOrigin=function(t,e){const r=[0,0,0];return pr(r,r,Vl(ko(e.canonical))),pr(r,r,t),r},s.globeMetersToEcef=lh,s.globeNormalizeECEF=Vl,s.globePixelsToTileUnits=function(t,e){return Xe/(512*Math.pow(2,t))*hh(ko(e))},s.globePoleMatrixForTile=function(t,e,r){const o=ao(new Float64Array(16)),a=(e/(1<<t)-.5)*Math.PI*2;return sh(o,r.globeMatrix,a),Float32Array.from(o)},s.globeTileBounds=ko,s.globeTiltAtLngLat=Hp,s.globeToMercatorTransition=xs,s.globeUseCustomAntiAliasing=function(t,e,r){const o=xs(r.zoom),a=t.style.map._antialias,c=!!e.extStandardDerivatives,u=e.extStandardDerivativesForceOff||t.terrain&&t.terrain.exaggeration()>0;return o===0&&!a&&!u&&c},s.identity=ao,s.identity$1=Up,s.invert=fu,s.isFullscreen=function(){return!!ve.document.fullscreenElement||!!ve.document.webkitFullscreenElement},s.isLngLatBehindGlobe=Mu,s.isMapAuthenticated=function(t){return Xr.has(t)},s.isMapboxURL=ee,s.isSafariWithAntialiasingBug=function(t){const e=t.navigator?t.navigator.userAgent:null;return!!nn(t)&&e&&(e.match("Version/15.4")||e.match("Version/15.5")||e.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},s.latFromMercatorY=$r,s.latLngToECEF=ys,s.len=wf,s.length=Ll,s.length$1=function(t){return Math.hypot(t[0],t[1],t[2],t[3])},s.lngFromMercatorX=Ci,s.loadVectorTile=Vm,s.makeRequest=Bo,s.mapValue=function(t,e,r,o,a){return it((t-e)/(r-e)*(a-o)+o,o,a)},s.mercatorScale=ed,s.mercatorXfromLng=So,s.mercatorYfromLat=Mo,s.mercatorZfromAltitude=lo,s.mul=xf,s.mul$1=vf,s.multiply=wa,s.multiply$1=Cp,s.multiply$2=Lp,s.nextPowerOfTwo=qi,s.normalize=ti,s.normalize$1=bf,s.normalize$2=Fp,s.number=bt,s.ortho=function(t,e,r,o,a,c,u){var d=1/(e-r),f=1/(o-a),g=1/(c-u);return t[0]=-2*d,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*f,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*g,t[11]=0,t[12]=(e+r)*d,t[13]=(a+o)*f,t[14]=(u+c)*g,t[15]=1,t},s.pbf=Ud,s.perspective=function(t,e,r,o,a){var c,u=1/Math.tan(e/2);return t[0]=u/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,a!=null&&a!==1/0?(t[10]=(a+o)*(c=1/(o-a)),t[14]=2*a*o*c):(t[10]=-1,t[14]=-2*o),t},s.pick=function(t,e){const r={};for(let o=0;o<e.length;o++){const a=e[o];a in t&&(r[a]=t[a])}return r},s.plugin=y,s.pointGeometry=jr,s.polesInViewport=function(t){const e=ao(new Float64Array(16));wa(e,t.pixelMatrix,t.globeMatrix);const r=[0,Ni,0],o=[0,Vi,0];return pr(r,r,e),pr(o,o,e),[r[0]>0&&r[0]<=t.width&&r[1]>0&&r[1]<=t.height&&!Mu(t,new Ot(t.center.lat,90)),o[0]>0&&o[0]<=t.width&&o[1]>0&&o[1]<=t.height&&!Mu(t,new Ot(t.center.lat,-90))]},s.polygonContainsPoint=Ma,s.polygonIntersectsBox=sd,s.polygonIntersectsPolygon=id,s.polygonizeBounds=function(t,e,r=0,o=!0){const a=new De(r,r),c=t.sub(a),u=e.add(a),d=[c,new De(u.x,c.y),u,new De(c.x,u.y)];return o&&d.push(c.clone()),d},s.posAttributes=Ul,s.postMapLoadEvent=dr,s.postPerformanceEvent=Tr,s.postTurnstileEvent=_t,s.potpack=Yu,s.prevPowerOfTwo=function(t){return t<=1?1:Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},s.radToDeg=Ke,s.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],s.registerForPluginStateChange=function(t){return t({pluginStatus:l,pluginURL:i}),p.on("pluginStateChange",t),t},s.removeAuthState=function(t){Xr.delete(t)},s.renderColorRamp=Bu,s.resample=td,s.rotateX=gu,s.rotateX$1=jp,s.rotateY=sh,s.rotateY$1=Np,s.rotateZ=function(t,e,r){var o=Math.sin(r),a=Math.cos(r),c=e[0],u=e[1],d=e[2],f=e[3],g=e[4],x=e[5],w=e[6],b=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=c*a+g*o,t[1]=u*a+x*o,t[2]=d*a+w*o,t[3]=f*a+b*o,t[4]=g*a-c*o,t[5]=x*a-u*o,t[6]=w*a-d*o,t[7]=b*a-f*o,t},s.rotateZ$1=function(t,e,r){r*=.5;var o=e[0],a=e[1],c=e[2],u=e[3],d=Math.sin(r),f=Math.cos(r);return t[0]=o*f+a*d,t[1]=a*f-o*d,t[2]=c*f+u*d,t[3]=u*f-c*d,t},s.scale=ba,s.scale$1=Bp,s.scale$2=Ii,s.scaleAndAdd=Fl,s.set=function(t,e,r,o){return t[0]=e,t[1]=r,t[2]=o,t},s.setCacheLimits=function(t,e){Ba=t,Fa=e},s.setColumn=function(t,e,r){t[4*e+0]=r[0],t[4*e+1]=r[1],t[4*e+2]=r[2],t[4*e+3]=r[3]},s.setRTLTextPlugin=function(t,e,r=!1){if(l===Al||l===Il||l===Cl)throw new Error("setRTLTextPlugin cannot be called multiple times.");i=Xi.resolveURL(t),l=Al,Mn=e,h(),r||_()},s.smoothstep=pi,s.spec=me,s.squaredLength=function(t){var e=t[0],r=t[1],o=t[2];return e*e+r*r+o*o},s.storeAuthState=function(t,e){e?Xr.add(t):Xr.delete(t)},s.sub=so,s.subtract=yu,s.symbolSize=Lg,s.tileAABB=function(t,e,r,o,a,c,u,d,f){if(f.name==="globe")return Mf(t,e,new bh(r,o,a));const g=Ia({z:r,x:o,y:a},f);return new ri([(c+g.x/g.scale)*e,e*(g.y/g.scale),u],[(c+g.x2/g.scale)*e,e*(g.y2/g.scale),d])},s.tileCornersToBounds=ch,s.tileTransform=Ia,s.transformMat3=function(t,e,r){var o=e[0],a=e[1],c=e[2];return t[0]=o*r[0]+a*r[3]+c*r[6],t[1]=o*r[1]+a*r[4]+c*r[7],t[2]=o*r[2]+a*r[5]+c*r[8],t},s.transformMat4=pr,s.transformMat4$1=Ta,s.transformQuat=Rp,s.transitionTileAABBinECEF=Zp,s.translate=Dl,s.transpose=function(t,e){if(t===e){var r=e[1],o=e[2],a=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=o,t[7]=a}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},s.triggerPluginCompletionEvent=n,s.uniqueId=tn,s.updateGlobeVertexNormal=function(t,e,r,o,a){const c=5*e+2;t.float32[c+0]=r,t.float32[c+1]=o,t.float32[c+2]=a},s.validateCustomStyleLayer=function(t){const e=[],r=t.id;return r===void 0&&e.push({message:`layers.${r}: missing required property "id"`}),t.render===void 0&&e.push({message:`layers.${r}: missing required method "render"`}),t.renderingMode&&t.renderingMode!=="2d"&&t.renderingMode!=="3d"&&e.push({message:`layers.${r}: property "renderingMode" must be either "2d" or "3d"`}),e},s.validateFilter=t=>yi(ga(t)),s.validateFog=t=>yi(Hc(t)),s.validateLayer=t=>yi(Zc(t)),s.validateLight=t=>yi(Yc(t)),s.validateSource=t=>yi(Wc(t)),s.validateStyle=Jc,s.validateTerrain=t=>yi(Tl(t)),s.values=Kr,s.vectorTile=xh,s.version=yt,s.warnOnce=ir,s.window=ve,s.wrap=tr}),Qt(["./shared"],function(s){function ve(q){if(typeof q=="number"||typeof q=="boolean"||typeof q=="string"||q==null)return JSON.stringify(q);if(Array.isArray(q)){let z="[";for(const G of q)z+=`${ve(G)},`;return`${z}]`}let C="{";for(const z of Object.keys(q).sort())C+=`${z}:${ve(q[z])},`;return`${C}}`}function yt(q){let C="";for(const z of s.refProperties)C+=`/${ve(q[z])}`;return C}class Xt{constructor(C){this.keyCache={},C&&this.replace(C)}replace(C){this._layerConfigs={},this._layers={},this.update(C,[])}update(C,z){for(const Y of C)this._layerConfigs[Y.id]=Y,(this._layers[Y.id]=s.createStyleLayer(Y)).compileFilter(),this.keyCache[Y.id]&&delete this.keyCache[Y.id];for(const Y of z)delete this.keyCache[Y],delete this._layerConfigs[Y],delete this._layers[Y];this.familiesBySource={};const G=function(Y,ee){const oe={};for(let Q=0;Q<Y.length;Q++){const pe=ee&&ee[Y[Q].id]||yt(Y[Q]);ee&&(ee[Y[Q].id]=pe);let ze=oe[pe];ze||(ze=oe[pe]=[]),ze.push(Y[Q])}const ie=[];for(const Q in oe)ie.push(oe[Q]);return ie}(s.values(this._layerConfigs),this.keyCache);for(const Y of G){const ee=Y.map(Pe=>this._layers[Pe.id]),oe=ee[0];if(oe.visibility==="none")continue;const ie=oe.source||"";let Q=this.familiesBySource[ie];Q||(Q=this.familiesBySource[ie]={});const pe=oe.sourceLayer||"_geojsonTileLayer";let ze=Q[pe];ze||(ze=Q[pe]=[]),ze.push(ee)}}}class He{loadTile(C,z){const{uid:G,encoding:Y,rawImageData:ee,padding:oe,buildQuadTree:ie}=C,Q=s.window.ImageBitmap&&ee instanceof s.window.ImageBitmap?this.getImageData(ee,oe):ee;z(null,new s.DEMData(G,Q,Y,oe<1,ie))}getImageData(C,z){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(C.width,C.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=C.width,this.offscreenCanvas.height=C.height,this.offscreenCanvasContext.drawImage(C,0,0,C.width,C.height);const G=this.offscreenCanvasContext.getImageData(-z,-z,C.width+2*z,C.height+2*z);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),G}}function Je(q,C){if(q.length!==0){vt(q[0],C);for(var z=1;z<q.length;z++)vt(q[z],!C)}}function vt(q,C){for(var z=0,G=0,Y=0,ee=q.length,oe=ee-1;Y<ee;oe=Y++){var ie=(q[Y][0]-q[oe][0])*(q[oe][1]+q[Y][1]),Q=z+ie;G+=Math.abs(z)>=Math.abs(ie)?z-Q+ie:ie-Q+z,z=Q}z+G>=0!=!!C&&q.reverse()}var er=s.getDefaultExportFromCjs(function q(C,z){var G,Y=C&&C.type;if(Y==="FeatureCollection")for(G=0;G<C.features.length;G++)q(C.features[G],z);else if(Y==="GeometryCollection")for(G=0;G<C.geometries.length;G++)q(C.geometries[G],z);else if(Y==="Feature")q(C.geometry,z);else if(Y==="Polygon")Je(C.coordinates,z);else if(Y==="MultiPolygon")for(G=0;G<C.coordinates.length;G++)Je(C.coordinates[G],z);return C});const kr=s.VectorTileFeature.prototype.toGeoJSON;var Dt={exports:{}},Ei=s.pointGeometry,ki=s.vectorTile.VectorTileFeature,ai=fo;function fo(q,C){this.options=C||{},this.features=q,this.length=q.length}function Ur(q,C){this.id=typeof q.id=="number"?q.id:void 0,this.type=q.type,this.rawGeometry=q.type===1?[q.geometry]:q.geometry,this.properties=q.tags,this.extent=C||4096}fo.prototype.feature=function(q){return new Ur(this.features[q],this.options.extent)},Ur.prototype.loadGeometry=function(){var q=this.rawGeometry;this.geometry=[];for(var C=0;C<q.length;C++){for(var z=q[C],G=[],Y=0;Y<z.length;Y++)G.push(new Ei(z[Y][0],z[Y][1]));this.geometry.push(G)}return this.geometry},Ur.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var q=this.geometry,C=1/0,z=-1/0,G=1/0,Y=-1/0,ee=0;ee<q.length;ee++)for(var oe=q[ee],ie=0;ie<oe.length;ie++){var Q=oe[ie];C=Math.min(C,Q.x),z=Math.max(z,Q.x),G=Math.min(G,Q.y),Y=Math.max(Y,Q.y)}return[C,G,z,Y]},Ur.prototype.toGeoJSON=ki.prototype.toGeoJSON;var Rr=s.pbf,jr=ai;function br(q){var C=new Rr;return function(z,G){for(var Y in z.layers)G.writeMessage(3,De,z.layers[Y])}(q,C),C.finish()}function De(q,C){var z;C.writeVarintField(15,q.version||1),C.writeStringField(1,q.name||""),C.writeVarintField(5,q.extent||4096);var G={keys:[],values:[],keycache:{},valuecache:{}};for(z=0;z<q.length;z++)G.feature=q.feature(z),C.writeMessage(2,Un,G);var Y=G.keys;for(z=0;z<Y.length;z++)C.writeStringField(3,Y[z]);var ee=G.values;for(z=0;z<ee.length;z++)C.writeMessage(4,wt,ee[z])}function Un(q,C){var z=q.feature;z.id!==void 0&&C.writeVarintField(1,z.id),C.writeMessage(2,jn,q),C.writeVarintField(3,z.type),C.writeMessage(4,Ge,z)}function jn(q,C){var z=q.feature,G=q.keys,Y=q.values,ee=q.keycache,oe=q.valuecache;for(var ie in z.properties){var Q=z.properties[ie],pe=ee[ie];if(Q!==null){pe===void 0&&(G.push(ie),ee[ie]=pe=G.length-1),C.writeVarint(pe);var ze=typeof Q;ze!=="string"&&ze!=="boolean"&&ze!=="number"&&(Q=JSON.stringify(Q));var Pe=ze+":"+Q,Ae=oe[Pe];Ae===void 0&&(Y.push(Q),oe[Pe]=Ae=Y.length-1),C.writeVarint(Ae)}}}function lt(q,C){return(C<<3)+(7&q)}function Ke(q){return q<<1^q>>31}function Ge(q,C){for(var z=q.loadGeometry(),G=q.type,Y=0,ee=0,oe=z.length,ie=0;ie<oe;ie++){var Q=z[ie],pe=1;G===1&&(pe=Q.length),C.writeVarint(lt(1,pe));for(var ze=G===3?Q.length-1:Q.length,Pe=0;Pe<ze;Pe++){Pe===1&&G!==1&&C.writeVarint(lt(2,ze-1));var Ae=Q[Pe].x-Y,ot=Q[Pe].y-ee;C.writeVarint(Ke(Ae)),C.writeVarint(Ke(ot)),Y+=Ae,ee+=ot}G===3&&C.writeVarint(lt(7,1))}}function wt(q,C){var z=typeof q;z==="string"?C.writeStringField(1,q):z==="boolean"?C.writeBooleanField(7,q):z==="number"&&(q%1!=0?C.writeDoubleField(3,q):q<0?C.writeSVarintField(6,q):C.writeVarintField(5,q))}Dt.exports=br,Dt.exports.fromVectorTileJs=br,Dt.exports.fromGeojsonVt=function(q,C){C=C||{};var z={};for(var G in q)z[G]=new jr(q[G].features,C),z[G].name=G,z[G].version=C.version,z[G].extent=C.extent;return br({layers:z})},Dt.exports.GeoJSONWrapper=jr;var Hr=s.getDefaultExportFromCjs(Dt.exports);const Sr={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:q=>q},it=Math.fround||(pi=new Float32Array(1),q=>(pi[0]=+q,pi[0]));var pi;const tr=3,rr=5,Kr=6;class sr{constructor(C){this.options=Object.assign(Object.create(Sr),C),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(C){const{log:z,minZoom:G,maxZoom:Y}=this.options;z&&console.time("total time");const ee=`prepare ${C.length} points`;z&&console.time(ee),this.points=C;const oe=[];for(let Q=0;Q<C.length;Q++){const pe=C[Q];if(!pe.geometry)continue;const[ze,Pe]=pe.geometry.coordinates,Ae=it(_o(ze)),ot=it(qi(Pe));oe.push(Ae,ot,1/0,Q,-1,1),this.options.reduce&&oe.push(0)}let ie=this.trees[Y+1]=this._createTree(oe);z&&console.timeEnd(ee);for(let Q=Y;Q>=G;Q--){const pe=+Date.now();ie=this.trees[Q]=this._createTree(this._cluster(ie,Q)),z&&console.log("z%d: %d clusters in %dms",Q,ie.numItems,+Date.now()-pe)}return z&&console.timeEnd("total time"),this}getClusters(C,z){let G=((C[0]+180)%360+360)%360-180;const Y=Math.max(-90,Math.min(90,C[1]));let ee=C[2]===180?180:((C[2]+180)%360+360)%360-180;const oe=Math.max(-90,Math.min(90,C[3]));if(C[2]-C[0]>=360)G=-180,ee=180;else if(G>ee){const Pe=this.getClusters([G,Y,180,oe],z),Ae=this.getClusters([-180,Y,ee,oe],z);return Pe.concat(Ae)}const ie=this.trees[this._limitZoom(z)],Q=ie.range(_o(G),qi(oe),_o(ee),qi(Y)),pe=ie.data,ze=[];for(const Pe of Q){const Ae=this.stride*Pe;ze.push(pe[Ae+rr]>1?go(pe,Ae,this.clusterProps):this.points[pe[Ae+tr]])}return ze}getChildren(C){const z=this._getOriginId(C),G=this._getOriginZoom(C),Y="No cluster with the specified id.",ee=this.trees[G];if(!ee)throw new Error(Y);const oe=ee.data;if(z*this.stride>=oe.length)throw new Error(Y);const ie=this.options.radius/(this.options.extent*Math.pow(2,G-1)),Q=ee.within(oe[z*this.stride],oe[z*this.stride+1],ie),pe=[];for(const ze of Q){const Pe=ze*this.stride;oe[Pe+4]===C&&pe.push(oe[Pe+rr]>1?go(oe,Pe,this.clusterProps):this.points[oe[Pe+tr]])}if(pe.length===0)throw new Error(Y);return pe}getLeaves(C,z,G){const Y=[];return this._appendLeaves(Y,C,z=z||10,G=G||0,0),Y}getTile(C,z,G){const Y=this.trees[this._limitZoom(C)],ee=Math.pow(2,C),{extent:oe,radius:ie}=this.options,Q=ie/oe,pe=(G-Q)/ee,ze=(G+1+Q)/ee,Pe={features:[]};return this._addTileFeatures(Y.range((z-Q)/ee,pe,(z+1+Q)/ee,ze),Y.data,z,G,ee,Pe),z===0&&this._addTileFeatures(Y.range(1-Q/ee,pe,1,ze),Y.data,ee,G,ee,Pe),z===ee-1&&this._addTileFeatures(Y.range(0,pe,Q/ee,ze),Y.data,-1,G,ee,Pe),Pe.features.length?Pe:null}getClusterExpansionZoom(C){let z=this._getOriginZoom(C)-1;for(;z<=this.options.maxZoom;){const G=this.getChildren(C);if(z++,G.length!==1)break;C=G[0].properties.cluster_id}return z}_appendLeaves(C,z,G,Y,ee){const oe=this.getChildren(z);for(const ie of oe){const Q=ie.properties;if(Q&&Q.cluster?ee+Q.point_count<=Y?ee+=Q.point_count:ee=this._appendLeaves(C,Q.cluster_id,G,Y,ee):ee<Y?ee++:C.push(ie),C.length===G)break}return ee}_createTree(C){const z=new s.KDBush(C.length/this.stride|0,this.options.nodeSize,Float32Array);for(let G=0;G<C.length;G+=this.stride)z.add(C[G],C[G+1]);return z.finish(),z.data=C,z}_addTileFeatures(C,z,G,Y,ee,oe){for(const ie of C){const Q=ie*this.stride,pe=z[Q+rr]>1;let ze,Pe,Ae;if(pe)ze=tn(z,Q,this.clusterProps),Pe=z[Q],Ae=z[Q+1];else{const nt=this.points[z[Q+tr]];ze=nt.properties;const[ht,_t]=nt.geometry.coordinates;Pe=_o(ht),Ae=qi(_t)}const ot={type:1,geometry:[[Math.round(this.options.extent*(Pe*ee-G)),Math.round(this.options.extent*(Ae*ee-Y))]],tags:ze};let ct;ct=pe||this.options.generateId?z[Q+tr]:this.points[z[Q+tr]].id,ct!==void 0&&(ot.id=ct),oe.features.push(ot)}}_limitZoom(C){return Math.max(this.options.minZoom,Math.min(Math.floor(+C),this.options.maxZoom+1))}_cluster(C,z){const{radius:G,extent:Y,reduce:ee,minPoints:oe}=this.options,ie=G/(Y*Math.pow(2,z)),Q=C.data,pe=[],ze=this.stride;for(let Pe=0;Pe<Q.length;Pe+=ze){if(Q[Pe+2]<=z)continue;Q[Pe+2]=z;const Ae=Q[Pe],ot=Q[Pe+1],ct=C.within(Q[Pe],Q[Pe+1],ie),nt=Q[Pe+rr];let ht=nt;for(const _t of ct){const or=_t*ze;Q[or+2]>z&&(ht+=Q[or+rr])}if(ht>nt&&ht>=oe){let _t,or=Ae*nt,dr=ot*nt,Nr=-1;const Tr=((Pe/ze|0)<<5)+(z+1)+this.points.length;for(const Di of ct){const Mr=Di*ze;if(Q[Mr+2]<=z)continue;Q[Mr+2]=z;const Xr=Q[Mr+rr];or+=Q[Mr]*Xr,dr+=Q[Mr+1]*Xr,Q[Mr+4]=Tr,ee&&(_t||(_t=this._map(Q,Pe,!0),Nr=this.clusterProps.length,this.clusterProps.push(_t)),ee(_t,this._map(Q,Mr)))}Q[Pe+4]=Tr,pe.push(or/ht,dr/ht,1/0,Tr,-1,ht),ee&&pe.push(Nr)}else{for(let _t=0;_t<ze;_t++)pe.push(Q[Pe+_t]);if(ht>1)for(const _t of ct){const or=_t*ze;if(!(Q[or+2]<=z)){Q[or+2]=z;for(let dr=0;dr<ze;dr++)pe.push(Q[or+dr])}}}}return pe}_getOriginId(C){return C-this.points.length>>5}_getOriginZoom(C){return(C-this.points.length)%32}_map(C,z,G){if(C[z+rr]>1){const oe=this.clusterProps[C[z+Kr]];return G?Object.assign({},oe):oe}const Y=this.points[C[z+tr]].properties,ee=this.options.map(Y);return G&&ee===Y?Object.assign({},ee):ee}}function go(q,C,z){return{type:"Feature",id:q[C+tr],properties:tn(q,C,z),geometry:{type:"Point",coordinates:[(G=q[C],360*(G-.5)),La(q[C+1])]}};var G}function tn(q,C,z){const G=q[C+rr],Y=G>=1e4?`${Math.round(G/1e3)}k`:G>=1e3?Math.round(G/100)/10+"k":G,ee=q[C+Kr],oe=ee===-1?{}:Object.assign({},z[ee]);return Object.assign(oe,{cluster:!0,cluster_id:q[C+tr],point_count:G,point_count_abbreviated:Y})}function _o(q){return q/360+.5}function qi(q){const C=Math.sin(q*Math.PI/180),z=.5-.25*Math.log((1+C)/(1-C))/Math.PI;return z<0?0:z>1?1:z}function La(q){const C=(180-360*q)*Math.PI/180;return 360*Math.atan(Math.exp(C))/Math.PI-90}function Po(q,C,z,G){for(var Y,ee=G,oe=z-C>>1,ie=z-C,Q=q[C],pe=q[C+1],ze=q[z],Pe=q[z+1],Ae=C+3;Ae<z;Ae+=3){var ot=rn(q[Ae],q[Ae+1],Q,pe,ze,Pe);if(ot>ee)Y=Ae,ee=ot;else if(ot===ee){var ct=Math.abs(Ae-oe);ct<ie&&(Y=Ae,ie=ct)}}ee>G&&(Y-C>3&&Po(q,C,Y,G),q[Y+2]=ee,z-Y>3&&Po(q,Y,z,G))}function rn(q,C,z,G,Y,ee){var oe=Y-z,ie=ee-G;if(oe!==0||ie!==0){var Q=((q-z)*oe+(C-G)*ie)/(oe*oe+ie*ie);Q>1?(z=Y,G=ee):Q>0&&(z+=oe*Q,G+=ie*Q)}return(oe=q-z)*oe+(ie=C-G)*ie}function gt(q,C,z,G){var Y={id:q===void 0?null:q,type:C,geometry:z,tags:G,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(ee){var oe=ee.geometry,ie=ee.type;if(ie==="Point"||ie==="MultiPoint"||ie==="LineString")on(ee,oe);else if(ie==="Polygon"||ie==="MultiLineString")for(var Q=0;Q<oe.length;Q++)on(ee,oe[Q]);else if(ie==="MultiPolygon")for(Q=0;Q<oe.length;Q++)for(var pe=0;pe<oe[Q].length;pe++)on(ee,oe[Q][pe])}(Y),Y}function on(q,C){for(var z=0;z<C.length;z+=3)q.minX=Math.min(q.minX,C[z]),q.minY=Math.min(q.minY,C[z+1]),q.maxX=Math.max(q.maxX,C[z]),q.maxY=Math.max(q.maxY,C[z+1])}function si(q,C,z,G){if(C.geometry){var Y=C.geometry.coordinates,ee=C.geometry.type,oe=Math.pow(z.tolerance/((1<<z.maxZoom)*z.extent),2),ie=[],Q=C.id;if(z.promoteId?Q=C.properties[z.promoteId]:z.generateId&&(Q=G||0),ee==="Point")Nn(Y,ie);else if(ee==="MultiPoint")for(var pe=0;pe<Y.length;pe++)Nn(Y[pe],ie);else if(ee==="LineString")ir(Y,ie,oe,!1);else if(ee==="MultiLineString"){if(z.lineMetrics){for(pe=0;pe<Y.length;pe++)ir(Y[pe],ie=[],oe,!1),q.push(gt(Q,"LineString",ie,C.properties));return}di(Y,ie,oe,!1)}else if(ee==="Polygon")di(Y,ie,oe,!0);else{if(ee!=="MultiPolygon"){if(ee==="GeometryCollection"){for(pe=0;pe<C.geometry.geometries.length;pe++)si(q,{id:Q,geometry:C.geometry.geometries[pe],properties:C.properties},z,G);return}throw new Error("Input data is not a valid GeoJSON object.")}for(pe=0;pe<Y.length;pe++){var ze=[];di(Y[pe],ze,oe,!0),ie.push(ze)}}q.push(gt(Q,ee,ie,C.properties))}}function Nn(q,C){C.push(Ra(q[0])),C.push(Zi(q[1])),C.push(0)}function ir(q,C,z,G){for(var Y,ee,oe=0,ie=0;ie<q.length;ie++){var Q=Ra(q[ie][0]),pe=Zi(q[ie][1]);C.push(Q),C.push(pe),C.push(0),ie>0&&(oe+=G?(Y*pe-Q*ee)/2:Math.sqrt(Math.pow(Q-Y,2)+Math.pow(pe-ee,2))),Y=Q,ee=pe}var ze=C.length-3;C[2]=1,Po(C,0,ze,z),C[ze+2]=1,C.size=Math.abs(oe),C.start=0,C.end=C.size}function di(q,C,z,G){for(var Y=0;Y<q.length;Y++){var ee=[];ir(q[Y],ee,z,G),C.push(ee)}}function Ra(q){return q/360+.5}function Zi(q){var C=Math.sin(q*Math.PI/180),z=.5-.25*Math.log((1+C)/(1-C))/Math.PI;return z<0?0:z>1?1:z}function li(q,C,z,G,Y,ee,oe,ie){if(G/=C,ee>=(z/=C)&&oe<G)return q;if(oe<z||ee>=G)return null;for(var Q=[],pe=0;pe<q.length;pe++){var ze=q[pe],Pe=ze.geometry,Ae=ze.type,ot=Y===0?ze.minX:ze.minY,ct=Y===0?ze.maxX:ze.maxY;if(ot>=z&&ct<G)Q.push(ze);else if(!(ct<z||ot>=G)){var nt=[];if(Ae==="Point"||Ae==="MultiPoint")Vn(Pe,nt,z,G,Y);else if(Ae==="LineString")nn(Pe,nt,z,G,Y,!1,ie.lineMetrics);else if(Ae==="MultiLineString")yo(Pe,nt,z,G,Y,!1);else if(Ae==="Polygon")yo(Pe,nt,z,G,Y,!0);else if(Ae==="MultiPolygon")for(var ht=0;ht<Pe.length;ht++){var _t=[];yo(Pe[ht],_t,z,G,Y,!0),_t.length&&nt.push(_t)}if(nt.length){if(ie.lineMetrics&&Ae==="LineString"){for(ht=0;ht<nt.length;ht++)Q.push(gt(ze.id,Ae,nt[ht],ze.tags));continue}Ae!=="LineString"&&Ae!=="MultiLineString"||(nt.length===1?(Ae="LineString",nt=nt[0]):Ae="MultiLineString"),Ae!=="Point"&&Ae!=="MultiPoint"||(Ae=nt.length===3?"Point":"MultiPoint"),Q.push(gt(ze.id,Ae,nt,ze.tags))}}}return Q.length?Q:null}function Vn(q,C,z,G,Y){for(var ee=0;ee<q.length;ee+=3){var oe=q[ee+Y];oe>=z&&oe<=G&&(C.push(q[ee]),C.push(q[ee+1]),C.push(q[ee+2]))}}function nn(q,C,z,G,Y,ee,oe){for(var ie,Q,pe=Gn(q),ze=Y===0?Ba:Fa,Pe=q.start,Ae=0;Ae<q.length-3;Ae+=3){var ot=q[Ae],ct=q[Ae+1],nt=q[Ae+2],ht=q[Ae+3],_t=q[Ae+4],or=Y===0?ot:ct,dr=Y===0?ht:_t,Nr=!1;oe&&(ie=Math.sqrt(Math.pow(ot-ht,2)+Math.pow(ct-_t,2))),or<z?dr>z&&(Q=ze(pe,ot,ct,ht,_t,z),oe&&(pe.start=Pe+ie*Q)):or>G?dr<G&&(Q=ze(pe,ot,ct,ht,_t,G),oe&&(pe.start=Pe+ie*Q)):an(pe,ot,ct,nt),dr<z&&or>=z&&(Q=ze(pe,ot,ct,ht,_t,z),Nr=!0),dr>G&&or<=G&&(Q=ze(pe,ot,ct,ht,_t,G),Nr=!0),!ee&&Nr&&(oe&&(pe.end=Pe+ie*Q),C.push(pe),pe=Gn(q)),oe&&(Pe+=ie)}var Tr=q.length-3;ot=q[Tr],ct=q[Tr+1],nt=q[Tr+2],(or=Y===0?ot:ct)>=z&&or<=G&&an(pe,ot,ct,nt),Tr=pe.length-3,ee&&Tr>=3&&(pe[Tr]!==pe[0]||pe[Tr+1]!==pe[1])&&an(pe,pe[0],pe[1],pe[2]),pe.length&&C.push(pe)}function Gn(q){var C=[];return C.size=q.size,C.start=q.start,C.end=q.end,C}function yo(q,C,z,G,Y,ee){for(var oe=0;oe<q.length;oe++)nn(q[oe],C,z,G,Y,ee,!1)}function an(q,C,z,G){q.push(C),q.push(z),q.push(G)}function Ba(q,C,z,G,Y,ee){var oe=(ee-C)/(G-C);return q.push(ee),q.push(z+(Y-z)*oe),q.push(1),oe}function Fa(q,C,z,G,Y,ee){var oe=(ee-z)/(Y-z);return q.push(C+(G-C)*oe),q.push(ee),q.push(1),oe}function mi(q,C){for(var z=[],G=0;G<q.length;G++){var Y,ee=q[G],oe=ee.type;if(oe==="Point"||oe==="MultiPoint"||oe==="LineString")Y=xo(ee.geometry,C);else if(oe==="MultiLineString"||oe==="Polygon"){Y=[];for(var ie=0;ie<ee.geometry.length;ie++)Y.push(xo(ee.geometry[ie],C))}else if(oe==="MultiPolygon")for(Y=[],ie=0;ie<ee.geometry.length;ie++){for(var Q=[],pe=0;pe<ee.geometry[ie].length;pe++)Q.push(xo(ee.geometry[ie][pe],C));Y.push(Q)}z.push(gt(ee.id,oe,Y,ee.tags))}return z}function xo(q,C){var z=[];z.size=q.size,q.start!==void 0&&(z.start=q.start,z.end=q.end);for(var G=0;G<q.length;G+=3)z.push(q[G]+C,q[G+1],q[G+2]);return z}function $n(q,C){if(q.transformed)return q;var z,G,Y,ee=1<<q.z,oe=q.x,ie=q.y;for(z=0;z<q.features.length;z++){var Q=q.features[z],pe=Q.geometry,ze=Q.type;if(Q.geometry=[],ze===1)for(G=0;G<pe.length;G+=2)Q.geometry.push(Do(pe[G],pe[G+1],C,ee,oe,ie));else for(G=0;G<pe.length;G++){var Pe=[];for(Y=0;Y<pe[G].length;Y+=2)Pe.push(Do(pe[G][Y],pe[G][Y+1],C,ee,oe,ie));Q.geometry.push(Pe)}}return q.transformed=!0,q}function Do(q,C,z,G,Y,ee){return[Math.round(z*(q*G-Y)),Math.round(z*(C*G-ee))]}function sn(q,C,z,G,Y){for(var ee=C===Y.maxZoom?0:Y.tolerance/((1<<C)*Y.extent),oe={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:z,y:G,z:C,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},ie=0;ie<q.length;ie++){oe.numFeatures++,qn(oe,q[ie],ee,Y);var Q=q[ie].minX,pe=q[ie].minY,ze=q[ie].maxX,Pe=q[ie].maxY;Q<oe.minX&&(oe.minX=Q),pe<oe.minY&&(oe.minY=pe),ze>oe.maxX&&(oe.maxX=ze),Pe>oe.maxY&&(oe.maxY=Pe)}return oe}function qn(q,C,z,G){var Y=C.geometry,ee=C.type,oe=[];if(ee==="Point"||ee==="MultiPoint")for(var ie=0;ie<Y.length;ie+=3)oe.push(Y[ie]),oe.push(Y[ie+1]),q.numPoints++,q.numSimplified++;else if(ee==="LineString")Lo(oe,Y,q,z,!1,!1);else if(ee==="MultiLineString"||ee==="Polygon")for(ie=0;ie<Y.length;ie++)Lo(oe,Y[ie],q,z,ee==="Polygon",ie===0);else if(ee==="MultiPolygon")for(var Q=0;Q<Y.length;Q++){var pe=Y[Q];for(ie=0;ie<pe.length;ie++)Lo(oe,pe[ie],q,z,!0,ie===0)}if(oe.length){var ze=C.tags||null;if(ee==="LineString"&&G.lineMetrics){for(var Pe in ze={},C.tags)ze[Pe]=C.tags[Pe];ze.mapbox_clip_start=Y.start/Y.size,ze.mapbox_clip_end=Y.end/Y.size}var Ae={geometry:oe,type:ee==="Polygon"||ee==="MultiPolygon"?3:ee==="LineString"||ee==="MultiLineString"?2:1,tags:ze};C.id!==null&&(Ae.id=C.id),q.features.push(Ae)}}function Lo(q,C,z,G,Y,ee){var oe=G*G;if(G>0&&C.size<(Y?oe:G))z.numPoints+=C.length/3;else{for(var ie=[],Q=0;Q<C.length;Q+=3)(G===0||C[Q+2]>oe)&&(z.numSimplified++,ie.push(C[Q]),ie.push(C[Q+1])),z.numPoints++;Y&&function(pe,ze){for(var Pe=0,Ae=0,ot=pe.length,ct=ot-2;Ae<ot;ct=Ae,Ae+=2)Pe+=(pe[Ae]-pe[ct])*(pe[Ae+1]+pe[ct+1]);if(Pe>0===ze)for(Ae=0,ot=pe.length;Ae<ot/2;Ae+=2){var nt=pe[Ae],ht=pe[Ae+1];pe[Ae]=pe[ot-2-Ae],pe[Ae+1]=pe[ot-1-Ae],pe[ot-2-Ae]=nt,pe[ot-1-Ae]=ht}}(ie,ee),q.push(ie)}}function vo(q,C){var z=(C=this.options=function(Y,ee){for(var oe in ee)Y[oe]=ee[oe];return Y}(Object.create(this.options),C)).debug;if(z&&console.time("preprocess data"),C.maxZoom<0||C.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(C.promoteId&&C.generateId)throw new Error("promoteId and generateId cannot be used together.");var G=function(Y,ee){var oe=[];if(Y.type==="FeatureCollection")for(var ie=0;ie<Y.features.length;ie++)si(oe,Y.features[ie],ee,ie);else si(oe,Y.type==="Feature"?Y:{geometry:Y},ee);return oe}(q,C);this.tiles={},this.tileCoords=[],z&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",C.indexMaxZoom,C.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),G=function(Y,ee){var oe=ee.buffer/ee.extent,ie=Y,Q=li(Y,1,-1-oe,oe,0,-1,2,ee),pe=li(Y,1,1-oe,2+oe,0,-1,2,ee);return(Q||pe)&&(ie=li(Y,1,-oe,1+oe,0,-1,2,ee)||[],Q&&(ie=mi(Q,1).concat(ie)),pe&&(ie=ie.concat(mi(pe,-1)))),ie}(G,C),G.length&&this.splitTile(G,0,0,0),z&&(G.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function Ro(q,C,z){return 32*((1<<q)*z+C)+q}function Bo(q,C){const z=q.tileID.canonical;if(!this._geoJSONIndex)return C(null,null);const G=this._geoJSONIndex.getTile(z.z,z.x,z.y);if(!G)return C(null,null);const Y=new class{constructor(oe){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=s.EXTENT,this.length=oe.length,this._features=oe}feature(oe){return new class{constructor(ie){this._feature=ie,this.extent=s.EXTENT,this.type=ie.type,this.properties=ie.tags,"id"in ie&&!isNaN(ie.id)&&(this.id=parseInt(ie.id,10))}loadGeometry(){if(this._feature.type===1){const ie=[];for(const Q of this._feature.geometry)ie.push([new s.Point(Q[0],Q[1])]);return ie}{const ie=[];for(const Q of this._feature.geometry){const pe=[];for(const ze of Q)pe.push(new s.Point(ze[0],ze[1]));ie.push(pe)}return ie}}toGeoJSON(ie,Q,pe){return kr.call(this,ie,Q,pe)}}(this._features[oe])}}(G.features);let ee=Hr(Y);ee.byteOffset===0&&ee.byteLength===ee.buffer.byteLength||(ee=new Uint8Array(ee)),C(null,{vectorTile:Y,rawData:ee.buffer})}vo.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},vo.prototype.splitTile=function(q,C,z,G,Y,ee,oe){for(var ie=[q,C,z,G],Q=this.options,pe=Q.debug;ie.length;){G=ie.pop(),z=ie.pop(),C=ie.pop(),q=ie.pop();var ze=1<<C,Pe=Ro(C,z,G),Ae=this.tiles[Pe];if(!Ae&&(pe>1&&console.time("creation"),Ae=this.tiles[Pe]=sn(q,C,z,G,Q),this.tileCoords.push({z:C,x:z,y:G}),pe)){pe>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",C,z,G,Ae.numFeatures,Ae.numPoints,Ae.numSimplified),console.timeEnd("creation"));var ot="z"+C;this.stats[ot]=(this.stats[ot]||0)+1,this.total++}if(Ae.source=q,Y){if(C===Q.maxZoom||C===Y)continue;var ct=1<<Y-C;if(z!==Math.floor(ee/ct)||G!==Math.floor(oe/ct))continue}else if(C===Q.indexMaxZoom||Ae.numPoints<=Q.indexMaxPoints)continue;if(Ae.source=null,q.length!==0){pe>1&&console.time("clipping");var nt,ht,_t,or,dr,Nr,Tr=.5*Q.buffer/Q.extent,Di=.5-Tr,Mr=.5+Tr,Xr=1+Tr;nt=ht=_t=or=null,dr=li(q,ze,z-Tr,z+Mr,0,Ae.minX,Ae.maxX,Q),Nr=li(q,ze,z+Di,z+Xr,0,Ae.minX,Ae.maxX,Q),q=null,dr&&(nt=li(dr,ze,G-Tr,G+Mr,1,Ae.minY,Ae.maxY,Q),ht=li(dr,ze,G+Di,G+Xr,1,Ae.minY,Ae.maxY,Q),dr=null),Nr&&(_t=li(Nr,ze,G-Tr,G+Mr,1,Ae.minY,Ae.maxY,Q),or=li(Nr,ze,G+Di,G+Xr,1,Ae.minY,Ae.maxY,Q),Nr=null),pe>1&&console.timeEnd("clipping"),ie.push(nt||[],C+1,2*z,2*G),ie.push(ht||[],C+1,2*z,2*G+1),ie.push(_t||[],C+1,2*z+1,2*G),ie.push(or||[],C+1,2*z+1,2*G+1)}}},vo.prototype.getTile=function(q,C,z){var G=this.options,Y=G.extent,ee=G.debug;if(q<0||q>24)return null;var oe=1<<q,ie=Ro(q,C=(C%oe+oe)%oe,z);if(this.tiles[ie])return $n(this.tiles[ie],Y);ee>1&&console.log("drilling down to z%d-%d-%d",q,C,z);for(var Q,pe=q,ze=C,Pe=z;!Q&&pe>0;)pe--,ze=Math.floor(ze/2),Pe=Math.floor(Pe/2),Q=this.tiles[Ro(pe,ze,Pe)];return Q&&Q.source?(ee>1&&console.log("found parent tile z%d-%d-%d",pe,ze,Pe),ee>1&&console.time("drilling down"),this.splitTile(Q.source,pe,ze,Pe,q,C,z),ee>1&&console.timeEnd("drilling down"),this.tiles[ie]?$n(this.tiles[ie],Y):null):null};class ln extends s.VectorTileWorkerSource{constructor(C,z,G,Y,ee){super(C,z,G,Y,Bo),ee&&(this.loadGeoJSON=ee)}loadData(C,z){const G=C&&C.request,Y=G&&G.collectResourceTiming;this.loadGeoJSON(C,(ee,oe)=>{if(ee||!oe)return z(ee);if(typeof oe!="object")return z(new Error(`Input data given to '${C.source}' is not a valid GeoJSON object.`));{er(oe,!0);try{if(C.filter){const Q=s.createExpression(C.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Q.result==="error")throw new Error(Q.value.map(ze=>`${ze.key}: ${ze.message}`).join(", "));oe={type:"FeatureCollection",features:oe.features.filter(ze=>Q.value.evaluate({zoom:0},ze))}}this._geoJSONIndex=C.cluster?new sr(function({superclusterOptions:Q,clusterProperties:pe}){if(!pe||!Q)return Q;const ze={},Pe={},Ae={accumulated:null,zoom:0},ot={properties:null},ct=Object.keys(pe);for(const nt of ct){const[ht,_t]=pe[nt],or=s.createExpression(_t),dr=s.createExpression(typeof ht=="string"?[ht,["accumulated"],["get",nt]]:ht);ze[nt]=or.value,Pe[nt]=dr.value}return Q.map=nt=>{ot.properties=nt;const ht={};for(const _t of ct)ht[_t]=ze[_t].evaluate(Ae,ot);return ht},Q.reduce=(nt,ht)=>{ot.properties=ht;for(const _t of ct)Ae.accumulated=nt[_t],nt[_t]=Pe[_t].evaluate(Ae,ot)},Q}(C)).load(oe.features):function(Q,pe){return new vo(Q,pe)}(oe,C.geojsonVtOptions)}catch(Q){return z(Q)}this.loaded={};const ie={};if(Y){const Q=s.getPerformanceMeasurement(G);Q&&(ie.resourceTiming={},ie.resourceTiming[C.source]=JSON.parse(JSON.stringify(Q)))}z(null,ie)}})}reloadTile(C,z){const G=this.loaded;return G&&G[C.uid]?super.reloadTile(C,z):this.loadTile(C,z)}loadGeoJSON(C,z){if(C.request)s.getJSON(C.request,z);else{if(typeof C.data!="string")return z(new Error(`Input data given to '${C.source}' is not a valid GeoJSON object.`));try{return z(null,JSON.parse(C.data))}catch{return z(new Error(`Input data given to '${C.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(C,z){try{z(null,this._geoJSONIndex.getClusterExpansionZoom(C.clusterId))}catch(G){z(G)}}getClusterChildren(C,z){try{z(null,this._geoJSONIndex.getChildren(C.clusterId))}catch(G){z(G)}}getClusterLeaves(C,z){try{z(null,this._geoJSONIndex.getLeaves(C.clusterId,C.limit,C.offset))}catch(G){z(G)}}}class Oa{constructor(C){this.self=C,this.actor=new s.Actor(C,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.defaultProjection=s.getProjection({name:"mercator"}),this.workerSourceTypes={vector:s.VectorTileWorkerSource,geojson:ln},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(z,G)=>{if(this.workerSourceTypes[z])throw new Error(`Worker source with name "${z}" already registered.`);this.workerSourceTypes[z]=G},this.self.registerRTLTextPlugin=z=>{if(s.plugin.isParsed())throw new Error("RTL text plugin already registered.");s.plugin.applyArabicShaping=z.applyArabicShaping,s.plugin.processBidirectionalText=z.processBidirectionalText,s.plugin.processStyledBidirectionalText=z.processStyledBidirectionalText}}clearCaches(C,z,G){delete this.layerIndexes[C],delete this.availableImages[C],delete this.workerSources[C],delete this.demWorkerSources[C],G()}checkIfReady(C,z,G){G()}setReferrer(C,z){this.referrer=z}spriteLoaded(C,z){this.isSpriteLoaded[C]=z;for(const G in this.workerSources[C]){const Y=this.workerSources[C][G];for(const ee in Y)Y[ee]instanceof s.VectorTileWorkerSource&&(Y[ee].isSpriteLoaded=z,Y[ee].fire(new s.Event("isSpriteLoaded")))}}setImages(C,z,G){this.availableImages[C]=z;for(const Y in this.workerSources[C]){const ee=this.workerSources[C][Y];for(const oe in ee)ee[oe].availableImages=z}G()}enableTerrain(C,z,G){this.terrain=z,G()}setProjection(C,z){this.projections[C]=s.getProjection(z)}setLayers(C,z,G){this.getLayerIndex(C).replace(z),G()}updateLayers(C,z,G){this.getLayerIndex(C).update(z.layers,z.removedIds),G()}loadTile(C,z,G){const Y=this.enableTerrain?s.extend({enableTerrain:this.terrain},z):z;Y.projection=this.projections[C]||this.defaultProjection,this.getWorkerSource(C,z.type,z.source).loadTile(Y,G)}loadDEMTile(C,z,G){const Y=this.enableTerrain?s.extend({buildQuadTree:this.terrain},z):z;this.getDEMWorkerSource(C,z.source).loadTile(Y,G)}reloadTile(C,z,G){const Y=this.enableTerrain?s.extend({enableTerrain:this.terrain},z):z;Y.projection=this.projections[C]||this.defaultProjection,this.getWorkerSource(C,z.type,z.source).reloadTile(Y,G)}abortTile(C,z,G){this.getWorkerSource(C,z.type,z.source).abortTile(z,G)}removeTile(C,z,G){this.getWorkerSource(C,z.type,z.source).removeTile(z,G)}removeSource(C,z,G){if(!this.workerSources[C]||!this.workerSources[C][z.type]||!this.workerSources[C][z.type][z.source])return;const Y=this.workerSources[C][z.type][z.source];delete this.workerSources[C][z.type][z.source],Y.removeSource!==void 0?Y.removeSource(z,G):G()}loadWorkerSource(C,z,G){try{this.self.importScripts(z.url),G()}catch(Y){G(Y.toString())}}syncRTLPluginState(C,z,G){try{s.plugin.setState(z);const Y=s.plugin.getPluginURL();if(s.plugin.isLoaded()&&!s.plugin.isParsed()&&Y!=null){this.self.importScripts(Y);const ee=s.plugin.isParsed();G(ee?void 0:new Error(`RTL Text Plugin failed to import scripts from ${Y}`),ee)}}catch(Y){G(Y.toString())}}getAvailableImages(C){let z=this.availableImages[C];return z||(z=[]),z}getLayerIndex(C){let z=this.layerIndexes[C];return z||(z=this.layerIndexes[C]=new Xt),z}getWorkerSource(C,z,G){if(this.workerSources[C]||(this.workerSources[C]={}),this.workerSources[C][z]||(this.workerSources[C][z]={}),!this.workerSources[C][z][G]){const Y={send:(ee,oe,ie,Q,pe,ze)=>{this.actor.send(ee,oe,ie,C,pe,ze)},scheduler:this.actor.scheduler};this.workerSources[C][z][G]=new this.workerSourceTypes[z](Y,this.getLayerIndex(C),this.getAvailableImages(C),this.isSpriteLoaded[C])}return this.workerSources[C][z][G]}getDEMWorkerSource(C,z){return this.demWorkerSources[C]||(this.demWorkerSources[C]={}),this.demWorkerSources[C][z]||(this.demWorkerSources[C][z]=new He),this.demWorkerSources[C][z]}enforceCacheSizeLimit(C,z){s.enforceCacheSizeLimit(z)}getWorkerPerformanceMetrics(C,z,G){G(void 0,void 0)}}return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new Oa(self)),Oa}),Qt(["./shared"],function(s){function ve(l,i){if(Array.isArray(l)){if(!Array.isArray(i)||l.length!==i.length)return!1;for(let n=0;n<l.length;n++)if(!ve(l[n],i[n]))return!1;return!0}if(typeof l=="object"&&l!==null&&i!==null){if(typeof i!="object"||Object.keys(l).length!==Object.keys(i).length)return!1;for(const n in l)if(!ve(l[n],i[n]))return!1;return!0}return l===i}var yt=Xt;function Xt(l){return!function(i){return typeof window>"u"||typeof document>"u"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var h,p,m=new Blob([""],{type:"text/javascript"}),_=URL.createObjectURL(m);try{p=new Worker(_),h=!0}catch{h=!1}return p&&p.terminate(),URL.revokeObjectURL(_),h}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var h=document.createElement("canvas");h.width=h.height=1;var p=h.getContext("2d");if(!p)return!1;var m=p.getImageData(0,0,1,1);return m&&m.width===h.width}()?(He[n=i&&i.failIfMajorPerformanceCaveat]===void 0&&(He[n]=function(h){var p,m=function(_){var y=document.createElement("canvas"),v=Object.create(Xt.webGLContextAttributes);return v.failIfMajorPerformanceCaveat=_,y.getContext("webgl",v)||y.getContext("experimental-webgl",v)}(h);if(!m)return!1;try{p=m.createShader(m.VERTEX_SHADER)}catch{return!1}return!(!p||m.isContextLost())&&(m.shaderSource(p,"void main() {}"),m.compileShader(p),m.getShaderParameter(p,m.COMPILE_STATUS)===!0)}(n)),He[n]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var n}(l)}var He={};function Je(l,i,n){const h=s.window.document.createElement(l);return i!==void 0&&(h.className=i),n&&n.appendChild(h),h}function vt(l,i,n){const h=s.window.document.createElementNS("http://www.w3.org/2000/svg",l);for(const p of Object.keys(i))h.setAttributeNS(null,p,i[p]);return n&&n.appendChild(h),h}Xt.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};const er=s.window.document&&s.window.document.documentElement.style,kr=er&&er.userSelect!==void 0?"userSelect":"WebkitUserSelect";let Dt;function Ei(){er&&kr&&(Dt=er[kr],er[kr]="none")}function ki(){er&&kr&&(er[kr]=Dt)}function ai(l){l.preventDefault(),l.stopPropagation(),s.window.removeEventListener("click",ai,!0)}function fo(){s.window.addEventListener("click",ai,!0),s.window.setTimeout(()=>{s.window.removeEventListener("click",ai,!0)},0)}function Ur(l,i){const n=l.getBoundingClientRect();return br(l,n,i)}function Rr(l,i){const n=l.getBoundingClientRect(),h=[];for(let p=0;p<i.length;p++)h.push(br(l,n,i[p]));return h}function jr(l){return s.window.InstallTrigger!==void 0&&l.button===2&&l.ctrlKey&&s.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:l.button}function br(l,i,n){const h=l.offsetWidth===i.width?1:l.offsetWidth/i.width;return new s.Point((n.clientX-i.left)*h,(n.clientY-i.top)*h)}function De(l,i){var n=i[0],h=i[1],p=i[2],m=i[3],_=n*m-p*h;return _?(l[0]=m*(_=1/_),l[1]=-h*_,l[2]=-p*_,l[3]=n*_,l):null}function Un(l){const{userImage:i}=l;return!!(i&&i.render&&i.render())&&(l.data.replace(new Uint8Array(i.data.buffer)),!0)}class jn extends s.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new s.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(i){if(this.loaded!==i&&(this.loaded=i,i)){for(const{ids:n,callback:h}of this.requestors)this._notify(n,h);this.requestors=[]}}hasImage(i){return!!this.getImage(i)}getImage(i){return this.images[i]}addImage(i,n){this._validate(i,n)&&(this.images[i]=n)}_validate(i,n){let h=!0;return this._validateStretch(n.stretchX,n.data&&n.data.width)||(this.fire(new s.ErrorEvent(new Error(`Image "${i}" has invalid "stretchX" value`))),h=!1),this._validateStretch(n.stretchY,n.data&&n.data.height)||(this.fire(new s.ErrorEvent(new Error(`Image "${i}" has invalid "stretchY" value`))),h=!1),this._validateContent(n.content,n)||(this.fire(new s.ErrorEvent(new Error(`Image "${i}" has invalid "content" value`))),h=!1),h}_validateStretch(i,n){if(!i)return!0;let h=0;for(const p of i){if(p[0]<h||p[1]<p[0]||n<p[1])return!1;h=p[1]}return!0}_validateContent(i,n){return!(i&&(i.length!==4||i[0]<0||n.data.width<i[0]||i[1]<0||n.data.height<i[1]||i[2]<0||n.data.width<i[2]||i[3]<0||n.data.height<i[3]||i[2]<i[0]||i[3]<i[1]))}updateImage(i,n){n.version=this.images[i].version+1,this.images[i]=n,this.updatedImages[i]=!0}removeImage(i){const n=this.images[i];delete this.images[i],delete this.patterns[i],n.userImage&&n.userImage.onRemove&&n.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(i,n){let h=!0;if(!this.isLoaded())for(const p of i)this.images[p]||(h=!1);this.isLoaded()||h?this._notify(i,n):this.requestors.push({ids:i,callback:n})}_notify(i,n){const h={};for(const p of i){this.images[p]||this.fire(new s.Event("styleimagemissing",{id:p}));const m=this.images[p];m?h[p]={data:m.data.clone(),pixelRatio:m.pixelRatio,sdf:m.sdf,version:m.version,stretchX:m.stretchX,stretchY:m.stretchY,content:m.content,hasRenderCallback:!!(m.userImage&&m.userImage.render)}:s.warnOnce(`Image "${p}" 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.`)}n(null,h)}getPixelSize(){const{width:i,height:n}=this.atlasImage;return{width:i,height:n}}getPattern(i){const n=this.patterns[i],h=this.getImage(i);if(!h)return null;if(n&&n.position.version===h.version)return n.position;if(n)n.position.version=h.version;else{const p={w:h.data.width+2,h:h.data.height+2,x:0,y:0},m=new s.ImagePosition(p,h);this.patterns[i]={bin:p,position:m}}return this._updatePatternAtlas(),this.patterns[i].position}bind(i){const n=i.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new s.Texture(i,this.atlasImage,n.RGBA),this.atlasTexture&&this.atlasTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}_updatePatternAtlas(){const i=[];for(const m in this.patterns)i.push(this.patterns[m].bin);const{w:n,h}=s.potpack(i),p=this.atlasImage;p.resize({width:n||1,height:h||1});for(const m in this.patterns){const{bin:_}=this.patterns[m],y=_.x+1,v=_.y+1,E=this.images[m].data,T=E.width,M=E.height;s.RGBAImage.copy(E,p,{x:0,y:0},{x:y,y:v},{width:T,height:M}),s.RGBAImage.copy(E,p,{x:0,y:M-1},{x:y,y:v-1},{width:T,height:1}),s.RGBAImage.copy(E,p,{x:0,y:0},{x:y,y:v+M},{width:T,height:1}),s.RGBAImage.copy(E,p,{x:T-1,y:0},{x:y-1,y:v},{width:1,height:M}),s.RGBAImage.copy(E,p,{x:0,y:0},{x:y+T,y:v},{width:1,height:M})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(i){for(const n of i){if(this.callbackDispatchedThisFrame[n])continue;this.callbackDispatchedThisFrame[n]=!0;const h=this.images[n];Un(h)&&this.updateImage(n,h)}}}const lt=new s.Properties({anchor:new s.DataConstantProperty(s.spec.light.anchor),position:new class{constructor(){this.specification=s.spec.light.position}possiblyEvaluate(l,i){return function([n,h,p]){const m=s.degToRad(h+90),_=s.degToRad(p);return{x:n*Math.cos(m)*Math.sin(_),y:n*Math.sin(m)*Math.sin(_),z:n*Math.cos(_),azimuthal:h,polar:p}}(l.expression.evaluate(i))}interpolate(l,i,n){return{x:s.number(l.x,i.x,n),y:s.number(l.y,i.y,n),z:s.number(l.z,i.z,n),azimuthal:s.number(l.azimuthal,i.azimuthal,n),polar:s.number(l.polar,i.polar,n)}}},color:new s.DataConstantProperty(s.spec.light.color),intensity:new s.DataConstantProperty(s.spec.light.intensity)});class Ke extends s.Evented{constructor(i){super(),this._transitionable=new s.Transitionable(lt),this.setLight(i),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(i,n={}){if(!this._validate(s.validateLight,i,n))for(const h in i){const p=i[h];s.endsWith(h,"-transition")?this._transitionable.setTransition(h.slice(0,-11),p):this._transitionable.setValue(h,p)}}updateTransitions(i){this._transitioning=this._transitionable.transitioned(i,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(i){this.properties=this._transitioning.possiblyEvaluate(i)}_validate(i,n,h){return(!h||h.validate!==!1)&&s.emitValidationErrors(this,i.call(s.validateStyle,s.extend({value:n,style:{glyphs:!0,sprite:!0},styleSpec:s.spec})))}}const Ge=new s.Properties({source:new s.DataConstantProperty(s.spec.terrain.source),exaggeration:new s.DataConstantProperty(s.spec.terrain.exaggeration)});let wt=class extends s.Evented{constructor(l,i){super(),this._transitionable=new s.Transitionable(Ge),this.set(l),this._transitioning=this._transitionable.untransitioned(),this.drapeRenderMode=i}get(){return this._transitionable.serialize()}set(l){for(const i in l){const n=l[i];s.endsWith(i,"-transition")?this._transitionable.setTransition(i.slice(0,-11),n):this._transitionable.setValue(i,n)}}updateTransitions(l){this._transitioning=this._transitionable.transitioned(l,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(l){this.properties=this._transitioning.possiblyEvaluate(l)}};function Hr(l,i,n,h){const p=s.smoothstep(45,65,n),[m,_]=Sr(l,h),y=s.length(i);let v=1-Math.min(1,Math.exp((y-m)/(_-m)*-6));return v*=v*v,v=Math.min(1,1.00747*v),v*p*l.alpha}function Sr(l,i){const n=.5/Math.tan(.5*i);return[l.range[0]+n,l.range[1]+n]}const it=new s.Properties({range:new s.DataConstantProperty(s.spec.fog.range),color:new s.DataConstantProperty(s.spec.fog.color),"high-color":new s.DataConstantProperty(s.spec.fog["high-color"]),"space-color":new s.DataConstantProperty(s.spec.fog["space-color"]),"horizon-blend":new s.DataConstantProperty(s.spec.fog["horizon-blend"]),"star-intensity":new s.DataConstantProperty(s.spec.fog["star-intensity"])});class pi extends s.Evented{constructor(i,n){super(),this._transitionable=new s.Transitionable(it),this.set(i),this._transitioning=this._transitionable.untransitioned(),this._transform=n}get state(){const i=this._transform,n=i.projection.name==="globe",h=s.globeToMercatorTransition(i.zoom),p=this.properties.get("range"),m=[.5,3];return{range:n?[s.number(m[0],p[0],h),s.number(m[1],p[1],h)]:p,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(i,n={}){if(!this._validate(s.validateFog,i,n)){for(const h of Object.keys(s.spec.fog))i&&i[h]===void 0&&(i[h]=s.spec.fog[h].default);for(const h in i){const p=i[h];s.endsWith(h,"-transition")?this._transitionable.setTransition(h.slice(0,-11),p):this._transitionable.setValue(h,p)}}}getOpacity(i){if(!this._transform.projection.supportsFog)return 0;const n=this.properties&&this.properties.get("color")||1;return(this._transform.projection.name==="globe"?1:s.smoothstep(45,65,i))*n.a}getOpacityAtLatLng(i,n){return this._transform.projection.supportsFog?function(h,p,m){const _=s.MercatorCoordinate.fromLngLat(p),y=m.elevation?m.elevation.getAtPointOrZero(_):0,v=[_.x,_.y,y];return s.transformMat4(v,v,m.mercatorFogMatrix),Hr(h,v,m.pitch,m._fov)}(this.state,i,n):0}getFovAdjustedRange(i){return this._transform.projection.supportsFog?Sr(this.state,i):[0,1]}updateTransitions(i){this._transitioning=this._transitionable.transitioned(i,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(i){this.properties=this._transitioning.possiblyEvaluate(i)}_validate(i,n,h){return(!h||h.validate!==!1)&&s.emitValidationErrors(this,i.call(s.validateStyle,s.extend({value:n,style:{glyphs:!0,sprite:!0},styleSpec:s.spec})))}}class tr{constructor(i,n){this.workerPool=i,this.actors=[],this.currentActor=0,this.id=s.uniqueId();const h=this.workerPool.acquire(this.id);for(let p=0;p<h.length;p++){const m=new tr.Actor(h[p],n,this.id);m.name=`Worker ${p}`,this.actors.push(m)}this.ready=!1,this.broadcast("checkIfReady",null,()=>{this.ready=!0})}broadcast(i,n,h){s.asyncAll(this.actors,(p,m)=>{p.send(i,n,m)},h=h||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(i=>{i.remove()}),this.actors=[],this.workerPool.release(this.id)}}function rr(l,i,n){return i*(s.EXTENT/(l.tileSize*Math.pow(2,n-l.tileID.overscaledZ)))}tr.Actor=s.Actor;class Kr{constructor(i,n,h,p){this.screenBounds=i,this.cameraPoint=n,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=h,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,p)}static createFromScreenPoints(i,n){let h,p;if(i instanceof s.Point||typeof i[0]=="number"){const m=s.Point.convert(i);h=[m],p=n.isPointAboveHorizon(m)}else{const m=s.Point.convert(i[0]),_=s.Point.convert(i[1]);h=[m,_],p=s.polygonizeBounds(m,_).every(y=>n.isPointAboveHorizon(y))}return new Kr(h,n.getCameraPoint(),p,n)}isPointQuery(){return this.screenBounds.length===1}bufferedScreenGeometry(i){return s.polygonizeBounds(this.screenBounds[0],this.screenBounds.length===1?this.screenBounds[0]:this.screenBounds[1],i)}bufferedCameraGeometry(i){const n=this.screenBounds[0],h=this.screenBounds.length===1?this.screenBounds[0].add(new s.Point(1,1)):this.screenBounds[1],p=s.polygonizeBounds(n,h,0,!1);return this.cameraPoint.y>h.y&&(this.cameraPoint.x>n.x&&this.cameraPoint.x<h.x?p.splice(3,0,this.cameraPoint):this.cameraPoint.x>=h.x?p[2]=this.cameraPoint:this.cameraPoint.x<=n.x&&(p[3]=this.cameraPoint)),s.bufferConvexPolygon(p,i)}bufferedCameraGeometryGlobe(i){const n=this.screenBounds[0],h=this.screenBounds.length===1?this.screenBounds[0].add(new s.Point(1,1)):this.screenBounds[1],p=s.polygonizeBounds(n,h,i),m=this.cameraPoint.clone();switch(3*((m.y>n.y)+(m.y>h.y))+((m.x>n.x)+(m.x>h.x))){case 0:p[0]=m,p[4]=m.clone();break;case 1:p.splice(1,0,m);break;case 2:p[1]=m;break;case 3:p.splice(4,0,m);break;case 5:p.splice(2,0,m);break;case 6:p[3]=m;break;case 7:p.splice(3,0,m);break;case 8:p[2]=m}return p}containsTile(i,n,h,p=0){const m=i.queryPadding/n._pixelsPerMercatorPixel+1,_=h?this._bufferedCameraMercator(m,n):this._bufferedScreenMercator(m,n);let y=i.tileID.wrap+(_.unwrapped?p:0);const v=_.polygon.map(O=>s.getTilePoint(i.tileTransform,O,y));if(!s.polygonIntersectsBox(v,0,0,s.EXTENT,s.EXTENT))return;y=i.tileID.wrap+(this.screenGeometryMercator.unwrapped?p:0);const E=this.screenGeometryMercator.polygon.map(O=>s.getTileVec3(i.tileTransform,O,y)),T=E.map(O=>new s.Point(O[0],O[1])),M=n.getFreeCameraOptions().position||new s.MercatorCoordinate(0,0,0),P=s.getTileVec3(i.tileTransform,M,y),R=E.map(O=>{const A=s.sub(O,O,P);return s.normalize(A,A),new s.Ray(P,A)}),F=rr(i,1,n.zoom)*n._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:T,tilespaceRays:R,bufferedTilespaceGeometry:v,bufferedTilespaceBounds:(B=s.getBounds(v),B.min.x=s.clamp(B.min.x,0,s.EXTENT),B.min.y=s.clamp(B.min.y,0,s.EXTENT),B.max.x=s.clamp(B.max.x,0,s.EXTENT),B.max.y=s.clamp(B.max.y,0,s.EXTENT),B),tile:i,tileID:i.tileID,pixelToTileUnitsFactor:F};var B}_bufferedScreenMercator(i,n){const h=tn(i);if(this._screenRaycastCache[h])return this._screenRaycastCache[h];{let p;return p=n.projection.name==="globe"?this._projectAndResample(this.bufferedScreenGeometry(i),n):{polygon:this.bufferedScreenGeometry(i).map(m=>n.pointCoordinate3D(m)),unwrapped:!0},this._screenRaycastCache[h]=p,p}}_bufferedCameraMercator(i,n){const h=tn(i);if(this._cameraRaycastCache[h])return this._cameraRaycastCache[h];{let p;return p=n.projection.name==="globe"?this._projectAndResample(this.bufferedCameraGeometryGlobe(i),n):{polygon:this.bufferedCameraGeometry(i).map(m=>n.pointCoordinate3D(m)),unwrapped:!0},this._cameraRaycastCache[h]=p,p}}_projectAndResample(i,n){const h=function(m,_){const y=s.multiply([],_.pixelMatrix,_.globeMatrix),v=[0,-s.GLOBE_RADIUS,0,1],E=[0,s.GLOBE_RADIUS,0,1],T=[0,0,0,1];s.transformMat4$1(v,v,y),s.transformMat4$1(E,E,y),s.transformMat4$1(T,T,y);const M=new s.Point(v[0]/v[3],v[1]/v[3]),P=new s.Point(E[0]/E[3],E[1]/E[3]),R=s.polygonContainsPoint(m,M)&&v[3]<T[3],F=s.polygonContainsPoint(m,P)&&E[3]<T[3];if(!R&&!F)return null;const B=function(K,re,te){for(let le=1;le<K.length;le++){const Ee=go(re.pointCoordinate3D(K[le-1]).x),ne=go(re.pointCoordinate3D(K[le]).x);if(te<0){if(Ee<ne)return{idx:le,t:-Ee/(ne-1-Ee)}}else if(ne<Ee)return{idx:le,t:(1-Ee)/(ne+1-Ee)}}return null}(m,_,R?-1:1);if(!B)return null;const{idx:O,t:A}=B;let L=O>1?sr(m.slice(0,O),_):[],N=O<m.length?sr(m.slice(O),_):[];L=L.map(K=>new s.Point(go(K.x),K.y)),N=N.map(K=>new s.Point(go(K.x),K.y));const V=[...L];V.length===0&&V.push(N[N.length-1]);const H=s.number(V[V.length-1].y,(N.length===0?L[0]:N[0]).y,A);let J;return J=R?[new s.Point(0,H),new s.Point(0,0),new s.Point(1,0),new s.Point(1,H)]:[new s.Point(1,H),new s.Point(1,1),new s.Point(0,1),new s.Point(0,H)],V.push(...J),N.length===0?V.push(L[0]):V.push(...N),{polygon:V.map(K=>new s.MercatorCoordinate(K.x,K.y)),unwrapped:!1}}(i,n);if(h)return h;const p=function(m,_){let y=!1,v=-1/0,E=0;for(let M=0;M<m.length-1;M++)m[M].x>v&&(v=m[M].x,E=M);for(let M=0;M<m.length-1;M++){const P=(E+M)%(m.length-1),R=m[P],F=m[P+1];Math.abs(R.x-F.x)>.5&&(R.x<F.x?(R.x+=1,P===0&&(m[m.length-1].x+=1)):(F.x+=1,P+1===m.length-1&&(m[0].x+=1)),y=!0)}const T=s.mercatorXfromLng(_.center.lng);return y&&T<Math.abs(T-1)&&m.forEach(M=>{M.x-=1}),{polygon:m,unwrapped:y}}(sr(i,n).map(m=>new s.Point(go(m.x),m.y)),n);return{polygon:p.polygon.map(m=>new s.MercatorCoordinate(m.x,m.y)),unwrapped:p.unwrapped}}}function sr(l,i){return s.resample(l,n=>{const h=i.pointCoordinate3D(n);n.x=h.x,n.y=h.y},1/256)}function go(l){return l<0?1+l%1:l%1}function tn(l){return 100*l|0}function _o(l,i,n,h,p){const m=function(_,y){if(_)return p(_);if(y){l.url&&y.tiles&&l.tiles&&delete l.tiles;const v=s.pick(s.extend(y,l),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);y.vector_layers&&(v.vectorLayers=y.vector_layers,v.vectorLayerIds=v.vectorLayers.map(E=>E.id)),v.tiles=i.canonicalizeTileset(v,l.url),p(null,v)}};return l.url?s.getJSON(i.transformRequest(i.normalizeSourceURL(l.url,null,n,h),s.ResourceType.Source),m):s.exported.frame(()=>m(null,l))}class qi{constructor(i,n,h){this.bounds=s.LngLatBounds.convert(this.validateBounds(i)),this.minzoom=n||0,this.maxzoom=h||24}validateBounds(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]}contains(i){const n=Math.pow(2,i.z),h=Math.floor(s.mercatorXfromLng(this.bounds.getWest())*n),p=Math.floor(s.mercatorYfromLat(this.bounds.getNorth())*n),m=Math.ceil(s.mercatorXfromLng(this.bounds.getEast())*n),_=Math.ceil(s.mercatorYfromLat(this.bounds.getSouth())*n);return i.x>=h&&i.x<m&&i.y>=p&&i.y<_}}class La{constructor(i,n,h){this.context=i;const p=i.gl;this.buffer=p.createBuffer(),this.dynamicDraw=!!h,this.context.unbindVAO(),i.bindElementBuffer.set(this.buffer),p.bufferData(p.ELEMENT_ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?p.DYNAMIC_DRAW:p.STATIC_DRAW),this.dynamicDraw||n.destroy()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(i){const n=this.context.gl;this.context.unbindVAO(),this.bind(),n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,0,i.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Po={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class rn{constructor(i,n,h,p){this.length=n.length,this.attributes=h,this.itemSize=n.bytesPerElement,this.dynamicDraw=p,this.context=i;const m=i.gl;this.buffer=m.createBuffer(),i.bindVertexBuffer.set(this.buffer),m.bufferData(m.ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?m.DYNAMIC_DRAW:m.STATIC_DRAW),this.dynamicDraw||n.destroy()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(i){const n=this.context.gl;this.bind(),n.bufferSubData(n.ARRAY_BUFFER,0,i.arrayBuffer)}enableAttributes(i,n){for(let h=0;h<this.attributes.length;h++){const p=n.attributes[this.attributes[h].name];p!==void 0&&i.enableVertexAttribArray(p)}}setVertexAttribPointers(i,n,h){for(let p=0;p<this.attributes.length;p++){const m=this.attributes[p],_=n.attributes[m.name];_!==void 0&&i.vertexAttribPointer(_,m.components,i[Po[m.type]],!1,this.itemSize,m.offset+this.itemSize*(h||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class gt{constructor(i){this.gl=i.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(i){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class on extends gt{getDefault(){return s.Color.transparent}set(i){const n=this.current;(i.r!==n.r||i.g!==n.g||i.b!==n.b||i.a!==n.a||this.dirty)&&(this.gl.clearColor(i.r,i.g,i.b,i.a),this.current=i,this.dirty=!1)}}class si extends gt{getDefault(){return 1}set(i){(i!==this.current||this.dirty)&&(this.gl.clearDepth(i),this.current=i,this.dirty=!1)}}class Nn extends gt{getDefault(){return 0}set(i){(i!==this.current||this.dirty)&&(this.gl.clearStencil(i),this.current=i,this.dirty=!1)}}class ir extends gt{getDefault(){return[!0,!0,!0,!0]}set(i){const n=this.current;(i[0]!==n[0]||i[1]!==n[1]||i[2]!==n[2]||i[3]!==n[3]||this.dirty)&&(this.gl.colorMask(i[0],i[1],i[2],i[3]),this.current=i,this.dirty=!1)}}class di extends gt{getDefault(){return!0}set(i){(i!==this.current||this.dirty)&&(this.gl.depthMask(i),this.current=i,this.dirty=!1)}}class Ra extends gt{getDefault(){return 255}set(i){(i!==this.current||this.dirty)&&(this.gl.stencilMask(i),this.current=i,this.dirty=!1)}}class Zi extends gt{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(i){const n=this.current;(i.func!==n.func||i.ref!==n.ref||i.mask!==n.mask||this.dirty)&&(this.gl.stencilFunc(i.func,i.ref,i.mask),this.current=i,this.dirty=!1)}}class li extends gt{getDefault(){const i=this.gl;return[i.KEEP,i.KEEP,i.KEEP]}set(i){const n=this.current;(i[0]!==n[0]||i[1]!==n[1]||i[2]!==n[2]||this.dirty)&&(this.gl.stencilOp(i[0],i[1],i[2]),this.current=i,this.dirty=!1)}}class Vn extends gt{getDefault(){return!1}set(i){if(i===this.current&&!this.dirty)return;const n=this.gl;i?n.enable(n.STENCIL_TEST):n.disable(n.STENCIL_TEST),this.current=i,this.dirty=!1}}class nn extends gt{getDefault(){return[0,1]}set(i){const n=this.current;(i[0]!==n[0]||i[1]!==n[1]||this.dirty)&&(this.gl.depthRange(i[0],i[1]),this.current=i,this.dirty=!1)}}class Gn extends gt{getDefault(){return!1}set(i){if(i===this.current&&!this.dirty)return;const n=this.gl;i?n.enable(n.DEPTH_TEST):n.disable(n.DEPTH_TEST),this.current=i,this.dirty=!1}}class yo extends gt{getDefault(){return this.gl.LESS}set(i){(i!==this.current||this.dirty)&&(this.gl.depthFunc(i),this.current=i,this.dirty=!1)}}class an extends gt{getDefault(){return!1}set(i){if(i===this.current&&!this.dirty)return;const n=this.gl;i?n.enable(n.BLEND):n.disable(n.BLEND),this.current=i,this.dirty=!1}}class Ba extends gt{getDefault(){const i=this.gl;return[i.ONE,i.ZERO]}set(i){const n=this.current;(i[0]!==n[0]||i[1]!==n[1]||this.dirty)&&(this.gl.blendFunc(i[0],i[1]),this.current=i,this.dirty=!1)}}class Fa extends gt{getDefault(){return s.Color.transparent}set(i){const n=this.current;(i.r!==n.r||i.g!==n.g||i.b!==n.b||i.a!==n.a||this.dirty)&&(this.gl.blendColor(i.r,i.g,i.b,i.a),this.current=i,this.dirty=!1)}}class mi extends gt{getDefault(){return this.gl.FUNC_ADD}set(i){(i!==this.current||this.dirty)&&(this.gl.blendEquation(i),this.current=i,this.dirty=!1)}}class xo extends gt{getDefault(){return!1}set(i){if(i===this.current&&!this.dirty)return;const n=this.gl;i?n.enable(n.CULL_FACE):n.disable(n.CULL_FACE),this.current=i,this.dirty=!1}}class $n extends gt{getDefault(){return this.gl.BACK}set(i){(i!==this.current||this.dirty)&&(this.gl.cullFace(i),this.current=i,this.dirty=!1)}}class Do extends gt{getDefault(){return this.gl.CCW}set(i){(i!==this.current||this.dirty)&&(this.gl.frontFace(i),this.current=i,this.dirty=!1)}}let sn,qn=class extends gt{getDefault(){return null}set(l){(l!==this.current||this.dirty)&&(this.gl.useProgram(l),this.current=l,this.dirty=!1)}};class Lo extends gt{getDefault(){return this.gl.TEXTURE0}set(i){(i!==this.current||this.dirty)&&(this.gl.activeTexture(i),this.current=i,this.dirty=!1)}}class vo extends gt{getDefault(){const i=this.gl;return[0,0,i.drawingBufferWidth,i.drawingBufferHeight]}set(i){const n=this.current;(i[0]!==n[0]||i[1]!==n[1]||i[2]!==n[2]||i[3]!==n[3]||this.dirty)&&(this.gl.viewport(i[0],i[1],i[2],i[3]),this.current=i,this.dirty=!1)}}class Ro extends gt{getDefault(){return null}set(i){if(i===this.current&&!this.dirty)return;const n=this.gl;n.bindFramebuffer(n.FRAMEBUFFER,i),this.current=i,this.dirty=!1}}class Bo extends gt{getDefault(){return null}set(i){if(i===this.current&&!this.dirty)return;const n=this.gl;n.bindRenderbuffer(n.RENDERBUFFER,i),this.current=i,this.dirty=!1}}class ln extends gt{getDefault(){return null}set(i){if(i===this.current&&!this.dirty)return;const n=this.gl;n.bindTexture(n.TEXTURE_2D,i),this.current=i,this.dirty=!1}}class Oa extends gt{getDefault(){return null}set(i){if(i===this.current&&!this.dirty)return;const n=this.gl;n.bindBuffer(n.ARRAY_BUFFER,i),this.current=i,this.dirty=!1}}class q extends gt{getDefault(){return null}set(i){const n=this.gl;n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,i),this.current=i,this.dirty=!1}}class C extends gt{constructor(i){super(i),this.vao=i.extVertexArrayObject}getDefault(){return null}set(i){this.vao&&(i!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(i),this.current=i,this.dirty=!1)}}class z extends gt{getDefault(){return 4}set(i){if(i===this.current&&!this.dirty)return;const n=this.gl;n.pixelStorei(n.UNPACK_ALIGNMENT,i),this.current=i,this.dirty=!1}}class G extends gt{getDefault(){return!1}set(i){if(i===this.current&&!this.dirty)return;const n=this.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i),this.current=i,this.dirty=!1}}class Y extends gt{getDefault(){return!1}set(i){if(i===this.current&&!this.dirty)return;const n=this.gl;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,i),this.current=i,this.dirty=!1}}class ee extends gt{constructor(i,n){super(i),this.context=i,this.parent=n}getDefault(){return null}}class oe extends ee{setDirty(){this.dirty=!0}set(i){if(i===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const n=this.gl;n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,i,0),this.current=i,this.dirty=!1}}class ie extends ee{attachment(){return this.gl.DEPTH_ATTACHMENT}set(i){if(i===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const n=this.gl;n.framebufferRenderbuffer(n.FRAMEBUFFER,this.attachment(),n.RENDERBUFFER,i),this.current=i,this.dirty=!1}}class Q extends ie{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}class pe{constructor(i,n,h,p){this.context=i,this.width=n,this.height=h;const m=this.framebuffer=i.gl.createFramebuffer();this.colorAttachment=new oe(i,m),p&&(this.depthAttachment=new ie(i,m))}destroy(){const i=this.context.gl,n=this.colorAttachment.get();if(n&&i.deleteTexture(n),this.depthAttachment){const h=this.depthAttachment.get();h&&i.deleteRenderbuffer(h)}i.deleteFramebuffer(this.framebuffer)}}class ze{constructor(i,n=!1){if(this.gl=i,this.isWebGL2=n,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),n){const h=i;this.extVertexArrayObject={createVertexArrayOES:h.createVertexArray.bind(i),deleteVertexArrayOES:h.deleteVertexArray.bind(i),bindVertexArrayOES:h.bindVertexArray.bind(i)}}this.clearColor=new on(this),this.clearDepth=new si(this),this.clearStencil=new Nn(this),this.colorMask=new ir(this),this.depthMask=new di(this),this.stencilMask=new Ra(this),this.stencilFunc=new Zi(this),this.stencilOp=new li(this),this.stencilTest=new Vn(this),this.depthRange=new nn(this),this.depthTest=new Gn(this),this.depthFunc=new yo(this),this.blend=new an(this),this.blendFunc=new Ba(this),this.blendColor=new Fa(this),this.blendEquation=new mi(this),this.cullFace=new xo(this),this.cullFaceSide=new $n(this),this.frontFace=new Do(this),this.program=new qn(this),this.activeTexture=new Lo(this),this.viewport=new vo(this),this.bindFramebuffer=new Ro(this),this.bindRenderbuffer=new Bo(this),this.bindTexture=new ln(this),this.bindVertexBuffer=new Oa(this),this.bindElementBuffer=new q(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new C(this),this.pixelStoreUnpack=new z(this),this.pixelStoreUnpackPremultiplyAlpha=new G(this),this.pixelStoreUnpackFlipY=new Y(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.extTextureFilterAnisotropicForceOff=!1,this.extStandardDerivativesForceOff=!1,this.extDebugRendererInfo=i.getExtension("WEBGL_debug_renderer_info"),this.extDebugRendererInfo&&(this.renderer=i.getParameter(this.extDebugRendererInfo.UNMASKED_RENDERER_WEBGL),this.vendor=i.getParameter(this.extDebugRendererInfo.UNMASKED_VENDOR_WEBGL)),n||(this.extTextureHalfFloat=i.getExtension("OES_texture_half_float")),(n||this.extTextureHalfFloat&&i.getExtension("OES_texture_half_float_linear"))&&(this.extRenderToTextureHalfFloat=i.getExtension("EXT_color_buffer_half_float")),this.extStandardDerivatives=n||i.getExtension("OES_standard_derivatives"),this.extTimerQuery=i.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE)}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(i,n){return new La(this,i,n)}createVertexBuffer(i,n,h){return new rn(this,i,n,h)}createRenderbuffer(i,n,h){const p=this.gl,m=p.createRenderbuffer();return this.bindRenderbuffer.set(m),p.renderbufferStorage(p.RENDERBUFFER,i,n,h),this.bindRenderbuffer.set(null),m}createFramebuffer(i,n,h){return new pe(this,i,n,h)}clear({color:i,depth:n,stencil:h}){const p=this.gl;let m=0;i&&(m|=p.COLOR_BUFFER_BIT,this.clearColor.set(i),this.colorMask.set([!0,!0,!0,!0])),n!==void 0&&(m|=p.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(n),this.depthMask.set(!0)),h!==void 0&&(m|=p.STENCIL_BUFFER_BIT,this.clearStencil.set(h),this.stencilMask.set(255)),p.clear(m)}setCullFace(i){i.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(i.mode),this.frontFace.set(i.frontFace))}setDepthMode(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)}setStencilMode(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)}setColorMode(i){ve(i.blendFunction,s.ColorMode.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(i.blendFunction),this.blendColor.set(i.blendColor)),this.colorMask.set(i.mask)}unbindVAO(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)}}class Pe extends s.Evented{constructor(i,n,h,p){if(super(),this.id=i,this.dispatcher=h,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,s.extend(this,s.pick(n,["url","scheme","tileSize","promoteId"])),this._options=s.extend({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(p),this._tileWorkers={},this._deduped=new s.DedupedRequest}load(i){this._loaded=!1,this.fire(new s.Event("dataloading",{dataType:"source"}));const n=Array.isArray(this.map._language)?this.map._language.join():this.map._language,h=this.map._worldview;this._tileJSONRequest=_o(this._options,this.map._requestManager,n,h,(p,m)=>{this._tileJSONRequest=null,this._loaded=!0,p?(n&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${n}`),h&&h.length!==2&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${h}`),this.fire(new s.ErrorEvent(p))):m&&(s.extend(this,m),m.bounds&&(this.tileBounds=new qi(m.bounds,this.minzoom,this.maxzoom)),s.postTurnstileEvent(m.tiles,this.map._requestManager._customAccessToken),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))),i&&i(p)})}loaded(){return this._loaded}hasTile(i){return!this.tileBounds||this.tileBounds.contains(i.canonical)}onAdd(i){this.map=i,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(i){return this._options.tiles=i,this.reload(),this}setUrl(i){return this.url=i,this._options.url=i,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return s.extend({},this._options)}loadTile(i,n){const h=this.map._requestManager.normalizeTileURL(i.tileID.canonical.url(this.tiles,this.scheme)),p={request:this.map._requestManager.transformRequest(h,s.ResourceType.Tile),data:void 0,uid:i.uid,tileID:i.tileID,tileZoom:i.tileZoom,zoom:i.tileID.overscaledZ,tileSize:this.tileSize*i.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:s.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:i.isSymbolTile};if(p.request.collectResourceTiming=this._collectResourceTiming,i.actor&&i.state!=="expired")i.state==="loading"?i.reloadCallback=n:i.request=i.actor.send("reloadTile",p,m.bind(this));else if(i.actor=this._tileWorkers[h]=this._tileWorkers[h]||this.dispatcher.getActor(),this.dispatcher.ready)i.request=i.actor.send("loadTile",p,m.bind(this),void 0,!0);else{const _=s.loadVectorTile.call({deduped:this._deduped},p,(y,v)=>{y||!v?m.call(this,y):(p.data={cacheControl:v.cacheControl,expires:v.expires,rawData:v.rawData.slice(0)},i.actor&&i.actor.send("loadTile",p,m.bind(this),void 0,!0))},!0);i.request={cancel:_}}function m(_,y){return delete i.request,i.aborted?n(null):_&&_.status!==404?n(_):(y&&y.resourceTiming&&(i.resourceTiming=y.resourceTiming),this.map._refreshExpiredTiles&&y&&i.setExpiryData(y),i.loadVectorData(y,this.map.painter),s.cacheEntryPossiblyAdded(this.dispatcher),n(null),void(i.reloadCallback&&(this.loadTile(i,i.reloadCallback),i.reloadCallback=null)))}}abortTile(i){i.request&&(i.request.cancel(),delete i.request),i.actor&&i.actor.send("abortTile",{uid:i.uid,type:this.type,source:this.id})}unloadTile(i){i.unloadVectorData(),i.actor&&i.actor.send("removeTile",{uid:i.uid,type:this.type,source:this.id})}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class Ae extends s.Evented{constructor(i,n,h,p){super(),this.id=i,this.dispatcher=h,this.setEventedParent(p),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=s.extend({type:"raster"},n),s.extend(this,s.pick(n,["url","scheme","tileSize"]))}load(i){this._loaded=!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=_o(this._options,this.map._requestManager,null,null,(n,h)=>{this._tileJSONRequest=null,this._loaded=!0,n?this.fire(new s.ErrorEvent(n)):h&&(s.extend(this,h),h.bounds&&(this.tileBounds=new qi(h.bounds,this.minzoom,this.maxzoom)),s.postTurnstileEvent(h.tiles),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))),i&&i(n)})}loaded(){return this._loaded}onAdd(i){this.map=i,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(i){return this._options.tiles=i,this.reload(),this}setUrl(i){return this.url=i,this._options.url=i,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return s.extend({},this._options)}hasTile(i){return!this.tileBounds||this.tileBounds.contains(i.canonical)}loadTile(i,n){const h=s.exported.devicePixelRatio>=2,p=this.map._requestManager.normalizeTileURL(i.tileID.canonical.url(this.tiles,this.scheme),h,this.tileSize);i.request=s.getImage(this.map._requestManager.transformRequest(p,s.ResourceType.Tile),(m,_,y,v)=>(delete i.request,i.aborted?(i.state="unloaded",n(null)):m?(i.state="errored",n(m)):_?(this.map._refreshExpiredTiles&&i.setExpiryData({cacheControl:y,expires:v}),i.setTexture(_,this.map.painter),i.state="loaded",s.cacheEntryPossiblyAdded(this.dispatcher),void n(null)):n(null)))}static loadTileData(i,n,h){i.setTexture(n,h)}static unloadTileData(i,n){i.texture&&n.saveTileTexture(i.texture)}abortTile(i,n){i.request&&(i.request.cancel(),delete i.request),n()}unloadTile(i,n){i.texture&&this.map.painter.saveTileTexture(i.texture),n()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}function ot(l,i,n,h,p,m,_,y){const v=[l,n,p,i,h,m,1,1,1],E=[_,y,1],T=s.adjoint([],v),[M,P,R]=s.transformMat3(E,E,s.transpose(T,T));return s.multiply$1(v,[M,0,0,0,P,0,0,0,R],v)}class ct extends s.Evented{constructor(i,n,h,p){super(),this.id=i,this.dispatcher=h,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(p),this.options=n,this._dirty=!1}load(i,n){this._loaded=n||!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._imageRequest=s.getImage(this.map._requestManager.transformRequest(this.url,s.ResourceType.Image),(h,p)=>{if(this._imageRequest=null,this._loaded=!0,h)this.fire(new s.ErrorEvent(h));else if(p){const{HTMLImageElement:m}=s.window;this.image=p instanceof m?s.exported.getImageData(p):p,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,i&&(this.coordinates=i),this._finishLoading()}})}loaded(){return this._loaded}updateImage(i){return this.image&&i.url?(this._imageRequest&&i.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=i.url,this.load(i.coordinates,this._loaded),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(i){this.map=i,this.load()}onRemove(){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),this.texture&&this.texture.destroy()}setCoordinates(i){this.coordinates=i,this._boundsArray=void 0;const n=i.map(s.MercatorCoordinate.fromLngLat);return this.tileID=function(h){let p=1/0,m=1/0,_=-1/0,y=-1/0;for(const M of h)p=Math.min(p,M.x),m=Math.min(m,M.y),_=Math.max(_,M.x),y=Math.max(y,M.y);const v=Math.max(_-p,y-m),E=Math.max(0,Math.floor(-Math.log(v)/Math.LN2)),T=Math.pow(2,E);return new s.CanonicalTileID(E,Math.floor((p+_)/2*T),Math.floor((m+y)/2*T))}(n),this.minzoom=this.maxzoom=this.tileID.z,this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0}_prepareData(i){for(const v in this.tiles){const E=this.tiles[v];E.state!=="loaded"&&(E.state="loaded",E.texture=this.texture)}if(this._boundsArray)return;const n=s.tileTransform(this.tileID,this.map.transform.projection),[h,p,m,_]=this.coordinates.map(v=>{const E=n.projection.project(v[0],v[1]);return s.getTilePoint(n,E)._round()});this.perspectiveTransform=function(v,E,T,M,P,R,F,B,O,A){const L=ot(0,0,v,0,0,E,v,E),N=ot(T,M,P,R,F,B,O,A);return s.multiply$1(N,s.adjoint(L,L),N),[N[6]/N[8]*v/s.EXTENT,N[7]/N[8]*E/s.EXTENT]}(this.width,this.height,h.x,h.y,p.x,p.y,_.x,_.y,m.x,m.y);const y=this._boundsArray=new s.StructArrayLayout4i8;y.emplaceBack(h.x,h.y,0,0),y.emplaceBack(p.x,p.y,s.EXTENT,0),y.emplaceBack(_.x,_.y,0,s.EXTENT),y.emplaceBack(m.x,m.y,s.EXTENT,s.EXTENT),this.boundsBuffer&&this.boundsBuffer.destroy(),this.boundsBuffer=i.createVertexBuffer(y,s.boundsAttributes.members),this.boundsSegments=s.SegmentVector.simpleSegment(0,0,4,2)}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const i=this.map.painter.context,n=i.gl;this._dirty&&(this.texture?this.texture.update(this.image):(this.texture=new s.Texture(i,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE)),this._dirty=!1),this._prepareData(i)}loadTile(i,n){this.tileID&&this.tileID.equals(i.tileID.canonical)?(this.tiles[String(i.tileID.wrap)]=i,i.buckets={},n(null)):(i.state="errored",n(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}const nt={vector:Pe,raster:Ae,"raster-dem":class extends Ae{constructor(l,i,n,h){super(l,i,n,h),this.type="raster-dem",this.maxzoom=22,this._options=s.extend({type:"raster-dem"},i),this.encoding=i.encoding||"mapbox"}loadTile(l,i){const n=this.map._requestManager.normalizeTileURL(l.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function h(p,m){p&&(l.state="errored",i(p)),m&&(l.dem=m,l.dem.onDeserialize(),l.needsHillshadePrepare=!0,l.needsDEMTextureUpload=!0,l.state="loaded",i(null))}l.request=s.getImage(this.map._requestManager.transformRequest(n,s.ResourceType.Tile),(function(p,m,_,y){if(delete l.request,l.aborted)l.state="unloaded",i(null);else if(p)l.state="errored",i(p);else if(m){this.map._refreshExpiredTiles&&l.setExpiryData({cacheControl:_,expires:y});const v=s.window.ImageBitmap&&m instanceof s.window.ImageBitmap&&(sn==null&&(sn=s.window.OffscreenCanvas&&new s.window.OffscreenCanvas(1,1).getContext("2d")&&typeof s.window.createImageBitmap=="function"),sn),E=1-(m.width-s.prevPowerOfTwo(m.width))/2;E<1||l.neighboringTiles||(l.neighboringTiles=this._getNeighboringTiles(l.tileID));const T=v?m:s.exported.getImageData(m,E),M={uid:l.uid,coord:l.tileID,source:this.id,rawImageData:T,encoding:this.encoding,padding:E};l.actor&&l.state!=="expired"||(l.actor=this.dispatcher.getActor(),l.actor.send("loadDEMTile",M,h.bind(this),void 0,!0))}}).bind(this))}_getNeighboringTiles(l){const i=l.canonical,n=Math.pow(2,i.z),h=(i.x-1+n)%n,p=i.x===0?l.wrap-1:l.wrap,m=(i.x+1+n)%n,_=i.x+1===n?l.wrap+1:l.wrap,y={};return y[new s.OverscaledTileID(l.overscaledZ,p,i.z,h,i.y).key]={backfilled:!1},y[new s.OverscaledTileID(l.overscaledZ,_,i.z,m,i.y).key]={backfilled:!1},i.y>0&&(y[new s.OverscaledTileID(l.overscaledZ,p,i.z,h,i.y-1).key]={backfilled:!1},y[new s.OverscaledTileID(l.overscaledZ,l.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},y[new s.OverscaledTileID(l.overscaledZ,_,i.z,m,i.y-1).key]={backfilled:!1}),i.y+1<n&&(y[new s.OverscaledTileID(l.overscaledZ,p,i.z,h,i.y+1).key]={backfilled:!1},y[new s.OverscaledTileID(l.overscaledZ,l.wrap,i.z,i.x,i.y+1).key]={backfilled:!1},y[new s.OverscaledTileID(l.overscaledZ,_,i.z,m,i.y+1).key]={backfilled:!1}),y}unloadTile(l){l.demTexture&&this.map.painter.saveTileTexture(l.demTexture),l.fbo&&(l.fbo.destroy(),delete l.fbo),l.dem&&delete l.dem,delete l.neighboringTiles,l.state="unloaded"}},geojson:class extends s.Evented{constructor(l,i,n,h){super(),this.id=l,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._loaded=!1,this.actor=n.getActor(),this.setEventedParent(h),this._data=i.data,this._options=s.extend({},i),this._collectResourceTiming=i.collectResourceTiming,i.maxzoom!==void 0&&(this.maxzoom=i.maxzoom),i.type&&(this.type=i.type),i.attribution&&(this.attribution=i.attribution),this.promoteId=i.promoteId;const p=s.EXTENT/this.tileSize;this.workerOptions=s.extend({source:this.id,cluster:i.cluster||!1,geojsonVtOptions:{buffer:(i.buffer!==void 0?i.buffer:128)*p,tolerance:(i.tolerance!==void 0?i.tolerance:.375)*p,extent:s.EXTENT,maxZoom:this.maxzoom,lineMetrics:i.lineMetrics||!1,generateId:i.generateId||!1},superclusterOptions:{maxZoom:i.clusterMaxZoom!==void 0?i.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,i.clusterMinPoints||2),extent:s.EXTENT,radius:(i.clusterRadius!==void 0?i.clusterRadius:50)*p,log:!1,generateId:i.generateId||!1},clusterProperties:i.clusterProperties,filter:i.filter},i.workerOptions)}onAdd(l){this.map=l,this.setData(this._data)}setData(l){return this._data=l,this._updateWorkerData(),this}getClusterExpansionZoom(l,i){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:l,source:this.id},i),this}getClusterChildren(l,i){return this.actor.send("geojson.getClusterChildren",{clusterId:l,source:this.id},i),this}getClusterLeaves(l,i,n,h){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:l,limit:i,offset:n},h),this}_updateWorkerData(){if(this._pendingLoad)return void(this._coalesce=!0);this.fire(new s.Event("dataloading",{dataType:"source"})),this._loaded=!1;const l=s.extend({},this.workerOptions),i=this._data;typeof i=="string"?(l.request=this.map._requestManager.transformRequest(s.exported.resolveURL(i),s.ResourceType.Source),l.request.collectResourceTiming=this._collectResourceTiming):l.data=JSON.stringify(i),this._pendingLoad=this.actor.send(`${this.type}.loadData`,l,(n,h)=>{if(this._loaded=!0,this._pendingLoad=null,n)this.fire(new s.ErrorEvent(n));else{const p={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&h&&h.resourceTiming&&h.resourceTiming[this.id]&&(p.resourceTiming=h.resourceTiming[this.id]),this.fire(new s.Event("data",p)),this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(),this._coalesce=!1)})}loaded(){return this._loaded}loadTile(l,i){const n=l.actor?"reloadTile":"loadTile";l.actor=this.actor,l.request=this.actor.send(n,{type:this.type,uid:l.uid,tileID:l.tileID,tileZoom:l.tileZoom,zoom:l.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:s.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(h,p)=>(delete l.request,l.unloadVectorData(),l.aborted?i(null):h?i(h):(l.loadVectorData(p,this.map.painter,n==="reloadTile"),i(null))),void 0,n==="loadTile")}abortTile(l){l.request&&(l.request.cancel(),delete l.request),l.aborted=!0}unloadTile(l){l.unloadVectorData(),this.actor.send("removeTile",{uid:l.uid,type:this.type,source:this.id})}onRemove(){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return s.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends ct{constructor(l,i,n,h){super(l,i,n,h),this.roundZoom=!0,this.type="video",this.options=i}load(){this._loaded=!1;const l=this.options;this.urls=[];for(const i of l.urls)this.urls.push(this.map._requestManager.transformRequest(i,s.ResourceType.Source).url);s.getVideo(this.urls,(i,n)=>{this._loaded=!0,i?this.fire(new s.ErrorEvent(i)):n&&(this.video=n,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(l){if(this.video){const i=this.video.seekable;l<i.start(0)||l>i.end(0)?this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${i.start(0)} and ${i.end(0)}-second mark.`))):this.video.currentTime=l}}getVideo(){return this.video}onAdd(l){this.map||(this.map=l,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const l=this.map.painter.context,i=l.gl;this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new s.Texture(l,this.video,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(l)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:ct,canvas:class extends ct{constructor(l,i,n,h){super(l,i,n,h),i.coordinates?Array.isArray(i.coordinates)&&i.coordinates.length===4&&!i.coordinates.some(p=>!Array.isArray(p)||p.length!==2||p.some(m=>typeof m!="number"))||this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${l}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${l}`,null,'missing required property "coordinates"'))),i.animate&&typeof i.animate!="boolean"&&this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${l}`,null,'optional "animate" property must be a boolean value'))),i.canvas?typeof i.canvas=="string"||i.canvas instanceof s.window.HTMLCanvasElement||this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${l}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${l}`,null,'missing required property "canvas"'))),this.options=i,this.animate=i.animate===void 0||i.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof s.window.HTMLCanvasElement?this.options.canvas:s.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new s.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(l){this.map=l,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let l=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,l=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,l=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const i=this.map.painter.context;this.texture?(l||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new s.Texture(i,this.canvas,i.gl.RGBA,{premultiply:!0}),this._prepareData(i)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const l of[this.canvas.width,this.canvas.height])if(isNaN(l)||l<=0)return!0;return!1}},custom:class extends s.Evented{constructor(l,i,n,h){super(),this.id=l,this.type="custom",this._dataType="raster",this._dispatcher=n,this._implementation=i,this.setEventedParent(h),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new s.ErrorEvent(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new s.ErrorEvent(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new qi(this._implementation.bounds,this.minzoom,this.maxzoom)),i.update=this._update.bind(this),i.clearTiles=this._clearTiles.bind(this),i.coveringTiles=this._coveringTiles.bind(this),s.extend(this,s.pick(i,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return s.pick(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(l){this._map=l,this._loaded=!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(l),this.load()}onRemove(l){this._implementation.onRemove&&this._implementation.onRemove(l)}hasTile(l){if(this._implementation.hasTile){const{x:i,y:n,z:h}=l.canonical;return this._implementation.hasTile({x:i,y:n,z:h})}return!this.tileBounds||this.tileBounds.contains(l.canonical)}loadTile(l,i){const{x:n,y:h,z:p}=l.tileID.canonical,m=new s.window.AbortController;l.request=Promise.resolve(this._implementation.loadTile({x:n,y:h,z:p},{signal:m.signal})).then((function(_){return delete l.request,l.aborted?(l.state="unloaded",i(null)):_===void 0?(l.state="errored",i(null)):_===null?(this.loadTileData(l,{width:this.tileSize,height:this.tileSize,data:null}),l.state="loaded",i(null)):function(y){return y instanceof s.window.ImageData||y instanceof s.window.HTMLCanvasElement||y instanceof s.window.ImageBitmap||y instanceof s.window.HTMLImageElement}(_)?(this.loadTileData(l,_),l.state="loaded",void i(null)):(l.state="errored",i(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}).bind(this)).catch(_=>{_.code!==20&&(l.state="errored",i(_))}),l.request.cancel=()=>m.abort()}loadTileData(l,i){Ae.loadTileData(l,i,this._map.painter)}unloadTileData(l){Ae.unloadTileData(l,this._map.painter)}unloadTile(l,i){if(this.unloadTileData(l),this._implementation.unloadTile){const{x:n,y:h,z:p}=l.tileID.canonical;this._implementation.unloadTile({x:n,y:h,z:p})}i()}abortTile(l,i){l.request&&l.request.cancel&&(l.request.cancel(),delete l.request),i()}hasTransition(){return!1}_coveringTiles(){return this._map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map(l=>({x:l.canonical.x,y:l.canonical.y,z:l.canonical.z}))}_clearTiles(){this._map.style._clearSource(this.id)}_update(){this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))}}},ht=function(l,i,n,h){const p=new nt[i.type](l,i,n,h);if(p.id!==l)throw new Error(`Expected Source id to be ${l} instead of ${p.id}`);return s.bindAll(["load","abort","unload","serialize","prepare"],p),p};function _t(l,i){const n=s.identity([]);return s.scale(n,n,[.5*l.width,.5*-l.height,1]),s.translate(n,n,[1,-1,0]),s.multiply(n,n,l.calculateProjMatrix(i.toUnwrapped())),Float32Array.from(n)}function or(l,i,n,h,p,m,_,y=!1){const v=l.tilesIn(h,_,y);v.sort(Nr);const E=[];for(const M of v)E.push({wrappedTileID:M.tile.tileID.wrapped().key,queryResults:M.tile.queryRenderedFeatures(i,n,l._state,M,p,m,_t(l.transform,M.tile.tileID),y)});const T=function(M){const P={},R={};for(const F of M){const B=F.queryResults,O=F.wrappedTileID,A=R[O]=R[O]||{};for(const L in B){const N=B[L],V=A[L]=A[L]||{},H=P[L]=P[L]||[];for(const J of N)V[J.featureIndex]||(V[J.featureIndex]=!0,H.push(J))}}return P}(E);for(const M in T)T[M].forEach(P=>{const R=P.feature,F=R.layer;F&&F.type!=="background"&&F.type!=="sky"&&(R.source=F.source,F["source-layer"]&&(R.sourceLayer=F["source-layer"]),R.state=R.id!==void 0?l.getFeatureState(F["source-layer"],R.id):{})});return T}function dr(l,i){const n=l.getRenderableIds().map(m=>l.getTileByID(m)),h=[],p={};for(let m=0;m<n.length;m++){const _=n[m],y=_.tileID.canonical.key;p[y]||(p[y]=!0,_.querySourceFeatures(h,i))}return h}function Nr(l,i){const n=l.tileID,h=i.tileID;return n.overscaledZ-h.overscaledZ||n.canonical.y-h.canonical.y||n.wrap-h.wrap||n.canonical.x-h.canonical.x}function Tr(){return Mn.workerClass!=null?new Mn.workerClass:new s.window.Worker(Mn.workerUrl)}const Di="mapboxgl_preloaded_worker_pool";class Mr{constructor(){this.active={}}acquire(i){if(!this.workers)for(this.workers=[];this.workers.length<Mr.workerCount;)this.workers.push(new Tr);return this.active[i]=!0,this.workers.slice()}release(i){delete this.active[i],this.numActive()===0&&(this.workers.forEach(n=>{n.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Di]}numActive(){return Object.keys(this.active).length}}let Xr;function cn(){return Xr||(Xr=new Mr),Xr}function Gh(l,i){const n={};for(const h in l)h!=="ref"&&(n[h]=l[h]);return s.refProperties.forEach(h=>{h in i&&(n[h]=i[h])}),n}function gc(l){l=l.slice();const i=Object.create(null);for(let n=0;n<l.length;n++)i[l[n].id]=l[n];for(let n=0;n<l.length;n++)"ref"in l[n]&&(l[n]=Gh(l[n],i[l[n].ref]));return l}Mr.workerCount=2;const Mt={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight",setTerrain:"setTerrain",setFog:"setFog",setProjection:"setProjection"};function Bs(l,i,n){n.push({command:Mt.addSource,args:[l,i[l]]})}function Zn(l,i,n){i.push({command:Mt.removeSource,args:[l]}),n[l]=!0}function Fs(l,i,n,h){Zn(l,n,h),Bs(l,i,n)}function Ua(l,i,n){let h;for(h in l[n])if(l[n].hasOwnProperty(h)&&h!=="data"&&!ve(l[n][h],i[n][h]))return!1;for(h in i[n])if(i[n].hasOwnProperty(h)&&h!=="data"&&!ve(l[n][h],i[n][h]))return!1;return!0}function Li(l,i,n,h,p,m){let _;for(_ in i=i||{},l=l||{})l.hasOwnProperty(_)&&(ve(l[_],i[_])||n.push({command:m,args:[h,_,i[_],p]}));for(_ in i)i.hasOwnProperty(_)&&!l.hasOwnProperty(_)&&(ve(l[_],i[_])||n.push({command:m,args:[h,_,i[_],p]}))}function Xi(l){return l.id}function Os(l,i){return l[i.id]=i,l}class Us{constructor(i,n){this.reset(i,n)}reset(i,n){this.points=i||[],this._distances=[0];for(let h=1;h<this.points.length;h++)this._distances[h]=this._distances[h-1]+this.points[h].dist(this.points[h-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(n||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(i){if(this.points.length===1)return this.points[0];i=s.clamp(i,0,1);let n=1,h=this._distances[n];const p=i*this.paddedLength+this.padding;for(;h<p&&n<this._distances.length;)h=this._distances[++n];const m=n-1,_=this._distances[m],y=h-_,v=y>0?(p-_)/y:0;return this.points[m].mult(1-v).add(this.points[n].mult(v))}}class Fo{constructor(i,n,h){const p=this.boxCells=[],m=this.circleCells=[];this.xCellCount=Math.ceil(i/h),this.yCellCount=Math.ceil(n/h);for(let _=0;_<this.xCellCount*this.yCellCount;_++)p.push([]),m.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=i,this.height=n,this.xScale=this.xCellCount/i,this.yScale=this.yCellCount/n,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(i,n,h,p,m){this._forEachCell(n,h,p,m,this._insertBoxCell,this.boxUid++),this.boxKeys.push(i),this.bboxes.push(n),this.bboxes.push(h),this.bboxes.push(p),this.bboxes.push(m)}insertCircle(i,n,h,p){this._forEachCell(n-p,h-p,n+p,h+p,this._insertCircleCell,this.circleUid++),this.circleKeys.push(i),this.circles.push(n),this.circles.push(h),this.circles.push(p)}_insertBoxCell(i,n,h,p,m,_){this.boxCells[m].push(_)}_insertCircleCell(i,n,h,p,m,_){this.circleCells[m].push(_)}_query(i,n,h,p,m,_){if(h<0||i>this.width||p<0||n>this.height)return!m&&[];const y=[];if(i<=0&&n<=0&&this.width<=h&&this.height<=p){if(m)return!0;for(let v=0;v<this.boxKeys.length;v++)y.push({key:this.boxKeys[v],x1:this.bboxes[4*v],y1:this.bboxes[4*v+1],x2:this.bboxes[4*v+2],y2:this.bboxes[4*v+3]});for(let v=0;v<this.circleKeys.length;v++){const E=this.circles[3*v],T=this.circles[3*v+1],M=this.circles[3*v+2];y.push({key:this.circleKeys[v],x1:E-M,y1:T-M,x2:E+M,y2:T+M})}return _?y.filter(_):y}return this._forEachCell(i,n,h,p,this._queryCell,y,{hitTest:m,seenUids:{box:{},circle:{}}},_),m?y.length>0:y}_queryCircle(i,n,h,p,m){const _=i-h,y=i+h,v=n-h,E=n+h;if(y<0||_>this.width||E<0||v>this.height)return!p&&[];const T=[];return this._forEachCell(_,v,y,E,this._queryCellCircle,T,{hitTest:p,circle:{x:i,y:n,radius:h},seenUids:{box:{},circle:{}}},m),p?T.length>0:T}query(i,n,h,p,m){return this._query(i,n,h,p,!1,m)}hitTest(i,n,h,p,m){return this._query(i,n,h,p,!0,m)}hitTestCircle(i,n,h,p){return this._queryCircle(i,n,h,!0,p)}_queryCell(i,n,h,p,m,_,y,v){const E=y.seenUids,T=this.boxCells[m];if(T!==null){const P=this.bboxes;for(const R of T)if(!E.box[R]){E.box[R]=!0;const F=4*R;if(i<=P[F+2]&&n<=P[F+3]&&h>=P[F+0]&&p>=P[F+1]&&(!v||v(this.boxKeys[R]))){if(y.hitTest)return _.push(!0),!0;_.push({key:this.boxKeys[R],x1:P[F],y1:P[F+1],x2:P[F+2],y2:P[F+3]})}}}const M=this.circleCells[m];if(M!==null){const P=this.circles;for(const R of M)if(!E.circle[R]){E.circle[R]=!0;const F=3*R;if(this._circleAndRectCollide(P[F],P[F+1],P[F+2],i,n,h,p)&&(!v||v(this.circleKeys[R]))){if(y.hitTest)return _.push(!0),!0;{const B=P[F],O=P[F+1],A=P[F+2];_.push({key:this.circleKeys[R],x1:B-A,y1:O-A,x2:B+A,y2:O+A})}}}}}_queryCellCircle(i,n,h,p,m,_,y,v){const E=y.circle,T=y.seenUids,M=this.boxCells[m];if(M!==null){const R=this.bboxes;for(const F of M)if(!T.box[F]){T.box[F]=!0;const B=4*F;if(this._circleAndRectCollide(E.x,E.y,E.radius,R[B+0],R[B+1],R[B+2],R[B+3])&&(!v||v(this.boxKeys[F])))return _.push(!0),!0}}const P=this.circleCells[m];if(P!==null){const R=this.circles;for(const F of P)if(!T.circle[F]){T.circle[F]=!0;const B=3*F;if(this._circlesCollide(R[B],R[B+1],R[B+2],E.x,E.y,E.radius)&&(!v||v(this.circleKeys[F])))return _.push(!0),!0}}}_forEachCell(i,n,h,p,m,_,y,v){const E=this._convertToXCellCoord(i),T=this._convertToYCellCoord(n),M=this._convertToXCellCoord(h),P=this._convertToYCellCoord(p);for(let R=E;R<=M;R++)for(let F=T;F<=P;F++)if(m.call(this,i,n,h,p,this.xCellCount*F+R,_,y,v))return}_convertToXCellCoord(i){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(i*this.xScale)))}_convertToYCellCoord(i){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(i*this.yScale)))}_circlesCollide(i,n,h,p,m,_){const y=p-i,v=m-n,E=h+_;return E*E>y*y+v*v}_circleAndRectCollide(i,n,h,p,m,_,y){const v=(_-p)/2,E=Math.abs(i-(p+v));if(E>v+h)return!1;const T=(y-m)/2,M=Math.abs(n-(m+T));if(M>T+h)return!1;if(E<=v||M<=T)return!0;const P=E-v,R=M-T;return P*P+R*R<=h*h}}const Wi={unknown:0,flipRequired:1,flipNotRequired:2},Xn=Math.tan(85*Math.PI/180);function me(l,i,n,h,p,m,_){const y=s.create();if(n)if(m.name==="globe"){const v=s.calculateGlobeLabelMatrix(p,i);s.multiply(y,y,v)}else{const v=De([],_);y[0]=v[0],y[1]=v[1],y[4]=v[2],y[5]=v[3],h||s.rotateZ(y,y,p.angle)}else s.multiply(y,p.labelPlaneMatrix,l);return y}function Yi(l,i,n,h,p,m,_){const y=me(l,i,n,h,p,m,_);return m.name==="globe"&&n||(y[2]=y[6]=y[10]=y[14]=0),y}function mr(l,i,n,h,p,m,_){if(n){if(m.name==="globe"){const y=me(l,i,n,h,p,m,_);return s.invert(y,y),s.multiply(y,l,y),y}{const y=s.clone(l),v=s.identity([]);return v[0]=_[0],v[1]=_[1],v[4]=_[2],v[5]=_[3],s.multiply(y,y,v),h||s.rotateZ(y,y,-p.angle),y}}return p.glCoordMatrix}function Ar(l,i,n,h){const p=[l,i,n,1];n?s.transformMat4$1(p,p,h):dt(p,p,h);const m=p[3];return p[0]/=m,p[1]/=m,p[2]/=m,p}function _c(l,i){return Math.min(.5+l/i*.5,1.5)}function Ri(l,i){const n=l[0]/l[3],h=l[1]/l[3];return n>=-i[0]&&n<=i[0]&&h>=-i[1]&&h<=i[1]}function js(l,i,n,h,p,m,_,y,v,E){const T=n.transform,M=h?l.textSizeData:l.iconSizeData,P=s.evaluateSizeForZoom(M,n.transform.zoom),R=T.projection.name==="globe",F=[256/n.width*2+1,256/n.height*2+1],B=h?l.text.dynamicLayoutVertexArray:l.icon.dynamicLayoutVertexArray;B.clear();let O=null;R&&(O=h?l.text.globeExtVertexArray:l.icon.globeExtVertexArray);const A=l.lineVertexArray,L=h?l.text.placedSymbolArray:l.icon.placedSymbolArray,N=n.transform.width/n.transform.height;let V,H=!1;for(let J=0;J<L.length;J++){const K=L.get(J),{numGlyphs:re,writingMode:te}=K;if(te!==s.WritingMode.vertical||H||V===s.WritingMode.horizontal||(H=!0),V=te,(K.hidden||te===s.WritingMode.vertical)&&!H){Si(re,B);continue}H=!1;const le=new s.Point(K.tileAnchorX,K.tileAnchorY);let{x:Ee,y:ne,z:_e}=T.projection.projectTilePoint(le.x,le.y,E.canonical);if(v){const[Qe,je,We]=v(le);Ee+=Qe,ne+=je,_e+=We}const he=[Ee,ne,_e,1];if(s.transformMat4$1(he,he,i),!Ri(he,F)){Si(re,B);continue}const Te=_c(n.transform.cameraToCenterDistance,he[3]),se=s.evaluateSizeForFeature(M,P,K),ge=_?se/Te:se*Te,Se=Ar(Ee,ne,_e,p);if(Se[3]<=0){Si(re,B);continue}let we={};const Me=_?null:v,qe=Fe(K,ge,!1,y,i,p,m,l.glyphOffsetArray,A,B,O,Se,le,we,N,Me,T.projection,E,_);H=qe.useVertical,Me&&qe.needsFlipping&&(we={}),(qe.notEnoughRoom||H||qe.needsFlipping&&Fe(K,ge,!0,y,i,p,m,l.glyphOffsetArray,A,B,O,Se,le,we,N,Me,T.projection,E,_).notEnoughRoom)&&Si(re,B)}h?(l.text.dynamicLayoutVertexBuffer.updateData(B),O&&l.text.globeExtVertexBuffer.updateData(O)):(l.icon.dynamicLayoutVertexBuffer.updateData(B),O&&l.icon.globeExtVertexBuffer.updateData(O))}function yc(l,i,n,h,p,m,_,y,v,E,T,M,P,R,F,B){const{lineStartIndex:O,glyphStartIndex:A,segment:L}=y,N=A+y.numGlyphs,V=O+y.lineLength,H=i.getoffsetX(A),J=i.getoffsetX(N-1),K=ci(l*H,n,h,p,m,_,L,O,V,v,E,T,M,P,!0,R,F,B);if(!K)return null;const re=ci(l*J,n,h,p,m,_,L,O,V,v,E,T,M,P,!0,R,F,B);return re?{first:K,last:re}:null}function hn(l,i,n,h){return l===s.WritingMode.horizontal&&Math.abs(h)>Math.abs(n)?{useVertical:!0}:l===s.WritingMode.vertical?h>0?{needsFlipping:!0}:null:i!==Wi.unknown&&function(p,m){return p===0||Math.abs(m/p)>Xn}(n,h)?i===Wi.flipRequired?{needsFlipping:!0}:null:n<0?{needsFlipping:!0}:null}function Fe(l,i,n,h,p,m,_,y,v,E,T,M,P,R,F,B,O,A,L){const N=i/24,V=l.lineOffsetX*N,H=l.lineOffsetY*N,{lineStartIndex:J,glyphStartIndex:K,numGlyphs:re,segment:te,writingMode:le,flipState:Ee}=l,ne=J+l.lineLength,_e=he=>{if(T){const[Se,we,Me]=he.up,qe=E.length;s.updateGlobeVertexNormal(T,qe+0,Se,we,Me),s.updateGlobeVertexNormal(T,qe+1,Se,we,Me),s.updateGlobeVertexNormal(T,qe+2,Se,we,Me),s.updateGlobeVertexNormal(T,qe+3,Se,we,Me)}const[Te,se,ge]=he.point;s.addDynamicAttributes(E,Te,se,ge,he.angle)};if(re>1){const he=yc(N,y,V,H,n,M,P,l,v,m,R,B,!1,O,A,L);if(!he)return{notEnoughRoom:!0};if(h&&!n){let[Te,se,ge]=he.first.point,[Se,we,Me]=he.last.point;[Te,se]=Ar(Te,se,ge,_),[Se,we]=Ar(Se,we,Me,_);const qe=hn(le,Ee,(Se-Te)*F,we-se);if(l.flipState=qe&&qe.needsFlipping?Wi.flipRequired:Wi.flipNotRequired,qe)return qe}_e(he.first);for(let Te=K+1;Te<K+re-1;Te++){const se=ci(N*y.getoffsetX(Te),V,H,n,M,P,te,J,ne,v,m,R,B,!1,!1,O,A,L);if(!se)return E.length-=4*(Te-K),{notEnoughRoom:!0};_e(se)}_e(he.last)}else{if(h&&!n){const Te=Ar(P.x,P.y,0,p),se=J+te+1,ge=new s.Point(v.getx(se),v.gety(se)),Se=Ar(ge.x,ge.y,0,p),we=Se[3]>0?Se:pt(P,ge,Te,1,p,void 0,O,A.canonical),Me=hn(le,Ee,(we[0]-Te[0])*F,we[1]-Te[1]);if(l.flipState=Me&&Me.needsFlipping?Wi.flipRequired:Wi.flipNotRequired,Me)return Me}const he=ci(N*y.getoffsetX(K),V,H,n,M,P,te,J,ne,v,m,R,B,!1,!1,O,A,L);if(!he)return{notEnoughRoom:!0};_e(he)}return{}}function ft(l,i,n,h,p){const{x:m,y:_,z:y}=h.projectTilePoint(l.x,l.y,i);if(!p)return Ar(m,_,y,n);const[v,E,T]=p(l);return Ar(m+v,_+E,y+T,n)}function pt(l,i,n,h,p,m,_,y){const v=ft(l.sub(i)._unit()._add(l),y,p,_,m);return s.sub(v,n,v),s.normalize(v,v),s.scaleAndAdd(v,n,v,h)}function ci(l,i,n,h,p,m,_,y,v,E,T,M,P,R,F,B,O,A){const L=h?l-i:l+i;let N=L>0?1:-1,V=0;h&&(N*=-1,V=Math.PI),N<0&&(V+=Math.PI);let H=y+_+(N>0?0:1)|0,J=p,K=p,re=0,te=0;const le=Math.abs(L),Ee=[],ne=[];let _e=m,he=_e;const Te=()=>pt(he,_e,K,le-re+1,T,P,B,O.canonical);for(;re+te<=le;){if(H+=N,H<y||H>=v)return null;if(K=J,he=_e,Ee.push(K),R&&ne.push(he),_e=new s.Point(E.getx(H),E.gety(H)),J=M[H],!J){const We=ft(_e,O.canonical,T,B,P);J=We[3]>0?M[H]=We:Te()}re+=te,te=s.distance(K,J)}F&&P&&(M[H]&&(J=Te(),te=s.distance(K,J)),M[H]=J);const se=(le-re)/te,ge=_e.sub(he)._mult(se)._add(he),Se=s.sub([],J,K),we=s.scaleAndAdd([],K,Se,se);let Me=[0,0,1],qe=Se[0],Qe=Se[1];if(A&&(Me=B.upVector(O.canonical,ge.x,ge.y),Me[0]!==0||Me[1]!==0||Me[2]!==1)){const We=[Me[2],0,-Me[0]],mt=s.cross([],Me,We);s.normalize(We,We),s.normalize(mt,mt),qe=s.dot(Se,We),Qe=s.dot(Se,mt)}if(n){const We=s.cross([],Me,Se);s.normalize(We,We),s.scaleAndAdd(we,we,We,n*N)}const je=V+Math.atan2(Qe,qe);return Ee.push(we),R&&ne.push(ge),{point:we,angle:je,path:Ee,tilePath:ne,up:Me}}function Si(l,i){const n=i.length,h=n+4*l;i.resize(h),i.float32.fill(-1/0,4*n,4*h)}function dt(l,i,n){const h=i[0],p=i[1];return l[0]=n[0]*h+n[4]*p+n[12],l[1]=n[1]*h+n[5]*p+n[13],l[3]=n[3]*h+n[7]*p+n[15],l}const hi=100;class Wn{constructor(i,n,h=new Fo(i.width+200,i.height+200,25),p=new Fo(i.width+200,i.height+200,25)){this.transform=i,this.grid=h,this.ignoredGrid=p,this.pitchfactor=Math.cos(i._pitch)*i.cameraToCenterDistance,this.screenRightBoundary=i.width+hi,this.screenBottomBoundary=i.height+hi,this.gridRightBoundary=i.width+200,this.gridBottomBoundary=i.height+200,this.fogState=n}placeCollisionBox(i,n,h,p,m,_,y,v){let E=h.projectedAnchorX,T=h.projectedAnchorY,M=h.projectedAnchorZ;const P=h.elevation,R=h.tileID,F=i.getProjection();if(P&&R){const[J,K,re]=F.upVector(R.canonical,h.tileAnchorX,h.tileAnchorY),te=F.upVectorScale(R.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;E+=J*P*te,T+=K*P*te,M+=re*P*te}const B=this.projectAndGetPerspectiveRatio(y,E,T,M,h.tileID,F.name==="globe"||!!P||this.transform.pitch>0,F),O=_*B.perspectiveRatio,A=(h.x1*n+p.x-h.padding)*O+B.point.x,L=(h.y1*n+p.y-h.padding)*O+B.point.y,N=(h.x2*n+p.x+h.padding)*O+B.point.x,V=(h.y2*n+p.y+h.padding)*O+B.point.y,H=B.perspectiveRatio<=.55||B.occluded;return!this.isInsideGrid(A,L,N,V)||!m&&this.grid.hitTest(A,L,N,V,v)||H?{box:[],offscreen:!1,occluded:B.occluded}:{box:[A,L,N,V],offscreen:this.isOffscreen(A,L,N,V),occluded:!1}}placeCollisionCircles(i,n,h,p,m,_,y,v,E,T,M,P,R,F,B){const O=[],A=this.transform.elevation,L=i.getProjection(),N=A?A.getAtTileOffsetFunc(B,this.transform.center.lat,this.transform.worldSize,L):null,V=new s.Point(h.tileAnchorX,h.tileAnchorY);let{x:H,y:J,z:K}=L.projectTilePoint(V.x,V.y,B.canonical);if(N){const[ge,Se,we]=N(V);H+=ge,J+=Se,K+=we}const re=L.name==="globe",te=this.projectAndGetPerspectiveRatio(y,H,J,K,B,re||!!A||this.transform.pitch>0,L),{perspectiveRatio:le}=te,Ee=(M?_/le:_*le)/s.ONE_EM,ne=Ar(H,J,K,v),_e=te.signedDistanceFromCamera>0?yc(Ee,m,h.lineOffsetX*Ee,h.lineOffsetY*Ee,!1,ne,V,h,p,v,{},A&&!M?N:null,M&&!!A,L,B,M):null;let he=!1,Te=!1,se=!0;if(_e&&!te.occluded){const ge=.5*R*le+F,Se=new s.Point(-100,-100),we=new s.Point(this.screenRightBoundary,this.screenBottomBoundary),Me=new Us,{first:qe,last:Qe}=_e,je=qe.path.length;let We=[];for(let $e=je-1;$e>=1;$e--)We.push(qe.path[$e]);for(let $e=1;$e<Qe.path.length;$e++)We.push(Qe.path[$e]);const mt=2.5*ge;E&&(We=We.map(([$e,It,Lt],Rt)=>(N&&!re&&(Lt=N(Rt<je-1?qe.tilePath[je-1-Rt]:Qe.tilePath[Rt-je+2])[2]),Ar($e,It,Lt,E))),We.some($e=>$e[3]<=0)&&(We=[]));let ut=[];if(We.length>0){let $e=1/0,It=-1/0,Lt=1/0,Rt=-1/0;for(const Bt of We)$e=Math.min($e,Bt[0]),Lt=Math.min(Lt,Bt[1]),It=Math.max(It,Bt[0]),Rt=Math.max(Rt,Bt[1]);It>=Se.x&&$e<=we.x&&Rt>=Se.y&&Lt<=we.y&&(ut=[We.map(Bt=>new s.Point(Bt[0],Bt[1]))],($e<Se.x||It>we.x||Lt<Se.y||Rt>we.y)&&(ut=s.clipLine(ut,Se.x,Se.y,we.x,we.y)))}for(const $e of ut){Me.reset($e,.25*ge);let It=0;It=Me.length<=.5*ge?1:Math.ceil(Me.paddedLength/mt)+1;for(let Lt=0;Lt<It;Lt++){const Rt=Lt/Math.max(It-1,1),Bt=Me.lerp(Rt),Gr=Bt.x+hi,Cr=Bt.y+hi;O.push(Gr,Cr,ge,0);const xi=Gr-ge,Ui=Cr-ge,Jt=Gr+ge,Ft=Cr+ge;if(se=se&&this.isOffscreen(xi,Ui,Jt,Ft),Te=Te||this.isInsideGrid(xi,Ui,Jt,Ft),!n&&this.grid.hitTestCircle(Gr,Cr,ge,P)&&(he=!0,!T))return{circles:[],offscreen:!1,collisionDetected:he,occluded:!1}}}}return{circles:!T&&he||!Te?[]:O,offscreen:se,collisionDetected:he,occluded:te.occluded}}queryRenderedSymbols(i){if(i.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const n=[];let h=1/0,p=1/0,m=-1/0,_=-1/0;for(const T of i){const M=new s.Point(T.x+hi,T.y+hi);h=Math.min(h,M.x),p=Math.min(p,M.y),m=Math.max(m,M.x),_=Math.max(_,M.y),n.push(M)}const y=this.grid.query(h,p,m,_).concat(this.ignoredGrid.query(h,p,m,_)),v={},E={};for(const T of y){const M=T.key;if(v[M.bucketInstanceId]===void 0&&(v[M.bucketInstanceId]={}),v[M.bucketInstanceId][M.featureIndex])continue;const P=[new s.Point(T.x1,T.y1),new s.Point(T.x2,T.y1),new s.Point(T.x2,T.y2),new s.Point(T.x1,T.y2)];s.polygonIntersectsPolygon(n,P)&&(v[M.bucketInstanceId][M.featureIndex]=!0,E[M.bucketInstanceId]===void 0&&(E[M.bucketInstanceId]=[]),E[M.bucketInstanceId].push(M.featureIndex))}return E}insertCollisionBox(i,n,h,p,m){(n?this.ignoredGrid:this.grid).insert({bucketInstanceId:h,featureIndex:p,collisionGroupID:m},i[0],i[1],i[2],i[3])}insertCollisionCircles(i,n,h,p,m){const _=n?this.ignoredGrid:this.grid,y={bucketInstanceId:h,featureIndex:p,collisionGroupID:m};for(let v=0;v<i.length;v+=4)_.insertCircle(y,i[v],i[v+1],i[v+2])}projectAndGetPerspectiveRatio(i,n,h,p,m,_,y){const v=[n,h,p,1];let E=!1;p||this.transform.pitch>0?(s.transformMat4$1(v,v,i),this.fogState&&m&&y.name!=="globe"&&(E=function(P,R,F,B,O,A){const L=A.calculateFogTileMatrix(O),N=[R,F,B];return s.transformMat4(N,N,L),Hr(P,N,A.pitch,A._fov)}(this.fogState,n,h,p,m.toUnwrapped(),this.transform)>.9)):dt(v,v,i);const T=v[3];return{point:new s.Point((v[0]/T+1)/2*this.transform.width+hi,(-v[1]/T+1)/2*this.transform.height+hi),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(y)/T*.5,1.5),signedDistanceFromCamera:T,occluded:_&&v[2]>T||E}}isOffscreen(i,n,h,p){return h<hi||i>=this.screenRightBoundary||p<hi||n>this.screenBottomBoundary}isInsideGrid(i,n,h,p){return h>=0&&i<this.gridRightBoundary&&p>=0&&n<this.gridBottomBoundary}getViewportMatrix(){const i=s.identity([]);return s.translate(i,i,[-100,-100,0]),i}}function Oo(l,i,n){const h=i.createTileMatrix(l,l.worldSize,n.toUnwrapped());return s.multiply(new Float32Array(16),l.projMatrix,h)}function fi(l,i,n){if(i.projection.name===n.projection.name)return l.projMatrix;const h=n.clone();return h.setProjection(i.projection),Oo(h,i.getProjection(),l)}function Kt(l,i,n){return i.name===n.projection.name?l.projMatrix:Oo(n,i,l)}class xc{constructor(i,n,h,p){this.opacity=i?Math.max(0,Math.min(1,i.opacity+(i.placed?n:-n))):p&&h?1:0,this.placed=h}isHidden(){return this.opacity===0&&!this.placed}}class Hi{constructor(i,n,h,p,m,_=!1){this.text=new xc(i?i.text:null,n,h,m),this.icon=new xc(i?i.icon:null,n,p,m),this.clipped=_}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Yn{constructor(i,n,h,p=!1){this.text=i,this.icon=n,this.skipFade=h,this.clipped=p}}class Hn{constructor(){this.invProjMatrix=s.create(),this.viewportMatrix=s.create(),this.circles=[]}}class Ns{constructor(i,n,h,p,m){this.bucketInstanceId=i,this.featureIndex=n,this.sourceLayerIndex=h,this.bucketIndex=p,this.tileID=m}}class vc{constructor(i){this.crossSourceCollisions=i,this.maxGroupID=0,this.collisionGroups={}}get(i){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[i]){const n=++this.maxGroupID;this.collisionGroups[i]={ID:n,predicate:h=>h.collisionGroupID===n}}return this.collisionGroups[i]}}function Kn(l,i,n,h,p){const{horizontalAlign:m,verticalAlign:_}=s.getAnchorAlignment(l),y=-(m-.5)*i,v=-(_-.5)*n,E=s.evaluateVariableOffset(l,h);return new s.Point(y+E[0]*p,v+E[1]*p)}function Jn(l,i,n,h,p){const m=new s.Point(l,i);return n&&m._rotate(h?p:-p),m}class ja{constructor(i,n,h,p,m){this.transform=i.clone(),this.projection=i.projection.name,this.collisionIndex=new Wn(this.transform,m),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=n,this.retainedQueryData={},this.collisionGroups=new vc(h),this.collisionCircleArrays={},this.prevPlacement=p,p&&(p.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(i,n,h,p){const m=h.getBucket(n),_=h.latestFeatureIndex;if(!m||!_||n.id!==m.layerIds[0])return;const y=m.layers[0].layout,v=h.collisionBoxArray,E=Math.pow(2,this.transform.zoom-h.tileID.overscaledZ),T=h.tileSize/s.EXTENT,M=h.tileID.toUnwrapped();this.transform.setProjection(m.projection);const P=(R=h.tileID,F=m.getProjection(),B=this.transform,F.name===this.projection?B.calculateProjMatrix(R.toUnwrapped()):Oo(B,F,R));var R,F,B;const O=y.get("text-pitch-alignment")==="map",A=y.get("text-rotation-alignment")==="map";n.compileFilter();const L=n.dynamicFilter(),N=n.dynamicFilterNeedsFeature(),V=this.transform.calculatePixelsToTileUnitsMatrix(h),H=Yi(P,h.tileID.canonical,O,A,this.transform,m.getProjection(),V);let J=null;if(O){const te=mr(P,h.tileID.canonical,O,A,this.transform,m.getProjection(),V);J=s.multiply([],this.transform.labelPlaneMatrix,te)}let K=null;L&&h.latestFeatureIndex&&(K={unwrappedTileID:M,dynamicFilter:L,dynamicFilterNeedsFeature:N,featureIndex:h.latestFeatureIndex}),this.retainedQueryData[m.bucketInstanceId]=new Ns(m.bucketInstanceId,_,m.sourceLayerIndex,m.index,h.tileID);const re={bucket:m,layout:y,posMatrix:P,textLabelPlaneMatrix:H,labelToScreenMatrix:J,clippingData:K,scale:E,textPixelRatio:T,holdingForFade:h.holdingForFade(),collisionBoxArray:v,partiallyEvaluatedTextSize:s.evaluateSizeForZoom(m.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:s.evaluateSizeForZoom(m.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(m.sourceID)};if(p)for(const te of m.sortKeyRanges){const{sortKey:le,symbolInstanceStart:Ee,symbolInstanceEnd:ne}=te;i.push({sortKey:le,symbolInstanceStart:Ee,symbolInstanceEnd:ne,parameters:re})}else i.push({symbolInstanceStart:0,symbolInstanceEnd:m.symbolInstances.length,parameters:re})}attemptAnchorPlacement(i,n,h,p,m,_,y,v,E,T,M,P,R,F,B,O,A,L){const{textOffset0:N,textOffset1:V,crossTileID:H}=P,J=[N,V],K=Kn(i,h,p,J,m),re=this.collisionIndex.placeCollisionBox(F,m,n,Jn(K.x,K.y,_,y,this.transform.angle),M,v,E,T.predicate);if(O){const te=F.getSymbolInstanceIconSize(L,this.transform.zoom,P.placedIconSymbolIndex);if(this.collisionIndex.placeCollisionBox(F,te,O,Jn(K.x,K.y,_,y,this.transform.angle),M,v,E,T.predicate).box.length===0)return}if(re.box.length>0){let te;return this.prevPlacement&&this.prevPlacement.variableOffsets[H]&&this.prevPlacement.placements[H]&&this.prevPlacement.placements[H].text&&(te=this.prevPlacement.variableOffsets[H].anchor),this.variableOffsets[H]={textOffset:J,width:h,height:p,anchor:i,textScale:m,prevAnchor:te},this.markUsedJustification(F,i,P,B),F.allowVerticalPlacement&&(this.markUsedOrientation(F,B,P),this.placedOrientations[H]=B),{shift:K,placedGlyphBoxes:re}}}placeLayerBucketPart(i,n,h,p){const{bucket:m,layout:_,posMatrix:y,textLabelPlaneMatrix:v,labelToScreenMatrix:E,clippingData:T,textPixelRatio:M,holdingForFade:P,collisionBoxArray:R,partiallyEvaluatedTextSize:F,partiallyEvaluatedIconSize:B,collisionGroup:O}=i.parameters,A=_.get("text-optional"),L=_.get("icon-optional"),N=_.get("text-allow-overlap"),V=_.get("icon-allow-overlap"),H=_.get("text-rotation-alignment")==="map",J=_.get("text-pitch-alignment")==="map",K=_.get("icon-text-fit")!=="none",re=_.get("symbol-z-order")==="viewport-y";this.transform.setProjection(m.projection);let te=N&&(V||!m.hasIconData()||L),le=V&&(N||!m.hasTextData()||A);!m.collisionArrays&&R&&m.deserializeCollisionBoxes(R),h&&p&&m.updateCollisionDebugBuffers(this.transform.zoom,R);const Ee=(ne,_e,he)=>{const{crossTileID:Te,numVerticalGlyphVertices:se}=ne;if(T){const Jt={zoom:this.transform.zoom,pitch:this.transform.pitch};let Ft=null;if(T.dynamicFilterNeedsFeature){const kt=this.retainedQueryData[m.bucketInstanceId];Ft=T.featureIndex.loadFeature({featureIndex:ne.featureIndex,bucketIndex:kt.bucketIndex,sourceLayerIndex:kt.sourceLayerIndex,layoutVertexArrayOffset:0})}if(!(0,T.dynamicFilter)(Jt,Ft,this.retainedQueryData[m.bucketInstanceId].tileID.canonical,new s.Point(ne.tileAnchorX,ne.tileAnchorY),this.transform.calculateDistanceTileData(T.unwrappedTileID)))return this.placements[Te]=new Yn(!1,!1,!1,!0),void n.add(Te)}if(n.has(Te))return;if(P)return void(this.placements[Te]=new Yn(!1,!1,!1));let ge=!1,Se=!1,we=!0,Me=!1,qe=!1,Qe=null,je={box:null,offscreen:null,occluded:null},We={box:null,offscreen:null,occluded:null},mt=null,ut=null,$e=null,It=0,Lt=0,Rt=0;he.textFeatureIndex?It=he.textFeatureIndex:ne.useRuntimeCollisionCircles&&(It=ne.featureIndex),he.verticalTextFeatureIndex&&(Lt=he.verticalTextFeatureIndex);const Bt=Jt=>{Jt.tileID=this.retainedQueryData[m.bucketInstanceId].tileID;const Ft=this.transform.elevation;(Ft||Jt.elevation)&&(Jt.elevation=Ft?Ft.getAtTileOffset(Jt.tileID,Jt.tileAnchorX,Jt.tileAnchorY):0)},Gr=he.textBox;if(Gr){Bt(Gr);const Jt=kt=>{let fr=s.WritingMode.horizontal;if(m.allowVerticalPlacement&&!kt&&this.prevPlacement){const Wr=this.prevPlacement.placedOrientations[Te];Wr&&(this.placedOrientations[Te]=Wr,fr=Wr,this.markUsedOrientation(m,fr,ne))}return fr},Ft=(kt,fr)=>{if(m.allowVerticalPlacement&&se>0&&he.verticalTextBox){for(const Wr of m.writingModes)if(Wr===s.WritingMode.vertical?(je=fr(),We=je):je=kt(),je&&je.box&&je.box.length)break}else je=kt()};if(_.get("text-variable-anchor")){let kt=_.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[Te]){const Yt=this.prevPlacement.variableOffsets[Te];kt.indexOf(Yt.anchor)>0&&(kt=kt.filter(ei=>ei!==Yt.anchor),kt.unshift(Yt.anchor))}const fr=(Yt,ei,ds)=>{const Zo=m.getSymbolInstanceTextSize(F,ne,this.transform.zoom,_e),ya=(Yt.x2-Yt.x1)*Zo+2*Yt.padding,io=(Yt.y2-Yt.y1)*Zo+2*Yt.padding,To=K&&!V?ei:null;To&&Bt(To);let Xo={box:[],offscreen:!1,occluded:!1};const ms=N?2*kt.length:kt.length;for(let xa=0;xa<ms;++xa){const zl=this.attemptAnchorPlacement(kt[xa%kt.length],Yt,ya,io,Zo,H,J,M,y,O,xa>=kt.length,ne,_e,m,ds,To,F,B);if(zl&&(Xo=zl.placedGlyphBoxes,Xo&&Xo.box&&Xo.box.length)){ge=!0,Qe=zl.shift;break}}return Xo};Ft(()=>fr(Gr,he.iconBox,s.WritingMode.horizontal),()=>{const Yt=he.verticalTextBox;return Yt&&Bt(Yt),m.allowVerticalPlacement&&!(je&&je.box&&je.box.length)&&se>0&&Yt?fr(Yt,he.verticalIconBox,s.WritingMode.vertical):{box:null,offscreen:null,occluded:null}}),je&&(ge=je.box,we=je.offscreen,Me=je.occluded);const Wr=Jt(!(!je||!je.box));if(!ge&&this.prevPlacement){const Yt=this.prevPlacement.variableOffsets[Te];Yt&&(this.variableOffsets[Te]=Yt,this.markUsedJustification(m,Yt.anchor,ne,Wr))}}else{const kt=(fr,Wr)=>{const Yt=m.getSymbolInstanceTextSize(F,ne,this.transform.zoom,_e),ei=this.collisionIndex.placeCollisionBox(m,Yt,fr,new s.Point(0,0),N,M,y,O.predicate);return ei&&ei.box&&ei.box.length&&(this.markUsedOrientation(m,Wr,ne),this.placedOrientations[Te]=Wr),ei};Ft(()=>kt(Gr,s.WritingMode.horizontal),()=>{const fr=he.verticalTextBox;return m.allowVerticalPlacement&&se>0&&fr?(Bt(fr),kt(fr,s.WritingMode.vertical)):{box:null,offscreen:null,occluded:null}}),Jt(!!(je&&je.box&&je.box.length))}}if(mt=je,ge=mt&&mt.box&&mt.box.length>0,we=mt&&mt.offscreen,Me=mt&&mt.occluded,ne.useRuntimeCollisionCircles){const Jt=m.text.placedSymbolArray.get(ne.centerJustifiedTextSymbolIndex>=0?ne.centerJustifiedTextSymbolIndex:ne.verticalPlacedTextSymbolIndex),Ft=s.evaluateSizeForFeature(m.textSizeData,F,Jt),kt=_.get("text-padding");ut=this.collisionIndex.placeCollisionCircles(m,N,Jt,m.lineVertexArray,m.glyphOffsetArray,Ft,y,v,E,h,J,O.predicate,ne.collisionCircleDiameter*Ft/s.ONE_EM,kt,this.retainedQueryData[m.bucketInstanceId].tileID),ge=N||ut.circles.length>0&&!ut.collisionDetected,we=we&&ut.offscreen,Me=ut.occluded}if(he.iconFeatureIndex&&(Rt=he.iconFeatureIndex),he.iconBox){const Jt=Ft=>{Bt(Ft);const kt=K&&Qe?Jn(Qe.x,Qe.y,H,J,this.transform.angle):new s.Point(0,0),fr=m.getSymbolInstanceIconSize(B,this.transform.zoom,ne.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(m,fr,Ft,kt,V,M,y,O.predicate)};We&&We.box&&We.box.length&&he.verticalIconBox?($e=Jt(he.verticalIconBox),Se=$e.box.length>0):($e=Jt(he.iconBox),Se=$e.box.length>0),we=we&&$e.offscreen,qe=$e.occluded}const Cr=A||ne.numHorizontalGlyphVertices===0&&se===0,xi=L||ne.numIconVertices===0;if(Cr||xi?xi?Cr||(Se=Se&&ge):ge=Se&&ge:Se=ge=Se&&ge,ge&&mt&&mt.box&&this.collisionIndex.insertCollisionBox(mt.box,_.get("text-ignore-placement"),m.bucketInstanceId,We&&We.box&&Lt?Lt:It,O.ID),Se&&$e&&this.collisionIndex.insertCollisionBox($e.box,_.get("icon-ignore-placement"),m.bucketInstanceId,Rt,O.ID),ut&&(ge&&this.collisionIndex.insertCollisionCircles(ut.circles,_.get("text-ignore-placement"),m.bucketInstanceId,It,O.ID),h)){const Jt=m.bucketInstanceId;let Ft=this.collisionCircleArrays[Jt];Ft===void 0&&(Ft=this.collisionCircleArrays[Jt]=new Hn);for(let kt=0;kt<ut.circles.length;kt+=4)Ft.circles.push(ut.circles[kt+0]),Ft.circles.push(ut.circles[kt+1]),Ft.circles.push(ut.circles[kt+2]),Ft.circles.push(ut.collisionDetected?1:0)}const Ui=m.projection.name!=="globe";te=te&&(Ui||!Me),le=le&&(Ui||!qe),this.placements[Te]=new Yn(ge||te,Se||le,we||m.justReloaded),n.add(Te)};if(re){const ne=m.getSortedSymbolIndexes(this.transform.angle);for(let _e=ne.length-1;_e>=0;--_e){const he=ne[_e];Ee(m.symbolInstances.get(he),he,m.collisionArrays[he])}}else for(let ne=i.symbolInstanceStart;ne<i.symbolInstanceEnd;ne++)Ee(m.symbolInstances.get(ne),ne,m.collisionArrays[ne]);if(h&&m.bucketInstanceId in this.collisionCircleArrays){const ne=this.collisionCircleArrays[m.bucketInstanceId];s.invert(ne.invProjMatrix,y),ne.viewportMatrix=this.collisionIndex.getViewportMatrix()}m.justReloaded=!1}markUsedJustification(i,n,h,p){const{leftJustifiedTextSymbolIndex:m,centerJustifiedTextSymbolIndex:_,rightJustifiedTextSymbolIndex:y,verticalPlacedTextSymbolIndex:v,crossTileID:E}=h,T=s.getAnchorJustification(n),M=p===s.WritingMode.vertical?v:T==="left"?m:T==="center"?_:T==="right"?y:-1;m>=0&&(i.text.placedSymbolArray.get(m).crossTileID=M>=0&&m!==M?0:E),_>=0&&(i.text.placedSymbolArray.get(_).crossTileID=M>=0&&_!==M?0:E),y>=0&&(i.text.placedSymbolArray.get(y).crossTileID=M>=0&&y!==M?0:E),v>=0&&(i.text.placedSymbolArray.get(v).crossTileID=M>=0&&v!==M?0:E)}markUsedOrientation(i,n,h){const p=n===s.WritingMode.horizontal||n===s.WritingMode.horizontalOnly?n:0,m=n===s.WritingMode.vertical?n:0,{leftJustifiedTextSymbolIndex:_,centerJustifiedTextSymbolIndex:y,rightJustifiedTextSymbolIndex:v,verticalPlacedTextSymbolIndex:E}=h,T=i.text.placedSymbolArray;_>=0&&(T.get(_).placedOrientation=p),y>=0&&(T.get(y).placedOrientation=p),v>=0&&(T.get(v).placedOrientation=p),E>=0&&(T.get(E).placedOrientation=m)}commit(i){this.commitTime=i,this.zoomAtLastRecencyCheck=this.transform.zoom;const n=this.prevPlacement;let h=!1;this.prevZoomAdjustment=n?n.zoomAdjustment(this.transform.zoom):0;const p=n?n.symbolFadeChange(i):1,m=n?n.opacities:{},_=n?n.variableOffsets:{},y=n?n.placedOrientations:{};for(const v in this.placements){const E=this.placements[v],T=m[v];T?(this.opacities[v]=new Hi(T,p,E.text,E.icon,null,E.clipped),h=h||E.text!==T.text.placed||E.icon!==T.icon.placed):(this.opacities[v]=new Hi(null,p,E.text,E.icon,E.skipFade,E.clipped),h=h||E.text||E.icon)}for(const v in m){const E=m[v];if(!this.opacities[v]){const T=new Hi(E,p,!1,!1);T.isHidden()||(this.opacities[v]=T,h=h||E.text.placed||E.icon.placed)}}for(const v in _)this.variableOffsets[v]||!this.opacities[v]||this.opacities[v].isHidden()||(this.variableOffsets[v]=_[v]);for(const v in y)this.placedOrientations[v]||!this.opacities[v]||this.opacities[v].isHidden()||(this.placedOrientations[v]=y[v]);h?this.lastPlacementChangeTime=i:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=n?n.lastPlacementChangeTime:i)}updateLayerOpacities(i,n){const h=new Set;for(const p of n){const m=p.getBucket(i);m&&p.latestFeatureIndex&&i.id===m.layerIds[0]&&this.updateBucketOpacities(m,h,p.collisionBoxArray)}}updateBucketOpacities(i,n,h){i.hasTextData()&&i.text.opacityVertexArray.clear(),i.hasIconData()&&i.icon.opacityVertexArray.clear(),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexArray.clear(),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexArray.clear();const p=i.layers[0].layout,m=!!i.layers[0].dynamicFilter(),_=new Hi(null,0,!1,!1,!0),y=p.get("text-allow-overlap"),v=p.get("icon-allow-overlap"),E=p.get("text-variable-anchor"),T=p.get("text-rotation-alignment")==="map",M=p.get("text-pitch-alignment")==="map",P=p.get("icon-text-fit")!=="none",R=new Hi(null,0,y&&(v||!i.hasIconData()||p.get("icon-optional")),v&&(y||!i.hasTextData()||p.get("text-optional")),!0);!i.collisionArrays&&h&&(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData())&&i.deserializeCollisionBoxes(h);const F=(O,A,L)=>{for(let N=0;N<A/4;N++)O.opacityVertexArray.emplaceBack(L)};let B=0;for(let O=0;O<i.symbolInstances.length;O++){const A=i.symbolInstances.get(O),{numHorizontalGlyphVertices:L,numVerticalGlyphVertices:N,crossTileID:V,numIconVertices:H}=A,J=n.has(V);let K=this.opacities[V];J?K=_:K||(K=R,this.opacities[V]=K),n.add(V);const re=L>0||N>0,te=H>0,le=this.placedOrientations[V],Ee=le===s.WritingMode.vertical,ne=le===s.WritingMode.horizontal||le===s.WritingMode.horizontalOnly;if(!re&&!te||K.isHidden()||B++,re){const _e=Qn(K.text);F(i.text,L,Ee?lr:_e),F(i.text,N,ne?lr:_e);const he=K.text.isHidden(),{leftJustifiedTextSymbolIndex:Te,centerJustifiedTextSymbolIndex:se,rightJustifiedTextSymbolIndex:ge,verticalPlacedTextSymbolIndex:Se}=A,we=i.text.placedSymbolArray,Me=he||Ee?1:0;Te>=0&&(we.get(Te).hidden=Me),se>=0&&(we.get(se).hidden=Me),ge>=0&&(we.get(ge).hidden=Me),Se>=0&&(we.get(Se).hidden=he||ne?1:0);const qe=this.variableOffsets[V];qe&&this.markUsedJustification(i,qe.anchor,A,le);const Qe=this.placedOrientations[V];Qe&&(this.markUsedJustification(i,"left",A,Qe),this.markUsedOrientation(i,Qe,A))}if(te){const _e=Qn(K.icon),{placedIconSymbolIndex:he,verticalPlacedIconSymbolIndex:Te}=A,se=i.icon.placedSymbolArray,ge=K.icon.isHidden()?1:0;he>=0&&(F(i.icon,H,Ee?lr:_e),se.get(he).hidden=ge),Te>=0&&(F(i.icon,A.numVerticalIconVertices,ne?lr:_e),se.get(Te).hidden=ge)}if(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData()){const _e=i.collisionArrays[O];if(_e){let he=new s.Point(0,0),Te=!0;if(_e.textBox||_e.verticalTextBox){if(E){const ge=this.variableOffsets[V];ge?(he=Kn(ge.anchor,ge.width,ge.height,ge.textOffset,ge.textScale),T&&he._rotate(M?this.transform.angle:-this.transform.angle)):Te=!1}m&&(Te=!K.clipped),_e.textBox&&un(i.textCollisionBox.collisionVertexArray,K.text.placed,!Te||Ee,he.x,he.y),_e.verticalTextBox&&un(i.textCollisionBox.collisionVertexArray,K.text.placed,!Te||ne,he.x,he.y)}const se=Te&&!!(!ne&&_e.verticalIconBox);_e.iconBox&&un(i.iconCollisionBox.collisionVertexArray,K.icon.placed,se,P?he.x:0,P?he.y:0),_e.verticalIconBox&&un(i.iconCollisionBox.collisionVertexArray,K.icon.placed,!se,P?he.x:0,P?he.y:0)}}}if(i.fullyClipped=B===0,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){const O=this.collisionCircleArrays[i.bucketInstanceId];i.placementInvProjMatrix=O.invProjMatrix,i.placementViewportMatrix=O.viewportMatrix,i.collisionCircleArray=O.circles,delete this.collisionCircleArrays[i.bucketInstanceId]}}symbolFadeChange(i){return this.fadeDuration===0?1:(i-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(i){return Math.max(0,(this.transform.zoom-i)/1.5)}hasTransitions(i){return this.stale||i-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(i,n){const h=this.zoomAtLastRecencyCheck===n?1-this.zoomAdjustment(n):1;return this.zoomAtLastRecencyCheck=n,this.commitTime+this.fadeDuration*h>i}setStale(){this.stale=!0}}function un(l,i,n,h,p){l.emplaceBack(i?1:0,n?1:0,h||0,p||0),l.emplaceBack(i?1:0,n?1:0,h||0,p||0),l.emplaceBack(i?1:0,n?1:0,h||0,p||0),l.emplaceBack(i?1:0,n?1:0,h||0,p||0)}const Jr=Math.pow(2,25),ur=Math.pow(2,24),Vs=Math.pow(2,17),Gs=Math.pow(2,16),Qr=Math.pow(2,9),gi=Math.pow(2,8),wc=Math.pow(2,1);function Qn(l){if(l.opacity===0&&!l.placed)return 0;if(l.opacity===1&&l.placed)return 4294967295;const i=l.placed?1:0,n=Math.floor(127*l.opacity);return n*Jr+i*ur+n*Vs+i*Gs+n*Qr+i*gi+n*wc+i}const lr=0;class ea{constructor(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=new Set,this._bucketParts=[]}continuePlacement(i,n,h,p,m){const _=this._bucketParts;for(;this._currentTileIndex<i.length;)if(n.getBucketParts(_,p,i[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,m())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,_.sort((y,v)=>y.sortKey-v.sortKey));this._currentPartIndex<_.length;){const y=_[this._currentPartIndex];if(n.placeLayerBucketPart(y,this._seenCrossTileIDs,h,y.symbolInstanceStart===0),this._currentPartIndex++,m())return!0}return!1}}class $s{constructor(i,n,h,p,m,_,y,v){this.placement=new ja(i,m,_,y,v),this._currentPlacementIndex=n.length-1,this._forceFullPlacement=h,this._showCollisionBoxes=p,this._done=!1}isDone(){return this._done}continuePlacement(i,n,h){const p=s.exported.now(),m=()=>{const _=s.exported.now()-p;return!this._forceFullPlacement&&_>2};for(;this._currentPlacementIndex>=0;){const _=n[i[this._currentPlacementIndex]],y=this.placement.collisionIndex.transform.zoom;if(_.type==="symbol"&&(!_.minzoom||_.minzoom<=y)&&(!_.maxzoom||_.maxzoom>y)){if(this._inProgressLayer||(this._inProgressLayer=new ea(_)),this._inProgressLayer.continuePlacement(h[_.source],this.placement,this._showCollisionBoxes,_,m))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(i){return this.placement.commit(i),this.placement}}const Uo=512/s.EXTENT/2;class Br{constructor(i,n,h){this.tileID=i,this.bucketInstanceId=h,this.index=new s.KDBush(n.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const p=i.canonical.x*s.EXTENT,m=i.canonical.y*s.EXTENT;for(let _=0;_<n.length;_++){const{key:y,crossTileID:v,tileAnchorX:E,tileAnchorY:T}=n.get(_),M=Math.floor((p+E)*Uo),P=Math.floor((m+T)*Uo);this.index.add(M,P),this.keys.push(y),this.crossTileIDs.push(v)}this.index.finish()}findMatches(i,n,h){const p=this.tileID.canonical.z<n.canonical.z?1:Math.pow(2,this.tileID.canonical.z-n.canonical.z),m=Uo/Math.pow(2,n.canonical.z-this.tileID.canonical.z),_=n.canonical.x*s.EXTENT,y=n.canonical.y*s.EXTENT;for(let v=0;v<i.length;v++){const E=i.get(v);if(E.crossTileID)continue;const{key:T,tileAnchorX:M,tileAnchorY:P}=E,R=Math.floor((_+M)*m),F=Math.floor((y+P)*m),B=this.index.range(R-p,F-p,R+p,F+p);for(const O of B){const A=this.crossTileIDs[O];if(this.keys[O]===T&&!h.has(A)){h.add(A),E.crossTileID=A;break}}}}}class qs{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Zs{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(i){const n=Math.round((i-this.lng)/360);if(n!==0)for(const h in this.indexes){const p=this.indexes[h],m={};for(const _ in p){const y=p[_];y.tileID=y.tileID.unwrapTo(y.tileID.wrap+n),m[y.tileID.key]=y}this.indexes[h]=m}this.lng=i}addBucket(i,n,h){if(this.indexes[i.overscaledZ]&&this.indexes[i.overscaledZ][i.key]){if(this.indexes[i.overscaledZ][i.key].bucketInstanceId===n.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(i.overscaledZ,this.indexes[i.overscaledZ][i.key])}for(let m=0;m<n.symbolInstances.length;m++)n.symbolInstances.get(m).crossTileID=0;this.usedCrossTileIDs[i.overscaledZ]||(this.usedCrossTileIDs[i.overscaledZ]=new Set);const p=this.usedCrossTileIDs[i.overscaledZ];for(const m in this.indexes){const _=this.indexes[m];if(Number(m)>i.overscaledZ)for(const y in _){const v=_[y];v.tileID.isChildOf(i)&&v.findMatches(n.symbolInstances,i,p)}else{const y=_[i.scaledTo(Number(m)).key];y&&y.findMatches(n.symbolInstances,i,p)}}for(let m=0;m<n.symbolInstances.length;m++){const _=n.symbolInstances.get(m);_.crossTileID||(_.crossTileID=h.generate(),p.add(_.crossTileID))}return this.indexes[i.overscaledZ]===void 0&&(this.indexes[i.overscaledZ]={}),this.indexes[i.overscaledZ][i.key]=new Br(i,n.symbolInstances,n.bucketInstanceId),!0}removeBucketCrossTileIDs(i,n){for(const h of n.crossTileIDs)this.usedCrossTileIDs[i].delete(h)}removeStaleBuckets(i){let n=!1;for(const h in this.indexes){const p=this.indexes[h];for(const m in p)i[p[m].bucketInstanceId]||(this.removeBucketCrossTileIDs(h,p[m]),delete p[m],n=!0)}return n}}class Ki{constructor(){this.layerIndexes={},this.crossTileIDs=new qs,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(i,n,h,p){let m=this.layerIndexes[i.id];m===void 0&&(m=this.layerIndexes[i.id]=new Zs);let _=!1;const y={};p.name!=="globe"&&m.handleWrapJump(h);for(const v of n){const E=v.getBucket(i);E&&i.id===E.layerIds[0]&&(E.bucketInstanceId||(E.bucketInstanceId=++this.maxBucketInstanceId),m.addBucket(v.tileID,E,this.crossTileIDs)&&(_=!0),y[E.bucketInstanceId]=!0)}return m.removeStaleBuckets(y)&&(_=!0),_}pruneUnusedLayers(i){const n={};i.forEach(h=>{n[h]=!0});for(const h in this.layerIndexes)n[h]||delete this.layerIndexes[h]}}const wo=(l,i)=>s.emitValidationErrors(l,i&&i.filter(n=>n.identifier!=="source.canvas")),Na=s.pick(Mt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setProjection"]),$h=s.pick(Mt,["setCenter","setZoom","setBearing","setPitch"]),Xs={version:8,layers:[],sources:{}},pn={fill:!0,line:!0,background:!0,hillshade:!0,raster:!0};class Bi extends s.Evented{constructor(i,n={}){super(),this.map=i,this.dispatcher=new tr(cn(),this),this.imageManager=new jn,this.imageManager.setEventedParent(this),this.glyphManager=new s.GlyphManager(i._requestManager,n.localFontFamily?s.LocalGlyphMode.all:n.localIdeographFontFamily?s.LocalGlyphMode.ideographs:s.LocalGlyphMode.none,n.localFontFamily||n.localIdeographFontFamily),this.crossTileSymbolIndex=new Ki,this._layers={},this._num3DLayers=0,this._numSymbolLayers=0,this._numCircleLayers=0,this._serializedLayers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._availableImages=[],this._order=[],this._drapedFirstOrder=[],this._markersNeedUpdate=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",s.getReferrer());const h=this;this._rtlTextPluginCallback=Bi.registerForPluginStateChange(p=>{h.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:p.pluginStatus,pluginURL:p.pluginURL},(m,_)=>{if(s.triggerPluginCompletionEvent(m),_&&_.every(y=>y))for(const y in h._sourceCaches){const v=h._sourceCaches[y],E=v.getSource().type;E!=="vector"&&E!=="geojson"||v.reload()}})}),this.on("data",p=>{if(p.dataType!=="source"||p.sourceDataType!=="metadata")return;const m=this.getSource(p.sourceId);if(m&&m.vectorLayerIds)for(const _ in this._layers){const y=this._layers[_];y.source===m.id&&this._validateLayer(y)}})}loadURL(i,n={}){this.fire(new s.Event("dataloading",{dataType:"style"}));const h=typeof n.validate=="boolean"?n.validate:!s.isMapboxURL(i);i=this.map._requestManager.normalizeStyleURL(i,n.accessToken);const p=this.map._requestManager.transformRequest(i,s.ResourceType.Style);this._request=s.getJSON(p,(m,_)=>{this._request=null,m?this.fire(new s.ErrorEvent(m)):_&&this._load(_,h)})}loadJSON(i,n={}){this.fire(new s.Event("dataloading",{dataType:"style"})),this._request=s.exported.frame(()=>{this._request=null,this._load(i,n.validate!==!1)})}loadEmpty(){this.fire(new s.Event("dataloading",{dataType:"style"})),this._load(Xs,!1)}_updateLayerCount(i,n){const h=n?1:-1;i.is3D()&&(this._num3DLayers+=h),i.type==="circle"&&(this._numCircleLayers+=h),i.type==="symbol"&&(this._numSymbolLayers+=h)}_load(i,n){if(n&&wo(this,s.validateStyle(i)))return;this._loaded=!0,this.stylesheet=s.clone$1(i),this._updateMapProjection();for(const p in i.sources)this.addSource(p,i.sources[p],{validate:!1});this._changed=!1,i.sprite?this._loadSprite(i.sprite):(this.imageManager.setLoaded(!0),this.dispatcher.broadcast("spriteLoaded",!0)),this.glyphManager.setURL(i.glyphs);const h=gc(this.stylesheet.layers);this._order=h.map(p=>p.id),this._layers={},this._serializedLayers={};for(const p of h){const m=s.createStyleLayer(p);m.setEventedParent(this,{layer:{id:m.id}}),this._layers[m.id]=m,this._serializedLayers[m.id]=m.serialize(),this._updateLayerCount(m,!0)}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new Ke(this.stylesheet.light),this.stylesheet.terrain&&!this.terrainSetForDrapingOnly()&&this._createTerrain(this.stylesheet.terrain,1),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this._updateDrapeFirstLayers(),this.fire(new s.Event("data",{dataType:"style"})),this.fire(new s.Event("style.load"))}terrainSetForDrapingOnly(){return!!this.terrain&&this.terrain.drapeRenderMode===0}setProjection(i){i?this.stylesheet.projection=i:delete this.stylesheet.projection,this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?this.getTerrain()||this.stylesheet.terrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null))}_updateMapProjection(){this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.stylesheet.projection)}_loadSprite(i){this._spriteRequest=function(n,h,p){let m,_,y;const v=s.exported.devicePixelRatio>1?"@2x":"";let E=s.getJSON(h.transformRequest(h.normalizeSpriteURL(n,v,".json"),s.ResourceType.SpriteJSON),(P,R)=>{E=null,y||(y=P,m=R,M())}),T=s.getImage(h.transformRequest(h.normalizeSpriteURL(n,v,".png"),s.ResourceType.SpriteImage),(P,R)=>{T=null,y||(y=P,_=R,M())});function M(){if(y)p(y);else if(m&&_){const P=s.exported.getImageData(_),R={};for(const F in m){const{width:B,height:O,x:A,y:L,sdf:N,pixelRatio:V,stretchX:H,stretchY:J,content:K}=m[F],re=new s.RGBAImage({width:B,height:O});s.RGBAImage.copy(P,re,{x:A,y:L},{x:0,y:0},{width:B,height:O}),R[F]={data:re,pixelRatio:V,sdf:N,stretchX:H,stretchY:J,content:K}}p(null,R)}}return{cancel(){E&&(E.cancel(),E=null),T&&(T.cancel(),T=null)}}}(i,this.map._requestManager,(n,h)=>{if(this._spriteRequest=null,n)this.fire(new s.ErrorEvent(n));else if(h)for(const p in h)this.imageManager.addImage(p,h[p]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.dispatcher.broadcast("spriteLoaded",!0),this.fire(new s.Event("data",{dataType:"style"}))})}_validateLayer(i){const n=this.getSource(i.source);if(!n)return;const h=i.sourceLayer;h&&(n.type==="geojson"||n.vectorLayerIds&&n.vectorLayerIds.indexOf(h)===-1)&&this.fire(new s.ErrorEvent(new Error(`Source layer "${h}" does not exist on source "${n.id}" as specified by style layer "${i.id}"`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const i in this._sourceCaches)if(!this._sourceCaches[i].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(i){const n=[];for(const h of i){const p=this._layers[h];p.type!=="custom"&&n.push(p.serialize())}return n}hasTransitions(){if(this.light&&this.light.hasTransition()||this.fog&&this.fog.hasTransition())return!0;for(const i in this._sourceCaches)if(this._sourceCaches[i].hasTransition())return!0;for(const i in this._layers)if(this._layers[i].hasTransition())return!0;return!1}get order(){return this.map._optimizeForTerrain&&this.terrain?this._drapedFirstOrder:this._order}isLayerDraped(i){return!!this.terrain&&(typeof i.isLayerDraped=="function"?i.isLayerDraped():pn[i.type])}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}update(i){if(!this._loaded)return;const n=this._changed;if(this._changed){const p=Object.keys(this._updatedLayers),m=Object.keys(this._removedLayers);(p.length||m.length)&&this._updateWorkerLayers(p,m);for(const _ in this._updatedSources){const y=this._updatedSources[_];y==="reload"?this._reloadSource(_):y==="clear"&&this._clearSource(_)}this._updateTilesForChangedImages();for(const _ in this._updatedPaintProps)this._layers[_].updateTransitions(i);this.light.updateTransitions(i),this.fog&&this.fog.updateTransitions(i),this._resetUpdates()}const h={};for(const p in this._sourceCaches){const m=this._sourceCaches[p];h[p]=m.used,m.used=!1}for(const p of this._order){const m=this._layers[p];if(m.recalculate(i,this._availableImages),!m.isHidden(i.zoom)){const y=this._getLayerSourceCache(m);y&&(y.used=!0)}const _=this.map.painter;if(_){const y=m.getProgramIds();if(!y)continue;const v=m.getProgramConfiguration(i.zoom);for(const E of y)_.useProgram(E,v)}}for(const p in h){const m=this._sourceCaches[p];h[p]!==m.used&&m.getSource().fire(new s.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:m.getSource().id}))}this.light.recalculate(i),this.terrain&&this.terrain.recalculate(i),this.fog&&this.fog.recalculate(i),this.z=i.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),n&&this.fire(new s.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const i=Object.keys(this._changedImages);if(i.length){for(const n in this._sourceCaches)this._sourceCaches[n].reloadTilesForDependencies(["icons","patterns"],i);this._changedImages={}}}_updateWorkerLayers(i,n){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(i),removedIds:n})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(i){if(this._checkLoaded(),wo(this,s.validateStyle(i)))return!1;(i=s.clone$1(i)).layers=gc(i.layers);const n=function(p,m){if(!p)return[{command:Mt.setStyle,args:[m]}];let _=[];try{if(!ve(p.version,m.version))return[{command:Mt.setStyle,args:[m]}];ve(p.center,m.center)||_.push({command:Mt.setCenter,args:[m.center]}),ve(p.zoom,m.zoom)||_.push({command:Mt.setZoom,args:[m.zoom]}),ve(p.bearing,m.bearing)||_.push({command:Mt.setBearing,args:[m.bearing]}),ve(p.pitch,m.pitch)||_.push({command:Mt.setPitch,args:[m.pitch]}),ve(p.sprite,m.sprite)||_.push({command:Mt.setSprite,args:[m.sprite]}),ve(p.glyphs,m.glyphs)||_.push({command:Mt.setGlyphs,args:[m.glyphs]}),ve(p.transition,m.transition)||_.push({command:Mt.setTransition,args:[m.transition]}),ve(p.light,m.light)||_.push({command:Mt.setLight,args:[m.light]}),ve(p.fog,m.fog)||_.push({command:Mt.setFog,args:[m.fog]}),ve(p.projection,m.projection)||_.push({command:Mt.setProjection,args:[m.projection]});const y={},v=[];(function(M,P,R,F){let B;for(B in P=P||{},M=M||{})M.hasOwnProperty(B)&&(P.hasOwnProperty(B)||Zn(B,R,F));for(B in P){if(!P.hasOwnProperty(B))continue;const O=P[B];M.hasOwnProperty(B)?ve(M[B],O)||(M[B].type==="geojson"&&O.type==="geojson"&&Ua(M,P,B)?R.push({command:Mt.setGeoJSONSourceData,args:[B,O.data]}):Fs(B,P,R,F)):Bs(B,P,R)}})(p.sources,m.sources,v,y);const E=[];p.layers&&p.layers.forEach(M=>{M.source&&y[M.source]?_.push({command:Mt.removeLayer,args:[M.id]}):E.push(M)});let T=p.terrain;T&&y[T.source]&&(_.push({command:Mt.setTerrain,args:[void 0]}),T=void 0),_=_.concat(v),ve(T,m.terrain)||_.push({command:Mt.setTerrain,args:[m.terrain]}),function(M,P,R){P=P||[];const F=(M=M||[]).map(Xi),B=P.map(Xi),O=M.reduce(Os,{}),A=P.reduce(Os,{}),L=F.slice(),N=Object.create(null);let V,H,J,K,re,te,le;for(V=0,H=0;V<F.length;V++)J=F[V],A.hasOwnProperty(J)?H++:(R.push({command:Mt.removeLayer,args:[J]}),L.splice(L.indexOf(J,H),1));for(V=0,H=0;V<B.length;V++)J=B[B.length-1-V],L[L.length-1-V]!==J&&(O.hasOwnProperty(J)?(R.push({command:Mt.removeLayer,args:[J]}),L.splice(L.lastIndexOf(J,L.length-H),1)):H++,te=L[L.length-V],R.push({command:Mt.addLayer,args:[A[J],te]}),L.splice(L.length-V,0,J),N[J]=!0);for(V=0;V<B.length;V++)if(J=B[V],K=O[J],re=A[J],!N[J]&&!ve(K,re))if(ve(K.source,re.source)&&ve(K["source-layer"],re["source-layer"])&&ve(K.type,re.type)){for(le in Li(K.layout,re.layout,R,J,null,Mt.setLayoutProperty),Li(K.paint,re.paint,R,J,null,Mt.setPaintProperty),ve(K.filter,re.filter)||R.push({command:Mt.setFilter,args:[J,re.filter]}),ve(K.minzoom,re.minzoom)&&ve(K.maxzoom,re.maxzoom)||R.push({command:Mt.setLayerZoomRange,args:[J,re.minzoom,re.maxzoom]}),K)K.hasOwnProperty(le)&&le!=="layout"&&le!=="paint"&&le!=="filter"&&le!=="metadata"&&le!=="minzoom"&&le!=="maxzoom"&&(le.indexOf("paint.")===0?Li(K[le],re[le],R,J,le.slice(6),Mt.setPaintProperty):ve(K[le],re[le])||R.push({command:Mt.setLayerProperty,args:[J,le,re[le]]}));for(le in re)re.hasOwnProperty(le)&&!K.hasOwnProperty(le)&&le!=="layout"&&le!=="paint"&&le!=="filter"&&le!=="metadata"&&le!=="minzoom"&&le!=="maxzoom"&&(le.indexOf("paint.")===0?Li(K[le],re[le],R,J,le.slice(6),Mt.setPaintProperty):ve(K[le],re[le])||R.push({command:Mt.setLayerProperty,args:[J,le,re[le]]}))}else R.push({command:Mt.removeLayer,args:[J]}),te=L[L.lastIndexOf(J)+1],R.push({command:Mt.addLayer,args:[re,te]})}(E,m.layers,_)}catch(y){console.warn("Unable to compute style diff:",y),_=[{command:Mt.setStyle,args:[m]}]}return _}(this.serialize(),i).filter(p=>!(p.command in $h));if(n.length===0)return!1;const h=n.filter(p=>!(p.command in Na));if(h.length>0)throw new Error(`Unimplemented: ${h.map(p=>p.command).join(", ")}.`);return n.forEach(p=>{p.command!=="setTransition"&&p.command!=="setProjection"&&this[p.command].apply(this,p.args)}),this.stylesheet=i,this._updateMapProjection(),!0}addImage(i,n){return this.getImage(i)?this.fire(new s.ErrorEvent(new Error("An image with this name already exists."))):(this.imageManager.addImage(i,n),this._afterImageUpdated(i),this)}updateImage(i,n){this.imageManager.updateImage(i,n)}getImage(i){return this.imageManager.getImage(i)}removeImage(i){return this.getImage(i)?(this.imageManager.removeImage(i),this._afterImageUpdated(i),this):this.fire(new s.ErrorEvent(new Error("No image with this name exists.")))}_afterImageUpdated(i){this._availableImages=this.imageManager.listImages(),this._changedImages[i]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new s.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addSource(i,n,h={}){if(this._checkLoaded(),this.getSource(i)!==void 0)throw new Error("There is already a source with this ID");if(!n.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(s.validateSource,`sources.${i}`,n,null,h))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);const p=ht(i,n,this.dispatcher,this);p.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(i),source:p.serialize(),sourceId:i}));const m=_=>{const y=(_?"symbol:":"other:")+i,v=this._sourceCaches[y]=new s.SourceCache(y,p,_);(_?this._symbolSourceCaches:this._otherSourceCaches)[i]=v,v.style=this,v.onAdd(this.map)};m(!1),n.type!=="vector"&&n.type!=="geojson"||m(!0),p.onAdd&&p.onAdd(this.map),this._changed=!0}removeSource(i){this._checkLoaded();const n=this.getSource(i);if(!n)throw new Error("There is no source with this ID");for(const p in this._layers)if(this._layers[p].source===i)return this.fire(new s.ErrorEvent(new Error(`Source "${i}" cannot be removed while layer "${p}" is using it.`)));if(this.terrain&&this.terrain.get().source===i)return this.fire(new s.ErrorEvent(new Error(`Source "${i}" cannot be removed while terrain is using it.`)));const h=this._getSourceCaches(i);for(const p of h)delete this._sourceCaches[p.id],delete this._updatedSources[p.id],p.fire(new s.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:p.getSource().id})),p.setEventedParent(null),p.clearTiles();return delete this._otherSourceCaches[i],delete this._symbolSourceCaches[i],n.setEventedParent(null),n.onRemove&&n.onRemove(this.map),this._changed=!0,this}setGeoJSONSourceData(i,n){this._checkLoaded(),this.getSource(i).setData(n),this._changed=!0}getSource(i){const n=this._getSourceCache(i);return n&&n.getSource()}_getSources(){const i=[];for(const n in this._otherSourceCaches){const h=this._getSourceCache(n);h&&i.push(h.getSource())}return i}addLayer(i,n,h={}){this._checkLoaded();const p=i.id;if(this.getLayer(p))return void this.fire(new s.ErrorEvent(new Error(`Layer with id "${p}" already exists on this map`)));let m;if(i.type==="custom"){if(wo(this,s.validateCustomStyleLayer(i)))return;m=s.createStyleLayer(i)}else{if(typeof i.source=="object"&&(this.addSource(p,i.source),i=s.clone$1(i),i=s.extend(i,{source:p})),this._validate(s.validateLayer,`layers.${p}`,i,{arrayIndex:-1},h))return;m=s.createStyleLayer(i),this._validateLayer(m),m.setEventedParent(this,{layer:{id:p}}),this._serializedLayers[m.id]=m.serialize(),this._updateLayerCount(m,!0)}const _=n?this._order.indexOf(n):this._order.length;if(n&&_===-1)return void this.fire(new s.ErrorEvent(new Error(`Layer with id "${n}" does not exist on this map.`)));this._order.splice(_,0,p),this._layerOrderChanged=!0,this._layers[p]=m;const y=this._getLayerSourceCache(m);if(this._removedLayers[p]&&m.source&&y&&m.type!=="custom"){const v=this._removedLayers[p];delete this._removedLayers[p],v.type!==m.type?this._updatedSources[m.source]="clear":(this._updatedSources[m.source]="reload",y.pause())}this._updateLayer(m),m.onAdd&&m.onAdd(this.map),this._updateDrapeFirstLayers()}moveLayer(i,n){if(this._checkLoaded(),this._changed=!0,!this._layers[i])return void this.fire(new s.ErrorEvent(new Error(`The layer '${i}' does not exist in the map's style and cannot be moved.`)));if(i===n)return;const h=this._order.indexOf(i);this._order.splice(h,1);const p=n?this._order.indexOf(n):this._order.length;n&&p===-1?this.fire(new s.ErrorEvent(new Error(`Layer with id "${n}" does not exist on this map.`))):(this._order.splice(p,0,i),this._layerOrderChanged=!0,this._updateDrapeFirstLayers())}removeLayer(i){this._checkLoaded();const n=this._layers[i];if(!n)return void this.fire(new s.ErrorEvent(new Error(`The layer '${i}' does not exist in the map's style and cannot be removed.`)));n.setEventedParent(null),this._updateLayerCount(n,!1);const h=this._order.indexOf(i);this._order.splice(h,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[i]=n,delete this._layers[i],delete this._serializedLayers[i],delete this._updatedLayers[i],delete this._updatedPaintProps[i],n.onRemove&&n.onRemove(this.map),this._updateDrapeFirstLayers()}getLayer(i){return this._layers[i]}hasLayer(i){return i in this._layers}hasLayerType(i){for(const n in this._layers)if(this._layers[n].type===i)return!0;return!1}setLayerZoomRange(i,n,h){this._checkLoaded();const p=this.getLayer(i);p?p.minzoom===n&&p.maxzoom===h||(n!=null&&(p.minzoom=n),h!=null&&(p.maxzoom=h),this._updateLayer(p)):this.fire(new s.ErrorEvent(new Error(`The layer '${i}' does not exist in the map's style and cannot have zoom extent.`)))}setFilter(i,n,h={}){this._checkLoaded();const p=this.getLayer(i);if(p){if(!ve(p.filter,n))return n==null?(p.filter=void 0,void this._updateLayer(p)):void(this._validate(s.validateFilter,`layers.${p.id}.filter`,n,{layerType:p.type},h)||(p.filter=s.clone$1(n),this._updateLayer(p)))}else this.fire(new s.ErrorEvent(new Error(`The layer '${i}' does not exist in the map's style and cannot be filtered.`)))}getFilter(i){const n=this.getLayer(i);return n&&s.clone$1(n.filter)}setLayoutProperty(i,n,h,p={}){this._checkLoaded();const m=this.getLayer(i);m?ve(m.getLayoutProperty(n),h)||(m.setLayoutProperty(n,h,p),this._updateLayer(m)):this.fire(new s.ErrorEvent(new Error(`The layer '${i}' does not exist in the map's style and cannot be styled.`)))}getLayoutProperty(i,n){const h=this.getLayer(i);if(h)return h.getLayoutProperty(n);this.fire(new s.ErrorEvent(new Error(`The layer '${i}' does not exist in the map's style.`)))}setPaintProperty(i,n,h,p={}){this._checkLoaded();const m=this.getLayer(i);m?ve(m.getPaintProperty(n),h)||(m.setPaintProperty(n,h,p)&&this._updateLayer(m),this._changed=!0,this._updatedPaintProps[i]=!0):this.fire(new s.ErrorEvent(new Error(`The layer '${i}' does not exist in the map's style and cannot be styled.`)))}getPaintProperty(i,n){const h=this.getLayer(i);return h&&h.getPaintProperty(n)}setFeatureState(i,n){this._checkLoaded();const h=i.source,p=i.sourceLayer,m=this.getSource(h);if(!m)return void this.fire(new s.ErrorEvent(new Error(`The source '${h}' does not exist in the map's style.`)));const _=m.type;if(_==="geojson"&&p)return void this.fire(new s.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if(_==="vector"&&!p)return void this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));i.id===void 0&&this.fire(new s.ErrorEvent(new Error("The feature id parameter must be provided.")));const y=this._getSourceCaches(h);for(const v of y)v.setFeatureState(p,i.id,n)}removeFeatureState(i,n){this._checkLoaded();const h=i.source,p=this.getSource(h);if(!p)return void this.fire(new s.ErrorEvent(new Error(`The source '${h}' does not exist in the map's style.`)));const m=p.type,_=m==="vector"?i.sourceLayer:void 0;if(m==="vector"&&!_)return void this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));if(n&&typeof i.id!="string"&&typeof i.id!="number")return void this.fire(new s.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));const y=this._getSourceCaches(h);for(const v of y)v.removeFeatureState(_,i.id,n)}getFeatureState(i){this._checkLoaded();const n=i.source,h=i.sourceLayer,p=this.getSource(n);if(p){if(p.type!=="vector"||h)return i.id===void 0&&this.fire(new s.ErrorEvent(new Error("The feature id parameter must be provided."))),this._getSourceCaches(n)[0].getFeatureState(h,i.id);this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new s.ErrorEvent(new Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){return s.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){const i={};for(const n in this._sourceCaches){const h=this._sourceCaches[n].getSource();i[h.id]||(i[h.id]=h.serialize())}return s.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,terrain:this.getTerrain()||void 0,fog:this.stylesheet.fog,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:i,layers:this._serializeLayers(this._order)},n=>n!==void 0)}_updateLayer(i){this._updatedLayers[i.id]=!0;const n=this._getLayerSourceCache(i);i.source&&!this._updatedSources[i.source]&&n&&n.getSource().type!=="raster"&&(this._updatedSources[i.source]="reload",n.pause()),this._changed=!0,i.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(i){const n=_=>this._layers[_].type==="fill-extrusion",h={},p=[];for(let _=this._order.length-1;_>=0;_--){const y=this._order[_];if(n(y)){h[y]=_;for(const v of i){const E=v[y];if(E)for(const T of E)p.push(T)}}}p.sort((_,y)=>y.intersectionZ-_.intersectionZ);const m=[];for(let _=this._order.length-1;_>=0;_--){const y=this._order[_];if(n(y))for(let v=p.length-1;v>=0;v--){const E=p[v].feature;if(h[E.layer.id]<_)break;m.push(E),p.pop()}else for(const v of i){const E=v[y];if(E)for(const T of E)m.push(T.feature)}}return m}queryRenderedFeatures(i,n,h){n&&n.filter&&this._validate(s.validateFilter,"queryRenderedFeatures.filter",n.filter,null,n);const p={};if(n&&n.layers){if(!Array.isArray(n.layers))return this.fire(new s.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(const v of n.layers){const E=this._layers[v];if(!E)return this.fire(new s.ErrorEvent(new Error(`The layer '${v}' does not exist in the map's style and cannot be queried for features.`))),[];p[E.source]=!0}}const m=[];n.availableImages=this._availableImages;const _=n&&n.layers?n.layers.some(v=>{const E=this.getLayer(v);return E&&E.is3D()}):this.has3DLayers(),y=Kr.createFromScreenPoints(i,h);for(const v in this._sourceCaches){const E=this._sourceCaches[v].getSource().id;n.layers&&!p[E]||m.push(or(this._sourceCaches[v],this._layers,this._serializedLayers,y,n,h,_,!!this.map._showQueryGeometry))}return this.placement&&m.push(function(v,E,T,M,P,R,F){const B={},O=R.queryRenderedSymbols(M),A=[];for(const L of Object.keys(O).map(Number))A.push(F[L]);A.sort(Nr);for(const L of A){const N=L.featureIndex.lookupSymbolFeatures(O[L.bucketInstanceId],E,L.bucketIndex,L.sourceLayerIndex,P.filter,P.layers,P.availableImages,v);for(const V in N){const H=B[V]=B[V]||[],J=N[V];J.sort((K,re)=>{const te=L.featureSortOrder;if(te){const le=te.indexOf(K.featureIndex);return te.indexOf(re.featureIndex)-le}return re.featureIndex-K.featureIndex});for(const K of J)H.push(K)}}for(const L in B)B[L].forEach(N=>{const V=N.feature,H=T(v[L]);if(!H)return;const J=H.getFeatureState(V.layer["source-layer"],V.id);V.source=V.layer.source,V.layer["source-layer"]&&(V.sourceLayer=V.layer["source-layer"]),V.state=J});return B}(this._layers,this._serializedLayers,this._getLayerSourceCache.bind(this),y.screenGeometry,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(m)}querySourceFeatures(i,n){n&&n.filter&&this._validate(s.validateFilter,"querySourceFeatures.filter",n.filter,null,n);const h=this._getSourceCaches(i);let p=[];for(const m of h)p=p.concat(dr(m,n));return p}addSourceType(i,n,h){return Bi.getSourceType(i)?h(new Error(`A source type called "${i}" already exists.`)):(Bi.setSourceType(i,n),n.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:i,url:n.workerSourceURL},h):h(null,null))}getLight(){return this.light.getLight()}setLight(i,n={}){this._checkLoaded();const h=this.light.getLight();let p=!1;for(const _ in i)if(!ve(i[_],h[_])){p=!0;break}if(!p)return;const m=this._setTransitionParameters({duration:300,delay:0});this.light.setLight(i,n),this.light.updateTransitions(m)}getTerrain(){return this.terrain&&this.terrain.drapeRenderMode===1?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}setTerrain(i,n=1){if(this._checkLoaded(),!i)return delete this.terrain,delete this.stylesheet.terrain,this.dispatcher.broadcast("enableTerrain",!1),this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);let h=i;if(n===1){if(typeof h.source=="object"){const p="terrain-dem-src";this.addSource(p,h.source),h=s.clone$1(h),h=s.extend(h,{source:p})}if(this._validate(s.validateTerrain,"terrain",h))return}if(!this.terrain||this.terrain&&n!==this.terrain.drapeRenderMode){if(!h)return;this._createTerrain(h,n)}else{const p=this.terrain,m=p.get();for(const _ of Object.keys(s.spec.terrain))!h.hasOwnProperty(_)&&s.spec.terrain[_].default&&(h[_]=s.spec.terrain[_].default);for(const _ in h)if(!ve(h[_],m[_])){p.set(h),this.stylesheet.terrain=h;const y=this._setTransitionParameters({duration:0});p.updateTransitions(y);break}}this._updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(i){const n=this.fog=new pi(i,this.map.transform);this.stylesheet.fog=i;const h=this._setTransitionParameters({duration:0});n.updateTransitions(h)}_updateMarkersOpacity(){this.map._markers.length!==0&&this.map._requestDomTask(()=>{for(const i of this.map._markers)i._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(i){if(this._checkLoaded(),!i)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const n=this.fog,h=n.get();Object.keys(i).length===0&&n.set(i);for(const p in i)if(!ve(i[p],h[p])){n.set(i),this.stylesheet.fog=i;const m=this._setTransitionParameters({duration:0});n.updateTransitions(m);break}}else this._createFog(i);this._markersNeedUpdate=!0}_setTransitionParameters(i){return{now:s.exported.now(),transition:s.extend(i,this.stylesheet.transition)}}_updateDrapeFirstLayers(){if(!this.map._optimizeForTerrain||!this.terrain)return;const i=this._order.filter(h=>this.isLayerDraped(this._layers[h])),n=this._order.filter(h=>!this.isLayerDraped(this._layers[h]));this._drapedFirstOrder=[],this._drapedFirstOrder.push(...i),this._drapedFirstOrder.push(...n)}_createTerrain(i,n){const h=this.terrain=new wt(i,n);this.stylesheet.terrain=i,this.dispatcher.broadcast("enableTerrain",!this.terrainSetForDrapingOnly()),this._force3DLayerUpdate();const p=this._setTransitionParameters({duration:0});h.updateTransitions(p)}_force3DLayerUpdate(){for(const i in this._layers){const n=this._layers[i];n.type==="fill-extrusion"&&this._updateLayer(n)}}_forceSymbolLayerUpdate(){for(const i in this._layers){const n=this._layers[i];n.type==="symbol"&&this._updateLayer(n)}}_validate(i,n,h,p,m={}){return(!m||m.validate!==!1)&&wo(this,i.call(s.validateStyle,s.extend({key:n,style:this.serialize(),value:h,styleSpec:s.spec},p)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),s.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const i in this._layers)this._layers[i].setEventedParent(null);for(const i in this._sourceCaches)this._sourceCaches[i].clearTiles(),this._sourceCaches[i].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(i){const n=this._getSourceCaches(i);for(const h of n)h.clearTiles()}_reloadSource(i){const n=this._getSourceCaches(i);for(const h of n)h.resume(),h.reload()}_reloadSources(){for(const i of this._getSources())i.reload&&i.reload()}_updateSources(i){for(const n in this._sourceCaches)this._sourceCaches[n].update(i)}_generateCollisionBoxes(){for(const i in this._sourceCaches){const n=this._sourceCaches[i];n.resume(),n.reload()}}_updatePlacement(i,n,h,p,m=!1){let _=!1,y=!1;const v={};for(const E of this._order){const T=this._layers[E];if(T.type!=="symbol")continue;if(!v[T.source]){const P=this._getLayerSourceCache(T);if(!P)continue;v[T.source]=P.getRenderableIds(!0).map(R=>P.getTileByID(R)).sort((R,F)=>F.tileID.overscaledZ-R.tileID.overscaledZ||(R.tileID.isLessThan(F.tileID)?-1:1))}const M=this.crossTileSymbolIndex.addLayer(T,v[T.source],i.center.lng,i.projection);_=_||M}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),m=m||this._layerOrderChanged||h===0,this._layerOrderChanged&&this.fire(new s.Event("neworder")),(m||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(s.exported.now(),i.zoom))&&(this.pauseablePlacement=new $s(i,this._order,m,n,h,p,this.placement,this.fog&&i.projection.supportsFog?this.fog.state:null),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,v),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(s.exported.now()),y=!0),_&&this.pauseablePlacement.placement.setStale()),y||_)for(const E of this._order){const T=this._layers[E];T.type==="symbol"&&this.placement.updateLayerOpacities(T,v[T.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(s.exported.now())}_releaseSymbolFadeTiles(){for(const i in this._sourceCaches)this._sourceCaches[i].releaseSymbolFadeTiles()}getImages(i,n,h){this.imageManager.getImages(n.icons,h),this._updateTilesForChangedImages();const p=m=>{m&&m.setDependencies(n.tileID.key,n.type,n.icons)};p(this._otherSourceCaches[n.source]),p(this._symbolSourceCaches[n.source])}getGlyphs(i,n,h){this.glyphManager.getGlyphs(n.stacks,h)}getResource(i,n,h){return s.makeRequest(n,h)}_getSourceCache(i){return this._otherSourceCaches[i]}_getLayerSourceCache(i){return i.type==="symbol"?this._symbolSourceCaches[i.source]:this._otherSourceCaches[i.source]}_getSourceCaches(i){const n=[];return this._otherSourceCaches[i]&&n.push(this._otherSourceCaches[i]),this._symbolSourceCaches[i]&&n.push(this._symbolSourceCaches[i]),n}_isSourceCacheLoaded(i){const n=this._getSourceCaches(i);return n.length===0?(this.fire(new s.ErrorEvent(new Error(`There is no source with ID '${i}'`))),!1):n.every(h=>h.loaded())}has3DLayers(){return this._num3DLayers>0}hasSymbolLayers(){return this._numSymbolLayers>0}hasCircleLayers(){return this._numCircleLayers>0}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}Bi.getSourceType=function(l){return nt[l]},Bi.setSourceType=function(l,i){nt[l]=i},Bi.registerForPluginStateChange=s.registerForPluginStateChange;var Ws=`
#define EPSILON 0.0000001
#define PI 3.141592653589793
#define EXTENT 8192.0
#define HALF_PI PI/2.0
#define QUARTER_PI PI/4.0
#define RAD_TO_DEG 180.0/PI
#define DEG_TO_RAD PI/180.0
#define GLOBE_RADIUS EXTENT/PI/2.0`,jo="attribute highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;varying highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",Ji=`
#define ELEVATION_SCALE 7.0
#define ELEVATION_OFFSET 450.0
#ifdef PROJECTION_GLOBE_VIEW
uniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix(
mix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;}
#else
vec3 elevationVector(vec2 pos) { return vec3(0,0,1); }
#endif
const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt)
{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);}
#ifdef TERRAIN
#ifdef TERRAIN_DEM_FLOAT_FORMAT
uniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;
#else
uniform sampler2D u_dem;uniform sampler2D u_dem_prev;
#endif
uniform vec4 u_dem_unpack;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;uniform sampler2D u_depth;uniform vec2 u_depth_size_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float decodeElevation(vec4 v) {return dot(vec4(v.xyz*255.0,-1.0),u_dem_unpack);}float currentElevation(vec2 apos) {
#ifdef TERRAIN_DEM_FLOAT_FORMAT
vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem,pos).a;
#else
float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem,pos));
#ifdef TERRAIN_DEM_NEAREST_FILTER
return u_exaggeration*tl;
#endif
float tr=decodeElevation(texture2D(u_dem,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);
#endif
}float prevElevation(vec2 apos) {
#ifdef TERRAIN_DEM_FLOAT_FORMAT
vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem_prev,pos).a;
#else
float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem_prev,pos));float tr=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem_prev,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);
#endif
}
#ifdef TERRAIN_VERTEX_MORPHING
float elevation(vec2 apos) {
#ifdef ZERO_EXAGGERATION
return 0.0;
#endif
float nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);}
#else
float elevation(vec2 apos) {
#ifdef ZERO_EXAGGERATION
return 0.0;
#endif
return currentElevation(apos);}
#endif
highp float unpack_depth(highp vec4 rgba_depth)
{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;float depth=unpack_depth(texture2D(u_depth,(coord.xy+1.0)*0.5));return coord.z > depth+0.0005;}float occlusionFade(vec4 frag) {vec3 coord=frag.xyz/frag.w;vec3 df=vec3(5.0*u_depth_size_inv,0.0);vec2 uv=0.5*coord.xy+0.5;vec4 depth=vec4(
unpack_depth(texture2D(u_depth,uv-df.xz)),unpack_depth(texture2D(u_depth,uv+df.xz)),unpack_depth(texture2D(u_depth,uv-df.zy)),unpack_depth(texture2D(u_depth,uv+df.zy))
);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z-0.001)-depth),0.0,1.0));}vec4 fourSample(vec2 pos,vec2 off) {
#ifdef TERRAIN_DEM_FLOAT_FORMAT
float tl=texture2D(u_dem,pos).a;float tr=texture2D(u_dem,pos+vec2(off.x,0.0)).a;float bl=texture2D(u_dem,pos+vec2(0.0,off.y)).a;float br=texture2D(u_dem,pos+off).a;
#else
vec4 demtl=vec4(texture2D(u_dem,pos).xyz*255.0,-1.0);float tl=dot(demtl,u_dem_unpack);vec4 demtr=vec4(texture2D(u_dem,pos+vec2(off.x,0.0)).xyz*255.0,-1.0);float tr=dot(demtr,u_dem_unpack);vec4 dembl=vec4(texture2D(u_dem,pos+vec2(0.0,off.y)).xyz*255.0,-1.0);float bl=dot(dembl,u_dem_unpack);vec4 dembr=vec4(texture2D(u_dem,pos+off).xyz*255.0,-1.0);float br=dot(dembr,u_dem_unpack);
#endif
return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);}
#else
float elevation(vec2 pos) { return 0.0; }bool isOccluded(vec4 frag) { return false; }float occlusionFade(vec4 frag) { return 1.0; }
#endif`,ta=`#ifdef FOG
uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;varying vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);}
#endif`,Qi=`#ifdef FOG
uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump float u_fog_temporal_offset;varying vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(
mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,opacity);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec3 fog_dither(vec3 color) {vec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}
#endif`;let Va={},dn={};const ra=[];mn(Ws,ra),mn(Ji,ra),mn(ta,ra),mn(Qi,ra),Va=At("",Ji),dn=At(Qi,ta);const bc=At(`
#if __VERSION__ >=300
#define varying in
#define gl_FragColor glFragColor
#define texture2D texture
#define textureCube texture
out vec4 glFragColor;
#endif
highp vec3 hash(highp vec2 p) {highp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));p3+=dot(p3,p3.yxz+19.19);return fract((p3.xxy+p3.yzz)*p3.zyx);}vec3 dither(vec3 color,highp vec2 seed) {vec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;return color+rnd/255.0;}highp float unpack_depth(highp vec4 rgba_depth)
{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}`,`
#if __VERSION__ >=300
#define attribute in
#define varying out
#define texture2D texture
#endif
float wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;}
#ifdef PROJECTION_GLOBE_VIEW
vec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) {
#ifndef PROJECTED_POS_ON_VIEWPORT
float tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz;
#else
return vec3(0.0);
#endif
}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);}
#endif
vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(
unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}const vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);//Normalized device coordinate that is not rendered.`),Ga=Ws,Ys=`
#ifdef GL_ES
precision mediump float;
#else

#if !defined(lowp)
#define lowp
#endif

#if !defined(mediump)
#define mediump
#endif

#if !defined(highp)
#define highp
#endif

#endif`;var Hs={background:At(`uniform vec4 u_color;uniform float u_opacity;
#ifdef LIGHTING_3D_MODE
varying vec4 v_color;
#endif
void main() {vec4 out_color;
#ifdef LIGHTING_3D_MODE
out_color=v_color;
#else
out_color=u_color;
#endif
#ifdef FOG
out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
#endif
gl_FragColor=out_color*u_opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`attribute vec2 a_pos;uniform mat4 u_matrix;
#ifdef LIGHTING_3D_MODE
uniform vec4 u_color;varying vec4 v_color;
#endif
void main() {gl_Position=u_matrix*vec4(a_pos,0,1);
#ifdef LIGHTING_3D_MODE
v_color=apply_lighting(u_color);
#endif
#ifdef FOG
v_fog_pos=fog_position(a_pos);
#endif
}`),backgroundPattern:At(`uniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos;void main() {vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);
#ifdef LIGHTING_3D_MODE
out_color=apply_lighting(out_color);
#endif
#ifdef FOG
out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
#endif
gl_FragColor=out_color*u_opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_tile_units_to_pixels,a_pos);
#ifdef FOG
v_fog_pos=fog_position(a_pos);
#endif
}`),circle:At(`varying vec3 v_data;varying float v_visibility;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define mediump float radius
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define highp vec4 stroke_color
#pragma mapbox: define mediump float stroke_width
#pragma mapbox: define lowp float stroke_opacity
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize mediump float radius
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize highp vec4 stroke_color
#pragma mapbox: initialize mediump float stroke_width
#pragma mapbox: initialize lowp float stroke_opacity
vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(
antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)
);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);
#ifdef LIGHTING_3D_MODE
out_color=apply_lighting(out_color);
#endif
#ifdef FOG
out_color=fog_apply_premultiplied(out_color,v_fog_pos);
#endif
gl_FragColor=out_color*(v_visibility*opacity_t);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`#define NUM_VISIBILITY_RINGS 2
#define INV_SQRT2 0.70710678
#define ELEVATION_BIAS 0.0001
#define NUM_SAMPLES_PER_RING 16
uniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;
#ifdef PROJECTION_GLOBE_VIEW
attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;
#endif
varying vec3 v_data;varying float v_visibility;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define mediump float radius
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define highp vec4 stroke_color
#pragma mapbox: define mediump float stroke_width
#pragma mapbox: define lowp float stroke_opacity
vec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) {
#if defined(TERRAIN)
return elevation(pos)+ELEVATION_BIAS;
#else
return 0.0;
#endif
}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale);
#ifdef PITCH_WITH_MAP
#ifdef PROJECTION_GLOBE_VIEW
return u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) );
#else
return u_matrix*( world_center+vec4(sample_offset,0,0) );
#endif
#else
return projected_center+vec4(sample_offset,0,0);
#endif
}float get_sample_step() {
#ifdef PITCH_WITH_MAP
return 2.0*PI/float(NUM_SAMPLES_PER_RING);
#else
return PI/float(NUM_SAMPLES_PER_RING);
#endif
}void main(void) {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize mediump float radius
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize highp vec4 stroke_color
#pragma mapbox: initialize mediump float stroke_width
#pragma mapbox: initialize lowp float stroke_opacity
vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors;
#ifdef PROJECTION_GLOBE_VIEW
vec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1);
#else 
surface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1);
#endif
vec4 projected_center=u_matrix*world_center;float view_scale=0.0;
#ifdef PITCH_WITH_MAP
#ifdef SCALE_WITH_MAP
view_scale=1.0;
#else
view_scale=projected_center.w/u_camera_to_center_distance;
#endif
#else
#ifdef SCALE_WITH_MAP
view_scale=u_camera_to_center_distance;
#else
view_scale=projected_center.w;
#endif
#endif
gl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0;
#ifdef TERRAIN
float step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center;
#ifdef PITCH_WITH_MAP
float cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center;
#else
occlusion_world_center=world_center;occlusion_projected_center=projected_center;
#endif
for(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);
#else
visibility=1.0;
#endif
#ifdef PROJECTION_GLOBE_VIEW
visibility=1.0;
#endif
v_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);
#ifdef FOG
v_fog_pos=fog_position(world_center.xyz);
#endif
}`),clippingMask:At("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:At(`uniform highp float u_intensity;varying vec2 v_extrude;
#pragma mapbox: define highp float weight
#define GAUSS_COEF 0.3989422804014327
void main() {
#pragma mapbox: initialize highp float weight
float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);
#ifdef FOG
if (u_is_globe==0) {gl_FragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);}
#endif
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;
#ifdef PROJECTION_GLOBE_VIEW
attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;
#endif
varying vec2 v_extrude;
#pragma mapbox: define highp float weight
#pragma mapbox: define mediump float radius
const highp float ZERO=1.0/255.0/16.0;
#define GAUSS_COEF 0.3989422804014327
void main(void) {
#pragma mapbox: initialize highp float weight
#pragma mapbox: initialize mediump float radius
vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 tilePos=floor(a_pos*0.5);vec3 pos;
#ifdef PROJECTION_GLOBE_VIEW
vec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);
#else
pos=vec3(tilePos+extrude,elevation(tilePos));
#endif
gl_Position=u_matrix*vec4(pos,1);
#ifdef FOG
v_fog_pos=fog_position(pos);
#endif
}`),heatmapTexture:At(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(0.0);
#endif
}`,"attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:At("varying float v_placed;varying float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);gl_FragColor =mix(red,blue,step(0.5,v_placed))*0.5;gl_FragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",`attribute vec3 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;attribute float a_size_scale;attribute vec2 a_padding;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*elevation(a_anchor_pos),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(
0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}`),collisionCircle:At("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}",`attribute vec2 a_pos_2f;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd  =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz  /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos_2f;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(
mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(
0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}`),debug:At("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;
#ifdef PROJECTION_GLOBE_VIEW
attribute vec3 a_pos_3;
#endif
varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0;
#ifdef PROJECTION_GLOBE_VIEW
gl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1);
#else
gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1);
#endif
}`),fill:At(`#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float opacity
vec4 out_color=color;
#ifdef LIGHTING_3D_MODE
out_color=apply_lighting(out_color);
#endif
#ifdef FOG
out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
#endif
gl_FragColor=out_color*opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`attribute vec2 a_pos;uniform mat4 u_matrix;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float opacity
gl_Position=u_matrix*vec4(a_pos,0,1);
#ifdef FOG
v_fog_pos=fog_position(a_pos);
#endif
}`),fillOutline:At(`varying vec2 v_pos;
#pragma mapbox: define highp vec4 outline_color
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 outline_color
#pragma mapbox: initialize lowp float opacity
float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color;
#ifdef LIGHTING_3D_MODE
out_color=apply_lighting(out_color);
#endif
#ifdef FOG
out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
#endif
gl_FragColor=out_color*(alpha*opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;
#pragma mapbox: define highp vec4 outline_color
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 outline_color
#pragma mapbox: initialize lowp float opacity
gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;
#ifdef FOG
v_fog_pos=fog_position(a_pos);
#endif
}`),fillOutlinePattern:At(`uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;varying vec2 v_pos_world;
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp vec4 pattern
void main() {
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump vec4 pattern
vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=texture2D(u_image,pos);
#ifdef LIGHTING_3D_MODE
out_color=apply_lighting(out_color);
#endif
#ifdef FOG
out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
#endif
gl_FragColor=out_color*(alpha*opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;varying vec2 v_pos_world;
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp vec4 pattern
#pragma mapbox: define lowp float pixel_ratio
void main() {
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump vec4 pattern
#pragma mapbox: initialize lowp float pixel_ratio
vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;
#ifdef FOG
v_fog_pos=fog_position(a_pos);
#endif
}`),fillPattern:At(`uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp vec4 pattern
void main() {
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump vec4 pattern
vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);
#ifdef LIGHTING_3D_MODE
out_color=apply_lighting(out_color);
#endif
#ifdef FOG
out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
#endif
gl_FragColor=out_color*opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp vec4 pattern
#pragma mapbox: define lowp float pixel_ratio
void main() {
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump vec4 pattern
#pragma mapbox: initialize lowp float pixel_ratio
vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);
#ifdef FOG
v_fog_pos=fog_position(a_pos);
#endif
}`),fillExtrusion:At(`varying vec4 v_color;
#ifdef RENDER_SHADOWS
varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth;
#endif
#ifdef FAUX_AO
uniform lowp vec2 u_ao;varying vec3 v_ao;
#endif
#ifdef ZERO_ROOF_RADIUS
varying vec4 v_roof_color;
#endif
#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)
varying highp vec3 v_normal;
#endif
void main() {
#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)
vec3 normal=v_normal;
#endif
float z;vec4 color;
#ifdef ZERO_ROOF_RADIUS
z=float(normal.z > 0.00001);color=mix(v_color,v_roof_color,z);
#else
color=v_color;
#endif
#ifdef FAUX_AO
float intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;
#ifdef ZERO_ROOF_RADIUS
concave*=(1.0-z);
#endif
float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);color.rgb=color.rgb*shade;
#endif
#ifdef RENDER_SHADOWS
#ifdef ZERO_ROOF_RADIUS
normal=mix(normal,vec3(0.0,0.0,1.0),z);
#endif
color.xyz=shadowed_color_normal(color.xyz,normalize(normal),v_pos_light_view_0,v_pos_light_view_1,v_depth);
#endif
#ifdef FOG
color=fog_dither(fog_apply_premultiplied(color,v_fog_pos));
#endif
gl_FragColor=color;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_edge_radius;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;
#ifdef PROJECTION_GLOBE_VIEW
attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;
#endif
varying vec4 v_color;
#ifdef RENDER_SHADOWS
uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth;
#endif
#ifdef ZERO_ROOF_RADIUS
varying vec4 v_roof_color;
#endif
#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)
varying highp vec3 v_normal;
#endif
#ifdef FAUX_AO
uniform lowp vec2 u_ao;varying vec3 v_ao;
#endif
#pragma mapbox: define highp float base
#pragma mapbox: define highp float height
#pragma mapbox: define highp vec4 color
void main() {
#pragma mapbox: initialize highp float base
#pragma mapbox: initialize highp float height
#pragma mapbox: initialize highp vec4 color
vec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));
#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)
v_normal=normal;
#endif
base=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);
#if defined(HAS_CENTROID) || defined(TERRAIN)
centroid_pos=a_centroid_pos;
#endif
float ele=0.0;float h=0.0;float c_ele;vec3 pos;
#ifdef TERRAIN
bool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);pos=vec3(pos_nx.xy,h);
#else
h=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h);
#endif
#ifdef PROJECTION_GLOBE_VIEW
float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);
#endif
float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);
#ifdef RENDER_SHADOWS
v_pos_light_view_0=u_light_matrix_0*vec4(pos,1);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1);v_depth=gl_Position.w;
#endif
float NdotL=0.0;float colorvalue=0.0;
#ifdef LIGHTING_3D_MODE
NdotL=calculate_NdotL(normal);
#else
colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL);
#endif
if (normal.y !=0.0) {float r=0.84;
#ifndef LIGHTING_3D_MODE
r=mix(0.7,0.98,1.0-u_lightintensity);
#endif
NdotL*=(
(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}v_color=vec4(0.0,0.0,0.0,1.0);
#ifdef FAUX_AO
float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;
#ifdef TERRAIN
top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);
#endif
v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);
#ifdef PROJECTION_GLOBE_VIEW
top_height+=u_height_lift;
#endif
gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;
#endif
#ifdef LIGHTING_3D_MODE
v_color=apply_lighting(color,NdotL);
#else
v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));
#endif
v_color*=u_opacity;
#ifdef ZERO_ROOF_RADIUS
v_roof_color=vec4(0.0,0.0,0.0,1.0);
#ifdef LIGHTING_3D_MODE
v_roof_color=apply_lighting(color,calculate_NdotL(vec3(0.0,0.0,1.0)));
#else
float roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));
#endif
v_roof_color*=u_opacity;
#endif
#ifdef FOG
v_fog_pos=fog_position(pos);
#endif
}`),fillExtrusionPattern:At(`uniform vec2 u_texsize;uniform sampler2D u_image;
#ifdef FAUX_AO
uniform lowp vec2 u_ao;varying vec3 v_ao;
#endif
#ifdef LIGHTING_3D_MODE
varying float v_NdotL;
#endif
varying vec2 v_pos;varying vec4 v_lighting;uniform lowp float u_opacity;
#pragma mapbox: define lowp float base
#pragma mapbox: define lowp float height
#pragma mapbox: define lowp vec4 pattern
#pragma mapbox: define lowp float pixel_ratio
void main() {
#pragma mapbox: initialize lowp float base
#pragma mapbox: initialize lowp float height
#pragma mapbox: initialize mediump vec4 pattern
#pragma mapbox: initialize lowp float pixel_ratio
vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);
#ifdef LIGHTING_3D_MODE
out_color=apply_lighting(out_color,v_NdotL)*u_opacity;
#else
out_color=out_color*v_lighting;
#endif
#ifdef FAUX_AO
float intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade;
#endif
#ifdef FOG
out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
#endif
gl_FragColor=out_color;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;
#ifdef PROJECTION_GLOBE_VIEW
attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;
#endif
varying vec2 v_pos;varying vec4 v_lighting;
#ifdef FAUX_AO
uniform lowp vec2 u_ao;varying vec3 v_ao;
#endif
#ifdef LIGHTING_3D_MODE
varying float v_NdotL;
#endif
#pragma mapbox: define lowp float base
#pragma mapbox: define lowp float height
#pragma mapbox: define lowp vec4 pattern
#pragma mapbox: define lowp float pixel_ratio
void main() {
#pragma mapbox: initialize lowp float base
#pragma mapbox: initialize lowp float height
#pragma mapbox: initialize mediump vec4 pattern
#pragma mapbox: initialize lowp float pixel_ratio
vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0);
#if defined(HAS_CENTROID) || defined(TERRAIN)
centroid_pos=a_centroid_pos;
#endif
float ele=0.0;float h=z;vec3 p;float c_ele;
#ifdef TERRAIN
bool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);p=vec3(pos_nx.xy,h);
#else
p=vec3(pos_nx.xy,z);
#endif
#ifdef PROJECTION_GLOBE_VIEW
float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);
#endif
float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0
? pos_nx.xy
: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0;
#ifdef LIGHTING_3D_MODE
NdotL=calculate_NdotL(normal);
#else
NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL);
#endif
if (normal.y !=0.0) {float r=0.84;
#ifndef LIGHTING_3D_MODE
r=mix(0.7,0.98,1.0-u_lightintensity);
#endif
NdotL*=(
(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}
#ifdef FAUX_AO
float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;
#ifdef TERRAIN
top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);
#endif
v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);
#ifdef PROJECTION_GLOBE_VIEW
top_height+=u_height_lift;
#endif
gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;
#endif
#ifdef LIGHTING_3D_MODE
v_NdotL=NdotL;
#else
v_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;
#endif 
#ifdef FOG
v_fog_pos=fog_position(p);
#endif
}`),hillshadePrepare:At(`#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord) {
#ifdef TERRAIN_DEM_FLOAT_FORMAT
return texture2D(u_image,coord).a/4.0;
#else
vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;
#endif
}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2(
(c+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c)
)/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(
deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:At(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;
#ifdef LIGHTING_3D_MODE
gl_FragColor=apply_lighting(gl_FragColor);
#endif
#ifdef FOG
gl_FragColor=fog_dither(fog_apply_premultiplied(gl_FragColor,v_fog_pos));
#endif
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;
#ifdef FOG
v_fog_pos=fog_position(a_pos);
#endif
}`),line:At(`uniform lowp float u_device_pixel_ratio;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec4 v_uv;
#ifdef RENDER_LINE_DASH
uniform sampler2D u_dash_image;varying vec2 v_tex;
#endif
#ifdef RENDER_LINE_GRADIENT
uniform sampler2D u_gradient_image;
#endif
uniform float u_border_width;uniform vec4 u_border_color;float luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;}
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float floorwidth
#pragma mapbox: define lowp vec4 dash
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
float linearstep(float edge0,float edge1,float x) {return  clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float floorwidth
#pragma mapbox: initialize lowp vec4 dash
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);
#ifdef RENDER_LINE_DASH
float sdfdist=texture2D(u_dash_image,v_tex).a;float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;alpha*=linearstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);
#endif
highp vec4 out_color;
#ifdef RENDER_LINE_GRADIENT
out_color=texture2D(u_gradient_image,v_uv.xy);
#else
out_color=color;
#endif
float trimmed=1.0;
#ifdef RENDER_LINE_TRIM_OFFSET
highp float start=v_uv[2];highp float end=v_uv[3];highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=(start+(v_uv.x)*(end-start));if (trim_end > trim_start) {if (line_progress <=trim_end && line_progress >=trim_start) {out_color=vec4(0,0,0,0);trimmed=0.0;}}
#endif
#ifdef LIGHTING_3D_MODE
out_color=apply_lighting(out_color);
#endif
#ifdef FOG
out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
#endif
#ifdef RENDER_LINE_ALPHA_DISCARD
if (alpha < u_alpha_discard_threshold) {discard;}
#endif
#ifdef RENDER_LINE_BORDER
float edgeBlur=(u_border_width+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2);
#ifdef RENDER_LINE_BORDER_AUTO
float Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);}
#else
out_color.rgb=mix(u_border_color.rgb*u_border_color.a*trimmed,out_color.rgb,smoothAlpha);
#endif
}
#endif
gl_FragColor=out_color*(alpha*opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`
#define EXTRUDE_SCALE 0.015873016
attribute vec2 a_pos_normal;attribute vec4 a_data;
#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)
attribute highp vec4 a_packed;
#endif
#ifdef RENDER_LINE_DASH
attribute float a_linesofar;
#endif
uniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec4 v_uv;
#ifdef RENDER_LINE_DASH
uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;varying vec2 v_tex;
#endif
#ifdef RENDER_LINE_GRADIENT
uniform float u_image_height;
#endif
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float floorwidth
#pragma mapbox: define lowp vec4 dash
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define mediump float gapwidth
#pragma mapbox: define lowp float offset
#pragma mapbox: define mediump float width
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float floorwidth
#pragma mapbox: initialize lowp vec4 dash
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump float gapwidth
#pragma mapbox: initialize lowp float offset
#pragma mapbox: initialize mediump float width
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;
#ifndef RENDER_TO_TEXTURE
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
#else
v_gamma_scale=1.0;
#endif
#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)
float a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float a_clip_start=a_packed[2];highp float a_clip_end=a_packed[3];
#ifdef RENDER_LINE_GRADIENT
highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec4(a_uv_x,a_split_index*texel_height-half_texel_height,a_clip_start,a_clip_end);
#else
v_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end);
#endif
#endif
#ifdef RENDER_LINE_DASH
float scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/floorwidth,(-normal.y*height+dash.x+0.5)/u_texsize.y);
#endif
v_width2=vec2(outset,inset);
#ifdef FOG
v_fog_pos=fog_position(pos);
#endif
}`),linePattern:At(`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
#pragma mapbox: define lowp vec4 pattern
#pragma mapbox: define lowp float pixel_ratio
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize mediump vec4 pattern
#pragma mapbox: initialize lowp float pixel_ratio
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;vec2 pattern_size=vec2(display_size.x/u_tile_units_to_pixels,display_size.y);float aspect=display_size.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x=mod(v_linesofar/pattern_size.x*aspect,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));vec4 color=texture2D(u_image,pos);
#ifdef LIGHTING_3D_MODE
color=apply_lighting(color);
#endif
#ifdef FOG
color=fog_dither(fog_apply_premultiplied(color,v_fog_pos));
#endif
gl_FragColor=color*(alpha*opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`
#define scale 0.015873016
attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_linesofar;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float offset
#pragma mapbox: define mediump float gapwidth
#pragma mapbox: define mediump float width
#pragma mapbox: define lowp float floorwidth
#pragma mapbox: define lowp vec4 pattern
#pragma mapbox: define lowp float pixel_ratio
void main() {
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float offset
#pragma mapbox: initialize mediump float gapwidth
#pragma mapbox: initialize mediump float width
#pragma mapbox: initialize lowp float floorwidth
#pragma mapbox: initialize mediump vec4 pattern
#pragma mapbox: initialize lowp float pixel_ratio
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;
#ifndef RENDER_TO_TEXTURE
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
#else
v_gamma_scale=1.0;
#endif
v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;
#ifdef FOG
v_fog_pos=fog_position(pos);
#endif
}`),raster:At(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(
dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);vec3 out_color=mix(u_high_vec,u_low_vec,rgb);
#ifdef LIGHTING_3D_MODE
out_color=apply_lighting(out_color);
#endif
#ifdef FOG
out_color=fog_dither(fog_apply(out_color,v_fog_pos));
#endif
gl_FragColor=vec4(out_color*color.a,color.a);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {float w=1.0+dot(a_texture_pos,u_perspective_transform);gl_Position=u_matrix*vec4(a_pos*w,0,w);v_pos0=a_texture_pos/8192.0;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;
#ifdef FOG
v_fog_pos=fog_position(a_pos);
#endif
}`),symbolIcon:At(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize lowp float opacity
lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity;
#ifdef PROJECTION_GLOBE_VIEW
attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;
#endif
uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform vec3 u_up_vector;
#ifdef PROJECTION_GLOBE_VIEW
uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;
#endif
varying vec2 v_tex;varying float v_fade_opacity;
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize lowp float opacity
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;
#ifdef PROJECTION_GLOBE_VIEW
mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;
#else
world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;
#endif
vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?
camera_to_anchor_distance/u_camera_to_center_distance :
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(
0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjected_point;
#ifdef PROJECTION_GLOBE_VIEW
vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetProjected_point=u_matrix*vec4(a_globe_anchor+displacement,1);
#else
offsetProjected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);
#endif
vec2 a=projected_point.xy/projected_point.w;vec2 b=offsetProjected_point.xy/offsetProjected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;
#ifdef PROJECTION_GLOBE_VIEW
vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);
#else
projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);
#endif
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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0);
#ifdef TERRAIN
#ifdef PITCH_WITH_MAP_TERRAIN
vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);
#endif
#endif
float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;
#ifdef PROJECTION_GLOBE_VIEW
vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));
#else
gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));
#endif
float projection_transition_fade=1.0;
#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)
projection_transition_fade=1.0-step(EPSILON,u_zoom_transition);
#endif
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(occlusion_fade,fade_opacity[0]+fade_change))*projection_transition_fade;}`),symbolSDF:At(`#define SDF_PX 8.0
uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;
#pragma mapbox: define highp vec4 fill_color
#pragma mapbox: define highp vec4 halo_color
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float halo_width
#pragma mapbox: define lowp float halo_blur
void main() {
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float halo_width
#pragma mapbox: initialize lowp float halo_blur
float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity;
#ifdef PROJECTION_GLOBE_VIEW
attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;
#endif
uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;
#ifdef PROJECTION_GLOBE_VIEW
uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;
#endif
varying vec2 v_data0;varying vec3 v_data1;
#pragma mapbox: define highp vec4 fill_color
#pragma mapbox: define highp vec4 halo_color
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float halo_width
#pragma mapbox: define lowp float halo_blur
void main() {
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float halo_width
#pragma mapbox: initialize lowp float halo_blur
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;
#ifdef PROJECTION_GLOBE_VIEW
mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;
#else
world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;
#endif
vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?
camera_to_anchor_distance/u_camera_to_center_distance :
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(
0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point;
#ifdef PROJECTION_GLOBE_VIEW
vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1);
#else
offsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);
#endif
vec2 a=projected_point.xy/projected_point.w;vec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;
#ifdef PROJECTION_GLOBE_VIEW
vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);
#else
projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);
#endif
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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset);
#ifdef TERRAIN
#ifdef PITCH_WITH_MAP_TERRAIN
vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);
#endif
#endif
float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;
#ifdef PROJECTION_GLOBE_VIEW
vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));
#else
gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));
#endif
float gamma_scale=gl_Position.w;float projection_transition_fade=1.0;
#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)
projection_transition_fade=1.0-step(EPSILON,u_zoom_transition);
#endif
vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade);}`),symbolTextAndIcon:At(`#define SDF_PX 8.0
#define SDF 1.0
#define ICON 0.0
uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;
#pragma mapbox: define highp vec4 fill_color
#pragma mapbox: define highp vec4 halo_color
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float halo_width
#pragma mapbox: define lowp float halo_blur
void main() {
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float halo_width
#pragma mapbox: initialize lowp float halo_blur
float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_projected_pos;attribute float a_fade_opacity;
#ifdef PROJECTION_GLOBE_VIEW
attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;
#endif
uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;uniform vec2 u_texsize_icon;
#ifdef PROJECTION_GLOBE_VIEW
uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;
#endif
varying vec4 v_data0;varying vec4 v_data1;
#pragma mapbox: define highp vec4 fill_color
#pragma mapbox: define highp vec4 halo_color
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float halo_width
#pragma mapbox: define lowp float halo_blur
void main() {
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float halo_width
#pragma mapbox: initialize lowp float halo_blur
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;
#ifdef PROJECTION_GLOBE_VIEW
mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;
#else
world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;
#endif
vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?
camera_to_anchor_distance/u_camera_to_center_distance :
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(
0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offset_projected_point=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projected_point.xy/projected_point.w;vec2 b=offset_projected_point.xy/offset_projected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;
#ifdef PROJECTION_GLOBE_VIEW
vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);
#else
projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);
#endif
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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*font_scale);
#ifdef TERRAIN
#ifdef PITCH_WITH_MAP_TERRAIN
vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);
#endif
#endif
float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;
#ifdef PROJECTION_GLOBE_VIEW
vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));
#else
gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));
#endif
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(occlusion_fade,fade_opacity[0]+fade_change));float projection_transition_fade=1.0;
#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)
projection_transition_fade=1.0-step(EPSILON,u_zoom_transition);
#endif
v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade,is_sdf);}`),terrainRaster:At(`uniform sampler2D u_image0;varying vec2 v_pos0;
#ifdef FOG
varying float v_fog_opacity;
#endif
#ifdef RENDER_SHADOWS
varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth;
#endif
void main() {vec4 color=texture2D(u_image0,v_pos0);
#ifdef RENDER_SHADOWS
color.xyz=shadowed_color(color.xyz,v_pos_light_view_0,v_pos_light_view_1,v_depth);
#endif
#ifdef FOG
#ifdef ZERO_EXAGGERATION
color=fog_dither(fog_apply_premultiplied(color,v_fog_pos));
#else
color=fog_dither(fog_apply_from_vert(color,v_fog_opacity));
#endif
#endif
gl_FragColor=color;
#ifdef TERRAIN_WIREFRAME
gl_FragColor=vec4(1.0,0.0,0.0,0.8);
#endif
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform float u_skirt_height;attribute vec2 a_pos;varying vec2 v_pos0;
#ifdef FOG
varying float v_fog_opacity;
#endif
#ifdef RENDER_SHADOWS
uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth;
#endif
const float wireframeOffset=0.00015;void main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height;
#ifdef TERRAIN_WIREFRAME
elevation+=wireframeOffset;
#endif
v_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0);
#ifdef FOG
#ifdef ZERO_EXAGGERATION
v_fog_pos=fog_position(decodedPos);
#else
v_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));
#endif
#endif
#ifdef RENDER_SHADOWS
vec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);v_depth=gl_Position.w;
#endif
}`),terrainDepth:At(`#ifdef GL_ES
precision highp float;
#endif
varying float v_depth;void main() {gl_FragColor=pack_depth(v_depth);}`,"uniform mat4 u_matrix;attribute vec2 a_pos;varying float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}"),skybox:At(`
varying lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep(
cos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=textureCube(u_cubemap,uv).rgb;
#ifdef FOG
sky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);
#endif
sky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);gl_FragColor=vec4(sky_color*u_opacity,u_opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,jo),skyboxGradient:At(`varying highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture2D(u_color_ramp,vec2(progress,0.5));
#ifdef FOG
color.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;
#endif
color*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=color;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,jo),skyboxCapture:At(`
varying highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;
#ifdef GL_ES
precision highp float;
#endif
#define BETA_R                  vec3(5.5e-6,13.0e-6,22.4e-6)
#define BETA_M                  vec3(21e-6,21e-6,21e-6)
#define MIE_G                   0.76
#define DENSITY_HEIGHT_SCALE_R  8000.0
#define DENSITY_HEIGHT_SCALE_M  1200.0
#define PLANET_RADIUS           6360e3
#define ATMOSPHERE_RADIUS       6420e3
#define SAMPLE_STEPS            10
#define DENSITY_STEPS           4
float ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;gl_FragColor=vec4(color,1.0);}`,"attribute highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;varying highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:At(`uniform sampler2D u_image0;varying vec2 v_pos0;
#ifndef FOG
uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport;
#endif
void main() {vec4 color;
#ifdef CUSTOM_ANTIALIASING
vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(
mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);vec3 dir=normalize(ray_dir);vec3 closest_point=dot(u_globe_pos,dir)*dir;float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture2D(u_image0,v_pos0);color=vec4(raster.rgb*antialias,raster.a*antialias);
#else
color=texture2D(u_image0,v_pos0);
#endif
#ifdef FOG
color=fog_dither(fog_apply_premultiplied(color,v_fog_pos));
#endif
gl_FragColor=color;
#ifdef TERRAIN_WIREFRAME
gl_FragColor=vec4(1.0,0.0,0.0,0.8);
#endif
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height;
#ifdef GLOBE_POLES
attribute vec3 a_globe_pos;attribute vec2 a_uv;
#else
attribute vec2 a_pos;
#endif
varying vec2 v_pos0;const float wireframeOffset=1e3;float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(QUARTER_PI+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}void main() {
#ifdef GLOBE_POLES
vec3 globe_pos=a_globe_pos;vec2 uv=a_uv;
#else
float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY);
#endif
v_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale;
#ifdef GLOBE_POLES
vec3 up_vector=globe_derived_up_vector;
#else
vec3 up_vector=elevationVector(tile_pos);
#endif
float height=elevation(tile_pos);
#ifdef TERRAIN_WIREFRAME
height+=wireframeOffset;
#endif
globe_pos+=up_vector*height;
#ifndef GLOBE_POLES
globe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z;
#endif
#ifdef GLOBE_POLES
vec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0);
#else
vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0);
#endif
gl_Position=u_proj_matrix*interpolated_pos;
#ifdef FOG
v_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);
#endif
}`),globeAtmosphere:At(`uniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec3 u_start_color;uniform vec4 u_color;uniform vec4 u_space_color;uniform vec4 u_high_color;uniform float u_star_intensity;uniform float u_star_size;uniform float u_star_density;uniform float u_horizon_angle;uniform mat4 u_rotation_matrix;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;highp float random(highp vec3 p) {p=fract(p*vec3(23.2342,97.1231,91.2342));p+=dot(p.zxy,p.yxz+123.1234);return fract(p.x*p.y);}float stars(vec3 p,float scale,vec2 offset) {vec2 uv_scale=(u_viewport/u_star_size)*scale;vec3 position=vec3(p.xy*uv_scale+offset*u_viewport,p.z);vec3 q=fract(position)-0.5;vec3 id=floor(position);float random_visibility=step(random(id),u_star_density);float circle=smoothstep(0.5+u_star_intensity,0.5,length(q));return circle*random_visibility;}void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir;
#ifdef PROJECTION_GLOBE_VIEW
globe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {discard;return;}
#endif
highp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ?
0.0 : max(acos(dot(dir,horizon_dir)),0.0);float horizon_angle;
#ifdef PROJECTION_GLOBE_VIEW
highp vec3 closest_point=globe_pos_dot_dir*dir;float closest_point_to_center=length(closest_point-u_globe_pos);float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ?
PI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t);
#else
horizon_angle=horizon_angle_mercator;
#endif
horizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb;vec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c =mix(color_stop_2,c2,t);float a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);vec2 uv=gl_FragCoord.xy/u_viewport-0.5;float aspect_ratio=u_viewport.x/u_viewport.y;vec4 uv_dir=vec4(normalize(vec3(uv.x*aspect_ratio,uv.y,1.0)),1.0);uv_dir=u_rotation_matrix*uv_dir;vec3 n=abs(uv_dir.xyz);vec2 uv_remap=(n.x > n.y && n.x > n.z) ? uv_dir.yz/uv_dir.x:
(n.y > n.x && n.y > n.z) ? uv_dir.zx/uv_dir.y:
uv_dir.xy/uv_dir.z;uv_remap.x/=aspect_ratio;vec3 D=vec3(uv_remap,1.0);highp float star_field=0.0;if (u_star_intensity > 0.0) {star_field+=stars(D,1.2,vec2(0.0,0.0));star_field+=stars(D,1.0,vec2(1.0,0.0));star_field+=stars(D,0.8,vec2(0.0,1.0));star_field+=stars(D,0.6,vec2(1.0,1.0));star_field*=(1.0-pow(t,0.25+(1.0-u_high_color.a)*0.75));c+=star_field*alpha_2;}c=dither(c,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=vec4(c,a);}`,`attribute vec3 a_pos;attribute vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;void main() {v_ray_dir=mix(
mix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix(
mix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}`)};function mn(l,i){const n=l.replace(/\s*\/\/[^\n]*\n/g,`
`).split(`
`);for(let h of n)if(h=h.trim(),h[0]==="#"&&h.includes("if")&&!h.includes("endif")){h=h.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const p=h.split(" ");for(const m of p)i.includes(m)||i.push(m)}}function At(l,i){const n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,h=i.match(/attribute (highp |mediump |lowp )?([\w]+) ([\w]+)/g),p={},m=[...ra];return mn(l,m),mn(i,m),{fragmentSource:l=l.replace(n,(_,y,v,E,T)=>(p[T]=!0,y==="define"?`
#ifndef HAS_UNIFORM_u_${T}
varying ${v} ${E} ${T};
#else
uniform ${v} ${E} u_${T};
#endif
`:`
#ifdef HAS_UNIFORM_u_${T}
    ${v} ${E} ${T} = u_${T};
#endif
`)),vertexSource:i=i.replace(n,(_,y,v,E,T)=>{const M=E==="float"?"vec2":"vec4",P=T.match(/color/)?"color":M;return p[T]?y==="define"?`
#ifndef HAS_UNIFORM_u_${T}
uniform lowp float u_${T}_t;
attribute ${v} ${M} a_${T};
varying ${v} ${E} ${T};
#else
uniform ${v} ${E} u_${T};
#endif
`:P==="vec4"?`
#ifndef HAS_UNIFORM_u_${T}
    ${T} = a_${T};
#else
    ${v} ${E} ${T} = u_${T};
#endif
`:`
#ifndef HAS_UNIFORM_u_${T}
    ${T} = unpack_mix_${P}(a_${T}, u_${T}_t);
#else
    ${v} ${E} ${T} = u_${T};
#endif
`:y==="define"?`
#ifndef HAS_UNIFORM_u_${T}
uniform lowp float u_${T}_t;
attribute ${v} ${M} a_${T};
#else
uniform ${v} ${E} u_${T};
#endif
`:P==="vec4"?`
#ifndef HAS_UNIFORM_u_${T}
    ${v} ${E} ${T} = a_${T};
#else
    ${v} ${E} ${T} = u_${T};
#endif
`:`
#ifndef HAS_UNIFORM_u_${T}
    ${v} ${E} ${T} = unpack_mix_${P}(a_${T}, u_${T}_t);
#else
    ${v} ${E} ${T} = u_${T};
#endif
`}),staticAttributes:h,usedDefines:m}}class qh{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(i,n,h,p,m,_,y){this.context=i;let v=this.boundPaintVertexBuffers.length!==p.length;for(let T=0;!v&&T<p.length;T++)this.boundPaintVertexBuffers[T]!==p[T]&&(v=!0);let E=this.boundDynamicVertexBuffers.length!==y.length;for(let T=0;!E&&T<y.length;T++)this.boundDynamicVertexBuffers[T]!==y[T]&&(E=!0);if(!i.extVertexArrayObject||!this.vao||this.boundProgram!==n||this.boundLayoutVertexBuffer!==h||v||E||this.boundIndexBuffer!==m||this.boundVertexOffset!==_)this.freshBind(n,h,p,m,_,y);else{i.bindVertexArrayOES.set(this.vao);for(const T of y)T&&T.bind();m&&m.dynamicDraw&&m.bind()}}freshBind(i,n,h,p,m,_){let y;const v=i.numAttributes,E=this.context,T=E.gl;if(E.extVertexArrayObject)this.vao&&this.destroy(),this.vao=E.extVertexArrayObject.createVertexArrayOES(),E.bindVertexArrayOES.set(this.vao),y=0,this.boundProgram=i,this.boundLayoutVertexBuffer=n,this.boundPaintVertexBuffers=h,this.boundIndexBuffer=p,this.boundVertexOffset=m,this.boundDynamicVertexBuffers=_;else{y=E.currentNumAttributes||0;for(let M=v;M<y;M++)T.disableVertexAttribArray(M)}n.enableAttributes(T,i),n.bind(),n.setVertexAttribPointers(T,i,m);for(const M of h)M.enableAttributes(T,i),M.bind(),M.setVertexAttribPointers(T,i,m);for(const M of _)M&&(M.enableAttributes(T,i),M.bind(),M.setVertexAttribPointers(T,i,m));p&&p.bind(),E.currentNumAttributes=v}destroy(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)}}function Ks(l,i){const n=Math.pow(2,i.canonical.z),h=i.canonical.y;return[new s.MercatorCoordinate(0,h/n).toLngLat().lat,new s.MercatorCoordinate(0,(h+1)/n).toLngLat().lat]}function Tc(l,i,n,h,p,m,_){const y=l.context,v=y.gl,E=n.fbo;if(!E)return;l.prepareDrawTile();const T=l.useProgram("hillshade");y.activeTexture.set(v.TEXTURE0),v.bindTexture(v.TEXTURE_2D,E.colorAttachment.get());const M=((B,O,A,L)=>{const N=A.paint.get("hillshade-shadow-color"),V=A.paint.get("hillshade-highlight-color"),H=A.paint.get("hillshade-accent-color");let J=A.paint.get("hillshade-illumination-direction")*(Math.PI/180);A.paint.get("hillshade-illumination-anchor")==="viewport"&&(J-=B.transform.angle);const K=!B.options.moving;return{u_matrix:L||B.transform.calculateProjMatrix(O.tileID.toUnwrapped(),K),u_image:0,u_latrange:Ks(0,O.tileID),u_light:[A.paint.get("hillshade-exaggeration"),J],u_shadow:N,u_highlight:V,u_accent:H}})(l,n,h,l.terrain?i.projMatrix:null);l.prepareDrawProgram(y,T,i.toUnwrapped());const{tileBoundsBuffer:P,tileBoundsIndexBuffer:R,tileBoundsSegments:F}=l.getTileBoundsBuffers(n);T.draw(y,v.TRIANGLES,p,m,_,s.CullFaceMode.disabled,M,h.id,P,R,F)}function Js(l,i,n){if(!i.needsDEMTextureUpload)return;const h=l.context,p=h.gl;h.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture=i.demTexture||l.getTileTexture(n.stride);const m=n.getPixels();i.demTexture?i.demTexture.update(m,{premultiply:!1}):i.demTexture=new s.Texture(h,m,p.RGBA,{premultiply:!1}),i.needsDEMTextureUpload=!1}function Ec(l,i,n,h,p,m){const _=l.context,y=_.gl;if(!i.dem)return;const v=i.dem;if(_.activeTexture.set(y.TEXTURE1),Js(l,i,v),!i.demTexture)return;i.demTexture.bind(y.NEAREST,y.CLAMP_TO_EDGE);const E=v.dim;_.activeTexture.set(y.TEXTURE0);let T=i.fbo;if(!T){const F=new s.Texture(_,{width:E,height:E,data:null},y.RGBA);F.bind(y.LINEAR,y.CLAMP_TO_EDGE),T=i.fbo=_.createFramebuffer(E,E,!0),T.colorAttachment.set(F.texture)}_.bindFramebuffer.set(T.framebuffer),_.viewport.set([0,0,E,E]);const{tileBoundsBuffer:M,tileBoundsIndexBuffer:P,tileBoundsSegments:R}=l.getMercatorTileBoundsBuffers();l.useProgram("hillshadePrepare").draw(_,y.TRIANGLES,h,p,m,s.CullFaceMode.disabled,((F,B)=>{const O=B.stride,A=s.create();return s.ortho(A,0,s.EXTENT,-s.EXTENT,0,0,1),s.translate(A,A,[0,-s.EXTENT,0]),{u_matrix:A,u_image:1,u_dimension:[O,O],u_zoom:F.overscaledZ,u_unpack:B.unpackVector}})(i.tileID,v),n.id,M,P,R),i.needsHillshadePrepare=!1}const Qs=l=>({u_matrix:new s.UniformMatrix4f(l),u_image0:new s.Uniform1i(l),u_skirt_height:new s.Uniform1f(l)}),fn=(l,i)=>({u_matrix:l,u_image0:0,u_skirt_height:i}),$a=(l,i,n,h,p,m,_,y,v,E,T,M,P,R,F)=>({u_proj_matrix:Float32Array.from(l),u_globe_matrix:i,u_normalize_matrix:Float32Array.from(h),u_merc_matrix:n,u_zoom_transition:p,u_merc_center:m,u_image0:0,u_frustum_tl:_,u_frustum_tr:y,u_frustum_br:v,u_frustum_bl:E,u_globe_pos:T,u_globe_radius:M,u_viewport:P,u_grid_matrix:F?Float32Array.from(F):new Float32Array(9),u_skirt_height:R});function gn(l,i){return l!=null&&i!=null&&!(!l.hasData()||!i.hasData())&&l.demTexture!=null&&i.demTexture!=null&&l.tileID.key!==i.tileID.key}const eo=new class{constructor(){this.operations={}}newMorphing(l,i,n,h,p){if(l in this.operations){const m=this.operations[l];m.to.tileID.key!==n.tileID.key&&(m.queued=n)}else this.operations[l]={startTime:h,phase:0,duration:p,from:i,to:n,queued:null}}getMorphValuesForProxy(l){if(!(l in this.operations))return null;const i=this.operations[l];return{from:i.from,to:i.to,phase:i.phase}}update(l){for(const i in this.operations){const n=this.operations[i];for(n.phase=(l-n.startTime)/n.duration;n.phase>=1||!this._validOp(n);)if(!this._nextOp(n,l)){delete this.operations[i];break}}}_nextOp(l,i){return!!l.queued&&(l.from=l.to,l.to=l.queued,l.queued=null,l.phase=0,l.startTime=i,!0)}_validOp(l){return l.from.hasData()&&l.to.hasData()}},No={0:null,1:"TERRAIN_VERTEX_MORPHING",2:"TERRAIN_WIREFRAME"};function qa(l){return 6*Math.pow(1.5,22-l)}function kc(l,i){const n=1<<l.z;return!i&&(l.x===0||l.x===n-1)||l.y===0||l.y===n-1}const ia=l=>({u_matrix:l});function el(l,i,n,h,p){if(p>0){const m=s.exported.now(),_=(m-l.timeAdded)/p,y=i?(m-i.timeAdded)/p:-1,v=n.getSource(),E=h.coveringZoomLevel({tileSize:v.tileSize,roundZoom:v.roundZoom}),T=!i||Math.abs(i.tileID.overscaledZ-E)>Math.abs(l.tileID.overscaledZ-E),M=T&&l.refreshedUponExpiration?1:s.clamp(T?_:1-y,0,1);return l.refreshedUponExpiration&&_>=1&&(l.refreshedUponExpiration=!1),i?{opacity:1,mix:1-M}:{opacity:M,mix:0}}return{opacity:1,mix:0}}class tl extends s.SourceCache{constructor(i){const n={type:"raster-dem",maxzoom:i.transform.maxZoom},h=new tr(cn(),null),p=ht("mock-dem",n,h,i.style);super("mock-dem",p,!1),p.setEventedParent(this),this._sourceLoaded=!0}_loadTile(i,n){i.state="loaded",n(null)}}class Za extends s.SourceCache{constructor(i){const n=ht("proxy",{type:"geojson",maxzoom:i.transform.maxZoom},new tr(cn(),null),i.style);super("proxy",n,!1),n.setEventedParent(this),this.map=this.getSource().map=i,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(i,n,h){if(i.freezeTileCoverage)return;this.transform=i;const p=i.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((m,_)=>{if(m[_.key]="",!this._tiles[_.key]){const y=new s.Tile(_,this._source.tileSize*_.overscaleFactor(),i.tileZoom);y.state="loaded",this._tiles[_.key]=y}return m},{});for(const m in this._tiles)m in p||(this.freeFBO(m),this._tiles[m].unloadVectorData(),delete this._tiles[m])}freeFBO(i){const n=this.proxyCachedFBO[i];if(n!==void 0){const h=Object.values(n);this.renderCachePool.push(...h),delete this.proxyCachedFBO[i]}}deallocRenderCache(){this.renderCache.forEach(i=>i.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class Xa extends s.OverscaledTileID{constructor(i,n,h){super(i.overscaledZ,i.wrap,i.canonical.z,i.canonical.x,i.canonical.y),this.proxyTileKey=n,this.projMatrix=h}}class rl extends s.Elevation{constructor(i,n){super(),this.painter=i,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[h,p,m]=function(v){const E=new s.StructArrayLayout2i4,T=new s.StructArrayLayout3ui6,M=131;E.reserve(17161),T.reserve(33800);const P=s.EXTENT/128,R=s.EXTENT+P/2,F=R+P;for(let O=-P;O<F;O+=P)for(let A=-P;A<F;A+=P){const L=A<0||A>R||O<0||O>R?24575:0,N=s.clamp(Math.round(A),0,s.EXTENT),V=s.clamp(Math.round(O),0,s.EXTENT);E.emplaceBack(N+L,V)}const B=(O,A)=>{const L=A*M+O;T.emplaceBack(L+1,L,L+M),T.emplaceBack(L+M,L+M+1,L+1)};for(let O=1;O<129;O++)for(let A=1;A<129;A++)B(A,O);return[0,129].forEach(O=>{for(let A=0;A<130;A++)B(A,O),B(O,A)}),[E,T,32768]}(),_=i.context;this.gridBuffer=_.createVertexBuffer(h,s.posAttributes.members),this.gridIndexBuffer=_.createIndexBuffer(p),this.gridSegments=s.SegmentVector.simpleSegment(0,0,h.length,p.length),this.gridNoSkirtSegments=s.SegmentVector.simpleSegment(0,0,h.length,m),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new Za(n.map),this.orthoMatrix=s.create(),s.ortho(this.orthoMatrix,this.painter.transform.projection.name==="globe"?.015:0,s.EXTENT,0,s.EXTENT,0,1);const y=_.gl;this._overlapStencilMode=new s.StencilMode({func:y.GEQUAL,mask:255},0,255,y.KEEP,y.KEEP,y.REPLACE),this._previousZoom=i.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=n,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new tl(n.map)}set style(i){i.on("data",this._onStyleDataEvent.bind(this)),i.on("neworder",this._checkRenderCacheEfficiency.bind(this)),this._style=i,this._checkRenderCacheEfficiency(),this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(i,n,h){if(i&&i.terrain){this._style!==i&&(this.style=i),this.enabled=!0;const p=i.terrain.properties;this.sourceCache=i.terrain.drapeRenderMode===0?this._mockSourceCache:i._getSourceCache(p.get("source")),this._exaggeration=p.get("exaggeration");const m=()=>{this.sourceCache.used&&s.warnOnce(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source.
This leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const _=this.getScaledDemTileSize();this.sourceCache.update(n,_,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,m(),this._initializing=!0),m(),n.updateElevation(!0,h),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(n),this._emptyDEMTextureDirty=!0}else this._disable()}resetTileLookupCache(i){this._findCoveringTileCache[i]={}}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_checkRenderCacheEfficiency(){const i=this.renderCacheEfficiency(this._style);this._style.map._optimizeForTerrain||i.efficiency!==100&&s.warnOnce(`Terrain render cache efficiency is not optimal (${i.efficiency}%) and performance
                may be affected negatively, consider placing all background, fill and line layers before layer
                with id '${i.firstUndrapedLayer}' or create a map using optimizeForTerrain: true option.`)}_onStyleDataEvent(i){i.coord&&i.dataType==="source"?this._clearRenderCacheForTile(i.sourceCacheId,i.coord):i.dataType==="style"&&(this._invalidateRenderCache=!0)}_disable(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const i in this._style._sourceCaches)this._style._sourceCaches[i].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this._emptyDepthBufferTexture&&this._emptyDepthBufferTexture.destroy(),this.pool.forEach(i=>i.fb.destroy()),this.pool=[],this._depthFBO&&(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0)}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this._exaggeration}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const i=2*this.proxySourceCache.getSource().tileSize;return[i,i]}set useVertexMorphing(i){this._useVertexMorphing=i}updateTileBinding(i){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const n=this.proxySourceCache,h=this.painter.transform;this._initializing&&(this._initializing=h._centerAltitude===0&&this.getAtPointOrZero(s.MercatorCoordinate.fromLngLat(h.center),-1)===-1,this._emptyDEMTextureDirty=!this._initializing);const p=this.proxyCoords=n.getIds().map(v=>{const E=n.getTileByID(v).tileID;return E.projMatrix=h.calculateProjMatrix(E.toUnwrapped()),E});(function(v,E){const T=E.transform.pointCoordinate(E.transform.getCameraPoint()),M=new s.Point(T.x,T.y);v.sort((P,R)=>{if(R.overscaledZ-P.overscaledZ)return R.overscaledZ-P.overscaledZ;const F=new s.Point(P.canonical.x+(1<<P.canonical.z)*P.wrap,P.canonical.y),B=new s.Point(R.canonical.x+(1<<R.canonical.z)*R.wrap,R.canonical.y),O=M.mult(1<<P.canonical.z);return O.x-=.5,O.y-=.5,O.distSqr(F)-O.distSqr(B)})})(p,this.painter),this._previousZoom=h.zoom;const m=this.proxyToSource||{};this.proxyToSource={},p.forEach(v=>{this.proxyToSource[v.key]={}}),this.terrainTileForTile={};const _=this._style._sourceCaches;for(const v in _){const E=_[v];if(!E.used||(E!==this.sourceCache&&this.resetTileLookupCache(E.id),this._setupProxiedCoordsForOrtho(E,i[v],m),E.usedForTerrain))continue;const T=i[v];E.getSource().reparseOverscaled&&this._assignTerrainTiles(T)}this.proxiedCoords[n.id]=p.map(v=>new Xa(v,v.key,this.orthoMatrix)),this._assignTerrainTiles(p),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(m),this.renderingToTexture=!1,this._updateTimestamp=s.exported.now();const y={};this._visibleDemTiles=[];for(const v of this.proxyCoords){const E=this.terrainTileForTile[v.key];if(!E)continue;const T=E.tileID.key;T in y||(this._visibleDemTiles.push(E),y[T]=T)}}_assignTerrainTiles(i){this._initializing||i.forEach(n=>{if(this.terrainTileForTile[n.key])return;const h=this._findTileCoveringTileID(n,this.sourceCache);h&&(this.terrainTileForTile[n.key]=h)})}_prepareDEMTextures(){const i=this.painter.context,n=i.gl;for(const h in this.terrainTileForTile){const p=this.terrainTileForTile[h],m=p.dem;!m||p.demTexture&&!p.needsDEMTextureUpload||(i.activeTexture.set(n.TEXTURE1),Js(this.painter,p,m))}}_prepareDemTileUniforms(i,n,h,p){if(!n||n.demTexture==null)return!1;const m=i.tileID.canonical,_=Math.pow(2,n.tileID.canonical.z-m.z),y=p||"";return h[`u_dem_tl${y}`]=[m.x*_%1,m.y*_%1],h[`u_dem_scale${y}`]=_,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}get emptyDepthBufferTexture(){const i=this.painter.context,n=i.gl;if(!this._emptyDepthBufferTexture){const h=new s.RGBAImage({width:1,height:1},Uint8Array.of(255,255,255,255));this._emptyDepthBufferTexture=new s.Texture(i,h,n.RGBA,{premultiply:!1})}return this._emptyDepthBufferTexture}_getLoadedAreaMinimum(){let i=0;const n=this._visibleDemTiles.reduce((h,p)=>{if(!p.dem)return h;const m=p.dem.tree.minimums[0];return m>0&&i++,h+m},0);return i?n/i:0}_updateEmptyDEMTexture(){const i=this.painter.context,n=i.gl;i.activeTexture.set(n.TEXTURE2);const h=this._getLoadedAreaMinimum(),p=new s.RGBAImage({width:1,height:1},new Uint8Array(s.DEMData.pack(h,this.sourceCache.getSource().encoding)));this._emptyDEMTextureDirty=!1;let m=this._emptyDEMTexture;return m?m.update(p,{premultiply:!1}):m=this._emptyDEMTexture=new s.Texture(i,p,n.RGBA,{premultiply:!1}),m}setupElevationDraw(i,n,h){const p=this.painter.context,m=p.gl,_=(y=this.sourceCache.getSource().encoding,{u_dem:2,u_dem_prev:4,u_dem_unpack:s.DEMData.getUnpackVector(y),u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_exaggeration:0});var y;_.u_dem_size=this.sourceCache.getSource().tileSize,_.u_exaggeration=this.exaggeration();let v=null,E=null,T=1;if(h&&h.morphing&&this._useVertexMorphing){const M=h.morphing.srcDemTile,P=h.morphing.dstDemTile;T=h.morphing.phase,M&&P&&(this._prepareDemTileUniforms(i,M,_,"_prev")&&(E=M),this._prepareDemTileUniforms(i,P,_)&&(v=P))}if(E&&v?(p.activeTexture.set(m.TEXTURE2),v.demTexture.bind(m.NEAREST,m.CLAMP_TO_EDGE,m.NEAREST),p.activeTexture.set(m.TEXTURE4),E.demTexture.bind(m.NEAREST,m.CLAMP_TO_EDGE,m.NEAREST),_.u_dem_lerp=T):(v=this.terrainTileForTile[i.tileID.key],p.activeTexture.set(m.TEXTURE2),(this._prepareDemTileUniforms(i,v,_)?v.demTexture:this.emptyDEMTexture).bind(m.NEAREST,m.CLAMP_TO_EDGE)),p.activeTexture.set(m.TEXTURE3),h&&h.useDepthForOcclusion?(this._depthTexture&&this._depthTexture.bind(m.NEAREST,m.CLAMP_TO_EDGE),this._depthFBO&&(_.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height])):(this.emptyDepthBufferTexture.bind(m.NEAREST,m.CLAMP_TO_EDGE),_.u_depth_size_inv=[1,1]),h&&h.useMeterToDem&&v){const M=(1<<v.tileID.canonical.z)*s.mercatorZfromAltitude(1,this.painter.transform.center.lat)*this.sourceCache.getSource().tileSize;_.u_meter_to_dem=M}if(h&&h.labelPlaneMatrixInv&&(_.u_label_plane_matrix_inv=h.labelPlaneMatrixInv),n.setTerrainUniformValues(p,_),this.painter.transform.projection.name==="globe"){const M=this.globeUniformValues(this.painter.transform,i.tileID.canonical,h&&h.useDenormalizedUpVectorScale);n.setGlobeUniformValues(p,M)}}globeUniformValues(i,n,h){const p=i.projection;return{u_tile_tl_up:p.upVector(n,0,0),u_tile_tr_up:p.upVector(n,s.EXTENT,0),u_tile_br_up:p.upVector(n,s.EXTENT,s.EXTENT),u_tile_bl_up:p.upVector(n,0,s.EXTENT),u_tile_up_scale:h?s.globeMetersToEcef(1):p.upVectorScale(n,i.center.lat,i.worldSize).metersToTile}}renderToBackBuffer(i){const n=this.painter,h=this.painter.context;i.length!==0&&(h.bindFramebuffer.set(null),h.viewport.set([0,0,n.width,n.height]),n.gpuTimingDeferredRenderStart(),this.renderingToTexture=!1,function(p,m,_,y,v){if(p.transform.projection.name==="globe")(function(E,T,M,P,R){const F=E.context,B=F.gl;let O,A;const L=E.options.showTerrainWireframe?2:0,N=E.transform,V=s.globeUseCustomAntiAliasing(E,F,N),H=(Te,se)=>{if(A===Te)return;const ge=[No[Te],"PROJECTION_GLOBE_VIEW"];V&&ge.push("CUSTOM_ANTIALIASING"),se&&ge.push(No[L]),O=E.useProgram("globeRaster",null,ge),A=Te},J=E.colorModeForRenderPass(),K=new s.DepthMode(B.LEQUAL,s.DepthMode.ReadWrite,E.depthRangeFor3D);eo.update(R);const re=s.calculateGlobeMercatorMatrix(N),te=[s.mercatorXfromLng(N.center.lng),s.mercatorYfromLat(N.center.lat)],le=L?[!1,!0]:[!1],Ee=E.globeSharedBuffers,ne=[N.width*s.exported.devicePixelRatio,N.height*s.exported.devicePixelRatio],_e=Float32Array.from(N.globeMatrix),he={useDenormalizedUpVectorScale:!0};if(le.forEach(Te=>{const se=E.transform,ge=qa(se.zoom)*T.exaggeration();A=-1;const Se=Te?B.LINES:B.TRIANGLES;for(const we of P){const Me=M.getTile(we),qe=s.StencilMode.disabled,Qe=T.prevTerrainTileForTile[we.key],je=T.terrainTileForTile[we.key];gn(Qe,je)&&eo.newMorphing(we.key,Qe,je,R,250),F.activeTexture.set(B.TEXTURE0),Me.texture.bind(B.LINEAR,B.CLAMP_TO_EDGE);const We=eo.getMorphValuesForProxy(we.key),mt=We?1:0;We&&s.extend$1(he,{morphing:{srcDemTile:We.from,dstDemTile:We.to,phase:s.easeCubicInOut(We.phase)}});const ut=s.tileCornersToBounds(we.canonical),$e=s.getLatitudinalLod(ut.getCenter().lat),It=s.getGridMatrix(we.canonical,ut,$e,se.worldSize/se._pixelsPerMercatorPixel),Lt=s.globeNormalizeECEF(s.globeTileBounds(we.canonical)),Rt=$a(se.projMatrix,_e,re,Lt,s.globeToMercatorTransition(se.zoom),te,se.frustumCorners.TL,se.frustumCorners.TR,se.frustumCorners.BR,se.frustumCorners.BL,se.globeCenterInViewSpace,se.globeRadius,ne,ge,It);if(H(mt,Te),T.setupElevationDraw(Me,O,he),E.prepareDrawProgram(F,O,we.toUnwrapped()),Ee){const[Bt,Gr,Cr]=Te?Ee.getWirefameBuffers(E.context,$e):Ee.getGridBuffers($e,ge!==0);O.draw(F,Se,K,qe,J,s.CullFaceMode.backCCW,Rt,"globe_raster",Bt,Gr,Cr)}}}),Ee){const Te=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];V&&Te.push("CUSTOM_ANTIALIASING"),O=E.useProgram("globeRaster",null,Te);for(const se of P){const{x:ge,y:Se,z:we}=se.canonical,Me=Se===0,qe=Se===(1<<we)-1,[Qe,je,We,mt]=Ee.getPoleBuffers(we);if(mt&&(Me||qe)){const ut=M.getTile(se);F.activeTexture.set(B.TEXTURE0),ut.texture.bind(B.LINEAR,B.CLAMP_TO_EDGE);let $e=s.globePoleMatrixForTile(we,ge,N);const It=s.globeNormalizeECEF(s.globeTileBounds(se.canonical)),Lt=(Rt,Bt)=>Rt.draw(F,B.TRIANGLES,K,s.StencilMode.disabled,J,s.CullFaceMode.disabled,$a(N.projMatrix,$e,$e,It,0,te,N.frustumCorners.TL,N.frustumCorners.TR,N.frustumCorners.BR,N.frustumCorners.BL,N.globeCenterInViewSpace,N.globeRadius,ne,0),"globe_pole_raster",Bt,We,mt);T.setupElevationDraw(ut,O,he),E.prepareDrawProgram(F,O,se.toUnwrapped()),Me&&Lt(O,Qe),qe&&($e=s.scale(s.create(),$e,[1,-1,1]),Lt(O,je))}}}})(p,m,_,y,v);else{const E=p.context,T=E.gl;let M,P;const R=p.options.showTerrainWireframe?2:0,F=(N,V)=>{if(P===N)return;const H=[No[N]];V&&H.push(No[R]),M=p.useProgram("terrainRaster",null,H),P=N},B=p.colorModeForRenderPass(),O=new s.DepthMode(T.LEQUAL,s.DepthMode.ReadWrite,p.depthRangeFor3D);eo.update(v);const A=p.transform,L=qa(A.zoom)*m.exaggeration();(R?[!1,!0]:[!1]).forEach(N=>{P=-1;const V=N?T.LINES:T.TRIANGLES,[H,J]=N?m.getWirefameBuffer():[m.gridIndexBuffer,m.gridSegments];for(const K of y){const re=_.getTile(K),te=s.StencilMode.disabled,le=m.prevTerrainTileForTile[K.key],Ee=m.terrainTileForTile[K.key];gn(le,Ee)&&eo.newMorphing(K.key,le,Ee,v,250),E.activeTexture.set(T.TEXTURE0),re.texture.bind(T.LINEAR,T.CLAMP_TO_EDGE,T.LINEAR_MIPMAP_NEAREST);const ne=eo.getMorphValuesForProxy(K.key),_e=ne?1:0;let he;ne&&(he={morphing:{srcDemTile:ne.from,dstDemTile:ne.to,phase:s.easeCubicInOut(ne.phase)}});const Te=fn(K.projMatrix,kc(K.canonical,A.renderWorldCopies)?L/10:L);F(_e,N),m.setupElevationDraw(re,M,he),p.prepareDrawProgram(E,M,K.toUnwrapped()),M.draw(E,V,O,te,B,s.CullFaceMode.backCCW,Te,"terrain_raster",m.gridBuffer,H,J)}})}}(n,this,this.proxySourceCache,i,this._updateTimestamp),this.renderingToTexture=!0,n.gpuTimingDeferredRenderEnd(),i.splice(0,i.length))}renderBatch(i){if(this._drapedRenderBatches.length===0)return i+1;this.renderingToTexture=!0;const n=this.painter,h=this.painter.context,p=this.proxySourceCache,m=this.proxiedCoords[p.id],_=this._drapedRenderBatches.shift(),y=[],v=n.style.order;let E=0;for(const T of m){const M=p.getTileByID(T.proxyTileKey),P=p.proxyCachedFBO[T.key]?p.proxyCachedFBO[T.key][i]:void 0,R=P!==void 0?p.renderCache[P]:this.pool[E++],F=P!==void 0;if(M.texture=R.tex,F&&!R.dirty){y.push(M.tileID);continue}let B;h.bindFramebuffer.set(R.fb.framebuffer),this.renderedToTile=!1,R.dirty&&(h.clear({color:s.Color.transparent,stencil:0}),R.dirty=!1);for(let O=_.start;O<=_.end;++O){const A=n.style._layers[v[O]];if(A.isHidden(n.transform.zoom))continue;const L=n.style._getLayerSourceCache(A),N=L?this.proxyToSource[T.key][L.id]:[T];if(!N)continue;const V=N;h.viewport.set([0,0,R.fb.width,R.fb.height]),B!==(L?L.id:null)&&(this._setupStencil(R,N,A,L),B=L?L.id:null),n.renderLayer(n,L,A,V)}this.renderedToTile?(R.dirty=!0,y.push(M.tileID)):F||--E,E===5&&(E=0,this.renderToBackBuffer(y))}return this.renderToBackBuffer(y),this.renderingToTexture=!1,h.bindFramebuffer.set(null),h.viewport.set([0,0,n.width,n.height]),_.end+1}postRender(){}renderCacheEfficiency(i){const n=i.order.length;if(n===0)return{efficiency:100};let h,p=0,m=0,_=!1;for(let y=0;y<n;++y){const v=i._layers[i.order[y]];this._style.isLayerDraped(v)?(_&&++p,++m):_||(_=!0,h=v.id)}return m===0?{efficiency:100}:{efficiency:100*(1-p/m),firstUndrapedLayer:h}}getMinElevationBelowMSL(){let i=0;return this._visibleDemTiles.filter(n=>n.dem).forEach(n=>{i=Math.min(i,n.dem.tree.minimums[0])}),i===0?i:(i-30)*this._exaggeration}raycast(i,n,h){if(!this._visibleDemTiles)return null;const p=this._visibleDemTiles.filter(m=>m.dem).map(m=>{const _=m.tileID,y=1<<_.overscaledZ,{x:v,y:E}=_.canonical,T=v/y,M=(v+1)/y,P=E/y,R=(E+1)/y;return{minx:T,miny:P,maxx:M,maxy:R,t:m.dem.tree.raycastRoot(T,P,M,R,i,n,h),tile:m}});p.sort((m,_)=>(m.t!==null?m.t:Number.MAX_VALUE)-(_.t!==null?_.t:Number.MAX_VALUE));for(const m of p){if(m.t==null)return null;const _=m.tile.dem.tree.raycast(m.minx,m.miny,m.maxx,m.maxy,i,n,h);if(_!=null)return _}return null}_createFBO(){const i=this.painter.context,n=i.gl,h=this.drapeBufferSize;i.activeTexture.set(n.TEXTURE0);const p=new s.Texture(i,{width:h[0],height:h[1],data:null},n.RGBA);p.bind(n.LINEAR,n.CLAMP_TO_EDGE);const m=i.createFramebuffer(h[0],h[1],!1);return m.colorAttachment.set(p.texture),m.depthAttachment=new Q(i,m.framebuffer),this._sharedDepthStencil===void 0?(this._sharedDepthStencil=i.createRenderbuffer(i.gl.DEPTH_STENCIL,h[0],h[1]),this._stencilRef=0,m.depthAttachment.set(this._sharedDepthStencil),i.clear({stencil:0})):m.depthAttachment.set(this._sharedDepthStencil),i.extTextureFilterAnisotropic&&!i.extTextureFilterAnisotropicForceOff&&n.texParameterf(n.TEXTURE_2D,i.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,i.extTextureFilterAnisotropicMax),{fb:m,tex:p,dirty:!1}}_initFBOPool(){for(;this.pool.length<Math.min(5,this.proxyCoords.length);)this.pool.push(this._createFBO())}_shouldDisableRenderCache(){if(this._style.light&&this._style.light.hasTransition())return!0;for(const i in this._style._sourceCaches)if(this._style._sourceCaches[i].hasTransition())return!0;return this._style.order.some(i=>{const n=this._style._layers[i],h=n.isHidden(this.painter.transform.zoom);return n.type==="custom"?!h&&n.shouldRedrape():!h&&n.hasTransition()})}_clearLineLayersFromRenderCache(){let i=!1;for(const h of this._style._getSources())if(h instanceof Pe){i=!0;break}if(!i)return;const n={};for(let h=0;h<this._style.order.length;++h){const p=this._style._layers[this._style.order[h]],m=this._style._getLayerSourceCache(p);if(m&&!n[m.id]&&!p.isHidden(this.painter.transform.zoom)&&p.type==="line"&&p.widthExpression()instanceof s.ZoomDependentExpression){n[m.id]=!0;for(const _ of this.proxyCoords){const y=this.proxyToSource[_.key][m.id];if(y)for(const v of y)this._clearRenderCacheForTile(m.id,v)}}}}_clearRasterLayersFromRenderCache(){let i=!1;for(const h in this._style._sourceCaches)if(this._style._sourceCaches[h]._source instanceof Ae){i=!0;break}if(!i)return;const n={};for(let h=0;h<this._style.order.length;++h){const p=this._style._layers[this._style.order[h]],m=this._style._getLayerSourceCache(p);if(!m||n[m.id]||p.isHidden(this.painter.transform.zoom)||p.type!=="raster")continue;const _=p.paint.get("raster-fade-duration");for(const y of this.proxyCoords){const v=this.proxyToSource[y.key][m.id];if(v)for(const E of v){const T=el(m.getTile(E),m.findLoadedParent(E,0),m,this.painter.transform,_);(T.opacity!==1||T.mix!==0)&&this._clearRenderCacheForTile(m.id,E)}}}}_setupDrapedRenderBatches(){const i=this._style.order,n=i.length;if(n===0)return;const h=[];let p,m=0,_=this._style._layers[i[m]];for(;!this._style.isLayerDraped(_)&&_.isHidden(this.painter.transform.zoom)&&++m<n;)_=this._style._layers[i[m]];for(;m<n;++m){const y=this._style._layers[i[m]];y.isHidden(this.painter.transform.zoom)||(this._style.isLayerDraped(y)?p===void 0&&(p=m):p!==void 0&&(h.push({start:p,end:m-1}),p=void 0))}p!==void 0&&h.push({start:p,end:m-1}),this._drapedRenderBatches=h}_setupRenderCache(i){const n=this.proxySourceCache;if(this._shouldDisableRenderCache()||this._invalidateRenderCache){if(this._invalidateRenderCache=!1,n.renderCache.length>n.renderCachePool.length){const _=Object.values(n.proxyCachedFBO);n.proxyCachedFBO={};for(let y=0;y<_.length;++y){const v=Object.values(_[y]);n.renderCachePool.push(...v)}}return}this._clearRasterLayersFromRenderCache();const h=this.proxyCoords,p=this._tilesDirty;for(let _=h.length-1;_>=0;_--){const y=h[_];if(n.getTileByID(y.key),n.proxyCachedFBO[y.key]!==void 0){const v=i[y.key],E=this.proxyToSource[y.key];let T=0;for(const M in E){const P=E[M],R=v[M];if(!R||R.length!==P.length||P.some((F,B)=>F!==R[B]||p[M]&&p[M].hasOwnProperty(F.key))){T=-1;break}++T}for(const M in n.proxyCachedFBO[y.key])n.renderCache[n.proxyCachedFBO[y.key][M]].dirty=T<0||T!==Object.values(v).length}}const m=[...this._drapedRenderBatches];m.sort((_,y)=>y.end-y.start-(_.end-_.start));for(const _ of m)for(const y of h){if(n.proxyCachedFBO[y.key])continue;let v=n.renderCachePool.pop();v===void 0&&n.renderCache.length<50&&(v=n.renderCache.length,n.renderCache.push(this._createFBO())),v!==void 0&&(n.proxyCachedFBO[y.key]={},n.proxyCachedFBO[y.key][_.start]=v,n.renderCache[v].dirty=!0)}this._tilesDirty={}}_setupStencil(i,n,h,p){if(!p||!this._sourceTilesOverlap[p.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const m=this.painter.context,_=m.gl;if(n.length<=1)return void(this._overlapStencilType=!1);let y;if(h.isTileClipped())y=n.length,this._overlapStencilMode.test={func:_.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(n[0].overscaledZ>n[n.length-1].overscaledZ))return void(this._overlapStencilType=!1);y=1,this._overlapStencilMode.test={func:_.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+y>255&&(m.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=y,this._overlapStencilMode.ref=this._stencilRef,h.isTileClipped()&&this._renderTileClippingMasks(n,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return this._overlapStencilType==="Clip"||this._overlapStencilType==="Mask"}stencilModeForRTTOverlap(i){return this.renderingToTexture&&this._overlapStencilType?(this._overlapStencilType==="Clip"&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[i.key]),this._overlapStencilMode):s.StencilMode.disabled}_renderTileClippingMasks(i,n){const h=this.painter,p=this.painter.context,m=p.gl;h._tileClippingMaskIDs={},p.setColorMode(s.ColorMode.disabled),p.setDepthMode(s.DepthMode.disabled);const _=h.useProgram("clippingMask");for(const y of i){const v=h._tileClippingMaskIDs[y.key]=--n;_.draw(p,m.TRIANGLES,s.DepthMode.disabled,new s.StencilMode({func:m.ALWAYS,mask:0},v,255,m.KEEP,m.KEEP,m.REPLACE),s.ColorMode.disabled,s.CullFaceMode.disabled,ia(y.projMatrix),"$clipping",h.tileExtentBuffer,h.quadTriangleIndexBuffer,h.tileExtentSegments)}}pointCoordinate(i){const n=this.painter.transform;if(i.x<0||i.x>n.width||i.y<0||i.y>n.height)return null;const h=[i.x,i.y,1,1];s.transformMat4$1(h,h,n.pixelMatrixInverse),s.scale$1(h,h,1/h[3]),h[0]/=n.worldSize,h[1]/=n.worldSize;const p=n._camera.position,m=s.mercatorZfromAltitude(1,n.center.lat),_=[p[0],p[1],p[2]/m,0],y=s.subtract([],h.slice(0,3),_);s.normalize(y,y);const v=this.raycast(_,y,this._exaggeration);return v!==null&&v?(s.scaleAndAdd(_,_,y,v),_[3]=_[2],_[2]*=m,_):null}drawDepth(){const i=this.painter,n=i.context,h=this.proxySourceCache,p=Math.ceil(i.width),m=Math.ceil(i.height);if(!this._depthFBO||this._depthFBO.width===p&&this._depthFBO.height===m||(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0),!this._depthFBO){const _=n.gl,y=n.createFramebuffer(p,m,!0);n.activeTexture.set(_.TEXTURE0);const v=new s.Texture(n,{width:p,height:m,data:null},_.RGBA);v.bind(_.NEAREST,_.CLAMP_TO_EDGE),y.colorAttachment.set(v.texture);const E=n.createRenderbuffer(n.gl.DEPTH_COMPONENT16,p,m);y.depthAttachment.set(E),this._depthFBO=y,this._depthTexture=v}n.bindFramebuffer.set(this._depthFBO.framebuffer),n.viewport.set([0,0,p,m]),function(_,y,v,E){if(_.transform.projection.name==="globe")return;const T=_.context,M=T.gl;T.clear({depth:1});const P=_.useProgram("terrainDepth"),R=new s.DepthMode(M.LESS,s.DepthMode.ReadWrite,_.depthRangeFor3D);for(const F of E){const B=v.getTile(F),O=fn(F.projMatrix,0);y.setupElevationDraw(B,P),P.draw(T,M.TRIANGLES,R,s.StencilMode.disabled,s.ColorMode.unblended,s.CullFaceMode.backCCW,O,"terrain_depth",y.gridBuffer,y.gridIndexBuffer,y.gridNoSkirtSegments)}}(i,this,h,this.proxyCoords)}_setupProxiedCoordsForOrtho(i,n,h){if(i.getSource()instanceof ct)return this._setupProxiedCoordsForImageSource(i,n,h);this._findCoveringTileCache[i.id]=this._findCoveringTileCache[i.id]||{};const p=this.proxiedCoords[i.id]=[],m=this.proxyCoords;for(let y=0;y<m.length;y++){const v=m[y],E=this._findTileCoveringTileID(v,i);if(E){const T=this._createProxiedId(v,E,h[v.key]&&h[v.key][i.id]);p.push(T),this.proxyToSource[v.key][i.id]=[T]}}let _=!1;for(let y=0;y<n.length;y++){const v=i.getTile(n[y]);if(!v||!v.hasData())continue;const E=this._findTileCoveringTileID(v.tileID,this.proxySourceCache);if(E&&E.tileID.canonical.z!==v.tileID.canonical.z){const T=this.proxyToSource[E.tileID.key][i.id],M=this._createProxiedId(E.tileID,v,h[E.tileID.key]&&h[E.tileID.key][i.id]);T?T.splice(T.length-1,0,M):this.proxyToSource[E.tileID.key][i.id]=[M],p.push(M),_=!0}}this._sourceTilesOverlap[i.id]=_}_setupProxiedCoordsForImageSource(i,n,h){if(!i.getSource().loaded())return;const p=this.proxiedCoords[i.id]=[],m=this.proxyCoords,_=i.getSource(),y=new s.Point(_.tileID.x,_.tileID.y)._div(1<<_.tileID.z),v=_.coordinates.map(s.MercatorCoordinate.fromLngLat).reduce((T,M)=>(T.min.x=Math.min(T.min.x,M.x-y.x),T.min.y=Math.min(T.min.y,M.y-y.y),T.max.x=Math.max(T.max.x,M.x-y.x),T.max.y=Math.max(T.max.y,M.y-y.y),T),{min:new s.Point(Number.MAX_VALUE,Number.MAX_VALUE),max:new s.Point(-Number.MAX_VALUE,-Number.MAX_VALUE)}),E=(T,M)=>{const P=T.wrap+T.canonical.x/(1<<T.canonical.z),R=T.canonical.y/(1<<T.canonical.z),F=s.EXTENT/(1<<T.canonical.z),B=M.wrap+M.canonical.x/(1<<M.canonical.z),O=M.canonical.y/(1<<M.canonical.z);return P+F<B+v.min.x||P>B+v.max.x||R+F<O+v.min.y||R>O+v.max.y};for(let T=0;T<m.length;T++){const M=m[T];for(let P=0;P<n.length;P++){const R=i.getTile(n[P]);if(!R||!R.hasData()||E(M,R.tileID))continue;const F=this._createProxiedId(M,R,h[M.key]&&h[M.key][i.id]),B=this.proxyToSource[M.key][i.id];B?B.push(F):this.proxyToSource[M.key][i.id]=[F],p.push(F)}}}_createProxiedId(i,n,h){let p=this.orthoMatrix;if(h){const m=h.find(_=>_.key===n.tileID.key);if(m)return m}if(n.tileID.key!==i.key){const m=i.canonical.z-n.tileID.canonical.z;let _,y,v;p=s.create();const E=n.tileID.wrap-i.wrap<<i.overscaledZ;m>0?(_=s.EXTENT>>m,y=_*((n.tileID.canonical.x<<m)-i.canonical.x+E),v=_*((n.tileID.canonical.y<<m)-i.canonical.y)):(_=s.EXTENT<<-m,y=s.EXTENT*(n.tileID.canonical.x-(i.canonical.x+E<<-m)),v=s.EXTENT*(n.tileID.canonical.y-(i.canonical.y<<-m))),s.ortho(p,0,_,0,_,0,1),s.translate(p,p,[y,v,0])}return new Xa(n.tileID,i.key,p)}_findTileCoveringTileID(i,n){let h=n.getTile(i);if(h&&h.hasData())return h;const p=this._findCoveringTileCache[n.id],m=p[i.key];if(h=m?n.getTileByID(m):null,h&&h.hasData()||m===null)return h;let _=h?h.tileID:i,y=_.overscaledZ;const v=n.getSource().minzoom,E=[];if(!m){const M=n.getSource().maxzoom;if(i.canonical.z>=M){const P=i.canonical.z-M;n.getSource().reparseOverscaled?(y=Math.max(i.canonical.z+2,n.transform.tileZoom),_=new s.OverscaledTileID(y,i.wrap,M,i.canonical.x>>P,i.canonical.y>>P)):P!==0&&(y=M,_=new s.OverscaledTileID(y,i.wrap,M,i.canonical.x>>P,i.canonical.y>>P))}_.key!==i.key&&(E.push(_.key),h=n.getTile(_))}const T=M=>{E.forEach(P=>{p[P]=M}),E.length=0};for(y-=1;y>=v&&(!h||!h.hasData());y--){h&&T(h.tileID.key);const M=_.calculateScaledKey(y);if(h=n.getTileByID(M),h&&h.hasData())break;const P=p[M];if(P===null)break;P===void 0?E.push(M):h=n.getTileByID(P)}return T(h?h.tileID.key:null),h&&h.hasData()?h:null}findDEMTileFor(i){return this.enabled?this._findTileCoveringTileID(i,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(i,n){let h=this._tilesDirty[i];h||(h=this._tilesDirty[i]={}),h[n.key]=!0}getWirefameBuffer(){if(!this.wireframeSegments){const i=function(n){let h=0;const p=new s.StructArrayLayout2ui4,m=131;for(let _=1;_<129;_++){for(let y=1;y<129;y++)h=_*m+y,p.emplaceBack(h,h+1),p.emplaceBack(h,h+m),p.emplaceBack(h+1,h+m),_===128&&p.emplaceBack(h+m,h+m+1);p.emplaceBack(h+1,h+1+m)}return p}();this.wireframeIndexBuffer=this.painter.context.createIndexBuffer(i),this.wireframeSegments=s.SegmentVector.simpleSegment(0,0,this.gridBuffer.length,i.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}}class bt{static cacheKey(i,n,h,p){let m=`${n}${p?p.cacheKey:""}`;for(const _ of h)i.usedDefines.includes(_)&&(m+=`/${_}`);return m}constructor(i,n,h,p,m,_){const y=i.gl;this.program=y.createProgram();const v=function(A){const L=[];for(let N=0;N<A.length;N++){if(A[N]===null)continue;const V=A[N].split(" ");L.push(V.pop())}return L}(h.staticAttributes),E=p?p.getBinderAttributes():[],T=v.concat(E);let M=p?p.defines():[];M=M.concat(_.map(A=>`#define ${A}`));const P=i.isWebGL2?`#version 300 es
`:"",R=P+M.concat(i.extStandardDerivatives&&P.length===0?`#extension GL_OES_standard_derivatives : enable
`.concat(Ys):Ys,Ys,Ga,bc.fragmentSource,dn.fragmentSource,h.fragmentSource).join(`
`),F=P+M.concat(`
#ifdef GL_ES
precision highp float;
#else

#if !defined(lowp)
#define lowp
#endif

#if !defined(mediump)
#define mediump
#endif

#if !defined(highp)
#define highp
#endif

#endif`,Ga,bc.vertexSource,dn.vertexSource,Va.vertexSource,h.vertexSource).join(`
`),B=y.createShader(y.FRAGMENT_SHADER);if(y.isContextLost())return void(this.failedToCreate=!0);y.shaderSource(B,R),y.compileShader(B),y.attachShader(this.program,B);const O=y.createShader(y.VERTEX_SHADER);if(y.isContextLost())this.failedToCreate=!0;else{y.shaderSource(O,F),y.compileShader(O),y.attachShader(this.program,O),this.attributes={},this.numAttributes=T.length;for(let A=0;A<this.numAttributes;A++)T[A]&&(y.bindAttribLocation(this.program,A,T[A]),this.attributes[T[A]]=A);y.linkProgram(this.program),y.deleteShader(O),y.deleteShader(B),this.fixedUniforms=m(i),this.binderUniforms=p?p.getUniforms(i):[],_.includes("TERRAIN")&&(this.terrainUniforms=(A=>({u_dem:new s.Uniform1i(A),u_dem_prev:new s.Uniform1i(A),u_dem_unpack:new s.Uniform4f(A),u_dem_tl:new s.Uniform2f(A),u_dem_scale:new s.Uniform1f(A),u_dem_tl_prev:new s.Uniform2f(A),u_dem_scale_prev:new s.Uniform1f(A),u_dem_size:new s.Uniform1f(A),u_dem_lerp:new s.Uniform1f(A),u_exaggeration:new s.Uniform1f(A),u_depth:new s.Uniform1i(A),u_depth_size_inv:new s.Uniform2f(A),u_meter_to_dem:new s.Uniform1f(A),u_label_plane_matrix_inv:new s.UniformMatrix4f(A)}))(i)),_.includes("GLOBE")&&(this.globeUniforms=(A=>({u_tile_tl_up:new s.Uniform3f(A),u_tile_tr_up:new s.Uniform3f(A),u_tile_br_up:new s.Uniform3f(A),u_tile_bl_up:new s.Uniform3f(A),u_tile_up_scale:new s.Uniform1f(A)}))(i)),_.includes("FOG")&&(this.fogUniforms=(A=>({u_fog_matrix:new s.UniformMatrix4f(A),u_fog_range:new s.Uniform2f(A),u_fog_color:new s.Uniform4f(A),u_fog_horizon_blend:new s.Uniform1f(A),u_fog_temporal_offset:new s.Uniform1f(A),u_frustum_tl:new s.Uniform3f(A),u_frustum_tr:new s.Uniform3f(A),u_frustum_br:new s.Uniform3f(A),u_frustum_bl:new s.Uniform3f(A),u_globe_pos:new s.Uniform3f(A),u_globe_radius:new s.Uniform1f(A),u_globe_transition:new s.Uniform1f(A),u_is_globe:new s.Uniform1i(A),u_viewport:new s.Uniform2f(A)}))(i))}}setTerrainUniformValues(i,n){if(!this.terrainUniforms)return;const h=this.terrainUniforms;if(!this.failedToCreate){i.program.set(this.program);for(const p in n)h[p]&&h[p].set(this.program,p,n[p])}}setGlobeUniformValues(i,n){if(!this.globeUniforms)return;const h=this.globeUniforms;if(!this.failedToCreate){i.program.set(this.program);for(const p in n)h[p]&&h[p].set(this.program,p,n[p])}}setFogUniformValues(i,n){if(!this.fogUniforms)return;const h=this.fogUniforms;if(!this.failedToCreate){i.program.set(this.program);for(const p in n)h[p].set(this.program,p,n[p])}}draw(i,n,h,p,m,_,y,v,E,T,M,P,R,F,B){const O=i.gl;if(this.failedToCreate)return;i.program.set(this.program),i.setDepthMode(h),i.setStencilMode(p),i.setColorMode(m),i.setCullFace(_);for(const L of Object.keys(this.fixedUniforms))this.fixedUniforms[L].set(this.program,L,y[L]);F&&F.setUniforms(this.program,i,this.binderUniforms,P,{zoom:R});const A={[O.LINES]:2,[O.TRIANGLES]:3,[O.LINE_STRIP]:1}[n];for(const L of M.get()){const N=L.vaos||(L.vaos={});(N[v]||(N[v]=new qh)).bind(i,this,E,F?F.getPaintVertexBuffers():[],T,L.vertexOffset,B||[]),O.drawElements(n,L.primitiveLength*A,O.UNSIGNED_SHORT,L.primitiveOffset*A*2)}}}function oa(l,i){const n=Math.pow(2,i.tileID.overscaledZ),h=i.tileSize*Math.pow(2,l.transform.tileZoom)/n,p=h*(i.tileID.canonical.x+i.tileID.wrap*n),m=h*i.tileID.canonical.y;return{u_image:0,u_texsize:i.imageAtlasTexture.size,u_tile_units_to_pixels:1/rr(i,1,l.transform.tileZoom),u_pixel_coord_upper:[p>>16,m>>16],u_pixel_coord_lower:[65535&p,65535&m]}}const Sc=s.create(),il=(l,i,n,h,p,m,_,y,v,E,T)=>{const M=i.style.light,P=M.properties.get("position"),R=[P.x,P.y,P.z],F=s.create$1();M.properties.get("anchor")==="viewport"&&(s.fromRotation(F,-i.transform.angle),s.transformMat3(R,R,F));const B=M.properties.get("color"),O=i.transform,A={u_matrix:l,u_lightpos:R,u_lightintensity:M.properties.get("intensity"),u_lightcolor:[B.r,B.g,B.b],u_vertical_gradient:+n,u_opacity:h,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Sc,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_ao:p,u_edge_radius:m};return O.projection.name==="globe"&&(A.u_tile_id=[_.canonical.x,_.canonical.y,1<<_.canonical.z],A.u_zoom_transition=v,A.u_inv_rot_matrix=T,A.u_merc_center=E,A.u_up_dir=O.projection.upVector(new s.CanonicalTileID(0,0,0),E[0]*s.EXTENT,E[1]*s.EXTENT),A.u_height_lift=y),A},Mc=(l,i,n,h,p,m,_,y,v,E,T,M)=>{const P=il(l,i,n,h,p,m,_,v,E,T,M),R={u_height_factor:-Math.pow(2,_.overscaledZ)/y.tileSize/8};return s.extend(P,oa(i,y),R)},Vo=l=>({u_matrix:l}),ol=(l,i,n)=>s.extend(Vo(l),oa(i,n)),Zh=(l,i)=>({u_matrix:l,u_world:i}),Xh=(l,i,n,h)=>s.extend(ol(l,i,n),{u_world:h}),Wh=s.create(),nl=(l,i,n,h,p,m)=>{const _=l.transform,y=_.projection.name==="globe";let v;if(m.paint.get("circle-pitch-alignment")==="map")if(y){const T=s.globePixelsToTileUnits(_.zoom,i.canonical)*_._pixelsPerMercatorPixel;v=Float32Array.from([T,0,0,T])}else v=_.calculatePixelsToTileUnitsMatrix(n);else v=new Float32Array([_.pixelsToGLUnits[0],0,0,_.pixelsToGLUnits[1]]);const E={u_camera_to_center_distance:_.cameraToCenterDistance,u_matrix:l.translatePosMatrix(i.projMatrix,n,m.paint.get("circle-translate"),m.paint.get("circle-translate-anchor")),u_device_pixel_ratio:s.exported.devicePixelRatio,u_extrude_scale:v,u_inv_rot_matrix:Wh,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(y){E.u_inv_rot_matrix=h,E.u_merc_center=p,E.u_tile_id=[i.canonical.x,i.canonical.y,1<<i.canonical.z],E.u_zoom_transition=s.globeToMercatorTransition(_.zoom);const T=p[0]*s.EXTENT,M=p[1]*s.EXTENT;E.u_up_dir=_.projection.upVector(new s.CanonicalTileID(0,0,0),T,M)}return E},al=l=>{const i=[];return l.paint.get("circle-pitch-alignment")==="map"&&i.push("PITCH_WITH_MAP"),l.paint.get("circle-pitch-scale")==="map"&&i.push("SCALE_WITH_MAP"),i},sl=(l,i,n,h)=>{const p=s.EXTENT/n.tileSize;return{u_matrix:l,u_camera_to_center_distance:i.getCameraToCenterDistance(h),u_extrude_scale:[i.pixelsToGLUnits[0]/p,i.pixelsToGLUnits[1]/p]}},Wa=(l,i,n=1)=>({u_matrix:l,u_color:i,u_overlay:0,u_overlay_scale:n}),Ac=s.create(),Ic=(l,i,n,h,p,m,_)=>{const y=l.transform,v=y.projection.name==="globe",E=v?s.globePixelsToTileUnits(y.zoom,i.canonical)*y._pixelsPerMercatorPixel:rr(n,1,m),T={u_matrix:i.projMatrix,u_extrude_scale:E,u_intensity:_,u_inv_rot_matrix:Ac,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(v){T.u_inv_rot_matrix=h,T.u_merc_center=p,T.u_tile_id=[i.canonical.x,i.canonical.y,1<<i.canonical.z],T.u_zoom_transition=s.globeToMercatorTransition(y.zoom);const M=p[0]*s.EXTENT,P=p[1]*s.EXTENT;T.u_up_dir=y.projection.upVector(new s.CanonicalTileID(0,0,0),M,P)}return T},Yh=(l,i,n,h,p,m,_)=>{const y=l.transform,v=y.calculatePixelsToTileUnitsMatrix(i);return{u_matrix:ll(l,i,n,h),u_pixels_to_tile_units:v,u_device_pixel_ratio:m,u_units_to_pixels:[1/y.pixelsToGLUnits[0],1/y.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:p,u_texsize:aa(n)?i.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:_n(i,l.transform),u_alpha_discard_threshold:0,u_trim_offset:_}},na=(l,i,n,h,p)=>{const m=l.transform;return{u_matrix:ll(l,i,n,h),u_texsize:i.imageAtlasTexture.size,u_pixels_to_tile_units:m.calculatePixelsToTileUnitsMatrix(i),u_device_pixel_ratio:p,u_image:0,u_tile_units_to_pixels:_n(i,m),u_units_to_pixels:[1/m.pixelsToGLUnits[0],1/m.pixelsToGLUnits[1]],u_alpha_discard_threshold:0}};function _n(l,i){return 1/rr(l,1,i.tileZoom)}function ll(l,i,n,h){return l.translatePosMatrix(h||i.tileID.projMatrix,i,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}function aa(l){const i=l.paint.get("line-dasharray").value;return i.value||i.kind!=="constant"}const cl=(l,i,n,h,p,m)=>{return{u_matrix:l,u_tl_parent:i,u_scale_parent:n,u_fade_t:h.mix,u_opacity:h.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:(y=p.paint.get("raster-saturation"),y>0?1-1/(1.001-y):-y),u_contrast_factor:(_=p.paint.get("raster-contrast"),_>0?1/(1-_):1+_),u_spin_weights:Fi(p.paint.get("raster-hue-rotate")),u_perspective_transform:m};var _,y};function Fi(l){l*=Math.PI/180;const i=Math.sin(l),n=Math.cos(l);return[(2*n+1)/3,(-Math.sqrt(3)*i-n+1)/3,(Math.sqrt(3)*i-n+1)/3]}const Ya=s.create(),hl=(l,i,n,h,p,m,_,y,v,E,T,M,P,R,F,B)=>{const O=p.transform,A={u_is_size_zoom_constant:+(l==="constant"||l==="source"),u_is_size_feature_constant:+(l==="constant"||l==="camera"),u_size_t:i?i.uSizeT:0,u_size:i?i.uSize:0,u_camera_to_center_distance:O.cameraToCenterDistance,u_rotate_symbol:+n,u_aspect_ratio:O.width/O.height,u_fade_change:p.options.fadeDuration?p.symbolFadeChange:1,u_matrix:m,u_label_plane_matrix:_,u_coord_matrix:y,u_is_text:+v,u_pitch_with_map:+h,u_texsize:E,u_texture:0,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Ya,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:Ya,u_up_vector:[0,-1,0]};return B.name==="globe"&&(A.u_tile_id=[T.canonical.x,T.canonical.y,1<<T.canonical.z],A.u_zoom_transition=M,A.u_inv_rot_matrix=R,A.u_merc_center=P,A.u_camera_forward=O._camera.forward(),A.u_ecef_origin=s.globeECEFOrigin(O.globeMatrix,T.toUnwrapped()),A.u_tile_matrix=Float32Array.from(O.globeMatrix),A.u_up_vector=F),A},Ha=(l,i,n,h,p,m,_,y,v,E,T,M,P,R,F,B,O)=>s.extend(hl(l,i,n,h,p,m,_,y,v,E,M,P,R,F,B,O),{u_gamma_scale:h?p.transform.cameraToCenterDistance*Math.cos(p.terrain?0:p.transform._pitch):1,u_device_pixel_ratio:s.exported.devicePixelRatio,u_is_halo:+T}),Cc=(l,i,n,h,p,m,_,y,v,E,T,M,P,R,F,B)=>s.extend(Ha(l,i,n,h,p,m,_,y,!0,v,!0,T,M,P,R,F,B),{u_texsize_icon:E,u_texture_icon:1}),ul=(l,i,n)=>({u_matrix:l,u_opacity:i,u_color:n}),Hh=(l,i,n,h,p)=>s.extend(function(m,_,y){const v=_.imageManager.getPattern(m.toString()),{width:E,height:T}=_.imageManager.getPixelSize(),M=Math.pow(2,y.tileID.overscaledZ),P=y.tileSize*Math.pow(2,_.transform.tileZoom)/M,R=P*(y.tileID.canonical.x+y.tileID.wrap*M),F=P*y.tileID.canonical.y;return{u_image:0,u_pattern_tl:v.tl,u_pattern_br:v.br,u_texsize:[E,T],u_pattern_size:v.displaySize,u_tile_units_to_pixels:1/rr(y,1,_.transform.tileZoom),u_pixel_coord_upper:[R>>16,F>>16],u_pixel_coord_lower:[65535&R,65535&F]}}(h,n,p),{u_matrix:l,u_opacity:i}),pl={fillExtrusion:l=>({u_matrix:new s.UniformMatrix4f(l),u_lightpos:new s.Uniform3f(l),u_lightintensity:new s.Uniform1f(l),u_lightcolor:new s.Uniform3f(l),u_vertical_gradient:new s.Uniform1f(l),u_opacity:new s.Uniform1f(l),u_edge_radius:new s.Uniform1f(l),u_ao:new s.Uniform2f(l),u_tile_id:new s.Uniform3f(l),u_zoom_transition:new s.Uniform1f(l),u_inv_rot_matrix:new s.UniformMatrix4f(l),u_merc_center:new s.Uniform2f(l),u_up_dir:new s.Uniform3f(l),u_height_lift:new s.Uniform1f(l)}),fillExtrusionPattern:l=>({u_matrix:new s.UniformMatrix4f(l),u_lightpos:new s.Uniform3f(l),u_lightintensity:new s.Uniform1f(l),u_lightcolor:new s.Uniform3f(l),u_vertical_gradient:new s.Uniform1f(l),u_height_factor:new s.Uniform1f(l),u_edge_radius:new s.Uniform1f(l),u_ao:new s.Uniform2f(l),u_tile_id:new s.Uniform3f(l),u_zoom_transition:new s.Uniform1f(l),u_inv_rot_matrix:new s.UniformMatrix4f(l),u_merc_center:new s.Uniform2f(l),u_up_dir:new s.Uniform3f(l),u_height_lift:new s.Uniform1f(l),u_image:new s.Uniform1i(l),u_texsize:new s.Uniform2f(l),u_pixel_coord_upper:new s.Uniform2f(l),u_pixel_coord_lower:new s.Uniform2f(l),u_tile_units_to_pixels:new s.Uniform1f(l),u_opacity:new s.Uniform1f(l)}),fill:l=>({u_matrix:new s.UniformMatrix4f(l)}),fillPattern:l=>({u_matrix:new s.UniformMatrix4f(l),u_image:new s.Uniform1i(l),u_texsize:new s.Uniform2f(l),u_pixel_coord_upper:new s.Uniform2f(l),u_pixel_coord_lower:new s.Uniform2f(l),u_tile_units_to_pixels:new s.Uniform1f(l)}),fillOutline:l=>({u_matrix:new s.UniformMatrix4f(l),u_world:new s.Uniform2f(l)}),fillOutlinePattern:l=>({u_matrix:new s.UniformMatrix4f(l),u_world:new s.Uniform2f(l),u_image:new s.Uniform1i(l),u_texsize:new s.Uniform2f(l),u_pixel_coord_upper:new s.Uniform2f(l),u_pixel_coord_lower:new s.Uniform2f(l),u_tile_units_to_pixels:new s.Uniform1f(l)}),circle:l=>({u_camera_to_center_distance:new s.Uniform1f(l),u_extrude_scale:new s.UniformMatrix2f(l),u_device_pixel_ratio:new s.Uniform1f(l),u_matrix:new s.UniformMatrix4f(l),u_inv_rot_matrix:new s.UniformMatrix4f(l),u_merc_center:new s.Uniform2f(l),u_tile_id:new s.Uniform3f(l),u_zoom_transition:new s.Uniform1f(l),u_up_dir:new s.Uniform3f(l)}),collisionBox:l=>({u_matrix:new s.UniformMatrix4f(l),u_camera_to_center_distance:new s.Uniform1f(l),u_extrude_scale:new s.Uniform2f(l)}),collisionCircle:l=>({u_matrix:new s.UniformMatrix4f(l),u_inv_matrix:new s.UniformMatrix4f(l),u_camera_to_center_distance:new s.Uniform1f(l),u_viewport_size:new s.Uniform2f(l)}),debug:l=>({u_color:new s.UniformColor(l),u_matrix:new s.UniformMatrix4f(l),u_overlay:new s.Uniform1i(l),u_overlay_scale:new s.Uniform1f(l)}),clippingMask:l=>({u_matrix:new s.UniformMatrix4f(l)}),heatmap:l=>({u_extrude_scale:new s.Uniform1f(l),u_intensity:new s.Uniform1f(l),u_matrix:new s.UniformMatrix4f(l),u_inv_rot_matrix:new s.UniformMatrix4f(l),u_merc_center:new s.Uniform2f(l),u_tile_id:new s.Uniform3f(l),u_zoom_transition:new s.Uniform1f(l),u_up_dir:new s.Uniform3f(l)}),heatmapTexture:l=>({u_image:new s.Uniform1i(l),u_color_ramp:new s.Uniform1i(l),u_opacity:new s.Uniform1f(l)}),hillshade:l=>({u_matrix:new s.UniformMatrix4f(l),u_image:new s.Uniform1i(l),u_latrange:new s.Uniform2f(l),u_light:new s.Uniform2f(l),u_shadow:new s.UniformColor(l),u_highlight:new s.UniformColor(l),u_accent:new s.UniformColor(l)}),hillshadePrepare:l=>({u_matrix:new s.UniformMatrix4f(l),u_image:new s.Uniform1i(l),u_dimension:new s.Uniform2f(l),u_zoom:new s.Uniform1f(l),u_unpack:new s.Uniform4f(l)}),line:l=>({u_matrix:new s.UniformMatrix4f(l),u_pixels_to_tile_units:new s.UniformMatrix2f(l),u_device_pixel_ratio:new s.Uniform1f(l),u_units_to_pixels:new s.Uniform2f(l),u_dash_image:new s.Uniform1i(l),u_gradient_image:new s.Uniform1i(l),u_image_height:new s.Uniform1f(l),u_texsize:new s.Uniform2f(l),u_tile_units_to_pixels:new s.Uniform1f(l),u_alpha_discard_threshold:new s.Uniform1f(l),u_trim_offset:new s.Uniform2f(l)}),linePattern:l=>({u_matrix:new s.UniformMatrix4f(l),u_texsize:new s.Uniform2f(l),u_pixels_to_tile_units:new s.UniformMatrix2f(l),u_device_pixel_ratio:new s.Uniform1f(l),u_image:new s.Uniform1i(l),u_units_to_pixels:new s.Uniform2f(l),u_tile_units_to_pixels:new s.Uniform1f(l),u_alpha_discard_threshold:new s.Uniform1f(l)}),raster:l=>({u_matrix:new s.UniformMatrix4f(l),u_tl_parent:new s.Uniform2f(l),u_scale_parent:new s.Uniform1f(l),u_fade_t:new s.Uniform1f(l),u_opacity:new s.Uniform1f(l),u_image0:new s.Uniform1i(l),u_image1:new s.Uniform1i(l),u_brightness_low:new s.Uniform1f(l),u_brightness_high:new s.Uniform1f(l),u_saturation_factor:new s.Uniform1f(l),u_contrast_factor:new s.Uniform1f(l),u_spin_weights:new s.Uniform3f(l),u_perspective_transform:new s.Uniform2f(l)}),symbolIcon:l=>({u_is_size_zoom_constant:new s.Uniform1i(l),u_is_size_feature_constant:new s.Uniform1i(l),u_size_t:new s.Uniform1f(l),u_size:new s.Uniform1f(l),u_camera_to_center_distance:new s.Uniform1f(l),u_rotate_symbol:new s.Uniform1i(l),u_aspect_ratio:new s.Uniform1f(l),u_fade_change:new s.Uniform1f(l),u_matrix:new s.UniformMatrix4f(l),u_label_plane_matrix:new s.UniformMatrix4f(l),u_coord_matrix:new s.UniformMatrix4f(l),u_is_text:new s.Uniform1i(l),u_pitch_with_map:new s.Uniform1i(l),u_texsize:new s.Uniform2f(l),u_tile_id:new s.Uniform3f(l),u_zoom_transition:new s.Uniform1f(l),u_inv_rot_matrix:new s.UniformMatrix4f(l),u_merc_center:new s.Uniform2f(l),u_camera_forward:new s.Uniform3f(l),u_tile_matrix:new s.UniformMatrix4f(l),u_up_vector:new s.Uniform3f(l),u_ecef_origin:new s.Uniform3f(l),u_texture:new s.Uniform1i(l)}),symbolSDF:l=>({u_is_size_zoom_constant:new s.Uniform1i(l),u_is_size_feature_constant:new s.Uniform1i(l),u_size_t:new s.Uniform1f(l),u_size:new s.Uniform1f(l),u_camera_to_center_distance:new s.Uniform1f(l),u_rotate_symbol:new s.Uniform1i(l),u_aspect_ratio:new s.Uniform1f(l),u_fade_change:new s.Uniform1f(l),u_matrix:new s.UniformMatrix4f(l),u_label_plane_matrix:new s.UniformMatrix4f(l),u_coord_matrix:new s.UniformMatrix4f(l),u_is_text:new s.Uniform1i(l),u_pitch_with_map:new s.Uniform1i(l),u_texsize:new s.Uniform2f(l),u_texture:new s.Uniform1i(l),u_gamma_scale:new s.Uniform1f(l),u_device_pixel_ratio:new s.Uniform1f(l),u_tile_id:new s.Uniform3f(l),u_zoom_transition:new s.Uniform1f(l),u_inv_rot_matrix:new s.UniformMatrix4f(l),u_merc_center:new s.Uniform2f(l),u_camera_forward:new s.Uniform3f(l),u_tile_matrix:new s.UniformMatrix4f(l),u_up_vector:new s.Uniform3f(l),u_ecef_origin:new s.Uniform3f(l),u_is_halo:new s.Uniform1i(l)}),symbolTextAndIcon:l=>({u_is_size_zoom_constant:new s.Uniform1i(l),u_is_size_feature_constant:new s.Uniform1i(l),u_size_t:new s.Uniform1f(l),u_size:new s.Uniform1f(l),u_camera_to_center_distance:new s.Uniform1f(l),u_rotate_symbol:new s.Uniform1i(l),u_aspect_ratio:new s.Uniform1f(l),u_fade_change:new s.Uniform1f(l),u_matrix:new s.UniformMatrix4f(l),u_label_plane_matrix:new s.UniformMatrix4f(l),u_coord_matrix:new s.UniformMatrix4f(l),u_is_text:new s.Uniform1i(l),u_pitch_with_map:new s.Uniform1i(l),u_texsize:new s.Uniform2f(l),u_texsize_icon:new s.Uniform2f(l),u_texture:new s.Uniform1i(l),u_texture_icon:new s.Uniform1i(l),u_gamma_scale:new s.Uniform1f(l),u_device_pixel_ratio:new s.Uniform1f(l),u_is_halo:new s.Uniform1i(l)}),background:l=>({u_matrix:new s.UniformMatrix4f(l),u_opacity:new s.Uniform1f(l),u_color:new s.UniformColor(l)}),backgroundPattern:l=>({u_matrix:new s.UniformMatrix4f(l),u_opacity:new s.Uniform1f(l),u_image:new s.Uniform1i(l),u_pattern_tl:new s.Uniform2f(l),u_pattern_br:new s.Uniform2f(l),u_texsize:new s.Uniform2f(l),u_pattern_size:new s.Uniform2f(l),u_pixel_coord_upper:new s.Uniform2f(l),u_pixel_coord_lower:new s.Uniform2f(l),u_tile_units_to_pixels:new s.Uniform1f(l)}),terrainRaster:Qs,terrainDepth:Qs,skybox:l=>({u_matrix:new s.UniformMatrix4f(l),u_sun_direction:new s.Uniform3f(l),u_cubemap:new s.Uniform1i(l),u_opacity:new s.Uniform1f(l),u_temporal_offset:new s.Uniform1f(l)}),skyboxGradient:l=>({u_matrix:new s.UniformMatrix4f(l),u_color_ramp:new s.Uniform1i(l),u_center_direction:new s.Uniform3f(l),u_radius:new s.Uniform1f(l),u_opacity:new s.Uniform1f(l),u_temporal_offset:new s.Uniform1f(l)}),skyboxCapture:l=>({u_matrix_3f:new s.UniformMatrix3f(l),u_sun_direction:new s.Uniform3f(l),u_sun_intensity:new s.Uniform1f(l),u_color_tint_r:new s.Uniform4f(l),u_color_tint_m:new s.Uniform4f(l),u_luminance:new s.Uniform1f(l)}),globeRaster:l=>({u_proj_matrix:new s.UniformMatrix4f(l),u_globe_matrix:new s.UniformMatrix4f(l),u_normalize_matrix:new s.UniformMatrix4f(l),u_merc_matrix:new s.UniformMatrix4f(l),u_zoom_transition:new s.Uniform1f(l),u_merc_center:new s.Uniform2f(l),u_image0:new s.Uniform1i(l),u_grid_matrix:new s.UniformMatrix3f(l),u_skirt_height:new s.Uniform1f(l),u_frustum_tl:new s.Uniform3f(l),u_frustum_tr:new s.Uniform3f(l),u_frustum_br:new s.Uniform3f(l),u_frustum_bl:new s.Uniform3f(l),u_globe_pos:new s.Uniform3f(l),u_globe_radius:new s.Uniform1f(l),u_viewport:new s.Uniform2f(l)}),globeAtmosphere:l=>({u_frustum_tl:new s.Uniform3f(l),u_frustum_tr:new s.Uniform3f(l),u_frustum_br:new s.Uniform3f(l),u_frustum_bl:new s.Uniform3f(l),u_horizon:new s.Uniform1f(l),u_transition:new s.Uniform1f(l),u_fadeout_range:new s.Uniform1f(l),u_color:new s.Uniform4f(l),u_high_color:new s.Uniform4f(l),u_space_color:new s.Uniform4f(l),u_star_intensity:new s.Uniform1f(l),u_star_density:new s.Uniform1f(l),u_star_size:new s.Uniform1f(l),u_temporal_offset:new s.Uniform1f(l),u_horizon_angle:new s.Uniform1f(l),u_rotation_matrix:new s.UniformMatrix4f(l)})};let Ka;function sa(l,i,n,h,p,m,_){const y=l.context,v=y.gl,E=l.transform,T=l.useProgram("collisionBox"),M=[];let P=0,R=0;for(let V=0;V<h.length;V++){const H=h[V],J=i.getTile(H),K=J.getBucket(n);if(!K)continue;const re=fi(H,K,E);let te=re;p[0]===0&&p[1]===0||(te=l.translatePosMatrix(re,J,p,m));const le=_?K.textCollisionBox:K.iconCollisionBox,Ee=K.collisionCircleArray;if(Ee.length>0){const ne=s.create(),_e=te;s.mul(ne,K.placementInvProjMatrix,E.glCoordMatrix),s.mul(ne,ne,K.placementViewportMatrix),M.push({circleArray:Ee,circleOffset:R,transform:_e,invTransform:ne,projection:K.getProjection()}),P+=Ee.length/4,R=P}le&&(l.terrain&&l.terrain.setupElevationDraw(J,T),T.draw(y,v.LINES,s.DepthMode.disabled,s.StencilMode.disabled,l.colorModeForRenderPass(),s.CullFaceMode.disabled,sl(te,E,J,K.getProjection()),n.id,le.layoutVertexBuffer,le.indexBuffer,le.segments,null,E.zoom,null,[le.collisionVertexBuffer,le.collisionVertexBufferExt]))}if(!_||!M.length)return;const F=l.useProgram("collisionCircle"),B=new s.StructArrayLayout2f1f2i16;B.resize(4*P),B._trim();let O=0;for(const V of M)for(let H=0;H<V.circleArray.length/4;H++){const J=4*H,K=V.circleArray[J+0],re=V.circleArray[J+1],te=V.circleArray[J+2],le=V.circleArray[J+3];B.emplace(O++,K,re,te,le,0),B.emplace(O++,K,re,te,le,1),B.emplace(O++,K,re,te,le,2),B.emplace(O++,K,re,te,le,3)}(!Ka||Ka.length<2*P)&&(Ka=function(V){const H=2*V,J=new s.StructArrayLayout3ui6;J.resize(H),J._trim();for(let K=0;K<H;K++){const re=6*K;J.uint16[re+0]=4*K+0,J.uint16[re+1]=4*K+1,J.uint16[re+2]=4*K+2,J.uint16[re+3]=4*K+2,J.uint16[re+4]=4*K+3,J.uint16[re+5]=4*K+0}return J}(P));const A=y.createIndexBuffer(Ka,!0),L=y.createVertexBuffer(B,s.collisionCircleLayout.members,!0);for(const V of M){const H={u_matrix:V.transform,u_inv_matrix:V.invTransform,u_camera_to_center_distance:(N=E).getCameraToCenterDistance(V.projection),u_viewport_size:[N.width,N.height]};F.draw(y,v.TRIANGLES,s.DepthMode.disabled,s.StencilMode.disabled,l.colorModeForRenderPass(),s.CullFaceMode.disabled,H,n.id,L,A,s.SegmentVector.simpleSegment(0,2*V.circleOffset,V.circleArray.length,V.circleArray.length/2),null,E.zoom)}var N;L.destroy(),A.destroy()}const zc=s.create();function dl({width:l,height:i,anchor:n,textOffset:h,textScale:p},m){const{horizontalAlign:_,verticalAlign:y}=s.getAnchorAlignment(n),v=-(_-.5)*l,E=-(y-.5)*i,T=s.evaluateVariableOffset(n,h);return new s.Point((v/p+T[0])*m,(E/p+T[1])*m)}function Kh(l,i,n,h,p,m,_,y,v,E,T){const M=l.text.placedSymbolArray,P=l.text.dynamicLayoutVertexArray,R=l.icon.dynamicLayoutVertexArray,F={},B=l.getProjection(),O=Kt(y,B,m),A=m.elevation,L=B.upVectorScale(y.canonical,m.center.lat,m.worldSize).metersToTile;P.clear();for(let N=0;N<M.length;N++){const V=M.get(N),{tileAnchorX:H,tileAnchorY:J,numGlyphs:K}=V,re=V.hidden||!V.crossTileID||l.allowVerticalPlacement&&!V.placedOrientation?null:h[V.crossTileID];if(re){let te=0,le=0,Ee=0;if(A){const Me=A?A.getAtTileOffset(y,H,J):0,[qe,Qe,je]=B.upVector(y.canonical,H,J);te=Me*qe*L,le=Me*Qe*L,Ee=Me*je*L}let[ne,_e,he,Te]=Ar(V.projectedAnchorX+te,V.projectedAnchorY+le,V.projectedAnchorZ+Ee,n?O:_);const se=_c(m.getCameraToCenterDistance(B),Te);let ge=p.evaluateSizeForFeature(l.textSizeData,E,V)*se/s.ONE_EM;n&&(ge*=l.tilePixelRatio/v);const Se=dl(re,ge);n?({x:ne,y:_e,z:he}=B.projectTilePoint(H+Se.x,J+Se.y,y.canonical),[ne,_e,he]=Ar(ne+te,_e+le,he+Ee,_)):(i&&Se._rotate(-m.angle),ne+=Se.x,_e+=Se.y,he=0);const we=l.allowVerticalPlacement&&V.placedOrientation===s.WritingMode.vertical?Math.PI/2:0;for(let Me=0;Me<K;Me++)s.addDynamicAttributes(P,ne,_e,he,we);T&&V.associatedIconIndex>=0&&(F[V.associatedIconIndex]={x:ne,y:_e,z:he,angle:we})}else Si(K,P)}if(T){R.clear();const N=l.icon.placedSymbolArray;for(let V=0;V<N.length;V++){const H=N.get(V),{numGlyphs:J}=H,K=F[V];if(H.hidden||!K)Si(J,R);else{const{x:re,y:te,z:le,angle:Ee}=K;for(let ne=0;ne<J;ne++)s.addDynamicAttributes(R,re,te,le,Ee)}}l.icon.dynamicLayoutVertexBuffer.updateData(R)}l.text.dynamicLayoutVertexBuffer.updateData(P)}function ml(l,i,n){return n.iconsInText&&i?"symbolTextAndIcon":l?"symbolSDF":"symbolIcon"}function Pc(l,i,n,h,p,m,_,y,v,E,T,M){const P=l.context,R=P.gl,F=l.transform,B=y==="map",O=v==="map",A=B&&n.layout.get("symbol-placement")!=="point",L=B&&!O&&!A,N=n.layout.get("symbol-sort-key").constantOr(1)!==void 0;let V=!1;const H=l.depthModeForSublayer(0,s.DepthMode.ReadOnly),J=[s.mercatorXfromLng(F.center.lng),s.mercatorYfromLat(F.center.lat)],K=n.layout.get("text-variable-anchor"),re=F.projection.name==="globe",te=[],le=[0,-1,0];let Ee=le;!re&&!F.mercatorFromTransition||B||(Ee=function(ne){const _e=ne._camera.getWorldToCamera(ne.worldSize,1),he=s.multiply([],_e,ne.globeMatrix);s.invert(he,he);const Te=[0,0,0],se=[0,1,0,0];return s.transformMat4$1(se,se,he),Te[0]=se[0],Te[1]=se[1],Te[2]=se[2],s.normalize(Te,Te),Te}(F));for(const ne of h){const _e=i.getTile(ne),he=_e.getBucket(n);if(!he||he.projection.name==="mercator"&&re)continue;const Te=p?he.text:he.icon;if(!Te||he.fullyClipped||!Te.segments.get().length)continue;const se=Te.programConfigurations.get(n.id),ge=p||he.sdfIcons,Se=p?he.textSizeData:he.iconSizeData,we=O||F.pitch!==0,Me=s.evaluateSizeForZoom(Se,F.zoom);let qe,Qe,je,We,mt=[0,0],ut=null;if(p)Qe=_e.glyphAtlasTexture,je=R.LINEAR,qe=_e.glyphAtlasTexture.size,he.iconsInText&&(mt=_e.imageAtlasTexture.size,ut=_e.imageAtlasTexture,We=we||l.options.rotating||l.options.zooming||Se.kind==="composite"||Se.kind==="camera"?R.LINEAR:R.NEAREST);else{const io=n.layout.get("icon-size").constantOr(0)!==1||he.iconsNeedLinear;Qe=_e.imageAtlasTexture,je=ge||l.options.rotating||l.options.zooming||io||we?R.LINEAR:R.NEAREST,qe=_e.imageAtlasTexture.size}const $e=he.projection.name==="globe",It=$e?Ee:le,Lt=$e?s.globeToMercatorTransition(F.zoom):0,Rt=Kt(ne,he.getProjection(),F),Bt=F.calculatePixelsToTileUnitsMatrix(_e),Gr=me(Rt,_e.tileID.canonical,O,B,F,he.getProjection(),Bt),Cr=l.terrain&&O&&A?s.invert(s.create(),Gr):zc,xi=mr(Rt,_e.tileID.canonical,O,B,F,he.getProjection(),Bt),Ui=K&&he.hasTextData(),Jt=n.layout.get("icon-text-fit")!=="none"&&Ui&&he.hasIconData();if(A){const io=F.elevation,To=io?io.getAtTileOffsetFunc(ne,F.center.lat,F.worldSize,he.getProjection()):null,Xo=Yi(Rt,_e.tileID.canonical,O,B,F,he.getProjection(),Bt);js(he,Rt,l,p,Xo,xi,O,E,To,ne)}const Ft=A||p&&K||Jt,kt=l.translatePosMatrix(Rt,_e,m,_),fr=Ft?zc:Gr,Wr=l.translatePosMatrix(xi,_e,m,_,!0),Yt=he.getProjection().createInversionMatrix(F,ne.canonical),ei=[];l.terrainRenderModeElevated()&&O&&ei.push("PITCH_WITH_MAP_TERRAIN"),$e&&ei.push("PROJECTION_GLOBE_VIEW"),Ft&&ei.push("PROJECTED_POS_ON_VIEWPORT");const ds=ge&&n.paint.get(p?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Zo;Zo=ge?he.iconsInText?Cc(Se.kind,Me,L,O,l,kt,fr,Wr,qe,mt,ne,Lt,J,Yt,It,he.getProjection()):Ha(Se.kind,Me,L,O,l,kt,fr,Wr,p,qe,!0,ne,Lt,J,Yt,It,he.getProjection()):hl(Se.kind,Me,L,O,l,kt,fr,Wr,p,qe,ne,Lt,J,Yt,It,he.getProjection());const ya={program:l.useProgram(ml(ge,p,he),se,ei),buffers:Te,uniformValues:Zo,atlasTexture:Qe,atlasTextureIcon:ut,atlasInterpolation:je,atlasInterpolationIcon:We,isSDF:ge,hasHalo:ds,tile:_e,labelPlaneMatrixInv:Cr};if(N&&he.canOverlap){V=!0;const io=Te.segments.get();for(const To of io)te.push({segments:new s.SegmentVector([To]),sortKey:To.sortKey,state:ya})}else te.push({segments:Te.segments,sortKey:0,state:ya})}V&&te.sort((ne,_e)=>ne.sortKey-_e.sortKey);for(const ne of te){const _e=ne.state;if(l.terrain&&l.terrain.setupElevationDraw(_e.tile,_e.program,{useDepthForOcclusion:!re,labelPlaneMatrixInv:_e.labelPlaneMatrixInv}),P.activeTexture.set(R.TEXTURE0),_e.atlasTexture.bind(_e.atlasInterpolation,R.CLAMP_TO_EDGE),_e.atlasTextureIcon&&(P.activeTexture.set(R.TEXTURE1),_e.atlasTextureIcon&&_e.atlasTextureIcon.bind(_e.atlasInterpolationIcon,R.CLAMP_TO_EDGE)),_e.isSDF){const he=_e.uniformValues;_e.hasHalo&&(he.u_is_halo=1,la(_e.buffers,ne.segments,n,l,_e.program,H,T,M,he)),he.u_is_halo=0}la(_e.buffers,ne.segments,n,l,_e.program,H,T,M,_e.uniformValues)}}function la(l,i,n,h,p,m,_,y,v){const E=h.context,T=[l.dynamicLayoutVertexBuffer,l.opacityVertexBuffer,l.globeExtVertexBuffer];p.draw(E,E.gl.TRIANGLES,m,_,y,s.CullFaceMode.disabled,v,n.id,l.layoutVertexBuffer,l.indexBuffer,i,n.paint,h.transform.zoom,l.programConfigurations.get(n.id),T)}function Dc(l,i,n,h,p,m,_){const y=l.context.gl,v=n.paint.get("fill-pattern"),E=v&&v.constantOr(1);let T,M,P,R,F;_?(M=E&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",T=y.LINES):(M=E?"fillPattern":"fill",T=y.TRIANGLES);for(const B of h){const O=i.getTile(B);if(E&&!O.patternsLoaded())continue;const A=O.getBucket(n);if(!A)continue;l.prepareDrawTile();const L=A.programConfigurations.get(n.id),N=l.useProgram(M,L);E&&(l.context.activeTexture.set(y.TEXTURE0),O.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),L.updatePaintBuffers());const V=v.constantOr(null);if(V&&O.imageAtlas){const J=O.imageAtlas.patternPositions[V.toString()];J&&L.setConstantPatternPositions(J)}const H=l.translatePosMatrix(B.projMatrix,O,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(_){R=A.indexBuffer2,F=A.segments2;const J=l.terrain&&l.terrain.renderingToTexture?l.terrain.drapeBufferSize:[y.drawingBufferWidth,y.drawingBufferHeight];P=M==="fillOutlinePattern"&&E?Xh(H,l,O,J):Zh(H,J)}else R=A.indexBuffer,F=A.segments,P=E?ol(H,l,O):Vo(H);l.prepareDrawProgram(l.context,N,B.toUnwrapped()),N.draw(l.context,T,p,l.stencilModeForClipping(B),m,s.CullFaceMode.disabled,P,n.id,A.layoutVertexBuffer,R,F,n.paint,l.transform.zoom,L)}}function Ja(l,i,n,h,p,m,_){const y=l.context,v=y.gl,E=l.transform,T=n.paint.get("fill-extrusion-pattern"),M=T.constantOr(1),P=n.paint.get("fill-extrusion-opacity"),R=[n.paint.get("fill-extrusion-ambient-occlusion-intensity"),n.paint.get("fill-extrusion-ambient-occlusion-radius")],F=n.layout.get("fill-extrusion-edge-radius"),B=F>0&&!n.paint.get("fill-extrusion-rounded-roof"),O=B?0:F,A=E.projection.name==="globe"?s.fillExtrusionHeightLift():0,L=E.projection.name==="globe",N=L?s.globeToMercatorTransition(E.zoom):0,V=[s.mercatorXfromLng(E.center.lng),s.mercatorYfromLat(E.center.lat)],H=[];L&&H.push("PROJECTION_GLOBE_VIEW"),R[0]>0&&H.push("FAUX_AO"),B&&H.push("ZERO_ROOF_RADIUS");for(const J of h){const K=i.getTile(J),re=K.getBucket(n);if(!re||re.projection.name!==E.projection.name)continue;const te=re.programConfigurations.get(n.id),le=l.useProgram(M?"fillExtrusionPattern":"fillExtrusion",te,H);if(l.terrain){const ge=l.terrain;if(l.style.terrainSetForDrapingOnly())ge.setupElevationDraw(K,le,{useMeterToDem:!0});else{if(!re.enableTerrain)continue;if(ge.setupElevationDraw(K,le,{useMeterToDem:!0}),Lc(y,i,J,re,n,ge),!re.centroidVertexBuffer){const Se=le.attributes.a_centroid_pos;Se!==void 0&&v.vertexAttrib2f(Se,0,0)}}}M&&(l.context.activeTexture.set(v.TEXTURE0),K.imageAtlasTexture.bind(v.LINEAR,v.CLAMP_TO_EDGE),te.updatePaintBuffers());const Ee=T.constantOr(null);if(Ee&&K.imageAtlas){const ge=K.imageAtlas.patternPositions[Ee.toString()];ge&&te.setConstantPatternPositions(ge)}const ne=l.translatePosMatrix(J.projMatrix,K,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),_e=E.projection.createInversionMatrix(E,J.canonical),he=n.paint.get("fill-extrusion-vertical-gradient"),Te=M?Mc(ne,l,he,P,R,O,J,K,A,N,V,_e):il(ne,l,he,P,R,O,J,A,N,V,_e);l.prepareDrawProgram(y,le,J.toUnwrapped());const se=[];l.terrain&&se.push(re.centroidVertexBuffer),L&&se.push(re.layoutVertexExtBuffer),le.draw(y,y.gl.TRIANGLES,p,m,_,s.CullFaceMode.backCCW,Te,n.id,re.layoutVertexBuffer,re.indexBuffer,re.segments,n.paint,l.transform.zoom,te,se)}}function Lc(l,i,n,h,p,m){const _=[A=>{let L=A.canonical.x-1,N=A.wrap;return L<0&&(L=(1<<A.canonical.z)-1,N--),new s.OverscaledTileID(A.overscaledZ,N,A.canonical.z,L,A.canonical.y)},A=>{let L=A.canonical.x+1,N=A.wrap;return L===1<<A.canonical.z&&(L=0,N++),new s.OverscaledTileID(A.overscaledZ,N,A.canonical.z,L,A.canonical.y)},A=>new s.OverscaledTileID(A.overscaledZ,A.wrap,A.canonical.z,A.canonical.x,(A.canonical.y===0?1<<A.canonical.z:A.canonical.y)-1),A=>new s.OverscaledTileID(A.overscaledZ,A.wrap,A.canonical.z,A.canonical.x,A.canonical.y===(1<<A.canonical.z)-1?0:A.canonical.y+1)],y=A=>{const L=i.getSource().minzoom,N=H=>{const J=i.getTileByID(H);if(J&&J.hasData())return J.getBucket(p)},V=[0,-1,1];for(const H of V){if(A.overscaledZ+H<L)continue;const J=N(A.calculateScaledKey(A.overscaledZ+H));if(J)return J}},v=[0,0,0],E=(A,L)=>(v[0]=Math.min(A.min.y,L.min.y),v[1]=Math.max(A.max.y,L.max.y),v[2]=s.EXTENT-L.min.x>A.max.x?L.min.x-s.EXTENT:A.max.x,v),T=(A,L)=>(v[0]=Math.min(A.min.x,L.min.x),v[1]=Math.max(A.max.x,L.max.x),v[2]=s.EXTENT-L.min.y>A.max.y?L.min.y-s.EXTENT:A.max.y,v),M=[(A,L)=>E(A,L),(A,L)=>E(L,A),(A,L)=>T(A,L),(A,L)=>T(L,A)],P=new s.Point(0,0);let R,F,B;const O=(A,L,N,V,H)=>{const J=[[V?N:A,V?A:N,0],[V?N:L,V?L:N,0]],K=H<0?s.EXTENT+H:H,re=[V?K:(A+L)/2,V?(A+L)/2:K,0];return N===0&&H<0||N!==0&&H>0?m.getForTilePoints(B,[re],!0,F):J.push(re),m.getForTilePoints(n,J,!0,R),Math.max(J[0][2],J[1][2],re[2])/m.exaggeration()};for(let A=0;A<4;A++){const L=(A<2?1:5)-A,N=h.borders[A];if(N.length===0)continue;const V=B=_[A](n),H=y(V);if(!(H&&H instanceof s.FillExtrusionBucket&&H.enableTerrain)||h.borderDoneWithNeighborZ[A]===H.canonical.z&&H.borderDoneWithNeighborZ[L]===h.canonical.z||(F=m.findDEMTileFor(V),!F||!F.dem))continue;if(!R){const te=m.findDEMTileFor(n);if(!te||!te.dem)return;R=te}const J=H.borders[L];let K=0;const re=H.borderDoneWithNeighborZ[L]!==h.canonical.z;if(h.canonical.z===H.canonical.z){for(let te=0;te<N.length;te++){const le=h.featuresOnBorder[N[te]],Ee=le.borders[A];let ne;for(;K<J.length&&(ne=H.featuresOnBorder[J[K]],!(ne.borders[L][1]>Ee[0]+3));)re&&H.encodeCentroid(void 0,ne,!1),K++;if(ne&&K<J.length){const _e=K;let he=0;for(;!(ne.borders[L][0]>Ee[1]-3)&&(he++,++K!==J.length);)ne=H.featuresOnBorder[J[K]];if(ne=H.featuresOnBorder[J[_e]],le.intersectsCount()>1||ne.intersectsCount()>1||he!==1){he!==1&&(K=_e),h.encodeCentroid(void 0,le,!1),re&&H.encodeCentroid(void 0,ne,!1);continue}const Te=M[A](le,ne),se=A%2?s.EXTENT-1:0;P.x=O(Te[0],Math.min(s.EXTENT-1,Te[1]),se,A<2,Te[2]),P.y=0,h.encodeCentroid(P,le,!1),re&&H.encodeCentroid(P,ne,!1)}else h.encodeCentroid(void 0,le,!1)}h.borderDoneWithNeighborZ[A]=H.canonical.z,h.needsCentroidUpdate=!0,re&&(H.borderDoneWithNeighborZ[L]=h.canonical.z,H.needsCentroidUpdate=!0)}else{for(const te of N)h.encodeCentroid(void 0,h.featuresOnBorder[te],!1);if(re){for(const te of J)H.encodeCentroid(void 0,H.featuresOnBorder[te],!1);H.borderDoneWithNeighborZ[L]=h.canonical.z,H.needsCentroidUpdate=!0}h.borderDoneWithNeighborZ[A]=H.canonical.z,h.needsCentroidUpdate=!0}}(h.needsCentroidUpdate||!h.centroidVertexBuffer&&h.centroidVertexArray.length!==0)&&h.uploadCentroid(l)}const yn=new s.Color(1,0,0,1),Jh=new s.Color(0,1,0,1),Qh=new s.Color(0,0,1,1),eu=new s.Color(1,0,1,1),tu=new s.Color(0,1,1,1);function ru(l,i,n){const h=l.context,p=l.transform,m=h.gl,_=p.projection.name==="globe",y=_?["PROJECTION_GLOBE_VIEW"]:null;let v=n.projMatrix;if(_&&s.globeToMercatorTransition(p.zoom)>0){const le=s.transitionTileAABBinECEF(n.canonical,p),Ee=s.globeDenormalizeECEF(le);v=s.multiply(new Float32Array(16),p.globeMatrix,Ee),s.multiply(v,p.projMatrix,v)}const E=l.useProgram("debug",null,y),T=i.getTileByID(n.key);l.terrain&&l.terrain.setupElevationDraw(T,E);const M=s.DepthMode.disabled,P=s.StencilMode.disabled,R=l.colorModeForRenderPass(),F="$debug";h.activeTexture.set(m.TEXTURE0),l.emptyTexture.bind(m.LINEAR,m.CLAMP_TO_EDGE),_?T._makeGlobeTileDebugBuffers(l.context,p):T._makeDebugTileBoundsBuffers(l.context,p.projection);const B=T._tileDebugBuffer||l.debugBuffer,O=T._tileDebugIndexBuffer||l.debugIndexBuffer,A=T._tileDebugSegments||l.debugSegments;E.draw(h,m.LINE_STRIP,M,P,R,s.CullFaceMode.disabled,Wa(v,s.Color.red),F,B,O,A,null,null,null,[T._globeTileDebugBorderBuffer]);const L=T.latestRawTileData,N=Math.floor((L&&L.byteLength||0)/1024),V=i.getTile(n).tileSize,H=512/Math.min(V,512)*(n.overscaledZ/p.zoom)*.5;let J=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(J+=` => ${n.overscaledZ}`),J+=` ${N}kb`,function(le,Ee){le.initDebugOverlayCanvas();const ne=le.debugOverlayCanvas,_e=le.context.gl,he=le.debugOverlayCanvas.getContext("2d");he.clearRect(0,0,ne.width,ne.height),he.shadowColor="white",he.shadowBlur=2,he.lineWidth=1.5,he.strokeStyle="white",he.textBaseline="top",he.font="bold 36px Open Sans, sans-serif",he.fillText(Ee,5,5),he.strokeText(Ee,5,5),le.debugOverlayTexture.update(ne),le.debugOverlayTexture.bind(_e.LINEAR,_e.CLAMP_TO_EDGE)}(l,J);const K=T._tileDebugTextBuffer||l.debugBuffer,re=T._tileDebugTextIndexBuffer||l.quadTriangleIndexBuffer,te=T._tileDebugTextSegments||l.debugSegments;E.draw(h,m.TRIANGLES,M,P,s.ColorMode.alphaBlended,s.CullFaceMode.disabled,Wa(v,s.Color.transparent,H),F,K,re,te,null,null,null,[T._globeTileDebugTextBuffer])}function Rc(l,i,n,h){xn(l,0,i+n/2,l.transform.width,n,h)}function Qa(l,i,n,h){xn(l,i-n/2,0,n,l.transform.height,h)}function xn(l,i,n,h,p,m){const _=l.context,y=_.gl;y.enable(y.SCISSOR_TEST),y.scissor(i*s.exported.devicePixelRatio,n*s.exported.devicePixelRatio,h*s.exported.devicePixelRatio,p*s.exported.devicePixelRatio),_.clear({color:m}),y.disable(y.SCISSOR_TEST)}const Bc=s.createLayout([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:Fc}=Bc;function to(l,i,n,h){l.emplaceBack(i,n,h)}class es{constructor(i){this.vertexArray=new s.StructArrayLayout3f12,this.indices=new s.StructArrayLayout3ui6,to(this.vertexArray,-1,-1,1),to(this.vertexArray,1,-1,1),to(this.vertexArray,-1,1,1),to(this.vertexArray,1,1,1),to(this.vertexArray,-1,-1,-1),to(this.vertexArray,1,-1,-1),to(this.vertexArray,-1,1,-1),to(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=i.createVertexBuffer(this.vertexArray,Fc),this.indexBuffer=i.createIndexBuffer(this.indices),this.segment=s.SegmentVector.simpleSegment(0,0,36,12)}}function _i(l,i,n,h,p,m){const _=l.gl,y=i.paint.get("sky-atmosphere-color"),v=i.paint.get("sky-atmosphere-halo-color"),E=i.paint.get("sky-atmosphere-sun-intensity"),T=((M,P,R,F,B)=>({u_matrix_3f:M,u_sun_direction:P,u_sun_intensity:R,u_color_tint_r:[F.r,F.g,F.b,F.a],u_color_tint_m:[B.r,B.g,B.b,B.a],u_luminance:5e-5}))(s.fromMat4(s.create$1(),h),p,E,y,v);_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.TEXTURE_CUBE_MAP_POSITIVE_X+m,i.skyboxTexture,0),n.draw(l,_.TRIANGLES,s.DepthMode.disabled,s.StencilMode.disabled,s.ColorMode.unblended,s.CullFaceMode.frontCW,T,"skyboxCapture",i.skyboxGeometry.vertexBuffer,i.skyboxGeometry.indexBuffer,i.skyboxGeometry.segment)}const ca=s.createLayout([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class Oc{constructor(i){const n=new s.StructArrayLayout5f20;n.emplaceBack(-1,1,1,0,0),n.emplaceBack(1,1,1,1,0),n.emplaceBack(1,-1,1,1,1),n.emplaceBack(-1,-1,1,0,1);const h=new s.StructArrayLayout3ui6;h.emplaceBack(0,1,2),h.emplaceBack(2,3,0),this.vertexBuffer=i.createVertexBuffer(n,ca.members),this.indexBuffer=i.createIndexBuffer(h),this.segments=s.SegmentVector.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const Go={symbol:function(l,i,n,h,p){if(l.renderPass!=="translucent")return;const m=s.StencilMode.disabled,_=l.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(y,v,E,T,M,P,R){const F=v.transform,B=M==="map",O=P==="map";for(const A of y){const L=T.getTile(A),N=L.getBucket(E);if(!N||!N.text||!N.text.segments.get().length)continue;const V=s.evaluateSizeForZoom(N.textSizeData,F.zoom),H=Kt(A,N.getProjection(),F),J=F.calculatePixelsToTileUnitsMatrix(L),K=me(H,L.tileID.canonical,O,B,F,N.getProjection(),J),re=E.layout.get("icon-text-fit")!=="none"&&N.hasIconData();if(V){const te=Math.pow(2,F.zoom-L.tileID.overscaledZ);Kh(N,B,O,R,s.symbolSize,F,K,A,te,V,re)}}}(h,l,n,i,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),p),n.paint.get("icon-opacity").constantOr(1)!==0&&Pc(l,i,n,h,!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"),m,_),n.paint.get("text-opacity").constantOr(1)!==0&&Pc(l,i,n,h,!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"),m,_),i.map.showCollisionBoxes&&(sa(l,i,n,h,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),sa(l,i,n,h,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))},circle:function(l,i,n,h){if(l.renderPass!=="translucent")return;const p=n.paint.get("circle-opacity"),m=n.paint.get("circle-stroke-width"),_=n.paint.get("circle-stroke-opacity"),y=n.layout.get("circle-sort-key").constantOr(1)!==void 0;if(p.constantOr(1)===0&&(m.constantOr(1)===0||_.constantOr(1)===0))return;const v=l.context,E=v.gl,T=l.transform,M=l.depthModeForSublayer(0,s.DepthMode.ReadOnly),P=s.StencilMode.disabled,R=l.colorModeForRenderPass(),F=T.projection.name==="globe",B=[s.mercatorXfromLng(T.center.lng),s.mercatorYfromLat(T.center.lat)],O=[];for(let L=0;L<h.length;L++){const N=h[L],V=i.getTile(N),H=V.getBucket(n);if(!H||H.projection.name!==T.projection.name)continue;const J=H.programConfigurations.get(n.id),K=al(n);F&&K.push("PROJECTION_GLOBE_VIEW");const re=l.useProgram("circle",J,K),te=H.layoutVertexBuffer,le=H.globeExtVertexBuffer,Ee=H.indexBuffer,ne=T.projection.createInversionMatrix(T,N.canonical),_e={programConfiguration:J,program:re,layoutVertexBuffer:te,globeExtVertexBuffer:le,indexBuffer:Ee,uniformValues:nl(l,N,V,ne,B,n),tile:V};if(y){const he=H.segments.get();for(const Te of he)O.push({segments:new s.SegmentVector([Te]),sortKey:Te.sortKey,state:_e})}else O.push({segments:H.segments,sortKey:0,state:_e})}y&&O.sort((L,N)=>L.sortKey-N.sortKey);const A={useDepthForOcclusion:!F};for(const L of O){const{programConfiguration:N,program:V,layoutVertexBuffer:H,globeExtVertexBuffer:J,indexBuffer:K,uniformValues:re,tile:te}=L.state,le=L.segments;l.terrain&&l.terrain.setupElevationDraw(te,V,A),l.prepareDrawProgram(v,V,te.tileID.toUnwrapped()),V.draw(v,E.TRIANGLES,M,P,R,s.CullFaceMode.disabled,re,n.id,H,K,le,n.paint,T.zoom,N,[J])}},heatmap:function(l,i,n,h){if(n.paint.get("heatmap-opacity")!==0)if(l.renderPass==="offscreen"){const p=l.context,m=p.gl,_=s.StencilMode.disabled,y=new s.ColorMode([m.ONE,m.ONE],s.Color.transparent,[!0,!0,!0,!0]);(function(R,F,B,O){const A=R.gl,L=F.width*O,N=F.height*O;R.activeTexture.set(A.TEXTURE1),R.viewport.set([0,0,L,N]);let V=B.heatmapFbo;if(!V||V&&(V.width!==L||V.height!==N)){V&&V.destroy();const H=A.createTexture();A.bindTexture(A.TEXTURE_2D,H),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_WRAP_S,A.CLAMP_TO_EDGE),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_WRAP_T,A.CLAMP_TO_EDGE),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_MIN_FILTER,A.LINEAR),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_MAG_FILTER,A.LINEAR),V=B.heatmapFbo=R.createFramebuffer(L,N,!1),function(J,K,re,te,le,Ee){const ne=J.gl;ne.texImage2D(ne.TEXTURE_2D,0,J.isWebGL2&&J.extRenderToTextureHalfFloat?ne.RGBA16F:ne.RGBA,le,Ee,0,ne.RGBA,J.extRenderToTextureHalfFloat?J.isWebGL2?ne.HALF_FLOAT:J.extTextureHalfFloat.HALF_FLOAT_OES:ne.UNSIGNED_BYTE,null),te.colorAttachment.set(re)}(R,0,H,V,L,N)}else A.bindTexture(A.TEXTURE_2D,V.colorAttachment.get()),R.bindFramebuffer.set(V.framebuffer)})(p,l,n,l.transform.projection.name==="globe"?.5:.25),p.clear({color:s.Color.transparent});const v=l.transform,E=v.projection.name==="globe",T=E?["PROJECTION_GLOBE_VIEW"]:null,M=E?s.CullFaceMode.frontCCW:s.CullFaceMode.disabled,P=[s.mercatorXfromLng(v.center.lng),s.mercatorYfromLat(v.center.lat)];for(let R=0;R<h.length;R++){const F=h[R];if(i.hasRenderableParent(F))continue;const B=i.getTile(F),O=B.getBucket(n);if(!O||O.projection.name!==v.projection.name)continue;const A=O.programConfigurations.get(n.id),L=l.useProgram("heatmap",A,T),{zoom:N}=l.transform;l.terrain&&l.terrain.setupElevationDraw(B,L),l.prepareDrawProgram(p,L,F.toUnwrapped());const V=v.projection.createInversionMatrix(v,F.canonical);L.draw(p,m.TRIANGLES,s.DepthMode.disabled,_,y,M,Ic(l,F,B,V,P,N,n.paint.get("heatmap-intensity")),n.id,O.layoutVertexBuffer,O.indexBuffer,O.segments,n.paint,l.transform.zoom,A,E?[O.globeExtVertexBuffer]:null)}p.viewport.set([0,0,l.width,l.height])}else l.renderPass==="translucent"&&(l.context.setColorMode(l.colorModeForRenderPass()),function(p,m){const _=p.context,y=_.gl,v=m.heatmapFbo;if(!v)return;_.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,v.colorAttachment.get()),_.activeTexture.set(y.TEXTURE1);let E=m.colorRampTexture;E||(E=m.colorRampTexture=new s.Texture(_,m.colorRamp,y.RGBA)),E.bind(y.LINEAR,y.CLAMP_TO_EDGE),p.useProgram("heatmapTexture").draw(_,y.TRIANGLES,s.DepthMode.disabled,s.StencilMode.disabled,p.colorModeForRenderPass(),s.CullFaceMode.disabled,((T,M,P,R)=>({u_image:0,u_color_ramp:1,u_opacity:M.paint.get("heatmap-opacity")}))(0,m),m.id,p.viewportBuffer,p.quadTriangleIndexBuffer,p.viewportSegments,m.paint,p.transform.zoom)}(l,n))},line:function(l,i,n,h){if(l.renderPass!=="translucent")return;const p=n.paint.get("line-opacity"),m=n.paint.get("line-width");if(p.constantOr(1)===0||m.constantOr(1)===0)return;const _=l.depthModeForSublayer(0,s.DepthMode.ReadOnly),y=l.colorModeForRenderPass(),v=l.terrain&&l.terrain.renderingToTexture?1:s.exported.devicePixelRatio,E=n.paint.get("line-dasharray"),T=E.constantOr(1),M=n.layout.get("line-cap"),P=n.paint.get("line-pattern"),R=P.constantOr(1),F=n.paint.get("line-gradient"),B=R?"linePattern":"line",O=l.context,A=O.gl,L=(V=>{const H=[];aa(V)&&H.push("RENDER_LINE_DASH"),V.paint.get("line-gradient")&&H.push("RENDER_LINE_GRADIENT");const J=V.paint.get("line-trim-offset");J[0]===0&&J[1]===0||H.push("RENDER_LINE_TRIM_OFFSET");const K=V.paint.get("line-pattern").constantOr(1),re=V.paint.get("line-opacity").constantOr(1)!==1;return!K&&re&&H.push("RENDER_LINE_ALPHA_DISCARD"),H})(n);let N=L.includes("RENDER_LINE_ALPHA_DISCARD");l.terrain&&l.terrain.clipOrMaskOverlapStencilType()&&(N=!1);for(const V of h){const H=i.getTile(V);if(R&&!H.patternsLoaded())continue;const J=H.getBucket(n);if(!J)continue;l.prepareDrawTile();const K=J.programConfigurations.get(n.id),re=l.useProgram(B,K,L),te=P.constantOr(null);if(te&&H.imageAtlas){const ge=H.imageAtlas.patternPositions[te.toString()];ge&&K.setConstantPatternPositions(ge)}const le=E.constantOr(null),Ee=M.constantOr(null);if(!R&&le&&Ee&&H.lineAtlas){const ge=H.lineAtlas.getDash(le,Ee);ge&&K.setConstantPatternPositions(ge)}let[ne,_e]=n.paint.get("line-trim-offset");(Ee==="round"||Ee==="square")&&ne!==_e&&(ne===0&&(ne-=1),_e===1&&(_e+=1));const he=l.terrain?V.projMatrix:null,Te=R?na(l,H,n,he,v):Yh(l,H,n,he,J.lineClipsArray.length,v,[ne,_e]);if(F){const ge=J.gradients[n.id];let Se=ge.texture;if(n.gradientVersion!==ge.version){let we=256;if(n.stepInterpolant){const Me=i.getSource().maxzoom,qe=V.canonical.z===Me?Math.ceil(1<<l.transform.maxZoom-V.canonical.z):1;we=s.clamp(s.nextPowerOfTwo(J.maxLineLength/s.EXTENT*1024*qe),256,O.maxTextureSize)}ge.gradient=s.renderColorRamp({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:we,image:ge.gradient||void 0,clips:J.lineClipsArray}),ge.texture?ge.texture.update(ge.gradient):ge.texture=new s.Texture(O,ge.gradient,A.RGBA),ge.version=n.gradientVersion,Se=ge.texture}O.activeTexture.set(A.TEXTURE1),Se.bind(n.stepInterpolant?A.NEAREST:A.LINEAR,A.CLAMP_TO_EDGE)}T&&(O.activeTexture.set(A.TEXTURE0),H.lineAtlasTexture.bind(A.LINEAR,A.REPEAT),K.updatePaintBuffers()),R&&(O.activeTexture.set(A.TEXTURE0),H.imageAtlasTexture.bind(A.LINEAR,A.CLAMP_TO_EDGE),K.updatePaintBuffers()),l.prepareDrawProgram(O,re,V.toUnwrapped());const se=ge=>{re.draw(O,A.TRIANGLES,_,ge,y,s.CullFaceMode.disabled,Te,n.id,J.layoutVertexBuffer,J.indexBuffer,J.segments,n.paint,l.transform.zoom,K,[J.layoutVertexBuffer2])};if(N){const ge=l.stencilModeForClipping(V).ref;ge===0&&l.terrain&&O.clear({stencil:0});const Se={func:A.EQUAL,mask:255};Te.u_alpha_discard_threshold=.8,se(new s.StencilMode(Se,ge,255,A.KEEP,A.KEEP,A.INVERT)),Te.u_alpha_discard_threshold=0,se(new s.StencilMode(Se,ge,255,A.KEEP,A.KEEP,A.KEEP))}else se(l.stencilModeForClipping(V))}N&&(l.resetStencilClippingMasks(),l.terrain&&O.clear({stencil:0}))},fill:function(l,i,n,h){const p=n.paint.get("fill-color"),m=n.paint.get("fill-opacity");if(m.constantOr(1)===0)return;const _=l.colorModeForRenderPass(),y=n.paint.get("fill-pattern"),v=l.opaquePassEnabledForLayer()&&!y.constantOr(1)&&p.constantOr(s.Color.transparent).a===1&&m.constantOr(0)===1?"opaque":"translucent";if(l.renderPass===v){const E=l.depthModeForSublayer(1,l.renderPass==="opaque"?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly);Dc(l,i,n,h,E,_,!1)}if(l.renderPass==="translucent"&&n.paint.get("fill-antialias")){const E=l.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,s.DepthMode.ReadOnly);Dc(l,i,n,h,E,_,!0)}},"fill-extrusion":function(l,i,n,h){const p=n.paint.get("fill-extrusion-opacity");if(p!==0&&l.renderPass==="translucent"){const m=new s.DepthMode(l.context.gl.LEQUAL,s.DepthMode.ReadWrite,l.depthRangeFor3D);if(p!==1||n.paint.get("fill-extrusion-pattern").constantOr(1))Ja(l,i,n,h,m,s.StencilMode.disabled,s.ColorMode.disabled),Ja(l,i,n,h,m,l.stencilModeFor3D(),l.colorModeForRenderPass()),l.resetStencilClippingMasks();else{const _=l.colorModeForRenderPass();Ja(l,i,n,h,m,s.StencilMode.disabled,_)}}},hillshade:function(l,i,n,h){if(l.renderPass!=="offscreen"&&l.renderPass!=="translucent")return;const p=l.context,m=l.depthModeForSublayer(0,s.DepthMode.ReadOnly),_=l.colorModeForRenderPass(),y=l.terrain&&l.terrain.renderingToTexture,[v,E]=l.renderPass!=="translucent"||y?[{},h]:l.stencilConfigForOverlap(h);for(const T of E){const M=i.getTile(T);if(M.needsHillshadePrepare&&l.renderPass==="offscreen")Ec(l,M,n,m,s.StencilMode.disabled,_);else if(l.renderPass==="translucent"){const P=y&&l.terrain?l.terrain.stencilModeForRTTOverlap(T):v[T.overscaledZ];Tc(l,T,M,n,m,P,_)}}p.viewport.set([0,0,l.width,l.height]),l.resetStencilClippingMasks()},raster:function(l,i,n,h,p,m){if(l.renderPass!=="translucent"||n.paint.get("raster-opacity")===0||!h.length)return;const _=l.context,y=_.gl,v=i.getSource(),E=l.useProgram("raster"),T=l.colorModeForRenderPass(),M=l.terrain&&l.terrain.renderingToTexture,[P,R]=v instanceof ct||M?[{},h]:l.stencilConfigForOverlap(h),F=R[R.length-1].overscaledZ,B=!l.options.moving;for(const O of R){const A=M?s.DepthMode.disabled:l.depthModeForSublayer(O.overscaledZ-F,n.paint.get("raster-opacity")===1?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly,y.LESS),L=O.toUnwrapped(),N=i.getTile(O);if(M&&(!N||!N.hasData()))continue;const V=M?O.projMatrix:l.transform.calculateProjMatrix(L,B),H=l.terrain&&M?l.terrain.stencilModeForRTTOverlap(O):P[O.overscaledZ],J=m?0:n.paint.get("raster-fade-duration");N.registerFadeDuration(J);const K=i.findLoadedParent(O,0),re=el(N,K,i,l.transform,J);let te,le;l.terrain&&l.terrain.prepareDrawTile();const Ee=n.paint.get("raster-resampling")==="nearest"?y.NEAREST:y.LINEAR;_.activeTexture.set(y.TEXTURE0),N.texture.bind(Ee,y.CLAMP_TO_EDGE),_.activeTexture.set(y.TEXTURE1),K?(K.texture.bind(Ee,y.CLAMP_TO_EDGE),te=Math.pow(2,K.tileID.overscaledZ-N.tileID.overscaledZ),le=[N.tileID.canonical.x*te%1,N.tileID.canonical.y*te%1]):N.texture.bind(Ee,y.CLAMP_TO_EDGE),N.texture.useMipmap&&_.extTextureFilterAnisotropic&&l.transform.pitch>20&&y.texParameterf(y.TEXTURE_2D,_.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,_.extTextureFilterAnisotropicMax);const ne=cl(V,le||[0,0],te||1,re,n,v instanceof ct?v.perspectiveTransform:[0,0]);if(l.prepareDrawProgram(_,E,L),v instanceof ct)v.boundsBuffer&&v.boundsSegments&&E.draw(_,y.TRIANGLES,A,s.StencilMode.disabled,T,s.CullFaceMode.disabled,ne,n.id,v.boundsBuffer,l.quadTriangleIndexBuffer,v.boundsSegments);else{const{tileBoundsBuffer:_e,tileBoundsIndexBuffer:he,tileBoundsSegments:Te}=l.getTileBoundsBuffers(N);E.draw(_,y.TRIANGLES,A,H,T,s.CullFaceMode.disabled,ne,n.id,_e,he,Te)}}l.resetStencilClippingMasks()},background:function(l,i,n,h){const p=n.paint.get("background-color"),m=n.paint.get("background-opacity");if(m===0)return;const _=l.context,y=_.gl,v=l.transform,E=v.tileSize,T=n.paint.get("background-pattern");if(l.isPatternMissing(T))return;const M=!T&&p.a===1&&m===1&&l.opaquePassEnabledForLayer()?"opaque":"translucent";if(l.renderPass!==M)return;const P=s.StencilMode.disabled,R=l.depthModeForSublayer(0,M==="opaque"?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly),F=l.colorModeForRenderPass(),B=l.useProgram(T?"backgroundPattern":"background");let O,A=h;A||(O=l.getBackgroundTiles(),A=Object.values(O).map(L=>L.tileID)),T&&(_.activeTexture.set(y.TEXTURE0),l.imageManager.bind(l.context));for(const L of A){const N=L.toUnwrapped(),V=h?L.projMatrix:l.transform.calculateProjMatrix(N);l.prepareDrawTile();const H=i?i.getTile(L):O?O[L.key]:new s.Tile(L,E,v.zoom,l),J=T?Hh(V,m,l,T,{tileID:L,tileSize:E}):ul(V,m,p);l.prepareDrawProgram(_,B,N);const{tileBoundsBuffer:K,tileBoundsIndexBuffer:re,tileBoundsSegments:te}=l.getTileBoundsBuffers(H);B.draw(_,y.TRIANGLES,R,P,F,s.CullFaceMode.disabled,J,n.id,K,re,te)}},sky:function(l,i,n){const h=l.transform,p=h.projection.name==="mercator"||h.projection.name==="globe"?1:s.smoothstep(7,8,h.zoom),m=n.paint.get("sky-opacity")*p;if(m===0)return;const _=l.context,y=n.paint.get("sky-type"),v=new s.DepthMode(_.gl.LEQUAL,s.DepthMode.ReadOnly,[0,1]),E=l.frameCounter/1e3%1;y==="atmosphere"?l.renderPass==="offscreen"?n.needsSkyboxCapture(l)&&(function(T,M,P,R){const F=T.context,B=F.gl;let O=M.skyboxFbo;if(!O){O=M.skyboxFbo=F.createFramebuffer(32,32,!1),M.skyboxGeometry=new es(F),M.skyboxTexture=F.gl.createTexture(),B.bindTexture(B.TEXTURE_CUBE_MAP,M.skyboxTexture),B.texParameteri(B.TEXTURE_CUBE_MAP,B.TEXTURE_WRAP_S,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_CUBE_MAP,B.TEXTURE_WRAP_T,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_CUBE_MAP,B.TEXTURE_MIN_FILTER,B.LINEAR),B.texParameteri(B.TEXTURE_CUBE_MAP,B.TEXTURE_MAG_FILTER,B.LINEAR);for(let V=0;V<6;++V)B.texImage2D(B.TEXTURE_CUBE_MAP_POSITIVE_X+V,0,B.RGBA,32,32,0,B.RGBA,B.UNSIGNED_BYTE,null)}F.bindFramebuffer.set(O.framebuffer),F.viewport.set([0,0,32,32]);const A=M.getCenter(T,!0),L=T.useProgram("skyboxCapture"),N=new Float64Array(16);s.identity(N),s.rotateY(N,N,.5*-Math.PI),_i(F,M,L,N,A,0),s.identity(N),s.rotateY(N,N,.5*Math.PI),_i(F,M,L,N,A,1),s.identity(N),s.rotateX(N,N,.5*-Math.PI),_i(F,M,L,N,A,2),s.identity(N),s.rotateX(N,N,.5*Math.PI),_i(F,M,L,N,A,3),s.identity(N),_i(F,M,L,N,A,4),s.identity(N),s.rotateY(N,N,Math.PI),_i(F,M,L,N,A,5),F.viewport.set([0,0,T.width,T.height])}(l,n),n.markSkyboxValid(l)):l.renderPass==="sky"&&function(T,M,P,R,F){const B=T.context,O=B.gl,A=T.transform,L=T.useProgram("skybox");B.activeTexture.set(O.TEXTURE0),O.bindTexture(O.TEXTURE_CUBE_MAP,M.skyboxTexture);const N=((V,H,J,K,re)=>({u_matrix:V,u_sun_direction:H,u_cubemap:0,u_opacity:K,u_temporal_offset:re}))(A.skyboxMatrix,M.getCenter(T,!1),0,R,F);T.prepareDrawProgram(B,L),L.draw(B,O.TRIANGLES,P,s.StencilMode.disabled,T.colorModeForRenderPass(),s.CullFaceMode.backCW,N,"skybox",M.skyboxGeometry.vertexBuffer,M.skyboxGeometry.indexBuffer,M.skyboxGeometry.segment)}(l,n,v,m,E):y==="gradient"&&l.renderPass==="sky"&&function(T,M,P,R,F){const B=T.context,O=B.gl,A=T.transform,L=T.useProgram("skyboxGradient");M.skyboxGeometry||(M.skyboxGeometry=new es(B)),B.activeTexture.set(O.TEXTURE0);let N=M.colorRampTexture;N||(N=M.colorRampTexture=new s.Texture(B,M.colorRamp,O.RGBA)),N.bind(O.LINEAR,O.CLAMP_TO_EDGE);const V=((H,J,K,re,te)=>({u_matrix:H,u_color_ramp:0,u_center_direction:J,u_radius:s.degToRad(K),u_opacity:re,u_temporal_offset:te}))(A.skyboxMatrix,M.getCenter(T,!1),M.paint.get("sky-gradient-radius"),R,F);T.prepareDrawProgram(B,L),L.draw(B,O.TRIANGLES,P,s.StencilMode.disabled,T.colorModeForRenderPass(),s.CullFaceMode.backCW,V,"skyboxGradient",M.skyboxGeometry.vertexBuffer,M.skyboxGeometry.indexBuffer,M.skyboxGeometry.segment)}(l,n,v,m,E)},debug:function(l,i,n){for(let h=0;h<n.length;h++)ru(l,i,n[h])},custom:function(l,i,n,h){const p=l.context,m=n.implementation;if(!l.transform.projection.unsupportedLayers||!l.transform.projection.unsupportedLayers.includes("custom")||l.terrain&&(l.terrain.renderingToTexture||l.renderPass==="offscreen")&&n.isLayerDraped()){if(l.renderPass==="offscreen"){const _=m.prerender;if(_){if(l.setCustomLayerDefaults(),p.setColorMode(l.colorModeForRenderPass()),l.transform.projection.name==="globe"){const y=l.transform.pointMerc;_.call(m,p.gl,l.transform.customLayerMatrix(),l.transform.getProjection(),l.transform.globeToMercatorMatrix(),s.globeToMercatorTransition(l.transform.zoom),[y.x,y.y],l.transform.pixelsPerMeterRatio)}else _.call(m,p.gl,l.transform.customLayerMatrix());p.setDirty(),l.setBaseState()}}else if(l.renderPass==="translucent"){if(l.terrain&&l.terrain.renderingToTexture){const y=m.renderToTile;if(y){const v=h[0].canonical,E=new s.MercatorCoordinate(v.x+h[0].wrap*(1<<v.z),v.y,v.z);p.setDepthMode(s.DepthMode.disabled),p.setStencilMode(s.StencilMode.disabled),p.setColorMode(l.colorModeForRenderPass()),l.setCustomLayerDefaults(),y.call(m,p.gl,E),p.setDirty(),l.setBaseState()}return}l.setCustomLayerDefaults(),p.setColorMode(l.colorModeForRenderPass()),p.setStencilMode(s.StencilMode.disabled);const _=m.renderingMode==="3d"?new s.DepthMode(l.context.gl.LEQUAL,s.DepthMode.ReadWrite,l.depthRangeFor3D):l.depthModeForSublayer(0,s.DepthMode.ReadOnly);if(p.setDepthMode(_),l.transform.projection.name==="globe"){const y=l.transform.pointMerc;m.render(p.gl,l.transform.customLayerMatrix(),l.transform.getProjection(),l.transform.globeToMercatorMatrix(),s.globeToMercatorTransition(l.transform.zoom),[y.x,y.y],l.transform.pixelsPerMeterRatio)}else m.render(p.gl,l.transform.customLayerMatrix());p.setDirty(),l.setBaseState(),p.bindFramebuffer.set(null)}}else s.warnOnce("Custom layers are not yet supported with this projection. Use mercator or globe to enable usage of custom layers.")}};class vn{constructor(i,n,h=!1){this.context=new ze(i,h),this.transform=n,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this.setup(),this.numSublayers=s.SourceCache.maxUnderzooming+s.SourceCache.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this._backgroundTiles={}}updateTerrain(i,n){const h=!!i&&!!i.terrain&&this.transform.projection.supportsTerrain;if(!(h||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new rl(this,i));const p=this._terrain;this.transform.elevation=h?p:null,p.update(i,this.transform,n)}_updateFog(i){const n=i.fog;if(!n||this.transform.projection.name==="globe"||n.getOpacity(this.transform.pitch)<1||n.properties.get("horizon-blend")<.03)return void(this.transform.fogCullDistSq=null);const[h,p]=n.getFovAdjustedRange(this.transform._fov);if(h>p)return void(this.transform.fogCullDistSq=null);const m=h+.78*(p-h);this.transform.fogCullDistSq=m*m}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled?this._terrain:null}resize(i,n){if(this.width=i*s.exported.devicePixelRatio,this.height=n*s.exported.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const h of this.style.order)this.style._layers[h].resize()}setup(){const i=this.context,n=new s.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(s.EXTENT,0),n.emplaceBack(0,s.EXTENT),n.emplaceBack(s.EXTENT,s.EXTENT),this.tileExtentBuffer=i.createVertexBuffer(n,s.posAttributes.members),this.tileExtentSegments=s.SegmentVector.simpleSegment(0,0,4,2);const h=new s.StructArrayLayout2i4;h.emplaceBack(0,0),h.emplaceBack(s.EXTENT,0),h.emplaceBack(0,s.EXTENT),h.emplaceBack(s.EXTENT,s.EXTENT),this.debugBuffer=i.createVertexBuffer(h,s.posAttributes.members),this.debugSegments=s.SegmentVector.simpleSegment(0,0,4,5);const p=new s.StructArrayLayout2i4;p.emplaceBack(-1,-1),p.emplaceBack(1,-1),p.emplaceBack(-1,1),p.emplaceBack(1,1),this.viewportBuffer=i.createVertexBuffer(p,s.posAttributes.members),this.viewportSegments=s.SegmentVector.simpleSegment(0,0,4,2);const m=new s.StructArrayLayout4i8;m.emplaceBack(0,0,0,0),m.emplaceBack(s.EXTENT,0,s.EXTENT,0),m.emplaceBack(0,s.EXTENT,0,s.EXTENT),m.emplaceBack(s.EXTENT,s.EXTENT,s.EXTENT,s.EXTENT),this.mercatorBoundsBuffer=i.createVertexBuffer(m,s.boundsAttributes.members),this.mercatorBoundsSegments=s.SegmentVector.simpleSegment(0,0,4,2);const _=new s.StructArrayLayout3ui6;_.emplaceBack(0,1,2),_.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=i.createIndexBuffer(_);const y=new s.StructArrayLayout1ui2;for(const E of[0,1,3,2,0])y.emplaceBack(E);this.debugIndexBuffer=i.createIndexBuffer(y),this.emptyTexture=new s.Texture(i,new s.RGBAImage({width:1,height:1},Uint8Array.of(0,0,0,0)),i.gl.RGBA),this.identityMat=s.create();const v=this.context.gl;this.stencilClearMode=new s.StencilMode({func:v.ALWAYS,mask:0},0,255,v.ZERO,v.ZERO,v.ZERO),this.loadTimeStamps.push(s.window.performance.now()),this.atmosphereBuffer=new Oc(this.context)}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(i){return i._makeTileBoundsBuffers(this.context,this.transform.projection),i._tileBoundsBuffer?{tileBoundsBuffer:i._tileBoundsBuffer,tileBoundsIndexBuffer:i._tileBoundsIndexBuffer,tileBoundsSegments:i._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const i=this.context,n=i.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.useProgram("clippingMask").draw(i,n.TRIANGLES,s.DepthMode.disabled,this.stencilClearMode,s.ColorMode.disabled,s.CullFaceMode.disabled,ia(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(i,n,h){if(!n||this.currentStencilSource===n.id||!i.isTileClipped()||!h||h.length===0)return;if(this._tileClippingMaskIDs&&!this.terrain){let y=!1;for(const v of h)if(this._tileClippingMaskIDs[v.key]===void 0){y=!0;break}if(!y)return}this.currentStencilSource=n.id;const p=this.context,m=p.gl;this.nextStencilID+h.length>256&&this.clearStencil(),p.setColorMode(s.ColorMode.disabled),p.setDepthMode(s.DepthMode.disabled);const _=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const y of h){const v=n.getTile(y),E=this._tileClippingMaskIDs[y.key]=this.nextStencilID++,{tileBoundsBuffer:T,tileBoundsIndexBuffer:M,tileBoundsSegments:P}=this.getTileBoundsBuffers(v);_.draw(p,m.TRIANGLES,s.DepthMode.disabled,new s.StencilMode({func:m.ALWAYS,mask:0},E,255,m.KEEP,m.KEEP,m.REPLACE),s.ColorMode.disabled,s.CullFaceMode.disabled,ia(y.projMatrix),"$clipping",T,M,P)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const i=this.nextStencilID++,n=this.context.gl;return new s.StencilMode({func:n.NOTEQUAL,mask:255},i,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(i){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(i);const n=this.context.gl;return new s.StencilMode({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[i.key],0,n.KEEP,n.KEEP,n.REPLACE)}stencilConfigForOverlap(i){const n=this.context.gl,h=i.sort((_,y)=>y.overscaledZ-_.overscaledZ),p=h[h.length-1].overscaledZ,m=h[0].overscaledZ-p+1;if(m>1){this.currentStencilSource=void 0,this.nextStencilID+m>256&&this.clearStencil();const _={};for(let y=0;y<m;y++)_[y+p]=new s.StencilMode({func:n.GEQUAL,mask:255},y+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=m,[_,h]}return[{[p]:s.StencilMode.disabled},h]}colorModeForRenderPass(){const i=this.context.gl;return this._showOverdrawInspector?new s.ColorMode([i.CONSTANT_COLOR,i.ONE],new s.Color(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?s.ColorMode.unblended:s.ColorMode.alphaBlended}depthModeForSublayer(i,n,h){if(!this.opaquePassEnabledForLayer())return s.DepthMode.disabled;const p=1-((1+this.currentLayer)*this.numSublayers+i)*this.depthEpsilon;return new s.DepthMode(h||this.context.gl.LEQUAL,n,[p,p])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(i,n){this.style=i,this.options=n,this.imageManager=i.imageManager,this.glyphManager=i.glyphManager,this.symbolFadeChange=i.placement.symbolFadeChange(s.exported.now()),this.imageManager.beginFrame();const h=this.style.order,p=this.style._sourceCaches;for(const E in p){const T=p[E];T.used&&T.prepare(this.context)}const m={},_={},y={};for(const E in p){const T=p[E];m[E]=T.getVisibleCoordinates(),_[E]=m[E].slice().reverse(),y[E]=T.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let E=0;E<h.length;E++)if(this.style._layers[h[E]].is3D()){this.opaquePassCutoff=E;break}if(this.terrain&&(this.terrain.updateTileBinding(y),this.opaquePassCutoff=0),this.transform.projection.name!=="globe"||this.globeSharedBuffers||(this.globeSharedBuffers=new s.GlobeSharedBuffers(this.context)),!s.isMapAuthenticated(this.context.gl))return;this.renderPass="offscreen";for(const E of h){const T=this.style._layers[E],M=i._getLayerSourceCache(T);if(!T.hasOffscreenPass()||T.isHidden(this.transform.zoom))continue;const P=M?_[M.id]:void 0;(T.type==="custom"||T.isSky()||P&&P.length)&&this.renderLayer(this,M,T,P)}this.depthRangeFor3D=[0,1-(i.order.length+2)*this.numSublayers*this.depthEpsilon];const v=this.terrain;if(v&&(this.style.hasSymbolLayers()||this.style.hasCircleLayers())&&v.drawDepth(),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]),this.context.clear({color:n.showOverdrawInspector?s.Color.black:s.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=n.showOverdrawInspector,this.renderPass="opaque",!this.terrain)for(this.currentLayer=h.length-1;this.currentLayer>=0;this.currentLayer--){const E=this.style._layers[h[this.currentLayer]],T=i._getLayerSourceCache(E);if(E.isSky())continue;const M=T?_[T.id]:void 0;this._renderTileClippingMasks(E,T,M),this.renderLayer(this,T,E,M)}if(this.style.fog&&this.transform.projection.supportsFog&&function(E,T){const M=E.context,P=M.gl,R=E.transform,F=new s.DepthMode(P.LEQUAL,s.DepthMode.ReadOnly,[0,1]),B=E.useProgram("globeAtmosphere",null,R.projection.name==="globe"?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"]),O=s.globeToMercatorTransition(R.zoom),A=T.properties.get("color").toArray01(),L=T.properties.get("high-color").toArray01(),N=T.properties.get("space-color").toArray01PremultipliedAlpha(),V=s.identity$1([]);s.rotateY$1(V,V,-s.degToRad(R._center.lng)),s.rotateX$1(V,V,s.degToRad(R._center.lat)),s.rotateZ$1(V,V,R.angle),s.rotateX$1(V,V,-R._pitch);const H=s.fromQuat(new Float32Array(16),V),J=s.mapValue(T.properties.get("star-intensity"),0,1,0,.25),K=5e-4,re=s.mapValue(T.properties.get("horizon-blend"),0,1,K,.25),te=s.globeUseCustomAntiAliasing(E,M,R)&&re===K?R.worldSize/(2*Math.PI*1.025)-1:R.globeRadius,le=E.frameCounter/1e3%1,Ee=s.length(R.globeCenterInViewSpace),ne=Math.sqrt(Math.pow(Ee,2)-Math.pow(te,2)),_e=Math.acos(ne/Ee),he=((se,ge,Se,we,Me,qe,Qe,je,We,mt,ut,$e,It,Lt)=>({u_frustum_tl:se,u_frustum_tr:ge,u_frustum_br:Se,u_frustum_bl:we,u_horizon:Me,u_transition:qe,u_fadeout_range:Qe,u_color:je,u_high_color:We,u_space_color:mt,u_star_intensity:ut,u_star_size:5*s.exported.devicePixelRatio,u_star_density:0,u_temporal_offset:$e,u_horizon_angle:It,u_rotation_matrix:Lt}))(R.frustumCorners.TL,R.frustumCorners.TR,R.frustumCorners.BR,R.frustumCorners.BL,R.frustumCorners.horizon,O,re,A,L,N,J,le,_e,H);E.prepareDrawProgram(M,B);const Te=E.atmosphereBuffer;Te&&B.draw(M,P.TRIANGLES,F,s.StencilMode.disabled,s.ColorMode.alphaBlended,s.CullFaceMode.backCW,he,"skybox",Te.vertexBuffer,Te.indexBuffer,Te.segments)}(this,this.style.fog),this.renderPass="sky",(s.globeToMercatorTransition(this.transform.zoom)>0||this.transform.projection.name!=="globe")&&this.transform.isHorizonVisible())for(this.currentLayer=0;this.currentLayer<h.length;this.currentLayer++){const E=this.style._layers[h[this.currentLayer]],T=i._getLayerSourceCache(E);E.isSky()&&this.renderLayer(this,T,E,T?_[T.id]:void 0)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<h.length;){const E=this.style._layers[h[this.currentLayer]],T=i._getLayerSourceCache(E);if(E.isSky()){++this.currentLayer;continue}if(this.terrain&&this.style.isLayerDraped(E)){if(E.isHidden(this.transform.zoom)){++this.currentLayer;continue}this.currentLayer=this.terrain.renderBatch(this.currentLayer);continue}const M=T?(E.type==="symbol"?y:_)[T.id]:void 0;this._renderTileClippingMasks(E,T,T?m[T.id]:void 0),this.renderLayer(this,T,E,M),++this.currentLayer}if(this.terrain&&this.terrain.postRender(),this.options.showTileBoundaries||this.options.showQueryGeometry||this.options.showTileAABBs){let E=null;s.values(this.style._layers).forEach(T=>{const M=i._getLayerSourceCache(T);M&&!T.isHidden(this.transform.zoom)&&(!E||E.getSource().maxzoom<M.getSource().maxzoom)&&(E=M)}),E&&this.options.showTileBoundaries&&Go.debug(this,E,E.getVisibleCoordinates())}this.options.showPadding&&function(E){const T=E.transform.padding;Rc(E,E.transform.height-(T.top||0),3,yn),Rc(E,T.bottom||0,3,Jh),Qa(E,T.left||0,3,Qh),Qa(E,E.transform.width-(T.right||0),3,eu);const M=E.transform.centerPoint;(function(P,R,F,B){xn(P,R-1,F-10,2,20,B),xn(P,R-10,F-1,20,2,B)})(E,M.x,E.transform.height-M.y,tu)}(this),this.context.setDefault(),this.frameCounter=(this.frameCounter+1)%Number.MAX_SAFE_INTEGER,this.tileLoaded&&this.options.speedIndexTiming&&(this.loadTimeStamps.push(s.window.performance.now()),this.saveCanvasCopy())}renderLayer(i,n,h,p){h.isHidden(this.transform.zoom)||(h.type==="background"||h.type==="sky"||h.type==="custom"||p&&p.length)&&(this.id=h.id,this.gpuTimingStart(h),(!i.transform.projection.unsupportedLayers||!i.transform.projection.unsupportedLayers.includes(h.type)||i.terrain&&h.type==="custom")&&Go[h.type](i,n,h,p,this.style.placement.variableOffsets,this.options.isInitialLoad),this.gpuTimingEnd())}gpuTimingStart(i){if(!this.options.gpuTiming)return;const n=this.context.extTimerQuery;let h=this.gpuTimers[i.id];h||(h=this.gpuTimers[i.id]={calls:0,cpuTime:0,query:n.createQueryEXT()}),h.calls++,n.beginQueryEXT(n.TIME_ELAPSED_EXT,h.query)}gpuTimingDeferredRenderStart(){if(this.options.gpuTimingDeferredRender){const i=this.context.extTimerQuery,n=i.createQueryEXT();this.deferredRenderGpuTimeQueries.push(n),i.beginQueryEXT(i.TIME_ELAPSED_EXT,n)}}gpuTimingDeferredRenderEnd(){if(!this.options.gpuTimingDeferredRender)return;const i=this.context.extTimerQuery;i.endQueryEXT(i.TIME_ELAPSED_EXT)}gpuTimingEnd(){if(!this.options.gpuTiming)return;const i=this.context.extTimerQuery;i.endQueryEXT(i.TIME_ELAPSED_EXT)}collectGpuTimers(){const i=this.gpuTimers;return this.gpuTimers={},i}collectDeferredRenderGpuQueries(){const i=this.deferredRenderGpuTimeQueries;return this.deferredRenderGpuTimeQueries=[],i}queryGpuTimers(i){const n={};for(const h in i){const p=i[h],m=this.context.extTimerQuery,_=m.getQueryObjectEXT(p.query,m.QUERY_RESULT_EXT)/1e6;m.deleteQueryEXT(p.query),n[h]=_}return n}queryGpuTimeDeferredRender(i){if(!this.options.gpuTimingDeferredRender)return 0;const n=this.context.extTimerQuery;let h=0;for(const p of i)h+=n.getQueryObjectEXT(p,n.QUERY_RESULT_EXT)/1e6,n.deleteQueryEXT(p);return h}translatePosMatrix(i,n,h,p,m){if(!h[0]&&!h[1])return i;const _=m?p==="map"?this.transform.angle:0:p==="viewport"?-this.transform.angle:0;if(_){const E=Math.sin(_),T=Math.cos(_);h=[h[0]*T-h[1]*E,h[0]*E+h[1]*T]}const y=[m?h[0]:rr(n,h[0],this.transform.zoom),m?h[1]:rr(n,h[1],this.transform.zoom),0],v=new Float32Array(16);return s.translate(v,i,y),v}saveTileTexture(i){const n=this._tileTextures[i.size[0]];n?n.push(i):this._tileTextures[i.size[0]]=[i]}getTileTexture(i){const n=this._tileTextures[i];return n&&n.length>0?n.pop():null}isPatternMissing(i){return i===null||i!==void 0&&!this.imageManager.getPattern(i.toString())}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture}currentGlobalDefines(){const i=this.terrain&&this.terrain.renderingToTexture,n=this.terrain&&this.terrain.exaggeration()===0,h=this.style&&this.style.fog,p=[];return this.terrainRenderModeElevated()&&p.push("TERRAIN"),this.transform.projection.name==="globe"&&p.push("GLOBE"),n&&p.push("ZERO_EXAGGERATION"),h&&!i&&h.getOpacity(this.transform.pitch)!==0&&p.push("FOG"),i&&p.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&p.push("OVERDRAW_INSPECTOR"),p}useProgram(i,n,h){this.cache=this.cache||{};const p=h||[],m=this.currentGlobalDefines().concat(p),_=bt.cacheKey(Hs[i],i,m,n);return this.cache[_]||(this.cache[_]=new bt(this.context,i,Hs[i],n,pl[i],m)),this.cache[_]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const 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)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=s.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new s.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this._terrain&&this._terrain.destroy(),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.atmosphereBuffer&&this.atmosphereBuffer.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}prepareDrawProgram(i,n,h){if(this.terrain&&this.terrain.renderingToTexture)return;const p=this.style.fog;if(p){const m=p.getOpacity(this.transform.pitch),_=((y,v,E,T,M,P,R,F,B,O,A)=>{const L=y.transform,N=v.properties.get("color").toArray01();N[3]=T;const V=y.frameCounter/1e3%1;return{u_fog_matrix:E?L.calculateFogTileMatrix(E):y.identityMat,u_fog_range:v.getFovAdjustedRange(L._fov),u_fog_color:N,u_fog_horizon_blend:v.properties.get("horizon-blend"),u_fog_temporal_offset:V,u_frustum_tl:M,u_frustum_tr:P,u_frustum_br:R,u_frustum_bl:F,u_globe_pos:B,u_globe_radius:O,u_viewport:A,u_globe_transition:s.globeToMercatorTransition(L.zoom),u_is_globe:+(L.projection.name==="globe")}})(this,p,h,m,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*s.exported.devicePixelRatio,this.transform.height*s.exported.devicePixelRatio]);n.setFogUniformValues(i,_)}}setTileLoadedFlag(i){this.tileLoaded=i}saveCanvasCopy(){const i=this.canvasCopy();i&&(this.frameCopies.push(i),this.tileLoaded=!1)}canvasCopy(){const i=this.context.gl,n=i.createTexture();return i.bindTexture(i.TEXTURE_2D,n),i.copyTexImage2D(i.TEXTURE_2D,0,i.RGBA,0,0,i.drawingBufferWidth,i.drawingBufferHeight,0),n}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const i=this.style&&this.style.fog;return!!i&&i.getOpacity(this.transform.pitch)!==0}getBackgroundTiles(){const i=this._backgroundTiles,n=this._backgroundTiles={},h=this.transform.coveringTiles({tileSize:512});for(const p of h)n[p.key]=i[p.key]||new s.Tile(p,512,this.transform.tileZoom,this);return n}clearBackgroundTiles(){this._backgroundTiles={}}}class ts{constructor(i=0,n=0,h=0,p=0){if(isNaN(i)||i<0||isNaN(n)||n<0||isNaN(h)||h<0||isNaN(p)||p<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=i,this.bottom=n,this.left=h,this.right=p}interpolate(i,n,h){return n.top!=null&&i.top!=null&&(this.top=s.number(i.top,n.top,h)),n.bottom!=null&&i.bottom!=null&&(this.bottom=s.number(i.bottom,n.bottom,h)),n.left!=null&&i.left!=null&&(this.left=s.number(i.left,n.left,h)),n.right!=null&&i.right!=null&&(this.right=s.number(i.right,n.right,h)),this}getCenter(i,n){const h=s.clamp((this.left+i-this.right)/2,0,i),p=s.clamp((this.top+n-this.bottom)/2,0,n);return new s.Point(h,p)}equals(i){return this.top===i.top&&this.bottom===i.bottom&&this.left===i.left&&this.right===i.right}clone(){return new ts(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function rs(l,i){const n=s.getColumn(l,3);s.fromQuat(l,i),s.setColumn(l,3,n)}function Tt(l,i){const n=s.identity$1([]);return s.rotateZ$1(n,n,-i),s.rotateX$1(n,n,-l),n}function ha(l,i){const n=[l[0],l[1],0],h=[i[0],i[1],0];if(s.length(n)>=1e-15){const _=s.normalize([],n);s.scale$2(h,_,s.dot(h,_)),i[0]=h[0],i[1]=h[1]}const p=s.cross([],i,l);if(s.len(p)<1e-15)return null;const m=Math.atan2(-p[1],p[0]);return Tt(Math.atan2(Math.sqrt(l[0]*l[0]+l[1]*l[1]),-l[2]),m)}class Uc{constructor(i,n){this.position=i,this.orientation=n}get position(){return this._position}set position(i){if(i){const n=i instanceof s.MercatorCoordinate?i:new s.MercatorCoordinate(i[0],i[1],i[2]);this._renderWorldCopies&&(n.x=s.wrap(n.x,0,1)),this._position=n}else this._position=null}lookAtPoint(i,n){if(this.orientation=null,!this.position)return;const h=this.position,p=this._elevation?this._elevation.getAtPointOrZero(s.MercatorCoordinate.fromLngLat(i)):0,m=s.MercatorCoordinate.fromLngLat(i,p),_=[m.x-h.x,m.y-h.y,m.z-h.z];n||(n=[0,0,1]),n[2]=Math.abs(n[2]),this.orientation=ha(_,n)}setPitchBearing(i,n){this.orientation=Tt(s.degToRad(i),s.degToRad(-n))}}class is{constructor(i,n){this._transform=s.identity([]),this.orientation=n,this.position=i}get mercatorPosition(){const i=this.position;return new s.MercatorCoordinate(i[0],i[1],i[2])}get position(){const i=s.getColumn(this._transform,3);return[i[0],i[1],i[2]]}set position(i){var n;i&&s.setColumn(this._transform,3,[(n=i)[0],n[1],n[2],1])}get orientation(){return this._orientation}set orientation(i){this._orientation=i||s.identity$1([]),i&&rs(this._transform,this._orientation)}getPitchBearing(){const i=this.forward(),n=this.right();return{bearing:Math.atan2(-n[1],n[0]),pitch:Math.atan2(Math.sqrt(i[0]*i[0]+i[1]*i[1]),-i[2])}}setPitchBearing(i,n){this._orientation=Tt(i,n),rs(this._transform,this._orientation)}forward(){const i=s.getColumn(this._transform,2);return[-i[0],-i[1],-i[2]]}up(){const i=s.getColumn(this._transform,1);return[-i[0],-i[1],-i[2]]}right(){const i=s.getColumn(this._transform,0);return[i[0],i[1],i[2]]}getCameraToWorld(i,n){const h=new Float64Array(16);return s.invert(h,this.getWorldToCamera(i,n)),h}getWorldToCameraPosition(i,n,h){const p=this.position;s.scale$2(p,p,-i);const m=new Float64Array(16);return s.fromScaling(m,[h,h,h]),s.translate(m,m,p),m[10]*=n,m}getWorldToCamera(i,n){const h=new Float64Array(16),p=new Float64Array(4),m=this.position;return s.conjugate(p,this._orientation),s.scale$2(m,m,-i),s.fromQuat(h,p),s.translate(h,h,m),h[1]*=-1,h[5]*=-1,h[9]*=-1,h[13]*=-1,h[8]*=n,h[9]*=n,h[10]*=n,h[11]*=n,h}getCameraToClipPerspective(i,n,h,p){const m=new Float64Array(16);return s.perspective(m,i,n,h,p),m}getDistanceToElevation(i,n=!1){const h=i===0?0:s.mercatorZfromAltitude(i,n?s.latFromMercatorY(this.position[1]):this.position[1]),p=this.forward();return(h-this.position[2])/p[2]}clone(){return new is([...this.position],[...this.orientation])}}function wn(l,i){const n=os(l.projection,l.zoom,l.width,l.height),h=function(m,_,y,v,E){const T=new s.LngLat(y.lng-180*ro,y.lat),M=new s.LngLat(y.lng+180*ro,y.lat),P=m.project(T.lng,T.lat),R=m.project(M.lng,M.lat),F=-Math.atan2(R.y-P.y,R.x-P.x),B=s.MercatorCoordinate.fromLngLat(y);B.y=s.clamp(B.y,-1+ro,1-ro);const O=B.toLngLat(),A=m.project(O.lng,O.lat),L=s.MercatorCoordinate.fromLngLat(O);L.x+=ro;const N=L.toLngLat(),V=m.project(N.lng,N.lat),H=ns(V.x-A.x,V.y-A.y,F),J=s.MercatorCoordinate.fromLngLat(O);J.y+=ro;const K=J.toLngLat(),re=m.project(K.lng,K.lat),te=ns(re.x-A.x,re.y-A.y,F),le=Math.abs(H.x)/Math.abs(te.y),Ee=s.identity([]);s.rotateZ(Ee,Ee,-F*(1-(E?0:v)));const ne=s.identity([]);return s.scale(ne,ne,[1,1-(1-le)*v,1]),ne[4]=-te.x/te.y*v,s.rotateZ(ne,ne,F),s.multiply(ne,Ee,ne),ne}(l.projection,0,l.center,n,i),p=jc(l);return s.scale(h,h,[p,p,1]),h}function jc(l){const i=l.projection,n=os(l.projection,l.zoom,l.width,l.height),h=Nc(i,l.center),p=Nc(i,s.LngLat.convert(i.center));return Math.pow(2,h*n+(1-n)*p)}function os(l,i,n,h,p=1/0){const m=l.range;if(!m)return 0;const _=Math.min(p,Math.max(n,h)),y=Math.log(_/1024)/Math.LN2;return s.smoothstep(m[0]+y,m[1]+y,i)}const ro=1/4e4;function Nc(l,i){const n=s.clamp(i.lat,-s.MAX_MERCATOR_LATITUDE,s.MAX_MERCATOR_LATITUDE),h=new s.LngLat(i.lng-180*ro,n),p=new s.LngLat(i.lng+180*ro,n),m=l.project(h.lng,n),_=l.project(p.lng,n),y=s.MercatorCoordinate.fromLngLat(h),v=s.MercatorCoordinate.fromLngLat(p),E=_.x-m.x,T=_.y-m.y,M=v.x-y.x,P=v.y-y.y,R=Math.sqrt((M*M+P*P)/(E*E+T*T));return Math.log(R)/Math.LN2}function ns(l,i,n){const h=Math.cos(n),p=Math.sin(n);return{x:l*h-i*p,y:l*p+i*h}}class bn{constructor(i,n,h,p,m,_,y){this.tileSize=512,this._renderWorldCopies=m===void 0||m,this._minZoom=i||0,this._maxZoom=n||22,this._minPitch=h??0,this._maxPitch=p??60,this.setProjection(_),this.setMaxBounds(y),this.width=0,this.height=0,this._center=new s.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new ts,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._distanceTileDataCache={},this._camera=new is,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._horizonShift=.1}clone(){const i=new bn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return i._elevation=this._elevation,i._centerAltitude=this._centerAltitude,i._centerAltitudeValidForExaggeration=this._centerAltitudeValidForExaggeration,i.tileSize=this.tileSize,i.mercatorFromTransition=this.mercatorFromTransition,i.width=this.width,i.height=this.height,i.cameraElevationReference=this.cameraElevationReference,i._center=this._center,i._setZoom(this.zoom),i._seaLevelZoom=this._seaLevelZoom,i.angle=this.angle,i._fov=this._fov,i._pitch=this._pitch,i._nearZ=this._nearZ,i._farZ=this._farZ,i._averageElevation=this._averageElevation,i._unmodified=this._unmodified,i._edgeInsets=this._edgeInsets.clone(),i._camera=this._camera.clone(),i._calcMatrices(),i.freezeTileCoverage=this.freezeTileCoverage,i.frustumCorners=this.frustumCorners,i}get elevation(){return this._elevation}set elevation(i){this._elevation!==i&&(this._elevation=i,this._updateCameraOnTerrain(),this._calcMatrices())}updateElevation(i,n=!1){const h=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(this._seaLevelZoom==null||h)&&this._updateCameraOnTerrain(),(i||h)&&this._constrainCamera(n),this._calcMatrices()}getProjection(){return s.pick(this.projection,["name","center","parallels"])}setProjection(i){this.projectionOptions=i||{name:"mercator"};const n=this.projection?this.getProjection():void 0;this.projection=s.getProjection(this.projectionOptions);const h=!ve(n,this.getProjection());return h&&this._calcMatrices(),this.mercatorFromTransition=!1,h}setMercatorFromTransition(){const i=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=s.getProjection({name:"mercator"});const n=i!==this.projection.name;return n&&this._calcMatrices(),n}get minZoom(){return this._minZoom}set minZoom(i){this._minZoom!==i&&(this._minZoom=i,this.zoom=Math.max(this.zoom,i))}get maxZoom(){return this._maxZoom}set maxZoom(i){this._maxZoom!==i&&(this._maxZoom=i,this.zoom=Math.min(this.zoom,i))}get minPitch(){return this._minPitch}set minPitch(i){this._minPitch!==i&&(this._minPitch=i,this.pitch=Math.max(this.pitch,i))}get maxPitch(){return this._maxPitch}set maxPitch(i){this._maxPitch!==i&&(this._maxPitch=i,this.pitch=Math.min(this.pitch,i))}get renderWorldCopies(){return this._renderWorldCopies&&this.projection.supportsWorldCopies===!0}set renderWorldCopies(i){i===void 0?i=!0:i===null&&(i=!1),this._renderWorldCopies=i}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const i=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(i))}get cameraWorldSize(){const i=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(i))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return s.mercatorZfromAltitude(this.center.lat,this.cameraWorldSizeForFog)}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new s.Point(this.width,this.height)}get bearing(){return s.wrap(this.rotation,-180,180)}set bearing(i){this.rotation=i}get rotation(){return-this.angle/Math.PI*180}set rotation(i){const n=-i*Math.PI/180;var h;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=(h=new s.ARRAY_TYPE(4),s.ARRAY_TYPE!=Float32Array&&(h[1]=0,h[2]=0),h[0]=1,h[3]=1,h),function(p,m,_){var y=m[0],v=m[1],E=m[2],T=m[3],M=Math.sin(_),P=Math.cos(_);p[0]=y*P+E*M,p[1]=v*P+T*M,p[2]=y*-M+E*P,p[3]=v*-M+T*P}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(i){const n=s.clamp(i,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}get fovX(){return this._fov}get fovY(){const i=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/i)}set fov(i){i=Math.max(.01,Math.min(60,i)),this._fov!==i&&(this._unmodified=!1,this._fov=s.degToRad(i),this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(i){this._averageElevation=i,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(i){const n=Math.min(Math.max(i,this.minZoom),this.maxZoom);this._zoom!==n&&(this._unmodified=!1,this._setZoom(n),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(i){this._zoom=i,this.scale=this.zoomScale(i),this.tileZoom=Math.floor(i),this.zoomFraction=i-this.tileZoom}_updateCameraOnTerrain(){if(!this._elevation||!this._elevation.isDataAvailableAtPoint(this.locationCoordinate(this.center)))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const i=this._elevation;this._centerAltitude=i.getAtPointOrZero(this.locationCoordinate(this.center)),this._centerAltitudeValidForExaggeration=i.exaggeration(),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){this._centerAltitudeValidForExaggeration!==void 0&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;const i=this._elevation,n=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],h=this.horizonLineFromTop();let p=0,m=0;for(let _=0;_<n.length;_++){const y=new s.Point(n[_][0]*this.width,h+n[_][1]*(this.height-h)),v=i.pointCoordinate(y);if(!v)continue;const E=1/Math.hypot(v[0]-this._camera.position[0],v[1]-this._camera.position[1]);p+=v[3]*E,m+=E}return m===0?NaN:p/m}get center(){return this._center}set center(i){i.lat===this._center.lat&&i.lng===this._center.lng||(this._unmodified=!1,this._center=i,this._terrainEnabled()&&(this.cameraElevationReference==="ground"?this._updateCameraOnTerrain():this._updateZoomFromElevation()),this._constrain(),this._calcMatrices())}_updateZoomFromElevation(){if(this._seaLevelZoom==null||!this._elevation)return;const i=this._seaLevelZoom,n=this._elevation.getAtPointOrZero(this.locationCoordinate(this.center)),h=this.pixelsPerMeter/this.worldSize*n,p=this._mercatorZfromZoom(i),m=this._mercatorZfromZoom(this._maxZoom),_=Math.max(p-h,m);this._setZoom(this._zoomFromMercatorZ(_))}get padding(){return this._edgeInsets.toJSON()}set padding(i){this._edgeInsets.equals(i)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,i,1),this._calcMatrices())}computeZoomRelativeTo(i){const n=this.rayIntersectionCoordinate(this.pointRayIntersection(this.centerPoint,i.toAltitude()));let h;h=i.z<this._camera.position[2]?[n.x,n.y,n.z]:[i.x,i.y,i.z];const p=s.length(s.sub([],this._camera.position,h));return s.clamp(this._zoomFromMercatorZ(p),this._minZoom,this._maxZoom)}setFreeCameraOptions(i){if(!this.height||!i.position&&!i.orientation)return;this._updateCameraState();let n=!1;if(i.orientation&&!s.exactEquals(i.orientation,this._camera.orientation)&&(n=this._setCameraOrientation(i.orientation)),i.position){const h=[i.position.x,i.position.y,i.position.z];s.exactEquals$1(h,this._camera.position)||(this._setCameraPosition(h),n=!0)}n&&(this._updateStateFromCamera(),this.recenterOnTerrain())}getFreeCameraOptions(){this._updateCameraState();const i=this._camera.position,n=new Uc;return n.position=new s.MercatorCoordinate(i[0],i[1],i[2]),n.orientation=this._camera.orientation,n._elevation=this.elevation,n._renderWorldCopies=this.renderWorldCopies,n}_setCameraOrientation(i){if(!s.length$1(i))return!1;s.normalize$1(i,i);const n=s.transformQuat([],[0,0,-1],i),h=s.transformQuat([],[0,-1,0],i);if(h[2]<0)return!1;const p=ha(n,h);return!!p&&(this._camera.orientation=p,!0)}_setCameraPosition(i){const n=this.zoomScale(this.minZoom)*this.tileSize,h=this.zoomScale(this.maxZoom)*this.tileSize,p=this.cameraToCenterDistance;i[2]=s.clamp(i[2],p/h,p/n),this._camera.position=i}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}get fovAboveCenter(){return this._fov*(.5+this.centerOffset.y/this.height)}isPaddingEqual(i){return this._edgeInsets.equals(i)}interpolatePadding(i,n,h){this._unmodified=!1,this._edgeInsets.interpolate(i,n,h),this._constrain(),this._calcMatrices()}coveringZoomLevel(i){const n=(i.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/i.tileSize));return Math.max(0,n)}getVisibleUnwrappedCoordinates(i){const n=[new s.UnwrappedTileID(0,i)];if(this.renderWorldCopies){const h=this.pointCoordinate(new s.Point(0,0)),p=this.pointCoordinate(new s.Point(this.width,0)),m=this.pointCoordinate(new s.Point(this.width,this.height)),_=this.pointCoordinate(new s.Point(0,this.height)),y=Math.floor(Math.min(h.x,p.x,m.x,_.x)),v=Math.floor(Math.max(h.x,p.x,m.x,_.x)),E=1;for(let T=y-E;T<=v+E;T++)T!==0&&n.push(new s.UnwrappedTileID(T,i))}return n}coveringTiles(i){let n=this.coveringZoomLevel(i);const h=n,p=this.elevation&&!i.isTerrainDEM,m=this.projection.name==="mercator";if(i.minzoom!==void 0&&n<i.minzoom)return[];i.maxzoom!==void 0&&n>i.maxzoom&&(n=i.maxzoom);const _=this.locationCoordinate(this.center),y=this.center.lat,v=1<<n,E=[v*_.x,v*_.y,0],T=this.projection.name==="globe",M=!T,P=s.Frustum.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,n,M),R=T?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),F=v*s.mercatorZfromAltitude(1,this.center.lat),B=this._camera.position[2]/s.mercatorZfromAltitude(1,this.center.lat),O=[v*R.x,v*R.y,B*(M?1:F)],A=this.cameraToCenterDistance/i.tileSize*(i.roundZoom?1:.502),L=this.pitch<=60&&this._edgeInsets.top<=this._edgeInsets.bottom&&!this._elevation&&!this.projection.isReprojectedInTileSpace?n:0,N=i.isTerrainDEM&&this._elevation?1e4*this._elevation.exaggeration():this._centerAltitude,V=i.isTerrainDEM?-N:this._elevation?this._elevation.getMinElevationBelowMSL():0,H=this.projection.isReprojectedInTileSpace?jc(this):1,J=se=>{const Se=new s.MercatorCoordinate(se.x+25e-6,se.y,se.z),we=new s.MercatorCoordinate(se.x,se.y+25e-6,se.z),Me=se.toLngLat(),qe=Se.toLngLat(),Qe=we.toLngLat(),je=this.locationCoordinate(Me),We=this.locationCoordinate(qe),mt=this.locationCoordinate(Qe),ut=Math.hypot(We.x-je.x,We.y-je.y),$e=Math.hypot(mt.x-je.x,mt.y-je.y);return Math.sqrt(ut*$e)*H/25e-6},K=se=>{const ge=N,Se=V;return{aabb:s.tileAABB(this,v,0,0,0,se,Se,ge,this.projection),zoom:0,x:0,y:0,minZ:Se,maxZ:ge,wrap:se,fullyVisible:!1}},re=[];let te=[];const le=n,Ee=i.reparseOverscaled?h:n,ne=se=>se*se,_e=ne((B-this._centerAltitude)*F),he=se=>{if(!this._elevation||!se.tileID||!m)return;const ge=this._elevation.getMinMaxForTile(se.tileID),Se=se.aabb;ge?(Se.min[2]=ge.min,Se.max[2]=ge.max,Se.center[2]=(Se.min[2]+Se.max[2])/2):(se.shouldSplit=Te(se),se.shouldSplit||(Se.min[2]=Se.max[2]=Se.center[2]=this._centerAltitude))},Te=se=>{if(se.zoom<L)return!0;if(se.zoom===le)return!1;if(se.shouldSplit!=null)return se.shouldSplit;const ge=se.aabb.distanceX(O),Se=se.aabb.distanceY(O);let we=_e,Me=1;if(T){we=ne(se.aabb.distanceZ(O));const je=Math.pow(2,se.zoom),We=s.latFromMercatorY((se.y+1)/je),mt=s.latFromMercatorY(se.y/je),ut=Math.min(Math.max(y,We),mt),$e=s.circumferenceAtLatitude(ut)/s.circumferenceAtLatitude(y);if(Me=ut===y?1/Math.max(1,this._mercatorScaleRatio-.3):Math.min(1,$e/this._mercatorScaleRatio),this.zoom<=s.GLOBE_ZOOM_THRESHOLD_MIN&&se.zoom===le-1&&$e>=.9)return!0}else if(p&&(we=ne(se.aabb.distanceZ(O)*F)),this.projection.isReprojectedInTileSpace&&h<=5){const je=Math.pow(2,se.zoom),We=J(new s.MercatorCoordinate((se.x+.5)/je,(se.y+.5)/je));Me=We>.85?1:We}const qe=ge*ge+Se*Se+we,Qe=ne((1<<le-se.zoom)*A*Me*((je,We)=>{if(We*ne(.707)<je)return 1;const mt=Math.sqrt(We/je);return mt/(1.4144271570014144+(Math.pow(1.1,mt-1.4144271570014144+1)-1)/(1.1-1)-1)})(Math.max(we,_e),qe));return qe<Qe};if(this.renderWorldCopies)for(let se=1;se<=3;se++)re.push(K(-se)),re.push(K(se));for(re.push(K(0));re.length>0;){const se=re.pop(),ge=se.x,Se=se.y;let we=se.fullyVisible;if(!we){const Me=se.aabb.intersects(P);if(Me===0)continue;we=Me===2}if(se.zoom!==le&&Te(se))for(let Me=0;Me<4;Me++){const qe=(ge<<1)+Me%2,Qe=(Se<<1)+(Me>>1),je={aabb:m?se.aabb.quadrant(Me):s.tileAABB(this,v,se.zoom+1,qe,Qe,se.wrap,se.minZ,se.maxZ,this.projection),zoom:se.zoom+1,x:qe,y:Qe,wrap:se.wrap,fullyVisible:we,tileID:void 0,shouldSplit:void 0,minZ:se.minZ,maxZ:se.maxZ};p&&!T&&(je.tileID=new s.OverscaledTileID(se.zoom+1===le?Ee:se.zoom+1,se.wrap,se.zoom+1,qe,Qe),he(je)),re.push(je)}else{const Me=se.zoom===le?Ee:se.zoom;if(i.minzoom&&i.minzoom>Me)continue;const qe=E[0]-(.5+ge+(se.wrap<<se.zoom))*(1<<n-se.zoom),Qe=E[1]-.5-Se,je=se.tileID?se.tileID:new s.OverscaledTileID(Me,se.wrap,se.zoom,ge,Se);te.push({tileID:je,distanceSq:qe*qe+Qe*Qe})}}if(this.fogCullDistSq){const se=this.fogCullDistSq,ge=this.horizonLineFromTop();te=te.filter(Se=>{const we=[0,0,0,1],Me=[s.EXTENT,s.EXTENT,0,1],qe=this.calculateFogTileMatrix(Se.tileID.toUnwrapped());s.transformMat4$1(we,we,qe),s.transformMat4$1(Me,Me,qe);const Qe=s.getAABBPointSquareDist(we,Me);if(Qe===0)return!0;let je=!1;const We=this._elevation;if(We&&Qe>se&&ge!==0){const mt=this.calculateProjMatrix(Se.tileID.toUnwrapped());let ut;i.isTerrainDEM||(ut=We.getMinMaxForTile(Se.tileID)),ut||(ut={min:V,max:N});const $e=s.furthestTileCorner(this.rotation),It=[$e[0]*s.EXTENT,$e[1]*s.EXTENT,ut.max];s.transformMat4(It,It,mt),je=(1-It[1])*this.height*.5<ge}return Qe<se||je})}return te.sort((se,ge)=>se.distanceSq-ge.distanceSq).map(se=>se.tileID)}resize(i,n){this.width=i,this.height=n,this.pixelsToGLUnits=[2/i,-2/n],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(i){return Math.pow(2,i)}scaleZoom(i){return Math.log(i)/Math.LN2}project(i){const n=s.clamp(i.lat,-s.MAX_MERCATOR_LATITUDE,s.MAX_MERCATOR_LATITUDE),h=this.projection.project(i.lng,n);return new s.Point(h.x*this.worldSize,h.y*this.worldSize)}unproject(i){return this.projection.unproject(i.x/this.worldSize,i.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/s.mercatorZfromAltitude(1,this.center.lat)/this.worldSize}setLocationAtPoint(i,n){let h,p;const m=this.centerPoint;if(this.projection.name==="globe"){const y=this.worldSize;h=(n.x-m.x)/y,p=(n.y-m.y)/y}else{const y=this.pointCoordinate(n),v=this.pointCoordinate(m);h=y.x-v.x,p=y.y-v.y}const _=this.locationCoordinate(i);this.setLocation(new s.MercatorCoordinate(_.x-h,_.y-p))}setLocation(i){this.center=this.coordinateLocation(i),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(i){return this.projection.locationPoint(this,i)}locationPoint3D(i){return this.projection.locationPoint(this,i,!0)}pointLocation(i){return this.coordinateLocation(this.pointCoordinate(i))}pointLocation3D(i){return this.coordinateLocation(this.pointCoordinate3D(i))}locationCoordinate(i,n){const h=n?s.mercatorZfromAltitude(n,i.lat):void 0,p=this.projection.project(i.lng,i.lat);return new s.MercatorCoordinate(p.x,p.y,h)}coordinateLocation(i){return this.projection.unproject(i.x,i.y)}pointRayIntersection(i,n){const h=n??this._centerAltitude,p=[i.x,i.y,0,1],m=[i.x,i.y,1,1];s.transformMat4$1(p,p,this.pixelMatrixInverse),s.transformMat4$1(m,m,this.pixelMatrixInverse);const _=m[3];s.scale$1(p,p,1/p[3]),s.scale$1(m,m,1/_);const y=p[2],v=m[2];return{p0:p,p1:m,t:y===v?0:(h-y)/(v-y)}}screenPointToMercatorRay(i){const n=[i.x,i.y,0,1],h=[i.x,i.y,1,1];return s.transformMat4$1(n,n,this.pixelMatrixInverse),s.transformMat4$1(h,h,this.pixelMatrixInverse),s.scale$1(n,n,1/n[3]),s.scale$1(h,h,1/h[3]),n[2]=s.mercatorZfromAltitude(n[2],this._center.lat)*this.worldSize,h[2]=s.mercatorZfromAltitude(h[2],this._center.lat)*this.worldSize,s.scale$1(n,n,1/this.worldSize),s.scale$1(h,h,1/this.worldSize),new s.Ray([n[0],n[1],n[2]],s.normalize([],s.sub([],h,n)))}rayIntersectionCoordinate(i){const{p0:n,p1:h,t:p}=i,m=s.mercatorZfromAltitude(n[2],this._center.lat),_=s.mercatorZfromAltitude(h[2],this._center.lat);return new s.MercatorCoordinate(s.number(n[0],h[0],p)/this.worldSize,s.number(n[1],h[1],p)/this.worldSize,s.number(m,_,p))}pointCoordinate(i,n=this._centerAltitude){return this.projection.pointCoordinate(this,i.x,i.y,n)}pointCoordinate3D(i){if(!this.elevation)return this.pointCoordinate(i);let n=this.projection.pointCoordinate3D(this,i.x,i.y);if(n)return new s.MercatorCoordinate(n[0],n[1],n[2]);let h=0,p=this.horizonLineFromTop();if(i.y>p)return this.pointCoordinate(i);const m=.02*p,_=i.clone();for(let y=0;y<10&&p-h>m;y++){_.y=s.number(h,p,.66);const v=this.projection.pointCoordinate3D(this,_.x,_.y);v?(p=_.y,n=v):h=_.y}return n?new s.MercatorCoordinate(n[0],n[1],n[2]):this.pointCoordinate(i)}isPointAboveHorizon(i){return this.projection.isPointAboveHorizon(this,i)}isPointOnSurface(i){if(i.y<0||i.y>this.height||i.x<0||i.x>this.width)return!1;if(this.elevation||this.zoom>=s.GLOBE_ZOOM_THRESHOLD_MAX)return!this.isPointAboveHorizon(i);const n=this.pointCoordinate(i);return n.y>=0&&n.y<=1}_coordinatePoint(i,n){const h=n&&this.elevation?this.elevation.getAtPointOrZero(i,this._centerAltitude):this._centerAltitude,p=[i.x*this.worldSize,i.y*this.worldSize,h+i.toAltitude(),1];return s.transformMat4$1(p,p,this.pixelMatrix),p[3]>0?new s.Point(p[0]/p[3],p[1]/p[3]):new s.Point(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:i,left:n}=this._edgeInsets,h=this.height-this._edgeInsets.bottom,p=this.width-this._edgeInsets.right,m=this.pointLocation3D(new s.Point(n,i)),_=this.pointLocation3D(new s.Point(p,i)),y=this.pointLocation3D(new s.Point(p,h)),v=this.pointLocation3D(new s.Point(n,h));let E=Math.min(m.lng,_.lng,y.lng,v.lng),T=Math.max(m.lng,_.lng,y.lng,v.lng),M=Math.min(m.lat,_.lat,y.lat,v.lat),P=Math.max(m.lat,_.lat,y.lat,v.lat);const R=Math.pow(2,-this.zoom)/16*270,F=this.projection.name==="globe"?1:4,B=(O,A,L,N,V)=>{const H=(O+L)/2,J=(A+N)/2,K=new s.Point(H,J),{lng:re,lat:te}=this.pointLocation3D(K),le=Math.max(0,E-re,M-te,re-T,te-P);E=Math.min(E,re),T=Math.max(T,re),M=Math.min(M,te),P=Math.max(P,te),(V<F||le>R)&&(B(O,A,H,J,V+1),B(H,J,L,N,V+1))};if(B(n,i,p,i,1),B(p,i,p,h,1),B(p,h,n,h,1),B(n,h,n,i,1),this.projection.name==="globe"){const[O,A]=s.polesInViewport(this);O?(P=90,T=180,E=-180):A&&(M=-90,T=180,E=-180)}return new s.LngLatBounds(new s.LngLat(E,M),new s.LngLat(T,P))}_getBoundsRectangular(i,n){const{top:h,left:p}=this._edgeInsets,m=this.height-this._edgeInsets.bottom,_=this.width-this._edgeInsets.right,y=new s.Point(p,h),v=new s.Point(_,h),E=new s.Point(_,m),T=new s.Point(p,m);let M=this.pointCoordinate(y,i),P=this.pointCoordinate(v,i);const R=this.pointCoordinate(E,n),F=this.pointCoordinate(T,n),B=(O,A)=>(A.y-O.y)/(A.x-O.x);return M.y>1&&P.y>=0?M=new s.MercatorCoordinate((1-F.y)/B(F,M)+F.x,1):M.y<0&&P.y<=1&&(M=new s.MercatorCoordinate(-F.y/B(F,M)+F.x,0)),P.y>1&&M.y>=0?P=new s.MercatorCoordinate((1-R.y)/B(R,P)+R.x,1):P.y<0&&M.y<=1&&(P=new s.MercatorCoordinate(-R.y/B(R,P)+R.x,0)),new s.LngLatBounds().extend(this.coordinateLocation(M)).extend(this.coordinateLocation(P)).extend(this.coordinateLocation(F)).extend(this.coordinateLocation(R))}_getBoundsRectangularTerrain(){const i=this.elevation;if(!i.visibleDemTiles.length||i.isUsingMockSource())return this._getBoundsRectangular(0,0);const n=i.visibleDemTiles.reduce((h,p)=>{if(p.dem){const m=p.dem.tree;h.min=Math.min(h.min,m.minimums[0]),h.max=Math.max(h.max,m.maximums[0])}return h},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(n.min*i.exaggeration(),n.max*i.exaggeration())}getBounds(){return this.projection.name==="mercator"||this.projection.name==="equirectangular"?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(i=!0){const n=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))+this.centerOffset.y,h=this.height/2-n*(1-this._horizonShift);return i?Math.max(0,h):h}getMaxBounds(){return this.maxBounds}setMaxBounds(i){this.maxBounds=i,this.minLat=-s.MAX_MERCATOR_LATITUDE,this.maxLat=s.MAX_MERCATOR_LATITUDE,this.minLng=-180,this.maxLng=180,i&&(this.minLat=i.getSouth(),this.maxLat=i.getNorth(),this.minLng=i.getWest(),this.maxLng=i.getEast(),this.maxLng<this.minLng&&(this.maxLng+=360)),this.worldMinX=s.mercatorXfromLng(this.minLng)*this.tileSize,this.worldMaxX=s.mercatorXfromLng(this.maxLng)*this.tileSize,this.worldMinY=s.mercatorYfromLat(this.maxLat)*this.tileSize,this.worldMaxY=s.mercatorYfromLat(this.minLat)*this.tileSize,this._constrain()}calculatePosMatrix(i,n){return this.projection.createTileMatrix(this,n,i)}calculateDistanceTileData(i){const n=i.key,h=this._distanceTileDataCache;if(h[n])return h[n];const p=i.canonical,m=1/this.height,_=this.cameraWorldSize,y=_/this.zoomScale(p.z),v=(p.x+Math.pow(2,p.z)*i.wrap)*y,E=p.y*y,T=this.point;T.x*=_/this.worldSize,T.y*=_/this.worldSize;const M=this.angle,P=Math.sin(-M),R=-Math.cos(-M);return h[n]={bearing:[P,R],center:[(T.x-v)*m,(T.y-E)*m],scale:y/s.EXTENT*m},h[n]}calculateFogTileMatrix(i){const n=i.key,h=this._fogTileMatrixCache;if(h[n])return h[n];const p=this.projection.createTileMatrix(this,this.cameraWorldSizeForFog,i);return s.multiply(p,this.worldToFogMatrix,p),h[n]=new Float32Array(p),h[n]}calculateProjMatrix(i,n=!1){const h=i.key,p=n?this._alignedProjMatrixCache:this._projMatrixCache;if(p[h])return p[h];const m=this.calculatePosMatrix(i,this.worldSize);return s.multiply(m,this.projection.isReprojectedInTileSpace?this.mercatorMatrix:n?this.alignedProjMatrix:this.projMatrix,m),p[h]=new Float32Array(m),p[h]}calculatePixelsToTileUnitsMatrix(i){const n=i.tileID.key,h=this._pixelsToTileUnitsCache;if(h[n])return h[n];const p=function(m,_){const{scale:y}=m.tileTransform,v=y*s.EXTENT/(m.tileSize*Math.pow(2,_.zoom-m.tileID.overscaledZ+m.tileID.canonical.z));return E=new Float32Array(4),P=(T=_.inverseAdjustmentMatrix)[1],R=T[2],F=T[3],O=(M=[v,v])[1],E[0]=T[0]*(B=M[0]),E[1]=P*B,E[2]=R*O,E[3]=F*O,E;var E,T,M,P,R,F,B,O}(i,this);return h[n]=p,h[n]}customLayerMatrix(){return this.mercatorMatrix.slice()}globeToMercatorMatrix(){if(this.projection.name==="globe"){const i=1/this.worldSize,n=s.fromScaling([],[i,i,i]);return s.multiply(n,n,this.globeMatrix),n}}recenterOnTerrain(){if(!this._elevation||this.projection.name==="globe")return;const i=this._elevation;this._updateCameraState();const n=s.mercatorZfromAltitude(1,this._center.lat)*this.worldSize,h=this._computeCameraPosition(n),p=this._camera.forward(),m=s.mercatorZfromAltitude(1,this._center.lat);h[2]/=m,p[2]/=m,s.normalize(p,p);const _=i.raycast(h,p,i.exaggeration());if(_){const y=s.scaleAndAdd([],h,p,_),v=new s.MercatorCoordinate(y[0],y[1],s.mercatorZfromAltitude(y[2],s.latFromMercatorY(y[1]))),E=(v.z+s.length([v.x-h[0],v.y-h[1],v.z-h[2]*m]))*this._pixelsPerMercatorPixel;this._seaLevelZoom=this._zoomFromMercatorZ(E),this._centerAltitude=v.toAltitude(),this._center=this.coordinateLocation(v),this._updateZoomFromElevation(),this._constrain(),this._calcMatrices()}}_constrainCamera(i=!1){if(!this._elevation)return;const n=this._elevation,h=s.mercatorZfromAltitude(1,this._center.lat)*this.worldSize,p=this._computeCameraPosition(h),m=n.getAtPointOrZero(new s.MercatorCoordinate(...p)),_=this.pixelsPerMeter/this.worldSize*m,y=this._minimumHeightOverTerrain(),v=p[2]-_;if(v<=y)if(v<0||i){const E=this.locationCoordinate(this._center,this._centerAltitude),T=[p[0],p[1],E.z-p[2]],M=s.length(T);T[2]-=(y-v)/this._pixelsPerMercatorPixel;const P=s.length(T);if(P===0)return;s.scale$2(T,T,M/P*this._pixelsPerMercatorPixel),this._camera.position=[p[0],p[1],E.z*this._pixelsPerMercatorPixel-T[2]],this._updateStateFromCamera()}else this._isCameraConstrained=!0}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const i=this.projection.name==="globe"||this.mercatorFromTransition;if(this.projection.isReprojectedInTileSpace||i){const P=this.center;return P.lat=s.clamp(P.lat,this.minLat,this.maxLat),(this.maxBounds||!this.renderWorldCopies&&!i)&&(P.lng=s.clamp(P.lng,this.minLng,this.maxLng)),this.center=P,void(this._constraining=!1)}const n=this._unmodified,{x:h,y:p}=this.point;let m=0,_=h,y=p;const v=this.width/2,E=this.height/2,T=this.worldMinY*this.scale,M=this.worldMaxY*this.scale;if(p-E<T&&(y=T+E),p+E>M&&(y=M-E),M-T<this.height&&(m=Math.max(m,this.height/(M-T)),y=(M+T)/2),this.maxBounds||!this._renderWorldCopies||!this.projection.wrap){const P=this.worldMinX*this.scale,R=this.worldMaxX*this.scale,F=this.worldSize/2-(P+R)/2;_=(h+F+this.worldSize)%this.worldSize-F,_-v<P&&(_=P+v),_+v>R&&(_=R-v),R-P<this.width&&(m=Math.max(m,this.width/(R-P)),_=(R+P)/2)}_===h&&y===p||(this.center=this.unproject(new s.Point(_,y))),m&&(this.zoom+=this.scaleZoom(m)),this._constrainCamera(),this._unmodified=n,this._constraining=!1}_minZoomForBounds(){let i=Math.max(0,this.scaleZoom(this.height/(this.worldMaxY-this.worldMinY)));return this.maxBounds&&(i=Math.max(i,this.scaleZoom(this.width/(this.worldMaxX-this.worldMinX)))),i}_maxCameraBoundsDistance(){return this._mercatorZfromZoom(this._minZoomForBounds())}_calcMatrices(){if(!this.height)return;const i=this.centerOffset,n=this.pixelsPerMeter;this.projection.name==="globe"&&(this._mercatorScaleRatio=s.mercatorZfromAltitude(1,this.center.lat)/s.mercatorZfromAltitude(1,s.GLOBE_SCALE_MATCH_LATITUDE));const h=os(this.projection,this.zoom,this.width,this.height,1024);this._pixelsPerMercatorPixel=this.projection.pixelSpaceConversion(this.center.lat,this.worldSize,h),this.cameraToCenterDistance=.5/Math.tan(.5*this._fov)*this.height*this._pixelsPerMercatorPixel,this._updateCameraState(),this._farZ=this.projection.farthestPixelDistance(this),this._nearZ=this.height/50;const p=this.projection.zAxisUnit==="meters"?n:1,m=this._camera.getWorldToCamera(this.worldSize,p),_=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,this._farZ);_[8]=2*-i.x/this.width,_[9]=2*i.y/this.height;let y=s.mul([],_,m);if(this.projection.isReprojectedInTileSpace){const J=this.locationCoordinate(this.center),K=s.identity([]);s.translate(K,K,[J.x*this.worldSize,J.y*this.worldSize,0]),s.multiply(K,K,wn(this)),s.translate(K,K,[-J.x*this.worldSize,-J.y*this.worldSize,0]),s.multiply(y,y,K),this.inverseAdjustmentMatrix=function(re){const te=wn(re,!0);return De([],[te[0],te[1],te[4],te[5]])}(this)}else this.inverseAdjustmentMatrix=[1,0,0,1];this.mercatorMatrix=s.scale([],y,[this.worldSize,this.worldSize,this.worldSize/p,1]),this.projMatrix=y,this.invProjMatrix=s.invert(new Float64Array(16),this.projMatrix);const v=s.invert([],_);this.frustumCorners=s.FrustumCorners.fromInvProjectionMatrix(v,this.horizonLineFromTop(),this.height);const E=new Float32Array(16);s.identity(E),s.scale(E,E,[1,-1,1]),s.rotateX(E,E,this._pitch),s.rotateZ(E,E,this.angle);const T=s.perspective(new Float32Array(16),this._fov,this.width/this.height,this._nearZ,this._farZ),M=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;T[8]=2*-i.x/this.width,T[9]=2*(i.y+M)/this.height,this.skyboxMatrix=s.multiply(E,T,E);const P=this.point,R=P.x,F=P.y,B=this.width%2/2,O=this.height%2/2,A=Math.cos(this.angle),L=Math.sin(this.angle),N=R-Math.round(R)+A*B+L*O,V=F-Math.round(F)+A*O+L*B,H=new Float64Array(y);if(s.translate(H,H,[N>.5?N-1:N,V>.5?V-1:V,0]),this.alignedProjMatrix=H,y=s.create(),s.scale(y,y,[this.width/2,-this.height/2,1]),s.translate(y,y,[1,-1,0]),this.labelPlaneMatrix=y,y=s.create(),s.scale(y,y,[1,-1,1]),s.translate(y,y,[-1,-1,0]),s.scale(y,y,[2/this.width,2/this.height,1]),this.glCoordMatrix=y,this.pixelMatrix=s.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),this._calcFogMatrices(),this._distanceTileDataCache={},y=s.invert(new Float64Array(16),this.pixelMatrix),!y)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=y,this.projection.name==="globe"||this.mercatorFromTransition){this.globeMatrix=s.calculateGlobeMatrix(this);const J=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=s.transformMat4(J,J,m),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=y;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const i=this.cameraWorldSizeForFog,n=this.cameraPixelsPerMeter,h=this._camera.position,p=1/this.height/this._pixelsPerMercatorPixel,m=[i,i,n];s.scale$2(m,m,p),s.scale$2(h,h,-1),s.multiply$2(h,h,m);const _=s.create();s.translate(_,_,h),s.scale(_,_,m),this.mercatorFogMatrix=_,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(i,n,p)}_computeCameraPosition(i){const n=(i=i||this.pixelsPerMeter)/this.pixelsPerMeter,h=this._camera.forward(),p=this.point,m=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*n-i/this.worldSize*this._centerAltitude;return[p.x/this.worldSize-h[0]*m,p.y/this.worldSize-h[1]*m,i/this.worldSize*this._centerAltitude-h[2]*m]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(i){const n=this._maxCameraBoundsDistance()*Math.cos(this._pitch),h=this._camera.position[2],p=i[2];let m=1;this.projection.wrap&&(this.center=this.center.wrap()),p>0&&(m=Math.min((n-h)/p,1)),this._camera.position=s.scaleAndAdd([],this._camera.position,i,m),this._updateStateFromCamera()}_updateStateFromCamera(){const i=this._camera.position,n=this._camera.forward(),{pitch:h,bearing:p}=this._camera.getPitchBearing(),m=s.mercatorZfromAltitude(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,_=this._mercatorZfromZoom(this._maxZoom)*Math.cos(s.degToRad(this._maxPitch)),y=Math.max((i[2]-m)/Math.cos(h),_),v=this._zoomFromMercatorZ(y);s.scaleAndAdd(i,i,n,y),this._pitch=s.clamp(h,s.degToRad(this.minPitch),s.degToRad(this.maxPitch)),this.angle=s.wrap(p,-Math.PI,Math.PI),this._setZoom(s.clamp(v,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new s.MercatorCoordinate(i[0],i[1],i[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(i){return Math.pow(2,i)*this.tileSize}_mercatorZfromZoom(i){return this.cameraToCenterDistance/this._worldSizeFromZoom(i)}_minimumHeightOverTerrain(){const i=Math.min((this._seaLevelZoom!=null?this._seaLevelZoom:this._zoom)+4,this._maxZoom);return this._mercatorZfromZoom(i)}_zoomFromMercatorZ(i){return this.scaleZoom(this.cameraToCenterDistance/(i*this.tileSize))}zoomFromMercatorZAdjusted(i){let n=0,h=s.GLOBE_ZOOM_THRESHOLD_MAX,p=0,m=1/0;for(;h-n>1e-6&&h>n;){const _=n+.5*(h-n),y=this.tileSize*Math.pow(2,_),v=this.getCameraToCenterDistance(this.projection,_,y),E=this.scaleZoom(v/(i*this.tileSize)),T=Math.abs(_-E);T<m&&(m=T,p=_),_<E?n=_:h=_}return p}_terrainEnabled(){return!(!this._elevation||!this.projection.supportsTerrain&&(s.warnOnce("Terrain is not yet supported with alternate projections. Use mercator or globe to enable terrain."),1))}anyCornerOffEdge(i,n){const h=Math.min(i.x,n.x),p=Math.max(i.x,n.x),m=Math.min(i.y,n.y),_=Math.max(i.y,n.y);if(m<this.horizonLineFromTop(!1))return!0;if(this.projection.name!=="mercator")return!1;const y=[new s.Point(h,m),new s.Point(p,_),new s.Point(h,_),new s.Point(p,m)],v=this.renderWorldCopies?-3:0,E=this.renderWorldCopies?4:1;for(const T of y){const M=this.pointRayIntersection(T);if(M.t<0)return!0;const P=this.rayIntersectionCoordinate(M);if(P.x<v||P.y<0||P.x>E||P.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+s.radToDeg(this.fovAboveCenter)>88||this.anyCornerOffEdge(new s.Point(0,0),new s.Point(this.width,this.height))}zoomDeltaToMovement(i,n){const h=s.length(s.sub([],this._camera.position,i)),p=this._zoomFromMercatorZ(h)+n;return h-this._mercatorZfromZoom(p)}getCameraPoint(){if(this.projection.name==="globe"){const i=function([n,h,p],m){const _=[n,h,p,1];s.transformMat4$1(_,_,m);const y=_[3]=Math.max(_[3],1e-6);return _[0]/=y,_[1]/=y,_[2]/=y,_}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new s.Point(i[0],i[1])}{const i=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new s.Point(0,i))}}getCameraToCenterDistance(i,n=this.zoom,h=this.worldSize){const p=os(i,n,this.width,this.height,1024),m=i.pixelSpaceConversion(this.center.lat,h,p);return .5/Math.tan(.5*this._fov)*this.height*m}getWorldToCameraMatrix(){const i=this._camera.getWorldToCamera(this.worldSize,this.projection.zAxisUnit==="meters"?this.pixelsPerMeter:1);return this.projection.name==="globe"&&s.multiply(i,i,this.globeMatrix),i}}function Tn(l,i){let n=!1,h=null;const p=()=>{h=null,n&&(l(),h=setTimeout(p,i),n=!1)};return()=>(n=!0,h||p(),h)}class fl{constructor(i){this._hashName=i&&encodeURIComponent(i),s.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=Tn(this._updateHashUnthrottled.bind(this),300)}addTo(i){return this._map=i,s.window.addEventListener("hashchange",this._onHashChange,!1),i.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),s.window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const i=this._map;if(!i)return"";const n=ua(i);if(this._hashName){const h=this._hashName;let p=!1;const m=s.window.location.hash.slice(1).split("&").map(_=>{const y=_.split("=")[0];return y===h?(p=!0,`${y}=${n}`):_}).filter(_=>_);return p||m.push(`${h}=${n}`),`#${m.join("&")}`}return`#${n}`}_getCurrentHash(){const i=s.window.location.hash.replace("#","");if(this._hashName){let n;return i.split("&").map(h=>h.split("=")).forEach(h=>{h[0]===this._hashName&&(n=h)}),(n&&n[1]||"").split("/")}return i.split("/")}_onHashChange(){const i=this._map;if(!i)return!1;const n=this._getCurrentHash();if(n.length>=3&&!n.some(h=>isNaN(h))){const h=i.dragRotate.isEnabled()&&i.touchZoomRotate.isEnabled()?+(n[3]||0):i.getBearing();return i.jumpTo({center:[+n[2],+n[1]],zoom:+n[0],bearing:h,pitch:+(n[4]||0)}),!0}return!1}_updateHashUnthrottled(){const i=s.window.location.href.replace(/(#.+)?$/,this.getHashString());s.window.history.replaceState(s.window.history.state,null,i)}}function ua(l,i){const n=l.getCenter(),h=Math.round(100*l.getZoom())/100,p=Math.ceil((h*Math.LN2+Math.log(512/360/.5))/Math.LN10),m=Math.pow(10,p),_=Math.round(n.lng*m)/m,y=Math.round(n.lat*m)/m,v=l.getBearing(),E=l.getPitch();let T=i?`/${_}/${y}/${h}`:`${h}/${y}/${_}`;return(v||E)&&(T+="/"+Math.round(10*v)/10),E&&(T+=`/${Math.round(E)}`),T}const pa={linearity:.3,easing:s.bezier(0,0,.3,1)},as=s.extend({deceleration:2500,maxSpeed:1400},pa),ss=s.extend({deceleration:20,maxSpeed:1400},pa),Oe=s.extend({deceleration:1e3,maxSpeed:360},pa),Mi=s.extend({deceleration:1e3,maxSpeed:90},pa);class Vc{constructor(i){this._map=i,this.clear()}clear(){this._inertiaBuffer=[]}record(i){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:s.exported.now(),settings:i})}_drainInertiaBuffer(){const i=this._inertiaBuffer,n=s.exported.now();for(;i.length>0&&n-i[0].time>160;)i.shift()}_onMoveEnd(i){if(this._map._prefersReducedMotion()||(this._drainInertiaBuffer(),this._inertiaBuffer.length<2))return;const n={zoom:0,bearing:0,pitch:0,pan:new s.Point(0,0),pinchAround:void 0,around:void 0};for(const{settings:m}of this._inertiaBuffer)n.zoom+=m.zoomDelta||0,n.bearing+=m.bearingDelta||0,n.pitch+=m.pitchDelta||0,m.panDelta&&n.pan._add(m.panDelta),m.around&&(n.around=m.around),m.pinchAround&&(n.pinchAround=m.pinchAround);const h=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,p={};if(n.pan.mag()){const m=ma(n.pan.mag(),h,s.extend({},as,i||{}));p.offset=n.pan.mult(m.amount/n.pan.mag()),p.center=this._map.transform.center,da(p,m)}if(n.zoom){const m=ma(n.zoom,h,ss);p.zoom=this._map.transform.zoom+m.amount,da(p,m)}if(n.bearing){const m=ma(n.bearing,h,Oe);p.bearing=this._map.transform.bearing+s.clamp(m.amount,-179,179),da(p,m)}if(n.pitch){const m=ma(n.pitch,h,Mi);p.pitch=this._map.transform.pitch+m.amount,da(p,m)}if(p.zoom||p.bearing){const m=n.pinchAround===void 0?n.around:n.pinchAround;p.around=m?this._map.unproject(m):this._map.getCenter()}return this.clear(),p.noMoveStart=!0,p}}function da(l,i){(!l.duration||l.duration<i.duration)&&(l.duration=i.duration,l.easing=i.easing)}function ma(l,i,n){const{maxSpeed:h,linearity:p,deceleration:m}=n,_=s.clamp(l*p/(i/1e3),-h,h),y=Math.abs(_)/(m*p);return{easing:n.easing,duration:1e3*y,amount:_*(y/2)}}class Ir extends s.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(i,n,h,p={}){const m=Ur(n.getCanvasContainer(),h),_=n.unproject(m);super(i,s.extend({point:m,lngLat:_,originalEvent:h},p)),this._defaultPrevented=!1,this.target=n}}class fa extends s.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(i,n,h){const p=i==="touchend"?h.changedTouches:h.touches,m=Rr(n.getCanvasContainer(),p),_=m.map(v=>n.unproject(v)),y=m.reduce((v,E,T,M)=>v.add(E.div(M.length)),new s.Point(0,0));super(i,{points:m,point:y,lngLats:_,lngLat:n.unproject(y),originalEvent:h}),this._defaultPrevented=!1}}class ls extends s.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(i,n,h){super(i,{originalEvent:h}),this._defaultPrevented=!1}}class gl{constructor(i,n){this._map=i,this._clickTolerance=n.clickTolerance}reset(){this._mousedownPos=void 0}wheel(i){return this._firePreventable(new ls(i.type,this._map,i))}mousedown(i,n){return this._mousedownPos=n,this._firePreventable(new Ir(i.type,this._map,i))}mouseup(i){this._map.fire(new Ir(i.type,this._map,i))}preclick(i){const n=s.extend({},i);n.type="preclick",this._map.fire(new Ir(n.type,this._map,n))}click(i,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||(this.preclick(i),this._map.fire(new Ir(i.type,this._map,i)))}dblclick(i){return this._firePreventable(new Ir(i.type,this._map,i))}mouseover(i){this._map.fire(new Ir(i.type,this._map,i))}mouseout(i){this._map.fire(new Ir(i.type,this._map,i))}touchstart(i){return this._firePreventable(new fa(i.type,this._map,i))}touchmove(i){this._map.fire(new fa(i.type,this._map,i))}touchend(i){this._map.fire(new fa(i.type,this._map,i))}touchcancel(i){this._map.fire(new fa(i.type,this._map,i))}_firePreventable(i){if(this._map.fire(i),i.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class cs{constructor(i){this._map=i}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(i){this._map.fire(new Ir(i.type,this._map,i))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ir("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(i){this._delayContextMenu?this._contextMenuEvent=i:this._map.fire(new Ir(i.type,this._map,i)),this._map.listens("contextmenu")&&i.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Gc{constructor(i,n){this._map=i,this._el=i.getCanvasContainer(),this._container=i.getContainer(),this._clickTolerance=n.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(i,n){this.isEnabled()&&i.shiftKey&&i.button===0&&(Ei(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(i,n){if(!this._active)return;const h=n,p=this._startPos,m=this._lastPos;if(!p||!m||m.equals(h)||!this._box&&h.dist(p)<this._clickTolerance)return;this._lastPos=h,this._box||(this._box=Je("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",i));const _=Math.min(p.x,h.x),y=Math.max(p.x,h.x),v=Math.min(p.y,h.y),E=Math.max(p.y,h.y);this._map._requestDomTask(()=>{this._box&&(this._box.style.transform=`translate(${_}px,${v}px)`,this._box.style.width=y-_+"px",this._box.style.height=E-v+"px")})}mouseupWindow(i,n){if(!this._active)return;const h=this._startPos,p=n;if(h&&i.button===0){if(this.reset(),fo(),h.x!==p.x||h.y!==p.y)return this._map.fire(new s.Event("boxzoomend",{originalEvent:i})),{cameraAnimation:m=>m.fitScreenCoordinates(h,p,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",i)}}keydown(i){this._active&&i.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",i))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),ki(),delete this._startPos,delete this._lastPos}_fireEvent(i,n){return this._map.fire(new s.Event(i,{originalEvent:n}))}}function hs(l,i){const n={};for(let h=0;h<l.length;h++)n[l[h].identifier]=i[h];return n}class En{constructor(i){this.reset(),this.numTouches=i.numTouches}reset(){this.centroid=void 0,this.startTime=0,this.touches={},this.aborted=!1}touchstart(i,n,h){(this.centroid||h.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===0&&(this.startTime=i.timeStamp),h.length===this.numTouches&&(this.centroid=function(p){const m=new s.Point(0,0);for(const _ of p)m._add(_);return m.div(p.length)}(n),this.touches=hs(h,n)))}touchmove(i,n,h){if(this.aborted||!this.centroid)return;const p=hs(h,n);for(const m in this.touches){const _=p[m];(!_||_.dist(this.touches[m])>30)&&(this.aborted=!0)}}touchend(i,n,h){if((!this.centroid||i.timeStamp-this.startTime>500)&&(this.aborted=!0),h.length===0){const p=!this.aborted&&this.centroid;if(this.reset(),p)return p}}}class _l{constructor(i){this.singleTap=new En(i),this.numTaps=i.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(i,n,h){this.singleTap.touchstart(i,n,h)}touchmove(i,n,h){this.singleTap.touchmove(i,n,h)}touchend(i,n,h){const p=this.singleTap.touchend(i,n,h);if(p){const m=i.timeStamp-this.lastTime<500,_=!this.lastTap||this.lastTap.dist(p)<30;if(m&&_||this.reset(),this.count++,this.lastTime=i.timeStamp,this.lastTap=p,this.count===this.numTaps)return this.reset(),p}}}class iu{constructor(){this._zoomIn=new _l({numTouches:1,numTaps:2}),this._zoomOut=new _l({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(i,n,h){this._zoomIn.touchstart(i,n,h),this._zoomOut.touchstart(i,n,h)}touchmove(i,n,h){this._zoomIn.touchmove(i,n,h),this._zoomOut.touchmove(i,n,h)}touchend(i,n,h){const p=this._zoomIn.touchend(i,n,h),m=this._zoomOut.touchend(i,n,h);return p?(this._active=!0,i.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:_=>_.easeTo({duration:300,zoom:_.getZoom()+1,around:_.unproject(p)},{originalEvent:i})}):m?(this._active=!0,i.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:_=>_.easeTo({duration:300,zoom:_.getZoom()-1,around:_.unproject(m)},{originalEvent:i})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const $c={0:1,2:2};class kn{constructor(i){this.reset(),this._clickTolerance=i.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(i,n){return!1}_move(i,n){return{}}mousedown(i,n){if(this._lastPoint)return;const h=jr(i);this._correctButton(i,h)&&(this._lastPoint=n,this._eventButton=h)}mousemoveWindow(i,n){const h=this._lastPoint;if(h){if(i.preventDefault(),this._eventButton!=null&&function(p,m){const _=$c[m];return p.buttons===void 0||(p.buttons&_)!==_}(i,this._eventButton))this.reset();else if(this._moved||!(n.dist(h)<this._clickTolerance))return this._moved=!0,this._lastPoint=n,this._move(h,n)}}mouseupWindow(i){this._lastPoint&&jr(i)===this._eventButton&&(this._moved&&fo(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class yl extends kn{mousedown(i,n){super.mousedown(i,n),this._lastPoint&&(this._active=!0)}_correctButton(i,n){return n===0&&!i.ctrlKey}_move(i,n){return{around:n,panDelta:n.sub(i)}}}class xl extends kn{_correctButton(i,n){return n===0&&i.ctrlKey||n===2}_move(i,n){const h=.8*(n.x-i.x);if(h)return this._active=!0,{bearingDelta:h}}contextmenu(i){i.preventDefault()}}class vl extends kn{_correctButton(i,n){return n===0&&i.ctrlKey||n===2}_move(i,n){const h=-.5*(n.y-i.y);if(h)return this._active=!0,{pitchDelta:h}}contextmenu(i){i.preventDefault()}}class us{constructor(i,n){this._map=i,this._el=i.getCanvasContainer(),this._minTouches=1,this._clickTolerance=n.clickTolerance||1,this.reset(),s.bindAll(["_addTouchPanBlocker","_showTouchPanBlockerAlert"],this)}reset(){this._active=!1,this._touches={},this._sum=new s.Point(0,0)}touchstart(i,n,h){return this._calculateTransform(i,n,h)}touchmove(i,n,h){if(this._active&&!(h.length<this._minTouches)){if(this._map._cooperativeGestures&&!this._map.isMoving()){if(h.length===1&&!s.isFullscreen())return void this._showTouchPanBlockerAlert();this._alertContainer.style.visibility!=="hidden"&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}return i.cancelable&&i.preventDefault(),this._calculateTransform(i,n,h)}}touchend(i,n,h){this._calculateTransform(i,n,h),this._active&&h.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(i,n,h){h.length>0&&(this._active=!0);const p=hs(h,n),m=new s.Point(0,0),_=new s.Point(0,0);let y=0;for(const E in p){const T=p[E],M=this._touches[E];M&&(m._add(T),_._add(T.sub(M)),y++,p[E]=T)}if(this._touches=p,y<this._minTouches||!_.mag())return;const v=_.div(y);return this._sum._add(v),this._sum.mag()<this._clickTolerance?void 0:{around:m.div(y),panDelta:v}}enable(){this._enabled=!0,this._map._cooperativeGestures&&(this._addTouchPanBlocker(),this._el.classList.add("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page"))}disable(){this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove(),this._el.classList.remove("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page")),this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}_addTouchPanBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=Je("div","mapboxgl-touch-pan-blocker",this._map._container),this._alertContainer.textContent=this._map._getUIString("TouchPanBlocker.Message"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showTouchPanBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","null")},500)}}class ga{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(i){}_move(i,n,h){return{}}touchstart(i,n,h){this._firstTwoTouches||h.length<2||(this._firstTwoTouches=[h[0].identifier,h[1].identifier],this._start([n[0],n[1]]))}touchmove(i,n,h){const p=this._firstTwoTouches;if(!p)return;i.preventDefault();const[m,_]=p,y=_a(h,n,m),v=_a(h,n,_);if(!y||!v)return;const E=this._aroundCenter?null:y.add(v).div(2);return this._move([y,v],E,i)}touchend(i,n,h){if(!this._firstTwoTouches)return;const[p,m]=this._firstTwoTouches,_=_a(h,n,p),y=_a(h,n,m);_&&y||(this._active&&fo(),this.reset())}touchcancel(){this.reset()}enable(i){this._enabled=!0,this._aroundCenter=!!i&&i.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function _a(l,i,n){for(let h=0;h<l.length;h++)if(l[h].identifier===n)return i[h]}function wl(l,i){return Math.log(l/i)/Math.LN2}class qc extends ga{reset(){super.reset(),this._distance=0,this._startDistance=0}_start(i){this._startDistance=this._distance=i[0].dist(i[1])}_move(i,n){const h=this._distance;if(this._distance=i[0].dist(i[1]),this._active||!(Math.abs(wl(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:wl(this._distance,h),pinchAround:n}}}function bl(l,i){return 180*l.angleWith(i)/Math.PI}class Zc extends ga{reset(){super.reset(),this._minDiameter=0,this._startVector=void 0,this._vector=void 0}_start(i){this._startVector=this._vector=i[0].sub(i[1]),this._minDiameter=i[0].dist(i[1])}_move(i,n){const h=this._vector;if(this._vector=i[0].sub(i[1]),h&&(this._active||!this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:bl(this._vector,h),pinchAround:n}}_isBelowThreshold(i){this._minDiameter=Math.min(this._minDiameter,i.mag());const n=25/(Math.PI*this._minDiameter)*360,h=this._startVector;if(!h)return!1;const p=bl(i,h);return Math.abs(p)<n}}function bo(l){return Math.abs(l.y)>Math.abs(l.x)}class Xc extends ga{constructor(i){super(),this._map=i}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(i){this._lastPoints=i,bo(i[0].sub(i[1]))&&(this._valid=!1)}_move(i,n,h){const p=this._lastPoints;if(!p)return;const m=i[0].sub(p[0]),_=i[1].sub(p[1]);return this._map._cooperativeGestures&&!s.isFullscreen()&&h.touches.length<3||(this._valid=this.gestureBeginsVertically(m,_,h.timeStamp),!this._valid)?void 0:(this._lastPoints=i,this._active=!0,{pitchDelta:(m.y+_.y)/2*-.5})}gestureBeginsVertically(i,n,h){if(this._valid!==void 0)return this._valid;const p=i.mag()>=2,m=n.mag()>=2;if(!p&&!m)return;if(!p||!m)return this._firstMove==null&&(this._firstMove=h),h-this._firstMove<100&&void 0;const _=i.y>0==n.y>0;return bo(i)&&bo(n)&&_}}const Wc={panStep:100,bearingStep:15,pitchStep:10};class ou{constructor(){const i=Wc;this._panStep=i.panStep,this._bearingStep=i.bearingStep,this._pitchStep=i.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(i){if(i.altKey||i.ctrlKey||i.metaKey)return;let n=0,h=0,p=0,m=0,_=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?h=-1:(i.preventDefault(),m=-1);break;case 39:i.shiftKey?h=1:(i.preventDefault(),m=1);break;case 38:i.shiftKey?p=1:(i.preventDefault(),_=-1);break;case 40:i.shiftKey?p=-1:(i.preventDefault(),_=1);break;default:return}return this._rotationDisabled&&(h=0,p=0),{cameraAnimation:y=>{const v=y.getZoom();y.easeTo({duration:300,easeId:"keyboardHandler",easing:Yc,zoom:n?Math.round(v)+n*(i.shiftKey?2:1):v,bearing:y.getBearing()+h*this._bearingStep,pitch:y.getPitch()+p*this._pitchStep,offset:[-m*this._panStep,-_*this._panStep],center:y.getCenter()},{originalEvent:i})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Yc(l){return l*(2-l)}const Tl=4.000244140625;class Hc{constructor(i,n){this._map=i,this._el=i.getCanvasContainer(),this._handler=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,s.bindAll(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(i){this._defaultZoomRate=i}setWheelZoomRate(i){this._wheelZoomRate=i}isEnabled(){return!!this._enabled}isActive(){return this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(i){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!i&&i.around==="center",this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(i){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(i.ctrlKey||i.metaKey||this.isZooming()||s.isFullscreen()))return void this._showBlockerAlert();this._alertContainer.style.visibility!=="hidden"&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let n=i.deltaMode===s.window.WheelEvent.DOM_DELTA_LINE?40*i.deltaY:i.deltaY;const h=s.exported.now(),p=h-(this._lastWheelEventTime||0);this._lastWheelEventTime=h,n!==0&&n%Tl==0?this._type="wheel":n!==0&&Math.abs(n)<4?this._type="trackpad":p>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,i)):this._type||(this._type=Math.abs(p*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),i.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=i,this._delta-=n,this._active||this._start(i)),i.preventDefault()}_onTimeout(i){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(i)}_start(i){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const n=Ur(this._el,i);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:n,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const i=this._map.transform;this._type==="wheel"&&i.projection.wrap&&(i._center.lng>=180||i._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const n=()=>i._terrainEnabled()&&this._aroundCoord?i.computeZoomRelativeTo(this._aroundCoord):i.zoom;if(this._delta!==0){const v=this._type==="wheel"&&Math.abs(this._delta)>Tl?this._wheelZoomRate:this._defaultZoomRate;let E=2/(1+Math.exp(-Math.abs(this._delta*v)));this._delta<0&&E!==0&&(E=1/E);const T=n(),M=Math.pow(2,T),P=typeof this._targetZoom=="number"?i.zoomScale(this._targetZoom):M;this._targetZoom=Math.min(i.maxZoom,Math.max(i.minZoom,i.scaleZoom(P*E))),this._type==="wheel"&&(this._startZoom=T,this._easing=this._smoothOutEasing(200)),this._delta=0}const h=typeof this._targetZoom=="number"?this._targetZoom:n(),p=this._startZoom,m=this._easing;let _,y=!1;if(this._type==="wheel"&&p&&m){const v=Math.min((s.exported.now()-this._lastWheelEventTime)/200,1),E=m(v);_=s.number(p,h,E),v<1?this._frameId||(this._frameId=!0):y=!0}else _=h,y=!0;return this._active=!0,y&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!y,zoomDelta:_-n(),around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(i){let n=s.ease;if(this._prevEase){const h=this._prevEase,p=(s.exported.now()-h.start)/h.duration,m=h.easing(p+.01)-h.easing(p),_=.27/Math.sqrt(m*m+1e-4)*.01,y=Math.sqrt(.0729-_*_);n=s.bezier(_,y,.25,1)}return this._prevEase={start:s.exported.now(),duration:i,easing:n},n}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=Je("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(s.window.navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","null")},200)}}class Kc{constructor(i,n){this._clickZoom=i,this._tapZoom=n}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Vr{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(i,n){return i.preventDefault(),{cameraAnimation:h=>{h.easeTo({duration:300,zoom:h.getZoom()+(i.shiftKey?-1:1),around:h.unproject(n)},{originalEvent:i})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class nu{constructor(){this._tap=new _l({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(i,n,h){this._swipePoint||(this._tapTime&&i.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?h.length>0&&(this._swipePoint=n[0],this._swipeTouch=h[0].identifier):this._tap.touchstart(i,n,h))}touchmove(i,n,h){if(this._tapTime){if(this._swipePoint){if(h[0].identifier!==this._swipeTouch)return;const p=n[0],m=p.y-this._swipePoint.y;return this._swipePoint=p,i.preventDefault(),this._active=!0,{zoomDelta:m/128}}}else this._tap.touchmove(i,n,h)}touchend(i,n,h){this._tapTime?this._swipePoint&&h.length===0&&this.reset():this._tap.touchend(i,n,h)&&(this._tapTime=i.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Jc{constructor(i,n,h){this._el=i,this._mousePan=n,this._touchPan=h}enable(i){this._inertiaOptions=i||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class au{constructor(i,n,h){this._pitchWithRotate=i.pitchWithRotate,this._mouseRotate=n,this._mousePitch=h}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class su{constructor(i,n,h,p){this._el=i,this._touchZoom=n,this._touchRotate=h,this._tapDragZoom=p,this._rotationDisabled=!1,this._enabled=!0}enable(i){this._touchZoom.enable(i),this._rotationDisabled||this._touchRotate.enable(i),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const yi=l=>l.zoom||l.drag||l.pitch||l.rotate;class Qc extends s.Event{}class lu{constructor(){this.constants=[1,1,.01],this.radius=0}setup(i,n){const h=s.sub([],n,i);this.radius=s.length(h[2]<0?s.div([],h,this.constants):[h[0],h[1],0])}projectRay(i){s.div(i,i,this.constants),s.normalize(i,i),s.mul$1(i,i,this.constants);const n=s.scale$2([],i,this.radius);if(n[2]>0){const h=s.scale$2([],[0,0,1],s.dot(n,[0,0,1])),p=s.scale$2([],s.normalize([],[n[0],n[1],0]),this.radius),m=s.add([],n,s.scale$2([],s.sub([],s.add([],p,h),n),2));n[0]=m[0],n[1]=m[1]}return n}}function Ai(l){return l.panDelta&&l.panDelta.mag()||l.zoomDelta||l.bearingDelta||l.pitchDelta}class Oi{constructor(i,n){this._map=i,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Vc(i),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new lu,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(n),s.bindAll(["handleEvent","handleWindowEvent"],this);const h=this._el;this._listeners=[[h,"touchstart",{passive:!0}],[h,"touchmove",{passive:!1}],[h,"touchend",void 0],[h,"touchcancel",void 0],[h,"mousedown",void 0],[h,"mousemove",void 0],[h,"mouseup",void 0],[s.window.document,"mousemove",{capture:!0}],[s.window.document,"mouseup",void 0],[h,"mouseover",void 0],[h,"mouseout",void 0],[h,"dblclick",void 0],[h,"click",void 0],[h,"keydown",{capture:!1}],[h,"keyup",void 0],[h,"wheel",{passive:!1}],[h,"contextmenu",void 0],[s.window,"blur",void 0]];for(const[p,m,_]of this._listeners)p.addEventListener(m,p===s.window.document?this.handleWindowEvent:this.handleEvent,_)}destroy(){for(const[i,n,h]of this._listeners)i.removeEventListener(n,i===s.window.document?this.handleWindowEvent:this.handleEvent,h)}_addDefaultHandlers(i){const n=this._map,h=n.getCanvasContainer();this._add("mapEvent",new gl(n,i));const p=n.boxZoom=new Gc(n,i);this._add("boxZoom",p);const m=new iu,_=new Vr;n.doubleClickZoom=new Kc(_,m),this._add("tapZoom",m),this._add("clickZoom",_);const y=new nu;this._add("tapDragZoom",y);const v=n.touchPitch=new Xc(n);this._add("touchPitch",v);const E=new xl(i),T=new vl(i);n.dragRotate=new au(i,E,T),this._add("mouseRotate",E,["mousePitch"]),this._add("mousePitch",T,["mouseRotate"]);const M=new yl(i),P=new us(n,i);n.dragPan=new Jc(h,M,P),this._add("mousePan",M),this._add("touchPan",P,["touchZoom","touchRotate"]);const R=new Zc,F=new qc;n.touchZoomRotate=new su(h,F,R,y),this._add("touchRotate",R,["touchPan","touchZoom"]),this._add("touchZoom",F,["touchPan","touchRotate"]),this._add("blockableMapEvent",new cs(n));const B=n.scrollZoom=new Hc(n,this);this._add("scrollZoom",B,["mousePan"]);const O=n.keyboard=new ou;this._add("keyboard",O);for(const A of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])i.interactive&&i[A]&&n[A].enable(i[A])}_add(i,n,h){this._handlers.push({handlerName:i,handler:n,allowed:h}),this._handlersById[i]=n}stop(i){if(!this._updatingCamera){for(const{handler:n}of this._handlers)n.reset();this._inertia.clear(),this._fireEvents({},{},i),this._changes=[]}}isActive(){for(const{handler:i}of this._handlers)if(i.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!yi(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(i,n,h){for(const p in i)if(p!==h&&(!n||n.indexOf(p)<0))return!0;return!1}handleWindowEvent(i){this.handleEvent(i,`${i.type}Window`)}_getMapTouches(i){const n=[];for(const h of i)this._el.contains(h.target)&&n.push(h);return n}handleEvent(i,n){this._updatingCamera=!0;const h=i.type==="renderFrame",p=h?void 0:i,m={needsRenderFrame:!1},_={},y={},v=i.touches?this._getMapTouches(i.touches):void 0,E=v?Rr(this._el,v):h?void 0:Ur(this._el,i);for(const{handlerName:P,handler:R,allowed:F}of this._handlers){if(!R.isEnabled())continue;let B;this._blockedByActive(y,F,P)?R.reset():R[n||i.type]&&(B=R[n||i.type](i,E,v),this.mergeHandlerResult(m,_,B,P,p),B&&B.needsRenderFrame&&this._triggerRenderFrame()),(B||R.isActive())&&(y[P]=R)}const T={};for(const P in this._previousActiveHandlers)y[P]||(T[P]=p);this._previousActiveHandlers=y,(Object.keys(T).length||Ai(m))&&(this._changes.push([m,_,T]),this._triggerRenderFrame()),(Object.keys(y).length||Ai(m))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:M}=m;M&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],M(this._map))}mergeHandlerResult(i,n,h,p,m){if(!h)return;s.extend(i,h);const _={handlerName:p,originalEvent:h.originalEvent||m};h.zoomDelta!==void 0&&(n.zoom=_),h.panDelta!==void 0&&(n.drag=_),h.pitchDelta!==void 0&&(n.pitch=_),h.bearingDelta!==void 0&&(n.rotate=_)}_applyChanges(){const i={},n={},h={};for(const[p,m,_]of this._changes)p.panDelta&&(i.panDelta=(i.panDelta||new s.Point(0,0))._add(p.panDelta)),p.zoomDelta&&(i.zoomDelta=(i.zoomDelta||0)+p.zoomDelta),p.bearingDelta&&(i.bearingDelta=(i.bearingDelta||0)+p.bearingDelta),p.pitchDelta&&(i.pitchDelta=(i.pitchDelta||0)+p.pitchDelta),p.around!==void 0&&(i.around=p.around),p.aroundCoord!==void 0&&(i.aroundCoord=p.aroundCoord),p.pinchAround!==void 0&&(i.pinchAround=p.pinchAround),p.noInertia&&(i.noInertia=p.noInertia),s.extend(n,m),s.extend(h,_);this._updateMapTransform(i,n,h),this._changes=[]}_updateMapTransform(i,n,h){const p=this._map,m=p.transform,_=L=>[L.x,L.y,L.z];if((L=>{const N=this._eventsInProgress.drag;return N&&!this._handlersById[N.handlerName].isActive()})()&&!Ai(i)){const L=m.zoom;m.cameraElevationReference="sea",m.recenterOnTerrain(),m.cameraElevationReference="ground",L!==m.zoom&&this._map._update(!0)}if(m._isCameraConstrained&&p._stop(!0),!Ai(i))return void this._fireEvents(n,h,!0);let{panDelta:y,zoomDelta:v,bearingDelta:E,pitchDelta:T,around:M,aroundCoord:P,pinchAround:R}=i;m._isCameraConstrained&&(v>0&&(v=0),m._isCameraConstrained=!1),R!==void 0&&(M=R),(v||(L=>n[L]&&!this._eventsInProgress[L])("drag"))&&M&&(this._dragOrigin=_(m.pointCoordinate3D(M)),this._trackingEllipsoid.setup(m._camera.position,this._dragOrigin)),m.cameraElevationReference="sea",p._stop(!0),M=M||p.transform.centerPoint,E&&(m.bearing+=E),T&&(m.pitch+=T),m._updateCameraState();const F=[0,0,0];if(y)if(m.projection.name==="mercator"){const L=this._trackingEllipsoid.projectRay(m.screenPointToMercatorRay(M).dir),N=this._trackingEllipsoid.projectRay(m.screenPointToMercatorRay(M.sub(y)).dir);F[0]=N[0]-L[0],F[1]=N[1]-L[1]}else{const L=m.pointCoordinate(M);if(m.projection.name==="globe"){y=y.rotate(-m.angle);const N=m._pixelsPerMercatorPixel/m.worldSize;F[0]=-y.x*s.mercatorScale(s.latFromMercatorY(L.y))*N,F[1]=-y.y*s.mercatorScale(m.center.lat)*N}else{const N=m.pointCoordinate(M.sub(y));L&&N&&(F[0]=N.x-L.x,F[1]=N.y-L.y)}}const B=m.zoom,O=[0,0,0];if(v){const L=_(P||m.pointCoordinate3D(M)),N={dir:s.normalize([],s.sub([],L,m._camera.position))};if(N.dir[2]<0){const V=m.zoomDeltaToMovement(L,v);s.scale$2(O,N.dir,V)}}const A=s.add(F,F,O);m._translateCameraConstrained(A),v&&Math.abs(m.zoom-B)>1e-4&&m.recenterOnTerrain(),m.cameraElevationReference="ground",this._map._update(),i.noInertia||this._inertia.record(i),this._fireEvents(n,h,!0)}_fireEvents(i,n,h){const p=yi(this._eventsInProgress),m=yi(i),_={};for(const T in i){const{originalEvent:M}=i[T];this._eventsInProgress[T]||(_[`${T}start`]=M),this._eventsInProgress[T]=i[T]}!p&&m&&this._fireEvent("movestart",m.originalEvent);for(const T in _)this._fireEvent(T,_[T]);m&&this._fireEvent("move",m.originalEvent);for(const T in i){const{originalEvent:M}=i[T];this._fireEvent(T,M)}const y={};let v;for(const T in this._eventsInProgress){const{handlerName:M,originalEvent:P}=this._eventsInProgress[T];this._handlersById[M].isActive()||(delete this._eventsInProgress[T],v=n[M]||P,y[`${T}end`]=v)}for(const T in y)this._fireEvent(T,y[T]);const E=yi(this._eventsInProgress);if(h&&(p||m)&&!E){this._updatingCamera=!0;const T=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),M=P=>P!==0&&-this._bearingSnap<P&&P<this._bearingSnap;T?(M(T.bearing||this._map.getBearing())&&(T.bearing=0),this._map.easeTo(T,{originalEvent:v})):(this._map.fire(new s.Event("moveend",{originalEvent:v})),M(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(i,n){this._map.fire(new s.Event(i,n?{originalEvent:n}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(i=>{this._frameId=void 0,this.handleEvent(new Qc("renderFrame",{timeStamp:i})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}const $o="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class ps extends s.Evented{constructor(i,n){super(),this._moving=!1,this._zooming=!1,this.transform=i,this._bearingSnap=n.bearingSnap,this._respectPrefersReducedMotion=n.respectPrefersReducedMotion!==!1,s.bindAll(["_renderFrameCallback"],this)}getCenter(){return new s.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(i,n){return this.jumpTo({center:i},n)}panBy(i,n,h){return i=s.Point.convert(i).mult(-1),this.panTo(this.transform.center,s.extend({offset:i},n),h)}panTo(i,n,h){return this.easeTo(s.extend({center:i},n),h)}getZoom(){return this.transform.zoom}setZoom(i,n){return this.jumpTo({zoom:i},n),this}zoomTo(i,n,h){return this.easeTo(s.extend({zoom:i},n),h)}zoomIn(i,n){return this.zoomTo(this.getZoom()+1,i,n),this}zoomOut(i,n){return this.zoomTo(this.getZoom()-1,i,n),this}getBearing(){return this.transform.bearing}setBearing(i,n){return this.jumpTo({bearing:i},n),this}getPadding(){return this.transform.padding}setPadding(i,n){return this.jumpTo({padding:i},n),this}rotateTo(i,n,h){return this.easeTo(s.extend({bearing:i},n),h)}resetNorth(i,n){return this.rotateTo(0,s.extend({duration:1e3},i),n),this}resetNorthPitch(i,n){return this.easeTo(s.extend({bearing:0,pitch:0,duration:1e3},i),n),this}snapToNorth(i,n){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(i,n):this}getPitch(){return this.transform.pitch}setPitch(i,n){return this.jumpTo({pitch:i},n),this}cameraForBounds(i,n){i=s.LngLatBounds.convert(i);const h=n&&n.bearing||0,p=n&&n.pitch||0,m=i.getNorthWest(),_=i.getSouthEast();return this._cameraForBounds(this.transform,m,_,h,p,n)}_extendCameraOptions(i){const n={top:0,bottom:0,right:0,left:0};if(typeof(i=s.extend({padding:n,offset:[0,0],maxZoom:this.transform.maxZoom},i)).padding=="number"){const h=i.padding;i.padding={top:h,bottom:h,right:h,left:h}}return i.padding=s.extend(n,i.padding),i}_minimumAABBFrustumDistance(i,n){const h=n.max[0]-n.min[0],p=n.max[1]-n.min[1];return h/p>i.aspect?h/(2*Math.tan(.5*i.fovX)*i.aspect):p/(2*Math.tan(.5*i.fovY)*i.aspect)}_cameraForBoundsOnGlobe(i,n,h,p,m,_){const y=i.clone(),v=this._extendCameraOptions(_);y.bearing=p,y.pitch=m;const E=s.LngLat.convert(n),T=s.LngLat.convert(h),M=.5*(E.lat+T.lat),P=.5*(E.lng+T.lng),R=s.latLngToECEF(M,P),F=s.normalize([],R),B=s.normalize([],s.cross([],F,[0,1,0])),O=s.cross([],B,F),A=[B[0],B[1],B[2],0,O[0],O[1],O[2],0,F[0],F[1],F[2],0,0,0,0,1],L=[R,s.latLngToECEF(E.lat,E.lng),s.latLngToECEF(T.lat,E.lng),s.latLngToECEF(T.lat,T.lng),s.latLngToECEF(E.lat,T.lng),s.latLngToECEF(M,E.lng),s.latLngToECEF(M,T.lng),s.latLngToECEF(E.lat,P),s.latLngToECEF(T.lat,P)];let N=s.Aabb.fromPoints(L.map(we=>[s.dot(B,we),s.dot(O,we),s.dot(F,we)]));const V=s.transformMat4([],N.center,A);s.squaredLength(V)===0&&s.set(V,0,0,1),s.normalize(V,V),s.scale$2(V,V,s.GLOBE_RADIUS),y.center=s.ecefToLatLng(V);const H=y.getWorldToCameraMatrix(),J=s.invert(new Float64Array(16),H);N=s.Aabb.applyTransform(N,s.multiply([],H,A)),s.transformMat4(V,V,H);const K=.5*(N.max[2]-N.min[2]),re=this._minimumAABBFrustumDistance(y,N),te=s.scale$2([],[0,0,1],K),le=s.add(te,V,te),Ee=re+(y.pitch===0?0:s.distance(V,le)),ne=y.globeCenterInViewSpace,_e=s.sub([],V,[ne[0],ne[1],ne[2]]);s.normalize(_e,_e),s.scale$2(_e,_e,Ee);const he=s.add([],V,_e);s.transformMat4(he,he,J);const Te=s.earthRadius/s.GLOBE_RADIUS,se=s.length(he),ge=s.mercatorZfromAltitude(Math.max(se*Te-s.earthRadius,Number.EPSILON),0),Se=Math.min(y.zoomFromMercatorZAdjusted(ge),v.maxZoom);return Se>.5*(s.GLOBE_ZOOM_THRESHOLD_MIN+s.GLOBE_ZOOM_THRESHOLD_MAX)?(y.setProjection({name:"mercator"}),y.zoom=Se,this._cameraForBounds(y,n,h,p,m,_)):{center:y.center,zoom:Se,bearing:p,pitch:m}}queryTerrainElevation(i,n){const h=this.transform.elevation;return h?(n=s.extend({},{exaggerated:!0},n),h.getAtPoint(s.MercatorCoordinate.fromLngLat(i),null,n.exaggerated)):null}_cameraForBounds(i,n,h,p,m,_){if(i.projection.name==="globe")return this._cameraForBoundsOnGlobe(i,n,h,p,m,_);const y=i.clone(),v=this._extendCameraOptions(_),E=y.padding;y.bearing=p,y.pitch=m;const T=s.LngLat.convert(n),M=s.LngLat.convert(h),P=new s.LngLat(T.lng,M.lat),R=new s.LngLat(M.lng,T.lat),F=y.project(T),B=y.project(M),O=this.queryTerrainElevation(T),A=this.queryTerrainElevation(M),L=this.queryTerrainElevation(P),N=this.queryTerrainElevation(R),V=[[F.x,F.y,Math.min(O||0,A||0,L||0,N||0)],[B.x,B.y,Math.max(O||0,A||0,L||0,N||0)]];let H=s.Aabb.fromPoints(V);const J=y.getWorldToCameraMatrix(),K=s.invert(new Float64Array(16),J);H=s.Aabb.applyTransform(H,J);const re=s.sub([],H.max,H.min),te=E.left||0,le=E.right||0,Ee=E.bottom||0,ne=E.top||0,{left:_e,right:he,top:Te,bottom:se}=v.padding,ge=.5*(te+le),Se=.5*(ne+Ee),we=Math.min(y.scaleZoom(y.scale*Math.min((y.width-(te+le+_e+he))/re[0],(y.height-(Ee+ne+se+Te))/re[1])),v.maxZoom),Me=y.scale/y.zoomScale(we);H=new s.Aabb([H.min[0]-(_e+ge)*Me,H.min[1]-(se+Se)*Me,H.min[2]],[H.max[0]+(he+ge)*Me,H.max[1]+(Te+Se)*Me,H.max[2]]);const qe=.5*re[2],Qe=this._minimumAABBFrustumDistance(y,H),je=[0,0,1,0];s.transformMat4$1(je,je,J),s.normalize$2(je,je);const We=s.scale$2([],je,Qe+qe),mt=s.add([],H.center,We),ut=(typeof v.offset.x=="number"&&typeof v.offset.y=="number"?new s.Point(v.offset.x,v.offset.y):s.Point.convert(v.offset)).rotate(-s.degToRad(p));H.center[0]-=ut.x*Me,H.center[1]+=ut.y*Me,s.transformMat4(H.center,H.center,K),s.transformMat4(mt,mt,K);const $e=[H.center[0],H.center[1],mt[2]*y.pixelsPerMeter];s.scale$2($e,$e,1/y.worldSize);const It=s.lngFromMercatorX($e[0]),Lt=s.latFromMercatorY($e[1]),Rt=Math.min(y._zoomFromMercatorZ($e[2]),v.maxZoom),Bt=new s.LngLat(It,Lt);return y.mercatorFromTransition&&Rt<.5*(s.GLOBE_ZOOM_THRESHOLD_MIN+s.GLOBE_ZOOM_THRESHOLD_MAX)?(y.setProjection({name:"globe"}),y.zoom=Rt,this._cameraForBounds(y,n,h,p,m,_)):{center:Bt,zoom:Rt,bearing:p,pitch:m}}fitBounds(i,n,h){const p=this.cameraForBounds(i,n);return this._fitInternal(p,n,h)}fitScreenCoordinates(i,n,h,p,m){const _=s.Point.convert(i),y=s.Point.convert(n),v=new s.Point(Math.min(_.x,y.x),Math.min(_.y,y.y)),E=new s.Point(Math.max(_.x,y.x),Math.max(_.y,y.y));if(this.transform.projection.name==="mercator"&&this.transform.anyCornerOffEdge(_,y))return this;const T=this.transform.pointLocation3D(v),M=this.transform.pointLocation3D(E),P=this.transform.pointLocation3D(new s.Point(v.x,E.y)),R=this.transform.pointLocation3D(new s.Point(E.x,v.y)),F=[Math.min(T.lng,M.lng,P.lng,R.lng),Math.min(T.lat,M.lat,P.lat,R.lat)],B=[Math.max(T.lng,M.lng,P.lng,R.lng),Math.max(T.lat,M.lat,P.lat,R.lat)],O=p&&p.pitch?p.pitch:this.getPitch(),A=this._cameraForBounds(this.transform,F,B,h,O,p);return this._fitInternal(A,p,m)}_fitInternal(i,n,h){return i?(delete(n=s.extend(i,n)).padding,n.linear?this.easeTo(n,h):this.flyTo(n,h)):this}jumpTo(i,n){this.stop();const h=i.preloadOnly?this.transform.clone():this.transform;let p=!1,m=!1,_=!1;return"zoom"in i&&h.zoom!==+i.zoom&&(p=!0,h.zoom=+i.zoom),i.center!==void 0&&(h.center=s.LngLat.convert(i.center)),"bearing"in i&&h.bearing!==+i.bearing&&(m=!0,h.bearing=+i.bearing),"pitch"in i&&h.pitch!==+i.pitch&&(_=!0,h.pitch=+i.pitch),i.padding==null||h.isPaddingEqual(i.padding)||(h.padding=i.padding),i.preloadOnly?(this._preloadTiles(h),this):(this.fire(new s.Event("movestart",n)).fire(new s.Event("move",n)),p&&this.fire(new s.Event("zoomstart",n)).fire(new s.Event("zoom",n)).fire(new s.Event("zoomend",n)),m&&this.fire(new s.Event("rotatestart",n)).fire(new s.Event("rotate",n)).fire(new s.Event("rotateend",n)),_&&this.fire(new s.Event("pitchstart",n)).fire(new s.Event("pitch",n)).fire(new s.Event("pitchend",n)),this.fire(new s.Event("moveend",n)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||s.warnOnce($o),this.transform.getFreeCameraOptions()}setFreeCameraOptions(i,n){const h=this.transform;if(!h.projection.supportsFreeCamera)return s.warnOnce($o),this;this.stop();const p=h.zoom,m=h.pitch,_=h.bearing;h.setFreeCameraOptions(i);const y=p!==h.zoom,v=m!==h.pitch,E=_!==h.bearing;return this.fire(new s.Event("movestart",n)).fire(new s.Event("move",n)),y&&this.fire(new s.Event("zoomstart",n)).fire(new s.Event("zoom",n)).fire(new s.Event("zoomend",n)),E&&this.fire(new s.Event("rotatestart",n)).fire(new s.Event("rotate",n)).fire(new s.Event("rotateend",n)),v&&this.fire(new s.Event("pitchstart",n)).fire(new s.Event("pitch",n)).fire(new s.Event("pitchend",n)),this.fire(new s.Event("moveend",n)),this}easeTo(i,n){this._stop(!1,i.easeId),((i=s.extend({offset:[0,0],duration:500,easing:s.ease},i)).animate===!1||this._prefersReducedMotion(i))&&(i.duration=0);const h=this.transform,p=this.getZoom(),m=this.getBearing(),_=this.getPitch(),y=this.getPadding(),v="zoom"in i?+i.zoom:p,E="bearing"in i?this._normalizeBearing(i.bearing,m):m,T="pitch"in i?+i.pitch:_,M="padding"in i?i.padding:h.padding,P=s.Point.convert(i.offset);let R,F,B;if(h.projection.name==="globe"){const te=s.MercatorCoordinate.fromLngLat(h.center),le=P.rotate(-h.angle);te.x+=le.x/h.worldSize,te.y+=le.y/h.worldSize;const Ee=te.toLngLat(),ne=s.LngLat.convert(i.center||Ee);this._normalizeCenter(ne),R=h.centerPoint.add(le),F=new s.Point(te.x,te.y).mult(h.worldSize),B=new s.Point(s.mercatorXfromLng(ne.lng),s.mercatorYfromLat(ne.lat)).mult(h.worldSize).sub(F)}else{R=h.centerPoint.add(P);const te=h.pointLocation(R),le=s.LngLat.convert(i.center||te);this._normalizeCenter(le),F=h.project(te),B=h.project(le).sub(F)}const O=h.zoomScale(v-p);let A,L;i.around&&(A=s.LngLat.convert(i.around),L=h.locationPoint(A));const N=this._zooming||v!==p,V=this._rotating||m!==E,H=this._pitching||T!==_,J=!h.isPaddingEqual(M),K=te=>le=>{if(N&&(te.zoom=s.number(p,v,le)),V&&(te.bearing=s.number(m,E,le)),H&&(te.pitch=s.number(_,T,le)),J&&(te.interpolatePadding(y,M,le),R=te.centerPoint.add(P)),A)te.setLocationAtPoint(A,L);else{const Ee=te.zoomScale(te.zoom-p),ne=v>p?Math.min(2,O):Math.max(.5,O),_e=Math.pow(ne,1-le),he=te.unproject(F.add(B.mult(le*_e)).mult(Ee));te.setLocationAtPoint(te.renderWorldCopies?he.wrap():he,R)}return i.preloadOnly||this._fireMoveEvents(n),te};if(i.preloadOnly){const te=this._emulate(K,i.duration,h);return this._preloadTiles(te),this}const re={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=N,this._rotating=V,this._pitching=H,this._padding=J,this._easeId=i.easeId,this._prepareEase(n,i.noMoveStart,re),this._ease(K(h),te=>{h.recenterOnTerrain(),this._afterEase(n,te)},i),this}_prepareEase(i,n,h={}){this._moving=!0,this.transform.cameraElevationReference="sea",n||h.moving||this.fire(new s.Event("movestart",i)),this._zooming&&!h.zooming&&this.fire(new s.Event("zoomstart",i)),this._rotating&&!h.rotating&&this.fire(new s.Event("rotatestart",i)),this._pitching&&!h.pitching&&this.fire(new s.Event("pitchstart",i))}_fireMoveEvents(i){this.fire(new s.Event("move",i)),this._zooming&&this.fire(new s.Event("zoom",i)),this._rotating&&this.fire(new s.Event("rotate",i)),this._pitching&&this.fire(new s.Event("pitch",i))}_afterEase(i,n){if(this._easeId&&n&&this._easeId===n)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const h=this._zooming,p=this._rotating,m=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,h&&this.fire(new s.Event("zoomend",i)),p&&this.fire(new s.Event("rotateend",i)),m&&this.fire(new s.Event("pitchend",i)),this.fire(new s.Event("moveend",i))}flyTo(i,n){if(this._prefersReducedMotion(i)){const we=s.pick(i,["center","zoom","bearing","pitch","around"]);return this.jumpTo(we,n)}this.stop(),i=s.extend({offset:[0,0],speed:1.2,curve:1.42,easing:s.ease},i);const h=this.transform,p=this.getZoom(),m=this.getBearing(),_=this.getPitch(),y=this.getPadding(),v="zoom"in i?s.clamp(+i.zoom,h.minZoom,h.maxZoom):p,E="bearing"in i?this._normalizeBearing(i.bearing,m):m,T="pitch"in i?+i.pitch:_,M="padding"in i?i.padding:h.padding,P=h.zoomScale(v-p),R=s.Point.convert(i.offset);let F=h.centerPoint.add(R);const B=h.pointLocation(F),O=s.LngLat.convert(i.center||B);this._normalizeCenter(O);const A=h.project(B),L=h.project(O).sub(A);let N=i.curve;const V=Math.max(h.width,h.height),H=V/P,J=L.mag();if("minZoom"in i){const we=s.clamp(Math.min(i.minZoom,p,v),h.minZoom,h.maxZoom),Me=V/h.zoomScale(we-p);N=Math.sqrt(Me/J*2)}const K=N*N;function re(we){const Me=(H*H-V*V+(we?-1:1)*K*K*J*J)/(2*(we?H:V)*K*J);return Math.log(Math.sqrt(Me*Me+1)-Me)}function te(we){return(Math.exp(we)-Math.exp(-we))/2}function le(we){return(Math.exp(we)+Math.exp(-we))/2}const Ee=re(0);let ne=function(we){return le(Ee)/le(Ee+N*we)},_e=function(we){return V*((le(Ee)*(te(Me=Ee+N*we)/le(Me))-te(Ee))/K)/J;var Me},he=(re(1)-Ee)/N;if(Math.abs(J)<1e-6||!isFinite(he)){if(Math.abs(V-H)<1e-6)return this.easeTo(i,n);const we=H<V?-1:1;he=Math.abs(Math.log(H/V))/N,_e=function(){return 0},ne=function(Me){return Math.exp(we*N*Me)}}i.duration="duration"in i?+i.duration:1e3*he/("screenSpeed"in i?+i.screenSpeed/N:+i.speed),i.maxDuration&&i.duration>i.maxDuration&&(i.duration=0);const Te=m!==E,se=T!==_,ge=!h.isPaddingEqual(M),Se=we=>Me=>{const qe=Me*he,Qe=1/ne(qe);we.zoom=Me===1?v:p+we.scaleZoom(Qe),Te&&(we.bearing=s.number(m,E,Me)),se&&(we.pitch=s.number(_,T,Me)),ge&&(we.interpolatePadding(y,M,Me),F=we.centerPoint.add(R));const je=Me===1?O:we.unproject(A.add(L.mult(_e(qe))).mult(Qe));return we.setLocationAtPoint(we.renderWorldCopies?je.wrap():je,F),we._updateCameraOnTerrain(),i.preloadOnly||this._fireMoveEvents(n),we};if(i.preloadOnly){const we=this._emulate(Se,i.duration,h);return this._preloadTiles(we),this}return this._zooming=!0,this._rotating=Te,this._pitching=se,this._padding=ge,this._prepareEase(n,!1),this._ease(Se(h),()=>this._afterEase(n),i),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(i,n){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const h=this._onEaseEnd;this._onEaseEnd=void 0,h.call(this,n)}if(!i){const h=this.handlers;h&&h.stop(!1)}return this}_ease(i,n,h){h.animate===!1||h.duration===0?(i(1),n()):(this._easeStart=s.exported.now(),this._easeOptions=h,this._onEaseFrame=i,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const i=Math.min((s.exported.now()-this._easeStart)/this._easeOptions.duration,1),n=this._onEaseFrame;n&&n(this._easeOptions.easing(i)),i<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(i,n){i=s.wrap(i,-180,180);const h=Math.abs(i-n);return Math.abs(i-360-n)<h&&(i-=360),Math.abs(i+360-n)<h&&(i+=360),i}_normalizeCenter(i){const n=this.transform;if(!n.renderWorldCopies||n.maxBounds)return;const h=i.lng-n.center.lng;i.lng+=h>180?-360:h<-180?360:0}_prefersReducedMotion(i){return this._respectPrefersReducedMotion&&s.exported.prefersReducedMotion&&!(i&&i.essential)}_emulate(i,n,h){const p=Math.ceil(15*n/1e3),m=[],_=i(h.clone());for(let y=0;y<=p;y++){const v=_(y/p);m.push(v.clone())}return m}}class Ue{constructor(i={}){this.options=i,s.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(i){const n=this.options&&this.options.compact;return this._map=i,this._container=Je("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=Je("button","mapboxgl-ctrl-attrib-button",this._container),Je("span","mapboxgl-ctrl-icon",this._compactButton).setAttribute("aria-hidden","true"),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=Je("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),n&&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),n===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_setElementTitle(i,n){const h=this._map._getUIString(`AttributionControl.${n}`);i.setAttribute("aria-label",h),i.removeAttribute("title"),i.firstElementChild&&i.firstElementChild.setAttribute("title",h)}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let i=this._editLink;i||(i=this._editLink=this._container.querySelector(".mapbox-improve-map"));const n=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||s.config.ACCESS_TOKEN}];if(i){const h=n.reduce((p,m,_)=>(m.value&&(p+=`${m.key}=${m.value}${_<n.length-1?"&":""}`),p),"?");i.href=`${s.config.FEEDBACK_URL}/${h}#${ua(this._map,!0)}`,i.rel="noopener nofollow",this._setElementTitle(i,"MapFeedback")}}_updateData(i){!i||i.sourceDataType!=="metadata"&&i.sourceDataType!=="visibility"&&i.dataType!=="style"||(this._updateAttributions(),this._updateEditLink())}_updateAttributions(){if(!this._map.style)return;let i=[];if(this._map.style.stylesheet){const p=this._map.style.stylesheet;this.styleOwner=p.owner,this.styleId=p.id}const n=this._map.style._sourceCaches;for(const p in n){const m=n[p];if(m.used){const _=m.getSource();_.attribution&&i.indexOf(_.attribution)<0&&i.push(_.attribution)}}i.sort((p,m)=>p.length-m.length),i=i.filter((p,m)=>{for(let _=m+1;_<i.length;_++)if(i[_].indexOf(p)>=0)return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?i=[...this.options.customAttribution,...i]:i.unshift(this.options.customAttribution));const h=i.join(" | ");h!==this._attribHTML&&(this._attribHTML=h,i.length?(this._innerContainer.innerHTML=h,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class El{constructor(){s.bindAll(["_updateLogo","_updateCompact"],this)}onAdd(i){this._map=i,this._container=Je("div","mapboxgl-ctrl");const n=Je("a","mapboxgl-ctrl-logo");return n.target="_blank",n.rel="noopener nofollow",n.href="https://www.mapbox.com/",n.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),n.setAttribute("rel","noopener nofollow"),this._container.appendChild(n),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(i){i&&i.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const i=this._map.style._sourceCaches;if(Object.entries(i).length===0)return!0;for(const n in i){const h=i[n].getSource();if(h.hasOwnProperty("mapbox_logo")&&!h.mapbox_logo)return!1}return!0}_updateCompact(){const i=this._container.children;if(i.length){const n=i[0];this._map.getCanvasContainer().offsetWidth<250?n.classList.add("mapboxgl-compact"):n.classList.remove("mapboxgl-compact")}}}class kl{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(i){const n=++this._id;return this._queue.push({callback:i,id:n,cancelled:!1}),n}remove(i){const n=this._currentlyRunning,h=n?this._queue.concat(n):this._queue;for(const p of h)if(p.id===i)return void(p.cancelled=!0)}run(i=0){const n=this._currentlyRunning=this._queue;this._queue=[];for(const h of n)if(!h.cancelled&&(h.callback(i),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function Sn(l,i,n){if(l=new s.LngLat(l.lng,l.lat),i){const h=new s.LngLat(l.lng-360,l.lat),p=new s.LngLat(l.lng+360,l.lat),m=360*Math.ceil(Math.abs(l.lng-n.center.lng)/360),_=n.locationPoint(l).distSqr(i),y=i.x<0||i.y<0||i.x>n.width||i.y>n.height;n.locationPoint(h).distSqr(i)<_&&(y||Math.abs(h.lng-n.center.lng)<m)?l=h:n.locationPoint(p).distSqr(i)<_&&(y||Math.abs(p.lng-n.center.lng)<m)&&(l=p)}for(;Math.abs(l.lng-n.center.lng)>180;){const h=n.locationPoint(l);if(h.x>=0&&h.y>=0&&h.x<=n.width&&h.y<=n.height)break;l.lng>n.center.lng?l.lng-=360:l.lng+=360}return l}const qo={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};class Be extends s.Evented{constructor(i,n){if(super(),(i instanceof s.window.HTMLElement||n)&&(i=s.extend({element:i},n)),s.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=i&&i.anchor||"center",this._color=i&&i.color||"#3FB1CE",this._scale=i&&i.scale||1,this._draggable=i&&i.draggable||!1,this._clickTolerance=i&&i.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=i&&i.rotation||0,this._rotationAlignment=i&&i.rotationAlignment||"auto",this._pitchAlignment=i&&i.pitchAlignment&&i.pitchAlignment||"auto",this._updateMoving=()=>this._update(!0),this._occludedOpacity=i&&i.occludedOpacity||.2,i&&i.element)this._element=i.element,this._offset=s.Point.convert(i&&i.offset||[0,0]);else{this._defaultMarker=!0,this._element=Je("div");const p=41,m=27,_=vt("svg",{display:"block",height:p*this._scale+"px",width:m*this._scale+"px",viewBox:`0 0 ${m} ${p}`},this._element),y=vt("radialGradient",{id:"shadowGradient"},vt("defs",{},_));vt("stop",{offset:"10%","stop-opacity":.4},y),vt("stop",{offset:"100%","stop-opacity":.05},y),vt("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},_),vt("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},_),vt("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},_),vt("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},_),this._offset=s.Point.convert(i&&i.offset||[0,-14])}this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",p=>{p.preventDefault()}),this._element.addEventListener("mousedown",p=>{p.preventDefault()});const h=this._element.classList;for(const p in qo)h.remove(`mapboxgl-marker-anchor-${p}`);h.add(`mapboxgl-marker-anchor-${this._anchor}`),this._popup=null}addTo(i){return i===this._map||(this.remove(),this._map=i,i.getCanvasContainer().appendChild(this._element),i.on("move",this._updateMoving),i.on("moveend",this._update),i.on("remove",this._clearFadeTimer),i._addMarker(this),this.setDraggable(this._draggable),this._update(),i.on("click",this._onMapClick)),this}remove(){const i=this._map;return i&&(i.off("click",this._onMapClick),i.off("move",this._updateMoving),i.off("moveend",this._update),i.off("mousedown",this._addDragHandler),i.off("touchstart",this._addDragHandler),i.off("mouseup",this._onUp),i.off("touchend",this._onUp),i.off("mousemove",this._onMove),i.off("touchmove",this._onMove),i.off("remove",this._clearFadeTimer),i._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(i){return this._lngLat=s.LngLat.convert(i),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(i){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),i){if(!("offset"in i.options)){const p=Math.sqrt(Math.pow(13.5,2)/2);i.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[p,-1*(38.1-13.5+p)],"bottom-right":[-p,-1*(38.1-13.5+p)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=i,i._marker=this,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(i){const n=i.code,h=i.charCode||i.keyCode;n!=="Space"&&n!=="Enter"&&h!==32&&h!==13||this.togglePopup()}_onMapClick(i){const n=i.originalEvent.target,h=this._element;this._popup&&(n===h||h.contains(n))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const i=this._popup;return i?(i.isOpen()?(i.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(i.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const i=this._map,n=this._pos;if(!i||!n)return!1;const h=i.unproject(n),p=i.getFreeCameraOptions();if(!p.position)return!1;const m=p.position.toLngLat();return m.distanceTo(h)<.9*m.distanceTo(this._lngLat)}_evaluateOpacity(){const i=this._map;if(!i)return;const n=this._pos;if(!n||n.x<0||n.x>i.transform.width||n.y<0||n.y>i.transform.height)return void this._clearFadeTimer();const h=i.unproject(n);let p;i._showingGlobe()&&s.isLngLatBehindGlobe(i.transform,this._lngLat)?p=0:(p=1-i._queryFogOpacity(h),i.transform._terrainEnabled()&&i.getTerrain()&&this._behindTerrain()&&(p*=this._occludedOpacity)),this._element.style.opacity=`${p}`,this._element.style.pointerEvents=p>0?"auto":"none",this._popup&&this._popup._setOpacity(p),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const i=this._pos;if(!i||!this._map)return;const n=this._offset.mult(this._scale);this._element.style.transform=`
            translate(${i.x}px,${i.y}px)
            ${qo[this._anchor]}
            ${this._calculateXYTransform()} ${this._calculateZTransform()}
            translate(${n.x}px,${n.y}px)
        `}_calculateXYTransform(){const i=this._pos,n=this._map,h=this.getPitchAlignment();if(!n||!i||h!=="map")return"";if(!n._showingGlobe()){const v=n.getPitch();return v?`rotateX(${v}deg)`:""}const p=s.radToDeg(s.globeTiltAtLngLat(n.transform,this._lngLat)),m=i.sub(s.globeCenterToScreenPoint(n.transform)),_=Math.abs(m.x)+Math.abs(m.y);if(_===0)return"";const y=p/_;return`rotateX(${-m.y*y}deg) rotateY(${m.x*y}deg)`}_calculateZTransform(){const i=this._pos,n=this._map;if(!n||!i)return"";let h=0;const p=this.getRotationAlignment();if(p==="map")if(n._showingGlobe()){const m=n.project(new s.LngLat(this._lngLat.lng,this._lngLat.lat+.001)),_=n.project(new s.LngLat(this._lngLat.lng,this._lngLat.lat-.001)).sub(m);h=s.radToDeg(Math.atan2(_.y,_.x))-90}else h=-n.getBearing();else if(p==="horizon"){const m=s.smoothstep(4,6,n.getZoom()),_=s.globeCenterToScreenPoint(n.transform);_.y+=m*n.transform.height;const y=i.sub(_),v=s.radToDeg(Math.atan2(y.y,y.x));h=(v>90?v-270:v+90)*(1-m)}return h+=this._rotation,h?`rotateZ(${h}deg)`:""}_update(i){s.window.cancelAnimationFrame(this._updateFrameId);const n=this._map;n&&(n.transform.renderWorldCopies&&(this._lngLat=Sn(this._lngLat,this._pos,n.transform)),this._pos=n.project(this._lngLat),i===!0?this._updateFrameId=s.window.requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),n._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(n._showingGlobe()||n.getTerrain()||n.getFog())&&!this._fadeTimer&&(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(i){return this._offset=s.Point.convert(i),this._update(),this}_onMove(i){const n=this._map;if(!n)return;const h=this._pointerdownPos,p=this._positionDelta;if(h&&p){if(!this._isDragging){const m=this._clickTolerance||n._clickTolerance;if(i.point.dist(h)<m)return;this._isDragging=!0}this._pos=i.point.sub(p),this._lngLat=n.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new s.Event("dragstart"))),this.fire(new s.Event("drag"))}}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1;const i=this._map;i&&(i.off("mousemove",this._onMove),i.off("touchmove",this._onMove)),this._state==="active"&&this.fire(new s.Event("dragend")),this._state="inactive"}_addDragHandler(i){const n=this._map,h=this._pos;n&&h&&this._element.contains(i.originalEvent.target)&&(i.preventDefault(),this._positionDelta=i.point.sub(h),this._pointerdownPos=i.point,this._state="pending",n.on("mousemove",this._onMove),n.on("touchmove",this._onMove),n.once("mouseup",this._onUp),n.once("touchend",this._onUp))}setDraggable(i){this._draggable=!!i;const n=this._map;return n&&(i?(n.on("mousedown",this._addDragHandler),n.on("touchstart",this._addDragHandler)):(n.off("mousedown",this._addDragHandler),n.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(i){return this._rotation=i||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(i){return this._rotationAlignment=i||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment==="auto"||this._rotationAlignment==="horizon"&&this._map&&!this._map._showingGlobe()?"viewport":this._rotationAlignment}setPitchAlignment(i){return this._pitchAlignment=i||"auto",this._update(),this}getPitchAlignment(){return this._pitchAlignment==="auto"?this.getRotationAlignment():this._pitchAlignment}setOccludedOpacity(i){return this._occludedOpacity=i||.2,this._update(),this}getOccludedOpacity(){return this._occludedOpacity}}const Sl={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},cu=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function eh(l=new s.Point(0,0),i="bottom"){if(typeof l=="number"){const n=Math.round(Math.sqrt(.5*Math.pow(l,2)));switch(i){case"top":return new s.Point(0,l);case"top-left":return new s.Point(n,n);case"top-right":return new s.Point(-n,n);case"bottom":return new s.Point(0,-l);case"bottom-left":return new s.Point(n,-n);case"bottom-right":return new s.Point(-n,-n);case"left":return new s.Point(l,0);case"right":return new s.Point(-l,0)}return new s.Point(0,0)}return l instanceof s.Point||Array.isArray(l)?s.Point.convert(l):s.Point.convert(l[i]||[0,0])}class Ml{constructor(i){this.jumpTo(i)}getValue(i){if(i<=this._startTime)return this._start;if(i>=this._endTime)return this._end;const n=s.easeCubicInOut((i-this._startTime)/(this._endTime-this._startTime));return this._start*(1-n)+this._end*n}isEasing(i){return i>=this._startTime&&i<=this._endTime}jumpTo(i){this._startTime=-1/0,this._endTime=-1/0,this._start=i,this._end=i}easeTo(i,n,h){this._start=this.getValue(n),this._end=i,this._startTime=n,this._endTime=n+h}}const th={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use ⌘ + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"},rh={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,optimizeForTerrain:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0},hu={showCompass:!0,showZoom:!0,visualizePitch:!1};class uu{constructor(i,n,h=!1){this._clickTolerance=10,this.element=n,this.mouseRotate=new xl({clickTolerance:i.dragRotate._mouseRotate._clickTolerance}),this.map=i,h&&(this.mousePitch=new vl({clickTolerance:i.dragRotate._mousePitch._clickTolerance})),s.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),n.addEventListener("mousedown",this.mousedown),n.addEventListener("touchstart",this.touchstart,{passive:!1}),n.addEventListener("touchmove",this.touchmove),n.addEventListener("touchend",this.touchend),n.addEventListener("touchcancel",this.reset)}down(i,n){this.mouseRotate.mousedown(i,n),this.mousePitch&&this.mousePitch.mousedown(i,n),Ei()}move(i,n){const h=this.map,p=this.mouseRotate.mousemoveWindow(i,n),m=p&&p.bearingDelta;if(m&&h.setBearing(h.getBearing()+m),this.mousePitch){const _=this.mousePitch.mousemoveWindow(i,n),y=_&&_.pitchDelta;y&&h.setPitch(h.getPitch()+y)}}off(){const i=this.element;i.removeEventListener("mousedown",this.mousedown),i.removeEventListener("touchstart",this.touchstart,{passive:!1}),i.removeEventListener("touchmove",this.touchmove),i.removeEventListener("touchend",this.touchend),i.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){ki(),s.window.removeEventListener("mousemove",this.mousemove),s.window.removeEventListener("mouseup",this.mouseup)}mousedown(i){this.down(s.extend({},i,{ctrlKey:!0,preventDefault:()=>i.preventDefault()}),Ur(this.element,i)),s.window.addEventListener("mousemove",this.mousemove),s.window.addEventListener("mouseup",this.mouseup)}mousemove(i){this.move(i,Ur(this.element,i))}mouseup(i){this.mouseRotate.mouseupWindow(i),this.mousePitch&&this.mousePitch.mouseupWindow(i),this.offTemp()}touchstart(i){i.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=Rr(this.element,i.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>i.preventDefault()},this._startPos))}touchmove(i){i.targetTouches.length!==1?this.reset():(this._lastPos=Rr(this.element,i.targetTouches)[0],this.move({preventDefault:()=>i.preventDefault()},this._lastPos))}touchend(i){i.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()}reset(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()}}const Al={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0,showUserHeading:!1},Il={maxWidth:100,unit:"metric"},Cl={kilometer:"km",meter:"m",mile:"mi",foot:"ft","nautical-mile":"nm"},Mn={version:s.version,supported:yt,setRTLTextPlugin:s.setRTLTextPlugin,getRTLTextPluginStatus:s.getRTLTextPluginStatus,Map:class extends ps{constructor(l){if(s.LivePerformanceUtils.mark(s.PerformanceMarkers.create),(l=s.extend({},rh,l)).minZoom!=null&&l.maxZoom!=null&&l.minZoom>l.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(l.minPitch!=null&&l.maxPitch!=null&&l.minPitch>l.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(l.minPitch!=null&&l.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(l.maxPitch!=null&&l.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(l.antialias&&s.isSafariWithAntialiasingBug(s.window)&&(l.antialias=!1,s.warnOnce("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new bn(l.minZoom,l.maxZoom,l.minPitch,l.maxPitch,l.renderWorldCopies),l),this._interactive=l.interactive,this._minTileCacheSize=l.minTileCacheSize,this._maxTileCacheSize=l.maxTileCacheSize,this._failIfMajorPerformanceCaveat=l.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=l.preserveDrawingBuffer,this._antialias=l.antialias,this._useWebGL2=l.useWebGL2,this._trackResize=l.trackResize,this._bearingSnap=l.bearingSnap,this._refreshExpiredTiles=l.refreshExpiredTiles,this._fadeDuration=l.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=l.crossSourceCollisions,this._collectResourceTiming=l.collectResourceTiming,this._optimizeForTerrain=l.optimizeForTerrain,this._language=this._parseLanguage(l.language),this._worldview=l.worldview,this._renderTaskQueue=new kl,this._domRenderTaskQueue=new kl,this._controls=[],this._markers=[],this._popups=[],this._mapId=s.uniqueId(),this._locale=s.extend({},th,l.locale),this._clickTolerance=l.clickTolerance,this._cooperativeGestures=l.cooperativeGestures,this._performanceMetricsCollection=l.performanceMetricsCollection,this._containerWidth=0,this._containerHeight=0,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new Ml(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._requestManager=new s.RequestManager(l.transformRequest,l.accessToken,l.testMode),this._silenceAuthErrors=!!l.testMode,typeof l.container=="string"){if(this._container=s.window.document.getElementById(l.container),!this._container)throw new Error(`Container '${l.container}' not found.`)}else{if(!(l.container instanceof s.window.HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=l.container}if(this._container.childNodes.length>0&&s.warnOnce("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),l.maxBounds&&this.setMaxBounds(l.maxBounds),s.bindAll(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),s.window!==void 0&&(s.window.addEventListener("online",this._onWindowOnline,!1),s.window.addEventListener("resize",this._onWindowResize,!1),s.window.addEventListener("orientationchange",this._onWindowResize,!1),s.window.addEventListener("webkitfullscreenchange",this._onWindowResize,!1),s.window.addEventListener("visibilitychange",this._onVisibilityChange,!1)),this.handlers=new Oi(this,l),this._localFontFamily=l.localFontFamily,this._localIdeographFontFamily=l.localIdeographFontFamily,l.style&&this.setStyle(l.style,{localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),l.projection&&this.setProjection(l.projection),this._hash=l.hash&&new fl(typeof l.hash=="string"&&l.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:l.center,zoom:l.zoom,bearing:l.bearing,pitch:l.pitch}),l.bounds&&(this.resize(),this.fitBounds(l.bounds,s.extend({},l.fitBoundsOptions,{duration:0})))),this.resize(),l.attributionControl&&this.addControl(new Ue({customAttribution:l.customAttribution})),this._logoControl=new El,this.addControl(this._logoControl,l.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",i=>{this._update(i.dataType==="style"),this.fire(new s.Event(`${i.dataType}data`,i))}),this.on("dataloading",i=>{this.fire(new s.Event(`${i.dataType}dataloading`,i))})}_getMapId(){return this._mapId}addControl(l,i){if(i===void 0&&(i=l.getDefaultPosition?l.getDefaultPosition():"top-right"),!l||!l.onAdd)return this.fire(new s.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=l.onAdd(this);this._controls.push(l);const h=this._controlPositions[i];return i.indexOf("bottom")!==-1?h.insertBefore(n,h.firstChild):h.appendChild(n),this}removeControl(l){if(!l||!l.onRemove)return this.fire(new s.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const i=this._controls.indexOf(l);return i>-1&&this._controls.splice(i,1),l.onRemove(this),this}hasControl(l){return this._controls.indexOf(l)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(l){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const i=!this._moving;return i&&this.fire(new s.Event("movestart",l)).fire(new s.Event("move",l)),this.fire(new s.Event("resize",l)),i&&this.fire(new s.Event("moveend",l)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(l){return this.transform.setMaxBounds(s.LngLatBounds.convert(l)),this._update()}setMinZoom(l){if((l=l??-2)>=-2&&l<=this.transform.maxZoom)return this.transform.minZoom=l,this._update(),this.getZoom()<l?this.setZoom(l):this.fire(new s.Event("zoomstart")).fire(new s.Event("zoom")).fire(new s.Event("zoomend")),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(l){if((l=l??22)>=this.transform.minZoom)return this.transform.maxZoom=l,this._update(),this.getZoom()>l?this.setZoom(l):this.fire(new s.Event("zoomstart")).fire(new s.Event("zoom")).fire(new s.Event("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(l){if((l=l??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(l>=0&&l<=this.transform.maxPitch)return this.transform.minPitch=l,this._update(),this.getPitch()<l?this.setPitch(l):this.fire(new s.Event("pitchstart")).fire(new s.Event("pitch")).fire(new s.Event("pitchend")),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(l){if((l=l??85)>85)throw new Error("maxPitch must be less than or equal to 85");if(l>=this.transform.minPitch)return this.transform.maxPitch=l,this._update(),this.getPitch()>l?this.setPitch(l):this.fire(new s.Event("pitchstart")).fire(new s.Event("pitch")).fire(new s.Event("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(l){return this.transform.renderWorldCopies=l,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(l){return l==="auto"?s.window.navigator.language:Array.isArray(l)?l.length===0?void 0:l.map(i=>i==="auto"?s.window.navigator.language:i):l}setLanguage(l){const i=this._parseLanguage(l);if(!this.style||i===this._language)return this;this._language=i,this.style._reloadSources();for(const n of this._controls)n._setLanguage&&n._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(l){return this.style&&l!==this._worldview?(this._worldview=l,this.style._reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return this.transform.projection.name==="globe"}setProjection(l){return this._lazyInitEmptyStyle(),l?typeof l=="string"&&(l={name:l}):l=null,this._useExplicitProjection=!!l,this._prioritizeAndUpdateProjection(l,this.style.stylesheet?this.style.stylesheet.projection:null)}_updateProjectionTransition(){if(this.getProjection().name!=="globe")return;const l=this.transform,i=l.projection.name;let n;i==="globe"&&l.zoom>=s.GLOBE_ZOOM_THRESHOLD_MAX?(l.setMercatorFromTransition(),n=!0):i==="mercator"&&l.zoom<s.GLOBE_ZOOM_THRESHOLD_MAX&&(l.setProjection({name:"globe"}),n=!0),n&&(this.style.applyProjectionUpdate(),this.style._forceSymbolLayerUpdate())}_prioritizeAndUpdateProjection(l,i){return this._updateProjection(l||i||{name:"mercator"})}_updateProjection(l){let i;if(i=l.name==="globe"&&this.transform.zoom>=s.GLOBE_ZOOM_THRESHOLD_MAX?this.transform.setMercatorFromTransition():this.transform.setProjection(l),this.style.applyProjectionUpdate(),i){this.painter.clearBackgroundTiles();for(const n in this.style._sourceCaches)this.style._sourceCaches[n].clearTiles();this._update(!0),this._forceMarkerAndPopupUpdate(!0)}return this}project(l){return this.transform.locationPoint3D(s.LngLat.convert(l))}unproject(l){return this.transform.pointLocation3D(s.Point.convert(l))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(l,i,n){if(l==="mouseenter"||l==="mouseover"){let h=!1;const p=_=>{const y=i.filter(E=>this.getLayer(E)),v=y.length?this.queryRenderedFeatures(_.point,{layers:y}):[];v.length?h||(h=!0,n.call(this,new Ir(l,this,_.originalEvent,{features:v}))):h=!1},m=()=>{h=!1};return{layers:new Set(i),listener:n,delegates:{mousemove:p,mouseout:m}}}if(l==="mouseleave"||l==="mouseout"){let h=!1;const p=_=>{const y=i.filter(v=>this.getLayer(v));(y.length?this.queryRenderedFeatures(_.point,{layers:y}):[]).length?h=!0:h&&(h=!1,n.call(this,new Ir(l,this,_.originalEvent)))},m=_=>{h&&(h=!1,n.call(this,new Ir(l,this,_.originalEvent)))};return{layers:new Set(i),listener:n,delegates:{mousemove:p,mouseout:m}}}{const h=p=>{const m=i.filter(y=>this.getLayer(y)),_=m.length?this.queryRenderedFeatures(p.point,{layers:m}):[];_.length&&(p.features=_,n.call(this,p),delete p.features)};return{layers:new Set(i),listener:n,delegates:{[l]:h}}}}on(l,i,n){if(n===void 0)return super.on(l,i);Array.isArray(i)||(i=[i]);const h=this._createDelegatedListener(l,i,n);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[l]=this._delegatedListeners[l]||[],this._delegatedListeners[l].push(h);for(const p in h.delegates)this.on(p,h.delegates[p]);return this}once(l,i,n){if(n===void 0)return super.once(l,i);Array.isArray(i)||(i=[i]);const h=this._createDelegatedListener(l,i,n);for(const p in h.delegates)this.once(p,h.delegates[p]);return this}off(l,i,n){if(n===void 0)return super.off(l,i);i=new Set(Array.isArray(i)?i:[i]);const h=(m,_)=>{if(m.size!==_.size)return!1;for(const y of m)if(!_.has(y))return!1;return!0},p=this._delegatedListeners?this._delegatedListeners[l]:void 0;return p&&(m=>{for(let _=0;_<m.length;_++){const y=m[_];if(y.listener===n&&h(y.layers,i)){for(const v in y.delegates)this.off(v,y.delegates[v]);return m.splice(_,1),this}}})(p),this}queryRenderedFeatures(l,i){return this.style?(i!==void 0||l===void 0||l instanceof s.Point||Array.isArray(l)||(i=l,l=void 0),this.style.queryRenderedFeatures(l=l||[[0,0],[this.transform.width,this.transform.height]],i=i||{},this.transform)):[]}querySourceFeatures(l,i){return this.style.querySourceFeatures(l,i)}isPointOnSurface(l){const{name:i}=this.transform.projection;return i!=="globe"&&i!=="mercator"&&s.warnOnce(`${i} projection does not support isPointOnSurface, this API may behave unexpectedly.`),this.transform.isPointOnSurface(s.Point.convert(l))}setStyle(l,i){return(i=s.extend({},{localIdeographFontFamily:this._localIdeographFontFamily,localFontFamily:this._localFontFamily},i)).diff!==!1&&i.localIdeographFontFamily===this._localIdeographFontFamily&&i.localFontFamily===this._localFontFamily&&this.style&&l?(this._diffStyle(l,i),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._localFontFamily=i.localFontFamily,this._updateStyle(l,i))}_getUIString(l){const i=this._locale[l];if(i==null)throw new Error(`Missing UI string '${l}'`);return i}_updateStyle(l,i){return this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),l&&(this.style=new Bi(this,i||{}),this.style.setEventedParent(this,{style:this.style}),typeof l=="string"?this.style.loadURL(l):this.style.loadJSON(l)),this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new Bi(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(l,i){if(typeof l=="string"){const n=this._requestManager.normalizeStyleURL(l),h=this._requestManager.transformRequest(n,s.ResourceType.Style);s.getJSON(h,(p,m)=>{p?this.fire(new s.ErrorEvent(p)):m&&this._updateDiff(m,i)})}else typeof l=="object"&&this._updateDiff(l,i)}_updateDiff(l,i){try{this.style.setState(l)&&this._update(!0)}catch(n){s.warnOnce(`Unable to perform style diff: ${n.message||n.error||n}.  Rebuilding the style from scratch.`),this._updateStyle(l,i)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(s.warnOnce("There is no style added to the map."),!1)}addSource(l,i){return this._lazyInitEmptyStyle(),this.style.addSource(l,i),this._update(!0)}isSourceLoaded(l){return!!this.style&&this.style._isSourceCacheLoaded(l)}areTilesLoaded(){const l=this.style&&this.style._sourceCaches;for(const i in l){const n=l[i]._tiles;for(const h in n){const p=n[h];if(p.state!=="loaded"&&p.state!=="errored")return!1}}return!0}addSourceType(l,i,n){this._lazyInitEmptyStyle(),this.style.addSourceType(l,i,n)}removeSource(l){return this.style.removeSource(l),this._updateTerrain(),this._update(!0)}getSource(l){return this.style.getSource(l)}addImage(l,i,{pixelRatio:n=1,sdf:h=!1,stretchX:p,stretchY:m,content:_}={}){if(this._lazyInitEmptyStyle(),i instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&i instanceof s.window.ImageBitmap){const{width:y,height:v,data:E}=s.exported.getImageData(i);this.style.addImage(l,{data:new s.RGBAImage({width:y,height:v},E),pixelRatio:n,stretchX:p,stretchY:m,content:_,sdf:h,version:0})}else if(i.width===void 0||i.height===void 0)this.fire(new s.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));else{const{width:y,height:v}=i,E=i;this.style.addImage(l,{data:new s.RGBAImage({width:y,height:v},new Uint8Array(E.data)),pixelRatio:n,stretchX:p,stretchY:m,content:_,sdf:h,version:0,userImage:E}),E.onAdd&&E.onAdd(this,l)}}updateImage(l,i){const n=this.style.getImage(l);if(!n)return void this.fire(new s.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const h=i instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&i instanceof s.window.ImageBitmap?s.exported.getImageData(i):i,{width:p,height:m}=h;p!==void 0&&m!==void 0?p===n.data.width&&m===n.data.height?(n.data.replace(h.data,!(i instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&i instanceof s.window.ImageBitmap)),this.style.updateImage(l,n)):this.fire(new s.ErrorEvent(new Error(`The width and height of the updated image (${p}, ${m})
                must be that same as the previous version of the image
                (${n.data.width}, ${n.data.height})`))):this.fire(new s.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")))}hasImage(l){return l?!!this.style.getImage(l):(this.fire(new s.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(l){this.style.removeImage(l)}loadImage(l,i){s.getImage(this._requestManager.transformRequest(l,s.ResourceType.Image),(n,h)=>{i(n,h instanceof s.window.HTMLImageElement?s.exported.getImageData(h):h)})}listImages(){return this.style.listImages()}addLayer(l,i){return this._lazyInitEmptyStyle(),this.style.addLayer(l,i),this._update(!0)}moveLayer(l,i){return this.style.moveLayer(l,i),this._update(!0)}removeLayer(l){return this.style.removeLayer(l),this._update(!0)}getLayer(l){return this.style.getLayer(l)}setLayerZoomRange(l,i,n){return this.style.setLayerZoomRange(l,i,n),this._update(!0)}setFilter(l,i,n={}){return this.style.setFilter(l,i,n),this._update(!0)}getFilter(l){return this.style.getFilter(l)}setPaintProperty(l,i,n,h={}){return this.style.setPaintProperty(l,i,n,h),this._update(!0)}getPaintProperty(l,i){return this.style.getPaintProperty(l,i)}setLayoutProperty(l,i,n,h={}){return this.style.setLayoutProperty(l,i,n,h),this._update(!0)}getLayoutProperty(l,i){return this.style.getLayoutProperty(l,i)}setLight(l,i={}){return this._lazyInitEmptyStyle(),this.style.setLight(l,i),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(l){return this._lazyInitEmptyStyle(),!l&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(l),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(l){return this._lazyInitEmptyStyle(),this.style.setFog(l),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(l){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(s.LngLat.convert(l),this.transform):0}setFeatureState(l,i){return this.style.setFeatureState(l,i),this._update()}removeFeatureState(l,i){return this.style.removeFeatureState(l,i),this._update()}getFeatureState(l){return this.style.getFeatureState(l)}_updateContainerDimensions(){if(!this._container)return;const l=this._container.getBoundingClientRect().width||400,i=this._container.getBoundingClientRect().height||300;let n,h,p,m=this._container;for(;m&&(!h||!p);){const _=s.window.getComputedStyle(m).transform;_&&_!=="none"&&(n=_.match(/matrix.*\((.+)\)/)[1].split(", "),n[0]&&n[0]!=="0"&&n[0]!=="1"&&(h=n[0]),n[3]&&n[3]!=="0"&&n[3]!=="1"&&(p=n[3])),m=m.parentElement}this._containerWidth=h?Math.abs(l/h):l,this._containerHeight=p?Math.abs(i/p):i}_detectMissingCSS(){s.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&s.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/.")}_setupContainer(){const l=this._container;l.classList.add("mapboxgl-map"),(this._missingCSSCanary=Je("div","mapboxgl-canary",l)).style.visibility="hidden",this._detectMissingCSS();const i=this._canvasContainer=Je("div","mapboxgl-canvas-container",l);this._interactive&&i.classList.add("mapboxgl-interactive"),this._canvas=Je("canvas","mapboxgl-canvas",i),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const n=this._controlContainer=Je("div","mapboxgl-control-container",l),h=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(p=>{h[p]=Je("div",`mapboxgl-ctrl-${p}`,n)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(l,i){const n=s.exported.devicePixelRatio||1;this._canvas.width=n*Math.ceil(l),this._canvas.height=n*Math.ceil(i),this._canvas.style.width=`${l}px`,this._canvas.style.height=`${i}px`}_addMarker(l){this._markers.push(l)}_removeMarker(l){const i=this._markers.indexOf(l);i!==-1&&this._markers.splice(i,1)}_addPopup(l){this._popups.push(l)}_removePopup(l){const i=this._popups.indexOf(l);i!==-1&&this._popups.splice(i,1)}_setupPainter(){const l=s.extend({},yt.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),i=this._useWebGL2&&this._canvas.getContext("webgl2",l),n=i||this._canvas.getContext("webgl",l)||this._canvas.getContext("experimental-webgl",l);n?(this._useWebGL2&&!i&&s.warnOnce("Failed to create WebGL 2 context. Using WebGL 1."),s.storeAuthState(n,!0),this.painter=new vn(n,this.transform,!!i),this.on("data",h=>{h.dataType==="source"&&this.painter.setTileLoadedFlag(!0)}),s.exported$1.testSupport(n)):this.fire(new s.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(l){l.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new s.Event("webglcontextlost",{originalEvent:l}))}_contextRestored(l){this._setupPainter(),this.resize(),this._update(),this.fire(new s.Event("webglcontextrestored",{originalEvent:l}))}_onMapScroll(l){if(l.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(l){return this.style?(this._styleDirty=this._styleDirty||l,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(l){return this._update(),this._renderTaskQueue.add(l)}_cancelRenderFrame(l){this._renderTaskQueue.remove(l)}_requestDomTask(l){!this.loaded()||this.loaded()&&!this.isMoving()?l():this._domRenderTaskQueue.add(l)}_render(l){let i;const n=this.painter.context.extTimerQuery,h=s.exported.now();if(this.listens("gpu-timing-frame")&&(i=n.createQueryEXT(),n.beginQueryEXT(n.TIME_ELAPSED_EXT,i)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],s.window.performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],s.window.performance.now())),this._renderTaskQueue.run(l),this._domRenderTaskQueue.run(l),this._removed)return;this._updateProjectionTransition();const p=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const y=this.transform.zoom,v=this.transform.pitch,E=s.exported.now(),T=new s.EvaluationParameters(y,{now:E,fadeDuration:p,pitch:v,transition:this.style.getTransition()});this.style.update(T)}this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let m=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),m=this._updateAverageElevation(h),this.style._updateSources(this.transform),this._forceMarkerAndPopupUpdate()):m=this._updateAverageElevation(h),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,p,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:p,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new s.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new s.Event("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),i){const y=s.exported.now()-h;n.endQueryEXT(n.TIME_ELAPSED_EXT,i),setTimeout(()=>{const v=n.getQueryObjectEXT(i,n.QUERY_RESULT_EXT)/1e6;n.deleteQueryEXT(i),this.fire(new s.Event("gpu-timing-frame",{cpuTime:y,gpuTime:v})),s.window.performance.mark("frame-gpu",{startTime:h,detail:{gpuTime:v}})},50)}if(this.listens("gpu-timing-layer")){const y=this.painter.collectGpuTimers();setTimeout(()=>{const v=this.painter.queryGpuTimers(y);this.fire(new s.Event("gpu-timing-layer",{layerTimes:v}))},50)}if(this.listens("gpu-timing-deferred-render")){const y=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const v=this.painter.queryGpuTimeDeferredRender(y);this.fire(new s.Event("gpu-timing-deferred-render",{gpuTime:v}))},50)}const _=this._sourcesDirty||this._styleDirty||this._placementDirty||m;if(_||this._repaint)this.triggerRepaint();else{const y=!this.isMoving()&&this.loaded();if(y&&(m=this._updateAverageElevation(h,!0)),m)this.triggerRepaint();else if(this._triggerFrame(!1),y&&(this.fire(new s.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const v=this._calculateSpeedIndex();this.fire(new s.Event("speedindexcompleted",{speedIndex:v})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||_||(this._fullyLoaded=!0,s.LivePerformanceUtils.mark(s.PerformanceMarkers.fullLoad),this._performanceMetricsCollection&&s.postPerformanceEvent(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(l){for(const i of this._markers)l&&!this.getRenderWorldCopies()&&(i._lngLat=i._lngLat.wrap()),i._update();for(const i of this._popups)!l||this.getRenderWorldCopies()||i._trackPointer||(i._lngLat=i._lngLat.wrap()),i._update()}_updateAverageElevation(l,i=!1){const n=h=>(this.transform.averageElevation=h,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return this.transform.averageElevation!==0&&n(0);if((i||l-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(l)){const h=this.transform.averageElevation;let p=this.transform.sampleAverageElevation(),m=!1;this.transform.elevation&&(m=this.transform.elevation.exaggeration()!==this._averageElevationExaggeration,this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(p)?p=0:this._averageElevationLastSampledAt=l;const _=Math.abs(h-p);if(_>1){if(this._isInitialLoad||m)return this._averageElevation.jumpTo(p),n(p);this._averageElevation.easeTo(p,l,300)}else if(_>1e-4)return this._averageElevation.jumpTo(p),n(p)}return!!this._averageElevation.isEasing(l)&&n(this._averageElevation.getValue(l))}_authenticate(){s.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,l=>{if(l&&(l.message===s.AUTH_ERR_MSG||l.status===401)){const i=this.painter.context.gl;s.storeAuthState(i,!1),this._logoControl instanceof El&&this._logoControl._updateLogo(),i&&i.clear(i.DEPTH_BUFFER_BIT|i.COLOR_BUFFER_BIT|i.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new s.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),s.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_updateTerrain(){const l=this._isDragging();this.painter.updateTerrain(this.style,l)}_calculateSpeedIndex(){const l=this.painter.canvasCopy(),i=this.painter.getCanvasCopiesAndTimestamps();i.timeStamps.push(performance.now());const n=this.painter.context.gl,h=n.createFramebuffer();function p(m){n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,m,0);const _=new Uint8Array(n.drawingBufferWidth*n.drawingBufferHeight*4);return n.readPixels(0,0,n.drawingBufferWidth,n.drawingBufferHeight,n.RGBA,n.UNSIGNED_BYTE,_),_}return n.bindFramebuffer(n.FRAMEBUFFER,h),this._canvasPixelComparison(p(l),i.canvasCopies.map(p),i.timeStamps)}_canvasPixelComparison(l,i,n){let h=n[1]-n[0];const p=l.length/4;for(let m=0;m<i.length;m++){const _=i[m];let y=0;for(let v=0;v<_.length;v+=4)_[v]===l[v]&&_[v+1]===l[v+1]&&_[v+2]===l[v+2]&&_[v+3]===l[v+3]&&(y+=1);h+=(n[m+2]-n[m+1])*(1-y/p)}return h}remove(){this._hash&&this._hash.remove();for(const i of this._controls)i.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this._domRenderTaskQueue.clear(),this.style&&this.style.destroy(),this.painter.destroy(),this.handlers&&this.handlers.destroy(),this.handlers=void 0,this.setStyle(null),s.window!==void 0&&(s.window.removeEventListener("resize",this._onWindowResize,!1),s.window.removeEventListener("orientationchange",this._onWindowResize,!1),s.window.removeEventListener("webkitfullscreenchange",this._onWindowResize,!1),s.window.removeEventListener("online",this._onWindowOnline,!1),s.window.removeEventListener("visibilitychange",this._onVisibilityChange,!1));const l=this.painter.context.gl.getExtension("WEBGL_lose_context");l&&l.loseContext(),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._missingCSSCanary.remove(),this._canvas=void 0,this._canvasContainer=void 0,this._controlContainer=void 0,this._missingCSSCanary=void 0,this._container.classList.remove("mapboxgl-map"),this._container.removeEventListener("scroll",this._onMapScroll,!1),s.removeAuthState(this.painter.context.gl),this._removed=!0,this.fire(new s.Event("remove"))}triggerRepaint(){this._triggerFrame(!0)}_triggerFrame(l){this._renderNextFrame=this._renderNextFrame||l,this.style&&!this._frame&&(this._frame=s.exported.frame(i=>{const n=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,n&&this._render(i)}))}_preloadTiles(l){const i=this.style?Object.values(this.style._sourceCaches):[];return s.asyncAll(i,(n,h)=>n._preloadTiles(l,h),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(l){this._trackResize&&this.resize({originalEvent:l})._update()}_onVisibilityChange(){s.window.document.visibilityState==="hidden"&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(l){this._showTileBoundaries!==l&&(this._showTileBoundaries=l,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(l){this._showTerrainWireframe!==l&&(this._showTerrainWireframe=l,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(l){this._speedIndexTiming!==l&&(this._speedIndexTiming=l,this._update())}get showPadding(){return!!this._showPadding}set showPadding(l){this._showPadding!==l&&(this._showPadding=l,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(l){this._showCollisionBoxes!==l&&(this._showCollisionBoxes=l,l?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(l){this._showOverdrawInspector!==l&&(this._showOverdrawInspector=l,this._update())}get repaint(){return!!this._repaint}set repaint(l){this._repaint!==l&&(this._repaint=l,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(l){this._vertices=l,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(l){this._showTileAABBs!==l&&(this._showTileAABBs=l,l&&this._update())}_setCacheLimits(l,i){s.setCacheLimits(l,i)}get version(){return s.version}},NavigationControl:class{constructor(l){this.options=s.extend({},hu,l),this._container=Je("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",i=>i.preventDefault()),this.options.showZoom&&(s.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",i=>{this._map&&this._map.zoomIn({},{originalEvent:i})}),Je("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",i=>{this._map&&this._map.zoomOut({},{originalEvent:i})}),Je("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(s.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",i=>{const n=this._map;n&&(this.options.visualizePitch?n.resetNorthPitch({},{originalEvent:i}):n.resetNorth({},{originalEvent:i}))}),this._compassIcon=Je("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const l=this._map;if(!l)return;const i=l.getZoom(),n=i===l.getMaxZoom(),h=i===l.getMinZoom();this._zoomInButton.disabled=n,this._zoomOutButton.disabled=h,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",h.toString())}_rotateCompassArrow(){const l=this._map;if(!l)return;const i=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(l.transform.pitch*(Math.PI/180)),.5)}) rotateX(${l.transform.pitch}deg) rotateZ(${l.transform.angle*(180/Math.PI)}deg)`:`rotate(${l.transform.angle*(180/Math.PI)}deg)`;l._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=i)})}onAdd(l){return this._map=l,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),l.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&l.on("pitch",this._rotateCompassArrow),l.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new uu(l,this._compass,this.options.visualizePitch)),this._container}onRemove(){const l=this._map;l&&(this._container.remove(),this.options.showZoom&&l.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&l.off("pitch",this._rotateCompassArrow),l.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(l,i){const n=Je("button",l,this._container);return n.type="button",n.addEventListener("click",i),n}_setButtonTitle(l,i){if(!this._map)return;const n=this._map._getUIString(`NavigationControl.${i}`);l.setAttribute("aria-label",n),l.firstElementChild&&l.firstElementChild.setAttribute("title",n)}},GeolocateControl:class extends s.Evented{constructor(l){super(),this.options=s.extend({geolocation:s.window.navigator.geolocation},Al,l),s.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=Tn(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(l){return this._map=l,this._container=Je("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(l){const i=(n=!!this.options.geolocation)=>{this._supportsGeolocation=n,l(n)};this._supportsGeolocation!==void 0?l(this._supportsGeolocation):s.window.navigator.permissions!==void 0?s.window.navigator.permissions.query({name:"geolocation"}).then(n=>i(n.state!=="denied")).catch(()=>i()):i()}_isOutOfMapMaxBounds(l){const i=this._map.getMaxBounds(),n=l.coords;return!!i&&(n.longitude<i.getWest()||n.longitude>i.getEast()||n.latitude<i.getSouth()||n.latitude>i.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(l){if(this._map){if(this._isOutOfMapMaxBounds(l))return this._setErrorState(),this.fire(new s.Event("outofmaxbounds",l)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=l,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_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(l),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(l),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("geolocate",l)),this._finish()}}_updateCamera(l){const i=new s.LngLat(l.coords.longitude,l.coords.latitude),n=l.coords.accuracy,h=this._map.getBearing(),p=s.extend({bearing:h},this.options.fitBoundsOptions);this._map.fitBounds(i.toBounds(n),p,{geolocateSource:!0})}_updateMarker(l){if(l){const i=new s.LngLat(l.coords.longitude,l.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=l.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const l=this._map.transform,i=s.mercatorZfromAltitude(1,l._center.lat)*l.worldSize,n=Math.ceil(2*this._accuracy*i);this._circleElement.style.width=`${n}px`,this._circleElement.style.height=`${n}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&typeof this._heading=="number"?(this._userLocationDotMarker.setRotation(this._heading),this._dotElement.classList.add("mapboxgl-user-location-show-heading")):(this._dotElement.classList.remove("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(l){if(this._map){if(this.options.trackUserLocation)if(l.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",i),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",i),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(l.code===3&&this._noTimeout)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("error",l)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(l){if(this._map!==void 0){if(this._container.addEventListener("contextmenu",i=>i.preventDefault()),this._geolocateButton=Je("button","mapboxgl-ctrl-geolocate",this._container),Je("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",l===!1){s.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",i),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",i)}else{const i=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",i),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",i)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=Je("div","mapboxgl-user-location"),this._dotElement.appendChild(Je("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(Je("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new Be({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=Je("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Be({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",i=>{i.geolocateSource||this._watchState!=="ACTIVE_LOCK"||i.originalEvent&&i.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new s.Event("trackuserlocationend")))})}}_onDeviceOrientation(l){this._userLocationDotMarker&&(l.webkitCompassHeading?this._heading=l.webkitCompassHeading:l.absolute===!0&&(this._heading=-1*l.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return s.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 s.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new s.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 s.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let l;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(l={maximumAge:6e5,timeout:0},this._noTimeout=!0):(l=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,l),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const l=()=>{s.window.addEventListener("ondeviceorientationabsolute"in s.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientation)};s.window.DeviceMotionEvent!==void 0&&typeof s.window.DeviceMotionEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(i=>{i==="granted"&&l()}).catch(console.error):l()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),s.window.removeEventListener("deviceorientation",this._onDeviceOrientation),s.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Ue,ScaleControl:class{constructor(l){this.options=s.extend({},Il,l),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch{return!1}}(),s.bindAll(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const l=this.options.maxWidth||100,i=this._map,n=i._containerHeight/2,h=i._containerWidth/2-l/2,p=i.unproject([h,n]),m=i.unproject([h+l,n]),_=p.distanceTo(m);if(this.options.unit==="imperial"){const y=3.2808*_;y>5280?this._setScale(l,y/5280,"mile"):this._setScale(l,y,"foot")}else this.options.unit==="nautical"?this._setScale(l,_/1852,"nautical-mile"):_>=1e3?this._setScale(l,_/1e3,"kilometer"):this._setScale(l,_,"meter")}_setScale(l,i,n){this._map._requestDomTask(()=>{const h=function(m){const _=Math.pow(10,`${Math.floor(m)}`.length-1);let y=m/_;return y=y>=10?10:y>=5?5:y>=3?3:y>=2?2:y>=1?1:function(v){const E=Math.pow(10,Math.ceil(-Math.log(v)/Math.LN10));return Math.round(v*E)/E}(y),_*y}(i),p=h/i;this._container.innerHTML=this._isNumberFormatSupported&&n!=="nautical-mile"?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:n}).format(h):`${h}&nbsp;${Cl[n]}`,this._container.style.width=l*p+"px"})}onAdd(l){return this._map=l,this._language=l.getLanguage(),this._container=Je("div","mapboxgl-ctrl mapboxgl-ctrl-scale",l.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(l){this._language=l,this._update()}setUnit(l){this.options.unit=l,this._update()}},FullscreenControl:class{constructor(l){this._fullscreen=!1,l&&l.container&&(l.container instanceof s.window.HTMLElement?this._container=l.container:s.warnOnce("Full screen control 'container' must be a DOM element.")),s.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in s.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in s.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(l){return this._map=l,this._container||(this._container=this._map.getContainer()),this._controlContainer=Je("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",s.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,s.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!s.window.document.fullscreenEnabled&&!s.window.document.webkitFullscreenEnabled)}_setupUI(){const l=this._fullscreenButton=Je("button","mapboxgl-ctrl-fullscreen",this._controlContainer);Je("span","mapboxgl-ctrl-icon",l).setAttribute("aria-hidden","true"),l.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),s.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const l=this._getTitle();this._fullscreenButton.setAttribute("aria-label",l),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",l)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(s.window.document.fullscreenElement||s.window.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?s.window.document.exitFullscreen?s.window.document.exitFullscreen():s.window.document.webkitCancelFullScreen&&s.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends s.Evented{constructor(l){super(),this.options=s.extend(Object.create(Sl),l),s.bindAll(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(l&&l.className?l.className.trim().split(/\s+/):[])}addTo(l){return this._map&&this.remove(),this._map=l,this.options.closeOnClick&&l.on("preclick",this._onClose),this.options.closeOnMove&&l.on("move",this._onClose),l.on("remove",this.remove),this._update(),l._addPopup(this),this._focusFirstElement(),this._trackPointer?(l.on("mousemove",this._onMouseEvent),l.on("mouseup",this._onMouseEvent),l._canvasContainer.classList.add("mapboxgl-track-pointer")):l.on("move",this._update),this.fire(new s.Event("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const l=this._map;return l&&(l.off("move",this._update),l.off("move",this._onClose),l.off("preclick",this._onClose),l.off("click",this._onClose),l.off("remove",this.remove),l.off("mousemove",this._onMouseEvent),l.off("mouseup",this._onMouseEvent),l.off("drag",this._onMouseEvent),l._canvasContainer&&l._canvasContainer.classList.remove("mapboxgl-track-pointer"),l._removePopup(this),this._map=void 0),this.fire(new s.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(l){this._lngLat=s.LngLat.convert(l),this._pos=null,this._trackPointer=!1,this._update();const i=this._map;return i&&(i.on("move",this._update),i.off("mousemove",this._onMouseEvent),i._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const l=this._map;return l&&(l.off("move",this._update),l.on("mousemove",this._onMouseEvent),l.on("drag",this._onMouseEvent),l._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(l){return this.setDOMContent(s.window.document.createTextNode(l))}setHTML(l){const i=s.window.document.createDocumentFragment(),n=s.window.document.createElement("body");let h;for(n.innerHTML=l;h=n.firstChild,h;)i.appendChild(h);return this.setDOMContent(i)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(l){return this.options.maxWidth=l,this._update(),this}setDOMContent(l){let i=this._content;if(i)for(;i.hasChildNodes();)i.firstChild&&i.removeChild(i.firstChild);else i=this._content=Je("div","mapboxgl-popup-content",this._container||void 0);if(i.appendChild(l),this.options.closeButton){const n=this._closeButton=Je("button","mapboxgl-popup-close-button",i);n.type="button",n.setAttribute("aria-label","Close popup"),n.setAttribute("aria-hidden","true"),n.innerHTML="&#215;",n.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(l){return this._classList.add(l),this._updateClassList(),this}removeClassName(l){return this._classList.delete(l),this._updateClassList(),this}setOffset(l){return this.options.offset=l,this._update(),this}toggleClassName(l){let i;return this._classList.delete(l)?i=!1:(this._classList.add(l),i=!0),this._updateClassList(),i}_onMouseEvent(l){this._update(l.point)}_getAnchor(l){if(this.options.anchor)return this.options.anchor;const i=this._map,n=this._container,h=this._pos;if(!i||!n||!h)return"bottom";const p=n.offsetWidth,m=n.offsetHeight,_=h.x<p/2,y=h.x>i.transform.width-p/2;if(h.y+l<m)return _?"top-left":y?"top-right":"top";if(h.y>i.transform.height-m){if(_)return"bottom-left";if(y)return"bottom-right"}return _?"left":y?"right":"bottom"}_updateClassList(){const l=this._container;if(!l)return;const i=[...this._classList];i.push("mapboxgl-popup"),this._anchor&&i.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&i.push("mapboxgl-popup-track-pointer"),l.className=i.join(" ")}_update(l){const i=this._map,n=this._content;if(!i||!this._lngLat&&!this._trackPointer||!n)return;let h=this._container;if(h||(h=this._container=Je("div","mapboxgl-popup",i.getContainer()),this._tip=Je("div","mapboxgl-popup-tip",h),h.appendChild(n)),this.options.maxWidth&&h.style.maxWidth!==this.options.maxWidth&&(h.style.maxWidth=this.options.maxWidth),i.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Sn(this._lngLat,this._pos,i.transform)),!this._trackPointer||l){const p=this._pos=this._trackPointer&&l?l:i.project(this._lngLat),m=eh(this.options.offset),_=this._anchor=this._getAnchor(m.y),y=eh(this.options.offset,_),v=p.add(y).round();i._requestDomTask(()=>{this._container&&_&&(this._container.style.transform=`${qo[_]} translate(${v.x}px,${v.y}px)`)})}if(!this._marker&&i._showingGlobe()){const p=s.isLngLatBehindGlobe(i.transform,this._lngLat)?0:1;this._setOpacity(p)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const l=this._container.querySelector(cu);l&&l.focus()}_onClose(){this.remove()}_setOpacity(l){this._container&&(this._container.style.opacity=`${l}`),this._content&&(this._content.style.pointerEvents=l?"auto":"none")}},Marker:Be,Style:Bi,LngLat:s.LngLat,LngLatBounds:s.LngLatBounds,Point:s.Point,MercatorCoordinate:s.MercatorCoordinate,FreeCameraOptions:Uc,Evented:s.Evented,config:s.config,prewarm:function(){cn().acquire(Di)},clearPrewarmedResources:function(){const l=Xr;l&&(l.isPreloaded()&&l.numActive()===1?(l.release(Di),Xr=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 s.config.ACCESS_TOKEN},set accessToken(l){s.config.ACCESS_TOKEN=l},get baseApiUrl(){return s.config.API_URL},set baseApiUrl(l){s.config.API_URL=l},get workerCount(){return Mr.workerCount},set workerCount(l){Mr.workerCount=l},get maxParallelImageRequests(){return s.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(l){s.config.MAX_PARALLEL_IMAGE_REQUESTS=l},clearStorage(l){s.clearTileCache(l)},workerUrl:"",workerClass:null,setNow:s.exported.setNow,restoreNow:s.exported.restoreNow};return Mn});var Pi=Ht;return Pi})})(sf);var my=sf.exports;const fc=Z_(my),nf={__name:"map",props:{token:{type:String,required:!0}},emits:["mapCreated"],setup(zt,{expose:Vt,emit:xt}){const Pt=zt;let Ht=Yr(null),Qt=Yr(null),Pi=Yr(null),s=Yr({}),ve=vt=>{Qt.value=new fc.LngLatBounds,vt.forEach(er=>{Qt.value.extend([er.longitude,er.latitude])})},yt=(vt,er)=>{Object.values(s.value).forEach(kr=>kr.remove()),s.value={},vt.forEach(kr=>{let Dt=new fc.Marker({color:"#000000"}).setLngLat([parseFloat(kr.longitude),parseFloat(kr.latitude)]).setPopup(new fc.Popup().setHTML(er[kr.id]));s.value[kr.id]=Dt,Dt.addTo(Ht.value)})},Xt=vt=>{vt.length!==0&&Ht.value.fitBounds(Qt.value,{padding:80,maxZoom:10})},He=async()=>{try{fc.accessToken=Pt.token,Ht.value=new fc.Map({container:Pi.value,style:"mapbox://styles/adria-mobil/cld1k0m6i000h01lcthq1rv5s",bounds:Qt.value}),xt("mapCreated",Ht.value)}catch(vt){console.log("map error",vt)}};return Nh(()=>Pi.value,()=>He()),Vt({mapMarkers:s,fill:(vt,er)=>{ve(vt),yt(vt,er),Xt(vt)}}),(vt,er)=>(hr(),Lr("div",{ref_key:"mapDiv",ref:Pi},null,512))}},fy={},gy={width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},_y=Ct("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M18.25 11C18.25 15 12 19.25 12 19.25C12 19.25 5.75 15 5.75 11C5.75 7.5 8.68629 4.75 12 4.75C15.3137 4.75 18.25 7.5 18.25 11Z"},null,-1),yy=Ct("circle",{cx:"12",cy:"11",r:"2.25",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"},null,-1),xy=[_y,yy];function vy(zt,Vt){return hr(),Lr("svg",gy,xy)}const wy=Vh(fy,[["render",vy]]),by=`@import"https://api.mapbox.com/mapbox-gl-js/v2.12.0/mapbox-gl.css";html{font-weight:400}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Raleway,sans-serif;font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}[type=text],input:where(:not([type])),[type=email],[type=url],[type=password],[type=number],[type=date],[type=datetime-local],[type=month],[type=search],[type=tel],[type=time],[type=week],[multiple],textarea,select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#6b7280;border-width:1px;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem;--tw-shadow: 0 0 #0000}[type=text]:focus,input:where(:not([type])):focus,[type=email]:focus,[type=url]:focus,[type=password]:focus,[type=number]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=month]:focus,[type=search]:focus,[type=tel]:focus,[type=time]:focus,[type=week]:focus,[multiple]:focus,textarea:focus,select:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: #2563eb;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#2563eb}input::-moz-placeholder,textarea::-moz-placeholder{color:#6b7280;opacity:1}input::placeholder,textarea::placeholder{color:#6b7280;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-top:0;padding-bottom:0}select{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem;-webkit-print-color-adjust:exact;print-color-adjust:exact}[multiple],[size]:where(select:not([size="1"])){background-image:initial;background-position:initial;background-repeat:unset;background-size:initial;padding-right:.75rem;-webkit-print-color-adjust:unset;print-color-adjust:unset}[type=checkbox],[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;display:inline-block;vertical-align:middle;background-origin:border-box;-webkit-user-select:none;-moz-user-select:none;user-select:none;flex-shrink:0;height:1rem;width:1rem;color:#2563eb;background-color:#fff;border-color:#6b7280;border-width:1px;--tw-shadow: 0 0 #0000}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 2px;--tw-ring-offset-color: #fff;--tw-ring-color: #2563eb;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}[type=checkbox]:checked,[type=radio]:checked{border-color:transparent;background-color:currentColor;background-size:100% 100%;background-position:center;background-repeat:no-repeat}[type=checkbox]:checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e")}[type=radio]:checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e")}[type=checkbox]:checked:hover,[type=checkbox]:checked:focus,[type=radio]:checked:hover,[type=radio]:checked:focus{border-color:transparent;background-color:currentColor}[type=checkbox]:indeterminate{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");border-color:transparent;background-color:currentColor;background-size:100% 100%;background-position:center;background-repeat:no-repeat}[type=checkbox]:indeterminate:hover,[type=checkbox]:indeterminate:focus{border-color:transparent;background-color:currentColor}[type=file]{background:unset;border-color:inherit;border-width:0;border-radius:0;padding:0;font-size:unset;line-height:inherit}[type=file]:focus{outline:1px solid ButtonText;outline:1px auto -webkit-focus-ring-color}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.\\!container{width:100%!important}.container{width:100%}@media (min-width: 640px){.\\!container{max-width:640px!important}.container{max-width:640px}}@media (min-width: 768px){.\\!container{max-width:768px!important}.container{max-width:768px}}@media (min-width: 1024px){.\\!container{max-width:1024px!important}.container{max-width:1024px}}@media (min-width: 1280px){.\\!container{max-width:1280px!important}.container{max-width:1280px}}@media (min-width: 1536px){.\\!container{max-width:1536px!important}.container{max-width:1536px}}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-left-width:.25rem;border-left-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-left:1em}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px 0 rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding:.1875em .375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"\`"}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"\`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding:.8571429em 1.1428571em}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;text-align:left;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-right:.5714286em;padding-bottom:.5714286em;padding-left:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-left:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-sm{font-size:.875rem;line-height:1.7142857}.prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}.prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-left:1.1111111em}.prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2}.prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4}.prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;margin-top:1.5555556em;margin-bottom:.4444444em;line-height:1.5555556}.prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714}.prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;border-radius:.3125rem;padding:.1428571em .3571429em}.prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em}.prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding:.6666667em 1em}.prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-left:1.5714286em}.prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-left:1.5714286em}.prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}.prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.4285714em}.prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.4285714em}.prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(.prose-sm>ul>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ul>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(.prose-sm>ol>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ol>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;padding-left:1.5714286em}.prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}.prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.5}.prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:1em;padding-bottom:.6666667em;padding-left:1em}.prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding:.6666667em 1em}.prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}.prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-lg{font-size:1.125rem;line-height:1.7777778}.prose-lg :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em}.prose-lg :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2222222em;line-height:1.4545455;margin-top:1.0909091em;margin-bottom:1.0909091em}.prose-lg :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.6666667em;margin-bottom:1.6666667em;padding-left:1em}.prose-lg :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.6666667em;margin-top:0;margin-bottom:.8333333em;line-height:1}.prose-lg :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.6666667em;margin-top:1.8666667em;margin-bottom:1.0666667em;line-height:1.3333333}.prose-lg :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.3333333em;margin-top:1.6666667em;margin-bottom:.6666667em;line-height:1.5}.prose-lg :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7777778em;margin-bottom:.4444444em;line-height:1.5555556}.prose-lg :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7777778em;margin-bottom:1.7777778em}.prose-lg :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7777778em;margin-bottom:1.7777778em}.prose-lg :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-lg :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7777778em;margin-bottom:1.7777778em}.prose-lg :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em;border-radius:.3125rem;padding:.2222222em .4444444em}.prose-lg :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.prose-lg :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8666667em}.prose-lg :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.875em}.prose-lg :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em;line-height:1.75;margin-top:2em;margin-bottom:2em;border-radius:.375rem;padding:1em 1.5em}.prose-lg :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-left:1.5555556em}.prose-lg :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-left:1.5555556em}.prose-lg :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.6666667em;margin-bottom:.6666667em}.prose-lg :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.4444444em}.prose-lg :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.4444444em}.prose-lg :where(.prose-lg>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.8888889em;margin-bottom:.8888889em}.prose-lg :where(.prose-lg>ul>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em}.prose-lg :where(.prose-lg>ul>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.3333333em}.prose-lg :where(.prose-lg>ol>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em}.prose-lg :where(.prose-lg>ol>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.3333333em}.prose-lg :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.8888889em;margin-bottom:.8888889em}.prose-lg :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em}.prose-lg :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em}.prose-lg :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.6666667em;padding-left:1.5555556em}.prose-lg :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:3.1111111em;margin-bottom:3.1111111em}.prose-lg :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-lg :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-lg :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-lg :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-lg :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em;line-height:1.5}.prose-lg :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:.75em;padding-bottom:.75em;padding-left:.75em}.prose-lg :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.prose-lg :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.prose-lg :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding:.75em}.prose-lg :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.prose-lg :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.prose-lg :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7777778em;margin-bottom:1.7777778em}.prose-lg :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-lg :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em;line-height:1.5;margin-top:1em}.prose-lg :where(.prose-lg>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-lg :where(.prose-lg>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-invert{--tw-prose-body: var(--tw-prose-invert-body);--tw-prose-headings: var(--tw-prose-invert-headings);--tw-prose-lead: var(--tw-prose-invert-lead);--tw-prose-links: var(--tw-prose-invert-links);--tw-prose-bold: var(--tw-prose-invert-bold);--tw-prose-counters: var(--tw-prose-invert-counters);--tw-prose-bullets: var(--tw-prose-invert-bullets);--tw-prose-hr: var(--tw-prose-invert-hr);--tw-prose-quotes: var(--tw-prose-invert-quotes);--tw-prose-quote-borders: var(--tw-prose-invert-quote-borders);--tw-prose-captions: var(--tw-prose-invert-captions);--tw-prose-kbd: var(--tw-prose-invert-kbd);--tw-prose-kbd-shadows: var(--tw-prose-invert-kbd-shadows);--tw-prose-code: var(--tw-prose-invert-code);--tw-prose-pre-code: var(--tw-prose-invert-pre-code);--tw-prose-pre-bg: var(--tw-prose-invert-pre-bg);--tw-prose-th-borders: var(--tw-prose-invert-th-borders);--tw-prose-td-borders: var(--tw-prose-invert-td-borders)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{top:0;bottom:0}.\\!-bottom-10{bottom:-2.5rem!important}.\\!-bottom-\\[36px\\]{bottom:-36px!important}.\\!-left-\\[40px\\]{left:-40px!important}.\\!-right-\\[40px\\]{right:-40px!important}.\\!bottom-2{bottom:.5rem!important}.\\!left-0{left:0!important}.\\!right-0{right:0!important}.\\!right-2{right:.5rem!important}.\\!right-2\\.5{right:.625rem!important}.\\!right-6{right:1.5rem!important}.\\!top-0{top:0!important}.\\!top-\\[1\\.4rem\\]{top:1.4rem!important}.\\!top-auto{top:auto!important}.-bottom-6{bottom:-1.5rem}.-right-4{right:-1rem}.-right-8{right:-2rem}.bottom-0{bottom:0}.bottom-10{bottom:2.5rem}.bottom-12{bottom:3rem}.bottom-2{bottom:.5rem}.bottom-4{bottom:1rem}.bottom-6{bottom:1.5rem}.bottom-\\[50\\%\\]{bottom:50%}.left-0{left:0}.left-1\\/2{left:50%}.left-12{left:3rem}.left-4{left:1rem}.right-0{right:0}.right-1\\/2{right:50%}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.right-8{right:2rem}.right-\\[3\\.65rem\\]{right:3.65rem}.top-0{top:0}.top-1\\/2{top:50%}.top-1\\/3{top:33.333333%}.top-10{top:2.5rem}.top-16{top:4rem}.top-2{top:.5rem}.top-2\\.5{top:.625rem}.top-8{top:2rem}.top-\\[10\\%\\]{top:10%}.-z-10{z-index:-10}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.z-\\[10\\]{z-index:10}.z-\\[12\\]{z-index:12}.z-\\[13\\]{z-index:13}.z-\\[1\\]{z-index:1}.order-1{order:1}.order-2{order:2}.order-3{order:3}.order-4{order:4}.order-5{order:5}.order-6{order:6}.order-7{order:7}.order-first{order:-9999}.order-last{order:9999}.col-span-1{grid-column:span 1 / span 1}.col-span-11{grid-column:span 11 / span 11}.col-span-2{grid-column:span 2 / span 2}.col-span-3{grid-column:span 3 / span 3}.col-span-4{grid-column:span 4 / span 4}.col-span-5{grid-column:span 5 / span 5}.col-span-6{grid-column:span 6 / span 6}.col-span-7{grid-column:span 7 / span 7}.col-span-8{grid-column:span 8 / span 8}.col-span-9{grid-column:span 9 / span 9}.row-start-\\[10\\]{grid-row-start:10}.row-start-\\[11\\]{grid-row-start:11}.row-start-\\[12\\]{grid-row-start:12}.row-start-\\[13\\]{grid-row-start:13}.row-start-\\[14\\]{grid-row-start:14}.row-start-\\[15\\]{grid-row-start:15}.row-start-\\[16\\]{grid-row-start:16}.row-start-\\[17\\]{grid-row-start:17}.row-start-\\[18\\]{grid-row-start:18}.row-start-\\[19\\]{grid-row-start:19}.row-start-\\[1\\]{grid-row-start:1}.row-start-\\[20\\]{grid-row-start:20}.row-start-\\[21\\]{grid-row-start:21}.row-start-\\[22\\]{grid-row-start:22}.row-start-\\[23\\]{grid-row-start:23}.row-start-\\[24\\]{grid-row-start:24}.row-start-\\[25\\]{grid-row-start:25}.row-start-\\[26\\]{grid-row-start:26}.row-start-\\[27\\]{grid-row-start:27}.row-start-\\[28\\]{grid-row-start:28}.row-start-\\[29\\]{grid-row-start:29}.row-start-\\[2\\]{grid-row-start:2}.row-start-\\[30\\]{grid-row-start:30}.row-start-\\[31\\]{grid-row-start:31}.row-start-\\[32\\]{grid-row-start:32}.row-start-\\[33\\]{grid-row-start:33}.row-start-\\[34\\]{grid-row-start:34}.row-start-\\[35\\]{grid-row-start:35}.row-start-\\[36\\]{grid-row-start:36}.row-start-\\[37\\]{grid-row-start:37}.row-start-\\[38\\]{grid-row-start:38}.row-start-\\[39\\]{grid-row-start:39}.row-start-\\[3\\]{grid-row-start:3}.row-start-\\[40\\]{grid-row-start:40}.row-start-\\[41\\]{grid-row-start:41}.row-start-\\[42\\]{grid-row-start:42}.row-start-\\[43\\]{grid-row-start:43}.row-start-\\[44\\]{grid-row-start:44}.row-start-\\[45\\]{grid-row-start:45}.row-start-\\[46\\]{grid-row-start:46}.row-start-\\[47\\]{grid-row-start:47}.row-start-\\[48\\]{grid-row-start:48}.row-start-\\[49\\]{grid-row-start:49}.row-start-\\[4\\]{grid-row-start:4}.row-start-\\[50\\]{grid-row-start:50}.row-start-\\[51\\]{grid-row-start:51}.row-start-\\[52\\]{grid-row-start:52}.row-start-\\[53\\]{grid-row-start:53}.row-start-\\[54\\]{grid-row-start:54}.row-start-\\[55\\]{grid-row-start:55}.row-start-\\[56\\]{grid-row-start:56}.row-start-\\[57\\]{grid-row-start:57}.row-start-\\[58\\]{grid-row-start:58}.row-start-\\[59\\]{grid-row-start:59}.row-start-\\[5\\]{grid-row-start:5}.row-start-\\[60\\]{grid-row-start:60}.row-start-\\[61\\]{grid-row-start:61}.row-start-\\[62\\]{grid-row-start:62}.row-start-\\[63\\]{grid-row-start:63}.row-start-\\[64\\]{grid-row-start:64}.row-start-\\[65\\]{grid-row-start:65}.row-start-\\[66\\]{grid-row-start:66}.row-start-\\[67\\]{grid-row-start:67}.row-start-\\[68\\]{grid-row-start:68}.row-start-\\[69\\]{grid-row-start:69}.row-start-\\[6\\]{grid-row-start:6}.row-start-\\[70\\]{grid-row-start:70}.row-start-\\[71\\]{grid-row-start:71}.row-start-\\[72\\]{grid-row-start:72}.row-start-\\[73\\]{grid-row-start:73}.row-start-\\[74\\]{grid-row-start:74}.row-start-\\[75\\]{grid-row-start:75}.row-start-\\[76\\]{grid-row-start:76}.row-start-\\[77\\]{grid-row-start:77}.row-start-\\[78\\]{grid-row-start:78}.row-start-\\[79\\]{grid-row-start:79}.row-start-\\[7\\]{grid-row-start:7}.row-start-\\[80\\]{grid-row-start:80}.row-start-\\[81\\]{grid-row-start:81}.row-start-\\[82\\]{grid-row-start:82}.row-start-\\[83\\]{grid-row-start:83}.row-start-\\[84\\]{grid-row-start:84}.row-start-\\[85\\]{grid-row-start:85}.row-start-\\[86\\]{grid-row-start:86}.row-start-\\[87\\]{grid-row-start:87}.row-start-\\[88\\]{grid-row-start:88}.row-start-\\[89\\]{grid-row-start:89}.row-start-\\[8\\]{grid-row-start:8}.row-start-\\[90\\]{grid-row-start:90}.row-start-\\[91\\]{grid-row-start:91}.row-start-\\[92\\]{grid-row-start:92}.row-start-\\[93\\]{grid-row-start:93}.row-start-\\[94\\]{grid-row-start:94}.row-start-\\[95\\]{grid-row-start:95}.row-start-\\[96\\]{grid-row-start:96}.row-start-\\[97\\]{grid-row-start:97}.row-start-\\[98\\]{grid-row-start:98}.row-start-\\[99\\]{grid-row-start:99}.row-start-\\[9\\]{grid-row-start:9}.\\!m-0{margin:0!important}.m-0{margin:0}.m-1{margin:.25rem}.m-2{margin:.5rem}.m-auto{margin:auto}.mx-10{margin-left:2.5rem;margin-right:2.5rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-8{margin-left:2rem;margin-right:2rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0{margin-top:0;margin-bottom:0}.my-10{margin-top:2.5rem;margin-bottom:2.5rem}.my-12{margin-top:3rem;margin-bottom:3rem}.my-16{margin-top:4rem;margin-bottom:4rem}.my-20{margin-top:5rem;margin-bottom:5rem}.my-24{margin-top:6rem;margin-bottom:6rem}.my-4{margin-top:1rem;margin-bottom:1rem}.my-8{margin-top:2rem;margin-bottom:2rem}.my-auto{margin-top:auto;margin-bottom:auto}.\\!-mt-2{margin-top:-.5rem!important}.\\!-mt-2\\.5{margin-top:-.625rem!important}.\\!-mt-4{margin-top:-1rem!important}.\\!mt-0{margin-top:0!important}.\\!mt-2{margin-top:.5rem!important}.-mb-\\[10\\%\\]{margin-bottom:-10%}.-ml-2{margin-left:-.5rem}.-ml-4{margin-left:-1rem}.-ml-6{margin-left:-1.5rem}.-ml-px{margin-left:-1px}.-mt-12{margin-top:-3rem}.-mt-2{margin-top:-.5rem}.-mt-5{margin-top:-1.25rem}.-mt-\\[20\\%\\]{margin-top:-20%}.mb-1{margin-bottom:.25rem}.mb-10{margin-bottom:2.5rem}.mb-12{margin-bottom:3rem}.mb-16{margin-bottom:4rem}.mb-2{margin-bottom:.5rem}.mb-20{margin-bottom:5rem}.mb-24{margin-bottom:6rem}.mb-3{margin-bottom:.75rem}.mb-32{margin-bottom:8rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-8{margin-left:2rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-1\\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mr-\\[0\\.15rem\\]{margin-right:.15rem}.mr-\\[2px\\]{margin-right:2px}.mr-\\[40px\\]{margin-right:40px}.mr-auto{margin-right:auto}.mt-0{margin-top:0}.mt-1{margin-top:.25rem}.mt-10{margin-top:2.5rem}.mt-12{margin-top:3rem}.mt-14{margin-top:3.5rem}.mt-16{margin-top:4rem}.mt-2{margin-top:.5rem}.mt-20{margin-top:5rem}.mt-24{margin-top:6rem}.mt-28{margin-top:7rem}.mt-3{margin-top:.75rem}.mt-32{margin-top:8rem}.mt-4{margin-top:1rem}.mt-40{margin-top:10rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.\\!block{display:block!important}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.\\!flex{display:flex!important}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.table-cell{display:table-cell}.table-header-group{display:table-header-group}.table-row{display:table-row}.grid{display:grid}.contents{display:contents}.\\!hidden{display:none!important}.hidden{display:none}.\\!aspect-\\[16\\/9\\]{aspect-ratio:16/9!important}.\\!aspect-\\[9\\/16\\]{aspect-ratio:9/16!important}.\\!aspect-square{aspect-ratio:1 / 1!important}.aspect-\\[1\\/1\\]{aspect-ratio:1/1}.aspect-\\[1\\/2\\]{aspect-ratio:1/2}.aspect-\\[10\\/6\\]{aspect-ratio:10/6}.aspect-\\[10\\/7\\]{aspect-ratio:10/7}.aspect-\\[1030\\/670\\]{aspect-ratio:1030/670}.aspect-\\[12\\/16\\]{aspect-ratio:12/16}.aspect-\\[16\\/10\\]{aspect-ratio:16/10}.aspect-\\[16\\/11\\]{aspect-ratio:16/11}.aspect-\\[16\\/12\\]{aspect-ratio:16/12}.aspect-\\[16\\/8\\]{aspect-ratio:16/8}.aspect-\\[16\\/9\\]{aspect-ratio:16/9}.aspect-\\[2\\/1\\]{aspect-ratio:2/1}.aspect-\\[2\\/3\\]{aspect-ratio:2/3}.aspect-\\[3\\/2\\]{aspect-ratio:3/2}.aspect-\\[3\\/4\\]{aspect-ratio:3/4}.aspect-\\[3\\/5\\]{aspect-ratio:3/5}.aspect-\\[350\\/240\\]{aspect-ratio:350/240}.aspect-\\[390\\/844\\]{aspect-ratio:390/844}.aspect-\\[4\\/3\\]{aspect-ratio:4/3}.aspect-\\[412\\/915\\]{aspect-ratio:412/915}.aspect-\\[5\\/3\\]{aspect-ratio:5/3}.aspect-\\[7\\/8\\]{aspect-ratio:7/8}.aspect-\\[820\\/1180\\]{aspect-ratio:820/1180}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.\\!h-12{height:3rem!important}.\\!h-6{height:1.5rem!important}.\\!h-8{height:2rem!important}.\\!h-\\[calc\\(100\\%-2\\.2rem\\)\\]{height:calc(100% - 2.2rem)!important}.\\!h-auto{height:auto!important}.\\!h-full{height:100%!important}.h-1\\/2{height:50%}.h-10{height:2.5rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-20{height:5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-32{height:8rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-96{height:24rem}.h-\\[1200px\\]{height:1200px}.h-\\[200px\\]{height:200px}.h-\\[40\\%\\]{height:40%}.h-\\[400px\\]{height:400px}.h-\\[50\\%\\]{height:50%}.h-\\[560px\\]{height:560px}.h-\\[5rem\\]{height:5rem}.h-\\[calc\\(100vh-12rem\\)\\]{height:calc(100vh - 12rem)}.h-\\[calc\\(100vh-4rem\\)\\]{height:calc(100vh - 4rem)}.h-auto{height:auto}.h-full{height:100%}.h-full-screen{height:calc(100vh - 4rem);height:calc(100lvh - 4rem)}.h-full-screen-small{height:calc(100vh - 4rem);height:calc(100svh - 4rem)}.h-screen{height:100vh}.h-top-header{height:4rem}.max-h-96{max-height:24rem}.max-h-\\[50rem\\]{max-height:50rem}.max-h-\\[700px\\]{max-height:700px}.max-h-\\[80\\%\\]{max-height:80%}.max-h-\\[800px\\]{max-height:800px}.max-h-\\[90\\%\\]{max-height:90%}.max-h-full{max-height:100%}.max-h-screen{max-height:100vh}.min-h-\\[200px\\]{min-height:200px}.min-h-\\[300px\\]{min-height:300px}.min-h-\\[600px\\]{min-height:600px}.min-h-full{min-height:100%}.min-h-screen{min-height:100vh}.\\!w-12{width:3rem!important}.\\!w-32{width:8rem!important}.\\!w-6{width:1.5rem!important}.\\!w-8{width:2rem!important}.\\!w-9\\/12{width:75%!important}.\\!w-\\[80\\%\\]{width:80%!important}.\\!w-\\[86\\%\\]{width:86%!important}.\\!w-\\[90\\%\\]{width:90%!important}.\\!w-\\[calc\\(100\\%-6rem\\)\\]{width:calc(100% - 6rem)!important}.\\!w-\\[calc\\(80\\%\\)\\]{width:80%!important}.\\!w-\\[calc\\(90\\%\\)\\]{width:90%!important}.\\!w-auto{width:auto!important}.w-1\\/12{width:8.333333%}.w-1\\/2{width:50%}.w-1\\/3{width:33.333333%}.w-1\\/5{width:20%}.w-10{width:2.5rem}.w-10\\/12{width:83.333333%}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\\/3{width:66.666667%}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\\/12{width:25%}.w-32{width:8rem}.w-4{width:1rem}.w-4\\/5{width:80%}.w-40{width:10rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-52{width:13rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-8\\/12{width:66.666667%}.w-80{width:20rem}.w-9\\/12{width:75%}.w-96{width:24rem}.w-\\[10\\%\\]{width:10%}.w-\\[16\\.15rem\\]{width:16.15rem}.w-\\[20\\%\\]{width:20%}.w-\\[300px\\]{width:300px}.w-\\[360px\\]{width:360px}.w-\\[380px\\]{width:380px}.w-\\[40\\%\\]{width:40%}.w-\\[420px\\]{width:420px}.w-\\[5\\%\\]{width:5%}.w-\\[500px\\]{width:500px}.w-\\[60\\%\\]{width:60%}.w-\\[80\\%\\]{width:80%}.w-\\[90\\%\\]{width:90%}.w-auto{width:auto}.w-full{width:100%}.w-screen{width:100vw}.min-w-full{min-width:100%}.\\!max-w-none{max-width:none!important}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-6xl{max-width:72rem}.max-w-7xl{max-width:80rem}.max-w-\\[60\\%\\]{max-width:60%}.max-w-\\[72rem\\]{max-width:72rem}.max-w-\\[90\\%\\]{max-width:90%}.max-w-full{max-width:100%}.max-w-full-hd{max-width:1920px}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.max-w-prose{max-width:65ch}.max-w-screen-2xl{max-width:1536px}.max-w-screen-lg{max-width:1024px}.max-w-screen-md{max-width:768px}.max-w-screen-sm{max-width:640px}.max-w-screen-xl{max-width:1280px}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink{flex-shrink:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.origin-top{transform-origin:top}.origin-top-left{transform-origin:top left}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-10{--tw-translate-x: -2.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-0{--tw-translate-y: -0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-16{--tw-translate-y: -4rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-20{--tw-translate-y: -5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-32{--tw-translate-y: -8rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-full{--tw-translate-y: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-1\\/2{--tw-translate-x: 50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-10{--tw-translate-x: 2.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-20{--tw-translate-x: 5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-4{--tw-translate-y: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-8{--tw-translate-y: 2rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-45{--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-0{--tw-scale-x: 0;--tw-scale-y: 0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-50{--tw-scale-x: .5;--tw-scale-y: .5;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-y-0{--tw-scale-y: 0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform-gpu{transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.break-inside-avoid{-moz-column-break-inside:avoid;break-inside:avoid}.break-after-page{-moz-column-break-after:page;break-after:page}.grid-flow-row{grid-auto-flow:row}.grid-flow-col{grid-auto-flow:column}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.grid-rows-\\[repeat\\(13\\,minmax\\(0\\,1fr\\)\\)\\]{grid-template-rows:repeat(13,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.\\!items-start{align-items:flex-start!important}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.\\!justify-start{justify-content:flex-start!important}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-evenly{justify-content:space-evenly}.justify-items-center{justify-items:center}.gap-0{gap:0px}.gap-1{gap:.25rem}.gap-10{gap:2.5rem}.gap-12{gap:3rem}.gap-16{gap:4rem}.gap-2{gap:.5rem}.gap-20{gap:5rem}.gap-24{gap:6rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-x-1{-moz-column-gap:.25rem;column-gap:.25rem}.gap-x-1\\.5{-moz-column-gap:.375rem;column-gap:.375rem}.gap-x-12{-moz-column-gap:3rem;column-gap:3rem}.gap-x-16{-moz-column-gap:4rem;column-gap:4rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-x-8{-moz-column-gap:2rem;column-gap:2rem}.gap-y-10{row-gap:2.5rem}.gap-y-12{row-gap:3rem}.gap-y-2{row-gap:.5rem}.gap-y-24{row-gap:6rem}.gap-y-4{row-gap:1rem}.gap-y-6{row-gap:1.5rem}.gap-y-8{row-gap:2rem}.\\!space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(0px * var(--tw-space-y-reverse))!important}.\\!space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(.5rem * var(--tw-space-y-reverse))!important}.\\!space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(2rem * var(--tw-space-y-reverse))!important}.space-x-0>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(0px * var(--tw-space-x-reverse));margin-left:calc(0px * calc(1 - var(--tw-space-x-reverse)))}.space-x-0\\.5>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.125rem * var(--tw-space-x-reverse));margin-left:calc(.125rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-1\\.5>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.375rem * var(--tw-space-x-reverse));margin-left:calc(.375rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-6>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1.5rem * var(--tw-space-x-reverse));margin-left:calc(1.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2rem * var(--tw-space-x-reverse));margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-\\[6\\%\\]>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(6% * var(--tw-space-x-reverse));margin-left:calc(6% * calc(1 - var(--tw-space-x-reverse)))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-0\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-10>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2.5rem * var(--tw-space-y-reverse))}.space-y-12>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(3rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(3rem * var(--tw-space-y-reverse))}.space-y-14>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(3.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(3.5rem * var(--tw-space-y-reverse))}.space-y-16>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(4rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(4rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-20>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(5rem * var(--tw-space-y-reverse))}.space-y-24>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(6rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(6rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}.divide-x-2>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(2px * var(--tw-divide-x-reverse));border-left-width:calc(2px * calc(1 - var(--tw-divide-x-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-y-2>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(2px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(2px * var(--tw-divide-y-reverse))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(229 231 235 / var(--tw-divide-opacity))}.divide-gray-300>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(209 213 219 / var(--tw-divide-opacity))}.divide-gray-500>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(107 114 128 / var(--tw-divide-opacity))}.divide-supersonic-gray-text>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(135 135 135 / var(--tw-divide-opacity))}.divide-opacity-10>:not([hidden])~:not([hidden]){--tw-divide-opacity: .1}.divide-opacity-20>:not([hidden])~:not([hidden]){--tw-divide-opacity: .2}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-hidden{overflow-y:hidden}.scroll-smooth{scroll-behavior:smooth}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-none{border-radius:0}.rounded-xl{border-radius:.75rem}.rounded-l-full{border-top-left-radius:9999px;border-bottom-left-radius:9999px}.rounded-l-md{border-top-left-radius:.375rem;border-bottom-left-radius:.375rem}.rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.rounded-r-md{border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}.rounded-tl-lg{border-top-left-radius:.5rem}.rounded-tr-lg{border-top-right-radius:.5rem}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-r-2{border-right-width:2px}.border-t{border-top-width:1px}.border-t-2{border-top-width:2px}.border-dashed{border-style:dashed}.\\!border-none{border-style:none!important}.border-a-black-30{--tw-border-opacity: 1;border-color:rgb(180 180 179 / var(--tw-border-opacity))}.border-a-black-60{--tw-border-opacity: 1;border-color:rgb(103 103 103 / var(--tw-border-opacity))}.border-a-footer{--tw-border-opacity: 1;border-color:rgb(34 34 34 / var(--tw-border-opacity))}.border-a-light-gray{--tw-border-opacity: 1;border-color:rgb(235 235 235 / var(--tw-border-opacity))}.border-black{--tw-border-opacity: 1;border-color:rgb(0 0 0 / var(--tw-border-opacity))}.border-blue-600{--tw-border-opacity: 1;border-color:rgb(37 99 235 / var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-gray-400{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity))}.border-gray-500{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity))}.border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}.border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity))}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity))}.border-green-400{--tw-border-opacity: 1;border-color:rgb(74 222 128 / var(--tw-border-opacity))}.border-green-600{--tw-border-opacity: 1;border-color:rgb(22 163 74 / var(--tw-border-opacity))}.border-neutral-700{--tw-border-opacity: 1;border-color:rgb(64 64 64 / var(--tw-border-opacity))}.border-purple-600{--tw-border-opacity: 1;border-color:rgb(147 51 234 / var(--tw-border-opacity))}.border-red-400{--tw-border-opacity: 1;border-color:rgb(248 113 113 / var(--tw-border-opacity))}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}.border-b-\\[\\#9b9b9b\\]{--tw-border-opacity: 1;border-bottom-color:rgb(155 155 155 / var(--tw-border-opacity))}.border-b-black{--tw-border-opacity: 1;border-bottom-color:rgb(0 0 0 / var(--tw-border-opacity))}.border-b-gray-500{--tw-border-opacity: 1;border-bottom-color:rgb(107 114 128 / var(--tw-border-opacity))}.border-b-neutral-300{--tw-border-opacity: 1;border-bottom-color:rgb(212 212 212 / var(--tw-border-opacity))}.border-b-white{--tw-border-opacity: 1;border-bottom-color:rgb(255 255 255 / var(--tw-border-opacity))}.border-r-gray-500{--tw-border-opacity: 1;border-right-color:rgb(107 114 128 / var(--tw-border-opacity))}.border-t-a-black-30{--tw-border-opacity: 1;border-top-color:rgb(180 180 179 / var(--tw-border-opacity))}.border-opacity-50{--tw-border-opacity: .5}.\\!bg-a-light-gray{--tw-bg-opacity: 1 !important;background-color:rgb(235 235 235 / var(--tw-bg-opacity))!important}.\\!bg-transparent{background-color:transparent!important}.bg-\\[\\#1C160F\\]{--tw-bg-opacity: 1;background-color:rgb(28 22 15 / var(--tw-bg-opacity))}.bg-\\[\\#1C1C1C\\]{--tw-bg-opacity: 1;background-color:rgb(28 28 28 / var(--tw-bg-opacity))}.bg-\\[\\#282A29\\]{--tw-bg-opacity: 1;background-color:rgb(40 42 41 / var(--tw-bg-opacity))}.bg-\\[\\#B0746A\\]{--tw-bg-opacity: 1;background-color:rgb(176 116 106 / var(--tw-bg-opacity))}.bg-\\[\\#CCCCCC\\]{--tw-bg-opacity: 1;background-color:rgb(204 204 204 / var(--tw-bg-opacity))}.bg-\\[\\#D3D3D3\\]{--tw-bg-opacity: 1;background-color:rgb(211 211 211 / var(--tw-bg-opacity))}.bg-\\[\\#D9D9D9\\]{--tw-bg-opacity: 1;background-color:rgb(217 217 217 / var(--tw-bg-opacity))}.bg-\\[\\#DEDAD9\\]{--tw-bg-opacity: 1;background-color:rgb(222 218 217 / var(--tw-bg-opacity))}.bg-\\[\\#DEDEDE\\]{--tw-bg-opacity: 1;background-color:rgb(222 222 222 / var(--tw-bg-opacity))}.bg-\\[\\#EBEBEB\\]{--tw-bg-opacity: 1;background-color:rgb(235 235 235 / var(--tw-bg-opacity))}.bg-\\[\\#F6F4F4\\]{--tw-bg-opacity: 1;background-color:rgb(246 244 244 / var(--tw-bg-opacity))}.bg-\\[\\#F8F8F6\\]{--tw-bg-opacity: 1;background-color:rgb(248 248 246 / var(--tw-bg-opacity))}.bg-a-black-50{--tw-bg-opacity: 1;background-color:rgb(128 128 128 / var(--tw-bg-opacity))}.bg-a-footer{--tw-bg-opacity: 1;background-color:rgb(34 34 34 / var(--tw-bg-opacity))}.bg-a-gray{--tw-bg-opacity: 1;background-color:rgb(57 59 65 / var(--tw-bg-opacity))}.bg-a-light-gray{--tw-bg-opacity: 1;background-color:rgb(235 235 235 / var(--tw-bg-opacity))}.bg-accent-campervans{--tw-bg-opacity: 1;background-color:rgb(112 116 95 / var(--tw-bg-opacity))}.bg-accent-caravans{--tw-bg-opacity: 1;background-color:rgb(103 112 134 / var(--tw-bg-opacity))}.bg-accent-designed-to-perform{--tw-bg-opacity: 1;background-color:rgb(57 58 65 / var(--tw-bg-opacity))}.bg-accent-minivans{--tw-bg-opacity: 1;background-color:rgb(147 97 89 / var(--tw-bg-opacity))}.bg-accent-motorhomes{--tw-bg-opacity: 1;background-color:rgb(90 91 97 / var(--tw-bg-opacity))}.bg-aviva-lite-green{--tw-bg-opacity: 1;background-color:rgb(74 109 81 / var(--tw-bg-opacity))}.bg-aviva-lite-red{--tw-bg-opacity: 1;background-color:rgb(157 82 60 / var(--tw-bg-opacity))}.bg-aviva-lite-yellow{--tw-bg-opacity: 1;background-color:rgb(217 172 54 / var(--tw-bg-opacity))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-black\\/20{background-color:#0003}.bg-black\\/30{background-color:#0000004d}.bg-black\\/60{background-color:#0009}.bg-black\\/75{background-color:#000000bf}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}.bg-gray-500\\/20{background-color:#6b728033}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity))}.bg-neutral-100{--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity))}.bg-neutral-200{--tw-bg-opacity: 1;background-color:rgb(229 229 229 / var(--tw-bg-opacity))}.bg-neutral-50{--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity))}.bg-neutral-600{--tw-bg-opacity: 1;background-color:rgb(82 82 82 / var(--tw-bg-opacity))}.bg-neutral-700{--tw-bg-opacity: 1;background-color:rgb(64 64 64 / var(--tw-bg-opacity))}.bg-neutral-900{--tw-bg-opacity: 1;background-color:rgb(23 23 23 / var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.bg-s-blue{--tw-bg-opacity: 1;background-color:rgb(0 158 227 / var(--tw-bg-opacity))}.bg-supersonic-awards-red{--tw-bg-opacity: 1;background-color:rgb(137 43 44 / var(--tw-bg-opacity))}.bg-supersonic-gray-bg{--tw-bg-opacity: 1;background-color:rgb(72 73 77 / var(--tw-bg-opacity))}.bg-supersonic-gray-bg-2{--tw-bg-opacity: 1;background-color:rgb(218 218 218 / var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity))}.bg-yellow-900{--tw-bg-opacity: 1;background-color:rgb(113 63 18 / var(--tw-bg-opacity))}.bg-opacity-20{--tw-bg-opacity: .2}.bg-opacity-40{--tw-bg-opacity: .4}.bg-opacity-50{--tw-bg-opacity: .5}.bg-opacity-75{--tw-bg-opacity: .75}.bg-opacity-80{--tw-bg-opacity: .8}.\\!bg-none{background-image:none!important}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-l{background-image:linear-gradient(to left,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-black{--tw-gradient-from: #000 var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-black\\/75{--tw-gradient-from: rgb(0 0 0 / .75) var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-white{--tw-gradient-from: #fff var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.to-45\\%{--tw-gradient-to-position: 45%}.to-50\\%{--tw-gradient-to-position: 50%}.to-75\\%{--tw-gradient-to-position: 75%}.bg-contain{background-size:contain}.bg-center{background-position:center}.bg-no-repeat{background-repeat:no-repeat}.\\!fill-black{fill:#000!important}.fill-\\[\\#0a66c2\\]{fill:#0a66c2}.fill-\\[\\#4267B2\\]{fill:#4267b2}.fill-a-black-30{fill:#b4b4b3}.fill-a-black-50{fill:gray}.fill-a-social-icons{fill:#979797}.fill-black{fill:#000}.fill-current{fill:currentColor}.fill-s-blue{fill:#009ee3}.fill-white{fill:#fff}.stroke-current{stroke:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.object-center{-o-object-position:center;object-position:center}.object-left{-o-object-position:left;object-position:left}.\\!p-0{padding:0!important}.p-0{padding:0}.p-1{padding:.25rem}.p-10{padding:2.5rem}.p-12{padding:3rem}.p-16{padding:4rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.\\!px-1{padding-left:.25rem!important;padding-right:.25rem!important}.\\!px-4{padding-left:1rem!important;padding-right:1rem!important}.\\!py-0{padding-top:0!important;padding-bottom:0!important}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-12{padding-left:3rem;padding-right:3rem}.px-16{padding-left:4rem;padding-right:4rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-14{padding-top:3.5rem;padding-bottom:3.5rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\\.5{padding-top:.625rem;padding-bottom:.625rem}.py-20{padding-top:5rem;padding-bottom:5rem}.py-24{padding-top:6rem;padding-bottom:6rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\\.5{padding-top:.875rem;padding-bottom:.875rem}.py-32{padding-top:8rem;padding-bottom:8rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-40{padding-top:10rem;padding-bottom:10rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.\\!pr-0{padding-right:0!important}.pb-0{padding-bottom:0}.pb-1{padding-bottom:.25rem}.pb-10{padding-bottom:2.5rem}.pb-12{padding-bottom:3rem}.pb-16{padding-bottom:4rem}.pb-2{padding-bottom:.5rem}.pb-20{padding-bottom:5rem}.pb-3{padding-bottom:.75rem}.pb-32{padding-bottom:8rem}.pb-4{padding-bottom:1rem}.pb-48{padding-bottom:12rem}.pb-5{padding-bottom:1.25rem}.pb-6{padding-bottom:1.5rem}.pb-8{padding-bottom:2rem}.pl-0{padding-left:0}.pl-1{padding-left:.25rem}.pl-10{padding-left:2.5rem}.pl-12{padding-left:3rem}.pl-16{padding-left:4rem}.pl-2{padding-left:.5rem}.pl-3{padding-left:.75rem}.pl-4{padding-left:1rem}.pl-6{padding-left:1.5rem}.pl-8{padding-left:2rem}.pl-\\[10\\%\\]{padding-left:10%}.pr-0{padding-right:0}.pr-10{padding-right:2.5rem}.pr-12{padding-right:3rem}.pr-16{padding-right:4rem}.pr-2{padding-right:.5rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pr-6{padding-right:1.5rem}.pr-8{padding-right:2rem}.pr-\\[5\\%\\]{padding-right:5%}.pr-\\[8\\%\\]{padding-right:8%}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-10{padding-top:2.5rem}.pt-12{padding-top:3rem}.pt-16{padding-top:4rem}.pt-2{padding-top:.5rem}.pt-20{padding-top:5rem}.pt-24{padding-top:6rem}.pt-32{padding-top:8rem}.pt-4{padding-top:1rem}.pt-5{padding-top:1.25rem}.pt-6{padding-top:1.5rem}.pt-8{padding-top:2rem}.\\!text-left{text-align:left!important}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.text-justify{text-align:justify}.text-start{text-align:start}.align-top{vertical-align:top}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-12{font-size:12px}.text-13{font-size:13px}.text-14{font-size:14px}.text-15{font-size:15px}.text-16{font-size:16px}.text-17{font-size:17px}.text-18{font-size:18px}.text-20{font-size:20px}.text-22{font-size:22px}.text-23{font-size:23px}.text-24{font-size:24px}.text-25{font-size:25px}.text-26{font-size:26px}.text-27{font-size:27px}.text-28{font-size:28px}.text-2xl{font-size:1.5rem;line-height:2rem}.text-2xs{font-size:.6rem}.text-30{font-size:30px}.text-32{font-size:32px}.text-34{font-size:34px}.text-35{font-size:35px}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-40{font-size:40px}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-53{font-size:53px}.text-5xl{font-size:3rem;line-height:1}.text-63{font-size:63px}.text-6xl{font-size:3.75rem;line-height:1}.text-\\[0\\.6rem\\]{font-size:.6rem}.text-\\[100px\\]{font-size:100px}.text-\\[10vw\\]{font-size:10vw}.text-\\[44px\\]{font-size:44px}.text-\\[70px\\]{font-size:70px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.\\!font-semibold{font-weight:600!important}.font-black{font-weight:900}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-extralight{font-weight:200}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.font-thin{font-weight:100}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.italic{font-style:italic}.lining-nums{--tw-numeric-figure: lining-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-10{line-height:2.5rem}.leading-4{line-height:1rem}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-7{line-height:1.75rem}.leading-8{line-height:2rem}.leading-9{line-height:2.25rem}.leading-\\[2\\.5rem\\]{line-height:2.5rem}.leading-\\[2rem\\]{line-height:2rem}.leading-\\[3\\.5rem\\]{line-height:3.5rem}.leading-none{line-height:1}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-tighter{letter-spacing:-.05em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.\\!text-a-black-60{--tw-text-opacity: 1 !important;color:rgb(103 103 103 / var(--tw-text-opacity))!important}.\\!text-a-light-gray{--tw-text-opacity: 1 !important;color:rgb(235 235 235 / var(--tw-text-opacity))!important}.\\!text-black{--tw-text-opacity: 1 !important;color:rgb(0 0 0 / var(--tw-text-opacity))!important}.\\!text-gray-700{--tw-text-opacity: 1 !important;color:rgb(55 65 81 / var(--tw-text-opacity))!important}.\\!text-white{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}.text-\\[\\#262626\\]{--tw-text-opacity: 1;color:rgb(38 38 38 / var(--tw-text-opacity))}.text-\\[\\#458F60\\]{--tw-text-opacity: 1;color:rgb(69 143 96 / var(--tw-text-opacity))}.text-\\[\\#78AB6D\\]{--tw-text-opacity: 1;color:rgb(120 171 109 / var(--tw-text-opacity))}.text-\\[\\#78ab6e\\]{--tw-text-opacity: 1;color:rgb(120 171 110 / var(--tw-text-opacity))}.text-\\[\\#a7a565\\]{--tw-text-opacity: 1;color:rgb(167 165 101 / var(--tw-text-opacity))}.text-a-black-30{--tw-text-opacity: 1;color:rgb(180 180 179 / var(--tw-text-opacity))}.text-a-black-40{--tw-text-opacity: 1;color:rgb(153 153 153 / var(--tw-text-opacity))}.text-a-black-50{--tw-text-opacity: 1;color:rgb(128 128 128 / var(--tw-text-opacity))}.text-a-black-60{--tw-text-opacity: 1;color:rgb(103 103 103 / var(--tw-text-opacity))}.text-a-footer{--tw-text-opacity: 1;color:rgb(34 34 34 / var(--tw-text-opacity))}.text-a-light-gray{--tw-text-opacity: 1;color:rgb(235 235 235 / var(--tw-text-opacity))}.text-accent-campervans-content,.text-accent-caravans-content,.text-accent-designed-to-perform-content,.text-accent-minivans-content,.text-accent-motorhomes-content{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-astella-gold{--tw-text-opacity: 1;color:rgb(203 170 131 / var(--tw-text-opacity))}.text-aviva-lite-green{--tw-text-opacity: 1;color:rgb(74 109 81 / var(--tw-text-opacity))}.text-aviva-lite-red{--tw-text-opacity: 1;color:rgb(157 82 60 / var(--tw-text-opacity))}.text-aviva-lite-yellow{--tw-text-opacity: 1;color:rgb(217 172 54 / var(--tw-text-opacity))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity))}.text-neutral-500{--tw-text-opacity: 1;color:rgb(115 115 115 / var(--tw-text-opacity))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity))}.text-s-blue{--tw-text-opacity: 1;color:rgb(0 158 227 / var(--tw-text-opacity))}.text-supersonic-gray-on-white{--tw-text-opacity: 1;color:rgb(28 28 27 / var(--tw-text-opacity))}.text-supersonic-gray-text{--tw-text-opacity: 1;color:rgb(135 135 135 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline{text-decoration-line:underline}.decoration-2{text-decoration-thickness:2px}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.\\!opacity-30{opacity:.3!important}.opacity-0{opacity:0}.opacity-10{opacity:.1}.opacity-100{opacity:1}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-black{--tw-shadow-color: #000;--tw-shadow: var(--tw-shadow-colored)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-inset{--tw-ring-inset: inset}.ring-black{--tw-ring-opacity: 1;--tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity))}.ring-gray-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity))}.ring-gray-900\\/5{--tw-ring-color: rgb(17 24 39 / .05)}.ring-supersonic-gray-text{--tw-ring-opacity: 1;--tw-ring-color: rgb(135 135 135 / var(--tw-ring-opacity))}.ring-opacity-5{--tw-ring-opacity: .05}.drop-shadow-\\[0_5px_5px_rgba\\(0\\,0\\,0\\,1\\)\\]{--tw-drop-shadow: drop-shadow(0 5px 5px rgba(0,0,0,1));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow-lg{--tw-drop-shadow: drop-shadow(0 10px 8px rgb(0 0 0 / .04)) drop-shadow(0 4px 3px rgb(0 0 0 / .1));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow-md{--tw-drop-shadow: drop-shadow(0 4px 3px rgb(0 0 0 / .07)) drop-shadow(0 2px 2px rgb(0 0 0 / .06));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow-text{--tw-drop-shadow: drop-shadow(2px 2px 1px rgba(0, 0, 0, .5));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow-text-strong{--tw-drop-shadow: drop-shadow(2px 2px 1px rgba(0, 0, 0, .9));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-1000{transition-duration:1s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}[x-cloak]{display:none}@media (min-width: 1536px){.designed_to_perform__content-offset{max-width:calc(1536px + (100vw - 1536px)/2);margin-left:calc((100vw - 1536px)/2)}}@media (min-width: 1024px){.content_image_gallery__content-offset{max-width:calc(1024px + (100vw - 1024px)/2);margin-left:calc((100vw - 1024px)/2)}}.mapboxgl-popup-content .grid{display:block}.mapboxgl-popup-content .grid>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.mapboxgl-popup-close-button{padding:.5rem;font-size:1.125rem;line-height:1.75rem}.mapboxgl-popup-close-button:focus{outline:2px solid transparent;outline-offset:2px}.prevent-propagation>*{pointer-events:none}:root{--primary: 0 0 0;--layout-box-bg: transparent;--layout-box-border-color: #e5e7eb;--layout-box-border-width: 2px;--layout-box-radius: .375rem}.placeholder\\:font-normal::-moz-placeholder{font-weight:400}.placeholder\\:font-normal::placeholder{font-weight:400}.placeholder\\:normal-case::-moz-placeholder{text-transform:none}.placeholder\\:normal-case::placeholder{text-transform:none}.placeholder\\:italic::-moz-placeholder{font-style:italic}.placeholder\\:italic::placeholder{font-style:italic}.placeholder\\:text-gray-400::-moz-placeholder{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.placeholder\\:text-gray-400::placeholder{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.first\\:ml-\\[5\\%\\]:first-child{margin-left:5%}.first\\:pt-0:first-child{padding-top:0}.last\\:\\!mr-\\[4\\%\\]:last-child{margin-right:4%!important}.last\\:mb-6:last-child{margin-bottom:1.5rem}.last\\:mr-8:last-child{margin-right:2rem}.last\\:border-0:last-child{border-width:0px}.first-of-type\\:rounded-t-md:first-of-type{border-top-left-radius:.375rem;border-top-right-radius:.375rem}.last-of-type\\:rounded-b-md:last-of-type{border-bottom-right-radius:.375rem;border-bottom-left-radius:.375rem}.focus-within\\:ring-2:focus-within{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-within\\:ring-indigo-500:focus-within{--tw-ring-opacity: 1;--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity))}.focus-within\\:ring-offset-2:focus-within{--tw-ring-offset-width: 2px}.focus-within\\:ring-offset-gray-100:focus-within{--tw-ring-offset-color: #f3f4f6}.hover\\:border-gray-400:hover{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity))}.hover\\:border-gray-700:hover{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity))}.hover\\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.hover\\:bg-gray-900:hover{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.hover\\:bg-neutral-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 229 229 / var(--tw-bg-opacity))}.hover\\:bg-neutral-700:hover{--tw-bg-opacity: 1;background-color:rgb(64 64 64 / var(--tw-bg-opacity))}.hover\\:bg-transparent:hover{background-color:transparent}.hover\\:bg-white\\/10:hover{background-color:#ffffff1a}.hover\\:bg-opacity-100:hover{--tw-bg-opacity: 1}.hover\\:bg-opacity-20:hover{--tw-bg-opacity: .2}.hover\\:bg-opacity-80:hover{--tw-bg-opacity: .8}.hover\\:fill-black:hover{fill:#000}.hover\\:font-bold:hover{font-weight:700}.hover\\:text-gray-500:hover{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.hover\\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\\:border-gray-700:focus{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-inset:focus{--tw-ring-inset: inset}.focus\\:ring-black:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity))}.focus\\:ring-gray-700:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(55 65 81 / var(--tw-ring-opacity))}.focus\\:ring-indigo-600:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(79 70 229 / var(--tw-ring-opacity))}.disabled\\:text-gray-500:disabled{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.disabled\\:opacity-20:disabled{opacity:.2}.group:first-child .group-first\\:bg-a-gray{--tw-bg-opacity: 1;background-color:rgb(57 59 65 / var(--tw-bg-opacity))}.group:first-child .group-first\\:text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.group\\/cta-item:last-child .group-last\\/cta-item\\:border-0{border-width:0px}.group:hover .group-hover\\:flex{display:flex}.group:hover .group-hover\\:hidden{display:none}.group:hover .group-hover\\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\\:scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\\:scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\\:scale-110{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group\\/cta-item:hover .group-hover\\/cta-item\\:bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.group\\/cta-item:hover .group-hover\\/cta-item\\:text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.group:hover .group-hover\\:underline{text-decoration-line:underline}.group:hover .group-hover\\:opacity-75{opacity:.75}.group.swiper-slide-active .group-\\[\\.swiper-slide-active\\]\\:translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group.swiper-button-disabled .group-\\[\\.swiper-button-disabled\\]\\:text-\\[\\#d6d6d6\\]{--tw-text-opacity: 1;color:rgb(214 214 214 / var(--tw-text-opacity))}.group.swiper-slide-active .group-\\[\\.swiper-slide-active\\]\\:opacity-100{opacity:1}.prose-p\\:mb-0 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){margin-bottom:0}.prose-p\\:mt-0 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:0}.prose-p\\:italic :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){font-style:italic}.prose-strong\\:font-bold :is(:where(strong):not(:where([class~=not-prose],[class~=not-prose] *))){font-weight:700}@media (prefers-color-scheme: dark){.dark\\:bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.dark\\:text-gray-100{--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity))}}@media (min-width: 640px){.sm\\:\\!left-14{left:3.5rem!important}.sm\\:\\!right-14{right:3.5rem!important}.sm\\:bottom-20{bottom:5rem}.sm\\:left-0{left:0}.sm\\:left-8{left:2rem}.sm\\:right-0{right:0}.sm\\:right-20{right:5rem}.sm\\:top-16{top:4rem}.sm\\:mx-auto{margin-left:auto;margin-right:auto}.sm\\:my-8{margin-top:2rem;margin-bottom:2rem}.sm\\:-mt-40{margin-top:-10rem}.sm\\:mb-0{margin-bottom:0}.sm\\:mb-16{margin-bottom:4rem}.sm\\:mb-8{margin-bottom:2rem}.sm\\:mr-0{margin-right:0}.sm\\:mr-2{margin-right:.5rem}.sm\\:mt-0{margin-top:0}.sm\\:block{display:block}.sm\\:inline-block{display:inline-block}.sm\\:flex{display:flex}.sm\\:hidden{display:none}.sm\\:h-32{height:8rem}.sm\\:h-4{height:1rem}.sm\\:h-8{height:2rem}.sm\\:max-h-\\[500px\\]{max-height:500px}.sm\\:max-h-full{max-height:100%}.sm\\:w-1\\/2{width:50%}.sm\\:w-32{width:8rem}.sm\\:w-48{width:12rem}.sm\\:w-64{width:16rem}.sm\\:w-96{width:24rem}.sm\\:w-\\[49\\.8\\%\\]{width:49.8%}.sm\\:w-auto{width:auto}.sm\\:w-full{width:100%}.sm\\:max-w-lg{max-width:32rem}.sm\\:max-w-none{max-width:none}.sm\\:max-w-sm{max-width:24rem}.sm\\:max-w-xs{max-width:20rem}.sm\\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.sm\\:translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.sm\\:scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.sm\\:scale-95{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\\:flex-row{flex-direction:row}.sm\\:flex-col{flex-direction:column}.sm\\:flex-wrap{flex-wrap:wrap}.sm\\:flex-nowrap{flex-wrap:nowrap}.sm\\:items-start{align-items:flex-start}.sm\\:items-end{align-items:flex-end}.sm\\:items-center{align-items:center}.sm\\:justify-end{justify-content:flex-end}.sm\\:justify-center{justify-content:center}.sm\\:justify-between{justify-content:space-between}.sm\\:gap-2{gap:.5rem}.sm\\:gap-4{gap:1rem}.sm\\:gap-8{gap:2rem}.sm\\:gap-x-0{-moz-column-gap:0px;column-gap:0px}.sm\\:gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.sm\\:\\!space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0 !important;margin-right:calc(2rem * var(--tw-space-x-reverse))!important;margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)))!important}.sm\\:\\!space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(0px * var(--tw-space-y-reverse))!important}.sm\\:space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.sm\\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.sm\\:space-y-16>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(4rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(4rem * var(--tw-space-y-reverse))}.sm\\:overflow-hidden{overflow:hidden}.sm\\:rounded-bl-md{border-bottom-left-radius:.375rem}.sm\\:rounded-tl-none{border-top-left-radius:0}.sm\\:border-b{border-bottom-width:1px}.sm\\:border-gray-500{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity))}.sm\\:bg-gray-700\\/60{background-color:#37415199}.sm\\:p-0{padding:0}.sm\\:p-16{padding:4rem}.sm\\:p-6{padding:1.5rem}.sm\\:px-0{padding-left:0;padding-right:0}.sm\\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\\:px-8{padding-left:2rem;padding-right:2rem}.sm\\:py-0{padding-top:0;padding-bottom:0}.sm\\:py-4{padding-top:1rem;padding-bottom:1rem}.sm\\:pb-2{padding-bottom:.5rem}.sm\\:pb-6{padding-bottom:1.5rem}.sm\\:pl-0{padding-left:0}.sm\\:pl-4{padding-left:1rem}.sm\\:pl-6{padding-left:1.5rem}.sm\\:pr-0{padding-right:0}.sm\\:pr-4{padding-right:1rem}.sm\\:pt-2{padding-top:.5rem}.sm\\:pt-24{padding-top:6rem}.sm\\:pt-6{padding-top:1.5rem}.sm\\:text-left{text-align:left}.sm\\:text-16{font-size:16px}.sm\\:text-17{font-size:17px}.sm\\:text-18{font-size:18px}.sm\\:text-24{font-size:24px}.sm\\:text-26{font-size:26px}.sm\\:text-28{font-size:28px}.sm\\:text-35{font-size:35px}.sm\\:text-53{font-size:53px}.sm\\:text-7xl{font-size:4.5rem;line-height:1}.sm\\:text-sm{font-size:.875rem;line-height:1.25rem}.sm\\:font-semibold{font-weight:600}.sm\\:leading-6{line-height:1.5rem}.sm\\:text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.sm\\:duration-700{transition-duration:.7s}.sm\\:last\\:mr-0:last-child{margin-right:0}.group\\/cta-item:last-child .sm\\:group-last\\/cta-item\\:border-0{border-width:0px}.group\\/cta-block:hover .sm\\:group-hover\\/cta-block\\:-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}}@media (min-width: 768px){.md\\:\\!left-2{left:.5rem!important}.md\\:\\!right-2{right:.5rem!important}.md\\:bottom-8{bottom:2rem}.md\\:left-8{left:2rem}.md\\:order-1{order:1}.md\\:order-2{order:2}.md\\:order-first{order:-9999}.md\\:order-last{order:9999}.md\\:col-span-2{grid-column:span 2 / span 2}.md\\:col-span-3{grid-column:span 3 / span 3}.md\\:col-span-4{grid-column:span 4 / span 4}.md\\:col-span-5{grid-column:span 5 / span 5}.md\\:col-span-6{grid-column:span 6 / span 6}.md\\:row-span-2{grid-row:span 2 / span 2}.md\\:mx-8{margin-left:2rem;margin-right:2rem}.md\\:my-12{margin-top:3rem;margin-bottom:3rem}.md\\:my-16{margin-top:4rem;margin-bottom:4rem}.md\\:-mb-80{margin-bottom:-20rem}.md\\:mb-0{margin-bottom:0}.md\\:mb-12{margin-bottom:3rem}.md\\:mb-16{margin-bottom:4rem}.md\\:mb-20{margin-bottom:5rem}.md\\:mb-32{margin-bottom:8rem}.md\\:mb-6{margin-bottom:1.5rem}.md\\:ml-8{margin-left:2rem}.md\\:mt-0{margin-top:0}.md\\:mt-20{margin-top:5rem}.md\\:mt-48{margin-top:12rem}.md\\:block{display:block}.md\\:flex{display:flex}.md\\:grid{display:grid}.md\\:hidden{display:none}.md\\:aspect-\\[1\\/2\\]{aspect-ratio:1/2}.md\\:aspect-\\[16\\/12\\]{aspect-ratio:16/12}.md\\:aspect-\\[16\\/6\\]{aspect-ratio:16/6}.md\\:aspect-\\[16\\/9\\]{aspect-ratio:16/9}.md\\:aspect-auto{aspect-ratio:auto}.md\\:h-48{height:12rem}.md\\:h-64{height:16rem}.md\\:h-96{height:24rem}.md\\:h-\\[300px\\]{height:300px}.md\\:h-auto{height:auto}.md\\:\\!w-\\[calc\\(45\\%\\)\\]{width:45%!important}.md\\:\\!w-\\[calc\\(50\\%-4rem\\)\\]{width:calc(50% - 4rem)!important}.md\\:\\!w-\\[calc\\(80\\%\\)\\]{width:80%!important}.md\\:w-2\\/5{width:40%}.md\\:w-5\\/12{width:41.666667%}.md\\:w-\\[22\\%\\]{width:22%}.md\\:w-\\[38\\%\\]{width:38%}.md\\:w-\\[40\\%\\]{width:40%}.md\\:w-\\[40rem\\]{width:40rem}.md\\:w-\\[50\\%\\]{width:50%}.md\\:w-\\[60\\%\\]{width:60%}.md\\:w-\\[90\\%\\]{width:90%}.md\\:w-auto{width:auto}.md\\:max-w-3xl{max-width:48rem}.md\\:max-w-\\[50\\%\\]{max-width:50%}.md\\:max-w-\\[60\\%\\]{max-width:60%}.md\\:max-w-lg{max-width:32rem}.md\\:flex-auto{flex:1 1 auto}.md\\:flex-none{flex:none}.md\\:-translate-y-56{--tw-translate-y: -14rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:-translate-y-\\[22rem\\]{--tw-translate-y: -22rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:translate-y-20{--tw-translate-y: 5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.md\\:flex-row{flex-direction:row}.md\\:justify-start{justify-content:flex-start}.md\\:justify-end{justify-content:flex-end}.md\\:justify-center{justify-content:center}.md\\:justify-between{justify-content:space-between}.md\\:gap-0{gap:0px}.md\\:gap-16{gap:4rem}.md\\:gap-20{gap:5rem}.md\\:gap-4{gap:1rem}.md\\:gap-8{gap:2rem}.md\\:gap-x-20{-moz-column-gap:5rem;column-gap:5rem}.md\\:gap-y-10{row-gap:2.5rem}.md\\:space-x-16>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(4rem * var(--tw-space-x-reverse));margin-left:calc(4rem * calc(1 - var(--tw-space-x-reverse)))}.md\\:space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.md\\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.md\\:overflow-hidden{overflow:hidden}.md\\:rounded-xl{border-radius:.75rem}.md\\:border-none{border-style:none}.md\\:p-0{padding:0}.md\\:p-16{padding:4rem}.md\\:p-20{padding:5rem}.md\\:p-4{padding:1rem}.md\\:p-8{padding:2rem}.md\\:px-16{padding-left:4rem;padding-right:4rem}.md\\:px-20{padding-left:5rem;padding-right:5rem}.md\\:px-6{padding-left:1.5rem;padding-right:1.5rem}.md\\:px-8{padding-left:2rem;padding-right:2rem}.md\\:py-0{padding-top:0;padding-bottom:0}.md\\:py-12{padding-top:3rem;padding-bottom:3rem}.md\\:py-20{padding-top:5rem;padding-bottom:5rem}.md\\:py-3{padding-top:.75rem;padding-bottom:.75rem}.md\\:pb-0{padding-bottom:0}.md\\:pb-16{padding-bottom:4rem}.md\\:pb-20{padding-bottom:5rem}.md\\:pb-32{padding-bottom:8rem}.md\\:pl-0{padding-left:0}.md\\:pl-8{padding-left:2rem}.md\\:pr-0{padding-right:0}.md\\:pr-20{padding-right:5rem}.md\\:pt-16{padding-top:4rem}.md\\:pt-20{padding-top:5rem}.md\\:text-left{text-align:left}.md\\:text-right{text-align:right}.md\\:text-start{text-align:start}.md\\:text-14{font-size:14px}.md\\:text-15{font-size:15px}.md\\:text-17{font-size:17px}.md\\:text-18{font-size:18px}.md\\:text-22{font-size:22px}.md\\:text-24{font-size:24px}.md\\:text-26{font-size:26px}.md\\:text-28{font-size:28px}.md\\:text-32{font-size:32px}.md\\:text-35{font-size:35px}.md\\:text-4xl{font-size:2.25rem;line-height:2.5rem}.md\\:text-53{font-size:53px}.md\\:text-\\[106px\\]{font-size:106px}.md\\:text-\\[70px\\]{font-size:70px}.md\\:text-base{font-size:1rem;line-height:1.5rem}.md\\:text-xl{font-size:1.25rem;line-height:1.75rem}.md\\:leading-10{line-height:2.5rem}.md\\:first\\:col-span-2:first-child{grid-column:span 2 / span 2}.md\\:first\\:col-start-2:first-child{grid-column-start:2}.md\\:first\\:col-start-3:first-child{grid-column-start:3}.md\\:first\\:ml-0:first-child{margin-left:0}.md\\:hover\\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}}@media (min-width: 1024px){.lg\\:static{position:static}.lg\\:absolute{position:absolute}.lg\\:relative{position:relative}.lg\\:inset-0{top:0;right:0;bottom:0;left:0}.lg\\:\\!-left-\\[50px\\]{left:-50px!important}.lg\\:\\!-right-\\[50px\\]{right:-50px!important}.lg\\:\\!bottom-0{bottom:0!important}.lg\\:\\!left-5{left:1.25rem!important}.lg\\:\\!right-5{right:1.25rem!important}.lg\\:bottom-4{bottom:1rem}.lg\\:left-0{left:0}.lg\\:left-16{left:4rem}.lg\\:left-\\[50\\%\\]{left:50%}.lg\\:left-\\[66\\%\\]{left:66%}.lg\\:right-0{right:0}.lg\\:top-1\\/2{top:50%}.lg\\:top-16{top:4rem}.lg\\:top-24{top:6rem}.lg\\:top-\\[10\\%\\]{top:10%}.lg\\:order-1{order:1}.lg\\:order-2{order:2}.lg\\:order-first{order:-9999}.lg\\:order-last{order:9999}.lg\\:order-none{order:0}.lg\\:col-span-1{grid-column:span 1 / span 1}.lg\\:col-span-2{grid-column:span 2 / span 2}.lg\\:col-span-3{grid-column:span 3 / span 3}.lg\\:col-span-4{grid-column:span 4 / span 4}.lg\\:col-span-5{grid-column:span 5 / span 5}.lg\\:col-span-6{grid-column:span 6 / span 6}.lg\\:col-span-7{grid-column:span 7 / span 7}.lg\\:col-span-8{grid-column:span 8 / span 8}.lg\\:row-span-1{grid-row:span 1 / span 1}.lg\\:row-span-2{grid-row:span 2 / span 2}.lg\\:row-span-3{grid-row:span 3 / span 3}.lg\\:mx-0{margin-left:0;margin-right:0}.lg\\:mx-8{margin-left:2rem;margin-right:2rem}.lg\\:mx-auto{margin-left:auto;margin-right:auto}.lg\\:my-0{margin-top:0;margin-bottom:0}.lg\\:my-12{margin-top:3rem;margin-bottom:3rem}.lg\\:my-16{margin-top:4rem;margin-bottom:4rem}.lg\\:my-20{margin-top:5rem;margin-bottom:5rem}.lg\\:my-28{margin-top:7rem;margin-bottom:7rem}.lg\\:my-32{margin-top:8rem;margin-bottom:8rem}.lg\\:-mt-12{margin-top:-3rem}.lg\\:-mt-16{margin-top:-4rem}.lg\\:-mt-20{margin-top:-5rem}.lg\\:-mt-24{margin-top:-6rem}.lg\\:-mt-32{margin-top:-8rem}.lg\\:-mt-36{margin-top:-9rem}.lg\\:-mt-40{margin-top:-10rem}.lg\\:-mt-48{margin-top:-12rem}.lg\\:-mt-52{margin-top:-13rem}.lg\\:-mt-60{margin-top:-15rem}.lg\\:mb-0{margin-bottom:0}.lg\\:mb-12{margin-bottom:3rem}.lg\\:mb-16{margin-bottom:4rem}.lg\\:mb-20{margin-bottom:5rem}.lg\\:mb-24{margin-bottom:6rem}.lg\\:mb-32{margin-bottom:8rem}.lg\\:mb-60{margin-bottom:15rem}.lg\\:mb-64{margin-bottom:16rem}.lg\\:mb-8{margin-bottom:2rem}.lg\\:ml-0{margin-left:0}.lg\\:ml-20{margin-left:5rem}.lg\\:ml-\\[2\\%\\]{margin-left:2%}.lg\\:ml-\\[5\\%\\]{margin-left:5%}.lg\\:ml-auto{margin-left:auto}.lg\\:mt-0{margin-top:0}.lg\\:mt-10{margin-top:2.5rem}.lg\\:mt-12{margin-top:3rem}.lg\\:mt-16{margin-top:4rem}.lg\\:mt-20{margin-top:5rem}.lg\\:mt-24{margin-top:6rem}.lg\\:mt-28{margin-top:7rem}.lg\\:mt-32{margin-top:8rem}.lg\\:mt-4{margin-top:1rem}.lg\\:mt-40{margin-top:10rem}.lg\\:mt-60{margin-top:15rem}.lg\\:mt-64{margin-top:16rem}.lg\\:mt-72{margin-top:18rem}.lg\\:mt-8{margin-top:2rem}.lg\\:block{display:block}.lg\\:flex{display:flex}.lg\\:\\!grid{display:grid!important}.lg\\:grid{display:grid}.lg\\:\\!hidden{display:none!important}.lg\\:hidden{display:none}.lg\\:aspect-\\[1\\/1\\]{aspect-ratio:1/1}.lg\\:aspect-\\[16\\/10\\]{aspect-ratio:16/10}.lg\\:aspect-\\[16\\/12\\]{aspect-ratio:16/12}.lg\\:aspect-\\[16\\/6\\]{aspect-ratio:16/6}.lg\\:aspect-\\[16\\/8\\]{aspect-ratio:16/8}.lg\\:aspect-\\[16\\/9\\]{aspect-ratio:16/9}.lg\\:aspect-\\[2\\/1\\]{aspect-ratio:2/1}.lg\\:aspect-\\[3\\/2\\]{aspect-ratio:3/2}.lg\\:aspect-\\[5\\/4\\]{aspect-ratio:5/4}.lg\\:aspect-\\[8\\/12\\]{aspect-ratio:8/12}.lg\\:aspect-auto{aspect-ratio:auto}.lg\\:aspect-square{aspect-ratio:1 / 1}.lg\\:h-10{height:2.5rem}.lg\\:h-12{height:3rem}.lg\\:h-24{height:6rem}.lg\\:h-32{height:8rem}.lg\\:h-8{height:2rem}.lg\\:h-96{height:24rem}.lg\\:h-\\[300px\\]{height:300px}.lg\\:h-\\[900px\\]{height:900px}.lg\\:h-auto{height:auto}.lg\\:h-full{height:100%}.lg\\:h-full-screen{height:calc(100vh - 4rem);height:calc(100lvh - 4rem)}.lg\\:h-screen{height:100vh}.lg\\:\\!w-1\\/2{width:50%!important}.lg\\:\\!w-5\\/12{width:41.666667%!important}.lg\\:\\!w-\\[35\\%\\]{width:35%!important}.lg\\:\\!w-\\[40\\%\\]{width:40%!important}.lg\\:\\!w-\\[55\\%\\]{width:55%!important}.lg\\:\\!w-\\[60\\%\\]{width:60%!important}.lg\\:\\!w-\\[80\\%\\]{width:80%!important}.lg\\:\\!w-full{width:100%!important}.lg\\:w-1\\/12{width:8.333333%}.lg\\:w-1\\/2{width:50%}.lg\\:w-1\\/3{width:33.333333%}.lg\\:w-1\\/4{width:25%}.lg\\:w-1\\/6{width:16.666667%}.lg\\:w-10{width:2.5rem}.lg\\:w-12{width:3rem}.lg\\:w-2\\/12{width:16.666667%}.lg\\:w-2\\/3{width:66.666667%}.lg\\:w-2\\/5{width:40%}.lg\\:w-3\\/12{width:25%}.lg\\:w-3\\/5{width:60%}.lg\\:w-32{width:8rem}.lg\\:w-4\\/12{width:33.333333%}.lg\\:w-4\\/5{width:80%}.lg\\:w-48{width:12rem}.lg\\:w-5\\/12{width:41.666667%}.lg\\:w-6\\/12{width:50%}.lg\\:w-60{width:15rem}.lg\\:w-64{width:16rem}.lg\\:w-7\\/12{width:58.333333%}.lg\\:w-8{width:2rem}.lg\\:w-9\\/12{width:75%}.lg\\:w-96{width:24rem}.lg\\:w-\\[10\\%\\]{width:10%}.lg\\:w-\\[15\\%\\]{width:15%}.lg\\:w-\\[17\\%\\]{width:17%}.lg\\:w-\\[20\\%\\]{width:20%}.lg\\:w-\\[22\\%\\]{width:22%}.lg\\:w-\\[24\\%\\]{width:24%}.lg\\:w-\\[25\\%\\]{width:25%}.lg\\:w-\\[26\\%\\]{width:26%}.lg\\:w-\\[28\\%\\]{width:28%}.lg\\:w-\\[30\\%\\]{width:30%}.lg\\:w-\\[30rem\\]{width:30rem}.lg\\:w-\\[32\\%\\]{width:32%}.lg\\:w-\\[33\\%\\]{width:33%}.lg\\:w-\\[34\\%\\]{width:34%}.lg\\:w-\\[35\\%\\]{width:35%}.lg\\:w-\\[36\\%\\]{width:36%}.lg\\:w-\\[364px\\]{width:364px}.lg\\:w-\\[40\\%\\]{width:40%}.lg\\:w-\\[400px\\]{width:400px}.lg\\:w-\\[43\\%\\]{width:43%}.lg\\:w-\\[45\\%\\]{width:45%}.lg\\:w-\\[46\\%\\]{width:46%}.lg\\:w-\\[460px\\]{width:460px}.lg\\:w-\\[50\\%\\]{width:50%}.lg\\:w-\\[500px\\]{width:500px}.lg\\:w-\\[55\\%\\]{width:55%}.lg\\:w-\\[560px\\]{width:560px}.lg\\:w-\\[57\\%\\]{width:57%}.lg\\:w-\\[60\\%\\]{width:60%}.lg\\:w-\\[600px\\]{width:600px}.lg\\:w-\\[65\\%\\]{width:65%}.lg\\:w-\\[70\\%\\]{width:70%}.lg\\:w-\\[800px\\]{width:800px}.lg\\:w-\\[90\\%\\]{width:90%}.lg\\:w-auto{width:auto}.lg\\:w-full{width:100%}.lg\\:max-w-2xl{max-width:42rem}.lg\\:max-w-3xl{max-width:48rem}.lg\\:max-w-\\[200px\\]{max-width:200px}.lg\\:max-w-\\[45\\%\\]{max-width:45%}.lg\\:max-w-\\[50\\%\\]{max-width:50%}.lg\\:max-w-\\[500px\\]{max-width:500px}.lg\\:max-w-\\[600px\\]{max-width:600px}.lg\\:max-w-lg{max-width:32rem}.lg\\:max-w-md{max-width:28rem}.lg\\:max-w-prose{max-width:65ch}.lg\\:max-w-screen-lg{max-width:1024px}.lg\\:max-w-screen-md{max-width:768px}.lg\\:max-w-screen-xl{max-width:1280px}.lg\\:max-w-sm{max-width:24rem}.lg\\:max-w-xl{max-width:36rem}.lg\\:flex-1{flex:1 1 0%}.lg\\:-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:-translate-y-16{--tw-translate-y: -4rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:-translate-y-24{--tw-translate-y: -6rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:-translate-y-32{--tw-translate-y: -8rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:-translate-y-\\[20\\%\\]{--tw-translate-y: -20%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:translate-y-16{--tw-translate-y: 4rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:translate-y-32{--tw-translate-y: 8rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:translate-y-\\[20\\%\\]{--tw-translate-y: 20%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:\\!grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))!important}.lg\\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.lg\\:grid-cols-18{grid-template-columns:repeat(18,minmax(0,1fr))}.lg\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.lg\\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.lg\\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.lg\\:flex-row{flex-direction:row}.lg\\:flex-col{flex-direction:column}.lg\\:flex-wrap{flex-wrap:wrap}.lg\\:items-start{align-items:flex-start}.lg\\:items-end{align-items:flex-end}.lg\\:items-center{align-items:center}.lg\\:justify-start{justify-content:flex-start}.lg\\:justify-end{justify-content:flex-end}.lg\\:justify-center{justify-content:center}.lg\\:justify-between{justify-content:space-between}.lg\\:\\!gap-4{gap:1rem!important}.lg\\:gap-0{gap:0px}.lg\\:gap-10{gap:2.5rem}.lg\\:gap-12{gap:3rem}.lg\\:gap-16{gap:4rem}.lg\\:gap-2{gap:.5rem}.lg\\:gap-20{gap:5rem}.lg\\:gap-4{gap:1rem}.lg\\:gap-8{gap:2rem}.lg\\:gap-\\[4\\%\\]{gap:4%}.lg\\:gap-\\[5\\%\\]{gap:5%}.lg\\:gap-x-20{-moz-column-gap:5rem;column-gap:5rem}.lg\\:gap-x-8{-moz-column-gap:2rem;column-gap:2rem}.lg\\:gap-y-0{row-gap:0px}.lg\\:gap-y-20{row-gap:5rem}.lg\\:gap-y-24{row-gap:6rem}.lg\\:gap-y-4{row-gap:1rem}.lg\\:\\!space-x-32>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0 !important;margin-right:calc(8rem * var(--tw-space-x-reverse))!important;margin-left:calc(8rem * calc(1 - var(--tw-space-x-reverse)))!important}.lg\\:space-x-32>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(8rem * var(--tw-space-x-reverse));margin-left:calc(8rem * calc(1 - var(--tw-space-x-reverse)))}.lg\\:space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2rem * var(--tw-space-x-reverse));margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)))}.lg\\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.lg\\:space-y-12>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(3rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(3rem * var(--tw-space-y-reverse))}.lg\\:space-y-16>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(4rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(4rem * var(--tw-space-y-reverse))}.lg\\:space-y-20>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(5rem * var(--tw-space-y-reverse))}.lg\\:space-y-24>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(6rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(6rem * var(--tw-space-y-reverse))}.lg\\:space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.lg\\:space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.lg\\:space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.lg\\:bg-inherit{background-color:inherit}.lg\\:to-50\\%{--tw-gradient-to-position: 50%}.lg\\:object-center{-o-object-position:center;object-position:center}.lg\\:p-0{padding:0}.lg\\:p-10{padding:2.5rem}.lg\\:p-12{padding:3rem}.lg\\:p-16{padding:4rem}.lg\\:p-20{padding:5rem}.lg\\:p-8{padding:2rem}.lg\\:px-0{padding-left:0;padding-right:0}.lg\\:px-12{padding-left:3rem;padding-right:3rem}.lg\\:px-16{padding-left:4rem;padding-right:4rem}.lg\\:px-20{padding-left:5rem;padding-right:5rem}.lg\\:px-24{padding-left:6rem;padding-right:6rem}.lg\\:px-3{padding-left:.75rem;padding-right:.75rem}.lg\\:px-32{padding-left:8rem;padding-right:8rem}.lg\\:px-4{padding-left:1rem;padding-right:1rem}.lg\\:px-8{padding-left:2rem;padding-right:2rem}.lg\\:px-\\[10\\%\\]{padding-left:10%;padding-right:10%}.lg\\:py-0{padding-top:0;padding-bottom:0}.lg\\:py-10{padding-top:2.5rem;padding-bottom:2.5rem}.lg\\:py-12{padding-top:3rem;padding-bottom:3rem}.lg\\:py-16{padding-top:4rem;padding-bottom:4rem}.lg\\:py-20{padding-top:5rem;padding-bottom:5rem}.lg\\:py-24{padding-top:6rem;padding-bottom:6rem}.lg\\:py-28{padding-top:7rem;padding-bottom:7rem}.lg\\:py-3{padding-top:.75rem;padding-bottom:.75rem}.lg\\:py-32{padding-top:8rem;padding-bottom:8rem}.lg\\:py-4{padding-top:1rem;padding-bottom:1rem}.lg\\:py-6{padding-top:1.5rem;padding-bottom:1.5rem}.lg\\:py-60{padding-top:15rem;padding-bottom:15rem}.lg\\:py-8{padding-top:2rem;padding-bottom:2rem}.lg\\:\\!pb-10{padding-bottom:2.5rem!important}.lg\\:pb-0{padding-bottom:0}.lg\\:pb-10{padding-bottom:2.5rem}.lg\\:pb-16{padding-bottom:4rem}.lg\\:pb-20{padding-bottom:5rem}.lg\\:pb-24{padding-bottom:6rem}.lg\\:pb-32{padding-bottom:8rem}.lg\\:pb-52{padding-bottom:13rem}.lg\\:pb-8{padding-bottom:2rem}.lg\\:pl-0{padding-left:0}.lg\\:pl-10{padding-left:2.5rem}.lg\\:pl-12{padding-left:3rem}.lg\\:pl-16{padding-left:4rem}.lg\\:pl-20{padding-left:5rem}.lg\\:pl-24{padding-left:6rem}.lg\\:pl-28{padding-left:7rem}.lg\\:pl-32{padding-left:8rem}.lg\\:pl-4{padding-left:1rem}.lg\\:pl-8{padding-left:2rem}.lg\\:pl-\\[5\\%\\]{padding-left:5%}.lg\\:pr-0{padding-right:0}.lg\\:pr-16{padding-right:4rem}.lg\\:pr-20{padding-right:5rem}.lg\\:pr-32{padding-right:8rem}.lg\\:pr-4{padding-right:1rem}.lg\\:pr-40{padding-right:10rem}.lg\\:pr-8{padding-right:2rem}.lg\\:pr-\\[10\\%\\]{padding-right:10%}.lg\\:pr-\\[4\\%\\]{padding-right:4%}.lg\\:pt-0{padding-top:0}.lg\\:pt-10{padding-top:2.5rem}.lg\\:pt-12{padding-top:3rem}.lg\\:pt-16{padding-top:4rem}.lg\\:pt-20{padding-top:5rem}.lg\\:pt-24{padding-top:6rem}.lg\\:pt-32{padding-top:8rem}.lg\\:pt-48{padding-top:12rem}.lg\\:pt-8{padding-top:2rem}.lg\\:text-left{text-align:left}.lg\\:text-center{text-align:center}.lg\\:text-right{text-align:right}.lg\\:text-end{text-align:end}.lg\\:text-13{font-size:13px}.lg\\:text-14{font-size:14px}.lg\\:text-15{font-size:15px}.lg\\:text-16{font-size:16px}.lg\\:text-17{font-size:17px}.lg\\:text-18{font-size:18px}.lg\\:text-20{font-size:20px}.lg\\:text-22{font-size:22px}.lg\\:text-24{font-size:24px}.lg\\:text-25{font-size:25px}.lg\\:text-26{font-size:26px}.lg\\:text-27{font-size:27px}.lg\\:text-28{font-size:28px}.lg\\:text-30{font-size:30px}.lg\\:text-32{font-size:32px}.lg\\:text-34{font-size:34px}.lg\\:text-35{font-size:35px}.lg\\:text-40{font-size:40px}.lg\\:text-4xl{font-size:2.25rem;line-height:2.5rem}.lg\\:text-53{font-size:53px}.lg\\:text-63{font-size:63px}.lg\\:text-\\[106px\\]{font-size:106px}.lg\\:text-\\[138px\\]{font-size:138px}.lg\\:text-lg{font-size:1.125rem;line-height:1.75rem}.lg\\:font-bold{font-weight:700}.lg\\:font-extrabold{font-weight:800}.lg\\:font-light{font-weight:300}.lg\\:font-normal{font-weight:400}.lg\\:leading-10{line-height:2.5rem}.lg\\:leading-3{line-height:.75rem}.lg\\:leading-9{line-height:2.25rem}.lg\\:leading-\\[2\\.5rem\\]{line-height:2.5rem}.lg\\:leading-\\[3\\.5rem\\]{line-height:3.5rem}.lg\\:text-a-black-60{--tw-text-opacity: 1;color:rgb(103 103 103 / var(--tw-text-opacity))}.lg\\:text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.lg\\:opacity-100{opacity:1}.lg\\:drop-shadow-none{--tw-drop-shadow: drop-shadow(0 0 #0000);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.lg\\:first\\:col-span-1:first-child{grid-column:span 1 / span 1}.lg\\:first\\:ml-\\[10\\%\\]:first-child{margin-left:10%}}@media (min-width: 1280px){.xl\\:\\!-bottom-10{bottom:-2.5rem!important}.xl\\:bottom-20{bottom:5rem}.xl\\:order-first{order:-9999}.xl\\:order-last{order:9999}.xl\\:col-span-1{grid-column:span 1 / span 1}.xl\\:col-span-2{grid-column:span 2 / span 2}.xl\\:col-span-3{grid-column:span 3 / span 3}.xl\\:col-span-4{grid-column:span 4 / span 4}.xl\\:col-span-5{grid-column:span 5 / span 5}.xl\\:col-span-7{grid-column:span 7 / span 7}.xl\\:col-span-8{grid-column:span 8 / span 8}.xl\\:row-span-2{grid-row:span 2 / span 2}.xl\\:my-32{margin-top:8rem;margin-bottom:8rem}.xl\\:-mb-12{margin-bottom:-3rem}.xl\\:-mt-32{margin-top:-8rem}.xl\\:-mt-40{margin-top:-10rem}.xl\\:-mt-52{margin-top:-13rem}.xl\\:-mt-64{margin-top:-16rem}.xl\\:-mt-80{margin-top:-20rem}.xl\\:-mt-96{margin-top:-24rem}.xl\\:mb-24{margin-bottom:6rem}.xl\\:ml-0{margin-left:0}.xl\\:ml-\\[15\\%\\]{margin-left:15%}.xl\\:mt-16{margin-top:4rem}.xl\\:mt-20{margin-top:5rem}.xl\\:mt-8{margin-top:2rem}.xl\\:block{display:block}.xl\\:flex{display:flex}.xl\\:\\!grid{display:grid!important}.xl\\:grid{display:grid}.xl\\:hidden{display:none}.xl\\:aspect-\\[16\\/11\\]{aspect-ratio:16/11}.xl\\:aspect-\\[16\\/6\\]{aspect-ratio:16/6}.xl\\:aspect-\\[16\\/8\\]{aspect-ratio:16/8}.xl\\:h-48{height:12rem}.xl\\:h-64{height:16rem}.xl\\:h-96{height:24rem}.xl\\:min-h-\\[800px\\]{min-height:800px}.xl\\:\\!w-1\\/4,.xl\\:\\!w-\\[25\\%\\]{width:25%!important}.xl\\:\\!w-full{width:100%!important}.xl\\:w-1\\/12{width:8.333333%}.xl\\:w-1\\/2{width:50%}.xl\\:w-1\\/3{width:33.333333%}.xl\\:w-2\\/12{width:16.666667%}.xl\\:w-3\\/12{width:25%}.xl\\:w-32{width:8rem}.xl\\:w-36{width:9rem}.xl\\:w-4\\/12{width:33.333333%}.xl\\:w-40{width:10rem}.xl\\:w-48{width:12rem}.xl\\:w-5\\/12{width:41.666667%}.xl\\:w-64{width:16rem}.xl\\:w-\\[25\\%\\]{width:25%}.xl\\:w-\\[28\\%\\]{width:28%}.xl\\:w-\\[420px\\]{width:420px}.xl\\:w-\\[45\\%\\]{width:45%}.xl\\:w-\\[55\\%\\]{width:55%}.xl\\:w-\\[60\\%\\]{width:60%}.xl\\:w-full{width:100%}.xl\\:max-w-2xl{max-width:42rem}.xl\\:max-w-4xl{max-width:56rem}.xl\\:max-w-5xl{max-width:64rem}.xl\\:max-w-lg{max-width:32rem}.xl\\:flex-1{flex:1 1 0%}.xl\\:-translate-y-1\\/4{--tw-translate-y: -25%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.xl\\:-translate-y-16{--tw-translate-y: -4rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.xl\\:-translate-y-2\\/3{--tw-translate-y: -66.666667%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.xl\\:-translate-y-32{--tw-translate-y: -8rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.xl\\:-translate-y-64{--tw-translate-y: -16rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.xl\\:-translate-y-\\[30rem\\]{--tw-translate-y: -30rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.xl\\:transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.xl\\:\\!grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))!important}.xl\\:\\!grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))!important}.xl\\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.xl\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\\:flex-row{flex-direction:row}.xl\\:flex-col{flex-direction:column}.xl\\:flex-nowrap{flex-wrap:nowrap}.xl\\:items-end{align-items:flex-end}.xl\\:justify-start{justify-content:flex-start}.xl\\:justify-end{justify-content:flex-end}.xl\\:justify-center{justify-content:center}.xl\\:justify-between{justify-content:space-between}.xl\\:\\!gap-4{gap:1rem!important}.xl\\:gap-0{gap:0px}.xl\\:gap-12{gap:3rem}.xl\\:gap-16{gap:4rem}.xl\\:gap-2{gap:.5rem}.xl\\:gap-20{gap:5rem}.xl\\:gap-4{gap:1rem}.xl\\:gap-8{gap:2rem}.xl\\:gap-\\[10\\%\\]{gap:10%}.xl\\:gap-x-1{-moz-column-gap:.25rem;column-gap:.25rem}.xl\\:gap-x-8{-moz-column-gap:2rem;column-gap:2rem}.xl\\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.xl\\:space-y-10>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2.5rem * var(--tw-space-y-reverse))}.xl\\:space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.xl\\:space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.xl\\:p-0{padding:0}.xl\\:p-12{padding:3rem}.xl\\:p-20{padding:5rem}.xl\\:px-0{padding-left:0;padding-right:0}.xl\\:px-20{padding-left:5rem;padding-right:5rem}.xl\\:px-4{padding-left:1rem;padding-right:1rem}.xl\\:py-2{padding-top:.5rem;padding-bottom:.5rem}.xl\\:py-28{padding-top:7rem;padding-bottom:7rem}.xl\\:py-8{padding-top:2rem;padding-bottom:2rem}.xl\\:\\!pl-\\[25\\%\\]{padding-left:25%!important}.xl\\:pb-16{padding-bottom:4rem}.xl\\:pl-16{padding-left:4rem}.xl\\:pl-20{padding-left:5rem}.xl\\:pr-\\[8\\%\\]{padding-right:8%}.xl\\:pt-16{padding-top:4rem}.xl\\:pt-24{padding-top:6rem}.xl\\:pt-28{padding-top:7rem}.xl\\:pt-32{padding-top:8rem}.xl\\:text-17{font-size:17px}.xl\\:text-18{font-size:18px}.xl\\:text-20{font-size:20px}.xl\\:text-22{font-size:22px}.xl\\:text-24{font-size:24px}.xl\\:text-35{font-size:35px}.xl\\:text-3xl{font-size:1.875rem;line-height:2.25rem}.xl\\:text-40{font-size:40px}.xl\\:text-53{font-size:53px}.xl\\:text-5xl{font-size:3rem;line-height:1}.xl\\:text-\\[200px\\]{font-size:200px}.xl\\:text-\\[68px\\]{font-size:68px}.xl\\:text-sm{font-size:.875rem;line-height:1.25rem}.xl\\:text-xs{font-size:.75rem;line-height:1rem}}@media (min-width: 1536px){.\\32xl\\:bottom-16{bottom:4rem}.\\32xl\\:left-\\[60\\%\\]{left:60%}.\\32xl\\:order-first{order:-9999}.\\32xl\\:order-last{order:9999}.\\32xl\\:col-span-1{grid-column:span 1 / span 1}.\\32xl\\:col-span-2{grid-column:span 2 / span 2}.\\32xl\\:col-span-3{grid-column:span 3 / span 3}.\\32xl\\:col-span-4{grid-column:span 4 / span 4}.\\32xl\\:col-span-5{grid-column:span 5 / span 5}.\\32xl\\:col-start-1{grid-column-start:1}.\\32xl\\:col-start-2{grid-column-start:2}.\\32xl\\:row-start-1{grid-row-start:1}.\\32xl\\:my-32{margin-top:8rem;margin-bottom:8rem}.\\32xl\\:-mt-20{margin-top:-5rem}.\\32xl\\:-mt-40{margin-top:-10rem}.\\32xl\\:-mt-80{margin-top:-20rem}.\\32xl\\:mb-0{margin-bottom:0}.\\32xl\\:ml-auto{margin-left:auto}.\\32xl\\:mt-0{margin-top:0}.\\32xl\\:mt-64{margin-top:16rem}.\\32xl\\:block{display:block}.\\32xl\\:grid{display:grid}.\\32xl\\:aspect-\\[16\\/4\\]{aspect-ratio:16/4}.\\32xl\\:aspect-\\[16\\/6\\]{aspect-ratio:16/6}.\\32xl\\:aspect-\\[16\\/7\\]{aspect-ratio:16/7}.\\32xl\\:aspect-\\[2\\/1\\]{aspect-ratio:2/1}.\\32xl\\:h-auto{height:auto}.\\32xl\\:max-h-full{max-height:100%}.\\32xl\\:\\!w-\\[30\\%\\]{width:30%!important}.\\32xl\\:\\!w-\\[40\\%\\]{width:40%!important}.\\32xl\\:w-2\\/12{width:16.666667%}.\\32xl\\:w-3\\/12{width:25%}.\\32xl\\:w-4\\/12{width:33.333333%}.\\32xl\\:w-60{width:15rem}.\\32xl\\:w-\\[10\\%\\]{width:10%}.\\32xl\\:w-\\[15\\%\\]{width:15%}.\\32xl\\:w-\\[25\\%\\]{width:25%}.\\32xl\\:w-\\[28\\%\\]{width:28%}.\\32xl\\:w-\\[30\\%\\]{width:30%}.\\32xl\\:w-\\[33\\%\\]{width:33%}.\\32xl\\:w-\\[35\\%\\]{width:35%}.\\32xl\\:w-\\[36\\%\\]{width:36%}.\\32xl\\:w-\\[40\\%\\]{width:40%}.\\32xl\\:w-\\[43\\%\\]{width:43%}.\\32xl\\:w-\\[45\\%\\]{width:45%}.\\32xl\\:w-\\[55\\%\\]{width:55%}.\\32xl\\:w-\\[57\\%\\]{width:57%}.\\32xl\\:w-\\[60\\%\\]{width:60%}.\\32xl\\:w-\\[800px\\]{width:800px}.\\32xl\\:max-w-\\[35\\%\\]{max-width:35%}.\\32xl\\:max-w-\\[40\\%\\]{max-width:40%}.\\32xl\\:max-w-lg{max-width:32rem}.\\32xl\\:max-w-md{max-width:28rem}.\\32xl\\:-translate-y-1\\/3{--tw-translate-y: -33.333333%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\\32xl\\:-translate-y-32{--tw-translate-y: -8rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\\32xl\\:-translate-y-80{--tw-translate-y: -20rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\\32xl\\:translate-y-16{--tw-translate-y: 4rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\\32xl\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.\\32xl\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.\\32xl\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.\\32xl\\:flex-row{flex-direction:row}.\\32xl\\:items-start{align-items:flex-start}.\\32xl\\:items-end{align-items:flex-end}.\\32xl\\:justify-center{justify-content:center}.\\32xl\\:justify-between{justify-content:space-between}.\\32xl\\:gap-10{gap:2.5rem}.\\32xl\\:gap-16{gap:4rem}.\\32xl\\:gap-20{gap:5rem}.\\32xl\\:gap-24{gap:6rem}.\\32xl\\:gap-8{gap:2rem}.\\32xl\\:gap-\\[10\\%\\]{gap:10%}.\\32xl\\:space-x-16>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(4rem * var(--tw-space-x-reverse));margin-left:calc(4rem * calc(1 - var(--tw-space-x-reverse)))}.\\32xl\\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.\\32xl\\:space-y-16>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(4rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(4rem * var(--tw-space-y-reverse))}.\\32xl\\:space-y-20>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(5rem * var(--tw-space-y-reverse))}.\\32xl\\:space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.\\32xl\\:p-20{padding:5rem}.\\32xl\\:p-8{padding:2rem}.\\32xl\\:px-0{padding-left:0;padding-right:0}.\\32xl\\:px-10{padding-left:2.5rem;padding-right:2.5rem}.\\32xl\\:px-20{padding-left:5rem;padding-right:5rem}.\\32xl\\:py-0{padding-top:0;padding-bottom:0}.\\32xl\\:py-32{padding-top:8rem;padding-bottom:8rem}.\\32xl\\:py-8{padding-top:2rem;padding-bottom:2rem}.\\32xl\\:pb-24{padding-bottom:6rem}.\\32xl\\:pl-32{padding-left:8rem}.\\32xl\\:pl-\\[10\\%\\]{padding-left:10%}.\\32xl\\:pl-\\[14\\%\\]{padding-left:14%}.\\32xl\\:pl-\\[20\\%\\]{padding-left:20%}.\\32xl\\:pr-0{padding-right:0}.\\32xl\\:pr-20{padding-right:5rem}.\\32xl\\:pr-32{padding-right:8rem}.\\32xl\\:pr-48{padding-right:12rem}.\\32xl\\:pt-16{padding-top:4rem}.\\32xl\\:text-24{font-size:24px}.\\32xl\\:text-35{font-size:35px}.\\32xl\\:text-40{font-size:40px}.\\32xl\\:text-\\[100px\\]{font-size:100px}.\\32xl\\:text-\\[138px\\]{font-size:138px}.\\32xl\\:text-\\[192px\\]{font-size:192px}.\\32xl\\:text-\\[200px\\]{font-size:200px}.\\32xl\\:text-\\[80px\\]{font-size:80px}}.\\[\\&\\>\\.current\\]\\:text-\\[\\#0BB2EB\\]>.current{--tw-text-opacity: 1;color:rgb(11 178 235 / var(--tw-text-opacity))}.\\[\\&\\>\\.current\\]\\:text-\\[\\#459060\\]>.current{--tw-text-opacity: 1;color:rgb(69 144 96 / var(--tw-text-opacity))}.\\[\\&\\>\\.current\\]\\:underline>.current{text-decoration-line:underline}.\\[\\&\\>p\\:first-child\\]\\:text-aviva-lite-red>p:first-child{--tw-text-opacity: 1;color:rgb(157 82 60 / var(--tw-text-opacity))}.\\[\\&\\>p\\:first-child\\]\\:text-aviva-lite-yellow>p:first-child{--tw-text-opacity: 1;color:rgb(217 172 54 / var(--tw-text-opacity))}.\\[\\&\\>p\\:nth-child\\(2\\)\\]\\:font-light>p:nth-child(2){font-weight:300}.\\[\\&\\>p\\>strong\\]\\:font-bold>p>strong{font-weight:700}.\\[\\&\\>p\\>strong\\]\\:font-extrabold>p>strong{font-weight:800}.\\[\\&\\>p\\>strong\\]\\:font-semibold>p>strong{font-weight:600}.\\[\\&\\>p\\>strong\\]\\:text-\\[\\#459060\\]>p>strong{--tw-text-opacity: 1;color:rgb(69 144 96 / var(--tw-text-opacity))}.\\[\\&\\>p\\>strong\\]\\:text-\\[\\#78AB6D\\]>p>strong{--tw-text-opacity: 1;color:rgb(120 171 109 / var(--tw-text-opacity))}.\\[\\&\\>p\\>strong\\]\\:text-a-black-50>p>strong{--tw-text-opacity: 1;color:rgb(128 128 128 / var(--tw-text-opacity))}.\\[\\&\\>p\\>strong\\]\\:text-aviva-lite-yellow>p>strong{--tw-text-opacity: 1;color:rgb(217 172 54 / var(--tw-text-opacity))}.\\[\\&\\>p\\>strong\\]\\:text-black>p>strong{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.\\[\\&\\>p\\>strong\\]\\:text-s-blue>p>strong{--tw-text-opacity: 1;color:rgb(0 158 227 / var(--tw-text-opacity))}.\\[\\&\\>p\\>strong\\]\\:text-white>p>strong{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.\\[\\&\\>p\\]\\:my-0>p{margin-top:0;margin-bottom:0}.\\[\\&\\>p\\]\\:inline>p{display:inline}.\\[\\&\\>strong\\]\\:text-15>strong{font-size:15px}.\\[\\&\\>strong\\]\\:font-bold>strong{font-weight:700}.\\[\\&\\>strong\\]\\:text-black>strong{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.\\[\\&_\\.current\\]\\:font-black .current{font-weight:900}.\\[\\&_li\\>p\\]\\:m-0 li>p{margin:0}.\\[\\&_li\\]\\:m-0 li,.\\[\\&_li_p\\]\\:m-0 li p{margin:0}.\\[\\&_p\\:first-child\\]\\:mb-0 p:first-child{margin-bottom:0}.\\[\\&_p\\]\\:\\!m-0 p{margin:0!important}.\\[\\&_p\\]\\:m-0 p{margin:0}.\\[\\&_p\\]\\:\\!p-1 p{padding:.25rem!important}.\\[\\&_strong\\]\\:\\!font-black strong{font-weight:900!important}.\\[\\&_strong\\]\\:font-black strong{font-weight:900}.\\[\\&_strong\\]\\:font-bold strong{font-weight:700}.\\[\\&_strong\\]\\:\\!text-white strong{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}.\\[\\&_strong\\]\\:text-s-blue strong{--tw-text-opacity: 1;color:rgb(0 158 227 / var(--tw-text-opacity))}.\\[\\&_strong\\]\\:text-white strong{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.\\[\\&_tbody_tr\\:first-child_td\\:first-child\\]\\:bg-transparent tbody tr:first-child td:first-child{background-color:transparent}.\\[\\&_tbody_tr\\:first-child_td\\]\\:bg-white tbody tr:first-child td{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.\\[\\&_tbody_tr\\:first-child_td_strong\\]\\:\\!text-s-blue tbody tr:first-child td strong{--tw-text-opacity: 1 !important;color:rgb(0 158 227 / var(--tw-text-opacity))!important}.\\[\\&_tbody_tr\\:last-child\\]\\:border-b-\\[1px\\] tbody tr:last-child{border-bottom-width:1px}.\\[\\&_tbody_tr_td\\:first-child\\]\\:border-none tbody tr td:first-child{border-style:none}.\\[\\&_td\\]\\:border-l-\\[1px\\] td{border-left-width:1px}.\\[\\&_td\\]\\:p-1 td{padding:.25rem}@media (min-width: 1024px){.lg\\:\\[\\&_td\\]\\:p-2 td{padding:.5rem}}
`,Ty={class:"h-full-screen flex flex-col md:flex-row"},Ey={class:"flex-1 md:flex-none md:w-2/5 flex flex-col overflow-hidden"},ky={key:0,class:"w-full flex justify-end"},Sy={href:"?",class:"px-4 py-2 flex items-center space-x-1"},My={class:"flex items-center space-x-2"},Ay={class:"text-sm font-bold"},Iy={class:"px-12 pt-8 xl:pt-16 flex flex-col items-center space-y-4"},Cy={class:"uppercase tracking-widest text-2xs xl:text-xs font-bold text-gray-500"},zy=["innerHTML"],Py={class:"w-full hidden md:grid md:grid-cols-2"},Dy={class:"w-full space-y-2"},Ly={class:"relative xl:mt-8"},Ry=["placeholder"],By={class:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3"},Fy={class:"w-full mt-2"},Oy={class:"flex justify-between items-center px-12"},Uy={class:"flex-1 text-xs"},jy={class:"overflow-hidden"},Ny={class:"space-y-2"},Vy={for:"looking_for",class:"text-sm text-gray-600"},Gy={key:0,class:"font-bold"},$y={key:1,id:"looking_for",class:"flex flex-wrap gap-2"},qy={class:"flex justify-end mt-4"},Zy={key:2,class:"flex-1"},Xy={class:"md:hidden h-12 grid grid-cols-2 border-t divide-x"},Wy={class:"hidden md:block flex-1"},Yy={__name:"dealers.ce",props:{mapboxToken:{type:String,default:null},country:{type:String,default:null},displayCountrySelector:{type:String,default:null},displayFaxNumbers:{type:String,default:null},lookingFor:{type:String,default:null},rangeFilters:{type:String,default:null},model:{type:String,default:null}},setup(zt){const Vt=zt;let xt=Yr([]),Pt=Yr(null),Ht=Yr(null),Qt=Yr(!1),Pi=Yr(!1),s=null,ve=Yr([]),yt=function(){Pi.value=window.innerWidth<768},Xt=Vt.model!==null,He=Xt?JSON.parse(Vt.model):null;F_(async()=>{var Ge;window.addEventListener("resize",yt);const Ke=await Qm.post("/api/dealers",{country:(Ge=JSON.parse(Vt.country))==null?void 0:Ge.country,model_id:Xt?He==null?void 0:He.id:null});s=JSON.parse(Vt.country),ve.value=JSON.parse(Vt.rangeFilters),Pt.value=Ke.data.mapbox_token,xt.value=Ke.data.dealers,await er()}),O_(()=>{window.removeEventListener("resize",yt)});let Je=Yr([]),vt=Yr(window.innerWidth>1024),er=async()=>{var Ge,wt,Hr,Sr,it,pi,tr;let Ke=null;if(Dt.value==="location"&&ki.value.length>0){let rr=ki.value+", "+((Ge=JSON.parse(Vt.country))==null?void 0:Ge.name),Kr=await Qm.get("https://api.mapbox.com/geocoding/v5/mapbox.places/"+rr+".json?access_token="+Pt.value);if(((Hr=(wt=Kr.data)==null?void 0:wt.features[0])==null?void 0:Hr.center[0])===void 0&&((it=(Sr=Kr.data)==null?void 0:Sr.features[0])==null?void 0:it.center[1])===void 0)return;Ke=(tr=(pi=Kr.data)==null?void 0:pi.features[0])==null?void 0:tr.center}Je.value=xt.value.filter(rr=>{let Kr=ai(rr,Ke),sr=De(rr);return Kr&&sr})},kr=()=>{if(Xt){window.location.href=window.location.origin+window.location.pathname;return}Rr.value=[]},Dt=Yr("location"),Ei=Yr(""),ki=Q_(Ei,500),ai=(Ke,Ge)=>Dt.value==="dealer_name"?Ke.name.toLowerCase().includes(ki.value.toLowerCase()):Ge===null?!0:fo(Ge[1],Ge[0],Ke.latitude,Ke.longitude)<150,fo=(Ke,Ge,wt,Hr)=>{let Sr=6371,it=Ur(wt-Ke),pi=Ur(Hr-Ge);Ke=Ur(Ke),wt=Ur(wt);let tr=Math.sin(it/2)*Math.sin(it/2)+Math.sin(pi/2)*Math.sin(pi/2)*Math.cos(Ke)*Math.cos(wt),rr=2*Math.atan2(Math.sqrt(tr),Math.sqrt(1-tr));return Sr*rr},Ur=Ke=>Ke*Math.PI/180,Rr=Yr(Vt.lookingFor?[Vt.lookingFor]:[]),jr=Ke=>{let Ge=Rr.value.findIndex(wt=>wt===Ke);Ge>-1?Rr.value.splice(Ge,1):Rr.value.push(Ke)},br=Ke=>Rr.value.length===0?!1:Rr.value.findIndex(wt=>wt===Ke)>-1,De=Ke=>{let Ge=[];if(Ke.motorhomes&&Ge.push("motorhomes"),Ke.caravans&&Ge.push("caravans"),Ke.vans&&Ge.push("vans"),Ke.mini_vans&&Ge.push("minivans"),Ke.supersonic&&Ge.push("supersonic"),Ke.astella&&Ge.push("astella"),Ke.rental&&Ge.push("rental"),Ke.service&&Ge.push("service"),Ge.length===0)return!1;if(Rr.value.length===0)return!0;for(let wt of Rr.value)if(!Ge.includes(wt))return!1;return!0};Nh(()=>[ki.value,Rr.value],()=>{er()},{deep:!0});let Un=Ke=>{Object.values(Ht.value.mapMarkers).forEach(Ge=>{Ge._popup.isOpen()&&Ge.togglePopup()}),Ht.value.mapMarkers[Ke].togglePopup()},jn=Yr(null),lt=()=>{let Ke={};Array.from(Je.value).forEach(Ge=>{Ke[Ge.id]=af(Ge,{display_fax_numbers:Vt.displayFaxNumbers==="true"})}),Ht.value.fill(Je.value,Ke)};return Nh(()=>Je.value,()=>{Ht.value!==null&&lt()},{deep:!0}),yt(),(Ke,Ge)=>(hr(),Lr("div",Ty,[Ct("div",Ey,[zt.displayCountrySelector==="true"&&Ve(s)?(hr(),Lr("div",ky,[Ct("a",Sy,[dc(wy,{class:"w-8 h-8"}),Ct("div",My,[Ct("span",Ay,Dr(Ve(s).name),1),dc(ef,{class:"w-4 h-4"})])])])):$i("",!0),Ct("div",Iy,[Ct("h2",Cy,Dr(Ve(Zr)("Sales and after sales")),1),Ct("h1",{class:"text-xl xl:text-3xl font-bold tracking-wide text-center",innerHTML:Ve(Zr)("Find your Adria dealer")},null,8,zy),Ct("div",Py,[Ct("button",{class:mo(["border-b-2 px-2 xl:px-4 py-1 xl:py-2 text-xs xl:text-sm font-medium",[Ve(Dt)==="location"?"border-gray-500":"border-gray-200"]]),"data-gtm":"dealers_search_by_location","data-gtm-value":"desktop",onClick:Ge[0]||(Ge[0]=wt=>Da(Dt)?Dt.value="location":Dt="location")},Dr(Ve(Zr)("Search by location")),3),Ct("button",{class:mo(["border-b-2 px-2 xl:px-4 py-1 xl:py-2 text-xs xl:text-sm font-medium",[Ve(Dt)==="dealer_name"?"border-gray-500":"border-gray-200"]]),"data-gtm":"dealers_search_by_dealer_name","data-gtm-value":"desktop",onClick:Ge[1]||(Ge[1]=wt=>Da(Dt)?Dt.value="dealer_name":Dt="dealer_name")},Dr(Ve(Zr)("Search by dealer name")),3)]),Ct("div",Dy,[Ct("div",Ly,[U_(Ct("input",{type:"text","onUpdate:modelValue":Ge[2]||(Ge[2]=wt=>Da(Ei)?Ei.value=wt:Ei=wt),class:"block w-full rounded-md border-gray-300 shadow-sm focus:border-gray-700 focus:ring-gray-700 sm:text-sm pr-10","data-gtm":"dealers_search_input",placeholder:Ve(Zr)("Search")+"..."},null,8,Ry),[[j_,Ve(Ei)]]),Ct("div",By,[dc(ny,{class:"w-4 h-4"})])])])]),Ct("div",Fy,[Ct("div",Oy,[Ct("div",Uy,[N_(Dr(Ve(Zr)("Results"))+": ",1),Ct("strong",null,Dr(Ve(Je).length),1)]),Ct("button",{class:mo(["text-[0.6rem] uppercase font-bold tracking-widest flex items-center space-x-1 py-1.5 px-3 prevent-propagation",[Ve(vt)?"bg-gray-100":""]]),"data-gtm":"dealers_filters_button",onClick:Ge[3]||(Ge[3]=wt=>Da(vt)?vt.value=!Ve(vt):vt=!Ve(vt))},[Ct("span",null,Dr(Ve(Zr)("Filters")),1),Ve(vt)?(hr(),mc(uy,{key:0,class:"w-3 h-3"})):(hr(),mc(ef,{key:1,class:"w-3 h-3"}))],2)]),Ct("div",jy,[dc(Ve(W_),{show:Ve(vt)},{default:Jm(()=>[dc(Ve(X_),{class:"bg-gray-100 px-12 py-4",enter:"transform transition ease-in-out duration-500","enter-from":"-translate-y-full","enter-to":"translate-y-0",leave:"transform transition ease-in-out duration-500","leave-from":"translate-y-0","leave-to":"-translate-y-full"},{default:Jm(()=>{var wt,Hr;return[Ct("div",Ny,[Ct("label",Vy,Dr(Ve(Zr)("I'm looking for"))+":",1),Ve(Xt)?(hr(),Lr("div",Gy,Dr((wt=Ve(He))==null?void 0:wt.gama)+" "+Dr((Hr=Ve(He))==null?void 0:Hr.title),1)):(hr(),Lr("div",$y,[Ve(ve).includes("motorhomes")?(hr(),Lr("button",{key:0,"data-gtm":"dealers_filter_selected","data-gtm-value":"motorhomes",class:mo(["border border-gray-400 rounded-md uppercase tracking-widest font-bold text-2xs px-4 py-2",[Ve(br)("motorhomes")?"bg-gray-800 text-white border-gray-800":""]]),onClick:Ge[4]||(Ge[4]=Sr=>Ve(jr)("motorhomes"))},Dr(Ve(Zr)("Motorhomes")),3)):$i("",!0),Ve(ve).includes("caravans")?(hr(),Lr("button",{key:1,"data-gtm":"dealers_filter_selected","data-gtm-value":"caravans",class:mo(["border border-gray-400 rounded-md uppercase tracking-widest font-bold text-2xs px-4 py-2",[Ve(br)("caravans")?"bg-gray-800 text-white border-gray-800":""]]),onClick:Ge[5]||(Ge[5]=Sr=>Ve(jr)("caravans"))},Dr(Ve(Zr)("Caravans")),3)):$i("",!0),Ve(ve).includes("vans")?(hr(),Lr("button",{key:2,"data-gtm":"dealers_filter_selected","data-gtm-value":"vans",class:mo(["border border-gray-400 rounded-md uppercase tracking-widest font-bold text-2xs px-4 py-2",[Ve(br)("vans")?"bg-gray-800 text-white border-gray-800":""]]),onClick:Ge[6]||(Ge[6]=Sr=>Ve(jr)("vans"))},Dr(Ve(Zr)("Campervans")),3)):$i("",!0),Ve(ve).includes("mini-vans")?(hr(),Lr("button",{key:3,"data-gtm":"dealers_filter_selected","data-gtm-value":"minivans",class:mo(["border border-gray-400 rounded-md uppercase tracking-widest font-bold text-2xs px-4 py-2",[Ve(br)("minivans")?"bg-gray-800 text-white border-gray-800":""]]),onClick:Ge[7]||(Ge[7]=Sr=>Ve(jr)("minivans"))},Dr(Ve(Zr)("Minivans")),3)):$i("",!0),Ve(ve).includes("supersonic")?(hr(),Lr("button",{key:4,"data-gtm":"dealers_filter_selected","data-gtm-value":"supersonic",class:mo(["border border-gray-400 rounded-md uppercase tracking-widest font-bold text-2xs px-4 py-2",[Ve(br)("supersonic")?"bg-gray-800 text-white border-gray-800":""]]),onClick:Ge[8]||(Ge[8]=Sr=>Ve(jr)("supersonic"))},"Supersonic ",2)):$i("",!0),Ve(ve).includes("astella")?(hr(),Lr("button",{key:5,"data-gtm":"dealers_filter_selected","data-gtm-value":"astella",class:mo(["border border-gray-400 rounded-md uppercase tracking-widest font-bold text-2xs px-4 py-2",[Ve(br)("astella")?"bg-gray-800 text-white border-gray-800":""]]),onClick:Ge[9]||(Ge[9]=Sr=>Ve(jr)("astella"))},"Astella ",2)):$i("",!0),Ct("button",{"data-gtm":"dealers_filter_selected","data-gtm-value":"service",class:mo(["border border-gray-400 rounded-md uppercase tracking-widest font-bold text-2xs px-4 py-2",[Ve(br)("service")?"bg-gray-800 text-white border-gray-800":""]]),onClick:Ge[10]||(Ge[10]=Sr=>Ve(jr)("service"))},Dr(Ve(Zr)("Service")),3),Ct("button",{"data-gtm":"dealers_filter_selected","data-gtm-value":"rental",class:mo(["border border-gray-400 rounded-md uppercase tracking-widest font-bold text-2xs px-4 py-2",[Ve(br)("rental")?"bg-gray-800 text-white border-gray-800":""]]),onClick:Ge[11]||(Ge[11]=Sr=>Ve(jr)("rental"))},Dr(Ve(Zr)("Rental")),3)]))]),Ct("div",qy,[Ct("button",{"data-gtm":"dealers_clear_filters",class:"underline text-xs",onClick:Ge[12]||(Ge[12]=(...Sr)=>Ve(kr)&&Ve(kr)(...Sr))},Dr(Ve(Zr)("Clear filters")),1)])]}),_:1})]),_:1},8,["show"])])]),Ve(Qt)?$i("",!0):(hr(),Lr("div",{key:1,class:"flex-1 overflow-y-auto px-12 divide-y border-t",ref_key:"dealersList",ref:jn},[(hr(!0),Lr(V_,null,G_(Ve(Je),wt=>(hr(),mc(dy,{key:wt.id,dealer:wt,id:"dealer-"+wt.id,"data-id":wt.id,display_fax_numbers:zt.displayFaxNumbers==="true",onClickContent:Hr=>Ve(Un)(wt.id)},null,8,["dealer","id","data-id","display_fax_numbers","onClickContent"]))),128))],512)),Ve(Qt)?(hr(),Lr("div",Zy,[Ve(Pt)&&Ve(Pi)?(hr(),mc(nf,{key:0,class:"w-full h-full",token:Ve(Pt),onMapCreated:Ve(lt),ref_key:"map",ref:Ht},null,8,["token","onMapCreated"])):$i("",!0)])):$i("",!0),Ct("div",Xy,[Ve(Dt)==="location"?(hr(),Lr("button",{key:0,class:"text-xs uppercase font-bold tracking-wide","data-gtm":"dealers_search_by_dealer_name","data-gtm-value":"mobile",onClick:Ge[13]||(Ge[13]=wt=>Da(Dt)?Dt.value="name":Dt="name")},Dr(Ve(Zr)("Search by location")),1)):Ve(Dt)==="name"?(hr(),Lr("button",{key:1,class:"text-xs uppercase font-bold tracking-wide","data-gtm":"dealers_search_by_location","data-gtm-value":"mobile",onClick:Ge[14]||(Ge[14]=wt=>Da(Dt)?Dt.value="location":Dt="location")},Dr(Ve(Zr)("Search by dealer name")),1)):$i("",!0),Ct("button",{class:"text-xs uppercase font-bold tracking-wide",onClick:Ge[15]||(Ge[15]=wt=>Da(Qt)?Qt.value=!Ve(Qt):Qt=!Ve(Qt)),"data-gtm":"dealers_show_map_toggle"},Dr(Ve(Zr)(Ve(Qt)?"Show list":"Show map")),1)])]),Ct("div",Wy,[Ve(Pt)&&!Ve(Pi)?(hr(),mc(nf,{key:0,class:"w-full h-full",token:Ve(Pt),ref_key:"map",ref:Ht,onMapCreated:Ve(lt)},null,8,["token","onMapCreated"])):$i("",!0)])]))}},Hy=Vh(Yy,[["styles",[by]]]),Ky=$_(Hy);customElements.define("v-dealers",Ky);
