vendor: 4,251 bytes, line 1
1var RT=Object.create;var jv=Object.defineProperty;var FT=Object.getOwnPropertyDescriptor;var BT=Object.getOwnPropertyNames;var OT=Object.getPrototypeOf,VT=Object.prototype.hasOwnProperty;var Ry=(O,E)=>()=>(E||O((E={exports:{}}).exports,E),E.exports);var NT=(O,E,F,H)=>{if(E&&typeof E=="object"||typeof E=="function")for(let V of BT(E))!VT.call(O,V)&&V!==F&&jv(O,V,{get:()=>E[V],enumerable:!(H=FT(E,V))||H.enumerable});return O};var _p=(O,E,F)=>(F=O!=null?RT(OT(O)):{},NT(E||!O||!O.__esModule?jv(F,"default",{value:O,enumerable:!0}):F,O));var Qv=Ry((vC,Fy)=>{"use strict";var om=typeof Reflect=="object"?Reflect:null,qv=om&&typeof om.apply=="function"?om.apply:function(E,F,H){return Function.prototype.apply.call(E,F,H)},yg;om&&typeof om.ownKeys=="function"?yg=om.ownKeys:Object.getOwnPropertySymbols?yg=function(E){return Object.getOwnPropertyNames(E).concat(Object.getOwnPropertySymbols(E))}:yg=function(E){return Object.getOwnPropertyNames(E)};function jT(O){console&&console.warn&&console.warn(O)}var Gv=Number.isNaN||function(E){return E!==E};function fn(){fn.init.call(this)}Fy.exports=fn;Fy.exports.once=ZT;fn.EventEmitter=fn;fn.prototype._events=void 0;fn.prototype._eventsCount=0;fn.prototype._maxListeners=void 0;var $v=10;function xg(O){if(typeof O!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof O)}Object.defineProperty(fn,"defaultMaxListeners",{enumerable:!0,get:function(){return $v},set:function(O){if(typeof O!="number"||O<0||Gv(O))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+O+".");$v=O}});fn.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};fn.prototype.setMaxListeners=function(E){if(typeof E!="number"||E<0||Gv(E))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+E+".");return this._maxListeners=E,this};function Zv(O){return O._maxListeners===void 0?fn.defaultMaxListeners:O._maxListeners}fn.prototype.getMaxListeners=function(){return Zv(this)};fn.prototype.emit=function(E){for(var F=[],H=1;H<arguments.length;H++)F.push(arguments[H]);var V=E==="error",o=this._events;if(o!==void 0)V=V&&o.error===void 0;else if(!V)return!1;if(V){var pe;if(F.length>0&&(pe=F[0]),pe instanceof Error)throw pe;var Ne=new Error("Unhandled error."+(pe?" ("+pe.message+")":""));throw Ne.context=pe,Ne}var Qe=o[E];if(Qe===void 0)return!1;if(typeof Qe=="function")qv(Qe,this,F);else for(var ct=Qe.length,Ze=Yv(Qe,ct),H=0;H<ct;++H)qv(Ze[H],this,F);return!0};function Wv(O,E,F,H){var V,o,pe;if(xg(F),o=O._events,o===void 0?(o=O._events=Object.create(null),O._eventsCount=0):(o.newListener!==void 0&&(O.emit("newListener",E,F.listener?F.listener:F),o=O._events),pe=o[E]),pe===void 0)pe=o[E]=F,++O._eventsCount;else if(typeof pe=="function"?pe=o[E]=H?[F,pe]:[pe,F]:H?pe.unshift(F):pe.push(F),V=Zv(O),V>0&&pe.length>V&&!pe.warned){pe.warned=!0;var Ne=new Error("Possible EventEmitter memory leak detected. "+pe.length+" "+String(E)+" listeners added. Use emitter.setMaxListeners() to increase limit");Ne.name="MaxListenersExceededWarning",Ne.emitter=O,Ne.type=E,Ne.count=pe.length,jT(Ne)}return O}fn.prototype.addListener=function(E,F){return Wv(this,E,F,!1)};fn.prototype.on=fn.prototype.addListener;fn.prototype.prependListener=function(E,F){return Wv(this,E,F,!0)};function qT(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Hv(O,E,F){var H={fired:!1,wrapFn:void 0,target:O,type:E,listener:F},V=qT.bind(H);return V.listener=F,H.wrapFn=V,V}fn.prototype.once=function(E,F){return xg(F),this.on(E,Hv(this,E,F)),this};fn.prototype.prependOnceListener=function(E,F){return xg(F),this.prependListener(E,Hv(this,E,F)),this};fn.prototype.removeListener=function(E,F){var H,V,o,pe,Ne;if(xg(F),V=this._events,V===void 0)return this;if(H=V[E],H===void 0)return this;if(H===F||H.listener===F)--this._eventsCount===0?this._events=Object.create(null):(delete V[E],V.removeListener&&this.emit
1("removeListener",E,H.listener||F));else if(typeof H!="function"){for(o=-1,pe=H.length-1;pe>=0;pe--)if(H[pe]===F||H[pe].listener===F){Ne=H[pe].listener,o=pe;break}if(o<0)return this;o===0?H.shift():$T(H,o),H.length===1&&(V[E]=H[0]),V.removeListener!==void 0&&this.emit("removeListener",E,Ne||F)}return this};fn.prototype.off=fn.prototype.removeListener;fn.prototype.removeAllListeners=function(E){var F,H,V;if(H=this._events,H===void 0)return this;if(H.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):H[E]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete H[E]),this;if(arguments.length===0){var o=Object.keys(H),pe;for(V=0;V<o.length;++V)pe=o[V],pe!=="removeListener"&&this.removeAllListeners(pe);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(F=H[E],typeof F=="function")this.removeListener(E,F);else if(F!==void 0)for(V=F.length-1;V>=0;V--)this.removeListener(E,F[V]);return this};function Xv(O,E,F){var H=O._events;if(H===void 0)return[];var V=H[E];return V===void 0?[]:typeof V=="function"?F?[V.listener||V]:[V]:F?GT(V):Yv(V,V.length)}fn.prototype.listeners=function(E){return Xv(this,E,!0)};fn.prototype.rawListeners=function(E){return Xv(this,E,!1)};fn.listenerCount=function(O,E){return typeof O.listenerCount=="function"?O.listenerCount(E):Kv.call(O,E)};fn.prototype.listenerCount=Kv;function Kv(O){var E=this._events;if(E!==void 0){var F=E[O];if(typeof F=="function")return 1;if(F!==void 0)return F.length}return 0}fn.prototype.eventNames=function(){return this._eventsCount>0?yg(this._events):[]};function Yv(O,E){for(var F=new Array(E),H=0;H<E;++H)F[H]=O[H];return F}function $T(O,E){for(;E+1<O.length;E++)O[E]=O[E+1];O.pop()}function GT(O){for(var E=new Array(O.length),F=0;F<E.length;++F)E[F]=O[F].listener||O[F];return E}function ZT(O,E){return new Promise(function(F,H){function V(pe){O.removeListener(E,o),H(pe)}function o(){typeof O.removeListener=="function"&&O.removeListener("error",V),F([].slice.call(arguments))}Jv(O,E,o,{once:!0}),E!=="error"&&WT(O,V,{once:!0})})}function WT(O,E,F){typeof O.on=="function"&&Jv(O,"error",E,F)}function Jv(O,E,F,H){if(typeof O.on=="function")H.once?O.once(E,F):O.on(E,F);else if(typeof O.addEventListener=="function")O.addEventListener(E,function V(o){H.once&&O.removeEventListener(E,V),F(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof O)}});var id=Ry((Hy,Xy)=>{(function(O,E){typeof Hy=="object"&&typeof Xy<"u"?Xy.exports=E():typeof define=="function"&&define.amd?define(E):(O=typeof globalThis<"u"?globalThis:O||self,O.maplibregl=E())})(Hy,(function(){"use strict";var O={},E={};function F(V,o,pe){if(E[V]=pe,V==="index"){var Ne="var sharedModule = {}; ("+E.shared+")(sharedModule); ("+E.worker+")(sharedModule);",Qe={};return E.shared(Qe),E.index(O,Qe),typeof window<"u"&&O.setWorkerUrl(window.URL.createObjectURL(new Blob([Ne],{type:"text/javascript"}))),O}}F("shared",["exports"],(function(V){"use strict";function o(r,e,i,l){return new(i||(i=Promise))((function(h,m){function g(w){try{C(l.next(w))}catch(A){m(A)}}function x(w){try{C(l.throw(w))}catch(A){m(A)}}function C(w){var A;w.done?h(w.value):(A=w.value,A instanceof i?A:new i((function(M){M(A)}))).then(g,x)}C((l=l.apply(r,e||[])).next())}))}function pe(r,e){this.x=r,this.y=e}function Ne(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Qe,ct;typeof SuppressedError=="function"&&SuppressedError,pe.prototype={clone(){return new pe(this.x,this.y)},add(r){return this.clone()._add(r)},sub(r){return this.clone()._sub(r)},multByPoint(r){return this.clone()._multByPoint(r)},divByPoint(r){return this.clone()._divByPoint(r)},mult(r){return this.clone()._mult(r)},div(r){return this.clone()._div(r)},rotate(r){return this.clone()._rotate(r)},rotateAround(r,e){return this.clone()._rotateAround(r,e)},matMult(r){return this.clone()._matMult(r)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(r){return this.x===r.x&&this.y===r.y},dist(r){return Math.sqrt(this.distSqr(r))},distSqr(r){let e=r.x-this.x,i=r.y-this.y;return e*e+i*i},angle(){return Math.atan2(this.y,this.x)},angleTo(r){return Math.atan2(this.y-r.y,this.x-r.x)},angleWith(r){return this.angleWithSep(r.x,r.y)},angleWithSep(r,e){return Math.atan2(this.x*e-this.y*r,this.x*r+this.y*e)},_matMult(r){let e=r[2]*this.x+r[3]*this.y;return this.x=r[0]*this.x+r[1]*this.y,this.y=e,this},_add(r){return this.x+=r.x,this.y+=r.y,this},_sub(r){return this.x-=r.x,this.y-=r.y,this},_mult(r){return this.x*=r,this.y*=r,this},_div(r){return this.x/=r,this.y/=r,this},_multByPoint(r){return this.x*=r.x,this.y*=r.y,this},_divByPoint(r){return this.x/=r.x,this.y/=r.y,this},_unit(){return this._div(this.mag()),this},_perp(){let r=this.y;return this.y=this.x,this.x=-r,this},_rotate(r){let e=Math.cos(r),i=Math.sin(r),l=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=l,this}
vendor: 6,226 bytes, line 1
1,_rotateAround(r,e){let i=Math.cos(r),l=Math.sin(r),h=e.y+l*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-l*(this.y-e.y),this.y=h,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:pe},pe.convert=function(r){if(r instanceof pe)return r;if(Array.isArray(r))return new pe(+r[0],+r[1]);if(r.x!==void 0&&r.y!==void 0)return new pe(+r.x,+r.y);throw new Error("Expected [x, y] or {x, y} point format")};var Ze=(function(){if(ct)return Qe;function r(e,i,l,h){this.cx=3*e,this.bx=3*(l-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(h-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=i,this.p2x=l,this.p2y=h}return ct=1,Qe=r,r.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,i){if(i===void 0&&(i=1e-6),e<0)return 0;if(e>1)return 1;for(var l=e,h=0;h<8;h++){var m=this.sampleCurveX(l)-e;if(Math.abs(m)<i)return l;var g=this.sampleCurveDerivativeX(l);if(Math.abs(g)<1e-6)break;l-=m/g}var x=0,C=1;for(l=e,h=0;h<20&&(m=this.sampleCurveX(l),!(Math.abs(m-e)<i));h++)e>m?x=l:C=l,l=.5*(C-x)+x;return l},solve:function(e,i){return this.sampleCurveY(this.solveCurveX(e,i))}},Qe})(),Bt=Ne(Ze);let Ct,Mt;function fi(){return Ct!=null||(Ct=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Ct}function At(){if(Mt==null&&(Mt=!1,fi())){let e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let l=0;l<25;l++){let h=4*l;e.fillStyle=`rgb(${h},${h+1},${h+2})`,e.fillRect(l%5,Math.floor(l/5),1,1)}let i=e.getImageData(0,0,5,5).data;for(let l=0;l<100;l++)if(l%4!=3&&i[l]!==l){Mt=!0;break}}}return Mt||!1}var He=1e-6,Ut=typeof Float32Array<"u"?Float32Array:Array;function Mi(){var r=new Ut(9);return Ut!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function li(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function ki(){var r=new Ut(3);return Ut!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function wi(r){var e=r[0],i=r[1],l=r[2];return Math.sqrt(e*e+i*i+l*l)}function ci(r,e,i){var l=new Ut(3);return l[0]=r,l[1]=e,l[2]=i,l}function Pe(r,e,i){return r[0]=e[0]+i[0],r[1]=e[1]+i[1],r[2]=e[2]+i[2],r}function Ve(r,e,i){return r[0]=e[0]*i,r[1]=e[1]*i,r[2]=e[2]*i,r}function Ye(r,e,i){var l=e[0],h=e[1],m=e[2],g=i[0],x=i[1],C=i[2];return r[0]=h*C-m*x,r[1]=m*g-l*C,r[2]=l*x-h*g,r}var It,jt=wi;function Si(r,e,i){var l=e[0],h=e[1],m=e[2],g=e[3];return r[0]=i[0]*l+i[4]*h+i[8]*m+i[12]*g,r[1]=i[1]*l+i[5]*h+i[9]*m+i[13]*g,r[2]=i[2]*l+i[6]*h+i[10]*m+i[14]*g,r[3]=i[3]*l+i[7]*h+i[11]*m+i[15]*g,r}function hi(){var r=new Ut(4);return Ut!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function Nt(r,e,i,l){var h=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"zyx",m=Math.PI/360;e*=m,l*=m,i*=m;var g=Math.sin(e),x=Math.cos(e),C=Math.sin(i),w=Math.cos(i),A=Math.sin(l),M=Math.cos(l);switch(h){case"xyz":r[0]=g*w*M+x*C*A,r[1]=x*C*M-g*w*A,r[2]=x*w*A+g*C*M,r[3]=x*w*M-g*C*A;break;case"xzy":r[0]=g*w*M-x*C*A,r[1]=x*C*M-g*w*A,r[2]=x*w*A+g*C*M,r[3]=x*w*M+g*C*A;break;case"yxz":r[0]=g*w*M+x*C*A,r[1]=x*C*M-g*w*A,r[2]=x*w*A-g*C*M,r[3]=x*w*M+g*C*A;break;case"yzx":r[0]=g*w*M+x*C*A,r[1]=x*C*M+g*w*A,r[2]=x*w*A-g*C*M,r[3]=x*w*M-g*C*A;break;case"zxy":r[0]=g*w*M-x*C*A,r[1]=x*C*M+g*w*A,r[2]=x*w*A+g*C*M,r[3]=x*w*M-g*C*A;break;case"zyx":r[0]=g*w*M-x*C*A,r[1]=x*C*M+g*w*A,r[2]=x*w*A-g*C*M,r[3]=x*w*M+g*C*A;break;default:throw new Error("Unknown angle order "+h)}return r}function vi(){var r=new Ut(2);return Ut!=Float32Array&&(r[0]=0,r[1]=0),r}function Li(r,e){var i=new Ut(2);return i[0]=r,i[1]=e,i}ki(),It=new Ut(4),Ut!=Float32Array&&(It[0]=0,It[1]=0,It[2]=0,It[3]=0),ki(),ci(1,0,0),ci(0,1,0),hi(),hi(),Mi(),vi();let pi=8192;function er(r,e,i){return e*(pi/(r.tileSize*Math.pow(2,i-r.tileID.overscaledZ)))}function lr(r){return r instanceof Error?r:new Error(typeof r=="string"?r:String(r))}function _n(r,e){return(r%e+e)%e}function qr(r,e,i){return r*(1-i)+e*i}function Cn(r){if(r<=0)return 0;if(r>=1)return 1;let e=r*r,i=e*r;return 4*(r<.5?i:3*(r-e)+i-.75)}function yn(r,e,i,l){let h=new Bt(r,e,i,l);return m=>h.solve(m)}let zo=yn(.25,.1,.25,1);function $r(r,e,i){return Math.min(i,Math.max(e,r))}function yo(r,e,i){let l=i-e,h=((r-e)%l+l)%l+e;return h===e?i:h}function Dr(r,...e){for(let i of e)for(let l in i)r[l]=i[l];return r}let fa=1;function Do(r,e,i){let l={};for(let h in r)l[h]=e.call(this,r[h],h,r);return l}function Qn(r,e,i){let l={};for(let h in r)e.call(this,r[h],h,r)&&(l[h]=r[h]);return l}function Ti(r){return Array.isArray(r)?r.map(Ti):typeof r=="object"&&r?Do(r,Ti):r}let nn={};function Gr(r){nn[r]||(typeof console<"u"&&console.warn(r),nn[r]=!0)}function Hn(r,e,i){return(i.y-r.y)*(e.x-r.x)>(e.y-r.y)*(i.x-r.x)}function on(r){return typeof WorkerGlobalScope<"u"&&r!==void 0&&r instanceof WorkerGlobalScope}let Xn=null;function Qi(r){return typeof ImageBitmap<"u"&&r instanceof ImageBitmap}let ga="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function as(r,e,i,l,h){return o(this,void 0,void 0,(function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let m=new VideoFrame(r,{timestamp:0});try{let g=m?.format;if(!g||!g.startsWith("BGR")&&!g.startsWith("RGB"))throw new Error(`Unrecognized format ${g}`);let x=g.startsWith("BGR"),C=new Uint8ClampedArray(l*h*4);if(yield m.copyTo(C,(function(w,A,M,N,L){let Z=4*Math.max(-A,0),X=(Math.max(0,M)-M)*N*4+Z,ie=4*N,ne=Math.max(0,A),ue=Math.max(0,M);return{rect:{x:ne,y:ue,width:Math.min(w.width,A+N)-ne,height:Math.min(w.height,M+L)-ue},layout:[{offset:X,stride:ie}]}})(r,e,i,l,h)),x)for(let w=0;w<C.length;w+=4){let A=C[w];C[w]=C[w+2],C[w+2]=A}return C}finally{m.close()}}))}let xo,ss;function _a(r,e,i,l){return r.addEventListener(e,i,l),{unsubscribe:()=>{r.removeEventListener(e,i,l)}}}function oo(r){return r*Math.PI/180}function ya(r){return r/Math.PI*180}let Na={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0}
1,St={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},Kt="AbortError";class Ua extends Error{constructor(e=Kt){super(e instanceof Error?e.message:e),this.name=Kt,e instanceof Error&&e.stack&&(this.stack=e.stack)}}function xa(r){return r instanceof Error&&r.name===Kt}function or(r){if(r.aborted)throw new Ua(r.reason)}let Bn={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function xn(r){return Bn.REGISTERED_PROTOCOLS[r.substring(0,r.indexOf("://"))]}let Zr="global-dispatcher";class ta extends Error{constructor(e,i,l,h){super(`AJAXError: ${i} (${e}): ${l}`),this.status=e,this.statusText=i,this.url=l,this.body=h}}let Ht=()=>{var r;return on(self)?(r=self.worker)===null||r===void 0?void 0:r.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href},Wi=function(r,e){return o(this,void 0,void 0,(function*(){var i,l;if(r.url.includes("://")&&!/^https?:|^file:/.test(r.url)){let h=xn(r.url);if(h){let m=yield h(r,e);return m.data||r.type!=="arrayBuffer"?m:Dr(m,{data:new ArrayBuffer(0)})}if(on(self)&&(!((i=self.worker)===null||i===void 0)&&i.actor))return self.worker.actor.sendAsync({type:"GR",data:r,targetMapId:Zr},e)}if(!(h=>{var m;return h.startsWith("file:")||((m=Ht())===null||m===void 0?void 0:m.startsWith("file:"))&&!/^\w+:/.test(h)})(r.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,"signal"))return(function(h,m){return o(this,void 0,void 0,(function*(){let g=new Request(h.url,{method:h.method||"GET",body:h.body,credentials:h.credentials,headers:h.headers,cache:h.cache,referrer:Ht(),referrerPolicy:h.referrerPolicy,signal:m.signal}),x,C;h.type!=="json"||g.headers.has("Accept")||g.headers.set("Accept","application/json");try{x=yield fetch(g)}catch(A){throw xa(A)?A:new ta(0,lr(A).message,h.url,new Blob)}if(!x.ok){let A=yield x.blob();throw new ta(x.status,x.statusText,h.url,A)}C=h.type==="arrayBuffer"||h.type==="image"?x.arrayBuffer():h.type==="json"?x.json():x.text();let w=yield C;return or(m.signal),{data:w,cacheControl:x.headers.get("Cache-Control"),expires:x.headers.get("Expires"),etag:x.headers.get("ETag")}}))})(r,e);if(on(self)&&(!((l=self.worker)===null||l===void 0)&&l.actor))return self.worker.actor.sendAsync({type:"GR",data:r,mustQueue:!0,targetMapId:Zr},e)}return(function(h,m){return new Promise(((g,x)=>{var C;let w=new XMLHttpRequest;w.open(h.method||"GET",h.url,!0),h.type!=="arrayBuffer"&&h.type!=="image"||(w.responseType="arraybuffer");for(let A in h.headers)w.setRequestHeader(A,h.headers[A]);h.type==="json"&&(w.responseType="text",!((C=h.headers)===null||C===void 0)&&C.Accept||w.setRequestHeader("Accept","application/json")),w.withCredentials=h.credentials==="include",w.onerror=()=>{x(new Error(w.statusText))},w.onload=()=>{if(!m.signal.aborted)if((w.status>=200&&w.status<300||w.status===0)&&w.response!==null){let A=w.response;if(h.type==="json")try{A=JSON.parse(w.response)}catch(M){return void x(M)}g({data:A,cacheControl:w.getResponseHeader("Cache-Control"),expires:w.getResponseHeader("Expires"),etag:w.getResponseHeader("ETag")})}else{let A=new Blob([w.response],{type:w.getResponseHeader("Content-Type")});x(new ta(w.status,w.statusText,h.url,A))}},m.signal.addEventListener("abort",(()=>{w.abort(),x(new Ua(m.signal.reason))})),w.send(h.body)}))})(r,e)}))};function Bi(r){if(!r||r.indexOf("://")<=0||r.startsWith("data:image/")||r.startsWith("blob:"))return!0;let e=new URL(r),i=window.location;return e.protocol===i.protocol&&e.host===i.host}function an(r,e,i){var l;!((l=i[r])===null||l===void 0)&&l.includes(e)||(i[r]||(i[r]=[]),i[r].push(e))}function Lo(r,e,i){if(i?.[r]){let l=i[r].indexOf(e);l!==-1&&i[r].splice(l,1)}}class ji{constructor(e,i={}){Dr(this,i),this.type=e}}class Ro extends ji{constructor(e,i={}){super("error",Dr({error:e},i))}}class vn{on(e,i){return this._listeners||(this._listeners={}),an(e,i,this._listeners),{unsubscribe:()=>{this.off(e,i)}}}off(e,i){return Lo(e,i,this._listeners),Lo(e,i,this._oneTimeListeners),this}
1once(e,i){return i?(this._oneTimeListeners||(this._oneTimeListeners={}),an(e,i,this._oneTimeListeners),this):new Promise((l=>this.once(e,l)))}fire(e,i){var l,h;typeof e=="string"&&(e=new ji(e,i||{}));let m=e.type;if(this.listens(m)){e.target=this;let g=!((l=this._listeners)===null||l===void 0)&&l[m]?this._listeners[m].slice():[];for(let w of g)w.call(this,e);let x=!((h=this._oneTimeListeners)===null||h===void 0)&&h[m]?this._oneTimeListeners[m].slice():[];for(let w of x)Lo(m,w,this._oneTimeListeners),w.call(this,e);let C=this._eventedParent;C&&(Dr(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),C.fire(e))}else e instanceof Ro&&console.error(e.error);return this}listens(e){var i,l,h,m,g;return((l=(i=this._listeners)===null||i===void 0?void 0:i[e])===null||l===void 0?void 0:l.length)>0||((m=(h=this._oneTimeListeners)===null||h===void 0?void 0:h[e])===null||m===void 0?void 0:m.length)>0||((g=this._eventedParent)===null||g===void 0?void 0:g.listens(e))}setEventedParent(e,i){return this._eventedParent=e,this._eventedParentData=i,this}}var xt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{}
vendor: 15,845 bytes, line 1
1,miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven
vendor: 12,722 bytes, line 1
1"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}}
vendor: 80,727 bytes, line 1
1;let sn=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function eo(r,e){let i={};for(let l in r)l!=="ref"&&(i[l]=r[l]);return sn.forEach((l=>{l in e&&(i[l]=e[l])})),i}function Ai(r,e){if(Array.isArray(r)){if(!Array.isArray(e)||r.length!==e.length)return!1;for(let i=0;i<r.length;i++)if(!Ai(r[i],e[i]))return!1;return!0}if(typeof r=="object"&&r!==null&&e!==null){if(typeof e!="object"||Object.keys(r).length!==Object.keys(e).length)return!1;for(let i in r)if(!Ai(r[i],e[i]))return!1;return!0}return r===e}function On(r,e){r.push(e)}function ao(r,e,i){On(i,{command:"addSource",args:[r,e[r]]})}function Xs(r,e,i){On(e,{command:"removeSource",args:[r]}),i[r]=!0}function Ks(r,e,i,l){Xs(r,i,l),ao(r,e,i)}function Ql(r,e,i){let l;for(l in r[i])if(Object.prototype.hasOwnProperty.call(r[i],l)&&l!=="data"&&!Ai(r[i][l],e[i][l]))return!1;for(l in e[i])if(Object.prototype.hasOwnProperty.call(e[i],l)&&l!=="data"&&!Ai(r[i][l],e[i][l]))return!1;return!0}function ls(r,e,i,l,h,m){r=r||{},e=e||{};for(let g in r)Object.prototype.hasOwnProperty.call(r,g)&&(Ai(r[g],e[g])||i.push({command:m,args:[l,g,e[g],h]}));for(let g in e)Object.prototype.hasOwnProperty.call(e,g)&&!Object.prototype.hasOwnProperty.call(r,g)&&(Ai(r[g],e[g])||i.push({command:m,args:[l,g,e[g],h]}))}function Se(r){return r.id}function re(r,e){return r[e.id]=e,r}class te{constructor(e,i,l,h){this.message=(e?`${e}: `:"")+l,h&&(this.identifier=h),i!=null&&i.__line__&&(this.line=i.__line__)}}function xe(r,...e){for(let i of e)for(let l in i)r[l]=i[l];return r}class ve extends Error{constructor(e,i){super(i),this.message=i,this.key=e}}class $e{constructor(e,i=[]){this.parent=e,this.bindings={};for(let[l,h]of i)this.bindings[l]=h}concat(e){return new $e(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)}}let Ke={kind:"null"},Te={kind:"number"},ke={kind:"string"},Ge={kind:"boolean"},pt={kind:"color"},zt={kind:"projectionDefinition"},dt={kind:"object"},Lt={kind:"value"},gi={kind:"collator"},ei={kind:"formatted"},zi={kind:"padding"},Ri={kind:"colorArray"},rr={kind:"numberArray"},Vi={kind:"resolvedImage"},Hi={kind:"variableAnchorOffsetCollection"};function qi(r,e){return{kind:"array",itemType:r,N:e}}function Fi(r){if(r.kind==="array"){let e=Fi(r.itemType);return typeof r.N=="number"?`array<${e}, ${r.N}>`:r.itemType.kind==="value"?"array":`array<${e}>`}return r.kind}let bn=[Ke,Te,ke,Ge,pt,zt,ei,dt,qi(Lt),zi,rr,Ri,Vi,Hi];function Sr(r,e){if(e.kind==="error")return null;if(r.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Sr(r.itemType,e.itemType))&&(typeof r.N!="number"||r.N===e.N))return null}else{if(r.kind===e.kind)return null;if(r.kind==="value"){for(let i of bn)if(!Sr(i,e))return null}}return`Expected ${Fi(r)} but found ${Fi(e)} instead.`}function En(r,e){return e.some((i=>i.kind===r.kind))}function va(r,e){return e.some((i=>i==="null"?r===null:i==="array"?Array.isArray(r):i==="object"?r&&!Array.isArray(r)&&typeof r=="object":i===typeof r))}function vo(r,e){return r.kind==="array"&&e.kind==="array"?r.itemType.kind===e.itemType.kind&&typeof r.N=="number":r.kind===e.kind}let Ir=.96422,Ss=.82521,ec=4/29,Wr=6/29,Kh=3*Wr*Wr,sh=Wr*Wr*Wr,Ec=Math.PI/180,Mc=180/Math.PI;function lh(r){return(r%=360)<0&&(r+=360),r}function Yh([r,e,i,l]){let h,m,g=ch((.2225045*(r=Pc(r))+.7168786*(e=Pc(e))+.0606169*(i=Pc(i)))/1);r===e&&e===i?h=m=g:(h=ch((.4360747*r+.3850649*e+.1430804*i)/Ir),m=ch((.0139322*r+.0971045*e+.7141733*i)/Ss));let x=116*g-16;return[x<0?0:x,500*(h-g),200*(g-m),l]}function Pc(r){return r<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)}function ch(r){return r>sh?Math.pow(r,1/3):r/Kh+ec}function Is([r,e,i,l]){let h=(r+16)/116,m=isNaN(e)?h:h+e/500,g=isNaN(i)?h:h-i/200;return h=1*Ys(h),m=Ir*Ys(m),g=Ss*Ys(g),[vl(3.1338561*m-1.6168667*h-.4906146*g),vl(-.9787684*m+1.9161415*h+.033454*g),vl(.0719453*m-.2289914*h+1.4052427*g),l]}function vl(r){return(r=r<=.00304?12.92*r:1.055*Math.pow(r,1/2.4)-.055)<0?0:r>1?1:r}function Ys(r){return r>Wr?r*r*r:Kh*(r-ec)}let hh=Object.hasOwn||function(r,e){return Object.prototype.hasOwnProperty.call(r,e)};function Js(r,e){return hh(r,e)?r[e]:void 0}function Cs(r){return parseInt(r.padEnd(2,r),16)/255}function uh(r,e){return Es(e?r/100:r,0,1)}function Es(r,e,i){return Math.min(Math.max(e,r),i)}function bl(r){return!r.some(Number.isNaN)}let Mr={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function ba(r,e,i){return r+i*(e-r)}function wl(r,e,i){return r.map(((l,h)=>ba(l,e[h],i)))}class Yi{constructor(e,i,l,h=1,m=!0){this.r=e,this.g=i,this.b=l,this.a=h,m||(this.r*=h,this.g*=h,this.b*=h,h||this.overwriteGetter("rgb",[e,i,l,h]))}static parse(e){if(e instanceof Yi)return e;if(typeof e!="string")return;let i=(function(l){if((l=l.toLowerCase().trim())==="transparent")return[0,0,0,0];let h=Js(Mr,l);if(h){let[g,x,C]=h;return[g/255,x/255,C/255,1]}if(l.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(l)){let g=l.length<6?1:2,x=1;return[Cs(l.slice(x,x+=g)),Cs(l.slice(x,x+=g)),Cs(l.slice(x,x+=g)),Cs(l.slice(x,x+g)||"ff")]}if(l.startsWith("rgb")){let g=l.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(g){let[x,C,w,A,M,N,L,Z,X,ie,ne,ue]=g,se=[A||" ",L||" ",ie].join("");if(se===" "||se===" /"||se===",,"||se===",,,"){let me=[w,N,X].join(""),be=me==="%%%"?100:me===""?255:0;if(be){let Ce=[Es(+C/be,0,1),Es(+M/be,0,1),Es(+Z/be,0,1),ne?uh(+ne,ue):1];if(bl(Ce))return Ce}}return}}let m=l.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(m){let[g,x,C,w,A,M,N,L,Z]=m,X=[C||" ",A||" ",N].join("");if(X===" "||X===" /"||X===",,"||X===",,,"){let ie=[+x,Es(+w,0,100),Es(+M,0,100),L?uh(+L,Z):1];if(bl(ie))return(function([ne,ue,se,me]){function be(Ce){let We=(Ce+ne/30)%12,Je=ue*Math.min(se,1-se);return se-Je*Math.max(-1,Math.min(We-3,9-We,1))}return ne=lh(ne),ue/=100,se/=100,[be(0),be(8),be(4),me]})(ie)}}})(e);return i?new Yi(...i,!1):void 0}get rgb(){let{r:e,g:i,b:l,a:h}=this,m=h||1/0;return this.overwriteGetter("rgb",[e/m,i/m,l/m,h])}get hcl(){return this.overwriteGetter("hcl",(function(e){let[i,l,h,m]=Yh(e),g=Math.sqrt(l*l+h*h);return[Math.round(1e4*g)?lh(Math.atan2(h,l)*Mc):NaN,g,i,m]})(this.rgb))}get lab(){return this.overwriteGetter("lab",Yh(this.rgb))}overwriteGetter(e,i){return Object.defineProperty(this,e,{value:i}),i}toString(){let[e,i,l,h]=this.rgb;return`rgba(${[e,i,l].map((m=>Math.round(255*m))).join(",")},${h})`}static interpolate(e,i,l,h="rgb"){switch(h){case"rgb":{let[m,g,x,C]=wl(e.rgb,i.rgb,l);return new Yi(m,g,x,C,!1)}case"hcl":{let[m,g,x,C]=e.hcl,[w,A,M,N]=i.hcl,L,Z;if(isNaN(m)||isNaN(w))isNaN(m)?isNaN(w)?L=NaN:(L=w,x!==1&&x!==0||(Z=A)):(L=m,M!==1&&M!==0||(Z=g));else{let se=w-m;w>m&&se>180?se-=360:w<m&&m-w>180&&(se+=360),L=m+l*se}let[X,ie,ne,ue]=(function([se,me,be,Ce]){return se=isNaN(se)?0:se*Ec,Is([be,Math.cos(se)*me,Math.sin(se)*me,Ce])})([L,Z??ba(g,A,l),ba(x,M,l),ba(C,N,l)]);return new Yi(X,ie,ne,ue,!1)}case"lab":{let[m,g,x,C]=Is(wl(e.lab,i.lab,l));return new Yi(m,g,x,C,!1)}}}}Yi.black=new Yi(0,0,0,1),Yi.white=new Yi(1,1,1,1),Yi.transparent=new Yi(0,0,0,0),Yi.red=new Yi(1,0,0,1);class kc{constructor(e,i,l){this.sensitivity=e?i?"variant":"case":i?"accent":"base",this.locale=l,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,i){return this.collator.compare(e,i)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}let ph=["bottom","center","top"];class dh{constructor(e,i,l,h,m,g){this.text=e,this.image=i,this.scale=l,this.fontStack=h,this.textColor=m,this.verticalAlign=g}}class Fo{constructor(e){this.sections=e}static fromString(e){return new Fo([new dh(e,null,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 Fo?e:Fo.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map((e=>e.text)).join("")}}class so{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof so)return e;if(typeof e=="number")return new so([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let i of e)if(typeof i!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new so(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,l){return new so(wl(e.values,i.values,l))}}class Br{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Br)return e;if(typeof e=="number")return new Br([e]);if(Array.isArray(e)){for(let i of e)if(typeof i!="number")return;return new Br(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,l){return new Br(wl(e.values,i.values,l))}}class Ni{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ni)return e;if(typeof e=="string"){let l=Yi.parse(e);return l?new Ni([l]):void 0}if(!Array.isArray(e))return;let i=[];for(let l of e){if(typeof l!="string")return;let h=Yi.parse(l);if(!h)return;i.push(h)}return new Ni(i)}toString(){return JSON.stringify(this.values)}static interpolate(e,i,l,h="rgb"){let m=[];if(e.values.length!=i.values.length)throw new Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${i.values.length}), cannot interpolate.`);for(let g=0;g<e.values.length;g++)m.push(Yi.interpolate(e.values[g],i.values[g],l,h));return new Ni(m)}}class Cr extends Error{constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}}let cs=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Xi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Xi)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let i=0;i<e.length;i+=2){let l=e[i],h=e[i+1];if(typeof l!="string"||!cs.has(l)||!Array.isArray(h)||h.length!==2||typeof h[0]!="number"||typeof h[1]!="number")return}return new Xi(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,l){let h=e.values,m=i.values;if(h.length!==m.length)throw new Cr(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${i.toString()}`);let g=[];for(let x=0;x<h.length;x+=2){if(h[x]!==m[x])throw new Cr(`Cannot interpolate values containing mismatched anchors. from[${x}]: ${h[x]}, to[${x}]: ${m[x]}`);g.push(h[x]);let[C,w]=h[x+1],[A,M]=m[x+1];g.push([ba(C,A,l),ba(w,M,l)])}return new Xi(g)}}class Bo{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Bo({name:e,available:!1}):null}}class bo{constructor(e,i,l){this.from=e,this.to=i,this.transition=l}static interpolate(e,i,l){return new bo(e,i,l)}static parse(e){return e instanceof bo?e:Array.isArray(e)&&e.length===3&&typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="number"?new bo(e[0],e[1],e[2]):typeof e=="object"&&typeof e.from=="string"&&typeof e.to=="string"&&typeof e.transition=="number"?new bo(e.from,e.to,e.transition):typeof e=="string"?new bo(e,e,1):void 0}}function hs(r,e,i,l){return typeof r=="number"&&r>=0&&r<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof i=="number"&&i>=0&&i<=255?l===void 0||typeof l=="number"&&l>=0&&l<=1?null:`Invalid rgba value [${[r,e,i,l].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof l=="number"?[r,e,i,l]:[r,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function wa(r){if(r===null||typeof r=="string"||typeof r=="boolean"||typeof r=="number"||r instanceof bo||r instanceof Yi||r instanceof kc||r instanceof Fo||r instanceof so||r instanceof Br||r instanceof Ni||r instanceof Xi||r instanceof Bo)return!0;if(Array.isArray(r)){for(let e of r)if(!wa(e))return!1;return!0}if(typeof r=="object"){for(let e in r)if(!wa(r[e]))return!1;return!0}return!1}function en(r){if(r===null)return Ke;if(typeof r=="string")return ke;if(typeof r=="boolean")return Ge;if(typeof r=="number")return Te;if(r instanceof Yi)return pt;if(r instanceof bo)return zt;if(r instanceof kc)return gi;if(r instanceof Fo)return ei;if(r instanceof so)return zi;if(r instanceof Br)return rr;if(r instanceof Ni)return Ri;if(r instanceof Xi)return Hi;if(r instanceof Bo)return Vi;if(Array.isArray(r)){let e=r.length,i;for(let l of r){let h=en(l);if(i){if(i===h)continue;i=Lt;break}i=h}return qi(i||Lt,e)}return dt}function Vn(r){let e=typeof r;return r===null?"":e==="string"||e==="number"||e==="boolean"?String(r):r instanceof Yi||r instanceof bo||r instanceof Fo||r instanceof so||r instanceof Br||r instanceof Ni||r instanceof Xi||r instanceof Bo?r.toString():JSON.stringify(r)}class Ta{constructor(e,i){this.type=e,this.value=i}static parse(e,i){if(e.length!==2)return i.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!wa(e[1]))return i.error("invalid value");let l=e[1],h=en(l),m=i.expectedType;return h.kind!=="array"||h.N!==0||!m||m.kind!=="array"||typeof m.N=="number"&&m.N!==0||(h=m),new Ta(h,l)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}let Tl={string:ke,number:Te,boolean:Ge,object:dt};class to{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let l,h=1,m=e[0];if(m==="array"){let x,C;if(e.length>2){let w=e[1];if(typeof w!="string"||!(w in Tl)||w==="object")return i.error('The item type argument of "array" must be one of string, number, boolean',1);x=Tl[w],h++}else x=Lt;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return i.error('The length argument to "array" must be a positive integer literal',2);C=e[2],h++}l=qi(x,C)}else{if(!Tl[m])throw new Error(`Types doesn't contain name = ${m}`);l=Tl[m]}let g=[];for(;h<e.length;h++){let x=i.parse(e[h],h,Lt);if(!x)return null;g.push(x)}return new to(l,g)}evaluate(e){for(let i=0;i<this.args.length;i++){let l=this.args[i].evaluate(e);if(!Sr(this.type,en(l)))return l;if(i===this.args.length-1)throw new Cr(`Expected value to be of type ${Fi(this.type)}, but found ${Fi(en(l))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}let Ms={"to-boolean":Ge,"to-color":pt,"to-number":Te,"to-string":ke};class ja{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let l=e[0];if(!Ms[l])throw new Error(`Can't parse ${l} as it is not part of the known types`);if((l==="to-boolean"||l==="to-string")&&e.length!==2)return i.error("Expected one argument.");let h=Ms[l],m=[];for(let g=1;g<e.length;g++){let x=i.parse(e[g],g,Lt);if(!x)return null;m.push(x)}return new ja(h,m)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let i,l;for(let h of this.args){if(i=h.evaluate(e),l=null,i instanceof Yi)return i;if(typeof i=="string"){let m=e.parseColor(i);if(m)return m}else if(Array.isArray(i)&&(l=i.length<3||i.length>4?`Invalid rgba value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:hs(i[0],i[1],i[2],i[3]),!l))return new Yi(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new Cr(l||`Could not parse color from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"padding":{let i;for(let l of this.args){i=l.evaluate(e);let h=so.parse(i);if(h)return h}throw new Cr(`Could not parse padding from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"numberArray":{let i;for(let l of this.args){i=l.evaluate(e);let h=Br.parse(i);if(h)return h}throw new Cr(`Could not parse numberArray from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"colorArray":{let i;for(let l of this.args){i=l.evaluate(e);let h=Ni.parse(i);if(h)return h}throw new Cr(`Could not parse colorArray from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"variableAnchorOffsetCollection":{let i;for(let l of this.args){i=l.evaluate(e);let h=Xi.parse(i);if(h)return h}throw new Cr(`Could not parse variableAnchorOffsetCollection from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"number":{let i=null;for(let l of this.args){if(i=l.evaluate(e),i===null)return 0;let h=Number(i);if(!isNaN(h))return h}throw new Cr(`Could not convert ${JSON.stringify(i)} to number.`)}case"formatted":return Fo.fromString(Vn(this.args[0].evaluate(e)));case"resolvedImage":return Bo.fromString(Vn(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return Vn(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}let Ac=["Unknown","Point","LineString","Polygon"];class zc{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Ac[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let i=this._parseColorCache.get(e);return i||(i=Yi.parse(e),this._parseColorCache.set(e,i)),i}}class Ps{constructor(e,i,l=[],h,m=new $e,g=[]){this.registry=e,this.path=l,this.key=l.map((x=>`[${x}]`)).join(""),this.scope=m,this.errors=g,this.expectedType=h,this._isConstant=i}parse(e,i,l,h,m={}){return i?this.concat(i,l,h)._parse(e,m):this._parse(e,m)}_parse(e,i){function l(h,m,g){return g==="assert"?new to(m,[h]):g==="coerce"?new ja(m,[h]):h}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", []].');let h=e[0];if(typeof h!="string")return this.error(`Expression name must be a string, but found ${typeof h} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let m=this.registry[h];if(m){let g=m.parse(e,this);if(!g)return null;if(this.expectedType){let x=this.expectedType,C=g.type;if(x.kind!=="string"&&x.kind!=="number"&&x.kind!=="boolean"&&x.kind!=="object"&&x.kind!=="array"||C.kind!=="value"){if(x.kind==="projectionDefinition"&&["string","array"].includes(C.kind)||["color","formatted","resolvedImage"].includes(x.kind)&&["value","string"].includes(C.kind)||["padding","numberArray"].includes(x.kind)&&["value","number","array"].includes(C.kind)||x.kind==="colorArray"&&["value","string","array"].includes(C.kind)||x.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(C.kind))g=l(g,x,i.typeAnnotation||"coerce");else if(this.checkSubtype(x,C))return null}else g=l(g,x,i.typeAnnotation||"assert")}if(!(g instanceof Ta)&&g.type.kind!=="resolvedImage"&&this._isConstant(g)){let x=new zc;try{g=new Ta(g.type,g.evaluate(x))}catch(C){return this.error(C.message),null}}return g}return this.error(`Unknown expression "${h}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,i,l){let h=typeof e=="number"?this.path.concat(e):this.path,m=l?this.scope.concat(l):this.scope;return new Ps(this.registry,this._isConstant,h,i||null,m,this.errors)}error(e,...i){let l=`${this.key}${i.map((h=>`[${h}]`)).join("")}`;this.errors.push(new ve(l,e))}checkSubtype(e,i){let l=Sr(e,i);return l&&this.error(l),l}}class br{constructor(e,i){this.type=i.type,this.bindings=[].concat(e),this.result=i}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let i of this.bindings)e(i[1]);e(this.result)}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);let l=[];for(let m=1;m<e.length-1;m+=2){let g=e[m];if(typeof g!="string")return i.error(`Expected string, but found ${typeof g} instead.`,m);if(/[^a-zA-Z0-9_]/.test(g))return i.error("Variable names must contain only alphanumeric characters or '_'.",m);let x=i.parse(e[m+1],m+1);if(!x)return null;l.push([g,x])}let h=i.parse(e[e.length-1],e.length-1,i.expectedType,l);return h?new br(l,h):null}outputDefined(){return this.result.outputDefined()}}class Sl{constructor(e,i){this.type=i.type,this.name=e,this.boundExpression=i}static parse(e,i){if(e.length!==2||typeof e[1]!="string")return i.error("'var' expression requires exactly one string literal argument.");let l=e[1];return i.scope.has(l)?new Sl(l,i.scope.get(l)):i.error(`Unknown variable "${l}". Make sure "${l}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class ar{constructor(e,i,l){this.type=e,this.index=i,this.input=l}static parse(e,i){if(e.length!==3)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let l=i.parse(e[1],1,Te),h=i.parse(e[2],2,qi(i.expectedType||Lt));return l&&h?new ar(h.type.itemType,l,h):null}evaluate(e){let i=this.index.evaluate(e),l=this.input.evaluate(e);if(i<0)throw new Cr(`Array index out of bounds: ${i} < 0.`);if(i>=l.length)throw new Cr(`Array index out of bounds: ${i} > ${l.length-1}.`);if(i!==Math.floor(i))throw new Cr(`Array index must be an integer, but found ${i} instead.`);return l[i]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class Zi{constructor(e,i){this.type=Ge,this.needle=e,this.haystack=i}static parse(e,i){if(e.length!==3)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let l=i.parse(e[1],1,Lt),h=i.parse(e[2],2,Lt);return l&&h?En(l.type,[Ge,ke,Te,Ke,Lt])?new Zi(l,h):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Fi(l.type)} instead`):null}evaluate(e){let i=this.needle.evaluate(e),l=this.haystack.evaluate(e);if(!l)return!1;if(!va(i,["boolean","string","number","null"]))throw new Cr(`Expected first argument to be of type boolean, string, number or null, but found ${Fi(en(i))} instead.`);if(!va(l,["string","array"]))throw new Cr(`Expected second argument to be of type array or string, but found ${Fi(en(l))} instead.`);return l.indexOf(i)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class tc{constructor(e,i,l){this.type=Te,this.needle=e,this.haystack=i,this.fromIndex=l}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let l=i.parse(e[1],1,Lt),h=i.parse(e[2],2,Lt);if(!l||!h)return null;if(!En(l.type,[Ge,ke,Te,Ke,Lt]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Fi(l.type)} instead`);if(e.length===4){let m=i.parse(e[3],3,Te);return m?new tc(l,h,m):null}return new tc(l,h)}evaluate(e){let i=this.needle.evaluate(e),l=this.haystack.evaluate(e);if(!va(i,["boolean","string","number","null"]))throw new Cr(`Expected first argument to be of type boolean, string, number or null, but found ${Fi(en(i))} instead.`);let h;if(this.fromIndex&&(h=this.fromIndex.evaluate(e)),va(l,["string"])){let m=l.indexOf(i,h);return m===-1?-1:[...l.slice(0,m)].length}if(va(l,["array"]))return l.indexOf(i,h);throw new Cr(`Expected second argument to be of type array or string, but found ${Fi(en(l))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class hr{constructor(e,i,l,h,m,g){this.inputType=e,this.type=i,this.input=l,this.cases=h,this.outputs=m,this.otherwise=g}static parse(e,i){if(e.length<5)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return i.error("Expected an even number of arguments.");let l,h;i.expectedType&&i.expectedType.kind!=="value"&&(h=i.expectedType);let m={},g=[];for(let w=2;w<e.length-1;w+=2){let A=e[w],M=e[w+1];Array.isArray(A)||(A=[A]);let N=i.concat(w);if(A.length===0)return N.error("Expected at least one branch label.");for(let Z of A){if(typeof Z!="number"&&typeof Z!="string")return N.error("Branch labels must be numbers or strings.");if(typeof Z=="number"&&Math.abs(Z)>Number.MAX_SAFE_INTEGER)return N.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof Z=="number"&&Math.floor(Z)!==Z)return N.error("Numeric branch labels must be integer values.");if(l){if(N.checkSubtype(l,en(Z)))return null}else l=en(Z);if(m[String(Z)]!==void 0)return N.error("Branch labels must be unique.");m[String(Z)]=g.length}let L=i.parse(M,w,h);if(!L)return null;h=h||L.type,g.push(L)}let x=i.parse(e[1],1,Lt);if(!x)return null;let C=i.parse(e[e.length-1],e.length-1,h);return C?x.type.kind!=="value"&&i.concat(1).checkSubtype(l,x.type)?null:new hr(l,h,x,m,g,C):null}evaluate(e){let i=this.input.evaluate(e);return(en(i)===this.inputType&&this.outputs[this.cases[i]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}}class qa{constructor(e,i,l){this.type=e,this.branches=i,this.otherwise=l}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return i.error("Expected an odd number of arguments.");let l;i.expectedType&&i.expectedType.kind!=="value"&&(l=i.expectedType);let h=[];for(let g=1;g<e.length-1;g+=2){let x=i.parse(e[g],g,Ge);if(!x)return null;let C=i.parse(e[g+1],g+1,l);if(!C)return null;h.push([x,C]),l=l||C.type}let m=i.parse(e[e.length-1],e.length-1,l);if(!m)return null;if(!l)throw new Error("Can't infer output type");return new qa(l,h,m)}evaluate(e){for(let[i,l]of this.branches)if(i.evaluate(e))return l.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[i,l]of this.branches)e(i),e(l);e(this.otherwise)}outputDefined(){return this.branches.every((([e,i])=>i.outputDefined()))&&this.otherwise.outputDefined()}}class ic{constructor(e,i,l,h){this.type=e,this.input=i,this.beginIndex=l,this.endIndex=h}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let l=i.parse(e[1],1,Lt),h=i.parse(e[2],2,Te);if(!l||!h)return null;if(!En(l.type,[qi(Lt),ke,Lt]))return i.error(`Expected first argument to be of type array or string, but found ${Fi(l.type)} instead`);if(e.length===4){let m=i.parse(e[3],3,Te);return m?new ic(l.type,l,h,m):null}return new ic(l.type,l,h)}evaluate(e){let i=this.input.evaluate(e),l=this.beginIndex.evaluate(e),h;if(this.endIndex&&(h=this.endIndex.evaluate(e)),va(i,["string"]))return[...i].slice(l,h).join("");if(va(i,["array"]))return i.slice(l,h);throw new Cr(`Expected first argument to be of type array or string, but found ${Fi(en(i))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function Il(r,e){let i=r.length-1,l,h,m=0,g=i,x=0;for(;m<=g;)if(x=Math.floor((m+g)/2),l=r[x],h=r[x+1],l<=e){if(x===i||e<h)return x;m=x+1}else{if(!(l>e))throw new Cr("Input is not a number.");g=x-1}return 0}class rc{constructor(e,i,l){this.type=e,this.input=i,this.labels=[],this.outputs=[];for(let[h,m]of l)this.labels.push(h),this.outputs.push(m)}static parse(e,i){if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");let l=i.parse(e[1],1,Te);if(!l)return null;let h=[],m=null;i.expectedType&&i.expectedType.kind!=="value"&&(m=i.expectedType);for(let g=1;g<e.length;g+=2){let x=g===1?-1/0:e[g],C=e[g+1],w=g,A=g+1;if(typeof x!="number")return i.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',w);if(h.length&&h[h.length-1][0]>=x)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',w);let M=i.parse(C,A,m);if(!M)return null;m=m||M.type,h.push([x,M])}return new rc(m,l,h)}evaluate(e){let i=this.labels,l=this.outputs;if(i.length===1)return l[0].evaluate(e);let h=this.input.evaluate(e);if(h<=i[0])return l[0].evaluate(e);let m=i.length;return h>=i[m-1]?l[m-1].evaluate(e):l[Il(i,h)].evaluate(e)}eachChild(e){e(this.input);for(let i of this.outputs)e(i)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function Dc(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Cl,mh,fh=(function(){if(mh)return Cl;function r(e,i,l,h){this.cx=3*e,this.bx=3*(l-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(h-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=i,this.p2x=l,this.p2y=h}return mh=1,Cl=r,r.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,i){if(i===void 0&&(i=1e-6),e<0)return 0;if(e>1)return 1;for(var l=e,h=0;h<8;h++){var m=this.sampleCurveX(l)-e;if(Math.abs(m)<i)return l;var g=this.sampleCurveDerivativeX(l);if(Math.abs(g)<1e-6)break;l-=m/g}var x=0,C=1;for(l=e,h=0;h<20&&(m=this.sampleCurveX(l),!(Math.abs(m-e)<i));h++)e>m?x=l:C=l,l=.5*(C-x)+x;return l},solve:function(e,i){return this.sampleCurveY(this.solveCurveX(e,i))}},Cl})(),El=Dc(fh);class ln{constructor(e,i,l,h,m){this.type=e,this.operator=i,this.interpolation=l,this.input=h,this.labels=[],this.outputs=[];for(let[g,x]of m)this.labels.push(g),this.outputs.push(x)}static interpolationFactor(e,i,l,h){let m=0;if(e.name==="exponential")m=Nn(i,e.base,l,h);else if(e.name==="linear")m=Nn(i,1,l,h);else if(e.name==="cubic-bezier"){let g=e.controlPoints;m=new El(g[0],g[1],g[2],g[3]).solve(Nn(i,1,l,h))}return m}static parse(e,i){let[l,h,m,...g]=e;if(!Array.isArray(h)||h.length===0)return i.error("Expected an interpolation type expression.",1);if(h[0]==="linear")h={name:"linear"};else if(h[0]==="exponential"){let w=h[1];if(typeof w!="number")return i.error("Exponential interpolation requires a numeric base.",1,1);h={name:"exponential",base:w}}else{if(h[0]!=="cubic-bezier")return i.error(`Unknown interpolation type ${String(h[0])}`,1,0);{let w=h.slice(1);if(w.length!==4||w.some((A=>typeof A!="number"||A<0||A>1)))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);h={name:"cubic-bezier",controlPoints:w}}}if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(m=i.parse(m,2,Te),!m)return null;let x=[],C=null;l!=="interpolate-hcl"&&l!=="interpolate-lab"||i.expectedType==Ri?i.expectedType&&i.expectedType.kind!=="value"&&(C=i.expectedType):C=pt;for(let w=0;w<g.length;w+=2){let A=g[w],M=g[w+1],N=w+3,L=w+4;if(typeof A!="number")return i.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',N);if(x.length&&x[x.length-1][0]>=A)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',N);let Z=i.parse(M,L,C);if(!Z)return null;C=C||Z.type,x.push([A,Z])}return vo(C,Te)||vo(C,zt)||vo(C,pt)||vo(C,zi)||vo(C,rr)||vo(C,Ri)||vo(C,Hi)||vo(C,qi(Te))?new ln(C,l,h,m,x):i.error(`Type ${Fi(C)} is not interpolatable.`)}evaluate(e){let i=this.labels,l=this.outputs;if(i.length===1)return l[0].evaluate(e);let h=this.input.evaluate(e);if(h<=i[0])return l[0].evaluate(e);let m=i.length;if(h>=i[m-1])return l[m-1].evaluate(e);let g=Il(i,h),x=ln.interpolationFactor(this.interpolation,h,i[g],i[g+1]),C=l[g].evaluate(e),w=l[g+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return ba(C,w,x);case"color":return Yi.interpolate(C,w,x);case"padding":return so.interpolate(C,w,x);case"colorArray":return Ni.interpolate(C,w,x);case"numberArray":return Br.interpolate(C,w,x);case"variableAnchorOffsetCollection":return Xi.interpolate(C,w,x);case"array":return wl(C,w,x);case"projectionDefinition":return bo.interpolate(C,w,x)}case"interpolate-hcl":switch(this.type.kind){case"color":return Yi.interpolate(C,w,x,"hcl");case"colorArray":return Ni.interpolate(C,w,x,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return Yi.interpolate(C,w,x,"lab");case"colorArray":return Ni.interpolate(C,w,x,"lab")}}}eachChild(e){e(this.input);for(let i of this.outputs)e(i)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function Nn(r,e,i,l){let h=l-i,m=r-i;return h===0?0:e===1?m/h:(Math.pow(e,m)-1)/(Math.pow(e,h)-1)}let lo={color:Yi.interpolate,number:ba,padding:so.interpolate,numberArray:Br.interpolate,colorArray:Ni.interpolate,variableAnchorOffsetCollection:Xi.interpolate,array:wl};class $a{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let l=null,h=i.expectedType;h&&h.kind!=="value"&&(l=h);let m=[];for(let x of e.slice(1)){let C=i.parse(x,1+m.length,l,void 0,{typeAnnotation:"omit"});if(!C)return null;l=l||C.type,m.push(C)}if(!l)throw new Error("No output type");let g=h&&m.some((x=>Sr(h,x.type)));return new $a(g?Lt:l,m)}evaluate(e){let i,l=null,h=0;for(let m of this.args)if(h++,l=m.evaluate(e),l&&l instanceof Bo&&!l.available&&(i||(i=l.name),l=null,h===this.args.length&&(l=i)),l!==null)break;return l}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}function nc(r,e){return r==="=="||r==="!="?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 Hr(r,e,i,l){return l.compare(e,i)===0}function yr(r,e,i){let l=r!=="=="&&r!=="!=";return class gb{constructor(m,g,x){this.type=Ge,this.lhs=m,this.rhs=g,this.collator=x,this.hasUntypedArgument=m.type.kind==="value"||g.type.kind==="value"}static parse(m,g){if(m.length!==3&&m.length!==4)return g.error("Expected two or three arguments.");let x=m[0],C=g.parse(m[1],1,Lt);if(!C)return null;if(!nc(x,C.type))return g.concat(1).error(`"${x}" comparisons are not supported for type '${Fi(C.type)}'.`);let w=g.parse(m[2],2,Lt);if(!w)return null;if(!nc(x,w.type))return g.concat(2).error(`"${x}" comparisons are not supported for type '${Fi(w.type)}'.`);if(C.type.kind!==w.type.kind&&C.type.kind!=="value"&&w.type.kind!=="value")return g.error(`Cannot compare types '${Fi(C.type)}' and '${Fi(w.type)}'.`);l&&(C.type.kind==="value"&&w.type.kind!=="value"?C=new to(w.type,[C]):C.type.kind!=="value"&&w.type.kind==="value"&&(w=new to(C.type,[w])));let A=null;if(m.length===4){if(C.type.kind!=="string"&&w.type.kind!=="string"&&C.type.kind!=="value"&&w.type.kind!=="value")return g.error("Cannot use collator to compare non-string types.");if(A=g.parse(m[3],3,gi),!A)return null}return new gb(C,w,A)}evaluate(m){let g=this.lhs.evaluate(m),x=this.rhs.evaluate(m);if(l&&this.hasUntypedArgument){let C=en(g),w=en(x);if(C.kind!==w.kind||C.kind!=="string"&&C.kind!=="number")throw new Cr(`Expected arguments for "${r}" to be (string, string) or (number, number), but found (${C.kind}, ${w.kind}) instead.`)}if(this.collator&&!l&&this.hasUntypedArgument){let C=en(g),w=en(x);if(C.kind!=="string"||w.kind!=="string")return e(m,g,x)}return this.collator?i(m,g,x,this.collator.evaluate(m)):e(m,g,x)}eachChild(m){m(this.lhs),m(this.rhs),this.collator&&m(this.collator)}outputDefined(){return!0}}}let gh=yr("==",(function(r,e,i){return e===i}),Hr),nr=yr("!=",(function(r,e,i){return e!==i}),(function(r,e,i,l){return!Hr(0,e,i,l)})),gr=yr("<",(function(r,e,i){return e<i}),(function(r,e,i,l){return l.compare(e,i)<0})),xr=yr(">",(function(r,e,i){return e>i}),(function(r,e,i,l){return l.compare(e,i)>0})),zr=yr("<=",(function(r,e,i){return e<=i}),(function(r,e,i,l){return l.compare(e,i)<=0})),Ml=yr(">=",(function(r,e,i){return e>=i}),(function(r,e,i,l){return l.compare(e,i)>=0}));class ks{constructor(e,i,l){this.type=gi,this.locale=l,this.caseSensitive=e,this.diacriticSensitive=i}static parse(e,i){if(e.length!==2)return i.error("Expected one argument.");let l=e[1];if(typeof l!="object"||Array.isArray(l))return i.error("Collator options argument must be an object.");let h=i.parse(l["case-sensitive"]!==void 0&&l["case-sensitive"],1,Ge);if(!h)return null;let m=i.parse(l["diacritic-sensitive"]!==void 0&&l["diacritic-sensitive"],1,Ge);if(!m)return null;let g=null;return l.locale&&(g=i.parse(l.locale,1,ke),!g)?null:new ks(h,m,g)}evaluate(e){return new kc(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}}class _h{constructor(e,i,l,h,m,g){this.type=ke,this.number=e,this.locale=i,this.currency=l,this.unit=h,this.minFractionDigits=m,this.maxFractionDigits=g}static parse(e,i){if(e.length!==3)return i.error("Expected two arguments.");let l=i.parse(e[1],1,Te);if(!l)return null;let h=e[2];if(typeof h!="object"||Array.isArray(h))return i.error("NumberFormat options argument must be an object.");let m=null;if(h.locale&&(m=i.parse(h.locale,1,ke),!m))return null;let g=null;if(h.currency&&(g=i.parse(h.currency,1,ke),!g))return null;let x=null;if(h.unit&&(x=i.parse(h.unit,1,ke),!x))return null;if(g&&x)return i.error("NumberFormat options `currency` and `unit` are mutually exclusive");let C=null;if(h["min-fraction-digits"]&&(C=i.parse(h["min-fraction-digits"],1,Te),!C))return null;let w=null;return h["max-fraction-digits"]&&(w=i.parse(h["max-fraction-digits"],1,Te),!w)?null:new _h(l,m,g,x,C,w)}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}}class Pl{constructor(e){this.type=ei,this.sections=e}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let l=e[1];if(!Array.isArray(l)&&typeof l=="object")return i.error("First argument must be an image or text section.");let h=[],m=!1;for(let g=1;g<=e.length-1;++g){let x=e[g];if(m&&typeof x=="object"&&!Array.isArray(x)){m=!1;let C=null;if(x["font-scale"]&&(C=i.parse(x["font-scale"],1,Te),!C))return null;let w=null;if(x["text-font"]&&(w=i.parse(x["text-font"],1,qi(ke)),!w))return null;let A=null;if(x["text-color"]&&(A=i.parse(x["text-color"],1,pt),!A))return null;let M=null;if(x["vertical-align"]){if(typeof x["vertical-align"]=="string"&&!ph.includes(x["vertical-align"]))return i.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${x["vertical-align"]}' instead.`);if(M=i.parse(x["vertical-align"],1,ke),!M)return null}let N=h[h.length-1];N.scale=C,N.font=w,N.textColor=A,N.verticalAlign=M}else{let C=i.parse(e[g],1,Lt);if(!C)return null;let w=C.type.kind;if(w!=="string"&&w!=="value"&&w!=="null"&&w!=="resolvedImage")return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");m=!0,h.push({content:C,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Pl(h)}evaluate(e){return new Fo(this.sections.map((i=>{let l=i.content.evaluate(e);return en(l)===Vi?new dh("",l,null,null,null,i.verticalAlign?i.verticalAlign.evaluate(e):null):new dh(Vn(l),null,i.scale?i.scale.evaluate(e):null,i.font?i.font.evaluate(e).join(","):null,i.textColor?i.textColor.evaluate(e):null,i.verticalAlign?i.verticalAlign.evaluate(e):null)})))}eachChild(e){for(let i of this.sections)e(i.content),i.scale&&e(i.scale),i.font&&e(i.font),i.textColor&&e(i.textColor),i.verticalAlign&&e(i.verticalAlign)}outputDefined(){return!1}}class kl{constructor(e){this.type=Vi,this.input=e}static parse(e,i){if(e.length!==2)return i.error("Expected two arguments.");let l=i.parse(e[1],1,ke);return l?new kl(l):i.error("No image name provided.")}evaluate(e){let i=this.input.evaluate(e),l=Bo.fromString(i);return l&&e.availableImages&&(l.available=e.availableImages.indexOf(i)>-1),l}eachChild(e){e(this.input)}outputDefined(){return!1}}class ia{constructor(e){this.type=Te,this.input=e}static parse(e,i){if(e.length!==2)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);let l=i.parse(e[1],1);return l?l.type.kind!=="array"&&l.type.kind!=="string"&&l.type.kind!=="value"?i.error(`Expected argument of type string or array, but found ${Fi(l.type)} instead.`):new ia(l):null}evaluate(e){let i=this.input.evaluate(e);if(typeof i=="string")return[...i].length;if(Array.isArray(i))return i.length;throw new Cr(`Expected value to be of type string or array, but found ${Fi(en(i))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}let Oo=8192;function Qs(r,e){let i=(180+r[0])/360,l=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r[1]*Math.PI/360)))/360,h=Math.pow(2,e.z);return[Math.round(i*h*Oo),Math.round(l*h*Oo)]}function Al(r,e){let i=Math.pow(2,e.z);return[(h=(r[0]/Oo+e.x)/i,360*h-180),(l=(r[1]/Oo+e.y)/i,360/Math.PI*Math.atan(Math.exp((180-360*l)*Math.PI/180))-90)];var l,h}function Ga(r,e){r[0]=Math.min(r[0],e[0]),r[1]=Math.min(r[1],e[1]),r[2]=Math.max(r[2],e[0]),r[3]=Math.max(r[3],e[1])}function zl(r,e){return!(r[0]<=e[0]||r[2]>=e[2]||r[1]<=e[1]||r[3]>=e[3])}function Su(r,e,i){let l=r[0]-e[0],h=r[1]-e[1],m=r[0]-i[0],g=r[1]-i[1];return l*g-m*h==0&&l*m<=0&&h*g<=0}function Dl(r,e,i,l){return(h=[l[0]-i[0],l[1]-i[1]])[0]*(m=[e[0]-r[0],e[1]-r[1]])[1]-h[1]*m[0]!=0&&!(!el(r,e,i,l)||!el(i,l,r,e));var h,m}function yh(r,e,i){for(let l of i)for(let h=0;h<l.length-1;++h)if(Dl(r,e,l[h],l[h+1]))return!0;return!1}function Un(r,e,i=!1){let l=!1;for(let x of e)for(let C=0;C<x.length-1;C++){if(Su(r,x[C],x[C+1]))return i;(m=x[C])[1]>(h=r)[1]!=(g=x[C+1])[1]>h[1]&&h[0]<(g[0]-m[0])*(h[1]-m[1])/(g[1]-m[1])+m[0]&&(l=!l)}var h,m,g;return l}function Iu(r,e){for(let i of e)if(Un(r,i))return!0;return!1}function Lc(r,e){for(let i of r)if(!Un(i,e))return!1;for(let i=0;i<r.length-1;++i)if(yh(r[i],r[i+1],e))return!1;return!0}function Jh(r,e){for(let i of e)if(Lc(r,i))return!0;return!1}function el(r,e,i,l){let h=l[0]-i[0],m=l[1]-i[1],g=(r[0]-i[0])*m-h*(r[1]-i[1]),x=(e[0]-i[0])*m-h*(e[1]-i[1]);return g>0&&x<0||g<0&&x>0}function tl(r,e,i){let l=[];for(let h=0;h<r.length;h++){let m=[];for(let g=0;g<r[h].length;g++){let x=Qs(r[h][g],i);Ga(e,x),m.push(x)}l.push(m)}return l}function Ll(r,e,i){let l=[];for(let h=0;h<r.length;h++){let m=tl(r[h],e,i);l.push(m)}return l}function Cu(r,e,i,l){if(r[0]<i[0]||r[0]>i[2]){let h=.5*l,m=r[0]-i[0]>h?-l:i[0]-r[0]>h?l:0;m===0&&(m=r[0]-i[2]>h?-l:i[2]-r[0]>h?l:0),r[0]+=m}Ga(e,r)}function Rc(r,e,i,l){let h=Math.pow(2,l.z)*Oo,m=[l.x*Oo,l.y*Oo],g=[];for(let x of r)for(let C of x){let w=[C.x+m[0],C.y+m[1]];Cu(w,e,i,h),g.push(w)}return g}function Qh(r,e,i,l){let h=Math.pow(2,l.z)*Oo,m=[l.x*Oo,l.y*Oo],g=[];for(let C of r){let w=[];for(let A of C){let M=[A.x+m[0],A.y+m[1]];Ga(e,M),w.push(M)}g.push(w)}if(e[2]-e[0]<=h/2){(x=e)[0]=x[1]=1/0,x[2]=x[3]=-1/0;for(let C of g)for(let w of C)Cu(w,e,i,h)}var x;return g}class il{constructor(e,i){this.type=Ge,this.geojson=e,this.geometries=i}static parse(e,i){if(e.length!==2)return i.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(wa(e[1])){let l=e[1];if(l.type==="FeatureCollection"){let h=[];for(let m of l.features){let{type:g,coordinates:x}=m.geometry;g==="Polygon"&&h.push(x),g==="MultiPolygon"&&h.push(...x)}if(h.length)return new il(l,{type:"MultiPolygon",coordinates:h})}else if(l.type==="Feature"){let h=l.geometry.type;if(h==="Polygon"||h==="MultiPolygon")return new il(l,l.geometry)}else if(l.type==="Polygon"||l.type==="MultiPolygon")return new il(l,l)}return i.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return(function(i,l){let h=[1/0,1/0,-1/0,-1/0],m=[1/0,1/0,-1/0,-1/0],g=i.canonicalID();if(l.type==="Polygon"){let x=tl(l.coordinates,m,g),C=Rc(i.geometry(),h,m,g);if(!zl(h,m))return!1;for(let w of C)if(!Un(w,x))return!1}if(l.type==="MultiPolygon"){let x=Ll(l.coordinates,m,g),C=Rc(i.geometry(),h,m,g);if(!zl(h,m))return!1;for(let w of C)if(!Iu(w,x))return!1}return!0})(e,this.geometries);if(e.geometryType()==="LineString")return(function(i,l){let h=[1/0,1/0,-1/0,-1/0],m=[1/0,1/0,-1/0,-1/0],g=i.canonicalID();if(l.type==="Polygon"){let x=tl(l.coordinates,m,g),C=Qh(i.geometry(),h,m,g);if(!zl(h,m))return!1;for(let w of C)if(!Lc(w,x))return!1}if(l.type==="MultiPolygon"){let x=Ll(l.coordinates,m,g),C=Qh(i.geometry(),h,m,g);if(!zl(h,m))return!1;for(let w of C)if(!Jh(w,x))return!1}return!0})(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Rl=class{constructor(r=[],e=(i,l)=>i<l?-1:i>l?1:0){if(this.data=r,this.length=this.data.length,this.compare=e,this.length>0)for(let i=(this.length>>1)-1;i>=0;i--)this._down(i)}push(r){this.data.push(r),this._up(this.length++)}pop(){if(this.length===0)return;let r=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),r}peek(){return this.data[0]}_up(r){let{data:e,compare:i}=this,l=e[r];for(;r>0;){let h=r-1>>1,m=e[h];if(i(l,m)>=0)break;e[r]=m,r=h}e[r]=l}_down(r){let{data:e,compare:i}=this,l=this.length>>1,h=e[r];for(;r<l;){let m=1+(r<<1),g=m+1;if(g<this.length&&i(e[g],e[m])<0&&(m=g),i(e[m],h)>=0)break;e[r]=e[m],r=m}e[r]=h}};function Fc(r,e,i=0,l=r.length-1,h=Bc){for(;l>i;){if(l-i>600){let C=l-i+1,w=e-i+1,A=Math.log(C),M=.5*Math.exp(2*A/3),N=.5*Math.sqrt(A*M*(C-M)/C)*(w-C/2<0?-1:1);Fc(r,e,Math.max(i,Math.floor(e-w*M/C+N)),Math.min(l,Math.floor(e+(C-w)*M/C+N)),h)}let m=r[e],g=i,x=l;for(As(r,i,e),h(r[l],m)>0&&As(r,i,l);g<x;){for(As(r,g,x),g++,x--;h(r[g],m)<0;)g++;for(;h(r[x],m)>0;)x--}h(r[i],m)===0?As(r,i,x):(x++,As(r,x,l)),x<=e&&(i=x+1),e<=x&&(l=x-1)}}function As(r,e,i){let l=r[e];r[e]=r[i],r[i]=l}function Bc(r,e){return r<e?-1:r>e?1:0}function zs(r,e){if(r.length<=1)return[r];let i=[],l,h;for(let m of r){let g=Eu(m);g!==0&&(m.area=Math.abs(g),h===void 0&&(h=g<0),h===g<0?(l&&i.push(l),l=[m]):l.push(m))}if(l&&i.push(l),e>1)for(let m=0;m<i.length;m++)i[m].length<=e||(Fc(i[m],e,1,i[m].length-1,Oc),i[m]=i[m].slice(0,e));return i}function Oc(r,e){return e.area-r.area}function Eu(r){let e=0;for(let i,l,h=0,m=r.length,g=m-1;h<m;g=h++)i=r[h],l=r[g],e+=(l.x-i.x)*(i.y+l.y);return e}let Ds=1/298.257223563,eu=Ds*(2-Ds),tu=Math.PI/180;class xh{constructor(e){let i=6378.137*tu*1e3,l=Math.cos(e*tu),h=1/(1-eu*(1-l*l)),m=Math.sqrt(h);this.kx=i*m*l,this.ky=i*m*h*(1-eu)}distance(e,i){let l=this.wrap(e[0]-i[0])*this.kx,h=(e[1]-i[1])*this.ky;return Math.sqrt(l*l+h*h)}pointOnLine(e,i){let l,h,m,g,x=1/0;for(let C=0;C<e.length-1;C++){let w=e[C][0],A=e[C][1],M=this.wrap(e[C+1][0]-w)*this.kx,N=(e[C+1][1]-A)*this.ky,L=0;M===0&&N===0||(L=(this.wrap(i[0]-w)*this.kx*M+(i[1]-A)*this.ky*N)/(M*M+N*N),L>1?(w=e[C+1][0],A=e[C+1][1]):L>0&&(w+=M/this.kx*L,A+=N/this.ky*L)),M=this.wrap(i[0]-w)*this.kx,N=(i[1]-A)*this.ky;let Z=M*M+N*N;Z<x&&(x=Z,l=w,h=A,m=C,g=L)}return{point:[l,h],index:m,t:Math.max(0,Math.min(1,g))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}function Fl(r,e){return e[0]-r[0]}function Bl(r){return r[1]-r[0]+1}function Vo(r,e){return r[1]>=r[0]&&r[1]<e}function Ol(r,e){if(r[0]>r[1])return[null,null];let i=Bl(r);if(e){if(i===2)return[r,null];let h=Math.floor(i/2);return[[r[0],r[0]+h],[r[0]+h,r[1]]]}if(i===1)return[r,null];let l=Math.floor(i/2)-1;return[[r[0],r[0]+l],[r[0]+l+1,r[1]]]}function wo(r,e){if(!Vo(e,r.length))return[1/0,1/0,-1/0,-1/0];let i=[1/0,1/0,-1/0,-1/0];for(let l=e[0];l<=e[1];++l)Ga(i,r[l]);return i}function rl(r){let e=[1/0,1/0,-1/0,-1/0];for(let i of r)for(let l of i)Ga(e,l);return e}function To(r){return r[0]!==-1/0&&r[1]!==-1/0&&r[2]!==1/0&&r[3]!==1/0}function iu(r,e,i){if(!To(r)||!To(e))return NaN;let l=0,h=0;return r[2]<e[0]&&(l=e[0]-r[2]),r[0]>e[2]&&(l=r[0]-e[2]),r[1]>e[3]&&(h=r[1]-e[3]),r[3]<e[1]&&(h=e[1]-r[3]),i.distance([0,0],[l,h])}function No(r,e,i){let l=i.pointOnLine(e,r);return i.distance(r,l.point)}function vh(r,e,i,l,h){let m=Math.min(No(r,[i,l],h),No(e,[i,l],h)),g=Math.min(No(i,[r,e],h),No(l,[r,e],h));return Math.min(m,g)}function us(r,e,i,l,h){if(!Vo(e,r.length)||!Vo(l,i.length))return 1/0;let m=1/0;for(let g=e[0];g<e[1];++g){let x=r[g],C=r[g+1];for(let w=l[0];w<l[1];++w){let A=i[w],M=i[w+1];if(Dl(x,C,A,M))return 0;m=Math.min(m,vh(x,C,A,M,h))}}return m}function Vc(r,e,i,l,h){if(!Vo(e,r.length)||!Vo(l,i.length))return NaN;let m=1/0;for(let g=e[0];g<=e[1];++g)for(let x=l[0];x<=l[1];++x)if(m=Math.min(m,h.distance(r[g],i[x])),m===0)return m;return m}function ru(r,e,i){if(Un(r,e,!0))return 0;let l=1/0;for(let h of e){let m=h[0],g=h[h.length-1];if(m!==g&&(l=Math.min(l,No(r,[g,m],i)),l===0))return l;let x=i.pointOnLine(h,r);if(l=Math.min(l,i.distance(r,x.point)),l===0)return l}return l}function Ip(r,e,i,l){if(!Vo(e,r.length))return NaN;for(let m=e[0];m<=e[1];++m)if(Un(r[m],i,!0))return 0;let h=1/0;for(let m=e[0];m<e[1];++m){let g=r[m],x=r[m+1];for(let C of i)for(let w=0,A=C.length,M=A-1;w<A;M=w++){let N=C[M],L=C[w];if(Dl(g,x,N,L))return 0;h=Math.min(h,vh(g,x,N,L,l))}}return h}function Mu(r,e){for(let i of r)for(let l of i)if(Un(l,e,!0))return!0;return!1}function dr(r,e,i,l=1/0){let h=rl(r),m=rl(e);if(l!==1/0&&iu(h,m,i)>=l)return l;if(zl(h,m)){if(Mu(r,e))return 0}else if(Mu(e,r))return 0;let g=1/0;for(let x of r)for(let C=0,w=x.length,A=w-1;C<w;A=C++){let M=x[A],N=x[C];for(let L of e)for(let Z=0,X=L.length,ie=X-1;Z<X;ie=Z++){let ne=L[ie],ue=L[Z];if(Dl(M,N,ne,ue))return 0;g=Math.min(g,vh(M,N,ne,ue,i))}}return g}function oc(r,e,i,l,h,m){if(!m)return;let g=iu(wo(l,m),h,i);g<e&&r.push([g,m,[0,0]])}function Sa(r,e,i,l,h,m,g){if(!m||!g)return;let x=iu(wo(l,m),wo(h,g),i);x<e&&r.push([x,m,g])}function ui(r,e,i,l,h=1/0){let m=Math.min(l.distance(r[0],i[0][0]),h);if(m===0)return m;let g=new Rl([[0,[0,r.length-1],[0,0]]],Fl),x=rl(i);for(;g.length>0;){let C=g.pop();if(C[0]>=m)continue;let w=C[1],A=e?50:100;if(Bl(w)<=A){if(!Vo(w,r.length))return NaN;if(e){let M=Ip(r,w,i,l);if(isNaN(M)||M===0)return M;m=Math.min(m,M)}else for(let M=w[0];M<=w[1];++M){let N=ru(r[M],i,l);if(m=Math.min(m,N),m===0)return 0}}else{let M=Ol(w,e);oc(g,m,l,r,x,M[0]),oc(g,m,l,r,x,M[1])}}return m}function Nc(r,e,i,l,h,m=1/0){let g=Math.min(m,h.distance(r[0],i[0]));if(g===0)return g;let x=new Rl([[0,[0,r.length-1],[0,i.length-1]]],Fl);for(;x.length>0;){let C=x.pop();if(C[0]>=g)continue;let w=C[1],A=C[2],M=e?50:100,N=l?50:100;if(Bl(w)<=M&&Bl(A)<=N){if(!Vo(w,r.length)&&Vo(A,i.length))return NaN;let L;if(e&&l)L=us(r,w,i,A,h),g=Math.min(g,L);else if(e&&!l){let Z=r.slice(w[0],w[1]+1);for(let X=A[0];X<=A[1];++X)if(L=No(i[X],Z,h),g=Math.min(g,L),g===0)return g}else if(!e&&l){let Z=i.slice(A[0],A[1]+1);for(let X=w[0];X<=w[1];++X)if(L=No(r[X],Z,h),g=Math.min(g,L),g===0)return g}else L=Vc(r,w,i,A,h),g=Math.min(g,L)}else{let L=Ol(w,e),Z=Ol(A,l);Sa(x,g,h,r,i,L[0],Z[0]),Sa(x,g,h,r,i,L[0],Z[1]),Sa(x,g,h,r,i,L[1],Z[0]),Sa(x,g,h,r,i,L[1],Z[1])}}return g}function Ls(r){return r.type==="MultiPolygon"?r.coordinates.map((e=>({type:"Polygon",coordinates:e}))):r.type==="MultiLineString"?r.coordinates.map((e=>({type:"LineString",coordinates:e}))):r.type==="MultiPoint"?r.coordinates.map((e=>({type:"Point",coordinates:e}))):[r]}class Uo{constructor(e,i){this.type=Te,this.geojson=e,this.geometries=i}static parse(e,i){if(e.length!==2)return i.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(wa(e[1])){let l=e[1];if(l.type==="FeatureCollection")return new Uo(l,l.features.map((h=>Ls(h.geometry))).flat());if(l.type==="Feature")return new Uo(l,Ls(l.geometry));if("type"in l&&"coordinates"in l)return new Uo(l,Ls(l))}return i.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return(function(i,l){let h=i.geometry(),m=h.flat().map((C=>Al([C.x,C.y],i.canonical)));if(h.length===0)return NaN;let g=new xh(m[0][1]),x=1/0;for(let C of l){switch(C.type){case"Point":x=Math.min(x,Nc(m,!1,[C.coordinates],!1,g,x));break;case"LineString":x=Math.min(x,Nc(m,!1,C.coordinates,!0,g,x));break;case"Polygon":x=Math.min(x,ui(m,!1,C.coordinates,g,x))}if(x===0)return x}return x})(e,this.geometries);if(e.geometryType()==="LineString")return(function(i,l){let h=i.geometry(),m=h.flat().map((C=>Al([C.x,C.y],i.canonical)));if(h.length===0)return NaN;let g=new xh(m[0][1]),x=1/0;for(let C of l){switch(C.type){case"Point":x=Math.min(x,Nc(m,!0,[C.coordinates],!1,g,x));break;case"LineString":x=Math.min(x,Nc(m,!0,C.coordinates,!0,g,x));break;case"Polygon":x=Math.min(x,ui(m,!0,C.coordinates,g,x))}if(x===0)return x}return x})(e,this.geometries);if(e.geometryType()==="Polygon")return(function(i,l){let h=i.geometry();if(h.length===0||h[0].length===0)return NaN;let m=zs(h,0).map((C=>C.map((w=>w.map((A=>Al([A.x,A.y],i.canonical))))))),g=new xh(m[0][0][0][1]),x=1/0;for(let C of l)for(let w of m){switch(C.type){case"Point":x=Math.min(x,ui([C.coordinates],!1,w,g,x));break;case"LineString":x=Math.min(x,ui(C.coordinates,!0,w,g,x));break;case"Polygon":x=Math.min(x,dr(w,C.coordinates,g,x))}if(x===0)return x}return x})(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class Vl{constructor(e){this.type=Lt,this.key=e}static parse(e,i){if(e.length!==2)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);let l=e[1];return l==null?i.error("Global state property must be defined."):typeof l!="string"?i.error(`Global state property must be string, but found ${typeof e[1]} instead.`):new Vl(l)}evaluate(e){var i;let l=(i=e.globals)===null||i===void 0?void 0:i.globalState;return l&&Object.keys(l).length!==0?Js(l,this.key):null}eachChild(){}outputDefined(){return!1}}let Yt={"==":gh,"!=":nr,">":xr,"<":gr,">=":Ml,"<=":zr,array:to,at:ar,boolean:to,case:qa,coalesce:$a,collator:ks,format:Pl,image:kl,in:Zi,"index-of":tc,interpolate:ln,"interpolate-hcl":ln,"interpolate-lab":ln,length:ia,let:br,literal:Ta,match:hr,number:to,"number-format":_h,object:to,slice:ic,step:rc,string:to,"to-boolean":ja,"to-color":ja,"to-number":ja,"to-string":ja,var:Sl,within:il,distance:Uo,"global-state":Vl};class So{constructor(e,i,l,h){this.name=e,this.type=i,this._evaluate=l,this.args=h}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,i){let l=e[0],h=So.definitions[l];if(!h)return i.error(`Unknown expression "${l}". If you wanted a literal array, use ["literal", [...]].`,0);let m=Array.isArray(h)?h[0]:h.type,g=Array.isArray(h)?[[h[1],h[2]]]:h.overloads,x=g.filter((([w])=>!Array.isArray(w)||w.length===e.length-1)),C=null;for(let[w,A]of x){C=new Ps(i.registry,jc,i.path,null,i.scope);let M=[],N=!1;for(let L=1;L<e.length;L++){let Z=e[L],X=Array.isArray(w)?w[L-1]:w.type,ie=C.parse(Z,1+M.length,X);if(!ie){N=!0;break}M.push(ie)}if(!N)if(Array.isArray(w)&&w.length!==M.length)C.error(`Expected ${w.length} arguments, but found ${M.length} instead.`);else{for(let L=0;L<M.length;L++){let Z=Array.isArray(w)?w[L]:w.type,X=M[L];C.concat(L+1).checkSubtype(Z,X.type)}if(C.errors.length===0)return new So(l,m,A,M)}}if(x.length===1)i.errors.push(...C.errors);else{let w=(x.length?x:g).map((([M])=>{return N=M,Array.isArray(N)?`(${N.map(Fi).join(", ")})`:`(${Fi(N.type)}...)`;var N})).join(" | "),A=[];for(let M=1;M<e.length;M++){let N=i.parse(e[M],1+A.length);if(!N)return null;A.push(Fi(N.type))}i.error(`Expected arguments of type ${w}, but found (${A.join(", ")}) instead.`)}return null}static register(e,i){So.definitions=i;for(let l in i)e[l]=So}}function Pu(r,[e,i,l,h]){e=e.evaluate(r),i=i.evaluate(r),l=l.evaluate(r);let m=h?h.evaluate(r):1,g=hs(e,i,l,m);if(g)throw new Cr(g);return new Yi(e/255,i/255,l/255,m,!1)}function bh(r,e){return r in e}function Uc(r,e){let i=e[r];return i===void 0?null:i}function nl(r){return{type:r}}function jc(r){if(r instanceof Sl)return jc(r.boundExpression);if(r instanceof So&&r.name==="error"||r instanceof ks||r instanceof il||r instanceof Uo||r instanceof Vl)return!1;let e=r instanceof ja||r instanceof to,i=!0;return r.eachChild((l=>{i=e?i&&jc(l):i&&l instanceof Ta})),!!i&&wh(r)&&sc(r,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function wh(r){if(r instanceof So&&(r.name==="get"&&r.args.length===1||r.name==="feature-state"||r.name==="has"&&r.args.length===1||r.name==="properties"||r.name==="geometry-type"||r.name==="id"||/^filter-/.test(r.name))||r instanceof il||r instanceof Uo)return!1;let e=!0;return r.eachChild((i=>{e&&!wh(i)&&(e=!1)})),e}function ac(r){if(r instanceof So&&r.name==="feature-state")return!1;let e=!0;return r.eachChild((i=>{e&&!ac(i)&&(e=!1)})),e}function sc(r,e){if(r instanceof So&&e.indexOf(r.name)>=0)return!1;let i=!0;return r.eachChild((l=>{i&&!sc(l,e)&&(i=!1)})),i}function Th(r){return{result:"success",value:r}}function ol(r){return{result:"error",value:r}}function al(r){return r["property-type"]==="data-driven"||r["property-type"]==="cross-faded-data-driven"}function Io(r){return!!r.expression&&r.expression.parameters.indexOf("zoom")>-1}function ps(r){return!!r.expression&&r.expression.interpolated}function Ji(r){return r instanceof Number?"number":r instanceof String?"string":r instanceof Boolean?"boolean":Array.isArray(r)?"array":r===null?"null":typeof r}function Rs(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)&&en(r)===dt}function nu(r){return r}function lc(r,e){let i=r.stops&&typeof r.stops[0][0]=="object",l=i||!(i||r.property!==void 0),h=r.type||(ps(e)?"exponential":"interval"),m=(function(A){switch(A.type){case"color":return Yi.parse;case"padding":return so.parse;case"numberArray":return Br.parse;case"colorArray":return Ni.parse;default:return null}})(e);if(m&&((r=xe({},r)).stops&&(r.stops=r.stops.map((A=>[A[0],m(A[1])]))),r.default=m(r.default?r.default:e.default)),r.colorSpace&&(g=r.colorSpace)!=="rgb"&&g!=="hcl"&&g!=="lab")throw new Error(`Unknown color space: "${r.colorSpace}"`);var g;let x=(function(A){switch(A){case"exponential":return hc;case"interval":return Nr;case"categorical":return Ia;case"identity":return Sh;default:throw new Error(`Unknown function type "${A}"`)}})(h),C,w;if(h==="categorical"){C=Object.create(null);for(let A of r.stops)C[A[0]]=A[1];w=typeof r.stops[0][0]}if(i){let A={},M=[];for(let Z=0;Z<r.stops.length;Z++){let X=r.stops[Z],ie=X[0].zoom;A[ie]===void 0&&(A[ie]={zoom:ie,type:r.type,property:r.property,default:r.default,stops:[]},M.push(ie)),A[ie].stops.push([X[0].value,X[1]])}let N=[];for(let Z of M)N.push([A[Z].zoom,lc(A[Z],e)]);let L={name:"linear"};return{kind:"composite",interpolationType:L,interpolationFactor:ln.interpolationFactor.bind(void 0,L),zoomStops:N.map((Z=>Z[0])),evaluate:({zoom:Z},X)=>hc({stops:N,base:r.base},e,Z).evaluate(Z,X)}}if(l){let A=h==="exponential"?{name:"exponential",base:r.base!==void 0?r.base:1}:null;return{kind:"camera",interpolationType:A,interpolationFactor:ln.interpolationFactor.bind(void 0,A),zoomStops:r.stops.map((M=>M[0])),evaluate:({zoom:M})=>x(r,e,M,C,w)}}return{kind:"source",evaluate(A,M){let N=M&&M.properties?M.properties[r.property]:void 0;return N===void 0?cc(r.default,e.default):x(r,e,N,C,w)}}}function cc(r,e,i){return r!==void 0?r:e!==void 0?e:i!==void 0?i:void 0}function Ia(r,e,i,l,h){return cc(typeof i===h?l[i]:void 0,r.default,e.default)}function Nr(r,e,i){if(Ji(i)!=="number")return cc(r.default,e.default);let l=r.stops.length;if(l===1||i<=r.stops[0][0])return r.stops[0][1];if(i>=r.stops[l-1][0])return r.stops[l-1][1];let h=Il(r.stops.map((m=>m[0])),i);return r.stops[h][1]}function hc(r,e,i){let l=r.base!==void 0?r.base:1;if(Ji(i)!=="number")return cc(r.default,e.default);let h=r.stops.length;if(h===1||i<=r.stops[0][0])return r.stops[0][1];if(i>=r.stops[h-1][0])return r.stops[h-1][1];let m=Il(r.stops.map((A=>A[0])),i),g=(function(A,M,N,L){let Z=L-N,X=A-N;return Z===0?0:M===1?X/Z:(Math.pow(M,X)-1)/(Math.pow(M,Z)-1)})(i,l,r.stops[m][0],r.stops[m+1][0]),x=r.stops[m][1],C=r.stops[m+1][1],w=lo[e.type]||nu;return typeof x.evaluate=="function"?{evaluate(...A){let M=x.evaluate.apply(void 0,A),N=C.evaluate.apply(void 0,A);if(M!==void 0&&N!==void 0)return w(M,N,g,r.colorSpace)}}:w(x,C,g,r.colorSpace)}function Sh(r,e,i){switch(e.type){case"color":i=Yi.parse(i);break;case"formatted":i=Fo.fromString(i.toString());break;case"resolvedImage":i=Bo.fromString(i.toString());break;case"padding":i=so.parse(i);break;case"colorArray":i=Ni.parse(i);break;case"numberArray":i=Br.parse(i);break;default:Ji(i)===e.type||e.type==="enum"&&e.values[i]||(i=void 0)}return cc(i,r.default,e.default)}So.register(Yt,{error:[{kind:"error"},[ke],(r,[e])=>{throw new Cr(e.evaluate(r))}],typeof:[ke,[Lt],(r,[e])=>Fi(en(e.evaluate(r)))],"to-rgba":[qi(Te,4),[pt],(r,[e])=>{let[i,l,h,m]=e.evaluate(r).rgb;return[255*i,255*l,255*h,m]}],rgb:[pt,[Te,Te,Te],Pu],rgba:[pt,[Te,Te,Te,Te],Pu],has:{type:Ge,overloads:[[[ke],(r,[e])=>bh(e.evaluate(r),r.properties())],[[ke,dt],(r,[e,i])=>bh(e.evaluate(r),i.evaluate(r))]]},get:{type:Lt,overloads:[[[ke],(r,[e])=>Uc(e.evaluate(r),r.properties())],[[ke,dt],(r,[e,i])=>Uc(e.evaluate(r),i.evaluate(r))]]},"feature-state":[Lt,[ke],(r,[e])=>Uc(e.evaluate(r),r.featureState||{})],properties:[dt,[],r=>r.properties()],"geometry-type":[ke,[],r=>r.geometryType()],id:[Lt,[],r=>r.id()],zoom:[Te,[],r=>r.globals.zoom],"heatmap-density":[Te,[],r=>r.globals.heatmapDensity||0],elevation:[Te,[],r=>r.globals.elevation||0],"line-progress":[Te,[],r=>r.globals.lineProgress||0],accumulated:[Lt,[],r=>r.globals.accumulated===void 0?null:r.globals.accumulated],"+":[Te,nl(Te),(r,e)=>{let i=0;for(let l of e)i+=l.evaluate(r);return i}],"*":[Te,nl(Te),(r,e)=>{let i=1;for(let l of e)i*=l.evaluate(r);return i}],"-":{type:Te,overloads:[[[Te,Te],(r,[e,i])=>e.evaluate(r)-i.evaluate(r)],[[Te],(r,[e])=>-e.evaluate(r)]]},"/":[Te,[Te,Te],(r,[e,i])=>e.evaluate(r)/i.evaluate(r)],"%":[Te,[Te,Te],(r,[e,i])=>e.evaluate(r)%i.evaluate(r)],ln2:[Te,[],()=>Math.LN2],pi:[Te,[],()=>Math.PI],e:[Te,[],()=>Math.E],"^":[Te,[Te,Te],(r,[e,i])=>Math.pow(e.evaluate(r),i.evaluate(r))],sqrt:[Te,[Te],(r,[e])=>Math.sqrt(e.evaluate(r))],log10:[Te,[Te],(r,[e])=>Math.log(e.evaluate(r))/Math.LN10],ln:[Te,[Te],(r,[e])=>Math.log(e.evaluate(r))],log2:[Te,[Te],(r,[e])=>Math.log(e.evaluate(r))/Math.LN2],sin:[Te,[Te],(r,[e])=>Math.sin(e.evaluate(r))],cos:[Te,[Te],(r,[e])=>Math.cos(e.evaluate(r))],tan:[Te,[Te],(r,[e])=>Math.tan(e.evaluate(r))],asin:[Te,[Te],(r,[e])=>Math.asin(e.evaluate(r))],acos:[Te,[Te],(r,[e])=>Math.acos(e.evaluate(r))],atan:[Te,[Te],(r,[e])=>Math.atan(e.evaluate(r))],min:[Te,nl(Te),(r,e)=>Math.min(...e.map((i=>i.evaluate(r))))],max:[Te,nl(Te),(r,e)=>Math.max(...e.map((i=>i.evaluate(r))))],abs:[Te,[Te],(r,[e])=>Math.abs(e.evaluate(r))],round:[Te,[Te],(r,[e])=>{let i=e.evaluate(r);return i<0?-Math.round(-i):Math.round(i)}],floor:[Te,[Te],(r,[e])=>Math.floor(e.evaluate(r))],ceil:[Te,[Te],(r,[e])=>Math.ceil(e.evaluate(r))],"filter-==":[Ge,[ke,Lt],(r,[e,i])=>r.properties()[e.value]===i.value],"filter-id-==":[Ge,[Lt],(r,[e])=>r.id()===e.value],"filter-type-==":[Ge,[ke],(r,[e])=>r.geometryType()===e.value],"filter-<":[Ge,[ke,Lt],(r,[e,i])=>{let l=r.properties()[e.value],h=i.value;return typeof l==typeof h&&l<h}],"filter-id-<":[Ge,[Lt],(r,[e])=>{let i=r.id(),l=e.value;return typeof i==typeof l&&i<l}],"filter->":[Ge,[ke,Lt],(r,[e,i])=>{let l=r.properties()[e.value],h=i.value;return typeof l==typeof h&&l>h}],"filter-id->":[Ge,[Lt],(r,[e])=>{let i=r.id(),l=e.value;return typeof i==typeof l&&i>l}],"filter-<=":[Ge,[ke,Lt],(r,[e,i])=>{let l=r.properties()[e.value],h=i.value;return typeof l==typeof h&&l<=h}],"filter-id-<=":[Ge,[Lt],(r,[e])=>{let i=r.id(),l=e.value;return typeof i==typeof l&&i<=l}],"filter->=":[Ge,[ke,Lt],(r,[e,i])=>{let l=r.properties()[e.value],h=i.value;return typeof l==typeof h&&l>=h}],"filter-id->=":[Ge,[Lt],(r,[e])=>{let i=r.id(),l=e.value;return typeof i==typeof l&&i>=l}],"filter-has":[Ge,[Lt],(r,[e])=>e.value in r.properties()],"filter-has-id":[Ge,[],r=>r.id()!==null&&r.id()!==void 0],"filter-type-in":[Ge,[qi(ke)],(r,[e])=>e.value.indexOf(r.geometryType())>=0],"filter-id-in":[Ge,[qi(Lt)],(r,[e])=>e.value.indexOf(r.id())>=0],"filter-in-small":[Ge,[ke,qi(Lt)],(r,[e,i])=>i.value.indexOf(r.properties()[e.value])>=0],"filter-in-large":[Ge,[ke,qi(Lt)],(r,[e,i])=>(function(l,h,m,g){for(;m<=g;){let x=m+g>>1;if(h[x]===l)return!0;h[x]>l?g=x-1:m=x+1}return!1})(r.properties()[e.value],i.value,0,i.value.length-1)],all:{type:Ge,overloads:[[[Ge,Ge],(r,[e,i])=>e.evaluate(r)&&i.evaluate(r)],[nl(Ge),(r,e)=>{for(let i of e)if(!i.evaluate(r))return!1;return!0}]]},any:{type:Ge,overloads:[[[Ge,Ge],(r,[e,i])=>e.evaluate(r)||i.evaluate(r)],[nl(Ge),(r,e)=>{for(let i of e)if(i.evaluate(r))return!0;return!1}]]},"!":[Ge,[Ge],(r,[e])=>!e.evaluate(r)],"is-supported-script":[Ge,[ke],(r,[e])=>{let i=r.globals&&r.globals.isSupportedScript;return!i||i(e.evaluate(r))}],upcase:[ke,[ke],(r,[e])=>e.evaluate(r).toUpperCase()],downcase:[ke,[ke],(r,[e])=>e.evaluate(r).toLowerCase()],concat:[ke,nl(Lt),(r,e)=>e.map((i=>Vn(i.evaluate(r)))).join("")],split:[qi(ke),[ke,ke],(r,[e,i])=>e.evaluate(r).split(i.evaluate(r))],join:[ke,[qi(ke),ke],(r,[e,i])=>e.evaluate(r).join(i.evaluate(r))],"resolved-locale":[ke,[gi],(r,[e])=>e.evaluate(r).resolvedLocale()]});class uc{constructor(e,i,l){this.expression=e,this._warningHistory={},this._evaluator=new zc,this._defaultValue=i?(function(h){if(h.type==="color"&&Rs(h.default))return new Yi(0,0,0,0);switch(h.type){case"color":return Yi.parse(h.default)||null;case"padding":return so.parse(h.default)||null;case"numberArray":return Br.parse(h.default)||null;case"colorArray":return Ni.parse(h.default)||null;case"variableAnchorOffsetCollection":return Xi.parse(h.default)||null;case"projectionDefinition":return bo.parse(h.default)||null;default:return h.default===void 0?null:h.default}})(i):null,this._enumValues=i&&i.type==="enum"?i.values:null,this._globalState=l}evaluateWithoutErrorHandling(e,i,l,h,m,g){return this._globalState&&(e=sl(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=i,this._evaluator.featureState=l,this._evaluator.canonical=h,this._evaluator.availableImages=m||null,this._evaluator.formattedSection=g,this.expression.evaluate(this._evaluator)}evaluate(e,i,l,h,m,g){this._globalState&&(e=sl(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=i||null,this._evaluator.featureState=l||null,this._evaluator.canonical=h,this._evaluator.availableImages=m||null,this._evaluator.formattedSection=g||null;try{let x=this.expression.evaluate(this._evaluator);if(x==null||typeof x=="number"&&x!=x)return this._defaultValue;if(this._enumValues&&!(x in this._enumValues))throw new Cr(`Expected value to be one of ${Object.keys(this._enumValues).map((C=>JSON.stringify(C))).join(", ")}, but found ${JSON.stringify(x)} instead.`);return x}catch(x){return this._warningHistory[x.message]||(this._warningHistory[x.message]=!0,typeof console<"u"&&console.warn(x.message)),this._defaultValue}}}function qc(r){return Array.isArray(r)&&r.length>0&&typeof r[0]=="string"&&r[0]in Yt}function pc(r,e,i){let l=new Ps(Yt,jc,[],e?(function(m){let g={color:pt,string:ke,number:Te,enum:ke,boolean:Ge,formatted:ei,padding:zi,numberArray:rr,colorArray:Ri,projectionDefinition:zt,resolvedImage:Vi,variableAnchorOffsetCollection:Hi};return m.type==="array"?qi(g[m.value]||Lt,m.length):g[m.type]})(e):void 0),h=l.parse(r,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return h?Th(new uc(h,e,i)):ol(l.errors)}class Ih{constructor(e,i,l){this.kind=e,this._styleExpression=i,this.isStateDependent=e!=="constant"&&!ac(i.expression),this.globalStateRefs=Za(i.expression),this._globalState=l}evaluateWithoutErrorHandling(e,i,l,h,m,g){return this._globalState&&(e=sl(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,i,l,h,m,g)}evaluate(e,i,l,h,m,g){return this._globalState&&(e=sl(e,this._globalState)),this._styleExpression.evaluate(e,i,l,h,m,g)}}class ra{constructor(e,i,l,h,m){this.kind=e,this.zoomStops=l,this._styleExpression=i,this.isStateDependent=e!=="camera"&&!ac(i.expression),this.globalStateRefs=Za(i.expression),this.interpolationType=h,this._globalState=m}evaluateWithoutErrorHandling(e,i,l,h,m,g){return this._globalState&&(e=sl(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,i,l,h,m,g)}evaluate(e,i,l,h,m,g){return this._globalState&&(e=sl(e,this._globalState)),this._styleExpression.evaluate(e,i,l,h,m,g)}interpolationFactor(e,i,l){return this.interpolationType?ln.interpolationFactor(this.interpolationType,e,i,l):0}}function dc(r,e,i){let l=pc(r,e,i);if(l.result==="error")return l;let h=l.value.expression,m=wh(h);if(!m&&!al(e))return ol([new ve("","data expressions not supported")]);let g=sc(h,["zoom"]);if(!g&&!Io(e))return ol([new ve("","zoom expressions not supported")]);let x=Pi(h);return x||g?x instanceof ve?ol([x]):x instanceof ln&&!ps(e)?ol([new ve("",'"interpolate" expressions cannot be used with this property')]):Th(x?new ra(m?"camera":"composite",l.value,x.labels,x instanceof ln?x.interpolation:void 0,i):new Ih(m?"constant":"source",l.value,i)):ol([new ve("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class xi{constructor(e,i){this._parameters=e,this._specification=i,xe(this,lc(this._parameters,this._specification))}static deserialize(e){return new xi(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Pi(r){let e=null;if(r instanceof br)e=Pi(r.result);else if(r instanceof $a){for(let i of r.args)if(e=Pi(i),e)break}else(r instanceof rc||r instanceof ln)&&r.input instanceof So&&r.input.name==="zoom"&&(e=r);return e instanceof ve||r.eachChild((i=>{let l=Pi(i);l instanceof ve?e=l:!e&&l?e=new ve("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&l&&e!==l&&(e=new ve("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function Za(r,e=new Set){return r instanceof Vl&&e.add(r.key),r.eachChild((i=>{Za(i,e)})),e}function sl(r,e){let{zoom:i,heatmapDensity:l,elevation:h,lineProgress:m,isSupportedScript:g,accumulated:x}=r??{};return{zoom:i,heatmapDensity:l,elevation:h,lineProgress:m,isSupportedScript:g,accumulated:x,globalState:e}}function ds(r){if(r===!0||r===!1)return!0;if(!Array.isArray(r)||r.length===0)return!1;switch(r[0]){case"has":return r.length>=2&&r[1]!=="$id"&&r[1]!=="$type";case"in":return r.length>=3&&(typeof r[1]!="string"||Array.isArray(r[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return r.length!==3||Array.isArray(r[1])||Array.isArray(r[2]);case"any":case"all":for(let e of r.slice(1))if(!ds(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}let io={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ca(r,e){if(r==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};ds(r)||(r=Ea(r));let i=pc(r,io,e);if(i.result==="error")throw new Error(i.value.map((l=>`${l.key}: ${l.message}`)).join(", "));return{filter:(l,h,m)=>i.value.evaluate(l,h,{},m),needGeometry:Ch(r),getGlobalStateRefs:()=>Za(i.value.expression)}}function ms(r,e){return r<e?-1:r>e?1:0}function Ch(r){if(!Array.isArray(r))return!1;if(r[0]==="within"||r[0]==="distance")return!0;for(let e=1;e<r.length;e++)if(Ch(r[e]))return!0;return!1}function Ea(r){if(!r)return!0;let e=r[0];return r.length<=1?e!=="any":e==="=="?Xr(r[1],r[2],"=="):e==="!="?Wa(Xr(r[1],r[2],"==")):e==="<"||e===">"||e==="<="||e===">="?Xr(r[1],r[2],e):e==="any"?(i=r.slice(1),["any"].concat(i.map(Ea))):e==="all"?["all"].concat(r.slice(1).map(Ea)):e==="none"?["all"].concat(r.slice(1).map(Ea).map(Wa)):e==="in"?wn(r[1],r.slice(2)):e==="!in"?Wa(wn(r[1],r.slice(2))):e==="has"?$c(r[1]):e!=="!has"||Wa($c(r[1]));var i}function Xr(r,e,i){switch(r){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,r,e]}}function wn(r,e){if(e.length===0)return!1;switch(r){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((i=>typeof i!=typeof e[0]))?["filter-in-large",r,["literal",e.sort(ms)]]:["filter-in-small",r,["literal",e]]}}function $c(r){switch(r){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",r]}}function Wa(r){return["!",r]}function T(r){let e=typeof r;if(e==="number"||e==="boolean"||e==="string"||r==null)return JSON.stringify(r);if(Array.isArray(r)){let h="[";for(let m of r)h+=`${T(m)},`;return`${h}]`}let i=Object.keys(r).sort(),l="{";for(let h=0;h<i.length;h++)l+=`${JSON.stringify(i[h])}:${T(r[i[h]])},`;return`${l}}`}function s(r){let e="";for(let i of sn)e+=`/${T(r[i])}`;return e}function d(r){let e=r.value;return e?[new te(r.key,e,"constants have been deprecated as of v8")]:[]}function v(r){return r instanceof Number||r instanceof String||r instanceof Boolean?r.valueOf():r}function S(r){if(Array.isArray(r))return r.map(S);if(r instanceof Object&&!(r instanceof Number||r instanceof String||r instanceof Boolean)){let e={};for(let i in r)e[i]=S(r[i]);return e}return v(r)}function z(r){let e=r.key,i=r.value,l=r.valueSpec||{},h=r.objectElementValidators||{},m=r.style,g=r.styleSpec,x=r.validateSpec,C=[],w=Ji(i);if(w!=="object")return[new te(e,i,`object expected, ${w} found`)];for(let A in i){let M=A.split(".")[0],N=Js(l,M)||l["*"],L;if(Js(h,M))L=h[M];else if(Js(l,M)){if(i[A]===void 0)continue;L=x}else if(h["*"])L=h["*"];else{if(!l["*"]){C.push(new te(e,i[A],`unknown property "${A}"`));continue}L=x}C=C.concat(L({key:(e&&`${e}.`)+A,value:i[A],valueSpec:N,style:m,styleSpec:g,object:i,objectKey:A,validateSpec:x},i))}for(let A in l)h[A]||l[A].required&&l[A].default===void 0&&i[A]===void 0&&C.push(new te(e,i,`missing required property "${A}"`));return C}function j(r){let e=r.value,i=r.valueSpec,l=r.style,h=r.styleSpec,m=r.key,g=r.arrayElementValidator||r.validateSpec;if(Ji(e)!=="array")return[new te(m,e,`array expected, ${Ji(e)} found`)];if(i.length&&e.length!==i.length)return[new te(m,e,`array length ${i.length} expected, length ${e.length} found`)];let x={type:i.value,values:i.values};h.$version<7&&(x.function=i.function),Ji(i.value)==="object"&&(x=i.value);let C=[];for(let w=0;w<e.length;w++)C=C.concat(g({array:e,arrayIndex:w,value:e[w],valueSpec:x,validateSpec:r.validateSpec,style:l,styleSpec:h,key:`${m}[${w}]`}));return C}function W(r){let e=r.key,i=r.value,l=r.valueSpec,h=Ji(i);return h==="number"&&i!=i&&(h="NaN"),h!=="number"?[new te(e,i,`number expected, ${h} found`)]:"minimum"in l&&i<l.minimum?[new te(e,i,`${i} is less than the minimum value ${l.minimum}`)]:"maximum"in l&&i>l.maximum?[new te(e,i,`${i} is greater than the maximum value ${l.maximum}`)]:[]}function K(r){let e=r.valueSpec,i=v(r.value.type),l,h,m,g={},x=i!=="categorical"&&r.value.property===void 0,C=!x,w=Ji(r.value.stops)==="array"&&Ji(r.value.stops[0])==="array"&&Ji(r.value.stops[0][0])==="object",A=z({key:r.key,value:r.value,valueSpec:r.styleSpec.function,validateSpec:r.validateSpec,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{stops:function(L){if(i==="identity")return[new te(L.key,L.value,'identity function may not have a "stops" property')];let Z=[],X=L.value;return Z=Z.concat(j({key:L.key,value:X,valueSpec:L.valueSpec,validateSpec:L.validateSpec,style:L.style,styleSpec:L.styleSpec,arrayElementValidator:M})),Ji(X)==="array"&&X.length===0&&Z.push(new te(L.key,X,"array must have at least one stop")),Z},default:function(L){return L.validateSpec({key:L.key,value:L.value,valueSpec:e,validateSpec:L.validateSpec,style:L.style,styleSpec:L.styleSpec})}}});return i==="identity"&&x&&A.push(new te(r.key,r.value,'missing required property "property"')),i==="identity"||r.value.stops||A.push(new te(r.key,r.value,'missing required property "stops"')),i==="exponential"&&r.valueSpec.expression&&!ps(r.valueSpec)&&A.push(new te(r.key,r.value,"exponential functions not supported")),r.styleSpec.$version>=8&&(C&&!al(r.valueSpec)?A.push(new te(r.key,r.value,"property functions not supported")):x&&!Io(r.valueSpec)&&A.push(new te(r.key,r.value,"zoom functions not supported"))),i!=="c
1ategorical"&&!w||r.value.property!==void 0||A.push(new te(r.key,r.value,'"property" property is required')),A;function M(L){let Z=[],X=L.value,ie=L.key;if(Ji(X)!=="array")return[new te(ie,X,`array expected, ${Ji(X)} found`)];if(X.length!==2)return[new te(ie,X,`array length 2 expected, length ${X.length} found`)];if(w){if(Ji(X[0])!=="object")return[new te(ie,X,`object expected, ${Ji(X[0])} found`)];if(X[0].zoom===void 0)return[new te(ie,X,"object stop key must have zoom")];if(X[0].value===void 0)return[new te(ie,X,"object stop key must have value")];if(m&&m>v(X[0].zoom))return[new te(ie,X[0].zoom,"stop zoom values must appear in ascending order")];v(X[0].zoom)!==m&&(m=v(X[0].zoom),h=void 0,g={}),Z=Z.concat(z({key:`${ie}[0]`,value:X[0],valueSpec:{zoom:{}},validateSpec:L.validateSpec,style:L.style,styleSpec:L.styleSpec,objectElementValidators:{zoom:W,value:N}}))}else Z=Z.concat(N({key:`${ie}[0]`,value:X[0],validateSpec:L.validateSpec,style:L.style,styleSpec:L.styleSpec},X));return qc(S(X[1]))?Z.concat([new te(`${ie}[1]`,X[1],"expressions are not allowed in function stops.")]):Z.concat(L.validateSpec({key:`${ie}[1]`,value:X[1],valueSpec:e,validateSpec:L.validateSpec,style:L.style,styleSpec:L.styleSpec}))}function N(L,Z){let X=Ji(L.value),ie=v(L.value),ne=L.value!==null?L.value:Z;if(l){if(X!==l)return[new te(L.key,ne,`${X} stop domain type must match previous stop domain type ${l}`)]}else l=X;if(X!=="number"&&X!=="string"&&X!=="boolean")return[new te(L.key,ne,"stop domain value must be a number, string, or boolean")];if(X!=="number"&&i!=="categorical"){let ue=`number expected, ${X} found`;return al(e)&&i===void 0&&(ue+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new te(L.key,ne,ue)]}return i!=="categorical"||X!=="number"||isFinite(ie)&&Math.floor(ie)===ie?i!=="categorical"&&X==="number"&&h!==void 0&&ie<h?[new te(L.key,ne,"stop domain values must appear in ascending order")]:(h=ie,i==="categorical"&&ie in g?[new te(L.key,ne,"stop domain values must be unique")]:(g[ie]=!0,[])):[new te(L.key,ne,`integer expected, found ${ie}`)]}}function Q(r){let e=(r.expressionContext==="property"?dc:pc)(S(r.value),r.valueSpec);if(e.result==="error")return e.value.map((l=>new te(`${r.key}${l.key}`,r.value,l.message)));let i=e.value.expression||e.value._styleExpression.expression;if(r.expressionContext==="property"&&r.propertyKey==="text-font"&&!i.outputDefined())return[new te(r.key,r.value,`Invalid data expression for "${r.propertyKey}". Output values must be contained as literals within the expression.`)];if(r.expressionContext==="property"&&r.propertyType==="layout"&&!ac(i))return[new te(r.key,r.value,'"feature-state" data expressions are not supported with layout properties.')];if(r.expressionContext==="filter"&&!ac(i))return[new te(r.key,r.value,'"feature-state" data expressions are not supported with filters.')];if(r.expressionContext&&r.expressionContext.indexOf("cluster")===0){if(!sc(i,["zoom","feature-state"]))return[new te(r.key,r.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(r.expressionContext==="cluster-initial"&&!wh(i))return[new te(r.key,r.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function le(r){let e=r.key,i=r.value,l=Ji(i);return l!=="string"?[new te(e,i,`color expected, ${l} found`)]:Yi.parse(String(i))?[]:[new te(e,i,`color expected, "${i}" found`)]}function he(r){let e=r.key,i=r.value,l=r.valueSpec,h=[];return Array.isArray(l.values)?l.values.indexOf(v(i))===-1&&h.push(new te(e,i,`expected one of [${l.values.join(", ")}], ${JSON.stringify(i)} found`)):Object.keys(l.values).indexOf(v(i))===-1&&h.push(new te(e,i,`expected one of [${Object.keys(l.values).join(", ")}], ${JSON.stringify(i)} found`)),h}function fe(r){return ds(S(r.value))?Q(xe({},r,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Re(r)}function Re(r){let e=r.value,i=r.key;if(Ji(e)!=="array")return[new te(i,e,`array expected, ${Ji(e)} found`)];let l=r.styleSpec,h,m=[];if(e.length<1)return[new te(i,e,"filter array must have at least 1 element")];switch(m=m.concat(he({key:`${i}[0]`,value:e[0],valueSpec:l.filter_operator,style:r.style,styleSpec:r.styleSpec})),v(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&v(e[1])==="$type"&&m.push(new te(i,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&m.push(new te(i,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>
1=2&&(h=Ji(e[1]),h!=="string"&&m.push(new te(`${i}[1]`,e[1],`string expected, ${h} found`)));for(let g=2;g<e.length;g++)h=Ji(e[g]),v(e[1])==="$type"?m=m.concat(he({key:`${i}[${g}]`,value:e[g],valueSpec:l.geometry_type,style:r.style,styleSpec:r.styleSpec})):h!=="string"&&h!=="number"&&h!=="boolean"&&m.push(new te(`${i}[${g}]`,e[g],`string, number, or boolean expected, ${h} found`));break;case"any":case"all":case"none":for(let g=1;g<e.length;g++)m=m.concat(Re({key:`${i}[${g}]`,value:e[g],style:r.style,styleSpec:r.styleSpec}));break;case"has":case"!has":h=Ji(e[1]),e.length!==2?m.push(new te(i,e,`filter array for "${e[0]}" operator must have 2 elements`)):h!=="string"&&m.push(new te(`${i}[1]`,e[1],`string expected, ${h} found`))}return m}function Me(r,e){let i=r.key,l=r.validateSpec,h=r.style,m=r.styleSpec,g=r.value,x=r.objectKey,C=m[`${e}_${r.layerType}`];if(!C)return[];let w=x.match(/^(.*)-transition$/);if(e==="paint"&&w&&C[w[1]]&&C[w[1]].transition)return l({key:i,value:g,valueSpec:m.transition,style:h,styleSpec:m});let A=r.valueSpec||C[x];if(!A)return[new te(i,g,`unknown property "${x}"`)];let M;if(Ji(g)==="string"&&al(A)&&!A.tokens&&(M=/^{([^}]+)}$/.exec(g)))return[new te(i,g,`"${x}" does not support interpolation syntax 2Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(M[1])} }\`.`)];let N=[];return r.layerType==="symbol"&&x==="text-font"&&Rs(S(g))&&v(g.type)==="identity"&&N.push(new te(i,g,'"text-font" does not support identity functions')),N.c
vendor: 5,114 bytes, line 2
2oncat(l({key:r.key,value:g,valueSpec:A,style:h,styleSpec:m,expressionContext:"property",propertyType:e,propertyKey:x}))}function Ae(r){return Me(r,"paint")}function Xe(r){return Me(r,"layout")}function et(r){var e,i;let l=[],h=r.value,m=r.key,g=r.style,x=r.styleSpec;if(Ji(h)!=="object")return[new te(m,h,`object expected, ${Ji(h)} found`)];h.type||h.ref||l.push(new te(m,h,'either "type" or "ref" is required'));let C=v(h.type),w=v(h.ref);if(h.id){let A=v(h.id);for(let M=0;M<r.arrayIndex;M++){let N=g.layers[M];v(N.id)===A&&l.push(new te(m,h.id,`duplicate layer id "${h.id}", previously used at line ${N.id.__line__}`))}}if("ref"in h){let A;["type","source","source-layer","filter","layout"].forEach((M=>{M in h&&l.push(new te(m,h[M],`"${M}" is prohibited for ref layers`))})),g.layers.forEach((M=>{v(M.id)===w&&(A=M)})),A?A.ref?l.push(new te(m,h.ref,"ref cannot reference another ref layer")):C=v(A.type):l.push(new te(m,h.ref,`ref layer "${w}" not found`))}else if(C!=="background")if(h.source){let A=g.sources&&g.sources[h.source],M=A&&v(A.type);A?M==="vector"&&C==="raster"?l.push(new te(m,h.source,`layer "${h.id}" requires a raster source`)):M!=="raster-dem"&&C==="hillshade"||M!=="raster-dem"&&C==="color-relief"?l.push(new te(m,h.source,`layer "${h.id}" requires a raster-dem source`)):M==="raster"&&C!=="raster"?l.push(new te(m,h.source,`layer "${h.id}" requires a vector source`)):M!=="vector"||h["source-layer"]?M==="raster-dem"&&C!=="hillshade"&&C!=="color-relief"?l.push(new te(m,h.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):C!=="line"||!h.paint||!h.paint["line-gradient"]||M==="geojson"&&A.lineMetrics||l.push(new te(m,h,`layer "${h.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):l.push(new te(m,h,`layer "${h.id}" must specify a "source-layer"`)):l.push(new te(m,h.source,`source "${h.source}" not found`))}else l.push(new te(m,h,'missing required property "source"'));return C==="raster"&&(!((e=h.paint)===null||e===void 0)&&e.resampling)&&(!((i=h.paint)===null||i===void 0)&&i["raster-resampling"])&&l.push(new te(m,h.paint,`layer "${h.id}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`)),l=l.concat(z({key:m,value:h,valueSpec:x.layer,style:r.style,styleSpec:r.styleSpec,validateSpec:r.validateSpec,objectElementValidators:{"*":()=>[],type:()=>r.validateSpec({key:`${m}.type`,value:h.type,valueSpec:x.layer.type,style:r.style,styleSpec:r.styleSpec,validateSpec:r.validateSpec,object:h,objectKey:"type"}),filter:fe,layout:A=>z({layer:h,key:A.key,value:A.value,style:A.style,styleSpec:A.styleSpec,validateSpec:A.validateSpec,objectElementValidators:{"*":M=>Xe(xe({layerType:C},M))}}),paint:A=>z({layer:h,key:A.key,value:A.value,style:A.style,styleSpec:A.styleSpec,validateSpec:A.validateSpec,objectElementValidators:{"*":M=>Ae(xe({layerType:C},M))}})}})),l}function rt(r){let e=r.value,i=r.key,l=Ji(e);return l!=="string"?[new te(i,e,`string expected, ${l} found`)]:[]}let Be={promoteId:function({key:r,value:e}){if(Ji(e)==="string")return rt({key:r,value:e});{let i=[];for(let l in e)i.push(...rt({key:`${r}.${l}`,value:e[l]}));return i}}};function ht(r){let e=r.value,i=r.key,l=r.styleSpec,h=r.style,m=r.validateSpec;if(!e.type)return[new te(i,e,'"type" is required')];let g=v(e.type),x;switch(g){case"vector":case"raster":return x=z({key:i,value:e,valueSpec:l[`source_${g.replace("-","_")}`],style:r.style,styleSpec:l,objectElementValidators:Be,validateSpec:m}),x;case"raster-dem":return x=(function(C){var w;let A=(w=C.sourceName)!==null&&w!==void 0?w:"",M=C.value,N=C.styleSpec,L=N.source_raster_dem,Z=C.style,X=[],ie=Ji(M);if(M===void 0)return X;if(ie!=="object")return X.push(new te("source_raster_dem",M,`object expected, ${ie} found`)),X;let ne=v(M.encoding)==="custom",ue=["redFactor","greenFactor","blueFactor","baseShift"],se=C.value.encoding?`"${C.value.encoding}"`:"Default";for(let me in M)!ne&&ue.includes(me)?X.push(new te(me,M[me],`In "${A}": "${me}" is only valid when "encoding" is set to "custom". ${se} encoding found`)):L[me]?X=X.concat(C.validateSpec({key:me,value:M[me],valueSpec:L[me],validateSpec:C.validateSpec,style:Z,styleSpec:N})):X.push(new te(me,M[me],`unknown property "${me}"`));return X})({sourceName:i,value:e,style:r.style,styleSpec:l,validateSpec:m}),x;case"geojson":if(x=z({key:i,value:e,valueSpec:l.source_geojson,style:h,styleSpec:l,validateSpec:m,objectElementValidators:Be}),e.cluster)for(let C in e.clusterProperties){let[w,A]=e.clusterProperties[C],M=typeof w=="string"?[w,["accumulated"],["get",C]]:w;x.push(...Q({key:`${i}.${C}.map`,value:A,expressionContext:"cluster-map"})),x.push(...Q({key:`${i}.${C}.reduce`,value:M,expressionContext:"cluster-reduce"}))}return x;case"video":return z({key:i,value:e,valueSpec:l.source_video,style:h,validateSpec:m,styleSpec:l});case"image":return z({key:i,value:e,valueSpec:l.source_image,style:h,validateSpec:m,styleSpec:l});case"canvas":return[new te(i,null,"Please use runtime APIs to add canvas sources, rather than
2including them in stylesheets.","source.canvas")];default:return he({key:`${i}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function ot(r){let e=r.value,i=r.styleSpec,l=i.light,h=r.style,m=[],g=Ji(e);if(e===void 0)return m;if(g!=="object")return m=m.concat([new te("light",e,`object expected, ${g} found`)]),m;for(let x in e){let C=x.match(/^(.*)-transition$/);m=m.concat(C&&l[C[1]]&&l[C[1]].transition?r.validateSpec({key:x,value:e[x],valueSpec:i.transition,validateSpec:r.validateSpec,style:h,styleSpec:i}):l[x]?r.validateSpec({key:x,value:e[x],valueSpec:l[x],validateSpec:r.validateSpec,style:h,styleSpec:i}):[new te(x,e[x],`unknown property "${x}"`)])}return m}function wt(r){let e=r.value,i=r.styleSpec,l=i.sky,h=r.style,m=Ji(e);if(e===void 0)return[];if(m!=="object")return[new te("sky",e,`object expected, ${m} found`)];let g=[];for(let x in e)g=g.concat(l[x]?r.validateSpec({key:x,value:e[x],valueSpec:l[x],style:h,styleSpec:i}):[new te(x,e[x],`unknown property "${x}"`)]);return g}function Tt(r){let e=r.value,i=r.styleSpec,l=i.terrain,h=r.style,m=[],g=Ji(e);if(e===void 0)return m;if(g!=="object")return m=m.concat([new te("terrain",e,`object expected, ${g} found`)]),m;for(let x in e)m=m.concat(l[x]?r.validateSpec({key:x,value:e[x],valueSpec:l[x],validateSpec:r.validateSpec,style:h,styleSpec:i}):[new te(x,e[x],`unknown property "${x}"`)]);return m}function Ft(r){let e=[],i=r.value,l=r.key;if(Array.isArray(i)){let h=[],m=[];for(let g in i)i[g].id&&h.includes(i[g].id)&&e.push(new te(l,i,`all the sprites' ids must be unique, but ${i[g].id} is duplicated`)),h.push(i[g].id),i[g].url&&m.includes(i[g].url)&&e.push(new te(l,i,`all the sprites' URLs must be unique, but ${i[g].url} is duplicated`)),m.push(i[g].url),e=e.concat(z({key:`${l}[${g}]`,value:i[g],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:r.validateSpec}));return e}return rt({key:l,value:i})}function gt(r){return!!r&&r.constructor===Object}function ri(r){return gt(r.value)?[]:[new te(r.key,r.value,`object expected, ${Ji(r.value)} found`)]}let Xt={"*":()=>[],array:j,boolean:function(r){let e=r.value,i=r.key,l=Ji(e);return l!=="boolean"?[new te(i,e,`boolean expected, ${l} found`)]:[]},number:W,color:le,constants:d,enum:he,filter:fe,function:K,layer:et,object:z,source:ht,light:ot,sky:wt,terrain:Tt,projection:function(r){let e=r.value,i=r.styleSpec,l=i.projection,h=r.style,m=Ji(e);if(e===void 0)return[];if(m!=="object")return[new te("projection",e,`object expected, ${m} found`)];let g=[];for(let x in e)g=g.concat(l[x]?r.validateSpec({key:x,value:e[x],valueSpec:l[x],style:h,styleSpec:i}):[new te(x,e[x],`unknown property "${x}"`)]);return g},projectionDefinition:function(r){let e=r.key,i=r.value;i=i instanceof String?i.valueOf():i;let l=Ji(i);return l!=="array"||(function(h){return Array.isArray(h)&&h.length===3&&typeof h[0]=="string"&&typeof h[1]=="string"&&typeof h[2]=="number"})(i)||(function(h){return!!["interpolate","step","literal"].includes(h[0])})(i)?["array","string"].includes(l)?[]:[new te(e,i,`projection expected, invalid type "${l}" found`)]:[new te(e,i,`projection expected, invalid array ${JSON.stringify(i)} found`)]},string:rt,formatted:function(r){return rt(r).length===0?[]:Q(r)},resolvedImage:function(r){return rt(r).length===0?[]:Q(r)},padding:function(r){let e=r.key,i=r.value;if(Ji(i)==="array"){if(i.length<1||i.length>4)return[new te(e,i,`padding requires 1 to 4 values; ${i.length} values found`)];let l={type:"number"},h=[];for(let m=0;m<i.length;m++)h=h.concat(r.validateSpec({key:`${e}[${m}]`,value:i[m],validateSpec:r.validateSpec,valueSpec:l}));return h}return W({key:e,value:i,valueSpec:{}})},numberArray:function(r){let e=r.key,i=r.value;if(Ji(i)==="array"){let l={type:"number"};if(i.length<1)return[new te(e,i,"array length at least 1 expected, length 0 found")];let h=[];for(let m=0;m<i.length;m++)h=h.concat(r.validateSpec({key:`${e}[${m}]`,value:i[m],validateSpec:r.validateSpec,valueSpec:l}));return h}return W({key:e,value:i,valueSpec:{}})},colorArray:function(r){let e=r.key,i=r.value;if(Ji(i)==="array"){if(i.length<1)return[new te(e,i,"array length at least 1 expected, length 0 found")];let l=[];for(let h=0;h<i.length;h++)l=l.concat(le({key:`${e}[${h}]`,value:i[h]}));return l}return le({key:e,value:i})},variableAnchorOffsetCollection:function(r){let e=r.key,i=r.value,l=Ji(i),h=r.styleSpec;if(l!=="array"||i.length<1||i.length%2!=0)return[new te(e,i,"variableAnchorOffsetCollection requires a non-empty array of even length")];let m=[];for(let g=0;g<i.length;g+=2)m=m.concat(he({key:`${e}[${g}]`,value:i[g],valueSpec:h.layout_symbol["text-anchor"]})),m=m.concat(j({key:`${e}[${g+1}]`,value:i[g+1],valueSpec:{length:2,value:"number"},validateSpec:r.validateSpec,style:r.style,styleSpec:h}));return m},sprite:Ft,state:ri,fontFaces:function(r){let e=r.key,i=r.value,l=r.validateSpec,h=r.
vendor: 18,315 bytes, line 2
2styleSpec,m=r.style;if(!gt(i))return[new te(e,i,`object expected, ${Ji(i)} found`)];let g=[];for(let x in i){let C=i[x],w=Ji(C);if(w==="string")g.push(...rt({key:`${e}.${x}`,value:C}));else if(w==="array"){let A={url:{type:"string",required:!0},"unicode-range":{type:"array",value:"string"}};for(let[M,N]of C.entries())g.push(...z({key:`${e}.${x}[${M}]`,value:N,valueSpec:A,styleSpec:h,style:m,validateSpec:l}))}else g.push(new te(`${e}.${x}`,C,`string or array expected, ${w} found`))}return g}};function ai(r){let e=r.value,i=r.valueSpec,l=r.styleSpec;return r.validateSpec=ai,i.expression&&Rs(v(e))?K(r):i.expression&&qc(S(e))?Q(r):i.type&&Xt[i.type]?Xt[i.type](r):z(xe({},r,{valueSpec:i.type?l[i.type]:i}))}function $i(r){let e=r.value,i=r.key,l=rt(r);return l.length||(e.indexOf("{fontstack}")===-1&&l.push(new te(i,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&l.push(new te(i,e,'"glyphs" url must include a "{range}" token'))),l}function Ui(r,e=xt){let i=[];return i=i.concat(ai({key:"",value:r,valueSpec:e.$root,styleSpec:e,style:r,validateSpec:ai,objectElementValidators:{glyphs:$i,"*":()=>[]}})),r.constants&&(i=i.concat(d({key:"constants",value:r.constants}))),vr(i)}function yi(r){return function(e){return r(Object.assign({},e,{validateSpec:ai}))}}function vr(r){return[].concat(r).sort(((e,i)=>e.line-i.line))}function tr(r){return function(...e){return vr(r.apply(this,e))}}Ui.source=tr(yi(ht)),Ui.sprite=tr(yi(Ft)),Ui.glyphs=tr(yi($i)),Ui.light=tr(yi(ot)),Ui.sky=tr(yi(wt)),Ui.terrain=tr(yi(Tt)),Ui.state=tr(yi(ri)),Ui.layer=tr(yi(et)),Ui.filter=tr(yi(fe)),Ui.paintProperty=tr(yi(Ae)),Ui.layoutProperty=tr(yi(Xe));let cr={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"};class ur{constructor(e,i){this._globalState=i,this.setValue(e)}evaluate(){var e;return(e=this._literalValue)!==null&&e!==void 0?e:this._compiledValue.evaluate({})}setValue(e){if(e==null||e==="visible"||e==="none")return this._literalValue=e==="none"?"none":"visible",this._compiledValue=void 0,void(this._globalStateRefs=new Set);let i=pc(e,cr,this._globalState);if(i.result==="error")throw this._literalValue="visible",this._compiledValue=void 0,new Error(i.value.map((l=>`${l.key}: ${l.message}`)).join(", "));this._literalValue=void 0,this._compiledValue=i.value,this._globalStateRefs=Za(i.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}}let mr=xt,Lr=Ui,cn=Lr.light,Co=Lr.sky,Ha=Lr.paintProperty,ll=Lr.layoutProperty;function na(r,e){let i=!1;if(e?.length)for(let l of e)r.fire(new Ro(new Error(l.message))),i=!0;return i}class hn{constructor(e,i,l){let h=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let g=new Int32Array(this.arrayBuffer);e=g[0],this.d=(i=g[1])+2*(l=g[2]);for(let C=0;C<this.d*this.d;C++){let w=g[3+C],A=g[3+C+1];h.push(w===A?null:g.subarray(w,A))}let x=g[3+h.length+1];this.keys=g.subarray(g[3+h.length],x),this.bboxes=g.subarray(x),this.insert=this._insertReadonly}else{this.d=i+2*l;for(let g=0;g<this.d*this.d;g++)h.push([]);this.keys=[],this.bboxes=[]}this.n=i,this.extent=e,this.padding=l,this.scale=i/e,this.uid=0;let m=l/i*e;this.min=-m,this.max=e+m}insert(e,i,l,h,m){this._forEachCell(i,l,h,m,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(i),this.bboxes.push(l),this.bboxes.push(h),this.bboxes.push(m)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,i,l,h,m,g){this.cells[m].push(g)}query(e,i,l,h,m){let g=this.min,x=this.max;if(e<=g&&i<=g&&x<=l&&x<=h&&!m)return[...this.keys];{let C=[];return this._forEachCell(e,i,l,h,this._queryCell,C,{},m),C}}_queryCell(e,i,l,h,m,g,x,C){let w=this.cells[m];if(w!==null){let A=this.keys,M=this.bboxes;for(let N of w)if(x[N]===void 0){let L=4*N;(C?C(M[L+0],M[L+1],M[L+2],M[L+3]):e<=M[L+2]&&i<=M[L+3]&&l>=M[L+0]&&h>=M[L+1])?(x[N]=!0,g.push(A[N])):x[N]=!1}}}_forEachCell(e,i,l,h,m,g,x,C){let w=this._convertToCellCoord(e),A=this._convertToCellCoord(i),M=this._convertToCellCoord(l),N=this._convertToCellCoord(h);for(let L=w;L<=M;L++)for(let Z=A;Z<=N;Z++){let X=this.d*Z+L;if((!C||C(this._convertFromCellCoord(L),this._convertFromCellCoord(Z),this._convertFromCellCoord(L+1),this._convertFromCellCoord(Z+1)))&&m.call(this,e,i,l,h,X,g,x,C))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,i=3+this.cells.length+1+1,l=0;for(let g of this.cells)l+=g.length;let h=new Int32Array(i+l+this.keys.length+this.bboxes.length);h[0]=this.extent,h[1]=this.n,h[2]=this.padding;let m=i;for(let g=0;g<e.length;g++){let x=e[g];h[3+g]=m,h.set(x,m),m+=x.length}return h[3+e.length]=m,h.set(this.keys,m),m+=this.keys.length,h[3+e.length+1]=m,h.set(this.bboxes,m),m+=this.bboxes.length,h.buffer}static serialize(e,i){let l=e.toArrayBuffer();return i&&i.push(l),{buffer:l}}static deserialize(e){return new hn(e.buffer)}}let Kn={};function Qt(r,e,i={}){if(Kn[r])throw new Error(`${r} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:r,writeable:!1}),Kn[r]={klass:e,omit:i.omit||[],shallow:i.shallow||[]}}Qt("Object",Object),Qt("Set",Set),Qt("TransferableGridIndex",hn),Qt("Color",Yi),Qt("Error",Error),Qt("AJAXError",ta),Qt("ResolvedImage",Bo),Qt("StylePropertyFunction",xi),Qt("StyleExpression",uc,{omit:["_evaluator"]}),Qt("ZoomDependentExpression",ra),Qt("ZoomConstantExpression",Ih),Qt("CompoundExpression",So,{omit:["_evaluate"]});for(let r in Yt)Yt[r]._classRegistryKey||Qt(`Expression_${r}`,Yt[r]);function Mn(r){var e;return r&&typeof ArrayBuffer<"u"&&(r instanceof ArrayBuffer||((e=r.constructor)===null||e===void 0?void 0:e.name)==="ArrayBuffer")}function Ki(r){return r.$name||r.constructor._classRegistryKey}function _r(r){return!(function(e){if(e===null||typeof e!="object")return!1;let i=Ki(e);return i&&i!=="Object"})(r)&&(r==null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||r instanceof Boolean||r instanceof Number||r instanceof String||r instanceof Date||r instanceof RegExp||r instanceof Blob||r instanceof Error||Mn(r)||Qi(r)||ArrayBuffer.isView(r)||r instanceof ImageData)}function Or(r,e){if(_r(r))return(Mn(r)||Qi(r))&&e&&e.push(r),ArrayBuffer.isView(r)&&e&&e.push(r.buffer),r instanceof ImageData&&e&&e.push(r.data.buffer),r;if(Array.isArray(r)){let m=[];for(let g of r)m.push(Or(g,e));return m}if(typeof r!="object")throw new Error("can't serialize object of type "+typeof r);let i=Ki(r);if(!i)throw new Error(`can't serialize object of unregistered class ${r.constructor.name}`);if(!Kn[i])throw new Error(`${i} is not registered.`);let{klass:l}=Kn[i],h=l.serialize?l.serialize(r,e):{};if(l.serialize){if(h===e?.[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(let m in r){if(!r.hasOwnProperty(m)||Kn[i].omit.includes(m))continue;let g=r[m];h[m]=Kn[i].shallow.includes(m)?g:Or(g,e)}r instanceof Error&&(h.message=r.message)}if(h.$name)throw new Error("$name property is reserved for worker serialization logic.");return i!=="Object"&&(h.$name=i),h}function un(r){if(_r(r))return r;if(Array.isArray(r))return r.map(un);if(typeof r!="object")throw new Error("can't deserialize object of type "+typeof r);let e=Ki(r)||"Object";if(!Kn[e])throw new Error(`can't deserialize unregistered class ${e}`);let{klass:i}=Kn[e];if(!i)throw new Error(`can't deserialize unregistered class ${e}`);if(i.deserialize)return i.deserialize(r);let l=Object.create(i.prototype);for(let h of Object.keys(r)){if(h==="$name")continue;let m=r[h];l[h]=Kn[e].shallow.includes(h)?m:un(m)}return l}class Rr{constructor(){this.first=!0}update(e,i){let l=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=l,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=l,!0):(this.lastFloorZoom>l?(this.lastIntegerZoom=l+1,this.lastIntegerZoomTime=i):this.lastFloorZoom<l&&(this.lastIntegerZoom=l,this.lastIntegerZoomTime=i),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=l,!0))}}function Ma(r){return/[\u02EA\u02EB\u2E80-\u2FDF\u2FF0-\u303F\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FD-\u30FF\u3105-\u312F\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(r))}function oa(r){return/[\u02EA\u02EB\u1100-\u11FF\u1400-\u167F\u18B0-\u18F5\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u3007\u3012\u3013\u3020-\u302F\u3031-\u303F\u3041-\u3096\u309D-\u30FB\u30FD-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE48\uFE50-\uFE57\uFE5F-\uFE62\uFE67-\uFE6F\uFF00-\uFF07\uFF0A-\uFF0C\uFF0E-\uFF19\uFF1F-\uFF3A\uFF3C\uFF3E\uFF40-\uFF5A\uFFE0-\uFFE2\uFFE4-\uFFE7]|\uD802[\uDD80-\uDD9F]|\uD805[\uDD80-\uDDFF]|\uD806[\uDE00-\uDEBF]|\uD811[\uDC00-\uDE7F]|\uD81B[\uDFE0-\uDFE4\uDFF0-\uDFF6]|[\uD81C-\uD822\uD83D\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD30-\uDEFB]|\uD833[\uDEC0-\uDFCF]|\uD834[\uDC00-\uDDFF\uDEE0-\uDF7F]|\uD836[\uDC00-\uDEAF]|\uD83C[\uDC00-\uDE00\uDF00-\uDFFF]|\uD83E[\uDD00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(r))}function Eh(r){return/\s/u.test(String.fromCodePoint(r))}function cl(r){for(let e of r)if(oa(e.codePointAt(0)))return!0;return!1}function Gc(r){for(let e of r)if(!gs(e.codePointAt(0)))return!1;return!0}function Mh(r){let e=r.map((i=>{try{return new RegExp(`\\p{sc=${i}}`,"u").source}catch{return null}})).filter((i=>i));return new RegExp(e.join("|"),"u")}let fs=Mh(["Arab","Dupl","Mong","Ougr","Syrc"]);function gs(r){return!fs.test(String.fromCodePoint(r))}function Fs(r){return!(oa(r)||(e=r,/[\xA7\xA9\xAE\xB1\xBC-\xBE\xD7\xF7\u2016\u2020\u2021\u2030\u2031\u203B\u203C\u2042\u2047-\u2049\u2051\u2100-\u218F\u221E\u2234\u2235\u2300-\u2307\u230C-\u231F\u2324-\u2328\u232B\u237D-\u239A\u23BE-\u23CD\u23CF\u23D1-\u23DB\u23E2-\u2422\u2424-\u24FF\u25A0-\u2619\u2620-\u2767\u2776-\u2793\u2B12-\u2B2F\u2B50-\u2B59\u2BB8-\u2BEB\u3000-\u303F\u30A0-\u30FF\uE000-\uF8FF\uFE30-\uFE6F\uFF00-\uFFEF\uFFFC\uFFFD]|[\uDB80-\uDBFF][\uDC00-\uDFFF]/gim.test(String.fromCodePoint(e))));var e}let Zc=Mh(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function ku(r){return Zc.test(String.fromCodePoint(r))}function cd(r,e){return!(!e&&ku(r)||/[\u0900-\u0DFF\u0F00-\u109F\u1780-\u17FF]/gim.test(String.fromCodePoint(r)))}function ou(r){for(let e of r)if(ku(e.codePointAt(0)))return!0;return!1}let Xa=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(r){this.pluginStatus=r.pluginStatus,this.pluginURL=r.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(r){if(Xa.isParsed())throw new Error("RTL text plugin already registered.");this.applyArabicShaping=r.applyArabicShaping,this.processBidirectionalText=r.processBidirectionalText,this.processStyledBidirectionalText=r.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}syncState(r,e){return o(this,void 0,void 0,(function*(){if(this.isParsed())return this.getState();if(r.pluginStatus!=="loading")return this.setState(r),r;let i=r.pluginURL,l=new Promise((m=>{this.loadScriptResolve=m}));e(i);let h=new Promise((m=>setTimeout((()=>m()),this.TIMEOUT)));if(yield Promise.race([l,h]),this.isParsed()){let m={pluginStatus:"loaded",pluginURL:i};return this.setState(m),m}throw this.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${i}`)}))}};class wr{constructor(e,i){this.isSupportedScript=hl,this.zoom=e,i?(this.now=i.now||0,this.fadeDuration=i.fadeDuration||0,this.zoomHistory=i.zoomHistory||new Rr,this.transition=i.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Rr,this.transition={})}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let e=this.zoom,i=e-Math.floor(e),l=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:i+(1-i)*l}:{fromScale:.5,toScale:1,t:1-(1-l)*i}}}function hl(r){return(function(e,i){for(let l of e)if(!cd(l.codePointAt(0),i))return!1;return!0})(r,Xa.getRTLTextPluginStatus()==="loaded")}let Pa="-transition";class _s{constructor(e,i,l){this.property=e,this.value=i,this.expression=(function(h,m,g){if(Rs(h))return new xi(h,m);if(qc(h)){let x=dc(h,m,g);if(x.result==="error")throw new Error(x.value.map((C=>`${C.key}: ${C.message}`)).join(", "));return x.value}{let x=h;return m.type==="color"&&typeof h=="string"?x=Yi.parse(h):m.type!=="padding"||typeof h!="number"&&!Array.isArray(h)?m.type!=="numberArray"||typeof h!="number"&&!Array.isArray(h)?m.type!=="colorArray"||typeof h!="string"&&!Array.isArray(h)?m.type==="variableAnchorOffsetCollection"&&Array.isArray(h)?x=Xi.parse(h):m.type==="projectionDefinition"&&typeof h=="string"&&(x=bo.parse(h)):x=Ni.parse(h):x=Br.parse(h):x=so.parse(h),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>x}}})(i===void 0?e.specification.default:i,e.specification,l)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(e,i,l){return this.property.possiblyEvaluate(this,e,i,l)}}class Au{constructor(e,i){this.property=e,this.value=new _s(e,void 0,i)}transitioned(e,i){return new Cp(this.property,this.value,i,Dr({},e.transition,this.transition),e.now)}untransitioned(){return new Cp(this.property,this.value,null,{},0)}}class Nl{constructor(e,i){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._globalState=i}hasProperty(e){return e in this._properties.defaultTransitionablePropertyValues}getValue(e){return Ti(this._values[e].value.value)}setValue(e,i){Object.hasOwn(this._values,e)||(this._values[e]=new Au(this._values[e].property,this._globalState)),this._values[e].value=new _s(this._values[e].property,i===null?void 0:Ti(i),this._globalState)}getTransition(e){return Ti(this._values[e].transition)}setTransition(e,i){Object.hasOwn(this._values,e)||(this._values[e]=new Au(this._values[e].property,this._globalState)),this._values[e].transition=Ti(i)||void 0}serialize(){let e={};for(let i of Object.keys(this._values)){let l=this.getValue(i);l!==void 0&&(e[i]=l);let h=this.getTransition(i);h!==void 0&&(e[`${i}${Pa}`]=h)}return e}transitioned(e,i){let l=new Ep(this._properties);for(let h of Object.keys(this._values))l._values[h]=this._values[h].transitioned(e,i._values[h]);return l}untransitioned(){let e=new Ep(this._properties);for(let i of Object.keys(this._values))e._values[i]=this._values[i].untransitioned();return e}}class Cp{constructor(e,i,l,h,m){this.property=e,this.value=i,this.begin=m+h.delay||0,this.end=this.begin+h.duration||0,e.specification.transition&&(h.delay||h.duration)&&(this.prior=l)}possiblyEvaluate(e,i,l){let h=e.now||0,m=this.value.possiblyEvaluate(e,i,l),g=this.prior;if(g){if(h>this.end)return this.prior=null,m;if(this.value.isDataDriven())return this.prior=null,m;if(h<this.begin)return g.possiblyEvaluate(e,i,l);{let x=(h-this.begin)/(this.end-this.begin);return this.property.interpolate(g.possiblyEvaluate(e,i,l),m,Cn(x))}}return m}}class Ep{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,i,l){let h=new Ph(this._properties);for(let m of Object.keys(this._values))h._values[m]=this._values[m].possiblyEvaluate(e,i,l);return h}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class jn{constructor(e,i){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._globalState=i}hasValue(e){return this._values[e].value!==void 0}hasProperty(e){return e in this._properties.defaultPropertyValues}getValue(e){return Ti(this._values[e].value)}setValue(e,i){this._values[e]=new _s(this._values[e].property,i===null?void 0:Ti(i),this._globalState)}serialize(){let e={};for(let i of Object.keys(this._values)){let l=this.getValue(i);l!==void 0&&(e[i]=l)}return e}possiblyEvaluate(e,i,l){let h=new Ph(this._properties);for(let m of Object.keys(this._values))h._values[m]=this._values[m].possiblyEvaluate(e,i,l);return h}}class Ka{constructor(e,i,l){this.property=e,this.value=i,this.parameters=l}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,i,l,h){return this.property.evaluate(this.value,this.parameters,e,i,l,h)}}class Ph{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class mi{constructor(e){this.specification=e}
2possiblyEvaluate(e,i){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(i)}interpolate(e,i,l){let h=lo[this.specification.type];return h?h(e,i,l):e}}class Ii{constructor(e,i){this.specification=e,this.overrides=i}possiblyEvaluate(e,i,l,h){return new Ka(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(i,null,{},l,h)}:e.expression,i)}interpolate(e,i,l){if(e.value.kind!=="constant"||i.value.kind!=="constant")return e;if(e.value.value===void 0||i.value.value===void 0)return new Ka(this,{kind:"constant",value:void 0},e.parameters);let h=lo[this.specification.type];if(h){let m=h(e.value.value,i.value.value,l);return new Ka(this,{kind:"constant",value:m},e.parameters)}return e}evaluate(e,i,l,h,m,g){return e.kind==="constant"?e.value:e.evaluate(i,l,h,m,g)}}class Bs extends Ii{possiblyEvaluate(e,i,l,h){if(e.value===void 0)return new Ka(this,{kind:"constant",value:void 0},i);if(e.expression.kind==="constant"){let m=e.expression.evaluate(i,null,{},l,h),g=e.property.specification.type==="resolvedImage"&&typeof m!="string"?m.name:m,x=this._calculate(g,g,g,i);return new Ka(this,{kind:"constant",value:x},i)}if(e.expression.kind==="camera"){let m=this._calculate(e.expression.evaluate({zoom:i.zoom-1}),e.expression.evaluate({zoom:i.zoom}),e.expression.evaluate({zoom:i.zoom+1}),i);return new Ka(this,{kind:"constant",value:m},i)}return new Ka(this,e.expression,i)}evaluate(e,i,l,h,m,g){if(e.kind==="source"){let x=e.evaluate(i,l,h,m,g);return this._calculate(x,x,x,i)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(i.zoom)-1},l,h),e.evaluate({zoom:Math.floor(i.zoom)},l,h),e.evaluate({zoom:Math.floor(i.zoom)+1},l,h),i):e.value}_calculate(e,i,l,h){return h.zoom>h.zoomHistory.lastIntegerZoom?{from:e,to:i}:{from:l,to:i}}interpolate(e){return e}}class zu{constructor(e){this.specification=e}possiblyEvaluate(e,i,l,h){if(e.value!==void 0){if(e.expression.kind==="constant"){let m=e.expression.evaluate(i,null,{},l,h);return this._calculate(m,m,m,i)}return this._calculate(e.expression.evaluate(new wr(Math.floor(i.zoom-1),i)),e.expression.evaluate(new wr(Math.floor(i.zoom),i)),e.expression.evaluate(new wr(Math.floor(i.zoom+1),i)),i)}}_calculate(e,i,l,h){return h.zoom>h.zoomHistory.lastIntegerZoom?{from:e,to:i}:{from:l,to:i}}interpolate(e){return e}}class Wc{constructor(e){this.specification=e}possiblyEvaluate(e,i,l,h){return!!e.expression.evaluate(i,null,{},l,h)}interpolate(){return!1}}class aa{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let i in e){let l=e[i];l.specification.overridable&&this.overridableProperties.push(i);let h=this.defaultPropertyValues[i]=new _s(l,void 0,void 0),m=this.defaultTransitionablePropertyValues[i]=new Au(l,void 0);this.defaultTransitioningPropertyValues[i]=m.untransitioned(),this.defaultPossiblyEvaluatedValues[i]=h.possiblyEvaluate({})}}}Qt("DataDrivenProperty",Ii),Qt("DataConstantProperty",mi),Qt("CrossFadedDataDrivenProperty",Bs),Qt("CrossFadedProperty",zu),Qt("ColorRampProperty",Wc);let Mp=" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?",Du=" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?";class ka extends vn{constructor(e,i,l){if(super(),this.id=e.id,this.type=e.type,this._globalState=l,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=(function(h,m){return new ur(h,m)})(this.visibility,l),e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter,this._featureFilter=Ca(e.filter,l)),i.layout&&(this._unevaluatedLayout=new jn(i.layout,l)),i.paint)){this._transitionablePaint=new Nl(i.paint,l);for(let h in e.paint)this.setPaintProperty(h,e.paint[h],{validate:!1});for(let h in e.layout)this.setLayoutProperty(h,e.layout[h],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ph(i.paint)}}setFilter(e){this.filter=e,this._featureFilter=Ca(e,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){var i;if(e==="visibility")return this.visibility;if(!((i=this._transitionablePaint)===null||i===void 0)&&i.hasProperty(e))throw new Error(e+Mp);if(!this._unevaluatedLayout)throw new Error(`Cannot get layout property "${e}" on layer type "${this.type}" which has no layout properties.`);return this._unevaluatedLayout.getValue(e)}getLayoutAffectingGlobalStateRefs(){let e=new Set;for(let i of this._visibilityExpression.getGlobalStateRefs())e.add(i);if(this._unevaluatedLayout)for(let i in this._unevaluatedLayout._values){let l=this._unevaluatedLayout._values[i];for(let h of l.getGlobalStateRefs())e.add(h)}for(let i of this._featureFilter.getGlobalStateRefs())e.add(i);return e}getPaintAffectingGlobalStateRefs(){var e;let i=new globalThis.Map;if(this._transitionablePaint)for(let l in this._transitionablePaint._values){let h=this._transitionablePaint._values[l].value;for(let m of h.getGlobalStateRefs()){let g=(e=i.get(m))!==null&&e!==void 0?e:[];g.push({name:l,value:h.value}),i.set(m,g)}}return i}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(e,i,l={}){var h;if(e==="visibility")return this.visibility=i,this._visibilityExpression.setValue(i),void this.recalculateVisibility();!((h=this._transitionablePaint)===null||h===void 0)&&h.hasProperty(e)?this.fire(new Ro(new Error(e+Mp))):i!=null&&this._val
2idate(ll,`layers.${this.id}.layout.${e}`,e,i,l)||this._unevaluatedLayout.setValue(e,i)}getPaintProperty(e){var i,l;if(e.endsWith(Pa)){let h=e.slice(0,-11);if(h==="visibility"||!((i=this._unevaluatedLayout)===null||i===void 0)&&i.hasProperty(h))throw new Error(e+Du);return this._transitionablePaint.getTransition(h)}if(e==="visibility"||!((l=this._unevaluatedLayout)===null||l===void 0)&&l.hasProperty(e))throw new Error(e+Du);return this._transitionablePaint.getValue(e)}setPaintProperty(e,i,l={}){var h;if(e==="visibility"||!((h=this._unevaluatedLayout)===null||h===void 0)&&h.hasProperty(e))return this.fire(new Ro(new Error(e+Du))),!1;if(i!=null&&this._validate(Ha,`layers.${this.id}.paint.${e}`,e,i,l))return!1;if(e.endsWith(Pa))return this._transitionablePaint.setTransition(e.slice(0,-11),i||void 0),!1;{let m=this._transitionablePaint._values[e],g=m.property.specification["property-type"]==="cross-faded-data-driven",x=m.value.isDataDriven(),C=m.value;this._transitionablePaint.setValue(e,i),this._handleSpecialPaintPropertyUpdate(e);let w=this._transitionablePaint._values[e].value;return w.isDataDriven()||x||g||this._handleOverridablePaintPropertyUpdate(e,C,w)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,i,l){return!1}isHidden(e=this.minzoom,i=!1){return!!(this.minzoom&&e<(i?Math.floor(this.minzoom):this.minzoom))||!!(this.maxzoom&&e>=this.maxzoom)||this._evaluatedVisibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(e,i){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,i)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,i)}serialize(){var e,i;
vendor: 15,197 bytes, line 2
2let l={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:(e=this._unevaluatedLayout)===null||e===void 0?void 0:e.serialize(),paint:(i=this._transitionablePaint)===null||i===void 0?void 0:i.serialize()};return this.visibility&&(l.layout||(l.layout={}),l.layout.visibility=this.visibility),Qn(l,((h,m)=>!(h===void 0||m==="layout"&&!Object.keys(h).length||m==="paint"&&!Object.keys(h).length)))}_validate(e,i,l,h,m={}){return m?.validate!==!1&&na(this,e.call(Lr,{key:i,layerType:this.type,objectKey:l,value:h,styleSpec:xt,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let e in this.paint._values){let i=this.paint.get(e);if(i instanceof Ka&&al(i.property.specification)&&(i.value.kind==="source"||i.value.kind==="composite")&&i.value.isStateDependent)return!0}return!1}}let Pp;var kp={get paint(){return Pp=Pp||new aa({"raster-opacity":new mi(xt.paint_raster["raster-opacity"]),"raster-hue-rotate":new mi(xt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new mi(xt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new mi(xt.paint_raster["raster-brightness-max"]),"raster-saturation":new mi(xt.paint_raster["raster-saturation"]),"raster-contrast":new mi(xt.paint_raster["raster-contrast"]),resampling:new mi(xt.paint_raster.resampling),"raster-resampling":new mi(xt.paint_raster["raster-resampling"]),"raster-fade-duration":new mi(xt.paint_raster["raster-fade-duration"])})}};class hd extends ka{constructor(e,i){super(e,kp,i)}}let ud={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class ul{constructor(e,i){this._structArray=e,this._pos1=i*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class pn{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,i){return e._trim(),i&&(e.isTransferred=!0,i.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let i=Object.create(this.prototype);return i.arrayBuffer=e.arrayBuffer,i.length=e.length,i.capacity=e.arrayBuffer.byteLength/i.bytesPerElement,i._refreshViews(),i}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let i=this.uint8;this._refreshViews(),i&&this.uint8.set(i)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}}function Pr(r,e=1){let i=0,l=0;return{members:r.map((h=>{let m=ud[h.type].BYTES_PER_ELEMENT,g=i=au(i,Math.max(e,m)),x=h.components||1;return l=Math.max(l,m),i+=m*x,{name:h.name,type:h.type,components:x,offset:g}})),size:au(i,Math.max(l,e)),alignment:e}}function au(r,e){return Math.ceil(r/e)*e}class mc extends pn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i){let l=this.length;return this.resize(l+1),this.emplace(l,e,i)}emplace(e,i,l){let h=2*e;return this.int16[h+0]=i,this.int16[h+1]=l,e}}mc.prototype.bytesPerElement=4,Qt("StructArrayLayout2i4",mc);class Lu extends pn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,l){let h=this.length;return this.resize(h+1),this.emplace(h,e,i,l)}emplace(e,i,l,h){let m=3*e;return this.int16[m+0]=i,this.int16[m+1]=l,this.int16[m+2]=h,e}}Lu.prototype.bytesPerElement=6,Qt("StructArrayLayout3i6",Lu);class Ru extends pn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,l,h){let m=this.length;return this.resize(m+1),this.emplace(m,e,i,l,h)}emplace(e,i,l,h,m){let g=4*e;return this.int16[g+0]=i,this.int16[g+1]=l,this.int16[g+2]=h,this.int16[g+3]=m,e}}Ru.prototype.bytesPerElement=8,Qt("StructArrayLayout4i8",Ru);class ro extends pn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,l,h,m,g){let x=this.length;return this.resize(x+1),this.emplace(x,e,i,l,h,m,g)}emplace(e,i,l,h,m,g,x){let C=6*e;return this.int16[C+0]=i,this.int16[C+1]=l,this.int16[C+2]=h,this.int16[C+3]=m,this.int16[C+4]=g,this.int16[C+5]=x,e}}ro.prototype.bytesPerElement=12,Qt("StructArrayLayout2i4i12",ro);class co extends pn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,l,h,m,g){let x=this.length;return this.resize(x+1),this.emplace(x,e,i,l,h,m,g)}emplace(e,i,l,h,m,g,x){let C=4*e,w=8*e;return this.int16[C+0]=i,this.int16[C+1]=l,this.uint8[w+4]=h,this.uint8[w+5]=m,this.uint8[w+6]=g,this.uint8[w+7]=x,e}}co.prototype.bytesPerElement=8,Qt("StructArrayLayout2i4ub8",co);class kh extends pn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i){let l=this.length;return this.resize(l+1),this.emplace(l,e,i)}emplace(e,i,l){let h=2*e;return this.float32[h+0]=i,this.float32[h+1]=l,e}}kh.prototype.bytesPerElement=8,Qt("StructArrayLayout2f8",kh);class Os extends pn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,l,h,m,g,x,C,w,A){let M=this.length;return this.resize(M+1),this.emplace(M,e,i,l,h,m,g,x,C,w,A)}emplace(e,i,l,h,m,g,x,C,w,A,M){let N=10*e;return this.uint16[N+0]=i,this.uint16[N+1]=l,this.uint16[N+2]=h,this.uint16[N+3]=m,this.uint16[N+4]=g,this.uint16[N+5]=x,this.uint16[N+6]=C,this.uint16[N+7]=w,this.uint16[N+8]=A,this.uint16[N+9]=M,e}}Os.prototype.bytesPerElement=20,Qt("StructArrayLayout10ui20",Os);class su extends pn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,l,h,m,g,x,C){let w=this.length;return this.resize(w+1),this.emplace(w,e,i,l,h,m,g,x,C)}emplace(e,i,l,h,m,g,x,C,w){let A=8*e;return this.uint16[A+0]=i,this.uint16[A+1]=l,this.uint16[A+2]=h,this.uint16[A+3]=m,this.uint16[A+4]=g,this.uint16[A+5]=x,this.uint16[A+6]=C,this.uint16[A+7]=w,e}}su.prototype.bytesPerElement=16,Qt("StructArrayLayout8ui16",su);class Ul extends pn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,l,h,m,g,x,C,w,A,M,N){let L=this.length;return this.resize(L+1),this.emplace(L,e,i,l,h,m,g,x,C,w,A,M,N)}emplace(e,i,l,h,m,g,x,C,w,A,M,N,L){let Z=12*e;return this.int16[Z+0]=i,this.int16[Z+1]=l,this.int16[Z+2]=h,this.int16[Z+3]=m,this.uint16[Z+4]=g,this.uint16[Z+5]=x,this.uint16[Z+6]=C,this.uint16[Z+7]=w,this.int16[Z+8]=A,this.int16[Z+9]=M,this.int16[Z+10]=N,this.int16[Z+11]=L,e}}Ul.prototype.bytesPerElement=24,Qt("StructArrayLayout4i4ui4i24",Ul);class Fu extends pn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,l){let h=this.length;return this.resize(h+1),this.emplace(h,e,i,l)}emplace(e,i,l,h){let m=3*e;return this.float32[m+0]=i,this.float32[m+1]=l,this.float32[m+2]=h,e}}Fu.prototype.bytesPerElement=12,Qt("StructArrayLayout3f12",Fu);class Ah extends pn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint32[1*e+0]=i,e}}Ah.prototype.bytesPerElement=4,Qt("StructArrayLayout1ul4",Ah);class Bu extends pn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,l,h,m,g,x,C,w){let A=this.length;return this.resize(A+1),this.emplace(A,e,i,l,h,m,g,x,C,w)}emplace(e,i,l,h,m,g,x,C,w,A){let M=10*e,N=5*e;return this.int16[M+0]=i,this.int16[M+1]=l,this.int16[M+2]=h,this.int16[M+3]=m,this.int16[M+4]=g,this.int16[M+5]=x,this.uint32[N+3]=C,this.uint16[M+8]=w,this.uint16[M+9]=A,e}}Bu.prototype.bytesPerElement=20,Qt("StructArrayLayout6i1ul2ui20",Bu);class jl extends pn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,l,h,m,g){let x=this.length;return this.resize(x+1),this.emplace(x,e,i,l,h,m,g)}emplace(e,i,l,h,m,g,x){let C=6*e;return this.int16[C+0]=i,this.int16[C+1]=l,this.int16[C+2]=h,this.int16[C+3]=m,this.int16[C+4]=g,this.int16[C+5]=x,e}}jl.prototype.bytesPerElement=12,Qt("StructArrayLayout2i2i2i12",jl);class fc extends pn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,l,h,m){let g=this.length;return this.resize(g+1),this.emplace(g,e,i,l,h,m)}emplace(e,i,l,h,m,g){let x=4*e,C=8*e;return this.float32[x+0]=i,this.float32[x+1]=l,this.float32[x+2]=h,this.int16[C+6]=m,this.int16[C+7]=g,e}}fc.prototype.bytesPerElement=16,Qt("StructArrayLayout2f1f2i16",fc);class Ou extends pn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,l,h,m,g){let x=this.length;return this.resize(x+1),this.emplace(x,e,i,l,h,m,g)}emplace(e,i,l,h,m,g,x){let C=16*e,w=4*e,A=8*e;return this.uint8[C+0]=i,this.uint8[C+1]=l,this.float32[w+1]=h,this.float32[w+2]=m,this.int16[A+6]=g,this.int16[A+7]=x,e}}Ou.prototype.bytesPerElement=16,Qt("StructArrayLayout2ub2f2i16",Ou);class zh extends pn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,l){let h=this.length;return this.resize(h+1),this.emplace(h,e,i,l)}emplace(e,i,l,h){let m=3*e;return this.uint16[m+0]=i,this.uint16[m+1]=l,this.uint16[m+2]=h,e}}zh.prototype.bytesPerElement=6,Qt("StructArrayLayout3ui6",zh);class Hc extends pn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,l,h,m,g,x,C,w,A,M,N,L,Z,X,ie,ne){let ue=this.length;return this.resize(ue+1),this.emplace(ue,e,i,l,h,m,g,x,C,w,A,M,N,L,Z,X,ie,ne)}emplace(e,i,l,h,m,g,x,C,w,A,M,N,L,Z,X,ie,ne,ue){let se=24*e,me=12*e,be=48*e;return this.int16[se+0]=i,this.int16[se+1]=l,this.uint16[se+2]=h,this.uint16[se+3]=m,this.uint32[me+2]=g,this.uint32[me+3]=x,this.uint32[me+4]=C,this.uint16[se+10]=w,this.uint16[se+11]=A,this.uint16[se+12]=M,this.float32[me+7]=N,this.float32[me+8]=L,this.uint8[be+36]=Z,this.uint8[be+37]=X,this.uint8[be+38]=ie,this.uint32[me+10]=ne,this.int16[se+22]=ue,e}}Hc.prototype.bytesPerElement=48,Qt("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Hc);class lu extends pn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,l,h,m,g,x,C,w,A,M,N,L,Z,X,ie,ne,ue,se,me,be,Ce,We,Je,mt,at,vt,bt){let yt=this.length;return this.resize(yt+1),this.emplace(yt,e,i,l,h,m,g,x,C,w,A,M,N,L,Z,X,ie,ne,ue,se,me,be,Ce,We,Je,mt,at,vt,bt)}emplace(e,i,l,h,m,g,x,C,w,A,M,N,L,Z,X,ie,ne,ue,se,me,be,Ce,We,Je,mt,at,vt,bt,yt){let lt=32*e,qt=16*e;return this.int16[lt+0]=i,this.int16[lt+1]=l,this.int16[lt+2]=h,this.int16[lt+3]=m,this.int16[lt+4]=g,this.int16[lt+5]=x,this.int16[lt+6]=C,this.int16[lt+7]=w,this.uint16[lt+8]=A,this.uint16[lt+9]=M,this.uint16[lt+10]=N,this.uint16[lt+11]=L,this.uint16[lt+12]=Z,this.uint16[lt+13]=X,this.uint16[lt+14]=ie,this.uint16[lt+15]=ne,this.uint16[lt+16]=ue,this.uint16[lt+17]=se,this.uint16[lt+18]=me,this.uint16[lt+19]=be,this.uint16[lt+20]=Ce,this.uint16[lt+21]=We,this.uint16[lt+22]=Je,this.uint32[qt+12]=mt,this.float32[qt+13]=at,this.float32[qt+14]=vt,this.uint16[lt+30]=bt,this.uint16[lt+31]=yt,e}}lu.prototype.bytesPerElement=64,Qt("StructArrayLayout8i15ui1ul2f2ui64",lu);class cu extends pn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.float32[1*e+0]=i,e}}cu.prototype.bytesPerElement=4,Qt("StructArrayLayout1f4",cu);class Dh extends pn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,l){let h=this.length;return this.resize(h+1),this.emplace(h,e,i,l)}emplace(e,i,l,h){let m=3*e;return this.uint16[6*e+0]=i,this.float32[m+1]=l,this.float32[m+2]=h,e}}Dh.prototype.bytesPerElement=12,Qt("StructArrayLayout1ui2f12",Dh);class Xc extends pn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,l){let h=this.length;return this.resize(h+1),this.emplace(h,e,i,l)}emplace(e,i,l,h){let m=4*e;return this.uint32[2*e+0]=i,this.uint16[m+2]=l,this.uint16[m+3]=h,e}}Xc.prototype.bytesPerElement=8,Qt("StructArrayLayout1ul2ui8",Xc);class _ extends pn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i){let l=this.length;return this.resize(l+1),this.emplace(l,e,i)}emplace(e,i,l){let h=2*e;return this.uint16[h+0]=i,this.uint16[h+1]=l,e}}_.prototype.bytesPerElement=4,Qt("StructArrayLayout2ui4",_);class t extends pn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint16[1*e+0]=i,e}}t.prototype.bytesPerElement=2,Qt("StructArrayLayout1ui2",t);class a extends pn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,l,h){let m=this.length;return this.resize(m+1),this.emplace(m,e,i,l,h)}emplace(e,i,l,h,m){let g=4*e;return this.float32[g+0]=i,this.float32[g+1]=l,this.float32[g+2]=h,this.float32[g+3]=m,e}}a.prototype.bytesPerElement=16,Qt("StructArrayLayout4f16",a);class p extends ul{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}
vendor: 4,681 bytes, line 2
2get anchorPoint(){return new pe(this.anchorPointX,this.anchorPointY)}}p.prototype.size=20;class f extends Bu{get(e){return new p(this,e)}}Qt("CollisionBoxArray",f);class b extends ul{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}b.prototype.size=48;class P extends Hc{get(e){return new b(this,e)}}Qt("PlacedSymbolArray",P);class D extends ul{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}D.prototype.size=64;class B extends lu{get(e){return new D(this,e)}}Qt("SymbolInstanceArray",B);class U extends cu{getoffsetX(e){return this.float32[1*e+0]}}Qt("GlyphOffsetArray",U);class $ extends Lu{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}Qt("SymbolLineVertexArray",$);class Y extends ul{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}Y.prototype.size=12;class ee extends Dh{get(e){return new Y(this,e)}}Qt("TextAnchorOffsetArray",ee);class oe extends ul{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]}}oe.prototype.size=8;class _e extends Xc{get(e){return new oe(this,e)}}Qt("FeatureIndexArray",_e);
vendor: 4,186 bytes, line 2
2class Ie extends mc{}class ze extends mc{}class Ee extends mc{}class De extends ro{}class je extends co{}class Le extends kh{}class we extends Os{}class qe extends su{}class Fe extends Ul{}class it extends Fu{}class ft extends Ah{}class _t extends jl{}class Rt extends Ou{}class Dt extends zh{}class _i extends _{}let Gt=Pr([{name:"a_pos",components:2,type:"Int16"}],4),{members:Et}=Gt;class ti{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=e}prepareSegment(e,i,l,h){let m=this.segments[this.segments.length-1];return e>ti.MAX_VERTEX_ARRAY_LENGTH&&Gr(`Max vertices per segment is ${ti.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${ti.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!m||m.vertexLength+e>ti.MAX_VERTEX_ARRAY_LENGTH||m.sortKey!==h?this.createNewSegment(i,l,h):m}createNewSegment(e,i,l){let h={vertexOffset:e.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0,vaos:{}};return l!==void 0&&(h.sortKey=l),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(h),h}getOrCreateLatestSegment(e,i,l){return this.prepareSegment(0,e,i,l)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let e of this.segments)for(let i in e.vaos)e.vaos[i].destroy()}static simpleSegment(e,i,l,h){return new ti([{vertexOffset:e,primitiveOffset:i,vertexLength:l,primitiveLength:h,vaos:{},sortKey:0}])}}function Ci(r,e){return 256*(r=$r(Math.floor(r),0,255))+$r(Math.floor(e),0,255)}ti.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Qt("SegmentVector",ti);let fr=Pr([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),Pn=Pr([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]);var kr,qn,kn,ho={exports:{}},tn={exports:{}},sa={exports:{}},Eo=(function(){if(kn)return ho.exports;kn=1;var r=(kr||(kr=1,tn.exports=function(i,l){var h,m,g,x,C,w,A,M;for(m=i.length-(h=3&i.length),g=l,C=3432918353,w=461845907,M=0;M<m;)A=255&i.charCodeAt(M)|(255&i.charCodeAt(++M))<<8|(255&i.charCodeAt(++M))<<16|(255&i.charCodeAt(++M))<<24,++M,g=27492+(65535&(x=5*(65535&(g=(g^=A=(65535&(A=(A=(65535&A)*C+(((A>>>16)*C&65535)<<16)&4294967295)<<15|A>>>17))*w+(((A>>>16)*w&65535)<<16)&4294967295)<<13|g>>>19))+((5*(g>>>16)&65535)<<16)&4294967295))+((58964+(x>>>16)&65535)<<16);switch(A=0,h){case 3:A^=(255&i.charCodeAt(M+2))<<16;case 2:A^=(255&i.charCodeAt(M+1))<<8;case 1:g^=A=(65535&(A=(A=(65535&(A^=255&i.charCodeAt(M)))*C+(((A>>>16)*C&65535)<<16)&4294967295)<<15|A>>>17))*w+(((A>>>16)*w&65535)<<16)&4294967295}return g^=i.length,g=2246822507*(65535&(g^=g>>>16))+((2246822507*(g>>>16)&65535)<<16)&4294967295,g=3266489909*(65535&(g^=g>>>13))+((3266489909*(g>>>16)&65535)<<16)&4294967295,(g^=g>>>16)>>>0}),tn.exports),e=(qn||(qn=1,sa.exports=function(i,l){for(var h,m=i.length,g=l^m,x=0;m>=4;)h=1540483477*(65535&(h=255&i.charCodeAt(x)|(255&i.charCodeAt(++x))<<8|(255&i.charCodeAt(++x))<<16|(255&i.charCodeAt(++x))<<24))+((1540483477*(h>>>16)&65535)<<16),g=1540483477*(65535&g)+((1540483477*(g>>>16)&65535)<<16)^(h=1540483477*(65535&(h^=h>>>24))+((1540483477*(h>>>16)&65535)<<16)),m-=4,++x;switch(m){case 3:g^=(255&i.charCodeAt(x+2))<<16;case 2:g^=(255&i.charCodeAt(x+1))<<8;case 1:g=1540483477*(65535&(g^=255&i.charCodeAt(x)))+((1540483477*(g>>>16)&65535)<<16)}return g=1540483477*(65535&(g^=g>>>13))+((1540483477*(g>>>16)&65535)<<16),(g^=g>>>15)>>>0}),sa.exports);return ho.exports=r,ho.exports.murmur3=r,ho.exports.murmur2=e,ho.exports})(),uo=Ne(Eo);class jo{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,i,l,h){this.ids.push(gc(e)),this.positions.push(i,l,h)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let i=gc(e),l=0,h=this.ids.length-1;for(;l<h;){let g=l+h>>1;this.ids[g]>=i?h=g:l=g+1}let m=[];for(;this.ids[l]===i;)m.push({index:this.positions[3*l],start:this.positions[3*l+1],end:this.positions[3*l+2]}
vendor: 4,349 bytes, line 2
2),l++;return m}static serialize(e,i){let l=new Float64Array(e.ids),h=new Uint32Array(e.positions);return la(l,h,0,l.length-1),i&&i.push(l.buffer,h.buffer),{ids:l,positions:h}}static deserialize(e){let i=new jo;return i.ids=e.ids,i.positions=e.positions,i.indexed=!0,i}}function gc(r){let e=+r;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:uo(String(r))}function la(r,e,i,l){for(;i<l;){let h=r[i+l>>1],m=i-1,g=l+1;for(;;){do m++;while(r[m]<h);do g--;while(r[g]>h);if(m>=g)break;_c(r,m,g),_c(e,3*m,3*g),_c(e,3*m+1,3*g+1),_c(e,3*m+2,3*g+2)}g-i<l-g?(la(r,e,i,g),i=g+1):(la(r,e,g+1,l),l=g)}}function _c(r,e,i){let l=r[e];r[e]=r[i],r[i]=l}Qt("FeaturePositionMap",jo);class Mo{constructor(e,i){this.gl=e.gl,this.location=i}}class Aa extends Mo{constructor(e,i){super(e,i),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}}class yc extends Mo{constructor(e,i){super(e,i),this.current=[0,0,0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]&&e[3]===this.current[3]||(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}}class Vu extends Mo{constructor(e,i){super(e,i),this.current=Yi.transparent}set(e){e.r===this.current.r&&e.g===this.current.g&&e.b===this.current.b&&e.a===this.current.a||(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}}let pl=new Float32Array(16);function Vs(r){return[Ci(255*r.r,255*r.g),Ci(255*r.b,255*r.a)]}class za{constructor(e,i,l){this.value=e,this.uniformNames=i.map((h=>`u_${h}`)),this.type=l}setUniform(e,i,l){e.set(l.constantOr(this.value))}getBinding(e,i,l){return this.type==="color"?new Vu(e,i):new Aa(e,i)}}class ys{constructor(e,i){this.uniformNames=i.map((l=>`u_${l}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,i){this.pixelRatioFrom=i.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=i.tlbr,this.patternTo=e.tlbr}setConstantDashPositions(e,i){this.dashTo=[0,e.y,e.height,e.width],this.dashFrom=[0,i.y,i.height,i.width]}setUniform(e,i,l,h){let m=null;h==="u_pattern_to"?m=this.patternTo:h==="u_pattern_from"?m=this.patternFrom:h==="u_dasharray_to"?m=this.dashTo:h==="u_dasharray_from"?m=this.dashFrom:h==="u_pixel_ratio_to"?m=this.pixelRatioTo:h==="u_pixel_ratio_from"&&(m=this.pixelRatioFrom),m!==null&&e.set(m)}getBinding(e,i,l){return l.startsWith("u_pattern")||l.startsWith("u_dasharray_")?new yc(e,i):new Aa(e,i)}}class dn{constructor(e,i,l,h){this.expression=e,this.type=l,this.maxValue=0,this.paintVertexAttributes=i.map((m=>({name:`a_${m}`,type:"Float32",components:l==="color"?2:1,offset:0}))),this.paintVertexArray=new h}populatePaintArray(e,i,l){let h=this.paintVertexArray.length,m=this.expression.evaluate(new wr(0,l),i,{},l.canonical,[],l.formattedSection);this.paintVertexArray.resize(e),this._setPaintValue(h,e,m)}updatePaintArray(e,i,l,h,m){let g=this.expression.evaluate(new wr(0,m),l,h);this._setPaintValue(e,i,g)}_setPaintValue(e,i,l){if(this.type==="color"){let h=Vs(l);for(let m=e;m<i;m++)this.paintVertexArray.emplace(m,h[0],h[1])}else{for(let h=e;h<i;h++)this.paintVertexArray.emplace(h,l);this.maxValue=Math.max(this.maxValue,Math.abs(l))}}upload(e){var i,l;!((i=this.paintVertexArray)===null||i===void 0)&&i.arrayBuffer.byteLength&&(!((l=this.paintVertexBuffer)===null||l===void 0)&&l.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Kr{constructor(e,i,l,h,m,g){this.expression=e,this.uniformNames=i.map((x=>`u_${x}_t`)),this.type=l,this.useIntegerZoom=h,this.zoom=m,this.maxValue=0,this.paintVertexAttributes=i.map((x=>({name:`a_${x}`,type:"Float32",components:l==="color"?4:2,offset:0}))),this.paintVertexArray=new g}populatePaintArray(e,i,l){let h=this.expression.evaluate(new wr(this.zoom,l),i,{},l.canonical,[],l.formattedSection),m=this.expression.evaluate(new wr(this.zoom+1,l),i,{},l.canonical,[],l.formattedSection),g=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(g,e,h,m)}updatePaintArray(e,i,l,h,m){let g=this.expression.evaluate(new wr(this.zoom,m),l,h),x=this.expression.evaluate(new wr(this.zoom+1,m),l,h);this._setPaintValue(e,i,g,x)}
2_setPaintValue(e,i,l,h){if(this.type==="color"){let m=Vs(l),g=Vs(h);for(let x=e;x<i;x++)this.paintVertexArray.emplace(x,m[0],m[1],g[0],g[1])}else{for(let m=e;m<i;m++)this.paintVertexArray.emplace(m,l,h);this.maxValue=Math.max(this.maxValue,Math.abs(l),Math.abs(h))}}upload(e){var i,l;!((i=this.paintVertexArray)===null||i===void 0)&&i.arrayBuffer.byteLength&&(!((l=this.paintVertexBuffer)===null||l===void 0)&&l.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,i){let l=this.useIntegerZoom?Math.floor(i.zoom):i.zoom,h=$r(this.expression.interpolationFactor(l,this.zoom,this.zoom+1),0,1);e.set(h)}getBinding(e,i,l){return new Aa(e,i)}}class Yn{constructor(e,i,l,h,m,g){this.expression=e,this.type=i,this.useIntegerZoom=l,this.zoom=h,this.layerId=g,this.zoomInPaintVertexArray=new m,this.zoomOutPaintVertexArray=new m}populatePaintArray(e,i,l){let h=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(h,e,this.getPositionIds(i),l)}updatePaintArray(e,i,l,h,m){this._setPaintValues(e,i,this.getPositionIds(l),m)}_setPaintValues(e,i,l,h){let m=this.getPositions(h);if(!m||!l)return;let g=m[l.min],x=m[l.mid],C=m[l.max];if(g&&x&&C)for(let w=e;w<i;w++)this.emplace(this.zoomInPaintVertexArray,w,x,g),this.emplace(this.zoomOutPaintVertexArray,w,x,C)}upload(e){var i,l;if(!((i=this.zoomInPaintVertexArray)===null||i===void 0)&&i.arrayBuffer.byteLength&&(!((l=this.zoomOutPaintVertexArray)===null||l===void 0)&&l.arrayBuffer.byteLength)){let h=this.getVertexAttributes();this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,h,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,h,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class Yr extends Yn{getPositions(e){return e.imagePositions}getPositionIds(e){var i;return(i=e.patterns)===null||i===void 0?void 0:i[this.layerId]}getVertexAttributes(){return fr.members}emplace(e,i,l,h){e.emplace(i,l.tlbr[0],l.tlbr[1],l.tlbr[2],l.tlbr[3],h.tlbr[0],h.tlbr[1],h.tlbr[2],h.tlbr[3],l.pixelRatio,h.pixelRatio)}}class Ns extends Yn{getPositions(e){return e.dashPositions}getPositionIds(e){var i;return(i=e.dashes)===null||i===void 0?void 0:i[this.layerId]}getVertexAttributes(){return Pn.members}emplace(e,i,l,h){e.emplace(i,0,l.y,l.height,l.width,0,h.y,h.height,h.width)}}class Lh{constructor(e,i,l){this.binders={},this._buffers=[];let h=[];for(let m in e.paint._values){if(!l(m))continue;let g=e.paint.get(m);if(!(g instanceof Ka&&al(g.property.specification)))continue;let x=Ap(m,e.type),C=g.value,w=g.property.specification.type,A=g.property.useIntegerZoom,M=g.property.specification["property-type"],N=M==="cross-faded"||M==="cross-faded-data-driven";if(C.kind==="constant")this.binders[m]=N?new ys(C.value,x):new za(C.value,x,w),h.push(`/u_${m}`);else if(C.kind==="source"||N){let L=pd(m,w,"source");this.binders[m]=N?m==="line-dasharray"?new Ns(C,w,A,i,L,e.id):new Yr(C,w,A,i,L,e.id):new dn(C,x,w,L),h.push(`/a_${m}`)}else{let L=pd(m,w,"composite");this.binders[m]=new Kr(C,x,w,A,i,L),h.push(`/z_${m}`)}}this.cacheKey=h.sort().join("")}getMaxValue(e){let i=this.binders[e];return i instanceof dn||i instanceof Kr?i.maxValue:0}populatePaintArrays(e,i,l){for(let h in this.binders){let m=this.binders[h];(m instanceof dn||m instanceof Kr||m instanceof Yn)&&m.populatePaintArray(e,i,l)}}setConstantPatternPositions(e,i){for(let l in this.binders){let h=this.binders[l];h instanceof ys&&h.setConstantPatternPositions(e,i)}}setConstantDashPositions(e,i){for(let l in this.binders){let h=this.binders[l];h instanceof ys&&h.setConstantDashPositions(e,i)}}updatePaintArrays(e,i,l,h,m){let g=!1;for(let x in e){let C=i.getPositions(x);for(let w of C){let A=l.feature(w.index);for(let M in this.binders){let N=this.binders[M];if((N instanceof dn||N instanceof Kr||N instanceof Yn)&&N.expression.isStateDependent===!0){let L=h.paint.get(M);N.expression=L.value,N.updatePaintArray(w.start,w.end,A,e[x],m),g=!0}}}}return g}
vendor: 9,867 bytes, line 2
2defines(){let e=[];for(let i in this.binders){let l=this.binders[i];(l instanceof za||l instanceof ys)&&e.push(...l.uniformNames.map((h=>`#define HAS_UNIFORM_${h}`)))}return e}getBinderAttributes(){let e=[];for(let i in this.binders){let l=this.binders[i];if(l instanceof dn||l instanceof Kr)for(let h of l.paintVertexAttributes)e.push(h.name);else if(l instanceof Yn){let h=l.getVertexAttributes();for(let m of h)e.push(m.name)}}return e}getBinderUniforms(){let e=[];for(let i in this.binders){let l=this.binders[i];if(l instanceof za||l instanceof ys||l instanceof Kr)for(let h of l.uniformNames)e.push(h)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,i){let l=[];for(let h in this.binders){let m=this.binders[h];if(m instanceof za||m instanceof ys||m instanceof Kr){for(let g of m.uniformNames)if(i[g]){let x=m.getBinding(e,i[g],g);l.push({name:g,property:h,binding:x})}}}return l}setUniforms(e,i,l,h){for(let{name:m,property:g,binding:x}of i)this.binders[g].setUniform(x,h,l.get(g),m)}updatePaintBuffers(e){this._buffers=[];for(let i in this.binders){let l=this.binders[i];if(e&&l instanceof Yn){let h=e.fromScale===2?l.zoomInPaintVertexBuffer:l.zoomOutPaintVertexBuffer;h&&this._buffers.push(h)}else(l instanceof dn||l instanceof Kr)&&l.paintVertexBuffer&&this._buffers.push(l.paintVertexBuffer)}}upload(e){for(let i in this.binders){let l=this.binders[i];(l instanceof dn||l instanceof Kr||l instanceof Yn)&&l.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let i=this.binders[e];(i instanceof dn||i instanceof Kr||i instanceof Yn)&&i.destroy()}}}class ql{constructor(e,i,l=()=>!0){this.programConfigurations={};for(let h of e)this.programConfigurations[h.id]=new Lh(h,i,l);this.needsUpload=!1,this._featureMap=new jo,this._bufferOffset=0}populatePaintArrays(e,i,l,h){for(let m in this.programConfigurations)this.programConfigurations[m].populatePaintArrays(e,i,h);i.id!==void 0&&this._featureMap.add(i.id,l,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,i,l,h){for(let m of l)this.needsUpload=this.programConfigurations[m.id].updatePaintArrays(e,this._featureMap,i,m,h)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let i in this.programConfigurations)this.programConfigurations[i].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}}function Ap(r,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-dasharray":["dasharray_to","dasharray_from"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[r]||[r.replace(`${e}-`,"").replace(/-/g,"_")]}function pd(r,e,i){let l={color:{source:kh,composite:a},number:{source:cu,composite:kh}},h=(function(m){return{"line-pattern":{source:we,composite:we},"fill-pattern":{source:we,composite:we},"fill-extrusion-pattern":{source:we,composite:we},"line-dasharray":{source:qe,composite:qe}}[m]})(r);return h?.[i]||l[e][i]}Qt("ConstantBinder",za),Qt("CrossFadedConstantBinder",ys),Qt("SourceExpressionBinder",dn),Qt("CrossFadedPatternBinder",Yr),Qt("CrossFadedDasharrayBinder",Ns),Qt("CompositeExpressionBinder",Kr),Qt("ProgramConfiguration",Lh,{omit:["_buffers"]}),Qt("ProgramConfigurationSet",ql);let Kc=Math.pow(2,14)-1,$l=-Kc-1;function xc(r){let e=pi/r.extent,i=r.loadGeometry();for(let l of i)for(let h of l){let m=Math.round(h.x*e),g=Math.round(h.y*e);h.x=$r(m,$l,Kc),h.y=$r(g,$l,Kc),(m<h.x||m>h.x+1||g<h.y||g>h.y+1)&&Gr("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return i}function vc(r,e){return{type:r.type,id:r.id,properties:r.properties,geometry:e?xc(r):[]}}let zp=-32768;function Dp(r,e,i,l,h){r.emplaceBack(zp+8*e+l,zp+8*i+h)}class Nu{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((i=>i.id)),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new ze,this.indexArray=new Dt,this.segments=new ti,this.programConfigurations=new ql(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((i=>i.isStateDependent())).map((i=>i.id))}populate(e,i,l){let h=this.layers[0],m=[],g=null,x=!1,C=h.type==="heatmap";if(h.type==="circle"){let A=h;g=A.layout.get("circle-sort-key"),x=!g.isConstant(),C||(C=A.paint.get("circle-pitch-alignment")==="map")}let w=C?i.subdivisionGranularity.circle:1;for(let{feature:A,id:M,index:N,sourceLayerIndex:L}of e){let Z=this.layers[0]._featureFilter.needGeometry,X=vc(A,Z);if(!this.layers[0]._featureFilter.filter(new wr(this.zoom),X,l))continue;let ie=x?g.evaluate(X,{},l):void 0,ne={id:M,properties:A.properties,type:A.type,sourceLayerIndex:L,index:N,geometry:Z?X.geometry:xc(A),patterns:{},sortKey:ie};m.push(ne)}x&&m.sort(((A,M)=>A.sortKey-M.sortKey));for(let A of m){let{geometry:M,index:N,sourceLayerIndex:L}=A,Z=e[N].feature;this.addFeature(A,M,N,l,w),i.featureIndex.insert(Z,M,N,L,this.index)}}update(e,i,l){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,{imagePositions:l})}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Et),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,i,l,h,m=1){let g;switch(m){case 1:g=[0,7];break;case 3:g=[0,2,5,7];break;case 5:g=[0,1,3,4,6,7];break;case 7:g=[0,1,2,3,4,5,6,7];break;default:throw new Error(`Invalid circle bucket granularity: ${m}; valid values are 1, 3, 5, 7.`)}let x=g.length;for(let C of i)for(let w of C){let A=w.x,M=w.y;if(A<0||A>=pi||M<0||M>=pi)continue;let N=this.segments.prepareSegment(x*x,this.layoutVertexArray,this.indexArray,e.sortKey),L=N.vertexLength;for(let Z=0;Z<x;Z++)for(let X=0;X<x;X++)Dp(this.layoutVertexArray,A,M,g[X],g[Z]);for(let Z=0;Z<x-1;Z++)for(let X=0;X<x-1;X++){let ie=L+Z*x+X,ne=L+(Z+1)*x+X;this.indexArray.emplaceBack(ie,ne+1,ie+1),this.indexArray.emplaceBack(ie,ne,ne+1)}N.vertexLength+=x*x,N.primitiveLength+=(x-1)*(x-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,l,{imagePositions:{},canonical:h})}}function Uu(r,e){for(let i of r)if(ju(e,i))return!0;for(let i of e)if(ju(r,i))return!0;return md(r,e)}function Lp(r,e,i){return!!ju(r,e)||fd(e,r,i)}function dd(r,e){if(r.length===1)return Uf(e,r[0]);for(let i of e)for(let l of i)if(ju(r,l))return!0;for(let i of r)if(Uf(e,i))return!0;for(let i of e)if(md(r,i))return!0;return!1}function V_(r,e,i){if(r.length>1){if(md(r,e))return!0;for(let l of e)if(fd(l,r,i))return!0}for(let l of r)if(fd(l,e,i))return!0;return!1}function md(r,e){if(r.length===0||e.length===0)return!1;for(let i=0;i<r.length-1;i++){let l=r[i],h=r[i+1];for(let m=0;m<e.length-1;m++)if(Vf(l,h,e[m],e[m+1]))return!0}return!1}function Vf(r,e,i,l){return Hn(r,i,l)!==Hn(e,i,l)&&Hn(r,e,i)!==Hn(r,e,l)}function fd(r,e,i){let l=i*i;if(e.length===1)return r.distSqr(e[0])<l;for(let h=1;h<e.length;h++)if(Nf(r,e[h-1],e[h])<l)return!0;return!1}function Nf(r,e,i){let l=e.distSqr(i);if(l===0)return r.distSqr(e);let h=((r.x-e.x)*(i.x-e.x)+(r.y-e.y)*(i.y-e.y))/l;return r.distSqr(h<0?e:h>1?i:i.sub(e)._mult(h)._add(e))}function Uf(r,e){let i,l,h,m=!1;for(let g of r){i=g;for(let x=0,C=i.length-1;x<i.length;C=x++)l=i[x],h=i[C],l.y>e.y!=h.y>e.y&&e.x<(h.x-l.x)*(e.y-l.y)/(h.y-l.y)+l.x&&(m=!m)}return m}function ju(r,e){let i=!1;for(let l=0,h=r.length-1;l<r.length;h=l++){let m=r[l],g=r[h];m.y>e.y!=g.y>e.y&&e.x<(g.x-m.x)*(e.y-m.y)/(g.y-m.y)+m.x&&(i=!i)}return i}function jf(r,e,i){let l=i[0],h=i[2];if(r.x<l.x&&e.x<l.x||r.x>h.x&&e.x>h.x||r.y<l.y&&e.y<l.y||r.y>h.y&&e.y>h.y)return!1;let m=Hn(r,e,i[0]);return m!==Hn(r,e,i[1])||m!==Hn(r,e,i[2])||m!==Hn(r,e,i[3])}function qu(r,e,i){let l=e.paint.get(r).value;return l.kind==="constant"?l.value:i.programConfigurations.get(e.id).getMaxValue(r)}function gd(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function Rh(r,e,i,l,h){if(!e[0]&&!e[1])return r;let m=pe.convert(e)._mult(h);i==="viewport"&&m._rotate(-l);let g=[];for(let x of r)g.push(x.sub(m));return g}function Po(r){let e=[];for(let i=0;i<r.length;i++){let l=r[i],h=e.at(-1);(i===0||h&&!l.equals(h))&&e.push(l)}return e}function _m({queryGeometry:r,size:e},i){return Lp(r,i,e)}function qf({queryGeometry:r,size:e,transform:i,unwrappedTileID:l,getElevation:h},m){return Lp(r,m,e*(i.projectTileCoordinates(m.x,m.y,l,h).signedDistanceFromCamera/i.cameraToCenterDistance))}function $f({queryGeometry:r,size:e,transform:i,unwrappedTileID:l,getElevation:h},m){let g=i.projectTileCoordinates(m.x,m.y,l,h).signedDistanceFromCamera,x=e*(i.cameraToCenterDistance/g);return Lp(r,Rp(m,i,l,h),x)}function Fr({queryGeometry:r,size:e,transform:i,unwrappedTileID:l,getElevation:h},m){return Lp(r,Rp(m,i,l,h),e)}function Yc({queryGeometry:r,size:e,transform:i,unwrappedTileID:l,getElevation:h,pitchAlignment:m="map",pitchScale:g="map"},x){let C=m==="map"?g==="map"?_m:qf:g==="map"?$f:Fr,w={queryGeometry:r,size:e,transform:i,unwrappedTileID:l,getElevation:h};for(let A of x)for(let M of A)if(C(w,M))return!0;return!1}function Rp(r,e,i,l){let h=e.projectTileCoordinates(r.x,r.y,i,l).point;
vendor: 3,267 bytes, line 2
2return new pe((.5*h.x+.5)*e.width,(.5*-h.y+.5)*e.height)}let ym,xm;Qt("CircleBucket",Nu,{omit:["layers"]});var Jc={get paint(){return xm=xm||new aa({"circle-radius":new Ii(xt.paint_circle["circle-radius"]),"circle-color":new Ii(xt.paint_circle["circle-color"]),"circle-blur":new Ii(xt.paint_circle["circle-blur"]),"circle-opacity":new Ii(xt.paint_circle["circle-opacity"]),"circle-translate":new mi(xt.paint_circle["circle-translate"]),"circle-translate-anchor":new mi(xt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new mi(xt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new mi(xt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ii(xt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ii(xt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ii(xt.paint_circle["circle-stroke-opacity"])})},get layout(){return ym=ym||new aa({"circle-sort-key":new Ii(xt.layout_circle["circle-sort-key"])})}};class $u extends ka{constructor(e,i){super(e,Jc,i)}createBucket(e){return new Nu(e)}queryRadius(e){let i=e;return qu("circle-radius",this,i)+qu("circle-stroke-width",this,i)+gd(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:e,feature:i,featureState:l,geometry:h,transform:m,pixelsToTileUnits:g,unwrappedTileID:x,getElevation:C}){let w=Rh(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-m.bearingInRadians,g),A=this.paint.get("circle-radius").evaluate(i,l)+this.paint.get("circle-stroke-width").evaluate(i,l),M=this.paint.get("circle-pitch-scale"),N=this.paint.get("circle-pitch-alignment"),L,Z;return N==="map"?(L=w,Z=A*g):(L=(function(X,ie,ne,ue){return X.map((se=>Rp(se,ie,ne,ue)))})(w,m,x,C),Z=A),Yc({queryGeometry:L,size:Z,transform:m,unwrappedTileID:x,getElevation:C,pitchAlignment:N,pitchScale:M},h)}}class vm extends Nu{}let Gf;Qt("HeatmapBucket",vm,{omit:["layers"]});var N_={get paint(){return Gf=Gf||new aa({"heatmap-radius":new Ii(xt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ii(xt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new mi(xt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Wc(xt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new mi(xt.paint_heatmap["heatmap-opacity"])})}};function bm(r,{width:e,height:i},l,h){if(h){if(h instanceof Uint8ClampedArray)h=new Uint8Array(h.buffer);else if(h.length!==e*i*l)throw new RangeError(`mismatched image size. expected: ${h.length} but got: ${e*i*l}`)}else h=new Uint8Array(e*i*l);return r.width=e,r.height=i,r.data=h,r}function Zf(r,{width:e,height:i},l){if(e===r.width&&i===r.height)return;let h=bm({},{width:e,height:i},l);wm(r,h,{x:0,y:0},{x:0,y:0},{width:Math.min(r.width,e),height:Math.min(r.height,i)},l),r.width=e,r.height=i,r.data=h.data}function wm(r,e,i,l,h,m){if(h.width===0||h.height===0)return e;if(h.width>r.width||h.height>r.height||i.x>r.width-h.width||i.y>r.height-h.height)throw new RangeError("out of range source coordinates for image copy");if(h.width>e.width||h.height>e.height||l.x>e.width-h.width||l.y>e.height-h.height)throw new RangeError("out of range destination coordinates for image copy");let g=r.data,x=e.data;if(g===x)throw new Error("srcData equals dstData, so image is already copied");for(let C=0;C<h.height;
vendor: 11,393 bytes, line 2
2C++){let w=((i.y+C)*r.width+i.x)*m,A=((l.y+C)*e.width+l.x)*m;for(let M=0;M<h.width*m;M++)x[A+M]=g[w+M]}return e}class Fp{constructor(e,i){bm(this,e,1,i)}resize(e){Zf(this,e,1)}clone(){return new Fp({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,i,l,h,m){wm(e,i,l,h,m,1)}}class Ya{constructor(e,i){bm(this,e,4,i)}resize(e){Zf(this,e,4)}replace(e,i){i?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new Ya({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,i,l,h,m){wm(e,i,l,h,m,4)}setPixel(e,i,l){let h=4*(e*this.width+i);this.data[h+0]=Math.round(255*l.r/l.a),this.data[h+1]=Math.round(255*l.g/l.a),this.data[h+2]=Math.round(255*l.b/l.a),this.data[h+3]=Math.round(255*l.a)}}function Wf(r){let e=new Uint8Array(r.length);for(let i=0;i<r.length;i+=4){let l=r[i+3];e[i+0]=Math.round(r[i+0]*l/255),e[i+1]=Math.round(r[i+1]*l/255),e[i+2]=Math.round(r[i+2]*l/255),e[i+3]=l}return e}function Hf(r){let e={},i=r.resolution||256,l=r.clips?r.clips.length:1,h=r.image||new Ya({width:i,height:l});if(Math.log(i)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${i}`);let m=(g,x,C)=>{e[r.evaluationKey]=C;let w=r.expression.evaluate(e);h.setPixel(g/4/i,x/4,w)};if(r.clips)for(let g=0,x=0;g<l;++g,x+=4*i)for(let C=0,w=0;C<i;C++,w+=4){let A=C/(i-1),{start:M,end:N}=r.clips[g];m(x,w,M*(1-A)+N*A)}else for(let g=0,x=0;g<i;g++,x+=4)m(0,x,g/(i-1));return h}Qt("AlphaImage",Fp),Qt("RGBAImage",Ya);let Gu="big-fb";class Zu extends ka{createBucket(e){return new vm(e)}constructor(e,i){super(e,N_,i),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){e==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Hf({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(Gu)&&this.heatmapFbos.delete(Gu)}queryRadius(e){return qu("heatmap-radius",this,e)}queryIntersectsFeature({queryGeometry:e,feature:i,featureState:l,geometry:h,transform:m,pixelsToTileUnits:g,unwrappedTileID:x,getElevation:C}){return Yc({queryGeometry:e,size:this.paint.get("heatmap-radius").evaluate(i,l)*g,transform:m,unwrappedTileID:x,getElevation:C},h)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&!this.isHidden()}}let Tm;var U_={get paint(){return Tm=Tm||new aa({"hillshade-illumination-direction":new mi(xt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-altitude":new mi(xt.paint_hillshade["hillshade-illumination-altitude"]),"hillshade-illumination-anchor":new mi(xt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new mi(xt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new mi(xt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new mi(xt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new mi(xt.paint_hillshade["hillshade-accent-color"]),"hillshade-method":new mi(xt.paint_hillshade["hillshade-method"]),resampling:new mi(xt.paint_hillshade.resampling)})}};class j_ extends ka{constructor(e,i){super(e,U_,i),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let e=this.paint.get("hillshade-illumination-direction").values,i=this.paint.get("hillshade-illumination-altitude").values,l=this.paint.get("hillshade-highlight-color").values,h=this.paint.get("hillshade-shadow-color").values,m=Math.max(e.length,i.length,l.length,h.length);e=e.concat(Array(m-e.length).fill(e.at(-1))),i=i.concat(Array(m-i.length).fill(i.at(-1))),l=l.concat(Array(m-l.length).fill(l.at(-1))),h=h.concat(Array(m-h.length).fill(h.at(-1)));let g=i.map(oo);return{directionRadians:e.map(oo),altitudeRadians:g,shadowColor:h,highlightColor:l}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&!this.isHidden()}}let Xf;var Kf={get paint(){return Xf=Xf||new aa({"color-relief-opacity":new mi(xt["paint_color-relief"]["color-relief-opacity"]),"color-relief-color":new Wc(xt["paint_color-relief"]["color-relief-color"]),resampling:new mi(xt["paint_color-relief"].resampling)})}};function _d(r){return"data"in r}class yd{constructor(e,i,l,h){this.context=e,this.format=l,this.texture=e.gl.createTexture(),this._ownedHandle=this.texture,this.update(i,h)}update(e,i,l){var h;let{width:m,height:g}=e,x=(((h=this.size)===null||h===void 0?void 0:h[0])!==m||this.size[1]!==g)&&!l,{context:C}=this,{gl:w}=C;this.useMipmap=!!i?.useMipmap,w.bindTexture(w.TEXTURE_2D,this.texture),C.pixelStoreUnpackFlipY.set(!1),C.pixelStoreUnpack.set(1);let A=this.format===w.RGBA&&i?.premultiply!==!1;if(x)this.size=[m,g],_d(e)?(C.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(e,A,m,g,w)):(C.pixelStoreUnpackPremultiplyAlpha.set(A),this._uploadDomImage(e,w));else{let{x:M,y:N}=l||{x:0,y:0};_d(e)?(C.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(e,A,M,N,m,g,w)):(C.pixelStoreUnpackPremultiplyAlpha.set(A),this._updateDomImage(e,M,N,w))}this.useMipmap&&this.isSizePowerOfTwo()&&w.generateMipmap(w.TEXTURE_2D),C.pixelStoreUnpackFlipY.setDefault(),C.pixelStoreUnpack.setDefault(),C.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(e,i){i.texImage2D(i.TEXTURE_2D,0,this.format,this.format,i.UNSIGNED_BYTE,e)}_uploadRawData(e,i,l,h,m){let{data:g}=e;i&&g&&(g=Wf(g)),m.texImage2D(m.TEXTURE_2D,0,this.format,l,h,0,this.format,m.UNSIGNED_BYTE,g)}_updateDomImage(e,i,l,h){h.texSubImage2D(h.TEXTURE_2D,0,i,l,h.RGBA,h.UNSIGNED_BYTE,e)}_updateRawData(e,i,l,h,m,g,x){let{data:C}=e;i&&C&&(C=Wf(C)),x.texSubImage2D(x.TEXTURE_2D,0,l,h,m,g,x.RGBA,x.UNSIGNED_BYTE,C)}bind(e,i,l){let{context:h}=this,{gl:m}=h;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),m.bindTexture(m.TEXTURE_2D,this.texture),l!==m.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(l=m.LINEAR),e!==this.filter&&(m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,e),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,l||e),this.filter=e),i!==this.wrap&&(m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,i),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,i),this.wrap=i)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}}class Bp{constructor(e,i,l,h=1,m=1,g=1,x=0){if(this.uid=e,i.height!==i.width)throw new RangeError("DEM tiles must be square");if(l&&!["mapbox","terrarium","custom"].includes(l))return void Gr(`"${l}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=i.height;let C=this.dim=i.height-2;switch(this.data=new Uint32Array(i.data.buffer),l){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=h,this.greenFactor=m,this.blueFactor=g,this.baseShift=x;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let w=0;w<C;w++)this.data[this._idx(-1,w)]=this.data[this._idx(0,w)],this.data[this._idx(C,w)]=this.data[this._idx(C-1,w)],this.data[this._idx(w,-1)]=this.data[this._idx(w,0)],this.data[this._idx(w,C)]=this.data[this._idx(w,C-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(C,-1)]=this.data[this._idx(C-1,0)],this.data[this._idx(-1,C)]=this.data[this._idx(0,C-1)],this.data[this._idx(C,C)]=this.data[this._idx(C-1,C-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let w=0;w<C;w++)for(let A=0;A<C;A++){let M=this.get(w,A);M>this.max&&(this.max=M),M<this.min&&(this.min=M)}}get(e,i){let l=new Uint8Array(this.data.buffer),h=4*this._idx(e,i);return this.unpack(l[h],l[h+1],l[h+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,i){if(e<-1||e>=this.dim+1||i<-1||i>=this.dim+1)throw new RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${i}, dim: ${this.dim}`);return(i+1)*this.stride+(e+1)}unpack(e,i,l){return e*this.redFactor+i*this.greenFactor+l*this.blueFactor-this.baseShift}pack(e){return Wu(e,this.getUnpackVector())}getPixels(){return new Ya({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,i,l){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let h=i*this.dim,m=i*this.dim+this.dim,g=l*this.dim,x=l*this.dim+this.dim;switch(i){case-1:h=m-1;break;case 1:m=h+1}switch(l){case-1:g=x-1;break;case 1:x=g+1}let C=-i*this.dim,w=-l*this.dim;for(let A=g;A<x;A++)for(let M=h;M<m;M++)this.data[this._idx(M,A)]=e.data[this._idx(M+C,A+w)]}}function Wu(r,e){let i=e[0],l=e[1],h=e[2],m=e[3],g=Math.min(i,l,h),x=Math.round((r+m)/g);return{r:Math.floor(x*g/i)%256,g:Math.floor(x*g/l)%256,b:Math.floor(x*g/h)%256}}Qt("DEMData",Bp);class Hu extends ka{constructor(e,i){super(e,Kf,i)}_createColorRamp(e){let i={elevationStops:[],colorStops:[]},l=this._transitionablePaint._values["color-relief-color"].value.expression;if(l instanceof Ih&&l._styleExpression.expression instanceof ln){this.colorRampExpression=l;let g=l._styleExpression.expression;i.elevationStops=g.labels,i.colorStops=[];for(let x of i.elevationStops)i.colorStops.push(g.evaluate({globals:{elevation:x}}))}if(i.elevationStops.length<1&&(i.elevationStops=[0],i.colorStops=[Yi.transparent]),i.elevationStops.length<2&&(i.elevationStops.push(i.elevationStops[0]+1),i.colorStops.push(i.colorStops[0])),i.elevationStops.length<=e)return i;let h={elevationStops:[],colorStops:[]},m=(i.elevationStops.length-1)/(e-1);for(let g=0;g<i.elevationStops.length-.5;g+=m)h.elevationStops.push(i.elevationStops[Math.round(g)]),h.colorStops.push(i.colorStops[Math.round(g)]);return Gr(`Too many colors in specification of ${this.id} color-relief layer, may not render properly. Max possible colors: ${e}, provided: ${i.elevationStops.length}`),h}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(e,i,l){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let h=this._createColorRamp(i),m=new Ya({width:h.colorStops.length,height:1}),g=new Ya({width:h.colorStops.length,height:1});for(let x=0;x<h.elevationStops.length;x++){let C=Wu(h.elevationStops[x],l);g.setPixel(0,x,new Yi(C.r/255,C.g/255,C.b/255,1)),m.setPixel(0,x,h.colorStops[x])}return this.colorRampTextures={elevationTexture:new yd(e,g,e.gl.RGBA),colorTexture:new yd(e,m,e.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}}let xd=Pr([{name:"a_pos",components:2,type:"Int16"}],4),{members:vd}=xd;function bd(r,e,i){let l=i.patternDependencies,h=!1;for(let m of e){let g=m.paint.get(`${r}-pattern`);g.isConstant()||(h=!0);let x=g.constantOr(null);x&&(h=!0,l[x.to]=!0,l[x.from]=!0)}return h}function wd(r,e,i,l,h){let{zoom:m}=l,g=h.patternDependencies;for(let x of e){let C=x.paint.get(`${r}-pattern`).value;if(C.kind!=="constant"){let w=C.evaluate({zoom:m-1},i,{},h.availableImages),A=C.evaluate({zoom:m},i,{},h.availableImages),M=C.evaluate({zoom:m+1},i,{},h.availableImages);w=w?.name?w.name:w,A=A?.name?A.name:A,M=M?.name?M.name:M,g[w]=!0,g[A]=!0,g[M]=!0,i.patterns[x.id]={min:w,mid:A,max:M}}}return i}function Sm(r,e,i,l,h){let m;if(h===(function(g,x,C,w){let A=0;for(let M=x,N=C-w;M<C;
vendor: 2,740 bytes, line 2
2M+=w)A+=(g[N]-g[M])*(g[M+1]+g[N+1]),N=M;return A})(r,e,i,l)>0)for(let g=e;g<i;g+=l)m=Mm(g/l|0,r[g],r[g+1],m);else for(let g=i-l;g>=e;g-=l)m=Mm(g/l|0,r[g],r[g+1],m);return m&&Yu(m,m.next)&&(Bh(m),m=m.next),m}function hu(r,e){if(!r)return r;e||(e=r);let i,l=r;do if(i=!1,l.steiner||!Yu(l,l.next)&&An(l.prev,l,l.next)!==0)l=l.next;else{if(Bh(l),l=e=l.prev,l===l.next)break;i=!0}while(i||l!==e);return e}function Xu(r,e,i,l,h,m,g){if(!r)return;!g&&m&&(function(C,w,A,M){let N=C;do N.z===0&&(N.z=Td(N.x,N.y,w,A,M)),N.prevZ=N.prev,N.nextZ=N.next,N=N.next;while(N!==C);N.prevZ.nextZ=null,N.prevZ=null,(function(L){let Z,X=1;do{let ie,ne=L;L=null;let ue=null;for(Z=0;ne;){Z++;let se=ne,me=0;for(let Ce=0;Ce<X&&(me++,se=se.nextZ,se);Ce++);let be=X;for(;me>0||be>0&&se;)me!==0&&(be===0||!se||ne.z<=se.z)?(ie=ne,ne=ne.nextZ,me--):(ie=se,se=se.nextZ,be--),ue?ue.nextZ=ie:L=ie,ie.prevZ=ue,ue=ie;ne=se}ue.nextZ=null,X*=2}while(Z>1)})(N)})(r,l,h,m);let x=r;for(;r.prev!==r.next;){let C=r.prev,w=r.next;if(m?Im(r,l,h,m):Yf(r))e.push(C.i,r.i,w.i),Bh(r),r=w.next,x=w.next;else if((r=w)===x){g?g===1?Xu(r=Cm(hu(r),e),e,i,l,h,m,2):g===2&&q_(r,e,i,l,h,m):Xu(hu(r),e,i,l,h,m,1);break}}}function Yf(r){let e=r.prev,i=r,l=r.next;if(An(e,i,l)>=0)return!1;let h=e.x,m=i.x,g=l.x,x=e.y,C=i.y,w=l.y,A=Math.min(h,m,g),M=Math.min(x,C,w),N=Math.max(h,m,g),L=Math.max(x,C,w),Z=l.next;for(;Z!==e;){if(Z.x>=A&&Z.x<=N&&Z.y>=M&&Z.y<=L&&Ku(h,x,m,C,g,w,Z.x,Z.y)&&An(Z.prev,Z,Z.next)>=0)return!1;Z=Z.next}return!0}function Im(r,e,i,l){let h=r.prev,m=r,g=r.next;if(An(h,m,g)>=0)return!1;let x=h.x,C=m.x,w=g.x,A=h.y,M=m.y,N=g.y,L=Math.min(x,C,w),Z=Math.min(A,M,N),X=Math.max(x,C,w),ie=Math.max(A,M,N),ne=Td(L,Z,e,i,l),ue=Td(X,ie,e,i,l),se=r.prevZ,me=r.nextZ;for(;se&&se.z>=ne&&me&&me.z<=ue;){if(se.x>=L&&se.x<=X&&se.y>=Z&&se.y<=ie&&se!==h&&se!==g&&Ku(x,A,C,M,w,N,se.x,se.y)&&An(se.prev,se,se.next)>=0||(se=se.prevZ,me.x>=L&&me.x<=X&&me.y>=Z&&me.y<=ie&&me!==h&&me!==g&&Ku(x,A,C,M,w,N,me.x,me.y)&&An(me.prev,me,me.next)>=0))return!1;me=me.nextZ}for(;se&&se.z>=ne;){if(se.x>=L&&se.x<=X&&se.y>=Z&&se.y<=ie&&se!==h&&se!==g&&Ku(x,A,C,M,w,N,se.x,se.y)&&An(se.prev,se,se.next)>=0)return!1;se=se.prevZ}for(;me&&me.z<=ue;){if(me.x>=L&&me.x<=X&&me.y>=Z&&me.y<=ie&&me!==h&&me!==g&&Ku(x,A,C,M,w,N,me.x,me.y)&&An(me.prev,me,me.next)>=0)return!1;me=me.nextZ}return!0}function Cm(r,e){let i=r;do{let l=i.prev,h=i.next.next;!Yu(l,h)&&eg(l,i,i.next,h)&&Ju(l,h)&&Ju(h,l)&&(e.push(l.i,i.i,h.i),Bh(i),Bh(i.next),i=r=h),i=i.next}while(i!==r);return hu(i)}function q_(r,e,i,l,h,m){let g=r;do{let x=g.next.next;for(;x!==g.prev;){if(g.i!==x.i&&Qf(g,x)){let C=Np(g,x);return g=hu(g,g.next),C=hu(C,C.next),Xu(g,e,i,l,h,m,0),void Xu(C,e,i,l,h,m,0)}x=x.next}g=g.next}while(g!==r)}function $_(r,e){let i=r.x-e.x;
vendor: 74,487 bytes, line 2
2return i===0&&(i=r.y-e.y,i===0)&&(i=(r.next.y-r.y)/(r.next.x-r.x)-(e.next.y-e.y)/(e.next.x-e.x)),i}function Jf(r,e){let i=(function(h,m){let g=m,x=h.x,C=h.y,w,A=-1/0;if(Yu(h,g))return g;do{if(Yu(h,g.next))return g.next;if(C<=g.y&&C>=g.next.y&&g.next.y!==g.y){let X=g.x+(C-g.y)*(g.next.x-g.x)/(g.next.y-g.y);if(X<=x&&X>A&&(A=X,w=g.x<g.next.x?g:g.next,X===x))return w}g=g.next}while(g!==m);if(!w)return null;let M=w,N=w.x,L=w.y,Z=1/0;g=w;do{if(x>=g.x&&g.x>=N&&x!==g.x&&Em(C<L?x:A,C,N,L,C<L?A:x,C,g.x,g.y)){let X=Math.abs(C-g.y)/(x-g.x);Ju(g,h)&&(X<Z||X===Z&&(g.x>w.x||g.x===w.x&&Qc(w,g)))&&(w=g,Z=X)}g=g.next}while(g!==M);return w})(r,e);if(!i)return e;let l=Np(i,r);return hu(l,l.next),hu(i,i.next)}function Qc(r,e){return An(r.prev,r,e.prev)<0&&An(e.next,r,r.next)<0}function Td(r,e,i,l,h){return(r=1431655765&((r=858993459&((r=252645135&((r=16711935&((r=(r-i)*h|0)|r<<8))|r<<4))|r<<2))|r<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-l)*h|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Fh(r){let e=r,i=r;do(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next;while(e!==r);return i}function Em(r,e,i,l,h,m,g,x){return(h-g)*(e-x)>=(r-g)*(m-x)&&(r-g)*(l-x)>=(i-g)*(e-x)&&(i-g)*(m-x)>=(h-g)*(l-x)}function Ku(r,e,i,l,h,m,g,x){return!(r===g&&e===x)&&Em(r,e,i,l,h,m,g,x)}function Qf(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!(function(i,l){let h=i;do{if(h.i!==i.i&&h.next.i!==i.i&&h.i!==l.i&&h.next.i!==l.i&&eg(h,h.next,i,l))return!0;h=h.next}while(h!==i);return!1})(r,e)&&(Ju(r,e)&&Ju(e,r)&&(function(i,l){let h=i,m=!1,g=(i.x+l.x)/2,x=(i.y+l.y)/2;do h.y>x!=h.next.y>x&&h.next.y!==h.y&&g<(h.next.x-h.x)*(x-h.y)/(h.next.y-h.y)+h.x&&(m=!m),h=h.next;while(h!==i);return m})(r,e)&&(An(r.prev,r,e.prev)||An(r,e.prev,e))||Yu(r,e)&&An(r.prev,r,r.next)>0&&An(e.prev,e,e.next)>0)}function An(r,e,i){return(e.y-r.y)*(i.x-e.x)-(e.x-r.x)*(i.y-e.y)}function Yu(r,e){return r.x===e.x&&r.y===e.y}function eg(r,e,i,l){let h=Vp(An(r,e,i)),m=Vp(An(r,e,l)),g=Vp(An(i,l,r)),x=Vp(An(i,l,e));return h!==m&&g!==x||!(h!==0||!Op(r,i,e))||!(m!==0||!Op(r,l,e))||!(g!==0||!Op(i,r,l))||!(x!==0||!Op(i,e,l))}function Op(r,e,i){return e.x<=Math.max(r.x,i.x)&&e.x>=Math.min(r.x,i.x)&&e.y<=Math.max(r.y,i.y)&&e.y>=Math.min(r.y,i.y)}function Vp(r){return r>0?1:r<0?-1:0}function Ju(r,e){return An(r.prev,r,r.next)<0?An(r,e,r.next)>=0&&An(r,r.prev,e)>=0:An(r,e,r.prev)<0||An(r,r.next,e)<0}function Np(r,e){let i=Qu(r.i,r.x,r.y),l=Qu(e.i,e.x,e.y),h=r.next,m=e.prev;return r.next=e,e.prev=r,i.next=h,h.prev=i,l.next=i,i.prev=l,m.next=l,l.prev=m,l}function Mm(r,e,i,l){let h=Qu(r,e,i);return l?(h.next=l.next,h.prev=l,l.next.prev=h,l.next=h):(h.prev=h,h.next=h),h}function Bh(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Qu(r,e,i){return{i:r,x:e,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class eh{constructor(e,i){if(i>e)throw new Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=e,this._minGranularity=i}getGranularityForZoomLevel(e){return Math.max(Math.floor(this._baseZoomGranularity/(1<<e)),this._minGranularity,1)}}class Sd{constructor(e){this.fill=e.fill,this.line=e.line,this.tile=e.tile,this.stencil=e.stencil,this.circle=e.circle}}Sd.noSubdivision=new Sd({fill:new eh(0,0),line:new eh(0,0),tile:new eh(0,0),stencil:new eh(0,0),circle:1}),Qt("SubdivisionGranularityExpression",eh),Qt("SubdivisionGranularitySetting",Sd);let ep=-32768,Up=32767;class G_{constructor(e,i){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=e,this._granularityCellSize=pi/e,this._canonical=i}_getKey(e,i){return(e+=32768)<<16|i+32768}_vertexToIndex(e,i){if(e<-32768||i<-32768||e>32767||i>32767)throw new Error("Vertex coordinates are out of signed 16 bit integer range.");let l=0|Math.round(e),h=0|Math.round(i),m=this._getKey(l,h);if(this._vertexDictionary.has(m))return this._vertexDictionary.get(m);let g=this._vertexBuffer.length/2;return this._vertexDictionary.set(m,g),this._vertexBuffer.push(l,h),g}_subdivideTrianglesScanline(e){if(this._granularity<2)return(function(h,m){let g=[];for(let x=0;x<m.length;x+=3){let C=m[x],w=m[x+1],A=m[x+2],M=h[2*C],N=h[2*C+1];(h[2*w]-M)*(h[2*A+1]-N)-(h[2*w+1]-N)*(h[2*A]-M)>0?(g.push(C),g.push(A),g.push(w)):(g.push(C),g.push(w),g.push(A))}return g})(this._vertexBuffer,e);let i=[],l=e.length;for(let h=0;h<l;h+=3){let m=[e[h+0],e[h+1],e[h+2]],g=[this._vertexBuffer[2*e[h+0]+0],this._vertexBuffer[2*e[h+0]+1],this._vertexBuffer[2*e[h+1]+0],this._vertexBuffer[2*e[h+1]+1],this._vertexBuffer[2*e[h+2]+0],this._vertexBuffer[2*e[h+2]+1]],x=1/0,C=1/0,w=-1/0,A=-1/0;for(let X=0;X<3;X++){let ie=g[2*X],ne=g[2*X+1];x=Math.min(x,ie),w=Math.max(w,ie),C=Math.min(C,ne),A=Math.max(A,ne)}if(x===w||C===A)continue;let M=Math.floor(x/this._granularityCellSize),N=Math.ceil(w/this._granularityCellSize),L=Math.floor(C/this._granularityCellSize),Z=Math.ceil(A/this._granularityCellSize);if(M!==N||L!==Z)for(let X=L;X<Z;X++){let ie=this._scanlineGenerateVertexRingForCellRow(X,g,m);tg(this._vertexBuffer,ie,i)}else i.push(...m)}return i}_scanlineGenerateVertexRingForCellRow(e,i,l){let h=e*this._granularityCellSize,m=h+this._granularityCellSize,g=[];for(let x=0;x<3;x++){let C=i[2*x],w=i[2*x+1],A=i[2*(x+1)%6],M=i[(2*(x+1)+1)%6],N=i[2*(x+2)%6],L=i[(2*(x+2)+1)%6],Z=A-C,X=M-w,ie=Z===0,ne=X===0,ue=(h-w)/X,se=(m-w)/X,me=Math.min(ue,se),be=Math.max(ue,se);if(!ne&&(me>=1||be<=0)||ne&&(w<h||w>m)){M>=h&&M<=m&&g.push(l[(x+1)%3]);continue}!ne&&me>0&&g.push(this._vertexToIndex(C+Z*me,w+X*me));let Ce=C+Z*Math.max(me,0),We=C+Z*Math.min(be,1);ie||this._generateIntraEdgeVertices(g,C,w,A,M,Ce,We),!ne&&be<1&&g.push(this._vertexToIndex(C+Z*be,w+X*be)),(ne||M>=h&&M<=m)&&g.push(l[(x+1)%3]),!ne&&(M<=h||M>=m)&&this._generateInterEdgeVertices(g,C,w,A,M,N,L,We,h,m)}return g}_generateIntraEdgeVertices(e,i,l,h,m,g,x){let C=h-i,w=m-l,A=w===0,M=A?Math.min(i,h):Math.min(g,x),N=A?Math.max(i,h):Math.max(g,x),L=Math.floor(M/this._granularityCellSize)+1,Z=Math.ceil(N/this._granularityCellSize)-1;if(A?i<h:g<x)for(let X=L;X<=Z;X++){let ie=X*this._granularityCellSize;e.push(this._vertexToIndex(ie,l+w*(ie-i)/C))}else for(let X=Z;X>=L;X--){let ie=X*this._granularityCellSize;e.push(this._vertexToIndex(ie,l+w*(ie-i)/C))}}_generateInterEdgeVertices(e,i,l,h,m,g,x,C,w,A){let M=m-l,N=g-h,L=x-m,Z=(w-m)/L,X=(A-m)/L,ie=Math.min(Z,X),ne=Math.max(Z,X),ue=h+N*ie,se=Math.floor(Math.min(ue,C)/this._granularityCellSize)+1,me=Math.ceil(Math.max(ue,C)/this._granularityCellSize)-1,be=C<ue,Ce=L===0;if(Ce&&(x===w||x===A))return;if(Ce||ie>=1||ne<=0){let Je=l-x,mt=g+(i-g)*Math.min((w-x)/Je,(A-x)/Je);se=Math.floor(Math.min(mt,C)/this._granularityCellSize)+1,me=Math.ceil(Math.max(mt,C)/this._granularityCellSize)-1,be=C<mt}let We=M>0?A:w;if(be)for(let Je=se;Je<=me;Je++)e.push(this._vertexToIndex(Je*this._granularityCellSize,We));else for(let Je=me;Je>=se;Je--)e.push(this._vertexToIndex(Je*this._granularityCellSize,We))}_generateOutline(e){let i=[];for(let l of e){let h=th(l,this._granularity,!0),m=this._pointArrayToIndices(h),g=[];for(let x=1;x<m.length;x++)g.push(m[x-1]),g.push(m[x]);i.push(g)}return i}_handlePoles(e){let i=!1,l=!1;this._canonical&&(this._canonical.y===0&&(i=!0),this._canonical.y===(1<<this._canonical.z)-1&&(l=!0)),(i||l)&&this._fillPoles(e,i,l)}_ensureNoPoleVertices(){let e=this._vertexBuffer;for(let i=0;i<e.length;i+=2){let l=e[i+1];l===ep&&(e[i+1]=-32767),l===Up&&(e[i+1]=32766)}}_generatePoleQuad(e,i,l,h,m,g){h>m!=(g===ep)?(e.push(i),e.push(l),e.push(this._vertexToIndex(h,g)),e.push(l),e.push(this._vertexToIndex(m,g)),e.push(this._vertexToIndex(h,g))):(e.push(l),e.push(i),e.push(this._vertexToIndex(h,g)),e.push(this._vertexToIndex(m,g)),e.push(l),e.push(this._vertexToIndex(h,g)))}_fillPoles(e,i,l){let h=this._vertexBuffer,m=pi,g=e.length;for(let x=2;x<g;x+=3){let C=e[x-2],w=e[x-1],A=e[x],M=h[2*C],N=h[2*C+1],L=h[2*w],Z=h[2*w+1],X=h[2*A],ie=h[2*A+1];i&&(N===0&&Z===0&&this._generatePoleQuad(e,C,w,M,L,ep),Z===0&&ie===0&&this._generatePoleQuad(e,w,A,L,X,ep),ie===0&&N===0&&this._generatePoleQuad(e,A,C,X,M,ep)),l&&(N===m&&Z===m&&this._generatePoleQuad(e,C,w,M,L,Up),Z===m&&ie===m&&this._generatePoleQuad(e,w,A,L,X,Up),ie===m&&N===m&&this._generatePoleQuad(e,A,C,X,M,Up))}}_initializeVertices(e){for(let i=0;i<e.length;i+=2)this._vertexToIndex(e[i],e[i+1])}subdividePolygonInternal(e,i){if(this._used)throw new Error("Subdivision: multiple use not allowed.");this._used=!0;let{flattened:l,holeIndices:h}=(function(x){let C=[],w=[];for(let A of x)if(A.length!==0){A!==x[0]&&C.push(w.length/2);for(let M of A)w.push(M.x),w.push(M.y)}return{flattened:w,holeIndices:C}})(e),m;this._initializeVertices(l);try{let x=(function(w,A,M=2){let N=A&&A.length,L=N?A[0]*M:w.length,Z=Sm(w,0,L,M,!0),X=[];if(!Z||Z.next===Z.prev)return X;let ie,ne,ue;if(N&&(Z=(function(se,me,be,Ce){let We=[];for(let Je=0,mt=me.length;Je<mt;Je++){let at=Sm(se,me[Je]*Ce,Je<mt-1?me[Je+1]*Ce:se.length,Ce,!1);at===at.next&&(at.steiner=!0),We.push(Fh(at))}We.sort($_);for(let Je=0;Je<We.length;Je++)be=Jf(We[Je],be);return be})(w,A,Z,M)),w.length>80*M){ie=w[0],ne=w[1];let se=ie,me=ne;for(let be=M;be<L;be+=M){let Ce=w[be],We=w[be+1];Ce<ie&&(ie=Ce),We<ne&&(ne=We),Ce>se&&(se=Ce),We>me&&(me=We)}ue=Math.max(se-ie,me-ne),ue=ue!==0?32767/ue:0}return Xu(Z,X,M,ie,ne,ue,0),X})(l,h),C=this._convertIndices(l,x);m=this._subdivideTrianglesScanline(C)}catch(x){console.error(x)}let g=[];return i&&(g=this._generateOutline(e)),this._ensureNoPoleVertices(),this._handlePoles(m),{verticesFlattened:this._vertexBuffer,indicesTriangles:m,indicesLineList:g}}_convertIndices(e,i){let l=[];for(let h of i)l.push(this._vertexToIndex(e[2*h],e[2*h+1]));return l}_pointArrayToIndices(e){let i=[];for(let l of e)i.push(this._vertexToIndex(l.x,l.y));return i}}function uu(r,e,i,l=!0){return new G_(i,e).subdividePolygonInternal(r,l)}function th(r,e,i=!1){if(!r||r.length<1)return[];if(r.length<2)return[];let l=r[0],h=r[r.length-1],m=i&&(l.x!==h.x||l.y!==h.y);if(e<2)return m?[...r,r[0]]:[...r];let g=Math.floor(pi/e),x=[];x.push(new pe(r[0].x,r[0].y));let C=r.length,w=m?C:C-1;for(let A=0;A<w;A++){let M=r[A],N=A<C-1?r[A+1]:r[0],L=M.x,Z=M.y,X=N.x,ie=N.y,ne=L!==X,ue=Z!==ie;if(!ne&&!ue)continue;let se=X-L,me=ie-Z,be=Math.abs(se),Ce=Math.abs(me),We=L,Je=Z;for(;;){let at=se>0?(Math.floor(We/g)+1)*g:(Math.ceil(We/g)-1)*g,vt=me>0?(Math.floor(Je/g)+1)*g:(Math.ceil(Je/g)-1)*g,bt=Math.abs(We-at),yt=Math.abs(Je-vt),lt=Math.abs(We-X),qt=Math.abs(Je-ie),ii=ne?bt/be:Number.POSITIVE_INFINITY,Wt=ue?yt/Ce:Number.POSITIVE_INFINITY;if((lt<=bt||!ne)&&(qt<=yt||!ue))break;if(ii<Wt&&ne||!ue){We=at,Je+=me*ii;let $t=new pe(We,Math.round(Je));x[x.length-1].x===$t.x&&x[x.length-1].y===$t.y||x.push($t)}else{We+=se*Wt,Je=vt;let $t=new pe(Math.round(We),Je);x[x.length-1].x===$t.x&&x[x.length-1].y===$t.y||x.push($t)}}let mt=new pe(X,ie);x[x.length-1].x===mt.x&&x[x.length-1].y===mt.y||x.push(mt)}return x}function tg(r,e,i){if(e.length===0)throw new Error("Subdivision vertex ring is empty.");let l=0,h=r[2*e[0]];for(let C=1;C<e.length;C++){let w=r[2*e[C]];w<h&&(h=w,l=C)}let m=e.length,g=l,x=(g+1)%m;for(;;){let C=g-1>=0?g-1:m-1,w=(x+1)%m,A=r[2*e[C]],M=r[2*e[w]],N=r[2*e[g]],L=r[2*e[g]+1],Z=r[2*e[x]+1],X=!1;if(A<M)X=!0;else if(A>M)X=!1;else{let ie=Z-L,ne=-(r[2*e[x]]-N),ue=L<Z?1:-1;((A-N)*ie+(r[2*e[C]+1]-L)*ne)*ue>((M-N)*ie+(r[2*e[w]+1]-L)*ne)*ue&&(X=!0)}if(X){let ie=e[C],ne=e[g],ue=e[x];ie!==ne&&ie!==ue&&ne!==ue&&i.push(ue,ne,ie),g--,g<0&&(g=m-1)}else{let ie=e[w],ne=e[g],ue=e[x];ie!==ne&&ie!==ue&&ne!==ue&&i.push(ue,ne,ie),x++,x>=m&&(x=0)}if(C===w)break}}function Id(r,e,i,l,h,m,g,x,C){let w=h.length/2,A=g&&x&&C;if(w<ti.MAX_VERTEX_ARRAY_LENGTH){let M=e.prepareSegment(w,i,l),N=M.vertexLength;for(let X=0;X<m.length;X+=3)l.emplaceBack(N+m[X],N+m[X+1],N+m[X+2]);let L,Z;M.vertexLength+=w,M.primitiveLength+=m.length/3,A&&(Z=g.prepareSegment(w,i,x),L=Z.vertexLength,Z.vertexLength+=w);for(let X=0;X<h.length;X+=2)r(h[X],h[X+1]);if(A)for(let X of C){for(let ie=1;ie<X.length;ie+=2)x.emplaceBack(L+X[ie-1],L+X[ie]);Z.primitiveLength+=X.length/2}}else(function(M,N,L,Z,X,ie){let ne=[];for(let Ce=0;Ce<Z.length/2;Ce++)ne.push(-1);let ue={count:0},se=0,me=M.getOrCreateLatestSegment(N,L),be=me.vertexLength;for(let Ce=2;Ce<X.length;Ce+=3){let We=X[Ce-2],Je=X[Ce-1],mt=X[Ce],at=ne[We]<se,vt=ne[Je]<se,bt=ne[mt]<se;me.vertexLength+((at?1:0)+(vt?1:0)+(bt?1:0))>ti.MAX_VERTEX_ARRAY_LENGTH&&(me=M.createNewSegment(N,L),se=ue.count,at=!0,vt=!0,bt=!0,be=0);let yt=jp(ne,Z,ie,ue,We,at,me),lt=jp(ne,Z,ie,ue,Je,vt,me),qt=jp(ne,Z,ie,ue,mt,bt,me);L.emplaceBack(be+yt-se,be+lt-se,be+qt-se),me.primitiveLength++}})(e,i,l,h,m,r),A&&(function(M,N,L,Z,X,ie){let ne=[];for(let Ce=0;Ce<Z.length/2;Ce++)ne.push(-1);let ue={count:0},se=0,me=M.getOrCreateLatestSegment(N,L),be=me.vertexLength;for(let Ce of X)for(let We=1;We<Ce.length;We+=2){let Je=Ce[We-1],mt=Ce[We],at=ne[Je]<se,vt=ne[mt]<se;me.vertexLength+((at?1:0)+(vt?1:0))>ti.MAX_VERTEX_ARRAY_LENGTH&&(me=M.createNewSegment(N,L),se=ue.count,at=!0,vt=!0,be=0);let bt=jp(ne,Z,ie,ue,Je,at,me),yt=jp(ne,Z,ie,ue,mt,vt,me);L.emplaceBack(be+bt-se,be+yt-se),me.primitiveLength++}})(g,i,x,h,C,r),e.forceNewSegmentOnNextPrepare(),g?.forceNewSegmentOnNextPrepare()}function jp(r,e,i,l,h,m,g){if(m){let x=l.count;return i(e[2*h],e[2*h+1]),r[h]=l.count,l.count++,g.vertexLength++,x}return r[h]}class bc{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((i=>i.id)),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.layoutVertexArray=new Ee,this.indexArray=new Dt,this.indexArray2=new _i,this.programConfigurations=new ql(e.layers,e.zoom),this.segments=new ti,this.segments2=new ti,this.stateDependentLayerIds=this.layers.filter((i=>i.isStateDependent())).map((i=>i.id))}populate(e,i,l){this.hasDependencies=bd("fill",this.layers,i);let h=this.layers[0].layout.get("fill-sort-key"),m=!h.isConstant(),g=[];for(let{feature:x,id:C,index:w,sourceLayerIndex:A}of e){let M=this.layers[0]._featureFilter.needGeometry,N=vc(x,M);if(!this.layers[0]._featureFilter.filter(new wr(this.zoom),N,l))continue;let L=m?h.evaluate(N,{},l,i.availableImages):void 0,Z={id:C,properties:x.properties,type:x.type,sourceLayerIndex:A,index:w,geometry:M?N.geometry:xc(x),patterns:{},sortKey:L};g.push(Z)}m&&g.sort(((x,C)=>x.sortKey-C.sortKey));for(let x of g){let{geometry:C,index:w,sourceLayerIndex:A}=x;if(this.hasDependencies){let M=wd("fill",this.layers,x,{zoom:this.zoom},i);this.patternFeatures.push(M)}else this.addFeature(x,C,w,l,{},i.subdivisionGranularity);i.featureIndex.insert(e[w].feature,C,w,A,this.index)}}update(e,i,l){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,{imagePositions:l})}addFeatures(e,i,l){for(let h of this.patternFeatures)this.addFeature(h,h.geometry,h.index,i,l,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,vd),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,i,l,h,m,g){for(let x of zs(i,500)){let C=uu(x,h,g.fill.getGranularityForZoomLevel(h.z)),w=this.layoutVertexArray;Id(((A,M)=>{w.emplaceBack(A,M)}),this.segments,this.layoutVertexArray,this.indexArray,C.verticesFlattened,C.indicesTriangles,this.segments2,this.indexArray2,C.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,l,{imagePositions:m,canonical:h})}}let Pm,km;Qt("FillBucket",bc,{omit:["layers","patternFeatures"]});var Z_={get paint(){return km=km||new aa({"fill-antialias":new mi(xt.paint_fill["fill-antialias"]),"fill-opacity":new Ii(xt.paint_fill["fill-opacity"]),"fill-color":new Ii(xt.paint_fill["fill-color"]),"fill-outline-color":new Ii(xt.paint_fill["fill-outline-color"]),"fill-translate":new mi(xt.paint_fill["fill-translate"]),"fill-translate-anchor":new mi(xt.paint_fill["fill-translate-anchor"]),"fill-pattern":new Bs(xt.paint_fill["fill-pattern"])})},get layout(){return Pm=Pm||new aa({"fill-sort-key":new Ii(xt.layout_fill["fill-sort-key"])})}};class W_ extends ka{constructor(e,i){super(e,Z_,i)}recalculate(e,i){super.recalculate(e,i);let l=this.paint._values["fill-outline-color"];l.value.kind==="constant"&&l.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new bc(e)}queryRadius(){return gd(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:e,geometry:i,transform:l,pixelsToTileUnits:h}){return dd(Rh(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-l.bearingInRadians,h),i)}isTileClipped(){return!0}}let H_=Pr([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Cd=Pr([{name:"a_centroid",components:2,type:"Int16"}],4),{members:Am}=H_;class qp{constructor(e,i,l,h,m){this.properties={},this.extent=l,this.type=0,this.id=void 0,this._pbf=e,this._geometry=-1,this._keys=h,this._values=m,e.readFields(zm,this,i)}loadGeometry(){let e=this._pbf;e.pos=this._geometry;let i=e.readVarint()+e.pos,l=[],h,m=1,g=0,x=0,C=0;for(;e.pos<i;){if(g<=0){let w=e.readVarint();m=7&w,g=w>>3}if(g--,m===1||m===2)x+=e.readSVarint(),C+=e.readSVarint(),m===1&&(h&&l.push(h),h=[]),h&&h.push(new pe(x,C));else{if(m!==7)throw new Error(`unknown command ${m}`);h&&h.push(h[0].clone())}}return h&&l.push(h),l}bbox(){let e=this._pbf;e.pos=this._geometry;let i=e.readVarint()+e.pos,l=1,h=0,m=0,g=0,x=1/0,C=-1/0,w=1/0,A=-1/0;for(;e.pos<i;){if(h<=0){let M=e.readVarint();l=7&M,h=M>>3}if(h--,l===1||l===2)m+=e.readSVarint(),g+=e.readSVarint(),m<x&&(x=m),m>C&&(C=m),g<w&&(w=g),g>A&&(A=g);else if(l!==7)throw new Error(`unknown command ${l}`)}return[x,w,C,A]}toGeoJSON(e,i,l){let h=this.extent*Math.pow(2,l),m=this.extent*e,g=this.extent*i,x=this.loadGeometry();function C(N){return[360*(N.x+m)/h-180,360/Math.PI*Math.atan(Math.exp((1-2*(N.y+g)/h)*Math.PI))-90]}function w(N){return N.map(C)}let A;if(this.type===1){let N=[];for(let Z of x)N.push(Z[0]);let L=w(N);A=N.length===1?{type:"Point",coordinates:L[0]}:{type:"MultiPoint",coordinates:L}}else if(this.type===2){let N=x.map(w);A=N.length===1?{type:"LineString",coordinates:N[0]}:{type:"MultiLineString",coordinates:N}}else{if(this.type!==3)throw new Error("unknown feature type");{let N=Ed(x),L=[];for(let Z of N)L.push(Z.map(w));A=L.length===1?{type:"Polygon",coordinates:L[0]}:{type:"MultiPolygon",coordinates:L}}}let M={type:"Feature",geometry:A,properties:this.properties};return this.id!=null&&(M.id=this.id),M}}function zm(r,e,i){r===1?e.id=i.readVarint():r===2?(function(l,h){let m=l.readVarint()+l.pos;for(;l.pos<m;){let g=h._keys[l.readVarint()],x=h._values[l.readVarint()];h.properties[g]=x}})(i,e):r===3?e.type=i.readVarint():r===4&&(e._geometry=i.pos)}function Ed(r){let e=r.length;if(e<=1)return[r];let i=[],l,h;for(let m=0;m<e;m++){let g=tp(r[m]);g!==0&&(h===void 0&&(h=g<0),h===g<0?(l&&i.push(l),l=[r[m]]):l&&l.push(r[m]))}return l&&i.push(l),i}function tp(r){let e=0;for(let i,l,h=0,m=r.length,g=m-1;h<m;g=h++)i=r[h],l=r[g],e+=(l.x-i.x)*(i.y+l.y);return e}qp.types=["Unknown","Point","LineString","Polygon"];class X_{constructor(e,i){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(Dm,this,i),this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];let i=this._pbf.readVarint()+this._pbf.pos;return new qp(this._pbf,i,this.extent,this._keys,this._values)}}function Dm(r,e,i){r===15?e.version=i.readVarint():r===1?e.name=i.readString():r===5?e.extent=i.readVarint():r===2?e._features.push(i.pos):r===3?e._keys.push(i.readString()):r===4&&e._values.push((function(l){let h=null,m=l.readVarint()+l.pos;for(;l.pos<m;){let g=l.readVarint()>>3;h=g===1?l.readString():g===2?l.readFloat():g===3?l.readDouble():g===4?l.readVarint64():g===5?l.readVarint():g===6?l.readSVarint():g===7?l.readBoolean():null}if(h==null)throw new Error("unknown feature value");return h})(i))}class Lm{constructor(e,i){this.layers=e.readFields(Md,{},i)}}function Md(r,e,i){if(r===3){let l=new X_(i,i.readVarint()+i.pos);l.length&&(e[l.name]=l)}}let $p=Math.pow(2,13);function Gp(r,e,i,l,h,m,g,x){r.emplaceBack(e,i,2*Math.floor(l*$p)+g,h*$p*2,m*$p*2,Math.round(x))}class Rm{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((i=>i.id)),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new De,this.centroidVertexArray=new Ie,this.indexArray=new Dt,this.programConfigurations=new ql(e.layers,e.zoom),this.segments=new ti,this.stateDependentLayerIds=this.layers.filter((i=>i.isStateDependent())).map((i=>i.id))}populate(e,i,l){this.features=[],this.hasDependencies=bd("fill-extrusion",this.layers,i);for(let{feature:h,id:m,index:g,sourceLayerIndex:x}of e){let C=this.layers[0]._featureFilter.needGeometry,w=vc(h,C);if(!this.layers[0]._featureFilter.filter(new wr(this.zoom),w,l))continue;let A={id:m,sourceLayerIndex:x,index:g,geometry:C?w.geometry:xc(h),properties:h.properties,type:h.type,patterns:{}};this.hasDependencies?this.features.push(wd("fill-extrusion",this.layers,A,{zoom:this.zoom},i)):this.addFeature(A,A.geometry,g,l,{},i.subdivisionGranularity),i.featureIndex.insert(h,A.geometry,g,x,this.index,!0)}}addFeatures(e,i,l){for(let h of this.features){let{geometry:m}=h;this.addFeature(h,m,h.index,i,l,e.subdivisionGranularity)}}update(e,i,l){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,{imagePositions:l})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Am),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Cd.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,i,l,h,m,g){for(let x of zs(i,500)){let C={x:0,y:0,sampleCount:0},w=this.layoutVertexArray.length;this.processPolygon(C,h,e,x,g);let A=this.layoutVertexArray.length-w,M=Math.floor(C.x/C.sampleCount),N=Math.floor(C.y/C.sampleCount);for(let L=0;L<A;L++)this.centroidVertexArray.emplaceBack(M,N)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,l,{imagePositions:m,canonical:h})}processPolygon(e,i,l,h,m){if(h.length<1||ig(h[0]))return;for(let M of h)M.length!==0&&K_(e,M);let g={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},x=m.fill.getGranularityForZoomLevel(i.z),C=qp.types[l.type]==="Polygon";for(let M of h){if(M.length===0||ig(M))continue;let N=th(M,x,C);this._generateSideFaces(N,g)}if(!C)return;let w=uu(h,i,x,!1),A=this.layoutVertexArray;Id(((M,N)=>{Gp(A,M,N,0,0,1,1,0)}),this.segments,this.layoutVertexArray,this.indexArray,w.verticesFlattened,w.indicesTriangles)}_generateSideFaces(e,i){let l=0;for(let h=1;h<e.length;h++){let m=e[h],g=e[h-1];if(Y_(m,g))continue;i.segment.vertexLength+4>ti.MAX_VERTEX_ARRAY_LENGTH&&(i.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let x=m.sub(g)._perp()._unit(),C=g.dist(m);l+C>32768&&(l=0),Gp(this.layoutVertexArray,m.x,m.y,x.x,x.y,0,0,l),Gp(this.layoutVertexArray,m.x,m.y,x.x,x.y,0,1,l),l+=C,Gp(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,0,l),Gp(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,1,l);let w=i.segment.vertexLength;this.indexArray.emplaceBack(w,w+2,w+1),this.indexArray.emplaceBack(w+1,w+2,w+3),i.segment.vertexLength+=4,i.segment.primitiveLength+=2}}}function K_(r,e){for(let i=0;i<e.length;i++){let l=e[i];i===e.length-1&&e[0].x===l.x&&e[0].y===l.y||(r.x+=l.x,r.y+=l.y,r.sampleCount++)}}function Y_(r,e){return r.x===e.x&&(r.x<0||r.x>pi)||r.y===e.y&&(r.y<0||r.y>pi)}function ig(r){return r.every((e=>e.x<0))||r.every((e=>e.x>pi))||r.every((e=>e.y<0))||r.every((e=>e.y>pi))}let Fm;Qt("FillExtrusionBucket",Rm,{omit:["layers","features"]});var zn={get paint(){return Fm=Fm||new aa({"fill-extrusion-opacity":new mi(xt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ii(xt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new mi(xt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new mi(xt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Bs(xt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ii(xt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ii(xt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new mi(xt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class pu extends ka{constructor(e,i){super(e,zn,i)}createBucket(e){return new Rm(e)}queryRadius(){return gd(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:e,feature:i,featureState:l,geometry:h,transform:m,pixelsToTileUnits:g,pixelPosMatrix:x}){let C=Rh(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-m.bearingInRadians,g),w=this.paint.get("fill-extrusion-height").evaluate(i,l),A=this.paint.get("fill-extrusion-base").evaluate(i,l),M=(function(L,Z){let X=[];for(let ie of L){let ne=[ie.x,ie.y,0,1];Si(ne,ne,Z),X.push(new pe(ne[0]/ne[3],ne[1]/ne[3]))}return X})(C,x),N=(function(L,Z,X,ie){let ne=[],ue=[],se=ie[8]*Z,me=ie[9]*Z,be=ie[10]*Z,Ce=ie[11]*Z,We=ie[8]*X,Je=ie[9]*X,mt=ie[10]*X,at=ie[11]*X;for(let vt of L){let bt=[],yt=[];for(let lt of vt){let qt=lt.x,ii=lt.y,Wt=ie[0]*qt+ie[4]*ii+ie[12],$t=ie[1]*qt+ie[5]*ii+ie[13],Gi=ie[2]*qt+ie[6]*ii+ie[14],Tr=ie[3]*qt+ie[7]*ii+ie[15],Ar=Gi+be,Vr=Tr+Ce,Ba=Wt+We,Gn=$t+Je,Ao=Gi+mt,Ko=Tr+at,Sn=new pe((Wt+se)/Vr,($t+me)/Vr);Sn.z=Ar/Vr,bt.push(Sn);let ua=new pe(Ba/Ko,Gn/Ko);ua.z=Ao/Ko,yt.push(ua)}ne.push(bt),ue.push(yt)}return[ne,ue]})(h,A,w,x);return(function(L,Z,X){let ie=1/0;dd(X,Z)&&(ie=Bm(X,Z[0]));for(let ne=0;ne<Z.length;ne++){let ue=Z[ne],se=L[ne];for(let me=0;me<ue.length-1;me++){let be=ue[me],Ce=[be,ue[me+1],se[me+1],se[me],be];Uu(X,Ce)&&(ie=Math.min(ie,Bm(X,Ce)))}}return ie!==1/0&&ie})(N[0],N[1],M)}}function ip(r,e){return r.x*e.x+r.y*e.y}function Bm(r,e){if(r.length===1){let i=0,l=e[i++],h;for(;!h||l.equals(h);)if(h=e[i++],!h)return 1/0;for(;i<e.length;i++){let m=e[i],g=r[0],x=h.sub(l),C=m.sub(l),w=g.sub(l),A=ip(x,x),M=ip(x,C),N=ip(C,C),L=ip(w,x),Z=ip(w,C),X=A*N-M*M,ie=(N*L-M*Z)/X,ne=(A*Z-M*L)/X,ue=l.z*(1-ie-ne)+h.z*ie+m.z*ne;if(isFinite(ue))return ue}return 1/0}{let i=1/0;for(let l of e)i=Math.min(i,l.z);return i}}let Om=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Zp{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[i,l]=new Uint8Array(e,0,2);if(i!==219)throw new Error("Data does not appear to be in a KDBush format.");let h=l>>4;if(h!==1)throw new Error(`Got v${h} data when expected v1.`);let m=Om[15&l];if(!m)throw new Error("Unrecognized array type.");let[g]=new Uint16Array(e,2,1),[x]=new Uint32Array(e,4,1);return new Zp(x,g,m,e)}constructor(e,i=64,l=Float64Array,h){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=l,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let m=Om.indexOf(this.ArrayType),g=2*e*this.ArrayType.BYTES_PER_ELEMENT,x=e*this.IndexArrayType.BYTES_PER_ELEMENT,C=(8-x%8)%8;if(m<0)throw new Error(`Unexpected typed array class: ${l}.`);h&&h instanceof ArrayBuffer?(this.data=h,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+x+C,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+g+x+C),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+x+C,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+m]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=e)}add(e,i){let l=this._pos>>1;return this.ids[l]=l,this.coords[this._pos++]=e,this.coords[this._pos++]=i,l}finish(){let e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Pd(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,i,l,h){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:m,coords:g,nodeSize:x}=this,C=[0,m.length-1,0],w=[];for(;C.length;){let A=C.pop()||0,M=C.pop()||0,N=C.pop()||0;if(M-N<=x){for(let ie=N;ie<=M;ie++){let ne=g[2*ie],ue=g[2*ie+1];ne>=e&&ne<=l&&ue>=i&&ue<=h&&w.push(m[ie])}continue}let L=N+M>>1,Z=g[2*L],X=g[2*L+1];Z>=e&&Z<=l&&X>=i&&X<=h&&w.push(m[L]),(A===0?e<=Z:i<=X)&&(C.push(N),C.push(L-1),C.push(1-A)),(A===0?l>=Z:h>=X)&&(C.push(L+1),C.push(M),C.push(1-A))}return w}within(e,i,l){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:h,coords:m,nodeSize:g}=this,x=[0,h.length-1,0],C=[],w=l*l;for(;x.length;){let A=x.pop()||0,M=x.pop()||0,N=x.pop()||0;if(M-N<=g){for(let ie=N;ie<=M;ie++)zd(m[2*ie],m[2*ie+1],e,i)<=w&&C.push(h[ie]);continue}let L=N+M>>1,Z=m[2*L],X=m[2*L+1];zd(Z,X,e,i)<=w&&C.push(h[L]),(A===0?e-l<=Z:i-l<=X)&&(x.push(N),x.push(L-1),x.push(1-A)),(A===0?e+l>=Z:i+l>=X)&&(x.push(L+1),x.push(M),x.push(1-A))}return C}}function Pd(r,e,i,l,h,m){if(h-l<=i)return;let g=l+h>>1;kd(r,e,g,l,h,m),Pd(r,e,i,l,g-1,1-m),Pd(r,e,i,g+1,h,1-m)}function kd(r,e,i,l,h,m){for(;h>l;){if(h-l>600){let w=h-l+1,A=i-l+1,M=Math.log(w),N=.5*Math.exp(2*M/3),L=.5*Math.sqrt(M*N*(w-N)/w)*(A-w/2<0?-1:1);kd(r,e,i,Math.max(l,Math.floor(i-A*N/w+L)),Math.min(h,Math.floor(i+(w-A)*N/w+L)),m)}let g=e[2*i+m],x=l,C=h;for(Oh(r,e,l,i),e[2*h+m]>g&&Oh(r,e,l,h);x<C;){for(Oh(r,e,x,C),x++,C--;e[2*x+m]<g;)x++;for(;e[2*C+m]>g;)C--}e[2*l+m]===g?Oh(r,e,l,C):(C++,Oh(r,e,C,h)),C<=i&&(l=C+1),i<=C&&(h=C-1)}}function Oh(r,e,i,l){Ad(r,i,l),Ad(e,2*i,2*l),Ad(e,2*i+1,2*l+1)}function Ad(r,e,i){let l=r[e];r[e]=r[i],r[i]=l}function zd(r,e,i,l){let h=r-i,m=e-l;return h*h+m*m}function Dd(r,e,i,l){let h=l,m=e+(i-e>>1),g,x=i-e,C=r[e],w=r[e+1],A=r[i],M=r[i+1];for(let N=e+3;N<i;N+=3){let L=Us(r[N],r[N+1],C,w,A,M);if(L>h)g=N,h=L;else if(L===h){let Z=Math.abs(N-m);Z<x&&(g=N,x=Z)}}h>l&&(g-e>3&&Dd(r,e,g,l),r[g+2]=h,i-g>3&&Dd(r,g,i,l))}function Us(r,e,i,l,h,m){let g=h-i,x=m-l;if(g!==0||x!==0){let C=((r-i)*g+(e-l)*x)/(g*g+x*x);C>1?(i=h,l=m):C>0&&(i+=g*C,l+=x*C)}return g=r-i,x=e-l,g*g+x*x}function $n(r,e,i,l){let h={type:e,geom:i},m={id:r??null,type:h.type,geometry:h.geom,tags:l,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};switch(h.type){case"Point":case"MultiPoint":rp(m,h.geom);break;case"LineString":rp(m,h.geom.points);break;case"Polygon":rp(m,h.geom[0].points);break;case"MultiLineString":for(let g of h.geom)rp(m,g.points);break;case"MultiPolygon":for(let g of h.geom)rp(m,g[0].points)}return m}function Ld(r){r.points.length>64&&(r.points=new Float64Array(r.points))}function rp(r,e){for(let i=0;i<e.length;i+=3)r.minX=Math.min(r.minX,e[i]),r.minY=Math.min(r.minY,e[i+1]),r.maxX=Math.max(r.maxX,e[i]),r.maxY=Math.max(r.maxY,e[i+1])}function Rd(r,e){let i=[];switch(r.type){case"FeatureCollection":for(let l=0;l<r.features.length;l++)Wp(i,r.features[l],e,l);break;case"Feature":Wp(i,r,e);break;default:Wp(i,{geometry:r,properties:void 0},e)}return i}function Wp(r,e,i,l){if(!e.geometry)return;if(e.geometry.type==="GeometryCollection")return void(function(x,C,w,A,M){for(let N of w.geometries)Wp(x,{id:C.id,geometry:N,properties:C.properties},A,M)})(r,e,e.geometry,i,l);if(!e.geometry.coordinates?.length)return;let m=(function(x,C,w){return C.promoteId?x.properties?.[C.promoteId]:C.generateId?w||0:x.id})(e,i,l),g=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2);switch(e.geometry.type){case"Point":return void(function(x,C,w,A){let M=[];M.push(np(w.coordinates[0]),Vh(w.coordinates[1]),0),x.push($n(C,"Point",M,A))})(r,m,e.geometry,e.properties);case"MultiPoint":return void(function(x,C,w,A){let M=[];for(let N of w.coordinates)M.push(np(N[0]),Vh(N[1]),0);x.push($n(C,"MultiPoint",M,A))})(r,m,e.geometry,e.properties);case"LineString":return void(function(x,C,w,A,M){let N={points:[]};Fd(w.coordinates,N,A,!1),x.push($n(C,"LineString",N,M))})(r,m,e.geometry,g,e.properties);case"MultiLineString":return void(function(x,C,w,A,M,N){if(M.lineMetrics)for(let L of w.coordinates){let Z={points:[]};Fd(L,Z,A,!1),x.push($n(C,"LineString",Z,N))}else{let L=[];Bd(w.coordinates,L,A,!1),x.push($n(C,"MultiLineString",L,N))}})(r,m,e.geometry,g,i,e.properties);case"Polygon":return void(function(x,C,w,A,M){let N=[];Bd(w.coordinates,N,A,!0),x.push($n(C,"Polygon",N,M))})(r,m,e.geometry,g,e.properties);case"MultiPolygon":return void(function(x,C,w,A,M){let N=[];for(let L of w.coordinates){let Z=[];Bd(L,Z,A,!0),N.push(Z)}x.push($n(C,"MultiPolygon",N,M))})(r,m,e.geometry,g,e.properties);default:throw new Error("Input data is not a valid GeoJSON object.")}}function Fd(r,e,i,l){let h,m,g=0;for(let C=0;C<r.length;C++){let w=np(r[C][0]),A=Vh(r[C][1]);e.points.push(w,A,0),C>0&&(g+=l?(h*A-w*m)/2:Math.sqrt(Math.pow(w-h,2)+Math.pow(A-m,2))),h=w,m=A}let x=e.points.length-3;e.points[2]=1,i>0&&Dd(e.points,0,x,i),e.points[x+2]=1,Ld(e),e.size=Math.abs(g),e.start=0,e.end=e.size}function Bd(r,e,i,l){for(let h=0;h<r.length;h++){let m={points:[]};Fd(r[h],m,i,l),e.push(m)}}function np(r){return r/360+.5}function Vh(r){let e=Math.sin(r*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}function du(r){let e={type:"Feature",geometry:Hp(r),properties:r.tags};return r.id!=null&&(e.id=r.id),e}function Hp(r){let{type:e,geometry:i}=r;switch(e){case"Point":return{type:e,coordinates:rg(i[0],i[1])};case"MultiPoint":return{type:e,coordinates:op(i)};case"LineString":return{type:e,coordinates:op(i.points)};case"MultiLineString":case"Polygon":return{type:e,coordinates:i.map((l=>op(l.points)))};case"MultiPolygon":return{type:e,coordinates:i.map((l=>l.map((h=>op(h.points)))))}}}function op(r){let e=[];for(let i=0;i<r.length;i+=3)e.push(rg(r[i],r[i+1]));return e}function rg(r,e){return[c(r),n(e)]}function c(r){return 360*(r-.5)}function n(r){let e=(180-360*r)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}var u;function y(r,e,i,l,h,m,g,x){if(l/=e,m>=(i/=e)&&g<l)return r;if(g<i||m>=l)return null;let C=[];for(let w of r){let A=h===u.X?w.minX:w.minY,M=h===u.X?w.maxX:w.maxY;if(A>=i&&M<l)C.push(w);else if(!(M<i||A>=l))switch(w.type){case"Point":case"MultiPoint":I(w,C,i,l,h);continue;case"LineString":k(w,C,i,l,h,x);continue;case"MultiLineString":R(w,C,i,l,h);continue;case"Polygon":q(w,C,i,l,h);continue;case"MultiPolygon":G(w,C,i,l,h);continue}}return C.length?C:null}function I(r,e,i,l,h){let m=[];(function(g,x,C,w,A){for(let M=0;M<g.length;M+=3){let N=g[M+A];N>=C&&N<=w&&de(x,g[M],g[M+1],g[M+2])}})(r.geometry,m,i,l,h),m.length&&e.push($n(r.id,m.length===3?"Point":"MultiPoint",m,r.tags))}function k(r,e,i,l,h,m){let g=[];if(J(r.geometry,g,i,l,h,!1,m.lineMetrics),g.length)if(m.lineMetrics)for(let x of g)e.push($n(r.id,"LineString",x,r.tags));else e.push(g.length>1?$n(r.id,"MultiLineString",g,r.tags):$n(r.id,"LineString",g[0],r.tags))}function R(r,e,i,l,h){let m=[];ce(r.geometry,m,i,l,h,!1),m.length&&e.push(m.length!==1?$n(r.id,"MultiLineString",m,r.tags):$n(r.id,"LineString",m[0],r.tags))}function q(r,e,i,l,h){let m=[];ce(r.geometry,m,i,l,h,!0),m.length&&e.push($n(r.id,"Polygon",m,r.tags))}function G(r,e,i,l,h){let m=[];for(let g of r.geometry){let x=[];ce(g,x,i,l,h,!0),x.length&&m.push(x)}m.length&&e.push($n(r.id,"MultiPolygon",m,r.tags))}function J(r,e,i,l,h,m,g){let x=ae(r),C=h===u.X?ge:ye,w,A,M=r.start;for(let ie=0;ie<r.points.length-3;ie+=3){let ne=r.points[ie],ue=r.points[ie+1],se=r.points[ie+2],me=r.points[ie+3],be=r.points[ie+4],Ce=h===u.X?ne:ue,We=h===u.X?me:be,Je=!1;g&&(w=Math.sqrt(Math.pow(ne-me,2)+Math.pow(ue-be,2))),Ce<i?We>i&&(A=C(x,ne,ue,me,be,i),g&&(x.start=M+w*A)):Ce>l?We<l&&(A=C(x,ne,ue,me,be,l),g&&(x.start=M+w*A)):de(x.points,ne,ue,se),We<i&&Ce>=i&&(A=C(x,ne,ue,me,be,i),Je=!0),We>l&&Ce<=l&&(A=C(x,ne,ue,me,be,l),Je=!0),!m&&Je&&(g&&(x.end=M+w*A),e.push(x),x=ae(r)),g&&(M+=w)}let N=r.points.length-3,L=r.points[N],Z=r.points[N+1],X=h===u.X?L:Z;X>=i&&X<=l&&de(x.points,L,Z,r.points[N+2]),N=x.points.length-3,m&&N>=3&&(x.points[N]!==x.points[0]||x.points[N+1]!==x.points[1])&&de(x.points,x.points[0],x.points[1],x.points[2]),x.points.length&&(Ld(x),e.push(x))}function ae(r){return{points:[],size:r.size,start:r.start,end:r.end}}function ce(r,e,i,l,h,m){for(let g of r)J(g,e,i,l,h,m,!1)}function de(r,e,i,l){r.push(e,i,l)}function ge(r,e,i,l,h,m){let g=(m-e)/(l-e);return de(r.points,m,i+(h-i)*g,1),g}function ye(r,e,i,l,h,m){let g=(m-i)/(h-i);return de(r.points,e+(l-e)*g,m,1),g}function Ue(r,e){let i=e.buffer/e.extent,l=r,h=y(r,1,-1-i,i,u.X,-1,2,e),m=y(r,1,1-i,2+i,u.X,-1,2,e);return(h||m)&&(l=y(r,1,-i,1+i,u.X,-1,2,e)||[],h&&(l=Oe(h,1).concat(l)),m&&(l=l.concat(Oe(m,-1)))),l}function Oe(r,e){let i=[];for(let l of r)switch(l.type){case"Point":case"MultiPoint":{let h=nt(l.geometry,e);i.push($n(l.id,l.type,h,l.tags));continue}case"LineString":{let h=ut(l.geometry,e);i.push($n(l.id,l.type,h,l.tags));continue}case"MultiLineString":case"Polygon":{let h=[];for(let m of l.geometry)h.push(ut(m,e));i.push($n(l.id,l.type,h,l.tags));continue}case"MultiPolygon":{let h=[];for(let m of l.geometry){let g=[];for(let x of m)g.push(ut(x,e));h.push(g)}i.push($n(l.id,l.type,h,l.tags));continue}}return i}function nt(r,e){let i=[];for(let l=0;l<r.length;l+=3)i.push(r[l]+e,r[l+1],r[l+2]);return i}function ut(r,e){let i={points:[],size:r.size};r.start!==void 0&&(i.start=r.start,i.end=r.end);for(let l=0;l<r.points.length;l+=3)i.points.push(r.points[l]+e,r.points[l+1],r.points[l+2]);return Ld(i),i}function tt(r,e,i){let l=!!e.newGeometry,h=e.removeAllProperties||e.removeProperties?.length>0||e.addOrUpdateProperties?.length>0;if(l){let m=r[0],g=Rd({type:"FeatureCollection",features:[{type:"Feature",id:m.id,geometry:e.newGeometry,properties:h?st(m.tags,e):m.tags}]},i);return g=Ue(g,i),g}if(h){let m=[];for(let g of r){let x={...g};x.tags=st(x.tags,e),m.push(x)}return m}return r}function st(r,e){if(e.removeAllProperties)return{};let i={...r||{}};if(e.removeProperties)for(let l of e.removeProperties)delete i[l];if(e.addOrUpdateProperties)for(let{key:l,value:h}of e.addOrUpdateProperties)i[l]=h;return i}(function(r){r[r.X=0]="X",r[r.Y=1]="Y"})(u||(u={}));let Pt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:r=>r};class kt{constructor(e){this.options=Object.assign(Object.create(Pt),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[],this.points=[]}load(e){let i=[];for(let l of e){if(!l.geometry)continue;let[h,m]=l.geometry.coordinates,[g,x]=[np(h),Vh(m)];i.push({id:l.id,type:"Point",geometry:[g,x],tags:l.properties})}this.createIndex(i)}initialize(e){let i=[];for(let l of e)l.type==="Point"&&i.push(l);this.createIndex(i)}updateIndex(e,i,l){this.options=Object.assign(Object.create(Pt),l.clusterOptions),this.initialize(e)}createIndex(e){let{log:i,minZoom:l,maxZoom:h}=this.options;i&&console.time("total time");let m=`prepare ${e.length} points`;i&&console.time(m),this.points=e;let g=[];for(let C=0;C<e.length;C++){let w=e[C];if(!w?.geometry)continue;let[A,M]=w.geometry;A=Math.fround(A),M=Math.fround(M),g.push(A,M,1/0,C,-1,1),this.options.reduce&&g.push(0)}let x=this.trees[h+1]=this.createTree(g);i&&console.timeEnd(m);for(let C=h;C>=l;C--){let w=Date.now();x=this.trees[C]=this.createTree(this.cluster(x,C)),i&&console.log("z%d: %d clusters in %dms",C,x.numItems,Date.now()-w)}i&&console.timeEnd("total time")}getClusters(e,i){return this.getClustersInternal(e,i).map((l=>du(l)))}getClustersInternal(e,i){let l=((e[0]+180)%360+360)%360-180,h=Math.max(-90,Math.min(90,e[1])),m=e[2]===180?180:((e[2]+180)%360+360)%360-180,g=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)l=-180,m=180;else if(l>m){let M=this.getClustersInternal([l,h,180,g],i),N=this.getClustersInternal([-180,h,m,g],i);return M.concat(N)}let x=this.trees[this.limitZoom(i)],C=x.range(np(l),Vh(g),np(m),Vh(h)),w=x.flatData,A=[];for(let M of C){let N=this.stride*M;A.push(w[N+5]>1?di(w,N,this.clusterProps):this.points[w[N+3]])}return A}getChildren(e){let i=this.getOriginId(e),l=this.getOriginZoom(e),h=new Error("No cluster with the specified id: "+e),m=this.trees[l];if(!m)throw h;let g=m.flatData;if(i*this.stride>=g.length)throw h;let x=this.options.radius/(this.options.extent*Math.pow(2,l-1)),C=m.within(g[i*this.stride],g[i*this.stride+1],x),w=[];for(let A of C){let M=A*this.stride;g[M+4]===e&&w.push(g[M+5]>1?bi(g,M,this.clusterProps):du(this.points[g[M+3]]))}if(w.length===0)throw h;return w}getLeaves(e,i,l){let h=[];return this.appendLeaves(h,e,i=i||10,l=l||0,0),h}getTile(e,i,l){let h=this.trees[this.limitZoom(e)];if(!h)return null;let m=Math.pow(2,e),{extent:g,radius:x}=this.options,C=x/g,w=(l-C)/m,A=(l+1+C)/m,M={transformed:!0,features:[],source:null,x:i,y:l,z:e};return this.addTileFeatures(h.range((i-C)/m,w,(i+1+C)/m,A),h.flatData,i,l,m,M),i===0&&this.addTileFeatures(h.range(1-C/m,w,1,A),h.flatData,m,l,m,M),i===m-1&&this.addTileFeatures(h.range(0,w,C/m,A),h.flatData,-1,l,m,M),M}getClusterExpansionZoom(e){return this.getOriginZoom(e)}appendLeaves(e,i,l,h,m){let g=this.getChildren(i);for(let x of g){let C=x.properties;if(C?.cluster?m+C.point_count<=h?m+=C.point_count:m=this.appendLeaves(e,C.cluster_id,l,h,m):m<h?m++:e.push(x),e.length===l)break}return m}createTree(e){let i=new Zp(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let l=0;l<e.length;l+=this.stride)i.add(e[l],e[l+1]);return i.finish(),i.flatData=e,i.data=null,i}addTileFeatures(e,i,l,h,m,g){for(let x of e){let C=x*this.stride,w=i[C+5]>1,A,M,N;if(w)A=oi(i,C,this.clusterProps),M=i[C],N=i[C+1];else{let X=this.points[i[C+3]];A=X.tags,[M,N]=X.geometry}let L={type:1,geometry:[[Math.round(this.options.extent*(M*m-l)),Math.round(this.options.extent*(N*m-h))]],tags:A},Z;Z=w||this.options.generateId?i[C+3]:this.points[i[C+3]].id,Z!==void 0&&(L.id=Z),g.features.push(L)}}limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}cluster(e,i){let{radius:l,extent:h,reduce:m,minPoints:g}=this.options,x=l/(h*Math.pow(2,i)),C=e.flatData,w=[],A=this.stride;for(let M=0;M<C.length;M+=A){if(C[M+2]<=i)continue;C[M+2]=i;let N=C[M],L=C[M+1],Z=e.within(C[M],C[M+1],x),X=C[M+5],ie=X;for(let ne of Z){let ue=ne*A;C[ue+2]>i&&(ie+=C[ue+5])}if(ie>X&&ie>=g){let ne,ue=N*X,se=L*X,me=-1,be=(M/A<<5)+(i+1)+this.points.length;for(let Ce of Z){let We=Ce*A;if(C[We+2]<=i)continue;C[We+2]=i;let Je=C[We+5];ue+=C[We]*Je,se+=C[We+1]*Je,C[We+4]=be,m&&(ne||(ne=this.map(C,M,!0),me=this.clusterProps.length,this.clusterProps.push(ne)),m(ne,this.map(C,We)))}C[M+4]=be,w.push(ue/ie,se/ie,1/0,be,-1,ie),m&&w.push(me)}else{for(let ne=0;ne<A;ne++)w.push(C[M+ne]);if(ie>1)for(let ne of Z){let ue=ne*A;if(!(C[ue+2]<=i)){C[ue+2]=i;for(let se=0;se<A;se++)w.push(C[ue+se])}}}}return w}getOriginId(e){return e-this.points.length>>5}getOriginZoom(e){return(e-this.points.length)%32}map(e,i,l){if(e[i+5]>1){let g=this.clusterProps[e[i+6]];return l?Object.assign({},g):g}let h=this.points[e[i+3]].tags,m=this.options.map(h);return l&&m===h?Object.assign({},m):m}}function di(r,e,i){return{id:r[e+3],type:"Point",tags:oi(r,e,i),geometry:[r[e],r[e+1]]}}function bi(r,e,i){return{type:"Feature",id:r[e+3],properties:oi(r,e,i),geometry:{type:"Point",coordinates:[c(r[e]),n(r[e+1])]}}}function oi(r,e,i){let l=r[e+5],h=l>=1e4?`${Math.round(l/1e3)}k`:l>=1e3?Math.round(l/100)/10+"k":l,m=r[e+6],g=m===-1?{}:Object.assign({},i[m]);return Object.assign(g,{cluster:!0,cluster_id:r[e+3],point_count:l,point_count_abbreviated:h})}let Jt="geojsonvt_clip_start",Zt="geojsonvt_clip_end";function si(r,e,i,l,h){let m=e===h.maxZoom?0:h.tolerance/((1<<e)*h.extent),g={transformed:!1,features:[],source:null,x:i,y:l,z:e,minX:2,minY:1,maxX:-1,maxY:0,numPoints:0,numSimplified:0,numFeatures:r.length};for(let x of r)ni(g,x,m,h);return g}function ni(r,e,i,l){switch(r.minX=Math.min(r.minX,e.minX),r.minY=Math.min(r.minY,e.minY),r.maxX=Math.max(r.maxX,e.maxX),r.maxY=Math.max(r.maxY,e.maxY),e.type){case"Point":case"MultiPoint":return void(function(h,m){let g=[];for(let C=0;C<m.geometry.length;C+=3)g.push(m.geometry[C],m.geometry[C+1]),h.numPoints++,h.numSimplified++;if(!g.length)return;let x={type:1,tags:m.tags||null,geometry:g};m.id!==null&&(x.id=m.id),h.features.push(x)})(r,e);case"LineString":return void(function(h,m,g,x){let C=[];if(Vt(C,m.geometry,h,g,!1,!1),!C.length)return;let w=m.tags||null;if(x.lineMetrics){w={};for(let M in m.tags)w[M]=m.tags[M];w[Jt]=m.geometry.start/m.geometry.size,w[Zt]=m.geometry.end/m.geometry.size}let A={type:2,tags:w,geometry:C};m.id!==null&&(A.id=m.id),h.features.push(A)})(r,e,i,l);case"MultiLineString":case"Polygon":return void(function(h,m,g){let x=[];for(let w=0;w<m.geometry.length;w++)Vt(x,m.geometry[w],h,g,m.type==="Polygon",w===0);if(!x.length)return;let C={type:m.type==="Polygon"?3:2,tags:m.tags||null,geometry:x};m.id!==null&&(C.id=m.id),h.features.push(C)})(r,e,i);case"MultiPolygon":return void(function(h,m,g){let x=[];for(let w=0;w<m.geometry.length;w++){let A=m.geometry[w];for(let M=0;M<A.length;M++)Vt(x,A[M],h,g,!0,M===0)}if(!x.length)return;let C={type:3,tags:m.tags||null,geometry:x};m.id!==null&&(C.id=m.id),h.features.push(C)})(r,e,i)}}function Vt(r,e,i,l,h,m){let g=l*l;if(l>0&&e.size<(h?g:l))return void(i.numPoints+=e.points.length/3);let x=[];for(let C=0;C<e.points.length;C+=3)(l===0||e.points[C+2]>g)&&(i.numSimplified++,x.push(e.points[C],e.points[C+1])),i.numPoints++;h&&(function(C,w){let A=0;for(let M=0,N=C.length,L=N-2;M<N;L=M,M+=2)A+=(C[M]-C[L])*(C[M+1]+C[L+1]);if(A>0===w)for(let M=0,N=C.length;M<N/2;M+=2){let L=C[M],Z=C[M+1];C[M]=C[N-2-M],C[M+1]=C[N-1-M],C[N-2-M]=L,C[N-1-M]=Z}})(x,m),r.push(x)}function Di(r,e){if(r.transformed)return r;let i=1<<r.z,l=r.x,h=r.y;for(let m of r.features)m.type===1?Ei(m,e,i,l,h):ir(m,e,i,l,h);return r.transformed=!0,r}function Ei(r,e,i,l,h){let m=r,g=r.geometry,x=[];for(let C=0;C<g.length;C+=2)x.push(Ur(g[C],g[C+1],e,i,l,h));return m.geometry=x,m}function ir(r,e,i,l,h){let m=r,g=r.geometry,x=[];for(let C of g){let w=[];for(let A=0;A<C.length;A+=2)w.push(Ur(C[A],C[A+1],e,i,l,h));x.push(w)}return m.geometry=x,m}function Ur(r,e,i,l,h,m){return[Math.round(i*(r*l-h)),Math.round(i*(e*l-m))]}class rn{constructor(e){this.options=e,this.total=0,this.stats={},this.tiles={},this.tileCoords=[],this.stats={},this.total=0}initialize(e){this.splitTile(e,0,0,0),this.options.debug&&(e.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)))}updateIndex(e,i,l){l.debug>1&&(console.log("invalidating tiles"),console.time("invalidating")),this.invalidateTiles(i),l.debug>1&&console.timeEnd("invalidating");let[h,m,g]=[0,0,0],x=si(e,h,m,g,l);x.source=e;let C=Dn(h,m,g);if(this.tiles[C]=x,this.tileCoords.push({z:h,x:m,y:g,id:C}),l.debug){let w=`z${h}`;this.stats[w]=(this.stats[w]||0)+1,this.total++}}getClusterExpansionZoom(e){return null}getChildren(e){return null}getLeaves(e,i,l){return null}getTile(e,i,l){let{extent:h,debug:m}=this.options,g=1<<e,x=Dn(e,i=i+g&g-1,l);if(this.tiles[x])return Di(this.tiles[x],h);m>1&&console.log("drilling down to z%d-%d-%d",e,i,l);let C,w=e,A=i,M=l;for(;!C&&w>0;)w--,A>>=1,M>>=1,C=this.tiles[Dn(w,A,M)];return C?.source?(m>1&&(console.log("found parent tile z%d-%d-%d",w,A,M),console.time("drilling down")),this.splitTile(C.source,w,A,M,e,i,l),m>1&&console.timeEnd("drilling down"),this.tiles[x]?Di(this.tiles[x],h):null):null}splitTile(e,i,l,h,m,g,x){let C=[e,i,l,h],w=this.options,A=w.debug;for(;C.length;){h=C.pop(),l=C.pop(),i=C.pop(),e=C.pop();let M=1<<i,N=Dn(i,l,h),L=this.tiles[N];if(!L&&(A>1&&console.time("creation"),L=this.tiles[N]=si(e,i,l,h,w),this.tileCoords.push({z:i,x:l,y:h,id:N}),A)){A>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",i,l,h,L.numFeatures,L.numPoints,L.numSimplified),console.timeEnd("creation"));let Je=`z${i}`;this.stats[Je]=(this.stats[Je]||0)+1,this.total++}if(L.source=e,m==null){if(i===w.indexMaxZoom||L.numPoints<=w.indexMaxPoints)continue}else{if(i===w.maxZoom||i===m)continue;if(m!=null){let Je=m-i;if(l!==g>>Je||h!==x>>Je)continue}}if(L.source=null,!e.length)continue;A>1&&console.time("clipping");let Z=.5*w.buffer/w.extent,X=.5-Z,ie=.5+Z,ne=1+Z,ue=null,se=null,me=null,be=null,Ce=y(e,M,l-Z,l+ie,u.X,L.minX,L.maxX,w),We=y(e,M,l+X,l+ne,u.X,L.minX,L.maxX,w);Ce&&(ue=y(Ce,M,h-Z,h+ie,u.Y,L.minY,L.maxY,w),se=y(Ce,M,h+X,h+ne,u.Y,L.minY,L.maxY,w)),We&&(me=y(We,M,h-Z,h+ie,u.Y,L.minY,L.maxY,w),be=y(We,M,h+X,h+ne,u.Y,L.minY,L.maxY,w)),A>1&&console.timeEnd("clipping"),C.push(ue||[],i+1,2*l,2*h),C.push(se||[],i+1,2*l,2*h+1),C.push(me||[],i+1,2*l+1,2*h),C.push(be||[],i+1,2*l+1,2*h+1)}}invalidateTiles(e){if(!e.length)return;let i=this.options,{debug:l}=i,h=1/0,m=-1/0,g=1/0,x=-1/0;for(let A of e)h=Math.min(h,A.minX),m=Math.max(m,A.maxX),g=Math.min(g,A.minY),x=Math.max(x,A.maxY);let C=i.buffer/i.extent,w=new Set;for(let A in this.tiles){let M=this.tiles[A],N=1<<M.z,L=(M.x-C)/N,Z=(M.x+1+C)/N,X=(M.y-C)/N,ie=(M.y+1+C)/N;if(m<L||h>=Z||x<X||g>=ie)continue;let ne=!1;for(let ue of e)if(ue.maxX>=L&&ue.minX<Z&&ue.maxY>=X&&ue.minY<ie){ne=!0;break}if(ne){if(l){l>1&&console.log("invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",M.z,M.x,M.y,M.numFeatures,M.numPoints,M.numSimplified);let ue=`z${M.z}`;this.stats[ue]=(this.stats[ue]||0)-1,this.total--}delete this.tiles[A],w.add(A)}}w.size&&(this.tileCoords=this.tileCoords.filter((A=>!w.has(A.id))))}}function Dn(r,e,i){return 32*((1<<r)*i+e)+r}let js={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,updateable:!1,cluster:!1,clusterOptions:Pt,debug:0},qo=Pr([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:Jn}=qo,po=Pr([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:$o}=po,ca=Math.cos(Math.PI/180*37.5),Da=Math.pow(2,14)/.5;class Ln{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((i=>i.id)),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={};for(let i of this.layers)this.gradients[i.id]={};this.layoutVertexArray=new je,this.layoutVertexArray2=new Le,this.indexArray=new Dt,this.programConfigurations=new ql(e.layers,e.zoom),this.segments=new ti,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((i=>i.isStateDependent())).map((i=>i.id))}populate(e,i,l){this.hasDependencies=bd("line",this.layers,i)||this.hasLineDasharray(this.layers);let h=this.layers[0].layout.get("line-sort-key"),m=!h.isConstant(),g=[];for(let{feature:x,id:C,index:w,sourceLayerIndex:A}of e){let M=this.layers[0]._featureFilter.needGeometry,N=vc(x,M);if(!this.layers[0]._featureFilter.filter(new wr(this.zoom),N,l))continue;let L=m?h.evaluate(N,{},l):void 0,Z={id:C,properties:x.properties,type:x.type,sourceLayerIndex:A,index:w,geometry:M?N.geometry:xc(x),patterns:{},dashes:{},sortKey:L};g.push(Z)}m&&g.sort(((x,C)=>x.sortKey-C.sortKey));for(let x of g){let{geometry:C,index:w,sourceLayerIndex:A}=x;this.hasDependencies?(bd("line",this.layers,i)?wd("line",this.layers,x,{zoom:this.zoom},i):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,x,this.zoom,i),this.patternFeatures.push(x)):this.addFeature(x,C,w,l,{},{},i.subdivisionGranularity),i.featureIndex.insert(e[w].feature,C,w,A,this.index)}}update(e,i,l,h){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,{imagePositions:l,dashPositions:h})}addFeatures(e,i,l,h){for(let m of this.patternFeatures)this.addFeature(m,m.geometry,m.index,i,l,h,e.subdivisionGranularity)}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,$o)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Jn),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.hasOwn(e.properties,Jt)&&Object.hasOwn(e.properties,Zt))return{start:+e.properties[Jt],end:+e.properties[Zt]}}addFeature(e,i,l,h,m,g,x){let C=this.layers[0].layout,w=C.get("line-join").evaluate(e,{}),A=C.get("line-cap").evaluate(e,{}),M=C.get("line-miter-limit").evaluate(e,{}),N=C.get("line-round-limit").evaluate(e,{});this.lineClips=this.lineFeatureClips(e);for(let L of i)this.addLine(L,e,w,A,M,N,h,x);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,l,{imagePositions:m,dashPositions:g,canonical:h})}addLine(e,i,l,h,m,g,x,C){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,e=th(e,x?C.line.getGranularityForZoomLevel(x.z):1),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let se=0;se<e.length-1;se++)this.totalDistance+=e[se].dist(e[se+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let w=qp.types[i.type]==="Polygon",A=e.length;for(;A>=2&&e[A-1].equals(e[A-2]);)A--;let M=0;for(;M<A-1&&e[M].equals(e[M+1]);)M++;if(A<(w?3:2))return;l==="bevel"&&(m=1.05);let N=this.overscaling<=16?122880/(512*this.overscaling):0,L=this.segments.prepareSegment(10*A,this.layoutVertexArray,this.indexArray),Z,X,ie,ne,ue;this.e1=this.e2=-1,w&&(Z=e[A-2],ue=e[M].sub(Z)._unit()._perp());for(let se=M;se<A;se++){if(ie=se===A-1?w?e[M+1]:void 0:e[se+1],ie&&e[se].equals(ie))continue;ue&&(ne=ue),Z&&(X=Z),Z=e[se],ue=ie?ie.sub(Z)._unit()._perp():ne,ne||(ne=ue);let me=ne.add(ue);me.x===0&&me.y===0||me._unit();let be=ne.x*ue.x+ne.y*ue.y,Ce=me.x*ue.x+me.y*ue.y,We=Ce!==0?1/Ce:1/0,Je=2*Math.sqrt(2-2*Ce),mt=Ce<ca&&X&&ie,at=ne.x*ue.y-ne.y*ue.x>0;if(mt&&se>M){let yt=Z.dist(X);if(yt>2*N){let lt=Z.sub(Z.sub(X)._mult(N/yt)._round());this.updateDistance(X,lt),this.addCurrentVertex(lt,ne,0,0,L),X=lt}}let vt=X&&ie,bt=vt?l:w?"butt":h;if(vt&&bt==="round"&&(We<g?bt="miter":We<=2&&(bt="fakeround")),bt==="miter"&&We>m&&(bt="bevel"),bt==="bevel"&&(We>2&&(bt="flipbevel"),We<m&&(bt="miter")),X&&this.updateDistance(X,Z),bt==="miter")me._mult(We),this.addCurrentVertex(Z,me,0,0,L);else if(bt==="flipbevel"){if(We>100)me=ue.mult(-1);else{let yt=We*ne.add(ue).mag()/ne.sub(ue).mag();me._perp()._mult(yt*(at?-1:1))}this.addCurrentVertex(Z,me,0,0,L),this.addCurrentVertex(Z,me.mult(-1),0,0,L)}else if(bt==="bevel"||bt==="fakeround"){let yt=-Math.sqrt(We*We-1),lt=at?yt:0,qt=at?0:yt;if(X&&this.addCurrentVertex(Z,ne,lt,qt,L),bt==="fakeround"){let ii=Math.round(180*Je/Math.PI/20);for(let Wt=1;Wt<ii;Wt++){let $t=Wt/ii;if($t!==.5){let Tr=$t-.5;$t+=$t*Tr*($t-1)*((1.0904+be*(be*(3.55645-1.43519*be)-3.2452))*Tr*Tr+(.848013+be*(.215638*be-1.06021)))}let Gi=ue.sub(ne)._mult($t)._add(ne)._unit()._mult(at?-1:1);this.addHalfVertex(Z,Gi.x,Gi.y,!1,at,0,L)}}ie&&this.addCurrentVertex(Z,ue,-lt,-qt,L)}else if(bt==="butt")this.addCurrentVertex(Z,me,0,0,L);else if(bt==="square"){let yt=X?1:-1;this.addCurrentVertex(Z,me,yt,yt,L)}else bt==="round"&&(X&&(this.addCurrentVertex(Z,ne,0,0,L),this.addCurrentVertex(Z,ne,1,1,L,!0)),ie&&(this.addCurrentVertex(Z,ue,-1,-1,L,!0),this.addCurrentVertex(Z,ue,0,0,L)));if(mt&&se<A-1){let yt=Z.dist(ie);if(yt>2*N){let lt=Z.add(ie.sub(Z)._mult(N/yt)._round());this.updateDistance(Z,lt),this.addCurrentVertex(lt,ue,0,0,L),Z=lt}}}}addCurrentVertex(e,i,l,h,m,g=!1){let x=i.y*h-i.x,C=-i.y-i.x*h;this.addHalfVertex(e,i.x+i.y*l,i.y-i.x*l,g,!1,l,m),this.addHalfVertex(e,x,C,g,!0,-h,m),this.distance>Da/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,i,l,h,m,g))}addHalfVertex({x:e,y:i},l,h,m,g,x,C){let w=.5*(this.lineClips?this.scaledDistance*(Da-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(m?1:0),(i<<1)+(g?1:0),Math.round(63*l)+128,Math.round(63*h)+128,1+(x===0?0:x<0?-1:1)|(63&w)<<2,w>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let A=C.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,A,this.e2),C.primitiveLength++),g?this.e2=A:this.e1=A}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,i){this.distance+=e.dist(i),this.updateScaledDistance()}hasLineDasharray(e){for(let i of e){let l=i.paint.get("line-dasharray");if(l&&!l.isConstant())return!0}return!1}addLineDashDependencies(e,i,l,h){for(let m of e){let g=m.paint.get("line-dasharray");if(!g||g.value.kind==="constant")continue;let x=m.layout.get("line-cap").evaluate(i,{})==="round",C={dasharray:g.value.evaluate({zoom:l-1},i,{}),round:x},w={dasharray:g.value.evaluate({zoom:l},i,{}),round:x},A={dasharray:g.value.evaluate({zoom:l+1},i,{}),round:x},M=`${C.dasharray.join(",")},${C.round}`,N=`${w.dasharray.join(",")},${w.round}`,L=`${A.dasharray.join(",")},${A.round}`;h.dashDependencies[M]=C,h.dashDependencies[N]=w,h.dashDependencies[L]=A,i.dashes[m.id]={min:M,mid:N,max:L}}}}let ko,Go;Qt("LineBucket",Ln,{omit:["layers","patternFeatures"]});var ha={get paint(){return Go=Go||new aa({"line-opacity":new Ii(xt.paint_line["line-opacity"]),"line-color":new Ii(xt.paint_line["line-color"]),"line-translate":new mi(xt.paint_line["line-translate"]),"line-translate-anchor":new mi(xt.paint_line["line-translate-anchor"]),"line-width":new Ii(xt.paint_line["line-width"]),"line-gap-width":new Ii(xt.paint_line["line-gap-width"]),"line-offset":new Ii(xt.paint_line["line-offset"]),"line-blur":new Ii(xt.paint_line["line-blur"]),"line-dasharray":new Bs(xt.paint_line["line-dasharray"]),"line-pattern":new Bs(xt.paint_line["line-pattern"]),"line-gradient":new Wc(xt.paint_line["line-gradient"])})},get layout(){return ko=ko||new aa({"line-cap":new Ii(xt.layout_line["line-cap"]),"line-join":new Ii(xt.layout_line["line-join"]),"line-miter-limit":new Ii(xt.layout_line["line-miter-limit"]),"line-round-limit":new Ii(xt.layout_line["line-round-limit"]),"line-sort-key":new Ii(xt.layout_line["line-sort-key"])})}};class Ja extends Ii{possiblyEvaluate(e,i){return i=new wr(Math.floor(i.zoom),{now:i.now,fadeDuration:i.fadeDuration,zoomHistory:i.zoomHistory,transition:i.transition}),super.possiblyEvaluate(e,i)}evaluate(e,i,l,h){return i=Dr({},i,{zoom:Math.floor(i.zoom)}),super.evaluate(e,i,l,h)}}let Zo;class mn extends ka{constructor(e,i){super(e,ha,i),this.gradientVersion=0,Zo||(Zo=new Ja(ha.paint.properties["line-width"].specification),Zo.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){let i=this.gradientExpression();this.stepInterpolant=!!(function(l){return l._styleExpression!==void 0})(i)&&i._styleExpression.expression instanceof rc,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,i){super.recalculate(e,i),this.paint._values["line-floorwidth"]=Zo.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new Ln(e)}queryRadius(e){let i=e,l=no(qu("line-width",this,i),qu("line-gap-width",this,i)),h=qu("line-offset",this,i);return l/2+Math.abs(h)+gd(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:e,feature:i,featureState:l,geometry:h,transform:m,pixelsToTileUnits:g}){let x=Rh(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-m.bearingInRadians,g),C=g/2*no(this.paint.get("line-width").evaluate(i,l),this.paint.get("line-gap-width").evaluate(i,l)),w=this.paint.get("line-offset").evaluate(i,l);return w&&(h=(function(A,M){let N=[];for(let L of A){let Z=Po(L),X=[];for(let ie=0;ie<Z.length;ie++){let ne=Z[ie],ue=Z[ie-1],se=Z[ie+1],me=ie===0?new pe(0,0):ne.sub(ue)._unit()._perp(),be=ie===Z.length-1?new pe(0,0):se.sub(ne)._unit()._perp(),Ce=me._add(be)._unit(),We=Ce.x*be.x+Ce.y*be.y;We!==0&&Ce._mult(1/We),X.push(Ce._mult(M)._add(ne))}N.push(X)}return N})(h,w*g)),(function(A,M,N){for(let L of M){if(A.length>=3){for(let Z of L)if(ju(A,Z))return!0}if(V_(A,L,N))return!0}return!1})(x,h,C)}isTileClipped(){return!0}}function no(r,e){return e>0?e+2*r:r}let sr=Pr([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),xs=Pr([{name:"a_projected_pos",components:3,type:"Float32"}],4);Pr([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let Wo=Pr([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);Pr([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);let Ho=Pr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),dl=Pr([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Gl(r,e,i){let l=e.layout.get("text-transform").evaluate(i,{});return l==="uppercase"?r=r.toLocaleUpperCase():l==="lowercase"&&(r=r.toLocaleLowerCase()),Xa.applyArabicShaping&&(r=Xa.applyArabicShaping(r)),r}function Zl(r,e,i){for(let l of r.sections)l.text=Gl(l.text,e,i);return r}Pr([{name:"triangle",components:3,type:"Uint16"}]),Pr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Pr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),Pr([{type:"Float32",name:"offsetX"}]),Pr([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Pr([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var Jr=24;let La={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u22EF":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"},qs={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},Qa={40:!0};function wc(r,e,i,l,h,m){if("fontStack"in e){let g=i[e.fontStack],x=g?.[r];return x?x.metrics.advance*e.scale+h:0}{let g=l[e.imageName];return g?g.displaySize[0]*e.scale*Jr/m+h:0}}function ap(r,e,i,l){let h=Math.pow(r-e,2);return l?r<e?h/2:2*h:h+Math.abs(i)*i}function ng(r,e,i){let l=0;return r===10&&(l-=1e4),i&&(l+=150),r!==40&&r!==65288||(l+=50),e!==41&&e!==65289||(l+=50),l}function Od(r,e,i,l,h,m){let g=null,x=ap(e,i,h,m);for(let C of l){let w=ap(e-C.x,i,h,m)+C.badness;w<=x&&(g=C,x=w)}return{index:r,x:e,priorBreak:g,badness:x}}function Vd(r){return r?Vd(r.priorBreak).concat(r.index):[]}class vs{constructor(e="",i=[],l=[]){this.text=e,this.sections=i,this.sectionIndex=l,this.imageSectionID=null}static fromFeature(e,i){let l=new vs;for(let h of e.sections)h.image?l.addImageSection(h):l.addTextSection(h,i);return l}length(){return[...this.text].length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}verticalizePunctuation(){this.text=(function(e){let i="",l={premature:!0,value:void 0},h=e[Symbol.iterator](),m=h.next(),g=e[Symbol.iterator]();g.next();let x=g.next();for(;!m.done;)i+=!x.done&&Fs(x.value.codePointAt(0))&&!La[x.value]||!l.premature&&Fs(l.value.codePointAt(0))&&!La[l.value]||!La[m.value]?m.value:La[m.value],l={value:m.value,premature:!1},m=h.next(),x=g.next();return i})(this.text)}hasZeroWidthSpaces(){return this.text.includes("\u200B")}trim(){let e=this.text.match(/^\s*/),i=e?e[0].length:0,l=this.text.match(/\S\s*$/),h=l?l[0].length-1:0;this.text=this.text.substring(i,this.text.length-h),this.sectionIndex=this.sectionIndex.slice(i,this.sectionIndex.length-h)}substring(e,i){let l=[...this.text].slice(e,i).join(""),h=this.sectionIndex.slice(e,i);return new vs(l,this.sections,h)}toCodeUnitIndex(e){return[...this.text].slice(0,e).join("").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((e,i)=>Math.max(e,this.sections[i].scale)),0)}getMaxImageSize(e){let i=0,l=0;for(let h=0;h<this.length();h++){let m=this.getSection(h);if("imageName"in m){let g=e[m.imageName];if(!g)continue;let x=g.displaySize;i=Math.max(i,x[0]),l=Math.max(l,x[1])}}return{maxImageWidth:i,maxImageHeight:l}}addTextSection(e,i){this.text+=e.text,this.sections.push({scale:e.scale||1,verticalAlign:e.verticalAlign||"bottom",fontStack:e.fontStack||i});let l=this.sections.length-1;this.sectionIndex.push(...[...e.text].map((()=>l)))}addImageSection(e){let i=e.image?e.image.name:"";if(i.length===0)return void Gr("Can't add FormattedSection with an empty image.");let l=this.getNextImageSectionCharCode();l?(this.text+=String.fromCharCode(l),this.sections.push({scale:1,verticalAlign:e.verticalAlign||"bottom",imageName:i}),this.sectionIndex.push(this.sections.length-1)):Gr("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(e,i,l,h,m){let g=[],x=this.determineAverageLineWidth(e,i,l,h,m),C=this.hasZeroWidthSpaces(),w=0,A=0,M=this.text[Symbol.iterator](),N=M.next(),L=this.text[Symbol.iterator]();L.next();let Z=L.next(),X=this.text[Symbol.iterator]();X.next(),X.next();let ie=X.next();for(;!N.done;){let ne=this.getSection(A),ue=N.value.codePointAt(0);if(Eh(ue)||(w+=wc(ue,ne,l,h,e,m)),!Z.done){let se=Ma(ue),me=Z.value.codePointAt(0);(qs[ue]||se||"imageName"in ne||!ie.done&&Qa[me])&&g.push(Od(A+1,w,x,g,ng(ue,me,se&&C),!1))}A++,N=M.next(),Z=L.next(),ie=X.next()}return Vd(Od(this.length(),w,x,g,0,!0))}determineAverageLineWidth(e,i,l,h,m){let g=0,x=0;for(let C of this.text){let w=this.getSection(x);g+=wc(C.codePointAt(0),w,l,h,e,m),x++}return g/Math.max(1,Math.ceil(g/i))}}let Nd=4294967296,Ud=1/Nd,jd=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");class Xp{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(e,i,l=this.length){for(;this.pos<l;){let h=this.readVarint(),m=h>>3,g=this.pos;this.type=7&h,e(m,i,this),this.pos===g&&this.skip(h)}return i}readMessage(e,i){return this.readFields(e,i,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*Nd;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Nd;return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){let i=this.buf,l,h;return h=i[this.pos++],l=127&h,h<128?l:(h=i[this.pos++],l|=(127&h)<<7,h<128?l:(h=i[this.pos++],l|=(127&h)<<14,h<128?l:(h=i[this.pos++],l|=(127&h)<<21,h<128?l:(h=i[this.pos],l|=(15&h)<<28,(function(m,g,x){let C=x.buf,w,A;if(A=C[x.pos++],w=(112&A)>>4,A<128||(A=C[x.pos++],w|=(127&A)<<3,A<128)||(A=C[x.pos++],w|=(127&A)<<10,A<128)||(A=C[x.pos++],w|=(127&A)<<17,A<128)||(A=C[x.pos++],w|=(127&A)<<24,A<128)||(A=C[x.pos++],w|=(1&A)<<31,A<128))return sp(m,w,g);throw new Error("Expected varint not more than 10 bytes")})(l,e,this)))))}readVarint64(){return this.readVarint(!0)}readSVarint(){let e=this.readVarint();return e%2==1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){let e=this.readVarint()+this.pos,i=this.pos;return this.pos=e,e-i>=12&&jd?jd.decode(this.buf.subarray(i,e)):(function(l,h,m){let g="",x=h;for(;x<m;){let C=l[x],w,A,M,N=null,L=C>239?4:C>223?3:C>191?2:1;if(x+L>m)break;L===1?C<128&&(N=C):L===2?(w=l[x+1],(192&w)==128&&(N=(31&C)<<6|63&w,N<=127&&(N=null))):L===3?(w=l[x+1],A=l[x+2],(192&w)==128&&(192&A)==128&&(N=(15&C)<<12|(63&w)<<6|63&A,(N<=2047||N>=55296&&N<=57343)&&(N=null))):L===4&&(w=l[x+1],A=l[x+2],M=l[x+3],(192&w)==128&&(192&A)==128&&(192&M)==128&&(N=(15&C)<<18|(63&w)<<12|(63&A)<<6|63&M,(N<=65535||N>=1114112)&&(N=null))),N===null?(N=65533,L=1):N>65535&&(N-=65536,g+=String.fromCharCode(N>>>10&1023|55296),N=56320|1023&N),g+=String.fromCharCode(N),x+=L}return g})(this.buf,i,e)}readBytes(){let e=this.readVarint()+this.pos,i=this.buf.subarray(this.pos,e);return this.pos=e,i}readPackedVarint(e=[],i){let l=this.readPackedEnd();for(;this.pos<l;)e.push(this.readVarint(i));return e}readPackedSVarint(e=[]){let i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===2?this.readVarint()+this.pos:this.pos+1}skip(e){let i=7&e;if(i===0)for(;this.buf[this.pos++]>127;);else if(i===2)this.pos=this.readVarint()+this.pos;else if(i===5)this.pos+=4;else{if(i!==1)throw new Error(`Unimplemented type: ${i}`);this.pos+=8}}writeTag(e,i){this.writeVarint(e<<3|i)}realloc(e){let i=this.length||16;for(;i<this.pos+e;)i*=2;if(i!==this.length){let l=new Uint8Array(i);l.set(this.buf),this.buf=l,this.dataView=new DataView(l.buffer),this.length=i}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}
vendor: 4,410 bytes, line 2
2writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*Ud),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*Ud),!0),this.pos+=8}writeVarint(e){(e=+e||0)>268435455||e<0?(function(i,l){let h,m;if(i>=0?(h=i%4294967296|0,m=i/4294967296|0):(h=~(-i%4294967296),m=~(-i/4294967296),4294967295^h?h=h+1|0:(h=0,m=m+1|0)),i>=18446744073709552e3||i<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");l.realloc(10),(function(g,x,C){C.buf[C.pos++]=127&g|128,g>>>=7,C.buf[C.pos++]=127&g|128,g>>>=7,C.buf[C.pos++]=127&g|128,g>>>=7,C.buf[C.pos++]=127&g|128,C.buf[C.pos]=127&(g>>>=7)})(h,0,l),(function(g,x){let C=(7&g)<<4;x.buf[x.pos++]|=C|((g>>>=3)?128:0),g&&(x.buf[x.pos++]=127&g|((g>>>=7)?128:0),g&&(x.buf[x.pos++]=127&g|((g>>>=7)?128:0),g&&(x.buf[x.pos++]=127&g|((g>>>=7)?128:0),g&&(x.buf[x.pos++]=127&g|((g>>>=7)?128:0),g&&(x.buf[x.pos++]=127&g)))))})(m,l)})(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))}writeSVarint(e){this.writeVarint(e<0?2*-e-1:2*e)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(4*e.length),this.pos++;let i=this.pos;this.pos=(function(h,m,g){for(let x,C,w=0;w<m.length;w++){if(x=m.charCodeAt(w),x>55295&&x<57344){if(!C){x>56319||w+1===m.length?(h[g++]=239,h[g++]=191,h[g++]=189):C=x;continue}if(x<56320){h[g++]=239,h[g++]=191,h[g++]=189,C=x;continue}x=C-55296<<10|x-56320|65536,C=null}else C&&(h[g++]=239,h[g++]=191,h[g++]=189,C=null);x<128?h[g++]=x:(x<2048?h[g++]=x>>6|192:(x<65536?h[g++]=x>>12|224:(h[g++]=x>>18|240,h[g++]=x>>12&63|128),h[g++]=x>>6&63|128),h[g++]=63&x|128)}return g})(this.buf,e,this.pos);let l=this.pos-i;l>=128&&og(i,l,this),this.pos=i-1,this.writeVarint(l),this.pos+=l}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){let i=e.length;this.writeVarint(i),this.realloc(i);for(let l=0;l<i;l++)this.buf[this.pos++]=e[l]}writeRawMessage(e,i){this.pos++;let l=this.pos;e(i,this);let h=this.pos-l;h>=128&&og(l,h,this),this.pos=l-1,this.writeVarint(h),this.pos+=h}writeMessage(e,i,l){this.writeTag(e,2),this.writeRawMessage(i,l)}writePackedVarint(e,i){i.length&&this.writeMessage(e,J_,i)}writePackedSVarint(e,i){i.length&&this.writeMessage(e,Q_,i)}writePackedBoolean(e,i){i.length&&this.writeMessage(e,iy,i)}writePackedFloat(e,i){i.length&&this.writeMessage(e,ey,i)}writePackedDouble(e,i){i.length&&this.writeMessage(e,ty,i)}writePackedFixed32(e,i){i.length&&this.writeMessage(e,ry,i)}writePackedSFixed32(e,i){i.length&&this.writeMessage(e,Wl,i)}writePackedFixed64(e,i){i.length&&this.writeMessage(e,qd,i)}writePackedSFixed64(e,i){i.length&&this.writeMessage(e,ag,i)}writeBytesField(e,i){this.writeTag(e,2),this.writeBytes(i)}writeFixed32Field(e,i){this.writeTag(e,5),this.writeFixed32(i)}writeSFixed32Field(e,i){this.writeTag(e,5),this.writeSFixed32(i)}writeFixed64Field(e,i){this.writeTag(e,1),this.writeFixed64(i)}writeSFixed64Field(e,i){this.writeTag(e,1),this.writeSFixed64(i)}writeVarintField(e,i){this.writeTag(e,0),this.writeVarint(i)}writeSVarintField(e,i){this.writeTag(e,0),this.writeSVarint(i)}writeStringField(e,i){this.writeTag(e,2),this.writeString(i)}writeFloatField(e,i){this.writeTag(e,5),this.writeFloat(i)}writeDoubleField(e,i){this.writeTag(e,1),this.writeDouble(i)}writeBooleanField(e,i){this.writeVarintField(e,+i)}}function sp(r,e,i){return i?4294967296*e+(r>>>0):4294967296*(e>>>0)+(r>>>0)}function og(r,e,i){let l=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(l);for(let h=i.pos-1;h>=r;h--)i.buf[h+l]=i.buf[h]}function J_(r,e){for(let i=0;i<r.length;i++)e.writeVarint(r[i])}function Q_(r,e){for(let i=0;i<r.length;i++)e.writeSVarint(r[i])}function ey(r,e){for(let i=0;i<r.length;i++)e.writeFloat(r[i])}function ty(r,e){for(let i=0;i<r.length;i++)e.writeDouble(r[i])}function iy(r,e){for(let i=0;i<r.length;i++)e.writeBoolean(r[i])}function ry(r,e){for(let i=0;i<r.length;i++)e.writeFixed32(r[i])}function Wl(r,e){for(let i=0;i<r.length;i++)e.writeSFixed32(r[i])}function qd(r,e){for(let i=0;i<r.length;
vendor: 31,659 bytes, line 2
2i++)e.writeFixed64(r[i])}function ag(r,e){for(let i=0;i<r.length;i++)e.writeSFixed64(r[i])}function es(r,e,i){r===1&&i.readMessage(Tc,e)}function Tc(r,e,i){if(r===3){let{id:l,bitmap:h,width:m,height:g,left:x,top:C,advance:w}=i.readMessage(Kp,{});e.push({id:l,bitmap:new Fp({width:m+6,height:g+6},h),metrics:{width:m,height:g,left:x,top:C,advance:w}})}}function Kp(r,e,i){r===1?e.id=i.readVarint():r===2?e.bitmap=i.readBytes():r===3?e.width=i.readVarint():r===4?e.height=i.readVarint():r===5?e.left=i.readSVarint():r===6?e.top=i.readSVarint():r===7&&(e.advance=i.readVarint())}function lp(r){let e=0,i=0;for(let g of r)e+=g.w*g.h,i=Math.max(i,g.w);r.sort(((g,x)=>x.h-g.h));let l=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}],h=0,m=0;for(let g of r)for(let x=l.length-1;x>=0;x--){let C=l[x];if(!(g.w>C.w||g.h>C.h)){if(g.x=C.x,g.y=C.y,m=Math.max(m,g.y+g.h),h=Math.max(h,g.x+g.w),g.w===C.w&&g.h===C.h){let w=l.pop();w&&x<l.length&&(l[x]=w)}else g.h===C.h?(C.x+=g.w,C.w-=g.w):g.w===C.w?(C.y+=g.h,C.h-=g.h):(l.push({x:C.x+g.w,y:C.y,w:C.w-g.w,h:g.h}),C.y+=g.h,C.h-=g.h);break}}return{w:h,h:m,fill:e/(h*m)||0}}class $d{constructor(e,{pixelRatio:i,version:l,stretchX:h,stretchY:m,content:g,textFitWidth:x,textFitHeight:C}){this.paddedRect=e,this.pixelRatio=i,this.stretchX=h,this.stretchY=m,this.content=g,this.version=l,this.textFitWidth=x,this.textFitHeight=C}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class Nh{constructor(e,i){let l={},h={};this.haveRenderCallbacks=[];let m=[];this.addImages(e,l,m),this.addImages(i,h,m);let{w:g,h:x}=lp(m),C=new Ya({width:g||1,height:x||1});for(let w in e){let A=e[w],M=l[w].paddedRect;Ya.copy(A.data,C,{x:0,y:0},{x:M.x+1,y:M.y+1},A.data)}for(let w in i){let A=i[w],M=h[w].paddedRect,N=M.x+1,L=M.y+1,Z=A.data.width,X=A.data.height;Ya.copy(A.data,C,{x:0,y:0},{x:N,y:L},A.data),Ya.copy(A.data,C,{x:0,y:X-1},{x:N,y:L-1},{width:Z,height:1}),Ya.copy(A.data,C,{x:0,y:0},{x:N,y:L+X},{width:Z,height:1}),Ya.copy(A.data,C,{x:Z-1,y:0},{x:N-1,y:L},{width:1,height:X}),Ya.copy(A.data,C,{x:0,y:0},{x:N+Z,y:L},{width:1,height:X})}this.image=C,this.iconPositions=l,this.patternPositions=h}addImages(e,i,l){for(let h in e){let m=e[h],g={x:0,y:0,w:m.data.width+2,h:m.data.height+2};l.push(g),i[h]=new $d(g,m),m.hasRenderCallback&&this.haveRenderCallbacks.push(h)}}patchUpdatedImages(e,i){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let l in e.updatedImages)this.patchUpdatedImage(this.iconPositions[l],e.getImage(l),i),this.patchUpdatedImage(this.patternPositions[l],e.getImage(l),i)}patchUpdatedImage(e,i,l){if(!e||!i||e.version===i.version)return;e.version=i.version;let[h,m]=e.tl;l.update(i.data,void 0,{x:h,y:m})}}var cp;function sg(r,e,i,l,h,m,g,x,C,w,A,M,N,L,Z){let X=vs.fromFeature(r,h),ie;M===V.ax.vertical&&X.verticalizePunctuation();let ne=X.determineLineBreaks(w,m,e,l,L),{processBidirectionalText:ue,processStyledBidirectionalText:se}=Xa;if(ue&&X.sections.length===1){ie=[],ne=ne.map((We=>X.toCodeUnitIndex(We)));let Ce=ue(X.toString(),ne);for(let We of Ce){let Je=[...We].map((()=>0));ie.push(new vs(We,X.sections,Je))}}else if(se){ie=[],ne=ne.map((mt=>X.toCodeUnitIndex(mt)));let Ce=0,We=[];for(let mt of X.text)We.push(...Array(mt.length).fill(X.sectionIndex[Ce])),Ce++;let Je=se(X.text,We,ne);for(let mt of Je){let at=[],vt="";for(let bt of mt[0])at.push(mt[1][vt.length]),vt+=bt;ie.push(new vs(mt[0],X.sections,at))}}else ie=(function(Ce,We){let Je=[],mt=0;for(let at of We)Je.push(Ce.substring(mt,at)),mt=at;return mt<Ce.length()&&Je.push(Ce.substring(mt,Ce.length())),Je})(X,ne);let me=[],be={positionedLines:me,text:X.toString(),top:A[1],bottom:A[1],left:A[0],right:A[0],writingMode:M,iconsInText:!1,verticalizable:!1};return(function(Ce,We,Je,mt,at,vt,bt,yt,lt,qt,ii,Wt){let $t=0,Gi=0,Tr=0,Ar=0,Vr=yt==="right"?1:yt==="left"?0:.5,Ba=Jr/Wt,Gn=0;for(let Sn of at){Sn.trim();let ua=Sn.getMaxScale(),is={positionedGlyphs:[],lineOffset:0};Ce.positionedLines[Gn]=is;let rs=is.positionedGlyphs,$s=0;if(!Sn.length()){Gi+=vt,++Gn;continue}let Oa=T3(mt,Sn,Ba),Gs=0;for(let Yo of Sn.text){let Rn=Sn.getSection(Gs),mo=Yo.codePointAt(0),Zn=S3(lt,ii,mo),Jo={glyph:mo,imageName:null,x:$t,y:Gi+-17,vertical:Zn,scale:1,fontStack:"",sectionIndex:Sn.getSectionIndex(Gs),metrics:null,rect:null},gu;if("fontStack"in Rn){if(gu=I3(Rn,mo,Zn,Oa,We,Je),!gu)continue;Jo.fontStack=Rn.fontStack}else{if(Ce.iconsInText=!0,Rn.scale*=Ba,gu=C3(Rn,Zn,ua,Oa,mt),!gu)continue;$s=Math.max($s,gu.imageOffset),Jo.imageName=Rn.imageName}let{rect:nh,metrics:qm,baselineOffset:gp}=gu;Jo.y+=gp,Jo.scale=Rn.scale,Jo.metrics=qm,Jo.rect=nh,rs.push(Jo),Zn?(Ce.verticalizable=!0,$t+=("imageName"in Rn?qm.advance:Jr)*Rn.scale+qt):$t+=qm.advance*Rn.scale+qt,Gs++}rs.length!==0&&(Tr=Math.max($t-qt,Tr),E3(rs,0,rs.length-1,Vr)),$t=0,is.lineOffset=Math.max($s,(ua-1)*Jr);let Sc=vt*ua+$s;Gi+=Sc,Ar=Math.max(Sc,Ar),++Gn}let{horizontalAlign:Ao,verticalAlign:Ko}=ny(bt);(function(Sn,ua,is,rs,$s,Oa,Gs,Sc,Yo){let Rn=(ua-is)*$s,mo=0;mo=Oa!==Gs?-Sc*rs- -17:-rs*Yo*Gs+.5*Gs;for(let Zn of Sn)for(let Jo of Zn.positionedGlyphs)Jo.x+=Rn,Jo.y+=mo})(Ce.positionedLines,Vr,Ao,Ko,Tr,Ar,vt,Gi,at.length),Ce.top+=-Ko*Gi,Ce.bottom=Ce.top+Gi,Ce.left+=-Ao*Tr,Ce.right=Ce.left+Tr})(be,e,i,l,ie,g,x,C,M,w,N,Z),!(function(Ce){for(let We of Ce)if(We.positionedGlyphs.length!==0)return!1;return!0})(me)&&be}function ny(r){let e=.5,i=.5;switch(r){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(r){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:e,verticalAlign:i}}function T3(r,e,i){let l=e.getMaxScale()*Jr,{maxImageWidth:h,maxImageHeight:m}=e.getMaxImageSize(r),g=Math.max(l,m*i);return{verticalLineContentWidth:Math.max(l,h*i),horizontalLineContentHeight:g}}function Sx(r){switch(r){case"top":return 0;case"center":return .5;default:return 1}}function S3(r,e,i){return!(r===V.ax.horizontal||!e&&!oa(i)||e&&(Eh(i)||(l=i,/\p{sc=Arab}/u.test(String.fromCodePoint(l)))));var l}function I3(r,e,i,l,h,m){let g=m[r.fontStack],x=(function(w,A,M,N){if(w?.rect)return w;let L=A[M.fontStack],Z=L?.[N];return Z?{rect:null,metrics:Z.metrics}:null})(g?.[e],h,r,e);if(x===null)return null;let C;if(i)C=l.verticalLineContentWidth-r.scale*Jr;else{let w=Sx(r.verticalAlign);C=(l.horizontalLineContentHeight-r.scale*Jr)*w}return{rect:x.rect,metrics:x.metrics,baselineOffset:C}}function C3(r,e,i,l,h){let m=h[r.imageName];if(!m)return null;let g=m.paddedRect,x=m.displaySize,C={width:x[0],height:x[1],left:1,top:-3,advance:e?x[1]:x[0]},w;if(e)w=l.verticalLineContentWidth-x[1]*r.scale;else{let A=Sx(r.verticalAlign);w=(l.horizontalLineContentHeight-x[1]*r.scale)*A}return{rect:g,metrics:C,baselineOffset:w,imageOffset:(e?x[0]:x[1])*r.scale-Jr*i}}function E3(r,e,i,l){if(l===0)return;let h=r[i],m=(r[i].x+h.metrics.advance*h.scale)*l;for(let g=e;g<=i;g++)r[g].x-=m}function M3(r,e,i){let{horizontalAlign:l,verticalAlign:h}=ny(i),m=e[0]-r.displaySize[0]*l,g=e[1]-r.displaySize[1]*h;return{image:r,top:g,bottom:g+r.displaySize[1],left:m,right:m+r.displaySize[0]}}function Ix(r){var e,i;let l=r.left,h=r.top,m=r.right-l,g=r.bottom-h,x=(e=r.image.textFitWidth)!==null&&e!==void 0?e:"stretchOrShrink",C=(i=r.image.textFitHeight)!==null&&i!==void 0?i:"stretchOrShrink",w=(r.image.content[2]-r.image.content[0])/(r.image.content[3]-r.image.content[1]);if(C==="proportional"){if(x==="stretchOnly"&&m/g<w||x==="proportional"){let A=Math.ceil(g*w);l*=A/m,m=A}}else if(x==="proportional"&&C==="stretchOnly"&&w!==0&&m/g>w){let A=Math.ceil(m/w);h*=A/g,g=A}return{x1:l,y1:h,x2:l+m,y2:h+g}}function Cx(r,e,i,l,h,m){let g=r.image,x;if(g.content){let ie=g.content,ne=g.pixelRatio||1;x=[ie[0]/ne,ie[1]/ne,g.displaySize[0]-ie[2]/ne,g.displaySize[1]-ie[3]/ne]}let C=e.left*m,w=e.right*m,A,M,N,L;i==="width"||i==="both"?(L=h[0]+C-l[3],M=h[0]+w+l[1]):(L=h[0]+(C+w-g.displaySize[0])/2,M=L+g.displaySize[0]);let Z=e.top*m,X=e.bottom*m;return i==="height"||i==="both"?(A=h[1]+Z-l[0],N=h[1]+X+l[2]):(A=h[1]+(Z+X-g.displaySize[1])/2,N=A+g.displaySize[1]),{image:g,top:A,right:M,bottom:N,left:L,collisionPadding:x}}Qt("ImagePosition",$d),Qt("ImageAtlas",Nh),V.ax=void 0,(cp=V.ax||(V.ax={}))[cp.none=0]="none",cp[cp.horizontal=1]="horizontal",cp[cp.vertical=2]="vertical",cp[cp.horizontalOnly=3]="horizontalOnly";let mu=128,hp=32640;function Ex(r,e){let{expression:i}=e;if(i.kind==="constant")return{kind:"constant",layoutSize:i.evaluate(new wr(r+1))};if(i.kind==="source")return{kind:"source"};{let{zoomStops:l,interpolationType:h}=i,m=0;for(;m<l.length&&l[m]<=r;)m++;m=Math.max(0,m-1);let g=m;for(;g<l.length&&l[g]<r+1;)g++;g=Math.min(l.length-1,g);let x=l[m],C=l[g];return i.kind==="composite"?{kind:"composite",minZoom:x,maxZoom:C,interpolationType:h}:{kind:"camera",minZoom:x,maxZoom:C,minSize:i.evaluate(new wr(x)),maxSize:i.evaluate(new wr(C)),interpolationType:h}}}function oy(r,e,i){let l="never",h=r.get(e);return h?l=h:r.get(i)&&(l="always"),l}let P3=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function lg(r,e,i,l,h,m,g,x,C,w,A,M,N){let L=x?Math.min(hp,Math.round(x[0])):0,Z=x?Math.min(hp,Math.round(x[1])):0;r.emplaceBack(e,i,Math.round(32*l),Math.round(32*h),m,g,(L<<1)+(C?1:0),Z,16*w,16*A,256*M,256*N)}function ay(r,e,i){r.emplaceBack(e.x,e.y,i),r.emplaceBack(e.x,e.y,i),r.emplaceBack(e.x,e.y,i),r.emplaceBack(e.x,e.y,i)}function k3(r){for(let e of r.sections)if(ou(e.text))return!0;return!1}class sy{constructor(e){this.layoutVertexArray=new Fe,this.indexArray=new Dt,this.programConfigurations=e,this.segments=new ti,this.dynamicLayoutVertexArray=new it,this.opacityVertexArray=new ft,this.hasVisibleVertices=!1,this.placedSymbolArray=new P}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,i,l,h){this.isEmpty()||(l&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,sr.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,i),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,xs.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,P3,!0),this.opacityVertexBuffer.itemSize=1),(l||h)&&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())}}Qt("SymbolBuffers",sy);class ly{constructor(e,i,l){this.layoutVertexArray=new e,this.layoutAttributes=i,this.indexArray=new l,this.segments=new ti,this.collisionVertexArray=new Rt}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Wo.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}Qt("CollisionBuffers",ly);class Gd{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((g=>g.id)),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasDependencies=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];let i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Ex(this.zoom,i["text-size"]),this.iconSizeData=Ex(this.zoom,i["icon-size"]);let l=this.layers[0].layout,h=l.get("symbol-sort-key"),m=l.get("symbol-z-order");this.canOverlap=oy(l,"text-overlap","text-allow-overlap")!=="never"||oy(l,"icon-overlap","icon-allow-overlap")!=="never"||l.get("text-ignore-placement")||l.get("icon-ignore-placement"),this.sortFeaturesByKey=m!=="viewport-y"&&!h.isConstant(),this.sortFeaturesByY=(m==="viewport-y"||m==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,l.get("symbol-placement")==="point"&&(this.writingModes=l.get("text-writing-mode").map((g=>V.ax[g]))),this.stateDependentLayerIds=this.layers.filter((g=>g.isStateDependent())).map((g=>g.id)),this.sourceID=e.sourceID}createArrays(){this.text=new sy(new ql(this.layers,this.zoom,(e=>e.startsWith("text")))),this.icon=new sy(new ql(this.layers,this.zoom,(e=>e.startsWith("icon")))),this.glyphOffsetArray=new U,this.lineVertexArray=new $,this.symbolInstances=new B,this.textAnchorOffsets=new ee}calculateGlyphDependencies(e,i,l,h,m){for(let g of e)if(i[g.codePointAt(0)]=!0,(l||h)&&m){let x=La[g];x&&(i[x.codePointAt(0)]=!0)}}populate(e,i,l){var h;let m=this.layers[0],g=m.layout,x=g.get("text-font"),C=g.get("text-field"),w=g.get("icon-image"),A=(C.value.kind!=="constant"||C.value.value instanceof Fo&&!C.value.value.isEmpty()||C.value.value.toString().length>0)&&(x.value.kind!=="constant"||x.value.value.length>0),M=w.value.kind!=="constant"||!!w.value.value||Object.keys(w.parameters).length>0,N=g.get("symbol-sort-key");if(this.features=[],!A&&!M)return;let L=i.iconDependencies,Z=i.glyphDependencies,X=i.availableImages,ie=new wr(this.zoom);for(let{feature:ne,id:ue,index:se,sourceLayerIndex:me}of e){let be=m._featureFilter.needGeometry,Ce=vc(ne,be);if(!m._featureFilter.filter(ie,Ce,l))continue;let We,Je;if(be||(Ce.geometry=xc(ne)),A){let at=m.getValueAndResolveTokens("text-field",Ce,l,X),vt=Fo.factory(at);this.hasRTLText||(this.hasRTLText=k3(vt)),(!this.hasRTLText||Xa.getRTLTextPluginStatus()==="unavailable"||this.hasRTLText&&Xa.isParsed())&&(We=Zl(vt,m,Ce))}if(M){let at=m.getValueAndResolveTokens("icon-image",Ce,l,X);Je=at instanceof Bo?at:Bo.fromString(at)}if(!We&&!Je)continue;let mt=this.sortFeaturesByKey?N.evaluate(Ce,{},l):void 0;if(this.features.push({id:ue,text:We,icon:Je,index:se,sourceLayerIndex:me,geometry:Ce.geometry,properties:ne.properties,type:qp.types[ne.type],sortKey:mt}),Je&&(L[Je.name]=!0),We){let at=x.evaluate(Ce,{},l).join(","),vt=g.get("text-rotation-alignment")!=="viewport"&&g.get("symbol-placement")!=="point";this.allowVerticalPlacement=(h=this.writingModes)===null||h===void 0?void 0:h.includes(V.ax.vertical);for(let bt of We.sections)if(bt.image)L[bt.image.name]=!0;else{let yt=cl(We.toString()),lt=bt.fontStack||at;Z[lt]||(Z[lt]={}),this.calculateGlyphDependencies(bt.text,Z[lt],vt,this.allowVerticalPlacement,yt)}}}g.get("symbol-placement")==="line"&&(this.features=(function(ne){let ue={},se={},me=[],be=0;function Ce(at){me.push(ne[at]),be++}function We(at,vt,bt){let yt=se[at];return delete se[at],se[vt]=yt,me[yt].geometry[0].pop(),me[yt].geometry[0]=me[yt].geometry[0].concat(bt[0]),yt}function Je(at,vt,bt){let yt=ue[vt];return delete ue[vt],ue[at]=yt,me[yt].geometry[0].shift(),me[yt].geometry[0]=bt[0].concat(me[yt].geometry[0]),yt}function mt(at,vt,bt){let yt=bt?vt[0][vt[0].length-1]:vt[0][0];return`${at}:${yt.x}:${yt.y}`}for(let at=0;at<ne.length;at++){let vt=ne[at],bt=vt.geometry,yt=vt.text?vt.text.toString():null;if(!yt){Ce(at);continue}let lt=mt(yt,bt),qt=mt(yt,bt,!0);if(lt in se&&qt in ue&&se[lt]!==ue[qt]){let ii=Je(lt,qt,bt),Wt=We(lt,qt,me[ii].geometry);delete ue[lt],delete se[qt],se[mt(yt,me[Wt].geometry,!0)]=Wt,me[ii].geometry=null}else lt in se?We(lt,qt,bt):qt in ue?Je(lt,qt,bt):(Ce(at),ue[lt]=be-1,se[qt]=be-1)}return me.filter((at=>at.geometry))})(this.features)),this.sortFeaturesByKey&&this.features.sort(((ne,ue)=>ne.sortKey-ue.sortKey))}update(e,i,l){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,i,this.layers,{imagePositions:l}),this.icon.programConfigurations.updatePaintArrays(e,i,this.layers,{imagePositions:l}))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,i){let l=this.lineVertexArray.length;if(e.segment!==void 0){let h=e.dist(i[e.segment+1]),m=e.dist(i[e.segment]),g={};for(let x=e.segment+1;x<i.length;x++)g[x]={x:i[x].x,y:i[x].y,tileUnitDistanceFromAnchor:h},x<i.length-1&&(h+=i[x+1].dist(i[x]));for(let x=e.segment||0;x>=0;x--)g[x]={x:i[x].x,y:i[x].y,tileUnitDistanceFromAnchor:m},x>0&&(m+=i[x-1].dist(i[x]));for(let x=0;x<i.length;x++){let C=g[x];this.lineVertexArray.emplaceBack(C.x,C.y,C.tileUnitDistanceFromAnchor)}}return{lineStartIndex:l,lineLength:this.lineVertexArray.length-l}}addSymbols(e,i,l,h,m,g,x,C,w,A,M,N){let L=e.indexArray,Z=e.layoutVertexArray,X=e.segments.prepareSegment(4*i.length,Z,L,this.canOverlap?g.sortKey:void 0),ie=this.glyphOffsetArray.length,ne=X.vertexLength,ue=this.allowVerticalPlacement&&x===V.ax.vertical?Math.PI/2:0,se=g.text&&g.text.sections;for(let me=0;me<i.length;me++){let{tl:be,tr:Ce,bl:We,br:Je,tex:mt,pixelOffsetTL:at,pixelOffsetBR:vt,minFontScaleX:bt,minFontScaleY:yt,glyphOffset:lt,isSDF:qt,sectionIndex:ii}=i[me],Wt=X.vertexLength,$t=lt[1];lg(Z,C.x,C.y,be.x,$t+be.y,mt.x,mt.y,l,qt,at.x,at.y,bt,yt),lg(Z,C.x,C.y,Ce.x,$t+Ce.y,mt.x+mt.w,mt.y,l,qt,vt.x,at.y,bt,yt),lg(Z,C.x,C.y,We.x,$t+We.y,mt.x,mt.y+mt.h,l,qt,at.x,vt.y,bt,yt),lg(Z,C.x,C.y,Je.x,$t+Je.y,mt.x+mt.w,mt.y+mt.h,l,qt,vt.x,vt.y,bt,yt),ay(e.dynamicLayoutVertexArray,C,ue),L.emplaceBack(Wt,Wt+2,Wt+1),L.emplaceBack(Wt+1,Wt+2,Wt+3),X.vertexLength+=4,X.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(lt[0]),me!==i.length-1&&ii===i[me+1].sectionIndex||e.programConfigurations.populatePaintArrays(Z.length,g,g.index,{imagePositions:{},canonical:N,formattedSection:se?.[ii]})}e.placedSymbolArray.emplaceBack(C.x,C.y,ie,this.glyphOffsetArray.length-ie,ne,w,A,C.segment,l?l[0]:0,l?l[1]:0,h[0],h[1],x,0,!1,0,M)}_addCollisionDebugVertex(e,i,l,h,m,g){return i.emplaceBack(0,0),e.emplaceBack(l.x,l.y,h,m,Math.round(g.x),Math.round(g.y))}addCollisionDebugVertices(e,i,l,h,m,g,x){let C=m.segments.prepareSegment(4,m.layoutVertexArray,m.indexArray),w=C.vertexLength,A=m.layoutVertexArray,M=m.collisionVertexArray,N=x.anchorX,L=x.anchorY;this._addCollisionDebugVertex(A,M,g,N,L,new pe(e,i)),this._addCollisionDebugVertex(A,M,g,N,L,new pe(l,i)),this._addCollisionDebugVertex(A,M,g,N,L,new pe(l,h)),this._addCollisionDebugVertex(A,M,g,N,L,new pe(e,h)),C.vertexLength+=4;let Z=m.indexArray;Z.emplaceBack(w,w+1),Z.emplaceBack(w+1,w+2),Z.emplaceBack(w+2,w+3),Z.emplaceBack(w+3,w),C.primitiveLength+=4}addDebugCollisionBoxes(e,i,l,h){for(let m=e;m<i;m++){let g=this.collisionBoxArray.get(m);this.addCollisionDebugVertices(g.x1,g.y1,g.x2,g.y2,h?this.textCollisionBox:this.iconCollisionBox,g.anchorPoint,l)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new ly(_t,Ho.members,_i),this.iconCollisionBox=new ly(_t,Ho.members,_i);for(let e=0;e<this.symbolInstances.length;e++){let i=this.symbolInstances.get(e);this.addDebugCollisionBoxes(i.textBoxStartIndex,i.textBoxEndIndex,i,!0),this.addDebugCollisionBoxes(i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i,!0),this.addDebugCollisionBoxes(i.iconBoxStartIndex,i.iconBoxEndIndex,i,!1),this.addDebugCollisionBoxes(i.verticalIconBoxStartIndex,i.verticalIconBoxEndIndex,i,!1)}}_deserializeCollisionBoxesForSymbol(e,i,l,h,m,g,x,C,w){let A={};for(let M=i;M<l;M++){let N=e.get(M);A.textBox={x1:N.x1,y1:N.y1,x2:N.x2,y2:N.y2,anchorPointX:N.anchorPointX,anchorPointY:N.anchorPointY},A.textFeatureIndex=N.featureIndex;break}for(let M=h;M<m;M++){let N=e.get(M);A.verticalTextBox={x1:N.x1,y1:N.y1,x2:N.x2,y2:N.y2,anchorPointX:N.anchorPointX,anchorPointY:N.anchorPointY},A.verticalTextFeatureIndex=N.featureIndex;break}for(let M=g;M<x;M++){let N=e.get(M);A.iconBox={x1:N.x1,y1:N.y1,x2:N.x2,y2:N.y2,anchorPointX:N.anchorPointX,anchorPointY:N.anchorPointY},A.iconFeatureIndex=N.featureIndex;break}for(let M=C;M<w;M++){let N=e.get(M);A.verticalIconBox={x1:N.x1,y1:N.y1,x2:N.x2,y2:N.y2,anchorPointX:N.anchorPointX,anchorPointY:N.anchorPointY},A.verticalIconFeatureIndex=N.featureIndex;break}return A}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let i=0;i<this.symbolInstances.length;i++){let l=this.symbolInstances.get(i);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,l.textBoxStartIndex,l.textBoxEndIndex,l.verticalTextBoxStartIndex,l.verticalTextBoxEndIndex,l.iconBoxStartIndex,l.iconBoxEndIndex,l.verticalIconBoxStartIndex,l.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,i){let l=e.placedSymbolArray.get(i),h=l.vertexStartIndex+4*l.numGlyphs;for(let m=l.vertexStartIndex;m<h;m+=4)e.indexArray.emplaceBack(m,m+2,m+1),e.indexArray.emplaceBack(m+1,m+2,m+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let i=Math.sin(e),l=Math.cos(e),h=[],m=[],g=[];for(let x=0;x<this.symbolInstances.length;++x){g.push(x);let C=this.symbolInstances.get(x);h.push(0|Math.round(i*C.anchorX+l*C.anchorY)),m.push(C.featureIndex)}return g.sort(((x,C)=>h[x]-h[C]||m[C]-m[x])),g}addToSortKeyRanges(e,i){let l=this.sortKeyRanges[this.sortKeyRanges.length-1];l?.sortKey===i?l.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:i,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let i of this.symbolInstanceIndexes){let l=this.symbolInstances.get(i);this.featureSortOrder.push(l.featureIndex);let h=[l.rightJustifiedTextSymbolIndex,l.centerJustifiedTextSymbolIndex,l.leftJustifiedTextSymbolIndex];for(let m=0;m<h.length;m++){let g=h[m];g>=0&&h.indexOf(g)===m&&this.addIndicesForPlacedSymbol(this.text,g)}l.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,l.verticalPlacedTextSymbolIndex),l.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,l.placedIconSymbolIndex),l.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,l.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Mx,Px;Qt("SymbolBucket",Gd,{omit:["layers","collisionBoxArray","features","compareText"]}),Gd.MAX_GLYPHS=65535,Gd.addDynamicAttributes=ay;var cy={get paint(){return Px=Px||new aa({"icon-opacity":new Ii(xt.paint_symbol["icon-opacity"]),"icon-color":new Ii(xt.paint_symbol["icon-color"]),"icon-halo-color":new Ii(xt.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ii(xt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ii(xt.paint_symbol["icon-halo-blur"]),"icon-translate":new mi(xt.paint_symbol["icon-translate"]),"icon-translate-anchor":new mi(xt.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ii(xt.paint_symbol["text-opacity"]),"text-color":new Ii(xt.paint_symbol["text-color"],{runtimeType:pt,getOverride:r=>r.textColor,hasOverride:r=>!!r.textColor}),"text-halo-color":new Ii(xt.paint_symbol["text-halo-color"]),"text-halo-width":new Ii(xt.paint_symbol["text-halo-width"]),"text-halo-blur":new Ii(xt.paint_symbol["text-halo-blur"]),"text-translate":new mi(xt.paint_symbol["text-translate"]),"text-translate-anchor":new mi(xt.paint_symbol["text-translate-anchor"])})},get layout(){return Mx=Mx||new aa({"symbol-placement":new mi(xt.layout_symbol["symbol-placement"]),"symbol-spacing":new mi(xt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new mi(xt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ii(xt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new mi(xt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new mi(xt.layout_symbol["icon-allow-overlap"]),"icon-overlap":new mi(xt.layout_symbol["icon-overlap"]),"icon-ignore-placement":new mi(xt.layout_symbol["icon-ignore-placement"]),"icon-optional":new mi(xt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new mi(xt.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ii(xt.layout_symbol["icon-size"]),"icon-text-fit":new mi(xt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new mi(xt.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ii(xt.layout_symbol["icon-image"]),"icon-rotate":new Ii(xt.layout_symbol["icon-rotate"]),"icon-padding":new Ii(xt.layout_symbol["icon-padding"]),"icon-keep-upright":new mi(xt.layout_symbol["icon-keep-upright"]),"icon-offset":new Ii(xt.layout_symbol["icon-offset"]),"icon-anchor":new Ii(xt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new mi(xt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new mi(xt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new mi(xt.layout_symbol["text-rotation-alignment"]),"text-field":new Ii(xt.layout_symbol["text-field"]),"text-font":new Ii(xt.layout_symbol["text-font"]),"text-size":new Ii(xt.layout_symbol["text-size"]),"text-max-width":new Ii(xt.layout_symbol["text-max-width"]),"text-line-height":new mi(xt.layout_symbol["text-line-height"]),"text-letter-spacing":new Ii(xt.layout_symbol["text-letter-spacing"]),"text-justify":new Ii(xt.layout_symbol["text-justify"]),"text-radial-offset":new Ii(xt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new mi(xt.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Ii(xt.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Ii(xt.layout_symbol["text-anchor"]),"text-max-angle":new mi(xt.layout_symbol["text-max-angle"]),"text-writing-mode":new mi(xt.layout_symbol["text-writing-mode"]),"text-rotate":new Ii(xt.layout_symbol["text-rotate"]),"text-padding":new mi(xt.layout_symbol["text-padding"]),"text-keep-upright":new mi(xt.layout_symbol["text-keep-upright"]),"text-transform":new Ii(xt.layout_symbol["text-transform"]),"text-offset":new Ii(xt.layout_symbol["text-offset"]),"text-allow-overlap":new mi(xt.layout_symbol["text-allow-overlap"]),"text-overlap":new mi(xt.layout_symbol["text-overlap"]),"text-ignore-placement":new mi(xt.layout_symbol["text-ignore-placement"]),"text-optional":new mi(xt.layout_symbol["text-optional"])})}};class kx{constructor(e){if(e.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:Ke,this.defaultValue=e}evaluate(e){if(e.formattedSection){let i=this.defaultValue.property.overrides;if(i?.hasOverride(e.formattedSection))return i.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Qt("FormatSectionOverride",kx,{omit:["defaultValue"]});class cg extends ka{constructor(e,i){super(e,cy,i)}recalculate(e,i){if(super.recalculate(e,i),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){let l=this.layout.get("text-writing-mode");if(l){let h=[];for(let m of l)h.includes(m)||h.push(m);this.layout._values["text-writing-mode"]=h}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,i,l,h){let m=this.layout.get(e).evaluate(i,{},l,h),g=this._unevaluatedLayout._values[e];return g.isDataDriven()||qc(g.value)||!m?m:(function(x,C){return C.replace(/{([^{}]+)}/g,((w,A)=>x&&A in x?String(x[A]):""))})(i.properties,m)}createBucket(e){return new Gd(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let e of cy.paint.overridableProperties){if(!cg.hasPaintOverride(this.layout,e))continue;let i=this.paint.get(e),l=new kx(i),h=new uc(l,i.property.specification),m=null;m=i.value.kind==="constant"||i.value.kind==="source"?new Ih("source",h):new ra("composite",h,i.value.zoomStops),this.paint._values[e]=new Ka(i.property,m,i.parameters)}}_handleOverridablePaintPropertyUpdate(e,i,l){return!(!this.layout||i.isDataDriven()||l.isDataDriven())&&cg.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,i){let l=e.get("text-field"),h=cy.paint.properties[i],m=!1,g=x=>{var C;for(let w of x)if(!((C=h.overrides)===null||C===void 0)&&C.hasOverride(w))return void(m=!0)};if(l.value.kind==="constant"&&l.value.value instanceof Fo)g(l.value.value.sections);else if(l.value.kind==="source"||l.value.kind==="composite"){let x=w=>{m||(w instanceof Ta&&en(w.value)===ei?g(w.value.sections):w instanceof Pl?g(w.sections):w.eachChild(x))},C=l.value;C._styleExpression&&x(C._styleExpression.expression)}return m}}let Ax;var A3={get paint(){return Ax=Ax||new aa({"background-color":new mi(xt.paint_background["background-color"]),"background-pattern":new zu(xt.paint_background["background-pattern"]),"background-opacity":new mi(xt.paint_background["background-opacity"])})}};class z3 extends ka{constructor(e,i){super(e,A3,i)}}class D3 extends ka{constructor(e,i){super(e,{},i),this.onAdd=l=>{this.implementation.onAdd&&this.implementation.onAdd(l,l.painter.context.gl)},this.onRemove=l=>{this.implementation.onRemove&&this.implementation.onRemove(l,l.painter.context.gl)},this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class L3{constructor(e){this._methodToThrottle=e,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()}}trigger(){var e;this._triggered||(this._triggered=!0,(e=this._channel)===null||e===void 0||e.port1.postMessage(!0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}let R3={once:!0},hy=63710088e-1;class up{constructor(e,i){if(isNaN(e)||isNaN(i))throw new Error(`Invalid LngLat object: (${e}, ${i})`);
vendor: 4,767 bytes, line 2
2if(this.lng=+e,this.lat=+i,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new up(yo(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let i=Math.PI/180,l=this.lat*i,h=e.lat*i,m=Math.sin(l)*Math.sin(h)+Math.cos(l)*Math.cos(h)*Math.cos((e.lng-this.lng)*i);return hy*Math.acos(Math.min(m,1))}static convert(e){if(e instanceof up)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new up(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new up(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>]")}}let zx=2*Math.PI*hy;function Dx(r){return zx*Math.cos(r*Math.PI/180)}function Lx(r){return(180+r)/360}function Rx(r){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360}function Fx(r,e){return r/Dx(e)}function Bx(r){return 360*r-180}function hg(r){return 360/Math.PI*Math.atan(Math.exp((180-360*r)*Math.PI/180))-90}function Ox(r,e){return r*Dx(hg(e))}class Vm{constructor(e,i,l=0){this.x=+e,this.y=+i,this.z=+l}static fromLngLat(e,i=0){let l=up.convert(e);return new Vm(Lx(l.lng),Rx(l.lat),Fx(i,l.lat))}toLngLat(){return new up(Bx(this.x),hg(this.y))}toAltitude(){return Ox(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/zx*(e=hg(this.y),1/Math.cos(e*Math.PI/180));var e}}function Vx(r,e,i){var l=2*Math.PI*6378137/256/Math.pow(2,i);return[r*l-2*Math.PI*6378137/2,e*l-2*Math.PI*6378137/2]}class uy{constructor(e,i,l){if(!(function(h,m,g){return!(h<0||h>25||g<0||g>=Math.pow(2,h)||m<0||m>=Math.pow(2,h))})(e,i,l))throw new Error(`x=${i}, y=${l}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);this.z=e,this.x=i,this.y=l,this.key=Zd(0,e,e,i,l)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,i,l){let h=(g=this.y,x=this.z,C=Vx(256*(m=this.x),256*(g=Math.pow(2,x)-g-1),x),w=Vx(256*(m+1),256*(g+1),x),C[0]+","+C[1]+","+w[0]+","+w[1]);var m,g,x,C,w;let A=(function(M,N,L){let Z="";for(let X=M;X>0;X--){let ie=1<<X-1;Z+=(N&ie?1:0)+(L&ie?2:0)}return Z})(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(l==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,i>1?"@2x":"").replace(/{quadkey}/g,A).replace(/{bbox-epsg-3857}/g,h)}isChildOf(e){let i=this.z-e.z;return i>0&&e.x===this.x>>i&&e.y===this.y>>i}getTilePoint(e){let i=Math.pow(2,this.z);return new pe((e.x*i-this.x)*pi,(e.y*i-this.y)*pi)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Nx{constructor(e,i){this.wrap=e,this.canonical=i,this.key=Zd(e,i.z,i.z,i.x,i.y)}}class ml{constructor(e,i,l,h,m){if(this.terrainRttPosMatrix32f=null,e<l)throw new Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${l}`);this.overscaledZ=e,this.wrap=i,this.canonical=new uy(l,+h,+m),this.key=Zd(i,e,l,h,m)}clone(){return new ml(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let i=this.canonical.z-e;return e>this.canonical.z?new ml(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ml(e,this.wrap,e,this.canonical.x>>i,this.canonical.y>>i)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(e,i){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let l=this.canonical.z-e;return e>this.canonical.z?Zd(this.wrap*+i,e,this.canonical.z,this.canonical.x,this.canonical.y):Zd(this.wrap*+i,e,e,this.canonical.x>>l,this.canonical.y>>l)}isChildOf(e){if(e.wrap!==this.wrap||this.overscaledZ-e.overscaledZ<=0)return!1;if(e.overscaledZ===0)return this.overscaledZ>0;let i=this.canonical.z-e.canonical.z;return!(i<0)&&e.canonical.x===this.canonical.x>>i&&e.canonical.y===this.canonical.y>>i}children(e){if(this.overscaledZ>=e)return[new ml(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let i=this.canonical.z+1,l=2*this.canonical.x,h=2*this.canonical.y;return[new ml(i,this.wrap,i,l,h),new ml(i,this.wrap,i,l+1,h),new ml(i,this.wrap,i,l,h+1),new ml(i,this.wrap,i,l+1,h+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>
vendor: 5,754 bytes, line 2
2e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new ml(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new ml(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 Nx(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new Vm(e.x-this.wrap,e.y))}normalizeCoordinates(e,i,l=8192){if(e>=0&&e<l&&i>=0&&i<l)return{tileID:this,x:e,y:i};let h=Math.floor(e/l),m=Math.floor(i/l),g=e-h*l,x=i-m*l,C=this.canonical.z,w=1<<C,A=this.canonical.y+m;if(A<0||A>=w)return null;let M=this.canonical.x+h,N=this.wrap;return M<0?(N-=Math.ceil(-M/w),M=(M%w+w)%w):M>=w&&(N+=Math.floor(M/w),M%=w),{tileID:new ml(this.overscaledZ,N,C,M,A),x:g,y:x}}}function Zd(r,e,i,l,h){(r*=2)<0&&(r=-1*r-1);let m=1<<i;return(m*m*r+m*h+l).toString(36)+i.toString(36)+e.toString(36)}Qt("CanonicalTileID",uy),Qt("OverscaledTileID",ml,{omit:["terrainRttPosMatrix32f"]});class Yp{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(e){let i=new Yp;return i.extend(e(new pe(this.minX,this.minY))),i.extend(e(new pe(this.maxX,this.minY))),i.extend(e(new pe(this.minX,this.maxY))),i.extend(e(new pe(this.maxX,this.maxY))),i}static fromPoints(e){let i=new Yp;for(let l of e)i.extend(l);return i}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}}class Ux{constructor(e){this._stringToNumber={},this._numberToString=[];for(let i=0;i<e.length;i++){let l=e[i];this._stringToNumber[l]=i,this._numberToString[i]=l}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class jx{constructor(e,i,l,h,m){this.type="Feature",this._vectorTileFeature=e,this._x=l,this._y=h,this._z=i,this.properties=e.properties,this.id=m}projectPoint(e,i,l,h){return[360*(e.x+i)/h-180,360/Math.PI*Math.atan(Math.exp((1-2*(e.y+l)/h)*Math.PI))-90]}projectLine(e,i,l,h){return e.map((m=>this.projectPoint(m,i,l,h)))}get geometry(){if(this._geometry)return this._geometry;let e=this._vectorTileFeature,i=e.extent*Math.pow(2,this._z),l=e.extent*this._x,h=e.extent*this._y,m=e.loadGeometry();switch(e.type){case 1:{let g=[];for(let C of m)g.push(C[0]);let x=this.projectLine(g,l,h,i);this._geometry=g.length===1?{type:"Point",coordinates:x[0]}:{type:"MultiPoint",coordinates:x};break}case 2:{let g=m.map((x=>this.projectLine(x,l,h,i)));this._geometry=g.length===1?{type:"LineString",coordinates:g[0]}:{type:"MultiLineString",coordinates:g};break}case 3:{let g=Ed(m),x=[];for(let C of g)x.push(C.map((w=>this.projectLine(w,l,h,i))));this._geometry=x.length===1?{type:"Polygon",coordinates:x[0]}:{type:"MultiPolygon",coordinates:x};break}default:throw new Error(`unknown feature type: ${e.type}`)}return this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let i in this)i!=="_geometry"&&i!=="_vectorTileFeature"&&i!=="_x"&&i!=="_y"&&i!=="_z"&&(e[i]=this[i]);return e}}class Wd{constructor(e,i,l){this._name=e,this.dataBuffer=i,typeof l=="number"?this._size=l:(this.nullabilityBuffer=l,this._size=l.size())}getValue(e){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(e)?null:this.getValueFromBuffer(e)}has(e){return this.nullabilityBuffer?.get(e)||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}}class ug extends Wd{}class py extends ug{getValueFromBuffer(e){return this.dataBuffer[e]}}class dy extends ug{getValueFromBuffer(e){return this.dataBuffer[e]}}class qx extends Wd{constructor(e,i,l,h){super(e,i,h),this.delta=l}}class my extends qx{constructor(e,i,l,h){super(e,Int32Array.of(i),l,h)}getValueFromBuffer(e){return this.dataBuffer[0]+e*this.delta}}class fy extends Wd{constructor(e,i,l,h){super(e,h?Int32Array.of(i):Uint32Array.of(i),l)}getValueFromBuffer(e){return this.dataBuffer[0]}}class F3{constructor(e,i,l,h,m=4096){this._name=e,this._geometryVector=i,this._idVector=l,this._propertyVectors=h,this._extent=m}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){return this._propertyVectors}getPropertyVector(e){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this._propertyVectors.map((i=>[i.name,i])))),this.propertyVectorsMap.get(e)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let e=[],i=this.geometryVector.getGeometries();for(let l=0;l<this.numFeatures;l++){let h;if(this.idVector){let x=this.idVector.getValue(l);h=this.containsMaxSafeIntegerValues(this.idVector)&&x!==null?Number(x):x}let m={coordinates:i[l],type:this.geometryVector.geometryType(l)},g={};
2for(let x of this.propertyVectors){if(!x)continue;let C=x.name,w=x.getValue(l);w!==null&&(g[C]=w)}e.push({id:h,geometry:m,properties:g})}return e}containsMaxSafeIntegerValues(e){return e instanceof py||e instanceof fy||e instanceof my||e instanceof dy}}class $x{constructor(e){this.value=e}get(){return this.value}set(e){this.value=e}increment(){return this.value++}add(e){this.value+=e}}var pr,pp;(function(r){r.NONE="NONE",r.DELTA="DELTA",r.COMPONENTWISE_DELTA="COMPONENTWISE_DELTA",r.RLE="RLE",r.MORTON="MORTON",r.PDE="PDE"})(pr||(pr={})),(function(r){r.NONE="NONE",r.FAST_PFOR="FAST_PFOR",r.VARINT="VARINT",r.ALP="ALP"})(pp||(pp={}));let gy=new Uint32Array(33);gy[0]=0;for(let r=1;r<=32;r++)gy[r]=r===32?4294967295:4294967295>>>32-r;let _y=gy,fu=256;function yy(r,e){return r-r%e}function B3(r){let e=r>>>0;return((255&e)<<24|(65280&e)<<8|e>>>8&65280|e>>>24&255)>>>0}let xy=(function(){if(!Number.isFinite(65536))return 65536;let r=yy(Math.floor(65536),fu);return r===0?fu:r})(),O3=3*xy/fu+xy|0;function Gx(){let r=new Uint8Array(O3);return{dataToBePacked:new Array(33),dataPointers:new Int32Array(33),byteContainer:r,byteContainerI32:new Int32Array(r.buffer,r.byteOffset,r.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function V3(r,e,i,l,h){switch(h){case 1:(function(m,g,x,C){let w=C,A=g;for(let M=0;M<8;M++){let N=m[A++]>>>0;x[w++]=N>>>0&1,x[w++]=N>>>1&1,x[w++]=N>>>2&1,x[w++]=N>>>3&1,x[w++]=N>>>4&1,x[w++]=N>>>5&1,x[w++]=N>>>6&1,x[w++]=N>>>7&1,x[w++]=N>>>8&1,x[w++]=N>>>9&1,x[w++]=N>>>10&1,x[w++]=N>>>11&1,x[w++]=N>>>12&1,x[w++]=N>>>13&1,x[w++]=N>>>14&1,x[w++]=N>>>15&1,x[w++]=N>>>16&1,x[w++]=N>>>17&1,x[w++]=N>>>18&1,x[w++]=N>>>19&1,x[w++]=N>>>20&1,x[w++]=N>>>21&1,x[w++]=N>>>22&1,x[w++]=N>>>23&1,x[w++]=N>>>24&1,x[w++]=N>>>25&1,x[w++]=N>>>26&1,x[w++]=N>>>27&1,x[w++]=N>>>28&1,x[w++]=N>>>29&1,x[w++]=N>>>30&1,x[w++]=N>>>31&1}})(r,e,i,l);break;case 2:(function(m,g,x,C){let w=C,A=g;for(let M=0;M<8;M++){let N=m[A++]>>>0,L=m[A++]>>>0;x[w++]=N>>>0&3,x[w++]=N>>>2&3,x[w++]=N>>>4&3,x[w++]=N>>>6&3,x[w++]=N>>>8&3,x[w++]=N>>>10&3,x[w++]=N>>>12&3,x[w++]=N>>>14&3,x[w++]=N>>>16&3,x[w++]=N>>>18&3,x[w++]=N>>>20&3,x[w++]=N>>>22&3,x[w++]=N>>>24&3,x[w++]=N>>>26&3,x[w++]=N>>>28&3,x[w++]=N>>>30&3,x[w++]=L>>>0&3,x[w++]=L>>>2&3,x[w++]=L>>>4&3,x[w++]=L>>>6&3,x[w++]=L>>>8&3,x[w++]=L>>>10&3,x[w++]=L>>>12&3,x[w++]=L>>>14&3,x[w++]=L>>>16&3,x[w++]=L>>>18&3,x[w++]=L>>>20&3,x[w++]=L>>>22&3,x[w++]=L>>>24&3,x[w++]=L>>>26&3,x[w++]=L>>>28&3,x[w++]=L>>>30&3}})(r,e,i,l);break;case 3:(function(m,g,x,C){let w=C,A=g;for(let M=0;M<8;M++){let N=m[A++]>>>0,L=m[A++]>>>0,Z=m[A++]>>>0;x[w++]=N>>>0&7,x[w++]=N>>>3&7,x[w++]=N>>>6&7,x[w++]=N>>>9&7,x[w++]=N>>>12&7,x[w++]=N>>>15&7,x[w++]=N>>>18&7,x[w++]=N>>>21&7,x[w++]=N>>>24&7,x[w++]=N>>>27&7,x[w++]=7&(N>>>30|(1&L)<<2),x[w++]=L>>>1&7,x[w++]=L>>>4&7,x[w++]=L>>>7&7,x[w++]=L>>>10&7,x[w++]=L>>>13&7,x[w++]=L>>>16&7,x[w++]=L>>>19&7,x[w++]=L>>>22&7,x[w++]=L>>>25&7,x[w++]=L>>>28&7,x[w++]=7&(L>>>31|(3&Z)<<1),x[w++]=Z>>>2&7,x[w++]=Z>>>5&7,x[w++]=Z>>>8&7,x[w++]=Z>>>11&7,x[w++]=Z>>>14&7,x[w++]=Z>>>17&7,x[w++]=Z>>>20&7,x[w++]=Z>>>23&7,x[w++]=Z>>>26&7,x[w++]=Z>>>29&7}})(r,e,i,l);break;case 4:(function(m,g,x,C){let w=C,A=g;for(let M=0;M<8;M++){let N=m[A++]>>>0,L=m[A++]>>>0,Z=m[A++]>>>0,X=m[A++]>>>0;x[w++]=N>>>0&15,x[w++]=N>>>4&15,x[w++]=N>>>8&15,x[w++]=N>>>12&15,x[w++]=N>>>16&15,x[w++]=N>>>20&15,x[w++]=N>>>24&15,x[w++]=N>>>28&15,x[w++]=L>>>0&15,x[w++]=L>>>4&15,x[w++]=L>>>8&15,x[w++]=L>>>12&15,x[w++]=L>>>16&15,x[w++]=L>>>20&15,x[w++]=L>>>24&15,x[w++]=L>>>28&15,x[w++]=Z>>>0&15,x[w++]=Z>>>4&15,x[w++]=Z>>>8&15,x[w++]=Z>>>12&15,x[w++]=Z>>>16&15,x[w++]=Z>>>20&15,x[w++]=Z>>>24&15,x[w++]=Z>>>28&15,x[w++]=X>>>0&15,x[w++]=X>>>4&15,x[w++]=X>>>8&15,x[w++]=X>>>12&15,x[w++]=X>>>16&15,x[w++]=X>>>20&15,x[w++]=X>>>24&15,x[w++]=X>>>28&15}})(r,e,i,l);break;case 5:(function(m,g,x,C){let w=C,A=g;for(let M=0;M<8;M++){let N=m[A++]>>>0,L=m[A++]>>>0,Z=m[A++]>>>0,X=m[A++]>>>0,ie=m[A++]>>>0;x[w++]=N>>>0&31,x[w++]=N>>>5&31,x[w++]=N>>>10&31,x[w++]=N>>>15&31,x[w++]=N>>>20&31,x[w++]=N>>>25&31,x[w++]=31&(N>>>30|(7&L)<<2),x[w++]=L>>>3&31,x[w++]=L>>>8&31,x[w++]=L>>>13&31,x[w++]=L>>>18&31,x[w++]=L>>>23&31,x[w++]=31&(L>>>28|(1&Z)<<4),x[w++]=Z>>>1&31,x[w++]=Z>>>6&31,x[w++]=Z>>>11&31,x[w++]=Z>>>16&31,x[w++]=Z>>>21&31,x[w++]=Z>>>26&31,x[w++]=31&(Z>>>31|(15&X)<<1),x[w++]=X>>>4&31,x[w++]=X>>>9&31,x[w++]=X>>>14&31,x[w++]=X>>>19&31,x[w++]=X>>>24&31,x[w++]=31&(X>>>29|(3&ie)<<3),x[w++]=ie>>>2&31,x[w++]=ie>>>7&31,x[w++]=ie>>>12&31,x[w++]=ie>>>17&31,x[w++]=ie>>>22&31,x[w++]=ie>>>27&31}})(r,e,i,l);break;case 6:(function(m,g,x,C){let w=C,A=g;for(let M=0;M<8;M++){let N=m[A++]>>>0,L=m[A++]>>>0,Z=m[A++]>>>0,X=m[A++]>>>0,ie=m[A++]>>>0,ne=m[A++]>>>0;x[w++]=N>>>0&63,x[w++]=N>>>6&63,x[w++]=N>>>12&63,x[w++]=N>>>18&63,x[w++]=N>>>24&63,x[w++]=63&(N>>>30|(15&L)<<2),x[w++]=L>>>4&63,x[w++]=L>>>10&63,x[w++]=L>>>16&63,x[w++]=L>>>22&63,x[w++]=63&(L>>>28|(3&Z)<<4),x[w++]=Z>>>2&63,x[w++]=Z>>>8&63,x[w++]=Z>>>14&63,x[w++]=Z>>>20&63,x[w++]=Z>>>26&63,x[w++]=X>>>0&63,x[w++]=X>>>6&63,x[w++]=X>>>12&63,x[w++]=X>>>18&63,x[w++]=X>>>24&63,x[w++]=63&(X>>>30|(15&ie)<<2),x[w++]=ie>>>4&63,x[w++]=ie>>>10&63,x[w++]=ie>>>16&63,x[w++]=ie>>>22&63,x[w++]=63&(ie>>>28|(3&ne)<<4),x[w++]=ne>>>2&63,x[w++]=ne>>>8&63,x[w++]=ne>>>14&63,x[w++]=ne>>>20&63,x[w++]=ne>>>26&63}})(r,e,i,l);break;case 7:(function(m,g,x,C){let w=C,A=g;for(let M=0;M<8;M++){let N=m[A++]>>>0,L=m[A++]>>>0,Z=m[A++]>>>0,X=m[A++]>>>0,ie=m[A++]>>>0,ne=m[A++]>>>0,ue=m[A++]>>>0;x[w++]=N>>>0&127,x[w++]=N>>>7&127,x[w++]=N>>>14&127,x[w++]=N>>>21&127,x[w++]=127&(N>>>28|(7&L)<<4),x[w++]=L>>>3&127,x[w++]=L>>>10&127,x[w++]=L>>>17&127,x[w++]=L>>>24&127,x[w++]=127&(L>>>31|(63&Z)<<1),x[w++]=Z>>>6&127,x[w++]=Z>>>13&127,x[w++]=Z>>>20&127,x[w++]=127&(Z>>>27|(3&X)<<5),x[w++]=X>>>2&127,x[w++]=X>>>9&127,x[w++]=X>>>16&127,x[w++]=X>>>23&127,x[w++]=127&(X>>>30|(31&ie)<<2),x[w++]=ie>>>5&127,x[w++]=ie>>>12&127,x[w++]=ie>>>19&127,x[w++]=127&(ie>>>26|(1&ne)<<6),x[w++]=ne>>>1&127,x[w++]=ne>>>8&127,x[w++]=ne>>>15&127,x[w++]=ne>>>22&127,x[w++]=127&(ne>>>29|(15&ue)<<3),x[w++]=ue>>>4&127,x[w++]=ue>>>11&127,x[w++]=ue>>>18&127,x[w++]=ue>>>25&127}})(r,e,i,l);break;case 8:(function(m,g,x,C){let w=C,A=g;for(let M=0;M<8;M++){let N=m[A++]>>>0,L=m[A++]>>>0,Z=m[A++]>>>0,X=m[A++]>>>0,ie=m[A++]>>>0,ne=m[A++]>>>0,ue=m[A++]>>>0,se=m[A++]>>>0;x[w++]=N>>>0&255,x[w++]=N>>>8&255,x[w++]=N>>>16&255,x[w++]=N>>>24&255,x[w++]=L>>>0&255,x[w++]=L>>>8&255,x[w++]=L>>>16&255,x[w++]=L>>>24&255,x[w++]=Z>>>0&255,x[w++]=Z>>>8&255,x[w++]=Z>>>16&255,x[w++]=Z>>>24&255,x[w++]=X>>>0&255,x[w++]=X>>>8&255,x[w++]=X>>>16&255,x[w++]=X>>>24&255,x[w++]=ie>>>0&255,x[w++]=ie>>>8&255,x[w++]=ie>>>16&255,x[w++]=ie>>>24&255,x[w++]=ne>>>0&255,x[w++]=ne>>>8&255,x[w++]=ne>>>16&255,x[w++]=ne>>>24&255,x[w++]=ue>>>0&255,x[w++]=ue>>>8&255,x[w++]=ue>>>16&255,x[w++]=ue>>>24&255,x[w++]=se>>>0&255,x[w++]=se>>>8&255,x[w++]=se>>>16&255,x[w++]=se>>>24&255}})(r,e,i,l);break;case 16:(function(m,g,x,C){let w=C,A=g;for(let M=0;M<128;M++){let N=m[A++]>>>0;x[w++]=65535&N,x[w++]=N>>>16&65535}})(r,e,i,l);break;default:(function(m,g,x,C,w){let A=_y[w]>>>0,M=g,N=0,L=m[M]>>>0,Z=C;for(let X=0;X<8;X++){for(let ie=0;ie<32;ie++)if(N+w<=32)x[Z+ie]=L>>>N&A,N+=w,N===32&&(N=0,M++,ie!==31&&(L=m[M]>>>0));else{let ne=32-N,ue=L>>>N;M++,L=m[M]>>>0;let se=w-ne;x[Z+ie]=(ue|(L&-1>>>32-se>>>0)<<ne)&A,N=se}Z+=32,N=0,X<7&&(L=m[M]>>>0)}})(r,e,i,l,h)}return e+(h<<3)|0}function N3(r,e,i,l){if(i+2>e)throw new Error(`FastPFOR decode: byteContainer underflow at block=${l} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${i}, byteSize=${e})`);let h=r[i++],m=r[i++];if(h>32)throw new Error(`FastPFOR decode: invalid bitWidth=${h} at block=${l} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:h,exceptionCount:m,bytePosIn:i}}function U3(r,e,i,l,h,m,g,x,C){let{maxBits:w,exceptionBitWidth:A,bytePosIn:M}=(function(ie,ne,ue,se,me,be){if(ue+1>ne)throw new Error(`FastPFOR decode: exception header underflow at block=${be} (need 1 byte for maxBits, bytePos=${ue}, byteSize=${ne})`);let Ce=ie[ue++];if(Ce<se||Ce>32)throw new Error(`FastPFOR decode: invalid maxBits=${Ce} at block=${be} (bitWidth=${se}, expected ${se}..32)`);let We=Ce-se|0;if(We<1||We>32)throw new Error(`FastPFOR decode: invalid exceptionBitWidth=${We} at block=${be} (bitWidth=${se}, maxBits=${Ce})`);if(ue+me>ne)throw new Error(`FastPFOR decode: exception positions underflow at block=${be} (need=${me}, have=${ne-ue})`);return{maxBits:Ce,exceptionBitWidth:We,bytePosIn:ue}})(h,m,g,i,l,C);if(g=M,A===1){let ie=1<<i;for(let ne=0;ne<l;ne=ne+1|0)r[h[g++]+e|0]|=ie;return g}let N=x.dataToBePacked[A];if(!N)throw new Error(`FastPFOR decode: missing exception stream for exceptionBitWidth=${A} (bitWidth=${i}, maxBits=${w}) at block ${C}`);let L=x.dataPointers,Z=0|L[A],X=0|x.exceptionSizes[A];if(Z+l>X)throw new Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${A} (ptr=${Z}, need ${l}, size=${X}) at block ${C}`);for(let ie=0;ie<l;ie=ie+1|0){let ne=h[g++],ue=0|N[Z++];r[ne+e|0]|=ue<<i}return L[A]=Z,g}function j3(r,e,i,l,h,m){let g=0|i,x=0|r[g];if(x<=0||g+x>r.length-1)throw new Error(`FastPFOR decode: invalid whereMeta=${x} at pageStart=${g} (expected > 0 and pageStart+whereMeta < encoded.length=${r.length})`);let C=g+1|0,w=g+x|0,A=r[w]>>>0,M=A+3>>>2,N=w+1,L=N+M;if(L>=r.length)throw new Error(`FastPFOR decode: invalid byteSize=${A} (metaInts=${M}, pageStart=${g}, packedEnd=${w}, byteContainerStart=${N}) causes bitmapPos=${L} out of bounds (encoded.length=${r.length})`);let Z=(function(ne,ue,se,me){me.byteContainer.length<se&&(me.byteContainer=new Uint8Array(2*se),me.byteContainerI32=void 0);let be=me.byteContainer,Ce=se>>>2;if(3&be.byteOffset)for(let Je=0;Je<Ce;Je=Je+1|0){let mt=0|ne[ue+Je|0],at=Je<<2;be[at]=255&mt,be[at+1|0]=mt>>>8&255,be[at+2|0]=mt>>>16&255,be[at+3|0]=mt>>>24&255}else{let Je=me.byteContainerI32;(!Je||Je.buffer!==be.buffer||Je.byteOffset!==be.byteOffset||Je.length<Ce)&&(Je=me.byteContainerI32=new Int32Array(be.buffer,be.byteOffset,be.byteLength>>>2)),Je.set(ne.subarray(ue,ue+Ce))}let We=3&se;if(We>0){let Je=0|ne[ue+Ce|0],mt=Ce<<2;for(let at=0;at<We;at=at+1|0)be[mt+at|0]=Je>>>(at<<3)&255}return be})(r,N,A,m),X=A,ie=(function(ne,ue,se){let me=0|ne[ue++],be=se.dataToBePacked;for(let Ce=2;Ce<=32;Ce=Ce+1|0){if(!(me>>>Ce-1&1))continue;if(ue>=ne.length)throw new Error(`FastPFOR decode: truncated exception stream header (bitWidth=${Ce}, streamWordIndex=${ue}, needWords=1, availableWords=${ne.length-ue}, encodedWords=${ne.length})`);let We=ne[ue++]>>>0,Je=yy(We+31,32),mt=We*Ce+31>>>5;if(ue+mt>ne.length)throw new Error(`FastPFOR decode: truncated exception stream (bitWidth=${Ce}, size=${We}, streamWordIndex=${ue}, needWords=${mt}, availableWords=${ne.length-ue}, encodedWords=${ne.length})`);let at=be[Ce];(!at||at.length<Je)&&(at=be[Ce]=new Uint32Array(Je));let vt=0;for(;vt<We;
2vt=vt+32|0)q3(ne,ue,at,vt,Ce),ue=ue+Ce|0;ue=ue-((vt-We|0)*Ce>>>5)|0,se.exceptionSizes[Ce]=We}return ue})(r,L,m);return m.dataPointers.fill(0),(function(ne,ue,se,me,be,Ce,We,Je,mt,at){let vt=0|se,bt=0;for(let yt=0;yt<We;yt=yt+1|0){let lt=N3(Je,mt,bt,yt);bt=lt.bytePosIn;let qt=lt.bitWidth,ii=lt.exceptionCount,Wt=Ce+yt*fu|0;switch(qt){case 0:be.fill(0,Wt,Wt+fu);break;case 32:for(let $t=0;$t<fu;$t=$t+1|0)be[Wt+$t|0]=0|ne[vt+$t|0];vt=vt+fu|0;break;default:vt=V3(ne,vt,be,Wt,qt)}ii>0&&(bt=U3(be,Wt,qt,ii,Je,mt,bt,at,yt))}if(vt!==me)throw new Error(`FastPFOR decode: packed region mismatch (pageStart=${ue}, packedStart=${se}, consumedPackedEnd=${vt}, expectedPackedEnd=${me}, packedWords=${me-se}, encoded.length=${ne.length})`)})(r,g,C,w,e,0|l,h/fu|0,Z,X,m),ie}function q3(r,e,i,l,h){switch(h){case 2:return void(function(w,A,M,N){let L=N,Z=w[A]>>>0,X=w[A+1]>>>0;M[L++]=Z>>>0&3,M[L++]=Z>>>2&3,M[L++]=Z>>>4&3,M[L++]=Z>>>6&3,M[L++]=Z>>>8&3,M[L++]=Z>>>10&3,M[L++]=Z>>>12&3,M[L++]=Z>>>14&3,M[L++]=Z>>>16&3,M[L++]=Z>>>18&3,M[L++]=Z>>>20&3,M[L++]=Z>>>22&3,M[L++]=Z>>>24&3,M[L++]=Z>>>26&3,M[L++]=Z>>>28&3,M[L++]=Z>>>30&3,M[L++]=X>>>0&3,M[L++]=X>>>2&3,M[L++]=X>>>4&3,M[L++]=X>>>6&3,M[L++]=X>>>8&3,M[L++]=X>>>10&3,M[L++]=X>>>12&3,M[L++]=X>>>14&3,M[L++]=X>>>16&3,M[L++]=X>>>18&3,M[L++]=X>>>20&3,M[L++]=X>>>22&3,M[L++]=X>>>24&3,M[L++]=X>>>26&3,M[L++]=X>>>28&3,M[L]=X>>>30&3})(r,e,i,l);case 3:return void(function(w,A,M,N){let L=N,Z=w[A]>>>0,X=w[A+1]>>>0,ie=w[A+2]>>>0;M[L++]=Z>>>0&7,M[L++]=Z>>>3&7,M[L++]=Z>>>6&7,M[L++]=Z>>>9&7,M[L++]=Z>>>12&7,M[L++]=Z>>>15&7,M[L++]=Z>>>18&7,M[L++]=Z>>>21&7,M[L++]=Z>>>24&7,M[L++]=Z>>>27&7,M[L++]=7&(Z>>>30|(1&X)<<2),M[L++]=X>>>1&7,M[L++]=X>>>4&7,M[L++]=X>>>7&7,M[L++]=X>>>10&7,M[L++]=X>>>13&7,M[L++]=X>>>16&7,M[L++]=X>>>19&7,M[L++]=X>>>22&7,M[L++]=X>>>25&7,M[L++]=X>>>28&7,M[L++]=7&(X>>>31|(3&ie)<<1),M[L++]=ie>>>2&7,M[L++]=ie>>>5&7,M[L++]=ie>>>8&7,M[L++]=ie>>>11&7,M[L++]=ie>>>14&7,M[L++]=ie>>>17&7,M[L++]=ie>>>20&7,M[L++]=ie>>>23&7,M[L++]=ie>>>26&7,M[L]=ie>>>29&7})(r,e,i,l);case 4:return void(function(w,A,M,N){let L=N,Z=w[A]>>>0,X=w[A+1]>>>0,ie=w[A+2]>>>0,ne=w[A+3]>>>0;M[L++]=Z>>>0&15,M[L++]=Z>>>4&15,M[L++]=Z>>>8&15,M[L++]=Z>>>12&15,M[L++]=Z>>>16&15,M[L++]=Z>>>20&15,M[L++]=Z>>>24&15,M[L++]=Z>>>28&15,M[L++]=X>>>0&15,M[L++]=X>>>4&15,M[L++]=X>>>8&15,M[L++]=X>>>12&15,M[L++]=X>>>16&15,M[L++]=X>>>20&15,M[L++]=X>>>24&15,M[L++]=X>>>28&15,M[L++]=ie>>>0&15,M[L++]=ie>>>4&15,M[L++]=ie>>>8&15,M[L++]=ie>>>12&15,M[L++]=ie>>>16&15,M[L++]=ie>>>20&15,M[L++]=ie>>>24&15,M[L++]=ie>>>28&15,M[L++]=ne>>>0&15,M[L++]=ne>>>4&15,M[L++]=ne>>>8&15,M[L++]=ne>>>12&15,M[L++]=ne>>>16&15,M[L++]=ne>>>20&15,M[L++]=ne>>>24&15,M[L]=ne>>>28&15})(r,e,i,l);case 5:return void(function(w,A,M,N){let L=N,Z=w[A]>>>0,X=w[A+1]>>>0,ie=w[A+2]>>>0,ne=w[A+3]>>>0,ue=w[A+4]>>>0;M[L++]=Z>>>0&31,M[L++]=Z>>>5&31,M[L++]=Z>>>10&31,M[L++]=Z>>>15&31,M[L++]=Z>>>20&31,M[L++]=Z>>>25&31,M[L++]=31&(Z>>>30|(7&X)<<2),M[L++]=X>>>3&31,M[L++]=X>>>8&31,M[L++]=X>>>13&31,M[L++]=X>>>18&31,M[L++]=X>>>23&31,M[L++]=31&(X>>>28|(1&ie)<<4),M[L++]=ie>>>1&31,M[L++]=ie>>>6&31,M[L++]=ie>>>11&31,M[L++]=ie>>>16&31,M[L++]=ie>>>21&31,M[L++]=ie>>>26&31,M[L++]=31&(ie>>>31|(15&ne)<<1),M[L++]=ne>>>4&31,M[L++]=ne>>>9&31,M[L++]=ne>>>14&31,M[L++]=ne>>>19&31,M[L++]=ne>>>24&31,M[L++]=31&(ne>>>29|(3&ue)<<3),M[L++]=ue>>>2&31,M[L++]=ue>>>7&31,M[L++]=ue>>>12&31,M[L++]=ue>>>17&31,M[L++]=ue>>>22&31,M[L]=ue>>>27&31})(r,e,i,l);case 6:return void(function(w,A,M,N){let L=N,Z=w[A]>>>0,X=w[A+1]>>>0,ie=w[A+2]>>>0,ne=w[A+3]>>>0,ue=w[A+4]>>>0,se=w[A+5]>>>0;M[L++]=Z>>>0&63,M[L++]=Z>>>6&63,M[L++]=Z>>>12&63,M[L++]=Z>>>18&63,M[L++]=Z>>>24&63,M[L++]=63&(Z>>>30|(15&X)<<2),M[L++]=X>>>4&63,M[L++]=X>>>10&63,M[L++]=X>>>16&63,M[L++]=X>>>22&63,M[L++]=63&(X>>>28|(3&ie)<<4),M[L++]=ie>>>2&63,M[L++]=ie>>>8&63,M[L++]=ie>>>14&63,M[L++]=ie>>>20&63,M[L++]=ie>>>26&63,M[L++]=ne>>>0&63,M[L++]=ne>>>6&63,M[L++]=ne>>>12&63,M[L++]=ne>>>18&63,M[L++]=ne>>>24&63,M[L++]=63&(ne>>>30|(15&ue)<<2),M[L++]=ue>>>4&63,M[L++]=ue>>>10&63,M[L++]=ue>>>16&63,M[L++]=ue>>>22&63,M[L++]=63&(ue>>>28|(3&se)<<4),M[L++]=se>>>2&63,M[L++]=se>>>8&63,M[L++]=se>>>14&63,M[L++]=se>>>20&63,M[L]=se>>>26&63})(r,e,i,l);case 7:return void(function(w,A,M,N){let L=N,Z=w[A]>>>0,X=w[A+1]>>>0,ie=w[A+2]>>>0,ne=w[A+3]>>>0,ue=w[A+4]>>>0,se=w[A+5]>>>0,me=w[A+6]>>>0;M[L++]=Z>>>0&127,M[L++]=Z>>>7&127,M[L++]=Z>>>14&127,M[L++]=Z>>>21&127,M[L++]=127&(Z>>>28|(7&X)<<4),M[L++]=X>>>3&127,M[L++]=X>>>10&127,M[L++]=X>>>17&127,M[L++]=X>>>24&127,M[L++]=127&(X>>>31|(63&ie)<<1),M[L++]=ie>>>6&127,M[L++]=ie>>>
vendor: 5,876 bytes, line 2
213&127,M[L++]=ie>>>20&127,M[L++]=127&(ie>>>27|(3&ne)<<5),M[L++]=ne>>>2&127,M[L++]=ne>>>9&127,M[L++]=ne>>>16&127,M[L++]=ne>>>23&127,M[L++]=127&(ne>>>30|(31&ue)<<2),M[L++]=ue>>>5&127,M[L++]=ue>>>12&127,M[L++]=ue>>>19&127,M[L++]=127&(ue>>>26|(1&se)<<6),M[L++]=se>>>1&127,M[L++]=se>>>8&127,M[L++]=se>>>15&127,M[L++]=se>>>22&127,M[L++]=127&(se>>>29|(15&me)<<3),M[L++]=me>>>4&127,M[L++]=me>>>11&127,M[L++]=me>>>18&127,M[L]=me>>>25&127})(r,e,i,l);case 8:return void(function(w,A,M,N){let L=N,Z=w[A]>>>0,X=w[A+1]>>>0,ie=w[A+2]>>>0,ne=w[A+3]>>>0,ue=w[A+4]>>>0,se=w[A+5]>>>0,me=w[A+6]>>>0,be=w[A+7]>>>0;M[L++]=Z>>>0&255,M[L++]=Z>>>8&255,M[L++]=Z>>>16&255,M[L++]=Z>>>24&255,M[L++]=X>>>0&255,M[L++]=X>>>8&255,M[L++]=X>>>16&255,M[L++]=X>>>24&255,M[L++]=ie>>>0&255,M[L++]=ie>>>8&255,M[L++]=ie>>>16&255,M[L++]=ie>>>24&255,M[L++]=ne>>>0&255,M[L++]=ne>>>8&255,M[L++]=ne>>>16&255,M[L++]=ne>>>24&255,M[L++]=ue>>>0&255,M[L++]=ue>>>8&255,M[L++]=ue>>>16&255,M[L++]=ue>>>24&255,M[L++]=se>>>0&255,M[L++]=se>>>8&255,M[L++]=se>>>16&255,M[L++]=se>>>24&255,M[L++]=me>>>0&255,M[L++]=me>>>8&255,M[L++]=me>>>16&255,M[L++]=me>>>24&255,M[L++]=be>>>0&255,M[L++]=be>>>8&255,M[L++]=be>>>16&255,M[L]=be>>>24&255})(r,e,i,l);case 9:return void(function(w,A,M,N){let L=N,Z=w[A]>>>0,X=w[A+1]>>>0,ie=w[A+2]>>>0,ne=w[A+3]>>>0,ue=w[A+4]>>>0,se=w[A+5]>>>0,me=w[A+6]>>>0,be=w[A+7]>>>0,Ce=w[A+8]>>>0;M[L++]=Z>>>0&511,M[L++]=Z>>>9&511,M[L++]=Z>>>18&511,M[L++]=511&(Z>>>27|(15&X)<<5),M[L++]=X>>>4&511,M[L++]=X>>>13&511,M[L++]=X>>>22&511,M[L++]=511&(X>>>31|(255&ie)<<1),M[L++]=ie>>>8&511,M[L++]=ie>>>17&511,M[L++]=511&(ie>>>26|(7&ne)<<6),M[L++]=ne>>>3&511,M[L++]=ne>>>12&511,M[L++]=ne>>>21&511,M[L++]=511&(ne>>>30|(127&ue)<<2),M[L++]=ue>>>7&511,M[L++]=ue>>>16&511,M[L++]=511&(ue>>>25|(3&se)<<7),M[L++]=se>>>2&511,M[L++]=se>>>11&511,M[L++]=se>>>20&511,M[L++]=511&(se>>>29|(63&me)<<3),M[L++]=me>>>6&511,M[L++]=me>>>15&511,M[L++]=511&(me>>>24|(1&be)<<8),M[L++]=be>>>1&511,M[L++]=be>>>10&511,M[L++]=be>>>19&511,M[L++]=511&(be>>>28|(31&Ce)<<4),M[L++]=Ce>>>5&511,M[L++]=Ce>>>14&511,M[L]=Ce>>>23&511})(r,e,i,l);case 10:return void(function(w,A,M,N){let L=N,Z=w[A]>>>0,X=w[A+1]>>>0,ie=w[A+2]>>>0,ne=w[A+3]>>>0,ue=w[A+4]>>>0,se=w[A+5]>>>0,me=w[A+6]>>>0,be=w[A+7]>>>0,Ce=w[A+8]>>>0,We=w[A+9]>>>0;M[L++]=Z>>>0&1023,M[L++]=Z>>>10&1023,M[L++]=Z>>>20&1023,M[L++]=1023&(Z>>>30|(255&X)<<2),M[L++]=X>>>8&1023,M[L++]=X>>>18&1023,M[L++]=1023&(X>>>28|(63&ie)<<4),M[L++]=ie>>>6&1023,M[L++]=ie>>>16&1023,M[L++]=1023&(ie>>>26|(15&ne)<<6),M[L++]=ne>>>4&1023,M[L++]=ne>>>14&1023,M[L++]=1023&(ne>>>24|(3&ue)<<8),M[L++]=ue>>>2&1023,M[L++]=ue>>>12&1023,M[L++]=ue>>>22&1023,M[L++]=se>>>0&1023,M[L++]=se>>>10&1023,M[L++]=se>>>20&1023,M[L++]=1023&(se>>>30|(255&me)<<2),M[L++]=me>>>8&1023,M[L++]=me>>>18&1023,M[L++]=1023&(me>>>28|(63&be)<<4),M[L++]=be>>>6&1023,M[L++]=be>>>16&1023,M[L++]=1023&(be>>>26|(15&Ce)<<6),M[L++]=Ce>>>4&1023,M[L++]=Ce>>>14&1023,M[L++]=1023&(Ce>>>24|(3&We)<<8),M[L++]=We>>>2&1023,M[L++]=We>>>12&1023,M[L]=We>>>22&1023})(r,e,i,l);case 11:return void(function(w,A,M,N){let L=N,Z=w[A]>>>0,X=w[A+1]>>>0,ie=w[A+2]>>>0,ne=w[A+3]>>>0,ue=w[A+4]>>>0,se=w[A+5]>>>0,me=w[A+6]>>>0,be=w[A+7]>>>0,Ce=w[A+8]>>>0,We=w[A+9]>>>0,Je=w[A+10]>>>0;M[L++]=Z>>>0&2047,M[L++]=Z>>>11&2047,M[L++]=2047&(Z>>>22|(1&X)<<10),M[L++]=X>>>1&2047,M[L++]=X>>>12&2047,M[L++]=2047&(X>>>23|(3&ie)<<9),M[L++]=ie>>>2&2047,M[L++]=ie>>>13&2047,M[L++]=2047&(ie>>>24|(7&ne)<<8),M[L++]=ne>>>3&2047,M[L++]=ne>>>14&2047,M[L++]=2047&(ne>>>25|(15&ue)<<7),M[L++]=ue>>>4&2047,M[L++]=ue>>>15&2047,M[L++]=2047&(ue>>>26|(31&se)<<6),M[L++]=se>>>5&2047,M[L++]=se>>>16&2047,M[L++]=2047&(se>>>27|(63&me)<<5),M[L++]=me>>>6&2047,M[L++]=me>>>17&2047,M[L++]=2047&(me>>>28|(127&be)<<4),M[L++]=be>>>7&2047,M[L++]=be>>>18&2047,M[L++]=2047&(be>>>29|(255&Ce)<<3),M[L++]=Ce>>>8&2047,M[L++]=Ce>>>19&2047,M[L++]=2047&(Ce>>>30|(511&We)<<2),M[L++]=We>>>9&2047,M[L++]=We>>>20&2047,M[L++]=2047&(We>>>31|(1023&Je)<<1),M[L++]=Je>>>10&2047,M[L]=Je>>>21&2047})(r,e,i,l);case 12:return void(function(w,A,M,N){let L=N,Z=w[A]>>>0,X=w[A+1]>>>0,ie=w[A+2]>>>0,ne=w[A+3]>>>0,ue=w[A+4]>>>0,se=w[A+5]>>>0,me=w[A+6]>>>0,be=w[A+7]>>>0,Ce=w[A+8]>>>0,We=w[A+9]>>>0,Je=w[A+10]>>>0,mt=w[A+11]>>>0;M[L++]=Z>>>0&4095,M[L++]=Z>>>12&4095,M[L++]=4095&(Z>>>24|(15&X)<<8),M[L++]=X>>>4&4095,M[L++]=X>>>16&4095,M[L++]=4095&(X>>>28|(255&ie)<<4),M[L++]=ie>>>8&4095,M[L++]=ie>>>20&4095,M[L++]=ne>>>0&4095,M[L++]=ne>>>12&4095,M[L++]=4095&(ne>>>24|(15&ue)<<8),M[L++]=ue>>>4&4095,M[L++]=ue>>>16&4095,M[L++]=4095&(ue>>>28|(255&se)<<4),M[L++]=se>>>8&4095,M[L++]=se>>>20&4095,M[L++]=me>>>0&4095,M[L++]=me>>>12&4095,M[L++]=4095&(me>>>24|(15&be)<<8),M[L++]=be>>>4&4095,M[L++]=be>>>16&4095,M[L++]=4095&(be>>>28|(255&Ce)<<4),M[L++]=Ce>>>8&4095,M[L++]=Ce>>>20&4095,M[L++]=We>>>0&4095,M[L++]=We>>>12&4095,M[L++]=4095&(We>>>24|(15&Je)<<8),M[L++]=Je>>>4&4095,M[L++]=Je>>>16&4095,M[L++]=4095&(Je>>>28|(255&mt)<<4),M[L++]=mt>>>8&4095,M[L]=mt>>>20&4095})(r,e,i,l);case 16:return void(function(w,A,M,N){let L=N,Z=w[A]>>>0,X=w[A+1]>>>0,ie=w[A+2]>>>0,ne=w[A+3]>>>0,ue=w[A+4]>>>0,se=w[A+5]>>>0,me=w[A+6]>>>0,be=w[A+7]>>>0,Ce=w[A+8]>>>0,We=w[A+9]>>>0,Je=w[A+10]>>>0,mt=w[A+11]>>>0,at=w[A+12]>>>0,vt=w[A+13]>>>0,bt=w[A+14]>>>0,yt=w[A+15]>>>0;M[L++]=Z>>>0&65535,M[L++]=Z>>>16&65535,M[L++]=X>>>0&65535,M[L++]=X>>>16&65535,M[L++]=ie>>>0&65535,M[L++]=ie>>>16&65535,M[L++]=ne>>>0&65535,M[L++]=ne>>>16&65535,M[L++]=ue>>>0&65535,M[L++]=ue>>>16&65535,M[L++]=se>>>0&65535,M[L++]=se>>>16&65535,M[L++]=me>>>0&65535,M[L++]=me>>>16&65535,M[L++]=be>>>0&65535,M[L++]=be>>>16&65535,M[L++]=Ce>>>0&65535,M[L++]=Ce>>>16&65535,M[L++]=We>>>0&65535,M[L++]=We>>>16&65535,M[L++]=Je>>>0&65535,M[L++]=Je>>>16&65535,M[L++]=mt>>>0&65535,M[L++]=mt>>>16&65535,M[L++]=at>>>0&65535,M[L++]=at>>>16&65535,M[L++]=vt>>>0&65535,M[L++]=vt>>>16&65535,M[L++]=bt>>>0&65535,M[L++]=bt>>>16&65535,M[L++]=yt>>>0&65535,M[L]=yt>>>16&65535})(r,e,i,l);case 32:for(let w=0;w<32;w=w+1|0)i[l+w|0]=0|r[e+w|0];return}
2let m=_y[h]>>>0,g=e,x=0,C=r[g]>>>0;for(let w=0;w<32;w++)if(x+h<=32)i[l+w]=C>>>x&m,x+=h,x===32&&(x=0,g++,w!==31&&(C=r[g]>>>0));else{let A=32-x,M=C>>>x;g++,C=r[g]>>>0,i[l+w]=(M|(C&_y[h-A]>>>0)<<A)&m,x=h-A}}function ts(r,e,i){let l=new Uint32Array(i),h=0,m=e.get();for(let g=0;g<l.length;g++){let x=r[m++],C=127&x;x<128||(x=r[m++],C|=(127&x)<<7,x<128||(x=r[m++],C|=(127&x)<<14,x<128||(x=r[m++],C|=(127&x)<<21,x<128||(x=r[m++],C|=(15&x)<<28)))),l[h++]=C}return e.set(m),l}function Hd(r,e,i){let l=new BigUint64Array(i);for(let h=0;h<l.length;h++)l[h]=$3(r,e);return l}function $3(r,e){let i=0n,l=0,h=e.get();for(;h<r.length;){let m=r[h++];if(i|=BigInt(127&m)<<BigInt(l),!(128&m))break;if(l+=7,l>=64)throw new Error("Varint too long")}return e.set(h),i}function G3(r,e){let i,l;return l=r[e.get()],e.increment(),i=127&l,l<128?i:(l=r[e.get()],e.increment(),i|=(127&l)<<7,l<128?i:(l=r[e.get()],e.increment(),i|=(127&l)<<14,l<128?i:(l=r[e.get()],e.increment(),i|=(127&l)<<21,l<128?i:(l=r[e.get()],i|=(15&l)<<28,(function(h,m,g){let x,C;if(C=m[g.get()],g.increment(),x=(112&C)>>4,C<128||(C=m[g.get()],g.increment(),x|=(127&C)<<3,C<128)||(C=m[g.get()],g.increment(),x|=(127&C)<<10,C<128)||(C=m[g.get()],g.increment(),x|=(127&C)<<17,C<128)||(C=m[g.get()],g.increment(),x|=(127&C)<<24,C<128)||(C=m[g.get()],g.increment(),x|=(1&C)<<31,C<128))return 4294967296*x+(h>>>0);throw new Error("Expected varint not more than 10 bytes")})(i,r,e)))))}function jr(r){return r>>>1^-(1&r)}function bs(r){return r>>1n^-(1n&r)}function Xd(r){return r%2==1?(r+1)/-2:r/2}function vy(r,e,i){if(i===void 0){i=0;for(let m=0;m<e;m++)i+=r[m]}let l=new Uint32Array(i),h=0;for(let m=0;m<e;m++){let g=r[m];l.fill(r[m+e],h,h+g),h+=g}return l}function by(r,e,i){if(i===void 0){i=0;for(let m=0;m<e;m++)i+=Number(r[m])}let l=new BigUint64Array(i),h=0;for(let m=0;m<e;m++){let g=Number(r[m]);l.fill(r[m+e],h,h+g),h+=g}return l}function Zx(r,e,i){let l=new Float64Array(i),h=0;for(let m=0;m<e;m++){let g=r[m];l.fill(r[m+e],h,h+g),h+=g}return l}function Wx(r){let e=new Int32Array(r.length);e[0]=jr(r[0]);let i=r.length/4*4,l=1;if(i>=4)for(;l<i-4;l+=4){let h=r[l+1],m=r[l+2],g=r[l+3];e[l]=jr(r[l])+e[l-1],e[l+1]=jr(h)+e[l],e[l+2]=jr(m)+e[l+1],e[l+3]=jr(g)+e[l+2]}for(;l!==r.length;++l)e[l]=jr(r[l])+e[l-1];return e}function Hx(r){let e=new BigInt64Array(r.length);e[0]=bs(r[0]);let i=r.length/4*4,l=1;if(i>=4)for(;l<i-4;l+=4){let h=r[l+1],m=r[l+2],g=r[l+3];e[l]=bs(r[l])+e[l-1],e[l+1]=bs(h)+e[l],e[l+2]=bs(m)+e[l+1],e[l+3]=bs(g)+e[l+2]}for(;l!==e.length;++l)e[l]=bs(r[l])+e[l-1];return e}function wy(r){let e=r.length/4*4,i=1;if(e>=4)for(let l=r[0];i<e-4;i+=4)l=r[i]+=l,l=r[i+1]+=l,l=r[i+2]+=l,l=r[i+3]+=l;for(;i!==r.length;)r[i]+=r[i-1],++i}var Ra,ih,Jp,fl,Tn,Xo,Xx,dp;function ws(r,e){let i=(function(l,h){let m=l[h.get()],g=Object.values(Ra)[m>>4],x=null;switch(g){case Ra.DATA:x={dictionaryType:Object.values(ih)[15&m]};break;case Ra.OFFSET:x={offsetType:Object.values(Jp)[15&m]};break;case Ra.LENGTH:x={lengthType:Object.values(fl)[15&m]}}h.increment();let C=l[h.get()],w=Object.values(pr)[C>>5],A=Object.values(pr)[C>>2&7],M=Object.values(pp)[3&C];h.increment();let N=ts(l,h,2),L=N[0];return{physicalStreamType:g,logicalStreamType:x,logicalLevelTechnique1:w,logicalLevelTechnique2:A,physicalLevelTechnique:M,numValues:L,byteLength:N[1],decompressedCount:L}})(r,e);return i.logicalLevelTechnique1===pr.MORTON?(function(l,h,m){let g=ts(h,m,2);return{physicalStreamType:l.physicalStreamType,logicalStreamType:l.logicalStreamType,logicalLevelTechnique1:l.logicalLevelTechnique1,logicalLevelTechnique2:l.logicalLevelTechnique2,physicalLevelTechnique:l.physicalLevelTechnique,numValues:l.numValues,byteLength:l.byteLength,decompressedCount:l.decompressedCount,numBits:g[0],coordinateShift:g[1]}})(i,r,e):pr.RLE!==i.logicalLevelTechnique1&&pr.RLE!==i.logicalLevelTechnique2||pp.NONE===i.physicalLevelTechnique?i:(function(l,h,m){let g=ts(h,m,2);return{physicalStreamType:l.physicalStreamType,logicalStreamType:l.logicalStreamType,logicalLevelTechnique1:l.logicalLevelTechnique1,logicalLevelTechnique2:l.logicalLevelTechnique2,physicalLevelTechnique:l.physicalLevelTechnique,numValues:l.numValues,byteLength:l.byteLength,decompressedCount:g[1],runs:g[0],numRleValues:g[1]}})(i,r,e)}(function(r){r.PRESENT="PRESENT",r.DATA="DATA",r.OFFSET="OFFSET",r.LENGTH="LENGTH"})(Ra||(Ra={})),(function(r){r.NONE="NONE",r.SINGLE="SINGLE",r.SHARED="SHARED",r.VERTEX="VERTEX",r.MORTON="MORTON",r.FSST="FSST"})(ih||(ih={})),(function(r){r.VERTEX="VERTEX",r.INDEX="INDEX",r.STRING="STRING",r.KEY="KEY"})(Jp||(Jp={})),(function(r){r.VAR_BINARY="VAR_BINARY",r.GEOMETRIES="GEOMETRIES",r.PARTS="PARTS",r.RINGS="RINGS",r.TRIANGLES="TRIANGLES",r.SYMBOL="SYMBOL",r.DICTIONARY="DICTIONARY"})(fl||(fl={})),(function(r){r[r.FLAT=0]="FLAT",r[r.CONST=1]="CONST",r[r.SEQUENCE=2]="SEQUENCE",r[r.DICTIONARY=3]="DICTIONARY",r[r.FSST_DICTIONARY=4]="FSST_DICTIONARY"})(Tn||(Tn={}));class rh{constructor(e,i){this.values=e,this._size=i}get(e){let i=Math.floor(e/8);return(this.values[i]>>e%8&1)==1}set(e,i){let l=Math.floor(e/8);this.values[l]=this.values[l]|(i?1:0)<<e%8}getInt(e){let i=Math.floor(e/8);return this.values[i]>>e%8&1}size(){return this._size}getBuffer(){return this.values}}function Kd(r,e,i){if(!e)return r;let l=e.size(),h=new r.constructor(l),m=0;for(let g=0;g<l;g++)h[g]=e.get(g)?r[m++]:i;return h}function Ty(r,e,i,l,h){return(function(m,g,x,C){let w;switch(g.logicalLevelTechnique1){case pr.DELTA:if(g.logicalLevelTechnique2===pr.RLE){let A=g;if(!C)return(function(M,N,L){let Z=new Int32Array(L),X=0,ie=0;for(let ne=0;ne<N;ne++){let ue=M[ne],se=jr(M[ne+N]);for(let me=0;me<ue;me++)ie+=se,Z[X++]=ie}return Z})(m,A.runs,A.numRleValues);w=Wx(m=vy(m,A.runs,A.numRleValues))}else w=Wx(m);break;case pr.RLE:w=(function(A,M,N){if(N===void 0){N=0;for(let X=0;X<M;X++)N+=A[X]}let L=new Int32Array(N),Z=0;for(let X=0;X<M;X++){let ie=A[X],ne=A[X+M];ne=jr(ne),L.fill(ne,Z,Z+ie),Z+=ie}return L})(m,g.runs,g.numRleValues);break;case pr.MORTON:wy(m),w=new Int32Array(m);break;case pr.COMPONENTWISE_DELTA:w=(function(A){if(A.length<2)return new Int32Array(A);let M=new Int32Array(A.length);M[0]=jr(A[0]),M[1]=jr(A[1]);let N=A.length/4*4,L=2;if(N>=4)for(;L<N-4;L+=4){let Z=A[L+1],X=A[L+2],ie=A[L+3];M[L]=jr(A[L])+M[L-2],M[L+1]=jr(Z)+M[L-1],M[L+2]=jr(X)+M[L],M[L+3]=jr(ie)+M[L+1]}for(;L!==A.length;L+=2)M[L]=jr(A[L])+M[L-2],M[L+1]=jr(A[L+1])+M[L-1];return M})(m);break;case pr.NONE:w=(function(A){let M=new Int32Array(A.length);for(let N=0;N<A.length;N++)M[N]=jr(A[N]);return M})(m);break;default:throw new Error(`The specified Logical level technique is not supported: ${g.logicalLevelTechnique1}`)}return C?Kd(w,C,0):w})(Yd(r,e,i),i,0,h)}function gl(r,e,i,l,h){return(function(m,g,x,C){let w;switch(g.logicalLevelTechnique1){case pr.DELTA:w=(function(A){let M=new Uint32Array(A.length);M[0]=jr(A[0])>>>0;for(let N=1;N<A.length;N++)M[N]=M[N-1]+jr(A[N])>>>0;return M})(g.logicalLevelTechnique2===pr.RLE?vy(m,g.runs,g.numRleValues):m);break;case pr.RLE:w=vy(m,g.runs,g.numRleValues);break;case pr.MORTON:wy(m),w=m;break;case pr.COMPONENTWISE_DELTA:w=(function(A){if(A.length<2)return new Uint32Array(A);let M=new Uint32Array(A.length);M[0]=jr(A[0])>>>0,M[1]=jr(A[1])>>>0;for(let N=2;N<A.length;N+=2)M[N]=M[N-2]+jr(A[N])>>>0,M[N+1]=M[N-1]+jr(A[N+1])>>>0;return M})(m);break;case pr.NONE:w=m;break;default:throw new Error(`The specified Logical level technique is not supported: ${g.logicalLevelTechnique1}`)}return C?Kd(w,C,0):w})(Yd(r,e,i),i,0,h)}function mp(r,e,i){return(function(l,h){if(h.logicalLevelTechnique1===pr.DELTA&&h.logicalLevelTechnique2===pr.NONE)return(function(m){let g=new Int32Array(m.length+1);g[0]=0,g[1]=jr(m[0]);let x=g[1];for(let C=2;C!==g.length;++C)x+=jr(m[C-1]),g[C]=g[C-1]+x;return new Uint32Array(g)})(l);if(h.logicalLevelTechnique1===pr.RLE&&h.logicalLevelTechnique2===pr.NONE)return(function(m,g,x){let C=new Uint32Array(x+1);C[0]=0;let w=1,A=C[0];for(let M=0;M<g;M++){let N=m[M],L=m[M+g];for(let Z=w;Z<w+N;Z++)C[Z]=L+A,A=C[Z];w+=N}return C})(l,h.runs,h.numRleValues);if(h.logicalLevelTechnique1===pr.NONE&&h.logicalLevelTechnique2===pr.NONE){(function(g){let x=0;for(let C=0;C<g.length;C++)g[C]+=x,x=g[C]})(l);let m=new Uint32Array(h.numValues+1);return m[0]=0,m.set(l,1),m}if(h.logicalLevelTechnique1===pr.DELTA&&h.logicalLevelTechnique2===pr.RLE){let m=(function(g,x,C){let w=new Int32Array(C+1);w[0]=0;let A=1,M=w[0];for(let N=0;N<x;N++){let L=g[N],Z=g[N+x];Z=jr(Z);for(let X=A;X<A+L;X++)w[X]=Z+M,M=w[X];A+=L}return w})(l,h.runs,h.numRleValues);return wy(m),new Uint32Array(m)}throw new Error("Only delta encoding is supported for transforming length to offset streams yet.")})(Yd(r,e,i),i)}function Yd(r,e,i){let l=i.physicalLevelTechnique;switch(l){case pp.FAST_PFOR:return(function(h,m,g,x){return(function(C,w,A,M,N){let L=M.get();
2if(3&A)throw new Error(`FastPFOR: invalid encodedByteLength=${A} at offset=${L} (encodedBytes.length=${C.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);let Z=A>>>2,X=(function(ne,ue){if(ue<=ne.encodedWords.length)return ne.encodedWords;let se=new Uint32Array(Math.max(16,2*ue));return ne.encodedWords=se,se})(N,Z);(function(ne,ue,se,me){if(ue<0||se<0||ue+se>ne.length)throw new RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${ue}, byteLength=${se}, bytes.length=${ne.length})`);let be=Math.floor(se/4),Ce=se%4!=0,We=Ce?be+1:be;if(me.length<We)throw new RangeError(`decodeBigEndianInt32sInto: out.length=${me.length} < ${We}`);if(be>0){let Je=ne.byteOffset+ue;if(3&Je)for(let mt=0;mt<be;mt++){let at=ue+4*mt;me[mt]=ne[at]<<24|ne[at+1]<<16|ne[at+2]<<8|ne[at+3]}else{let mt=new Uint32Array(ne.buffer,Je,be);for(let at=0;at<be;at++)me[at]=0|B3(mt[at])}}if(Ce){let Je=ue+4*be,mt=se-4*be,at=0;for(let vt=0;vt<mt;vt++)at|=ne[Je+vt]<<24-8*vt;me[be]=0|at}})(C,L,A,X);let ie=(function(ne,ue,se){let me=0,be=0,Ce=new Uint32Array(ue),We=se??Gx();if(ne.length>0){let Je=0|ne[me];if(me=me+1|0,255&Je)throw new Error(`FastPFOR decode: invalid alignedLength=${Je} (expected multiple of 256)`);if(be+Je>Ce.length)throw new Error(`FastPFOR decode: output buffer too small (outPos=${be}, alignedLength=${Je}, out.length=${Ce.length})`);me=(function(mt,at,vt,bt,yt,lt){let qt=bt+yy(yt,fu),ii=bt,Wt=vt;for(;ii!==qt;){let $t=Math.min(xy,qt-ii);Wt=j3(mt,at,Wt,ii,$t,lt),ii=ii+$t|0}return Wt})(ne,Ce,me,be,Je,We),be=be+Je|0}return(function(Je,mt,at,vt,bt,yt){if(yt===0)return mt;let lt=0,qt=mt,ii=mt+at,Wt=bt,$t=bt,Gi=bt+yt,Tr=0,Ar=0;for(;qt<ii&&$t<Gi;){let Vr=Je[qt]>>>lt&255;if(lt+=8,qt+=lt>>>5,lt&=31,Tr|=(127&Vr)<<Ar,128&Vr)vt[$t++]=0|Tr,Tr=0,Ar=0;else if(Ar+=7,Ar>28)throw new Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${Ar}, partial=${Tr}, decoded=${$t-Wt}/${yt}, inPos=${qt}, inEnd=${ii})`)}if($t!==Gi)throw new Error(`FastPFOR VByte: truncated stream (decoded=${$t-Wt}, expected=${yt}, consumedWords=${qt-mt}/${at}, vbyteStart=${mt}, vbyteEnd=${ii})`)})(ne,me,ne.length-me|0,Ce,be,ue-be|0),Ce})(X.subarray(0,Z),w,N.decoderWorkspace);return M.add(A),ie})(h,m,g,x,(function(C=16){if(C<0)throw new RangeError(`initialEncodedWordCapacity must be >= 0, got ${C}`);let w=Math.max(16,0|C);return{encodedWords:new Uint32Array(w),decoderWorkspace:Gx()}})(g>>>2))})(r,i.numValues,i.byteLength,e);case pp.VARINT:return ts(r,e,i.numValues);case pp.NONE:{let h=e.get();e.add(i.byteLength);let m=r.subarray(h,e.get());return new Uint32Array(m)}default:throw new Error(`Specified physicalLevelTechnique ${l} is not supported (yet).`)}}function Sy(r,e,i){let l=Yd(r,e,i);return l.length===1?l[0]:(function(h){return h[1]})(l)}function Kx(r,e,i){return(function(l){if(l.length===2){let h=jr(l[1]);return[h,h]}return[jr(l[2]),jr(l[3])]})(Yd(r,e,i))}function Yx(r,e,i){return(function(l){if(l.length===2){let h=bs(l[1]);return[h,h]}return[bs(l[2]),bs(l[3])]})(Hd(r,e,i.numValues))}function Jx(r,e,i,l){return(function(h,m,g){let x;switch(m.logicalLevelTechnique1){case pr.DELTA:x=(function(C){let w=new BigUint64Array(C.length);w[0]=BigInt.asUintN(64,bs(C[0]));for(let A=1;A<C.length;A++)w[A]=BigInt.asUintN(64,w[A-1]+bs(C[A]));return w})(m.logicalLevelTechnique2===pr.RLE?by(h,m.runs,m.numRleValues):h);break;case pr.RLE:x=by(h,m.runs,m.numRleValues);break;case pr.NONE:x=h;break;default:throw new Error(`The specified Logical level technique is not supported: ${m.logicalLevelTechnique1}`)}return g?Kd(x,g,0n):x})(Hd(r,e,i.numValues),i,l)}function Qx(r,e,i){let l=Hd(r,e,i.numValues);return l.length===1?l[0]:(function(h){return h[1]})(l)}function pg(r,e,i,l,h="int32"){let m=r.logicalLevelTechnique1;if(m===pr.RLE)return r.runs===1?Tn.CONST:Tn.FLAT;if(m!==pr.DELTA||r.logicalLevelTechnique2!==pr.RLE)return r.numValues===1?Tn.CONST:Tn.FLAT;let g=e instanceof rh?e.size():e;if(r.numRleValues!==g)return Tn.FLAT;if(r.runs===1)return Tn.SEQUENCE;if(r.runs!==2)return r.numValues===1?Tn.CONST:Tn.FLAT;let x=l.get();if(r.physicalLevelTechnique===pp.VARINT)return(function(A,M,N){let L=new $x(M.get());if(N==="int64"){let X=Hd(A,L,4);return X[2]===2n&&X[3]===2n}let Z=ts(A,L,4);return Z[2]===2&&Z[3]===2})(i,l,h)?Tn.SEQUENCE:r.numValues===1?Tn.CONST:Tn.FLAT;let C=l.get(),w=new Int32Array(i.buffer,i.byteOffset+C,4);return l.set(x),w[2]===2&&w[3]===2?Tn.SEQUENCE:r.numValues===1?Tn.CONST:Tn.FLAT}class ev extends ug{getValueFromBuffer(e){return this.dataBuffer[e]}}class tv extends qx{constructor(e,i,l,h){super(e,BigInt64Array.of(i),l,h)}getValueFromBuffer(e){return this.dataBuffer[0]+BigInt(e)*this.delta}}function Iy(r,e,i){return{x:iv(r,e)-i,y:iv(r>>1,e)-i}}function iv(r,e){let i=0;for(let l=0;l<e;l++)i|=(r&1<<2*l)>>l;return i}function Jd(r,e,i,l,h,m,g){return r===dp.MORTON?(function(x,C,w,A,M,N){let L=new Array(M?A+1:A);for(let Z=0;Z<A;Z++){let X=Iy(x[C[w+Z]],N.numBits,N.coordinateShift);L[Z]=new pe(X.x,X.y)}return M&&(L[L.length-1]=L[0]),L})(e,i,l,h,m,g):(function(x,C,w,A,M){let N=new Array(M?A+1:A);for(let L=0;L<2*A;L+=2){let Z=2*C[w+L/2];N[L/2]=new pe(x[Z],x[Z+1])}return M&&(N[N.length-1]=N[0]),N})(e,i,l,h,m)}function Qd(r,e,i,l){let h=new Array(l?i+1:i);for(let m=0;m<2*i;m+=2)h[m/2]=new pe(r[e+m],r[e+m+1]);return l&&(h[h.length-1]=h[0]),h}(function(r){r[r.POINT=0]="POINT",r[r.LINESTRING=1]="LINESTRING",r[r.POLYGON=2]="POLYGON",r[r.MULTIPOINT=3]="MULTIPOINT",r[r.MULTILINESTRING=4]="MULTILINESTRING",r[r.MULTIPOLYGON=5]="MULTIPOLYGON"})(Xo||(Xo={})),(function(r){r[r.POINT=0]="POINT",r[r.LINESTRING=1]="LINESTRING",r[r.POLYGON=2]="POLYGON"})(Xx||(Xx={})),(function(r){r[r.MORTON=0]="MORTON",r[r.VEC_2=1]="VEC_2",r[r.VEC_3=2]="VEC_3"})(dp||(dp={}));class rv{constructor(e,i,l,h,m){this._vertexBufferType=e,this._topologyVector=i,this._vertexOffsets=l,this._vertexBuffer=h,this._mortonSettings=m}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}getSimpleEncodedVertex(e){let i=this.vertexOffsets?2*this.vertexOffsets[e]:2*e;return[this.vertexBuffer[i],this.vertexBuffer[i+1]]}getVertex(e){if(this.vertexOffsets&&this.mortonSettings){let l=Iy(this.vertexBuffer[this.vertexOffsets[e]],this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[l.x,l.y]}let i=this.vertexOffsets?2*this.vertexOffsets[e]:2*e;return[this.vertexBuffer[i],this.vertexBuffer[i+1]]}getGeometries(){return(function(e){let i=new Array(e.numGeometries),l=1,h=1,m=1,g=0,x=0,C=0,w=e.mortonSettings,A=e.topologyVector,M=A.geometryOffsets,N=A.partOffsets,L=A.ringOffsets,Z=e.vertexOffsets,X=!Z||Z.length===0,ie=e.containsPolygonGeometry(),ne=e.vertexBuffer;for(let ue=0;ue<e.numGeometries;ue++)switch(e.geometryType(ue)){case Xo.POINT:{let se,me;if(X)se=ne[x++],me=ne[x++];else if(e.vertexBufferType===dp.MORTON){let be=Iy(ne[Z[C++]],w.numBits,w.coordinateShift);se=be.x,me=be.y}else{let be=2*Z[C++];se=ne[be],me=ne[be+1]}i[g++]=[[new pe(se,me)]],M&&m++,N&&l++,L&&h++}break;case Xo.MULTIPOINT:{let se=M[m]-M[m-1];m++;let me=new Array(se);if(X)for(let be=0;be<se;be++){let Ce=ne[x++],We=ne[x++];me[be]=new pe(Ce,We)}else for(let be=0;be<se;be++){let Ce=2*Z[C++];me[be]=new pe(ne[Ce],ne[Ce+1])}i[g++]=me.map((be=>[be])),l+=se,h+=se}break;case Xo.LINESTRING:{let se,me;ie?(se=L[h]-L[h-1],h++):se=N[l]-N[l-1],l++,X?(me=Qd(ne,x,se,!1),x+=2*se):(me=Jd(e.vertexBufferType,ne,Z,C,se,!1,w),C+=se),i[g++]=[me],M&&m++}break;case Xo.POLYGON:{let se=N[l]-N[l-1];l++;let me=new Array(se-1),be,Ce=L[h]-L[h-1];if(h++,X){be=Qd(ne,x,Ce,!0),x+=2*Ce;for(let We=0;We<me.length;We++)Ce=L[h]-L[h-1],h++,me[We]=Qd(ne,x,Ce,!0),x+=2*Ce}else{be=Jd(e.vertexBufferType,ne,Z,C,Ce,!0,w),C+=Ce;for(let We=0;We<me.length;We++)Ce=L[h]-L[h-1],h++,me[We]=Jd(e.vertexBufferType,ne,Z,C,Ce,!0,w),C+=Ce}
2i[g++]=[be].concat(me),M&&m++}break;case Xo.MULTILINESTRING:{let se=M[m]-M[m-1];m++;let me=new Array(se);for(let be=0;be<se;be++){let Ce;if(ie?(Ce=L[h]-L[h-1],h++):Ce=N[l]-N[l-1],l++,X)me[be]=Qd(ne,x,Ce,!1),x+=2*Ce;else{let We=Jd(e.vertexBufferType,ne,Z,C,Ce,!1,w);me[be]=We,C+=Ce}}i[g++]=me}break;case Xo.MULTIPOLYGON:{let se=M[m]-M[m-1];m++;let me=new Array(se);for(let be=0;be<se;be++){let Ce=N[l]-N[l-1],We;l++;let Je=new Array(Ce-1),mt=L[h]-L[h-1];h++,X?(We=Qd(ne,x,mt,!0),x+=2*mt):(We=Jd(e.vertexBufferType,ne,Z,C,mt,!0,w),C+=mt);for(let at=0;at<Je.length;at++){let vt=L[h]-L[h-1];h++,X?(Je[at]=Qd(ne,x,vt,!0),x+=2*vt):(Je[at]=Jd(e.vertexBufferType,ne,Z,C,vt,!0,w),C+=vt)}me[be]=[We].concat(Je)}i[g++]=me.flat()}break;default:throw new Error("The specified geometry type is currently not supported.")}return i})(this)}get mortonSettings(){return this._mortonSettings}}class nv extends rv{constructor(e,i,l,h,m,g,x){super(l,h,m,g,x),this._numGeometries=e,this._geometryType=i}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===Xo.POLYGON||this._geometryType===Xo.MULTIPOLYGON}containsSingleGeometryType(){return!0}}class ov extends rv{constructor(e,i,l,h,m,g){super(e,l,h,m,g),this._geometryTypes=i}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let e=0;e<this.numGeometries;e++)if(this.geometryType(e)===Xo.POLYGON||this.geometryType(e)===Xo.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}}class av{constructor(e,i,l,h){this._triangleOffsets=e,this._indexBuffer=i,this._vertexBuffer=l,this._topologyVector=h}get triangleOffsets(){return this._triangleOffsets}get indexBuffer(){return this._indexBuffer}get vertexBuffer(){return this._vertexBuffer}get topologyVector(){return this._topologyVector}getGeometries(){if(!this._topologyVector)throw new Error("Cannot convert GpuVector to coordinates without topology information");let e=new Array(this.numGeometries),i=this._topologyVector,l=i.partOffsets,h=i.ringOffsets,m=i.geometryOffsets,g=0,x=1,C=1,w=1;for(let A=0;A<this.numGeometries;A++)switch(this.geometryType(A)){case Xo.POLYGON:{let M=l[x]-l[x-1];x++;let N=[];for(let L=0;L<M;L++){let Z=h[C]-h[C-1];C++;let X=[];for(let ie=0;ie<Z;ie++){let ne=this._vertexBuffer[g++],ue=this._vertexBuffer[g++];X.push(new pe(ne,ue))}X.length>0&&X.push(X[0]),N.push(X)}e[A]=N,m&&w++}break;case Xo.MULTIPOLYGON:{let M=m[w]-m[w-1];w++;let N=[];for(let L=0;L<M;L++){let Z=l[x]-l[x-1];x++;for(let X=0;X<Z;X++){let ie=h[C]-h[C-1];C++;let ne=[];for(let ue=0;ue<ie;ue++){let se=this._vertexBuffer[g++],me=this._vertexBuffer[g++];ne.push(new pe(se,me))}ne.length>0&&ne.push(ne[0]),N.push(ne)}}e[A]=N}}return e}[Symbol.iterator](){return null}}function sv(r,e,i,l,h,m){return new Z3(r,e,i,l,h,m)}class Z3 extends av{constructor(e,i,l,h,m,g){super(l,h,m,g),this._numGeometries=e,this._geometryType=i}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}}function lv(r,e,i,l,h){return new W3(r,e,i,l,h)}class W3 extends av{constructor(e,i,l,h,m){super(i,l,h,m),this._geometryTypes=e}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}}function H3(r,e,i,l,h){let m=ws(r,i),g,x,C,w;if(pg(m,l,r,i)===Tn.CONST){let ue=Sy(r,i,m),se,me,be,Ce;for(let We=0;We<e-1;We++){let Je=ws(r,i);switch(Je.physicalStreamType){case Ra.LENGTH:switch(Je.logicalStreamType.lengthType){case fl.GEOMETRIES:se=mp(r,i,Je);break;case fl.PARTS:me=mp(r,i,Je);break;case fl.RINGS:be=mp(r,i,Je);break;case fl.TRIANGLES:Ce=mp(r,i,Je)}break;case Ra.OFFSET:switch(Je.logicalStreamType.offsetType){case Jp.VERTEX:g=gl(r,i,Je);break;case Jp.INDEX:w=gl(r,i,Je)}break;case Ra.DATA:ih.VERTEX===Je.logicalStreamType.dictionaryType?x=Ty(r,i,Je):(C={numBits:Je.numBits,coordinateShift:Je.coordinateShift},x=gl(r,i,Je))}}return w?se!==void 0||me!==void 0?sv(l,ue,Ce,w,x,{geometryOffsets:se,partOffsets:me,ringOffsets:be}):sv(l,ue,Ce,w,x):C===void 0?(function(We,Je,mt,at,vt){return new nv(We,Je,dp.VEC_2,mt,at,vt)})(l,ue,{geometryOffsets:se,partOffsets:me,ringOffsets:be},g,x):(function(We,Je,mt,at,vt,bt){return new nv(We,Je,dp.MORTON,mt,at,vt,bt)})(l,ue,{geometryOffsets:se,partOffsets:me,ringOffsets:be},g,x,C)}let A=gl(r,i,m),M,N,L,Z,X,ie,ne;for(let ue=0;ue<e-1;ue++){let se=ws(r,i);switch(se.physicalStreamType){case Ra.LENGTH:switch(se.logicalStreamType.lengthType){case fl.GEOMETRIES:M=gl(r,i,se);break;case fl.PARTS:N=gl(r,i,se);break;case fl.RINGS:L=gl(r,i,se);break;case fl.TRIANGLES:Z=mp(r,i,se)}break;case Ra.OFFSET:switch(se.logicalStreamType.offsetType){case Jp.VERTEX:g=gl(r,i,se);break;case Jp.INDEX:w=gl(r,i,se)}break;case Ra.DATA:ih.VERTEX===se.logicalStreamType.dictionaryType?x=Ty(r,i,se):(C={numBits:se.numBits,coordinateShift:se.coordinateShift},x=gl(r,i,se))}}return M?(X=Cy(A,M,2),N&&L?(ie=cv(A,X,N,!1),ne=(function(ue,se,me,be){let Ce=new Uint32Array(me[me.length-1]+1),We=0;Ce[0]=We;let Je=1,mt=1,at=0;for(let vt=0;vt<ue.length;vt++){let bt=ue[vt],yt=se[vt+1]-se[vt];if(bt!==0&&bt!==3)for(let lt=0;lt<yt;lt++){let qt=me[Je]-me[Je-1];Je++;for(let ii=0;ii<qt;ii++)We=Ce[mt++]=We+be[at++]}else for(let lt=0;lt<yt;lt++)Ce[mt++]=++We,Je++}return Ce})(A,X,ie,L)):N&&(ie=(function(ue,se,me){let be=new Uint32Array(se[se.length-1]+1),Ce=0;be[0]=Ce;let We=1,Je=0;for(let mt=0;mt<ue.length;mt++){let at=ue[mt],vt=se[mt+1]-se[mt];
2if(at===4||at===1)for(let bt=0;bt<vt;bt++)Ce=be[We++]=Ce+me[Je++];else for(let bt=0;bt<vt;bt++)be[We++]=++Ce}return be})(A,X,N))):N&&L?(ie=Cy(A,N,1),ne=cv(A,ie,L,!0)):N&&(ie=Cy(A,N,0)),w&&!ie?lv(A,Z,w,x):w?lv(A,Z,w,x,{geometryOffsets:X,partOffsets:ie,ringOffsets:ne}):C===void 0?(function(ue,se,me,be){return new ov(dp.VEC_2,ue,se,me,be)})(A,{geometryOffsets:X,partOffsets:ie,ringOffsets:ne},g,x):(function(ue,se,me,be,Ce){return new ov(dp.MORTON,ue,se,me,be,Ce)})(A,{geometryOffsets:X,partOffsets:ie,ringOffsets:ne},g,x,C)}function Cy(r,e,i){let l=new Uint32Array(r.length+1),h=0;l[0]=h;let m=0;for(let g=0;g<r.length;g++)h=l[g+1]=h+(r[g]>i?e[m++]:1);return l}function cv(r,e,i,l){let h=new Uint32Array(e[e.length-1]+1),m=0;h[0]=m;let g=1,x=0;for(let C=0;C<r.length;C++){let w=r[C],A=e[C+1]-e[C];if(w===5||w===2||l&&(w===4||w===1))for(let M=0;M<A;M++)m=h[g++]=m+i[x++];else for(let M=0;M<A;M++)h[g++]=++m}return h}class X3 extends Wd{constructor(e,i,l){super(e,i.getBuffer(),l),this.dataVector=i}getValueFromBuffer(e){return this.dataVector.get(e)}}class K3 extends ug{getValueFromBuffer(e){return this.dataBuffer[e]}}class hv extends Wd{constructor(e,i,l,h){super(e,h?BigInt64Array.of(i):BigUint64Array.of(i),l)}getValueFromBuffer(e){return this.dataBuffer[0]}}function Nm(r,e,i,l,h){let m=(function(g,x,C,w){let A=new Uint8Array(x),M=0,N=w.get()+C;for(;M<x&&!(w.get()>=N);){let L=g[w.increment()];if(L<=127){let Z=L+3,X=g[w.increment()],ie=Math.min(M+Z,x);A.fill(X,M,ie),M=ie}else{let Z=256-L;for(let X=0;X<Z&&M<x;X++)A[M++]=g[w.increment()]}}return w.set(N),A})(r,Math.ceil(e/8),i,l);return h?(function(g,x,C){if(!C)return g;let w=C.size(),A=new rh(g,x),M=new rh(new Uint8Array(Math.ceil(w/8)),w),N=0;for(let L=0;L<w;L++){let Z=!!C.get(L)&&A.get(N++);M.set(L,Z)}return M.getBuffer()})(m,e,h):m}let Y3=new TextDecoder;function Ey(r,e,i){return i-e>=12?Y3.decode(r.subarray(e,i)):(function(l,h,m){let g="",x=h;for(;x<m;){let C=l[x],w,A,M,N=null,L=C>239?4:C>223?3:C>191?2:1;if(x+L>m)break;L===1?C<128&&(N=C):L===2?(w=l[x+1],(192&w)==128&&(N=(31&C)<<6|63&w,N<=127&&(N=null))):L===3?(w=l[x+1],A=l[x+2],(192&w)==128&&(192&A)==128&&(N=(15&C)<<12|(63&w)<<6|63&A,(N<=2047||N>=55296&&N<=57343)&&(N=null))):L===4&&(w=l[x+1],A=l[x+2],M=l[x+3],(192&w)==128&&(192&A)==128&&(192&M)==128&&(N=(15&C)<<18|(63&w)<<12|(63&A)<<6|63&M,(N<=65535||N>=1114112)&&(N=null))),N===null?(N=65533,L=1):N>65535&&(N-=65536,g+=String.fromCharCode(N>>>10&1023|55296),N=56320|1023&N),g+=String.fromCharCode(N),x+=L}return g})(r,e,i)}class My extends Wd{constructor(e,i,l,h){super(e,l,h),this.offsetBuffer=i}}class uv extends My{constructor(e,i,l,h){super(e,i,l,h??i.length-1)}getValueFromBuffer(e){return Ey(this.dataBuffer,this.offsetBuffer[e],this.offsetBuffer[e+1])}}class em extends My{constructor(e,i,l,h,m){super(e,l,h,m??i.length),this.indexBuffer=i,this.indexBuffer=i}getValueFromBuffer(e){let i=this.indexBuffer[e];return Ey(this.dataBuffer,this.offsetBuffer[i],this.offsetBuffer[i+1])}}class pv extends My{constructor(e,i,l,h,m,g,x){super(e,l,h,x),this.indexBuffer=i,this.symbolOffsetBuffer=m,this.symbolTableBuffer=g}getValueFromBuffer(e){this.decodedDictionary==null&&(this.symbolLengthBuffer==null&&(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer)),this.decodedDictionary=(function(l,h,m){let g=[],x=new Array(h.length).fill(0);for(let C=1;C<h.length;C++)x[C]=x[C-1]+h[C-1];for(let C=0;C<m.length;C++)if(m[C]===255)g.push(m[++C]);else{let w=h[m[C]],A=x[m[C]];for(let M=0;M<w;M++)g.push(l[A+M])}return new Uint8Array(g)})(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer));let i=this.indexBuffer[e];return Ey(this.decodedDictionary,this.offsetBuffer[i],this.offsetBuffer[i+1])}offsetToLengthBuffer(e){let i=new Uint32Array(e.length-1),l=e[0];for(let h=1;h<e.length;h++){let m=e[h];i[h-1]=m-l,l=m}return i}}function J3(r,e,i,l,h,m){return i.type==="scalarType"?(function(g,x,C,w,A,M){let N=null;if(g===0)return null;if(M.nullable){let Z=ws(x,C),X=Z.numValues,ie=C.get(),ne=Nm(x,X,Z.byteLength,C);C.set(ie+Z.byteLength),N=new rh(ne,Z.numValues)}let L=N??w;switch(A.physicalType){case 4:case 3:return(function(Z,X,ie,ne,ue){let se=ws(Z,X),me=pg(se,ue,Z,X),be=ne.physicalType===3;if(me===Tn.FLAT){let We=Um(ue)?ue:void 0,Je=be?Ty(Z,X,se,0,We):gl(Z,X,se,0,We);return new py(ie.name,Je,ue)}if(me===Tn.SEQUENCE){let We=Kx(Z,X,se);return new my(ie.name,We[0],We[1],se.numRleValues)}let Ce=be?(function(We,Je,mt){let at=Yd(We,Je,mt);return at.length===1?jr(at[0]):(function(vt){return jr(vt[1])})(at)}
2)(Z,X,se):Sy(Z,X,se);return new fy(ie.name,Ce,ue,be)})(x,C,M,A,L);case 9:return(function(Z,X,ie,ne,ue){let se=null,me=null,be=null,Ce=null,We=null,Je=ue??null,mt=null,at=null;for(let vt=0;vt<ne;vt++){let bt=ws(X,ie);switch(bt.physicalStreamType){case Ra.PRESENT:{let yt=Nm(X,bt.numValues,bt.byteLength,ie),lt=new rh(yt,bt.numValues);Je=ue??lt;break}case Ra.OFFSET:me=gl(X,ie,bt,0,Je);break;case Ra.LENGTH:{let yt=mp(X,ie,bt);fl.DICTIONARY===bt.logicalStreamType.lengthType?se=yt:fl.SYMBOL===bt.logicalStreamType.lengthType?Ce=yt:mt=yt;break}case Ra.DATA:{let yt=X.subarray(ie.get(),ie.get()+bt.byteLength);ie.add(bt.byteLength);let lt=bt.logicalStreamType.dictionaryType;ih.FSST===lt?We=yt:ih.SINGLE===lt||ih.SHARED===lt?be=yt:ih.NONE===lt&&(at=yt);break}}}return(function(vt,bt,yt,lt,qt,ii,Wt){return bt?new pv(vt,yt,lt,qt,ii,bt,Wt):null})(Z,We,me,se,be,Ce,Je)??(function(vt,bt,yt,lt,qt){return bt?qt?new em(vt,yt,lt,bt,qt):new em(vt,yt,lt,bt):null})(Z,be,me,se,Je)??(function(vt,bt,yt,lt,qt){if(!bt||!yt)return null;if(lt)return qt?new em(vt,lt,bt,yt,qt):new em(vt,lt,bt,yt);if(qt&&qt.size()!==bt.length-1){let ii=new Uint32Array(qt.size()),Wt=0;for(let $t=0;$t<qt.size();$t++)ii[$t]=qt.get($t)?Wt++:0;return new em(vt,ii,bt,yt,qt)}return qt?new uv(vt,bt,yt,qt):new uv(vt,bt,yt)})(Z,mt,at,me,Je)})(M.name,x,C,M.nullable?g-1:g,N);case 0:return(function(Z,X,ie,ne,ue){let se=ws(Z,X),me=se.numValues,be=X.get(),Ce=Um(ue)?ue:void 0,We=Nm(Z,me,se.byteLength,X,Ce);X.set(be+se.byteLength);let Je=new rh(We,me);return new X3(ie.name,Je,ue)})(x,C,M,0,L);case 6:case 5:return(function(Z,X,ie,ne,ue){let se=ws(Z,X),me=pg(se,ne,Z,X,"int64"),be=ue.physicalType===5;if(me===Tn.FLAT){let We=Um(ne)?ne:void 0,Je=be?(function(mt,at,vt,bt){return(function(yt,lt,qt){let ii;switch(lt.logicalLevelTechnique1){case pr.DELTA:if(lt.logicalLevelTechnique2===pr.RLE){let Wt=lt;if(!qt)return(function($t,Gi,Tr){let Ar=new BigInt64Array(Tr),Vr=0,Ba=0n;for(let Gn=0;Gn<Gi;Gn++){let Ao=Number($t[Gn]),Ko=bs($t[Gn+Gi]);for(let Sn=0;Sn<Ao;Sn++)Ba+=Ko,Ar[Vr++]=Ba}return Ar})(yt,Wt.runs,Wt.numRleValues);ii=Hx(yt=by(yt,Wt.runs,Wt.numRleValues))}else ii=Hx(yt);break;case pr.RLE:ii=(function(Wt,$t,Gi){if(Gi===void 0){Gi=0;for(let Vr=0;Vr<$t;Vr++)Gi+=Number(Wt[Vr])}let Tr=new BigInt64Array(Gi),Ar=0;for(let Vr=0;Vr<$t;Vr++){let Ba=Number(Wt[Vr]),Gn=Wt[Vr+$t];Gn=bs(Gn),Tr.fill(Gn,Ar,Ar+Ba),Ar+=Ba}return Tr})(yt,lt.runs,lt.numRleValues);break;case pr.NONE:ii=(function(Wt){let $t=new BigInt64Array(Wt.length);for(let Gi=0;Gi<Wt.length;Gi++)$t[Gi]=bs(Wt[Gi]);return $t})(yt);break;default:throw new Error(`The specified Logical level technique is not supported: ${lt.logicalLevelTechnique1}`)}return qt?Kd(ii,qt,0n):ii})(Hd(mt,at,vt.numValues),vt,bt)})(Z,X,se,We):Jx(Z,X,se,We);return new ev(ie.name,Je,ne)}if(me===Tn.SEQUENCE){let We=Yx(Z,X,se);return new tv(ie.name,We[0],We[1],se.numRleValues)}let Ce=be?(function(We,Je,mt){let at=Hd(We,Je,mt.numValues);return at.length===1?bs(at[0]):(function(vt){return bs(vt[1])})(at)})(Z,X,se):Qx(Z,X,se);return new hv(ie.name,Ce,ne,be)})(x,C,M,L,A);case 7:return(function(Z,X,ie,ne){let ue=ws(Z,X),se=Um(ne)?ne:void 0,me=(function(be,Ce,We,Je){let mt=Ce.get(),at=mt+We*Float32Array.BYTES_PER_ELEMENT,vt=new Uint8Array(be.subarray(mt,at)).buffer,bt=new Float32Array(vt);return Ce.set(at),Je?Kd(bt,Je,0):bt})(Z,X,ue.numValues,se);return new K3(ie.name,me,ne)})(x,C,M,L);case 8:return(function(Z,X,ie,ne){let ue=ws(Z,X),se=Um(ne)?ne:void 0,me=(function(be,Ce,We,Je){let mt=Ce.get(),at=mt+We*Float64Array.BYTES_PER_ELEMENT,vt=new Uint8Array(be.subarray(mt,at)).buffer,bt=new Float64Array(vt);return Ce.set(at),Je?Kd(bt,Je,0):bt})(Z,X,ue.numValues,se);return new dy(ie.name,me,ne)})(x,C,M,L);default:throw new Error(`The specified data type for the field is currently not supported: ${A}`)}})(l,r,e,h,i.scalarType,i):l===0?null:(function(g,x,C,w){let A=null,M=null,N=null,L=null,Z=!1;for(;!Z;){let ue=ws(g,x);switch(ue.physicalStreamType){case Ra.LENGTH:fl.DICTIONARY===ue.logicalStreamType.lengthType?A=mp(g,x,ue):N=mp(g,x,ue);break;case Ra.DATA:ih.SINGLE===ue.logicalStreamType.dictionaryType||ih.SHARED===ue.logicalStreamType.dictionaryType?(M=g.subarray(x.get(),x.get()+ue.byteLength),Z=!0):L=g.subarray(x.get(),x.get()+ue.byteLength),x.add(ue.byteLength)}}
2let X=C.complexType.children,ie=[],ne=0;for(let ue of X){let se=ts(g,x,1)[0];if(se===0)continue;let me=ue.name?`${C.name}${ue.name}`:C.name;if(se!==2||ue.type!=="scalarField"||ue.scalarField.physicalType!==9)throw new Error("Currently only optional string fields are implemented for a struct.");let be=ws(g,x),Ce=Nm(g,be.numValues,be.byteLength,x),We=ws(g,x),Je=gl(g,x,We,0,We.decompressedCount!==w?new rh(Ce,be.numValues):void 0);ie[ne++]=L?new pv(me,Je,A,M,N,L,new rh(Ce,be.numValues)):new em(me,Je,A,M,new rh(Ce,be.numValues))}return ie})(r,e,i,h)}function Um(r){return r instanceof rh}function dv(r){switch(r){case 0:case 1:case 2:case 3:{let e={};e.nullable=!!(1&r),e.columnScope=0;let i={type:"logicalType",logicalType:0};return i.longID=!!(2&r),e.scalarType=i,e.type="scalarType",e}case 4:{let e={nullable:!1,columnScope:0},i={type:"physicalType",physicalType:0};return e.type="complexType",e.complexType=i,e}case 30:{let e={nullable:!1,columnScope:0},i={type:"physicalType",physicalType:1};return e.type="complexType",e.complexType=i,e}default:return(function(e){let i;switch(e){case 10:case 11:i=0;break;case 12:case 13:i=1;break;case 14:case 15:i=2;break;case 16:case 17:i=3;break;case 18:case 19:i=4;break;case 20:case 21:i=5;break;case 22:case 23:i=6;break;case 24:case 25:i=7;break;case 26:case 27:i=8;break;case 28:case 29:i=9;break;default:return null}let l={};l.nullable=!!(1&e),l.columnScope=0;let h={type:"physicalType"};return h.physicalType=i,l.type="scalarType",l.scalarType=h,l})(r)}}function mv(r){return r>=10}function fv(r){return r===30}function Q3(r){if(r.type==="scalarType"){let e=r.scalarType;if(e.type==="physicalType")switch(e.physicalType){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:default:return!1;case 9:return!0}if(e.type==="logicalType")return!1}else if(r.type==="complexType"){let e=r.complexType;if(e.type==="physicalType")switch(e.physicalType){case 0:case 1:return!0;default:return!1}}return console.warn("Unexpected column type in hasStreamCount",r),!1}function eT(r){return r.type==="complexType"&&r.complexType?.type==="physicalType"&&r.complexType.physicalType===0}let tT=new TextDecoder;function Py(r,e){let i=ts(r,e,1)[0];if(i===0)return"";let l=e.get(),h=r.subarray(l,l+i);return e.add(i),tT.decode(h)}function gv(r,e){let i=ts(r,e,1)[0]>>>0;if(i<10||i>30)throw new Error(`Unsupported field type code ${i}. Supported: 10-29(scalars), 30(STRUCT)`);let l=dv(i);if(mv(i)&&(l.name=Py(r,e)),fv(i)){let h=ts(r,e,1)[0]>>>0;l.complexType.children=new Array(h);for(let m=0;m<h;m++)l.complexType.children[m]=gv(r,e)}return(function(h){return{name:h.name,nullable:h.nullable,scalarField:h.scalarType,complexField:h.complexType,type:h.type==="scalarType"?"scalarField":"complexField"}})(l)}function iT(r,e){let i=ts(r,e,1)[0]>>>0,l=dv(i);if(!l)throw new Error(`Unsupported column type code ${i}. Supported: 0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT)`);if(mv(i)?l.name=Py(r,e):i>=0&&i<=3?l.name="id":i===4&&(l.name="geometry"),fv(i)){let h=ts(r,e,1)[0]>>>0,m=l.complexType;m.children=new Array(h);for(let g=0;g<h;g++)m.children[g]=gv(r,e)}return l}function rT(r,e){let i={featureTables:[]},l={};l.name=Py(r,e);let h=ts(r,e,1)[0]>>>0,m=ts(r,e,1)[0]>>>0;l.columns=new Array(m);for(let g=0;g<m;g++)l.columns[g]=iT(r,e);return i.featureTables.push(l),[i,h]}function nT(r,e,i,l,h,m,g=!1){let x=e.scalarType;if(!x||x.type!=="logicalType"||x.logicalType!==0)throw new Error(`ID column must be a logical ID scalar type: ${l}`);let C=x.longID?6:4,w=typeof m=="number"?void 0:m,A=pg(h,m,r,i,C===6?"int64":"int32");if(C===4)switch(A){case Tn.FLAT:{let M=gl(r,i,h,0,w);return new py(l,M,m)}case Tn.SEQUENCE:{let M=Kx(r,i,h);return new my(l,M[0],M[1],h.numRleValues)}case Tn.CONST:{let M=Sy(r,i,h);return new fy(l,M,m,!1)}}switch(A){case Tn.FLAT:{if(g){let N=(function(L,Z,X){let ie=(function(ne,ue,se){let me=new Float64Array(se);for(let be=0;be<se;be++)me[be]=G3(ne,ue);return me})(L,Z,X.numValues);return(function(ne,ue){switch(ue.logicalLevelTechnique1){case pr.DELTA:return ue.logicalLevelTechnique2===pr.RLE&&(ne=Zx(ne,ue.runs,ue.numRleValues)),(function(se){se[0]=Xd(se[0]);let me=se.length/4*4,be=1;
2if(me>=4)for(;be<me-4;be+=4){let Ce=se[be+1],We=se[be+2],Je=se[be+3];se[be]=Xd(se[be])+se[be-1],se[be+1]=Xd(Ce)+se[be],se[be+2]=Xd(We)+se[be+1],se[be+3]=Xd(Je)+se[be+2]}for(;be!==se.length;++be)se[be]=Xd(se[be])+se[be-1]})(ne),ne;case pr.RLE:return(function(se,me){return Zx(se,me.runs,me.numRleValues)})(ne,ue);case pr.NONE:return ne;default:throw new Error(`The specified Logical level technique is not supported: ${ue.logicalLevelTechnique1}`)}})(ie,X)})(r,i,h);return new dy(l,N,m)}let M=Jx(r,i,h,w);return new ev(l,M,m)}case Tn.SEQUENCE:{let M=Yx(r,i,h);return new tv(l,M[0],M[1],h.numRleValues)}case Tn.CONST:{let M=Qx(r,i,h);return new hv(l,M,m,!1)}}throw new Error("Vector type not supported for id column.")}class oT{constructor(e,i){var l;switch(this._featureData=e,this.properties=this._featureData.properties||{},(l=this._featureData.geometry)===null||l===void 0?void 0:l.type){case Xo.POINT:case Xo.MULTIPOINT:this.type=1;break;case Xo.LINESTRING:case Xo.MULTILINESTRING:this.type=2;break;case Xo.POLYGON:case Xo.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=i,this.id=Number(this._featureData.id)}loadGeometry(){let e=[];for(let i of this._featureData.geometry.coordinates){let l=[];for(let h of i)l.push(new pe(h.x,h.y));e.push(l)}return e}}class aT{constructor(e){this.features=[],this.featureTable=e,this.name=e.name,this.extent=e.extent,this.version=2,this.features=e.getFeatures(),this.length=this.features.length}feature(e){return new oT(this.features[e],this.extent)}}class _v{constructor(e){this.layers={};let i=(function(l,h,m=!0){let g=new $x(0),x=[];for(;g.get()<l.length;){let w=ts(l,g,1)[0]>>>0,A=g.get()+w;if(A>l.length)throw new Error(`Block overruns tile: ${A} > ${l.length}`);if(ts(l,g,1)[0]>>>0!=1){g.set(A);continue}let[M,N]=rT(l,g),L=M.featureTables[0],Z=null,X=null,ie=[],ne=0;for(let se of L.columns){let me=se.name;if((C=se).type==="scalarType"&&C.scalarType?.type==="logicalType"&&C.scalarType.logicalType===0){let be=null;if(se.nullable){let We=ws(l,g),Je=g.get(),mt=Nm(l,We.numValues,We.byteLength,g);g.set(Je+We.byteLength),be=new rh(mt,We.numValues)}let Ce=ws(l,g);ne=be?be.size():Ce.decompressedCount,Z=nT(l,se,g,me,Ce,be??ne,m)}else if(eT(se)){let be=ts(l,g,1)[0];if(ne===0){let Ce=g.get();ne=ws(l,g).decompressedCount,g.set(Ce)}X=H3(l,be,g,ne)}else{let be=Q3(se)?ts(l,g,1)[0]:1;if(be===0)continue;let Ce=J3(l,g,se,be,ne);if(Ce)if(Array.isArray(Ce))for(let We of Ce)ie.push(We);
vendor: 21,352 bytes, line 2
2else ie.push(Ce)}}let ue=new F3(L.name,X,Z,ie,N);x.push(ue),g.set(A)}var C;return x})(new Uint8Array(e));this.layers=i.reduce(((l,h)=>Object.assign(Object.assign({},l),{[h.name]:new aT(h)})),{})}}class sT{constructor(e,i){this.feature=e,this.type=e.type,this.properties=e.tags?e.tags:{},this.extent=i,"id"in e&&(typeof e.id=="string"?this.id=parseInt(e.id,10):typeof e.id!="number"||isNaN(e.id)||(this.id=e.id))}loadGeometry(){let e=[],i=this.feature.type===1?[this.feature.geometry]:this.feature.geometry;for(let l of i){let h=[];for(let m of l)h.push(new pe(m[0],m[1]));e.push(h)}return e}}let jm="_geojsonTileLayer";function lT(r,e,i=""){e.writeVarintField(15,r.version||1),e.writeStringField(1,r.name||""),e.writeVarintField(5,r.extent||4096);let l={jsonPrefix:i,keys:[],values:[],keycache:{},valuecache:{}};for(let g=0;g<r.length;g++)l.feature=r.feature(g),e.writeMessage(2,cT,l);let h=l.keys;for(let g of h)e.writeStringField(3,g);let m=l.values;for(let g of m)e.writeMessage(4,pT,g)}function cT(r,e){if(!r.feature)return;let i=r.feature;i.id!==void 0&&e.writeVarintField(1,i.id),e.writeMessage(2,hT,r),e.writeVarintField(3,i.type),e.writeMessage(4,uT,i)}function hT(r,e){for(let i in r.feature?.properties){let l=r.feature.properties[i],h=r.keycache[i];if(l==null)continue;h===void 0&&(r.keys.push(i),h=r.keys.length-1,r.keycache[i]=h),e.writeVarint(h),typeof l!="string"&&typeof l!="boolean"&&typeof l!="number"&&(l=r.jsonPrefix+JSON.stringify(l));let m=typeof l+":"+l,g=r.valuecache[m];g===void 0&&(r.values.push(l),g=r.values.length-1,r.valuecache[m]=g),e.writeVarint(g)}}function ky(r,e){return(e<<3)+(7&r)}function yv(r){return r<<1^r>>31}function uT(r,e){let i=r.loadGeometry(),l=r.type,h=0,m=0;for(let g of i){let x=1;l===1&&(x=g.length),e.writeVarint(ky(1,x));let C=l===3?g.length-1:g.length;for(let w=0;w<C;w++){w===1&&l!==1&&e.writeVarint(ky(2,C-1));let A=g[w].x-h,M=g[w].y-m;e.writeVarint(yv(A)),e.writeVarint(yv(M)),h+=A,m+=M}r.type===3&&e.writeVarint(ky(7,1))}}function pT(r,e){let i=typeof r;i==="string"?e.writeStringField(1,r):i==="boolean"?e.writeBooleanField(7,r):i==="number"&&(r%1!=0?e.writeDoubleField(3,r):r<0?e.writeSVarintField(6,r):e.writeVarintField(5,r))}class xv{constructor(e,i){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new hn(pi,16,0),this.grid3D=new hn(pi,16,0),this.featureIndexArray=new _e,this.promoteId=i}insert(e,i,l,h,m,g){let x=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(l,h,m);let C=g?this.grid3D:this.grid;for(let w of i){let A=[1/0,1/0,-1/0,-1/0];for(let M of w)A[0]=Math.min(A[0],M.x),A[1]=Math.min(A[1],M.y),A[2]=Math.max(A[2],M.x),A[3]=Math.max(A[3],M.y);A[0]<pi&&A[1]<pi&&A[2]>=0&&A[3]>=0&&C.insert(x,A[0],A[1],A[2],A[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=this.encoding!=="mlt"?new Lm(new Xp(this.rawTileData)).layers:new _v(this.rawTileData).layers,this.sourceLayerCoder=new Ux(this.vtLayers?Object.keys(this.vtLayers).sort():[jm])),this.vtLayers}query(e,i,l,h){this.loadVTLayers();let m=e.params,g=pi/e.tileSize/e.scale,x=Ca(m.filter,m.globalState),C=e.queryGeometry,w=e.queryPadding*g,A=Yp.fromPoints(C),M=this.grid.query(A.minX-w,A.minY-w,A.maxX+w,A.maxY+w),N=Yp.fromPoints(e.cameraQueryGeometry).expandBy(w),L=this.grid3D.query(N.minX,N.minY,N.maxX,N.maxY,((ie,ne,ue,se)=>(function(me,be,Ce,We,Je){for(let at of me)if(be<=at.x&&Ce<=at.y&&We>=at.x&&Je>=at.y)return!0;let mt=[new pe(be,Ce),new pe(be,Je),new pe(We,Je),new pe(We,Ce)];if(me.length>2){for(let at of mt)if(ju(me,at))return!0}for(let at=0;at<me.length-1;at++)if(jf(me[at],me[at+1],mt))return!0;return!1})(e.cameraQueryGeometry,ie-w,ne-w,ue+w,se+w)));for(let ie of L)M.push(ie);M.sort(dT);let Z={},X;for(let ie of M){if(ie===X)continue;X=ie;let ne=this.featureIndexArray.get(ie),ue=null;this.loadMatchingFeature(Z,ne.bucketIndex,ne.sourceLayerIndex,ne.featureIndex,x,m.layers,m.availableImages,i,l,h,((se,me,be)=>(ue||(ue=xc(se)),me.queryIntersectsFeature({queryGeometry:C,feature:se,featureState:be,geometry:ue,zoom:this.z,transform:e.transform,pixelsToTileUnits:g,pixelPosMatrix:e.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:e.getElevation}))))}return Z}loadMatchingFeature(e,i,l,h,m,g,x,C,w,A,M){let N=this.bucketLayerIDs[i];if(g&&!N.some((ie=>g.has(ie))))return;let L=this.sourceLayerCoder.decode(l),Z=this.vtLayers[L].feature(h);if(m.needGeometry){let ie=vc(Z,!0);if(!m.filter(new wr(this.tileID.overscaledZ),ie,this.tileID.canonical))return}else if(!m.filter(new wr(this.tileID.overscaledZ),Z))return;let X=this.getId(Z,L);for(let ie of N){if(g&&!g.has(ie))continue;let ne=C[ie];if(!ne)continue;let ue={};X&&A&&(ue=A.getState(ne.sourceLayer||jm,X));let se=Dr({},w[ie]);se.paint=vv(se.paint,ne.paint,Z,ue,x),se.layout=vv(se.layout,ne.layout,Z,ue,x);let me=!M||M(Z,ne,ue);if(!me)continue;let be=new jx(Z,this.z,this.x,this.y,X);be.layer=se;let Ce=e[ie];Ce===void 0&&(Ce=e[ie]=[]),Ce.push({featureIndex:h,feature:be,intersectionZ:me})}}lookupSymbolFeatures(e,i,l,h,m,g,x,C){let w={};this.loadVTLayers();let A=Ca(m.filterSpec,m.globalState);for(let M of e)this.loadMatchingFeature(w,l,h,M,A,g,x,C,i);return w}hasLayer(e){for(let i of this.bucketLayerIDs)for(let l of i)if(e===l)return!0;return!1}getId(e,i){var l;let h=e.id;return this.promoteId&&(h=e.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[i]],typeof h=="boolean"&&(h=Number(h)),h===void 0&&(!((l=e.properties)===null||l===void 0)&&l.cluster)&&this.promoteId&&(h=Number(e.properties.cluster_id))),h}}function vv(r,e,i,l,h){return Do(r,((m,g)=>{let x=e instanceof Ph?e.get(g):null;return x?.evaluate?x.evaluate(i,l,h):x}))}function dT(r,e){return e-r}function bv(r,e,i,l,h){let m=[];for(let g of r){let x;for(let C=0;C<g.length-1;C++){let w=g[C],A=g[C+1];w.x<e&&A.x<e||(w.x<e?w=new pe(e,w.y+(e-w.x)/(A.x-w.x)*(A.y-w.y))._round():A.x<e&&(A=new pe(e,w.y+(e-w.x)/(A.x-w.x)*(A.y-w.y))._round()),w.y<i&&A.y<i||(w.y<i?w=new pe(w.x+(i-w.y)/(A.y-w.y)*(A.x-w.x),i)._round():A.y<i&&(A=new pe(w.x+(i-w.y)/(A.y-w.y)*(A.x-w.x),i)._round()),w.x>=l&&A.x>=l||(w.x>=l?w=new pe(l,w.y+(l-w.x)/(A.x-w.x)*(A.y-w.y))._round():A.x>=l&&(A=new pe(l,w.y+(l-w.x)/(A.x-w.x)*(A.y-w.y))._round()),w.y>=h&&A.y>=h||(w.y>=h?w=new pe(w.x+(h-w.y)/(A.y-w.y)*(A.x-w.x),h)._round():A.y>=h&&(A=new pe(w.x+(h-w.y)/(A.y-w.y)*(A.x-w.x),h)._round()),x&&w.equals(x[x.length-1])||(x=[w],m.push(x)),x.push(A)))))}}return m}function wv(r,e,i,l,h){switch(e){case 1:return(function(m,g,x,C){let w=[];for(let A of m)for(let M of A){let N=C===0?M.x:M.y;N>=g&&N<=x&&w.push([M])}return w})(r,i,l,h);case 2:return Tv(r,i,l,h,!1);case 3:return Tv(r,i,l,h,!0)}return[]}function mT(r,e,i,l,h){let m=l===0?fT:gT,g=[],x=[];for(let A=0;A<r.length-1;A++){let M=r[A],N=r[A+1],L=l===0?M.x:M.y,Z=l===0?N.x:N.y,X=!1;L<e?Z>e&&g.push(m(M,N,e)):L>i?Z<i&&g.push(m(M,N,i)):g.push(M),Z<e&&L>=e&&(g.push(m(M,N,e)),X=!0),Z>i&&L<=i&&(g.push(m(M,N,i)),X=!0),!h&&X&&(x.push(g),g=[])}let C=r.length-1,w=l===0?r[C].x:r[C].y;return w>=e&&w<=i&&g.push(r[C]),h&&g.length>0&&!g[0].equals(g[g.length-1])&&g.push(new pe(g[0].x,g[0].y)),g.length>0&&x.push(g),x}function Tv(r,e,i,l,h){let m=[];for(let g of r){let x=mT(g,e,i,l,h);x.length>0&&m.push(...x)}return m}function fT(r,e,i){return new pe(i,r.y+(i-r.x)/(e.x-r.x)*(e.y-r.y))}function gT(r,e,i){return new pe(r.x+(i-r.y)/(e.y-r.y)*(e.x-r.x),i)}Qt("FeatureIndex",xv,{omit:["rawTileData","sourceLayerCoder"]});class fp extends pe{constructor(e,i,l,h){super(e,i),this.angle=l,h!==void 0&&(this.segment=h)}clone(){return new fp(this.x,this.y,this.angle,this.segment)}}function Sv(r,e,i,l,h){if(e.segment===void 0||i===0)return!0;let m=e,g=e.segment+1,x=0;for(;x>-i/2;){if(g--,g<0)return!1;x-=r[g].dist(m),m=r[g]}x+=r[g].dist(r[g+1]),g++;let C=[],w=0;for(;x<i/2;){let A=r[g],M=r[g+1];if(!M)return!1;let N=r[g-1].angleTo(A)-A.angleTo(M);for(N=Math.abs((N+3*Math.PI)%(2*Math.PI)-Math.PI),C.push({distance:x,angleDelta:N}),w+=N;x-C[0].distance>l;)w-=C.shift().angleDelta;if(w>h)return!1;g++,x+=A.dist(M)}return!0}function Iv(r){let e=0;for(let i=0;i<r.length-1;i++)e+=r[i].dist(r[i+1]);return e}function Cv(r,e,i){return r?.6*e*i:0}function Ev(r,e){return Math.max(r?r.right-r.left:0,e?e.right-e.left:0)}function _T(r,e,i,l,h,m){let g=Cv(i,h,m),x=Ev(i,l)*m,C=0,w=Iv(r)/2;for(let A=0;A<r.length-1;A++){let M=r[A],N=r[A+1],L=M.dist(N);if(C+L>w){let Z=(w-C)/L,X=lo.number(M.x,N.x,Z),ie=lo.number(M.y,N.y,Z),ne=new fp(X,ie,N.angleTo(M),A);return ne._round(),!g||Sv(r,ne,x,g,e)?ne:void 0}C+=L}}function yT(r,e,i,l,h,m,g,x,C){let w=Cv(l,m,g),A=Ev(l,h),M=A*g,N=r[0].x===0||r[0].x===C||r[0].y===0||r[0].y===C;return e-M<e/4&&(e=M+e/4),Mv(r,N?e/2*x%e:(A/2+2*m)*g*x%e,e,w,i,M,N,!1,C)}function Mv(r,e,i,l,h,m,g,x,C){let w=m/2,A=Iv(r),M=0,N=e-i,L=[];for(let Z=0;Z<r.length-1;Z++){let X=r[Z],ie=r[Z+1],ne=X.dist(ie),ue=ie.angleTo(X);for(;N+i<M+ne;){N+=i;let se=(N-M)/ne,me=lo.number(X.x,ie.x,se),be=lo.number(X.y,ie.y,se);if(me>=0&&me<C&&be>=0&&be<C&&N-w>=0&&N+w<=A){let Ce=new fp(me,be,ue,Z);Ce._round(),l&&!Sv(r,Ce,m,l,h)||L.push(Ce)}}M+=ne}return x||L.length||g||(L=Mv(r,M/2,i,l,h,m,g,!0,C)),L}function Pv(r,e,i,l){let h=[],m=r.image,g=m.pixelRatio,x=m.paddedRect.w-2,C=m.paddedRect.h-2,w={x1:r.left,y1:r.top,x2:r.right,y2:r.bottom},A=m.stretchX||[[0,x]],M=m.stretchY||[[0,C]],N=(lt,qt)=>lt+qt[1]-qt[0],L=A.reduce(N,0),Z=M.reduce(N,0),X=x-L,ie=C-Z,ne=0,ue=L,se=0,me=Z,be=0,Ce=X,We=0,Je=ie;if(m.content&&l){let lt=m.content,qt=lt[2]-lt[0],ii=lt[3]-lt[1];(m.textFitWidth||m.textFitHeight)&&(w=Ix(r)),ne=dg(A,0,lt[0]),se=dg(M,0,lt[1]),ue=dg(A,lt[0],lt[2]),me=dg(M,lt[1],lt[3]),be=lt[0]-ne,We=lt[1]-se,Ce=qt-ue,Je=ii-me}let mt=w.x1,at=w.y1,vt=w.x2-mt,bt=w.y2-at,yt=(lt,qt,ii,Wt)=>{let $t=mg(lt.stretch-ne,ue,vt,mt),Gi=fg(lt.fixed-be,Ce,lt.stretch,L),Tr=mg(qt.stretch-se,me,bt,at),Ar=fg(qt.fixed-We,Je,qt.stretch,Z),Vr=mg(ii.stretch-ne,ue,vt,mt),Ba=fg(ii.fixed-be,Ce,ii.stretch,L),Gn=mg(Wt.stretch-se,me,bt,at),Ao=fg(Wt.fixed-We,Je,Wt.stretch,Z),Ko=new pe($t,Tr),Sn=new pe(Vr,Tr),ua=new pe(Vr,Gn),is=new pe($t,Gn),rs=new pe(Gi/g,Ar/g),$s=new pe(Ba/g,Ao/g),Oa=e*Math.PI/180;if(Oa){let Yo=Math.sin(Oa),Rn=Math.cos(Oa),mo=[Rn,-Yo,Yo,Rn];Ko._matMult(mo),Sn._matMult(mo),is._matMult(mo),ua._matMult(mo)}let Gs=lt.stretch+lt.fixed,Sc=qt.stretch+qt.fixed;return{tl:Ko,tr:Sn,bl:is,br:ua,tex:{x:m.paddedRect.x+1+Gs,y:m.paddedRect.y+1+Sc,w:ii.stretch+ii.fixed-Gs,h:Wt.stretch+Wt.fixed-Sc},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:rs,pixelOffsetBR:$s,minFontScaleX:Ce/g/vt,minFontScaleY:Je/g/bt,isSDF:i}};if(l&&(m.stretchX||m.stretchY)){let lt=kv(A,X,L),qt=kv(M,ie,Z);for(let ii=0;ii<lt.length-1;ii++){let Wt=lt[ii],$t=lt[ii+1];for(let Gi=0;Gi<qt.length-1;Gi++)h.push(yt(Wt,qt[Gi],$t,qt[Gi+1]))}}else h.push(yt({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:x+1},{fixed:0,stretch:C+1}));return h}function dg(r,e,i){let l=0;for(let h of r)l+=Math.max(e,Math.min(i,h[1]))-Math.max(e,Math.min(i,h[0]));return l}function kv(r,e,i){let l=[{fixed:-1,stretch:0}];for(let[h,m]of r){let g=l[l.length-1];l.push({fixed:h-g.stretch,stretch:g.stretch}),l.push({fixed:h-g.stretch,stretch:g.stretch+(m-h)})}return l.push({fixed:e+1,stretch:i}),l}function mg(r,e,i,l){return r/e*i+l}function fg(r,e,i,l){return r-e*i/l}Qt("Anchor",fp);class gg{constructor(e,i,l,h,m,g,x,C,w,A){var M;if(this.boxStartIndex=e.length,w){let N=g.top,L=g.bottom,Z=g.collisionPadding;Z&&(N-=Z[1],L+=Z[3]);let X=L-N;X>0&&(X=Math.max(10,X),this.circleDiameter=X)}else{let N=!((M=g.image)===null||M===void 0)&&M.content&&(g.image.textFitWidth||g.image.textFitHeight)?Ix(g):{x1:g.left,y1:g.top,x2:g.right,y2:g.bottom};N.y1=N.y1*x-C[0],N.y2=N.y2*x+C[2],N.x1=N.x1*x-C[3],N.x2=N.x2*x+C[1];let L=g.collisionPadding;if(L&&(N.x1-=L[0]*x,N.y1-=L[1]*x,N.x2+=L[2]*x,N.y2+=L[3]*x),A){let Z=new pe(N.x1,N.y1),X=new pe(N.x2,N.y1),ie=new pe(N.x1,N.y2),ne=new pe(N.x2,N.y2),ue=A*Math.PI/180;Z._rotate(ue),X._rotate(ue),ie._rotate(ue),ne._rotate(ue),N.x1=Math.min(Z.x,X.x,ie.x,ne.x),N.x2=Math.max(Z.x,X.x,ie.x,ne.x),N.y1=Math.min(Z.y,X.y,ie.y,ne.y),N.y2=Math.max(Z.y,X.y,ie.y,ne.y)}e.emplaceBack(i.x,i.y,N.x1,N.y1,N.x2,N.y2,l,h,m)}this.boxEndIndex=e.length}}class xT{constructor(e=[],i=(l,h)=>l<h?-1:l>h?1:0){if(this.data=e,this.length=this.data.length,this.compare=i,this.length>0)for(let l=(this.length>>1)-1;l>=0;l--)this._down(l)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],i=this.data.pop();return--this.length>0&&(this.data[0]=i,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:i,compare:l}=this,h=i[e];for(;e>0;){let m=e-1>>1,g=i[m];if(l(h,g)>=0)break;i[e]=g,e=m}i[e]=h}_down(e){let{data:i,compare:l}=this,h=this.length>>1,m=i[e];for(;e<h;){let g=1+(e<<1),x=g+1;if(x<this.length&&l(i[x],i[g])<0&&(g=x),l(i[g],m)>=0)break;i[e]=i[g],e=g}i[e]=m}}function vT(r,e=1){let i=Yp.fromPoints(r[0]),l=Math.min(i.width(),i.height()),h=l/2,m=new xT([],bT),{minX:g,minY:x,maxX:C,maxY:w}=i;if(l===0)return new pe(g,x);for(let N=g;N<C;N+=l)for(let L=x;L<w;L+=l)m.push(new tm(N+h,L+h,h,r));let A=(function(N){let L=0,Z=0,X=0,ie=N[0];for(let ne=0,ue=ie.length,se=ue-1;ne<ue;se=ne++){let me=ie[ne],be=ie[se],Ce=me.x*be.y-be.x*me.y;Z+=(me.x+be.x)*Ce,X+=(me.y+be.y)*Ce,L+=3*Ce}return new tm(Z/L,X/L,0,N)})(r),M=A;for(;m.length;){let N=m.pop();(N.d>M.d||!M.d)&&(M=N),N.max-M.d<=e||(h=N.h/2,m.push(new tm(N.p.x-h,N.p.y-h,h,r)),m.push(new tm(N.p.x+h,N.p.y-h,h,r)),m.push(new tm(N.p.x-h,N.p.y+h,h,r)),m.push(new tm(N.p.x+h,N.p.y+h,h,r)))}return A.d>0&&M.d-A.d<=e?A.p:M.p}function bT(r,e){return e.max-r.max}class tm{constructor(e,i,l,h){this.p=new pe(e,i),this.h=l,this.d=(function(m,g){let x=!1,C=1/0;for(let w of g)for(let A=0,M=w.length,N=M-1;A<M;N=A++){let L=w[A],Z=w[N];L.y>m.y!=Z.y>m.y&&m.x<(Z.x-L.x)*(m.y-L.y)/(Z.y-L.y)+L.x&&(x=!x),C=Math.min(C,Nf(m,L,Z))}return(x?1:-1)*Math.sqrt(C)})(this.p,h),this.max=this.d+this.h*Math.SQRT2}}var Fa;V.aM=void 0,(Fa=V.aM||(V.aM={}))[Fa.center=1]="center",Fa[Fa.left=2]="left",Fa[Fa.right=3]="right",Fa[Fa.top=4]="top",Fa[Fa.bottom=5]="bottom",Fa[Fa["top-left"]=6]="top-left",Fa[Fa["top-right"]=7]="top-right",Fa[Fa["bottom-left"]=8]="bottom-left",Fa[Fa["bottom-right"]=9]="bottom-right";let Ay=Number.POSITIVE_INFINITY;function Av(r,e){return e[1]!==Ay?(function(i,l,h){let m=0,g=0;switch(l=Math.abs(l),h=Math.abs(h),i){case"top-right":case"top-left":case"top":g=h-7;break;case"bottom-right":case"bottom-left":case"bottom":g=7-h}switch(i){case"top-right":case"bottom-right":case"right":m=-l;break;case"top-left":case"bottom-left":case"left":m=l}return[m,g]})(r,e[0],e[1]):(function(i,l){let h=0,m=0;l<0&&(l=0);let g=l/Math.SQRT2;switch(i){case"top-right":case"top-left":m=g-7;break;case"bottom-right":case"bottom-left":m=7-g;break;case"bottom":m=7-l;break;case"top":m=l-7}switch(i){case"top-right":case"bottom-right":h=-g;break;case"top-left":case"bottom-left":h=g;break;case"left":h=l;break;case"right":h=-l}return[h,m]})(r,e[0])}function zv(r,e,i){var l;let h=r.layout,m=(l=h.get("text-variable-anchor-offset"))===null||l===void 0?void 0:l.evaluate(e,{},i);if(m){let x=m.values,C=[];for(let w=0;w<x.length;w+=2){let A=C[w]=x[w],M=x[w+1].map((N=>N*Jr));A.startsWith("top")?M[1]-=7:A.startsWith("bottom")&&(M[1]+=7),C[w+1]=M}return new Xi(C)}let g=h.get("text-variable-anchor");if(g){let x;x=r._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[h.get("text-radial-offset").evaluate(e,{},i)*Jr,Ay]:h.get("text-offset").evaluate(e,{},i).map((w=>w*Jr));let C=[];for(let w of g)C.push(w,Av(w,x));return new Xi(C)}return null}function zy(r){switch(r){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function wT(r,e,i,l,h,m,g,x,C,w,A,M){let N=m.textMaxSize.evaluate(e,{});N===void 0&&(N=g);let L=r.layers[0].layout,Z=L.get("icon-offset").evaluate(e,{},A),X=Lv(i.horizontal),ie=g/24,ne=r.tilePixelRatio*ie,ue=r.tilePixelRatio*N/24,se=r.tilePixelRatio*x,me=r.tilePixelRatio*L.get("symbol-spacing"),be=L.get("text-padding")*r.tilePixelRatio,Ce=(function(ii,Wt,$t,Gi=1){let Tr=ii.get("icon-padding").evaluate(Wt,{},$t),Ar=Tr?.values;return[Ar[0]*Gi,Ar[1]*Gi,Ar[2]*Gi,Ar[3]*Gi]})(L,e,A,r.tilePixelRatio),We=L.get("text-max-angle")/180*Math.PI,Je=L.get("text-rotation-alignment")!=="viewport"&&L.get("symbol-placement")!=="point",mt=L.get("icon-rotation-alignment")==="map"&&L.get("symbol-placement")!=="point",at=L.get("symbol-placement"),vt=me/2,bt=L.get("icon-text-fit"),yt;l&&bt!=="none"&&(r.allowVerticalPlacement&&i.vertical&&(yt=Cx(l,i.vertical,bt,L.get("icon-text-fit-padding"),Z,ie)),X&&(l=Cx(l,X,bt,L.get("icon-text-fit-padding"),Z,ie)));let lt=A?M.line.getGranularityForZoomLevel(A.z):1,qt=(ii,Wt)=>{Wt.x<0||Wt.x>=pi||Wt.y<0||Wt.y>=pi||(function($t,Gi,Tr,Ar,Vr,Ba,Gn,Ao,Ko,Sn,ua,is,rs,$s,Oa,Gs,Sc,Yo,Rn,mo,Zn,Jo,gu,nh,qm){let gp=$t.addToLineVertexArray(Gi,Tr),Qp,im,rm,nm,Rv=0,Fv=0,Bv=0,Ov=0,Dy=-1,Ly=-1,_u={},Vv=uo("");if($t.allowVerticalPlacement&&Ar.vertical){let ns=Ao.layout.get("text-rotate").evaluate(Zn,{},nh)+90;rm=new gg(Ko,Gi,Sn,ua,is,Ar.vertical,rs,$s,Oa,ns),Gn&&(nm=new gg(Ko,Gi,Sn,ua,is,Gn,Sc,Yo,Oa,ns))}if(Vr){let ns=Ao.layout.get("icon-rotate").evaluate(Zn,{}),Hl=Ao.layout.get("icon-text-fit")!=="none",ed=Pv(Vr,ns,gu,Hl),ah=Gn?Pv(Gn,ns,gu,Hl):void 0;im=new gg(Ko,Gi,Sn,ua,is,Vr,Sc,Yo,!1,ns),Rv=4*ed.length;let td=$t.iconSizeData,Uh=null;td.kind==="source"?(Uh=[mu*Ao.layout.get("icon-size").evaluate(Zn,{})],Uh[0]>hp&&Gr(`${$t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):td.kind==="composite"&&(Uh=[mu*Jo.compositeIconSizes[0].evaluate(Zn,{},nh),mu*Jo.compositeIconSizes[1].evaluate(Zn,{},nh)],(Uh[0]>hp||Uh[1]>hp)&&Gr(`${$t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),$t.addSymbols($t.icon,ed,Uh,mo,Rn,Zn,V.ax.none,Gi,gp.lineStartIndex,gp.lineLength,-1,nh),Dy=$t.icon.placedSymbolArray.length-1,ah&&(Fv=4*ah.length,$t.addSymbols($t.icon,ah,Uh,mo,Rn,Zn,V.ax.vertical,Gi,gp.lineStartIndex,gp.lineLength,-1,nh),Ly=$t.icon.placedSymbolArray.length-1)}let Nv=Object.keys(Ar.horizontal);for(let ns of Nv){let Hl=Ar.horizontal[ns];if(!Qp){Vv=uo(Hl.text);let ah=Ao.layout.get("text-rotate").evaluate(Zn,{},nh);Qp=new gg(Ko,Gi,Sn,ua,is,Hl,rs,$s,Oa,ah)}let ed=Hl.positionedLines.length===1;if(Bv+=Dv($t,Gi,Hl,Ba,Ao,Oa,Zn,Gs,gp,Ar.vertical?V.ax.horizontal:V.ax.horizontalOnly,ed?Nv:[ns],_u,Dy,Jo,nh),ed)break}Ar.vertical&&(Ov+=Dv($t,Gi,Ar.vertical,Ba,Ao,Oa,Zn,Gs,gp,V.ax.vertical,["vertical"],_u,Ly,Jo,nh));let ST=Qp?Qp.boxStartIndex:$t.collisionBoxArray.length,IT=Qp?Qp.boxEndIndex:$t.collisionBoxArray.length,CT=rm?rm.boxStartIndex:$t.collisionBoxArray.length,ET=rm?rm.boxEndIndex:$t.collisionBoxArray.length,MT=im?im.boxStartIndex:$t.collisionBoxArray.length,PT=im?im.boxEndIndex:$t.collisionBoxArray.length,kT=nm?nm.boxStartIndex:$t.collisionBoxArray.length,AT=nm?nm.boxEndIndex:$t.collisionBoxArray.length,oh=-1,_g=(ns,Hl)=>ns?.circleDiameter?Math.max(ns.circleDiameter,Hl):Hl;oh=_g(Qp,oh),oh=_g(rm,oh),oh=_g(im,oh),oh=_g(nm,oh);let Uv=oh>-1?1:0;Uv&&(oh*=qm/Jr),$t.glyphOffsetArray.length>=Gd.MAX_GLYPHS&&Gr("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Zn.sortKey!==void 0&&$t.addToSortKeyRanges($t.symbolInstances.length,Zn.sortKey);let zT=zv(Ao,Zn,nh),[DT,LT]=(function(ns,Hl){let ed=ns.length,ah=Hl?.values;if(ah?.length>0)for(let td=0;td<ah.length;td+=2){let Uh=ah[td+1];ns.emplaceBack(V.aM[ah[td]],Uh[0],Uh[1])}return[ed,ns.length]})($t.textAnchorOffsets,zT);$t.symbolInstances.emplaceBack(Gi.x,Gi.y,_u.right>=0?_u.right:-1,_u.center>=0?_u.center:-1,_u.left>=0?_u.left:-1,_u.vertical||-1,Dy,Ly,Vv,ST,IT,CT,ET,MT,PT,kT,AT,Sn,Bv,Ov,Rv,Fv,Uv,0,rs,oh,DT,LT)})(r,Wt,ii,i,l,h,yt,r.layers[0],r.collisionBoxArray,e.index,e.sourceLayerIndex,r.index,ne,[be,be,be,be],Je,C,se,Ce,mt,Z,e,m,w,A,g)};if(at==="line")for(let ii of bv(e.geometry,0,0,pi,pi)){let Wt=th(ii,lt),$t=yT(Wt,me,We,i.vertical||X,l,24,ue,r.overscaling,pi);for(let Gi of $t)X&&TT(r,X.text,vt,Gi)||qt(Wt,Gi)}else if(at==="line-center"){for(let ii of e.geometry)if(ii.length>1){let Wt=th(ii,lt),$t=_T(Wt,We,i.vertical||X,l,24,ue);$t&&qt(Wt,$t)}}else if(e.type==="Polygon")for(let ii of zs(e.geometry,0)){let Wt=vT(ii,16);qt(th(ii[0],lt,!0),new fp(Wt.x,Wt.y,0))}else if(e.type==="LineString")for(let ii of e.geometry){let Wt=th(ii,lt);qt(Wt,new fp(Wt[0].x,Wt[0].y,0))}else if(e.type==="Point")for(let ii of e.geometry)for(let Wt of ii)qt([Wt],new fp(Wt.x,Wt.y,0))}function Dv(r,e,i,l,h,m,g,x,C,w,A,M,N,L,Z){let X=(function(ue,se,me,be,Ce,We,Je,mt){let at=be.layout.get("text-rotate").evaluate(We,{})*Math.PI/180,vt=[];for(let bt of se.positionedLines)for(let yt of bt.positionedGlyphs){if(!yt.rect)continue;let lt=yt.rect||{},qt=4,ii=!0,Wt=1,$t=0,Gi=(Ce||mt)&&yt.vertical,Tr=yt.metrics.advance*yt.scale/2;if(mt&&se.verticalizable&&($t=bt.lineOffset/2-(yt.imageName?-(Jr-yt.metrics.width*yt.scale)/2:(yt.scale-1)*Jr)),yt.imageName){let Yo=Je[yt.imageName];ii=Yo.sdf,Wt=Yo.pixelRatio,qt=1/Wt}let Ar=Ce?[yt.x+Tr,yt.y]:[0,0],Vr=Ce?[0,0]:[yt.x+Tr+me[0],yt.y+me[1]-$t],Ba=[0,0];Gi&&(Ba=Vr,Vr=[0,0]);let Gn=yt.metrics.isDoubleResolution?2:1,Ao=(yt.metrics.left-qt)*yt.scale-Tr+Vr[0],Ko=(-yt.metrics.top-qt)*yt.scale+Vr[1],Sn=Ao+lt.w/Gn*yt.scale/Wt,ua=Ko+lt.h/Gn*yt.scale/Wt,is=new pe(Ao,Ko),rs=new pe(Sn,Ko),$s=new pe(Ao,ua),Oa=new pe(Sn,ua);if(Gi){let Yo=new pe(-Tr,Tr- -17),Rn=-Math.PI/2,mo=12-Tr,Zn=new pe(22-mo,-(yt.imageName?mo:0)),Jo=new pe(...Ba);
2is._rotateAround(Rn,Yo)._add(Zn)._add(Jo),rs._rotateAround(Rn,Yo)._add(Zn)._add(Jo),$s._rotateAround(Rn,Yo)._add(Zn)._add(Jo),Oa._rotateAround(Rn,Yo)._add(Zn)._add(Jo)}if(at){let Yo=Math.sin(at),Rn=Math.cos(at),mo=[Rn,-Yo,Yo,Rn];is._matMult(mo),rs._matMult(mo),$s._matMult(mo),Oa._matMult(mo)}let Gs=new pe(0,0),Sc=new pe(0,0);vt.push({tl:is,tr:rs,bl:$s,br:Oa,tex:lt,writingMode:se.writingMode,glyphOffset:Ar,sectionIndex:yt.sectionIndex,isSDF:ii,pixelOffsetTL:Gs,pixelOffsetBR:Sc,minFontScaleX:0,minFontScaleY:0})}return vt})(0,i,x,h,m,g,l,r.allowVerticalPlacement),ie=r.textSizeData,ne=null;ie.kind==="source"?(ne=[mu*h.layout.get("text-size").evaluate(g,{})],ne[0]>hp&&Gr(`${r.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):ie.kind==="composite"&&(ne=[mu*L.compositeTextSizes[0].evaluate(g,{},Z),mu*L.compositeTextSizes[1].evaluate(g,{},Z)],(ne[0]>hp||ne[1]>hp)&&Gr(`${r.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),r.addSymbols(r.text,X,ne,x,m,g,w,e,C.lineStartIndex,C.lineLength,N,Z);for(let ue of A)M[ue]=r.text.placedSymbolArray.length-1;return 4*X.length}function Lv(r){for(let e in r)return r[e];return null}function TT(r,e,i,l){let h=r.compareText;if(e in h){let m=h[e];for(let g=m.length-1;g>=0;g--)if(l.dist(m[g])<i)return!0}else h[e]=[];return h[e].push(l),!1}V.$=xa,V.A=Ut,V.B=Pa,V.C=na,V.D=mi,V.E=vn,V.F=Lr,V.G=function([r,e,i]){return e+=90,e*=Math.PI/180,i*=Math.PI/180,{x:r*Math.cos(e)*Math.sin(i),y:r*Math.sin(e)*Math.sin(i),z:r*Math.cos(i)}},V.H=lo,V.I=$d,V.J=wr,V.K=Co,V.L=function(r){if(Xn==null){let e=r.navigator?r.navigator.userAgent:null;Xn=!!r.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return Xn},V.M=Zr,V.N=class{constructor(r,e){this.target=r,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new L3((()=>this.process())),this.subscription=_a(this.target,"message",(i=>this.receive(i)),!1),this.globalScope=on(self)?r:window}registerMessageHandler(r,e){this.messageHandlers[r]=e}unregisterMessageHandler(r){delete this.messageHandlers[r]}sendAsync(r,e){return new Promise(((i,l)=>{let h=Math.round(1e18*Math.random()).toString(36).substring(0,10),m=e?_a(e.signal,"abort",(()=>{m?.unsubscribe(),delete this.resolveRejects[h];let C={id:h,type:"<cancel>",origin:location.origin,targetMapId:r.targetMapId,sourceMapId:this.mapId};this.target.postMessage(C)}),R3):null;this.resolveRejects[h]={resolve:C=>{m?.unsubscribe(),i(C)},reject:C=>{m?.unsubscribe(),l(C)}};let g=[],x=Object.assign(Object.assign({},r),{id:h,sourceMapId:this.mapId,origin:location.origin,data:Or(r.data,g)});this.target.postMessage(x,{transfer:g})}))}receive(r){let e=r.data,i=e.id,l=["file://","resource://android","null"],h=[e.origin,location.origin],m=e.origin===location.origin,g=h.some((x=>l.includes(x)));if((m||g)&&(!e.targetMapId||this.mapId===e.targetMapId)){if(e.type==="<cancel>"){delete this.tasks[i];let x=this.abortControllers[i];return delete this.abortControllers[i],void(x&&x.abort())}if(on(self)||e.mustQueue)return this.tasks[i]=e,this.taskQueue.push(i),void this.invoker.trigger();this.processTask(i,e)}}process(){if(this.taskQueue.length===0)return;let r=this.taskQueue.shift(),e=this.tasks[r];delete this.tasks[r],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(r,e)}processTask(r,e){return o(this,void 0,void 0,(function*(){if(e.type==="<response>"){let h=this.resolveRejects[r];return delete this.resolveRejects[r],h?void(e.error?h.reject(lr(un(e.error))):h.resolve(un(e.data))):void 0}if(!this.messageHandlers[e.type])return void this.completeTask(r,new Error(`Could not find a registered handler for ${e.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));let i=un(e.data),l=new AbortController;this.abortControllers[r]=l;try{let h=yield this.messageHandlers[e.type](e.sourceMapId,i,l);this.completeTask(r,null,h)}catch(h){this.completeTask(r,lr(h))}}))}completeTask(r,e,i){let l=[];delete this.abortControllers[r];let h={id:r,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:e?Or(e):null,data:Or(i,l)};this.target.postMessage(h,{transfer:l})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}}
vendor: 37,588 bytes, line 2
2,V.O=function(){var r=new Ut(16);return Ut!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0),r[0]=1,r[5]=1,r[10]=1,r[15]=1,r},V.P=pe,V.Q=function(r,e,i){var l,h,m,g,x,C,w,A,M,N,L,Z,X=i[0],ie=i[1],ne=i[2];return e===r?(r[12]=e[0]*X+e[4]*ie+e[8]*ne+e[12],r[13]=e[1]*X+e[5]*ie+e[9]*ne+e[13],r[14]=e[2]*X+e[6]*ie+e[10]*ne+e[14],r[15]=e[3]*X+e[7]*ie+e[11]*ne+e[15]):(h=e[1],m=e[2],g=e[3],x=e[4],C=e[5],w=e[6],A=e[7],M=e[8],N=e[9],L=e[10],Z=e[11],r[0]=l=e[0],r[1]=h,r[2]=m,r[3]=g,r[4]=x,r[5]=C,r[6]=w,r[7]=A,r[8]=M,r[9]=N,r[10]=L,r[11]=Z,r[12]=l*X+x*ie+M*ne+e[12],r[13]=h*X+C*ie+N*ne+e[13],r[14]=m*X+w*ie+L*ne+e[14],r[15]=g*X+A*ie+Z*ne+e[15]),r},V.R=Ya,V.S=function(r,e,i){var l=i[0],h=i[1],m=i[2];return r[0]=e[0]*l,r[1]=e[1]*l,r[2]=e[2]*l,r[3]=e[3]*l,r[4]=e[4]*h,r[5]=e[5]*h,r[6]=e[6]*h,r[7]=e[7]*h,r[8]=e[8]*m,r[9]=e[9]*m,r[10]=e[10]*m,r[11]=e[11]*m,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},V.T=yd,V.U=function(r,e,i){var l=e[0],h=e[1],m=e[2],g=e[3],x=e[4],C=e[5],w=e[6],A=e[7],M=e[8],N=e[9],L=e[10],Z=e[11],X=e[12],ie=e[13],ne=e[14],ue=e[15],se=i[0],me=i[1],be=i[2],Ce=i[3];return r[0]=se*l+me*x+be*M+Ce*X,r[1]=se*h+me*C+be*N+Ce*ie,r[2]=se*m+me*w+be*L+Ce*ne,r[3]=se*g+me*A+be*Z+Ce*ue,r[4]=(se=i[4])*l+(me=i[5])*x+(be=i[6])*M+(Ce=i[7])*X,r[5]=se*h+me*C+be*N+Ce*ie,r[6]=se*m+me*w+be*L+Ce*ne,r[7]=se*g+me*A+be*Z+Ce*ue,r[8]=(se=i[8])*l+(me=i[9])*x+(be=i[10])*M+(Ce=i[11])*X,r[9]=se*h+me*C+be*N+Ce*ie,r[10]=se*m+me*w+be*L+Ce*ne,r[11]=se*g+me*A+be*Z+Ce*ue,r[12]=(se=i[12])*l+(me=i[13])*x+(be=i[14])*M+(Ce=i[15])*X,r[13]=se*h+me*C+be*N+Ce*ie,r[14]=se*m+me*w+be*L+Ce*ne,r[15]=se*g+me*A+be*Z+Ce*ue,r},V.V=function(r,e){let i={};for(let l of e)l in r&&(i[l]=r[l]);return i},V.W=up,V.X=yo,V.Y=Rx,V.Z=Lx,V._=o,V.a=Ua,V.a$=function(r){var e=new Ut(3);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e},V.a0=fi,V.a1=At,V.a2=as,V.a3=ml,V.a4=Bx,V.a5=hg,V.a6=pi,V.a7=Vm,V.a8=Yp,V.a9=25,V.aA=function(r){var e=r[0],i=r[1];return Math.sqrt(e*e+i*i)},V.aB=function(r){return r[0]=0,r[1]=0,r},V.aC=function(r,e,i){return r[0]=e[0]*i,r[1]=e[1]*i,r},V.aD=ay,V.aE=Si,V.aF=function(r,e,i,l){let h=e.y-r.y,m=e.x-r.x,g=l.y-i.y,x=l.x-i.x,C=g*m-x*h;if(C===0)return null;let w=(x*(r.y-i.y)-g*(r.x-i.x))/C;return new pe(r.x+w*m,r.y+w*h)},V.aG=bv,V.aH=Uu,V.aI=function(r){let e=1/0,i=1/0,l=-1/0,h=-1/0;for(let m of r)e=Math.min(e,m.x),i=Math.min(i,m.y),l=Math.max(l,m.x),h=Math.max(h,m.y);return[e,i,l,h]},V.aJ=Jr,V.aK=er,V.aL=function(r,e,i,l,h=!1){if(!i[0]&&!i[1])return[0,0];let m=h?l==="map"?-r.bearingInRadians:0:l==="viewport"?r.bearingInRadians:0;if(m){let g=Math.sin(m),x=Math.cos(m);i=[i[0]*x-i[1]*g,i[0]*g+i[1]*x]}return[h?i[0]:er(e,i[0],r.zoom),h?i[1]:er(e,i[1],r.zoom)]},V.aN=oy,V.aO=zy,V.aP=ny,V.aQ=r=>r.type==="symbol",V.aR=Zp,V.aS=Pr,V.aT=Sd,V.aU=Ie,V.aV=ti,V.aW=Dt,V.aX=ya,V.aY=Ox,V.aZ=Ve,V.a_=Pe,V.aa=uy,V.ab=r=>{let e=window.document.createElement("video");return e.muted=!0,new Promise((i=>{e.onloadstart=()=>{i(e)};for(let l of r){let h=window.document.createElement("source");Bi(l)||(e.crossOrigin="Anonymous"),h.src=l,e.appendChild(h)}}))},V.ac=te,V.ad=function(){return fa++},V.ae=f,V.af=Gd,V.ag=jm,V.ah=Ca,V.ai=vc,V.aj=jx,V.ak=function(r){let e={};if(r.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((i,l,h,m)=>{let g=h||m;return e[l]=!g||g.toLowerCase(),""})),e["max-age"]){let i=parseInt(e["max-age"],10);isNaN(i)?delete e["max-age"]:e["max-age"]=i}return e},V.al=$r,V.am=85.051129,V.an=oo,V.ao=function(r){return Math.pow(2,r)},V.ap=li,V.aq=Fx,V.ar=function(r){return Math.log(r)/Math.LN2},V.as=function(r){var e=r[0],i=r[1];return e*e+i*i},V.at=function(r){if(!r.length)return new Set;let e=Math.max(...r.map((C=>C.canonical.z))),i=1/0,l=-1/0,h=1/0,m=-1/0,g=[];for(let C of r){let{x:w,y:A,z:M}=C.canonical,N=Math.pow(2,e-M),L=w*N,Z=A*N;g.push({id:C,x:L,y:Z}),L<i&&(i=L),L>l&&(l=L),Z<h&&(h=Z),Z>m&&(m=Z)}let x=new Set;for(let C of g)C.x!==i&&C.x!==l&&C.y!==h&&C.y!==m||x.add(C.id);return x},V.au=function(r,e){let i=Math.abs(2*r.wrap)-+(r.wrap<0),l=Math.abs(2*e.wrap)-+(e.wrap<0);return r.overscaledZ-e.overscaledZ||l-i||e.canonical.y-r.canonical.y||e.canonical.x-r.canonical.x},V.av=class{constructor(r,e){this.max=r,this.onRemove=e,this.reset()}reset(){for(let r in this.data)for(let e of this.data[r])e.timeout&&clearTimeout(e.timeout),this.onRemove(e.value);return this.data={},this.order=[],this}add(r,e,i){let l=r.wrapped().key;this.data[l]===void 0&&(this.data[l]=[]);let h={value:e,timeout:void 0};if(i!==void 0&&(h.timeout=setTimeout((()=>{this.remove(r,h)}),i)),this.data[l].push(h),this.order.push(l),this.order.length>this.max){let m=this._getAndRemoveByKey(this.order[0]);m&&this.onRemove(m)}return this}has(r){return r.wrapped().key in this.data}getAndRemove(r){return this.has(r)?this._getAndRemoveByKey(r.wrapped().key):null}_getAndRemoveByKey(r){let e=this.data[r].shift();return e.timeout&&clearTimeout(e.timeout),this.data[r].length===0&&delete this.data[r],this.order.splice(this.order.indexOf(r),1),e.value}getByKey(r){let e=this.data[r];return e?e[0].value:null}get(r){return this.has(r)?this.data[r.wrapped().key][0].value:null}remove(r,e){if(!this.has(r))return this;let i=r.wrapped().key,l=e===void 0?0:this.data[i].indexOf(e),h=this.data[i][l];return this.data[i].splice(l,1),h.timeout&&clearTimeout(h.timeout),this.data[i].length===0&&delete this.data[i],this.onRemove(h.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(r){for(this.max=r;this.order.length>this.max;){let e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(r){let e=[];for(let i in this.data)for(let l of this.data[i])r(l.value)||e.push(l);for(let i of e)this.remove(i.value.tileID,i)}},V.aw=function(r,e){let i=0,l=0;if(r.kind==="constant")l=r.layoutSize;else if(r.kind!=="source"){let{interpolationType:h,minZoom:m,maxZoom:g}=r,x=h?$r(ln.interpolationFactor(h,e,m,g),0,1):0;r.kind==="camera"?l=lo.number(r.minSize,r.maxSize,x):i=x}return{uSizeT:i,uSize:l}},V.ay=function(r,{uSize:e,uSizeT:i},{lowerSize:l,upperSize:h}){return r.kind==="source"?l/mu:r.kind==="composite"?lo.number(l/mu,h/mu,i):e},V.az=vi,V.b=Qi,V.b$=Vu,V.b0=function(r,e,i){return r[0]=e[0]-i[0],r[1]=e[1]-i[1],r[2]=e[2]-i[2],r},V.b1=function(r,e){var i=e[0],l=e[1],h=e[2],m=i*i+l*l+h*h;return m>0&&(m=1/Math.sqrt(m)),r[0]=e[0]*m,r[1]=e[1]*m,r[2]=e[2]*m,r},V.b2=Ye,V.b3=function(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]},V.b4=function(r,e,i){return r[0]=e[0]*i[0],r[1]=e[1]*i[1],r[2]=e[2]*i[2],r[3]=e[3]*i[3],r},V.b5=wi,V.b6=function(r,e,i){let l=e[0]*i[0]+e[1]*i[1]+e[2]*i[2];return l===0?null:(-(r[0]*i[0]+r[1]*i[1]+r[2]*i[2])-i[3])/l},V.b7=jt,V.b8=function(r,e,i){return r[0]=e[0]*i,r[1]=e[1]*i,r[2]=e[2]*i,r[3]=e[3]*i,r},V.b9=function(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]+r[3]},V.bA=Nt,V.bB=function(r,e,i){var l=i[0],h=i[1],m=i[2],g=i[3],x=e[0],C=e[1],w=e[2],A=h*w-m*C,M=m*x-l*w,N=l*C-h*x;return r[0]=x+g*(A+=A)+h*(N+=N)-m*(M+=M),r[1]=C+g*M+m*A-l*N,r[2]=w+g*N+l*M-h*A,r},V.bC=function(r,e,i){let l=(h=[r[0],r[1],r[2],e[0],e[1],e[2],i[0],i[1],i[2]])[0]*((A=h[8])*(g=h[4])-(x=h[5])*(w=h[7]))+h[1]*(-A*(m=h[3])+x*(C=h[6]))+h[2]*(w*m-g*C);var h,m,g,x,C,w,A;if(l===0)return null;let M=Ye([],[e[0],e[1],e[2]],[i[0],i[1],i[2]]),N=Ye([],[i[0],i[1],i[2]],[r[0],r[1],r[2]]),L=Ye([],[r[0],r[1],r[2]],[e[0],e[1],e[2]]),Z=Ve([],M,-r[3]);return Pe(Z,Z,Ve([],N,-e[3])),Pe(Z,Z,Ve([],L,-i[3])),Ve(Z,Z,1/l),Z},V.bD=hy,V.bE=function(){return new Float64Array(4)},V.bF=function(r,e,i,l){var h=[],m=[];return h[0]=e[0]-i[0],h[1]=e[1]-i[1],h[2]=e[2]-i[2],m[0]=h[0]*Math.cos(l)-h[1]*Math.sin(l),m[1]=h[0]*Math.sin(l)+h[1]*Math.cos(l),m[2]=h[2],r[0]=m[0]+i[0],r[1]=m[1]+i[1],r[2]=m[2]+i[2],r},V.bG=function(r,e,i,l){var h=[],m=[];return h[0]=e[0]-i[0],h[1]=e[1]-i[1],h[2]=e[2]-i[2],m[0]=h[0],m[1]=h[1]*Math.cos(l)-h[2]*Math.sin(l),m[2]=h[1]*Math.sin(l)+h[2]*Math.cos(l),r[0]=m[0]+i[0],r[1]=m[1]+i[1],r[2]=m[2]+i[2],r},V.bH=function(r,e,i,l){var h=[],m=[];return h[0]=e[0]-i[0],h[1]=e[1]-i[1],h[2]=e[2]-i[2],m[0]=h[2]*Math.sin(l)+h[0]*Math.cos(l),m[1]=h[1],m[2]=h[2]*Math.cos(l)-h[0]*Math.sin(l),r[0]=m[0]+i[0],r[1]=m[1]+i[1],r[2]=m[2]+i[2],r},V.bI=function(r,e,i){var l=Math.sin(i),h=Math.cos(i),m=e[0],g=e[1],x=e[2],C=e[3],w=e[8],A=e[9],M=e[10],N=e[11];return e!==r&&(r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[0]=m*h-w*l,r[1]=g*h-A*l,r[2]=x*h-M*l,r[3]=C*h-N*l,r[8]=m*l+w*h,r[9]=g*l+A*h,r[10]=x*l+M*h,r[11]=C*l+N*h,r},V.bJ=function(r,e){let i=_n(r,360),l=_n(e,360),h=l-i,m=l>i?h-360:h+360;return Math.abs(h)<Math.abs(m)?h:m},V.bK=function(r){return r[0]=0,r[1]=0,r[2]=0,r},V.bL=function(r,e,i,l){let h=Math.sqrt(r*r+e*e),m=Math.sqrt(i*i+l*l);r/=h,e/=h,i/=m,l/=m;let g=Math.acos(r*i+e*l);return-e*i+r*l>0?g:-g},V.bM=function(r,e){let i=_n(r,2*Math.PI),l=_n(e,2*Math.PI);return Math.min(Math.abs(i-l),Math.abs(i-l+2*Math.PI),Math.abs(i-l-2*Math.PI))},V.bN=function(){let r={},e=xt.$version;for(let i in xt.$root){let l=xt.$root[i];if(l.required){let h=null;h=i==="version"?e:l.type==="array"?[]:{},h!=null&&(r[i]=h)}}return r},V.bO=Ht,V.bP=Rr,V.bQ=function r(e,i){if(Array.isArray(e)){if(!Array.isArray(i)||e.length!==i.length)return!1;for(let l=0;l<e.length;l++)if(!r(e[l],i[l]))return!1;return!0}if(typeof e=="object"&&e!==null&&i!==null){if(typeof i!="object"||Object.keys(e).length!==Object.keys(i).length)return!1;for(let l in e)if(!r(e[l],i[l]))return!1;return!0}return e===i},V.bR=or,V.bS=function(r){r=r.slice();let e=Object.create(null);for(let i=0;i<r.length;i++)e[r[i].id]=r[i];for(let i=0;i<r.length;i++)"ref"in r[i]&&(r[i]=eo(r[i],e[r[i].ref]));return r},V.bT=function(r,e){if(r.type==="custom")return new D3(r,e);switch(r.type){case"background":return new z3(r,e);case"circle":return new $u(r,e);case"color-relief":return new Hu(r,e);case"fill":return new W_(r,e);case"fill-extrusion":return new pu(r,e);case"heatmap":return new Zu(r,e);case"hillshade":return new j_(r,e);case"line":return new mn(r,e);case"raster":return new hd(r,e);case"symbol":return new cg(r,e)}},V.bU=r=>r.type==="raster",V.bV=Ti,V.bW=function(r,e){if(!r)return[{command:"setStyle",args:[e]}];let i=[];try{if(!Ai(r.version,e.version))return[{command:"setStyle",args:[e]}];Ai(r.center,e.center)||i.push({command:"setCenter",args:[e.center]}),Ai(r.state,e.state)||i.push({command:"setGlobalState",args:[e.state]}),Ai(r.centerAltitude,e.centerAltitude)||i.push({command:"setCenterAltitude",args:[e.centerAltitude]}),Ai(r.zoom,e.zoom)||i.push({command:"setZoom",args:[e.zoom]}),Ai(r.bearing,e.bearing)||i.push({command:"setBearing",args:[e.bearing]}),Ai(r.pitch,e.pitch)||i.push({command:"setPitch",args:[e.pitch]}),Ai(r.roll,e.roll)||i.push({command:"setRoll",args:[e.roll]}),Ai(r.sprite,e.sprite)||i.push({command:"setSprite",args:[e.sprite]}),Ai(r.glyphs,e.glyphs)||i.push({command:"setGlyphs",args:[e.glyphs]}),Ai(r.transition,e.transition)||i.push({command:"setTransition",args:[e.transition]}),Ai(r.light,e.light)||i.push({command:"setLight",args:[e.light]}),Ai(r.terrain,e.terrain)||i.push({command:"setTerrain",args:[e.terrain]}),Ai(r.sky,e.sky)||i.push({command:"setSky",args:[e.sky]}),Ai(r.projection,e.projection)||i.push({command:"setProjection",args:[e.projection]});let l={},h=[];(function(g,x,C,w){let A;for(A in x=x||{},g=g||{})Object.prototype.hasOwnProperty.call(g,A)&&(Object.prototype.hasOwnProperty.call(x,A)||Xs(A,C,w));for(A in x)Object.prototype.hasOwnProperty.call(x,A)&&(Object.prototype.hasOwnProperty.call(g,A)?Ai(g[A],x[A])||(g[A].type==="geojson"&&x[A].type==="geojson"&&Ql(g,x,A)?On(C,{command:"setGeoJSONSourceData",args:[A,x[A].data]}):Ks(A,x,C,w)):ao(A,x,C))})(r.sources,e.sources,h,l);let m=[];r.layers&&r.layers.forEach((g=>{"source"in g&&l[g.source]?i.push({command:"removeLayer",args:[g.id]}):m.push(g)})),i=i.concat(h),(function(g,x,C){x=x||[];let w=(g=g||[]).map(Se),A=x.map(Se),M=g.reduce(re,{}),N=x.reduce(re,{}),L=w.slice(),Z=Object.create(null),X,ie,ne,ue,se;for(let me=0,be=0;me<w.length;me++)X=w[me],Object.prototype.hasOwnProperty.call(N,X)?be++:(On(C,{command:"removeLayer",args:[X]}),L.splice(L.indexOf(X,be),1));for(let me=0,be=0;me<A.length;me++)X=A[A.length-1-me],L[L.length-1-me]!==X&&(Object.prototype.hasOwnProperty.call(M,X)?(On(C,{command:"removeLayer",args:[X]}),L.splice(L.lastIndexOf(X,L.length-be),1)):be++,ue=L[L.length-me],On(C,{command:"addLayer",args:[N[X],ue]}),L.splice(L.length-me,0,X),Z[X]=!0);for(let me=0;me<A.length;me++)if(X=A[me],ie=M[X],ne=N[X],!Z[X]&&!Ai(ie,ne))if(Ai(ie.source,ne.source)&&Ai(ie["source-layer"],ne["source-layer"])&&Ai(ie.type,ne.type)){for(se in ls(ie.layout,ne.layout,C,X,null,"setLayoutProperty"),ls(ie.paint,ne.paint,C,X,null,"setPaintProperty"),Ai(ie.filter,ne.filter)||On(C,{command:"setFilter",args:[X,ne.filter]}),Ai(ie.minzoom,ne.minzoom)&&Ai(ie.maxzoom,ne.maxzoom)||On(C,{command:"setLayerZoomRange",args:[X,ne.minzoom,ne.maxzoom]}),ie)Object.prototype.hasOwnProperty.call(ie,se)&&se!=="layout"&&se!=="paint"&&se!=="filter"&&se!=="metadata"&&se!=="minzoom"&&se!=="maxzoom"&&(se.indexOf("paint.")===0?ls(ie[se],ne[se],C,X,se.slice(6),"setPaintProperty"):Ai(ie[se],ne[se])||On(C,{command:"setLayerProperty",args:[X,se,ne[se]]}));for(se in ne)Object.prototype.hasOwnProperty.call(ne,se)&&!Object.prototype.hasOwnProperty.call(ie,se)&&se!=="layout"&&se!=="paint"&&se!=="filter"&&se!=="metadata"&&se!=="minzoom"&&se!=="maxzoom"&&(se.indexOf("paint.")===0?ls(ie[se],ne[se],C,X,se.slice(6),"setPaintProperty"):Ai(ie[se],ne[se])||On(C,{command:"setLayerProperty",args:[X,se,ne[se]]}))}else On(C,{command:"removeLayer",args:[X]}),ue=L[L.lastIndexOf(X)+1],On(C,{command:"addLayer",args:[ne,ue]})})(m,e.layers,i)}catch(l){console.warn("Unable to compute style diff:",l),i=[{command:"setStyle",args:[e]}]}return i},V.bX=function(r){let e=[],i=r.id;return i===void 0&&e.push({message:`layers.${i}: missing required property "id"`}),r.render===void 0&&e.push({message:`layers.${i}: missing required method "render"`}),r.renderingMode&&r.renderingMode!=="2d"&&r.renderingMode!=="3d"&&e.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),e},V.bY=Do,V.bZ=Qn,V.b_=class extends Mo{constructor(r,e){super(r,e),this.current=0}set(r){this.current!==r&&(this.current=r,this.gl.uniform1i(this.location,r))}},V.ba=Nx,V.bb=Zd,V.bc=function(r,e,i,l,h){var m=1/Math.tan(e/2);if(r[0]=m/i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=m,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,h!=null&&h!==1/0){var g=1/(l-h);r[10]=(h+l)*g,r[14]=2*h*l*g}else r[10]=-1,r[14]=-2*l;return r},V.bd=function(r){var e=new Ut(16);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e},V.be=function(r,e,i){var l=Math.sin(i),h=Math.cos(i),m=e[0],g=e[1],x=e[2],C=e[3],w=e[4],A=e[5],M=e[6],N=e[7];return e!==r&&(r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[0]=m*h+w*l,r[1]=g*h+A*l,r[2]=x*h+M*l,r[3]=C*h+N*l,r[4]=w*h-m*l,r[5]=A*h-g*l,r[6]=M*h-x*l,r[7]=N*h-C*l,r},V.bf=function(r,e,i){var l=Math.sin(i),h=Math.cos(i),m=e[4],g=e[5],x=e[6],C=e[7],w=e[8],A=e[9],M=e[10],N=e[11];return e!==r&&(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[4]=m*h+w*l,r[5]=g*h+A*l,r[6]=x*h+M*l,r[7]=C*h+N*l,r[8]=w*h-m*l,r[9]=A*h-g*l,r[10]=M*h-x*l,r[11]=N*h-C*l,r},V.bg=function(r,e){var i=e[0],l=e[1],h=e[2],m=e[3],g=e[4],x=e[5],C=e[6],w=e[7],A=e[8],M=e[9],N=e[10],L=e[11],Z=e[12],X=e[13],ie=e[14],ne=e[15],ue=i*x-l*g,se=i*C-h*g,me=i*w-m*g,be=l*C-h*x,Ce=l*w-m*x,We=h*w-m*C,Je=A*X-M*Z,mt=A*ie-N*Z,at=A*ne-L*Z,vt=M*ie-N*X,bt=M*ne-L*X,yt=N*ne-L*ie,lt=ue*yt-se*bt+me*vt+be*at-Ce*mt+We*Je;return lt?(r[0]=(x*yt-C*bt+w*vt)*(lt=1/lt),r[1]=(h*bt-l*yt-m*vt)*lt,r[2]=(X*We-ie*Ce+ne*be)*lt,r[3]=(N*Ce-M*We-L*be)*lt,r[4]=(C*at-g*yt-w*mt)*lt,r[5]=(i*yt-h*at+m*mt)*lt,r[6]=(ie*me-Z*We-ne*se)*lt,r[7]=(A*We-N*me+L*se)*lt,r[8]=(g*bt-x*at+w*Je)*lt,r[9]=(l*at-i*bt-m*Je)*lt,r[10]=(Z*Ce-X*me+ne*ue)*lt,r[11]=(M*me-A*Ce-L*ue)*lt,r[12]=(x*mt-g*vt-C*Je)*lt,r[13]=(i*vt-l*mt+h*Je)*lt,r[14]=(X*se-Z*be-ie*ue)*lt,r[15]=(A*be-M*se+N*ue)*lt,r):null},V.bh=function(){let r=new Float32Array(16);return li(r),r},V.bi=function(){let r=new Float64Array(16);return li(r),r},V.bj=function(){return new Float64Array(16)},V.bk=function(r,e,i){let l=new Float64Array(4);return Nt(l,r,e-90,i),l},V.bl=function(r,e,i,l){var h,m,g,x,C,w=e[0],A=e[1],M=e[2],N=e[3],L=i[0],Z=i[1],X=i[2],ie=i[3];return(m=w*L+A*Z+M*X+N*ie)<0&&(m=-m,L=-L,Z=-Z,X=-X,ie=-ie),1-m>He?(h=Math.acos(m),g=Math.sin(h),x=Math.sin((1-l)*h)/g,C=Math.sin(l*h)/g):(x=1-l,C=l),r[0]=x*w+C*L,r[1]=x*A+C*Z,r[2]=x*M+C*X,r[3]=x*N+C*ie,r},V.bm=function(r){let e=new Float64Array(9);var i,l,h,m,g,x,C,w,A,M,N,L,Z,X,ie,ne,ue,se;M=(h=(l=r)[0])*(C=h+h),N=(m=l[1])*C,Z=(g=l[2])*C,X=g*(w=m+m),ne=(x=l[3])*C,ue=x*w,se=x*(A=g+g),(i=e)[0]=1-(L=m*w)-(ie=g*A),i[3]=N-se,i[6]=Z+ue,i[1]=N+se,i[4]=1-M-ie,i[7]=X-ne,i[2]=Z-ue,i[5]=X+ne,i[8]=1-M-L;let me=ya(-Math.asin($r(e[2],-1,1))),be,Ce;return Math.hypot(e[5],e[8])<.001?(be=0,Ce=-ya(Math.atan2(e[3],e[4]))):(be=ya(e[5]===0&&e[8]===0?0:Math.atan2(e[5],e[8])),Ce=ya(e[1]===0&&e[0]===0?0:Math.atan2(e[1],e[0]))),{roll:be,pitch:me+90,bearing:Ce}},V.bn=function(r,e){return r.roll==e.roll&&r.pitch==e.pitch&&r.bearing==e.bearing},V.bo=Yi,V.bp=Aa,V.bq=ep,V.br=Up,V.bs=eh,V.bt=qr,V.bu=Cn,V.bv=bo,V.bw=function(r,e,i,l,h){return qr(l,h,$r((r-e)/(i-e),0,1))},V.bx=function(r,e,i,l){return r[0]=e[0]+i[0]*l,r[1]=e[1]+i[1]*l,r[2]=e[2]+i[2]*l,r},V.by=_n,V.bz=function(){return new Float64Array(3)},V.c=Bn,V.c$=pc,V.c0=class extends Mo{constructor(r,e){super(r,e),this.current=pl}set(r){if(r[12]!==this.current[12]||r[0]!==this.current[0])return this.current=r,void this.gl.uniformMatrix4fv(this.location,!1,r);for(let e=1;e<16;e++)if(r[e]!==this.current[e]){this.current=r,this.gl.uniformMatrix4fv(this.location,!1,r);break}}},V.c1=yc,V.c2=class extends Mo{constructor(r,e){super(r,e),this.current=[0,0,0]}set(r){r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]||(this.current=r,this.gl.uniform3f(this.location,r[0],r[1],r[2]))}},V.c3=class extends Mo{constructor(r,e){super(r,e),this.current=[0,0]}set(r){r[0]===this.current[0]&&r[1]===this.current[1]||(this.current=r,this.gl.uniform2f(this.location,r[0],r[1]))}},V.c4=Mi,V.c5=function(r,e){var i=Math.sin(e),l=Math.cos(e);return r[0]=l,r[1]=i,r[2]=0,r[3]=-i,r[4]=l,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r},V.c6=function(r,e,i){var l=e[0],h=e[1],m=e[2];return r[0]=l*i[0]+h*i[3]+m*i[6],r[1]=l*i[1]+h*i[4]+m*i[7],r[2]=l*i[2]+h*i[5]+m*i[8],r},V.c7=function(r,e,i,l,h,m,g){var x=1/(e-i),C=1/(l-h),w=1/(m-g);return r[0]=-2*x,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*C,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*w,r[11]=0,r[12]=(e+i)*x,r[13]=(h+l)*C,r[14]=(g+m)*w,r[15]=1,r},V.c8=class extends Mo{constructor(r,e){super(r,e),this.current=new Array}set(r){if(r!=this.current){this.current=r;let e=new Float32Array(4*r.length);for(let i=0;i<r.length;i++)e[4*i]=r[i].r,e[4*i+1]=r[i].g,e[4*i+2]=r[i].b,e[4*i+3]=r[i].a;this.gl.uniform4fv(this.location,e)}}},V.c9=class extends Mo{constructor(r,e){super(r,e),this.current=new Array}set(r){if(r!=this.current){this.current=r;let e=new Float32Array(r);this.gl.uniform1fv(this.location,e)}}},V.cA=function(r,e){return Na[e]&&"touches"in r},V.cB=function(r){return Na[r]||St[r]},V.cC=function(r,e,i){var l=e[0],h=e[1];return r[0]=i[0]*l+i[4]*h+i[12],r[1]=i[1]*l+i[5]*h+i[13],r},V.cD=function(r,e){let{x:i,y:l}=Vm.fromLngLat(e);return!(r<0||r>25||l<0||l>=1||i<0||i>=1)},V.cE=function(r,e){return r[0]=e[0],r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=e[1],r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=e[2],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r},V.cF=class extends Lu{},V.cG=ta,V.cH=function(r,e){Bn.REGISTERED_PROTOCOLS[r]=e},V.cI=function(r){delete Bn.REGISTERED_PROTOCOLS[r]},V.cJ=function(r,e){let i={};for(let h=0;h<r.length;h++){let m=e&&e[r[h].id]||s(r[h]);e&&(e[r[h].id]=m);let g=i[m];g||(g=i[m]=[]),g.push(r[h])}let l=[];for(let h in i)l.push(i[h]);return l},V.cK=Qt,V.cL=Ux,V.cM=xv,V.cN=Nh,V.cO=function(r){var e,i;r.bucket.createArrays(),r.bucket.tilePixelRatio=pi/(512*r.bucket.overscaling),r.bucket.compareText={},r.bucket.iconsNeedLinear=!1;let l=r.bucket.layers[0],h=l.layout,m=l._unevaluatedLayout._values,g={layoutIconSize:m["icon-size"].possiblyEvaluate(new wr(r.bucket.zoom+1),r.canonical),layoutTextSize:m["text-size"].possiblyEvaluate(new wr(r.bucket.zoom+1),r.canonical),textMaxSize:m["text-size"].possiblyEvaluate(new wr(18))};if(r.bucket.textSizeData.kind==="composite"){let{minZoom:M,maxZoom:N}=r.bucket.textSizeData;g.compositeTextSizes=[m["text-size"].possiblyEvaluate(new wr(M),r.canonical),m["text-size"].possiblyEvaluate(new wr(N),r.canonical)]}if(r.bucket.iconSizeData.kind==="composite"){let{minZoom:M,maxZoom:N}=r.bucket.iconSizeData;g.compositeIconSizes=[m["icon-size"].possiblyEvaluate(new wr(M),r.canonical),m["icon-size"].possiblyEvaluate(new wr(N),r.canonical)]}let x=h.get("text-line-height")*Jr,C=h.get("text-rotation-alignment")!=="viewport"&&h.get("symbol-placement")!=="point",w=h.get("text-keep-upright"),A=h.get("text-size");for(let M of r.bucket.features){let N=h.get("text-font").evaluate(M,{},r.canonical).join(","),L=A.evaluate(M,{},r.canonical),Z=g.layoutTextSize.evaluate(M,{},r.canonical),X=g.layoutIconSize.evaluate(M,{},r.canonical),ie={horizontal:{},vertical:void 0},ne=M.text,ue,se=[0,0];if(ne){let Ce=ne.toString(),We=h.get("text-letter-spacing").evaluate(M,{},r.canonical)*Jr,Je=Gc(Ce)?We:0,mt=h.get("text-anchor").evaluate(M,{},r.canonical),at=zv(l,M,r.canonical);if(!at){let lt=h.get("text-radial-offset").evaluate(M,{},r.canonical);se=lt?Av(mt,[lt*Jr,Ay]):h.get("text-offset").evaluate(M,{},r.canonical).map((qt=>qt*Jr))}let vt=C?"center":h.get("text-justify").evaluate(M,{},r.canonical),bt=h.get("symbol-placement")==="point"?h.get("text-max-width").evaluate(M,{},r.canonical)*Jr:1/0,yt=()=>{r.bucket.allowVerticalPlacement&&cl(Ce)&&(ie.vertical=sg(ne,r.glyphMap,r.glyphPositions,r.imagePositions,N,bt,x,mt,"left",Je,se,V.ax.vertical,!0,Z,L))};if(!C&&at){let lt=new Set;if(vt==="auto")for(let ii=0;ii<at.values.length;ii+=2)lt.add(zy(at.values[ii]));else lt.add(vt);let qt=!1;for(let ii of lt)if(!ie.horizontal[ii])if(qt)ie.horizontal[ii]=ie.horizontal[0];else{let Wt=sg(ne,r.glyphMap,r.glyphPositions,r.imagePositions,N,bt,x,"center",ii,Je,se,V.ax.horizontal,!1,Z,L);Wt&&(ie.horizontal[ii]=Wt,qt=Wt.positionedLines.length===1)}yt()}else{vt==="auto"&&(vt=zy(mt));let lt=sg(ne,r.glyphMap,r.glyphPositions,r.imagePositions,N,bt,x,mt,vt,Je,se,V.ax.horizontal,!1,Z,L);lt&&(ie.horizontal[vt]=lt),yt(),cl(Ce)&&C&&w&&(ie.vertical=sg(ne,r.glyphMap,r.glyphPositions,r.imagePositions,N,bt,x,mt,vt,Je,se,V.ax.vertical,!1,Z,L))}}let me=!1;if(!((e=M.icon)===null||e===void 0)&&e.name){let Ce=r.imageMap[M.icon.name];Ce&&(ue=M3(r.imagePositions[M.icon.name],h.get("icon-offset").evaluate(M,{},r.canonical),h.get("icon-anchor").evaluate(M,{},r.canonical)),me=!!Ce.sdf,r.bucket.sdfIcons===void 0?r.bucket.sdfIcons=me:r.bucket.sdfIcons!==me&&Gr("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Ce.pixelRatio!==r.bucket.pixelRatio||h.get("icon-rotate").constantOr(1)!==0)&&(r.bucket.iconsNeedLinear=!0))}let be=Lv(ie.horizontal)||ie.vertical;(i=r.bucket).iconsInText||(i.iconsInText=!!be&&be.iconsInText),(be||ue)&&wT(r.bucket,M,ie,ue,r.imageMap,g,Z,X,se,me,r.canonical,r.subdivisionGranularity)}r.showCollisionBoxes&&r.bucket.generateCollisionDebugBuffers()},V.cP=bc,V.cQ=Rm,V.cR=Ln,V.cS=function(r,e=""){let i=new Xp;return(function(l,h,m=""){for(let g in l.layers)h.writeMessage(3,((x,C)=>lT(x,C,m)),l.layers[g])})(r,i,e),i.finish()},V.cT=function(r,e,i,l,h,m){let g=wv(r,e,i,h,0);return g=wv(g,e,l,m,1),g},V.cU=class{constructor(r){this.maxEntries=r,this.map=new Map}get(r){let e=this.map.get(r);return e!==void 0&&(this.map.delete(r),this.map.set(r,e)),e}set(r,e){if(this.map.has(r))this.map.delete(r);else if(this.map.size>=this.maxEntries){let i=this.map.keys().next().value;this.map.delete(i)}this.map.set(r,e)}clear(){this.map.clear()}},V.cV=Lm,V.cW=Xp,V.cX=_v,V.cY=function(r,e,i,l,h){return o(this,void 0,void 0,(function*(){if(At())try{return yield as(r,e,i,l,h)}catch{}return(function(m,g,x,C,w){let A=m.width,M=m.height;xo&&ss||(xo=new OffscreenCanvas(A,M),ss=xo.getContext("2d",{willReadFrequently:!0})),xo.width=A,xo.height=M,ss.drawImage(m,0,0,A,M);let N=ss.getImageData(g,x,C,w);return ss.clearRect(0,0,A,M),N.data})(r,e,i,l,h)}))},V.cZ=Bp,V.c_=class{constructor(r,e){this.layers={[jm]:this},this.name=jm,this.version=e?e.version:1,this.extent=e?e.extent:4096,this.length=r.length,this.features=r}feature(r){return new sT(this.features[r],this.extent)}},V.ca=class extends fc{},V.cb=dl,V.cc=class extends zh{},V.cd=Gu,V.ce=function(r){return r<=1?1:Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))},V.cf=Hf,V.cg=function(r,e,i){var l=e[0],h=e[1],m=e[2],g=i[3]*l+i[7]*h+i[11]*m+i[15];return r[0]=(i[0]*l+i[4]*h+i[8]*m+i[12])/(g=g||1),r[1]=(i[1]*l+i[5]*h+i[9]*m+i[13])/g,r[2]=(i[2]*l+i[6]*h+i[10]*m+i[14])/g,r},V.ch=class extends Ru{},V.ci=class extends t{},V.cj=function(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]&&r[4]===e[4]&&r[5]===e[5]&&r[6]===e[6]&&r[7]===e[7]&&r[8]===e[8]&&r[9]===e[9]&&r[10]===e[10]&&r[11]===e[11]&&r[12]===e[12]&&r[13]===e[13]&&r[14]===e[14]&&r[15]===e[15]},V.ck=function(r,e){var i=r[0],l=r[1],h=r[2],m=r[3],g=r[4],x=r[5],C=r[6],w=r[7],A=r[8],M=r[9],N=r[10],L=r[11],Z=r[12],X=r[13],ie=r[14],ne=r[15],ue=e[0],se=e[1],me=e[2],be=e[3],Ce=e[4],We=e[5],Je=e[6],mt=e[7],at=e[8],vt=e[9],bt=e[10],yt=e[11],lt=e[12],qt=e[13],ii=e[14],Wt=e[15];return Math.abs(i-ue)<=He*Math.max(1,Math.abs(i),Math.abs(ue))&&Math.abs(l-se)<=He*Math.max(1,Math.abs(l),Math.abs(se))&&Math.abs(h-me)<=He*Math.max(1,Math.abs(h),Math.abs(me))&&Math.abs(m-be)<=He*Math.max(1,Math.abs(m),Math.abs(be))&&Math.abs(g-Ce)<=He*Math.max(1,Math.abs(g),Math.abs(Ce))&&Math.abs(x-We)<=He*Math.max(1,Math.abs(x),Math.abs(We))&&Math.abs(C-Je)<=He*Math.max(1,Math.abs(C),Math.abs(Je))&&Math.abs(w-mt)<=He*Math.max(1,Math.abs(w),Math.abs(mt))&&Math.abs(A-at)<=He*Math.max(1,Math.abs(A),Math.abs(at))&&Math.abs(M-vt)<=He*Math.max(1,Math.abs(M),Math.abs(vt))&&Math.abs(N-bt)<=He*Math.max(1,Math.abs(N),Math.abs(bt))&&Math.abs(L-yt)<=He*Math.max(1,Math.abs(L),Math.abs(yt))&&Math.abs(Z-lt)<=He*Math.max(1,Math.abs(Z),Math.abs(lt))&&Math.abs(X-qt)<=He*Math.max(1,Math.abs(X),Math.abs(qt))&&Math.abs(ie-ii)<=He*Math.max(1,Math.abs(ie),Math.abs(ii))&&Math.abs(ne-Wt)<=He*Math.max(1,Math.abs(ne),Math.abs(Wt))},V.cl=function(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},V.cm=r=>r.type==="circle",V.cn=r=>r.type==="heatmap",V.co=r=>r.type==="line",V.cp=r=>r.type==="fill",V.cq=r=>r.type==="fill-extrusion",V.cr=r=>r.type==="hillshade",V.cs=r=>r.type==="color-relief",V.ct=r=>r.type==="background",V.cu=r=>r.type==="custom",V.cv=yn,V.cw=function(r,e,i){if(e<=0)return r;let l=1/e;return i===void 0||Math.abs(i)<1e-10?Math.round(r*l)/l:(i>0?Math.ceil(r*l-1e-9):Math.floor(r*l+1e-10))/l},V.cx=function(r,e,i){let l=Li(e.x-i.x,e.y-i.y),h=Li(r.x-i.x,r.y-i.y);var m,g;return ya(Math.atan2(l[0]*h[1]-l[1]*h[0],(m=l)[0]*(g=h)[0]+m[1]*g[1]))},V.cy=zo,V.cz=function(r,e){var i;if(!St[e])return!1;let l=r?.target,h=((i=l?.ownerDocument)===null||i===void 0?void 0:i.defaultView)||window;return r instanceof h.MouseEvent||r instanceof h.WheelEvent},V.d=lr,V.d0=class{constructor(r,e){let i=(e=this.options=Object.assign({},js,e)).debug;if(i&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");let l=Rd(r,e);i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles")),l=Ue(l,e),e.updateable&&(this.source=l),this.initializeIndex(l,e)}initializeIndex(r,e){this.tileIndex=e.cluster?new kt(e.clusterOptions):new rn(e),r.length&&this.tileIndex.initialize(r)}getTile(r,e,i){return e=+e,i=+i,(r=+r)<0||r>24?null:this.tileIndex.getTile(r,e,i)}updateData(r,e){let i=this.options;if(!i.updateable)throw new Error("to update tile geojson `updateable` option must be set to true");let{affected:l,source:h}=(function(m,g,x){let C=(function(A,M){return A?{removeAll:A.removeAll,remove:new Set(A.remove||[]),add:new Map(A.add?.map((N=>[M.promoteId?N.properties[M.promoteId]:N.id,N]))),update:new Map(A.update?.map((N=>[N.id,N])))}:{remove:new Set,add:new Map,update:new Map}})(g,x),w=[];if(C.removeAll&&(w=m,m=[]),C.remove.size||C.add.size){let A=[];for(let M of m)(C.remove.has(M.id)||C.add.has(M.id))&&A.push(M);if(A.length){w.push(...A);let M=new Set(A.map((N=>N.id)));m=m.filter((N=>!M.has(N.id)))}if(C.add.size){let M=Rd({type:"FeatureCollection",features:Array.from(C.add.values())},x);M=Ue(M,x),w.push(...M),m.push(...M)}}if(C.update.size){let A=new Map,M=[];for(let N of m)C.update.has(N.id)?A.set(N.id,[...A.get(N.id)||[],N]):M.push(N);for(let[N,L]of C.update){let Z=A.get(N);if(!Z||Z.length===0)continue;let X=tt(Z,L,x);w.push(...Z,...X),M.push(...X)}m=M}return{affected:w,source:m}})(this.source,r,i);e&&({affected:l,source:h}=this.filterUpdate(h,l,e)),l.length&&(this.source=h,this.tileIndex.updateIndex(h,l,i))}filterUpdate(r,e,i){let l=new Set;for(let h of r)h.id!=null&&(i(du(h))||(e.push(h),l.add(h.id)));return{affected:e,source:r=r.filter((h=>!l.has(h.id)))}}getData(){if(!this.options.updateable)throw new Error("to retrieve data the `updateable` option must be set to true");return{type:"FeatureCollection",features:this.source.map((r=>du(r)))}}updateClusterOptions(r,e){let i=this.options.cluster;this.options.cluster=r,this.options.clusterOptions=e,i!=r?this.initializeIndex(this.source,this.options):this.tileIndex.updateIndex(this.source,[],this.options)}getClusterExpansionZoom(r){return this.tileIndex.getClusterExpansionZoom(r)}getClusterChildren(r){return this.tileIndex.getChildren(r)}getClusterLeaves(r,e,i){return this.tileIndex.getLeaves(r,e,i)}},V.d1=Xa,V.e=Dr,V.f=Bi,V.g=xn,V.h=r=>o(void 0,void 0,void 0,(function*(){if(r.byteLength===0)return createImageBitmap(new ImageData(1,1));let e=new Blob([new Uint8Array(r)],{type:"image/png"});try{return createImageBitmap(e)}catch(i){throw new Error(`Could not load image because of ${lr(i).message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}})),V.i=on,V.j=r=>new Promise(((e,i)=>{let l=new Image;l.onload=()=>{e(l),URL.revokeObjectURL(l.src),l.onload=null,window.requestAnimationFrame((()=>l.src=ga))},l.onerror=()=>i(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let h=new Blob([new Uint8Array(r)],{type:"image/png"});l.src=r.byteLength?URL.createObjectURL(h):ga})),V.k=(r,e)=>Wi(Dr(r,{type:"json"}),e),V.l=Ro,V.m=Wi,V.n=ji,V.o=(r,e)=>Wi(Dr(r,{type:"arrayBuffer"}),e),V.p=lp,V.q=function(r){return new Xp(r).readFields(es,[])},V.r=function(r){return/[\u02EA\u02EB\u1100-\u11FF\u2E80-\u2FDF\u3000-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(r))},V.s=_a,V.t=Fp,V.u=aa,V.v=mr,V.w=Gr,V.x=xt,V.y=Nl,V.z=cn})),F("worker",["./shared"],(function(V){"use strict";class o{constructor(Pe,Ve){this.keyCache={},Pe&&this.replace(Pe,Ve)}replace(Pe,Ve){this._layerConfigs={},this._layers={},this.update(Pe,[],Ve)}update(Pe,Ve,Ye){for(let jt of Pe){this._layerConfigs[jt.id]=jt;let Si=this._layers[jt.id]=V.bT(jt,Ye);Si._featureFilter=V.ah(Si.filter,Ye),this.keyCache[jt.id]&&delete this.keyCache[jt.id]}for(let jt of Ve)delete this.keyCache[jt],delete this._layerConfigs[jt],delete this._layers[jt];this.familiesBySource={};let It=V.cJ(Object.values(this._layerConfigs),this.keyCache);for(let jt of It){let Si=jt.map((er=>this._layers[er.id])),hi=Si[0];if(hi.isHidden())continue;let Nt=hi.source||"",vi=this.familiesBySource[Nt];vi||(vi=this.familiesBySource[Nt]={});let Li=hi.sourceLayer||V.ag,pi=vi[Li];pi||(pi=vi[Li]=[]),pi.push(Si)}}}class pe{constructor(Pe){let Ve={},Ye=[];for(let hi in Pe){let Nt=Pe[hi],vi=Ve[hi]={};for(let Li in Nt){let pi=Nt[+Li];if(!pi||pi.bitmap.width===0||pi.bitmap.height===0)continue;let er={x:0,y:0,w:pi.bitmap.width+2,h:pi.bitmap.height+2};Ye.push(er),vi[Li]={rect:er,metrics:pi.metrics}}}let{w:It,h:jt}=V.p(Ye),Si=new V.t({width:It||1,height:jt||1});for(let hi in Pe){let Nt=Pe[hi];for(let vi in Nt){let Li=Nt[+vi];if(!Li||Li.bitmap.width===0||Li.bitmap.height===0)continue;let pi=Ve[hi][vi].rect;V.t.copy(Li.bitmap,Si,{x:0,y:0},{x:pi.x+1,y:pi.y+1},Li.bitmap)}}this.image=Si,this.positions=Ve}}V.cK("GlyphAtlas",pe);class Ne{constructor(Pe){this.tileID=new V.a3(Pe.tileID.overscaledZ,Pe.tileID.wrap,Pe.tileID.canonical.z,Pe.tileID.canonical.x,Pe.tileID.canonical.y),this.uid=Pe.uid,this.zoom=Pe.zoom,this.pixelRatio=Pe.pixelRatio,this.tileSize=Pe.tileSize,this.source=Pe.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=Pe.showCollisionBoxes,this.collectResourceTiming=!!Pe.collectResourceTiming,this.returnDependencies=!!Pe.returnDependencies,this.promoteId=Pe.promoteId,this.inFlightDependencies=[]}parse(Pe,Ve,Ye,It,jt){return V._(this,void 0,void 0,(function*(){this.status="parsing",this.data=Pe,this.collisionBoxArray=new V.ae;let Si=new V.cL(Object.keys(Pe.layers).sort()),hi=new V.cM(this.tileID,this.promoteId);hi.bucketLayerIDs=[];let Nt={},vi={featureIndex:hi,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:Ye,subdivisionGranularity:jt},Li=Ve.familiesBySource[this.source];for(let Ti in Li){let nn=Pe.layers[Ti];if(!nn)continue;nn.version===1&&V.w(`Vector tile source "${this.source}" layer "${Ti}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let Gr=Si.encode(Ti),Hn=[];for(let on=0;on<nn.length;on++){let Xn=nn.feature(on),Qi=hi.getId(Xn,Ti);Hn.push({feature:Xn,id:Qi,index:on,sourceLayerIndex:Gr})}for(let on of Li[Ti]){let Xn=on[0];Xn.source!==this.source&&V.w(`layer.source = ${Xn.source} does not equal this.source = ${this.source}`),Xn.isHidden(this.zoom,!0)||(Qe(on,this.zoom,Ye),(Nt[Xn.id]=Xn.createBucket({index:hi.bucketLayerIDs.length,layers:on,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Gr,sourceID:this.source})).populate(Hn,vi,this.tileID.canonical),hi.bucketLayerIDs.push(on.map((Qi=>Qi.id))))}}let pi=V.bY(vi.glyphDependencies,(Ti=>Object.keys(Ti).map(Number)));for(let Ti of this.inFlightDependencies)Ti?.abort();this.inFlightDependencies=[];let er=Promise.resolve({});if(Object.keys(pi).length){let Ti=new AbortController;this.inFlightDependencies.push(Ti),er=It.sendAsync({type:"GG",data:{stacks:pi,source:this.source,tileID:this.tileID,type:"glyphs"}},Ti)}let lr=Object.keys(vi.iconDependencies),_n=Promise.resolve({});if(lr.length){let Ti=new AbortController;this.inFlightDependencies.push(Ti),_n=It.sendAsync({type:"GI",data:{icons:lr,source:this.source,tileID:this.tileID,type:"icons"}},Ti)}let qr=Object.keys(vi.patternDependencies),Cn=Promise.resolve({});if(qr.length){let Ti=new AbortController;this.inFlightDependencies.push(Ti),Cn=It.sendAsync({type:"GI",data:{icons:qr,source:this.source,tileID:this.tileID,type:"patterns"}},Ti)}let yn=vi.dashDependencies,zo=Promise.resolve({});if(Object.keys(yn).length){let Ti=new AbortController;this.inFlightDependencies.push(Ti),zo=It.sendAsync({type:"GDA",data:{dashes:yn}},Ti)}let[$r,yo,Dr,fa]=yield Promise.all([er,_n,Cn,zo]),Do=new pe($r),Qn=new V.cN(yo,Dr);for(let Ti in Nt){let nn=Nt[Ti];nn instanceof V.af?(Qe(nn.layers,this.zoom,Ye),V.cO({bucket:nn,glyphMap:$r,glyphPositions:Do.positions,imageMap:yo,imagePositions:Qn.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:vi.subdivisionGranularity})):nn.hasDependencies&&(nn instanceof V.cP||nn instanceof V.cQ||nn instanceof V.cR)&&(Qe(nn.layers,this.zoom,Ye),nn.addFeatures(vi,this.tileID.canonical,Qn.patternPositions,fa))}return this.status="done",{buckets:Object.values(Nt).filter((Ti=>!Ti.isEmpty())),featureIndex:hi,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Do.image,imageAtlas:Qn,dashPositions:fa,glyphMap:this.returnDependencies?$r:null,iconMap:this.returnDependencies?yo:null,glyphPositions:this.returnDependencies?Do.positions:null}}))}}function Qe(ci,Pe,Ve){let Ye=new V.J(Pe);for(let It of ci)It.recalculate(Ye,Ve)}class ct{constructor(){this.loading={},this.loaded={},this.parsing={}}startLoading(Pe,Ve){this.loading[Pe]=Ve}finishLoading(Pe){delete this.loading[Pe]}abort(Pe){let Ve=this.loading[Pe];Ve?.abort&&(Ve.abort.abort(),delete this.loading[Pe])}setParsing(Pe,Ve){this.parsing[Pe]=Ve}consumeParsing(Pe){let Ve=this.parsing[Pe];
2if(Ve)return delete this.parsing[Pe],Ve}clearParsing(Pe){delete this.parsing[Pe]}markLoaded(Pe,Ve){this.loaded[Pe]=Ve}getLoaded(Pe){let Ve=this.loaded[Pe];if(Ve)return Ve}removeLoaded(Pe){delete this.loaded[Pe]}clearLoaded(){this.loaded={}}}class Ze{constructor(Pe){this.start=`${Pe}#start`,this.end=`${Pe}#end`,this.measure=Pe,performance.mark(this.start)}finish(){performance.mark(this.end);let Pe=performance.getEntriesByName(this.measure);return Pe.length===0&&(performance.measure(this.measure,this.start,this.end),Pe=performance.getEntriesByName(this.measure),performance.clearMarks(this.start),performance.clearMarks(this.end),performance.clearMeasures(this.measure)),Pe}}class Bt{constructor(Pe,Ve,Ye,It,jt){this.type=Pe,this.properties=Ye||{},this.extent=jt,this.pointsArray=Ve,this.id=It}loadGeometry(){return this.pointsArray.map((Pe=>Pe.map((Ve=>new V.P(Ve.x,Ve.y)))))}}class Ct{constructor(Pe,Ve,Ye){this.version=2,this._myFeatures=Pe,this.name=Ve,this.length=Pe.length,this.extent=Ye}feature(Pe){return this._myFeatures[Pe]}}class Mt{constructor(){this.layers={}}addLayer(Pe){this.layers[Pe.name]=Pe}}function fi(ci){let Pe=V.cS(ci);return Pe.byteOffset===0&&Pe.byteLength===Pe.buffer.byteLength||(Pe=new Uint8Array(Pe)),{vectorTile:ci,rawData:Pe.buffer}}function At(ci,Pe,Ve){let{extent:Ye}=ci,It=Math.pow(2,Ve.z-Pe.z),jt=(Ve.x-Pe.x*It)*Ye,Si=(Ve.y-Pe.y*It)*Ye,hi=[];for(let Nt=0;Nt<ci.length;Nt++){let vi=ci.feature(Nt),Li=vi.loadGeometry();for(let er of Li)for(let lr of er)lr.x=lr.x*It-jt,lr.y=lr.y*It-Si;let pi=128;Li=V.cT(Li,vi.type,-pi,-pi,Ye+pi,Ye+pi),Li.length!==0&&hi.push(new Bt(vi.type,Li,vi.properties,vi.id,Ye))}return new Ct(hi,ci.name,Ye)}class He{constructor(Pe,Ve,Ye){this.actor=Pe,this.layerIndex=Ve,this.availableImages=Ye,this.tileState=new ct,this.overzoomedTileResultCache=new V.cU(1e3)}loadVectorTile(Pe,Ve){try{return{vectorTile:Pe.encoding!=="mlt"?new V.cV(new V.cW(Ve)):new V.cX(Ve),rawData:Ve}}catch(Ye){let It=new Uint8Array(Ve),jt=`Unable to parse the tile at ${Pe.request.url}, `;throw jt+=It[0]===31&&It[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${V.d(Ye).message}`,new Error(jt)}}loadTile(Pe){return V._(this,void 0,void 0,(function*(){let{uid:Ve,overzoomParameters:Ye}=Pe;Ye&&(Pe.request=Ye.overzoomRequest);let It=this._startRequestTiming(Pe),jt=new Ne(Pe);this.tileState.startLoading(Ve,jt);let Si=new AbortController;jt.abort=Si;try{let hi=yield V.o(Pe.request,Si);if(Pe.etag&&Pe.etag===hi.etag)return this.tileState.finishLoading(Ve),this._getEtagUnmodifiedResult(hi,It);let Nt=this.loadVectorTile(Pe,hi.data);if(this.tileState.finishLoading(Ve),!Nt)return null;let{vectorTile:vi,rawData:Li}=Nt;Ye&&({vectorTile:vi,rawData:Li}=this._getOverzoomTile(Pe,vi));let pi=this._getExpiryData(hi),er=this._finishRequestTiming(It);jt.vectorTile=vi,this.tileState.markLoaded(Ve,jt);let lr={rawData:Li,cacheControl:pi,resourceTiming:er};this.tileState.setParsing(Ve,lr);try{return yield this._parseWorkerTile(jt,Pe,lr)}finally{this.tileState.clearParsing(Ve)}}catch(hi){throw this.tileState.finishLoading(Ve),jt.status="done",this.tileState.markLoaded(Ve,jt),hi}}))}_getEtagUnmodifiedResult(Pe,Ve){let Ye=this._getExpiryData(Pe),It=this._finishRequestTiming(Ve);return V.e({etagUnmodified:!0},Ye,It)}_parseWorkerTile(Pe,Ve,Ye){return V._(this,void 0,void 0,(function*(){let It=yield Pe.parse(Pe.vectorTile,this.layerIndex,this.availableImages,this.actor,Ve.subdivisionGranularity);if(Ye){let{rawData:jt,cacheControl:Si,resourceTiming:hi}=Ye;It=V.e({rawTileData:jt.slice(0),encoding:Ve.encoding},It,Si,hi)}return It}))}_getExpiryData({expires:Pe,cacheControl:Ve,etag:Ye}){let It={};return Pe&&(It.expires=Pe),Ve&&(It.cacheControl=Ve),Ye&&(It.etag=Ye),It}_startRequestTiming(Pe){var Ve;if(!((Ve=Pe.request)===null||Ve===void 0)&&Ve.collectResourceTiming)return new Ze(Pe.request.url)}_finishRequestTiming(Pe){let Ve=Pe?.finish();return Ve?{resourceTiming:JSON.parse(JSON.stringify(Ve))}:{}}_getOverzoomTile(Pe,Ve){var Ye;let{tileID:It,source:jt,overzoomParameters:Si}=Pe,{maxZoomTileID:hi}=Si,Nt=`${hi.key}_${It.key}_${(Ye=Pe.request)===null||Ye===void 0?void 0:Ye.url}`,vi=this.overzoomedTileResultCache.get(Nt);if(vi)return vi;let Li=new Mt,pi=this.layerIndex.familiesBySource[jt];for(let lr in pi){let _n=Ve.layers[lr];if(!_n)continue;let qr=At(_n,hi,It.canonical);qr.length>0&&Li.addLayer(qr)}let er=fi(Li);return this.overzoomedTileResultCache.set(Nt,er),er}reloadTile(Pe){return V._(this,void 0,void 0,(function*(){let Ve=Pe.uid,Ye=this.tileState.getLoaded(Ve);if(!Ye)throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");if(Ye.showCollisionBoxes=Pe.showCollisionBoxes,Ye.status==="parsing"){let It=this.tileState.consumeParsing(Ve);return yield this._parseWorkerTile(Ye,Pe,It)}if(Ye.status==="done"&&Ye.vectorTile)return yield this._parseWorkerTile(Ye,Pe)}))}abortTile(Pe){return V._(this,void 0,void 0,(function*(){this.tileState.abort(Pe.uid)}))}removeTile(Pe){return V._(this,void 0,void 0,(function*(){this.tileState.removeLoaded(Pe.uid)}))}}class Ut{constructor(){this.loaded={}}loadTile(Pe){return V._(this,void 0,void 0,(function*(){let{uid:Ve,encoding:Ye,rawImageData:It,redFactor:jt,greenFactor:Si,blueFactor:hi,baseShift:Nt}=Pe,vi=It.width+2,Li=It.height+2,pi=V.b(It)?new V.R({width:vi,height:Li},yield V.cY(It,-1,-1,vi,Li)):It,er=new V.cZ(Ve,pi,Ye,jt,Si,hi,Nt);return this.loaded||(this.loaded={}),this.loaded[Ve]=er,er}))}removeTile(Pe){let Ve=this.loaded,Ye=Pe.uid;Ve?.[Ye]&&delete Ve[Ye]}}class Mi{constructor(Pe,Ve,Ye,It=li){this.actor=Pe,this.layerIndex=Ve,this.availableImages=Ye,this.tileState=new ct,this._createGeoJSONIndex=It}loadVectorTile(Pe){if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");let{z:Ve,x:Ye,y:It}=Pe.tileID.canonical,jt=this._geoJSONIndex.getTile(Ve,Ye,It);return jt?fi(new V.c_(jt.features,{version:2,extent:V.a6})):null}loadTile(Pe){return V._(this,void 0,void 0,(function*(){let{uid:Ve}=Pe,Ye=new Ne(Pe);Ye.abort=new AbortController;try{let It=this.loadVectorTile(Pe);if(!It)return null;let{vectorTile:jt,rawData:Si}=It;Ye.vectorTile=jt,this.tileState.markLoaded(Ve,Ye);let hi={rawData:Si};this.tileState.setParsing(Ve,hi);try{return yield this._parseWorkerTile(Ye,Pe,hi)}finally{this.tileState.clearParsing(Ve)}}catch(It){throw Ye.status="done",this.tileState.markLoaded(Ve,Ye),It}}))}_reloadLoadedTile(Pe){return V._(this,void 0,void 0,(function*(){let Ve=Pe.uid,Ye=this.tileState.getLoaded(Ve);if(!Ye)throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");if(Ye.showCollisionBoxes=Pe.showCollisionBoxes,Ye.status==="parsing"){let It=this.tileState.consumeParsing(Ve);return yield this._parseWorkerTile(Ye,Pe,It)}if(Ye.status==="done"&&Ye.vectorTile)return yield this._parseWorkerTile(Ye,Pe)}))}_parseWorkerTile(Pe,Ve,Ye){return V._(this,void 0,void 0,(function*(){let It=yield Pe.parse(Pe.vectorTile,this.layerIndex,this.availableImages,this.actor,Ve.subdivisionGranularity);if(Ye){let{rawData:jt}=Ye;It=V.e({rawTileData:jt.slice(0),encoding:"mvt"},It)}return It}))}abortTile(Pe){return V._(this,void 0,void 0,(function*(){this.tileState.abort(Pe.uid)}))}removeTile(Pe){return V._(this,void 0,void 0,(function*(){this.tileState.removeLoaded(Pe.uid)}))}loadData(Pe){return V._(this,void 0,void 0,(function*(){var Ve;
vendor: 13,592 bytes, line 2
2(Ve=this._pendingRequest)===null||Ve===void 0||Ve.abort();let Ye=this._startRequestTiming(Pe);this._pendingRequest=new AbortController;try{yield this.loadAndProcessGeoJSON(Pe,this._pendingRequest),delete this._pendingRequest,this.tileState.clearLoaded();let It={};return Pe.request&&(It.data=Pe.data),this._finishRequestTiming(Ye,Pe,It),It}catch(It){if(delete this._pendingRequest,!V.$(It))throw It;return{abandoned:!0}}}))}_startRequestTiming(Pe){var Ve;if(!((Ve=Pe.request)===null||Ve===void 0)&&Ve.collectResourceTiming)return new Ze(Pe.request.url)}_finishRequestTiming(Pe,Ve,Ye){let It=Pe?.finish();It&&(Ye.resourceTiming={[Ve.source]:JSON.parse(JSON.stringify(It))})}reloadTile(Pe){return this.tileState.getLoaded(Pe.uid)?this._reloadLoadedTile(Pe):this.loadTile(Pe)}loadAndProcessGeoJSON(Pe,Ve){return V._(this,void 0,void 0,(function*(){var Ye;if(Pe.request&&(Pe.data=(yield V.k(Pe.request,Ve)).data),Pe.data)return Pe.data=this._filterGeoJSON(Pe.data,Pe.filter),void(this._geoJSONIndex=this._createGeoJSONIndex(Pe.data,Pe));if(Pe.dataDiff)return(Ye=this._geoJSONIndex)!==null&&Ye!==void 0||(this._geoJSONIndex=this._createGeoJSONIndex({type:"FeatureCollection",features:[]},Pe)),void this._geoJSONIndex.updateData(Pe.dataDiff,this._getFilterPredicate(Pe.filter));if(Pe.updateCluster&&this._geoJSONIndex.updateClusterOptions(Pe.geojsonVtOptions.cluster,ki(Pe)),this._geoJSONIndex==null)throw new Error(`Input data given to '${Pe.source}' is not a valid GeoJSON object.`)}))}_filterGeoJSON(Pe,Ve){if(Pe.type!=="FeatureCollection")return Pe;let Ye=this._getFilterPredicate(Ve);return Ye?{type:"FeatureCollection",features:Pe.features.filter((It=>Ye(It)))}:Pe}_getFilterPredicate(Pe){if(typeof Pe!="boolean"&&!Pe?.length)return;let Ve=V.c$(Pe,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Ve.result==="error")throw new Error(Ve.value.map((Ye=>`${Ye.key}: ${Ye.message}`)).join(", "));return Ye=>Ve.value.evaluate({zoom:0},Ye)}removeSource(Pe){return V._(this,void 0,void 0,(function*(){var Ve;(Ve=this._pendingRequest)===null||Ve===void 0||Ve.abort()}))}getClusterExpansionZoom(Pe){return this._geoJSONIndex.getClusterExpansionZoom(Pe.clusterId)}getClusterChildren(Pe){return this._geoJSONIndex.getClusterChildren(Pe.clusterId)}getClusterLeaves(Pe){return this._geoJSONIndex.getClusterLeaves(Pe.clusterId,Pe.limit,Pe.offset)}}function li(ci,Pe){let Ve=V.e(Pe.geojsonVtOptions||{},{updateable:!0,clusterOptions:ki(Pe)});return new V.d0(ci,Ve)}function ki({geojsonVtOptions:ci,clusterProperties:Pe}){if(!Pe||!ci.clusterOptions)return ci.clusterOptions;let Ve={},Ye={},It={accumulated:null,zoom:0},jt={properties:null},Si=Object.keys(Pe);for(let hi of Si){let[Nt,vi]=Pe[hi],Li=V.c$(vi),pi=V.c$(typeof Nt=="string"?[Nt,["accumulated"],["get",hi]]:Nt);Ve[hi]=Li.value,Ye[hi]=pi.value}return ci.clusterOptions.map=hi=>{jt.properties=hi;let Nt={};for(let vi of Si)Nt[vi]=Ve[vi].evaluate(It,jt);return Nt},ci.clusterOptions.reduce=(hi,Nt)=>{jt.properties=Nt;for(let vi of Si)It.accumulated=hi[vi],hi[vi]=Ye[vi].evaluate(It,jt)},ci.clusterOptions}class wi{constructor(Pe){this.self=Pe,this.actor=new V.N(Pe),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.self.registerWorkerSource=(Ve,Ye)=>{if(this.externalWorkerSourceTypes[Ve])throw new Error(`Worker source with name "${Ve}" already registered.`);this.externalWorkerSourceTypes[Ve]=Ye},this.self.addProtocol=V.cH,this.self.removeProtocol=V.cI,this.self.registerRTLTextPlugin=Ve=>{V.d1.setMethods(Ve)},this.self.makeRequest=V.m,this.actor.registerMessageHandler("LDT",((Ve,Ye)=>this._getDEMWorkerSource(Ve,Ye.source).loadTile(Ye))),this.actor.registerMessageHandler("RDT",((Ve,Ye)=>V._(this,void 0,void 0,(function*(){this._getDEMWorkerSource(Ve,Ye.source).removeTile(Ye)})))),this.actor.registerMessageHandler("GCEZ",((Ve,Ye)=>V._(this,void 0,void 0,(function*(){return this._getWorkerSource(Ve,Ye.type,Ye.source).getClusterExpansionZoom(Ye)})))),this.actor.registerMessageHandler("GCC",((Ve,Ye)=>V._(this,void 0,void 0,(function*(){return this._getWorkerSource(Ve,Ye.type,Ye.source).getClusterChildren(Ye)})))),this.actor.registerMessageHandler("GCL",((Ve,Ye)=>V._(this,void 0,void 0,(function*(){return this._getWorkerSource(Ve,Ye.type,Ye.source).getClusterLeaves(Ye)})))),this.actor.registerMessageHandler("LD",((Ve,Ye)=>this._getWorkerSource(Ve,Ye.type,Ye.source).loadData(Ye))),this.actor.registerMessageHandler("LT",((Ve,Ye)=>this._getWorkerSource(Ve,Ye.type,Ye.source).loadTile(Ye))),this.actor.registerMessageHandler("RT",((Ve,Ye)=>this._getWorkerSource(Ve,Ye.type,Ye.source).reloadTile(Ye))),this.actor.registerMessageHandler("AT",((Ve,Ye)=>this._getWorkerSource(Ve,Ye.type,Ye.source).abortTile(Ye))),this.actor.registerMessageHandler("RMT",((Ve,Ye)=>this._getWorkerSource(Ve,Ye.type,Ye.source).removeTile(Ye))),this.actor.registerMessageHandler("RS",((Ve,Ye)=>V._(this,void 0,void 0,(function*(){var It,jt;if(!(!((jt=(It=this.workerSources[Ve])===null||It===void 0?void 0:It[Ye.type])===null||jt===void 0)&&jt[Ye.source]))return;let Si=this.workerSources[Ve][Ye.type][Ye.source];delete this.workerSources[Ve][Ye.type][Ye.source],Si.removeSource!==void 0&&Si.removeSource(Ye)})))),this.actor.registerMessageHandler("RM",(Ve=>V._(this,void 0,void 0,(function*(){delete this.layerIndexes[Ve],delete this.availableImages[Ve],delete this.workerSources[Ve],delete this.demWorkerSources[Ve],this.globalStates.delete(Ve)})))),this.actor.registerMessageHandler("SR",((Ve,Ye)=>V._(this,void 0,void 0,(function*(){this.referrer=Ye})))),this.actor.registerMessageHandler("SRPS",((Ve,Ye)=>this._syncRTLPluginState(Ve,Ye))),this.actor.registerMessageHandler("IS",((Ve,Ye)=>V._(this,void 0,void 0,(function*(){this.self.importScripts(Ye)})))),this.actor.registerMessageHandler("SI",((Ve,Ye)=>this._setImages(Ve,Ye))),this.actor.registerMessageHandler("UL",((Ve,Ye)=>V._(this,void 0,void 0,(function*(){this._getLayerIndex(Ve).update(Ye.layers,Ye.removedIds,this._getGlobalState(Ve))})))),this.actor.registerMessageHandler("UGS",((Ve,Ye)=>V._(this,void 0,void 0,(function*(){let It=this._getGlobalState(Ve);for(let jt in Ye)It[jt]=Ye[jt]})))),this.actor.registerMessageHandler("SL",((Ve,Ye)=>V._(this,void 0,void 0,(function*(){this._getLayerIndex(Ve).replace(Ye,this._getGlobalState(Ve))}))))}_getGlobalState(Pe){let Ve=this.globalStates.get(Pe);return Ve||(Ve={},this.globalStates.set(Pe,Ve)),Ve}_setImages(Pe,Ve){return V._(this,void 0,void 0,(function*(){this.availableImages[Pe]=Ve;for(let Ye in this.workerSources[Pe]){let It=this.workerSources[Pe][Ye];for(let jt in It)It[jt].availableImages=Ve}}))}_syncRTLPluginState(Pe,Ve){return V._(this,void 0,void 0,(function*(){return yield V.d1.syncState(Ve,this.self.importScripts)}))}_getAvailableImages(Pe){let Ve=this.availableImages[Pe];return Ve||(Ve=[]),Ve}_getLayerIndex(Pe){let Ve=this.layerIndexes[Pe];return Ve||(Ve=this.layerIndexes[Pe]=new o),Ve}_getWorkerSource(Pe,Ve,Ye){var It,jt;if((It=this.workerSources)[Pe]||(It[Pe]={}),(jt=this.workerSources[Pe])[Ve]||(jt[Ve]={}),!this.workerSources[Pe][Ve][Ye]){let Si={sendAsync:(hi,Nt)=>(hi.targetMapId=Pe,this.actor.sendAsync(hi,Nt))};switch(Ve){case"vector":this.workerSources[Pe][Ve][Ye]=new He(Si,this._getLayerIndex(Pe),this._getAvailableImages(Pe));break;case"geojson":this.workerSources[Pe][Ve][Ye]=new Mi(Si,this._getLayerIndex(Pe),this._getAvailableImages(Pe));break;default:this.workerSources[Pe][Ve][Ye]=new this.externalWorkerSourceTypes[Ve](Si,this._getLayerIndex(Pe),this._getAvailableImages(Pe))}}return this.workerSources[Pe][Ve][Ye]}_getDEMWorkerSource(Pe,Ve){var Ye,It;return(Ye=this.demWorkerSources)[Pe]||(Ye[Pe]={}),(It=this.demWorkerSources[Pe])[Ve]||(It[Ve]=new Ut),this.demWorkerSources[Pe][Ve]}}return V.i(self)&&(self.worker=new wi(self)),wi})),F("index",["exports","./shared"],(function(V,o){"use strict";var pe="5.24.0";function Ne(){var _=new o.A(4);return o.A!=Float32Array&&(_[1]=0,_[2]=0),_[0]=1,_[3]=1,_}let Qe,ct,Ze,Bt={frame(_,t,a,p){let f=p||window,b=f.requestAnimationFrame((D=>{P(),t(D)})),{unsubscribe:P}=o.s(_.signal,"abort",(()=>{P(),f.cancelAnimationFrame(b),a(new o.a(_.signal.reason))}),!1)},frameAsync(_,t){return new Promise(((a,p)=>{this.frame(_,a,p,t)}))},getImageData(_,t=0){return this.getImageCanvasContext(_).getImageData(-t,-t,_.width+2*t,_.height+2*t)},getImageCanvasContext(_){let t=window.document.createElement("canvas"),a=t.getContext("2d",{willReadFrequently:!0});if(!a)throw new Error("failed to create canvas 2d context");return t.width=_.width,t.height=_.height,a.drawImage(_,0,0,_.width,_.height),a},resolveURL:_=>(Qe||(Qe=document.createElement("a")),Qe.href=_,Qe.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return Ze!==void 0?Ze:!!matchMedia&&(ct!=null||(ct=matchMedia("(prefers-reduced-motion: reduce)")),ct.matches)},set prefersReducedMotion(_){Ze=_}},Ct=new class{constructor(){this._frozenAt=null}getCurrentTime(){return this._frozenAt!==null?this._frozenAt:performance.now()}setNow(_){this._frozenAt=_}restoreNow(){this._frozenAt=null}isFrozen(){return this._frozenAt!==null}};function Mt(){return Ct.getCurrentTime()}var fi,At;class He{static create(t,a,p){let f=window.document.createElement(t);return a!==void 0&&(f.className=a),p&&p.appendChild(f),f}static createNS(t,a){return window.document.createElementNS(t,a)}static disableDrag(){He.docStyle&&He.selectProp&&(He.userSelect=He.docStyle[He.selectProp],He.docStyle[He.selectProp]="none")}static enableDrag(){He.docStyle&&He.selectProp&&(He.docStyle[He.selectProp]=He.userSelect)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",He.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",He.suppressClickInternal,!0),window.setTimeout((()=>{window.removeEventListener("click",He.suppressClickInternal,!0)}),0)}static getScale(t){let a=t.getBoundingClientRect();return{x:a.width/t.offsetWidth||1,y:a.height/t.offsetHeight||1,boundingClientRect:a}}static getPoint(t,a,p){let f=a.boundingClientRect;return new o.P((p.clientX-f.left)/a.x-t.clientLeft,(p.clientY-f.top)/a.y-t.clientTop)}static mousePos(t,a){let p=He.getScale(t);return He.getPoint(t,p,a)}static touchPos(t,a){let p=[],f=He.getScale(t);for(let b of a)p.push(He.getPoint(t,f,b));return p}static sanitize(t){let a=new DOMParser().parseFromString(t,"text/html").body||document.createElement("body"),p=a.querySelectorAll("script");for(let f of p)f.remove();return He.clean(a),a.innerHTML}static isPossiblyDangerous(t,a){let p=a.replace(/\s+/g,"").toLowerCase();return!(!["src","href","xlink:href"].includes(t)||!p.includes("javascript:")&&!p.includes("data:"))||!!t.startsWith("on")||void 0}static clean(t){let a=t.children;for(let p of a)He.removeAttributes(p),He.clean(p)}static removeAttributes(t){for(let{name:a,value:p}of t.attributes)He.isPossiblyDangerous(a,p)&&t.removeAttribute(a)}}He.docStyle=typeof window<"u"&&((fi=window.document)===null||fi===void 0?void 0:fi.documentElement.style),He.selectProp=!He.docStyle||"userSelect"in He.docStyle?"userSelect":"webkitUserSelect",(function(_){let t,a,p,f;_.resetRequestQueue=()=>{t=[],a=0,p=0,f={}},_.addThrottleControl=B=>{let U=p++;return f[U]=B,U},_.removeThrottleControl=B=>{delete f[B],P()},_.getImage=(B,U,$=!0)=>new Promise(((Y,ee)=>{B.headers||(B.headers={}),B.headers.accept="image/webp,*/*",o.e(B,{type:"image"}),t.push({abortController:U,requestParameters:B,supportImageRefresh:$,state:"queued",onError:oe=>{ee(oe)},onSuccess:oe=>{Y(oe)}}),P()}));let b=B=>o._(this,void 0,void 0,(function*(){B.state="running";let{requestParameters:U,supportImageRefresh:$,onError:Y,onSuccess:ee,abortController:oe}=B,_e=$===!1&&!o.i(self)&&!o.g(U.url)&&(!U.headers||Object.keys(U.headers).reduce(((Ee,De)=>Ee&&De==="accept"),!0));a++;let Ie=_e?D(U,oe):o.m(U,oe);try{let Ee=yield Ie;delete B.abortController,B.state="completed",Ee.data instanceof HTMLImageElement||o.b(Ee.data)?ee(Ee):Ee.data&&ee({data:yield(ze=Ee.data,typeof createImageBitmap=="function"?o.h(ze):o.j(ze)),cacheControl:Ee.cacheControl,expires:Ee.expires})}catch(Ee){delete B.abortController,Y(o.d(Ee))}finally{a--,P()}var ze})),P=()=>{let B=(()=>{for(let U of Object.keys(f))if(f[U]())return!0;return!1})()?o.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:o.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let U=a;U<B&&t.length>0;U++){let $=t.shift();$.abortController.signal.aborted?U--:b($)}},D=(B,U)=>new Promise((($,Y)=>{let ee=new Image,oe=B.url,_e=B.credentials;_e&&_e==="include"?ee.crossOrigin="use-credentials":(_e&&_e==="same-origin"||!o.f(oe))&&(ee.crossOrigin="anonymous"),U.signal.addEventListener("abort",(()=>{ee.src="",Y(new o.a(U.signal.reason))})),ee.fetchPriority="high",ee.onload=()=>{ee.onerror=ee.onload=null,$({data:ee})},ee.onerror=()=>{ee.onerror=ee.onload=null,U.signal.aborted||Y(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."))},ee.src=oe}))})(At||(At={})),At.resetRequestQueue();class Ut{constructor(t){this._transformRequestFn=t??null}transformRequest(t,a){return this._transformRequestFn&&this._transformRequestFn(t,a)||{url:t}}setTransformRequest(t){this._transformRequestFn=t}}function Mi(_){let t=[];if(typeof _=="string")t.push({id:"default",url:_});else if(_&&_.length>0){let a=[];for(let{id:p,url:f}of _){let b=`${p}${f}`;a.includes(b)||(a.push(b),t.push({id:p,url:f}))}}return t}function li(_,t,a){try{let p=new URL(_);return p.pathname+=`${t}${a}
2`,p.toString()}catch{throw new Error(`Invalid sprite URL "${_}", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}function ki(_){let{userImage:t}=_;return!(!t?.render||!t.render()||(_.data.replace(new Uint8Array(t.data.buffer)),0))}class wi extends o.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new o.R({width:1,height:1}),this.dirty=!0}destroy(){this.atlasTexture&&(this.atlasTexture.destroy(),this.atlasTexture=null);for(let t of Object.keys(this.images))this.removeImage(t);this.patterns={},this.atlasImage=new o.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(let{ids:a,promiseResolve:p}of this.requestors)p(this._getImagesForIds(a));this.requestors=[]}}getImage(t){let a=this.images[t];if(a&&!a.data&&a.spriteData){let p=a.spriteData;a.data=new o.R({width:p.width,height:p.height},p.context.getImageData(p.x,p.y,p.width,p.height).data),a.spriteData=null}return a}
2addImage(t,a){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,a)&&(this.images[t]=a)}_validate(t,a){let p=!0,f=a.data||a.spriteData;return this._validateStretch(a.stretchX,f?.width)||(this.fire(new o.l(new Error(`Image "${t}" has invalid "stretchX" value`))),p=!1),this._validateStretch(a.stretchY,f?.height)||(this.fire(new o.l(new Error(`Image "${t}" has invalid "stretchY" value`))),p=!1),this._validateContent(a.content,a)||(this.fire(new o.l(new Error(`Image "${t}" has invalid "content" value`))),p=!1),p}_validateStretch(t,a){if(!t)return!0;let p=0;for(let f of t){if(f[0]<p||f[1]<f[0]||a<f[1])return!1;p=f[1]}return!0}_validateContent(t,a){if(!t)return!0;if(t.length!==4)return!1;let p=a.spriteData,f=p?.width||a.data.width,b=p?.height||a.data.height;return!(t[0]<0||f<t[0]||t[1]<0||b<t[1]||t[2]<0||f<t[2]||t[3]<0||b<t[3]||t[2]<t[0]||!(t[3]>=t[1]))}updateImage(t,a,p=!0){let f=this.getImage(t);if(p&&(f.data.width!==a.data.width||f.data.height!==a.data.height))throw new Error(`size mismatch between old image (${f.data.width}x${f.data.height}) and new image (${a.data.width}x${a.data.height}).`);a.version=f.version+1,this.images[t]=a,this.updatedImages[t]=!0}removeImage(t){var a;let p=this.images[t];delete this.images[t],delete this.patterns[t],!((a=p.userImage)===null||a===void 0)&&a.onRemove&&p.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(t){return new Promise(((a,p)=>{let f=!0;if(!this.isLoaded())for(let b of t)this.images[b]||(f=!1);this.isLoaded()||f?a(this._getImagesForIds(t)):this.requestors.push({ids:t,promiseResolve:a})}))}_getImagesForIds(t){var a;let p={};for(let f of t){let b=this.getImage(f);b||(this.fire(new o.n("styleimagemissing",{id:f})),b=this.getImage(f)),b?p[f]={data:b.data.clone(),pixelRatio:b.pixelRatio,sdf:b.sdf,version:b.version,stretchX:b.stretchX,stretchY:b.stretchY,content:b.content,textFitWidth:b.textFitWidth,textFitHeight:b.textFitHeight,hasRenderCallback:!!(!((a=b.userImage)===null||a===void 0)&&a.render)}:o.w(`Image "${f}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return p}getPixelSize(){let{width:t,height:a}=this.atlasImage;return{width:t,height:a}}getPattern(t){let a=this.patterns[t],p=this.getImage(t);if(!p)return null;if(a&&a.position.version===p.version)return a.position;if(a)a.position.version=p.version;else{let f={w:p.data.width+2,h:p.data.height+2,x:0,y:0},b=new o.I(f,p);this.patterns[t]={bin:f,position:b}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){let a=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new o.T(t,this.atlasImage,a.RGBA),this.atlasTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE)}_updatePatternAtlas(){let t=[];for(let b in this.patterns)t.push(this.patterns[b].bin);let{w:a,h:p}=o.p(t),f=this.atlasImage;f.resize({width:a||1,height:p||1});for(let b in this.patterns){let{bin:P}=this.patterns[b],D=P.x+1,B=P.y+1,U=this.getImage(b).data,$=U.width,Y=U.height;o.R.copy(U,f,{x:0,y:0},{x:D,y:B},{width:$,height:Y}),o.R.copy(U,f,{x:0,y:Y-1},{x:D,y:B-1},{width:$,height:1}),o.R.copy(U,f,{x:0,y:0},{x:D,y:B+Y},{width:$,height:1}),o.R.copy(U,f,{x:$-1,y:0},{x:D-1,y:B},{width:1,height:Y}),o.R.copy(U,f,{x:0,y:0},{x:D+$,y:B},{width:1,height:Y})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(let a of t){if(this.callbackDispatchedThisFrame[a])continue;this.callbackDispatchedThisFrame[a]=!0;let p=this.getImage(a);p||o.w(`Image with ID: "${a}" was not found`),ki(p)&&this.updateImage(a,p)}}cloneImages(){let t={};for(let a in this.images){let p=this.images[a];t[a]=Object.assign(Object.assign({},p),{data:p.data?p.data.clone():null})}return t}}let ci=1e20,Pe=new Float64Array(256);for(let _=0;_<256;_++){let t=.5-Math.pow(_/255,.45454545454545453);Pe[_]=t*Math.abs(t)}function Ve(_,t,a,p,f,b,P,D,B){for(let U=t;U<t+p;U++)Ye(_,a*b+U,b,f,P,D,B);for(let U=a;U<a+f;
vendor: 29,085 bytes, line 2
2U++)Ye(_,U*b+t,1,p,P,D,B)}function Ye(_,t,a,p,f,b,P){b[0]=0,P[0]=-ci,P[1]=ci,f[0]=_[t];for(let D=1,B=0,U=0;D<p;D++){f[D]=_[t+D*a];let $=D*D;do{let Y=b[B];U=(f[D]-f[Y]+$-Y*Y)/(D-Y)/2}while(U<=P[B]&&--B>-1);B++,b[B]=D,P[B]=U,P[B+1]=ci}for(let D=0,B=0;D<p;D++){for(;P[B+1]<D;)B++;let U=b[B],$=D-U;_[t+D*a]=f[U]+$*$}}Pe[255]=-ci;let It=o.v.layout_symbol["text-font"].default.join(",");class jt{constructor(t,a,p){this.requestManager=t,this.localIdeographFontFamily=a,this.entries={},this.lang=p}setURL(t){this.url=t}getGlyphs(t){return o._(this,void 0,void 0,(function*(){let a=[];for(let b in t)for(let P of t[b])a.push(this._getAndCacheGlyphsPromise(b,P));let p=yield Promise.all(a),f={};for(let{stack:b,id:P,glyph:D}of p)f[b]||(f[b]={}),f[b][P]=D&&{id:D.id,bitmap:D.bitmap.clone(),metrics:D.metrics};return f}))}_getAndCacheGlyphsPromise(t,a){return o._(this,void 0,void 0,(function*(){var p,f;(p=(f=this.entries)[t])!==null&&p!==void 0||(f[t]={glyphs:{},requests:{},ranges:{}});let b=this.entries[t],P=b.glyphs[a];return P!==void 0?{stack:t,id:a,glyph:P}:!this.url||this._charUsesLocalIdeographFontFamily(a)?(P=b.glyphs[a]=this._drawGlyph(b,t,a),{stack:t,id:a,glyph:P}):yield this._downloadAndCacheRangePromise(t,a)}))}_downloadAndCacheRangePromise(t,a){return o._(this,void 0,void 0,(function*(){var p;let f=this.entries[t],b=Math.floor(a/256);if(f.ranges[b])return{stack:t,id:a,glyph:null};(p=f.requests)[b]||(p[b]=jt.loadGlyphRange(t,b,this.url,this.requestManager));try{let P=yield f.requests[b];for(let D in P)f.glyphs[+D]=P[+D];return f.ranges[b]=!0,{stack:t,id:a,glyph:P[a]||null}}catch(P){let D=f.glyphs[a]=this._drawGlyph(f,t,a);return this._warnOnMissingGlyphRange(D,b,a,o.d(P)),{stack:t,id:a,glyph:D}}}))}_warnOnMissingGlyphRange(t,a,p,f){let b=256*a,P=b+255,D=p.toString(16).padStart(4,"0").toUpperCase();o.w(`Unable to load glyph range ${a}, ${b}-${P}. Rendering codepoint U+${D} locally instead. ${f}`)}_charUsesLocalIdeographFontFamily(t){return!!this.localIdeographFontFamily&&o.r(t)}_drawGlyph(t,a,p){let f=a===It&&this.localIdeographFontFamily!==""&&this._charUsesLocalIdeographFontFamily(p),b=f?"ideographTinySDF":"tinySDF";t[b]||(t[b]=this._createTinySDF(f?this.localIdeographFontFamily:a));let P=t[b].draw(String.fromCodePoint(p)),D=/^\p{gc=Cf}+$/u.test(String.fromCodePoint(p));return{id:p,bitmap:new o.t({width:P.width||60,height:P.height||60},P.data),metrics:{width:D?0:P.glyphWidth/2||24,height:P.glyphHeight/2||24,left:P.glyphLeft/2+.5||0,top:P.glyphTop/2-27.5||-8,advance:D?0:P.glyphAdvance/2||24,isDoubleResolution:!0}}}_createTinySDF(t){let a=t?t.split(","):[];a.push("sans-serif");let p=a.map((f=>/[-\w]+/.test(f)?f:`'${CSS.escape(f)}'`)).join(",");return new jt.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:p,fontWeight:this._fontWeight(a[0]),fontStyle:this._fontStyle(a[0]),lang:this.lang})}_fontStyle(t){return/italic/i.test(t)?"italic":/oblique/i.test(t)?"oblique":"normal"}_fontWeight(t){let a={thin:100,hairline:100,"extra light":200,"ultra light":200,light:300,normal:400,regular:400,medium:500,semibold:600,demibold:600,bold:700,"extra bold":800,"ultra bold":800,black:900,heavy:900,"extra black":950,"ultra black":950},p;for(let[f,b]of Object.entries(a))new RegExp(`\\b${f}\\b`,"i").test(t)&&(p=`${b}`);return p}destroy(){for(let t in this.entries){let a=this.entries[t];a.tinySDF=null,a.ideographTinySDF=null,a.glyphs={},a.requests={},a.ranges={}}this.entries={}}}jt.loadGlyphRange=function(_,t,a,p){return o._(this,void 0,void 0,(function*(){let f=256*t,b=f+255,P=yield p.transformRequest(a.replace("{fontstack}",_).replace("{range}",`${f}-${b}`),"Glyphs"),D=yield o.o(P,new AbortController);if(!D?.data)throw new Error(`Could not load glyph range. range: ${t}, ${f}-${b}`);let B={};for(let U of o.q(D.data))B[U.id]=U;return B}))},jt.TinySDF=class{constructor({fontSize:_=24,buffer:t=3,radius:a=8,cutoff:p=.25,fontFamily:f="sans-serif",fontWeight:b="normal",fontStyle:P="normal",lang:D=null}={}){this.buffer=t,this.radius=a,this.cutoff=p,this.lang=D;let B=this.size=_+4*t,U=this._createCanvas(B),$=this.ctx=U.getContext("2d",{willReadFrequently:!0});$.font=`${P} ${b} ${_}px ${f}`,$.textBaseline="alphabetic",$.textAlign="left",$.fillStyle="black",this.gridOuter=new Float64Array(B*B),this.gridInner=new Float64Array(B*B),this.f=new Float64Array(B),this.z=new Float64Array(B+1),this.v=new Uint16Array(B)}_createCanvas(_){if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(_,_);let t=document.createElement("canvas");return t.width=t.height=_,t}draw(_){let{width:t,actualBoundingBoxAscent:a,actualBoundingBoxDescent:p,actualBoundingBoxLeft:f,actualBoundingBoxRight:b}=this.ctx.measureText(_),P=Math.ceil(a),D=Math.floor(f),B=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(b)-D)),U=Math.max(0,Math.min(this.size-this.buffer,P+Math.ceil(p))),$=B+2*this.buffer,Y=U+2*this.buffer,ee=Math.max($*Y,0),oe=new Uint8ClampedArray(ee),_e={data:oe,width:$,height:Y,glyphWidth:B,glyphHeight:U,glyphTop:P,glyphLeft:D,glyphAdvance:t};if(B===0||U===0)return _e;let{ctx:Ie,buffer:ze,gridInner:Ee,gridOuter:De}=this;this.lang&&(Ie.lang=this.lang),Ie.clearRect(ze,ze,B,U),Ie.fillText(_,ze-D,ze+P);let je=Ie.getImageData(ze,ze,B,U);De.fill(ci,0,ee),Ee.fill(0,0,ee);let Le=3;for(let Fe=0;Fe<U;Fe++){let it=(Fe+ze)*$+ze;for(let ft=0;ft<B;ft++,Le+=4,it++){let _t=je.data[Le];if(_t===0)continue;let Rt=Pe[_t];De[it]=Math.max(0,Rt),Ee[it]=Math.max(0,-Rt)}}Ve(De,0,0,$,Y,$,this.f,this.v,this.z),Ve(Ee,ze,ze,B,U,$,this.f,this.v,this.z);let we=255/this.radius,qe=255*(1-this.cutoff);for(let Fe=0;Fe<ee;Fe++){let it=Math.sqrt(De[Fe])-Math.sqrt(Ee[Fe]);oe[Fe]=Math.round(qe-we*it)}return _e}};class Si{constructor(){this.specification=o.x.light.position}possiblyEvaluate(t,a){return o.G(t.expression.evaluate(a))}interpolate(t,a,p){return{x:o.H.number(t.x,a.x,p),y:o.H.number(t.y,a.y,p),z:o.H.number(t.z,a.z,p)}}}let hi;class Nt extends o.E{constructor(t){super(),hi||(hi=new o.u({anchor:new o.D(o.x.light.anchor),position:new Si,color:new o.D(o.x.light.color),intensity:new o.D(o.x.light.intensity)})),this._transitionable=new o.y(hi,void 0),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,a={}){if(!this._validate(o.z,t,a))for(let p in t){let f=t[p];p.endsWith(o.B)?this._transitionable.setTransition(p.slice(0,-o.B.length),f):this._transitionable.setValue(p,f)}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,a,p){return p?.validate!==!1&&o.C(this,t.call(o.F,{value:a,style:{glyphs:!0,sprite:!0},styleSpec:o.x}))}}let vi=new o.u({"sky-color":new o.D(o.x.sky["sky-color"]),"horizon-color":new o.D(o.x.sky["horizon-color"]),"fog-color":new o.D(o.x.sky["fog-color"]),"fog-ground-blend":new o.D(o.x.sky["fog-ground-blend"]),"horizon-fog-blend":new o.D(o.x.sky["horizon-fog-blend"]),"sky-horizon-blend":new o.D(o.x.sky["sky-horizon-blend"]),"atmosphere-blend":new o.D(o.x.sky["atmosphere-blend"])});class Li extends o.E{constructor(t){super(),this._transitionable=new o.y(vi,void 0),this.setSky(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new o.J(0))}setSky(t,a={}){if(!this._validate(o.K,t,a)){t||(t={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(let p in t){let f=t[p];p.endsWith(o.B)?this._transitionable.setTransition(p.slice(0,-o.B.length),f):this._transitionable.setValue(p,f)}}}getSky(){return this._transitionable.serialize()}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,a,p={}){return p?.validate!==!1&&o.C(this,t.call(o.F,o.e({value:a,style:{glyphs:!0,sprite:!0},styleSpec:o.x})))}calculateFogBlendOpacity(t){return t<60?0:t<70?(t-60)/10:1}}class pi{constructor(t,a){this.width=t,this.height=a,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(t,a){var p;let f=t.join(",")+String(a);return(p=this.dashEntry)[f]||(p[f]=this.addDash(t,a)),this.dashEntry[f]}getDashRanges(t,a,p){let f=[],b=t.length%2==1?-t[t.length-1]*p:0,P=t[0]*p,D=!0;f.push({left:b,right:P,isDash:D,zeroLength:t[0]===0});let B=t[0];for(let U=1;U<t.length;U++){D=!D;let $=t[U];b=B*p,B+=$,P=B*p,f.push({left:b,right:P,isDash:D,zeroLength:$===0})}return f}addRoundDash(t,a,p){let f=a/2;for(let b=-p;b<=p;b++){let P=this.width*(this.nextRow+p+b),D=0,B=t[D];for(let U=0;U<this.width;U++){U/B.right>1&&(B=t[++D]);let $=Math.abs(U-B.left),Y=Math.abs(U-B.right),ee=Math.min($,Y),oe,_e=b/p*(f+1);if(B.isDash){let Ie=f-Math.abs(_e);oe=Math.sqrt(ee*ee+Ie*Ie)}else oe=f-Math.sqrt(ee*ee+_e*_e);this.data[P+U]=Math.max(0,Math.min(255,oe+128))}}}addRegularDash(t){for(let D=t.length-1;D>=0;--D){let B=t[D],U=t[D+1];B.zeroLength?t.splice(D,1):U&&U.isDash===B.isDash&&(U.left=B.left,t.splice(D,1))}let a=t[0],p=t[t.length-1];a.isDash===p.isDash&&(a.left=p.left-this.width,p.right=a.right+this.width);let f=this.width*this.nextRow,b=0,P=t[b];for(let D=0;D<this.width;D++){D/P.right>1&&(P=t[++b]);let B=Math.abs(D-P.left),U=Math.abs(D-P.right),$=Math.min(B,U);this.data[f+D]=Math.max(0,Math.min(255,(P.isDash?$:-$)+128))}}addDash(t,a){let p=a?7:0,f=2*p+1;if(this.nextRow+f>this.height)return o.w("LineAtlas out of space"),null;let b=0;for(let D of t)b+=D;if(b!==0){let D=this.width/b,B=this.getDashRanges(t,this.width,D);a?this.addRoundDash(B,D,p):this.addRegularDash(B)}let P={y:this.nextRow+p,height:2*p,width:b};return this.nextRow+=f,this.dirty=!0,P}bind(t){let a=t.gl;this.texture?(a.bindTexture(a.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,a.texSubImage2D(a.TEXTURE_2D,0,0,0,this.width,this.height,a.ALPHA,a.UNSIGNED_BYTE,this.data))):(this.texture=a.createTexture(),a.bindTexture(a.TEXTURE_2D,this.texture),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.REPEAT),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.REPEAT),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR),a.texImage2D(a.TEXTURE_2D,0,a.ALPHA,this.width,this.height,0,a.ALPHA,a.UNSIGNED_BYTE,this.data))}}let er="maplibre_preloaded_worker_pool";class lr{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<lr.workerCount;)this.workers.push(new Worker(o.c.WORKER_URL));return this.active[t]=!0,this.workers.slice()}release(t){if(delete this.active[t],this.numActive()===0){for(let a of this.workers)a.terminate();this.workers=null}}isPreloaded(){return!!this.active[er]}numActive(){return Object.keys(this.active).length}}let _n=Math.floor(Bt.hardwareConcurrency/2),qr,Cn;function yn(){return qr||(qr=new lr),qr}lr.workerCount=o.L(globalThis)?Math.max(Math.min(_n,3),1):1;class zo{constructor(t,a){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=a;let p=this.workerPool.acquire(a);for(let f=0;f<p.length;f++){let b=new o.N(p[f],a);b.name=`Worker ${f}`,this.actors.push(b)}if(!this.actors.length)throw new Error("No actors found")}broadcast(t,a){let p=[];for(let f of this.actors)p.push(f.sendAsync({type:t,data:a}));return Promise.all(p)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){for(let a of this.actors)a.remove();this.actors=[],t&&this.workerPool.release(this.id)}registerMessageHandler(t,a){for(let p of this.actors)p.registerMessageHandler(t,a)}unregisterMessageHandler(t){for(let a of this.actors)a.unregisterMessageHandler(t)}}function $r(){return Cn||(Cn=new zo(yn(),o.M),Cn.registerMessageHandler("GR",((_,t,a)=>o.m(t,a)))),Cn}function yo(_,t){let a=o.O();return o.Q(a,a,[1,1,0]),o.S(a,a,[.5*_.width,.5*_.height,1]),_.calculatePosMatrix?o.U(a,a,_.calculatePosMatrix(t.toUnwrapped())):a}function Dr(_,t,a,p,f,b,P){var D;let B=(function(ee,oe,_e){if(ee)for(let Ie of ee){let ze=oe[Ie];if(ze?.source===_e&&ze.type==="fill-extrusion")return!0}else for(let Ie in oe){let ze=oe[Ie];if(ze.source===_e&&ze.type==="fill-extrusion")return!0}return!1})((D=f?.layers)!==null&&D!==void 0?D:null,t,_.id),U=b.maxPitchScaleFactor(),$=_.tilesIn(p,U,B);$.sort(fa);let Y=[];for(let ee of $)Y.push({wrappedTileID:ee.tileID.wrapped().key,queryResults:ee.tile.queryRenderedFeatures(t,a,_.getState(),ee.queryGeometry,ee.cameraQueryGeometry,ee.scale,f,b,U,yo(b,ee.tileID),P?(oe,_e)=>P(ee.tileID,oe,_e):void 0)});return(function(ee,oe){for(let _e in ee)for(let Ie of ee[_e])Do(Ie,oe);return ee})((function(ee){let oe={},_e={};for(let{queryResults:Ie,wrappedTileID:ze}of ee){_e[ze]||(_e[ze]={});let Ee=_e[ze];for(let De in Ie){let je=Ie[De];Ee[De]||(Ee[De]={});let Le=Ee[De];oe[De]||(oe[De]=[]);for(let we of je)Le[we.featureIndex]||(Le[we.featureIndex]=!0,oe[De].push(we))}}return oe})(Y),_)}function fa(_,t){let a=_.tileID,p=t.tileID;return a.overscaledZ-p.overscaledZ||a.canonical.y-p.canonical.y||a.wrap-p.wrap||a.canonical.x-p.canonical.x}function Do(_,t){let a=_.feature,p=t.getFeatureState(a.layer["source-layer"],a.id);a.source=a.layer.source,a.layer["source-layer"]&&(a.sourceLayer=a.layer["source-layer"]),a.state=p}function Qn(_,t,a,p){return o._(this,void 0,void 0,(function*(){let f=_;if(_.url?f=(yield o.k(yield t.transformRequest(_.url,"Source"),a)).data:yield Bt.frameAsync(a,p),!f)return null;let b=o.V(o.e(f,_),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in f&&f.vector_layers&&(b.vectorLayerIds=f.vector_layers.map((P=>P.id))),b}))}class Ti{constructor(t,a){t&&(a?this.setSouthWest(t).setNorthEast(a):Array.isArray(t)&&(t.length===4?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof o.W?new o.W(t.lng,t.lat):o.W.convert(t),this}setSouthWest(t){return this._sw=t instanceof o.W?new o.W(t.lng,t.lat):o.W.convert(t),this}extend(t){let a=this._sw,p=this._ne,f,b;if(t instanceof o.W)f=t,b=t;else{if(!(t instanceof Ti))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(Ti.convert(t)):this.extend(o.W.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(o.W.convert(t)):this;if(f=t._sw,b=t._ne,!f||!b)return this}return a||p?(a.lng=Math.min(f.lng,a.lng),a.lat=Math.min(f.lat,a.lat),p.lng=Math.max(b.lng,p.lng),p.lat=Math.max(b.lat,p.lat)):(this._sw=new o.W(f.lng,f.lat),this._ne=new o.W(b.lng,b.lat)),this}getCenter(){return new o.W((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 o.W(this.getWest(),this.getNorth())}getSouthEast(){return new o.W(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(t){let{lng:a,lat:p}=o.W.convert(t),f=this._sw.lng<=a&&a<=this._ne.lng;return this._sw.lng>this._ne.lng&&(f=this._sw.lng>=a&&a>=this._ne.lng),this._sw.lat<=p&&p<=this._ne.lat&&f}intersects(t){if(!((t=Ti.convert(t)).getNorth()>=this.getSouth()&&t.getSouth()<=this.getNorth()))return!1;let a=Math.abs(this.getEast()-this.getWest()),p=Math.abs(t.getEast()-t.getWest());if(a>=360||p>=360)return!0;let f=o.X(this.getWest(),-180,180),b=o.X(this.getEast(),-180,180),P=o.X(t.getWest(),-180,180),D=o.X(t.getEast(),-180,180),B=f>b,U=P>D;return!(!B||!U)||(B?D>=f||P<=b:U?b>=P||f<=D:P<=b&&D>=f)}static convert(t){return t instanceof Ti?t:t&&new Ti(t)}static fromLngLat(t,a=0){let p=360*a/40075017,f=p/Math.cos(Math.PI/180*t.lat);return new Ti(new o.W(t.lng-f,t.lat-p),new o.W(t.lng+f,t.lat+p))}adjustAntiMeridian(){let t=new o.W(this._sw.lng,this._sw.lat),a=new o.W(this._ne.lng,this._ne.lat);return new Ti(t,t.lng>a.lng?new o.W(a.lng+360,a.lat):a)}}class nn{constructor(t,a,p){this.bounds=Ti.convert(this.validateBounds(t)),this.minzoom=a||0,this.maxzoom=p||24}validateBounds(t){return Array.isArray(t)&&t.length===4?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){let a=Math.pow(2,t.z),p=Math.floor(o.Z(this.bounds.getWest())*a),f=Math.floor(o.Y(this.bounds.getNorth())*a),b=Math.ceil(o.Z(this.bounds.getEast())*a),P=Math.ceil(o.Y(this.bounds.getSouth())*a);return t.x>=p&&t.x<b&&t.y>=f&&t.y<P}}class Gr extends o.E{constructor(t,a,p,f){if(super(),this.id=t,this.dispatcher=p,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,o.e(this,o.V(a,["url","scheme","tileSize","promoteId","encoding"])),this._options=o.e({type:"vector"},a),this._collectResourceTiming=a.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(f)}load(){return o._(this,arguments,void 0,(function*(t=!1){this._loaded=!1,this.fire(new o.n("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let a=yield Qn(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,a&&(o.e(this,a),a.bounds&&(this.tileBounds=new nn(a.bounds,this.minzoom,this.maxzoom)),this.fire(new o.n("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.n("data",{dataType:"source",sourceDataType:"content",sourceDataChanged:t})))}catch(a){this._tileJSONRequest=null,this._loaded=!0,o.$(a)||this.fire(new o.l(o.d(a)))}}))}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.abort(),t(),this.load(!0)}setTiles(t){return this.setSourceProperty((()=>{this._options.tiles=t})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t})),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return o.e({},this._options)}loadTile(t){return o._(this,void 0,void 0,(function*(){let a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),p={request:yield this.map._requestManager.transformRequest(a,"Tile"),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity,encoding:this.encoding,overzoomParameters:yield this._getOverzoomParameters(t),etag:t.etag};p.request.collectResourceTiming=this._collectResourceTiming;let f="RT";if(t.actor&&t.state!=="expired"){if(t.state==="loading")return new Promise(((b,P)=>{t.reloadPromise={resolve:b,reject:P}}))}else t.actor=this.dispatcher.getActor(),f="LT";t.abortController=new AbortController;try{let b=yield t.actor.sendAsync({type:f,data:p},t.abortController);if(delete t.abortController,t.aborted)return;this._afterTileLoadWorkerResponse(t,b);let P={};return b?.etagUnmodified&&(P.unmodified=!0),P}catch(b){if(delete t.abortController,t.aborted)return;if(b&&b.status!==404)throw b;this._afterTileLoadWorkerResponse(t,null)}}))}_getOverzoomParameters(t){return o._(this,void 0,void 0,(function*(){if(t.tileID.canonical.z<=this.maxzoom||this.map._zoomLevelsToOverscale===void 0)return;let a=t.tileID.scaledTo(this.maxzoom).canonical,p=a.url(this.tiles,this.map.getPixelRatio(),this.scheme);return{maxZoomTileID:a,overzoomRequest:yield this.map._requestManager.transformRequest(p,"Tile")}}))}_afterTileLoadWorkerResponse(t,a){if(a?.resourceTiming&&(t.resourceTiming=a.resourceTiming),a&&this.map._refreshExpiredTiles&&t.setExpiryData(a),t.etag=a?.etag,t.loadVectorData(a,this.map.painter),t.reloadPromise){let p=t.reloadPromise;t.reloadPromise=null,this.loadTile(t).then(p.resolve).catch(p.reject)}}abortTile(t){return o._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.actor&&(yield t.actor.sendAsync({type:"AT",data:{uid:t.uid,type:this.type,source:this.id}}))}))}unloadTile(t){return o._(this,void 0,void 0,(function*(){t.unloadVectorData(),t.actor&&(yield t.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}}))}))}hasTransition(){return!1}}class Hn extends o.E{constructor(t,a,p,f){super(),this.id=t,this.dispatcher=p,this.setEventedParent(f),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=o.e({type:"raster"},a),o.e(this,o.V(a,["url","scheme","tileSize"]))}load(){return o._(this,arguments,void 0,(function*(t=!1){this._loaded=!1,this.fire(new o.n("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let a=yield Qn(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,a&&(o.e(this,a),a.bounds&&(this.tileBounds=new nn(a.bounds,this.minzoom,this.maxzoom)),this.fire(new o.n("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.n("data",{dataType:"source",sourceDataType:"content",sourceDataChanged:t})))}catch(a){this._tileJSONRequest=null,this._loaded=!0,o.$(a)||this.fire(new o.l(o.d(a)))}}))}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),t(),this.load(!0)}setTiles(t){return this.setSourceProperty((()=>{this._options.tiles=t})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t})),this}serialize(){return o.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t){return o._(this,void 0,void 0,(function*(){let a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.abortController=new AbortController;try{let p=yield At.getImage(yield this.map._requestManager.transformRequest(a,"Tile"),t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(p?.data){this.map._refreshExpiredTiles&&(p.cacheControl||p.expires)&&t.setExpiryData({cacheControl:p.cacheControl,expires:p.expires});let f=this.map.painter.context,b=f.gl,P=p.data;t.texture=this.map.painter.getTileTexture(P.width),t.texture?t.texture.update(P,{useMipmap:!0}):(t.texture=new o.T(f,P,b.RGBA,{useMipmap:!0}),t.texture.bind(b.LINEAR,b.CLAMP_TO_EDGE,b.LINEAR_MIPMAP_NEAREST)),t.state="loaded"}}catch(p){if(delete t.abortController,t.aborted)t.state="unloaded";else if(p)throw t.state="errored",p}}))}abortTile(t){return o._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController)}))}unloadTile(t){return o._(this,void 0,void 0,(function*(){t.texture&&this.map.painter.saveTileTexture(t.texture)}))}hasTransition(){return!1}}class on extends Hn{constructor(t,a,p,f){super(t,a,p,f),this.type="raster-dem",this.maxzoom=22,this._options=o.e({type:"raster-dem"},a),this.encoding=a.encoding||"mapbox",this.redFactor=a.redFactor,this.greenFactor=a.greenFactor,this.blueFactor=a.blueFactor,this.baseShift=a.baseShift}loadTile(t){return o._(this,void 0,void 0,(function*(){let a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),p=yield this.map._requestManager.transformRequest(a,"Tile");t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.abortController=new AbortController;try{let f=yield At.getImage(p,t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(f?.data){let b=f.data;this.map._refreshExpiredTiles&&(f.cacheControl||f.expires)&&t.setExpiryData({cacheControl:f.cacheControl,expires:f.expires});let P=o.b(b)&&o.a0()?b:yield this.readImageNow(b),D={type:this.type,uid:t.uid,source:this.id,rawImageData:P,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(t.actor&&t.state!=="expired"&&t.state!=="reloading")return;t.actor&&t.state!=="expired"||(t.actor=this.dispatcher.getActor()),t.dem=yield t.actor.sendAsync({type:"LDT",data:D}),t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded"}}catch(f){if(delete t.abortController,t.aborted)t.state="unloaded";else if(f)throw t.state="errored",f}}))}readImageNow(t){return o._(this,void 0,void 0,(function*(){if(typeof VideoFrame<"u"&&o.a1()){let a=t.width+2,p=t.height+2;try{return new o.R({width:a,height:p},yield o.a2(t,-1,-1,a,p))}catch{}}return Bt.getImageData(t,1)}))}_getNeighboringTiles(t){let a=t.canonical,p=Math.pow(2,a.z),f=(a.x-1+p)%p,b=a.x===0?t.wrap-1:t.wrap,P=(a.x+1+p)%p,D=a.x+1===p?t.wrap+1:t.wrap,B={};return B[new o.a3(t.overscaledZ,b,a.z,f,a.y).key]={backfilled:!1},B[new o.a3(t.overscaledZ,D,a.z,P,a.y).key]={backfilled:!1},a.y>0&&(B[new o.a3(t.overscaledZ,b,a.z,f,a.y-1).key]={backfilled:!1},B[new o.a3(t.overscaledZ,t.wrap,a.z,a.x,a.y-1).key]={backfilled:!1},B[new o.a3(t.overscaledZ,D,a.z,P,a.y-1).key]={backfilled:!1}),a.y+1<p&&(B[new o.a3(t.overscaledZ,b,a.z,f,a.y+1).key]={backfilled:!1},B[new o.a3(t.overscaledZ,t.wrap,a.z,a.x,a.y+1).key]={backfilled:!1},B[new o.a3(t.overscaledZ,D,a.z,P,a.y+1).key]={backfilled:!1}),B}unloadTile(t){return o._(this,void 0,void 0,(function*(){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&(yield t.actor.sendAsync({type:"RDT",data:{type:this.type,uid:t.uid,source:this.id}}))}))}}function Xn(_,t){return t?_.properties[t]:_.id}function Qi(_,t){let a={id:_.id};if(t.removeAllProperties&&(delete _.removeProperties,delete _.addOrUpdateProperties,delete t.removeProperties),t.removeProperties)for(let p of t.removeProperties){let f=_.addOrUpdateProperties.findIndex((b=>b.key===p));f>-1&&_.addOrUpdateProperties.splice(f,1)}return(_.removeAllProperties||t.removeAllProperties)&&(a.removeAllProperties=!0),(_.removeProperties||t.removeProperties)&&(a.removeProperties=[..._.removeProperties||[],...t.removeProperties||[]]),(_.addOrUpdateProperties||t.addOrUpdateProperties)&&(a.addOrUpdateProperties=[..._.addOrUpdateProperties||[],...t.addOrUpdateProperties||[]]),(_.newGeometry||t.newGeometry)&&(a.newGeometry=t.newGeometry||_.newGeometry),a}function ga(_){var t,a;if(!_)return{};let p={};return p.removeAll=_.removeAll,p.remove=new Set(_.remove||[]),p.add=new Map((t=_.add)===null||t===void 0?void 0:t.map((f=>[f.id,f]))),p.update=new Map((a=_.update)===null||a===void 0?void 0:a.map((f=>[f.id,f]))),p}function as(_){return _&&_.length!==0?typeof _[0]=="number"?[_]:_.flatMap((t=>as(t))):[]}function xo(_){return _.type==="GeometryCollection"?_.geometries.flatMap((t=>xo(t))):as(_.coordinates)}function ss(_){let t=new Ti,a;switch(_.type){case"FeatureCollection":a=_.features.flatMap((p=>xo(p.geometry)));break;case"Feature":a=xo(_.geometry);break;default:a=xo(_)}if(a.length===0)return t;for(let p of a){let[f,b]=p;t.extend([f,b])}return t}class _a extends o.E{constructor(t,a,p,f){super(),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._isUpdatingWorker=!1,this._pendingWorkerUpdate={data:a.data},this.actor=p.getActor(),this.setEventedParent(f),this._data=typeof a.data=="string"?{url:a.data}:{geojson:a.data},this._options=o.e({},a),this._collectResourceTiming=a.collectResourceTiming,a.maxzoom!==void 0&&(this.maxzoom=a.maxzoom),a.type&&(this.type=a.type),a.attribution&&(this.attribution=a.attribution),this.promoteId=a.promoteId,a.clusterMaxZoom!==void 0&&this.maxzoom<=a.clusterMaxZoom&&o.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${a.clusterMaxZoom}".`),this.workerOptions=o.e({source:this.id,geojsonVtOptions:{buffer:this._pixelsToTileUnits(a.buffer!==void 0?a.buffer:128),tolerance:this._pixelsToTileUnits(a.tolerance!==void 0?a.tolerance:.375),extent:o.a6,maxZoom:this.maxzoom,lineMetrics:a.lineMetrics||!1,generateId:a.generateId||!1,promoteId:typeof a.promoteId=="string"?a.promoteId:void 0,cluster:a.cluster||!1,clusterOptions:{maxZoom:this._getClusterMaxZoom(a.clusterMaxZoom),minPoints:Math.max(2,a.clusterMinPoints||2),extent:o.a6,radius:this._pixelsToTileUnits(a.clusterRadius||50),log:!1,generateId:a.generateId||!1}},clusterProperties:a.clusterProperties,filter:a.filter},a.workerOptions)}_hasPendingWorkerUpdate(){return this._pendingWorkerUpdate.data!==void 0||this._pendingWorkerUpdate.diff!==void 0||this._pendingWorkerUpdate.updateCluster}_pixelsToTileUnits(t){return t*(o.a6/this.tileSize)}
2_getClusterMaxZoom(t){let a=t?Math.round(t):this.maxzoom-1;return Number.isInteger(t)||t===void 0||o.w(`Integer expected for option 'clusterMaxZoom': provided value "${t}" rounded to "${a}"`),a}load(){return o._(this,void 0,void 0,(function*(){yield this._updateWorkerData()}))}onAdd(t){this.map=t,this.load()}setData(t,a){this._data=typeof t=="string"?{url:t}:{geojson:t},this._pendingWorkerUpdate={data:t};let p=this._updateWorkerData();return a?p:this}updateData(t,a){this._pendingWorkerUpdate.diff=(function(f,b){if(!f)return b||{};if(!b)return f||{};let P=ga(f),D=ga(b);(function(U,$){$.removeAll&&(U.add.clear(),U.update.clear(),U.remove.clear(),$.remove.clear());for(let Y of $.remove)U.add.delete(Y),U.update.delete(Y);for(let[Y,ee]of $.update){let oe=U.update.get(Y);oe&&($.update.set(Y,Qi(oe,ee)),U.update.delete(Y))}})(P,D);let B={};if((P.removeAll||D.removeAll)&&(B.removeAll=!0),B.remove=new Set([...P.remove,...D.remove]),B.add=new Map([...P.add,...D.add]),B.update=new Map([...P.update,...D.update]),B.remove.size&&B.add.size)for(let U of B.add.keys())B.remove.delete(U);return(function(U){let $={};return U.removeAll&&($.removeAll=U.removeAll),U.remove&&($.remove=Array.from(U.remove)),U.add&&($.add=Array.from(U.add.values())),U.update&&($.update=Array.from(U.update.values())
2),$})(B)})(this._pendingWorkerUpdate.diff,t);let p=this._updateWorkerData();return a?p:this}getData(){return o._(this,void 0,void 0,(function*(){return this._data.url&&(yield this.once("data")),this._data.geojson?this._data.geojson:{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}}))}getBounds(){return o._(this,void 0,void 0,(function*(){return ss(yield this.getData())}))}setClusterOptions(t){return this.workerOptions.geojsonVtOptions.cluster=t.cluster,t.clusterRadius!==void 0&&(this.workerOptions.geojsonVtOptions.clusterOptions.radius=this._pixelsToTileUnits(t.clusterRadius)),t.clusterMaxZoom!==void 0&&(this.workerOptions.geojsonVtOptions.clusterOptions.maxZoom=this._getClusterMaxZoom(t.clusterMaxZoom)),this._pendingWorkerUpdate.updateCluster=!0,this._updateWorkerData(),this}getClusterExpansionZoom(t){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:t,source:this.id}})}getClusterChildren(t){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:t,source:this.id}})}getClusterLeaves(t,a,p){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:t,limit:a,offset:p}})}_updateWorkerData(){return o._(this,void 0,void 0,(function*(){if(this._isUpdatingWorker)return;if(!this._hasPendingWorkerUpdate())return void o.w(`No pending worker updates for GeoJSONSource ${this.id}.`);let{data:t,diff:a,updateCluster:p}=this._pendingWorkerUpdate,f=this._getLoadGeoJSONParameters(t,a,p);t!==void 0?this._pendingWorkerUpdate.data=void 0:a?this._pendingWorkerUpdate.diff=void 0:p&&(this._pendingWorkerUpdate.updateCluster=void 0),yield this._dispatchWorkerUpdate(f)}))}_getLoadGeoJSONParameters(t,a,p){return o._(this,void 0,void 0,(function*(){let f=o.e({type:this.type},this.workerOptions);return typeof t=="string"?(f.request=yield this.map._requestManager.transformRequest(Bt.resolveURL(t),"Source"),f.request.collectResourceTiming=this._collectResourceTiming,f):t!==void 0?(f.data=t,f):a?(f.dataDiff=a,f):p?(f.updateCluster=!0,f):void 0}))}_dispatchWorkerUpdate(t){return o._(this,void 0,void 0,(function*(){this._isUpdatingWorker=!0,this.fire(new o.n("dataloading",{dataType:"source"}));try{let a=yield t,p=yield this.actor.sendAsync({type:"LD",data:a});if(this._isUpdatingWorker=!1,this._removed||p.abandoned)return void this.fire(new o.n("dataabort",{dataType:"source"}));p.data&&(this._data={geojson:p.data});let f=this._applyDiffToSource(a.dataDiff),b=this._getShouldReloadTileOptions(f),P={dataType:"source"};this._applyResourceTiming(P,p),this.fire(new o.n("data",Object.assign(Object.assign({},P),{sourceDataType:"metadata"}))),this.fire(new o.n("data",Object.assign(Object.assign({},P),{sourceDataType:"content",shouldReloadTileOptions:b})))}catch(a){if(this._isUpdatingWorker=!1,this._removed)return void this.fire(new o.n("dataabort",{dataType:"source"}));this.fire(new o.l(o.d(a)))}finally{this._hasPendingWorkerUpdate()&&this._updateWorkerData()}}))}_applyResourceTiming(t,a){var p;if(!this._collectResourceTiming)return;let f=(p=a.resourceTiming)===null||p===void 0?void 0:p[this.id];if(!f)return;let b=f.slice(0);b?.length&&o.e(t,{resourceTiming:b})}_applyDiffToSource(t){if(!t)return;let a=typeof this.promoteId=="string"?this.promoteId:void 0;if(!this._data.url&&!this._data.updateable){let f=(function(b,P){let D=new Map;if(b==null||b.type==null)return D;if(b.type==="Feature"){let B=Xn(b,P);return B==null?void 0:(D.set(B,b),D)}if(b.type==="FeatureCollection"){let B=new Set;for(let U of b.features){let $=Xn(U,P);if($==null||B.has($))return;B.add($),D.set($,U)}return D}})(this._data.geojson,a);if(!f)throw new Error(`GeoJSONSource "${this.id}": GeoJSON data is not compatible with updateData`);this._data={updateable:f}}if(!this._data.updateable)return;let p=(function(f,b,P){var D,B;let U=[];if(b.removeAll)f.clear();else if(b.remove)for(let $ of b.remove){let Y=f.get($);Y&&(U.push(Y.geometry),f.delete($))}if(b.add)for(let $ of b.add){let Y=Xn($,P);if(Y==null)continue;let ee=f.get(Y);ee&&U.push(ee.geometry),U.push($.geometry),f.set(Y,$)}if(b.update)for(let $ of b.update){let Y=f.get($.id);if(!Y)continue;let ee=!!$.newGeometry,oe=$.removeAllProperties||((D=$.removeProperties)===null||D===void 0?void 0:D.length)>0||((B=$.addOrUpdateProperties)===null||B===void 0?void 0:B.length)>0;if(!ee&&!oe)continue;U.push(Y.geometry);let _e=Object.assign({},Y);
2if(f.set($.id,_e),ee&&(U.push($.newGeometry),_e.geometry=$.newGeometry),oe){if(_e.properties=$.removeAllProperties?{}:Object.assign({},_e.properties||{}),$.removeProperties)for(let Ie of $.removeProperties)delete _e.properties[Ie];if($.addOrUpdateProperties)for(let{key:Ie,value:ze}of $.addOrUpdateProperties)_e.properties[Ie]=ze}}return U})(this._data.updateable,t,a);return t.removeAll||this._options.cluster?void 0:p}_getShouldReloadTileOptions(t){if(t)return{affectedBounds:t.filter(Boolean).map((a=>ss(a)))}}shouldReloadTile(t,{affectedBounds:a}){if(t.state==="loading")return!0;if(t.state==="unloaded")return!1;let{buffer:p,extent:f}=this.workerOptions.geojsonVtOptions,b=(function({x:P,y:D,z:B},U=0){let $=o.a4((P-U)/Math.pow(2,B)),Y=o.a5((D+1+U)/Math.pow(2,B)),ee=o.a4((P+1+U)/Math.pow(2,B)),oe=o.a5((D-U)/Math.pow(2,B));return new Ti([$,Y],[ee,oe])})(t.tileID.canonical,p/f);for(let P of a)if(b.intersects(P))return!0;return!1}loaded(){return!this._isUpdatingWorker&&!this._hasPendingWorkerUpdate()}loadTile(t){return o._(this,void 0,void 0,(function*(){let a=t.actor?"RT":"LT";t.actor=this.actor;let p={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity};t.abortController=new AbortController;let f=yield this.actor.sendAsync({type:a,data:p},t.abortController);delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(f,this.map.painter,a==="RT")}))}abortTile(t){return o._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=!0}))}unloadTile(t){return o._(this,void 0,void 0,(function*(){t.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.t
2ype,source:this.id}})}))}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return o.e({},this._options,{type:this.type,data:this._data.updateable?{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}:this._data.url||this._data.geojson})}hasTransition(){return!1}}class oo extends o.E{constructor(t,a,p,f){super(),this.flippedWindingOrder=!1,this.id=t,this.dispatcher=p,this.coordinates=a.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(f),this.options=a}load(t){return o._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new o.n("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{let a=yield At.getImage(yield this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,a?.data&&(this.image=a.data,t&&(this.coordinates=t),this._finishLoading())}catch(a){this._request=null,this._loaded=!0,o.$(a)||this.fire(new o.l(o.d(a)))}}))}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=t.url,this.load(t.coordinates).finally((()=>this.texture=null)),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new o.n("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(t){this.coordinates=t;let a=t.map(o.a7.fromLngLat);var p;return this.tileID=(function(f){let b=o.a8.fromPoints(f),P=b.width(),D=b.height(),B=Math.max(P,D),U=Math.max(0,Math.floor(-Math.log(B)/Math.LN2)),$=Math.pow(2,U);return new o.aa(U,Math.floor((b.minX+b.maxX)/2*$),Math.floor((b.minY+b.maxY)/2*$))})(a),this.terrainTileRanges=this._getOverlappingTileRanges(a),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=a.map((f=>this.tileID.getTilePoint(f)._round())),this.flippedWindingOrder=((p=this.tileCoords)[1].x-p[0].x)*(p[2].y-p[0].y)-(p[1].y-p[0].y)*(p[2].x-p[0].x)<0,this.fire(new o.n("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let t=this.map.painter.context,a=t.gl;this.texture||(this.texture=new o.T(t,this.image,a.RGBA),this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE));let p=!1;for(let f in this.tiles){let b=this.tiles[f];b.state!=="loaded"&&(b.state="loaded",b.texture=this.texture,p=!0)}p&&this.fire(new o.n("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(t){return o._(this,void 0,void 0,(function*(){var a;!((a=this.tileID)===null||a===void 0)&&a.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={}):t.state="errored"}))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}_getOverlappingTileRanges(t){let{minX:a,minY:p,maxX:f,maxY:b}=o.a8.fromPoints(t),P={};for(let D=0;D<=o.a9;D++){let B=Math.pow(2,D),U=Math.floor(a*B),$=Math.floor(p*B),Y=Math.floor(f*B),ee=Math.floor(b*B),oe=(U%B+B)%B,_e=Y%B,Ie=Math.floor(U/B),ze=Math.floor(Y/B);P[D]={minWrap:Ie,maxWrap:ze,minTileXWrapped:oe,maxTileXWrapped:_e,minTileY:$,maxTileY:ee}}return P}}class ya extends oo{constructor(t,a,p,f){super(t,a,p,f),this._onPlayingHandler=()=>{var b;(b=this.map)===null||b===void 0||b.triggerRepaint()},this.roundZoom=!0,this.type="video",this.options=a}load(){return o._(this,void 0,void 0,(function*(){this._loaded=!1;let t=this.options;this.urls=[];for(let a of t.urls)this.urls.push((yield this.map._requestManager.transformRequest(a,"Source")).url);try{let a=yield o.ab(this.urls);if(this._loaded=!0,!a)return;this.video=a,this.video.loop=!0,this.video.addEventListener("playing",this._onPlayingHandler),this.map&&this.video.play(),this._finishLoading()}catch(a){this.fire(new o.l(o.d(a)))}}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){let a=this.video.seekable;t<a.start(0)||t>a.end(0)?this.fire(new o.l(new o.ac(`sources.${this.id}`,null,`Playback for this video can be set only between the ${a.start(0)} and ${a.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}
vendor: 4,345 bytes, line 2
2onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}onRemove(){super.onRemove(),this.video&&(this.video.removeEventListener("playing",this._onPlayingHandler),this.video.pause())}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let t=this.map.painter.context,a=t.gl;this.texture?this.video.paused||(this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE),a.texSubImage2D(a.TEXTURE_2D,0,0,0,a.RGBA,a.UNSIGNED_BYTE,this.video)):(this.texture=new o.T(t,this.video,a.RGBA),this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE));let p=!1;for(let f in this.tiles){let b=this.tiles[f];b.state!=="loaded"&&(b.state="loaded",b.texture=this.texture,p=!0)}p&&this.fire(new o.n("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class Na extends oo{constructor(t,a,p,f){super(t,a,p,f),a.coordinates?Array.isArray(a.coordinates)&&a.coordinates.length===4&&!a.coordinates.some((b=>!Array.isArray(b)||b.length!==2||b.some((P=>typeof P!="number"))))||this.fire(new o.l(new o.ac(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new o.l(new o.ac(`sources.${t}`,null,'missing required property "coordinates"'))),a.animate&&typeof a.animate!="boolean"&&this.fire(new o.l(new o.ac(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),a.canvas?typeof a.canvas=="string"||a.canvas instanceof HTMLCanvasElement||this.fire(new o.l(new o.ac(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new o.l(new o.ac(`sources.${t}`,null,'missing required property "canvas"'))),this.options=a,this.animate=a.animate===void 0||a.animate}load(){return o._(this,void 0,void 0,(function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new o.l(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}))}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let a=this.map.painter.context,p=a.gl;this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):(this.texture=new o.T(a,this.canvas,p.RGBA,{premultiply:!0}),this.texture.bind(p.LINEAR,p.CLAMP_TO_EDGE));let f=!1;for(let b in this.tiles){let P=this.tiles[b];P.state!=="loaded"&&(P.state="loaded",P.texture=this.texture,f=!0)}f&&this.fire(new o.n("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",animate:this.animate,canvas:this.options.canvas,coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}let St={},Kt=_=>{switch(_){case"geojson":return _a;case"image":return oo;case"raster":return Hn;case"raster-dem":return on;case"vector":return Gr;case"video":return ya;case"canvas":return Na}return St[_]},Ua="RTLPluginLoaded";class xa extends o.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=$r()}_syncState(t){return this.status=t,this.dispatcher.broadcast("SRPS",{pluginStatus:t,pluginURL:this.url}).catch((a=>{throw this.status="error",a}))}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(t){return o._(this,arguments,void 0,(function*(a,p=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=Bt.resolveURL(a),!this.url)throw new Error(`requested url ${a}
2 is invalid`);if(this.status==="unavailable"){if(!p)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()}))}_requestImport(){return o._(this,void 0,void 0,(function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new o.n(Ua))}))}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let or=null;function Bn(){return or||(or=new xa),or}var xn,Zr;(function(_){_[_.Base=0]="Base",_[_.Parent=1]="Parent"})(xn||(xn={})),(function(_){_[_.Departing=0]="Departing",_[_.Incoming=1]="Incoming"})(Zr||(Zr={}));class ta{constructor(t,a){this.timeAdded=0,this.fadeEndTime=0,this.fadeOpacity=1,this.tileID=t,this.uid=o.ad(),this.uses=0,this.tileSize=a,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttFingerprint={},this.expiredRequestCount=0,this.state="loading"}isRenderable(t){return this.hasData()&&(!this.fadeEndTime||this.fadeOpacity>0)&&(t||!this.holdingForSymbolFade())}setCrossFadeLogic({fadingRole:t,fadingDirection:a,fadingParentID:p,fadeEndTime:f}){this.resetFadeLogic(),this.fadingRole=t,this.fadingDirection=a,this.fadingParentID=p,this.fadeEndTime=f}setSelfFadeLogic(t){this.resetFadeLogic(),this.selfFading=!0,this.fadeEndTime=t}resetFadeLogic(){this.fadingRole=null,this.fadingDirection=null,this.fadingParentID=null,this.selfFading=!1,this.timeAdded=Mt(),this.fadeEndTime=0,this.fadeOpacity=1}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(t){this.demTexture&&t.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(t,a,p){if(t?.etagUnmodified!==!0)if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestEncoding=t.encoding,this.latestFeatureIndex.rawTileData=t.rawTileData,this.latestFeatureIndex.encoding=t.encoding):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData,this.latestFeatureIndex.encoding=this.latestEncoding)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=(function(f,b){let P={};if(!b)return P;for(let D of f){let B=D.layerIds.map((U=>b.getLayer(U))).filter(Boolean);if(B.length!==0){D.layers=B,D.stateDependentLayerIds&&(D.stateDependentLayers=D.stateDependentLayerIds.map((U=>B.filter(($=>
2$.id===U))[0])));for(let U of B)P[U.id]=D}}return P})(t.buckets,a?.style),this.hasSymbolBuckets=!1;for(let f in this.buckets){let b=this.buckets[f];if(b instanceof o.af){if(this.hasSymbolBuckets=!0,!p)break;b.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let f in this.buckets){let b=this.buckets[f];if(b instanceof o.af&&b.hasRTLText){this.hasRTLText=!0,Bn().lazyLoad();break}}this.queryPadding=0;for(let f in this.buckets){let b=this.buckets[f];this.queryPadding=Math.max(this.queryPadding,a.style.getLayer(f).queryRadius(b))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),this.dashPositions=t.dashPositions}else this.collisionBoxArray=new o.ae;else this.state="loaded"}unloadVectorData(){for(let t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.imageAtlas=null,this.dashPositions=null,this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(let p in this.buckets){let f=this.buckets[p];f.uploadPending()&&f.upload(t)}let a=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new o.T(t,this.imageAtlas.image,a.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new o.T(t,this.glyphAtlasImage,a.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,a,p,f,b,P,D,B,U,$,Y){var ee;return!((ee=this.latestFeatureIndex)===null||ee===void 0)&&ee.rawTileData?this.latestFeatureIndex.query({queryGeometry:f,cameraQueryGeometry:b,scale:P,tileSize:this.tileSize,pixelPosMatrix:$,transform:B,params:D,queryPadding:this.queryPadding*U,getElevation:Y},t,a,p):{}}querySourceFeatures(t,a){let p=this.latestFeatureIndex;if(!p?.rawTileData)return;let f=p.loadVTLayers(),b=a?.sourceLayer?a.sourceLayer:"",P=f[o.ag]||f[b];if(!P)return;let D=o.ah(a?.filter,a?.globalState),{z:B,x:U,y:$}=this.tileID.canonical,Y={z:B,x:U,y:$};for(let ee=0;ee<P.length;ee++){let oe=P.feature(ee);if(D.needGeometry){let ze=o.ai(oe,!0);if(!D.filter(new o.J(this.tileID.overscaledZ),ze,this.tileID.canonical))continue}else if(!D.filter(new o.J(this.tileID.overscaledZ),oe))continue;let _e=p.getId(oe,b),Ie=new o.aj(oe,B,U,$,_e);Ie.tile=Y,t.push(Ie)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){let a=this.expirationTime;if(t.cacheControl){let p=o.ak(t.cacheControl);p["max-age"]&&(this.expirationTime=Date.now()+1e3*p["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){let p=Date.now(),f=!1;if(this.expirationTime>p)f=!1;else if(a)if(this.expirationTime<a)f=!0;else{let b=this.expirationTime-a;b?this.expirationTime=p+Math.max(b,3e4):f=!0}else f=!0;f?(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(t,a){var p,f,b;if(!(!((p=this.latestFeatureIndex)===null||p===void 0)&&p.rawTileData)||Object.keys(t).length===0)return;let P=this.latestFeatureIndex.loadVTLayers();for(let D in this.buckets){if(!a.style.hasLayer(D))continue;let B=this.buckets[D],U=B.layers[0].sourceLayer||o.ag,$=P[U],Y=t[U];if(!$||!Y||Object.keys(Y).length===0)continue;B.update(Y,$,((f=this.imageAtlas)===null||f===void 0?void 0:f.patternPositions)||{},this.dashPositions||{});let ee=(b=a?.style)===null||b===void 0?void 0:b.getLayer(D);ee&&(this.queryPadding=Math.max(this.queryPadding,ee.queryRadius(B)))}}holdingForSymbolFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Mt()}clearSymbolFadeHold(){this.symbolFadeHoldUntil=void 0}setSymbolHoldDuration(t){this.symbolFadeHoldUntil=Mt()+t}
vendor: 10,823 bytes, line 2
2setDependencies(t,a){let p={};for(let f of a)p[f]=!0;this.dependencies[t]=p}hasDependency(t,a){for(let p of t){let f=this.dependencies[p];if(f){for(let b of a)if(f[b])return!0}}return!1}}class Ht{constructor(){this.state={},this.stateChanges={},this.deletedStates={},this.revision=0}updateState(t,a,p){var f,b,P,D,B;let U=String(a);if((D=this.stateChanges)[t]||(D[t]={}),(B=this.stateChanges[t])[U]||(B[U]={}),o.e(this.stateChanges[t][U],p),this.deletedStates[t]===null){this.deletedStates[t]={};for(let $ in this.state[t])$!==U&&(this.deletedStates[t][$]=null)}else if(((f=this.deletedStates[t])===null||f===void 0?void 0:f[U])===null){this.deletedStates[t][U]={};for(let $ in this.state[t][U])p[$]||(this.deletedStates[t][U][$]=null)}else for(let $ in p)((P=(b=this.deletedStates[t])===null||b===void 0?void 0:b[U])===null||P===void 0?void 0:P[$])===null&&delete this.deletedStates[t][U][$]}removeFeatureState(t,a,p){var f,b,P;if(this.deletedStates[t]===null)return;let D=String(a);if((b=this.deletedStates)[t]||(b[t]={}),p&&a!==void 0)this.deletedStates[t][D]!==null&&((P=this.deletedStates[t])[D]||(P[D]={}),this.deletedStates[t][D][p]=null);else if(a!==void 0)if(!((f=this.stateChanges[t])===null||f===void 0)&&f[D])for(p in this.deletedStates[t][D]={},this.stateChanges[t][D])this.deletedStates[t][D][p]=null;else this.deletedStates[t][D]=null;else this.deletedStates[t]=null}getState(t,a){let p=String(a),f=o.e({},(this.state[t]||{})[p],(this.stateChanges[t]||{})[p]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){let b=this.deletedStates[t][a];if(b===null)return{};for(let P in b)delete f[P]}return f}initializeTileState(t,a){t.setFeatureState(this.state,a)}coalesceChanges(t,a){var p,f,b;let P={};for(let D in this.stateChanges){(p=this.state)[D]||(p[D]={});let B={};for(let U in this.stateChanges[D])(f=this.state[D])[U]||(f[U]={}),o.e(this.state[D][U],this.stateChanges[D][U]),B[U]=this.state[D][U];P[D]=B}for(let D in this.deletedStates){(b=this.state)[D]||(b[D]={});let B={};if(this.deletedStates[D]===null)for(let U in this.state[D])B[U]={},this.state[D][U]={};else for(let U in this.deletedStates[D]){if(this.deletedStates[D][U]===null)this.state[D][U]={};else for(let $ of Object.keys(this.deletedStates[D][U]))delete this.state[D][U][$];B[U]=this.state[D][U]}P[D]||(P[D]={}),o.e(P[D],B)}this.stateChanges={},this.deletedStates={},Object.keys(P).length!==0&&(this.revision++,t.setFeatureState(P,a))}}let Wi=89.25;function Bi(_,t){let a=o.al(t.lat,-o.am,o.am);return new o.P(o.Z(t.lng)*_,o.Y(a)*_)}function an(_,t){return new o.a7(t.x/_,t.y/_).toLngLat()}function Lo(_){return _.cameraToCenterDistance*Math.min(.85*Math.tan(o.an(90-_.pitch)),Math.tan(o.an(Wi-_.pitch)))}function ji(_,t){let a=_.canonical,p=t/o.ao(a.z),f=a.x+Math.pow(2,a.z)*_.wrap,b=o.ap(new Float64Array(16));return o.Q(b,b,[f*p,a.y*p,0]),o.S(b,b,[p/o.a6,p/o.a6,1]),b}function Ro(_,t,a,p,f){let b=o.a7.fromLngLat(_,t),P=f*o.aq(1,_.lat),{x:D,y:B,z:U}=vn(a,p);return new o.a7(b.x+P*-D,b.y+P*-B,b.z+P*-U)}function vn(_,t){let a=o.an(_),p=o.an(t),f=Math.cos(-a),b=Math.sin(a);return{x:b*Math.sin(p),y:-b*Math.cos(p),z:f}}function xt(_,t,a){let p=t.intersectsFrustum(_);if(!a||p===0)return p;let f=t.intersectsPlane(a);return f===0?0:p===2&&f===2?2:1}function sn(_,t,a){let p=0,f=(a-t)/10;for(let b=0;b<10;b++)p+=f*Math.pow(Math.cos(t+(b+.5)/10*(a-t)),_);return p}function eo(_,t){return function(a,p,f,b,P){let D=2*((_-1)/o.ar(Math.cos(o.an(Wi-P))/Math.cos(o.an(Wi)))-1),B=Math.acos(f/b),U=2*sn(D-1,0,o.an(P/2)),$=Math.min(o.an(Wi),B+o.an(P/2)),Y=sn(D-1,Math.min($,B-o.an(P/2)),$),ee=Math.atan(p/f),oe=Math.hypot(p,f),_e=a;return _e+=o.ar(b/oe/Math.max(.5,Math.cos(o.an(P/2)))),_e+=D*o.ar(Math.cos(ee))/2,_e-=o.ar(Math.max(1,Y/U/t))/2,_e}}let Ai=eo(9.314,3);function On(_,t){let a=(t.roundZoom?Math.round:Math.floor)(_.zoom+o.ar(_.tileSize/t.tileSize));return Math.max(0,a)}function ao(_,t){let a=_.getCameraFrustum(),p=_.getClippingPlane(),f=_.screenPointToMercatorCoordinate(_.getCameraPoint()),b=o.a7.fromLngLat(_.center,_.elevation);f.z=b.z+Math.cos(_.pitchInRadians)*_.cameraToCenterDistance/_.worldSize;let P=_.getCoveringTilesDetailsProvider(),D=P.allowVariableZoom(_,t),B=On(_,t),U=t.minzoom||0,$=t.maxzoom!==void 0?t.maxzoom:_.maxZoom,Y=Math.min(Math.max(0,B),$),ee=Math.pow(2,Y),oe=[ee*f.x,ee*f.y,0],_e=[ee*b.x,ee*b.y,0],Ie=Math.hypot(b.x-f.x,b.y-f.y),ze=Math.abs(b.z-f.z),Ee=Math.hypot(Ie,ze),De=we=>({zoom:0,x:0,y:0,wrap:we,fullyVisible:!1}),je=[],Le=[];if(_.renderWorldCopies&&P.allowWorldCopies())for(let we=1;we<=3;we++)je.push(De(-we)),je.push(De(we));for(je.push(De(0));je.length>0;){let we=je.pop(),qe=we.x,Fe=we.y,it=we.fullyVisible,ft={x:qe,y:Fe,z:we.zoom},_t=P.getTileBoundingVolume(ft,we.wrap,_.elevation,t);if(!it){let Gt=xt(a,_t,p);if(Gt===0)continue;it=Gt===2}let Rt=P.distanceToTile2d(f.x,f.y,ft,_t),Dt=B;D&&(Dt=(t.calculateTileZoom||Ai)(_.zoom+o.ar(_.tileSize/t.tileSize),Rt,ze,Ee,_.fov)),Dt=(t.roundZoom?Math.round:Math.floor)(Dt),Dt=Math.max(0,Dt);let _i=Math.min(Dt,$);if(we.wrap=P.getWrap(b,ft,we.wrap),we.zoom>=_i){if(we.zoom<U)continue;let Gt=Y-we.zoom,Et=oe[0]-.5-(qe<<Gt),ti=oe[1]-.5-(Fe<<Gt),Ci=t.reparseOverscaled?Math.max(we.zoom,Dt):we.zoom;Le.push({tileID:new o.a3(we.zoom===$?Ci:we.zoom,we.wrap,we.zoom,qe,Fe),distanceSq:o.as([_e[0]-.5-qe,_e[1]-.5-Fe]),tileDistanceToCamera:Math.sqrt(Et*Et+ti*ti)})}else for(let Gt=0;Gt<4;Gt++)je.push({zoom:we.zoom+1,x:(qe<<1)+Gt%2,y:(Fe<<1)+(Gt>>1),wrap:we.wrap,fullyVisible:it})}return Le.sort(((we,qe)=>we.distanceSq-qe.distanceSq)).map((we=>we.tileID))}let Xs=o.a8.fromPoints([new o.P(0,0),new o.P(o.a6,o.a6)]);function Ks(_){return _==="raster"||_==="image"||_==="video"}function Ql(_,t,a,p,f,b,P){if(!t.hasData())return!1;let{tileID:D,fadingRole:B,fadingDirection:U,fadingParentID:$}=t;if(B===xn.Base&&U===Zr.Incoming&&$)return a[$.key]=$,!0;let Y=Math.max(D.overscaledZ-f,b);for(let ee=D.overscaledZ-1;ee>=Y;ee--){let oe=D.scaledTo(ee),_e=_.getLoadedTile(oe);if(_e)return t.setCrossFadeLogic({fadingRole:xn.Base,fadingDirection:Zr.Incoming,fadingParentID:_e.tileID,fadeEndTime:p+P}),_e.setCrossFadeLogic({fadingRole:xn.Parent,fadingDirection:Zr.Departing,fadeEndTime:p+P}),a[oe.key]=oe,!0}return!1}function ls(_,t,a,p,f,b){if(!t.hasData())return!1;let P=t.tileID.children(f),D=Se(_,t,P,a,p,f,b);if(D)return!0;for(let B of P)Se(_,t,B.children(f),a,p,f,b)&&(D=!0);return D}function Se(_,t,a,p,f,b,P){if(a[0].overscaledZ>=b)return!1;let D=!1;for(let B of a){let U=_.getLoadedTile(B);if(!U)continue;let{fadingRole:$,fadingDirection:Y,fadingParentID:ee}=U;$===xn.Base&&Y===Zr.Departing&&ee||(U.setCrossFadeLogic({fadingRole:xn.Base,fadingDirection:Zr.Departing,fadingParentID:t.tileID,fadeEndTime:f+P}),t.setCrossFadeLogic({fadingRole:xn.Parent,fadingDirection:Zr.Incoming,fadeEndTime:f+P})),p[B.key]=B,D=!0}return D}function re(_,t,a,p){let f=_.tileID;return!!_.selfFading||!_.hasData()&&!!t.has(f)&&(_.setSelfFadeLogic(a+p),!0)}function te(_,t){var a;_.needsHillshadePrepare=!0,_.needsTerrainPrepare=!0;let p=t.tileID.canonical.x-_.tileID.canonical.x,f=t.tileID.canonical.y-_.tileID.canonical.y,b=Math.pow(2,_.tileID.canonical.z),P=t.tileID.key;p===0&&f===0||Math.abs(f)>1||(Math.abs(p)>1&&(Math.abs(p+b)===1?p+=b:Math.abs(p-b)===1&&(p-=b)),t.dem&&_.dem&&(_.dem.backfillBorder(t.dem,p,f),!((a=_.neighboringTiles)===null||a===void 0)&&a[P]&&(_.neighboringTiles[P].backfilled=!0)))}class xe{constructor(){this._tiles={}}handleWrapJump(t){let a={};for(let p in this._tiles){let f=this._tiles[p];f.tileID=f.tileID.unwrapTo(f.tileID.wrap+t),a[f.tileID.key]=f}this._tiles=a}setFeatureState(t,a){for(let p in this._tiles)this._tiles[p].setFeatureState(t,a)}getAllTiles(){return Object.values(this._tiles)}getAllIds(t=!1){return t?Object.values(this._tiles).map((a=>a.tileID)).sort(o.au).map((a=>a.key)):Object.keys(this._tiles)}getTileById(t){return this._tiles[t]}setTile(t,a){this._tiles[t]=a}deleteTileById(t){delete this._tiles[t]}getLoadedTile(t){let a=this.getTileById(t.key);return a?.hasData()?a:null}isIdRenderable(t,a=!1){var p;return(p=this.getTileById(t))===null||p===void 0?void 0:p.isRenderable(a)}getRenderableIds(t=0,a){let p=[];for(let f of this.getAllIds())this.isIdRenderable(f,a)&&p.push(this.getTileById(f));return a?p.sort(((f,b)=>{let P=f.tileID,D=b.tileID,B=new o.P(P.canonical.x,P.canonical.y)._rotate(-t),U=new o.P(D.canonical.x,D.canonical.y)._rotate(-t);return P.overscaledZ-D.overscaledZ||U.y-B.y||U.x-B.x})).map((f=>f.tileID.key)):p.map((f=>f.tileID)).sort(o.au).map((f=>f.key))}}class ve extends o.E{constructor(t,a,p){super(),this.id=t,this.dispatcher=p,this.on("data",(f=>{this._dataHandler(f)})),this.on("dataloading",(()=>{this._sourceErrored=!1})),this.on("error",(()=>{this._sourceErrored=this._source.loaded()})),this._source=((f,b,P,D)=>{let B=new(Kt(b.type))(f,b,P,D);if(B.id!==f)throw new Error(`Expected Source id to be ${f} instead of ${B.id}`);return B})(t,a,p,this),this._inViewTiles=new xe,this._outOfViewCache=new o.av(0,(f=>this._unloadTile(f))),this._timers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._rasterFadeDuration=0,this._maxFadingAncestorLevels=5,this._state=new Ht,this._didEmitContent=!1,this._updated=!1}onAdd(t){var a;this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,!((a=this._source)===null||a===void 0)&&a.onAdd&&this._source.onAdd(t)}onRemove(t){var a;for(let p of this._inViewTiles.getAllTiles())p.unloadVectorData();this.clearTiles(),!((a=this._source)===null||a===void 0)&&a.onRemove&&this._source.onRemove(t),this._inViewTiles=new xe}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(let t of this._inViewTiles.getAllTiles())if(t.state!=="loaded"&&t.state!=="errored")return!1;return!0}getSource(){return this._source}getState(){return this._state}pause(){this._paused=!0}resume(){if(!this._paused)return;let t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,a,p){return o._(this,void 0,void 0,(function*(){try{let f=yield this._source.loadTile(t);this._tileLoaded(t,a,p,f)}catch(f){t.state="errored",f.status!==404?this._source.fire(new o.l(o.d(f),{tile:t})):this.update(this.transform,this.terrain)}}))}_unloadTile(t){this._source.unloadTile&&this._source.unloadTile(t)}_abortTile(t){this._source.abortTile&&this._source.abortTile(t),this._source.fire(new o.n("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._inViewTiles,this.map?this.map.painter:null);
2for(let a of this._inViewTiles.getAllTiles())a.upload(t),a.prepare(this.map.style.imageManager)}getIds(){return this._inViewTiles.getAllIds(!0)}getRenderableIds(t){var a;return this._inViewTiles.getRenderableIds((a=this.transform)===null||a===void 0?void 0:a.bearingInRadians,t)}hasRenderableParent(t){let a=t.overscaledZ-1;if(a>=this._source.minzoom){let p=this.getLoadedTile(t.scaledTo(a));if(p)return this._inViewTiles.isIdRenderable(p.tileID.key)}return!1}reload(t,a=void 0){if(this._paused)this._shouldReloadOnResume=!0;else{this._outOfViewCache.reset();for(let p of this._inViewTiles.getAllIds()){let f=this._inViewTiles.getTileById(p);a&&!this._source.shouldReloadTile(f,a)||(t?this._reloadTile(p,"expired"):f.state!=="errored"&&this._reloadTile(p,"reloading"))}}}_reloadTile(t,a){return o._(this,void 0,void 0,(function*(){let p=this._inViewTiles.getTileById(t);p&&(p.state!=="loading"&&(p.state=a),yield this._loadTile(p,t,a))}))}_tileLoaded(t,a,p,f){t.timeAdded=Mt(),t.selfFading&&(t.fadeEndTime=t.timeAdded+this._rasterFadeDuration),p==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(a,t),f?.unmodified||(this.getSource().type==="raster-dem"&&t.dem&&(function(b,P){var D,B,U;let $=P.getRenderableIds();for(let Y of $){if(!(!((D=b.neighboringTiles)===null||D===void 0)&&D[Y]))continue;let ee=P.getTileById(Y);b.neighboringTiles[Y].backfilled||te(b,ee),!((U=(B=ee.neighboringTiles)===null||B===void 0?void 0:B[b.tileID.key])===null||U===void 0)&&U.backfilled||te(ee,b)}})(t,this._inViewTiles),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new o.n("data",{dataType:"source",tile:t,coord:t.tileID})))}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._inViewTiles.getTileById(t)}_retainLoadedChildren(t,a){let p=this._getLoadedDescendents(a),f=new Set;for(let b of a){let P=p[b.key];if(!P?.length){f.add(b);continue}let D=b.overscaledZ+ve.maxOverzooming,B=P.filter((Y=>Y.tileID.overscaledZ<=D));if(!B.length){f.add(b);continue}let U=Math.min(...B.map((Y=>Y.tileID.overscaledZ))),$=B.filter((Y=>Y.tileID.overscaledZ===U)).map((Y=>Y.tileID));for(let Y of $)t[Y.key]=Y;this._areDescendentsComplete($,U,b.overscaledZ)||f.add(b)}return f}_getLoadedDescendents(t){var a;let p={};for(let f of this._inViewTiles.getAllTiles().filter((b=>b.hasData())))for(let b of t)f.tileID.isChildOf(b)&&(p[a=b.key]||(p[a]=[]),p[b.key].push(f));return p}_areDescendentsComplete(t,a,p){return t.length===1&&t[0].isOverscaled()?t[0].overscaledZ===a:Math.pow(4,a-p)===t.length}getLoadedTile(t){return this._inViewTiles.getLoadedTile(t)}updateCacheSize(t){let a=Math.ceil(t.width/this._source.tileSize)+1,p=Math.ceil(t.height/this._source.tileSize)+1,f=Math.floor(a*p*(this._maxTileCacheZoomLevels===null?o.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),b=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,f):f;this._outOfViewCache.setMaxSize(b)}handleWrapJump(t){let a=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);this._prevLng=t,a&&(this._inViewTiles.handleWrapJump(a),this._resetTileReloadTimers())}update(t,a){if(!this._sourceLoaded||this._paused)return;let p;this.transform=t,this.terrain=a,this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this.used||this.usedForTerrain?this._source.tileID?p=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((B=>new o.a3(B.canonical.z,B.wrap,B.canonical.z,B.canonical.x,B.canonical.y))):(p=ao(t,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.type==="vector"&&this.map._zoomLevelsToOverscale!==void 0?t.maxZoom-this.map._zoomLevelsToOverscale:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:a,calculateTileZoom:this._source.calculateTileZoom}),this._source.hasTile&&(p=p.filter((B=>this._source.hasTile(B))))):p=[],this.usedForTerrain&&(p=this._addTerrainIdealTiles(p));let f=p.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,f&&this.fire(new o.n("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let b=On(t,this._source),P=this._updateRetainedTiles(p,b),D=Ks(this._source.type);D&&this._rasterFadeDuration>0&&!a&&(function(B,U,$,Y,ee,oe,_e){let Ie=Mt(),ze=o.at(U);for(let Ee of U){let De=B.getTileById(Ee.key);De.fadingDirection!==Zr.Departing&&De.fadeOpacity!==0||De.resetFadeLogic(),Ql(B,De,$,Ie,Y,ee,_e)||ls(B,De,$,Ie,oe,_e)||re(De,ze,Ie,_e)||De.resetFadeLogic()}})(this._inViewTiles,p,P,this._maxFadingAncestorLevels,this._source.minzoom,this._source.maxzoom,this._rasterFadeDuration),D?this._cleanUpRasterTiles(P):this._cleanUpVectorTiles(P)}
vendor: 20,438 bytes, line 2
2_cleanUpRasterTiles(t){for(let a of this._inViewTiles.getAllIds())t[a]||this._removeTile(a)}_cleanUpVectorTiles(t){for(let a of this._inViewTiles.getAllIds()){let p=this._inViewTiles.getTileById(a);t[a]?p.clearSymbolFadeHold():p.hasSymbolBuckets?p.holdingForSymbolFade()?p.symbolFadeFinished()&&this._removeTile(a):p.setSymbolHoldDuration(this.map._fadeDuration):this._removeTile(a)}}_addTerrainIdealTiles(t){let a=[];for(let p of t)if(p.canonical.z>this._source.minzoom){let f=p.scaledTo(p.canonical.z-1);a.push(f);let b=p.scaledTo(Math.max(this._source.minzoom,Math.min(p.canonical.z,5)));a.push(b)}return t.concat(a)}releaseSymbolFadeTiles(){for(let t of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(t).holdingForSymbolFade()&&this._removeTile(t)}_updateRetainedTiles(t,a){var p;let f=new Set;for(let U of t)this._addTile(U).hasData()||f.add(U);let b=t.reduce(((U,$)=>(U[$.key]=$,U)),{}),P=this._retainLoadedChildren(b,f),D={},B=Math.max(a-ve.maxUnderzooming,this._source.minzoom);for(let U of P){let $=this._inViewTiles.getTileById(U.key),Y=$?.wasRequested();for(let ee=U.overscaledZ-1;ee>=B;--ee){let oe=U.scaledTo(ee);if(D[oe.key])break;if(D[oe.key]=!0,$=this.getTile(oe),!$&&Y&&($=this._addTile(oe)),$){let _e=$.hasData();if((_e||!(!((p=this.map)===null||p===void 0)&&p.cancelPendingTileRequestsWhileZooming)||Y)&&(b[oe.key]=oe),Y=$.wasRequested(),_e)break}}}return b}_addTile(t){let a=this._inViewTiles.getTileById(t.key);if(a)return a;a=this._outOfViewCache.getAndRemove(t),a&&(a.resetFadeLogic(),this._setTileReloadTimer(t.key,a),a.tileID=t,this._state.initializeTileState(a,this.map?this.map.painter:null));let p=a;return a||(a=new ta(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(a,t.key,a.state)),a.uses++,this._inViewTiles.setTile(t.key,a),p||this._source.fire(new o.n("dataloading",{tile:a,coord:a.tileID,dataType:"source"})),a}_setTileReloadTimer(t,a){this._clearTileReloadTimer(t);let p=a.getExpiryTimeout();p&&(this._timers[t]=setTimeout((()=>{this._reloadTile(t,"expired"),delete this._timers[t]}),p))}_clearTileReloadTimer(t){let a=this._timers[t];a&&(clearTimeout(a),delete this._timers[t])}_resetTileReloadTimers(){for(let t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(let t of this._inViewTiles.getAllIds()){let a=this._inViewTiles.getTileById(t);this._setTileReloadTimer(t,a)}}refreshTiles(t){for(let a of this._inViewTiles.getAllIds()){let p=this._inViewTiles.getTileById(a);(this._inViewTiles.isIdRenderable(a)||p.state=="errored")&&t.some((f=>f.equals(p.tileID.canonical)))&&this._reloadTile(a,"expired")}}_removeTile(t){let a=this._inViewTiles.getTileById(t);a&&(a.uses--,this._inViewTiles.deleteTileById(t),this._clearTileReloadTimer(t),a.uses>0||(a.hasData()&&a.state!=="reloading"?this._outOfViewCache.add(a.tileID,a,a.getExpiryTimeout()):(a.aborted=!0,this._abortTile(a),this._unloadTile(a))))}_dataHandler(t){t.dataType==="source"&&(t.sourceDataType!=="metadata"?t.sourceDataType==="content"&&this._sourceLoaded&&!this._paused&&(this.reload(t.sourceDataChanged,t.shouldReloadTileOptions),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0):this._sourceLoaded=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let t of this._inViewTiles.getAllIds())this._removeTile(t);this._outOfViewCache.reset()}tilesIn(t,a,p){let f=[],b=this.transform;if(!b)return f;let P=b.getCoveringTilesDetailsProvider().allowWorldCopies(),D=p?b.getCameraQueryGeometry(t):t,B=oe=>b.screenPointToMercatorCoordinate(oe,this.terrain),U=this.transformBbox(t,B,!P),$=this.transformBbox(D,B,!P),Y=this.getIds(),ee=o.a8.fromPoints($);for(let oe of Y){let _e=this._inViewTiles.getTileById(oe);if(_e.holdingForSymbolFade())continue;let Ie=P?[_e.tileID]:[_e.tileID.unwrapTo(-1),_e.tileID.unwrapTo(0)],ze=Math.pow(2,b.zoom-_e.tileID.overscaledZ),Ee=a*_e.queryPadding*o.a6/_e.tileSize/ze;for(let De of Ie){let je=ee.map((Le=>De.getTilePoint(new o.a7(Le.x,Le.y))));if(je.expandBy(Ee),je.intersects(Xs)){let Le=U.map((qe=>De.getTilePoint(qe))),we=$.map((qe=>De.getTilePoint(qe)));f.push({tile:_e,tileID:P?De:De.unwrapTo(0),queryGeometry:Le,cameraQueryGeometry:we,scale:ze})}}}return f}transformBbox(t,a,p){let f=t.map(a);if(p){let b=o.a8.fromPoints(t);b.shrinkBy(.001*Math.min(b.width(),b.height()));let P=b.map(a);o.a8.fromPoints(f).covers(P)||(f=f.map((D=>D.x>.5?new o.a7(D.x-1,D.y,D.z):D)))}return f}getVisibleCoordinates(t){let a=this.getRenderableIds(t).map((p=>this._inViewTiles.getTileById(p).tileID));return this.transform&&this.transform.populateCache(a),a}hasTransition(){return!!this._source.hasTransition()||Ks(this._source.type)&&(function(t,a){if(a<=0)return!1;let p=Mt();for(let f of t.getAllTiles())if(f.fadeEndTime>=p)return!0;return!1})(this._inViewTiles,this._rasterFadeDuration)}setRasterFadeDuration(t){this._rasterFadeDuration=t}setFeatureState(t,a,p){t||(t=o.ag),this._state.updateState(t,a,p)}removeFeatureState(t,a,p){t||(t=o.ag),this._state.removeFeatureState(t,a,p)}getFeatureState(t,a){return t||(t=o.ag),this._state.getState(t,a)}setDependencies(t,a,p){let f=this._inViewTiles.getTileById(t);f&&f.setDependencies(a,p)}reloadTilesForDependencies(t,a){for(let p of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(p).hasDependency(t,a)&&this._reloadTile(p,"reloading");this._outOfViewCache.filter((p=>!p.hasDependency(t,a)))}areTilesLoaded(){for(let t of this._inViewTiles.getAllTiles())if(t.state!=="loaded"&&t.state!=="errored")return!1;return!0}}ve.maxUnderzooming=10,ve.maxOverzooming=3;class $e{constructor(t,a){this.reset(t,a)}reset(t,a){this.points=t||[],this._distances=[0];for(let p=1;p<this.points.length;p++)this._distances[p]=this._distances[p-1]+this.points[p].dist(this.points[p-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(a||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(this.points.length===1)return this.points[0];t=o.al(t,0,1);let a=1,p=this._distances[a],f=t*this.paddedLength+this.padding;for(;p<f&&a<this._distances.length;)p=this._distances[++a];let b=a-1,P=this._distances[b],D=p-P,B=D>0?(f-P)/D:0;return this.points[b].mult(1-B).add(this.points[a].mult(B))}}function Ke(_,t){let a=!0;return _==="always"||_!=="never"&&t!=="never"||(a=!1),a}class Te{constructor(t,a,p){let f=this.boxCells=[],b=this.circleCells=[];this.xCellCount=Math.ceil(t/p),this.yCellCount=Math.ceil(a/p);for(let P=0;P<this.xCellCount*this.yCellCount;P++)f.push([]),b.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=a,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/a,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,a,p,f,b){this._forEachCell(a,p,f,b,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(a),this.bboxes.push(p),this.bboxes.push(f),this.bboxes.push(b)}insertCircle(t,a,p,f){this._forEachCell(a-f,p-f,a+f,p+f,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(a),this.circles.push(p),this.circles.push(f)}_insertBoxCell(t,a,p,f,b,P){this.boxCells[b].push(P)}_insertCircleCell(t,a,p,f,b,P){this.circleCells[b].push(P)}_query(t,a,p,f,b,P,D){if(p<0||t>this.width||f<0||a>this.height)return[];let B=[];if(t<=0&&a<=0&&this.width<=p&&this.height<=f){if(b)return[{key:null,x1:t,y1:a,x2:p,y2:f}];for(let U=0;U<this.boxKeys.length;U++)B.push({key:this.boxKeys[U],x1:this.bboxes[4*U],y1:this.bboxes[4*U+1],x2:this.bboxes[4*U+2],y2:this.bboxes[4*U+3]});for(let U=0;U<this.circleKeys.length;U++){let $=this.circles[3*U],Y=this.circles[3*U+1],ee=this.circles[3*U+2];B.push({key:this.circleKeys[U],x1:$-ee,y1:Y-ee,x2:$+ee,y2:Y+ee})}}else this._forEachCell(t,a,p,f,this._queryCell,B,{hitTest:b,overlapMode:P,seenUids:{box:{},circle:{}}},D);return B}query(t,a,p,f){return this._query(t,a,p,f,!1,null)}hitTest(t,a,p,f,b,P){return this._query(t,a,p,f,!0,b,P).length>0}hitTestCircle(t,a,p,f,b){let P=t-p,D=t+p,B=a-p,U=a+p;if(D<0||P>this.width||U<0||B>this.height)return!1;let $=[];return this._forEachCell(P,B,D,U,this._queryCellCircle,$,{hitTest:!0,overlapMode:f,circle:{x:t,y:a,radius:p},seenUids:{box:{},circle:{}}},b),$.length>0}_queryCell(t,a,p,f,b,P,D,B){let{seenUids:U,hitTest:$,overlapMode:Y}=D,ee=this.boxCells[b],oe=1e-6;if(ee!==null){let Ie=this.bboxes;for(let ze of ee)if(!U.box[ze]){U.box[ze]=!0;let Ee=4*ze,De=this.boxKeys[ze];if(t<=Ie[Ee+2]+oe&&a<=Ie[Ee+3]+oe&&p>=Ie[Ee+0]-oe&&f>=Ie[Ee+1]-oe&&(!B||B(De))&&(!$||!Ke(Y,De.overlapMode))&&(P.push({key:De,x1:Ie[Ee],y1:Ie[Ee+1],x2:Ie[Ee+2],y2:Ie[Ee+3]}),$))return!0}}let _e=this.circleCells[b];if(_e!==null){let Ie=this.circles;for(let ze of _e)if(!U.circle[ze]){U.circle[ze]=!0;let Ee=3*ze,De=this.circleKeys[ze];if(this._circleAndRectCollide(Ie[Ee],Ie[Ee+1],Ie[Ee+2],t,a,p,f)&&(!B||B(De))&&(!$||!Ke(Y,De.overlapMode))){let je=Ie[Ee],Le=Ie[Ee+1],we=Ie[Ee+2];if(P.push({key:De,x1:je-we,y1:Le-we,x2:je+we,y2:Le+we}),$)return!0}}}return!1}_queryCellCircle(t,a,p,f,b,P,D,B){let{circle:U,seenUids:$,overlapMode:Y}=D,ee=this.boxCells[b];if(ee!==null){let _e=this.bboxes;for(let Ie of ee)if(!$.box[Ie]){$.box[Ie]=!0;let ze=4*Ie,Ee=this.boxKeys[Ie];if(this._circleAndRectCollide(U.x,U.y,U.radius,_e[ze+0],_e[ze+1],_e[ze+2],_e[ze+3])&&(!B||B(Ee))&&!Ke(Y,Ee.overlapMode))return P.push(!0),!0}}let oe=this.circleCells[b];if(oe!==null){let _e=this.circles;for(let Ie of oe)if(!$.circle[Ie]){$.circle[Ie]=!0;let ze=3*Ie,Ee=this.circleKeys[Ie];if(this._circlesCollide(_e[ze],_e[ze+1],_e[ze+2],U.x,U.y,U.radius)&&(!B||B(Ee))&&!Ke(Y,Ee.overlapMode))return P.push(!0),!0}}}_forEachCell(t,a,p,f,b,P,D,B){let U=this._convertToXCellCoord(t),$=this._convertToYCellCoord(a),Y=this._convertToXCellCoord(p),ee=this._convertToYCellCoord(f);for(let oe=U;oe<=Y;oe++)for(let _e=$;_e<=ee;_e++)if(b.call(this,t,a,p,f,this.xCellCount*_e+oe,P,D,B))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,a,p,f,b,P){let D=f-t,B=b-a,U=p+P;return U*U>D*D+B*B}_circleAndRectCollide(t,a,p,f,b,P,D){let B=(P-f)/2,U=Math.abs(t-(f+B));if(U>B+p)return!1;let $=(D-b)/2,Y=Math.abs(a-(b+$));if(Y>$+p)return!1;if(U<=B||Y<=$)return!0;let ee=U-B,oe=Y-$;return ee*ee+oe*oe<=p*p}}function ke(_,t){let a=1/(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]),p=1/(t[8]*t[8]+t[9]*t[9]+t[10]*t[10]),f=t[0]*a,b=t[4]*a,P=t[8]*p,D=t[1]*a,B=t[5]*a,U=t[9]*p,$=t[2]*a,Y=t[6]*a,ee=t[10]*p;_[0]=f,_[1]=b,_[2]=P,_[4]=D,_[5]=B,_[6]=U,_[8]=$,_[9]=Y,_[10]=ee;let oe=t[12],_e=t[13],Ie=t[14];return _[12]=-f*oe-D*_e-$*Ie,_[13]=-b*oe-B*_e-Y*Ie,_[14]=-P*oe-U*_e-ee*Ie,_[3]=0,_[7]=0,_[11]=0,_[15]=1,_}let Ge=o.O();function pt(_,t,a){let p=o.O();if(!_){let{vecSouth:Y,vecEast:ee}=dt(t),oe=Ne();oe[0]=ee[0],oe[1]=ee[1],oe[2]=Y[0],oe[3]=Y[1],f=oe,($=(P=(b=oe)[0])*(U=b[3])-(B=b[2])*(D=b[1]))&&(f[0]=U*($=1/$),f[1]=-D*$,f[2]=-B*$,f[3]=P*$),p[0]=oe[0],p[1]=oe[1],p[4]=oe[2],p[5]=oe[3]}var f,b,P,D,B,U,$;return o.S(p,p,[1/a,1/a,1]),p}function zt(_,t,a,p){if(_){let f=o.O();if(!t){let{vecSouth:b,vecEast:P}=dt(a);f[0]=P[0],f[1]=P[1],f[4]=b[0],f[5]=b[1]}return o.S(f,f,[p,p,1]),f}return a.pixelsToClipSpaceMatrix}function dt(_){let t=Math.cos(_.rollInRadians),a=Math.sin(_.rollInRadians),p=Math.cos(_.pitchInRadians),f=Math.cos(_.bearingInRadians),b=Math.sin(_.bearingInRadians),P=o.az();P[0]=-f*p*a-b*t,P[1]=-b*p*a+f*t;let D=o.aA(P);D<1e-9?o.aB(P):o.aC(P,P,1/D);let B=o.az();B[0]=f*p*t-b*a,B[1]=b*p*t+f*a;let U=o.aA(B);return U<1e-9?o.aB(B):o.aC(B,B,1/U),{vecEast:B,vecSouth:P}}function Lt(_,t,a,p){let f;p?(f=[_,t,p(_,t),1],o.aE(f,f,a)):(f=[_,t,0,1],ec(f,f,a));let b=f[3];return{point:new o.P(f[0]/b,f[1]/b),signedDistanceFromCamera:b,isOccluded:!1}}function gi(_,t){return .5+_/t*.5}function ei(_,t){return _.x>=-t[0]&&_.x<=t[0]&&_.y>=-t[1]&&_.y<=t[1]}function zi(_,t,a,p,f,b,P,D,B,U,$,Y,ee){let oe=a?_.textSizeData:_.iconSizeData,_e=o.aw(oe,t.transform.zoom),Ie=[256/t.width*2+1,256/t.height*2+1],ze=a?_.text.dynamicLayoutVertexArray:_.icon.dynamicLayoutVertexArray;ze.clear();let Ee=_.lineVertexArray,De=a?_.text.placedSymbolArray:_.icon.placedSymbolArray,je=t.transform.width/t.transform.height,Le=!1;for(let we=0;we<De.length;we++){let qe=De.get(we);if(qe.hidden||qe.writingMode===o.ax.vertical&&!Le){Ss(qe.numGlyphs,ze);continue}Le=!1;let Fe=new o.P(qe.anchorX,qe.anchorY),it={getElevation:ee,pitchedLabelPlaneMatrix:p,lineVertexArray:Ee,pitchWithMap:b,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:t.transform,tileAnchorPoint:Fe,unwrappedTileID:B,width:U,height:$,translation:Y},ft=Sr(qe.anchorX,qe.anchorY,it);if(!ei(ft.point,Ie)){Ss(qe.numGlyphs,ze);continue}let _t=gi(t.transform.cameraToCenterDistance,ft.signedDistanceFromCamera),Rt=o.ay(oe,_e,qe),Dt=b?Rt*t.transform.getPitchedTextCorrection(qe.anchorX,qe.anchorY,B)/_t:Rt*_t,_i=Vi({projectionContext:it,pitchedLabelPlaneMatrixInverse:f,symbol:qe,fontSize:Dt,flip:!1,keepUpright:P,glyphOffsetArray:_.glyphOffsetArray,dynamicLayoutVertexArray:ze,aspectRatio:je,rotateToLine:D});Le=_i.useVertical,(_i.notEnoughRoom||Le||_i.needsFlipping&&Vi({projectionContext:it,pitchedLabelPlaneMatrixInverse:f,symbol:qe,fontSize:Dt,flip:!0,keepUpright:P,glyphOffsetArray:_.glyphOffsetArray,dynamicLayoutVertexArray:ze,aspectRatio:je,rotateToLine:D}).notEnoughRoom)&&Ss(qe.numGlyphs,ze)}a?_.text.dynamicLayoutVertexBuffer.updateData(ze):_.icon.dynamicLayoutVertexBuffer.updateData(ze)}function Ri(_,t,a,p,f,b,P,D){let B=b.glyphStartIndex+b.numGlyphs,U=b.lineStartIndex,$=b.lineStartIndex+b.lineLength,Y=t.getoffsetX(b.glyphStartIndex),ee=t.getoffsetX(B-1),oe=vo(_*Y,a,p,f,b.segment,U,$,D,P);if(!oe)return null;let _e=vo(_*ee,a,p,f,b.segment,U,$,D,P);return _e?D.projectionCache.anyProjectionOccluded?null:{first:oe,last:_e}:null}function rr(_,t,a,p){return _===o.ax.horizontal&&Math.abs(a.y-t.y)>Math.abs(a.x-t.x)*p?{useVertical:!0}:(_===o.ax.vertical?t.y<a.y:t.x>a.x)?{needsFlipping:!0}:null}function Vi(_){let{projectionContext:t,pitchedLabelPlaneMatrixInverse:a,symbol:p,fontSize:f,flip:b,keepUpright:P,glyphOffsetArray:D,dynamicLayoutVertexArray:B,aspectRatio:U,rotateToLine:$}=_,Y=f/24,ee=p.lineOffsetX*Y,oe=p.lineOffsetY*Y,_e;if(p.numGlyphs>1){let Ie=p.glyphStartIndex+p.numGlyphs,ze=p.lineStartIndex,Ee=p.lineStartIndex+p.lineLength,De=Ri(Y,D,ee,oe,b,p,$,t);if(!De)return{notEnoughRoom:!0};let je=bn(De.first.point.x,De.first.point.y,t,a),Le=bn(De.last.point.x,De.last.point.y,t,a);if(P&&!b){let we=rr(p.writingMode,je,Le,U);if(we)return we}_e=[De.first];for(let we=p.glyphStartIndex+1;we<Ie-1;we++){let qe=vo(Y*D.getoffsetX(we),ee,oe,b,p.segment,ze,Ee,t,$);if(!qe)return{notEnoughRoom:!0};_e.push(qe)}_e.push(De.last)}else{if(P&&!b){let ze=Fi(t.tileAnchorPoint.x,t.tileAnchorPoint.y,t).point,Ee=p.lineStartIndex+p.segment+1,De=new o.P(t.lineVertexArray.getx(Ee),t.lineVertexArray.gety(Ee)),je=Fi(De.x,De.y,t),Le=je.signedDistanceFromCamera>0?je.point:Hi(t.tileAnchorPoint,De,ze,1,t),we=bn(ze.x,ze.y,t,a),qe=bn(Le.x,Le.y,t,a),Fe=rr(p.writingMode,we,qe,U);if(Fe)return Fe}let Ie=vo(Y*D.getoffsetX(p.glyphStartIndex),ee,oe,b,p.segment,p.lineStartIndex,p.lineStartIndex+p.lineLength,t,$);if(!Ie||t.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};_e=[Ie]}for(let Ie of _e)o.aD(B,Ie.point,Ie.angle);return{}}function Hi(_,t,a,p,f){let b=_.add(_.sub(t)._unit()),P=Fi(b.x,b.y,f).point,D=a.sub(P);return a.add(D._mult(p/D.mag()))}function qi(_,t,a){let p=t.projectionCache;if(p.projections[_])return p.projections[_];let f=new o.P(t.lineVertexArray.getx(_),t.lineVertexArray.gety(_)),b=Fi(f.x,f.y,t);if(b.signedDistanceFromCamera>0)return p.projections[_]=b.point,p.anyProjectionOccluded||(p.anyProjectionOccluded=b.isOccluded),b.point;let P=_-a.direction;return Hi(a.distanceFromAnchor===0?t.tileAnchorPoint:new o.P(t.lineVertexArray.getx(P),t.lineVertexArray.gety(P)),f,a.previousVertex,a.absOffsetX-a.distanceFromAnchor+1,t)}function Fi(_,t,a){let p=_+a.translation[0],f=t+a.translation[1],b;return a.pitchWithMap?(b=Lt(p,f,a.pitchedLabelPlaneMatrix,a.getElevation),b.isOccluded=!1):(b=a.transform.projectTileCoordinates(p,f,a.unwrappedTileID,a.getElevation),b.point.x=(.5*b.point.x+.5)*a.width,b.point.y=(.5*-b.point.y+.5)*a.height),b}function bn(_,t,a,p){if(a.pitchWithMap){let f=[_,t,0,1];return o.aE(f,f,p),a.transform.projectTileCoordinates(f[0]/f[3],f[1]/f[3],a.unwrappedTileID,a.getElevation).point}return{x:_/a.width*2-1,y:1-t/a.height*2}}function Sr(_,t,a){return a.transform.projectTileCoordinates(_,t,a.unwrappedTileID,a.getElevation)}function En(_,t,a){return _._unit()._perp()._mult(t*a)}function va(_,t,a,p,f,b,P,D,B){if(D.projectionCache.offsets[_])return D.projectionCache.offsets[_];let U=a.add(t);if(_+B.direction<p||_+B.direction>=f)return D.projectionCache.offsets[_]=U,U;let $=qi(_+B.direction,D,B),Y=En($.sub(a),P,B.direction),ee=a.add(Y),oe=$.add(Y);return D.projectionCache.offsets[_]=o.aF(b,U,ee,oe)||U,D.projectionCache.offsets[_]}function vo(_,t,a,p,f,b,P,D,B){let U=p?_-t:_+t,$=U>0?1:-1,Y=0;p&&($*=-1,Y=Math.PI),$<0&&(Y+=Math.PI);let ee,oe=$>0?b+f:b+f+1;D.projectionCache.cachedAnchorPoint?ee=D.projectionCache.cachedAnchorPoint:(ee=Fi(D.tileAnchorPoint.x,D.tileAnchorPoint.y,D).point,D.projectionCache.cachedAnchorPoint=ee);let _e,Ie,ze=ee,Ee=ee,De=0,je=0,Le=Math.abs(U),we=[],qe;for(;De+je<=Le;){if(oe+=$,oe<b||oe>=P)return null;De+=je,Ee=ze,Ie=_e;let ft={absOffsetX:Le,direction:$,distanceFromAnchor:De,previousVertex:Ee};if(ze=qi(oe,D,ft),a===0)we.push(Ee),qe=ze.sub(Ee);else{let _t,Rt=ze.sub(Ee);_t=Rt.mag()===0?En(qi(oe+$,D,ft).sub(ze),a,$):En(Rt,a,$),Ie||(Ie=Ee.add(_t)),_e=va(oe,_t,ze,b,P,Ie,a,D,ft),we.push(Ie),qe=_e.sub(Ie)}je=qe.mag()}let Fe=qe._mult((Le-De)/je)._add(Ie||Ee),it=Y+Math.atan2(ze.y-Ee.y,ze.x-Ee.x);return we.push(Fe),{point:Fe,angle:B?it:0,path:we}}let Ir=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Ss(_,t){for(let a=0;a<_;a++){let p=t.length;t.resize(p+4),t.float32.set(Ir,3*p)}}function ec(_,t,a){let p=t[0],f=t[1];return _[0]=a[0]*p+a[4]*f+a[12],_[1]=a[1]*p+a[5]*f+a[13],_[3]=a[3]*p+a[7]*f+a[15],_}let Wr=100;class Kh{constructor(t,a=new Te(t.width+200,t.height+200,25),p=new Te(t.width+200,t.height+200,25)){this.transform=t,this.grid=a,this.ignoredGrid=p,this.pitchFactor=Math.cos(t.pitch*Math.PI/180)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+Wr,this.screenBottomBoundary=t.height+Wr,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(t,a,p,f,b,P,D,B,U,$,Y,ee){let oe=this.projectAndGetPerspectiveRatio(t.anchorPointX+B[0],t.anchorPointY+B[1],b,$,ee),_e=p*oe.perspectiveRatio,Ie;if(P||D)Ie=this._projectCollisionBox(t,_e,f,b,P,D,B,oe,$,Y,ee);else{let qe=oe.x+(Y?Y.x*_e:0),Fe=oe.y+(Y?Y.y*_e:0);Ie={allPointsOccluded:!1,box:[qe+t.x1*_e,Fe+t.y1*_e,qe+t.x2*_e,Fe+t.y2*_e]}}let[ze,Ee,De,je]=Ie.box,Le=P?Ie.allPointsOccluded:oe.isOccluded,we=Le;return we||(we=oe.perspectiveRatio<this.perspectiveRatioCutoff),we||(we=!this.isInsideGrid(ze,Ee,De,je)),we||a!=="always"&&this.grid.hitTest(ze,Ee,De,je,a,U)?{box:[ze,Ee,De,je],placeable:!1,offscreen:!1,occluded:Le}:{box:[ze,Ee,De,je],placeable:!0,offscreen:this.isOffscreen(ze,Ee,De,je),occluded:Le}}placeCollisionCircles(t,a,p,f,b,P,D,B,U,$,Y,ee,oe,_e){let Ie=[],ze=new o.P(a.anchorX,a.anchorY),Ee=this.getPerspectiveRatio(ze.x,ze.y,P,_e),De=(U?b*this.transform.getPitchedTextCorrection(a.anchorX,a.anchorY,P)/Ee:b*Ee)/o.aJ,je={getElevation:_e,pitchedLabelPlaneMatrix:D,lineVertexArray:p,pitchWithMap:U,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:this.transform,tileAnchorPoint:ze,unwrappedTileID:P,width:this.transform.width,height:this.transform.height,translation:oe},Le=Ri(De,f,a.lineOffsetX*De,a.lineOffsetY*De,!1,a,!1,je),we=!1,qe=!1,Fe=!0;if(Le){let it=.5*Y*Ee+ee,ft=new o.P(-100,-100),_t=new o.P(this.screenRightBoundary,this.screenBottomBoundary),Rt=new $e,Dt=Le.first,_i=Le.last,Gt=[];for(let Ci=Dt.path.length-1;Ci>=1;Ci--)Gt.push(Dt.path[Ci]);for(let Ci=1;Ci<_i.path.length;Ci++)Gt.push(_i.path[Ci]);let Et=2.5*it;if(U){let Ci=this.projectPathToScreenSpace(Gt,je);Gt=Ci.some((fr=>fr.signedDistanceFromCamera<=0))?[]:Ci.map((fr=>fr.point))}let ti=[];if(Gt.length>0){let Ci=Gt[0].clone(),fr=Gt[0].clone();for(let Pn=1;Pn<Gt.length;Pn++)Ci.x=Math.min(Ci.x,Gt[Pn].x),Ci.y=Math.min(Ci.y,Gt[Pn].y),fr.x=Math.max(fr.x,Gt[Pn].x),fr.y=Math.max(fr.
2y,Gt[Pn].y);ti=Ci.x>=ft.x&&fr.x<=_t.x&&Ci.y>=ft.y&&fr.y<=_t.y?[Gt]:fr.x<ft.x||Ci.x>_t.x||fr.y<ft.y||Ci.y>_t.y?[]:o.aG([Gt],ft.x,ft.y,_t.x,_t.y)}for(let Ci of ti){Rt.reset(Ci,.25*it);let fr=0;fr=Rt.length<=.5*it?1:Math.ceil(Rt.paddedLength/Et)+1;for(let Pn=0;Pn<fr;Pn++){let kr=Pn/Math.max(fr-1,1),qn=Rt.lerp(kr),kn=qn.x+Wr,ho=qn.y+Wr;Ie.push(kn,ho,it,0);let tn=kn-it,sa=ho-it,Eo=kn+it,uo=ho+it;if(Fe&&(Fe=this.isOffscreen(tn,sa,Eo,uo)),qe||(qe=this.isInsideGrid(tn,sa,Eo,uo)),t!=="always"&&this.grid.hitTestCircle(kn,ho,it,t,$)&&(we=!0,!B))return{circles:[],offscreen:!1,collisionDetected:we}}}}return{circles:!B&&we||!qe||Ee<this.perspectiveRatioCutoff?[]:Ie,offscreen:Fe,collisionDetected:we}}projectPathToScreenSpace(t,a){let p=(function(f,b){let P=Ge;return(function(D,B){let U=1/(B[0]*B[5]-B[1]*B[4]);D[0]=B[5]*U,D[1]=-B[1]*U,D[2]=0,D[3]=0,D[4]=-B[4]*U,D[5]=B[0]*U,D[6]=0,D[7]=0,D[8]=0,D[9]=0,D[10]=1/B[10],D[11]=0,D[12]=0,D[13]=0,D[14]=0,D[15]=1/B[15]})(P,b.pitchedLabelPlaneMatrix),f.map((D=>{let B=Lt(D.x,D.y,P,b.getElevation),U=b.transform.projectTileCoordinates(B.point.x,B.point.y,b.unwrappedTileID,b.getElevation);return U.point.x=(.5*U.point.x+.5)*b.width,U.point.y=(.5*-U.point.y+.5)*b.height,U}))})(t,a);return(function(f){let b=0,P=0,D=0,B=0;for(let U=0;U<f.length;U++)f[U].isOccluded?(D=U+1,B=0):(B++,B>P&&(P=B,b=D));return f.slice(b,b+P)})(p)}queryRenderedSymbols(t){if(t.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let a=[],p=new o.a8;for(let Y of t){let ee=new o.P(Y.x+Wr,Y.y+Wr);p.extend(ee),a.push(ee)}let{minX:f,minY:b,maxX:P,maxY:D}=p,B=this.grid.query(f,b,P,D).concat(this.ignoredGrid.query(f,b,P,D)),U={},$={};for(let Y of B){let ee=Y.key;if(U[ee.bucketInstanceId]===void 0&&(U[ee.bucketInstanceId]={}),U[ee.bucketInstanceId][ee.featureIndex])continue;let oe=[new o.P(Y.x1,Y.y1),new o.P(Y.x2,Y.y1),new o.P(Y.x2,Y.y2),new o.P(Y.x1,Y.y2)];o.aH(a,oe)&&(U[ee.bucketInstanceId][ee.featureIndex]=!0,$[ee.bucketInstanceId]===void 0&&($[ee.bucketInstanceId]=[]),$[ee.bucketInstanceId].push(ee.featureIndex))}return $}insertCollisionBox(t,a,p,f,b,P){(p?this.ignoredGrid:this.grid).insert({bucketInstanceId:f,featureIndex:b,collisionGroupID:P,overlapMode:a},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,a,p,f,b,P){let D=p?this.ignoredGrid:this.grid,B={bucketInstanceId:f,featureIndex:b,collisionGroupID:P,overlapMode:a};for(let U=0;U<t.length;U+=4)D.insertCircle(B,t[U],t[U+1],t[U+2])}projectAndGetPerspectiveRatio(t,a,p,f,b){if(b){let P;f?(P=[t,a,f(t,a),1],o.aE(P,P,b)):(P=[t,a,0,1],ec(P,P,b));let D=P[3];return{x:(P[0]/D+1)/2*this.transform.width+Wr,y:(-P[1]/D+1)/2*this.transform.height+Wr,perspectiveRatio:.5+this.transform.cameraToCenterDistance/D*.5,isOccluded:!1,signedDistanceFromCamera:D}}{let P=this.transform.projectTileCoordinates(t,a,p,f);return{x:(P.point.x+1)/2*this.transform.width+Wr,y:(1-P.point.y)/2*this.transform.height+Wr,perspectiveRatio:.5+this.transform.cameraToCenterDistance/P.signedDistanceFromCamera*.5,isOccluded:P.isOccluded,signedDistanceFromCamera:P.signedDistanceFromCamera}}}getPerspectiveRatio(t,a,p,f){let b=this.transform.projectTileCoordinates(t,a,p,f);return .5+this.transform.cameraToCenterDistance/b.signedDistanceFromCamera*.5}isOffscreen(t,a,p,f){return p<Wr||t>=this.screenRightBoundary||f<Wr||a>this.screenBottomBoundary}isInsideGrid(t,a,p,f){return p>=0&&t<this.gridRightBoundary&&f>=0&&a<this.gridBottomBoundary}getViewportMatrix(){let t=o.ap([]);return o.Q(t,t,[-100,-100,0]),t}_projectCollisionBox(t,a,p,f,b,P,D,B,U,$,Y){let ee=1,oe=0,_e=0,Ie=1,ze=t.anchorPointX+D[0],Ee=t.anchorPointY+D[1];if(P&&!b){let Gt=this.projectAndGetPerspectiveRatio(ze+1,Ee,f,U,Y),Et=Gt.x-B.x,ti=Math.atan((Gt.y-B.y)/Et)+(Et<0?Math.PI:0),Ci=Math.sin(ti),fr=Math.cos(ti);ee=fr,oe=Ci,_e=-Ci,Ie=fr}else if(!P&&b){let Gt=dt(this.transform);ee=Gt.vecEast[0],oe=Gt.vecEast[1],_e=Gt.vecSouth[0],Ie=Gt.vecSouth[1]}let De=B.x,je=B.y,Le=a;b&&(De=ze,je=Ee,Le=Math.pow(2,-(this.transform.zoom-p.overscaledZ)),Le*=this.transform.getPitchedTextCorrection(ze,Ee,f),$||(Le*=o.al(.5+B.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))),$&&(De+=ee*$.x*Le+_e*$.y*Le,je+=oe*$.x*Le+Ie*$.y*Le);
vendor: 8,693 bytes, line 2
2let we=t.x1*Le,qe=t.x2*Le,Fe=(we+qe)/2,it=t.y1*Le,ft=t.y2*Le,_t=(it+ft)/2,Rt=[{offsetX:we,offsetY:it},{offsetX:Fe,offsetY:it},{offsetX:qe,offsetY:it},{offsetX:qe,offsetY:_t},{offsetX:qe,offsetY:ft},{offsetX:Fe,offsetY:ft},{offsetX:we,offsetY:ft},{offsetX:we,offsetY:_t}],Dt=[];for(let{offsetX:Gt,offsetY:Et}of Rt)Dt.push(new o.P(De+ee*Gt+_e*Et,je+oe*Gt+Ie*Et));let _i=!1;if(b){let Gt=Dt.map((Et=>this.projectAndGetPerspectiveRatio(Et.x,Et.y,f,U,Y)));_i=Gt.some((Et=>!Et.isOccluded)),Dt=Gt.map((Et=>new o.P(Et.x,Et.y)))}else _i=!0;return{box:o.aI(Dt),allPointsOccluded:!_i}}}class sh{constructor(t,a,p,f){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?a:-a))):f&&p?1:0,this.placed=p}isHidden(){return this.opacity===0&&!this.placed}}class Ec{constructor(t,a,p,f,b){this.text=new sh(t?t.text:null,a,p,b),this.icon=new sh(t?t.icon:null,a,f,b)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Mc{constructor(t,a,p){this.text=t,this.icon=a,this.skipFade=p}}class lh{constructor(t,a,p,f,b){this.bucketInstanceId=t,this.featureIndex=a,this.sourceLayerIndex=p,this.bucketIndex=f,this.tileID=b}}class Yh{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){let a=++this.maxGroupID;this.collisionGroups[t]={ID:a,predicate:p=>p.collisionGroupID===a}}return this.collisionGroups[t]}}function Pc(_,t,a,p,f){let{horizontalAlign:b,verticalAlign:P}=o.aP(_);return new o.P(-(b-.5)*t+p[0]*f,-(P-.5)*a+p[1]*f)}class ch{constructor(t,a,p,f,b){this.transform=t.clone(),this.terrain=a,this.collisionIndex=new Kh(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=p,this.retainedQueryData={},this.collisionGroups=new Yh(f),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=b,b&&(b.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(t){let a=this.terrain;return a?(p,f)=>a.getElevation(t,p,f):null}getBucketParts(t,a,p,f){let b=p.getBucket(a),P=p.latestFeatureIndex;if(!b||!P||a.id!==b.layerIds[0])return;let D=p.collisionBoxArray,B=b.layers[0].layout,U=b.layers[0].paint,$=Math.pow(2,this.transform.zoom-p.tileID.overscaledZ),Y=p.tileSize/o.a6,ee=p.tileID.toUnwrapped(),oe=B.get("text-rotation-alignment")==="map",_e=o.aK(p,1,this.transform.zoom),Ie=o.aL(this.collisionIndex.transform,p,U.get("text-translate"),U.get("text-translate-anchor")),ze=o.aL(this.collisionIndex.transform,p,U.get("icon-translate"),U.get("icon-translate-anchor")),Ee=pt(oe,this.transform,_e);this.retainedQueryData[b.bucketInstanceId]=new lh(b.bucketInstanceId,P,b.sourceLayerIndex,b.index,p.tileID);let De={bucket:b,layout:B,translationText:Ie,translationIcon:ze,unwrappedTileID:ee,pitchedLabelPlaneMatrix:Ee,scale:$,textPixelRatio:Y,holdingForFade:p.holdingForSymbolFade(),collisionBoxArray:D,partiallyEvaluatedTextSize:o.aw(b.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(b.sourceID)};if(f)for(let je of b.sortKeyRanges){let{sortKey:Le,symbolInstanceStart:we,symbolInstanceEnd:qe}=je;t.push({sortKey:Le,symbolInstanceStart:we,symbolInstanceEnd:qe,parameters:De})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:b.symbolInstances.length,parameters:De})}attemptAnchorPlacement(t,a,p,f,b,P,D,B,U,$,Y,ee,oe,_e,Ie,ze,Ee,De,je,Le){var we,qe,Fe;let it=o.aM[t.textAnchor],ft=[t.textOffset0,t.textOffset1],_t=Pc(it,p,f,ft,b),Rt=this.collisionIndex.placeCollisionBox(a,ee,B,U,$,D,P,ze,Y.predicate,je,_t,Le);if((!De||this.collisionIndex.placeCollisionBox(De,ee,B,U,$,D,P,Ee,Y.predicate,je,_t,Le).placeable)&&Rt.placeable){let Dt;if(!((we=this.prevPlacement)===null||we===void 0)&&we.variableOffsets[oe.crossTileID]&&(!((Fe=(qe=this.prevPlacement)===null||qe===void 0?void 0:qe.placements[oe.crossTileID])===null||Fe===void 0)&&Fe.text)&&(Dt=this.prevPlacement.variableOffsets[oe.crossTileID].anchor),oe.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[oe.crossTileID]={textOffset:ft,width:p,height:f,anchor:it,textBoxScale:b,prevAnchor:Dt},this.markUsedJustification(_e,it,oe,Ie),_e.allowVerticalPlacement&&(this.markUsedOrientation(_e,Ie,oe),this.placedOrientations[oe.crossTileID]=Ie),{shift:_t,placedGlyphBoxes:Rt}}}placeLayerBucketPart(t,a,p){let{bucket:f,layout:b,translationText:P,translationIcon:D,unwrappedTileID:B,pitchedLabelPlaneMatrix:U,textPixelRatio:$,holdingForFade:Y,collisionBoxArray:ee,partiallyEvaluatedTextSize:oe,collisionGroup:_e}=t.parameters,Ie=b.get("text-optional"),ze=b.get("icon-optional"),Ee=o.aN(b,"text-overlap","text-allow-overlap"),De=Ee==="always",je=o.aN(b,"icon-overlap","icon-allow-overlap"),Le=je==="always",we=b.get("text-rotation-alignment")==="map",qe=b.get("text-pitch-alignment")==="map",Fe=b.get("icon-text-fit")!=="none",it=b.get("symbol-z-order")==="viewport-y",ft=De&&(Le||!f.hasIconData()||ze),_t=Le&&(De||!f.hasTextData()||Ie);!f.collisionArrays&&ee&&f.deserializeCollisionBoxes(ee);let Rt=this.retainedQueryData[f.bucketInstanceId].tileID,Dt=this._getTerrainElevationFunc(Rt),_i=this.transform.getFastPathSimpleProjectionMatrix(Rt),Gt=(Et,ti,Ci)=>{var fr,Pn;if(a[Et.crossTileID])return;if(Y)return void(this.placements[Et.crossTileID]=new Mc(!1,!1,!1));let kr=!1,qn=!1,kn=!0,ho=null,tn={box:null,placeable:!1,offscreen:null,occluded:!1},sa={placeable:!1},Eo=null,uo=null,jo=null,gc=0,la=0,_c=0;ti.textFeatureIndex?gc=ti.textFeatureIndex:Et.useRuntimeCollisionCircles&&(gc=Et.featureIndex),ti.verticalTextFeatureIndex&&(la=ti.verticalTextFeatureIndex);let Mo=ti.textBox;if(Mo){let pl=dn=>{let Kr=o.ax.horizontal;if(f.allowVerticalPlacement&&!dn&&this.prevPlacement){let Yn=this.prevPlacement.placedOrientations[Et.crossTileID];Yn&&(this.placedOrientations[Et.crossTileID]=Yn,Kr=Yn,this.markUsedOrientation(f,Kr,Et))}return Kr},Vs=(dn,Kr)=>{if(f.allowVerticalPlacement&&Et.numVerticalGlyphVertices>0&&ti.verticalTextBox){for(let Yn of f.writingModes)if(Yn===o.ax.vertical?(tn=Kr(),sa=tn):tn=dn(),tn?.placeable)break}else tn=dn()},za=Et.textAnchorOffsetStartIndex,ys=Et.textAnchorOffsetEndIndex;if(ys===za){let dn=(Kr,Yn)=>{let Yr=this.collisionIndex.placeCollisionBox(Kr,Ee,$,Rt,B,qe,we,P,_e.predicate,Dt,void 0,_i);return Yr?.placeable&&(this.markUsedOrientation(f,Yn,Et),this.placedOrientations[Et.crossTileID]=Yn),Yr};Vs((()=>dn(Mo,o.ax.horizontal)),(()=>{let Kr=ti.verticalTextBox;return f.allowVerticalPlacement&&Et.numVerticalGlyphVertices>0&&Kr?dn(Kr,o.ax.vertical):{box:null,offscreen:null}})),pl(tn?.placeable)}else{let dn=o.aM[(Pn=(fr=this.prevPlacement)===null||fr===void 0?void 0:fr.variableOffsets[Et.crossTileID])===null||Pn===void 0?void 0:Pn.anchor],Kr=(Yr,Ns,Lh)=>{let ql=Yr.x2-Yr.x1,Ap=Yr.y2-Yr.y1,pd=Et.textBoxScale,Kc=Fe&&je==="never"?Ns:null,$l=null,xc=Ee==="never"?1:2,vc="never";dn&&xc++;for(let zp=0;zp<xc;zp++){for(let Dp=za;Dp<ys;Dp++){let Nu=f.textAnchorOffsets.get(Dp);if(dn&&Nu.textAnchor!==dn)continue;let Uu=this.attemptAnchorPlacement(Nu,Yr,ql,Ap,pd,we,qe,$,Rt,B,_e,vc,Et,f,Lh,P,D,Kc,Dt);if(Uu&&($l=Uu.placedGlyphBoxes,$l?.placeable))return kr=!0,ho=Uu.shift,$l}dn?dn=null:vc=Ee}return p&&!$l&&($l={box:this.collisionIndex.placeCollisionBox(Mo,"always",$,Rt,B,qe,we,P,_e.predicate,Dt,void 0,_i).box,offscreen:!1,placeable:!1,occluded:!1}),$l};Vs((()=>Kr(Mo,ti.iconBox,o.ax.horizontal)),(()=>{let Yr=ti.verticalTextBox;return f.allowVerticalPlacement&&!tn?.placeable&&Et.numVerticalGlyphVertices>0&&Yr?Kr(Yr,ti.verticalIconBox,o.ax.vertical):{box:null,occluded:!0,offscreen:null}})),tn&&(kr=tn.placeable,kn=tn.offscreen);let Yn=pl(tn?.placeable);if(!kr&&this.prevPlacement){let Yr=this.prevPlacement.variableOffsets[Et.crossTileID];Yr&&(this.variableOffsets[Et.crossTileID]=Yr,this.markUsedJustification(f,Yr.anchor,Et,Yn))}}}if(Eo=tn,kr=Eo?.placeable,kn=Eo?.offscreen,Et.useRuntimeCollisionCircles&&Et.centerJustifiedTextSymbolIndex>=0){let pl=f.text.placedSymbolArray.get(Et.centerJustifiedTextSymbolIndex),Vs=o.ay(f.textSizeData,oe,pl),za=b.get("text-padding");uo=this.collisionIndex.placeCollisionCircles(Ee,pl,f.lineVertexArray,f.glyphOffsetArray,Vs,B,U,p,qe,_e.predicate,Et.collisionCircleDiameter,za,P,Dt),uo.circles.length&&uo.collisionDetected&&!p&&o.w("Collisions detected, but collision boxes are not shown"),kr=De||uo.circles.length>0&&!uo.collisionDetected,kn&&(kn=uo.offscreen)}if(ti.iconFeatureIndex&&(_c=ti.iconFeatureIndex),ti.iconBox){let pl=Vs=>this.collisionIndex.placeCollisionBox(Vs,je,$,Rt,B,qe,we,D,_e.predicate,Dt,Fe&&ho?ho:void 0,_i);sa&&sa.placeable&&ti.verticalIconBox?(jo=pl(ti.verticalIconBox),qn=jo.placeable):(jo=pl(ti.iconBox),qn=jo.placeable),kn&&(kn=jo.offscreen)}
2let Aa=Ie||Et.numHorizontalGlyphVertices===0&&Et.numVerticalGlyphVertices===0,yc=ze||Et.numIconVertices===0;Aa||yc?yc?Aa||qn&&(qn=kr):kr=qn&&kr:qn=kr=qn&&kr;let Vu=qn&&jo.placeable;if(kr&&Eo.placeable&&this.collisionIndex.insertCollisionBox(Eo.box,Ee,b.get("text-ignore-placement"),f.bucketInstanceId,sa&&sa.placeable&&la?la:gc,_e.ID),Vu&&this.collisionIndex.insertCollisionBox(jo.box,je,b.get("icon-ignore-placement"),f.bucketInstanceId,_c,_e.ID),uo&&kr&&this.collisionIndex.insertCollisionCircles(uo.circles,Ee,b.get("text-ignore-placement"),f.bucketInstanceId,gc,_e.ID),p&&this.storeCollisionData(f.bucketInstanceId,Ci,ti,Eo,jo,uo),Et.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(f.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[Et.crossTileID]=new Mc((kr||ft)&&!Eo?.occluded,(qn||_t)&&!jo?.occluded,kn||f.justReloaded),a[Et.crossTileID]=!0};if(it){if(t.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");let Et=f.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let ti=Et.length-1;ti>=0;--ti){let Ci=Et[ti];Gt(f.symbolInstances.get(Ci),f.collisionArrays[Ci],Ci)}}else for(let Et=t.symbolInstanceStart;Et<t.symbolInstanceEnd;Et++)Gt(f.symbolInstances.get(Et),f.collisionArrays[Et],Et);f.justReloaded=!1}storeCollisionData(t,a,p,f,b,P){if(p.textBox||p.iconBox){let D,B;this.collisionBoxArrays.has(t)?D=this.collisionBoxArrays.get(t):(D=new Map,this.collisionBoxArrays.set(t,D)),D.has(a)?B=D.get(a):(B={text:null,icon:null},D.set(a,B)),p.textBox&&(B.text=f.box),p.iconBox&&(B.icon=b.box)}if(P){let D=this.collisionCircleArrays[t];D===void 0&&(D=this.collisionCircleArrays[t]=[]);for(let B=0;B<P.circles.length;B+=4)D.push(P.circles[B+0]-Wr),D.push(P.circles[B+1]-Wr),D.push(P.circles[B+2]),D.push(P.collisionDetected?1:0)}}markUsedJustification(t,a,p,f){let b;b=f===o.ax.vertical?p.verticalPlacedTextSymbolIndex:{left:p.leftJustifiedTextSymbolIndex,center:p.centerJustifiedTextSymbolIndex,right:p.rightJustifiedTextSymbolIndex}[o.aO(a)];let P=[p.leftJustifiedTextSymbolIndex,p.centerJustifiedTextSymbolIndex,p.rightJustifiedTextSymbolIndex,p.verticalPlacedTextSymbolIndex];for(let D of P)D>=0&&(t.text.placedSymbolArray.get(D).crossTileID=b>=0&&D!==b?0:p.crossTileID)}markUsedOrientation(t,a,p){let f=a===o.ax.horizontal||a===o.ax.horizontalOnly?a:0,b=a===o.ax.vertical?a:0,P=[p.leftJustifiedTextSymbolIndex,p.centerJustifiedTextSymbolIndex,p.rightJustifiedTextSymbolIndex];for(let D of P)t.text.placedSymbolArray.get(D).placedOrientation=f;p.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(p.verticalPlacedTextSymbolIndex).placedOrientation=b)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;let a=this.prevPlacement,p=!1;this.prevZoomAdjustment=a?a.zoomAdjustment(this.transform.zoom):0;let f=a?a.symbolFadeChange(t):1,b=a?a.opacities:{},P=a?a.variableOffsets:{},D=a?a.placedOrientations:{};for(let B in this.placements){let U=this.placements[B],$=b[B];$?(this.opacities[B]=new Ec($,f,U.text,U.icon),p||(p=U.text!==$.text.placed),p||(p=U.icon!==$.icon.placed)):(this.opacities[B]=new Ec(null,f,U.text,U.icon,U.skipFade),p||(p=U.text||U.icon))}for(let B in b){let U=b[B];if(!this.opacities[B]){let $=new Ec(U,f,!1,!1);$.isHidden()||(this.opacities[B]=$,p||(p=U.text.placed),p||(p=U.icon.placed))}}for(let B in P)this.variableOffsets[B]||!this.opacities[B]||this.opacities[B].isHidden()||(this.variableOffsets[B]=P[B]);for(let B in D)this.placedOrientations[B]||!this.opacities[B]||this.opacities[B].isHidden()||(this.placedOrientations[B]=D[B]);if(a&&a.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");p?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=a?a.lastPlacementChangeTime:t)}updateLayerOpacities(t,a){let p={};for(let f of a){let b=f.getBucket(t);b&&f.latestFeatureIndex&&t.id===b.layerIds[0]&&this.updateBucketOpacities(b,f.tileID,p,f.collisionBoxArray)}}updateBucketOpacities(t,a,p,f){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();
vendor: 12,137 bytes, lines 2-29
2let b=t.layers[0],P=b.layout,D=new Ec(null,0,!1,!1,!0),B=P.get("text-allow-overlap"),U=P.get("icon-allow-overlap"),$=b._unevaluatedLayout.hasValue("text-variable-anchor")||b._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Y=P.get("text-rotation-alignment")==="map",ee=P.get("text-pitch-alignment")==="map",oe=P.get("icon-text-fit")!=="none",_e=new Ec(null,0,B&&(U||!t.hasIconData()||P.get("icon-optional")),U&&(B||!t.hasTextData()||P.get("text-optional")),!0);!t.collisionArrays&&f&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(f);let Ie=(Ee,De,je)=>{for(let Le=0;Le<De/4;Le++)Ee.opacityVertexArray.emplaceBack(je);Ee.hasVisibleVertices||(Ee.hasVisibleVertices=je!==Mr)},ze=this.collisionBoxArrays.get(t.bucketInstanceId);for(let Ee=0;Ee<t.symbolInstances.length;Ee++){let De=t.symbolInstances.get(Ee),{numHorizontalGlyphVertices:je,numVerticalGlyphVertices:Le,crossTileID:we}=De,qe=this.opacities[we];p[we]?qe=D:qe||(qe=_e,this.opacities[we]=qe),p[we]=!0;let Fe=De.numIconVertices>0,it=this.placedOrientations[De.crossTileID],ft=it===o.ax.vertical,_t=it===o.ax.horizontal||it===o.ax.horizontalOnly;if(je>0||Le>0){let Dt=bl(qe.text);Ie(t.text,je,ft?Mr:Dt),Ie(t.text,Le,_t?Mr:Dt);let _i=qe.text.isHidden(),Gt=[De.rightJustifiedTextSymbolIndex,De.centerJustifiedTextSymbolIndex,De.leftJustifiedTextSymbolIndex];for(let Ci of Gt)Ci>=0&&(t.text.placedSymbolArray.get(Ci).hidden=_i||ft?1:0);De.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(De.verticalPlacedTextSymbolIndex).hidden=_i||_t?1:0);let Et=this.variableOffsets[De.crossTileID];Et&&this.markUsedJustification(t,Et.anchor,De,it);let ti=this.placedOrientations[De.crossTileID];ti&&(this.markUsedJustification(t,"left",De,ti),this.markUsedOrientation(t,ti,De))}if(Fe){let Dt=bl(qe.icon),_i=!(oe&&De.verticalPlacedIconSymbolIndex&&ft);De.placedIconSymbolIndex>=0&&(Ie(t.icon,De.numIconVertices,_i?Dt:Mr),t.icon.placedSymbolArray.get(De.placedIconSymbolIndex).hidden=qe.icon.isHidden()),De.verticalPlacedIconSymbolIndex>=0&&(Ie(t.icon,De.numVerticalIconVertices,_i?Mr:Dt),t.icon.placedSymbolArray.get(De.verticalPlacedIconSymbolIndex).hidden=qe.icon.isHidden())}let Rt=ze?.has(Ee)?ze.get(Ee):{text:null,icon:null};if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){let Dt=t.collisionArrays[Ee];if(Dt){let _i=new o.P(0,0);if(Dt.textBox||Dt.verticalTextBox){let Gt=!0;if($){let Et=this.variableOffsets[we];Et?(_i=Pc(Et.anchor,Et.width,Et.height,Et.textOffset,Et.textBoxScale),Y&&_i._rotate(ee?-this.transform.bearingInRadians:this.transform.bearingInRadians)):Gt=!1}if(Dt.textBox||Dt.verticalTextBox){let Et;Dt.textBox&&(Et=ft),Dt.verticalTextBox&&(Et=_t),Is(t.textCollisionBox.collisionVertexArray,qe.text.placed,!Gt||Et,Rt.text,_i.x,_i.y)}}if(Dt.iconBox||Dt.verticalIconBox){let Gt=!!(!_t&&Dt.verticalIconBox),Et;Dt.iconBox&&(Et=Gt),Dt.verticalIconBox&&(Et=!Gt),Is(t.iconCollisionBox.collisionVertexArray,qe.icon.placed,Et,Rt.icon,oe?_i.x:0,oe?_i.y:0)}}}}if(t.sortFeatures(-this.transform.bearingInRadians),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);t.bucketInstanceId in this.collisionCircleArrays&&(t.collisionCircleArray=this.collisionCircleArrays[t.bucketInstanceId],delete this.collisionCircleArrays[t.bucketInstanceId])}symbolFadeChange(t){return this.fadeDuration===0?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(t,a){let p=this.zoomAtLastRecencyCheck===a?1-this.zoomAdjustment(a):1;return this.zoomAtLastRecencyCheck=a,this.commitTime+this.fadeDuration*p>t}setStale(){this.stale=!0}}function Is(_,t,a,p,f,b){p&&p.length!==0||(p=[0,0,0,0]);let P=p[0]-Wr,D=p[1]-Wr,B=p[2]-Wr,U=p[3]-Wr;_.emplaceBack(t?1:0,a?1:0,f||0,b||0,P,D),_.emplaceBack(t?1:0,a?1:0,f||0,b||0,B,D),_.emplaceBack(t?1:0,a?1:0,f||0,b||0,B,U),_.emplaceBack(t?1:0,a?1:0,f||0,b||0,P,U)}let vl=Math.pow(2,25),Ys=Math.pow(2,24),hh=Math.pow(2,17),Js=Math.pow(2,16),Cs=Math.pow(2,9),uh=Math.pow(2,8),Es=Math.pow(2,1);function bl(_){if(_.opacity===0&&!_.placed)return 0;if(_.opacity===1&&_.placed)return 4294967295;let t=_.placed?1:0,a=Math.floor(127*_.opacity);return a*vl+t*Ys+a*hh+t*Js+a*Cs+t*uh+a*Es+t}let Mr=0;class ba{constructor(t){this._sortAcrossTiles=t.layout.get("symbol-z-order")!=="viewport-y"&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,a,p,f,b){let P=this._bucketParts;for(;this._currentTileIndex<t.length;)if(a.getBucketParts(P,f,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,b())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,P.sort(((D,B)=>D.sortKey-B.sortKey)));this._currentPartIndex<P.length;)if(a.placeLayerBucketPart(P[this._currentPartIndex],this._seenCrossTileIDs,p),this._currentPartIndex++,b())return!0;return!1}}class wl{constructor(t,a,p,f,b,P,D,B){this.placement=new ch(t,a,P,D,B),this._currentPlacementIndex=p.length-1,this._forceFullPlacement=f,this._showCollisionBoxes=b,this._done=!1}isDone(){return this._done}continuePlacement(t,a,p){let f=Mt(),b=()=>!this._forceFullPlacement&&Mt()-f>2;for(;this._currentPlacementIndex>=0;){let P=a[t[this._currentPlacementIndex]],D=this.placement.collisionIndex.transform.zoom;if(o.aQ(P)&&P.layout&&(!P.minzoom||P.minzoom<=D)&&(!P.maxzoom||P.maxzoom>D)){if(this._inProgressLayer||(this._inProgressLayer=new ba(P)),this._inProgressLayer.continuePlacement(p[P.source],this.placement,this._showCollisionBoxes,P,b))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}let Yi=512/o.a6/2;class kc{constructor(t,a,p){this.tileID=t,this.bucketInstanceId=p,this._symbolsByKey={};let f=new Map;for(let b=0;b<a.length;b++){let P=a.get(b),D=P.key,B=f.get(D);B?B.push(P):f.set(D,[P])}for(let[b,P]of f){let D={positions:P.map((B=>({x:Math.floor(B.anchorX*Yi),y:Math.floor(B.anchorY*Yi)}))),crossTileIDs:P.map((B=>B.crossTileID))};if(D.positions.length>128){let B=new o.aR(D.positions.length,16,Uint16Array);for(let{x:U,y:$}of D.positions)B.add(U,$);B.finish(),delete D.positions,D.index=B}this._symbolsByKey[b]=D}}getScaledCoordinates(t,a){let{x:p,y:f,z:b}=this.tileID.canonical,{x:P,y:D,z:B}=a.canonical,U=Yi/Math.pow(2,B-b),$=(D*o.a6+t.anchorY)*U,Y=f*o.a6*Yi;return{x:Math.floor((P*o.a6+t.anchorX)*U-p*o.a6*Yi),y:Math.floor($-Y)}}findMatches(t,a,p){let f=this.tileID.canonical.z<a.canonical.z?1:Math.pow(2,this.tileID.canonical.z-a.canonical.z);for(let b=0;b<t.length;b++){let P=t.get(b);if(P.crossTileID)continue;let D=this._symbolsByKey[P.key];if(!D)continue;let B=this.getScaledCoordinates(P,a);if(D.index){let U=D.index.range(B.x-f,B.y-f,B.x+f,B.y+f).sort();for(let $ of U){let Y=D.crossTileIDs[$];if(!p[Y]){p[Y]=!0,P.crossTileID=Y;break}}}else if(D.positions)for(let U=0;U<D.positions.length;U++){let $=D.positions[U],Y=D.crossTileIDs[U];if(Math.abs($.x-B.x)<=f&&Math.abs($.y-B.y)<=f&&!p[Y]){p[Y]=!0,P.crossTileID=Y;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map((({crossTileIDs:t})=>t))}}class ph{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class dh{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){let a=Math.round((t-this.lng)/360);if(a!==0)for(let p in this.indexes){let f=this.indexes[p],b={};for(let P in f){let D=f[P];D.tileID=D.tileID.unwrapTo(D.tileID.wrap+a),b[D.tileID.key]=D}this.indexes[p]=b}this.lng=t}addBucket(t,a,p){var f,b,P;if(!((f=this.indexes[t.overscaledZ])===null||f===void 0)&&f[t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===a.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let B=0;B<a.symbolInstances.length;B++)a.symbolInstances.get(B).crossTileID=0;(b=this.usedCrossTileIDs)[P=t.overscaledZ]||(b[P]={});let D=this.usedCrossTileIDs[t.overscaledZ];for(let B in this.indexes){let U=this.indexes[B];if(Number(B)>t.overscaledZ)for(let $ in U){let Y=U[$];Y.tileID.isChildOf(t)&&Y.findMatches(a.symbolInstances,t,D)}else{let $=U[t.scaledTo(Number(B)).key];$&&$.findMatches(a.symbolInstances,t,D)}}for(let B=0;B<a.symbolInstances.length;B++){let U=a.symbolInstances.get(B);U.crossTileID||(U.crossTileID=p.generate(),D[U.crossTileID]=!0)}return this.indexes[t.overscaledZ]===void 0&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new kc(t,a.symbolInstances,a.bucketInstanceId),!0}removeBucketCrossTileIDs(t,a){for(let p of a.getCrossTileIDsLists())for(let f of p)delete this.usedCrossTileIDs[t][f]}removeStaleBuckets(t){let a=!1;for(let p in this.indexes){let f=this.indexes[p];for(let b in f)t[f[b].bucketInstanceId]||(this.removeBucketCrossTileIDs(p,f[b]),delete f[b],a=!0)}return a}}class Fo{constructor(){this.layerIndexes={},this.crossTileIDs=new ph,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,a,p){let f=this.layerIndexes[t.id];f===void 0&&(f=this.layerIndexes[t.id]=new dh);let b=!1,P={};f.handleWrapJump(p);for(let D of a){let B=D.getBucket(t);t.id===B?.layerIds[0]&&(B.bucketInstanceId||(this.maxBucketInstanceId+=1,B.bucketInstanceId=this.maxBucketInstanceId),f.addBucket(D.tileID,B,this.crossTileIDs)&&(b=!0),P[B.bucketInstanceId]=!0)}return f.removeStaleBuckets(P)&&(b=!0),b}pruneUnusedLayers(t){let a={};for(let p of t)a[p]=!0;for(let p in this.layerIndexes)a[p]||delete this.layerIndexes[p]}}var so="void main() {fragColor=vec4(1.0);}";let Br={prelude:Ni(`#ifdef GL_ES 3precision mediump float; 4#else 5#if !defined(lowp) 6#define lowp 7#endif 8#if !defined(mediump) 9#define mediump 10#endif 11#if !defined(highp) 12#define highp 13#endif 14#endif 15out highp vec4 fragColor;`,`#ifdef GL_ES 16precision highp float; 17#else 18#if !defined(lowp) 19#define lowp 20#endif 21#if !defined(mediump) 22#define mediump 23#endif 24#if !defined(highp) 25#define highp 26#endif 27#endif 28vec2 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 29);}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);
29return (tile_units_to_pixels*pos+offset)/pattern_size;}mat3 rotationMatrixFromAxisAngle(vec3 u,float angle) {float c=cos(angle);float s=sin(angle);float c2=1.0-c;return mat3(u.x*u.x*c2+ c,u.x*u.y*c2-u.z*s,u.x*u.z*c2+u.y*s,u.y*u.x*c2+u.z*s,u.y*u.y*c2+ c,u.y*u.z*c2-u.x*s,u.z*u.x*c2-u.y*s,u.z*u.y*c2+u.x*s,u.z*u.z*c2+ c 30);} 31#ifdef TERRAIN3D 32uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; 33#endif 34const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { 35#ifdef TERRAIN3D 36highp float d=unpack(texture(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); 37#else 38return 1.0; 39#endif 40}float calculate_visibility(vec4 pos) { 41#ifdef TERRAIN3D 42vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; 43#else 44return 1.0; 45#endif 46}float ele(vec2 pos) { 47#ifdef TERRAIN3D 48vec4 rgb=(texture(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; 49#else 50return 0.0; 51#endif 52}float get_elevation(vec2 pos) { 53#ifdef TERRAIN3D 54#ifdef GLOBE 55if ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;} 56#endif 57vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; 58#else 59return 0.0; 60#endif 61}const float PI=3.141592653589793;uniform mat4 u_projection_matrix;`),projectionMercator:Ni("","float projectLineThickness(float tileY) {return 1.0;}float projectCircleRadius(float tileY) {return 1.0;}vec4 projectTile(vec2 p) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);return result;}vec4 projectTile(vec2 p,vec2 rawPos) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);if (rawPos.y <-32767.5 || rawPos.y > 32766.5) {result.z=-10000000.0;}return result;}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_projection_matrix*vec4(posInTile,elevation,1.0);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {return projectTileWithElevation(posInTile,elevation);}"),projectionGlobe:Ni("",`#define GLOBE_RADIUS 6371008.8 62uniform highp vec4 u_projection_tile_mercator_coords;uniform highp vec4 u_projection_clipping_plane;uniform highp float u_projection_transition;uniform mat4 u_projection_fallback_matrix;vec3 globeRotateVector(vec3 vec,vec2 angles) {vec3 axisRight=vec3(vec.z,0.0,-vec.x);vec3 axisUp=cross(axisRight,vec);axisRight=normalize(axisRight);axisUp=normalize(axisUp);vec2 t=tan(angles);return normalize(vec+axisRight*t.x+axisUp*t.y);}mat3 globeGetRotationMatrix(vec3 spherePos) {vec3 axisRight=vec3(spherePos.z,0.0,-spherePos.x);vec3 axisDown=cross(axisRight,spherePos);axisRight=normalize(axisRight);axisDown=normalize(axisDown);return mat3(axisRight,axisDown,spherePos 63);}float circumferenceRatioAtTileY(float tileY) {float mercator_pos_y=u_projection_tile_mercator_coords.y+u_projection_tile_mercator_coords.w*tileY;float spherical_y=2.0*atan(exp(PI-(mercator_pos_y*PI*2.0)))-PI*0.5;return cos(spherical_y);}float projectLineThickness(float tileY) {float thickness=1.0/circumferenceRatioAtTileY(tileY); 64if (u_projection_transition < 0.999) {return mix(1.0,thickness,u_projection_transition);} else {return thickness;}}vec3 projectToSphere(vec2 translatedPos,vec2 rawPos) {vec2 mercator_pos=u_projection_tile_mercator_coords.xy+u_projection_tile_mercator_coords.zw*translatedPos;vec2 spherical;spherical.x=mercator_pos.x*PI*2.0+PI;spherical.y=2.0*atan(exp(PI-(mercator_pos.y*PI*2.0)))-PI*0.5;float len=cos(spherical.y);vec3 pos=vec3(sin(spherical.x)*len,sin(spherical.y),cos(spherical.x)*len 65);if (rawPos.y <-32767.5) {pos=vec3(0.0,1.0,0.0);}if (rawPos.y > 32766.5) {pos=vec3(0.0,-1.0,0.0);}return pos;}vec3 projectToSphere(vec2 posInTile) {return projectToSphere(posInTile,vec2(0.0,0.0));}float globeComputeClippingZ(vec3 spherePos) {return (1.0-(dot(spherePos,u_projection_clipping_plane.xyz)+u_projection_clipping_plane.w));}vec4 interpolateProjection(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);globePosition.z=globeComputeClippingZ(elevatedPos)*globePosition.w;if (u_projection_transition > 0.999) {return globePosition;}vec4 flatPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);const float z_globeness_threshold=0.2;vec4 result=globePosition;result.z=mix(0.0,globePosition.z,clamp((u_projection_transition-z_globeness_threshold)/(1.0-z_globeness_threshold),0.0,1.0));result.xyw=mix(flatPosition.xyw,globePosition.xyw,u_projection_transition);if ((posInTile.y <-32767.5) || (posInTile.y > 32766.5)) {result=globePosition;const float poles_hidden_anim_percentage=0.02;result.z=mix(globePosition.z,100.0,pow(max((1.0-u_projection_transition)/poles_hidden_anim_percentage,0.0),8.0));}return result;}vec4 interpolateProjectionFor3D(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);if (u_projection_transition > 0.999) {return globePosition;}vec4 fallbackPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);return mix(fallbackPosition,globePosition,u_projection_transition);}vec4 projectTile(vec2 posInTile) {return interpolateProjection(posInTile,projectToSphere(posInTile),0.0);}vec4 projectTile(vec2 posInTile,vec2 rawPos) {return interpolateProjection(posInTile,projectToSphere(posInTile,rawPos),0.0);}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return interpolateProjection(posInTile,projectToSphere(posInTile),elevation);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {vec3 spherePos=projectToSphere(posInTile,posInTile);return interpolateProjectionFor3D(posInTile,spherePos,elevation);}`),background:Ni(`uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity; 66#ifdef OVERDRAW_INSPECTOR 67fragColor=vec4(1.0); 68#endif 69}`,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),backgroundPattern:Ni(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;
69uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);fragColor=mix(color1,color2,u_mix)*u_opacity; 70#ifdef OVERDRAW_INSPECTOR 71fragColor=vec4(1.0); 72#endif 73}`,"uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;void main() {gl_Position=projectTile(a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:Ni(`in vec3 v_data;in float v_visibility; 74#pragma mapbox: define highp vec4 color 75#pragma mapbox: define mediump float radius 76#pragma mapbox: define lowp float blur 77#pragma mapbox: define lowp float opacity 78#pragma mapbox: define highp vec4 stroke_color 79#pragma mapbox: define mediump float stroke_width 80#pragma mapbox: define lowp float stroke_opacity 81void main() { 82#pragma mapbox: initialize highp vec4 color 83#pragma mapbox: initialize mediump float radius 84#pragma mapbox: initialize lowp float blur 85#pragma mapbox: initialize lowp float opacity 86#pragma mapbox: initialize highp vec4 stroke_color 87#pragma mapbox: initialize mediump float stroke_width 88#pragma mapbox: initialize lowp float stroke_opacity 89vec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));fragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);const float epsilon=0.5/255.0;if (fragColor.r < epsilon && fragColor.g < epsilon && fragColor.b < epsilon && fragColor.a < epsilon) {discard;} 90#ifdef OVERDRAW_INSPECTOR 91fragColor=vec4(1.0); 92#endif 93}`,`uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform highp float u_globe_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;uniform vec2 u_translate;in vec2 a_pos;out vec3 v_data;out float v_visibility; 94#pragma mapbox: define highp vec4 color 95#pragma mapbox: define mediump float radius 96#pragma mapbox: define lowp float blur 97#pragma mapbox: define lowp float opacity 98#pragma mapbox: define highp vec4 stroke_color 99#pragma mapbox: define mediump float stroke_width 100#pragma mapbox: define lowp float stroke_opacity 101void main(void) { 102#pragma mapbox: initialize highp vec4 color 103#pragma mapbox: initialize mediump float radius 104#pragma mapbox: initialize lowp float blur 105#pragma mapbox: initialize lowp float opacity 106#pragma mapbox: initialize highp vec4 stroke_color 107#pragma mapbox: initialize mediump float stroke_width 108#pragma mapbox: initialize lowp float stroke_opacity 109vec2 pos_raw=a_pos+32768.0;vec2 extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);vec2 circle_center=floor(pos_raw/8.0)+u_translate;float ele=get_elevation(circle_center);v_visibility=calculate_visibility(projectTileWithElevation(circle_center,ele));if (u_pitch_with_map) { 110#ifdef GLOBE 111vec3 center_vector=projectToSphere(circle_center); 112#endif 113float angle_scale=u_globe_extrude_scale;vec2 corner_position=circle_center;if (u_scale_with_map) {angle_scale*=(radius+stroke_width);corner_position+=extrude*u_extrude_scale*(radius+stroke_width);} else { 114#ifdef GLOBE 115vec4 projected_center=interpolateProjection(circle_center,center_vector,ele); 116#else 117vec4 projected_center=projectTileWithElevation(circle_center,ele); 118#endif 119corner_position+=extrude*u_extrude_scale*(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);angle_scale*=(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);} 120#ifdef GLOBE 121vec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele); 122#else 123gl_Position=projectTileWithElevation(corner_position,ele); 124#endif 125} else {gl_Position=projectTileWithElevation(circle_center,ele);if (gl_Position.z/gl_Position.w > 1.0) {gl_Position.xy=vec2(10000.0);}if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:Ni(so,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),heatmap:Ni(`uniform highp float u_intensity;in vec2 v_extrude; 126#pragma mapbox: define highp float weight 127#define GAUSS_COEF 0.3989422804014327 128void main() { 129#pragma mapbox: initialize highp float weight 130float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);fragColor=vec4(val,1.0,1.0,1.0); 131#ifdef OVERDRAW_INSPECTOR 132fragColor=vec4(1.0); 133#endif 134}`,`uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;uniform highp float u_globe_extrude_scale;in vec2 a_pos;out vec2 v_extrude; 135#pragma mapbox: define highp float weight 136#pragma mapbox: define mediump float radius 137const highp float ZERO=1.0/255.0/16.0; 138#define GAUSS_COEF 0.3989422804014327 139void main(void) { 140#pragma mapbox: initialize highp float weight 141#pragma mapbox: initialize mediump float radius 142vec2 pos_raw=a_pos+32768.0;vec2 unscaled_extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 circle_center=floor(pos_raw/8.0); 143#ifdef GLOBE 144vec2 angles=v_extrude*radius*u_globe_extrude_scale;vec3 center_vector=projectToSphere(circle_center);vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(circle_center+extrude,corner_vector,0.0); 145#else 146gl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center)); 147#endif 148}`),heatmapTexture:Ni(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));fragColor=color*u_opacity; 149#ifdef OVERDRAW_INSPECTOR 150fragColor=vec4(0.0); 151#endif 152}`,"uniform mat4 u_matrix;uniform vec2 u_world;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:Ni("in float v_placed;in float v_notUsed;void main() {float alpha=0.5;fragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {fragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {fragColor*=.1;}}","in vec2 a_anchor_pos;in vec2 a_placed;in vec2 a_box_real;uniform vec2 u_pixel_extrude_scale;out float v_placed;out float v_notUsed;void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Ni("in float v_radius;in vec2 v_extrude;in float v_collision;void main() {float alpha=0.5;float stroke_radius=0.9;float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);fragColor=color*alpha*opacity_t;}","in vec2 a_pos;in float a_radius;in vec2 a_flags;uniform vec2 u_viewport_size;out float v_radius;out vec2 v_extrude;out float v_collision;void main() {float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_collision=collision;gl_Position=vec4((a_pos/u_viewport_size*2.0-1.0)*vec2(1.0,-1.0),0.0,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),colorRelief:Ni(`#ifdef GL_ES 153precision highp float; 154#endif 155uniform sampler2D u_image;uniform vec4 u_unpack;uniform sampler2D u_elevation_stops;uniform sampler2D u_color_stops;uniform int u_color_ramp_size;uniform float u_opacity;in vec2 v_pos;float getElevation(vec2 coord) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}float getElevationStop(int stop) {float x=(float(stop)+0.5)/float(u_color_ramp_size);vec4 data=texture(u_elevation_stops,vec2(x,0))*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {float el=getElevation(v_pos);int r=(u_color_ramp_size-1);int l=0;float el_l=getElevationStop(l);float el_r=getElevationStop(r);while(r-l > 1){int m=(r+l)/2;float el_m=getElevationStop(m);if(el < el_m){r=m;el_r=el_m;}else 156{l=m;el_l=el_m;}}float x=(float(l)+(el-el_l)/(el_r-el_l)+0.5)/float(u_color_ramp_size);fragColor=u_opacity*texture(u_color_stops,vec2(x,0)); 157#ifdef OVERDRAW_INSPECTOR 158fragColor=vec4(1.0); 159#endif 160}`,"uniform vec2 u_dimension;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_pos/8192.0)*scale+epsilon;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),debug:Ni("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);fragColor=mix(u_color,overlay_color,overlay_color.a);}","in vec2 a_pos;out vec2 v_uv;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=projectTileWithElevation(a_pos*u_overlay_scale,get_elevation(a_pos));}"),depth:Ni(so,`in vec2 a_pos;void main() { 161#ifdef GLOBE 162gl_Position=projectTileFor3D(a_pos,0.0); 163#else 164gl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0); 165#endif 166}`),fill:Ni(`#pragma mapbox: define highp vec4 color 167#pragma mapbox: define lowp float opacity 168void main() { 169#pragma mapbox: initialize highp vec4 color 170#pragma mapbox: initialize lowp float opacity 171fragColor=color*opacity; 172#ifdef OVERDRAW_INSPECTOR 173fragColor=vec4(1.0); 174#endif 175}`,`uniform vec2 u_fill_translate;in vec2 a_pos; 176#pragma mapbox: define highp vec4 color 177#pragma mapbox: define lowp float opacity 178void main() { 179#pragma mapbox: initialize highp vec4 color 180#pragma mapbox: initialize lowp float opacity 181gl_Position=projectTile(a_pos+u_fill_translate,a_pos);}`),fillOutline:Ni(`in vec2 v_pos; 182#ifdef GLOBE 183in float v_depth; 184#endif 185#pragma mapbox: define highp vec4 outline_color 186#pragma mapbox: define lowp float opacity 187void main() { 188#pragma mapbox: initialize highp vec4 outline_color 189#pragma mapbox: initialize lowp float opacity 190float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity); 191#ifdef GLOBE 192if (v_depth > 1.0) {discard;} 193#endif 194#ifdef OVERDRAW_INSPECTOR 195fragColor=vec4(1.0); 196#endif 197}`,`uniform vec2 u_world;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos; 198#ifdef GLOBE 199out float v_depth; 200#endif 201#pragma mapbox: define highp vec4 outline_color 202#pragma mapbox: define lowp float opacity 203void main() { 204#pragma mapbox: initialize highp vec4 outline_color 205#pragma mapbox: initialize lowp float opacity 206gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; 207#ifdef GLOBE 208v_depth=gl_Position.z/gl_Position.w; 209#endif 210}`),fillOutlinePattern:Ni(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;in vec2 v_pos_a;in vec2 v_pos_b;in vec2 v_pos; 211#ifdef GLOBE 212in float v_depth; 213#endif 214#pragma mapbox: define lowp float opacity 215#pragma mapbox: define lowp vec4 pattern_from 216#pragma mapbox: define lowp vec4 pattern_to 217void main() { 218#pragma mapbox: initialize lowp float opacity 219#pragma mapbox: initialize mediump vec4 pattern_from 220#pragma mapbox: initialize mediump vec4 pattern_to 221vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=mix(color1,color2,u_fade)*alpha*opacity; 222#ifdef GLOBE 223if (v_depth > 1.0) {discard;} 224#endif 225#ifdef OVERDRAW_INSPECTOR 226fragColor=vec4(1.0); 227#endif 228}`,`uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;out vec2 v_pos; 229#ifdef GLOBE 230out float v_depth; 231#endif 232#pragma mapbox: define lowp float opacity 233#pragma mapbox: define lowp vec4 pattern_from 234#pragma mapbox: define lowp vec4 pattern_to 235#pragma mapbox: define lowp float pixel_ratio_from 236#pragma mapbox: define lowp float pixel_ratio_to 237void main() { 238#pragma mapbox: initialize lowp float opacity 239#pragma mapbox: initialize mediump vec4 pattern_from 240#pragma mapbox: initialize mediump vec4 pattern_to 241#pragma mapbox: initialize lowp float pixel_ratio_from 242#pragma mapbox: initialize lowp float pixel_ratio_to 243vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; 244#ifdef GLOBE 245v_depth=gl_Position.z/gl_Position.w; 246#endif 247}`),fillPattern:Ni(`#ifdef GL_ES 248precision highp float; 249#endif 250uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b; 251#pragma mapbox: define lowp float opacity 252#pragma mapbox: define lowp vec4 pattern_from 253#pragma mapbox: define lowp vec4 pattern_to 254void main() { 255#pragma mapbox: initialize lowp float opacity 256#pragma mapbox: initialize mediump vec4 pattern_from 257#pragma mapbox: initialize mediump vec4 pattern_to 258vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);fragColor=mix(color1,color2,u_fade)*opacity; 259#ifdef OVERDRAW_INSPECTOR 260fragColor=vec4(1.0); 261#endif 262}`,`uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b; 263#pragma mapbox: define lowp float opacity 264#pragma mapbox: define lowp vec4 pattern_from 265#pragma mapbox: define lowp vec4 pattern_to 266#pragma mapbox: define lowp float pixel_ratio_from 267#pragma mapbox: define lowp float pixel_ratio_to 268void main() { 269#pragma mapbox: initialize lowp float opacity 270#pragma mapbox: initialize mediump vec4 pattern_from 271#pragma mapbox: initialize mediump vec4 pattern_to 272#pragma mapbox: initialize lowp float pixel_ratio_from 273#pragma mapbox: initialize lowp float pixel_ratio_to 274vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_siz
274e_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:Ni(`in vec4 v_color;void main() {fragColor=v_color; 275#ifdef OVERDRAW_INSPECTOR 276fragColor=vec4(1.0); 277#endif 278}`,`uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;in vec2 a_pos;in vec4 a_normal_ed; 279#ifdef TERRAIN3D 280in vec2 a_centroid; 281#endif 282out vec4 v_color; 283#pragma mapbox: define highp float base 284#pragma mapbox: define highp float height 285#pragma mapbox: define highp vec4 color 286void main() { 287#pragma mapbox: initialize highp float base 288#pragma mapbox: initialize highp float height 289#pragma mapbox: initialize highp vec4 color 290vec3 normal=a_normal_ed.xyz; 291#ifdef TERRAIN3D 292float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); 293#else 294float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; 295#endif 296base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate; 297#ifdef GLOBE 298vec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation); 299#else 300gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0); 301#endif 302float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;vec3 normalForLighting=normal/16384.0;float directional=clamp(dot(normalForLighting,u_lightpos),0.0,1.0); 303#ifdef GLOBE 304mat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition); 305#endif 306directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:Ni(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;in vec4 v_lighting; 307#pragma mapbox: define lowp float base 308#pragma mapbox: define lowp float height 309#pragma mapbox: define lowp vec4 pattern_from 310#pragma mapbox: define lowp vec4 pattern_to 311#pragma mapbox: define lowp float pixel_ratio_from 312#pragma mapbox: define lowp float pixel_ratio_to 313void main() { 314#pragma mapbox: initialize lowp float base 315#pragma mapbox: initialize lowp float height 316#pragma mapbox: initialize mediump vec4 pattern_from 317#pragma mapbox: initialize mediump vec4 pattern_to 318#pragma mapbox: initialize lowp float pixel_ratio_from 319#pragma mapbox: initialize lowp float pixel_ratio_to 320vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);fragColor=mixedColor*v_lighting; 321#ifdef OVERDRAW_INSPECTOR 322fragColor=vec4(1.0); 323#endif 324}`,`uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;in vec2 a_pos;in vec4 a_normal_ed; 325#ifdef TERRAIN3D 326in vec2 a_centroid; 327#endif 328#ifdef GLOBE 329out vec3 v_sphere_pos; 330#endif 331out vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting; 332#pragma mapbox: define lowp float base 333#pragma mapbox: define lowp float height 334#pragma mapbox: define lowp vec4 pattern_from 335#pragma mapbox: define lowp vec4 pattern_to 336#pragma mapbox: define lowp float pixel_ratio_from 337#pragma mapbox: define lowp float pixel_ratio_to 338void main() { 339#pragma mapbox: initialize lowp float base 340#pragma mapbox: initialize lowp float height 341#pragma mapbox: initialize mediump vec4 pattern_from 342#pragma mapbox: initialize mediump vec4 pattern_to 343#pragma mapbox: initialize lowp float pixel_ratio_from 344#pragma mapbox: initialize lowp float pixel_ratio_to 345vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to; 346#ifdef TERRAIN3D 347float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); 348#else 349float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; 350#endif 351base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate; 352#ifdef GLOBE 353vec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation); 354#else 355gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0); 356#endif 357vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 358? a_pos 359: vec2(edgedistance,elevation*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:Ni(`#ifdef GL_ES 360precision highp float; 361#endif 362uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {vec2 epsilon=1.0/u_dimension;float tileSize=u_dimension.x-2.0;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))*tileSize/p
362ow(2.0,exaggeration+(28.2562-u_zoom));fragColor=clamp(vec4(deriv.x/8.0+0.5,deriv.y/8.0+0.5,1.0,1.0),0.0,1.0); 363#ifdef OVERDRAW_INSPECTOR 364fragColor=vec4(1.0); 365#endif 366}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:Ni(`uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform float u_exaggeration;uniform vec4 u_accent;uniform int u_method;uniform float u_altitudes[NUM_ILLUMINATION_SOURCES];uniform float u_azimuths[NUM_ILLUMINATION_SOURCES];uniform vec4 u_shadows[NUM_ILLUMINATION_SOURCES];uniform vec4 u_highlights[NUM_ILLUMINATION_SOURCES]; 367#define PI 3.141592653589793 368#define STANDARD 0 369#define COMBINED 1 370#define IGOR 2 371#define MULTIDIRECTIONAL 3 372#define BASIC 4 373float get_aspect(vec2 deriv){return deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);}void igor_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float aspect=get_aspect(deriv);float azimuth=u_azimuths[0]+PI;float slope_stength=atan(length(deriv))*2.0/PI;float aspect_strength=1.0-abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);float shadow_strength=slope_stength*aspect_strength;float highlight_strength=slope_stength*(1.0-aspect_strength);fragColor=u_shadows[0]*shadow_strength+u_highlights[0]*highlight_strength;}void standard_hillshade(vec2 deriv){float azimuth=u_azimuths[0]+PI;float slope=atan(0.625*length(deriv));float aspect=get_aspect(deriv);float intensity=u_exaggeration;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadows[0],u_highlights[0],shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);fragColor=accent_color*(1.0-shade_color.a)+shade_color;}void basic_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor=u_highlights[0]*(2.0*shade-1.0);}else 374{fragColor=u_shadows[0]*(1.0-2.0*shade);}}void multidirectional_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;fragColor=vec4(0,0,0,0);for(int i=0; i < NUM_ILLUMINATION_SOURCES; i++){float cos_alt=cos(u_altitudes[i]);float sin_alt=sin(u_altitudes[i]);float cos_az=-cos(u_azimuths[i]);float sin_az=-sin(u_azimuths[i]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor+=u_highlights[i]*(2.0*shade-1.0)/float(NUM_ILLUMINATION_SOURCES);}else 375{fragColor+=u_shadows[i]*(1.0-2.0*shade)/float(NUM_ILLUMINATION_SOURCES);}}}void combined_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=acos((sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv)));cang=clamp(cang,0.0,PI/2.0);float shade=cang*atan(length(deriv))*4.0/PI/PI;float highlight=(PI/2.0-cang)*atan(length(deriv))*4.0/PI/PI;fragColor=u_shadows[0]*shade+u_highlights[0]*highlight;}void main() {vec4 pixel=texture(u_image,v_pos);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));vec2 deriv=((pixel.rg*8.0)-4.0)/scaleFactor;if (u_method==BASIC) {basic_hillshade(deriv);} else if (u_method==COMBINED) {combined_hillshade(deriv);} else if (u_method==IGOR) {igor_hillshade(deriv);} else if (u_method==MULTIDIRECTIONAL) {multidirectional_hillshade(deriv);} else if (u_method==STANDARD) {standard_hillshade(deriv);} else {standard_hillshade(deriv);} 376#ifdef OVERDRAW_INSPECTOR 377fragColor=vec4(1.0); 378#endif 379}`,"uniform mat4 u_matrix;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);v_pos=a_pos/8192.0;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),line:Ni(`uniform lowp float u_device_pixel_ratio;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale; 380#ifdef GLOBE 381in float v_depth; 382#endif 383#pragma mapbox: define highp vec4 color 384#pragma mapbox: define lowp float blur 385#pragma mapbox: define lowp float opacity 386void main() { 387#pragma mapbox: initialize highp vec4 color 388#pragma mapbox: initialize lowp float blur 389#pragma mapbox: initialize lowp float opacity 390float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);fragColor=color*(alpha*opacity); 391#ifdef GLOBE 392if (v_depth > 1.0) {discard;} 393#endif 394#ifdef OVERDRAW_INSPECTOR 395fragColor=vec4(1.0); 396#endif 397}`,` 398#define scale 0.015873016 399in vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp float v_linesofar; 400#ifdef GLOBE 401out float v_depth; 402#endif 403#pragma mapbox: define highp vec4 color 404#pragma mapbox: define lowp float blur 405#pragma mapbox: define lowp float opacity 406#pragma mapbox: define mediump float gapwidth 407#pragma mapbox: define lowp float offset 408#pragma mapbox: define mediump float width 409void main() { 410#pragma mapbox: initialize highp vec4 color 411#pragma mapbox: initialize lowp float blur 412#pragma mapbox: initialize lowp float opacity 413#pragma mapbox: initialize mediump float gapwidth 414#pragma mapbox: initialize lowp float offset 415#pragma mapbox: initialize mediump float width 416float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);
416float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; 417#ifdef GLOBE 418v_depth=gl_Position.z/gl_Position.w; 419#endif 420#ifdef TERRAIN3D 421v_gamma_scale=1.0; 422#else 423float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; 424#endif 425v_width2=vec2(outset,inset);}`),lineGradient:Ni(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec2 v_uv; 426#ifdef GLOBE 427in float v_depth; 428#endif 429#pragma mapbox: define lowp float blur 430#pragma mapbox: define lowp float opacity 431void main() { 432#pragma mapbox: initialize lowp float blur 433#pragma mapbox: initialize lowp float opacity 434float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);fragColor=color*(alpha*opacity); 435#ifdef GLOBE 436if (v_depth > 1.0) {discard;} 437#endif 438#ifdef OVERDRAW_INSPECTOR 439fragColor=vec4(1.0); 440#endif 441}`,` 442#define scale 0.015873016 443in vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv; 444#ifdef GLOBE 445out float v_depth; 446#endif 447#pragma mapbox: define lowp float blur 448#pragma mapbox: define lowp float opacity 449#pragma mapbox: define mediump float gapwidth 450#pragma mapbox: define lowp float offset 451#pragma mapbox: define mediump float width 452void main() { 453#pragma mapbox: initialize lowp float blur 454#pragma mapbox: initialize lowp float opacity 455#pragma mapbox: initialize mediump float gapwidth 456#pragma mapbox: initialize lowp float offset 457#pragma mapbox: initialize mediump float width 458float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; 459#ifdef GLOBE 460v_depth=gl_Position.z/gl_Position.w; 461#endif 462#ifdef TERRAIN3D 463v_gamma_scale=1.0; 464#else 465float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; 466#endif 467v_width2=vec2(outset,inset);}`),linePattern:Ni(`#ifdef GL_ES 468precision highp float; 469#endif 470uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;in vec2 v_normal;in vec2 v_width2;in float v_linesofar;in float v_gamma_scale;in float v_width; 471#ifdef GLOBE 472in float v_depth; 473#endif 474#pragma mapbox: define lowp vec4 pattern_from 475#pragma mapbox: define lowp vec4 pattern_to 476#pragma mapbox: define lowp float pixel_ratio_from 477#pragma mapbox: define lowp float pixel_ratio_to 478#pragma mapbox: define lowp float blur 479#pragma mapbox: define lowp float opacity 480void main() { 481#pragma mapbox: initialize mediump vec4 pattern_from 482#pragma mapbox: initialize mediump vec4 pattern_to 483#pragma mapbox: initialize lowp float pixel_ratio_from 484#pragma mapbox: initialize lowp float pixel_ratio_to 485#pragma mapbox: initialize lowp float blur 486#pragma mapbox: initialize lowp float opacity 487vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture(u_image,pos_a),texture(u_image,pos_b),u_fade);fragColor=color*alpha*opacity; 488#ifdef GLOBE 489if (v_depth > 1.0) {discard;} 490#endif 491#ifdef OVERDRAW_INSPECTOR 492fragColor=vec4(1.0); 493#endif 494}`,` 495#define scale 0.015873016 496#define LINE_DISTANCE_SCALE 2.0 497in vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_linesofar;out float v_gamma_scale;out float v_width; 498#ifdef GLOBE 499out float v_depth; 500#endif 501#pragma mapbox: define lowp float blur 502#pragma mapbox: define lowp float opacity 503#pragma mapbox: define lowp float offset 504#pragma mapbox: define mediump float gapwidth 505#pragma mapbox: define mediump float width 506#pragma mapbox: define lowp float floorwidth 507#pragma mapbox: define lowp vec4 pattern_from 508#pragma mapbox: define lowp vec4 pattern_to 509#pragma mapbox: define lowp float pixel_ratio_from 510#pragma mapbox: define lowp float pixel_ratio_to 511void main() { 512#pragma mapbox: initialize lowp float blur 513#pragma mapbox: initialize lowp float opacity 514#pragma mapbox: initialize lowp float offset 515#pragma mapbox: initialize mediump float gapwidth 516#pragma mapbox: initialize mediump float width 517#pragma mapbox: initialize lowp float floorwidth 518#pragma mapbox: initialize mediump vec4 pattern_from 519#pragma mapbox: initialize mediump vec4 pattern_to 520#pragma mapbox: initialize lowp float pixel_ratio_from 521#pragma mapbox: initialize lowp float pixel_ratio_to 522float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);
522float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; 523#ifdef GLOBE 524v_depth=gl_Position.z/gl_Position.w; 525#endif 526#ifdef TERRAIN3D 527v_gamma_scale=1.0; 528#else 529float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; 530#endif 531v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Ni(`uniform lowp float u_device_pixel_ratio;uniform lowp float u_lineatlas_width;uniform sampler2D u_image;uniform float u_mix;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale; 532#ifdef GLOBE 533in float v_depth; 534#endif 535#pragma mapbox: define highp vec4 color 536#pragma mapbox: define lowp float blur 537#pragma mapbox: define lowp float opacity 538#pragma mapbox: define mediump float width 539#pragma mapbox: define lowp float floorwidth 540#pragma mapbox: define mediump vec4 dasharray_from 541#pragma mapbox: define mediump vec4 dasharray_to 542void main() { 543#pragma mapbox: initialize highp vec4 color 544#pragma mapbox: initialize lowp float blur 545#pragma mapbox: initialize lowp float opacity 546#pragma mapbox: initialize mediump float width 547#pragma mapbox: initialize lowp float floorwidth 548#pragma mapbox: initialize mediump vec4 dasharray_from 549#pragma mapbox: initialize mediump vec4 dasharray_to 550float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture(u_image,v_tex_a).a;float sdfdist_b=texture(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);
550float sdfgamma=(u_lineatlas_width/256.0/u_device_pixel_ratio)/min(dasharray_from.w,dasharray_to.w);alpha*=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*opacity); 551#ifdef GLOBE 552if (v_depth > 1.0) {discard;} 553#endif 554#ifdef OVERDRAW_INSPECTOR 555fragColor=vec4(1.0); 556#endif 557}`,` 558#define scale 0.015873016 559#define LINE_DISTANCE_SCALE 2.0 560in vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out vec2 v_tex_a;out vec2 v_tex_b;out float v_gamma_scale; 561#ifdef GLOBE 562out float v_depth; 563#endif 564#pragma mapbox: define highp vec4 color 565#pragma mapbox: define lowp float blur 566#pragma mapbox: define lowp float opacity 567#pragma mapbox: define mediump float gapwidth 568#pragma mapbox: define lowp float offset 569#pragma mapbox: define mediump float width 570#pragma mapbox: define lowp float floorwidth 571#pragma mapbox: define mediump vec4 dasharray_from 572#pragma mapbox: define mediump vec4 dasharray_to 573void main() { 574#pragma mapbox: initialize highp vec4 color 575#pragma mapbox: initialize lowp float blur 576#pragma mapbox: initialize lowp float opacity 577#pragma mapbox: initialize mediump float gapwidth 578#pragma mapbox: initialize lowp float offset 579#pragma mapbox: initialize mediump float width 580#pragma mapbox: initialize lowp float floorwidth 581#pragma mapbox: initialize mediump vec4 dasharray_from 582#pragma mapbox: initialize mediump vec4 dasharray_to 583float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; 584#ifdef GLOBE 585v_depth=gl_Position.z/gl_Position.w; 586#endif 587#ifdef TERRAIN3D 588v_gamma_scale=1.0; 589#else 590float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; 591#endif 592float u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}`),lineGradientSDF:Ni(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform sampler2D u_image_dash;uniform float u_mix;uniform lowp float u_lineatlas_width;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;in highp vec2 v_uv; 593#ifdef GLOBE 594in float v_depth; 595#endif 596#pragma mapbox: define lowp float blur 597#pragma mapbox: define lowp float opacity 598#pragma mapbox: define mediump float width 599#pragma mapbox: define lowp float floorwidth 600#pragma mapbox: define mediump vec4 dasharray_from 601#pragma mapbox: define mediump vec4 dasharray_to 602void main() { 603#pragma mapbox: initialize lowp float blur 604#pragma mapbox: initialize lowp float opacity 605#pragma mapbox: initialize mediump float width 606#pragma mapbox: initialize lowp float floorwidth 607#pragma mapbox: initialize mediump vec4 dasharray_from 608#pragma mapbox: initialize mediump vec4 dasharray_to 609float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);float sdfdist_a=texture(u_image_dash,v_tex_a).a;float sdfdist_b=texture(u_image_dash,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);
609float sdfgamma=(u_lineatlas_width/256.0)/min(dasharray_from.w,dasharray_to.w);float dash_alpha=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*dash_alpha*opacity); 610#ifdef GLOBE 611if (v_depth > 1.0) {discard;} 612#endif 613#ifdef OVERDRAW_INSPECTOR 614fragColor=vec4(1.0); 615#endif 616}`,` 617#define scale 0.015873016 618#define LINE_DISTANCE_SCALE 2.0 619in vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;out vec2 v_tex_a;out vec2 v_tex_b; 620#ifdef GLOBE 621out float v_depth; 622#endif 623#pragma mapbox: define lowp float blur 624#pragma mapbox: define lowp float opacity 625#pragma mapbox: define mediump float gapwidth 626#pragma mapbox: define lowp float offset 627#pragma mapbox: define mediump float width 628#pragma mapbox: define lowp float floorwidth 629#pragma mapbox: define mediump vec4 dasharray_from 630#pragma mapbox: define mediump vec4 dasharray_to 631void main() { 632#pragma mapbox: initialize lowp float blur 633#pragma mapbox: initialize lowp float opacity 634#pragma mapbox: initialize mediump float gapwidth 635#pragma mapbox: initialize lowp float offset 636#pragma mapbox: initialize mediump float width 637#pragma mapbox: initialize lowp float floorwidth 638#pragma mapbox: initialize mediump vec4 dasharray_from 639#pragma mapbox: initialize mediump vec4 dasharray_to 640float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;float texel_height=1.0/u_image_height;float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; 641#ifdef GLOBE 642v_depth=gl_Position.z/gl_Position.w; 643#endif 644#ifdef TERRAIN3D 645v_gamma_scale=1.0; 646#else 647float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; 648#endif 649float u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}`),raster:Ni(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;in vec2 v_pos0;in vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture(u_image0,v_pos0);vec4 color1=texture(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);fragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); 650#ifdef OVERDRAW_INSPECTOR 651fragColor=vec4(1.0); 652#endif 653}`,`uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;uniform vec4 u_coords_top;uniform vec4 u_coords_bottom;in vec2 a_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {vec2 fractionalPos=a_pos/8192.0;vec2 position=mix(mix(u_coords_top.xy,u_coords_top.zw,fractionalPos.x),mix(u_coords_bottom.xy,u_coords_bottom.zw,fractionalPos.x),fractionalPos.y);gl_Position=projectTile(position,position);v_pos0=((fractionalPos-0.5)/u_buffer_scale)+0.5; 654#ifdef GLOBE 655if (a_pos.y <-32767.5) {v_pos0.y=0.0;}if (a_pos.y > 32766.5) {v_pos0.y=1.0;} 656#endif 657v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}`),symbolIcon:Ni(`uniform sampler2D u_texture;in vec2 v_tex;in float v_total_opacity;void main() {fragColor=texture(u_texture,v_tex)*v_total_opacity; 658#ifdef OVERDRAW_INSPECTOR 659fragColor=vec4(1.0); 660#endif 661}`,`in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec2 v_tex;out float v_total_opacity; 662#pragma mapbox: define lowp float opacity 663void main() { 664#pragma mapbox: initialize lowp float opacity 665vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_total_opacity=opacity*max(0.0,min(visibility,fade_opacity[0]+fade_change));if (v_total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? 666camera_to_anchor_distance/u_camera_to_center_distance : 667u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0; 668#ifdef GLOBE 669if(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);} 670#endif 671vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;}`),symbolSDF:Ni(`#define SDF_PX 8.0 672uniform bool u_is_halo;uniform bool u_is_plain;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;in vec2 v_data0;in vec3 v_data1; 673#pragma mapbox: define highp vec4 fill_color 674#pragma mapbox: define highp vec4 halo_color 675#pragma mapbox: define lowp float halo_width 676#pragma mapbox: define lowp float halo_blur 677void main() { 678#pragma mapbox: initialize highp vec4 fill_color 679#pragma mapbox: initialize highp vec4 halo_color 680#pragma mapbox: initialize lowp float halo_width 681#pragma mapbox: initialize lowp float halo_blur 682float 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 total_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;lowp float dist=texture(u_texture,tex).a;lowp vec4 color_alpha_out_text,color_alpha_out_halo;if (u_is_plain){highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);color_alpha_out_text=total_opacity*alpha*fill_color;}if (u_is_halo) {float gamma_halo=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);float inner_edge_halo=inner_edge+gamma_halo*gamma_scale;highp float gamma_scaled_halo=gamma_halo*gamma_scale;highp float alpha_halo=smoothstep(inner_edge_halo-gamma_scaled_halo,inner_edge_halo+gamma_scaled_halo,dist);highp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha_halo= min(smoothstep(halo_edge-gamma_scaled_halo,halo_edge+gamma_scaled_halo,dist),1.0-alpha_halo);color_alpha_out_halo=total_opacity*alpha_halo*halo_color;}if (u_is_plain && u_is_halo) {fragColor=color_alpha_out_text+(1.-color_alpha_out_text.a)*color_alpha_out_halo;} else if (u_is_halo){fragColor=color_alpha_out_halo;} else {fragColor=color_alpha_out_text;} 683#ifdef OVERDRAW_INSPECTOR 684fragColor=vec4(1.0); 685#endif 686}`,`in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;out vec2 v_data0;out vec3 v_data1; 687#pragma mapbox: define highp vec4 fill_color 688#pragma mapbox: define highp vec4 halo_color 689#pragma mapbox: define lowp float opacity 690#pragma mapbox: define lowp float halo_width 691#pragma mapbox: define lowp float halo_blur 692void main() { 693#pragma mapbox: initialize highp vec4 fill_color 694#pragma mapbox: initialize highp vec4 halo_color 695#pragma mapbox: initialize lowp float opacity 696#pragma mapbox: initialize lowp float halo_width 697#pragma mapbox: initialize lowp float halo_blur 698vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy/16.0;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));float total_opacity=opacity*interpolated_fade_opacity;if (total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? 699camera_to_anchor_distance/u_camera_to_center_distance : 700u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0; 701#ifdef GLOBE 702if(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);} 703#endif 704vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,total_opacity);}`),symbolTextAndIcon:Ni(`#define SDF_PX 8.0 705#define SDF 1.0 706#define ICON 0.0 707uniform bool u_is_halo;uniform bool u_is_text;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;in vec4 v_data0;in vec4 v_data1; 708#pragma mapbox: define highp vec4 fill_color 709#pragma mapbox: define highp vec4 halo_color 710#pragma mapbox: define lowp float halo_width 711#pragma mapbox: define lowp float halo_blur 712void main() { 713#pragma mapbox: initialize highp vec4 fill_color 714#pragma mapbox: initialize highp vec4 halo_color 715#pragma mapbox: initialize lowp float halo_width 716#pragma mapbox: initialize lowp float halo_blur 717float total_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;
717fragColor=texture(u_texture_icon,tex_icon)*total_opacity; 718#ifdef OVERDRAW_INSPECTOR 719fragColor=vec4(1.0); 720#endif 721return;}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;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;lowp float dist=texture(u_texture,tex).a;lowp vec4 color_alpha_out,color_alpha_out_halo;if (u_is_text) {highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);color_alpha_out=fill_color*(alpha*total_opacity);}if (u_is_halo) {highp float gamma_halo=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);lowp float buff_halo=(6.0-halo_width/fontScale)/SDF_PX;highp float gamma_scaled_halo=gamma_halo*gamma_scale;highp float alpha_halo=smoothstep(buff_halo-gamma_scaled_halo,buff_halo+gamma_scaled_halo,dist);color_alpha_out_halo=halo_color*(alpha_halo*total_opacity);}if (u_is_text && u_is_halo) {fragColor=color_alpha_out+(1.-color_alpha_out.a)*color_alpha_out_halo;} else if (u_is_halo) {fragColor=color_alpha_out_halo;} else {fragColor=color_alpha_out;} 722#ifdef OVERDRAW_INSPECTOR 723fragColor=vec4(1.0); 724#endif 725}`,`in vec4 a_pos_offset;in vec4 a_data;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec4 v_data0;out vec4 v_data1; 726#pragma mapbox: define highp vec4 fill_color 727#pragma mapbox: define highp vec4 halo_color 728#pragma mapbox: define lowp float opacity 729#pragma mapbox: define lowp float halo_width 730#pragma mapbox: define lowp float halo_blur 731void main() { 732#pragma mapbox: initialize highp vec4 fill_color 733#pragma mapbox: initialize highp vec4 halo_color 734#pragma mapbox: initialize lowp float opacity 735#pragma mapbox: initialize lowp float halo_width 736#pragma mapbox: initialize lowp float halo_blur 737vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));float total_opacity=opacity*interpolated_fade_opacity;if (total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? 738camera_to_anchor_distance/u_camera_to_center_distance : 739u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0; 740#ifdef GLOBE 741if(u_pitch_with_map && !u_is_along_line) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);} 742#endif 743vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,total_opacity,is_sdf);}`),terrain:Ni("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;uniform bool u_is_globe_mode;in vec2 v_texture_pos;in float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture(u_texture,vec2(v_texture_pos.x,1.0-v_texture_pos.y));if (!u_is_globe_mode && u_fog_ground_blend_opacity > 0.0 && v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);
743float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);fragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {fragColor=surface_color;}}","in vec3 a_pos3d;uniform mat4 u_fog_matrix;uniform float u_ele_delta;out vec2 v_texture_pos;out float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:Ni("in float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {fragColor=pack(v_depth);}","in vec3 a_pos3d;uniform float u_ele_delta;out float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:Ni("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;in vec2 v_texture_pos;void main() {vec4 rgba=texture(u_texture,v_texture_pos);fragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","in vec3 a_pos3d;uniform float u_ele_delta;out vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);}"),projectionErrorMeasurement:Ni("in vec4 v_output_error_encoded;void main() {fragColor=v_output_error_encoded;}","in vec2 a_pos;uniform highp float u_input;uniform highp float u_output_expected;out vec4 v_output_error_encoded;void main() {float real_output=2.0*atan(exp(PI-(u_input*PI*2.0)))-PI*0.5;float error=real_output-u_output_expected;float abs_error=abs(error)*128.0;v_output_error_encoded.x=min(floor(abs_error*256.0),255.0)/255.0;abs_error-=v_output_error_encoded.x;v_output_error_encoded.y=min(floor(abs_error*65536.0),255.0)/255.0;abs_error-=v_output_error_encoded.x/255.0;v_output_error_encoded.z=min(floor(abs_error*16777216.0),255.0)/255.0;v_output_error_encoded.w=error >=0.0 ? 1.0 : 0.0;gl_Position=vec4(a_pos,0.0,1.0);}"),atmosphere:Ni(`#ifdef GL_ES 744precision highp float; 745#endif 746in vec3 view_direction;uniform vec3 u_sun_pos;uniform vec3 u_globe_position;uniform float u_globe_radius;uniform float u_atmosphere_blend;/**Shader use from https:*Made some change to adapt to MapLibre Globe geometry*/const float PI=3.141592653589793;const int iSteps=5;const int jSteps=3;/*radius of the planet*/const float EARTH_RADIUS=6371e3;/*radius of the atmosphere*/const float ATMOS_RADIUS=6471e3;vec2 rsi(vec3 r0,vec3 rd,float sr) {float a=dot(rd,rd);float b=2.0*dot(rd,r0);float c=dot(r0,r0)-(sr*sr);float d=(b*b)-4.0*a*c;if (d < 0.0) return vec2(1e5,-1e5);return vec2((-b-sqrt(d))/(2.0*a),(-b+sqrt(d))/(2.0*a));}vec4 atmosphere(vec3 r,vec3 r0,vec3 pSun,float iSun,float rPlanet,float rAtmos,vec3 kRlh,float kMie,float shRlh,float shMie,float g) {pSun=normalize(pSun);r=normalize(r);vec2 p=rsi(r0,r,rAtmos);if (p.x > p.y) {return vec4(0.0,0.0,0.0,1.0);}if (p.x < 0.0) {p.x=0.0;}vec3 pos=r0+r*p.x;vec2 p2=rsi(r0,r,rPlanet);if (p2.x <=p2.y && p2.x > 0.0) {p.y=min(p.y,p2.x);}float iStepSize=(p.y-p.x)/float(iSteps);float iTime=p.x+iStepSize*0.5;vec3 totalRlh=vec3(0,0,0);vec3 totalMie=vec3(0,0,0);float iOdRlh=0.0;float iOdMie=0.0;float mu=dot(r,pSun);float mumu=mu*mu;float gg=g*g;float pRlh=3.0/(16.0*PI)*(1.0+mumu);float pMie=3.0/(8.0*PI)*((1.0-gg)*(mumu+1.0))/(pow(1.0+gg-2.0*mu*g,1.5)*(2.0+gg));for (int i=0; i < iSteps; i++) {vec3 iPos=r0+r*iTime;float iHeight=length(iPos)-rPlanet;float odStepRlh=exp(-iHeight/shRlh)*iStepSize;float odStepMie=exp(-iHeight/shMie)*iStepSize;iOdRlh+=odStepRlh;iOdMie+=odStepMie;float jStepSize=rsi(iPos,pSun,rAtmos).y/float(jSteps);float jTime=jStepSize*0.5;float jOdRlh=0.0;float jOdMie=0.0;for (int j=0; j < jSteps; j++) {vec3 jPos=iPos+pSun*jTime;float jHeight=length(jPos)-rPlanet;jOdRlh+=exp(-jHeight/shRlh)*jStepSize;jOdMie+=exp(-jHeight/shMie)*jStepSize;jTime+=jStepSize;}vec3 attn=exp(-(kMie*(iOdMie+jOdMie)+kRlh*(iOdRlh+jOdRlh)));totalRlh+=odStepRlh*attn;totalMie+=odStepMie*attn;iTime+=iStepSize;}float opacity=exp(-(length(kRlh)*length(totalRlh)+kMie*length(totalMie)));vec3 color=iSun*(pRlh*kRlh*totalRlh+pMie*kMie*totalMie);return vec4(color,opacity);}void main() {vec3 scale_camera_pos=-u_globe_position*EARTH_RADIUS/u_globe_radius;vec4 color=atmosphere(normalize(view_direction),scale_camera_pos,u_sun_pos,22.0,EARTH_RADIUS,ATMOS_RADIUS,vec3(5.5e-6,13.0e-6,22.4e-6),21e-6,8e3,1.2e3,0.758 747);color.rgb=1.0-exp(-1.0*color.rgb);color=pow(color,vec4(1.0/2.2));fragColor=vec4(color.rgb,1.0-color.a)*u_atmosphere_blend;}`,"in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 view_direction;void main() {view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,0.0,1.0);}"),sky:Ni("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform vec2 u_horizon;uniform vec2 u_horizon_normal;uniform float u_sky_horizon_blend;uniform float u_sky_blend;void main() {float x=gl_FragCoord.x;float y=gl_FragCoord.y;float blend=(y-u_horizon.y)*u_horizon_normal.y+(x-u_horizon.x)*u_horizon_normal.x;if (blend > 0.0) {if (blend < u_sky_horizon_blend) {fragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {fragColor=u_sky_color;}}fragColor=mix(fragColor,vec4(vec3(0.0),0.0),u_sky_blend);}","in vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};
vendor: 15,280 bytes, lines 747-796
747function Ni(_,t){let a=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,p=t.match(/in ([\w]+) ([\w]+)/g),f=_.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),b=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),P=b?b.concat(f):f,D={};return{fragmentSource:_=_.replace(a,((B,U,$,Y,ee)=>(D[ee]=!0,U==="define"?` 748#ifndef HAS_UNIFORM_u_${ee} 749in ${$} ${Y} ${ee}; 750#else 751uniform ${$} ${Y} u_${ee}; 752#endif 753`:` 754#ifdef HAS_UNIFORM_u_${ee} 755 ${$} ${Y} ${ee} = u_${ee}; 756#endif 757`))),vertexSource:t=t.replace(a,((B,U,$,Y,ee)=>{let oe=Y==="float"?"vec2":"vec4",_e=ee.match(/color/)?"color":oe;return D[ee]?U==="define"?` 758#ifndef HAS_UNIFORM_u_${ee} 759uniform lowp float u_${ee}_t; 760in ${$} ${oe} a_${ee}; 761out ${$} ${Y} ${ee}; 762#else 763uniform ${$} ${Y} u_${ee}; 764#endif 765`:_e==="vec4"?` 766#ifndef HAS_UNIFORM_u_${ee} 767 ${ee} = a_${ee}; 768#else 769 ${$} ${Y} ${ee} = u_${ee}; 770#endif 771`:` 772#ifndef HAS_UNIFORM_u_${ee} 773 ${ee} = unpack_mix_${_e}(a_${ee}, u_${ee}_t); 774#else 775 ${$} ${Y} ${ee} = u_${ee}; 776#endif 777`:U==="define"?` 778#ifndef HAS_UNIFORM_u_${ee} 779uniform lowp float u_${ee}_t; 780in ${$} ${oe} a_${ee}; 781#else 782uniform ${$} ${Y} u_${ee}; 783#endif 784`:_e==="vec4"?` 785#ifndef HAS_UNIFORM_u_${ee} 786 ${$} ${Y} ${ee} = a_${ee}; 787#else 788 ${$} ${Y} ${ee} = u_${ee}; 789#endif 790`:` 791#ifndef HAS_UNIFORM_u_${ee} 792 ${$} ${Y} ${ee} = unpack_mix_${_e}(a_${ee}, u_${ee}_t); 793#else 794 ${$} ${Y} ${ee} = u_${ee}; 795#endif 796`})),staticAttributes:p,staticUniforms:P}}class Cr{constructor(t,a,p){this.vertexBuffer=t,this.indexBuffer=a,this.segments=p}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}var cs=o.aS([{name:"a_pos",type:"Int16",components:2}]);let Xi="#define PROJECTION_MERCATOR",Bo="mercator";class bo{constructor(){this._cachedMesh=null}get name(){return"mercator"}get useSubdivision(){return!1}get shaderVariantName(){return Bo}get shaderDefine(){return Xi}get shaderPreludeCode(){return Br.projectionMercator}get vertexShaderPreludeCode(){return Br.projectionMercator.vertexSource}get subdivisionGranularity(){return o.aT.noSubdivision}get useGlobeControls(){return!1}get transitionState(){return 0}get latitudeErrorCorrectionRadians(){return 0}destroy(){}updateGPUdependent(t){}getMeshFromTileID(t,a,p,f,b){if(this._cachedMesh)return this._cachedMesh;let P=new o.aU;P.emplaceBack(0,0),P.emplaceBack(o.a6,0),P.emplaceBack(0,o.a6),P.emplaceBack(o.a6,o.a6);let D=t.createVertexBuffer(P,cs.members),B=o.aV.simpleSegment(0,0,4,2),U=new o.aW;U.emplaceBack(1,0,2),U.emplaceBack(1,2,3);let $=t.createIndexBuffer(U);return this._cachedMesh=new Cr(D,$,B),this._cachedMesh}recalculate(){}hasTransition(){return!1}setErrorQueryLatitudeDegrees(t){}}class hs{constructor(t=0,a=0,p=0,f=0){if(isNaN(t)||t<0||isNaN(a)||a<0||isNaN(p)||p<0||isNaN(f)||f<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=a,this.left=p,this.right=f}interpolate(t,a,p){return a.top!=null&&t.top!=null&&(this.top=o.H.number(t.top,a.top,p)),a.bottom!=null&&t.bottom!=null&&(this.bottom=o.H.number(t.bottom,a.bottom,p)),a.left!=null&&t.left!=null&&(this.left=o.H.number(t.left,a.left,p)),a.right!=null&&t.right!=null&&(this.right=o.H.number(t.right,a.right,p)),this}getCenter(t,a){let p=o.al((this.left+t-this.right)/2,0,t),f=o.al((this.top+a-this.bottom)/2,0,a);return new o.P(p,f)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new hs(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function wa(_,t){if(!_.renderWorldCopies||_.lngRange)return;let a=t.lng-_.center.lng;t.lng+=a>180?-360:a<-180?360:0}function en(_){return Math.max(0,Math.floor(_))}class Vn{constructor(t,a){var p;this.applyConstrain=(f,b)=>this._constrainOverride!==null?this._constrainOverride(f,b):this._callbacks.defaultConstrain(f,b),this._callbacks=t,this._tileSize=512,this._renderWorldCopies=a?.renderWorldCopies===void 0||!!a?.renderWorldCopies,this._minZoom=a?.minZoom||0,this._maxZoom=a?.maxZoom||22,this._minPitch=a?.minPitch==null?0:a?.minPitch,this._maxPitch=a?.maxPitch==null?60:a?.maxPitch,this._constrainOverride=(p=a?.constrainOverride)!==null&&p!==void 0?p:null,this.setMaxBounds(),this._width=0,this._height=0,this._center=new o.W(0,0),this._elevation=0,this._zoom=0,this._tileZoom=en(this._zoom),this._scale=o.ao(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new hs,this._minElevationForCurrentTile=0,this._autoCalculateNearFarZ=!0}apply(t,a,p){this._constrainOverride=t.constrainOverride,this._latRange=t.latRange,this._lngRange=t.lngRange,this._width=t.width,this._height=t.height,this._center=t.center,this._elevation=t.elevation,this._minElevationForCurrentTile=t.minElevationForCurrentTile,this._zoom=t.zoom,this._tileZoom=en(this._zoom),this._scale=o.ao(this._zoom),this._bearingInRadians=t.bearingInRadians,this._fovInRadians=t.fovInRadians,this._pitchInRadians=t.pitchInRadians,this._rollInRadians=t.rollInRadians,this._unmodified=t.unmodified,this._edgeInsets=new hs(t.padding.top,t.padding.bottom,t.padding.left,t.padding.right),this._minZoom=t.minZoom,this._maxZoom=t.maxZoom,this._minPitch=t.minPitch,this._maxPitch=t.maxPitch,this._renderWorldCopies=t.renderWorldCopies,this._cameraToCenterDistance=t.cameraToCenterDistance,this._nearZ=t.nearZ,this._farZ=t.farZ,this._autoCalculateNearFarZ=!p&&t.autoCalculateNearFarZ,a&&this.constrainInternal(),this._calcMatrices()}get pixelsToClipSpaceMatrix(){return this._pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._clipSpaceToPixelsMatrix}get minElevationForCurrentTile(){return this._minElevationForCurrentTile}setMinElevationForCurrentTile(t){this._minElevationForCurrentTile=t}get tileSize(){return this._tileSize}get tileZoom(){return this._tileZoom}get scale(){return this._scale}get width(){return this._width}get height(){return this._height}get bearingInRadians(){return this._bearingInRadians}get lngRange(){return this._lngRange}get latRange(){return this._latRange}get pixelsToGLUnits(){return this._pixelsToGLUnits}get minZoom(){return this._minZoom}setMinZoom(t){this._minZoom!==t&&(this._minZoom=t,this.setZoom(this.applyConstrain(this._center,this.zoom).zoom))}get maxZoom(){return this._maxZoom}setMaxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.setZoom(this.applyConstrain(this._center,this.zoom).zoom))}get minPitch(){return this._minPitch}setMinPitch(t){this._minPitch!==t&&(this._minPitch=t,this.setPitch(Math.max(this.pitch,t)))}get maxPitch(){return this._maxPitch}setMaxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.setPitch(Math.min(this.pitch,t)))}get renderWorldCopies(){return this._renderWorldCopies}setRenderWorldCopies(t){t===void 0?t=!0:t===null&&(t=!1),this._renderWorldCopies=t}get constrainOverride(){return this._constrainOverride}setConstrainOverride(t){t===void 0&&(t=null),this._constrainOverride!==t&&(this._constrainOverride=t,this.constrainInternal(),this._calcMatrices())}get worldSize(){return this._tileSize*this._scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new o.P(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(t){let a=o.X(t,-180,180)*Math.PI/180;var p,f,b,P,D,B,U,$,Y;this._bearingInRadians!==a&&(this._unmodified=!1,this._bearingInRadians=a,this._calcMatrices(),this._rotationMatrix=Ne(),p=this._rotationMatrix,b=-this._bearingInRadians,P=(f=this._rotationMatrix)[0],D=f[1],B=f[2],U=f[3],$=Math.sin(b),Y=Math.cos(b),p[0]=P*Y+B*$,p[1]=D*Y+U*$,p[2]=P*-$+B*Y,p[3]=D*-$+U*Y)}get rotationMatrix(){return this._rotationMatrix}get pitchInRadians(){return this._pitchInRadians}get pitch(){return this._pitchInRadians/Math.PI*180}setPitch(t){let a=o.al(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitchInRadians!==a&&(this._unmodified=!1,this._pitchInRadians=a,this._calcMatrices())}get rollInRadians(){return this._rollInRadians}get roll(){return this._rollInRadians/Math.PI*180}setRoll(t){let a=t/180*Math.PI;this._rollInRadians!==a&&(this._unmodified=!1,this._rollInRadians=a,this._calcMatrices())}get fovInRadians(){return this._fovInRadians}get fov(){return o.aX(this._fovInRadians)}setFov(t){t=o.al(t,.1,150),this.fov!==t&&(this._unmodified=!1,this._fovInRadians=o.an(t),this._calcMatrices())}get zoom(){return this._zoom}setZoom(t){let a=this.applyConstrain(this._center,t).zoom;this._zoom!==a&&(this._unmodified=!1,this._zoom=a,this._tileZoom=Math.max(0,Math.floor(a)),this._scale=o.ao(a),this.constrainInternal(),this._calcMatrices())}get center(){return this._center}setCenter(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this.constrainInternal(),this._calcMatrices())}get elevation(){return this._elevation}setElevation(t){t!==this._elevation&&(this._elevation=t,this.constrainInternal(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}setPadding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this._width,this._height)}get pixelsPerMeter(){return this._pixelPerMeter}get unmodified(){return this._unmodified}get cameraToCenterDistance(){return this._cameraToCenterDistance}get nearZ(){return this._nearZ}get farZ(){return this._farZ}get autoCalculateNearFarZ(){return this._autoCalculateNearFarZ}overrideNearFarZ(t,a){this._autoCalculateNearFarZ=!1,this._nearZ=t,this._farZ=a,this._calcMatrices()}clearNearFarZOverride(){this._autoCalculateNearFarZ=!0,this._calcMatrices()}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,a,p){this._unmodified=!1,this._edgeInsets.interpolate(t,a,p),this.constrainInternal(),this._calcMatrices()}resize(t,a,p=!0){this._width=t,this._height=a,p&&this.constrainInternal(),this._calcMatrices()}getMaxBounds(){var t,a;return((t=this._latRange)===null||t===void 0?void 0:t.length)!==2||((a=this._lngRange)===null||a===void 0?void 0:a.length)!==2?null:new Ti([this._lngRange[0],this._latRange[0]],[this._lngRange[1],this._latRange[1]])}setMaxBounds(t){t?(this._lngRange=[t.getWest(),t.getEast()],this._latRange=[t.getSouth(),t.getNorth()],this.constrainInternal()):(this._lngRange=null,this._latRange=[-o.am,o.am])}getCameraQueryGeometry(t,a){if(a.length===1)return[a[0],t];{let{minX:p,minY:f,maxX:b,maxY:P}=o.a8.fromPoints(a).extend(t);return[new o.P(p,f),new o.P(b,f),new o.P(b,P),new o.P(p,P),new o.P(p,f)]}}constrainInternal(){if(!this.center||!this._width||!this._height||this._constraining)return;this._constraining=!0;let t=this._unmodified,{center:a,zoom:p}=this.applyConstrain(this.center,this.zoom);this.setCenter(a),this.setZoom(p),this._unmodified=t,this._constraining=!1}_calcMatrices(){if(this._width&&this._height){this._pixelsToGLUnits=[2/this._width,-2/this._height];let t=o.ap(new Float64Array(16));o.S(t,t,[this._width/2,-this._height/2,1]),o.Q(t,t,[1,-1,0]),this._clipSpaceToPixelsMatrix=t,t=o.ap(new Float64Array(16)),o.S(t,t,[1,-1,1]),o.Q(t,t,[-1,-1,0]),o.S(t,t,[2/this._width,2/this._height,1]),this._pixelsToClipSpaceMatrix=t,this._cameraToCenterDistance=.5/Math.tan(this.fovInRadians/2)*this._height}this._callbacks.calcMatrices()}calculateCenterFromCameraLngLatAlt(t,a,p,f){let b=p!==void 0?p:this.bearing,P=f=f!==void 0?f:this.pitch,{distanceToCenter:D,clampedElevation:B}=this._distanceToCenterFromAltElevationPitch(a,this.elevation,P),{x:U,y:$}=vn(P,b),Y=o.a7.fromLngLat(t,a),ee,oe,_e=o.aY(1,Y.y),Ie=0;do{if(Ie+=1,Ie>10)break;oe=D/_e,ee=new o.a7(Y.x+U*oe,Y.y+$*oe),_e=1/ee.meterInMercatorCoordinateUnits()}while(Math.abs(D-oe*_e)>1e-12);return{center:ee.toLngLat(),elevation:B,zoom:o.ar(this.height/2/Math.tan(this.fovInRadians/2)/oe/this.tileSize)}}recalculateZoomAndCenter(t){if(this.elevation-t==0)return;let a=1/this.worldSize,p=o.aq(1,this.center.lat)*this.worldSize,f=o.a7.fromLngLat(this.center,this.elevation),b=f.x/a,P=f.y/a,D=f.z/a,B=this.pitch,U=this.bearing,{x:$,y:Y,z:ee}=vn(B,U),oe=this.cameraToCenterDistance,_e=b+oe*-$,Ie=P+oe*-Y,ze=D+oe*ee,{distanceToCenter:Ee,clampedElevation:De}=this._distanceToCenterFromAltElevationPitch(ze/p,t,B),je=Ee*p,Le=new o.a7((_e+$*je)*a,(Ie+Y*je)*a,0).toLngLat(),we=o.aq(1,Le.lat),qe=o.ar(this.height/2/Math.tan(this.fovInRadians/2)/Ee/we/this.tileSize);this._elevation=De,this._center=Le,this.setZoom(qe)}_distanceToCenterFromAltElevationPitch(t,a,p){let f=-Math.cos(o.an(p)),b=t-a,P,D=a;return f*b>=0||Math.abs(f)<.1?(P=1e4,D=t+P*f):P=-b/f,{distanceToCenter:P,clampedElevation:D}}getCameraPoint(){let t=Math.tan(this.pitchInRadians)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new o.P(t*Math.sin(this.rollInRadians),t*Math.cos(this.rollInRadians)))}getCameraAltitude(){return Math.cos(this.pitchInRadians)*this._cameraToCenterDistance/this._pixelPerMeter+this.elevation}getCameraLngLat(){let t=o.aq(1,this.center.lat)*this.worldSize;return Ro(this.center,this.elevation,this.pitch,this.bearing,this.cameraToCenterDistance/t).toLngLat()}getMercatorTileCoordinates(t){if(!t)return[0,0,1,1];let a=t.canonical.z>=0?1<<t.canonical.z:Math.pow(2,t.canonical.z);return[t.canonical.x/a,t.canonical.y/a,1/a/o.a6,1/a/o.a6]}}class Ta{constructor(t,a){this.min=t,this.max=a,this.center=o.aZ([],o.a_([],this.min,this.max),.5)}quadrant(t){let a=[t%2==0,t<2],p=o.a$(this.min),f=o.a$(this.max);for(let b=0;b<a.length;b++)p[b]=a[b]?this.min[b]:this.center[b],f[b]=a[b]?this.center[b]:this.max[b];return f[2]=this.max[2],new Ta(p,f)}distanceX(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]}distanceY(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]}intersectsFrustum(t){let a=!0;for(let p of t.planes){let f=this.intersectsPlane(p);if(f===0)return 0;f===1&&(a=!1)}return a?2:t.aabb.min[0]>this.max[0]||t.aabb.min[1]>this.max[1]||t.aabb.min[2]>this.max[2]||t.aabb.max[0]<this.min[0]||t.aabb.max[1]<this.min[1]||t.aabb.max[2]<this.min[2]?0:1}intersectsPlane(t){let a=t[3],p=t[3];for(let f=0;f<3;f++)t[f]>0?(a+=t[f]*this.min[f],p+=t[f]*this.max[f]):(p+=t[f]*this.min[f],a+=t[f]*this.max[f]);return a>=0?2:p<0?0:1}}class Tl{distanceToTile2d(t,a,p,f){let b=f,P=b.distanceX([t,a]),D=b.distanceY([t,a]);return Math.hypot(P,D)}getWrap(t,a,p){return p}getTileBoundingVolume(t,a,p,f){var b,P;let D=0,B=0;if(f?.terrain){let $=new o.a3(t.z,a,t.z,t.x,t.y),Y=f.terrain.getMinMaxElevation($);D=(b=Y.minElevation)!==null&&b!==void 0?b:Math.min(0,p),B=(P=Y.maxElevation)!==null&&P!==void 0?P:Math.max(0,p)}let U=1<<t.z;return new Ta([a+t.x/U,t.y/U,D],[a+(t.x+1)/U,(t.y+1)/U,B])}allowVariableZoom(t,a){let p=t.fov*(Math.abs(Math.cos(t.rollInRadians))*t.height+Math.abs(Math.sin(t.rollInRadians))*t.width)/t.height,f=o.al(78.5-p/2,0,60);return!!a.terrain||t.pitch>f}allowWorldCopies(){return!0}prepareNextFrame(){}}class to{constructor(t,a,p){this.points=t,this.planes=a,this.aabb=p}static fromInvProjectionMatrix(t,a=1,p=0,f,b){let P=b?[[6,5,4],[0,1,2],[0,3,7],[2,1,5],[3,2,6],[0,4,5]]:[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],D=Math.pow(2,p),B=[[-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((ee=>
796(function(oe,_e,Ie,ze){let Ee=o.aE([],oe,_e),De=1/Ee[3]/Ie*ze;return o.b4(Ee,Ee,[De,De,1/Ee[3],De])})(ee,t,a,D)));f&&(function(ee,oe,_e,Ie){let ze=Ie?4:0,Ee=Ie?0:4,De=0,je=[],Le=[];for(let Fe=0;Fe<4;Fe++){let it=o.b0([],ee[Fe+Ee],ee[Fe+ze]),ft=o.b5(it);o.aZ(it,it,1/ft),je.push(ft),Le.push(it)}for(let Fe=0;Fe<4;Fe++){let it=o.b6(ee[Fe+ze],Le[Fe],_e);De=it!==null&&it>=0?Math.max(De,it):Math.max(De,je[Fe])}let we=(function(Fe,it){let ft=o.b0([],Fe[it[0]],Fe[it[1]]),_t=o.b0([],Fe[it[2]],Fe[it[1]]),Rt=[0,0,0,0];return o.b1(Rt,o.b2([],ft,_t)),Rt[3]=-o.b3(Rt,Fe[it[0]]),Rt})(ee,oe),qe=(function(Fe,it){let ft=o.b7(Fe),_t=o.b8([],Fe,1/ft),Rt=o.b0([],it,o.aZ([],_t,o.b3(it,_t))),Dt=o.b7(Rt);if(Dt>0){let _i=Math.sqrt(1-_t[3]*_t[3]),Gt=o.aZ([],_t,-_t[3]),Et=o.a_([],Gt,o.aZ([],Rt,_i/Dt));return o.b9(it,Et)}return null})(_e,we);if(qe!==null){let Fe=qe/o.b3(Le[0],we);De=Math.min(De,Fe)}for(let Fe=0;Fe<4;Fe++){let it=Math.min(De,je[Fe]);ee[Fe+Ee]=[ee[Fe+ze][0]+Le[Fe][0]*it,ee[Fe+ze][1]+Le[Fe][1]*it,ee[Fe+ze][2]+Le[Fe][2]*it,1]}})(B,P[0],f,b);let U=P.map((ee=>{let oe=o.b0([],B[ee[0]],B[ee[1]]),_e=o.b0([],B[ee[2]],B[ee[1]]),Ie=o.b1([],o.b2([],oe,_e)),ze=-o.b3(Ie,B[ee[1]]);return Ie.concat(ze)})),$=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],Y=[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];for(let ee of B)for(let oe=0;oe<3;oe++)$[oe]=Math.min($[oe],ee[oe]),Y[oe]=Math.max(Y[oe],ee[oe]);return new to(B,U,new Ta($,Y))}}class Ms{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,a,p){this._helper.interpolatePadding(t,a,p)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,a,p=!0){this._helper.resize(t,a,p)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,a){this._helper.overrideNearFarZ(t,a)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(t,a){}constructor(t){this._posMatrixCache=new Map,this._alignedPosMatrixCache=new Map,this._fogMatrixCacheF32=new Map,this.defaultConstrain=(a,p)=>{p=o.al(+p,this.minZoom,this.maxZoom);let f={center:new o.W(a.lng,a.lat),zoom:p},b=this._helper._lngRange;if(!this._helper._renderWorldCopies&&b===null){let Le=179.9999999999;b=[-Le,Le]}let P=this.tileSize*o.ao(f.zoom),D=0,B=P,U=0,$=P,Y=0,ee=0,{x:oe,y:_e}=this.size;if(this._helper._latRange){let Le=this._helper._latRange;D=o.Y(Le[1])*P,B=o.Y(Le[0])*P,B-D<_e&&(Y=_e/(B-D))}b&&(U=o.X(o.Z(b[0])*P,0,P),$=o.X(o.Z(b[1])*P,0,P),$<U&&($+=P),$-U<oe&&(ee=oe/($-U)));let{x:Ie,y:ze}=Bi(P,a),Ee,De,je=Math.max(ee||0,Y||0);if(je){let Le=new o.P(ee?($+U)/2:Ie,Y?(B+D)/2:ze);return f.center=an(P,Le).wrap(),f.zoom+=o.ar(je),f}if(this._helper._latRange){let Le=_e/2;ze-Le<D&&(De=D+Le),ze+Le>B&&(De=B-Le)}if(b){let Le=(U+$)/2,we=Ie;
vendor: 58,064 bytes, line 796
796this._helper._renderWorldCopies&&(we=o.X(Ie,Le-P/2,Le+P/2));let qe=oe/2;we-qe<U&&(Ee=U+qe),we+qe>$&&(Ee=$-qe)}if(Ee!==void 0||De!==void 0){let Le=new o.P(Ee??Ie,De??ze);f.center=an(P,Le).wrap()}return f},this.applyConstrain=(a,p)=>this._helper.applyConstrain(a,p),this._helper=new Vn({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(a,p)=>this.defaultConstrain(a,p)},t),this._coveringTilesDetailsProvider=new Tl}clone(){let t=new Ms;return t.apply(this,!1),t}apply(t,a,p){this._helper.apply(t,a,p)}get cameraPosition(){return this._cameraPosition}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._viewProjMatrix}get inverseProjectionMatrix(){return this._invProjMatrix}get mercatorMatrix(){return this._mercatorMatrix}getVisibleUnwrappedCoordinates(t){let a=[new o.ba(0,t)];if(this._helper._renderWorldCopies){let p=this.screenPointToMercatorCoordinate(new o.P(0,0)),f=this.screenPointToMercatorCoordinate(new o.P(this._helper._width,0)),b=this.screenPointToMercatorCoordinate(new o.P(this._helper._width,this._helper._height)),P=this.screenPointToMercatorCoordinate(new o.P(0,this._helper._height)),D=Math.floor(Math.min(p.x,f.x,b.x,P.x)),B=Math.floor(Math.max(p.x,f.x,b.x,P.x)),U=1;for(let $=D-U;$<=B+U;$++)$!==0&&a.push(new o.ba($,t))}return a}getCameraFrustum(){return to.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){let a=this.screenPointToLocation(this.centerPoint,t),p=t?t.getElevationForLngLatZoom(a,this._helper._tileZoom):0;this._helper.recalculateZoomAndCenter(p)}setLocationAtPoint(t,a){let p=o.aq(this.elevation,this.center.lat),f=this.screenPointToMercatorCoordinateAtZ(a,p),b=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,p),P=o.a7.fromLngLat(t),D=new o.a7(P.x-(f.x-b.x),P.y-(f.y-b.y));this.setCenter(D?.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(t,a){return a?this.coordinatePoint(o.a7.fromLngLat(t),a.getElevationForLngLat(t,this),this._pixelMatrix3D):this.coordinatePoint(o.a7.fromLngLat(t))}screenPointToLocation(t,a){var p;return(p=this.screenPointToMercatorCoordinate(t,a))===null||p===void 0?void 0:p.toLngLat()}screenPointToMercatorCoordinate(t,a){if(a){let p=a.pointCoordinate(t);if(p!=null)return p}return this.screenPointToMercatorCoordinateAtZ(t)}screenPointToMercatorCoordinateAtZ(t,a){let p=a||0,f=[t.x,t.y,0,1],b=[t.x,t.y,1,1];o.aE(f,f,this._pixelMatrixInverse),o.aE(b,b,this._pixelMatrixInverse);let P=f[3],D=b[3],B=f[1]/P,U=b[1]/D,$=f[2]/P,Y=b[2]/D,ee=$===Y?0:(p-$)/(Y-$);return new o.a7(o.H.number(f[0]/P,b[0]/D,ee)/this.worldSize,o.H.number(B,U,ee)/this.worldSize,p)}coordinatePoint(t,a=0,p=this._pixelMatrix){let f=[t.x*this.worldSize,t.y*this.worldSize,a,1];return o.aE(f,f,p),new o.P(f[0]/f[3],f[1]/f[3])}getBounds(){let t=Math.max(0,this._helper._height/2-Lo(this));return new Ti().extend(this.screenPointToLocation(new o.P(0,t))).extend(this.screenPointToLocation(new o.P(this._helper._width,t))).extend(this.screenPointToLocation(new o.P(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new o.P(0,this._helper._height)))}isPointOnMapSurface(t,a){return a?a.pointCoordinate(t)!=null:t.y>this.height/2-Lo(this)}calculatePosMatrix(t,a=!1,p){var f;let b=(f=t.key)!==null&&f!==void 0?f:o.bb(t.wrap,t.canonical.z,t.canonical.z,t.canonical.x,t.canonical.y),P=a?this._alignedPosMatrixCache:this._posMatrixCache;if(P.has(b)){let U=P.get(b);return p?U.f32:U.f64}let D=ji(t,this.worldSize);o.U(D,a?this._alignedProjMatrix:this._viewProjMatrix,D);let B={f64:D,f32:new Float32Array(D)};return P.set(b,B),p?B.f32:B.f64}calculateFogMatrix(t){let a=t.key,p=this._fogMatrixCacheF32;if(p.has(a))return p.get(a);let f=ji(t,this.worldSize);return o.U(f,this._fogMatrix,f),p.set(a,new Float32Array(f)),p.get(a)}calculateCenterFromCameraLngLatAlt(t,a,p,f){return this._helper.calculateCenterFromCameraLngLatAlt(t,a,p,f)}_calculateNearFarZIfNeeded(t,a,p){if(!this._helper.autoCalculateNearFarZ)return;let f=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),b=t-f*this._helper._pixelPerMeter/Math.cos(a),P=f<0?b:t,D=Math.PI/2+this.pitchInRadians,B=o.an(this.fov)*(Math.abs(Math.cos(o.an(this.roll)))*this.height+Math.abs(Math.sin(o.an(this.roll)))*this.width)/this.height*(.5+p.y/this.height),U=Math.sin(B)*P/Math.sin(o.al(Math.PI-D-B,.01,Math.PI-.01)),$=Lo(this),Y=Math.atan($/this._helper.cameraToCenterDistance),ee=o.an(.75),oe=Y>ee?2*Y*(.5+p.y/(2*$)):ee,_e=Math.sin(oe)*P/Math.sin(o.al(Math.PI-D-oe,.01,Math.PI-.01)),Ie=Math.min(U,_e);this._helper._farZ=1.01*(Math.cos(Math.PI/2-a)*Ie+P),this._helper._nearZ=this._helper._height/50}_calcMatrices(){if(!this._helper._height)return;let t=this.centerOffset,a=Bi(this.worldSize,this.center),p=a.x,f=a.y;this._helper._pixelPerMeter=o.aq(1,this.center.lat)*this.worldSize;let b=o.an(Math.min(this.pitch,Wi)),P=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(b)),D;var B,U;this._calculateNearFarZIfNeeded(P,b,t),D=new Float64Array(16),o.bc(D,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),(B=this._invProjMatrix)[0]=1/(U=D)[0],B[1]=0,B[2]=0,B[3]=0,B[4]=0,B[5]=1/U[5],B[6]=0,B[7]=0,B[8]=0,B[9]=0,B[10]=0,B[11]=1/U[14],B[12]=0,B[13]=0,B[14]=-1,B[15]=U[10]/U[14],D[8]=2*-t.x/this._helper._width,D[9]=2*t.y/this._helper._height,this._projectionMatrix=o.bd(D),o.S(D,D,[1,-1,1]),o.Q(D,D,[0,0,-this._helper.cameraToCenterDistance]),o.be(D,D,-this.rollInRadians),o.bf(D,D,this.pitchInRadians),o.be(D,D,-this.bearingInRadians),o.Q(D,D,[-p,-f,0]),this._mercatorMatrix=o.S([],D,[this.worldSize,this.worldSize,this.worldSize]),o.S(D,D,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=o.U(new Float64Array(16),this.clipSpaceToPixelsMatrix,D),o.Q(D,D,[0,0,-this.elevation]),this._viewProjMatrix=D,this._invViewProjMatrix=o.bg([],D);let $=[0,0,-1,1];o.aE($,$,this._invViewProjMatrix),this._cameraPosition=[$[0]/$[3],$[1]/$[3],$[2]/$[3]],this._fogMatrix=new Float64Array(16),o.bc(this._fogMatrix,this.fovInRadians,this.width/this.height,P,this._helper._farZ),this._fogMatrix[8]=2*-t.x/this.width,this._fogMatrix[9]=2*t.y/this.height,o.S(this._fogMatrix,this._fogMatrix,[1,-1,1]),o.Q(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),o.be(this._fogMatrix,this._fogMatrix,-this.rollInRadians),o.bf(this._fogMatrix,this._fogMatrix,this.pitchInRadians),o.be(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),o.Q(this._fogMatrix,this._fogMatrix,[-p,-f,0]),o.S(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),o.Q(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=o.U(new Float64Array(16),this.clipSpaceToPixelsMatrix,D);let Y=this._helper._width%2/2,ee=this._helper._height%2/2,oe=Math.cos(this.bearingInRadians),_e=Math.sin(-this.bearingInRadians),Ie=p-Math.round(p)+oe*Y+_e*ee,ze=f-Math.round(f)+oe*ee+_e*Y,Ee=new Float64Array(D);if(o.Q(Ee,Ee,[Ie>.5?Ie-1:Ie,ze>.5?ze-1:ze,0]),this._alignedProjMatrix=Ee,D=o.bg(new Float64Array(16),this._pixelMatrix),!D)throw new Error("failed to invert matrix");this._pixelMatrixInverse=D,this._clearMatrixCaches()}_clearMatrixCaches(){this._posMatrixCache.clear(),this._alignedPosMatrixCache.clear(),this._fogMatrixCacheF32.clear()}maxPitchScaleFactor(){if(!this._pixelMatrixInverse)return 1;let t=this.screenPointToMercatorCoordinate(new o.P(0,0)),a=[t.x*this.worldSize,t.y*this.worldSize,0,1];return o.aE(a,a,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){let t=o.aq(1,this.center.lat)*this.worldSize;return Ro(this.center,this.elevation,this.pitch,this.bearing,this._helper.cameraToCenterDistance/t).toLngLat()}lngLatToCameraDepth(t,a){let p=o.a7.fromLngLat(t),f=[p.x*this.worldSize,p.y*this.worldSize,a,1];return o.aE(f,f,this._viewProjMatrix),f[2]/f[3]}getProjectionData(t){let{overscaledTileID:a,aligned:p,applyTerrainMatrix:f}=t,b=this._helper.getMercatorTileCoordinates(a),P=a?this.calculatePosMatrix(a,p,!0):null,D;return D=a?.terrainRttPosMatrix32f&&f?a.terrainRttPosMatrix32f:P||o.bh(),{mainMatrix:D,tileMercatorCoords:b,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:D}}isLocationOccluded(t){return!1}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(t,a,p){return 1}transformLightDirection(t){return o.a$(t)}getRayDirectionFromPixel(t){throw new Error("Not implemented.")}projectTileCoordinates(t,a,p,f){let b=this.calculatePosMatrix(p),P;f?(P=[t,a,f(t,a),1],o.aE(P,P,b)):(P=[t,a,0,1],ec(P,P,b));let D=P[3];return{point:new o.P(P[0]/D,P[1]/D),signedDistanceFromCamera:D,isOccluded:!1}}populateCache(t){for(let a of t)this.calculatePosMatrix(a)}getMatrixForModel(t,a){let p=o.a7.fromLngLat(t,a),f=p.meterInMercatorCoordinateUnits(),b=o.bi();return o.Q(b,b,[p.x,p.y,p.z]),o.be(b,b,Math.PI),o.bf(b,b,Math.PI/2),o.S(b,b,[-f,f,f]),b}getProjectionDataForCustomLayer(t=!0){let a=new o.a3(0,0,0,0,0),p=this.getProjectionData({overscaledTileID:a,applyGlobeMatrix:t}),f=ji(a,this.worldSize);o.U(f,this._viewProjMatrix,f),p.tileMercatorCoords=[0,0,1,1];let b=[o.a6,o.a6,this.worldSize/this._helper.pixelsPerMeter],P=o.bj();return o.S(P,f,b),p.fallbackMatrix=P,p.mainMatrix=P,p}getFastPathSimpleProjectionMatrix(t){return this.calculatePosMatrix(t)}}function ja(){o.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}function Ac(_){if(_.useSlerp)if(_.k<1){let t=o.bk(_.startEulerAngles.roll,_.startEulerAngles.pitch,_.startEulerAngles.bearing),a=o.bk(_.endEulerAngles.roll,_.endEulerAngles.pitch,_.endEulerAngles.bearing),p=new Float64Array(4);o.bl(p,t,a,_.k);let f=o.bm(p);_.tr.setRoll(f.roll),_.tr.setPitch(f.pitch),_.tr.setBearing(f.bearing)}else _.tr.setRoll(_.endEulerAngles.roll),_.tr.setPitch(_.endEulerAngles.pitch),_.tr.setBearing(_.endEulerAngles.bearing);else _.tr.setRoll(o.H.number(_.startEulerAngles.roll,_.endEulerAngles.roll,_.k)),_.tr.setPitch(o.H.number(_.startEulerAngles.pitch,_.endEulerAngles.pitch,_.k)),_.tr.setBearing(o.H.number(_.startEulerAngles.bearing,_.endEulerAngles.bearing,_.k))}function zc(_,t,a,p,f){let b=f.padding,P=Bi(f.worldSize,a.getNorthWest()),D=Bi(f.worldSize,a.getNorthEast()),B=Bi(f.worldSize,a.getSouthEast()),U=Bi(f.worldSize,a.getSouthWest()),$=o.an(-p),Y=P.rotate($),ee=D.rotate($),oe=B.rotate($),_e=U.rotate($),Ie=new o.P(Math.max(Y.x,ee.x,_e.x,oe.x),Math.max(Y.y,ee.y,_e.y,oe.y)),ze=new o.P(Math.min(Y.x,ee.x,_e.x,oe.x),Math.min(Y.y,ee.y,_e.y,oe.y)),Ee=Ie.sub(ze),De=(f.width-(b.left+b.right+t.left+t.right))/Ee.x,je=(f.height-(b.top+b.bottom+t.top+t.bottom))/Ee.y;if(je<0||De<0)return void ja();let Le=Math.min(o.ar(f.scale*Math.min(De,je)),_.maxZoom),we=o.P.convert(_.offset),qe=new o.P((t.left-t.right)/2,(t.top-t.bottom)/2).rotate(o.an(p)),Fe=we.add(qe).mult(f.scale/o.ao(Le));return{center:an(f.worldSize,P.add(B).div(2).sub(Fe)),zoom:Le,bearing:p}}class Ps{get useGlobeControls(){return!1}handlePanInertia(t,a){let p=t.mag(),f=Math.abs(Lo(a));return{easingOffset:t.mult(Math.min(.75*f/p,1)),easingCenter:a.center}}handleMapControlsRollPitchBearingZoom(t,a){t.bearingDelta&&a.setBearing(a.bearing+t.bearingDelta),t.pitchDelta&&a.setPitch(a.pitch+t.pitchDelta),t.rollDelta&&a.setRoll(a.roll+t.rollDelta),t.zoomDelta&&a.setZoom(a.zoom+t.zoomDelta)}handleMapControlsPan(t,a,p){t.around.distSqr(a.centerPoint)<.01||a.setLocationAtPoint(p,t.around)}cameraForBoxAndBearing(t,a,p,f,b){return zc(t,a,p,f,b)}handleJumpToCenterZoom(t,a){t.zoom!==(a.zoom!==void 0?+a.zoom:t.zoom)&&t.setZoom(+a.zoom),a.center!==void 0&&t.setCenter(o.W.convert(a.center))}handleEaseTo(t,a){let p=t.zoom,f=t.padding,b={roll:t.roll,pitch:t.pitch,bearing:t.bearing},P={roll:a.roll===void 0?t.roll:a.roll,pitch:a.pitch===void 0?t.pitch:a.pitch,bearing:a.bearing===void 0?t.bearing:a.bearing},D=a.zoom!==void 0,B=!t.isPaddingEqual(a.padding),U=!1,$=D?+a.zoom:t.zoom,Y=t.centerPoint.add(a.offsetAsPoint),ee=t.screenPointToLocation(Y),{center:oe,zoom:_e}=t.applyConstrain(o.W.convert(a.center||ee),$??p);wa(t,oe);let Ie=Bi(t.worldSize,ee),ze=Bi(t.worldSize,oe).sub(Ie),Ee=o.ao(_e-p);return U=_e!==p,{easeFunc:De=>{if(U&&t.setZoom(o.H.number(p,_e,De)),o.bn(b,P)||Ac({startEulerAngles:b,endEulerAngles:P,tr:t,k:De,useSlerp:b.roll!=P.roll}),B&&(t.interpolatePadding(f,a.padding,De),Y=t.centerPoint.add(a.offsetAsPoint)),a.around)t.setLocationAtPoint(a.around,a.aroundPoint);else{let je=o.ao(t.zoom-p),Le=_e>p?Math.min(2,Ee):Math.max(.5,Ee),we=Math.pow(Le,1-De),qe=an(t.worldSize,Ie.add(ze.mult(De*we)).mult(je));t.setLocationAtPoint(t.renderWorldCopies?qe.wrap():qe,Y)}},isZooming:U,elevationCenter:oe}}handleFlyTo(t,a){let p=a.zoom!==void 0,f=t.zoom,b=t.applyConstrain(o.W.convert(a.center||a.locationAtOffset),p?+a.zoom:f),P=b.center,D=b.zoom;wa(t,P);let B=Bi(t.worldSize,a.locationAtOffset),U=Bi(t.worldSize,P).sub(B),$=U.mag(),Y=o.ao(D-f),ee;if(a.minZoom!==void 0){let oe=Math.min(+a.minZoom,f,D),_e=t.applyConstrain(P,oe).zoom;ee=o.ao(_e-f)}return{easeFunc:(oe,_e,Ie,ze)=>{t.setZoom(oe===1?D:f+o.ar(_e));let Ee=oe===1?P:an(t.worldSize,B.add(U.mult(Ie)).mult(_e));t.setLocationAtPoint(t.renderWorldCopies?Ee.wrap():Ee,ze)},scaleOfZoom:Y,targetCenter:P,scaleOfMinZoom:ee,pixelPathLength:$}}}class br{constructor(t,a,p){this.blendFunction=t,this.blendColor=a,this.mask=p}}br.Replace=[1,0],br.disabled=new br(br.Replace,o.bo.transparent,[!1,!1,!1,!1]),br.unblended=new br(br.Replace,o.bo.transparent,[!0,!0,!0,!0]),br.alphaBlended=new br([1,771],o.bo.transparent,[!0,!0,!0,!0]);let Sl=2305;class ar{constructor(t,a,p){this.enable=t,this.mode=a,this.frontFace=p}}ar.disabled=new ar(!1,1029,Sl),ar.backCCW=new ar(!0,1029,Sl),ar.frontCCW=new ar(!0,1028,Sl);class Zi{constructor(t,a,p){this.func=t,this.mask=a,this.range=p}}Zi.ReadOnly=!1,Zi.ReadWrite=!0,Zi.disabled=new Zi(519,Zi.ReadOnly,[0,1]);let tc=7680;class hr{constructor(t,a,p,f,b,P){this.test=t,this.ref=a,this.mask=p,this.fail=f,this.depthFail=b,this.pass=P}}function qa(_){return typeof WebGL2RenderingContext<"u"&&_ instanceof WebGL2RenderingContext}hr.disabled=new hr({func:519,mask:0},0,0,tc,tc,tc);class ic{get awaitingQuery(){return!!this._readbackQueue}constructor(t){this._readbackWaitFrames=4,this._measureWaitFrames=6,this._texWidth=1,this._texHeight=1,this._measuredError=0,this._updateCount=0,this._lastReadbackFrame=-1e3,this._readbackQueue=null,this._cachedRenderContext=t;let a=t.context,p=a.gl;this._texFormat=p.RGBA,this._texType=p.UNSIGNED_BYTE;let f=new o.aU;f.emplaceBack(-1,-1),f.emplaceBack(2,-1),f.emplaceBack(-1,2);let b=new o.aW;b.emplaceBack(0,1,2),this._fullscreenTriangle=new Cr(a.createVertexBuffer(f,cs.members),a.createIndexBuffer(b),o.aV.simpleSegment(0,0,f.length,b.length)),this._resultBuffer=new Uint8Array(4),a.activeTexture.set(p.TEXTURE1);let P=p.createTexture();p.bindTexture(p.TEXTURE_2D,P),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,p.NEAREST),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,p.NEAREST),p.texImage2D(p.TEXTURE_2D,0,this._texFormat,this._texWidth,this._texHeight,0,this._texFormat,this._texType,null),this._fbo=a.createFramebuffer(this._texWidth,this._texHeight,!1,!1),this._fbo.colorAttachment.set(P),qa(p)&&(this._pbo=p.createBuffer(),p.bindBuffer(p.PIXEL_PACK_BUFFER,this._pbo),p.bufferData(p.PIXEL_PACK_BUFFER,4,p.STREAM_READ),p.bindBuffer(p.PIXEL_PACK_BUFFER,null))}destroy(){let t=this._cachedRenderContext.context.gl;this._fullscreenTriangle.destroy(),this._fbo.destroy(),t.deleteBuffer(this._pbo),this._fullscreenTriangle=null,this._fbo=null,this._pbo=null,this._resultBuffer=null}updateErrorLoop(t,a){let p=this._updateCount;return this._readbackQueue?p>=this._readbackQueue.frameNumberIssued+this._readbackWaitFrames&&this._tryReadback():p>=this._lastReadbackFrame+this._measureWaitFrames&&this._renderErrorTexture(t,a),this._updateCount++,this._measuredError}_bindFramebuffer(){let t=this._cachedRenderContext.context,a=t.gl;t.activeTexture.set(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,this._fbo.colorAttachment.get()),t.bindFramebuffer.set(this._fbo.framebuffer)}_renderErrorTexture(t,a){let p=this._cachedRenderContext.context,f=p.gl;if(this._bindFramebuffer(),p.viewport.set([0,0,this._texWidth,this._texHeight]),p.clear({color:o.bo.transparent}),this._cachedRenderContext.useProgram("projectionErrorMeasurement").draw(p,f.TRIANGLES,Zi.disabled,hr.disabled,br.unblended,ar.disabled,((b,P)=>({u_input:b,u_output_expected:P}))(t,a),null,null,"$clipping",this._fullscreenTriangle.vertexBuffer,this._fullscreenTriangle.indexBuffer,this._fullscreenTriangle.segments),this._pbo&&qa(f)){f.bindBuffer(f.PIXEL_PACK_BUFFER,this._pbo),f.readBuffer(f.COLOR_ATTACHMENT0),f.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,0),f.bindBuffer(f.PIXEL_PACK_BUFFER,null);let b=f.fenceSync(f.SYNC_GPU_COMMANDS_COMPLETE,0);f.flush(),this._readbackQueue={frameNumberIssued:this._updateCount,sync:b}}else this._readbackQueue={frameNumberIssued:this._updateCount,sync:null}}_tryReadback(){let t=this._cachedRenderContext.context.gl;if(this._pbo&&this._readbackQueue&&qa(t)){let a=t.clientWaitSync(this._readbackQueue.sync,0,0);if(a===t.WAIT_FAILED)return o.w("WebGL2 clientWaitSync failed."),this._readbackQueue=null,void(this._lastReadbackFrame=this._updateCount);if(a===t.TIMEOUT_EXPIRED)return;t.bindBuffer(t.PIXEL_PACK_BUFFER,this._pbo),t.getBufferSubData(t.PIXEL_PACK_BUFFER,0,this._resultBuffer,0,4),t.bindBuffer(t.PIXEL_PACK_BUFFER,null)}else this._bindFramebuffer(),t.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,this._resultBuffer);this._readbackQueue=null,this._measuredError=ic._parseRGBA8float(this._resultBuffer),this._lastReadbackFrame=this._updateCount}static _parseRGBA8float(t){let a=0;return a+=t[0]/256,a+=t[1]/65536,a+=t[2]/16777216,t[3]<127&&(a=-a),a/128}}let Il=o.a6/128;function rc(_,t){let a=_.granularity!==void 0?Math.max(_.granularity,1):1,p=a+(_.generateBorders?2:0),f=a+(_.extendToNorthPole||_.generateBorders?1:0)+(_.extendToSouthPole||_.generateBorders?1:0),b=p+1,P=f+1,D=_.generateBorders?-1:0,B=_.generateBorders||_.extendToNorthPole?-1:0,U=a+(_.generateBorders?1:0),$=a+(_.generateBorders||_.extendToSouthPole?1:0),Y=b*P,ee=p*f*6,oe=b*P>65536;if(oe&&t==="16bit")throw new Error("Granularity is too large and meshes would not fit inside 16 bit vertex indices.");let _e=oe||t==="32bit",Ie=new Int16Array(2*Y),ze=0;for(let je=B;je<=$;je++)for(let Le=D;Le<=U;Le++){let we=Le/a*o.a6;Le===-1&&(we=-Il),Le===a+1&&(we=o.a6+Il);let qe=je/a*o.a6;je===-1&&(qe=_.extendToNorthPole?o.bq:-Il),je===a+1&&(qe=_.extendToSouthPole?o.br:o.a6+Il),Ie[ze++]=we,Ie[ze++]=qe}let Ee=_e?new Uint32Array(ee):new Uint16Array(ee),De=0;for(let je=0;je<f;je++)for(let Le=0;Le<p;Le++){let we=Le+1+je*b,qe=Le+(je+1)*b,Fe=Le+1+(je+1)*b;Ee[De++]=Le+je*b,Ee[De++]=qe,Ee[De++]=we,Ee[De++]=we,Ee[De++]=qe,Ee[De++]=Fe}return{vertices:Ie.buffer.slice(0),indices:Ee.buffer.slice(0),uses32bitIndices:_e}}let Dc=new o.aT({fill:new o.bs(128,2),line:new o.bs(512,0),tile:new o.bs(128,32),stencil:new o.bs(128,1),circle:3});class Cl{constructor(){this._tileMeshCache={},this._errorCorrectionUsable=0,this._errorMeasurementLastValue=0,this._errorCorrectionPreviousValue=0,this._errorMeasurementLastChangeTime=-1e3}get name(){return"vertical-perspective"}get transitionState(){return 1}get useSubdivision(){return!0}get shaderVariantName(){return"globe"}get shaderDefine(){return"#define GLOBE"}get shaderPreludeCode(){return Br.projectionGlobe}get vertexShaderPreludeCode(){return Br.projectionMercator.vertexSource}get subdivisionGranularity(){return Dc}get useGlobeControls(){return!0}get latitudeErrorCorrectionRadians(){return this._errorCorrectionUsable}destroy(){this._errorMeasurement&&this._errorMeasurement.destroy()}updateGPUdependent(t){this._errorMeasurement||(this._errorMeasurement=new ic(t));let a=o.Y(this._errorQueryLatitudeDegrees),p=2*Math.atan(Math.exp(Math.PI-a*Math.PI*2))-.5*Math.PI,f=this._errorMeasurement.updateErrorLoop(a,p),b=Mt();f!==this._errorMeasurementLastValue&&(this._errorCorrectionPreviousValue=this._errorCorrectionUsable,this._errorMeasurementLastValue=f,this._errorMeasurementLastChangeTime=b);let P=Math.min(Math.max((b-this._errorMeasurementLastChangeTime)/1e3/.5,0),1);this._errorCorrectionUsable=o.bt(this._errorCorrectionPreviousValue,-this._errorMeasurementLastValue,o.bu(P))}_getMeshKey(t){return`${t.granularity.toString(36)}_${t.generateBorders?"b":""}${t.extendToNorthPole?"n":""}${t.extendToSouthPole?"s":""}`}getMeshFromTileID(t,a,p,f,b){let P=(b==="stencil"?Dc.stencil:Dc.tile).getGranularityForZoomLevel(a.z);return this._getMesh(t,{granularity:P,generateBorders:p,extendToNorthPole:a.y===0&&f,extendToSouthPole:a.y===(1<<a.z)-1&&f})}_getMesh(t,a){let p=this._getMeshKey(a);if(p in this._tileMeshCache)return this._tileMeshCache[p];let f=(function(b,P){let D=rc(P,"16bit"),B=o.aU.deserialize({arrayBuffer:D.vertices,length:D.vertices.byteLength/2/2}),U=o.aW.deserialize({arrayBuffer:D.indices,length:D.indices.byteLength/2/3});return new Cr(b.createVertexBuffer(B,cs.members),b.createIndexBuffer(U),o.aV.simpleSegment(0,0,B.length,U.length))})(t,a);return this._tileMeshCache[p]=f,f}recalculate(t){}hasTransition(){var t;let a=Mt(),p=!1;return p||(p=(a-this._errorMeasurementLastChangeTime)/1e3<.7),p||(p=(t=this._errorMeasurement)===null||t===void 0?void 0:t.awaitingQuery),p}setErrorQueryLatitudeDegrees(t){this._errorQueryLatitudeDegrees=t}}let mh=new o.u({type:new o.D(o.x.projection.type)});class fh extends o.E{constructor(t){super(),this._transitionable=new o.y(mh,void 0),this.setProjection(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new o.J(0)),this._mercatorProjection=new bo,this._verticalPerspectiveProjection=new Cl}get transitionState(){let t=this.properties.get("type");if(typeof t=="string"&&t==="mercator")return 0;if(typeof t=="string"&&t==="vertical-perspective")return 1;if(t instanceof o.bv){if(t.from==="vertical-perspective"&&t.to==="mercator")return 1-t.transition;if(t.from==="mercator"&&t.to==="vertical-perspective")return t.transition}return 1}get useGlobeRendering(){return this.transitionState>0}get latitudeErrorCorrectionRadians(){return this._verticalPerspectiveProjection.latitudeErrorCorrectionRadians}get currentProjection(){return this.useGlobeRendering?this._verticalPerspectiveProjection:this._mercatorProjection}get name(){return"globe"}get useSubdivision(){return this.currentProjection.useSubdivision}get shaderVariantName(){return this.currentProjection.shaderVariantName}get shaderDefine(){return this.currentProjection.shaderDefine}get shaderPreludeCode(){return this.currentProjection.shaderPreludeCode}get vertexShaderPreludeCode(){return this.currentProjection.vertexShaderPreludeCode}get subdivisionGranularity(){return this.currentProjection.subdivisionGranularity}get useGlobeControls(){return this.transitionState>0}destroy(){this._mercatorProjection.destroy(),this._verticalPerspectiveProjection.destroy()}updateGPUdependent(t){this._mercatorProjection.updateGPUdependent(t),this._verticalPerspectiveProjection.updateGPUdependent(t)}getMeshFromTileID(t,a,p,f,b){return this.currentProjection.getMeshFromTileID(t,a,p,f,b)}setProjection(t){this._transitionable.setValue("type",t?.type||"mercator")}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()||this.currentProjection.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}setErrorQueryLatitudeDegrees(t){this._verticalPerspectiveProjection.setErrorQueryLatitudeDegrees(t),this._mercatorProjection.setErrorQueryLatitudeDegrees(t)}}function El(_){let t=lo(_.worldSize,_.center.lat);return 2*Math.PI*t}function ln(_,t,a,p,f){let b=1/(1<<f),P=t/o.a6*b+p*b,D=o.by((_/o.a6*b+a*b)*Math.PI*2+Math.PI,2*Math.PI),B=2*Math.atan(Math.exp(Math.PI-P*Math.PI*2))-.5*Math.PI,U=Math.cos(B),$=new Float64Array(3);return $[0]=Math.sin(D)*U,$[1]=Math.sin(B),$[2]=Math.cos(D)*U,$}function Nn(_){return(function(t,a){let p=Math.cos(a),f=new Float64Array(3);return f[0]=Math.sin(t)*p,f[1]=Math.sin(a),f[2]=Math.cos(t)*p,f})(_.lng*Math.PI/180,_.lat*Math.PI/180)}function lo(_,t){return _/(2*Math.PI)/Math.cos(t*Math.PI/180)}function $a(_){let t=Math.asin(_[1])/Math.PI*180,a=Math.sqrt(_[0]*_[0]+_[2]*_[2]);if(a>1e-6){let p=_[0]/a,f=Math.acos(_[2]/a),b=(p>0?f:-f)/Math.PI*180;return new o.W(o.X(b,-180,180),t)}return new o.W(0,t)}function nc(_){return Math.cos(_*Math.PI/180)}function Hr(_,t){let a=nc(_),p=nc(t);return o.ar(p/a)}function yr(_,t){let a=_.rotate(t.bearingInRadians),p=t.zoom+Hr(t.center.lat,0),f=o.bt(1/nc(t.center.lat),1/nc(Math.min(Math.abs(t.center.lat),60)),o.bw(p,7,3,0,1)),b=360/El({worldSize:t.worldSize,center:{lat:t.center.lat}});return new o.W(t.center.lng-a.x*b*f,o.al(t.center.lat+a.y*b,-o.am,o.am))}function gh(_){let t=.5*_,a=Math.sin(t),p=Math.cos(t);return Math.log(a+p)-Math.log(p-a)}function nr(_,t,a,p){let f=_.lat+a*p;if(Math.abs(a)>1){let b=(Math.sign(_.lat+a)!==Math.sign(_.lat)?-Math.abs(_.lat):Math.abs(_.lat))*Math.PI/180,P=Math.abs(_.lat+a)*Math.PI/180,D=gh(b+p*(P-b)),B=gh(b),U=gh(P);return new o.W(_.lng+t*((D-B)/(U-B)),f)}return new o.W(_.lng+t*p,f)}class gr{constructor(t){this._cachePrevious=new Map,this._cache=new Map,this._hadAnyChanges=!1,this._boundingVolumeFactory=t}swapBuffers(){if(!this._hadAnyChanges)return;let t=this._cachePrevious;this._cachePrevious=this._cache,this._cache=t,this._cache.clear(),this._hadAnyChanges=!1}getTileBoundingVolume(t,a,p,f){let b=`${t.z}_${t.x}_${t.y}_${f?.terrain?"t":""}`,P=this._cache.get(b);if(P)return P;let D=this._cachePrevious.get(b);if(D)return this._cache.set(b,D),D;let B=this._boundingVolumeFactory(t,a,p,f);return this._cache.set(b,B),this._hadAnyChanges=!0,B}}class xr{constructor(t,a,p,f){this.min=p,this.max=f,this.points=t,this.planes=a}static fromAabb(t,a){let p=[];for(let f=0;f<8;f++)p.push([1&~f?t[0]:a[0],(f>>1&1)==1?a[1]:t[1],(f>>2&1)==1?a[2]:t[2]]);return new xr(p,[[-1,0,0,a[0]],[1,0,0,-t[0]],[0,-1,0,a[1]],[0,1,0,-t[1]],[0,0,-1,a[2]],[0,0,1,-t[2]]],t,a)}static fromCenterSizeAngles(t,a,p){let f=o.bA([],p[0],p[1],p[2]),b=o.bB([],[a[0],0,0],f),P=o.bB([],[0,a[1],0],f),D=o.bB([],[0,0,a[2]],f),B=[...t],U=[...t];for(let Y=0;Y<8;Y++)for(let ee=0;ee<3;ee++){let oe=t[ee]+b[ee]*(1&~Y?-1:1)+P[ee]*((Y>>1&1)==1?1:-1)+D[ee]*((Y>>2&1)==1?1:-1);B[ee]=Math.min(B[ee],oe),U[ee]=Math.max(U[ee],oe)}let $=[];for(let Y=0;Y<8;Y++){let ee=[...t];o.a_(ee,ee,o.aZ([],b,1&~Y?-1:1)),o.a_(ee,ee,o.aZ([],P,(Y>>1&1)==1?1:-1)),o.a_(ee,ee,o.aZ([],D,(Y>>2&1)==1?1:-1)),$.push(ee)}return new xr($,[[...b,-o.b3(b,$[0])],[...P,-o.b3(P,$[0])],[...D,-o.b3(D,$[0])],[-b[0],-b[1],-b[2],-o.b3(b,$[7])],[-P[0],-P[1],-P[2],-o.b3(P,$[7])],[-D[0],-D[1],-D[2],-o.b3(D,$[7])]],B,U)}intersectsFrustum(t){let a=!0,p=this.points.length,f=this.planes.length,b=t.planes.length,P=t.points.length;for(let D=0;D<b;D++){let B=t.planes[D],U=0;for(let $=0;$<p;$++){let Y=this.points[$];B[0]*Y[0]+B[1]*Y[1]+B[2]*Y[2]+B[3]>=0&&U++}if(U===0)return 0;U<p&&(a=!1)}if(a)return 2;for(let D=0;D<f;D++){let B=this.planes[D],U=0;for(let $=0;$<P;$++){let Y=t.points[$];B[0]*Y[0]+B[1]*Y[1]+B[2]*Y[2]+B[3]>=0&&U++}if(U===0)return 0}return 1}intersectsPlane(t){let a=this.points.length,p=0;for(let f=0;f<a;f++){let b=this.points[f];t[0]*b[0]+t[1]*b[1]+t[2]*b[2]+t[3]>=0&&p++}return p===a?2:p===0?0:1}}function zr(_,t,a){let p=_-t;return p<0?-p:Math.max(0,p-a)}function Ml(_,t,a,p,f){let b=_-a,P;return P=b<0?Math.min(-b,1+b-f):b>f?Math.min(Math.max(b-f,0),1-b):0,Math.max(P,zr(t,p,f))}class ks{constructor(){this._boundingVolumeCache=new gr(this._computeTileBoundingVolume)}prepareNextFrame(){this._boundingVolumeCache.swapBuffers()}distanceToTile2d(t,a,p,f){let b=1<<p.z,P=1/b,D=p.x/b,B=p.y/b,U=2;return U=Math.min(U,Ml(t,a,D,B,P)),U=Math.min(U,Ml(t,a,D+.5,-B-P,P)),U=Math.min(U,Ml(t,a,D+.5,2-B-P,P)),U}getWrap(t,a,p){let f=1<<a.z,b=1/f,P=a.x/f,D=zr(t.x,P,b),B=zr(t.x,P-1,b),U=zr(t.x,P+1,b),$=Math.min(D,B,U);return $===U?1:$===B?-1:0}allowVariableZoom(t,a){return On(t,a)>4}allowWorldCopies(){return!1}getTileBoundingVolume(t,a,p,f){return this._boundingVolumeCache.getTileBoundingVolume(t,a,p,f)}_computeTileBoundingVolume(t,a,p,f){var b,P;let D=0,B=0;if(f?.terrain){let U=new o.a3(t.z,a,t.z,t.x,t.y),$=f.terrain.getMinMaxElevation(U);D=(b=$.minElevation)!==null&&b!==void 0?b:Math.min(0,p),B=(P=$.maxElevation)!==null&&P!==void 0?P:Math.max(0,p)}if(D/=o.bD,B/=o.bD,D+=1,B+=1,t.z<=0)return xr.fromAabb([-B,-B,-B],[B,B,B]);if(t.z===1)return xr.fromAabb([t.x===0?-B:0,t.y===0?0:-B,-B],[t.x===0?0:B,t.y===0?B:0,B]);{let U=[ln(0,0,t.x,t.y,t.z),ln(o.a6,0,t.x,t.y,t.z),ln(o.a6,o.a6,t.x,t.y,t.z),ln(0,o.a6,t.x,t.y,t.z)],$=[];for(let Rt of U)$.push(o.aZ([],Rt,B));if(B!==D)for(let Rt of U)$.push(o.aZ([],Rt,D));t.y===0&&$.push([0,1,0]),t.y===(1<<t.z)-1&&$.push([0,-1,0]);let Y=[1,1,1],ee=[-1,-1,-1];for(let Rt of $)for(let Dt=0;Dt<3;Dt++)Y[Dt]=Math.min(Y[Dt],Rt[Dt]),ee[Dt]=Math.max(ee[Dt],Rt[Dt]);let oe=ln(o.a6/2,o.a6/2,t.x,t.y,t.z),_e=o.b2([],[0,1,0],oe);o.b1(_e,_e);let Ie=o.b2([],oe,_e);o.b1(Ie,Ie);let ze=o.b2([],U[2],U[1]);o.b1(ze,ze);let Ee=o.b2([],U[0],U[3]);o.b1(Ee,Ee),$.push(o.aZ([],oe,B)),t.y>=(1<<t.z)/2&&$.push(o.aZ([],ln(o.a6/2,0,t.x,t.y,t.z),B)),t.y<(1<<t.z)/2&&$.push(o.aZ([],ln(o.a6/2,o.a6,t.x,t.y,t.z),B));let De=_h(oe,$),je=_h(Ie,$),Le=[-oe[0],-oe[1],-oe[2],De.max],we=[oe[0],oe[1],oe[2],-De.min],qe=[-Ie[0],-Ie[1],-Ie[2],je.max],Fe=[Ie[0],Ie[1],Ie[2],-je.min],it=[...ze,0],ft=[...Ee,0],_t=[];return t.y===0?_t.push(o.bC(ft,it,Le),o.bC(ft,it,we)):_t.push(o.bC(qe,it,Le),o.bC(qe,it,we),o.bC(qe,ft,Le),o.bC(qe,ft,we)),t.y===(1<<t.z)-1?_t.push(o.bC(ft,it,Le),o.bC(ft,it,we)):_t.push(o.bC(Fe,it,Le),o.bC(Fe,it,we),o.bC(Fe,ft,Le),o.bC(Fe,ft,we)),new xr(_t,[Le,we,qe,Fe,it,ft],Y,ee)}}}function _h(_,t){let a=1/0,p=-1/0;for(let f of t){let b=o.b3(_,f);a=Math.min(a,b),p=Math.max(p,b)}return{min:a,max:p}}class Pl{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,a,p){this._helper.interpolatePadding(t,a,p)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,a){this._helper.resize(t,a)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,a){this._helper.overrideNearFarZ(t,a)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(t){}constructor(t){this._cachedClippingPlane=o.bE(),this._projectionMatrix=o.bi(),this._globeViewProjMatrix32f=o.bh(),this._globeViewProjMatrixNoCorrection=o.bi(),this._globeViewProjMatrixNoCorrectionInverted=o.bi(),this._globeProjMatrixInverted=o.bi(),this._cameraPosition=o.bz(),this._globeLatitudeErrorCorrectionRadians=0,this.defaultConstrain=(a,p)=>{let f=o.al(a.lat,-o.am,o.am),b=o.al(+p,this.minZoom+Hr(0,f),this.maxZoom);return{center:new o.W(a.lng,f),zoom:b}},this.applyConstrain=(a,p)=>this._helper.applyConstrain(a,p),this._helper=new Vn({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(a,p)=>this.defaultConstrain(a,p)},t),this._coveringTilesDetailsProvider=new ks}clone(){let t=new Pl;return t.apply(this,!1),t}apply(t,a,p){this._globeLatitudeErrorCorrectionRadians=p||0,this._helper.apply(t,a)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixNoCorrection}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){let t=o.bz();return t[0]=this._cameraPosition[0],t[1]=this._cameraPosition[1],t[2]=this._cameraPosition[2],t}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}getProjectionData(t){let{overscaledTileID:a,applyGlobeMatrix:p}=t,f=this._helper.getMercatorTileCoordinates(a);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:f,clippingPlane:this._cachedClippingPlane,projectionTransition:p?1:0,fallbackMatrix:this._globeViewProjMatrix32f}}_computeClippingPlane(t){let a=this.pitchInRadians,p=this.cameraToCenterDistance/t,f=Math.sin(a)*p,b=Math.cos(a)*p+1,P=1/Math.sqrt(f*f+b*b)*1,D=-f,B=b,U=Math.sqrt(D*D+B*B);D/=U,B/=U;let $=[0,D,B];o.bF($,$,[0,0,0],-this.bearingInRadians),o.bG($,$,[0,0,0],-1*this.center.lat*Math.PI/180),o.bH($,$,[0,0,0],this.center.lng*Math.PI/180);let Y=1/o.b5($);return o.aZ($,$,Y),[...$,-P*Y]}isLocationOccluded(t){return!this.isSurfacePointVisible(Nn(t))}transformLightDirection(t){let a=this._helper._center.lng*Math.PI/180,p=this._helper._center.lat*Math.PI/180,f=Math.cos(p),b=[Math.sin(a)*f,Math.sin(p),Math.cos(a)*f],P=[b[2],0,-b[0]],D=[0,0,0];o.b2(D,P,b),o.b1(P,P),o.b1(D,D);let B=[0,0,0];return o.b1(B,[P[0]*t[0]+D[0]*t[1]+b[0]*t[2],P[1]*t[0]+D[1]*t[1]+b[1]*t[2],P[2]*t[0]+D[2]*t[1]+b[2]*t[2]]),B}getPixelScale(){return 1/Math.cos(this._helper._center.lat*Math.PI/180)}getCircleRadiusCorrection(){return Math.cos(this._helper._center.lat*Math.PI/180)}getPitchedTextCorrection(t,a,p){let f=(function(D,B,U){let $=1/(1<<U.z);return new o.a7(D/o.a6*$+U.x*$,B/o.a6*$+U.y*$)})(t,a,p.canonical),b=(P=f.y,[o.by(f.x*Math.PI*2+Math.PI,2*Math.PI),2*Math.atan(Math.exp(Math.PI-P*Math.PI*2))-.5*Math.PI]);var P;return this.getCircleRadiusCorrection()/Math.cos(b[1])}projectTileCoordinates(t,a,p,f){let b=p.canonical,P=ln(t,a,b.x,b.y,b.z),D=1+(f?f(t,a):0)/o.bD,B=[P[0]*D,P[1]*D,P[2]*D,1];o.aE(B,B,this._globeViewProjMatrixNoCorrection);let U=this._cachedClippingPlane,$=U[0]*P[0]+U[1]*P[1]+U[2]*P[2]+U[3]<0;return{point:new o.P(B[0]/B[3],B[1]/B[3]),signedDistanceFromCamera:B[3],isOccluded:$}}_calcMatrices(){if(!this._helper._width||!this._helper._height)return;let t=lo(this.worldSize,this.center.lat),a=o.bj(),p=o.bj();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+2*t),o.bc(a,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);let f=this.centerOffset;a[8]=2*-f.x/this._helper._width,a[9]=2*f.y/this._helper._height,this._projectionMatrix=o.bd(a),this._globeProjMatrixInverted=o.bj(),o.bg(this._globeProjMatrixInverted,a),o.Q(a,a,[0,0,-this.cameraToCenterDistance]),o.be(a,a,this.rollInRadians),o.bf(a,a,-this.pitchInRadians),o.be(a,a,this.bearingInRadians),o.Q(a,a,[0,0,-t]);let b=o.bz();b[0]=t,b[1]=t,b[2]=t,o.bf(p,a,this.center.lat*Math.PI/180),o.bI(p,p,-this.center.lng*Math.PI/180),o.S(p,p,b),this._globeViewProjMatrixNoCorrection=p,o.bf(a,a,this.center.lat*Math.PI/180-this._globeLatitudeErrorCorrectionRadians),o.bI(a,a,-this.center.lng*Math.PI/180),o.S(a,a,b),this._globeViewProjMatrix32f=new Float32Array(a),this._globeViewProjMatrixNoCorrectionInverted=o.bj(),o.bg(this._globeViewProjMatrixNoCorrectionInverted,p);let P=o.bz();this._cameraPosition=o.bz(),this._cameraPosition[2]=this.cameraToCenterDistance/t,o.bF(this._cameraPosition,this._cameraPosition,P,-this.rollInRadians),o.bG(this._cameraPosition,this._cameraPosition,P,this.pitchInRadians),o.bF(this._cameraPosition,this._cameraPosition,P,-this.bearingInRadians),o.a_(this._cameraPosition,this._cameraPosition,[0,0,1]),o.bG(this._cameraPosition,this._cameraPosition,P,-this.center.lat*Math.PI/180),o.bH(this._cameraPosition,this._cameraPosition,P,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(t);let D=o.bd(this._globeViewProjMatrixNoCorrectionInverted);o.S(D,D,[1,1,-1]),this._cachedFrustum=to.fromInvProjectionMatrix(D,1,0,this._cachedClippingPlane,!0)}calculateFogMatrix(t){o.w("calculateFogMatrix is not supported on globe projection.");let a=o.bj();return o.ap(a),a}getVisibleUnwrappedCoordinates(t){return[new o.ba(0,t)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){t&&o.w("terrain is not fully supported on vertical perspective projection."),this._helper.recalculateZoomAndCenter(0)}maxPitchScaleFactor(){return 1}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(t,a){if(!this._globeViewProjMatrixNoCorrection)return 1;let p=Nn(t);o.aZ(p,p,1+a/o.bD);let f=o.bE();return o.aE(f,[p[0],p[1],p[2],1],this._globeViewProjMatrixNoCorrection),f[2]/f[3]}populateCache(t){}getBounds(){let t=.5*this.width,a=.5*this.height,p=[new o.P(0,0),new o.P(t,0),new o.P(this.width,0),new o.P(this.width,a),new o.P(this.width,this.height),new o.P(t,this.height),new o.P(0,this.height),new o.P(0,a)],f=[];for(let Y of p)f.push(this.unprojectScreenPoint(Y));let b=0,P=0,D=0,B=0,U=this.center;for(let Y of f){let ee=o.bJ(U.lng,Y.lng),oe=o.bJ(U.lat,Y.lat);ee<P&&(P=ee),ee>b&&(b=ee),oe<B&&(B=oe),oe>D&&(D=oe)}let $=[U.lng+P,U.lat+B,U.lng+b,U.lat+D];return this.isSurfacePointOnScreen([0,1,0])&&($[3]=90,$[0]=-180,$[2]=180),this.isSurfacePointOnScreen([0,-1,0])&&($[1]=-90,$[0]=-180,$[2]=180),new Ti($)}calculateCenterFromCameraLngLatAlt(t,a,p,f){return this._helper.calculateCenterFromCameraLngLatAlt(t,a,p,f)}setLocationAtPoint(t,a){let p=Nn(this.unprojectScreenPoint(a)),f=Nn(t),b=o.bz();o.bK(b);let P=o.bz();o.bH(P,p,b,-this.center.lng*Math.PI/180),o.bG(P,P,b,this.center.lat*Math.PI/180);let D=f[0]*f[0]+f[2]*f[2],B=P[0]*P[0];if(D<B)return;let U=Math.sqrt(D-B),$=-U,Y=o.bL(f[0],f[2],P[0],U),ee=o.bL(f[0],f[2],P[0],$),oe=o.bz();o.bH(oe,f,b,-Y);let _e=o.bL(oe[1],oe[2],P[1],P[2]),Ie=o.bz();o.bH(Ie,f,b,-ee);let ze=o.bL(Ie[1],Ie[2],P[1],P[2]),Ee=.5*Math.PI,De=_e>=-Ee&&_e<=Ee,je=ze>=-Ee&&ze<=Ee,Le,we;if(De&&je){let ft=this.center.lng*Math.PI/180,_t=this.center.lat*Math.PI/180;o.bM(Y,ft)+o.bM(_e,_t)<o.bM(ee,ft)+o.bM(ze,_t)?(Le=Y,we=_e):(Le=ee,we=ze)}else if(De)Le=Y,we=_e;else{if(!je)return;Le=ee,we=ze}let qe=Le/Math.PI*180,Fe=we/Math.PI*180,it=this.center.lat;this.setCenter(new o.W(qe,o.al(Fe,-90,90))),this.setZoom(this.zoom+Hr(it,this.center.lat))}locationToScreenPoint(t,a){let p=Nn(t);if(a){let f=a.getElevationForLngLatZoom(t,this._helper._tileZoom);o.aZ(p,p,1+f/o.bD)}return this._projectSurfacePointToScreen(p)}_projectSurfacePointToScreen(t){let a=o.bE();return o.aE(a,[...t,1],this._globeViewProjMatrixNoCorrection),a[0]/=a[3],a[1]/=a[3],new o.P((.5*a[0]+.5)*this.width,(.5*-a[1]+.5)*this.height)}screenPointToMercatorCoordinate(t,a){if(a){let p=a.pointCoordinate(t);if(p)return p}return o.a7.fromLngLat(this.unprojectScreenPoint(t))}screenPointToLocation(t,a){var p;return(p=this.screenPointToMercatorCoordinate(t,a))===null||p===void 0?void 0:p.toLngLat()}isPointOnMapSurface(t,a){let p=this._cameraPosition,f=this.getRayDirectionFromPixel(t);return!!this.rayPlanetIntersection(p,f)}getRayDirectionFromPixel(t){let a=o.bE();a[0]=t.x/this.width*2-1,a[1]=-1*(t.y/this.height*2-1),a[2]=1,a[3]=1,o.aE(a,a,this._globeViewProjMatrixNoCorrectionInverted),a[0]/=a[3],a[1]/=a[3],a[2]/=a[3];let p=o.bz();p[0]=a[0]-this._cameraPosition[0],p[1]=a[1]-this._cameraPosition[1],p[2]=a[2]-this._cameraPosition[2];let f=o.bz();return o.b1(f,p),f}isSurfacePointVisible(t){let a=this._cachedClippingPlane;return a[0]*t[0]+a[1]*t[1]+a[2]*t[2]+a[3]>=0}isSurfacePointOnScreen(t){if(!this.isSurfacePointVisible(t))return!1;let a=o.bE();return o.aE(a,[...t,1],this._globeViewProjMatrixNoCorrection),a[0]/=a[3],a[1]/=a[3],a[2]/=a[3],a[0]>-1&&a[0]<1&&a[1]>-1&&a[1]<1&&a[2]>-1&&a[2]<1}rayPlanetIntersection(t,a){let p=o.b3(t,a),f=o.bz(),b=o.bz();o.aZ(b,a,p),o.b0(f,t,b);let P=1-o.b3(f,f);if(P<0)return null;let D=o.b3(t,t)-1,B=-p+(p<0?1:-1)*Math.sqrt(P),U=D/B,$=B;return{tMin:Math.min(U,$),tMax:Math.max(U,$)}}unprojectScreenPoint(t){let a=this._cameraPosition,p=this.getRayDirectionFromPixel(t),f=this.rayPlanetIntersection(a,p);if(f){let $=o.bz();o.a_($,a,[p[0]*f.tMin,p[1]*f.tMin,p[2]*f.tMin]);let Y=o.bz();return o.b1(Y,$),$a(Y)}let b=this._cachedClippingPlane,P=b[0]*p[0]+b[1]*p[1]+b[2]*p[2],D=-o.b9(b,a)/P,B=o.bz();if(D>0)o.a_(B,a,[p[0]*D,p[1]*D,p[2]*D]);else{let $=o.bz();o.a_($,a,[2*p[0],2*p[1],2*p[2]]);let Y=o.b9(this._cachedClippingPlane,$);o.b0(B,$,[this._cachedClippingPlane[0]*Y,this._cachedClippingPlane[1]*Y,this._cachedClippingPlane[2]*Y])}let U=(function($){let Y=o.bz();return Y[0]=$[0]*-$[3],Y[1]=$[1]*-$[3],Y[2]=$[2]*-$[3],{center:Y,radius:Math.sqrt(1-$[3]*$[3])}})(b);return $a((function($,Y,ee){let oe=o.bz();o.b0(oe,ee,$);let _e=o.bz();return o.bx(_e,$,oe,Y/o.b7(oe)),_e})(U.center,U.radius,B))}getMatrixForModel(t,a){let p=o.W.convert(t),f=1/o.bD,b=o.bi();return o.bI(b,b,p.lng/180*Math.PI),o.bf(b,b,-p.lat/180*Math.PI),o.Q(b,b,[0,0,1+a/o.bD]),o.bf(b,b,.5*Math.PI),o.S(b,b,[f,f,f]),b}getProjectionDataForCustomLayer(t=!0){let a=this.getProjectionData({overscaledTileID:new o.a3(0,0,0,0,0),applyGlobeMatrix:t});return a.tileMercatorCoords=[0,0,1,1],a}getFastPathSimpleProjectionMatrix(t){}}class kl{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,a,p){this._helper.interpolatePadding(t,a,p)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,a,p=!0){this._helper.resize(t,a,p)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,a){this._helper.overrideNearFarZ(t,a)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}get isGlobeRendering(){return this._globeness>0}setTransitionState(t,a){this._globeness=t,this._globeLatitudeErrorCorrectionRadians=a,this._calcMatrices(),this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().prepareNextFrame(),this._mercatorTransform.getCoveringTilesDetailsProvider().prepareNextFrame()}get currentTransform(){return this.isGlobeRendering?this._verticalPerspectiveTransform:this._mercatorTransform}constructor(t){this._globeLatitudeErrorCorrectionRadians=0,this._globeness=1,this.defaultConstrain=(a,p)=>this.currentTransform.defaultConstrain(a,p),this.applyConstrain=(a,p)=>this._helper.applyConstrain(a,p),this._helper=new Vn({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(a,p)=>this.defaultConstrain(a,p)},t),this._globeness=1,this._mercatorTransform=new Ms,this._verticalPerspectiveTransform=new Pl}clone(){let t=new kl;return t._globeness=this._globeness,t._globeLatitudeErrorCorrectionRadians=this._globeLatitudeErrorCorrectionRadians,t.apply(this,!1),t}apply(t,a){this._helper.apply(t,a),this._mercatorTransform.apply(this,!1),this._verticalPerspectiveTransform.apply(this,!1,this._globeLatitudeErrorCorrectionRadians)}get projectionMatrix(){return this.currentTransform.projectionMatrix}get modelViewProjectionMatrix(){return this.currentTransform.modelViewProjectionMatrix}get inverseProjectionMatrix(){return this.currentTransform.inverseProjectionMatrix}get cameraPosition(){return this.currentTransform.cameraPosition}getProjectionData(t){let a=this._mercatorTransform.getProjectionData(t),p=this._verticalPerspectiveTransform.getProjectionData(t);return{mainMatrix:this.isGlobeRendering?p.mainMatrix:a.mainMatrix,clippingPlane:p.clippingPlane,tileMercatorCoords:p.tileMercatorCoords,projectionTransition:t.applyGlobeMatrix?this._globeness:0,fallbackMatrix:a.fallbackMatrix}}isLocationOccluded(t){return this.currentTransform.isLocationOccluded(t)}transformLightDirection(t){return this.currentTransform.transformLightDirection(t)}getPixelScale(){return o.bt(this._mercatorTransform.getPixelScale(),this._verticalPerspectiveTransform.getPixelScale(),this._globeness)}getCircleRadiusCorrection(){return o.bt(this._mercatorTransform.getCircleRadiusCorrection(),this._verticalPerspectiveTransform.getCircleRadiusCorrection(),this._globeness)}getPitchedTextCorrection(t,a,p){let f=this._mercatorTransform.getPitchedTextCorrection(t,a,p),b=this._verticalPerspectiveTransform.getPitchedTextCorrection(t,a,p);return o.bt(f,b,this._globeness)}projectTileCoordinates(t,a,p,f){return this.currentTransform.projectTileCoordinates(t,a,p,f)}_calcMatrices(){this._helper._width&&this._helper._height&&(this._verticalPerspectiveTransform.apply(this,!1,this._globeLatitudeErrorCorrectionRadians),this._helper._nearZ=this._verticalPerspectiveTransform.nearZ,this._helper._farZ=this._verticalPerspectiveTransform.farZ,this._mercatorTransform.apply(this,!0,this.isGlobeRendering),this._helper._nearZ=this._mercatorTransform.nearZ,this._helper._farZ=this._mercatorTransform.farZ)}calculateFogMatrix(t){return this.currentTransform.calculateFogMatrix(t)}getVisibleUnwrappedCoordinates(t){return this.currentTransform.getVisibleUnwrappedCoordinates(t)}getCameraFrustum(){return this.currentTransform.getCameraFrustum()}getClippingPlane(){return this.currentTransform.getClippingPlane()}getCoveringTilesDetailsProvider(){return this.currentTransform.getCoveringTilesDetailsProvider()}recalculateZoomAndCenter(t){this._mercatorTransform.recalculateZoomAndCenter(t),this._verticalPerspectiveTransform.recalculateZoomAndCenter(t)}maxPitchScaleFactor(){return this._mercatorTransform.maxPitchScaleFactor()}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(t,a){return this.currentTransform.lngLatToCameraDepth(t,a)}populateCache(t){this._mercatorTransform.populateCache(t),this._verticalPerspectiveTransform.populateCache(t)}getBounds(){return this.currentTransform.getBounds()}calculateCenterFromCameraLngLatAlt(t,a,p,f){return this._helper.calculateCenterFromCameraLngLatAlt(t,a,p,f)}setLocationAtPoint(t,a){if(!this.isGlobeRendering)return this._mercatorTransform.setLocationAtPoint(t,a),void this.apply(this._mercatorTransform,!1);this._verticalPerspectiveTransform.setLocationAtPoint(t,a),this.apply(this._verticalPerspectiveTransform,!1)}locationToScreenPoint(t,a){return this.currentTransform.locationToScreenPoint(t,a)}screenPointToMercatorCoordinate(t,a){return this.currentTransform.screenPointToMercatorCoordinate(t,a)}screenPointToLocation(t,a){return this.currentTransform.screenPointToLocation(t,a)}isPointOnMapSurface(t,a){return this.currentTransform.isPointOnMapSurface(t,a)}getRayDirectionFromPixel(t){return this._verticalPerspectiveTransform.getRayDirectionFromPixel(t)}getMatrixForModel(t,a){return this.currentTransform.getMatrixForModel(t,a)}getProjectionDataForCustomLayer(t=!0){let a=this._mercatorTransform.getProjectionDataForCustomLayer(t);if(!this.isGlobeRendering)return a;let p=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(t);return p.fallbackMatrix=a.mainMatrix,p}getFastPathSimpleProjectionMatrix(t){return this.currentTransform.getFastPathSimpleProjectionMatrix(t)}}class ia{get useGlobeControls(){return!0}handlePanInertia(t,a){let p=yr(t,a);return Math.abs(p.lng-a.center.lng)>180&&(p.lng=a.center.lng+179.5*Math.sign(p.lng-a.center.lng)),{easingCenter:p,easingOffset:new o.P(0,0)}}handleMapControlsRollPitchBearingZoom(t,a){let p=t.around,f=a.screenPointToLocation(p);t.bearingDelta&&a.setBearing(a.bearing+t.bearingDelta),t.pitchDelta&&a.setPitch(a.pitch+t.pitchDelta),t.rollDelta&&a.setRoll(a.roll+t.rollDelta);let b=a.zoom;t.zoomDelta&&a.setZoom(a.zoom+t.zoomDelta);let P=a.zoom-b;if(P===0)return;let D=o.bJ(a.center.lng,f.lng),B=D/(Math.abs(D/180)+1),U=o.bJ(a.center.lat,f.lat),$=a.getRayDirectionFromPixel(p),Y=a.cameraPosition,ee=-1*o.b3(Y,$),oe=o.bz();o.a_(oe,Y,[$[0]*ee,$[1]*ee,$[2]*ee]);let _e=o.b5(oe)-1,Ie=Math.exp(.5*-Math.max(_e-.3,0)),ze=lo(a.worldSize,a.center.lat)/Math.min(a.width,a.height),Ee=o.bw(ze,.9,.5,1,.25),De=(1-o.ao(-P))*Math.min(Ie,Ee),je=a.center.lat,Le=a.zoom,we=new o.W(a.center.lng+B*De,o.al(a.center.lat+U*De,-o.am,o.am));a.setLocationAtPoint(f,p);let qe=a.center,Fe=o.bw(Math.abs(D),45,85,0,1),it=o.bw(ze,.75,.35,0,1),ft=Math.pow(Math.max(Fe,it),.25),_t=o.bJ(qe.lng,we.lng),Rt=o.bJ(qe.lat,we.lat);a.setCenter(new o.W(qe.lng+_t*ft,qe.lat+Rt*ft).wrap()),a.setZoom(Le+Hr(je,a.center.lat))}handleMapControlsPan(t,a,p){if(!t.panDelta)return;let f=a.center.lat,b=a.zoom;a.setCenter(yr(t.panDelta,a).wrap()),a.setZoom(b+Hr(f,a.center.lat))}cameraForBoxAndBearing(t,a,p,f,b){let P=zc(t,a,p,f,b),D=a.left/b.width*2-1,B=(b.width-a.right)/b.width*2-1,U=a.top/b.height*-2+1,$=(b.height-a.bottom)/b.height*-2+1,Y=o.bJ(p.getWest(),p.getEast())<0,ee=Y?p.getEast():p.getWest(),oe=Y?p.getWest():p.getEast(),_e=Math.max(p.getNorth(),p.getSouth()),Ie=Math.min(p.getNorth(),p.getSouth()),ze=ee+.5*o.bJ(ee,oe),Ee=_e+.5*o.bJ(_e,Ie),De=b.clone();De.setCenter(P.center),De.setBearing(P.bearing),De.setPitch(0),De.setRoll(0),De.setZoom(P.zoom);let je=De.modelViewProjectionMatrix,Le=[Nn(p.getNorthWest()),Nn(p.getNorthEast()),Nn(p.getSouthWest()),Nn(p.getSouthEast()),Nn(new o.W(oe,Ee)),Nn(new o.W(ee,Ee)),Nn(new o.W(ze,_e)),Nn(new o.W(ze,Ie))],we=Nn(P.center),qe=Number.POSITIVE_INFINITY;for(let Fe of Le)D<0&&(qe=ia.getLesserNonNegativeNonNull(qe,ia.solveVectorScale(Fe,we,je,"x",D))),B>0&&(qe=ia.getLesserNonNegativeNonNull(qe,ia.solveVectorScale(Fe,we,je,"x",B))),U>0&&(qe=ia.getLesserNonNegativeNonNull(qe,ia.solveVectorScale(Fe,we,je,"y",U))),$<0&&(qe=ia.getLesserNonNegativeNonNull(qe,ia.solveVectorScale(Fe,we,je,"y",$)));if(Number.isFinite(qe)&&qe!==0)return P.zoom=Math.min(De.zoom+o.ar(qe),t.maxZoom),P;ja()}handleJumpToCenterZoom(t,a){let p=t.center.lat,f=t.applyConstrain(a.center?o.W.convert(a.center):t.center,t.zoom).center;t.setCenter(f.wrap());let b=a.zoom!==void 0?+a.zoom:t.zoom+Hr(p,f.lat);t.zoom!==b&&t.setZoom(b)}handleEaseTo(t,a){let p=t.zoom,f=t.center,b=t.padding,P={roll:t.roll,pitch:t.pitch,bearing:t.bearing},D={roll:a.roll===void 0?t.roll:a.roll,pitch:a.pitch===void 0?t.pitch:a.pitch,bearing:a.bearing===void 0?t.bearing:a.bearing},B=a.zoom!==void 0,U=!t.isPaddingEqual(a.padding),$=!1,Y=a.center?o.W.convert(a.center):f,ee=t.applyConstrain(Y,p).center;wa(t,ee);let oe=t.clone();oe.setCenter(ee),oe.setZoom(B?+a.zoom:p+Hr(f.lat,Y.lat)),oe.setBearing(a.bearing);let _e=new o.P(o.al(t.centerPoint.x+a.offsetAsPoint.x,0,t.width),o.al(t.centerPoint.y+a.offsetAsPoint.y,0,t.height));oe.setLocationAtPoint(ee,_e);let Ie=(a.offset&&a.offsetAsPoint.mag())>0?oe.center:ee,ze=B?+a.zoom:p+Hr(f.lat,Ie.lat),Ee=p+Hr(f.lat,0),De=ze+Hr(Ie.lat,0),je=o.bJ(f.lng,Ie.lng),Le=o.bJ(f.lat,Ie.lat),we=o.ao(De-Ee);return $=ze!==p,{easeFunc:qe=>{if(o.bn(P,D)||Ac({startEulerAngles:P,endEulerAngles:D,tr:t,k:qe,useSlerp:P.roll!=D.roll}),U&&t.interpolatePadding(b,a.padding,qe),a.around)o.w("Easing around a point is not supported under globe projection."),t.setLocationAtPoint(a.around,a.aroundPoint);else{let Fe=De>Ee?Math.min(2,we):Math.max(.5,we),it=Math.pow(Fe,1-qe),ft=nr(f,je,Le,qe*it);t.setCenter(ft.wrap())}if($){let Fe=o.H.number(Ee,De,qe)+Hr(0,t.center.lat);t.setZoom(Fe)}},isZooming:$,elevationCenter:Ie}}handleFlyTo(t,a){let p=a.zoom!==void 0,f=t.center,b=t.zoom,P=t.padding,D=!t.isPaddingEqual(a.padding),B=t.applyConstrain(o.W.convert(a.center||a.locationAtOffset),b).center,U=p?+a.zoom:t.zoom+Hr(t.center.lat,B.lat),$=t.clone();$.setCenter(B),$.setZoom(U),$.setBearing(a.bearing);let Y=new o.P(o.al(t.centerPoint.x+a.offsetAsPoint.x,0,t.width),o.al(t.centerPoint.y+a.offsetAsPoint.y,0,t.height));$.setLocationAtPoint(B,Y);let ee=$.center;wa(t,ee);let oe=(function(Le,we,qe){let Fe=Nn(we),it=Nn(qe),ft=o.b3(Fe,it),_t=Math.acos(ft),Rt=El(Le);return _t/(2*Math.PI)*Rt})(t,f,ee),_e=b+Hr(f.lat,0),Ie=U+Hr(ee.lat,0),ze=o.ao(Ie-_e),Ee;if(typeof a.minZoom=="number"){let Le=+a.minZoom+Hr(ee.lat,0),we=Math.min(Le,_e,Ie)+Hr(0,ee.lat),qe=t.applyConstrain(ee,we).zoom+Hr(ee.lat,0);Ee=o.ao(qe-_e)}let De=o.bJ(f.lng,ee.lng),je=o.bJ(f.lat,ee.lat);return{easeFunc:(Le,we,qe,Fe)=>{let it=nr(f,De,je,qe);D&&t.interpolatePadding(P,a.padding,Le);let ft=Le===1?ee:it;t.setCenter(ft.wrap());let _t=_e+o.ar(we);t.setZoom(Le===1?U:_t+Hr(0,ft.lat))},scaleOfZoom:ze,targetCenter:ee,scaleOfMinZoom:Ee,pixelPathLength:oe}}static solveVectorScale(t,a,p,f,b){let P=f==="x"?[p[0],p[4],p[8],p[12]]:[p[1],p[5],p[9],p[13]],D=[p[3],p[7],p[11],p[15]],B=t[0]*P[0]+t[1]*P[1]+t[2]*P[2],U=t[0]*D[0]+t[1]*D[1]+t[2]*D[2],$=a[0]*P[0]+a[1]*P[1]+a[2]*P[2],Y=a[0]*D[0]+a[1]*D[1]+a[2]*D[2];return $+b*U===B+b*Y||D[3]*(B-$)+P[3]*(Y-U)+B*Y==$*U?null:($+P[3]-b*Y-b*D[3])/($-B-b*Y+b*U)}static getLesserNonNegativeNonNull(t,a){return a!==null&&a>=0&&a<t?a:t}}class Oo{constructor(t){this._globe=t,this._mercatorCameraHelper=new Ps,this._verticalPerspectiveCameraHelper=new ia}get useGlobeControls(){return this._globe.useGlobeRendering}get currentHelper(){return this.useGlobeControls?this._verticalPerspectiveCameraHelper:this._mercatorCameraHelper}handlePanInertia(t,a){return this.currentHelper.handlePanInertia(t,a)}handleMapControlsRollPitchBearingZoom(t,a){this.currentHelper.handleMapControlsRollPitchBearingZoom(t,a)}
796handleMapControlsPan(t,a,p){this.currentHelper.handleMapControlsPan(t,a,p)}cameraForBoxAndBearing(t,a,p,f,b){return this.currentHelper.cameraForBoxAndBearing(t,a,p,f,b)}handleJumpToCenterZoom(t,a){this.currentHelper.handleJumpToCenterZoom(t,a)}handleEaseTo(t,a){return this.currentHelper.handleEaseTo(t,a)}handleFlyTo(t,a){return this.currentHelper.handleFlyTo(t,a)}}let Qs=(_,t)=>o.C(_,t?.filter((a=>a.identifier!=="source.canvas"))),Al=o.bN();class Ga extends o.E{constructor(t,a={}){var p,f;super(),this._rtlPluginLoaded=()=>{for(let P in this.tileManagers){let D=this.tileManagers[P].getSource().type;D!=="vector"&&D!=="geojson"||this.tileManagers[P].reload()}},this.map=t,this.dispatcher=new zo(yn(),t._getMapId()),this.dispatcher.registerMessageHandler("GG",((P,D)=>this.getGlyphs(P,D))),this.dispatcher.registerMessageHandler("GI",((P,D)=>this.getImages(P,D))),this.dispatcher.registerMessageHandler("GDA",((P,D)=>this.getDashes(P,D))),this.imageManager=new wi,this.imageManager.setEventedParent(this);let b=((p=t._container)===null||p===void 0?void 0:p.lang)||typeof document<"u"&&((f=document.documentElement)===null||f===void 0?void 0:f.lang)||void 0;this.glyphManager=new jt(t._requestManager,a.localIdeographFontFamily,b),this.lineAtlas=new pi(256,512),this.crossTileSymbolIndex=new Fo,this._setInitialValues(),this._resetUpdates(),this.dispatcher.broadcast("SR",o.bO()),Bn().on(Ua,this._rtlPluginLoaded),this.on("data",(P=>{if(P.dataType!=="source"||P.sourceDataType!=="metadata")return;let D=this.tileManagers[P.sourceId];if(!D)return;let B=D.getSource();if(B?.vectorLayerIds)for(let U in this._layers){let $=this._layers[U];$.source===B.id&&this._validateLayer($)}}))}_setInitialValues(){var t;this._spritesImagesIds={},this._layers={},this._order=[],this.tileManagers={},this.zoomHistory=new o.bP,this._availableImages=[],this._globalState={},this._serializedLayers={},this.stylesheet=null,this.light=null,this.sky=null,this.projection&&(this.projection.destroy(),delete this.projection),this._loaded=!1,this._changed=!1,this._updatedLayers={},this._updatedSources={},this._changedImages={},this._glyphsDidChange=!1,this._updatedPaintProps={},this._layerOrderChanged=!1,this.crossTileSymbolIndex=new(((t=this.crossTileSymbolIndex)===null||t===void 0?void 0:t.constructor)||Object),this.pauseablePlacement=void 0,this.placement=void 0,this.z=0}setGlobalStateProperty(t,a){var p,f,b;this._checkLoaded();let P=a===null?(b=(f=(p=this.stylesheet.state)===null||p===void 0?void 0:p[t])===null||f===void 0?void 0:f.default)!==null&&b!==void 0?b:null:a;if(o.bQ(P,this._globalState[t]))return this;this._globalState[t]=P,this._applyGlobalStateChanges([t])}getGlobalState(){return this._globalState}setGlobalState(t){this._checkLoaded();let a=[];for(let p in t)!o.bQ(this._globalState[p],t[p].default)&&(a.push(p),this._globalState[p]=t[p].default);this._applyGlobalStateChanges(a)}_applyGlobalStateChanges(t){if(t.length===0)return;let a=new Set,p={};for(let f of t){p[f]=this._globalState[f];for(let b in this._layers){let P=this._layers[b],D=P.getLayoutAffectingGlobalStateRefs(),B=P.getPaintAffectingGlobalStateRefs(),U=P.getVisibilityAffectingGlobalStateRefs();if(D.has(f)&&a.add(P.source),B.has(f))for(let{name:$,value:Y}of B.get(f))this._updatePaintProperty(P,$,Y);U?.has(f)&&(P.recalculateVisibility(),this._updateLayer(P))}}this.dispatcher.broadcast("UGS",p);for(let f in this.tileManagers)a.has(f)&&(this._reloadSource(f),this._changed=!0)}loadURL(t){return o._(this,arguments,void 0,(function*(a,p={},f){this.fire(new o.n("dataloading",{dataType:"style"})),p.validate=typeof p.validate!="boolean"||p.validate,this._loadStyleRequest=new AbortController;let b=this._loadStyleRequest;try{let P=yield this.map._requestManager.transformRequest(a,"Style");o.bR(b.signal);let D=yield o.k(P,b);this._loadStyleRequest===b&&(this._loadStyleRequest=null),this._load(D.data,p,f)}catch(P){this._loadStyleRequest===b&&(this._loadStyleRequest=null),P&&!b.signal.aborted&&this.fire(new o.l(o.d(P)))}}))}loadJSON(t,a={},p){this.fire(new o.n("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,Bt.frameAsync(this._frameRequest,this.map._ownerWindow).then((()=>{this._frameRequest=null,a.validate=a.validate!==!1,this._load(t,a,p)})).catch((()=>{}))}loadEmpty(){this.fire(new o.n("dataloading",{dataType:"style"})),this._load(Al,{validate:!1})}_load(t,a,p){var f,b;let P=a.transformStyle?a.transformStyle(p,t):t;
796if(!a.validate||!Qs(this,o.F(P))){P=Object.assign({},P),this._loaded=!0,this.stylesheet=P;for(let D in P.sources)this.addSource(D,P.sources[D],{validate:!1});P.sprite?this._loadSprite(P.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(P.glyphs),this._createLayers(),this.light=new Nt(this.stylesheet.light),this._setProjectionInternal(((f=this.stylesheet.projection)===null||f===void 0?void 0:f.type)||"mercator"),this.sky=new Li(this.stylesheet.sky),this.map.setTerrain((b=this.stylesheet.terrain)!==null&&b!==void 0?b:null),this.fire(new o.n("data",{dataType:"style"})),this.fire(new o.n("style.load"))}}_createLayers(){var t,a,p;let f=o.bS(this.stylesheet.layers);this.setGlobalState((t=this.stylesheet.state)!==null&&t!==void 0?t:null),this.dispatcher.broadcast("SL",f),this._order=f.map((b=>b.id)),this._layers={},this._serializedLayers=null;for(let b of f){let P=o.bT(b,this._globalState);if(P.setEventedParent(this,{layer:{id:b.id}}),this._layers[b.id]=P,o.bU(P)&&this.tileManagers[P.source]){let D=(p=(a=b.paint)===null||a===void 0?void 0:a["raster-fade-duration"])!==null&&p!==void 0?p:P.paint.get("raster-fade-duration");this.tileManagers[P.source].setRasterFadeDuration(D)}}}_loadSprite(t,a=!1,p=void 0){this.imageManager.setLoaded(!1);let f=new AbortController,b;this._spriteRequest=f,(function(P,D,B,U){return o._(this,void 0,void 0,(function*(){let $=Mi(P),Y=B>1?"@2x":"",ee={},oe={};for(let{id:_e,url:Ie}of $){let ze=yield D.transformRequest(li(Ie,Y,".json"),"SpriteJSON");ee[_e]=o.k(ze,U);let Ee=yield D.transformRequest(li(Ie,Y,".png"),"SpriteImage");oe[_e]=At.getImage(Ee,U)}return yield Promise.all([...Object.values(ee),...Object.values(oe)]),(function(_e,Ie){return o._(this,void 0,void 0,(function*(){let ze={};for(let Ee in _e){ze[Ee]={};let De=Bt.getImageCanvasContext((yield Ie[Ee]).data),je=(yield _e[Ee]).data;for(let Le in je){let{width:we,height:qe,x:Fe,y:it,sdf:ft,pixelRatio:_t,stretchX:Rt,stretchY:Dt,content:_i,textFitWidth:Gt,textFitHeight:Et}=je[Le];ze[Ee][Le]={data:null,pixelRatio:_t,sdf:ft,stretchX:Rt,stretchY:Dt,content:_i,textFitWidth:Gt,textFitHeight:Et,spriteData:{width:we,height:qe,x:Fe,y:it,context:De}}}}return ze}))})(ee,oe)}))})(t,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then((P=>{if(this._spriteRequest=null,P)for(let D in P){this._spritesImagesIds[D]=[];let B=this._spritesImagesIds[D]?this._spritesImagesIds[D].filter((U=>!(U in P))):[];for(let U of B)this.imageManager.removeImage(U),this._changedImages[U]=!0;for(let U in P[D]){let $=D==="default"?U:`${D}:${U}`;this._spritesImagesIds[D].push($),$ in this.imageManager.images?this.imageManager.updateImage($,P[D][U],!1):this.imageManager.addImage($,P[D][U]),a&&(this._changedImages[$]=!0)}}})).catch((P=>{this._spriteRequest=null,b=P,f.signal.aborted||this.fire(new o.l(b))})).finally((()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),a&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new o.n("data",{dataType:"style"})),p&&p(b)}))}_unloadSprite(){for(let t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new o.n("data",{dataType:"style"}))}_validateLayer(t){let a=this.tileManagers[t.source];if(!a)return;let p=t.sourceLayer;if(!p)return;let f=a.getSource();(f.type==="geojson"||f.vectorLayerIds&&!f.vectorLayerIds.includes(p))&&this.fire(new o.l(new Error(`Source layer "${p}" does not exist on source "${f.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let t in this.tileManagers)if(!this.tileManagers[t].loaded())return!1;return this.imageManager.isLoaded()}_serializeByIds(t,a=!1){let p=this._serializedAllLayers();if(!t||t.length===0)return Object.values(a?o.bV(p):p);let f=[];for(let b of t)if(p[b]){let P=a?o.bV(p[b]):p[b];f.push(P)}return f}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};let a=Object.keys(this._layers);for(let p of a){let f=this._layers[p];f.type!=="custom"&&(t[p]=f.serialize())}return t}hasTransitions(){var t,a,p;if(!((t=this.light)===null||t===void 0)&&t.hasTransition()||!((a=this.sky)===null||a===void 0)&&a.hasTransition()||!((p=this.projection)===null||p===void 0)&&p.hasTransition())return!0;for(let f in this.tileManagers)if(this.tileManagers[f].hasTransition())return!0;for(let f in this._layers)if(this._layers[f].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;let a=this._changed;if(a){let f=Object.keys(this._updatedLayers),b=Object.keys(this._removedLayers);(f.length||b.length)&&this._updateWorkerLayers(f,b);for(let P in this._updatedSources){let D=this._updatedSources[P];if(D==="reload")this._reloadSource(P);else{if(D!=="clear")throw new Error(`Invalid action ${D}`);this._clearSource(P)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let P in this._updatedPaintProps)this._layers[P].updateTransitions(t);this.light.updateTransitions(t),this.sky.updateTransitions(t),this._resetUpdates()}let p={};for(let f in this.tileManagers){let b=this.tileManagers[f];p[f]=b.used,b.used=!1}for(let f of this._order){let b=this._layers[f];b.recalculate(t,this._availableImages),!b.isHidden(t.zoom)&&b.source&&(this.tileManagers[b.source].used=!0)}for(let f in p){let b=this.tileManagers[f];!!p[f]!=!!b.used&&b.fire(new o.n("data",{sourceDataType:"visibility",dataType:"source",sourceId:f}))}this.light.recalculate(t),this.sky.recalculate(t),this.projection.recalculate(t),this.z=t.zoom,a&&this.fire(new o.n("data",{dataType:"style"}))}_updateTilesForChangedImages(){let t=Object.keys(this._changedImages);if(t.length){for(let a in this.tileManagers)this.tileManagers[a].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let t in this.tileManagers)this.tileManagers[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,a){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(t,!1),removedIds:a})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,a={}){var p;this._checkLoaded();let f=this.serialize();if(t=a.transformStyle?a.transformStyle(f,t):t,((p=a.validate)===null||p===void 0||p)&&Qs(this,o.F(t)))return!1;(t=o.bV(t)).layers=o.bS(t.layers);let b=o.bW(f,t),P=this._getOperationsToPerform(b);if(P.unimplemented.length>0)throw new Error(`Unimplemented: ${P.unimplemented.join(", ")}.`);
vendor: 1,631 bytes, line 796
796if(P.operations.length===0)return!1;for(let D of P.operations)D();return this.stylesheet=t,this._serializedLayers=null,this.fire(new o.n("style.load",{style:this})),!0}_getOperationsToPerform(t){let a=[],p=[];for(let f of t)switch(f.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":case"setRoll":continue;case"addLayer":a.push((()=>this.addLayer.apply(this,f.args)));break;case"removeLayer":a.push((()=>this.removeLayer.apply(this,f.args)));break;case"setPaintProperty":a.push((()=>this.setPaintProperty.apply(this,f.args)));break;case"setLayoutProperty":a.push((()=>this.setLayoutProperty.apply(this,f.args)));break;case"setFilter":a.push((()=>this.setFilter.apply(this,f.args)));break;case"addSource":a.push((()=>this.addSource.apply(this,f.args)));break;case"removeSource":a.push((()=>this.removeSource.apply(this,f.args)));break;case"setLayerZoomRange":a.push((()=>this.setLayerZoomRange.apply(this,f.args)));break;case"setLight":a.push((()=>this.setLight.apply(this,f.args)));break;case"setGeoJSONSourceData":a.push((()=>this.setGeoJSONSourceData.apply(this,f.args)));break;case"setGlyphs":a.push((()=>this.setGlyphs.apply(this,f.args)));break;case"setSprite":a.push((()=>this.setSprite.apply(this,f.args)));break;case"setTerrain":a.push((()=>this.map.setTerrain.apply(this,f.args)));break;case"setSky":a.push((()=>this.setSky.apply(this,f.args)));break;case"setProjection":this.setProjection.apply(this,f.args);break;case"setGlobalState":a.push((()=>this.setGlobalState.apply(this,f.args)));break;case"setTransition":a.push((()=>{}));break;default:p.push(f.command)}return{operations:a,unimplemented:p}}
796addImage(t,a){if(this.getImage(t))return this.fire(new o.l(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,a),this._afterImageUpdated(t)}updateImage(t,a){this.imageManager.updateImage(t,a)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new o.l(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new o.n("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,a,p={}){var f;if(this._checkLoaded(),this.tileManagers[t]!==void 0)throw new Error(`Source "${t}" already exists.`);if(!a.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(a).join(", ")}.`);if(["vector","raster","geojson","video","image"].includes(a.type)&&this._validate(o.F.source,`sources.${t}`,a,null,p))return;!((f=this.map)===null||f===void 0)&&f._collectResourceTiming&&(a.collectResourceTiming=!0);let b=this.tileManagers[t]=new ve(t,a,this.dispatcher);b.style=this,b.setEventedParent(this,(()=>({isSourceLoaded:b.loaded(),source:b.serialize(),sourceId:t}))),b.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),this.tileManagers[t]===void 0)throw new Error(`There is no source with this ID=${t}`);for(let p in this._layers)if(this._layers[p].source===t)return this.fire(new o.l(new Error(`Source "${t}" cannot be removed while layer "${p}" is using it.`)));let a=this.tileManagers[t];delete this.tileManagers[t],delete this._updatedSources[t],a.fire(new o.n("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),a.setEventedParent(null),a.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,a){if(this._checkLoaded(),this.tileManagers[t]===void 0)throw new Error(`There is no source with this ID=${t}`);let p=this.tileManagers[t].getSource();if(p.type!=="geojson")throw new Error(`geojsonSource.type is ${p.type}, which is !== 'geojson`);p.setData(a),this._changed=!0}getSource(t){var a;return(a=this.tileManagers[t])===null||a===void 0?void 0:a.getSource()}addLayer(t,a,p={}){this._checkLoaded();let f=t.id;if(this.getLayer(f))return void this.fire(new o.l(new Error(`Layer "${f}" already exists on this map.`)));let b;if(t.type==="custom"){if(Qs(this,o.bX(t)))return;b=o.bT(t,this._globalState)}else{if("source"in t&&typeof t.source=="object"&&(this.addSource(f,t.source),t=o.bV(t),t=o.e(t,{source:f})),this._validate(o.F.layer,`layers.${f}`,t,{arrayIndex:-1},p))return;b=o.bT(t,this._globalState),this._validateLayer(b),b.setEventedParent(this,{layer:{id:f}})}let P=a?this._order.indexOf(a):this._order.length;if(a&&P===-1)this.fire(new o.l(new Error(`Cannot add layer "${f}" before non-existing layer "${a}".`)));else{if(this._order.splice(P,0,f),this._layerOrderChanged=!0,this._layers[f]=b,this._removedLayers[f]&&b.source&&b.type!=="custom"){let D=this._removedLayers[f];delete this._removedLayers[f],D.type!==b.type?this._updatedSources[b.source]="clear":(this._updatedSources[b.source]="reload",this.tileManagers[b.source].pause())}this._updateLayer(b),b.onAdd&&b.onAdd(this.map)}}moveLayer(t,a){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new o.l(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===a)return;let p=this._order.indexOf(t);this._order.splice(p,1);let f=a?this._order.indexOf(a):this._order.length;a&&f===-1?this.fire(new o.l(new Error(`Cannot move layer "${t}" before non-existing layer "${a}".`))):(this._order.splice(f,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();let a=this._layers[t];if(!a)return void this.fire(new o.l(new Error(`Cannot remove non-existing layer "${t}".`)));a.setEventedParent(null);let p=this._order.indexOf(t);this._order.splice(p,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=a,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],a.onRemove&&a.onRemove(this.map)}getLayer(t){return this._layers[t]}
796getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,a,p){this._checkLoaded();let f=this.getLayer(t);f?f.minzoom===a&&f.maxzoom===p||(a!=null&&(f.minzoom=a),p!=null&&(f.maxzoom=p),this._updateLayer(f)):this.fire(new o.l(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,a,p={}){this._checkLoaded();let f=this.getLayer(t);if(f){if(!o.bQ(f.filter,a))return a==null?(f.setFilter(void 0),void this._updateLayer(f)):void(this._validate(o.F.filter,`layers.${f.id}.filter`,a,null,p)||(f.setFilter(o.bV(a)),this._updateLayer(f)))}else this.fire(new o.l(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return o.bV(this.getLayer(t).filter)}setLayoutProperty(t,a,p,f={}){this._checkLoaded();let b=this.getLayer(t);b?o.bQ(b.getLayoutProperty(a),p)||(b.setLayoutProperty(a,p,f),this._updateLayer(b)):this.fire(new o.l(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,a){let p=this.getLayer(t);if(p)return p.getLayoutProperty(a);this.fire(new o.l(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,a,p,f={}){this._checkLoaded();let b=this.getLayer(t);b?o.bQ(b.getPaintProperty(a),p)||this._updatePaintProperty(b,a,p,f):this.fire(new o.l(new Error(`Cannot style non-existing layer "${t}".`)))}_updatePaintProperty(t,a,p,f={}){t.setPaintProperty(a,p,f)&&this._updateLayer(t),o.bU(t)&&a==="raster-fade-duration"&&this.tileManagers[t.source].setRasterFadeDuration(p),this._changed=!0,this._updatedPaintProps[t.id]=!0,this._serializedLayers=null}getPaintProperty(t,a){return this.getLayer(t).getPaintProperty(a)}setFeatureState(t,a){this._checkLoaded();let p=t.source,f=t.sourceLayer,b=this.tileManagers[p];if(b===void 0)return void this.fire(new o.l(new Error(`The source '${p}' does not exist in the map's style.`)));let P=b.getSource().type;P==="geojson"&&f?this.fire(new o.l(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):P!=="vector"||f?(t.id===void 0&&this.fire(new o.l(new Error("The feature id parameter must be provided."))),b.setFeatureState(f,t.id,a)):this.fire(new o.l(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,a){this._checkLoaded();let p=t.source,f=this.tileManagers[p];if(f===void 0)return void this.fire(new o.l(new Error(`The source '${p}' does not exist in the map's style.`)));let b=f.getSource().type,P=b==="vector"?t.sourceLayer:void 0;b!=="vector"||P?a&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new o.l(new Error("A feature id is required to remove its specific state property."))):f.removeFeatureState(P,t.id,a):this.fire(new o.l(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();let a=t.source,p=t.sourceLayer,f=this.tileManagers[a];if(f!==void 0)return f.getSource().type!=="vector"||p?(t.id===void 0&&this.fire(new o.l(new Error("The feature id parameter must be provided."))),f.getFeatureState(p,t.id)):void this.fire(new o.l(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new o.l(new Error(`The source '${a}' does not exist in the map's style.`)))}getTransition(){var t;return o.e({duration:300,delay:0},(t=this.stylesheet)===null||t===void 0?void 0:t.transition)}serialize(){if(!this._loaded)return;let t=o.bY(this.tileManagers,(b=>b.serialize())),a=this._serializeByIds(this._order,!0),p=this.map.getTerrain()||void 0,f=this.stylesheet;return o.bZ({version:f.version,name:f.name,metadata:f.metadata,light:f.light,sky:f.sky,center:f.center,zoom:f.zoom,bearing:f.bearing,pitch:f.pitch,sprite:f.sprite,glyphs:f.glyphs,transition:f.transition,projection:f.projection,sources:t,layers:a,terrain:p},(b=>b!==void 0))}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&this.tileManagers[t.source].getSource().type!=="raster"&&(this._updatedSources[t.source]="reload",this.tileManagers[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){let a=P=>this._layers[P].type==="fill-extrusion",p={},f=[];for(let P=this._order.length-1;P>=0;P--){let D=this._order[P];if(a(D)){p[D]=P;for(let B of t){let U=B[D];if(U)for(let $ of U)f.push($)}}}f.sort(((P,D)=>D.intersectionZ-P.intersectionZ));let b=[];for(let P=this._order.length-1;P>=0;P--){let D=this._order[P];if(a(D))for(let B=f.length-1;B>=0;B--){let U=f[B].feature;if(p[U.layer.id]<P)break;b.push(U),f.pop()}else for(let B of t){let U=B[D];if(U)for(let $ of U)b.push($.feature)}}return b}
vendor: 12,302 bytes, line 796
796queryRenderedFeatures(t,a,p){a?.filter&&this._validate(o.F.filter,"queryRenderedFeatures.filter",a.filter,null,a);let f={};if(a?.layers){if(!(Array.isArray(a.layers)||a.layers instanceof Set))return this.fire(new o.l(new Error("parameters.layers must be an Array or a Set of strings"))),[];for(let U of a.layers){let $=this._layers[U];if(!$)return this.fire(new o.l(new Error(`The layer '${U}' does not exist in the map's style and cannot be queried for features.`))),[];f[$.source]=!0}}let b=[];a.availableImages=this._availableImages;let P=this._serializedAllLayers(),D=a.layers instanceof Set?a.layers:Array.isArray(a.layers)?new Set(a.layers):null,B=Object.assign(Object.assign({},a),{layers:D,globalState:this._globalState});for(let U in this.tileManagers)a.layers&&!f[U]||b.push(Dr(this.tileManagers[U],this._layers,P,t,B,p,this.map.terrain?($,Y,ee)=>this.map.terrain.getElevation($,Y,ee):void 0));return this.placement&&b.push((function(U,$,Y,ee,oe,_e,Ie){let ze={},Ee=_e.queryRenderedSymbols(ee),De=[];for(let je of Object.keys(Ee).map(Number))De.push(Ie[je]);De.sort(fa);for(let je of De){let Le=je.featureIndex.lookupSymbolFeatures(Ee[je.bucketInstanceId],$,je.bucketIndex,je.sourceLayerIndex,{filterSpec:oe.filter,globalState:oe.globalState},oe.layers,oe.availableImages,U);for(let we in Le){ze[we]||(ze[we]=[]);let qe=Le[we];qe.sort(((Fe,it)=>{let ft=je.featureSortOrder;if(ft){let _t=ft.indexOf(Fe.featureIndex);return ft.indexOf(it.featureIndex)-_t}return it.featureIndex-Fe.featureIndex}));for(let Fe of qe)ze[we].push(Fe)}}return(function(je,Le,we){for(let qe in je)for(let Fe of je[qe])Do(Fe,we[Le[qe].source]);return je})(ze,U,Y)})(this._layers,P,this.tileManagers,t,B,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(b)}querySourceFeatures(t,a){a?.filter&&this._validate(o.F.filter,"querySourceFeatures.filter",a.filter,null,a);let p=this.tileManagers[t];return p?(function(f,b){let P=f.getRenderableIds().map((U=>f.getTileByID(U))),D=[],B={};for(let U of P){let $=U.tileID.canonical.key;B[$]||(B[$]=!0,U.querySourceFeatures(D,b))}return D})(p,a?Object.assign(Object.assign({},a),{globalState:this._globalState}):{globalState:this._globalState}):[]}getLight(){return this.light.getLight()}setLight(t,a={}){this._checkLoaded();let p=this.light.getLight(),f=!1;for(let P in t)if(!o.bQ(t[P],p[P])){f=!0;break}if(!f)return;let b={now:Mt(),transition:o.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,a),this.light.updateTransitions(b)}getProjection(){var t;return(t=this.stylesheet)===null||t===void 0?void 0:t.projection}setProjection(t){this._checkLoaded();let a=t??{type:"mercator"};if(this.stylesheet.projection=t,this.projection){if(this.projection.name===a.type)return;this.projection.destroy(),delete this.projection}this._setProjectionInternal(a.type)}getSky(){var t;return(t=this.stylesheet)===null||t===void 0?void 0:t.sky}setSky(t,a={}){this._checkLoaded();let p=this.getSky(),f=!1;if(!t&&!p)return;if(t&&!p)f=!0;else if(!t&&p)f=!0;else for(let P in t)if(!o.bQ(t[P],p[P])){f=!0;break}if(!f)return;let b={now:Mt(),transition:o.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=t,this.sky.setSky(t,a),this.sky.updateTransitions(b)}_setProjectionInternal(t){let a=(function(p,f){let b={constrainOverride:f};if(Array.isArray(p)){let P=new fh({type:p});return{projection:P,transform:new kl(b),cameraHelper:new Oo(P)}}switch(p){case"mercator":return{projection:new bo,transform:new Ms(b),cameraHelper:new Ps};case"globe":{let P=new fh({type:["interpolate",["linear"],["zoom"],11,"vertical-perspective",12,"mercator"]});return{projection:P,transform:new kl(b),cameraHelper:new Oo(P)}}case"vertical-perspective":return{projection:new Cl,transform:new Pl(b),cameraHelper:new ia};default:return o.w(`Unknown projection name: ${p}. Falling back to mercator projection.`),{projection:new bo,transform:new Ms(b),cameraHelper:new Ps}}})(t,this.map.transformConstrain);this.projection=a.projection,this.map.migrateProjection(a.transform,a.cameraHelper);for(let p in this.tileManagers)this.tileManagers[p].reload()}_validate(t,a,p,f,b={}){return b?.validate!==!1&&Qs(this,t.call(o.F,o.e({key:a,style:this.serialize(),value:p,styleSpec:o.x},f)))}_remove(t=!0){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),Bn().off(Ua,this._rtlPluginLoaded);for(let a in this._layers)this._layers[a].setEventedParent(null);for(let a in this.tileManagers){let p=this.tileManagers[a];p.setEventedParent(null),p.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),t&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(t)}_clearSource(t){this.tileManagers[t].clearTiles()}_reloadSource(t){this.tileManagers[t].resume(),this.tileManagers[t].reload()}_updateSources(t){for(let a in this.tileManagers)this.tileManagers[a].update(t,this.map.terrain)}_generateCollisionBoxes(){for(let t in this.tileManagers)this._reloadSource(t)}_updatePlacement(t,a,p,f,b=!1){let P=!1,D=!1,B={};for(let U of this._order){let $=this._layers[U];if($.type!=="symbol")continue;if(!B[$.source]){let ee=this.tileManagers[$.source];B[$.source]=ee.getRenderableIds(!0).map((oe=>ee.getTileByID(oe))).sort(((oe,_e)=>_e.tileID.overscaledZ-oe.tileID.overscaledZ||(oe.tileID.isLessThan(_e.tileID)?-1:1)))}let Y=this.crossTileSymbolIndex.addLayer($,B[$.source],t.center.lng);P||(P=Y)}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),b||(b=this._layerOrderChanged||p===0),(b||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(Mt(),t.zoom))&&(this.pauseablePlacement=new wl(t,this.map.terrain,this._order,b,a,p,f,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,B),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(Mt()),D=!0),P&&this.pauseablePlacement.placement.setStale()),D||P)for(let U of this._order){let $=this._layers[U];$.type==="symbol"&&this.placement.updateLayerOpacities($,B[$.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(Mt())}_releaseSymbolFadeTiles(){for(let t in this.tileManagers)this.tileManagers[t].releaseSymbolFadeTiles()}getImages(t,a){return o._(this,void 0,void 0,(function*(){let p=yield this.imageManager.getImages(a.icons);this._updateTilesForChangedImages();let f=this.tileManagers[a.source];return f&&f.setDependencies(a.tileID.key,a.type,a.icons),p}))}getGlyphs(t,a){return o._(this,void 0,void 0,(function*(){let p=yield this.glyphManager.getGlyphs(a.stacks),f=this.tileManagers[a.source];return f&&f.setDependencies(a.tileID.key,a.type,[""]),p}))}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,a={}){this._checkLoaded(),t&&this._validate(o.F.glyphs,"glyphs",t,null,a)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}getDashes(t,a){return o._(this,void 0,void 0,(function*(){let p={};for(let[f,b]of Object.entries(a.dashes))p[f]=this.lineAtlas.getDash(b.dasharray,b.round);return p}))}addSprite(t,a,p={},f){this._checkLoaded();let b=[{id:t,url:a}],P=[...Mi(this.stylesheet.sprite),...b];this._validate(o.F.sprite,"sprite",P,null,p)||(this.stylesheet.sprite=P,this._loadSprite(b,!0,f))}removeSprite(t){this._checkLoaded();let a=Mi(this.stylesheet.sprite);if(a.find((p=>p.id===t))){if(this._spritesImagesIds[t])for(let p of this._spritesImagesIds[t])this.imageManager.removeImage(p),this._changedImages[p]=!0;a.splice(a.findIndex((p=>p.id===t)),1),this.stylesheet.sprite=a.length>0?a:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new o.n("data",{dataType:"style"}))}else this.fire(new o.l(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return Mi(this.stylesheet.sprite)}setSprite(t,a={},p){this._checkLoaded(),t&&this._validate(o.F.sprite,"sprite",t,null,a)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,p):(this._unloadSprite(),p&&p(null)))}destroy(){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null);for(let t in this.tileManagers){let a=this.tileManagers[t];a.setEventedParent(null),a.onRemove(this.map)}this.tileManagers={},this.imageManager&&(this.imageManager.setEventedParent(null),this.imageManager.destroy(),this._availableImages=[],this._spritesImagesIds={}),this.glyphManager&&this.glyphManager.destroy();for(let t in this._layers){let a=this._layers[t];a.setEventedParent(null),a.onRemove&&a.onRemove(this.map)}this._setInitialValues(),this.setEventedParent(null),this.dispatcher.unregisterMessageHandler("GG"),this.dispatcher.unregisterMessageHandler("GI"),this.dispatcher.unregisterMessageHandler("GDA"),this.dispatcher.remove(!0),this._listeners={},this._oneTimeListeners={}}}var zl=o.aS([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Su{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,a,p,f,b,P,D,B,U){this.context=t;let $=this.boundPaintVertexBuffers.length!==f.length;for(let Y=0;!$&&Y<f.length;Y++)this.boundPaintVertexBuffers[Y]!==f[Y]&&($=!0);!this.vao||this.boundProgram!==a||this.boundLayoutVertexBuffer!==p||$||this.boundIndexBuffer!==b||this.boundVertexOffset!==P||this.boundDynamicVertexBuffer!==D||this.boundDynamicVertexBuffer2!==B||this.boundDynamicVertexBuffer3!==U?this.freshBind(a,p,f,b,P,D,B,U):(t.bindVertexArray.set(this.vao),D&&D.bind(),b?.dynamicDraw&&b.bind(),B&&B.bind(),U&&U.bind())}freshBind(t,a,p,f,b,P,D,B){let U=t.numAttributes,$=this.context,Y=$.gl;this.vao&&this.destroy(),this.vao=$.createVertexArray(),$.bindVertexArray.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=a,this.boundPaintVertexBuffers=p,this.boundIndexBuffer=f,this.boundVertexOffset=b,this.boundDynamicVertexBuffer=P,this.boundDynamicVertexBuffer2=D,this.boundDynamicVertexBuffer3=B,a.enableAttributes(Y,t);for(let ee of p)ee.enableAttributes(Y,t);P&&P.enableAttributes(Y,t),D&&D.enableAttributes(Y,t),B&&B.enableAttributes(Y,t),a.bind(),a.setVertexAttribPointers(Y,t,b);for(let ee of p)ee.bind(),ee.setVertexAttribPointers(Y,t,b);P&&(P.bind(),P.setVertexAttribPointers(Y,t,b)),f&&f.bind(),D&&(D.bind(),D.setVertexAttribPointers(Y,t,b)),B&&(B.bind(),B.setVertexAttribPointers(Y,t,b)),$.currentNumAttributes=U}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}let Dl=(_,t,a,p,f)=>({u_texture:0,u_ele_delta:_,u_fog_matrix:t,u_fog_color:a?a.properties.get("fog-color"):o.bo.white,u_fog_ground_blend:a?a.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:f?0:a?a.calculateFogBlendOpacity(p):0,u_horizon_color:a?a.properties.get("horizon-color"):o.bo.white,u_horizon_fog_blend:a?a.properties.get("horizon-fog-blend"):1,u_is_globe_mode:f?1:0}),yh={mainMatrix:"u_projection_matrix",tileMercatorCoords:"u_projection_tile_mercator_coords",clippingPlane:"u_projection_clipping_plane",projectionTransition:"u_projection_transition",fallbackMatrix:"u_projection_fallback_matrix"};function Un(_){let t=[];for(let a of _){if(a===null)continue;let p=a.split(" ");t.push(p.pop())}return t}class Iu{constructor(t,a,p,f,b,P,D,B,U=[]){let $=t.gl;this.program=$.createProgram();let Y=Un(a.staticAttributes),ee=p?p.getBinderAttributes():[],oe=Y.concat(ee),_e=Br.prelude.staticUniforms?Un(Br.prelude.staticUniforms):[],Ie=D.staticUniforms?Un(D.staticUniforms):[],ze=a.staticUniforms?Un(a.staticUniforms):[],Ee=p?p.getBinderUniforms():[],De=_e.concat(Ie).concat(ze).concat(Ee),je=[];for(let _t of De)je.includes(_t)||je.push(_t);let Le=p?p.defines():[];qa($)&&Le.unshift("#version 300 es"),b&&Le.push("#define OVERDRAW_INSPECTOR;"),P&&Le.push("#define TERRAIN3D;
796"),B&&Le.push(B),U&&Le.push(...U);let we=Le.concat(Br.prelude.fragmentSource,D.fragmentSource,a.fragmentSource).join(` 797`),qe=Le.concat(Br.prelude.vertexSource,D.vertexSource,a.vertexSource).join(` 798`);qa($)||(we=(function(_t){return _t.replace(/\bin\s/g,"varying ").replace("out highp vec4 fragColor;","").replace(/fragColor/g,"gl_FragColor").replace(/texture\(/g,"texture2D(")})(we),qe=(function(_t){return _t.replace(/\bin\s/g,"attribute ").replace(/\bout\s/g,"varying ").replace(/texture\(/g,"texture2D(")})(qe));let Fe=$.createShader($.FRAGMENT_SHADER);if($.isContextLost())return void(this.failedToCreate=!0);if($.shaderSource(Fe,we),$.compileShader(Fe),!$.getShaderParameter(Fe,$.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${$.getShaderInfoLog(Fe)}`);$.attachShader(this.program,Fe);let it=$.createShader($.VERTEX_SHADER);if($.isContextLost())return void(this.failedToCreate=!0);if($.shaderSource(it,qe),$.compileShader(it),!$.getShaderParameter(it,$.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${$.getShaderInfoLog(it)}`);$.attachShader(this.program,it),this.attributes={};let ft={};this.numAttributes=oe.length;for(let _t=0;_t<this.numAttributes;_t++)oe[_t]&&($.bindAttribLocation(this.program,_t,oe[_t]),this.attributes[oe[_t]]=_t);if($.linkProgram(this.program),!$.getProgramParameter(this.program,$.LINK_STATUS))throw new Error(`Program failed to link: ${$.getProgramInfoLog(this.program)}`);$.deleteShader(it),$.deleteShader(Fe);for(let _t of je)if(_t&&!ft[_t]){let Rt=$.getUniformLocation(this.program,_t);Rt&&(ft[_t]=Rt)}this.fixedUniforms=f(t,ft),this.terrainUniforms=((_t,Rt)=>({u_depth:new o.b_(_t,Rt.u_depth),u_terrain:new o.b_(_t,Rt.u_terrain),u_terrain_dim:new o.bp(_t,Rt.u_terrain_dim),u_terrain_matrix:new o.c0(_t,Rt.u_terrain_matrix),u_terrain_unpack:new o.c1(_t,Rt.u_terrain_unpack),u_terrain_exaggeration:new o.bp(_t,Rt.u_terrain_exaggeration)}))(t,ft),this.projectionUniforms=((_t,Rt)=>({u_projection_matrix:new o.c0(_t,Rt.u_projection_matrix),u_projection_tile_mercator_coords:new o.c1(_t,Rt.u_projection_tile_mercator_coords),u_projection_clipping_plane:new o.c1(_t,Rt.u_projection_clipping_plane),u_projection_transition:new o.bp(_t,Rt.u_projection_transition),u_projection_fallback_matrix:new o.c0(_t,Rt.u_projection_fallback_matrix)}))(t,ft),this.binderUniforms=p?p.getUniforms(t,ft):[]}draw(t,a,p,f,b,P,D,B,U,$,Y,ee,oe,_e,Ie,ze,Ee,De,je){var Le;let we=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(p),t.setStencilMode(f),t.setColorMode(b),t.setCullFace(P),B){t.activeTexture.set(we.TEXTURE2),we.bindTexture(we.TEXTURE_2D,B.depthTexture),t.activeTexture.set(we.TEXTURE3),we.bindTexture(we.TEXTURE_2D,B.texture);for(let Fe in this.terrainUniforms)this.terrainUniforms[Fe].set(B[Fe])}if(U)for(let Fe in U)this.projectionUniforms[yh[Fe]].set(U[Fe]);if(D)for(let Fe in this.fixedUniforms)this.fixedUniforms[Fe].set(D[Fe]);ze&&ze.setUniforms(t,this.binderUniforms,_e,{zoom:Ie});let qe=0;switch(a){case we.LINES:qe=2;break;case we.TRIANGLES:qe=3;break;case we.LINE_STRIP:qe=1}for(let Fe of oe.get())Fe.vaos||(Fe.vaos={}),(Le=Fe.vaos)[$]||(Le[$]=new Su),Fe.vaos[$].bind(t,this,Y,ze?ze.getPaintVertexBuffers():[],ee,Fe.vertexOffset,Ee,De,je),we.drawElements(a,Fe.primitiveLength*qe,we.UNSIGNED_SHORT,Fe.primitiveOffset*qe*2)}}function Lc(_,t,a){let p=1/o.aK(a,1,t.transform.tileZoom),f=Math.pow(2,a.tileID.overscaledZ),b=a.tileSize*Math.pow(2,t.transform.tileZoom)/f,P=b*(a.tileID.canonical.x+a.tileID.wrap*f),D=b*a.tileID.canonical.y;return{u_image:0,u_texsize:a.imageAtlasTexture.size,u_scale:[p,_.fromScale,_.toScale],u_fade:_.t,u_pixel_coord_upper:[P>>16,D>>16],u_pixel_coord_lower:[65535&P,65535&D]}}let Jh=(_,t,a,p)=>{let f=_.style.light,b=f.properties.get("position"),P=[b.x,b.y,b.z],D=o.c4();f.properties.get("anchor")==="viewport"&&o.c5(D,_.transform.bearingInRadians),o.c6(P,P,D);let B=_.transform.transformLightDirection(P),U=f.properties.get("color");return{u_lightpos:P,u_lightpos_globe:B,u_lightintensity:f.properties.get("intensity"),u_lightcolor:[U.r,U.g,U.b],u_vertical_gradient:+t,u_opacity:a,u_fill_translate:p}},el=(_,t,a,p,f,b,P)=>o.e(Jh(_,t,a,p),Lc(b,_,P),{u_height_factor:-Math.pow(2,f.overscaledZ
vendor: 4,904 bytes, line 798
798)/P.tileSize/8}),tl=(_,t,a,p)=>o.e(Lc(t,_,a),{u_fill_translate:p}),Ll=(_,t)=>({u_world:_,u_fill_translate:t}),Cu=(_,t,a,p,f)=>o.e(tl(_,t,a,f),{u_world:p}),Rc=(_,t,a,p,f)=>{let b=_.transform,P,D,B=0;if(a.paint.get("circle-pitch-alignment")==="map"){let U=o.aK(t,1,b.zoom);P=!0,D=[U,U],B=U/(o.a6*Math.pow(2,t.tileID.overscaledZ))*2*Math.PI*f}else P=!1,D=b.pixelsToGLUnits;return{u_camera_to_center_distance:b.cameraToCenterDistance,u_scale_with_map:+(a.paint.get("circle-pitch-scale")==="map"),u_pitch_with_map:+P,u_device_pixel_ratio:_.pixelRatio,u_extrude_scale:D,u_globe_extrude_scale:B,u_translate:p}},Qh=_=>({u_pixel_extrude_scale:[1/_.width,1/_.height]}),il=_=>({u_viewport_size:[_.width,_.height]}),Rl=(_,t=1)=>({u_color:_,u_overlay:0,u_overlay_scale:t}),Fc=(_,t,a,p)=>{let f=o.aK(_,1,t)/(o.a6*Math.pow(2,_.tileID.overscaledZ))*2*Math.PI*p;return{u_extrude_scale:o.aK(_,1,t),u_intensity:a,u_globe_extrude_scale:f}},As=(_,t,a,p)=>{let f=o.O();o.c7(f,0,_.width,_.height,0,0,1);let b=_.context.gl;return{u_matrix:f,u_world:[b.drawingBufferWidth,b.drawingBufferHeight],u_image:a,u_color_ramp:p,u_opacity:t.paint.get("heatmap-opacity")}},Bc=(_,t,a)=>{let p=a.paint.get("hillshade-accent-color"),f;switch(a.paint.get("hillshade-method")){case"basic":f=4;break;case"combined":f=1;break;case"igor":f=2;break;case"multidirectional":f=3;break;default:f=0}let b=a.getIlluminationProperties();for(let P=0;P<b.directionRadians.length;P++)a.paint.get("hillshade-illumination-anchor")==="viewport"&&(b.directionRadians[P]+=_.transform.bearingInRadians);return{u_image:0,u_latrange:Oc(0,t.tileID),u_exaggeration:a.paint.get("hillshade-exaggeration"),u_altitudes:b.altitudeRadians,u_azimuths:b.directionRadians,u_accent:p,u_method:f,u_highlights:b.highlightColor,u_shadows:b.shadowColor}},zs=(_,t)=>{let a=t.stride,p=o.O();return o.c7(p,0,o.a6,-o.a6,0,0,1),o.Q(p,p,[0,-o.a6,0]),{u_matrix:p,u_image:1,u_dimension:[a,a],u_zoom:_.overscaledZ,u_unpack:t.getUnpackVector()}};function Oc(_,t){let a=Math.pow(2,t.canonical.z),p=t.canonical.y;return[new o.a7(0,p/a).toLngLat().lat,new o.a7(0,(p+1)/a).toLngLat().lat]}let Eu=(_,t,a=0)=>({u_image:0,u_unpack:t.getUnpackVector(),u_dimension:[t.stride,t.stride],u_elevation_stops:1,u_color_stops:4,u_color_ramp_size:a,u_opacity:_.paint.get("color-relief-opacity")}),Ds=(_,t,a,p)=>{let f=_.transform;return{u_translation:Vo(_,t,a),u_ratio:p/o.aK(t,1,f.zoom),u_device_pixel_ratio:_.pixelRatio,u_units_to_pixels:[1/f.pixelsToGLUnits[0],1/f.pixelsToGLUnits[1]]}},eu=(_,t,a,p,f)=>o.e(Ds(_,t,a,p),{u_image:0,u_image_height:f}),tu=(_,t,a,p,f)=>{let b=_.transform,P=Bl(t,b);return{u_translation:Vo(_,t,a),u_texsize:t.imageAtlasTexture.size,u_ratio:p/o.aK(t,1,b.zoom),u_device_pixel_ratio:_.pixelRatio,u_image:0,u_scale:[P,f.fromScale,f.toScale],u_fade:f.t,u_units_to_pixels:[1/b.pixelsToGLUnits[0],1/b.pixelsToGLUnits[1]]}},xh=(_,t,a,p,f)=>{let b=Bl(t,_.transform);return o.e(Ds(_,t,a,p),{u_tileratio:b,u_crossfade_from:f.fromScale,u_crossfade_to:f.toScale,u_image:0,u_mix:f.t,u_lineatlas_width:_.lineAtlas.width,u_lineatlas_height:_.lineAtlas.height})},Fl=(_,t,a,p,f,b)=>{let P=Bl(t,_.transform);return o.e(Ds(_,t,a,p),{u_image:0,u_image_height:b,u_tileratio:P,u_crossfade_from:f.fromScale,u_crossfade_to:f.toScale,u_image_dash:1,u_mix:f.t,u_lineatlas_width:_.lineAtlas.width,u_lineatlas_height:_.lineAtlas.height})};function Bl(_,t){return 1/o.aK(_,1,t.tileZoom)}function Vo(_,t,a){return o.aL(_.transform,t,a.paint.get("line-translate"),a.paint.get("line-translate-anchor"))}let Ol=(_,t,a,p,f)=>{return{u_tl_parent:_,u_scale_parent:t,u_buffer_scale:1,u_fade_t:a.mix,u_opacity:a.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:(P=p.paint.get("raster-saturation"),P>0?1-1/(1.001-P):-P),u_contrast_factor:(b=p.paint.get("raster-contrast"),b>0?1/(1-b):1+b),u_spin_weights:wo(p.paint.get("raster-hue-rotate")),u_coords_top:[f[0].x,f[0].y,f[1].x,f[1].y],u_coords_bottom:[f[3].x,f[3].y,f[2].x,f[2].y]};var b,P};function wo(_){_*=Math.PI/180;let t=Math.sin(_),a=Math.cos(_);return[(2*a+1)/3,(-Math.sqrt(3)*t-a+1)/3,(Math.sqrt(3)*t-a+1)/3]}let rl=(_,t,a,p,f,b,P,D,B,U,$,Y,ee)=>{let oe=P.transform;return{u_is_size_zoom_constant:+(_==="constant"||_==="source"),u_is_size_feature_constant:+(_==="constant"||_==="camera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:oe.cameraToCenterDistance,u_pitch:oe.pitch/360*2*Math.PI,u_rotate_symbol:+a,u_aspect_ratio:oe.width/oe.height,u_fade_change:P.options.fadeDuration?P.symbolFadeChange:1,u_label_plane_matrix:D,u_coord_matrix:B,u_is_text:+$,u_pitch_with_map:+p,u_is_along_line:f,u_is_variable_anchor:b,u_texsize:Y,u_texture:0,u_translation:U,u_pitched_scale:ee}},To=(_,t,a,p,f,b,P,D,B,U,$,Y,ee,oe)=>{let _e=P.transform;return o.e(rl(_,t,a,p,f,b,P,D,B,U,$,Y,oe),{u_gamma_scale:p?Math.
vendor: 4,176 bytes, line 798
798cos(_e.pitch*Math.PI/180)*_e.cameraToCenterDistance:1,u_device_pixel_ratio:P.pixelRatio,u_is_halo:ee?1:0,u_is_plain:1})},iu=(_,t,a,p,f,b,P,D,B,U,$,Y,ee)=>o.e(To(_,t,a,p,f,b,P,D,B,U,!0,$,!0,ee),{u_texsize_icon:Y,u_texture_icon:1}),No=(_,t)=>({u_opacity:_,u_color:t}),vh=(_,t,a,p,f)=>o.e((function(b,P,D,B){let U=D.imageManager.getPattern(b.from.toString()),$=D.imageManager.getPattern(b.to.toString()),{width:Y,height:ee}=D.imageManager.getPixelSize(),oe=Math.pow(2,B.tileID.overscaledZ),_e=B.tileSize*Math.pow(2,D.transform.tileZoom)/oe,Ie=_e*(B.tileID.canonical.x+B.tileID.wrap*oe),ze=_e*B.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:U.tl,u_pattern_br_a:U.br,u_pattern_tl_b:$.tl,u_pattern_br_b:$.br,u_texsize:[Y,ee],u_mix:P.t,u_pattern_size_a:U.displaySize,u_pattern_size_b:$.displaySize,u_scale_a:P.fromScale,u_scale_b:P.toScale,u_tile_units_to_pixels:1/o.aK(B,1,D.transform.tileZoom),u_pixel_coord_upper:[Ie>>16,ze>>16],u_pixel_coord_lower:[65535&Ie,65535&ze]}})(a,f,t,p),{u_opacity:_}),us=(_,t)=>{},Vc={fillExtrusion:(_,t)=>({u_lightpos:new o.c2(_,t.u_lightpos),u_lightpos_globe:new o.c2(_,t.u_lightpos_globe),u_lightintensity:new o.bp(_,t.u_lightintensity),u_lightcolor:new o.c2(_,t.u_lightcolor),u_vertical_gradient:new o.bp(_,t.u_vertical_gradient),u_opacity:new o.bp(_,t.u_opacity),u_fill_translate:new o.c3(_,t.u_fill_translate)}),fillExtrusionPattern:(_,t)=>({u_lightpos:new o.c2(_,t.u_lightpos),u_lightpos_globe:new o.c2(_,t.u_lightpos_globe),u_lightintensity:new o.bp(_,t.u_lightintensity),u_lightcolor:new o.c2(_,t.u_lightcolor),u_vertical_gradient:new o.bp(_,t.u_vertical_gradient),u_height_factor:new o.bp(_,t.u_height_factor),u_opacity:new o.bp(_,t.u_opacity),u_fill_translate:new o.c3(_,t.u_fill_translate),u_image:new o.b_(_,t.u_image),u_texsize:new o.c3(_,t.u_texsize),u_pixel_coord_upper:new o.c3(_,t.u_pixel_coord_upper),u_pixel_coord_lower:new o.c3(_,t.u_pixel_coord_lower),u_scale:new o.c2(_,t.u_scale),u_fade:new o.bp(_,t.u_fade)}),fill:(_,t)=>({u_fill_translate:new o.c3(_,t.u_fill_translate)}),fillPattern:(_,t)=>({u_image:new o.b_(_,t.u_image),u_texsize:new o.c3(_,t.u_texsize),u_pixel_coord_upper:new o.c3(_,t.u_pixel_coord_upper),u_pixel_coord_lower:new o.c3(_,t.u_pixel_coord_lower),u_scale:new o.c2(_,t.u_scale),u_fade:new o.bp(_,t.u_fade),u_fill_translate:new o.c3(_,t.u_fill_translate)}),fillOutline:(_,t)=>({u_world:new o.c3(_,t.u_world),u_fill_translate:new o.c3(_,t.u_fill_translate)}),fillOutlinePattern:(_,t)=>({u_world:new o.c3(_,t.u_world),u_image:new o.b_(_,t.u_image),u_texsize:new o.c3(_,t.u_texsize),u_pixel_coord_upper:new o.c3(_,t.u_pixel_coord_upper),u_pixel_coord_lower:new o.c3(_,t.u_pixel_coord_lower),u_scale:new o.c2(_,t.u_scale),u_fade:new o.bp(_,t.u_fade),u_fill_translate:new o.c3(_,t.u_fill_translate)}),circle:(_,t)=>({u_camera_to_center_distance:new o.bp(_,t.u_camera_to_center_distance),u_scale_with_map:new o.b_(_,t.u_scale_with_map),u_pitch_with_map:new o.b_(_,t.u_pitch_with_map),u_extrude_scale:new o.c3(_,t.u_extrude_scale),u_device_pixel_ratio:new o.bp(_,t.u_device_pixel_ratio),u_globe_extrude_scale:new o.bp(_,t.u_globe_extrude_scale),u_translate:new o.c3(_,t.u_translate)}),collisionBox:(_,t)=>({u_pixel_extrude_scale:new o.c3(_,t.u_pixel_extrude_scale)}),collisionCircle:(_,t)=>({u_viewport_size:new o.c3(_,t.u_viewport_size)}),debug:(_,t)=>({u_color:new o.b$(_,t.u_color),u_overlay:new o.b_(_,t.u_overlay),u_overlay_scale:new o.bp(_,t.u_overlay_scale)}),depth:us,clippingMask:us,heatmap:(_,t)=>({u_extrude_scale:new o.bp(_,t.u_extrude_scale),u_intensity:new o.bp(_,t.u_intensity),u_globe_extrude_scale:new o.bp(_,t.u_globe_extrude_scale)}),heatmapTexture:(_,t)=>({u_matrix:new o.c0(_,t.u_matrix),u_world:new o.c3(_,t.u_world),u_image:new o.b_(_,t.u_image),u_color_ramp:new o.b_(_,t.u_color_ramp),u_opacity:new o.bp(_,t.u_opacity)}),hillshade:(_,t)=>({u_image:new o.b_(_,t.u_image),u_latrange:new o.c3(_,t.u_latrange),u_exaggeration:new o.bp(_,t.u_exaggeration),u_altitudes:new o.c9(_,t.u_altitudes),u_azimuths:new o.c9(_,t.u_azimuths),u_accent:new o.b$(_,t.u_accent),u_method:new o.b_(_,t.u_method),u_shadows:new o.c8(_,t.u_shadows),u_highlights:new o.c8(_,t.u_highlights)}),hillshadePrepare:(_,t)=>
798({u_matrix:new o.c0(_,t.u_matrix),u_image:new o.b_(_,t.u_image),u_dimension:new o.c3(_,t.u_dimension),u_zoom:new o.bp(_,t.u_zoom),u_unpack:new o.c1(_,t.u_unpack)}),colorRelief:(_,t)=>({u_image:new o.b_(_,t.u_image),u_unpack:new o.c1(_,t.u_unpack),u_dimension:new o.c3(_,t.u_dimension),u_elevation_stops:new o.b_(_,t.u_elevation_stops),u_color_stops:new o.b_(_,t.u_color_stops),u_color_ramp_size:new o.b_(_,t.u_color_ramp_size),u_opacity:new o.bp(_,t.u_opacity)}),line:(_,t)=>({u_translation:new o.c3(_,t.u_translation),u_ratio:new o.bp(_,t.u_ratio),u_device_pixel_ratio:new o.bp(_,t.u_device_pixel_ratio),u_units_to_pixels:new o.c3(_,t.u_units_to_pixels)}),lineGradient:(_,t)=>({u_translation:new o.c3(_,t.u_translation),u_ratio:new o.bp(_,t.u_ratio),u_device_pixel_ratio:new o.bp(_,t.u_device_pixel_ratio),u_units_to_pixels:new o.c3(_,t.u_units_to_pixels),u_image:new o.b_(_,t.u_image),u_image_height:new o.bp(_,t.u_image_height)}),linePattern:(_,t)=>({u_translation:new o.c3(_,t.u_translation),u_texsize:new o.c3(_,t.u_texsize),u_ratio:new o.bp(_,t.u_ratio),u_device_pixel_ratio:new o.bp(_,t.u_device_pixel_ratio),u_image:new o.b_(_,t.u_image),u_units_to_pixels:new o.c3(_,t.u_units_to_pixels),u_scale:new o.c2(_,t.u_scale),u_fade:new o.bp(_,t.u_fade)}),lineSDF:(_,t)=>({u_translation:new o.c3(_,t.u_translation),u_ratio:new o.bp(_,t.u_ratio),u_device_pixel_ratio:new o.bp(_,t.u_device_pixel_ratio),u_units_to_pixels:new o.c3(_,t.u_units_to_pixels),u_image:new o.b_(_,t.u_image),u_mix:new o.bp(_,t.u_mix),u_tileratio:new o.bp(_,t.u_tileratio),u_crossfade_from:new o.bp(_,t.u_crossfade_from),u_crossfade_to:new o.bp(_,t.u_crossfade_to),u_lineatlas_width:new o.bp(_,t.u_lineatlas_width),u_lineatlas_height:new o.bp(_,t.u_lineatlas_height)}),lineGradientSDF:(_,t)=>({u_translation:new o.c3(_,t.u_translation),u_ratio:new o.bp(_,t.u_ratio),u_device_pixel_ratio:new o.bp(_,t.u_device_pixel_ratio),u_units_to_pixels:new o.c3(_,t.u_units_to_pixels),u_image:new o.b_(_,t.u_image),u_image_height:new o.bp(_,t.u_image_height),u_tileratio:new o.bp(_,t.u_tileratio),u_crossfade_from:new o.bp(_,t.u_crossfade_from),u_crossfade_to:new o.bp(_,t.u_crossfade_to),u_image_dash:new o.b_(_,t.u_image_dash),u_mix:new o.bp(_,t.u_mix),u_lineatlas_width:new o.bp(_,t.u_lineatlas_width),u_lineatlas_height:new o.bp(_,t.u_lineatlas_height)}),raster:(_,t)=>({u_tl_parent:new o.c3(_,t.u_tl_parent),u_scale_parent:new o.bp(_,t.u_scale_parent),u_buffer_scale:new o.bp(_,t.u_buffer_scale),u_fade_t:new o.bp(_,t.u_fade_t),u_opacity:new o.bp(_,t.u_opacity),u_image0:new o.b_(_,t.u_image0),u_image1:new o.b_(_,t.u_image1),u_brightness_low:new o.bp(_,t.u_brightness_low),u_brightness_high:new o.bp(_,t.u_brightness_high),u_saturation_factor:new o.bp(_,t.u_saturation_factor),u_contrast_factor:new o.bp(_,t.u_contrast_factor),u_spin_weights:new o.c2(_,t.u_spin_weights),u_coords_top:new o.c1(_,t.u_coords_top),u_coords_bottom:new o.c1(_,t.u_coords_bottom)}),symbolIcon:(_,t)=>({u_is_size_zoom_constant:new o.b_(_,t.u_is_size_zoom_constant),u_is_size_feature_constant:new o.b_(_,t.u_is_size_feature_constant),u_size_t:new o.bp(_,t.u_size_t),u_size:new o.bp(_,t.u_size),u_camera_to_center_distance:new o.bp(_,t.u_camera_to_center_distance),u_pitch:new o.bp(_,t.u_pitch),u_rotate_symbol:new o.b_(_,t.u_rotate_symbol),u_aspect_ratio:new o.bp(_,t.u_aspect_ratio),u_fade_change:new o.bp(_,t.u_fade_change),u_label_plane_matrix:new o.c0(_,t.u_label_plane_matrix),u_coord_matrix:new o.c0(_,t.u_coord_matrix),u_is_text:new o.b_(_,t.u_is_text),u_pitch_with_map:new o.b_(_,t.u_pitch_with_map),u_is_along_line:new o.b_(_,t.u_is_along_line),u_is_variable_anchor:new o.b_(_,t.u_is_variable_anchor),u_texsize:new o.c3(_,t.u_texsize),u_texture:new o.b_(_,t.u_texture),u_translation:new o.c3(_,t.u_translation),u_pitched_scale:new o.bp(_,t.u_pitched_scale)}),symbolSDF:(_,t)=>({u_is_size_zoom_constant:new o.b_(_,t.u_is_size_zoom_constant),u_is_size_feature_constant:new o.b_(_,t.u_is_size_feature_constant),u_size_t:new o.bp(_,t.u_size_t),u_size:new o.bp(_,t.u_size),u_camera_to_center_distance:new o.bp(_,t.u_camera_to_center_distance),u_pitch:new o.bp(_,t.u_pitch),u_rotate_symbol:new o.b_(_,t.u_rotate_symbol),u_aspect_ratio:new o.bp(_,t.u_aspect_ratio),u_fade_change:new o.bp(_,t.u_fade_change),u_label_plane_matrix:new o.c0(_,t.u_label_plane_matrix
vendor: 12,210 bytes, line 798
798),u_coord_matrix:new o.c0(_,t.u_coord_matrix),u_is_text:new o.b_(_,t.u_is_text),u_pitch_with_map:new o.b_(_,t.u_pitch_with_map),u_is_along_line:new o.b_(_,t.u_is_along_line),u_is_variable_anchor:new o.b_(_,t.u_is_variable_anchor),u_texsize:new o.c3(_,t.u_texsize),u_texture:new o.b_(_,t.u_texture),u_gamma_scale:new o.bp(_,t.u_gamma_scale),u_device_pixel_ratio:new o.bp(_,t.u_device_pixel_ratio),u_is_halo:new o.b_(_,t.u_is_halo),u_is_plain:new o.b_(_,t.u_is_plain),u_translation:new o.c3(_,t.u_translation),u_pitched_scale:new o.bp(_,t.u_pitched_scale)}),symbolTextAndIcon:(_,t)=>({u_is_size_zoom_constant:new o.b_(_,t.u_is_size_zoom_constant),u_is_size_feature_constant:new o.b_(_,t.u_is_size_feature_constant),u_size_t:new o.bp(_,t.u_size_t),u_size:new o.bp(_,t.u_size),u_camera_to_center_distance:new o.bp(_,t.u_camera_to_center_distance),u_pitch:new o.bp(_,t.u_pitch),u_rotate_symbol:new o.b_(_,t.u_rotate_symbol),u_aspect_ratio:new o.bp(_,t.u_aspect_ratio),u_fade_change:new o.bp(_,t.u_fade_change),u_label_plane_matrix:new o.c0(_,t.u_label_plane_matrix),u_coord_matrix:new o.c0(_,t.u_coord_matrix),u_is_text:new o.b_(_,t.u_is_text),u_pitch_with_map:new o.b_(_,t.u_pitch_with_map),u_is_along_line:new o.b_(_,t.u_is_along_line),u_is_variable_anchor:new o.b_(_,t.u_is_variable_anchor),u_texsize:new o.c3(_,t.u_texsize),u_texsize_icon:new o.c3(_,t.u_texsize_icon),u_texture:new o.b_(_,t.u_texture),u_texture_icon:new o.b_(_,t.u_texture_icon),u_gamma_scale:new o.bp(_,t.u_gamma_scale),u_device_pixel_ratio:new o.bp(_,t.u_device_pixel_ratio),u_is_halo:new o.b_(_,t.u_is_halo),u_translation:new o.c3(_,t.u_translation),u_pitched_scale:new o.bp(_,t.u_pitched_scale)}),background:(_,t)=>({u_opacity:new o.bp(_,t.u_opacity),u_color:new o.b$(_,t.u_color)}),backgroundPattern:(_,t)=>({u_opacity:new o.bp(_,t.u_opacity),u_image:new o.b_(_,t.u_image),u_pattern_tl_a:new o.c3(_,t.u_pattern_tl_a),u_pattern_br_a:new o.c3(_,t.u_pattern_br_a),u_pattern_tl_b:new o.c3(_,t.u_pattern_tl_b),u_pattern_br_b:new o.c3(_,t.u_pattern_br_b),u_texsize:new o.c3(_,t.u_texsize),u_mix:new o.bp(_,t.u_mix),u_pattern_size_a:new o.c3(_,t.u_pattern_size_a),u_pattern_size_b:new o.c3(_,t.u_pattern_size_b),u_scale_a:new o.bp(_,t.u_scale_a),u_scale_b:new o.bp(_,t.u_scale_b),u_pixel_coord_upper:new o.c3(_,t.u_pixel_coord_upper),u_pixel_coord_lower:new o.c3(_,t.u_pixel_coord_lower),u_tile_units_to_pixels:new o.bp(_,t.u_tile_units_to_pixels)}),terrain:(_,t)=>({u_texture:new o.b_(_,t.u_texture),u_ele_delta:new o.bp(_,t.u_ele_delta),u_fog_matrix:new o.c0(_,t.u_fog_matrix),u_fog_color:new o.b$(_,t.u_fog_color),u_fog_ground_blend:new o.bp(_,t.u_fog_ground_blend),u_fog_ground_blend_opacity:new o.bp(_,t.u_fog_ground_blend_opacity),u_horizon_color:new o.b$(_,t.u_horizon_color),u_horizon_fog_blend:new o.bp(_,t.u_horizon_fog_blend),u_is_globe_mode:new o.bp(_,t.u_is_globe_mode)}),terrainDepth:(_,t)=>({u_ele_delta:new o.bp(_,t.u_ele_delta)}),terrainCoords:(_,t)=>({u_texture:new o.b_(_,t.u_texture),u_terrain_coords_id:new o.bp(_,t.u_terrain_coords_id),u_ele_delta:new o.bp(_,t.u_ele_delta)}),projectionErrorMeasurement:(_,t)=>({u_input:new o.bp(_,t.u_input),u_output_expected:new o.bp(_,t.u_output_expected)}),atmosphere:(_,t)=>({u_sun_pos:new o.c2(_,t.u_sun_pos),u_atmosphere_blend:new o.bp(_,t.u_atmosphere_blend),u_globe_position:new o.c2(_,t.u_globe_position),u_globe_radius:new o.bp(_,t.u_globe_radius),u_inv_proj_matrix:new o.c0(_,t.u_inv_proj_matrix)}),sky:(_,t)=>({u_sky_color:new o.b$(_,t.u_sky_color),u_horizon_color:new o.b$(_,t.u_horizon_color),u_horizon:new o.c3(_,t.u_horizon),u_horizon_normal:new o.c3(_,t.u_horizon_normal),u_sky_horizon_blend:new o.bp(_,t.u_sky_horizon_blend),u_sky_blend:new o.bp(_,t.u_sky_blend)})};class ru{constructor(t,a,p){this.context=t;let f=t.gl;this.buffer=f.createBuffer(),this.dynamicDraw=!!p,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),f.bufferData(f.ELEMENT_ARRAY_BUFFER,a.arrayBuffer,this.dynamicDraw?f.DYNAMIC_DRAW:f.STATIC_DRAW),this.dynamicDraw||a.freeBufferAfterUpload()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){let a=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),a.bufferSubData(a.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let Ip={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Mu{constructor(t,a,p,f){this.length=a.length,this.attributes=p,this.itemSize=a.bytesPerElement,this.dynamicDraw=f,this.context=t;let b=t.gl;this.buffer=b.createBuffer(),t.bindVertexBuffer.set(this.buffer),b.bufferData(b.ARRAY_BUFFER,a.arrayBuffer,this.dynamicDraw?b.DYNAMIC_DRAW:b.STATIC_DRAW),this.dynamicDraw||a.freeBufferAfterUpload()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);let a=this.context.gl;this.bind(),a.bufferSubData(a.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,a){for(let p of this.attributes){let f=a.attributes[p.name];f!==void 0&&t.enableVertexAttribArray(f)}}setVertexAttribPointers(t,a,p){for(let f of this.attributes){let b=a.attributes[f.name];b!==void 0&&t.vertexAttribPointer(b,f.components,t[Ip[f.type]],!1,this.itemSize,f.offset+this.itemSize*(p||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class dr{constructor(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(t){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class oc extends dr{getDefault(){return o.bo.transparent}set(t){let a=this.current;(t.r!==a.r||t.g!==a.g||t.b!==a.b||t.a!==a.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class Sa extends dr{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class ui extends dr{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class Nc extends dr{getDefault(){return[!0,!0,!0,!0]}set(t){let a=this.current;(t[0]!==a[0]||t[1]!==a[1]||t[2]!==a[2]||t[3]!==a[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class Ls extends dr{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class Uo extends dr{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class Vl extends dr{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){let a=this.current;(t.func!==a.func||t.ref!==a.ref||t.mask!==a.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}}class Yt extends dr{getDefault(){let t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){let a=this.current;(t[0]!==a[0]||t[1]!==a[1]||t[2]!==a[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}}class So extends dr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let a=this.gl;t?a.enable(a.STENCIL_TEST):a.disable(a.STENCIL_TEST),this.current=t,this.dirty=!1}}class Pu extends dr{getDefault(){return[0,1]}set(t){let a=this.current;(t[0]!==a[0]||t[1]!==a[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}}class bh extends dr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let a=this.gl;t?a.enable(a.DEPTH_TEST):a.disable(a.DEPTH_TEST),this.current=t,this.dirty=!1}}class Uc extends dr{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class nl extends dr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let a=this.gl;t?a.enable(a.BLEND):a.disable(a.BLEND),this.current=t,this.dirty=!1}}class jc extends dr{getDefault(){let t=this.gl;return[t.ONE,t.ZERO]}set(t){let a=this.current;(t[0]!==a[0]||t[1]!==a[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}}class wh extends dr{getDefault(){return o.bo.transparent}set(t){let a=this.current;(t.r!==a.r||t.g!==a.g||t.b!==a.b||t.a!==a.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class ac extends dr{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}}class sc extends dr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let a=this.gl;t?a.enable(a.CULL_FACE):a.disable(a.CULL_FACE),this.current=t,this.dirty=!1}}class Th extends dr{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class ol extends dr{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}class al extends dr{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}}class Io extends dr{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class ps extends dr{getDefault(){let t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){let a=this.current;(t[0]!==a[0]||t[1]!==a[1]||t[2]!==a[2]||t[3]!==a[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class Ji extends dr{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let a=this.gl;a.bindFramebuffer(a.FRAMEBUFFER,t),this.current=t,this.dirty=!1}}class Rs extends dr{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let a=this.gl;a.bindRenderbuffer(a.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class nu extends dr{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let a=this.gl;a.bindTexture(a.TEXTURE_2D,t),this.current=t,this.dirty=!1}}class lc extends dr{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let a=this.gl;a.bindBuffer(a.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class cc extends dr{getDefault(){return null}set(t){let a=this.gl;a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class Ia extends dr{getDefault(){return null}set(t){var a;if(t===this.current&&!this.dirty)return;let p=this.gl;qa(p)?p.bindVertexArray(t):(a=p.getExtension("OES_vertex_array_object"))===null||a===void 0||a.bindVertexArrayOES(t),this.current=t,this.dirty=!1}}class Nr extends dr{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;let a=this.gl;a.pixelStorei(a.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class hc extends dr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let a=this.gl;a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class Sh extends dr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let a=this.gl;a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class uc extends dr{constructor(t,a){super(t),this.context=t,this.parent=a}getDefault(){return null}}class qc extends uc{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let a=this.gl;a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class pc extends uc{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let a=this.gl;a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_ATTACHMENT,a.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Ih extends uc{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let a=this.gl;a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.RENDERBUFFER,t),this.current=t,this.dirty=!1}}let ra="Framebuffer is not complete";class dc{constructor(t,a,p,f,b){this.context=t,this.width=a,this.height=p;let P=t.gl,D=this.framebuffer=P.createFramebuffer();
798if(this.colorAttachment=new qc(t,D),f)this.depthAttachment=b?new Ih(t,D):new pc(t,D);else if(b)throw new Error("Stencil cannot be set without depth");if(P.checkFramebufferStatus(P.FRAMEBUFFER)!==P.FRAMEBUFFER_COMPLETE)throw new Error(ra)}destroy(){let t=this.context.gl,a=this.colorAttachment.get();if(a&&t.deleteTexture(a),this.depthAttachment){let p=this.depthAttachment.get();p&&t.deleteRenderbuffer(p)}t.deleteFramebuffer(this.framebuffer)}}class xi{constructor(t){var a,p;if(this.gl=t,this.clearColor=new oc(this),this.clearDepth=new Sa(this),this.clearStencil=new ui(this),this.colorMask=new Nc(this),this.depthMask=new Ls(this),this.stencilMask=new Uo(this),this.stencilFunc=new Vl(this),this.stencilOp=new Yt(this),this.stencilTest=new So(this),this.depthRange=new Pu(this),this.depthTest=new bh(this),this.depthFunc=new Uc(this),this.blend=new nl(this),this.blendFunc=new jc(this),this.blendColor=new wh(this),this.blendEquation=new ac(this),this.cullFace=new sc(this),this.cullFaceSide=new Th(this),this.frontFace=new ol(this),this.program=new al(this),this.activeTexture=new Io(this),this.viewport=new ps(this),this.bindFramebuffer=new Ji(this),this.bindRenderbuffer=new Rs(this),this.bindTexture=new nu(this),this.bindVertexBuffer=new lc(this),this.bindElementBuffer=new cc(this),this.bindVertexArray=new Ia(this),this.pixelStoreUnpack=new Nr(this),this.pixelStoreUnpackPremultiplyAlpha=new hc(this),this.pixelStoreUnpackFlipY=new Sh(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),qa(t)){this.HALF_FLOAT=t.HALF_FLOAT;let f=t.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(a=t.RGBA16F)!==null&&a!==void 0?a:f?.RGBA16F_EXT,this.RGB16F=(p=t.RGB16F)!==null&&p!==void 0?p:f?.RGB16F_EXT,t.getExtension("EXT_color_buffer_float")}else{t.getExtension("EXT_color_buffer_half_float"),t.getExtension("OES_texture_half_float_linear");let f=t.getExtension("OES_texture_half_float");this.HALF_FLOAT=f?.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(t,a){return new ru(this,t,a)}createVertexBuffer(t,a,p){return new Mu(this,t,a,p)}createRenderbuffer(t,a,p){let f=this.gl,b=f.createRenderbuffer();return this.bindRenderbuffer.set(b),f.renderbufferStorage(f.RENDERBUFFER,t,a,p),this.bindRenderbuffer.set(null),b}createFramebuffer(t,a,p,f){return new dc(this,t,a,p,f)}clear({color:t,depth:a,stencil:p}){let f=this.gl,b=0;t&&(b|=f.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),a!==void 0&&(b|=f.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(a),this.depthMask.set(!0)),p!==void 0&&(b|=f.STENCIL_BUFFER_BIT,this.clearStencil.set(p),this.stencilMask.set(255)),f.clear(b)}setCullFace(t){t.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))}setDepthMode(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)}setStencilMode(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)}setColorMode(t){o.bQ(t.blendFunction,br.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)}createVertexArray(){var t;return qa(this.gl)?this.gl.createVertexArray():(t=this.gl.getExtension("OES_vertex_array_object"))===null||t===void 0?void 0:t.createVertexArrayOES()}deleteVertexArray(t){var a;qa(this.gl)?this.gl.deleteVertexArray(t):(a=this.gl.getExtension("OES_vertex_array_object"))===null||a===void 0||a.deleteVertexArrayOES(t)}unbindVAO(){this.bindVertexArray.set(null)}}let Pi;function Za(_,t,a,p,f){var b,P;let D=_.context,B=_.transform,U=D.gl,$=_.useProgram("collisionBox"),Y=[],ee=0,oe=0;for(let je of p){let Le=t.getTile(je).getBucket(a);if(!Le)continue;let we=f?Le.textCollisionBox:Le.iconCollisionBox,qe=Le.collisionCircleArray;qe.length>0&&(Y.push({circleArray:qe,circleOffset:oe,coord:je}),ee+=qe.length/4,oe=ee),we&&$.draw(D,U.LINES,Zi.disabled,hr.disabled,_.colorModeForRenderPass(),ar.disabled,Qh(_.transform),(b=_.style.map.terrain)===null||b===void 0?void 0:b.getTerrainData(je),B.getProjectionData({overscaledTileID:je,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),a.id,we.layoutVertexBuffer,we.indexBuffer,we.segments,null,_.transform.zoom,null,null,we.collisionVertexBuffer)}if(!f||!Y.length)return;let _e=_.useProgram("collisionCircle"),Ie=new o.ca;Ie.resize(4*ee),Ie._trim();let ze=0;for(let je of Y)for(let Le=0;Le<je.circleArray.length/4;Le++){let we=4*Le,qe=je.circleArray[we+0],Fe=je.circleArray[we+1],it=je.circleArray[we+2],ft=je.circleArray[we+3];Ie.emplace(ze++,qe,Fe,it,ft,0),Ie.emplace(ze++,qe,Fe,it,ft,1),Ie.emplace(ze++,qe,Fe,it,ft,2),Ie.emplace(ze++,qe,Fe,it,ft,3)}(!Pi||Pi.length<2*ee)&&(Pi=(function(je){let Le=2*je,we=new o.cc;we.resize(Le),we._trim();for(let qe=0;qe<Le;qe++){let Fe=6*qe;we.uint16[Fe+0]=4*qe+0,we.uint16[Fe+1]=4*qe+1,we.uint16[Fe+2]=4*qe+2,we.uint16[Fe+3]=4*qe+2,we.uint16[Fe+4]=4*qe+3,we.uint16[Fe+5]=4*qe+0}return we})(ee));let Ee=D.createIndexBuffer(Pi,!0),De=D.createVertexBuffer(Ie,o.cb.members,!0);for(let je of Y){let Le=il(_.transform);_e.draw(D,U.TRIANGLES,Zi.disabled,hr.disabled,_.colorModeForRenderPass(),ar.disabled,Le,(P=_.style.map.terrain)===null||P===void 0?void 0:P.getTerrainData(je.coord),null,a.id,De,Ee,o.aV.simpleSegment(0,2*je.circleOffset,je.cir
vendor: 4,593 bytes, line 798
798cleArray.length,je.circleArray.length/2),null,_.transform.zoom,null,null,null)}De.destroy(),Ee.destroy()}let sl=o.ap(new Float32Array(16));function ds(_,t,a,p,f,b){let{horizontalAlign:P,verticalAlign:D}=o.aP(_);return new o.P((-(P-.5)*t/f+p[0])*b,(-(D-.5)*a/f+p[1])*b)}function io(_,t,a,p,f,b){let P=t.tileAnchorPoint.add(new o.P(t.translation[0],t.translation[1]));if(t.pitchWithMap){let D=p.mult(b);a||(D=D.rotate(-f));let B=P.add(D);return Lt(B.x,B.y,t.pitchedLabelPlaneMatrix,t.getElevation).point}if(a){let D=Fi(t.tileAnchorPoint.x+1,t.tileAnchorPoint.y,t).point.sub(_),B=Math.atan(D.y/D.x)+(D.x<0?Math.PI:0);return _.add(p.rotate(B))}return _.add(p)}function Ca(_,t,a,p,f,b,P,D,B,U,$,Y){let ee=_.text.placedSymbolArray,oe=_.text.dynamicLayoutVertexArray,_e=_.icon.dynamicLayoutVertexArray,Ie={};oe.clear();for(let ze=0;ze<ee.length;ze++){let Ee=ee.get(ze),De=Ee.hidden||!Ee.crossTileID||_.allowVerticalPlacement&&!Ee.placedOrientation?null:p[Ee.crossTileID];if(De){let je=new o.P(Ee.anchorX,Ee.anchorY),Le={getElevation:Y,width:f.width,height:f.height,pitchedLabelPlaneMatrix:b,pitchWithMap:a,transform:f,tileAnchorPoint:je,translation:U,unwrappedTileID:$},we=a?Sr(je.x,je.y,Le):Fi(je.x,je.y,Le),qe=gi(f.cameraToCenterDistance,we.signedDistanceFromCamera),Fe=o.ay(_.textSizeData,D,Ee)*qe/o.aJ;a&&(Fe*=_.tilePixelRatio/P);let{width:it,height:ft,anchor:_t,textOffset:Rt,textBoxScale:Dt}=De,_i=ds(_t,it,ft,Rt,Dt,Fe),Gt=f.getPitchedTextCorrection(je.x+U[0],je.y+U[1],$),Et=io(we.point,Le,t,_i,-f.bearingInRadians,Gt),ti=_.allowVerticalPlacement&&Ee.placedOrientation===o.ax.vertical?Math.PI/2:0;for(let Ci=0;Ci<Ee.numGlyphs;Ci++)o.aD(oe,Et,ti);B&&Ee.associatedIconIndex>=0&&(Ie[Ee.associatedIconIndex]={shiftedAnchor:Et,angle:ti})}else Ss(Ee.numGlyphs,oe)}if(B){_e.clear();let ze=_.icon.placedSymbolArray;for(let Ee=0;Ee<ze.length;Ee++){let De=ze.get(Ee);if(De.hidden)Ss(De.numGlyphs,_e);else{let je=Ie[Ee];if(je)for(let Le=0;Le<De.numGlyphs;Le++)o.aD(_e,je.shiftedAnchor,je.angle);else Ss(De.numGlyphs,_e)}}_.icon.dynamicLayoutVertexBuffer.updateData(_e)}_.text.dynamicLayoutVertexBuffer.updateData(oe)}function ms(_,t,a){return a.iconsInText&&t?"symbolTextAndIcon":_?"symbolSDF":"symbolIcon"}function Ch(_,t,a,p,f,b,P,D,B,U,$,Y,ee){var oe,_e;let Ie=_.context,ze=Ie.gl,Ee=_.transform,De=D==="map",je=B==="map",Le=D!=="viewport"&&a.layout.get("symbol-placement")!=="point",we=De&&!je&&!Le,qe=!a.layout.get("symbol-sort-key").isConstant(),Fe=!1,it=_.getDepthModeForSublayer(0,Zi.ReadOnly),ft=a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"),_t=[],Rt=Ee.getCircleRadiusCorrection();for(let Gt of p){let Et=t.getTile(Gt),ti=Et.getBucket(a);if(!ti)continue;let Ci=f?ti.text:ti.icon;if(!Ci?.segments.get().length||!Ci.hasVisibleVertices)continue;let fr=Ci.programConfigurations.get(a.id),Pn=f||ti.sdfIcons,kr=f?ti.textSizeData:ti.iconSizeData,qn=je||Ee.pitch!==0,kn=_.useProgram(ms(Pn,f,ti),fr),ho=o.aw(kr,Ee.zoom),tn=(oe=_.style.map.terrain)===null||oe===void 0?void 0:oe.getTerrainData(Gt),sa,Eo,uo,jo,gc=[0,0],la=null;if(f)Eo=Et.glyphAtlasTexture,uo=ze.LINEAR,sa=Et.glyphAtlasTexture.size,ti.iconsInText&&(gc=Et.imageAtlasTexture.size,la=Et.imageAtlasTexture,jo=qn||_.options.rotating||_.options.zooming||kr.kind==="composite"||kr.kind==="camera"?ze.LINEAR:ze.NEAREST);else{let Yr=a.layout.get("icon-size").constantOr(0)!==1||ti.iconsNeedLinear;Eo=Et.imageAtlasTexture,uo=Pn||_.options.rotating||_.options.zooming||Yr||qn?ze.LINEAR:ze.NEAREST,sa=Et.imageAtlasTexture.size}let _c=o.aK(Et,1,_.transform.zoom),Mo=pt(De,_.transform,_c),Aa=zt(je,De,_.transform,_c),yc=o.aL(Ee,Et,b,P),Vu=Ee.getProjectionData({overscaledTileID:Gt,applyGlobeMatrix:!ee,applyTerrainMatrix:!0}),pl=ft&&ti.hasTextData(),Vs=a.layout.get("icon-text-fit")!=="none"&&pl&&ti.hasIconData();if(Le){let Yr=o.O();ke(Yr,Mo);let Ns=_.style.map.terrain?(ql,Ap)=>_.style.map.terrain.getElevation(Gt,ql,Ap):null,Lh=a.layout.get("text-rotation-alignment")==="map";zi(ti,_,f,Mo,Yr,je,U,Lh,Gt.toUnwrapped(),Ee.width,Ee.height,yc,Ns)}let za=f&&ft||Vs,ys=Le||za?sl:je?Mo:_.transform.clipSpaceToPixelsMatrix,dn=Pn&&a.paint.get(f?"text-halo-width":"icon-halo-width").constantOr(1)!==0,Kr;Kr=Pn?ti.iconsInText?iu(kr.kind,ho,we,je,Le,za,_,ys,Aa,yc,sa,gc,Rt):To(kr.kind,ho,we,je,Le,za,_,ys,Aa,yc,f,sa,dn,Rt):rl(kr.kind,ho,we,je,Le,za,_,ys,Aa,yc,f,sa,Rt);let Yn={program:kn,buffers:Ci,uniformValues:Kr,projectionData:Vu,atlasTexture:Eo,atlasTextureIcon:la,atlasInterpolation:uo,atlasInterpolationIcon:jo,isSDF:Pn,hasHalo:dn};if(qe&&ti.canOverlap){Fe=!0;let Yr=Ci.segments.get();
798for(let Ns of Yr)_t.push({segments:new o.aV([Ns]),sortKey:Ns.sortKey,state:Yn,terrainData:tn})}else _t.push({segments:Ci.segments,sortKey:0,state:Yn,terrainData:tn})}Fe&&_t.sort(((Gt,Et)=>Gt.sortKey-Et.sortKey));let Dt=(_e=a.paint.get(f?"text-halo-width":"icon-halo-width").constantOr(null))!==null&&_e!==void 0?_e:1/0,_i=a.layout.get("text-letter-spacing").constantOr(0)*o.aJ<0||Dt>1;for(let Gt of _t){let Et=Gt.state;Ie.activeTexture.set(ze.TEXTURE0),Et.atlasTexture.bind(Et.atlasInterpolation,ze.CLAMP_TO_EDGE),Et.atlasTextureIcon&&(Ie.activeTexture.set(ze.TEXTURE1),Et.atlasTextureIcon&&Et.atlasTextureIcon.bind(Et.atlasInterpolationIcon,ze.CLAMP_TO_EDGE));let ti=Et.isSDF&&Et.hasHalo;if(ti){let Ci=Et.uniformValues;Ci.u_is_halo=1,_i&&(Ci.u_is_plain=0,Ea(Et.buffers,Gt.segments,a,_,Et.program,it,$,Y,Ci,Et.projectionData,Gt.terrainData),Ci.u_is_halo=0,Ci.u_is_plain=1)}Ea(Et.buffers,Gt.segments,a,_,Et.program,it,$,Y,Et.uniformValues,Et.projectionData,Gt.terrainData),ti&&!_i&&(Et.uniformValues.u_is_halo=0)}}function Ea(_,t,a,p,f,b,P,D,B,U,$){let Y=p.context;f.draw(Y,Y.gl.TRIANGLES,b,P,D,ar.backCCW,B,$,U,a.id,_.layoutVertexBuffer,_.indexBuffer,t,a.paint,p.transform.zoom,_.programConfigurations.get(a.id),_.dynamicLayoutVertexBuffer,_.opacityVertexBuffer)}function Xr(_,t,a,p,f){let b=_.context,P=b.gl,D=hr.disabled,B=new br([P.ONE,P.ONE],o.bo.transparent,[!0,!0,!0,!0]),U=t.getBucket(a);if(!U)return;let $=p.key,Y=a.heatmapFbos.get($);Y||(Y=$c(b,t.tileSize,t.tileSize),a.heatmapFbos.set($,Y)),b.bindFramebuffer.set(Y.framebuffer),b.viewport.set([0,0,t.tileSize,t.tileSize]),b.clear({color:o.bo.transparent});let ee=U.programConfigurations.get(a.id),oe=_.useProgram("heatmap",ee,!f),_e=_.transform.getProjectionData({overscaledTileID:t.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),Ie=_.style.map.terrain.getTerrainData(p);oe.draw(b,P.TRIANGLES,Zi.disabled,D,B,ar.disabled,Fc(t,_.transform.zoom,a.paint.get("heatmap-intensity"),1),Ie,_e,a.id,U.layoutVertexBuffer,U.indexBuffer,U.segments,a.paint,_.transform.zoom,ee)}function wn(_,t,a,p,f){let b=_.context,P=b.gl,D=_.transform;b.setColorMode(_.colorModeForRenderPass());let B=Wa(b,t),U=a.key,$=t.heatmapFbos.get(U);if(!$)return;b.activeTexture.set(P.TEXTURE0),P.bindTexture(P.TEXTURE_2D,$.colorAttachment.get()),b.activeTexture.set(P.TEXTURE1),B.bind(P.LINEAR,P.CLAMP_TO_EDGE);let Y=D.getProjectionData({overscaledTileID:a,applyTerrainMatrix:f,applyGlobeMatrix:!p});_.useProgram("heatmapTexture").draw(b,P.TRIANGLES,Zi.disabled,hr.disabled,_.colorModeForRenderPass(),ar.disabled,As(_,t,0,1),null,Y,t.id,_.rasterBoundsBuffer,_.quadTriangleIndexBuffer,_.rasterBoundsSegments,t.paint,D.zoom),$.destroy(),t.heatmapFbos.delete(U)}function $c(_,t,a){var p,f;let b=_.gl,P=b.createTexture();b.bindTexture(b.TEXTURE_2D,P),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR);let D=(p=_.HALF_FLOAT)!==null&&p!==void 0?p:b.UNSIGNED_BYTE,B=(f=_.RGBA16F)!==null&&f!==void 0?f:b.RGBA;b.texImage2D(b.TEXTURE_2D,0,B,t,a,0,b.RGBA,D,null);
vendor: 4,524 bytes, line 798
798let U=_.createFramebuffer(t,a,!1,!1);return U.colorAttachment.set(P),U}function Wa(_,t){return t.colorRampTexture||(t.colorRampTexture=new o.T(_,t.colorRamp,_.gl.RGBA)),t.colorRampTexture}function T(_,t,a,p,f,b,P,D){let B=256;if(f.stepInterpolant){let U=t.getSource().maxzoom,$=P.canonical.z===U?Math.ceil(1<<_.transform.maxZoom-P.canonical.z):1;B=o.al(o.ce(b.maxLineLength/o.a6*1024*$),256,a.maxTextureSize)}return D.gradient=o.cf({expression:f.gradientExpression(),evaluationKey:"lineProgress",resolution:B,image:D.gradient||void 0,clips:b.lineClipsArray}),D.texture?D.texture.update(D.gradient):D.texture=new o.T(a,D.gradient,p.RGBA),D.version=f.gradientVersion,D.texture}function s(_,t,a,p,f){_.activeTexture.set(t.TEXTURE0),a.imageAtlasTexture.bind(t.LINEAR,t.CLAMP_TO_EDGE),p.updatePaintBuffers(f)}function d(_,t,a,p,f,b){(f||_.lineAtlas.dirty)&&(t.activeTexture.set(a.TEXTURE0),_.lineAtlas.bind(t)),p.updatePaintBuffers(b)}function v(_,t,a,p,f,b,P){let D=b.gradients[f.id],B=D.texture;f.gradientVersion!==D.version&&(B=T(_,t,a,p,f,b,P,D)),a.activeTexture.set(p.TEXTURE0),B.bind(f.stepInterpolant?p.NEAREST:p.LINEAR,p.CLAMP_TO_EDGE)}function S(_,t,a,p,f,b,P,D,B){let U=b.gradients[f.id],$=U.texture;f.gradientVersion!==U.version&&($=T(_,t,a,p,f,b,P,U)),a.activeTexture.set(p.TEXTURE0),$.bind(f.stepInterpolant?p.NEAREST:p.LINEAR,p.CLAMP_TO_EDGE),a.activeTexture.set(p.TEXTURE1),_.lineAtlas.bind(a),D.updatePaintBuffers(B)}function z(_,t,a,p,f){if(!a||!p?.imageAtlas)return;let b=p.imageAtlas.patternPositions,P=b[a.to.toString()],D=b[a.from.toString()];if(!P&&D&&(P=D),!D&&P&&(D=P),!P||!D){let B=f.getPaintProperty(t);P=b[B],D=b[B]}P&&D&&_.setConstantPatternPositions(P,D)}function j(_,t,a,p,f,b,P,D){var B;let U=_.context.gl,$="fill-pattern",Y=a.paint.get($),ee=Y?.constantOr(1),oe=a.getCrossfadeParameters(),_e,Ie,ze,Ee,De,je=_.transform,Le=a.paint.get("fill-translate"),we=a.paint.get("fill-translate-anchor");P?(Ie=ee&&!a.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",_e=U.LINES):(Ie=ee?"fillPattern":"fill",_e=U.TRIANGLES);let qe=Y.constantOr(null);for(let Fe of p){let it=t.getTile(Fe);if(ee&&!it.patternsLoaded())continue;let ft=it.getBucket(a);if(!ft)continue;let _t=ft.programConfigurations.get(a.id),Rt=_.useProgram(Ie,_t),Dt=(B=_.style.map.terrain)===null||B===void 0?void 0:B.getTerrainData(Fe);ee&&(_.context.activeTexture.set(U.TEXTURE0),it.imageAtlasTexture.bind(U.LINEAR,U.CLAMP_TO_EDGE),_t.updatePaintBuffers(oe)),z(_t,$,qe,it,a);let _i=je.getProjectionData({overscaledTileID:Fe,applyGlobeMatrix:!D,applyTerrainMatrix:!0}),Gt=o.aL(je,it,Le,we);if(P){Ee=ft.indexBuffer2,De=ft.segments2;let ti=[U.drawingBufferWidth,U.drawingBufferHeight];ze=Ie==="fillOutlinePattern"&&ee?Cu(_,oe,it,ti,Gt):Ll(ti,Gt)}else Ee=ft.indexBuffer,De=ft.segments,ze=ee?tl(_,oe,it,Gt):{u_fill_translate:Gt};let Et=_.stencilModeForClipping(Fe);Rt.draw(_.context,_e,f,Et,b,ar.backCCW,ze,Dt,_i,a.id,ft.layoutVertexBuffer,Ee,De,a.paint,_.transform.zoom,_t)}}function W(_,t,a,p,f,b,P,D){var B;let U=_.context,$=U.gl,Y="fill-extrusion-pattern",ee=a.paint.get(Y),oe=ee.constantOr(1),_e=a.getCrossfadeParameters(),Ie=a.paint.get("fill-extrusion-opacity"),ze=ee.constantOr(null),Ee=_.transform;for(let De of p){let je=t.getTile(De),Le=je.getBucket(a);if(!Le)continue;let we=(B=_.style.map.terrain)===null||B===void 0?void 0:B.getTerrainData(De),qe=Le.programConfigurations.get(a.id),Fe=_.useProgram(oe?"fillExtrusionPattern":"fillExtrusion",qe);oe&&(_.context.activeTexture.set($.TEXTURE0),je.imageAtlasTexture.bind($.LINEAR,$.CLAMP_TO_EDGE),qe.updatePaintBuffers(_e));let it=Ee.getProjectionData({overscaledTileID:De,applyGlobeMatrix:!D,applyTerrainMatrix:!0});z(qe,Y,ze,je,a);let ft=o.aL(Ee,je,a.paint.get("fill-extrusion-translate"),a.paint.get("fill-extrusion-translate-anchor")),_t=a.paint.get("fill-extrusion-vertical-gradient"),Rt=oe?el(_,_t,Ie,ft,De,_e,je):Jh(_,_t,Ie,ft);Fe.draw(U,U.gl.TRIANGLES,f,b,P,ar.backCCW,Rt,we,it,a.id,Le.layoutVertexBuffer,Le.indexBuffer,Le.segments,a.paint,_.transform.zoom,qe,_.style.map.terrain&&Le.centroidVertexBuffer)}}function K(_,t,a,p,f,b,P,D,B){var U;let $=_.style.projection,Y=_.context,ee=_.transform,oe=Y.gl,_e=[`#define NUM_ILLUMINATION_SOURCES ${a.paint.get("hillshade-highlight-color").values.length}`],Ie=_.useProgram("hillshade",null,!1,_e),ze=!_.options.moving;for(let Ee of p){let De=t.getTile(Ee),je=De.fbo;if(!je)continue;let Le=$.getMeshFromTileID(Y,Ee.canonical,D,!0,"raster"),we=(U=_.style.map.terrain)===null||U===void 0?void 0:U.getTerrainData(Ee);
798Y.activeTexture.set(oe.TEXTURE0),oe.bindTexture(oe.TEXTURE_2D,je.colorAttachment.get());let qe=ee.getProjectionData({overscaledTileID:Ee,aligned:ze,applyGlobeMatrix:!B,applyTerrainMatrix:!0});Ie.draw(Y,oe.TRIANGLES,b,f[Ee.overscaledZ],P,ar.backCCW,Bc(_,De,a),we,qe,a.id,Le.vertexBuffer,Le.indexBuffer,Le.segments)}}let Q=0;function le(_,t,a,p,f,b,P,D,B){var U;let $=_.style.projection,Y=_.context,ee=_.transform,oe=Y.gl,_e=_.useProgram("colorRelief"),Ie=!_.options.moving,ze=a.paint.get("resampling")==="nearest"?oe.NEAREST:oe.LINEAR,Ee=!0,De=0;for(let je of p){let Le=t.getTile(je),we=Le.dem;if(Ee){Q||(Q=oe.getParameter(oe.MAX_TEXTURE_SIZE));let Rt=Q,{elevationTexture:Dt,colorTexture:_i}=a.getColorRampTextures(Y,Rt,we.getUnpackVector());Y.activeTexture.set(oe.TEXTURE1),Dt.bind(oe.NEAREST,oe.CLAMP_TO_EDGE),Y.activeTexture.set(oe.TEXTURE4),_i.bind(oe.LINEAR,oe.CLAMP_TO_EDGE),Ee=!1,De=Dt.size[0]}if(!we?.data)continue;let qe=we.stride,Fe=we.getPixels();if(Y.activeTexture.set(oe.TEXTURE0),Y.pixelStoreUnpackPremultiplyAlpha.set(!1),Le.demTexture||(Le.demTexture=_.getTileTexture(qe)),Le.demTexture){let Rt=Le.demTexture;Rt.update(Fe,{premultiply:!1}),Rt.bind(ze,oe.CLAMP_TO_EDGE)}else Le.demTexture=new o.T(Y,Fe,oe.RGBA,{premultiply:!1}),Le.demTexture.bind(ze,oe.CLAMP_TO_EDGE);let it=$.getMeshFromTileID(Y,je.canonical,D,!0,"raster"),ft=(U=_.style.map.terrain)===null||U===void 0?void 0:U.getTerrainData(je),_t=ee.getProjectionData({overscaledTileID:je,aligned:Ie,applyGlobeMatrix:!B,applyTerrainMatrix:!0});_e.draw(Y,oe.TRIANGLES,b,f[je.overscaledZ],P,ar.backCCW,Eu(a,Le.dem,De),ft,_t,a.id,it.vertexBuffer,it.indexBuffer,it.segments)}}let he=[new o.P(0,0),new o.P(o.a6,0),new o.P(o.a6,o.a6),new o.P(0,o.a6)];function fe(_,t,a,p,f,b,P,D,B=!1,U=!1){var $;let Y=p[p.length-1].overscaledZ,ee=_.context,oe=ee.gl,_e=_.useProgram("raster"),Ie=_.transform,ze=_.style.projection,Ee=_.colorModeForRenderPass(),De=!_.options.moving,je=a.paint.get("raster-opacity"),Le=a.paint.get("resampling")==="nearest"||a.paint.get("raster-resampling")==="nearest"?oe.NEAREST:oe.LINEAR,we=a.paint.get("raster-fade-duration"),qe=!!_.style.map.terrain;for(let Fe of p){let it=_.getDepthModeForSublayer(Fe.overscaledZ-Y,je===1?Zi.ReadWrite:Zi.ReadOnly,oe.LESS),ft=t.getTile(Fe);ee.activeTexture.set(oe.TEXTURE0),ft.texture.bind(Le,oe.CLAMP_TO_EDGE,oe.LINEAR_MIPMAP_NEAREST),ee.activeTexture.set(oe.TEXTURE1);let{parentTile:_t,parentScaleBy:Rt,parentTopLeft:Dt,fadeValues:_i}=Re(ft,t,we,qe);ft.fadeOpacity=_i.tileOpacity,_t?(_t.fadeOpacity=_i.parentTileOpacity,_t.texture.bind(Le,oe.CLAMP_TO_EDGE,oe.LINEAR_MIPMAP_NEAREST)):ft.texture.bind(Le,oe.CLAMP_TO_EDGE,oe.LINEAR_MIPMAP_NEAREST),ft.texture.useMipmap&&ee.extTextureFilterAnisotropic&&_.transform.pitch>_.options.anisotropicFilterPitch&&oe.texParameterf(oe.TEXTURE_2D,ee.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,ee.extTextureFilterAnisotropicMax);let Gt=($=_.style.map.terrain)===null||$===void 0?void 0:$.getTerrainData(Fe),Et=Ie.getProjectionData({overscaledTileID:Fe,aligned:De,applyGlobeMatrix:!U,applyTerrainMatrix:!0}),ti=Ol(Dt,Rt,_i.fadeMix,a,D),Ci=ze.getMeshFromTileID(ee,Fe.canonical,b,P,"raster");_e.draw(ee,oe.TRIANGLES,it,f?f[Fe.overscaledZ]:hr.disabled,Ee,B?ar.frontCCW:ar.backCCW,ti,Gt,Et,a.id,Ci.vertexBuffer,Ci.indexBuffer,Ci.segments)}}function Re(_,t,a,p){let f={parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:{tileOpacity:1,parentTileOpacity:1,fadeMix:{opacity:1,mix:0}}};if(a===0||p)return f;if(_.fadingParentID){let b=t.getLoadedTile(_.fadingParentID);if(!b)return f;let P=Math.pow(2,b.tileID.overscaledZ-_.tileID.overscaledZ),D=[_.tileID.canonical.x*P%1,_.tileID.canonical.y*P%1],B=(function(U,$,Y){let ee=Mt(),oe=(ee-$.timeAdded)/Y,_e=U.fadingDirection===Zr.Incoming,Ie=o.al((ee-U.timeAdded)/Y,0,1),ze=o.al(1-oe,0,1),Ee=_e?Ie:ze;return{tileOpacity:Ee,parentTileOpacity:_e?ze:Ie,fadeMix:{opacity:1,mix:1-Ee}}})(_,b,a);return{parentTile:b,parentScaleBy:P,parentTopLeft:D,fadeValues:B}}if(_.selfFading){let b=(function(P,D){let B=(Mt()-P.timeAdded)/D,U=o.al(B,0,1);return{tileOpacity:U,fadeMix:{opacity:U,mix:0}}})(_,a);return{parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:b}}return f}let Me=new o.bo(1,0,0,1),Ae=new o.bo(0,1,0,1),Xe=new o.bo(0,0,1,1),et=new o.bo(1,0,1,1),rt=new o.bo(0,1,1,1);function Be(_,t,a,p){ot(_,0,t+a/2,_.transform.width,a,p)}function ht(_,t,a,p){ot(_,t-a/2,0,a,_.transform.height,p)}function ot(_,t,a,p,f,b){let P=_.context,D=P.gl;D.enable(D.SCISSOR_TEST),D.scissor(t*_.pixelRatio,a*_.pixelRatio,p*_.pixelRatio,f*_.pixelRatio),P.clear({color:b}),D.disable(D.SCISSOR_TEST)}function wt(_,t,a){var p;let f=_.context,b=f.gl,P=_.useProgram("debug"),D=Zi.disabled,B=hr.disabled,U=_.colorModeForRenderPass(),$="$debug",Y=(p=_.style.map.terrain)===null||p===void 0?void 0:p.getTerrainData(a);f.activeTexture.set(b.TEXTURE0);let ee=t.getTileByID(a.key).latestRawTileData,oe=Math.floor((ee?.byteLength||0)/1024),_e=t.getTile(a).tileSize,Ie=512/Math.min(_e,512)*(a.overscaledZ/_.transform.zoom)*.5,ze=a.canonical.toString();a.overscaledZ!==a.canonical.z&&(ze+=` => ${a.overscaledZ}`),(function(De,je){De.initDebugOverlayCanvas();let Le=De.debugOverlayCanvas,we=De.context.gl,qe=De.debugOverlayCanvas.getContext("2d");qe.clearRect(0,0,Le.width,Le.height),qe.shadowColor="white",qe.shadowBlur=2,qe.lineWidth=1.5,qe.strokeStyle="white",qe.textBaseline="top",qe.font="bold 36px Open Sans, sans-serif",qe.fillText(je,5,5),qe.strokeText(je,5,5),De.debugOverlayTexture.update(Le),De.debugOverlayTexture.bind(we.LINEAR,we.CLAMP_TO_EDGE)})(_,`${ze} ${oe}kB`);let Ee=_.transform.getProjectionData({overscaledTileID:a,applyGlobeMatrix:!0,applyTerrainMatrix:!0});P.draw(f,b.TRIANGLES,D,B,br.alphaBlended,ar.disabled,Rl(o.bo.transparent,Ie),null,Ee,$,_.debugBuffer,_.quadTriangleIndexBuffer,_.debugSegments),P.draw(f,b.LINE_STRIP,D,B,U,ar.disabled,Rl(o.bo.red),Y,Ee,$,_.debugBuffer,_.tileBorderIndexBuffer,_.debugSegments)}function Tt(_,t,a,p){let{isRenderingGlobe:f}=p,b=_.context,P=b.gl,D=_.transform,B=_.colorModeForRenderPass(),U=_.getDepthModeFor3D(),$=_.useProgram("terrain");b.bindFramebuffer.set(null),b.viewport.set([0,0,_.width,_.height]);for(let Y of a){let ee=t.getTerrainMesh(Y.tileID),oe=_.renderToTexture.getTexture(Y),_e=t.getTerrainData(Y.tileID);b.activeTexture.set(P.TEXTURE0),P.bindTexture(P.TEXTURE_2D,oe.texture);let Ie=t.getMeshFrameDelta(D.zoom),ze=D.calculateFogMatrix(Y.tileID.toUnwrapped()),Ee=Dl(Ie,ze,_.style.sky,D.pitch,f),De=D.getProjectionData({overscaledTileID:Y.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});$.draw(b,P.TRIANGLES,U,hr.disabled,B,ar.backCCW,Ee,_e,De,"terrain",ee.vertexBuffer,ee.indexBuffer,ee.segments)}}function Ft(_,t){if(!t.mesh){let a=new o.aU;a.emplaceBack(-1,-1),a.emplaceBack(1,-1),a.emplaceBack(1,1),a.emplaceBack(-1,1);let p=new o.aW;p.emplaceBack(0,1,2),p.emplaceBack(0,2,3),t.mesh=new Cr(_.createVertexBuffer(a,cs.members),_.createIndexBuffer(p),o.aV.simpleSegment(0,0,a.length,p.length))}return t.mesh}let gt={symbol:function(_,t,a,p,f,b){if(_.renderPass!=="translucent")return;let{isRenderingToTexture:P}=b,D=hr.disabled,B=_.colorModeForRenderPass();(a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&(function(U,$,Y,ee,oe,_e,Ie,ze,Ee){var De;let je=$.transform,Le=$.style.map.terrain,we=oe==="map",qe=_e==="map";for(let Fe of U){let it=ee.getTile(Fe),ft=it.getBucket(Y);if(!(!((De=ft?.text)===null||De===void 0)&&De.segments.get().length))continue;let _t=o.aw(ft.textSizeData,je.zoom),Rt=o.aK(it,1,$.transform.zoom),Dt=pt(we,$.transform,Rt),_i=Y.layout.get("icon-text-fit")!=="none"&&ft.hasIconData();
vendor: 24,974 bytes, lines 798-800
798if(_t){let Gt=Math.pow(2,je.zoom-it.tileID.overscaledZ),Et=Le?(ti,Ci)=>Le.getElevation(Fe,ti,Ci):null;Ca(ft,we,qe,Ee,je,Dt,Gt,_t,_i,o.aL(je,it,Ie,ze),Fe.toUnwrapped(),Et)}}})(p,_,a,t,a.layout.get("text-rotation-alignment"),a.layout.get("text-pitch-alignment"),a.paint.get("text-translate"),a.paint.get("text-translate-anchor"),f),a.paint.get("icon-opacity").constantOr(1)!==0&&Ch(_,t,a,p,!1,a.paint.get("icon-translate"),a.paint.get("icon-translate-anchor"),a.layout.get("icon-rotation-alignment"),a.layout.get("icon-pitch-alignment"),a.layout.get("icon-keep-upright"),D,B,P),a.paint.get("text-opacity").constantOr(1)!==0&&Ch(_,t,a,p,!0,a.paint.get("text-translate"),a.paint.get("text-translate-anchor"),a.layout.get("text-rotation-alignment"),a.layout.get("text-pitch-alignment"),a.layout.get("text-keep-upright"),D,B,P),t.map.showCollisionBoxes&&(Za(_,t,a,p,!0),Za(_,t,a,p,!1))},circle:function(_,t,a,p,f){var b;if(_.renderPass!=="translucent")return;let{isRenderingToTexture:P}=f,D=a.paint.get("circle-opacity"),B=a.paint.get("circle-stroke-width"),U=a.paint.get("circle-stroke-opacity"),$=!a.layout.get("circle-sort-key").isConstant();if(D.constantOr(1)===0&&(B.constantOr(1)===0||U.constantOr(1)===0))return;let Y=_.context,ee=Y.gl,oe=_.transform,_e=_.getDepthModeForSublayer(0,Zi.ReadOnly),Ie=hr.disabled,ze=_.colorModeForRenderPass(),Ee=[],De=oe.getCircleRadiusCorrection();for(let je of p){let Le=t.getTile(je),we=Le.getBucket(a);if(!we)continue;let qe=a.paint.get("circle-translate"),Fe=a.paint.get("circle-translate-anchor"),it=o.aL(oe,Le,qe,Fe),ft=we.programConfigurations.get(a.id),_t=_.useProgram("circle",ft),Rt=we.layoutVertexBuffer,Dt=we.indexBuffer,_i=(b=_.style.map.terrain)===null||b===void 0?void 0:b.getTerrainData(je),Gt={programConfiguration:ft,program:_t,layoutVertexBuffer:Rt,indexBuffer:Dt,uniformValues:Rc(_,Le,a,it,De),terrainData:_i,projectionData:oe.getProjectionData({overscaledTileID:je,applyGlobeMatrix:!P,applyTerrainMatrix:!0})};if($){let Et=we.segments.get();for(let ti of Et)Ee.push({segments:new o.aV([ti]),sortKey:ti.sortKey,state:Gt})}else Ee.push({segments:we.segments,sortKey:0,state:Gt})}$&&Ee.sort(((je,Le)=>je.sortKey-Le.sortKey));for(let je of Ee){let{programConfiguration:Le,program:we,layoutVertexBuffer:qe,indexBuffer:Fe,uniformValues:it,terrainData:ft,projectionData:_t}=je.state;we.draw(Y,ee.TRIANGLES,_e,Ie,ze,ar.backCCW,it,ft,_t,a.id,qe,Fe,je.segments,a.paint,_.transform.zoom,Le)}},heatmap:function(_,t,a,p,f){if(a.paint.get("heatmap-opacity")===0)return;let b=_.context,{isRenderingToTexture:P,isRenderingGlobe:D}=f;if(_.style.map.terrain){for(let B of p){let U=t.getTile(B);t.hasRenderableParent(B)||(_.renderPass==="offscreen"?Xr(_,U,a,B,D):_.renderPass==="translucent"&&wn(_,a,B,P,D))}b.viewport.set([0,0,_.width,_.height])}else _.renderPass==="offscreen"?(function(B,U,$,Y){let ee=B.context,oe=ee.gl,_e=B.transform,Ie=hr.disabled,ze=new br([oe.ONE,oe.ONE],o.bo.transparent,[!0,!0,!0,!0]);(function(Ee,De,je){let Le=Ee.gl;Ee.activeTexture.set(Le.TEXTURE1),Ee.viewport.set([0,0,De.width/4,De.height/4]);let we=je.heatmapFbos.get(o.cd);we?(Le.bindTexture(Le.TEXTURE_2D,we.colorAttachment.get()),Ee.bindFramebuffer.set(we.framebuffer)):(we=$c(Ee,De.width/4,De.height/4),je.heatmapFbos.set(o.cd,we))})(ee,B,$),ee.clear({color:o.bo.transparent});for(let Ee of Y){if(U.hasRenderableParent(Ee))continue;let De=U.getTile(Ee),je=De.getBucket($);if(!je)continue;let Le=je.programConfigurations.get($.id),we=B.useProgram("heatmap",Le),qe=_e.getProjectionData({overscaledTileID:Ee,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),Fe=_e.getCircleRadiusCorrection();we.draw(ee,oe.TRIANGLES,Zi.disabled,Ie,ze,ar.backCCW,Fc(De,_e.zoom,$.paint.get("heatmap-intensity"),Fe),null,qe,$.id,je.layoutVertexBuffer,je.indexBuffer,je.segments,$.paint,_e.zoom,Le)}ee.viewport.set([0,0,B.width,B.height])})(_,t,a,p):_.renderPass==="translucent"&&(function(B,U){let $=B.context,Y=$.gl;$.setColorMode(B.colorModeForRenderPass());let ee=U.heatmapFbos.get(o.cd);ee&&($.activeTexture.set(Y.TEXTURE0),Y.bindTexture(Y.TEXTURE_2D,ee.colorAttachment.get()),$.activeTexture.set(Y.TEXTURE1),Wa($,U).bind(Y.LINEAR,Y.CLAMP_TO_EDGE),B.useProgram("heatmapTexture").draw($,Y.TRIANGLES,Zi.disabled,hr.disabled,B.colorModeForRenderPass(),ar.disabled,As(B,U,0,1),null,null,U.id,B.viewportBuffer,B.quadTriangleIndexBuffer,B.viewportSegments,U.paint,B.transform.zoom))})(_,a)},line:function(_,t,a,p,f){var b;if(_.renderPass!=="translucent")return;let{isRenderingToTexture:P}=f,D=a.paint.get("line-opacity"),B=a.paint.get("line-width");if(D.constantOr(1)===0||B.constantOr(1)===0)return;let U=_.getDepthModeForSublayer(0,Zi.ReadOnly),$=_.colorModeForRenderPass(),Y=a.paint.get("line-dasharray"),ee=Y.constantOr(1),oe=a.paint.get("line-pattern"),_e=oe.constantOr(1),Ie=a.paint.get("line-gradient"),ze=a.getCrossfadeParameters(),Ee;Ee=_e?"linePattern":ee&&Ie?"lineGradientSDF":ee?"lineSDF":Ie?"lineGradient":"line";let De=_.context,je=De.gl,Le=_.transform,we=!0;for(let qe of p){let Fe=t.getTile(qe);if(_e&&!Fe.patternsLoaded())continue;let it=Fe.getBucket(a);if(!it)continue;let ft=it.programConfigurations.get(a.id),_t=_.context.program.get(),Rt=_.useProgram(Ee,ft),Dt=we||Rt.program!==_t,_i=(b=_.style.map.terrain)===null||b===void 0?void 0:b.getTerrainData(qe),Gt=oe.constantOr(null),Et=Y?.constantOr(null);if(Gt&&Fe.imageAtlas){let kr=Fe.imageAtlas,qn=kr.patternPositions[Gt.to.toString()],kn=kr.patternPositions[Gt.from.toString()];qn&&kn&&ft.setConstantPatternPositions(qn,kn)}else if(Et){let kr=a.layout.get("line-cap").constantOr(null)==="round",qn=_.lineAtlas.getDash(Et.to,kr),kn=_.lineAtlas.getDash(Et.from,kr);ft.setConstantDashPositions(qn,kn)}let ti=Le.getProjectionData({overscaledTileID:qe,applyGlobeMatrix:!P,applyTerrainMatrix:!0}),Ci=Le.getPixelScale(),fr;_e?(fr=tu(_,Fe,a,Ci,ze),s(De,je,Fe,ft,ze)):ee&&Ie?(fr=Fl(_,Fe,a,Ci,ze,it.lineClipsArray.length),S(_,t,De,je,a,it,qe,ft,ze)):ee?(fr=xh(_,Fe,a,Ci,ze),d(_,De,je,ft,Dt,ze)):Ie?(fr=eu(_,Fe,a,Ci,it.lineClipsArray.length),v(_,t,De,je,a,it,qe)):fr=Ds(_,Fe,a,Ci);let Pn=_.stencilModeForClipping(qe);Rt.draw(De,je.TRIANGLES,U,Pn,$,ar.disabled,fr,_i,ti,a.id,it.layoutVertexBuffer,it.indexBuffer,it.segments,a.paint,_.transform.zoom,ft,it.layoutVertexBuffer2),we=!1}},fill:function(_,t,a,p,f){let b=a.paint.get("fill-color"),P=a.paint.get("fill-opacity");if(P.constantOr(1)===0)return;let{isRenderingToTexture:D}=f,B=_.colorModeForRenderPass(),U=a.paint.get("fill-pattern"),$=_.opaquePassEnabledForLayer()&&!U.constantOr(1)&&b.constantOr(o.bo.transparent).a===1&&P.constantOr(0)===1?"opaque":"translucent";if(_.renderPass===$){let Y=_.getDepthModeForSublayer(1,_.renderPass==="opaque"?Zi.ReadWrite:Zi.ReadOnly);j(_,t,a,p,Y,B,!1,D)}if(_.renderPass==="translucent"&&a.paint.get("fill-antialias")){let Y=_.getDepthModeForSublayer(a.getPaintProperty("fill-outline-color")?2:0,Zi.ReadOnly);j(_,t,a,p,Y,B,!0,D)}},fillExtrusion:function(_,t,a,p,f){let b=a.paint.get("fill-extrusion-opacity");if(b===0)return;let{isRenderingToTexture:P}=f;if(_.renderPass==="translucent"){let D=new Zi(_.context.gl.LEQUAL,Zi.ReadWrite,_.depthRangeFor3D);if(b!==1||a.paint.get("fill-extrusion-pattern").constantOr(1))W(_,t,a,p,D,hr.disabled,br.disabled,P),W(_,t,a,p,D,_.stencilModeFor3D(),_.colorModeForRenderPass(),P);else{let B=_.colorModeForRenderPass();W(_,t,a,p,D,hr.disabled,B,P)}}},hillshade:function(_,t,a,p,f){if(_.renderPass!=="offscreen"&&_.renderPass!=="translucent")return;let{isRenderingToTexture:b}=f,P=_.context,D=_.style.projection.useSubdivision,B=_.getDepthModeForSublayer(0,Zi.ReadOnly),U=_.colorModeForRenderPass();if(_.renderPass==="offscreen")(function($,Y,ee,oe,_e,Ie,ze){let Ee=$.context,De=Ee.gl,je=oe.paint.get("resampling")==="nearest"?De.NEAREST:De.LINEAR;for(let Le of ee){let we=Y.getTile(Le),qe=we.dem;if(!qe?.data||!we.needsHillshadePrepare)continue;let Fe=qe.dim,it=qe.stride,ft=qe.getPixels();if(Ee.activeTexture.set(De.TEXTURE1),Ee.pixelStoreUnpackPremultiplyAlpha.set(!1),we.demTexture||(we.demTexture=$.getTileTexture(it)),we.demTexture){let Rt=we.demTexture;Rt.update(ft,{premultiply:!1}),Rt.bind(De.NEAREST,De.CLAMP_TO_EDGE)}else we.demTexture=new o.T(Ee,ft,De.RGBA,{premultiply:!1}),we.demTexture.bind(De.NEAREST,De.CLAMP_TO_EDGE);Ee.activeTexture.set(De.TEXTURE0);let _t=we.fbo;if(!_t){let Rt=new o.T(Ee,{width:Fe,height:Fe,data:null},De.RGBA);Rt.bind(je,De.CLAMP_TO_EDGE),_t=we.fbo=Ee.createFramebuffer(Fe,Fe,!0,!1),_t.colorAttachment.set(Rt.texture)}Ee.bindFramebuffer.set(_t.framebuffer),Ee.viewport.set([0,0,Fe,Fe]),$.useProgram("hillshadePrepare").draw(Ee,De.TRIANGLES,_e,Ie,ze,ar.disabled,zs(we.tileID,qe),null,null,oe.id,$.rasterBoundsBuffer,$.quadTriangleIndexBuffer,$.rasterBoundsSegments),we.needsHillshadePrepare=!1}})(_,t,p,a,B,hr.disabled,U),P.viewport.set([0,0,_.width,_.height]);else if(_.renderPass==="translucent")if(D){let[$,Y,ee]=_.stencilConfigForOverlapTwoPass(p);K(_,t,a,ee,$,B,U,!1,b),K(_,t,a,ee,Y,B,U,!0,b)}else{let[$,Y]=_.getStencilConfigForOverlapAndUpdateStencilID(p);K(_,t,a,Y,$,B,U,!1,b)}},colorRelief:function(_,t,a,p,f){if(_.renderPass!=="translucent"||!p.length)return;let{isRenderingToTexture:b}=f,P=_.style.projection.useSubdivision,D=_.getDepthModeForSublayer(0,Zi.ReadOnly),B=_.colorModeForRenderPass();if(P){let[U,$,Y]=_.stencilConfigForOverlapTwoPass(p);le(_,t,a,Y,U,D,B,!1,b),le(_,t,a,Y,$,D,B,!0,b)}else{let[U,$]=_.getStencilConfigForOverlapAndUpdateStencilID(p);le(_,t,a,$,U,D,B,!1,b)}},raster:function(_,t,a,p,f){if(_.renderPass!=="translucent"||a.paint.get("raster-opacity")===0||!p.length)return;let{isRenderingToTexture:b}=f,P=t.getSource(),D=_.style.projection.useSubdivision;if(P instanceof oo)fe(_,t,a,p,null,!1,!1,P.tileCoords,P.flippedWindingOrder,b);else if(D){let[B,U,$]=_.stencilConfigForOverlapTwoPass(p);fe(_,t,a,$,B,!1,!0,he,!1,b),fe(_,t,a,$,U,!0,!0,he,!1,b)}else{let[B,U]=_.getStencilConfigForOverlapAndUpdateStencilID(p);fe(_,t,a,U,B,!1,!0,he,!1,b)}},background:function(_,t,a,p,f){var b;let P=a.paint.get("background-color"),D=a.paint.get("background-opacity");if(D===0)return;let{isRenderingToTexture:B}=f,U=_.context,$=U.gl,Y=_.style.projection,ee=_.transform,oe=ee.tileSize,_e=a.paint.get("background-pattern");if(_.isPatternMissing(_e))return;let Ie=!_e&&P.a===1&&D===1&&_.opaquePassEnabledForLayer()?"opaque":"translucent";if(_.renderPass!==Ie)return;let ze=hr.disabled,Ee=_.getDepthModeForSublayer(0,Ie==="opaque"?Zi.ReadWrite:Zi.ReadOnly),De=_.colorModeForRenderPass(),je=_.useProgram(_e?"backgroundPattern":"background"),Le=p||ao(ee,{tileSize:oe,terrain:_.style.map.terrain});_e&&(U.activeTexture.set($.TEXTURE0),_.imageManager.bind(_.context));let we=a.getCrossfadeParameters();for(let qe of Le){let Fe=ee.getProjectionData({overscaledTileID:qe,applyGlobeMatrix:!B,applyTerrainMatrix:!0}),it=_e?vh(D,_,_e,{tileID:qe,tileSize:oe},we):No(D,P),ft=(b=_.style.map.terrain)===null||b===void 0?void 0:b.getTerrainData(qe),_t=Y.getMeshFromTileID(U,qe.canonical,!1,!0,"raster");je.draw(U,$.TRIANGLES,Ee,ze,De,ar.backCCW,it,ft,Fe,a.id,_t.vertexBuffer,_t.indexBuffer,_t.segments)}},sky:function(_,t){let a=_.context,p=a.gl,f=(($,Y,ee)=>{let oe=Math.cos(Y.rollInRadians),_e=Math.sin(Y.rollInRadians),Ie=Lo(Y),ze=Y.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:$.properties.get("sky-color"),u_horizon_color:$.properties.get("horizon-color"),u_horizon:[(Y.width/2-Ie*_e)*ee,(Y.height/2+Ie*oe)*ee],u_horizon_normal:[-_e,oe],u_sky_horizon_blend:$.properties.get("sky-horizon-blend")*Y.height/2*ee,u_sky_blend:ze}})(t,_.style.map.transform,_.pixelRatio),b=new Zi(p.LEQUAL,Zi.ReadWrite,[0,1]),P=hr.disabled,D=_.colorModeForRenderPass(),B=_.useProgram("sky"),U=Ft(a,t);B.draw(a,p.TRIANGLES,b,P,D,ar.disabled,f,null,void 0,"sky",U.vertexBuffer,U.indexBuffer,U.segments)},atmosphere:function(_,t,a){let p=_.context,f=p.gl,b=_.useProgram("atmosphere"),P=new Zi(f.LEQUAL,Zi.ReadOnly,[0,1]),D=_.transform,B=(function(ze,Ee){let De=ze.properties.get("position"),je=[-De.x,-De.y,-De.z],Le=o.ap(new Float64Array(16));return ze.properties.get("anchor")==="map"&&(o.be(Le,Le,Ee.rollInRadians),o.bf(Le,Le,-Ee.pitchInRadians),o.be(Le,Le,Ee.bearingInRadians),o.bf(Le,Le,Ee.center.lat*Math.PI/180),o.bI(Le,Le,-Ee.center.lng*Math.PI/180)),o.cg(je,je,Le),je})(a,_.transform),U=D.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),$=t.properties.get("atmosphere-blend")*U.projectionTransition;if($===0)return;let Y=lo(D.worldSize,D.center.lat),ee=D.inverseProjectionMatrix,oe=new Float64Array(4);oe[3]=1,o.aE(oe,oe,D.modelViewProjectionMatrix),oe[0]/=oe[3],oe[1]/=oe[3],oe[2]/=oe[3],oe[3]=1,o.aE(oe,oe,ee),oe[0]/=oe[3],oe[1]/=oe[3],oe[2]/=oe[3],oe[3]=1;let _e=((ze,Ee,De,je,Le)=>({u_sun_pos:ze,u_atmosphere_blend:Ee,u_globe_position:De,u_globe_radius:je,u_inv_proj_matrix:Le}))(B,$,[oe[0],oe[1],oe[2]],Y,ee),Ie=Ft(p,t);b.draw(p,f.TRIANGLES,P,hr.disabled,br.alphaBlended,ar.disabled,_e,null,null,"atmosphere",Ie.vertexBuffer,Ie.indexBuffer,Ie.segments)},custom:function(_,t,a,p){let{isRenderingGlobe:f}=p,b=_.context,P=a.implementation,D=_.style.projection,B=_.transform,U=B.getProjectionDataForCustomLayer(f),$={farZ:B.farZ,nearZ:B.nearZ,fov:B.fov*Math.PI/180,modelViewProjectionMatrix:B.modelViewProjectionMatrix,projectionMatrix:B.projectionMatrix,shaderData:{variantName:D.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793; 799uniform mat4 u_projection_matrix; 800${D.shaderPreludeCode.vertexSource}`,define:D.shaderDefine},defaultProjectionData:U},Y=P.renderingMode?P.renderingMode:"2d";if(_.renderPass==="offscreen"){let ee=P.prerender;ee&&(_.setCustomLayerDefaults(),b.setColorMode(_.colorModeForRenderPass()),ee.call(P,b.gl,$),b.setDirty(),_.setBaseState())}else if(_.renderPass==="translucent"){_.setCustomLayerDefaults(),b.setColorMode(_.colorModeForRenderPass()),b.setStencilMode(hr.disabled);let ee=Y==="3d"?_.getDepthModeFor3D():_.getDepthModeForSublayer(0,Zi.ReadOnly);b.setDepthMode(ee),P.render(b.gl,$),b.setDirty(),_.setBaseState(),b.bindFramebuffer.set(null)}},debug:function(_,t,a){for(let p of a)wt(_,t,p)},debugPadding:function(_){let t=_.transform.padding;Be(_,_.transform.height-(t.top||0),3,Me),Be(_,t.bottom||0,3,Ae),ht(_,t.left||0,3,Xe),ht(_,_.transform.width-(t.right||0),3,et);let a=_.transform.centerPoint;(function(p,f,b,P){ot(p,f-1,b-10,2,20,P),ot(p,f-10,b-1,20,2,P)})(_,a.x,_.transform.height-a.y,rt)},terrainDepth:function(_,t){let a=_.context,p=a.gl,f=_.transform,b=br.unblended,P=new Zi(p.LEQUAL,Zi.ReadWrite,[0,1]),D=t.tileManager.getRenderableTiles(),B=_.useProgram("terrainDepth");a.bindFramebuffer.set(t.getFramebuffer("depth").framebuffer),a.viewport.set([0,0,_.width/devicePixelRatio,_.height/devicePixelRatio]),a.clear({color:o.bo.transparent,depth:1});for(let U of D){let $=t.getTerrainMesh(U.tileID),Y=t.getTerrainData(U.tileID),ee=f.getProjectionData({overscaledTileID:U.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),oe={u_ele_delta:t.getMeshFrameDelta(f.zoom)};B.draw(a,p.TRIANGLES,P,hr.disabled,b,ar.backCCW,oe,Y,ee,"terrain",$.vertexBuffer,$.indexBuffer,$.segments)}a.bindFramebuffer.set(null),a.viewport.set([0,0,_.width,_.height])},terrainCoords:function(_,t){let a=_.context,p=a.gl,f=_.transform,b=br.unblended,P=new Zi(p.LEQUAL,Zi.ReadWrite,[0,1]),D=t.getCoordsTexture(),B=t.tileManager.getRenderableTiles(),U=_.useProgram("terrainCoords");a.bindFramebuffer.set(t.getFramebuffer("coords").framebuffer),a.viewport.set([0,0,_.width/devicePixelRatio,_.height/devicePixelRatio]),a.clear({color:o.bo.transparent,depth:1}),t.coordsIndex=[];for(let $ of B){let Y=t.getTerrainMesh($.tileID),ee=t.getTerrainData($.tileID);a.activeTexture.set(p.TEXTURE0),p.bindTexture(p.TEXTURE_2D,D.texture);let oe={u_terrain_coords_id:(255-t.coordsIndex.length)/255,u_texture:0,u_ele_delta:t.getMeshFrameDelta(f.zoom)},_e=f.getProjectionData({overscaledTileID:$.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});U.draw(a,p.TRIANGLES,P,hr.disabled,b,ar.backCCW,oe,ee,_e,"terrain",Y.vertexBuffer,Y.indexBuffer,Y.segments),t.coordsIndex.push($.tileID.key)}a.bindFramebuffer.set(null),a.viewport.set([0,0,_.width,_.height])}};class ri{constructor(t,a){this.drawFunctions=gt,this.context=new xi(t),this.transform=a,this._tileTextures={},this.terrainFacilitator={depthDirty:!0,coordsDirty:!1,matrix:o.ap(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=ve.maxOverzooming+ve.maxUnderzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Fo}resize(t,a,p){if(this.width=Math.floor(t*p),this.height=Math.floor(a*p),this.pixelRatio=p,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let f of this.style._order)this.style._layers[f].resize()}setup(){let t=this.context,a=new o.aU;a.emplaceBack(0,0),a.emplaceBack(o.a6,0),a.emplaceBack(0,o.a6),a.emplaceBack(o.a6,o.a6),this.tileExtentBuffer=t.createVertexBuffer(a,cs.members),this.tileExtentSegments=o.aV.simpleSegment(0,0,4,2);let p=new o.aU;p.emplaceBack(0,0),p.emplaceBack(o.a6,0),p.emplaceBack(0,o.a6),p.emplaceBack(o.a6,o.a6),this.debugBuffer=t.createVertexBuffer(p,cs.members),this.debugSegments=o.aV.simpleSegment(0,0,4,5);let f=new o.ch;f.emplaceBack(0,0,0,0),f.emplaceBack(o.a6,0,o.a6,0),f.emplaceBack(0,o.a6,0,o.a6),f.emplaceBack(o.a6,o.a6,o.a6,o.a6),this.rasterBoundsBuffer=t.createVertexBuffer(f,zl.members),this.rasterBoundsSegments=o.aV.simpleSegment(0,0,4,2);let b=new o.aU;b.emplaceBack(0,0),b.emplaceBack(o.a6,0),b.emplaceBack(0,o.a6),b.emplaceBack(o.a6,o.a6),this.rasterBoundsBufferPosOnly=t.createVertexBuffer(b,cs.members),this.rasterBoundsSegmentsPosOnly=o.aV.simpleSegment(0,0,4,5);let P=new o.aU;P.emplaceBack(0,0),P.emplaceBack(1,0),P.emplaceBack(0,1),P.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(P,cs.members),this.viewportSegments=o.aV.simpleSegment(0,0,4,2);let D=new o.ci;D.emplaceBack(0),D.emplaceBack(1),D.emplaceBack(3),D.emplaceBack(2),D.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(D);let B=new o.aW;B.emplaceBack(1,0,2),B.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(B);let U=this.context.gl;this.stencilClearMode=new hr({func:U.ALWAYS,mask:0},0,255,U.ZERO,U.ZERO,U.ZERO),this.tileExtentMesh=new Cr(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){let t=this.context,a=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let p=o.O();o.c7(p,0,this.width,this.height,0,0,1),o.S(p,p,[a.drawingBufferWidth,a.drawingBufferHeight,0]);let f={mainMatrix:p,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:p};this.useProgram("clippingMask",null,!0).draw(t,a.TRIANGLES,Zi.disabled,this.stencilClearMode,br.disabled,ar.disabled,null,null,f,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,a,p){if(this.currentStencilSource===t.source||!t.isTileClipped()||!a?.length)return;this.currentStencilSource=t.source,this.nextStencilID+a.length>256&&this.clearStencil();let f=this.context;f.setColorMode(br.disabled),f.setDepthMode(Zi.disabled);let b={};for(let P of a)b[P.key]=this.nextStencilID++;this._renderTileMasks(b,a,p,!0),this._renderTileMasks(b,a,p,!1),this._tileClippingMaskIDs=b}_renderTileMasks(t,a,p,f){var b;let P=this.context,D=P.gl,B=this.style.projection,U=this.transform,$=this.useProgram("clippingMask");for(let Y of a){let ee=t[Y.key],oe=(b=this.style.map.terrain)===null||b===void 0?void 0:b.getTerrainData(Y),_e=B.getMeshFromTileID(this.context,Y.canonical,f,!0,"stencil"),Ie=U.getProjectionData({overscaledTileID:Y,applyGlobeMatrix:!p,applyTerrainMatrix:!0});$.draw(P,D.TRIANGLES,Zi.disabled,new hr({func:D.ALWAYS,mask:0},ee,255,D.KEEP,D.KEEP,D.REPLACE),br.disabled,p?ar.disabled:ar.backCCW,null,oe,Ie,"$clipping",_e.vertexBuffer,_e.indexBuffer,_e.segments)}}_renderTilesDepthBuffer(){var t;let a=this.context,p=a.gl,f=this.style.projection,b=this.transform,P=this.useProgram("depth"),D=this.getDepthModeFor3D(),B=ao(b,{tileSize:b.tileSize});for(let U of B){let $=(t=this.style.map.terrain)===null||t===void 0?void 0:t.getTerrainData(U),Y=f.getMeshFromTileID(this.context,U.canonical,!0,!0,"raster"),ee=b.getProjectionData({overscaledTileID:U,applyGlobeMatrix:!0,applyTerrainMatrix:!0});P.draw(a,p.TRIANGLES,D,hr.disabled,br.disabled,ar.backCCW,null,$,ee,"$clipping",Y.vertexBuffer,Y.indexBuffer,Y.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let t=this.nextStencilID++,a=this.context.gl;return new hr({func:a.NOTEQUAL,mask:255},t,255,a.KEEP,a.KEEP,a.REPLACE)}stencilModeForClipping(t){let a=this.context.gl;return new hr({func:a.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,a.KEEP,a.KEEP,a.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(t){let a=this.context.gl,p=t.sort(((P,D)=>D.overscaledZ-P.overscaledZ)),f=p[p.length-1].overscaledZ,b=p[0].overscaledZ-f+1;if(b>1){this.currentStencilSource=void 0,this.nextStencilID+b>256&&this.clearStencil();let P={};for(let D=0;D<b;D++)P[D+f]=new hr({func:a.GEQUAL,mask:255},D+this.nextStencilID,255,a.KEEP,a.KEEP,a.REPLACE);return this.nextStencilID+=b,[P,p]}return[{[f]:hr.disabled},p]}stencilConfigForOverlapTwoPass(t){let a=this.context.gl,p=t.sort(((P,D)=>D.overscaledZ-P.overscaledZ)),f=p[p.length-1].overscaledZ,b=p[0].overscaledZ-f+1;if(this.clearStencil(),b>1){let P={},D={};for(let B=0;B<b;B++)P[B+f]=new hr({func:a.GREATER,mask:255},b+1+B,255,a.KEEP,a.KEEP,a.REPLACE),D[B+f]=new hr({func:a.GREATER,mask:255},1+B,255,a.KEEP,a.KEEP,a.REPLACE);return this.nextStencilID=2*b+1,[P,D,p]}return this.nextStencilID=3,[{[f]:new hr({func:a.GREATER,mask:255},2,255,a.KEEP,a.KEEP,a.REPLACE)},{[f]:new hr({func:a.GREATER,mask:255},1,255,a.KEEP,a.KEEP,a.REPLACE)},p]}colorModeForRenderPass(){let t=this.context.gl;return this._showOverdrawInspector?new br([t.CONSTANT_COLOR,t.ONE],new o.bo(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?br.unblended:br.alphaBlended}getDepthModeForSublayer(t,a,p){if(!this.opaquePassEnabledForLayer())return Zi.disabled;let f=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new Zi(p||this.context.gl.LEQUAL,a,[f,f])}getDepthModeFor3D(){return new Zi(this.context.gl.LEQUAL,Zi.ReadWrite,this.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,a){var p,f,b;this.style=t,this.options=a,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(Mt()),this.imageManager.beginFrame();let P=this.style._order,D=this.style.tileManagers,B={},U={},$={},Y={isRenderingToTexture:!1,isRenderingGlobe:((p=t.projection)===null||p===void 0?void 0:p.transitionState)>0};for(let oe in D){let _e=D[oe];_e.used&&_e.prepare(this.context),B[oe]=_e.getVisibleCoordinates(!1),U[oe]=B[oe].slice().reverse(),$[oe]=_e.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let oe=0;oe<P.length;oe++)if(this.style._layers[P[oe]].is3D()){this.opaquePassCutoff=oe;break}this.maybeDrawDepth(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(let oe of P){let _e=this.style._layers[oe];if(!_e.hasOffscreenPass()||_e.isHidden(this.transform.zoom))continue;let Ie=U[_e.source];(_e.type==="custom"||Ie.length)&&this.renderLayer(this,D[_e.source],_e,Ie,Y)}if((f=this.style.projection)===null||f===void 0||f.updateGPUdependent({context:this.context,useProgram:oe=>this.useProgram(oe)}),this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:a.showOverdrawInspector?o.bo.black:o.bo.transparent,depth:1}),this.clearStencil(),this.style.sky&&this.drawFunctions.sky(this,this.style.sky),this._showOverdrawInspector=a.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=P.length-1;this.currentLayer>=0;this.currentLayer--){let oe=this.style._layers[P[this.currentLayer]],_e=D[oe.source],Ie=B[oe.source];this._renderTileClippingMasks(oe,Ie,!1),this.renderLayer(this,_e,oe,Ie,Y)}this.renderPass="translucent";let ee=!1;for(this.currentLayer=0;this.currentLayer<P.length;this.currentLayer++){let oe=this.style._layers[P[this.currentLayer]],_e=D[oe.source];if(!((b=this.renderToTexture)===null||b===void 0)&&b.renderLayer(oe,Y))continue;this.opaquePassEnabledForLayer()||ee||(ee=!0,Y.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());let Ie=(oe.type==="symbol"?$:U)[oe.source];this._renderTileClippingMasks(oe,B[oe.source],!!this.renderToTexture),this.renderLayer(this,_e,oe,Ie,Y)}if(Y.isRenderingGlobe&&this.drawFunctions.atmosphere(this,this.style.sky,this.style.light),this.options.showTileBoundaries){let oe=(function(_e,Ie){let ze=null,Ee=Object.values(_e._layers).flatMap((we=>we.source&&!we.isHidden(Ie)?[_e.tileManagers[we.source]]:[])),De=Ee.f
800ilter((we=>we.getSource().type==="vector")),je=Ee.filter((we=>we.getSource().type!=="vector")),Le=we=>{(!ze||ze.getSource().maxzoom<we.getSource().maxzoom)&&(ze=we)};for(let we of De)Le(we);if(!ze)for(let we of je)Le(we);return ze})(this.style,this.transform.zoom);oe&&this.drawFunctions.debug(this,oe,oe.getVisibleCoordinates())}this.options.showPadding&&this.drawFunctions.debugPadding(this),this.context.setDefault()}maybeDrawDepth(t){var a,p;if(!(!((p=(a=this.style)===null||a===void 0?void 0:a.map)===null||p===void 0)&&p.terrain))return;let f=this.terrainFacilitator.matrix,b=this.transform.modelViewProjectionMatrix,P=this.terrainFacilitator.depthDirty;P||(P=t?!o.cj(f,b):!o.ck(f,b)),P||(P=this.style.map.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime)),P&&(o.cl(f,b),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.depthDirty=!1,this.terrainFacilitator.coordsDirty=!0,this.drawFunctions.terrainDepth(this,this.style.map.terrain))}maybeDrawCoords(){var t,a;!((a=(t=this.style)===null||t===void 0?void 0:t.map)===null||a===void 0)&&a.terrain&&this.terrainFacilitator.coordsDirty&&(this.terrainFacilitator.coordsDirty=!1,this.drawFunctions.terrainCoords(this,this.style.map.terrain))}renderLayer(t,a,p,f,b){if(p.isHidden(this.transform.zoom)||p.type!=="background"&&p.type!=="custom"&&!(f||[]).length)return;this.id=p.id;let P=this.drawFunctions;o.aQ(p)?P.symbol(t,a,p,f,this.style.placement.variableOffsets,b):o.cm(p)?P.circle(t,a,p,f,b):o.cn(p)?P.heatmap(t,a,p,f,b):o.co(p)?P.line(t,a,p,f,b):o.cp(p)?P.fill(t,a,p,f,b):o.cq(p)?P.fillExtrusion(t,a,p,f,b):o.cr(p)?P.hillshade(t,a,p,f,b):o.cs(p)?P.colorRelief(t,a,p,f,b):o.bU(p)?P.raster(t,a,p,f,b):o.ct(p)?P.background(t,a,p,f,b):o.cu(p)&&P.custom(t,a,p,b)}saveTileTexture(t){let a=this._tileTextures[t.size[0]];a?a.length<ri.MAX_TEXTURE_POOL_SIZE_PER_BUCKET?a.push(t):t.destroy():this._tileTextures[t.size[0]]=[t]}getTileTexture(t){let a=this._tileTextures[t];return a&&a.length>0?a.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;let a=this.imageManager.getPattern(t.from.toString()),p=this.imageManager.getPattern(t.to.toString());return!a||!p}useProgram(t,a,p=!1,f=[]){var b;this.cache||(this.cache={});let P=!!this.style.map.terrain,D=this.style.projection,B=p?Br.projectionMercator:D.shaderPreludeCode,U=p?Xi:D.shaderDefine,$=t+(a?a.cacheKey:"")+`/${p?Bo:D.shaderVariantName}`+(this._showOverdrawInspector?"/overdraw":"")+(P?"/terrain":"")+(f?`/${f.join("/")}`:"");return(b=this.cache)[$]||(b[$]=new Iu(this.context,Br[t],a,Vc[t],this._showOverdrawInspector,P,B,U,f)),this.cache[$]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){let t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new o.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){var t,a;if(this._tileTextures){for(let p in this._tileTextures){let f=this._tileTextures[p];if(f)for(let b of f)b.destroy()}this._tileTextures={}}if(this.tileExtentBuffer&&this.tileExtentBuffer.destroy(),this.debugBuffer&&this.debugBuffer.destroy(),this.rasterBoundsBuffer&&this.rasterBoundsBuffer.destroy(),this.rasterBoundsBufferPosOnly&&this.rasterBoundsBufferPosOnly.destroy(),this.viewportBuffer&&this.viewportBuffer.destroy(),this.tileBorderIndexBuffer&&this.tileBorderIndexBuffer.destroy(),this.quadTriangleIndexBuffer&&this.quadTriangleIndexBuffer.destroy(),this.tileExtentMesh&&((t=this.tileExtentMesh.vertexBuffer)===null||t===void 0||t.destroy()),this.tileExtentMesh&&((a=this.tileExtentMesh.indexBuffer)===null||a===void 0||a.destroy()),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.cache){for(let p in this.cache){let f=this.cache[p];f?.program&&this.context.gl.deleteProgram(f.program)}this.cache={}}this.context&&this.context.setDefault()}overLimit(){let{drawingBufferWidth:t,drawingBufferHeight:a}=this.context.gl;return this.width!==t||this.height!==a}}function Xt(_,t){let a,p=!1,f=null,b=()=>{f=null,p&&(_(...a),f=setTimeout(b,t),p=!1)};return(...P)=>(p=!0,a=P,f||b(),f)}
vendor: 67,291 bytes, line 800
800ri.MAX_TEXTURE_POOL_SIZE_PER_BUCKET=50;class ai{constructor(t){this._getCurrentHash=()=>{let a=window.location.hash.replace("#","");if(this._hashName){let p,f=a.split("&").map((b=>b.split("=")));for(let b of f)b[0]===this._hashName&&(p=b);return(p&&p[1]||"").split("/")}return a.split("/")},this._onHashChange=()=>{let a=this._getCurrentHash();if(!this._isValidHash(a))return!1;let p=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(a[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+a[2],+a[1]],zoom:+a[0],bearing:p,pitch:+(a[4]||0)}),!0},this._updateHashUnthrottled=()=>{let a=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,a)},this._removeHash=()=>{let a=this._getCurrentHash();if(a.length===0)return;let p=a.join("/"),f=p;f.split("&").length>0&&(f=f.split("&")[0]),this._hashName&&(f=`${this._hashName}=${p}`);let b=window.location.hash.replace(f,"");b.startsWith("#&")?b=b.slice(0,1)+b.slice(2):b==="#"&&(b="");let P=window.location.href.replace(/(#.+)?$/,b);P=P.replace("&&","&"),window.history.replaceState(window.history.state,null,P)},this._updateHash=Xt(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(t){let a=this._map.getCenter(),p=Math.round(100*this._map.getZoom())/100,f=Math.ceil((p*Math.LN2+Math.log(512/360/.5))/Math.LN10),b=Math.pow(10,f),P=Math.round(a.lng*b)/b,D=Math.round(a.lat*b)/b,B=this._map.getBearing(),U=this._map.getPitch(),$="";if($+=t?`/${P}/${D}/${p}`:`${p}/${D}/${P}`,(B||U)&&($+="/"+Math.round(10*B)/10),U&&($+=`/${Math.round(U)}`),this._hashName){let Y=this._hashName,ee=!1,oe=window.location.hash.slice(1).split("&").map((_e=>{let Ie=_e.split("=")[0];return Ie===Y?(ee=!0,`${Ie}=${$}`):_e})).filter((_e=>_e));return ee||oe.push(`${Y}=${$}`),`#${oe.join("&")}`}return`#${$}`}_isValidHash(t){if(t.length<3||t.some(isNaN))return!1;try{new o.W(+t[2],+t[1])}catch{return!1}let a=+t[0],p=+(t[3]||0),f=+(t[4]||0);return a>=this._map.getMinZoom()&&a<=this._map.getMaxZoom()&&p>=-180&&p<=180&&f>=this._map.getMinPitch()&&f<=this._map.getMaxPitch()}}let $i={linearity:.3,easing:o.cv(0,0,.3,1)},Ui=o.e({deceleration:2500,maxSpeed:1400},$i),yi=o.e({deceleration:20,maxSpeed:1400},$i),vr=o.e({deceleration:1e3,maxSpeed:360},$i),tr=o.e({deceleration:1e3,maxSpeed:90},$i),cr=o.e({deceleration:1e3,maxSpeed:360},$i);class ur{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:Mt(),settings:t})}_drainInertiaBuffer(){let t=this._inertiaBuffer,a=Mt();for(;t.length>0&&a-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let a={zoom:0,bearing:0,pitch:0,roll:0,pan:new o.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:b}of this._inertiaBuffer)a.zoom+=b.zoomDelta||0,a.bearing+=b.bearingDelta||0,a.pitch+=b.pitchDelta||0,a.roll+=b.rollDelta||0,b.panDelta&&a.pan._add(b.panDelta),b.around&&(a.around=b.around),b.pinchAround&&(a.pinchAround=b.pinchAround);let p=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,f={};if(a.pan.mag()){let b=Lr(a.pan.mag(),p,o.e({},Ui,t||{})),P=a.pan.mult(b.amount/a.pan.mag()),D=this._map.cameraHelper.handlePanInertia(P,this._map.transform);f.center=D.easingCenter,f.offset=D.easingOffset,mr(f,b)}if(a.zoom){let b=Lr(a.zoom,p,yi);f.zoom=o.cw(this._map.transform.zoom+b.amount,this._map.getZoomSnap(),b.amount),mr(f,b)}if(a.bearing){let b=Lr(a.bearing,p,vr);f.bearing=this._map.transform.bearing+o.al(b.amount,-179,179),mr(f,b)}if(a.pitch){let b=Lr(a.pitch,p,tr);f.pitch=this._map.transform.pitch+b.amount,mr(f,b)}if(a.roll){let b=Lr(a.roll,p,cr);f.roll=this._map.transform.roll+o.al(b.amount,-179,179),mr(f,b)}if(f.zoom||f.bearing){let b=a.pinchAround===void 0?a.around:a.pinchAround;f.around=b?this._map.unproject(b):this._map.getCenter()}return this.clear(),o.e(f,{noMoveStart:!0})}}function mr(_,t){(!_.duration||_.duration<t.duration)&&(_.duration=t.duration,_.easing=t.easing)}function Lr(_,t,a){let{maxSpeed:p,linearity:f,deceleration:b}=a,P=o.al(_*f/(t/1e3),-p,p),D=Math.abs(P)/(b*f);return{easing:a.easing,duration:1e3*D,amount:P*(D/2)}}class cn extends o.n{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,a,p,f={}){p=p instanceof MouseEvent?p:new MouseEvent(t,p);let b=He.mousePos(a.getCanvas(),p),P=a.unproject(b);super(t,o.e({point:b,lngLat:P,originalEvent:p},f)),this._defaultPrevented=!1,this.target=a}}class Co extends o.n{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,a,p){let f=t==="touchend"?p.changedTouches:p.touches,b=He.touchPos(a.getCanvasContainer(),f),P=b.map((B=>a.unproject(B))),D=b.reduce(((B,U,$,Y)=>B.add(U.div(Y.length))),new o.P(0,0));super(t,{points:b,point:D,lngLats:P,lngLat:a.unproject(D),originalEvent:p}),this._defaultPrevented=!1}}class Ha extends o.n{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,a,p){super(t,{originalEvent:p}),this._defaultPrevented=!1}}class ll{constructor(t,a){this._map=t,this._clickTolerance=a.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new Ha(t.type,this._map,t))}mousedown(t,a){return this._mousedownPos=a,this._firePreventable(new cn(t.type,this._map,t))}mouseup(t){this._map.fire(new cn(t.type,this._map,t))}click(t,a){this._mousedownPos&&this._mousedownPos.dist(a)>=this._clickTolerance||this._map.fire(new cn(t.type,this._map,t))}dblclick(t){return this._firePreventable(new cn(t.type,this._map,t))}mouseover(t){this._map.fire(new cn(t.type,this._map,t))}mouseout(t){this._map.fire(new cn(t.type,this._map,t))}touchstart(t){return this._firePreventable(new Co(t.type,this._map,t))}touchmove(t){this._map.fire(new Co(t.type,this._map,t))}touchend(t){this._map.fire(new Co(t.type,this._map,t))}touchcancel(t){this._map.fire(new Co(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class na{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new cn(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new cn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new cn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class hn{constructor(t){this._map=t}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.screenPointToLocation(o.P.convert(t),this._map.terrain)}}class Kn{constructor(t,a){this._map=t,this._tr=new hn(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=a.clickTolerance||1,a.boxZoom&&typeof a.boxZoom=="object"&&(this._boxZoomEnd=a.boxZoom.boxZoomEnd)}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,a){this.isEnabled()&&t.shiftKey&&t.button===0&&(He.disableDrag(),this._startPos=this._lastPos=a,this._active=!0)}mousemoveWindow(t,a){if(!this._active)return;let p=a;if(this._lastPos.equals(p)||!this._box&&p.dist(this._startPos)<this._clickTolerance)return;let f=this._startPos;this._lastPos=p,this._box||(this._box=He.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));let b=Math.min(f.x,p.x),P=Math.max(f.x,p.x),D=Math.min(f.y,p.y),B=Math.max(f.y,p.y);this._box.style.transform=`translate(${b}px,${D}px)`,this._box.style.width=P-b+"px",this._box.style.height=B-D+"px"}mouseupWindow(t,a){if(!this._active||t.button!==0)return;let p=this._startPos,f=a;if(this.reset(),He.suppressClick(),p.x!==f.x||p.y!==f.y)return this._map.fire(new o.n("boxzoomend",{originalEvent:t})),this._boxZoomEnd?void this._boxZoomEnd(this._map,p,f,t):{cameraAnimation:b=>b.fitScreenCoordinates(p,f,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&t.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(this._box.remove(),this._box=null),He.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,a){return this._map.fire(new o.n(t,{originalEvent:a}))}}function Qt(_,t){if(_.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${_.length}, points ${t.length}`);let a={};for(let p=0;p<_.length;p++)a[_[p].identifier]=t[p];return a}class Mn{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,a,p){(this.centroid||p.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=t.timeStamp),p.length===this.numTouches&&(this.centroid=(function(f){let b=new o.P(0,0);for(let P of f)b._add(P);return b.div(f.length)})(a),this.touches=Qt(p,a)))}touchmove(t,a,p){if(this.aborted||!this.centroid)return;let f=Qt(p,a);for(let b in this.touches){let P=f[b];(!P||P.dist(this.touches[b])>30)&&(this.aborted=!0)}}touchend(t,a,p){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),p.length===0){let f=!this.aborted&&this.centroid;if(this.reset(),f)return f}}}class Ki{constructor(t){this.singleTap=new Mn(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,a,p){this.singleTap.touchstart(t,a,p)}touchmove(t,a,p){this.singleTap.touchmove(t,a,p)}touchend(t,a,p){let f=this.singleTap.touchend(t,a,p);if(f){let b=t.timeStamp-this.lastTime<500,P=!this.lastTap||this.lastTap.dist(f)<30;if(b&&P||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=f,this.count===this.numTaps)return this.reset(),f}}}class _r{constructor(t){this._tr=new hn(t),this._zoomIn=new Ki({numTouches:1,numTaps:2}),this._zoomOut=new Ki({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,a,p){this._zoomIn.touchstart(t,a,p),this._zoomOut.touchstart(t,a,p)}touchmove(t,a,p){this._zoomIn.touchmove(t,a,p),this._zoomOut.touchmove(t,a,p)}touchend(t,a,p){let f=this._zoomIn.touchend(t,a,p),b=this._zoomOut.touchend(t,a,p),P=this._tr;return f?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:D=>D.easeTo({duration:300,zoom:o.cw(P.zoom+1,D.getZoomSnap()),around:P.unproject(f)},{originalEvent:t})}):b?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:D=>D.easeTo({duration:300,zoom:o.cw(P.zoom-1,D.getZoomSnap()),around:P.unproject(b)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Or{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){let a=this._moveFunction(...t);if(a.bearingDelta||a.pitchDelta||a.rollDelta||a.around||a.panDelta)return this._active=!0,a}dragStart(t,a){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=Array.isArray(a)?a[0]:a,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,a){if(!this.isEnabled())return;let p=this._lastPoint;if(!p)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);let f=Array.isArray(a)?a[0]:a;return!this._moved&&f.dist(p)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=f,this._move(p,f))}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&He.suppressClick(),this.reset(t))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}let un=0,Rr=2,Ma={[un]:1,[Rr]:2};class oa{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){this._eventButton=t.button}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){return!(function(a,p){let f=Ma[p];return a.buttons===void 0||(a.buttons&f)!==f})(t,this._eventButton)}isValidEndEvent(t){return t.button===this._eventButton}}class Eh{constructor(){this._firstTouch=void 0}_isOneFingerTouch(t){return t.targetTouches.length===1}_isSameTouchEvent(t){return t.targetTouches[0].identifier===this._firstTouch}startMove(t){this._firstTouch=t.targetTouches[0].identifier}endMove(t){delete this._firstTouch}isValidStartEvent(t){return this._isOneFingerTouch(t)}isValidMoveEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}isValidEndEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}}class cl{constructor(t=new oa({checkCorrectEvent:()=>!0}),a=new Eh){this.mouseMoveStateManager=t,this.oneFingerTouchMoveStateManager=a}_executeRelevantHandler(t,a,p){return t instanceof MouseEvent?a(t):typeof TouchEvent<"u"&&t instanceof TouchEvent?p(t):void 0}startMove(t){this._executeRelevantHandler(t,(a=>{this.mouseMoveStateManager.startMove(a)}),(a=>{this.oneFingerTouchMoveStateManager.startMove(a)}))}endMove(t){this._executeRelevantHandler(t,(a=>{this.mouseMoveStateManager.endMove(a)}),(a=>{this.oneFingerTouchMoveStateManager.endMove(a)}))}isValidStartEvent(t){return this._executeRelevantHandler(t,(a=>this.mouseMoveStateManager.isValidStartEvent(a)),(a=>this.oneFingerTouchMoveStateManager.isValidStartEvent(a)))}isValidMoveEvent(t){return this._executeRelevantHandler(t,(a=>this.mouseMoveStateManager.isValidMoveEvent(a)),(a=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(a)))}isValidEndEvent(t){return this._executeRelevantHandler(t,(a=>this.mouseMoveStateManager.isValidEndEvent(a)),(a=>this.oneFingerTouchMoveStateManager.isValidEndEvent(a)))}}let Gc=_=>{_.mousedown=_.dragStart,_.mousemoveWindow=_.dragMove,_.mouseup=_.dragEnd,_.contextmenu=t=>{t.preventDefault()}};class Mh{constructor(t,a){this._clickTolerance=t.clickTolerance||1,this._map=a,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new o.P(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,a,p){return this._calculateTransform(t,a,p)}touchmove(t,a,p){if(this._active){if(!this._shouldBePrevented(p.length))return t.preventDefault(),this._calculateTransform(t,a,p);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t)}}touchend(t,a,p){this._calculateTransform(t,a,p),this._active&&this._shouldBePrevented(p.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,a,p){p.length>0&&(this._active=!0);let f=Qt(p,a),b=new o.P(0,0),P=new o.P(0,0),D=0;for(let U in f){let $=f[U],Y=this._touches[U];Y&&(b._add($),P._add($.sub(Y)),D++,f[U]=$)}if(this._touches=f,this._shouldBePrevented(D)||!P.mag())return;let B=P.div(D);return this._sum._add(B),this._sum.mag()<this._clickTolerance?void 0:{around:b.div(D),panDelta:B}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class fs{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,a,p){this._firstTwoTouches||p.length<2||(this._firstTwoTouches=[p[0].identifier,p[1].identifier],this._start([a[0],a[1]]))}touchmove(t,a,p){if(!this._firstTwoTouches)return;t.preventDefault();let[f,b]=this._firstTwoTouches,P=gs(p,a,f),D=gs(p,a,b);if(!P||!D)return;let B=this._aroundCenter?null:P.add(D).div(2);return this._move([P,D],B,t)}touchend(t,a,p){if(!this._firstTwoTouches)return;let[f,b]=this._firstTwoTouches,P=gs(p,a,f),D=gs(p,a,b);P&&D||(this._active&&He.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&t.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function gs(_,t,a){for(let p=0;p<_.length;p++)if(_[p].identifier===a)return t[p]}function Fs(_,t){return Math.log(_/t)/Math.LN2}class Zc extends fs{constructor(){super(),this._zoomRate=1,this._zoomThreshold=.1}setZoomRate(t){this._zoomRate=t??1}setZoomThreshold(t){this._zoomThreshold=t??.1}reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,a){let p=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(Fs(this._distance,this._startDistance))<this._zoomThreshold))return this._active=!0,{zoomDelta:Fs(this._distance,p)*this._zoomRate,pinchAround:a}}}function ku(_,t){return 180*_.angleWith(t)/Math.PI}class cd extends fs{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])}_move(t,a,p){let f=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ku(this._vector,f),pinchAround:a}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());let a=25/(Math.PI*this._minDiameter)*360,p=ku(t,this._startVector);return Math.abs(p)<a}}function ou(_){return Math.abs(_.y)>Math.abs(_.x)}class Xa extends fs{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,a,p){super.touchstart(t,a,p),this._currentTouchCount=p.length}_start(t){this._lastPoints=t,ou(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,a,p){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let f=t[0].sub(this._lastPoints[0]),b=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(f,b,p.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(f.y+b.y)/2*-.5}):void 0}gestureBeginsVertically(t,a,p){if(this._valid!==void 0)return this._valid;let f=t.mag()>=2,b=a.mag()>=2;if(!f&&!b)return;if(!f||!b)return this._firstMove===void 0&&(this._firstMove=p),p-this._firstMove<100&&void 0;let P=t.y>0==a.y>0;return ou(t)&&ou(a)&&P}}let wr={panStep:100,bearingStep:15,pitchStep:10};class hl{constructor(t){this._tr=new hn(t);let a=wr;this._panStep=a.panStep,this._bearingStep=a.bearingStep,this._pitchStep=a.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let a=0,p=0,f=0,b=0,P=0;switch(t.keyCode){case 61:case 107:case 171:case 187:a=1;break;case 189:case 109:case 173:a=-1;break;case 37:t.shiftKey?p=-1:(t.preventDefault(),b=-1);break;case 39:t.shiftKey?p=1:(t.preventDefault(),b=1);break;case 38:t.shiftKey?f=1:(t.preventDefault(),P=-1);break;case 40:t.shiftKey?f=-1:(t.preventDefault(),P=1);break;default:return}return this._rotationDisabled&&(p=0,f=0),{cameraAnimation:D=>{let B=this._tr;D.easeTo({duration:300,easeId:"keyboardHandler",easing:Pa,zoom:a?o.cw(B.zoom+a*(t.shiftKey?2:1),D.getZoomSnap()):B.zoom,bearing:B.bearing+p*this._bearingStep,pitch:B.pitch+f*this._pitchStep,offset:[-b*this._panStep,-P*this._panStep],center:B.center},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Pa(_){return _*(2-_)}let _s=4.000244140625,Au=1/450;class Nl{constructor(t,a){this._onTimeout=p=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(p)},this._map=t,this._tr=new hn(t),this._triggerRenderFrame=a,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=Au}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&t.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(t){return!!this._map.cooperativeGestures.isEnabled()&&!(t.ctrlKey||this._map.cooperativeGestures.isBypassed(t))}wheel(t){if(!this.isEnabled())return;if(this._shouldBePrevented(t))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",t);let a=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,p=Mt(),f=p-(this._lastWheelEventTime||0);this._lastWheelEventTime=p,a!==0&&a%_s==0?this._type="wheel":a!==0&&Math.abs(a)<4?this._type="trackpad":f>400?(this._type=null,this._lastValue=a,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(f*a)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,a+=this._lastValue)),t.shiftKey&&a&&(a/=4),this._type&&(this._lastWheelEvent=t,this._delta-=a,this._active||this._start(t)),t.preventDefault()}_start(t){if(!this._delta)return;this._needsRerender=!1,this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let a=He.mousePos(this._map.getCanvas(),t),p=this._tr;this._aroundPoint=this._aroundCenter?p.transform.locationToScreenPoint(o.W.convert(p.center)):a,this._needsRerender||(this._needsRerender=!0,this._triggerRenderFrame())}renderFrame(){if(!this._needsRerender||(this._needsRerender=!1,!this.isActive()))return;let t=this._tr.transform;if(typeof this._lastExpectedZoom=="number"){let D=t.zoom-this._lastExpectedZoom;typeof this._startZoom=="number"&&(this._startZoom+=D),typeof this._targetZoom=="number"&&(this._targetZoom+=D)}if(this._delta!==0){let D=this._type==="wheel"&&Math.abs(this._delta)>_s?this._wheelZoomRate:this._defaultZoomRate,B=2/(1+Math.exp(-Math.abs(this._delta*D)));this._delta<0&&B!==0&&(B=1/B);let U=typeof this._targetZoom!="number"?t.scale:o.ao(this._targetZoom),$=t.applyConstrain(t.getCameraLngLat(),o.ar(U*B)).zoom,Y=this._map.getZoomSnap();if(this._type==="wheel"&&Y>0){let ee=o.cw(t.zoom,Y);this._targetZoom=o.cw($,Y,$-ee)}else this._targetZoom=$;this._type==="wheel"&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let a=typeof this._targetZoom!="number"?t.zoom:this._targetZoom,p=this._startZoom,f=this._easing,b,P=!1;if(this._type==="wheel"&&p&&f){let D=Mt()-this._lastWheelEventTime,B=Math.min((D+5)/200,1),U=f(B);b=o.H.number(p,a,U),B<1?this._needsRerender=!0:P=!0}else b=a,P=!0;return this._active=!0,P&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout}),200)),this._lastExpectedZoom=b,{noInertia:!0,needsRenderFrame:!P,zoomDelta:b-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let a=o.cy;if(this._prevEase){let p=this._prevEase,f=(Mt()-p.start)/p.duration,b=p.easing(f+.01)-p.easing(f),P=.27/Math.sqrt(b*b+1e-4)*.01,D=Math.sqrt(.0729-P*P);a=o.cv(P,D,.25,1)}return this._prevEase={start:Mt(),duration:t,easing:a},a}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Cp{constructor(t,a){this._clickZoom=t,this._tapZoom=a}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 Ep{constructor(t){this._tr=new hn(t),this.reset()}reset(){this._active=!1}dblclick(t,a){return t.preventDefault(),{cameraAnimation:p=>{p.easeTo({duration:300,zoom:o.cw(this._tr.zoom+(t.shiftKey?-1:1),p.getZoomSnap()),around:this._tr.unproject(a)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class jn{constructor(){this._tap=new Ki({numTouches:1,numTaps:1}),this._zoomRate=1,this.reset()}setZoomRate(t){this._zoomRate=t??1}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,a,p){if(!this._swipePoint)if(this._tapTime){let f=a[0],b=t.timeStamp-this._tapTime<500,P=this._tapPoint.dist(f)<30;b&&P?p.length>0&&(this._swipePoint=f,this._swipeTouch=p[0].identifier):this.reset()}else this._tap.touchstart(t,a,p)}touchmove(t,a,p){if(this._tapTime){if(this._swipePoint){if(p[0].identifier!==this._swipeTouch)return;let f=a[0],b=f.y-this._swipePoint.y;return this._swipePoint=f,t.preventDefault(),this._active=!0,{zoomDelta:b/128*this._zoomRate}}}else this._tap.touchmove(t,a,p)}touchend(t,a,p){if(this._tapTime)this._swipePoint&&p.length===0&&this.reset();else{let f=this._tap.touchend(t,a,p);f&&(this._tapTime=t.timeStamp,this._tapPoint=f)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ka{constructor(t,a,p){this._el=t,this._mousePan=a,this._touchPan=p}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Ph{constructor(t,a,p,f){this._pitchWithRotate=t.pitchWithRotate,this._rollEnabled=t.rollEnabled,this._mouseRotate=a,this._mousePitch=p,this._mouseRoll=f}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}}class mi{constructor(t,a,p,f){this._el=t,this._touchZoom=a,this._touchRotate=p,this._tapDragZoom=f,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}setZoomRate(t){this._touchZoom.setZoomRate(t),this._tapDragZoom.setZoomRate(t)}setZoomThreshold(t){this._touchZoom.setZoomThreshold(t)}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Ii{constructor(t,a){this._bypassKey=navigator.userAgent.includes("Mac")?"metaKey":"ctrlKey",this._map=t,this._options=a,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=He.create("div","maplibregl-cooperative-gesture-screen",t);let a=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(a=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let p=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),f=document.createElement("div");f.className="maplibregl-desktop-message",f.textContent=a,this._container.appendChild(f);let b=document.createElement("div");b.className="maplibregl-mobile-message",b.textContent=p,this._container.appendChild(b),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(this._container.remove(),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(t){return t[this._bypassKey]}notifyGestureBlocked(t,a){this._enabled&&(this._map.fire(new o.n("cooperativegestureprevented",{gestureType:t,originalEvent:a})),this._container.classList.add("maplibregl-show"),setTimeout((()=>{this._container.classList.remove("maplibregl-show")}),100))}}let Bs=_=>_.zoom||_.drag||_.roll||_.pitch||_.rotate;class zu extends o.n{}function Wc(_){var t;return((t=_.panDelta)===null||t===void 0?void 0:t.mag())||_.zoomDelta||_.bearingDelta||_.pitchDelta||_.rollDelta}class aa{get _ownerDocument(){var t;return((t=this._el)===null||t===void 0?void 0:t.ownerDocument)||document}get _ownerWindow(){var t,a;return((a=(t=this._el)===null||t===void 0?void 0:t.ownerDocument)===null||a===void 0?void 0:a.defaultView)||window}constructor(t,a){this.handleWindowEvent=f=>{this.handleEvent(f,`${f.type}Window`)},this.handleEvent=(f,b)=>{if(f.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let P=f.type==="renderFrame"?void 0:f,D={needsRenderFrame:!1},B={},U={};for(let{handlerName:ee,handler:oe,allowed:_e}of this._handlers){if(!oe.isEnabled())continue;let Ie;if(this._blockedByActive(U,_e,ee))oe.reset();else if(oe[b||f.type]){if(o.cz(f,b||f.type)){let ze=He.mousePos(this._map.getCanvas(),f);Ie=oe[b||f.type](f,ze)}else if(o.cA(f,b||f.type)){let ze=this._getMapTouches(f.touches),Ee=He.touchPos(this._map.getCanvas(),ze);Ie=oe[b||f.type](f,Ee,ze)}else o.cB(b||f.type)||(Ie=oe[b||f.type](f));this.mergeHandlerResult(D,B,Ie,ee,P),Ie?.needsRenderFrame&&this._triggerRenderFrame()}(Ie||oe.isActive())&&(U[ee]=oe)}let $={};for(let ee in this._previousActiveHandlers)U[ee]||($[ee]=P);this._previousActiveHandlers=U,(Object.keys($).length||Wc(D))&&(this._changes.push([D,B,$]),this._triggerRenderFrame()),(Object.keys(U).length||Wc(D))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:Y}=D;Y&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],Y(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new ur(t),this._bearingSnap=a.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(a);let p=this._el;this._listeners=[[p,"touchstart",{passive:!0}],[p,"touchmove",{passive:!1}],[p,"touchend",void 0],[p,"touchcancel",void 0],[p,"mousedown",void 0],[p,"mousemove",void 0],[p,"mouseup",void 0],[this._ownerDocument,"mousemove",{capture:!0}],[this._ownerDocument,"mouseup",void 0],[p,"mouseover",void 0],[p,"mouseout",void 0],[p,"dblclick",void 0],[p,"click",void 0],[p,"keydown",{capture:!1}],[p,"keyup",void 0],[p,"wheel",{passive:!1}],[p,"contextmenu",void 0],[this._ownerWindow,"blur",void 0]];for(let[f,b,P]of this._listeners)f.addEventListener(b,f===this._ownerDocument?this.handleWindowEvent:this.handleEvent,P)}destroy(){for(let[t,a,p]of this._listeners)t.removeEventListener(a,t===this._ownerDocument?this.handleWindowEvent:this.handleEvent,p)}_addDefaultHandlers(t){let a=this._map,p=a.getCanvasContainer();this._add("mapEvent",new ll(a,t));let f=a.boxZoom=new Kn(a,t);this._add("boxZoom",f),t.interactive&&t.boxZoom&&f.enable();let b=a.cooperativeGestures=new Ii(a,t.cooperativeGestures);this._add("cooperativeGestures",b),t.cooperativeGestures&&b.enable();let P=new _r(a),D=new Ep(a);a.doubleClickZoom=new Cp(D,P),this._add("tapZoom",P),this._add("clickZoom",D),t.interactive&&t.doubleClickZoom&&a.doubleClickZoom.enable();let B=new jn;this._add("tapDragZoom",B);let U=a.touchPitch=new Xa(a);this._add("touchPitch",U),t.interactive&&t.touchPitch&&a.touchPitch.enable(t.touchPitch);let $=()=>a.project(a.getCenter()),Y=(function({enable:Le,clickTolerance:we,aroundCenter:qe=!0,minPixelCenterThreshold:Fe=100,rotateDegreesPerPixelMoved:it=.8},ft){let _t=new oa({checkCorrectEvent:Rt=>Rt.button===0&&Rt.ctrlKey||Rt.button===2&&!Rt.ctrlKey});return new Or({clickTolerance:we,move:(Rt,Dt)=>{let _i=ft();if(qe&&Math.abs(_i.y-Rt.y)>Fe)return{bearingDelta:o.cx(new o.P(Rt.x,Dt.y),Dt,_i)};let Gt=(Dt.x-Rt.x)*it;return qe&&Dt.y<_i.y&&(Gt=-Gt),{bearingDelta:Gt}},moveStateManager:_t,enable:Le,assignEvents:Gc})})(t,$),ee=(function({enable:Le,clickTolerance:we,pitchDegreesPerPixelMoved:qe=-.5}){let Fe=new oa({checkCorrectEvent:it=>it.button===0&&it.ctrlKey||it.button===2});return new Or({clickTolerance:we,move:(it,ft)=>({pitchDelta:(ft.y-it.y)*qe}),moveStateManager:Fe,enable:Le,assignEvents:Gc})})(t),oe=(function({enable:Le,clickTolerance:we,rollDegreesPerPixelMoved:qe=.3},Fe){let it=new oa({checkCorrectEvent:ft=>ft.button===2&&ft.ctrlKey});return new Or({clickTolerance:we,move:(ft,_t)=>{let Rt=Fe(),Dt=(_t.x-ft.x)*qe;return _t.y<Rt.y&&(Dt=-Dt),{rollDelta:Dt}},moveStateManager:it,enable:Le,assignEvents:Gc})})(t,$);a.dragRotate=new Ph(t,Y,ee,oe),this._add("mouseRotate",Y,["mousePitch"]),this._add("mousePitch",ee,["mouseRotate","mouseRoll"]),this._add("mouseRoll",oe,["mousePitch"]),t.interactive&&t.dragRotate&&a.dragRotate.enable();let _e=(function({enable:Le,clickTolerance:we}){let qe=new oa({checkCorrectEvent:Fe=>Fe.button===0&&!Fe.ctrlKey});return new Or({clickTolerance:we,move:(Fe,it)=>({around:it,panDelta:it.sub(Fe)}),activateOnStart:!0,moveStateManager:qe,enable:Le,assignEvents:Gc})})(t),Ie=new Mh(t,a);a.dragPan=new Ka(p,_e,Ie),this._add("mousePan",_e),this._add("touchPan",Ie,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&a.dragPan.enable(t.dragPan);let ze=new cd,Ee=new Zc;a.touchZoomRotate=new mi(p,Ee,ze,B),this._add("touchRotate",ze,["touchPan","touchZoom"]),this._add("touchZoom",Ee,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&a.touchZoomRotate.enable(t.touchZoomRotate),this._add("blockableMapEvent",new na(a));let De=a.scrollZoom=new Nl(a,(()=>this._triggerRenderFrame()));this._add("scrollZoom",De,["mousePan"]),t.interactive&&t.scrollZoom&&a.scrollZoom.enable(t.scrollZoom);let je=a.keyboard=new hl(a);this._add("keyboard",je),t.interactive&&t.keyboard&&a.keyboard.enable()}_add(t,a,p){this._handlers.push({handlerName:t,handler:a,allowed:p}),this._handlersById[t]=a}stop(t){if(!this._updatingCamera){for(let{handler:a}of this._handlers)a.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(let{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Bs(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,a,p){for(let f in t)if(f!==p&&!a?.includes(f))return!0;return!1}_getMapTouches(t){let a=[];for(let p of t)this._el.contains(p.target)&&a.push(p);return a}mergeHandlerResult(t,a,p,f,b){if(!p)return;o.e(t,p);let P={handlerName:f,originalEvent:p.originalEvent||b};p.zoomDelta!==void 0&&(a.zoom=P),p.panDelta!==void 0&&(a.drag=P),p.rollDelta!==void 0&&(a.roll=P),p.pitchDelta!==void 0&&(a.pitch=P),p.bearingDelta!==void 0&&(a.rotate=P)}_applyChanges(){let t={},a={},p={};for(let[f,b,P]of this._changes)f.panDelta&&(t.panDelta=(t.panDelta||new o.P(0,0))._add(f.panDelta)),f.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+f.zoomDelta),f.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+f.bearingDelta),f.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+f.pitchDelta),f.rollDelta&&(t.rollDelta=(t.rollDelta||0)+f.rollDelta),f.around!==void 0&&(t.around=f.around),f.pinchAround!==void 0&&(t.pinchAround=f.pinchAround),f.noInertia&&(t.noInertia=f.noInertia),o.e(a,b),o.e(p,P);this._updateMapTransform(t,a,p),this._changes=[]}_updateMapTransform(t,a,p){let f=this._map,b=f._getTransformForUpdate(),P=f.terrain;if(!(Wc(t)||P&&this._terrainMovement))return void this._fireEvents(a,p,!0);f._stop(!0);let{panDelta:D,zoomDelta:B,bearingDelta:U,pitchDelta:$,rollDelta:Y,around:ee,pinchAround:oe}=t;oe!==void 0&&(ee=oe),ee||(ee=f.transform.centerPoint),P&&!b.isPointOnMapSurface(ee)&&(ee=b.centerPoint);let _e={panDelta:D,zoomDelta:B,rollDelta:Y,pitchDelta:$,bearingDelta:U,around:ee};this._map.cameraHelper.useGlobeControls&&!b.isPointOnMapSurface(ee)&&(ee=b.centerPoint);let Ie=ee.distSqr(b.centerPoint)<.01?b.center:b.screenPointToLocation(D?ee.sub(D):ee);this._handleMapControls({terrain:P,tr:b,deltasForHelper:_e,preZoomAroundLoc:Ie,combinedEventsInProgress:a,panDelta:D}),f._applyUpdatedTransform(b),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(a,p,!0)}_handleMapControls({terrain:t,tr:a,deltasForHelper:p,preZoomAroundLoc:f,combinedEventsInProgress:b,panDelta:P}){let D=this._map.cameraHelper;if(D.handleMapControlsRollPitchBearingZoom(p,a),t)return D.useGlobeControls?(this._terrainMovement||!b.drag&&!b.zoom||(this._terrainMovement=!0,this._map._elevationFreeze=!0),void D.handleMapControlsPan(p,a,f)):this._terrainMovement||!b.drag&&!b.zoom?void(b.drag&&this._terrainMovement&&P?a.setCenter(a.screenPointToLocation(a.centerPoint.sub(P))):D.handleMapControlsPan(p,a,f)):(this._terrainMovement=!0,this._map._elevationFreeze=!0,void D.handleMapControlsPan(p,a,f));D.handleMapControlsPan(p,a,f)}_fireEvents(t,a,p){let f=Bs(this._eventsInProgress),b=Bs(t),P={};for(let Y in t){let{originalEvent:ee}=t[Y];this._eventsInProgress[Y]||(P[`${Y}start`]=ee),this._eventsInProgress[Y]=t[Y]}!f&&b&&this._fireEvent("movestart",b.originalEvent);for(let Y in P)this._fireEvent(Y,P[Y]);b&&this._fireEvent("move",b.originalEvent);for(let Y in t){let{originalEvent:ee}=t[Y];this._fireEvent(Y,ee)}let D={},B;for(let Y in this._eventsInProgress){let{handlerName:ee,originalEvent:oe}=this._eventsInProgress[Y];this._handlersById[ee].isActive()||(delete this._eventsInProgress[Y],B=a[ee]||oe,D[`${Y}end`]=B)}for(let Y in D)this._fireEvent(Y,D[Y]);let U=Bs(this._eventsInProgress),$=(f||b)&&!U;if($&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let Y=this._map._getTransformForUpdate();this._map.getCenterClampedToGround()&&Y.recalculateZoomAndCenter(this._map.terrain),this._map._applyUpdatedTransform(Y)}if(p&&$){this._updatingCamera=!0;let Y=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),ee=oe=>oe!==0&&-this._bearingSnap<oe&&oe<this._bearingSnap;!Y||!Y.essential&&Bt.prefersReducedMotion?(this._map.fire(new o.n("moveend",{originalEvent:B})),ee(this._map.getBearing())&&this._map.resetNorth()):(ee(Y.bearing||this._map.getBearing())&&(Y.bearing=0),Y.freezeElevation=!0,this._map.easeTo(Y,{originalEvent:B})),this._updatingCamera=!1}}_fireEvent(t,a){this._map.fire(new o.n(t,a?{originalEvent:a}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((t=>{delete this._frameId,this.handleEvent(new zu("renderFrame",{timeStamp:t})),this._applyChanges()}))}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Mp extends o.E{constructor(t,a,p){super(),this._renderFrameCallback=()=>{let f=Math.min((Mt()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(f)),f<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=p.bearingSnap,this._zoomSnap=p.zoomSnap,this.cameraHelper=a,this.on("moveend",(()=>{delete this._requestedCameraState}))}migrateProjection(t,a){t.apply(this.transform,!0),this.transform=t,this.cameraHelper=a}getCenter(){return new o.W(this.transform.center.lng,this.transform.center.lat)}setCenter(t,a){return this.jumpTo({center:t},a)}getCenterElevation(){return this.transform.elevation}setCenterElevation(t,a){return this.jumpTo({elevation:t},a),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(t){this._centerClampedToGround=t}panBy(t,a,p){return t=o.P.convert(t).mult(-1),this.panTo(this.transform.center,o.e({offset:t},a),p)}panTo(t,a,p){return this.easeTo(o.e({center:t},a),p)}getZoom(){return this.transform.zoom}setZoom(t,a){return this.jumpTo({zoom:t},a),this}zoomTo(t,a,p){return this.easeTo(o.e({zoom:t},a),p)}zoomIn(t,a){return this.zoomTo(o.cw(this.getZoom()+1,this._zoomSnap),t,a),this}zoomOut(t,a){return this.zoomTo(o.cw(this.getZoom()-1,this._zoomSnap),t,a),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(t,a){return t!=this.transform.fov&&(this.transform.setFov(t),this.fire(new o.n("movestart",a)).fire(new o.n("move",a)).fire(new o.n("moveend",a))),this}getBearing(){return this.transform.bearing}setZoomSnap(t){return this._zoomSnap=t,this}getZoomSnap(){return this._zoomSnap}setBearing(t,a){return this.jumpTo({bearing:t},a),this}getPadding(){return this.transform.padding}setPadding(t,a){return this.jumpTo({padding:t},a),this}rotateTo(t,a,p){return this.easeTo(o.e({bearing:t},a),p)}resetNorth(t,a){return this.rotateTo(0,o.e({duration:1e3},t),a),this}resetNorthPitch(t,a){return this.easeTo(o.e({bearing:0,pitch:0,roll:0,duration:1e3},t),a),this}snapToNorth(t,a){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,a):this}getPitch(){return this.transform.pitch}setPitch(t,a){return this.jumpTo({pitch:t},a),this}getRoll(){return this.transform.roll}setRoll(t,a){return this.jumpTo({roll:t},a),this}cameraForBounds(t,a){t=Ti.convert(t).adjustAntiMeridian();let p=a?.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),p,a)}_cameraForBoxAndBearing(t,a,p,f){let b={top:0,bottom:0,right:0,left:0};if(typeof(f=o.e({padding:b,offset:[0,0],maxZoom:this.transform.maxZoom},f)).padding=="number"){let $=f.padding;f.padding={top:$,bottom:$,right:$,left:$}}let P=o.e(b,f.padding);f.padding=P;let D=this.transform,B=new Ti(t,a),U=this.cameraHelper.cameraForBoxAndBearing(f,P,B,p,D);return U&&this._zoomSnap&&(U.zoom=o.cw(U.zoom,this._zoomSnap,-1)),U}fitBounds(t,a,p){return this._fitInternal(this.cameraForBounds(t,a),a,p)}fitScreenCoordinates(t,a,p,f,b){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(o.P.convert(t)),this.transform.screenPointToLocation(o.P.convert(a)),p,f),f,b)}_fitInternal(t,a,p){return t?(delete(a=o.e(t,a)).padding,a.linear?this.easeTo(a,p):this.flyTo(a,p)):this}jumpTo(t,a){this.stop(),"zoom"in t&&this._zoomSnap&&(t.zoom=o.cw(t.zoom,this._zoomSnap));let p=this._getTransformForUpdate(),f=!1,b=!1,P=!1,D=p.zoom;this.terrain&&p.setElevation(this.terrain.getElevationForLngLatZoom(t.center?o.W.convert(t.center):p.center,t.zoom||p.tileZoom)),this.cameraHelper.handleJumpToCenterZoom(p,t);let B=p.zoom!==D;return"elevation"in t&&p.elevation!==+t.elevation&&p.setElevation(+t.elevation),"bearing"in t&&p.bearing!==+t.bearing&&(f=!0,p.setBearing(+t.bearing)),"pitch"in t&&p.pitch!==+t.pitch&&(b=!0,p.setPitch(+t.pitch)),"roll"in t&&p.roll!==+t.roll&&(P=!0,p.setRoll(+t.roll)),t.padding==null||p.isPaddingEqual(t.padding)||p.setPadding(t.padding),this._applyUpdatedTransform(p),this.fire(new o.n("movestart",a)).fire(new o.n("move",a)),B&&this.fire(new o.n("zoomstart",a)).fire(new o.n("zoom",a)).fire(new o.n("zoomend",a)),f&&this.fire(new o.n("rotatestart",a)).fire(new o.n("rotate",a)).fire(new o.n("rotateend",a)),b&&this.fire(new o.n("pitchstart",a)).fire(new o.n("pitch",a)).fire(new o.n("pitchend",a)),P&&this.fire(new o.n("rollstart",a)).fire(new o.n("roll",a)).fire(new o.n("rollend",a)),this.fire(new o.n("moveend",a))}calculateCameraOptionsFromTo(t,a,p,f=0){let b=o.a7.fromLngLat(t,a),P=o.a7.fromLngLat(p,f),D=P.x-b.x,B=P.y-b.y,U=P.z-b.z,$=Math.hypot(D,B,U);if($===0)throw new Error("Can't calculate camera options with same From and To");let Y=Math.hypot(D,B),ee=o.ar(this.transform.cameraToCenterDistance/$/this.transform.tileSize),oe=180*Math.atan2(D,-B)/Math.PI,_e=180*Math.acos(Y/$)/Math.PI;return _e=U<0?90-_e:90+_e,{center:P.toLngLat(),elevation:f,zoom:ee,pitch:_e,bearing:oe}}calculateCameraOptionsFromCameraLngLatAltRotation(t,a,p,f,b){let P=this.transform.calculateCenterFromCameraLngLatAlt(t,a,p,f);return{center:P.center,elevation:P.elevation,zoom:P.zoom,bearing:p,pitch:f,roll:b}}easeTo(t,a){this._stop(!1,t.easeId),"zoom"in(t=o.e({offset:[0,0],duration:500,easing:o.cy},t))&&this._zoomSnap&&(t.zoom=o.cw(t.zoom,this._zoomSnap)),(t.animate===!1||!t.essential&&Bt.prefersReducedMotion)&&(t.duration=0);let p=this._getTransformForUpdate(),f=this.getBearing(),b=p.pitch,P=p.roll,D="bearing"in t?this._normalizeBearing(t.bearing,f):f,B="pitch"in t?+t.pitch:b,U="roll"in t?this._normalizeBearing(t.roll,P):P,$="padding"in t?t.padding:p.padding,Y=o.P.convert(t.offset),ee,oe;t.around&&(ee=o.W.convert(t.around),oe=p.locationToScreenPoint(ee));let _e={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},Ie=this.cameraHelper.handleEaseTo(p,{bearing:D,pitch:B,roll:U,padding:$,around:ee,aroundPoint:oe,offsetAsPoint:Y,offset:t.offset,zoom:t.zoom,center:t.center});return this._rotating||(this._rotating=f!==D),this._pitching||(this._pitching=B!==b),this._rolling||(this._rolling=U!==P),this._padding=!p.isPaddingEqual($),this._zooming||(this._zooming=Ie.isZooming),this._easeId=t.easeId,this._prepareEase(a,t.noMoveStart,_e),this.terrain&&this._prepareElevation(Ie.elevationCenter),this._ease((ze=>{Ie.easeFunc(ze),this.terrain&&!t.freezeElevation&&this._updateElevation(ze),this._applyUpdatedTransform(p),this._fireMoveEvents(a)}),(ze=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(a,ze)}),t),this}_prepareEase(t,a,p={}){this._moving=!0,a||p.moving||this.fire(new o.n("movestart",t)),this._zooming&&!p.zooming&&this.fire(new o.n("zoomstart",t)),this._rotating&&!p.rotating&&this.fire(new o.n("rotatestart",t)),this._pitching&&!p.pitching&&this.fire(new o.n("pitchstart",t)),this._rolling&&!p.rolling&&this.fire(new o.n("rollstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(t){this._elevationStart!==void 0&&this._elevationCenter!==void 0||this._prepareElevation(this.transform.center),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));let a=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&a!==this._elevationTarget){let p=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(p-(a-(p*t+this._elevationStart))/(1-t)),this._elevationTarget=a}this.transform.setElevation(o.H.number(this._elevationStart,this._elevationTarget,t))}_finalizeElevation(){this._elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(t){if(!this.terrain&&t.elevation>=0&&t.pitch<=90)return{};let a=t.getCameraLngLat(),p=t.getCameraAltitude(),f=this.terrain?this.terrain.getElevationForLngLatZoom(a,t.zoom):0;if(p<f){let b=this.calculateCameraOptionsFromTo(a,f,t.center,t.elevation);return{pitch:b.pitch,zoom:b.zoom}}return{}}_applyUpdatedTransform(t){let a=[];if(a.push((f=>this._elevateCameraIfInsideTerrain(f))),this.transformCameraUpdate&&a.push((f=>this.transformCameraUpdate(f))),!a.length)return;let p=t.clone();for(let f of a){let b=p.clone(),{center:P,zoom:D,roll:B,pitch:U,bearing:$,elevation:Y}=f(b);P&&b.setCenter(P),Y!==void 0&&b.setElevation(Y),D!==void 0&&b.setZoom(D),B!==void 0&&b.setRoll(B),U!==void 0&&b.setPitch(U),$!==void 0&&b.setBearing($),p.apply(b,!1)}this.transform.apply(p,!1)}_fireMoveEvents(t){this.fire(new o.n("move",t)),this._zooming&&this.fire(new o.n("zoom",t)),this._rotating&&this.fire(new o.n("rotate",t)),this._pitching&&this.fire(new o.n("pitch",t)),this._rolling&&this.fire(new o.n("roll",t))}_afterEase(t,a){if(this._easeId&&a&&this._easeId===a)return;delete this._easeId;let p=this._zooming,f=this._rotating,b=this._pitching,P=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,p&&this.fire(new o.n("zoomend",t)),f&&this.fire(new o.n("rotateend",t)),b&&this.fire(new o.n("pitchend",t)),P&&this.fire(new o.n("rollend",t)),this.fire(new o.n("moveend",t))}flyTo(t,a){if(!t.essential&&Bt.prefersReducedMotion){let Dt=o.V(t,["center","zoom","bearing","pitch","roll","elevation","padding"]);return this.jumpTo(Dt,a)}this.stop(),"zoom"in(t=o.e({offset:[0,0],speed:1.2,curve:1.42,easing:o.cy},t))&&this._zoomSnap&&(t.zoom=o.cw(t.zoom,this._zoomSnap));let p=this._getTransformForUpdate(),f=p.bearing,b=p.pitch,P=p.roll,D=p.padding,B="bearing"in t?this._normalizeBearing(t.bearing,f):f,U="pitch"in t?+t.pitch:b,$="roll"in t?this._normalizeBearing(t.roll,P):P,Y="padding"in t?t.padding:p.padding,ee=o.P.convert(t.offset),oe=p.centerPoint.add(ee),_e=p.screenPointToLocation(oe),Ie=this.cameraHelper.handleFlyTo(p,{bearing:B,pitch:U,roll:$,padding:Y,locationAtOffset:_e,offsetAsPoint:ee,center:t.center,minZoom:t.minZoom,zoom:t.zoom}),ze=t.curve,Ee=Math.max(p.width,p.height),De=Ee/Ie.scaleOfZoom,je=Ie.pixelPathLength;typeof Ie.scaleOfMinZoom=="number"&&(ze=Math.sqrt(Ee/Ie.scaleOfMinZoom/je*2));let Le=ze*ze;function we(Dt){let _i=(De*De-Ee*Ee+(Dt?-1:1)*Le*Le*je*je)/(2*(Dt?De:Ee)*Le*je);return Math.log(Math.sqrt(_i*_i+1)-_i)}function qe(Dt){return(Math.exp(Dt)-Math.exp(-Dt))/2}function Fe(Dt){return(Math.exp(Dt)+Math.exp(-Dt))/2}let it=we(!1),ft=function(Dt){return Fe(it)/Fe(it+ze*Dt)},_t=function(Dt){return Ee*((Fe(it)*(qe(_i=it+ze*Dt)/Fe(_i))-qe(it))/Le)/je;var _i},Rt=(we(!0)-it)/ze;if(Math.abs(je)<2e-6||!isFinite(Rt)){if(Math.abs(Ee-De)<1e-6)return this.easeTo(t,a);let Dt=De<Ee?-1:1;Rt=Math.abs(Math.log(De/Ee))/ze,_t=()=>0,ft=_i=>Math.exp(Dt*ze*_i)}return t.duration="duration"in t?+t.duration:1e3*Rt/("screenSpeed"in t?+t.screenSpeed/ze:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=f!==B,this._pitching=U!==b,this._rolling=$!==P,this._padding=!p.isPaddingEqual(Y),this._prepareEase(a,!1),this.terrain&&this._prepareElevation(Ie.targetCenter),this._ease((Dt=>{let _i=Dt*Rt,Gt=1/ft(_i),Et=_t(_i);this._rotating&&p.setBearing(o.H.number(f,B,Dt)),this._pitching&&p.setPitch(o.H.number(b,U,Dt)),this._rolling&&p.setRoll(o.H.number(P,$,Dt)),this._padding&&(p.interpolatePadding(D,Y,Dt),oe=p.centerPoint.add(ee)),Ie.easeFunc(Dt,Gt,Et,oe),this.terrain&&!t.freezeElevation&&this._updateElevation(Dt),this._applyUpdatedTransform(p),this._fireMoveEvents(a)}),(()=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(a)}),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,a){var p;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let f=this._onEaseEnd;delete this._onEaseEnd,f.call(this,a)}return t||(p=this.handlers)===null||p===void 0||p.stop(!1),this}_ease(t,a,p){p.animate===!1||p.duration===0?(t(1),a()):(this._easeStart=Mt(),this._easeOptions=p,this._onEaseFrame=t,this._onEaseEnd=a,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,a){t=o.X(t,-180,180);let p=Math.abs(t-a);return Math.abs(t-360-a)<p&&(t-=360),Math.abs(t+360-a)<p&&(t+=360),t}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLat(o.W.convert(t),this.transform):null}}let Du={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class ka{constructor(t=Du){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=a=>{!a||a.sourceDataType!=="metadata"&&a.sourceDataType!=="visibility"&&a.dataType!=="style"&&a.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options.compact,this._container=He.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=He.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=He.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,a){let p=this._map._getUIString(`AttributionControl.${a}`);t.title=p,t.setAttribute("aria-label",p)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((f=>typeof f!="string"?"":f))):typeof this.options.customAttribution=="string"&&t.push(this.options.customAttribution)),this._map.style.stylesheet){let f=this._map.style.stylesheet;this.styleOwner=f.owner,this.styleId=f.id}let a=this._map.style.tileManagers;for(let f in a){let b=a[f];if(b.used||b.usedForTerrain){let P=b.getSource();P.attribution&&!t.includes(P.attribution)&&t.push(P.attribution)}}t=t.filter((f=>String(f).trim())),t.sort(((f,b)=>f.length-b.length)),t=t.filter(((f,b)=>{for(let P=b+1;P<t.length;P++)if(t[P].includes(f))return!1;return!0}));let p=t.join(" | ");p!==this._attribHTML&&(this._attribHTML=p,t.length?(this._innerContainer.innerHTML=He.sanitize(p),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Pp{constructor(t={}){this._updateCompact=()=>{let a=this._container.children;if(a.length){let p=a[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&p.classList.add("maplibregl-compact"):p.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){var a;this._map=t,this._compact=(a=this.options)===null||a===void 0?void 0:a.compact,this._container=He.create("div","maplibregl-ctrl");let p=He.create("a","maplibregl-ctrl-logo");return p.target="_blank",p.rel="noopener nofollow",p.href="https://maplibre.org/",p.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),p.setAttribute("rel","noopener nofollow"),this._container.appendChild(p),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class kp{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){let a=++this._id;return this._queue.push({callback:t,id:a,cancelled:!1}),a}remove(t){let a=this._currentlyRunning,p=a?this._queue.concat(a):this._queue;for(let f of p)if(f.id===t)return void(f.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let a=this._currentlyRunning=this._queue;this._queue=[];for(let p of a)if(!p.cancelled&&(p.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var hd=o.aS([{name:"a_pos3d",type:"Int16",components:3}]);class ud extends o.E{constructor(t){super(),this._lastTilesetChange=Mt(),this.tileManager=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=t._source.tileSize*2**this.deltaZoom,t.usedForTerrain=!0,t.tileSize=this.tileSize}destruct(){this.tileManager.usedForTerrain=!1,this.tileManager.tileSize=null}getSource(){return this.tileManager._source}update(t,a){this.tileManager.update(t,a),this._renderableTilesKeys=[];let p={};for(let f of ao(t,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:a,calculateTileZoom:this.tileManager._source.calculateTileZoom}))p[f.key]=!0,this._renderableTilesKeys.push(f.key),this._tiles[f.key]||(f.terrainRttPosMatrix32f=new Float64Array(16),o.c7(f.terrainRttPosMatrix32f,0,o.a6,o.a6,0,0,1),this._tiles[f.key]=new ta(f,this.tileSize),this._lastTilesetChange=Mt());for(let f in this._tiles)p[f]||delete this._tiles[f]}freeRtt(t){for(let a in this._tiles){let p=this._tiles[a];(!t||p.tileID.equals(t)||p.tileID.isChildOf(t)||t.isChildOf(p.tileID))&&(p.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((t=>this.getTileByID(t)))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t,a){return a?this._getTerrainCoordsForTileRanges(t,a):this._getTerrainCoordsForRegularTile(t)}_getTerrainCoordsForRegularTile(t){let a={};for(let p of this._renderableTilesKeys){let f=this._tiles[p].tileID,b=t.clone(),P=o.bj();if(f.canonical.equals(t.canonical))o.c7(P,0,o.a6,o.a6,0,0,1);else if(f.canonical.isChildOf(t.canonical)){let D=f.canonical.z-t.canonical.z,B=f.canonical.x-(f.canonical.x>>D<<D),U=f.canonical.y-(f.canonical.y>>D<<D),$=o.a6>>D;o.c7(P,0,$,$,0,0,1),o.Q(P,P,[-B*$,-U*$,0])}else{if(!t.canonical.isChildOf(f.canonical))continue;{let D=t.canonical.z-f.canonical.z,B=t.canonical.x-(t.canonical.x>>D<<D),U=t.canonical.y-(t.canonical.y>>D<<D),$=o.a6>>D;o.c7(P,0,o.a6,o.a6,0,0,1),o.Q(P,P,[B*$,U*$,0]),o.S(P,P,[1/2**D,1/2**D,0])}}b.terrainRttPosMatrix32f=new Float32Array(P),a[p]=b}return a}_getTerrainCoordsForTileRanges(t,a){let p={};for(let f of this._renderableTilesKeys){let b=this._tiles[f].tileID;if(!this._isWithinTileRanges(b,a))continue;let P=t.clone(),D=o.bj();if(b.canonical.z===t.canonical.z){let B=t.canonical.x-b.canonical.x+t.wrap*(1<<t.canonical.z),U=t.canonical.y-b.canonical.y;o.c7(D,0,o.a6,o.a6,0,0,1),o.Q(D,D,[B*o.a6,U*o.a6,0])}else if(b.canonical.z>t.canonical.z){let B=b.canonical.z-t.canonical.z,U=b.canonical.x-(b.canonical.x>>B<<B)+t.wrap*(1<<b.canonical.z),$=b.canonical.y-(b.canonical.y>>B<<B),Y=t.canonical.x-(b.canonical.x>>B),ee=t.canonical.y-(b.canonical.y>>B),oe=o.a6>>B;o.c7(D,0,oe,oe,0,0,1),o.Q(D,D,[-U*oe+Y*o.a6,-$*oe+ee*o.a6,0])}else{let B=t.canonical.z-b.canonical.z,U=t.canonical.x-(t.canonical.x>>B<<B)+t.wrap*(1<<t.canonical.z),$=t.canonical.y-(t.canonical.y>>B<<B),Y=(t.canonical.x>>B)-b.canonical.x,ee=(t.canonical.y>>B)-b.canonical.y,oe=o.a6<<B;o.c7(D,0,oe,oe,0,0,1),o.Q(D,D,[U*o.a6+Y*oe,$*o.a6+ee*oe,0])}P.terrainRttPosMatrix32f=new Float32Array(D),p[f]=P}return p}getSourceTile(t,a){var p,f;let b=this.tileManager._source,P=t.overscaledZ-this.deltaZoom;if(P>b.maxzoom&&(P=b.maxzoom),P<b.minzoom)return;(p=this._sourceTileCache)[f=t.key]||(p[f]=t.scaledTo(P).key);let D=this.findTileInCaches(this._sourceTileCache[t.key]);if(!D?.dem&&a)for(;P>=b.minzoom&&!D?.dem;)D=this.findTileInCaches(t.scaledTo(P--).key);return D}findTileInCaches(t){let a=this.tileManager.getTileByID(t);return a||(a=this.tileManager._outOfViewCache.getByKey(t),a)}anyTilesAfterTime(t=Date.now()){return this._lastTilesetChange>=t}_isWithinTileRanges(t,a){let p=a[t.canonical.z];return!!p&&(t.wrap>p.minWrap||t.wrap<p.maxWrap||t.canonical.x>=p.minTileXWrapped&&t.canonical.x<=p.maxTileXWrapped&&t.canonical.y>=p.minTileY&&t.canonical.y<=p.maxTileY)}}class ul{constructor(t,a,p){this._meshCache={},this.painter=t,this.tileManager=new ud(a),this.options=p,this.exaggeration=typeof p.exaggeration=="number"?p.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}destroy(){this._fbo&&(this._fbo.destroy(),this._fbo=null),this._fboCoordsTexture&&(this._fboCoordsTexture.destroy(),this._fboCoordsTexture=null),this._fboDepthTexture&&(this._fboDepthTexture.destroy(),this._fboDepthTexture=null),this._emptyDemTexture&&(this._emptyDemTexture.destroy(),this._emptyDemTexture=null),this._emptyDepthTexture&&(this._emptyDepthTexture.destroy(),this._emptyDepthTexture=null),this._coordsTexture&&(this._coordsTexture.destroy(),this._coordsTexture=null);for(let t in this._meshCache)this._meshCache[t].destroy();this._meshCache={},this.tileManager.destruct()}getDEMElevation(t,a,p,f=o.a6){var b;let P=t.normalizeCoordinates(a,p,f);if(!P)return 0;let D=this.getTerrainData(P.tileID),B=(b=D.tile)===null||b===void 0?void 0:b.dem;if(!B)return 0;let U=o.cC([],[P.x/f*o.a6,P.y/f*o.a6],D.u_terrain_matrix),$=[U[0]*B.dim,U[1]*B.dim],Y=Math.floor($[0]),ee=Math.floor($[1]),oe=$[0]-Y,_e=$[1]-ee;return B.get(Y,ee)*(1-oe)*(1-_e)+B.get(Y+1,ee)*oe*(1-_e)+B.get(Y,ee+1)*(1-oe)*_e+B.get(Y+1,ee+1)*oe*_e}getElevationForLngLatZoom(t,a){if(!o.cD(a,t.wrap()))return 0;let{tileID:p,mercatorX:f,mercatorY:b}=this._getOverscaledTileIDFromLngLatZoom(t,a);return this.getElevation(p,f%o.a6,b%o.a6,o.a6)}getElevationForLngLat(t,a){let p=ao(a,{maxzoom:this.tileManager.maxzoom,minzoom:this.tileManager.minzoom,tileSize:512,terrain:this}),f=0;for(let b of p)b.canonical.z>f&&(f=Math.min(b.canonical.z,this.tileManager.maxzoom));return this.getElevationForLngLatZoom(t,f)}getElevation(t,a,p,f=o.a6){return this.getDEMElevation(t,a,p,f)*this.exaggeration}getTerrainData(t){var a,p;if(!this._emptyDemTexture){let P=this.painter.context,D=new o.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new o.T(P,D,P.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new o.T(P,new o.R({width:1,height:1}),P.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(P.gl.NEAREST,P.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=o.ap([])}let f=this.tileManager.getSourceTile(t,!0);if(f?.dem&&(!f.demTexture||f.needsTerrainPrepare)){let P=this.painter.context;f.demTexture=this.painter.getTileTexture(f.dem.stride),f.demTexture?f.demTexture.update(f.dem.getPixels(),{premultiply:!1}):f.demTexture=new o.T(P,f.dem.getPixels(),P.gl.RGBA,{premultiply:!1}),f.demTexture.bind(P.gl.NEAREST,P.gl.CLAMP_TO_EDGE),f.needsTerrainPrepare=!1}let b=f&&f.toString()+f.tileID.key+t.key;if(b&&!this._demMatrixCache[b]){let P=this.tileManager.getSource().maxzoom,D=t.canonical.z-f.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=P?D=t.canonical.z-P:o.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let B=t.canonical.x-(t.canonical.x>>D<<D),U=t.canonical.y-(t.canonical.y>>D<<D),$=o.cE(new Float64Array(16),[1/(o.a6<<D),1/(o.a6<<D),0]);o.Q($,$,[B*o.a6,U*o.a6,0]),this._demMatrixCache[b]={matrix:$,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:((a=f?.dem)===null||a===void 0?void 0:a.dim)||1,u_terrain_matrix:b?this._demMatrixCache[b].matrix:this._emptyDemMatrix,u_terrain_unpack:((p=f?.dem)===null||p===void 0?void 0:p.getUnpackVector())||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(f?.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:f}}getFramebuffer(t){let a=this.painter,p=a.width/devicePixelRatio,f=a.height/devicePixelRatio;return!this._fbo||this._fbo.width===p&&this._fbo.height===f||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new o.T(a.context,{width:p,height:f,data:null},a.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(a.context.gl.NEAREST,a.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new o.T(a.context,{width:p,height:f,data:null},a.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(a.context.gl.NEAREST,a.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=a.context.createFramebuffer(p,f,!0,!1),this._fbo.depthAttachment.set(a.context.createRenderbuffer(a.context.gl.DEPTH_COMPONENT16,p,f))),this._fbo.colorAttachment.set(t==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let t=this.painter.context;if(this._coordsTexture)return this._coordsTexture;let a=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let b=0,P=0;b<this._coordsTextureSize;b++)for(let D=0;D<this._coordsTextureSize;D++,P+=4)a[P+0]=255&D,a[P+1]=255&b,a[P+2]=D>>8<<4|b>>8,a[P+3]=0;let p=new o.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(a.buffer)),f=new o.T(t,p,t.gl.RGBA,{premultiply:!1});return f.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=f,f}pointCoordinate(t){this.painter.maybeDrawDepth(!0),this.painter.maybeDrawCoords();
800let a=new Uint8Array(4),p=this.painter.context,f=p.gl,b=Math.round(t.x*this.painter.pixelRatio/devicePixelRatio),P=Math.round(t.y*this.painter.pixelRatio/devicePixelRatio),D=Math.round(this.painter.height/devicePixelRatio);p.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),f.readPixels(b,D-P-1,1,1,f.RGBA,f.UNSIGNED_BYTE,a),p.bindFramebuffer.set(null);let B=a[0]+(a[2]>>4<<8),U=a[1]+((15&a[2])<<8),$=this.coordsIndex[255-a[3]],Y=$&&this.tileManager.getTileByID($);if(!Y)return null;let ee=this._coordsTextureSize,oe=(1<<Y.tileID.canonical.z)*ee;return new o.a7((Y.tileID.canonical.x*ee+B)/oe+Y.tileID.wrap,(Y.tileID.canonical.y*ee+U)/oe,this.getElevation(Y.tileID,B,U,ee))}depthAtPoint(t){let a=new Uint8Array(4),p=this.painter.context,f=p.gl;return p.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),f.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,f.RGBA,f.UNSIGNED_BYTE,a),p.bindFramebuffer.set(null),(a[0]/16777216+a[1]/65536+a[2]/256+a[3])/256}getTerrainMesh(t){var a;let p=((a=this.painter.style.projection)===null||a===void 0?void 0:a.transitionState)>0,f=p&&t.canonical.y===0,b=p&&t.canonical.y===(1<<t.canonical.z)-1,P=`m_${f?"n":""}_${b?"s":""}`;if(this._meshCache[P])return this._meshCache[P];let D=this.painter.context,B=new o.cF,U=new o.aW,$=this.meshSize,Y=o.a6/$,ee=$*$;for(let Fe=0;Fe<=$;Fe++)for(let it=0;it<=$;it++)B.emplaceBack(it*Y,Fe*Y,0);for(let Fe=0;Fe<ee;Fe+=$+1)for(let it=0;it<$;it++)U.emplaceBack(it+Fe,$+it+Fe+1,$+it+Fe+2),U.emplaceBack(it+Fe,$+it+Fe+2,it+Fe+1);let oe=B.length,_e=oe+($+1),Ie=($+1)*$,ze=f?o.bq:0,Ee=f?0:1,De=b?o.br:o.a6,je=b?0:1;for(let Fe=0;Fe<=$;Fe++)B.emplaceBack(Fe*Y,ze,Ee);for(let Fe=0;Fe<=$;Fe++)B.emplaceBack(Fe*Y,De,je);for(let Fe=0;Fe<$;Fe++)U.emplaceBack(Ie+Fe,_e+Fe,_e+Fe+1),U.emplaceBack(Ie+Fe,_e+Fe+1,Ie+Fe+1),U.emplaceBack(0+Fe,oe+Fe+1,oe+Fe),U.emplaceBack(0+Fe,0+Fe+1,oe+Fe+1);let Le=B.length,we=Le+2*($+1);for(let Fe of[0,1])for(let it=0;it<=$;it++)for(let ft of[0,1])B.emplaceBack(Fe*o.a6,it*Y,ft);for(let Fe=0;Fe<2*$;Fe+=2)U.emplaceBack(Le+Fe,Le+Fe+1,Le+Fe+3),U.emplaceBack(Le+Fe,Le+Fe+3,Le+Fe+2),U.emplaceBack(we+Fe,we+Fe+3,we+Fe+1),U.emplaceBack(we+Fe,we+Fe+2,we+Fe+3);let qe=new Cr(D.createVertexBuffer(B,hd.members),D.createIndexBuffer(U),o.aV.simpleSegment(0,0,B.length,U.length));return this._meshCache[P]=qe,qe}getMeshFrameDelta(t){return 2*Math.PI*o.bD/Math.pow(2,Math.max(t,0))/5}getMinTileElevationForLngLatZoom(t,a){var p;if(!o.cD(a,t.wrap()))return 0;let{tileID:f}=this._getOverscaledTileIDFromLngLatZoom(t,a);return(p=this.getMinMaxElevation(f).minElevation)!==null&&p!==void 0?p:0}getMinMaxElevation(t){let a=this.getTerrainData(t).tile,p={minElevation:null,maxElevation:null};return a?.dem&&(p.minElevation=a.dem.min*this.exaggeration,p.maxElevation=a.dem.max*this.exaggeration),p}_getOverscaledTileIDFromLngLatZoom(t,a){let p=o.a7.fromLngLat(t.wrap()),f=(1<<a)*o.a6,b=p.x*f,P=p.y*f,D=Math.floor(b/o.a6),B=Math.floor(P/o.a6);return{tileID:new o.a3(a,0,a,D,B),mercatorX:b,mercatorY:P}}}class pn{constructor(t,a,p){this._context=t,this._size=a,this._tileSize=p,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(let t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){let a=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),p=new o.T(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return p.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),this._context.extTextureFilterAnisotropic&&this._context.gl.texParameterf(this._context.gl.TEXTURE_2D,this._context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this._context.extTextureFilterAnisotropicMax),a.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),a.colorAttachment.set(p.texture),{id:t,fbo:a,texture:p,stamp:-1,inUse:!1}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter((a=>t.id!==a)),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(let a of this._recentlyUsed)if(!this._objects[a].inUse)return this._objects[a];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");let t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(let t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length<this._size)&&this._objects.some((t=>!t.inUse))===!1}}let Pr={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};class au{constructor(t,a){this.painter=t,this.terrain=a,this.pool=new pn(t.context,30,a.tileManager.tileSize*a.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}
vendor: 4,326 bytes, line 800
800prepareForRender(t,a){var p,f,b;this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=t._order.filter((P=>!t._layers[P].isHidden(a))),this._coordsAscending={};for(let P in t.tileManagers){this._coordsAscending[P]={};let D=t.tileManagers[P].getVisibleCoordinates(),B=t.tileManagers[P].getSource(),U=B instanceof oo?B.terrainTileRanges:null;for(let $ of D){let Y=this.terrain.tileManager.getTerrainCoords($,U);for(let ee in Y)(b=this._coordsAscending[P])[ee]||(b[ee]=[]),this._coordsAscending[P][ee].push(Y[ee])}}this._rttFingerprints={};for(let P of t._order){let D=t._layers[P],B=D.source;if(Pr[D.type]&&!this._rttFingerprints[B]){this._rttFingerprints[B]={};let U=(f=(p=t.tileManagers[B])===null||p===void 0?void 0:p.getState().revision)!==null&&f!==void 0?f:0;for(let $ in this._coordsAscending[B])this._rttFingerprints[B][$]=`${this._coordsAscending[B][$].map((Y=>Y.key)).sort().join()}#${U}`}}for(let P of this._renderableTiles)for(let D in this._rttFingerprints){let B=this._rttFingerprints[D][P.tileID.key];B&&B!==P.rttFingerprint[D]&&(P.rtt=[])}}renderLayer(t,a){if(t.isHidden(this.painter.transform.zoom))return!1;let p=Object.assign(Object.assign({},a),{isRenderingToTexture:!0}),f=t.type,b=this.painter,P=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(Pr[f]&&(this._prevType&&Pr[this._prevType]||this._stacks.push([]),this._prevType=f,this._stacks[this._stacks.length-1].push(t.id),!P))return!0;if(Pr[this._prevType]||Pr[f]&&P){this._prevType=f;let D=this._stacks.length-1,B=this._stacks[D]||[];for(let U of this._renderableTiles){if(this.pool.isFull()&&(Tt(this.painter,this.terrain,this._rttTiles,p),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(U),U.rtt[D]){let Y=this.pool.getObjectForId(U.rtt[D].id);if(Y.stamp===U.rtt[D].stamp){this.pool.useObject(Y);continue}}let $=this.pool.getOrCreateFreeObject();this.pool.useObject($),this.pool.stampObject($),U.rtt[D]={id:$.id,stamp:$.stamp},b.context.bindFramebuffer.set($.fbo.framebuffer),b.context.clear({color:o.bo.transparent,stencil:0}),b.currentStencilSource=void 0;for(let Y of B){let ee=b.style._layers[Y],oe=ee.source?this._coordsAscending[ee.source][U.tileID.key]:[U.tileID];b.context.viewport.set([0,0,$.fbo.width,$.fbo.height]),b._renderTileClippingMasks(ee,oe,!0),b.renderLayer(b,b.style.tileManagers[ee.source],ee,oe,p),ee.source&&(U.rttFingerprint[ee.source]=this._rttFingerprints[ee.source][U.tileID.key])}}return Tt(this.painter,this.terrain,this._rttTiles,p),this._rttTiles=[],this.pool.freeAllObjects(),Pr[f]}return!1}}let mc={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Drag to rotate map, click to reset north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use \u2318 + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},Lu=pe,Ru={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:Du,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileC
800acheSize:null,maxTileCacheZoomLevels:o.c.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,transformConstrain:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,reduceMotion:void 0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0,experimentalZoomLevelsToOverscale:void 0,anisotropicFilterPitch:20},ro=class extends Mp{get _ownerWindow(){var _,t;return((t=(_=this._container)===null||_===void 0?void 0:_.ownerDocument)===null||t===void 0?void 0:t.defaultView)||window}constructor(_){var t,a,p;let f=Object.assign(Object.assign(Object.assign({},Ru),_),{canvasContextAttributes:Object.assign(Object.assign({},Ru.canvasContextAttributes),_.canvasContextAttributes)});if(f.minZoom!=null&&f.maxZoom!=null&&f.minZoom>f.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(f.minPitch!=null&&f.maxPitch!=null&&f.minPitch>f.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(f.minPitch!=null&&f.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(f.maxPitch!=null&&f.maxPitch>180)throw new Error("maxPitch must be less than or equal to 180");let b=new Ms,P=new Ps;f.minZoom!==void 0&&b.setMinZoom(f.minZoom),f.maxZoom!==void 0&&b.setMaxZoom(f.maxZoom),f.minPitch!==void 0&&b.setMinPitch(f.minPitch),f.maxPitch!==void 0&&b.setMaxPitch(f.maxPitch),f.renderWorldCopies!==void 0&&b.setRenderWorldCopies(f.renderWorldCopies),f.transformConstrain!==null&&b.setConstrainOverride(f.transformConstrain),super(b,P,{bearingSnap:f.bearingSnap,zoomSnap:f.zoomSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new kp,this._controls=[],this._mapId=o.ad(),this._lostContextStyle={style:null,images:null},this._contextLost=B=>{if(B.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),this.style){for(let U of Object.values(this.style._layers))if(U.type==="custom"&&console.warn(`Custom layer with id '${U.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),U._listeners)for(let[$]of Object.entries(U._listeners))console.warn(`Custom layer with id '${U.id}' had event listeners for event '${$}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this.style.destroy(),this.style=null,this.fire(new o.n("webglcontextlost",{originalEvent:B}))}else this.fire(new o.n("webglcontextlost",{originalEvent:B}))},this._contextRestored=B=>{this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&this.style&&(this.style.imageManager.images=this._lostContextStyle.images),this._lostContextStyle={style:null,images:null},this._setupPainter(),this.resize(),this._update(),this._resizeInternal(),this.fire(new o.n("webglcontextrestored",{originalEvent:B}))},this._onMapScroll=B=>{if(B.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=f.interactive,this._maxTileCacheSize=f.maxTileCacheSize,this._maxTileCacheZoomLevels=f.maxTileCacheZoomLevels,this._canvasContextAttributes=Object.assign({},f.canvasContextAttributes),this._trackResize=f.trackResize===!0,this._bearingSnap=f.bearingSnap,this._zoomSnap=f.zoomSnap,this._centerClampedToGround=f.centerClampedToGround,this._refreshExpiredTiles=f.refreshExpiredTiles===!0,this._fadeDuration=f.fadeDuration,this._crossSourceCollisions=f.crossSourceCollisions===!0,this._collectResourceTiming=f.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},mc),f.locale),this._clickTolerance=f.clickTolerance,this._overridePixelRatio=f.pixelRatio,this._maxCanvasSize=f.maxCanvasSize,this._zoomLevelsToOverscale=f.experimentalZoomLevelsToOverscale,this.transformCameraUpdate=f.transformCameraUpdate,this.transformConstrain=f.transformConstrain,this.cancelPendingTileRequestsWhileZooming=f.cancelPendingTileRequestsWhileZooming===!0,this.setAnisotropicFilterPitch(f.anisotropicFilterPitch),f.reduceMotion!==void 0&&(Bt.prefersReducedMotion=f.reduceMotion),this._imageQueueHandle=At.addThrottleControl((()=>
800this.isMoving())),this._requestManager=new Ut(f.transformRequest),this._container=this._resolveContainer(f.container),f.maxBounds&&this.setMaxBounds(f.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",(()=>this._update(!1))),this.on("moveend",(()=>this._update(!1))),this.on("zoom",(()=>this._update(!0))),this.on("terrain",(()=>{this.painter.terrainFacilitator.depthDirty=!0,this._update(!0)})),this.once("idle",(()=>this._idleTriggered=!0)),typeof window<"u"&&(this._ownerWindow.addEventListener("online",this._onWindowOnline,!1),this._setupResizeObserver()),this.handlers=new aa(this,f),this._hash=f.hash?new ai(typeof f.hash=="string"&&f.hash||void 0).addTo(this):void 0,!((t=this._hash)===null||t===void 0)&&t._onHashChange()||(this.jumpTo({center:f.center,elevation:f.elevation,zoom:f.zoom,bearing:f.bearing,pitch:f.pitch,roll:f.roll}),f.bounds&&(this.resize(),this.fitBounds(f.bounds,o.e({},f.fitBoundsOptions,{duration:0}))));let D=typeof f.style=="string"||((p=(a=f.style)===null||a===void 0?void 0:a.projection)===null||p===void 0?void 0:p.type)!=="globe";this.resize(null,D),this._localIdeographFontFamily=f.localIdeographFontFamily,this._validateStyle=f.validateStyle,f.style&&this.setStyle(f.style,{localIdeographFontFamily:f.localIdeographFontFamily}),f.attributionControl&&this.addControl(new ka(typeof f.attributionControl=="boolean"?void 0:f.attributionControl)),f.maplibreLogo&&this.addControl(new Pp,f.logoPosition),this.on("style.load",(()=>{if(D||this._resizeTransform(),this.transform.unmodified){let B=o.V(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(B)}})),this.on("data",(B=>{this._update(B.dataType==="style"),this.fire(new o.n(`${B.dataType}data`,B))})),this.on("dataloading",(B=>{this.fire(new o.n(`${B.dataType}dataloading`,B))})),this.on("dataabort",(B=>{this.fire(new o.n("sourcedataabort",B))}))}_getMapId(){return this._mapId}setGlobalStateProperty(_,t){return this.style.setGlobalStateProperty(_,t),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(_,t){if(t===void 0&&(t=_.getDefaultPosition?_.getDefaultPosition():"top-right"),!_?.onAdd)return this.fire(new o.l(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let a=_.onAdd(this);this._controls.push(_);let p=this._controlPositions[t];return t.includes("bottom")?p.insertBefore(a,p.firstChild):p.appendChild(a),this}removeControl(_){if(!_?.onRemove)return this.fire(new o.l(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let t=this._controls.indexOf(_);return t>-1&&this._controls.splice(t,1),_.onRemove(this),this}hasControl(_){return this._controls.includes(_)}coveringTiles(_){return ao(this.transform,_)}calculateCameraOptionsFromTo(_,t,a,p){return p==null&&this.terrain&&(p=this.terrain.getElevationForLngLat(a,this.transform)),super.calculateCameraOptionsFromTo(_,t,a,p)}resize(_,t=!0){if(this._lostContextStyle.style!==null)return this;this._resizeInternal(t);let a=!this._moving;return a&&(this.stop(),this.fire(new o.n("movestart",_)).fire(new o.n("move",_))),this.fire(new o.n("resize",_)),a&&this.fire(new o.n("moveend",_)),this}_resizeInternal(_=!0){let[t,a]=this._containerDimensions(),p=this._getClampedPixelRatio(t,a);if(this._resizeCanvas(t,a,p),this.painter.resize(t,a,p),this.painter.overLimit()){let f=this.painter.context.gl;this._maxCanvasSize=[f.drawingBufferWidth,f.drawingBufferHeight];let b=this._getClampedPixelRatio(t,a);this._resizeCanvas(t,a,b),this.painter.resize(t,a,b)}this._resizeTransform(_)}_resizeTransform(_=!0){var t;let[a,p]=this._containerDimensions();this.transform.resize(a,p,_),(t=this._requestedCameraState)===null||t===void 0||t.resize(a,p,_)}_getClampedPixelRatio(_,t){let{0:a,1:p}=this._maxCanvasSize,f=this.getPixelRatio(),b=_*f,P=t*f;return Math.min(b>a?a/b:1,P>p?p/P:1)*f}getPixelRatio(){var _;return(_=this._overridePixelRatio)!==null&&_!==void 0?_:devicePixelRatio}setPixelRatio(_){this._overridePixelRatio=_,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(_){return this.transform.setMaxBounds(Ti.convert(_)),this._update()}setMinZoom(_){if((_=_??-2)>=-2&&_<=this.transform.maxZoom){let t=this.transform.zoom,a=this._getTransformForUpdate();return a.setMinZoom(_),this._applyUpdatedTransform(a),this._update(),t!==this.transform.zoom&&this.fire(new o.n("zoomstart")).fire(new o.n("zoom")).fire(new o.n("zoomend")).fire(new o.n("movestart")).fire(new o.n("move")).fire(new o.n("moveend")),this}throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(_){if((_=_??22)>=this.transform.minZoom){let t=this.transform.zoom,a=this._getTransformForUpdate();return a.setMaxZoom(_),this._applyUpdatedTransform(a),this._update(),t!==this.transform.zoom&&this.fire(new o.n("zoomstart")).fire(new o.n("zoom")).fire(new o.n("zoomend")).fire(new o.n("movestart")).fire(new o.n("move")).fire(new o.n("moveend")),this}
800throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(_){if((_=_??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(_>=0&&_<=this.transform.maxPitch){let t=this.transform.pitch,a=this._getTransformForUpdate();return a.setMinPitch(_),this._applyUpdatedTransform(a),this._update(),t!==this.transform.pitch&&this.fire(new o.n("pitchstart")).fire(new o.n("pitch")).fire(new o.n("pitchend")).fire(new o.n("movestart")).fire(new o.n("move")).fire(new o.n("moveend")),this}throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(_){if((_=_??60)>180)throw new Error("maxPitch must be less than or equal to 180");if(_>=this.transform.minPitch){let t=this.transform.pitch,a=this._getTransformForUpdate();return a.setMaxPitch(_),this._applyUpdatedTransform(a),this._update(),t!==this.transform.pitch&&this.fire(new o.n("pitchstart")).fire(new o.n("pitch")).fire(new o.n("pitchend")).fire(new o.n("movestart")).fire(new o.n("move")).fire(new o.n("moveend")),this}throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getAnisotropicFilterPitch(){return this._anisotropicFilterPitch}setAnisotropicFilterPitch(_){if((_=_??20)>180)throw new Error("anisotropicFilterPitch must be less than or equal to 180");if(_<0)throw new Error("anisotropicFilterPitch must be greater than or equal to 0");return this._anisotropicFilterPitch=_,this._update()}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(_){return this.transform.setRenderWorldCopies(_),this._update()}setTransformConstrain(_){return this.transform.setConstrainOverride(_),this._update()}project(_){return this.transform.locationToScreenPoint(o.W.convert(_),this.style&&this.terrain)}unproject(_){return this.transform.screenPointToLocation(o.P.convert(_),this.terrain)}isMoving(){var _;return this._moving||((_=this.handlers)===null||_===void 0?void 0:_.isMoving())}isZooming(){var _;return this._zooming||((_=this.handlers)===null||_===void 0?void 0:_.isZooming())}isRotating(){var _;return this._rotating||((_=this.handlers)===null||_===void 0?void 0:_.isRotating())}_createDelegatedListener(_,t,a){if(_==="mouseenter"||_==="mouseover"){let p=!1;return{layers:t,listener:a,delegates:{mousemove:b=>{let P=t.filter((B=>this.getLayer(B))),D=P.length!==0?this.queryRenderedFeatures(b.point,{layers:P}):[];D.length?p||(p=!0,a.call(this,new cn(_,this,b.originalEvent,{features:D}))):p=!1},mouseout:()=>{p=!1}}}}if(_==="mouseleave"||_==="mouseout"){let p=!1;return{layers:t,listener:a,delegates:{mousemove:P=>{let D=t.filter((B=>this.getLayer(B)));(D.length!==0?this.queryRenderedFeatures(P.point,{layers:D}):[]).length?p=!0:p&&(p=!1,a.call(this,new cn(_,this,P.originalEvent)))},mouseout:P=>{p&&(p=!1,a.call(this,new cn(_,this,P.originalEvent)))}}}}{let p=f=>{let b=t.filter((D=>this.getLayer(D))),P=b.length!==0?this.queryRenderedFeatures(f.point,{layers:b}):[];P.length&&(f.features=P,a.call(this,f),delete f.features)};return{layers:t,listener:a,delegates:{[_]:p}}}}_saveDelegatedListener(_,t){var a;this._delegatedListeners||(this._delegatedListeners={}),(a=this._delegatedListeners)[_]||(a[_]=[]),this._delegatedListeners[_].push(t)}_removeDelegatedListener(_,t,a){var p;if(!(!((p=this._delegatedListeners)===null||p===void 0)&&p[_]))return;let f=this._delegatedListeners[_];for(let b=0;b<f.length;b++){let P=f[b];if(P.listener===a&&P.layers.length===t.length&&P.layers.every((D=>t.includes(D)))){for(let D in P.delegates)this.off(D,P.delegates[D]);return void f.splice(b,1)}}}on(_,t,a){if(a===void 0)return super.on(_,t);let p=typeof t=="string"?[t]:t,f=this._createDelegatedListener(_,p,a);this._saveDelegatedListener(_,f);for(let b in f.delegates)this.on(b,f.delegates[b]);return{unsubscribe:()=>{this._removeDelegatedListener(_,p,a)}}}once(_,t,a){if(a===void 0)return super.once(_,t);let p=typeof t=="string"?[t]:t,f=this._createDelegatedListener(_,p,a);for(let b in f.delegates){let P=f.delegates[b];f.delegates[b]=(...D)=>{this._removeDelegatedListener(_,p,a),P(...D)}}this._saveDelegatedListener(_,f);for(let b in f.delegates)this.once(b,f.delegates[b]);return this}off(_,t,a){return a===void 0?super.off(_,t):(this._removeDelegatedListener(_,typeof t=="string"?[t]:t,a),this)}queryRenderedFeatures(_,t){if(!this.style)return[];let a,p=_ instanceof o.P||Array.isArray(_),f=p?_:[[0,0],[this.transform.width,this.transform.height]];if(t||(t=(p?{}:_)||{}),f instanceof o.P||typeof f[0]=="number")a=[o.P.convert(f)];else{let b=o.P.convert(f[0]),P=o.P.convert(f[1]);a=[b,new o.P(P.x,b.y),P,new o.P(b.x,P.y),b]}return this.style.queryRenderedFeatures(a,t,this.transform)}querySourceFeatures(_,t){return this.style.querySourceFeatures(_,t)}setStyle(_,t){return(t=o.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._val
800idateStyle},t)).diff!==!1&&t.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&_?(this._diffStyle(_,t),this):(this._localIdeographFontFamily=t.localIdeographFontFamily,this._updateStyle(_,t))}setTransformRequest(_){return this._requestManager.setTransformRequest(_),this}_getUIString(_){let t=this._locale[_];if(t==null)throw new Error(`Missing UI string '${_}'`);return t}_updateStyle(_,t){var a,p,f;if((a=this._diffStyleRequest)===null||a===void 0||a.abort(),this._diffStyleRequest=null,t.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",(()=>this._updateStyle(_,t)));let b=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!_)),_?(this.style=new Ga(this,t||{}),this.style.setEventedParent(this,{style:this.style}),typeof _=="string"?this.style.loadURL(_,t,b):this.style.loadJSON(_,t,b),this):(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),(f=(p=this.style)===null||p===void 0?void 0:p.projection)===null||f===void 0||f.destroy(),delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Ga(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(_,t){return o._(this,void 0,void 0,(function*(){var a;if((a=this._diffStyleRequest)===null||a===void 0||a.abort(),typeof _=="string"){let p=_;this._diffStyleRequest=new AbortController;let f=this._diffStyleRequest;try{let b=yield this._requestManager.transformRequest(p,"Style");if(f.signal.aborted)return void(this._diffStyleRequest=null);let P=yield o.k(b,f);this._diffStyleRequest=null,this._updateDiff(P.data,t)}catch(b){this._diffStyleRequest=null,o.$(b)||this.fire(new o.l(o.d(b)))}}else typeof _=="object"&&(this._diffStyleRequest=null,this._updateDiff(_,t))}))}_updateDiff(_,t){try{this.style.setState(_,t)&&this._update(!0)}catch(a){o.w(`Unable to perform style diff: ${o.d(a).message}. Rebuilding the style from scratch.`),this._updateStyle(_,t)}}getStyle(){if(this.style)return this.style.serialize()}_getStyleAndImages(){return this.style?{style:this.style.serialize(),images:this.style.imageManager.cloneImages()}:{style:null,images:{}}}isStyleLoaded(){if(this.style)return this.style.loaded();o.w("There is no style added to the map.")}addSource(_,t){return this._lazyInitEmptyStyle(),this.style.addSource(_,t),this._update(!0)}isSourceLoaded(_){var t;let a=(t=this.style)===null||t===void 0?void 0:t.tileManagers[_];if(a!==void 0)return a.loaded();this.fire(new o.l(new Error(`There is no tile manager with ID '${_}'`)))}setTerrain(_){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),_){let t=this.style.tileManagers[_.source];if(!t)throw new Error(`cannot load terrain, because there exists no source with ID: ${_.source}`);this.terrain===null&&t.reload();for(let a in this.style._layers){let p=this.style._layers[a];p.type==="hillshade"&&p.source===_.source&&o.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality."),p.type==="color-relief"&&p.source===_.source&&o.w("You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new ul(this.painter,t,_),this.painter.renderToTexture=new au(this.painter,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._terrainDataCallback=a=>{var p;a.dataType==="style"?this.terrain.tileManager.freeRtt():a.dataType==="source"&&a.tile&&(a.sourceId!==_.source||this._elevationFreeze||(this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))),((p=a.source)===null||p===void 0?void 0:p.type)==="image"?this.terrain.tileManager.freeRtt():this.terrain.tileManager.freeRtt(a.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.destroy(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGroun
800d&&this.transform.setElevation(0);return this.fire(new o.n("terrain",{terrain:_})),this}getTerrain(){var _,t;return(t=(_=this.terrain)===null||_===void 0?void 0:_.options)!==null&&t!==void 0?t:null}areTilesLoaded(){var _;let t=(_=this.style)===null||_===void 0?void 0:_.tileManagers;for(let a of Object.values(t))if(!a.areTilesLoaded())return!1;return!0}removeSource(_){return this.style.removeSource(_),this._update(!0)}getSource(_){return this.style.getSource(_)}setSourceTileLodParams(_,t,a){if(a){let p=this.getSource(a);if(!p)throw new Error(`There is no source with ID "${a}", cannot set LOD parameters`);p.calculateTileZoom=eo(Math.max(1,_),Math.max(1,t))}else for(let p in this.style.tileManagers)this.style.tileManagers[p].getSource().calculateTileZoom=eo(Math.max(1,_),Math.max(1,t));return this._update(!0),this}refreshTiles(_,t){let a=this.style.tileManagers[_];if(!a)throw new Error(`There is no tile manager with ID "${_}", cannot refresh tile`);t===void 0?a.reload(!0):a.refreshTiles(t.map((p=>new o.aa(p.z,p.x,p.y))))}addImage(_,t,a={}){let{pixelRatio:p=1,sdf:f=!1,stretchX:b,stretchY:P,content:D,textFitWidth:B,textFitHeight:U}=a;if(this._lazyInitEmptyStyle(),!(t instanceof HTMLImageElement||o.b(t))){if(t.width===void 0||t.height===void 0)return this.fire(new o.l(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`")));{let{width:$,height:Y,data:ee}=t,oe=t;return this.style.addImage(_,{data:new o.R({width:$,height:Y},new Uint8Array(ee)),pixelRatio:p,stretchX:b,stretchY:P,content:D,textFitWidth:B,textFitHeight:U,sdf:f,version:0,userImage:oe}),oe.onAdd&&oe.onAdd(this,_),this}}{let{width:$,height:Y,data:ee}=Bt.getImageData(t);this.style.addImage(_,{data:new o.R({width:$,height:Y},ee),pixelRatio:p,stretchX:b,stretchY:P,content:D,textFitWidth:B,textFitHeight:U,sdf:f,version:0})}}updateImage(_,t){let a=this.style.getImage(_);if(!a)return this.fire(new o.l(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let p=t instanceof HTMLImageElement||o.b(t)?Bt.getImageData(t):t,{width:f,height:b,data:P}=p;if(f===void 0||b===void 0)return this.fire(new o.l(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(f!==a.data.width||b!==a.data.height)return this.fire(new o.l(new Error("The width and height of the updated image must be that same as the previous version of the image")));let D=!(t instanceof HTMLImageElement||o.b(t));return a.data.replace(P,D),this.style.updateImage(_,a),this}getImage(_){return this.style.getImage(_)}hasImage(_){return _?!!this.style.getImage(_):(this.fire(new o.l(new Error("Missing required image id"))),!1)}removeImage(_){this.style.removeImage(_)}loadImage(_){return o._(this,void 0,void 0,(function*(){return At.getImage(yield this._requestManager.transformRequest(_,"Image"),new AbortController)}))}listImages(){return this.style.listImages()}addLayer(_,t){return this._lazyInitEmptyStyle(),this.style.addLayer(_,t),this._update(!0)}moveLayer(_,t){return this.style.moveLayer(_,t),this._update(!0)}removeLayer(_){return this.style.removeLayer(_),this._update(!0)}getLayer(_){return this.style.getLayer(_)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(_,t,a){return this.style.setLayerZoomRange(_,t,a),this._update(!0)}setFilter(_,t,a={}){return this.style.setFilter(_,t,a),this._update(!0)}getFilter(_){return this.style.getFilter(_)}setPaintProperty(_,t,a,p={}){return this.style.setPaintProperty(_,t,a,p),this._update(!0)}getPaintProperty(_,t){return this.style.getPaintProperty(_,t)}setLayoutProperty(_,t,a,p={}){return this.style.setLayoutProperty(_,t,a,p),this._update(!0)}getLayoutProperty(_,t){return this.style.getLayoutProperty(_,t)}setGlyphs(_,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(_,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(_,t,a={}){return this._lazyInitEmptyStyle(),this.style.addSprite(_,t,a,(p=>{p||this._update(!0)})),this}removeSprite(_){return this._lazyInitEmptyStyle(),this.style.removeSprite(_),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(_,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(_,t,(a=>{a||this._update(!0)})),this}setLight(_,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(_,t),this._update(!0)}getLight(){return this.style.getLight()}setSky(_,t={}){return this._lazyInitEmptyStyle(),this.style.setSky(_,t),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(_,t){return this.style.setFeatureState(_,t),this._update()}removeFeatureState(_,t){return this.style.removeFeatureState(_,t),this._update()}getFeatureState(_){return this.style.getFeatureState(_)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let _=0,t=0;return this._container&&(_=this._container.clientWidth||400,t=this._container.clientHeight||300),[_,t]}_setupResizeObserver(){var _;let t=!1,a=Xt((f=>{this._trackResize&&!this._removed&&(this.resize(f),this.redraw())}),50),p=(_=this._ownerWindow.ResizeObserver)!==null&&_!==void 0?_:ResizeObserver;this._resizeObserver=new p((f=>{t?a(f):t=!0})),this._resizeObserver.observe(this._container)}
800_resolveContainer(_){if(typeof _=="string"){let t=document.getElementById(_);if(!t)throw new Error(`Container '${_}' not found.`);return t}if(_ instanceof HTMLElement||_&&typeof _=="object"&&_.nodeType===1)return _;throw new Error("Invalid type: 'container' must be a String or HTMLElement.")}_setupContainer(){let _=this._container;_.classList.add("maplibregl-map");let t=this._canvasContainer=He.create("div","maplibregl-canvas-container",_);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=He.create("canvas","maplibregl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");let a=this._containerDimensions(),p=this._getClampedPixelRatio(a[0],a[1]);this._resizeCanvas(a[0],a[1],p);let f=this._controlContainer=He.create("div","maplibregl-control-container",_),b=this._controlPositions={};for(let P of["top-left","top-right","bottom-left","bottom-right"])b[P]=He.create("div",`maplibregl-ctrl-${P} `,f);this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(_,t,a){this._canvas.width=Math.floor(a*_),this._canvas.height=Math.floor(a*t),this._canvas.style.width=`${_}px`,this._canvas.style.height=`${t}px`}_setupPainter(){let _=Object.assign(Object.assign({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0}),t=null;this._canvas.addEventListener("webglcontextcreationerror",(p=>{t={requestedAttributes:_},p&&(t.statusMessage=p.statusMessage,t.type=p.type)}),{once:!0});let a=null;if(a=this._canvasContextAttributes.contextType?this._canvas.getContext(this._canvasContextAttributes.contextType,_):this._canvas.getContext("webgl2",_)||this._canvas.getContext("webgl",_),!a){let p="Failed to initialize WebGL";throw t?(t.message=p,new Error(JSON.stringify(t))):new Error(p)}this.painter=new ri(a,this.transform)}migrateProjection(_,t){super.migrateProjection(_,t),this.painter.transform=_,this.fire(new o.n("projectiontransition",{newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(_){var t;return!((t=this.style)===null||t===void 0)&&t._loaded?(this._styleDirty||(this._styleDirty=_),this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(_){return this._update(),this._renderTaskQueue.add(_)}_cancelRenderFrame(_){this._renderTaskQueue.remove(_)}_render(_){var t,a,p,f,b,P;let D=this._idleTriggered?this._fadeDuration:0,B=((t=this.style.projection)===null||t===void 0?void 0:t.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(_),this._removed)return;let U=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let ee=this.transform.zoom,oe=Mt();this.style.zoomHistory.update(ee,oe);let _e=new o.J(ee,{now:oe,fadeDuration:D,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),Ie=_e.crossFadingFactor();Ie===1&&Ie===this._crossFadingFactor||(U=!0,this._crossFadingFactor=Ie),this.style.update(_e)}let $=((a=this.style.projection)===null||a===void 0?void 0:a.transitionState)>0!==B;(p=this.style.projection)===null||p===void 0||p.setErrorQueryLatitudeDegrees(this.transform.center.lat),this.transform.setTransitionState((f=this.style.projection)===null||f===void 0?void 0:f.transitionState,(b=this.style.projection)===null||b===void 0?void 0:b.latitudeErrorCorrectionRadians),this.style&&(this._sourcesDirty||$)&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.tileManager.update(this.transform,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),!this._elevationFreeze&&this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGroun
vendor: 15,686 bytes, line 800
800d&&this.transform.setElevation(0)),this._placementDirty=(P=this.style)===null||P===void 0?void 0:P._updatePlacement(this.transform,this.showCollisionBoxes,D,this._crossSourceCollisions,$),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:D,showPadding:this.showPadding,anisotropicFilterPitch:this.getAnisotropicFilterPitch()}),this.fire(new o.n("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new o.n("load"))),this.style&&(this.style.hasTransitions()||U)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let Y=this._sourcesDirty||this._styleDirty||this._placementDirty;return Y||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new o.n("idle")),!this._loaded||this._fullyLoaded||Y||(this._fullyLoaded=!0),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var _,t;this._hash&&this._hash.remove();for(let p of this._controls)p.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),(_=this._diffStyleRequest)===null||_===void 0||_.abort(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&this._ownerWindow.removeEventListener("online",this._onWindowOnline,!1),At.removeThrottleControl(this._imageQueueHandle),(t=this._resizeObserver)===null||t===void 0||t.disconnect();let a=this.painter.context.gl.getExtension("WEBGL_lose_context");a?.loseContext&&a.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map"),this._removed=!0,this.fire(new o.n("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,Bt.frame(this._frameRequest,(_=>{this._frameRequest=null;try{this._render(_)}catch(t){if(!o.$(t)&&!(function(a){return a.message===ra})(t))throw t}}),(()=>{}),this._ownerWindow))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(_){this._showTileBoundaries!==_&&(this._showTileBoundaries=_,this._update())}get showPadding(){return!!this._showPadding}set showPadding(_){this._showPadding!==_&&(this._showPadding=_,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(_){this._showCollisionBoxes!==_&&(this._showCollisionBoxes=_,_?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(_){this._showOverdrawInspector!==_&&(this._showOverdrawInspector=_,this._update())}get repaint(){return!!this._repaint}set repaint(_){this._repaint!==_&&(this._repaint=_,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(_){this._vertices=_,this._update()}get version(){return Lu}getCameraTargetElevation(){return this.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(_){return this._lazyInitEmptyStyle(),this.style.setProjection(_),this._update(!0)}},co={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class kh{constructor(t,a,p=!1){this.mousedown=b=>{this.startMove(b,He.mousePos(this.element,b)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)},this.mousemove=b=>{this.move(b,He.mousePos(this.element,b))},this.mouseup=b=>{this._rotatePitchHandler.dragEnd(b),this.offTemp()},this.touchstart=b=>{b.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=He.touchPos(this.element,b.targetTouches)[0],this.startMove(b,this._startPos),window.addEventListener("touchmove",this.touchmove,{passive:!1}),window.addEventListener("touchend",this.touchend))},this.touchmove=b=>{b.targetTouches.length!==1?this.reset():(this._lastPos=He.touchPos(this.element,b.targetTouches)[0],this.move(b,this._lastPos))},this.touchend=b=>{b.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this._rotatePitchHandler.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=a;let f=new cl;this._rotatePitchHandler=new Or({clickTolerance:3,move:(b,P)=>{let D=a.getBoundingClientRect(),B=new o.P((D.bottom-D.top)/2,(D.right-D.left)/2);return{bearingDelta:o.cx(new o.P(b.x,P.y),P,B),pitchDelta:p?-.5*(P.y-b.y):void 0}},moveStateManager:f,enable:!0,assignEvents:()=>{}}),this.map=t,a.addEventListener("mousedown",this.mousedown),a.addEventListener("touchstart",this.touchstart,{passive:!1}),a.addEventListener("touchcancel",this.reset)}startMove(t,a){this._rotatePitchHandler.dragStart(t,a),He.disableDrag()}move(t,a){let p=this.map,{bearingDelta:f,pitchDelta:b}=this._rotatePitchHandler.dragMove(t,a)||{};f&&p.setBearing(p.getBearing()+f),b&&p.setPitch(p.getPitch()+b)}off(){let t=this.element;t.removeEventListener("mousedown",this.mousedown),t.removeEventListener("touchstart",this.touchstart),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend),t.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){He.enableDrag(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend)}}let Os;function su(_,t,a,p=!1){if(p||!a.getCoveringTilesDetailsProvider().allowWorldCopies())return _?.wrap();let f=new o.W(_.lng,_.lat);if(_=new o.W(_.lng,_.lat),t){let b=new o.W(_.lng-360,_.lat),P=new o.W(_.lng+360,_.lat),D=a.locationToScreenPoint(_).distSqr(t);a.locationToScreenPoint(b).distSqr(t)<D?_=b:a.locationToScreenPoint(P).distSqr(t)<D&&(_=P)}for(;Math.abs(_.lng-a.center.lng)>180;){let b=a.locationToScreenPoint(_);if(b.x>=0&&b.y>=0&&b.x<=a.width&&b.y<=a.height)break;_.lng>a.center.lng?_.lng-=360:_.lng+=360}return _.lng!==f.lng&&a.isPointOnMapSurface(a.locationToScreenPoint(_))?_:f}let Ul={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Fu(_,t,a){let p=_.classList;for(let f in Ul)p.remove(`maplibregl-${a}-anchor-${f}`);p.add(`maplibregl-${a}-anchor-${t}`)}class Ah extends o.E{constructor(t){if(super(),this._onClick=a=>{this.fire(new o.n("click",{originalEvent:a}))},this._onKeyPress=a=>{a.code!=="Space"&&a.code!=="Enter"||this.togglePopup()},this._onMapClick=a=>{let p=a.originalEvent.target,f=this._element;this._popup&&(p===f||f.contains(p))&&this.togglePopup()},this._update=a=>{if(!this._map)return;let p=this._map.loaded()&&!this._map.isMoving();(a?.type==="terrain"||a?.type==="render"&&!p)&&this._map.once("render",this._update),this._lngLat=su(this._lngLat,this._flatPos,this._map.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let f="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?f=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(f=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let b="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?b="rotateX(0deg)":this._pitchAlignment==="map"&&(b=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||a&&a.type!=="moveend"||(this._pos=this._pos.round()),this._element.style.transform=`${Ul[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${b} ${f}`,Bt.frameAsync(new AbortController,this._map._ownerWindow).then((()=>{this._updateOpacity(a?.type==="moveend")})).catch((()=>{}))},this._onMove=a=>{if(!this._isDragging){let p=this._clickTolerance||this._map._clickTolerance;this._isDragging=a.point.dist(this._pointerdownPos)>=p}this._isDragging&&(this._pos=a.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new o.n("dragstart"))),this.fire(new o.n("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new o.n("dragend")),this._state="inactive"},this._addDragHandler=a=>{this._element.contains(a.originalEvent.target)&&(a.preventDefault(),this._positionDelta=a.point.sub(this._pos).add(this._offset),this._pointerdownPos=a.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=t?.anchor||"center",this._color=t?.color||"#3FB1CE",this._scale=t?.scale||1,this._draggable=t?.draggable||!1,this._clickTolerance=t?.clickTolerance||0,this._subpixelPositioning=t?.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=t?.rotation||0,this._rotationAlignment=t?.rotationAlignment||"auto",this._pitchAlignment=t?.pitchAlignment&&t.pitchAlignment!=="auto"?t.pitchAlignment:this._rotationAlignment,this.setOpacity(t?.opacity,t?.opacityWhenCovered),t?.element)this._element=t.element,this._offset=o.P.convert(t?.offset||[0,0]);else{this._defaultMarker=!0,this._element=He.create("div");let a=He.createNS("http://www.w3.org/2000/svg","svg"),p=41,f=27;a.setAttributeNS(null,"display","block"),a.setAttributeNS(null,"height",`${p}px`),a.setAttributeNS(null,"width",`${f}px`),a.setAttributeNS(null,"viewBox",`0 0 ${f} ${p}`);let b=He.createNS("http://www.w3.org/2000/svg","g");b.setAttributeNS(null,"stroke","none"),b.setAttributeNS(null,"stroke-width","1"),b.setAttributeNS(null,"fill","none"),b.setAttributeNS(null,"fill-rule","evenodd");let P=He.createNS("http://www.w3.org/2000/svg","g");P.setAttributeNS(null,"fill-rule","nonzero");let D=He.createNS("http://www.w3.org/2000/svg","g");D.setAttributeNS(null,"transform","translate(3.0, 29.0)"),D.setAttributeNS(null,"fill","#000000");let B=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(let Ee of B){let De=He.createNS("http://www.w3.org/2000/svg","ellipse");De.setAttributeNS(null,"opacity","0.04"),De.setAttributeNS(null,"cx","10.5"),De.setAttributeNS(null,"cy","5.80029008"),De.setAttributeNS(null,"rx",Ee.rx),De.setAttributeNS(null,"ry",Ee.ry),D.appendChild(De)}let U=He.createNS("http://www.w3.org/2000/svg","g");U.setAttributeNS(null,"fill",this._color);let $=He.createNS("http://www.w3.org/2000/svg","path");$.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),U.appendChild($);let Y=He.createNS("http://www.w3.org/2000/svg","g");Y.setAttributeNS(null,"opacity","0.25"),Y.setAttributeNS(null,"fill","#000000");let ee=He.createNS("http://www.w3.org/2000/svg","path");ee.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),Y.appendChild(ee);let oe=He.createNS("http://www.w3.org/2000/svg","g");oe.setAttributeNS(null,"transform","translate(6.0, 7.0)"),oe.setAttributeNS(null,"fill","#FFFFFF");let _e=He.createNS("http://www.w3.org/2000/svg","g");_e.setAttributeNS(null,"transform","translate(8.0, 8.0)");let Ie=He.createNS("http://www.w3.org/2000/svg","circle");Ie.setAttributeNS(null,"fill","#000000"),Ie.setAttributeNS(null,"opacity","0.25"),Ie.setAttributeNS(null,"cx","5.5"),Ie.setAttributeNS(null,"cy","5.5"),Ie.setAttributeNS(null,"r","5.4999962");let ze=He.createNS("http://www.w3.org/2000/svg","circle");ze.setAttributeNS(null,"fill","#FFFFFF"),ze.setAttributeNS(null,"cx","5.5"),ze.setAttributeNS(null,"cy","5.5"),ze.setAttributeNS(null,"r","5.4999962"),_e.appendChild(Ie),_e.appendChild(ze),P.appendChild(D),P.appendChild(U),P.appendChild(Y),P.appendChild(oe),P.appendChild(_e),a.appendChild(P),a.setAttributeNS(null,"height",p*this._scale+"px"),a.setAttributeNS(null,"width",f*this._scale+"px"),this._element.appendChild(a),this._offset=o.P.convert(t?.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",(a=>{a.preventDefault()})),this._element.addEventListener("mousedown",(a=>{a.preventDefault()})),Fu(this._element,this._anchor,"marker"),t?.className)for(let a of t.className.split(" "))this._element.classList.add(a);this._popup=null}addTo(t){return this.remove(),this._map=t,this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label",t._getUIString("Marker.Title")),this._element.hasAttribute("role")||this._element.setAttribute("role","button"),t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),t.on("projectiontransition",this._update),this._element.addEventListener("click",this._onClick),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),this._element.removeEventListener("click",this._onClick),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=o.W.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){let f=Math.abs(13.5)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[
8000,-38.1],"bottom-left":[f,-1*(38.1-13.5+f)],"bottom-right":[-f,-1*(38.1-13.5+f)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=t,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(t){return this._subpixelPositioning=t,this}getPopup(){return this._popup}togglePopup(){let t=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:t?(t.isOpen()?t.remove():(t.setLngLat(this._lngLat),t.addTo(this._map)),this):this}_updateOpacity(t=!1){var a,p;let f=(a=this._map)===null||a===void 0?void 0:a.terrain,b=this._map.transform.isLocationOccluded(this._lngLat);if(!f||b){let oe=b?this._opacityWhenCovered:this._opacity;return void(this._element.style.opacity!==oe&&(this._element.style.opacity=oe,this._element.classList.toggle("maplibregl-marker-covered",b)))}if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout((()=>{this._opacityTimeout=null}),100)}let P=this._map,D=P.terrain.depthAtPoint(this._pos),B=P.terrain.getElevationForLngLat(this._lngLat,P.transform);if(P.transform.lngLatToCameraDepth(this._lngLat,B)-D<.006)return this._element.style.opacity=this._opacity,void this._element.classList.remove("maplibregl-marker-covered");let U=-this._offset.y/P.transform.pixelsPerMeter,$=Math.sin(P.getPitch()*Math.PI/180)*U,Y=P.terrain.depthAtPoint(new o.P(this._pos.x,this._pos.y-this._offset.y)),ee=P.transform.lngLatToCameraDepth(this._lngLat,B+$)-Y>.006;!((p=this._popup)===null||p===void 0)&&p.isOpen()&&ee&&this._popup.remove(),this._element.style.opacity=ee?this._opacityWhenCovered:this._opacity,this._element.classList.toggle("maplibregl-marker-covered",ee)}getOffset(){return this._offset}setOffset(t){return this._offset=o.P.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&t!=="auto"?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,a){return(this._opacity===void 0||t===void 0&&a===void 0)&&(this._opacity="1",this._opacityWhenCovered="0.2"),t!==void 0&&(this._opacity=String(t)),a!==void 0&&(this._opacityWhenCovered=String(a)),this._map&&this._updateOpacity(!0),this}}let Bu={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},jl=0,fc=!1,Ou={maxWidth:100,unit:"metric"};function zh(_,t,a){let p=a?.maxWidth||100,f=_._container.clientHeight/2,b=_._container.clientWidth/2,P=_.unproject([b-p/2,f]),D=_.unproject([b+p/2,f]),B=Math.round(_.project(D).x-_.project(P).x),U=Math.min(p,B,_._container.clientWidth),$=P.distanceTo(D);if(a?.unit==="imperial"){let Y=3.2808*$;Y>5280?Hc(t,U,Y/5280,_._getUIString("ScaleControl.Miles")):Hc(t,U,Y,_._getUIString("ScaleControl.Feet"))}else a?.unit==="nautical"?Hc(t,U,$/1852,_._getUIString("ScaleControl.NauticalMiles")):$>=1e3?Hc(t,U,$/1e3,_._getUIString("ScaleControl.Kilometers")):Hc(t,U,$,_._getUIString("ScaleControl.Meters"))}function Hc(_,t,a,p){let f=(function(b){let P=Math.pow(10,`${Math.floor(b)}`.length-1),D=b/P;return D=D>=10?10:D>=5?5:D>=3?3:D>=2?2:D>=1?1:(function(B){let U=Math.pow(10,Math.ceil(-Math.log(B)/Math.LN10));return Math.round(B*U)/U})(D),P*D})(a);_.style.width=t*(f/a)+"px",_.innerHTML=`${f} ${p}`}let lu={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0,padding:void 0}
vendor: 8,967 bytes, line 800
800,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 Dh(_){if(_){if(typeof _=="number"){let t=Math.round(Math.abs(_)/Math.SQRT2);return{center:new o.P(0,0),top:new o.P(0,_),"top-left":new o.P(t,t),"top-right":new o.P(-t,t),bottom:new o.P(0,-_),"bottom-left":new o.P(t,-t),"bottom-right":new o.P(-t,-t),left:new o.P(_,0),right:new o.P(-_,0)}}if(_ instanceof o.P||Array.isArray(_)){let t=o.P.convert(_);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:o.P.convert(_.center||[0,0]),top:o.P.convert(_.top||[0,0]),"top-left":o.P.convert(_["top-left"]||[0,0]),"top-right":o.P.convert(_["top-right"]||[0,0]),bottom:o.P.convert(_.bottom||[0,0]),"bottom-left":o.P.convert(_["bottom-left"]||[0,0]),"bottom-right":o.P.convert(_["bottom-right"]||[0,0]),left:o.P.convert(_.left||[0,0]),right:o.P.convert(_.right||[0,0])}}return Dh(new o.P(0,0))}let Xc=pe;V.AJAXError=o.cG,V.EXTENT=o.a6,V.Event=o.n,V.Evented=o.E,V.LngLat=o.W,V.MercatorCoordinate=o.a7,V.Point=o.P,V.addProtocol=o.cH,V.config=o.c,V.removeProtocol=o.cI,V.AttributionControl=ka,V.BoxZoomHandler=Kn,V.CanvasSource=Na,V.CooperativeGesturesHandler=Ii,V.DoubleClickZoomHandler=Cp,V.DragPanHandler=Ka,V.DragRotateHandler=Ph,V.EdgeInsets=hs,V.FullscreenControl=class extends o.E{constructor(_={}){var t;super(),this._onFullscreenChange=()=>{var a;let p=window.document.fullscreenElement||window.document.webkitFullscreenElement;for(;!((a=p?.shadowRoot)===null||a===void 0)&&a.fullscreenElement;)p=p.shadowRoot.fullscreenElement;p===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,this._pseudo=(t=_.pseudo)!==null&&t!==void 0&&t,_?.container&&(_.container instanceof HTMLElement?this._container=_.container:o.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(_){return this._map=_,this._container||(this._container=this._map.getContainer()),this._controlContainer=He.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let _=this._fullscreenButton=He.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);He.create("span","maplibregl-ctrl-icon",_).setAttribute("aria-hidden","true"),_.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let _=this._getTitle();this._fullscreenButton.setAttribute("aria-label",_),this._fullscreenButton.title=_}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new o.n("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new o.n("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){this._pseudo?this._togglePseudoFullScreen():window.document.exitFullscreen?window.document.exitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._pseudo?this._togglePseudoFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},V.GeoJSONSource=_a,V.GeolocateControl=class extends o.E{constructor(_){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new o.n("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(t),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new o.n("geolocate",t)),this._finish()}},this._updateCamera=t=>{let a=new o.W(t.coords.longitude,t.coords.latitude),p=t.coords.accuracy,f=this._map.getBearing(),b=o.e({bearing:f},this.options.fitBoundsOptions),P=Ti.fromLngLat(a,p);this._map.fitBounds(P,b,{geolocateSource:!0})},this._updateMarker=t=>{if(t){let a=new o.W(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(a).addTo(this._map),this._userLocationDotMarker.setLngLat(a).addTo(this._map),this._accuracy=t.coords.accuracy,this._updateCircleRadiusIfNeeded()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onUpdate=()=>{this._updateCircleRadiusIfNeeded()},this._onError=t=>{if(this._map){if(t.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(t.code===3&&fc)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new o.n("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._onMoveStart=t=>{if(!this._map)return;let a=t?.[0]instanceof ResizeObserverEntry;t.geolocateSource||this._watchState!=="ACTIVE_LOCK"||a||this._map.isZooming()||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new o.n("trackuserlocationend")),this.fire(new o.n("userlocationlostfocus")))},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",(t=>{t.preventDefault()})),this._geolocateButton=He.create("button","maplibregl-ctrl-geolocate",this._container),He.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=t=>{if(this._map){if(t===!1){o.w("Geolocation support is not available so the GeolocateControl will be disabled.");let a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}else{let a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","fal
800se"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=He.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Ah({element:this._dotElement}),this._circleElement=He.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ah({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onUpdate),this._map.on("move",this._onUpdate),this._map.on("rotate",this._onUpdate),this._map.on("pitch",this._onUpdate)),this._geolocateButton.addEventListener("click",(()=>this.trigger())),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",this._onMoveStart)}},this.options=o.e({},Bu,_)}onAdd(_){return this._map=_,this._container=He.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),(function(){return o._(this,arguments,void 0,(function*(t=!1){if(Os!==void 0&&!t)return Os;if(window.navigator.permissions===void 0)return Os=!!window.navigator.geolocation,Os;try{Os=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{Os=!!window.navigator.geolocation}return Os}))})().then((t=>this._finishSetupUI(t))),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("movestart",this._onMoveStart),this._map.off("zoom",this._onUpdate),this._map.off("move",this._onUpdate),this._map.off("rotate",this._onUpdate),this._map.off("pitch",this._onUpdate),this._map=void 0,jl=0,fc=!1}_isOutOfMapMaxBounds(_){let t=this._map.getMaxBounds(),a=_.coords;return t&&(a.longitude<t.getWest()||a.longitude>t.getEast()||a.latitude<t.getSouth()||a.latitude>t.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":case"BACKGROUND_ERROR":case"OFF":case void 0:break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadiusIfNeeded(){let _=this._userLocationDotMarker.getLngLat();if(!(this.options.showUserLocation&&this.options.showAccuracyCircle&&this._accuracy&&_))return;let t=this._map.project(_),a=this._map.unproject([t.x+100,t.y]),p=_.distanceTo(a)/100,f=2*this._accuracy/p;this._circleElement.style.width=`${f.toFixed(2)}px`,this._circleElement.style.height=`${f.toFixed(2)}px`}trigger(){if(!this._setup)return o.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new o.n("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":jl--,fc=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new o.n("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new o.n("trackuserlocationstart")),this.fire(new o.n("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let _;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),jl++,jl>1?(_={maximumAge:6e5,timeout:0},fc=!0):(_=this.options.positionOptions,fc=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,_)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","fal
800se"),this.options.showUserLocation&&this._updateMarker(null)}},V.GlobeControl=class{constructor(){this._toggleProjection=()=>{var _;let t=(_=this._map.getProjection())===null||_===void 0?void 0:_.type;this._map.setProjection(t!=="mercator"&&t?{type:"mercator"}:{type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var _;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),((_=this._map.getProjection())===null||_===void 0?void 0:_.type)==="globe"?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(_){return this._map=_,this._container=He.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=He.create("button","maplibregl-ctrl-globe",this._container),He.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._map.on("projectiontransition",this._updateGlobeIcon),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateGlobeIcon),this._map.off("projectiontransition",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},V.Hash=ai,V.ImageSource=oo,V.KeyboardHandler=hl,V.LngLatBounds=Ti,V.LogoControl=Pp,V.Map=ro,V.MapLibreMap=ro,V.MapMouseEvent=cn,V.MapTouchEvent=Co,V.MapWheelEvent=Ha,V.Marker=Ah,V.NavigationControl=class{constructor(_){this._updateZoomButtons=()=>{let t=this._map.getZoom(),a=t===this._map.getMaxZoom(),p=t===this._map.getMinZoom();this._zoomInButton.disabled=a,this._zoomOutButton.disabled=p,this._zoomInButton.setAttribute("aria-disabled",a.toString()),this._zoomOutButton.setAttribute("aria-disabled",p.toString())},this._rotateCompassArrow=()=>{this._compassIcon.style.transform=this.options.visualizePitch&&this.options.visualizeRoll?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateZ(${-this._map.transform.roll}deg) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizeRoll?`rotate(${-this._map.transform.bearing-this._map.transform.roll}deg)`:`rotate(${-this._map.transform.bearing}deg)`},this._setButtonTitle=(t,a)=>{let p=this._map._getUIString(`NavigationControl.${a}`);t.title=p,t.setAttribute("aria-label",p)},this.options=o.e({},co,_),this._container=He.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",(t=>this._map.zoomIn({},{originalEvent:t}))),He.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",(t=>this._map.zoomOut({},{originalEvent:t}))),He.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",(t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})})),this._compassIcon=He.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(_){return this._map=_,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new kh(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){this._container.remove(),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(_,t){let a=He.create("button",_,this._container);return a.type="button",a.addEventListener("click",t),a}},V.Popup=class extends o.E{constructor(_){super(),this._updateOpacity=()=>{this.options.locationOccludedOpacity!==void 0&&(this._container.style.opacity=this._map.transform.isLocationOccluded(this.getLngLat())?`${this.options.locationOccludedOpacity}`:"")},this.remove=()=>(this._content&&this._content.remove(),this._container&&(this._container.remove(),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousemove",this._update),this._map.off("mouseup",this._update),this._map.off("drag",this._update),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new o.n("close"))),this),this._update=t=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=He.create("div","maplibregl-popup",this._map.getContainer()),this._tip=He.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let D of this.options.className.split(" "))this._container.classList.add(D);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}let a;if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=su(this._lngLat,this._flatPos,this._map.transform,this._trackPointer),t&&"point"in t&&t.point&&(
800a=t.point),this._trackPointer&&!a)return;let p=this._flatPos=this._pos=this._trackPointer&&a?a:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&a?a:this._map.transform.locationToScreenPoint(this._lngLat));let f=this.options.anchor,b=Dh(this.options.offset);if(!f){let D=this._container.offsetWidth,B=this._container.offsetHeight,U=(function(Y){var ee,oe,_e,Ie;return Y?{top:(ee=Y.top)!==null&&ee!==void 0?ee:0,right:(oe=Y.right)!==null&&oe!==void 0?oe:0,bottom:(_e=Y.bottom)!==null&&_e!==void 0?_e:0,left:(Ie=Y.left)!==null&&Ie!==void 0?Ie:0}:{top:0,right:0,bottom:0,left:0}})(this.options.padding),$;$=p.y+b.bottom.y<B+U.top?["top"]:p.y>this._map.transform.height-B-U.bottom?["bottom"]:[],p.x<D/2+U.left?$.push("left"):p.x>this._map.transform.width-D/2-U.right&&$.push("right"),f=$.length===0?"bottom":$.join("-")}let P=p.add(b[f]);this.options.subpixelPositioning||(P=P.round()),this._container.style.transform=`${Ul[f]} translate(${P.x}px,${P.y}px)`,Fu(this._container,f,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=o.e(Object.create(lu),_)}addTo(_){return this._map&&this.remove(),this._map=_,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._map.on("terrain",this._update),this._map.on("projectiontransition",this._update),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._update),this._map.on("mouseup",this._update),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new o.n("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(_){return this._lngLat=o.W.convert(_),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._update),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._update),this._map.on("drag",this._update),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(_){return this.setDOMContent(document.createTextNode(_))}setHTML(_){let t=document.createDocumentFragment(),a=document.createElement("body"),p;for(a.innerHTML=_;p=a.firstChild,p;)t.appendChild(p);return this.setDOMContent(t)}getMaxWidth(){var _;return(_=this._container)===null||_===void 0?void 0:_.style.maxWidth}setMaxWidth(_){return this.options.maxWidth=_,this._update(),this}setDOMContent(_){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=He.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(_),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(_){return this._container&&this._container.classList.add(_),this}removeClassName(_){return this._container&&this._container.classList.remove(_),this}setOffset(_){return this.options.offset=_,this._update(),this}toggleClassName(_){if(this._container)return this._container.classList.toggle(_)}setSubpixelPositioning(_){this.options.subpixelPositioning=_}setPadding(_){this.options.padding=_,this._update()}_createCloseButton(){this.options.closeButton&&(this._closeButton=He.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let _=this._container.querySelector(cu);_&&_.focus()}},V.RasterDEMTileSource=on,V.RasterTileSource=Hn,V.ScaleControl=class{constructor(_){this._onMove=()=>{zh(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,zh(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Ou),_)}getDefaultPosition(){return"bottom-left"}onAdd(_){return this._map=_,this._container=He.create("div","maplibregl-ctrl maplibregl-ctrl-scale",_.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._onMove),this._map=void 0}}
800,V.ScrollZoomHandler=Nl,V.Style=Ga,V.TerrainControl=class{constructor(_){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=_}onAdd(_){return this._map=_,this._container=He.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=He.create("button","maplibregl-ctrl-terrain",this._container),He.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){this._container.remove(),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},V.TwoFingersTouchPitchHandler=Xa,V.TwoFingersTouchRotateHandler=cd,V.TwoFingersTouchZoomHandler=Zc,V.TwoFingersTouchZoomRotateHandler=mi,V.VectorTileSource=Gr,V.VideoSource=ya,V.addSourceType=(_,t)=>o._(void 0,void 0,void 0,(function*(){if(Kt(_))throw new Error(`A source type called "${_}" already exists.`);((a,p)=>{St[a]=p})(_,t)})),V.clearPrewarmedResources=function(){let _=qr;_&&(_.isPreloaded()&&_.numActive()===1?(_.release(er),qr=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()"))},V.createTileMesh=rc,V.getGlobalDispatcher=$r,V.getMaxParallelImageRequests=function(){return o.c.MAX_PARALLEL_IMAGE_REQUESTS},V.getRTLTextPluginStatus=function(){return Bn().getRTLTextPluginStatus()},V.getVersion=function(){return Xc},V.getWorkerCount=function(){return lr.workerCount},V.getWorkerUrl=function(){return o.c.WORKER_URL},V.importScriptInWorkers=function(_){return $r().broadcast("IS",_)},V.isTimeFrozen=function(){return Ct.isFrozen()},V.now=Mt,V.prewarm=function(){yn().acquire(er)},V.restoreNow=function(){Ct.restoreNow()},V.setMaxParallelImageRequests=function(_){o.c.MAX_PARALLEL_IMAGE_REQUESTS=_},V.setNow=function(_){Ct.setNow(_)},V.setRTLTextPlugin=function(_,t){return Bn().setRTLTextPlugin(_,t)},V.setWorkerCount=function(_){lr.workerCount=_},V.setWorkerUrl=function(_){o.c.WORKER_URL=_}}));var H=O;return H}))});var P5=Ry((_x,yx)=>{(function(O,E){typeof _x=="object"&&typeof yx<"u"?yx.exports=E():typeof define=="function"&&define.amd?define(E):(O=typeof globalThis<"u"?globalThis:O||self,O.maplibregl=E())})(_x,(function(){"use strict";var O,E,F;function H(o,pe){if(!O)O=pe;else if(!E)E=pe;else{var Ne="var sharedChunk = {}; ("+O+")(sharedChunk); ("+E+")(sharedChunk);",Qe={};O(Qe),F=pe(Qe),typeof window<"u"&&(F.workerUrl=window.URL.createObjectURL(new Blob([Ne],{type:"text/javascript"})))}}H(["exports"],(function(o){"use strict";var pe=Ne;function Ne(c,n,u,y){this.cx=3*c,this.bx=3*(u-c)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*n,this.by=3*(y-n)-this.cy,this.ay=1-this.cy-this.by,this.p1x=c,this.p1y=n,this.p2x=u,this.p2y=y}function Qe(c,n,u,y){let I=new pe(c,n,u,y);return function(k){return I.solve(k)}}Ne.prototype={sampleCurveX:function(c){return((this.ax*c+this.bx)*c+this.cx)*c},sampleCurveY:function(c){return((this.ay*c+this.by)*c+this.cy)*c},sampleCurveDerivativeX:function(c){return(3*this.ax*c+2*this.bx)*c+this.cx}
800,solveCurveX:function(c,n){if(n===void 0&&(n=1e-6),c<0)return 0;if(c>1)return 1;for(var u=c,y=0;y<8;y++){var I=this.sampleCurveX(u)-c;if(Math.abs(I)<n)return u;var k=this.sampleCurveDerivativeX(u);if(Math.abs(k)<1e-6)break;u-=I/k}var R=0,q=1;for(u=c,y=0;y<20&&(I=this.sampleCurveX(u),!(Math.abs(I-c)<n));y++)c>I?R=u:q=u,u=.5*(q-R)+R;return u},solve:function(c,n){return this.sampleCurveY(this.solveCurveX(c,n))}};let ct=Qe(.25,.1,.25,1);function Ze(c,n,u){return Math.min(u,Math.max(n,c))}function Bt(c,n,u){let y=u-n,I=((c-n)%y+y)%y+n;return I===n?u:I}function Ct(c,...n){for(let u of n)for(let y in u)c[y]=u[y];return c}let Mt=1;function fi(c,n){c.forEach((u=>{n[u]&&(n[u]=n[u].bind(n))}))}function At(c,n,u){let y={};for(let I in c)y[I]=n.call(u||this,c[I],I,c);return y}function He(c,n,u){let y={};for(let I in c)n.call(u||this,c[I],I,c)&&(y[I]=c[I]);return y}function Ut(c){return Array.isArray(c)?c.map(Ut):typeof c=="object"&&c?At(c,Ut):c}let Mi={};function li(c){Mi[c]||(typeof console<"u"&&console.warn(c),Mi[c]=!0)}function ki(c,n,u){return(u.y-c.y)*(n.x-c.x)>(n.y-c.y)*(u.x-c.x)}function wi(c){let n=0;for(let u,y,I=0,k=c.length,R=k-1;I<k;R=I++)u=c[I],y=c[R],n+=(y.x-u.x)*(u.y+y.y);return n}function ci(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function Pe(c){let n={};if(c.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((u,y,I,k)=>{let R=I||k;return n[y]=!R||R.toLowerCase(),""})),n["max-age"]){let u=parseInt(n["max-age"],10);isNaN(u)?delete n["max-age"]:n["max-age"]=u}return n}let Ve,Ye,It=null;function jt(c){if(It==null){let n=c.navigator?c.navigator.userAgent:null;It=!!c.safari||!(!n||!(/\b(iPad|iPhone|iPod)\b/.test(n)||n.match("Safari")&&!n.match("Chrome")))}return It}function Si(c){return typeof ImageBitmap<"u"&&c instanceof ImageBitmap}let hi={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(c){let n=requestAnimationFrame(c);return{cancel:()=>cancelAnimationFrame(n)}},getImageData(c,n=0){let u=window.document.createElement("canvas"),y=u.getContext("2d");if(!y)throw new Error("failed to create canvas 2d context");return u.width=c.width,u.height=c.height,y.drawImage(c,0,0,c.width,c.height),y.getImageData(-n,-n,c.width+2*n,c.height+2*n)},resolveURL:c=>(Ve||(Ve=document.createElement("a")),Ve.href=c,Ve.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(Ye==null&&(Ye=matchMedia("(prefers-reduced-motion: reduce)")),Ye.matches)}};var Nt=vi;function vi(c,n){this.x=c,this.y=n}vi.prototype={clone:function(){return new vi(this.x,this.y)},add:function(c){return this.clone()._add(c)},sub:function(c){return this.clone()._sub(c)},multByPoint:function(c){return this.clone()._multByPoint(c)},divByPoint:function(c){return this.clone()._divByPoint(c)},mult:function(c){return this.clone()._mult(c)},div:function(c){return this.clone()._div(c)},rotate:function(c){return this.clone()._rotate(c)},rotateAround:function(c,n){return this.clone()._rotateAround(c,n)},matMult:function(c){return this.clone()._matMult(c)},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(c){return this.x===c.x&&this.y===c.y},dist:function(c){return Math.sqrt(this.distSqr(c))},distSqr:function(c){var n=c.x-this.x,u=c.y-this.y;return n*n+u*u},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(c){return Math.atan2(this.y-c.y,this.x-c.x)},angleWith:function(c){return this.angleWithSep(c.x,c.y)},angleWithSep:function(c,n){return Math.atan2(this.x*n-this.y*c,this.x*c+this.y*n)},_matMult:function(c){var n=c[2]*this.x+c[3]*this.y;return this.x=c[0]*this.x+c[1]*this.y,this.y=n,this},_add:function(c){return this.x+=c.x,this.y+=c.y,this},_sub:function(c){return this.x-=c.x,this.y-=c.y,this},_mult:function(c){return this.x*=c,this.y*=c,this},_div:function(c){return this.x/=c,this.y/=c,this},_multByPoint:function(c){return this.x*=c.x,this.y*=c.y,this},_divByPoint:function(c){return this.x/=c.x,this.y/=c.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var c=this.y;return this.y=this.x,this.x=-c,this},_rotate:function(c){var n=Math.cos(c),u=Math.sin(c),y=u*this.x+n*this.y;return this.x=n*this.x-u*this.y,this.y=y,this}
800,_rotateAround:function(c,n){var u=Math.cos(c),y=Math.sin(c),I=n.y+y*(this.x-n.x)+u*(this.y-n.y);return this.x=n.x+u*(this.x-n.x)-y*(this.y-n.y),this.y=I,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},vi.convert=function(c){return c instanceof vi?c:Array.isArray(c)?new vi(c[0],c[1]):c};let Li={MAX_PARALLEL_IMAGE_REQUESTS:16,REGISTERED_PROTOCOLS:{}},pi="mapbox-tiles",er,lr,_n=500,qr=50;function Cn(){typeof caches>"u"||er||(er=caches.open(pi))}let yn=1/0,zo={supported:!1,testSupport:function(c){!Dr&&yo&&(fa?Do(c):$r=c)}},$r,yo,Dr=!1,fa=!1;function Do(c){let n=c.createTexture();c.bindTexture(c.TEXTURE_2D,n);try{if(c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,yo),c.isContextLost())return;zo.supported=!0}catch{}c.deleteTexture(n),Dr=!0}typeof document<"u"&&(yo=document.createElement("img"),yo.onload=function(){$r&&Do($r),$r=null,fa=!0},yo.onerror=function(){Dr=!0,$r=null},yo.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");let Qn={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(Qn);class Ti extends Error{constructor(n,u,y,I){super(`AJAXError: ${u} (${n}): ${y}`),this.status=n,this.statusText=u,this.url=y,this.body=I}}let nn=ci()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href;function Gr(c,n){let u=new AbortController,y=new Request(c.url,{method:c.method||"GET",body:c.body,credentials:c.credentials,headers:c.headers,referrer:nn(),signal:u.signal}),I=!1,k=!1;return c.type==="json"&&y.headers.set("Accept","application/json"),((R,q,G)=>{if(k)return;let J=Date.now();fetch(y).then((ae=>ae.ok?((ce,de,ge)=>{(c.type==="arrayBuffer"?ce.arrayBuffer():c.type==="json"?ce.json():ce.text()).then((ye=>{k||(de&&ge&&(function(Ue,Oe,nt){if(Cn(),!er)return;let ut={status:Oe.status,statusText:Oe.statusText,headers:new Headers};Oe.headers.forEach(((st,Pt)=>ut.headers.set(Pt,st)));let tt=Pe(Oe.headers.get("Cache-Control")||"");tt["no-store"]||(tt["max-age"]&&ut.headers.set("Expires",new Date(nt+1e3*tt["max-age"]).toUTCString()),new Date(ut.headers.get("Expires")).getTime()-nt<42e4||(function(st,Pt){if(lr===void 0)try{new Response(new ReadableStream),lr=!0}catch{lr=!1}lr?Pt(st.body):st.blob().then(Pt)})(Oe,(st=>{let Pt=new Response(st,ut);Cn(),er&&er.then((kt=>kt.put((function(di){let bi=di.indexOf("?");return bi<0?di:di.slice(0,bi)})(Ue.url),Pt))).catch((kt=>li(kt.message)))})))})(y,de,ge),I=!0,n(null,ye,ce.headers.get("Cache-Control"),ce.headers.get("Expires")))})).catch((ye=>{k||n(new Error(ye.message))}))})(ae,null,J):ae.blob().then((ce=>n(new Ti(ae.status,ae.statusText,c.url,ce)))))).catch((ae=>{ae.code!==20&&n(new Error(ae.message))}))})(),{cancel:()=>{k=!0,I||u.abort()}}}
800let Hn=function(c,n){if(/:\/\//.test(c.url)&&!/^https?:|^file:/.test(c.url)){if(ci()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",c,n);if(!ci()){let y=c.url.substring(0,c.url.indexOf("://"));return(Li.REGISTERED_PROTOCOLS[y]||Gr)(c,n)}}if(!(/^file:/.test(u=c.url)||/^file:/.test(nn())&&!/^\w+:/.test(u))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return Gr(c,n);if(ci()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",c,n,void 0,!0)}var u;return(function(y,I){let k=new XMLHttpRequest;k.open(y.method||"GET",y.url,!0),y.type==="arrayBuffer"&&(k.responseType="arraybuffer");for(let R in y.headers)k.setRequestHeader(R,y.headers[R]);return y.type==="json"&&(k.responseType="text",k.setRequestHeader("Accept","application/json")),k.withCredentials=y.credentials==="include",k.onerror=()=>{I(new Error(k.statusText))},k.onload=()=>{if((k.status>=200&&k.status<300||k.status===0)&&k.response!==null){let R=k.response;if(y.type==="json")try{R=JSON.parse(k.response)}catch(q){return I(q)}I(null,R,k.getResponseHeader("Cache-Control"),k.getResponseHeader("Expires"))}else{let R=new Blob([k.response],{type:k.getResponseHeader("Content-Type")});I(new Ti(k.status,k.statusText,y.url,R))}},k.send(y.body),{cancel:()=>k.abort()}})(c,n)},on=function(c,n){return Hn(Ct(c,{type:"arrayBuffer"}),n)};function Xn(c){let n=window.document.createElement("a");return n.href=c,n.protocol===window.document.location.protocol&&n.host===window.document.location.host}let Qi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=",ga,as;ga=[],as=0;
800let xo=function(c,n){if(zo.supported&&(c.headers||(c.headers={}),c.headers.accept="image/webp,*/*"),as>=Li.MAX_PARALLEL_IMAGE_REQUESTS){let k={requestParameters:c,callback:n,cancelled:!1,cancel(){this.cancelled=!0}};return ga.push(k),k}as++;let u=!1,y=()=>{if(!u)for(u=!0,as--;ga.length&&as<Li.MAX_PARALLEL_IMAGE_REQUESTS;){let k=ga.shift(),{requestParameters:R,callback:q,cancelled:G}=k;G||(k.cancel=xo(R,q).cancel)}},I=on(c,((k,R,q,G)=>{y(),k?n(k):R&&(function(J,ae){typeof createImageBitmap=="function"?(function(ce,de){let ge=new Blob([new Uint8Array(ce)],{type:"image/png"});createImageBitmap(ge).then((ye=>{de(null,ye)})).catch((ye=>{de(new Error(`Could not load image because of ${ye.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))}))})(J,ae):(function(ce,de){let ge=new Image;ge.onload=()=>{de(null,ge),URL.revokeObjectURL(ge.src),ge.onload=null,window.requestAnimationFrame((()=>{ge.src=Qi}))},ge.onerror=()=>de(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."));let ye=new Blob([new Uint8Array(ce)],{type:"image/png"});ge.src=ce.byteLength?URL.createObjectURL(ye):Qi})(J,ae)})(R,((J,ae)=>{J!=null?n(J):ae!=null&&n(null,ae,{cacheControl:q,expires:G})}))}));return{cancel:()=>{I.cancel(),y()}}};function ss(c,n,u){u[c]&&u[c].indexOf(n)!==-1||(u[c]=u[c]||[],u[c].push(n))}function _a(c,n,u){if(u&&u[c]){let y=u[c].indexOf(n);y!==-1&&u[c].splice(y,1)}}class oo{constructor(n,u={}){Ct(this,u),this.type=n}}class ya extends oo{constructor(n,u={}){super("error",Ct({error:n},u))}}class Na{on(n,u){return this._listeners=this._listeners||{},ss(n,u,this._listeners),this}off(n,u){return _a(n,u,this._listeners),_a(n,u,this._oneTimeListeners),this}once(n,u){return this._oneTimeListeners=this._oneTimeListeners||{},ss(n,u,this._oneTimeListeners),this}fire(n,u){typeof n=="string"&&(n=new oo(n,u||{}));let y=n.type;if(this.listens(y)){n.target=this;let I=this._listeners&&this._listeners[y]?this._listeners[y].slice():[];for(let q of I)q.call(this,n);let k=this._oneTimeListeners&&this._oneTimeListeners[y]?this._oneTimeListeners[y].slice():[];for(let q of k)_a(y,q,this._oneTimeListeners),q.call(this,n);let R=this._eventedParent;R&&(Ct(n,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),R.fire(n))}else n instanceof ya&&console.error(n.error);return this}listens(n){return this._listeners&&this._listeners[n]&&this._listeners[n].length>0||this._oneTimeListeners&&this._oneTimeListeners[n]&&this._oneTimeListeners[n].length>0||this._eventedParent&&this._eventedParent.listens(n)}setEventedParent(n,u){return this._eventedParent=n,this._eventedParentData=u,this}}var St={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}}
vendor: 6,283 bytes, line 800
800,default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"}
vendor: 4,098 bytes, line 800
800,"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}
vendor: 3,515 bytes, line 800
800,"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1},elevationOffset:{type:"number",default:450
vendor: 14,080 bytes, line 800
800}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};c
800lass Kt{constructor(n,u,y,I){this.message=(n?`${n}: `:"")+y,I&&(this.identifier=I),u!=null&&u.__line__&&(this.line=u.__line__)}}function Ua(c){let n=c.value;return n?[new Kt(c.key,n,"constants have been deprecated as of v8")]:[]}function xa(c,...n){for(let u of n)for(let y in u)c[y]=u[y];return c}function or(c){return c instanceof Number||c instanceof String||c instanceof Boolean?c.valueOf():c}function Bn(c){if(Array.isArray(c))return c.map(Bn);if(c instanceof Object&&!(c instanceof Number||c instanceof String||c instanceof Boolean)){let n={};for(let u in c)n[u]=Bn(c[u]);return n}return or(c)}class xn extends Error{constructor(n,u){super(u),this.message=u,this.key=n}}class Zr{constructor(n,u=[]){this.parent=n,this.bindings={};for(let[y,I]of u)this.bindings[y]=I}concat(n){return new Zr(this,n)}get(n){if(this.bindings[n])return this.bindings[n];if(this.parent)return this.parent.get(n);throw new Error(`${n} not found in scope.`)}has(n){return!!this.bindings[n]||!!this.parent&&this.parent.has(n)}}let ta={kind:"null"},Ht={kind:"number"},Wi={kind:"string"},Bi={kind:"boolean"},an={kind:"color"},Lo={kind:"object"},ji={kind:"value"},Ro={kind:"collator"},vn={kind:"formatted"},xt={kind:"padding"},sn={kind:"resolvedImage"};function eo(c,n){return{kind:"array",itemType:c,N:n}}function Ai(c){if(c.kind==="array"){let n=Ai(c.itemType);return typeof c.N=="number"?`array<${n}, ${c.N}>`:c.itemType.kind==="value"?"array":`array<${n}>`}return c.kind}let On=[ta,Ht,Wi,Bi,an,vn,Lo,eo(ji),xt,sn];
vendor: 5,659 bytes, line 800
800function ao(c,n){if(n.kind==="error")return null;if(c.kind==="array"){if(n.kind==="array"&&(n.N===0&&n.itemType.kind==="value"||!ao(c.itemType,n.itemType))&&(typeof c.N!="number"||c.N===n.N))return null}else{if(c.kind===n.kind)return null;if(c.kind==="value"){for(let u of On)if(!ao(u,n))return null}}return`Expected ${Ai(c)} but found ${Ai(n)} instead.`}function Xs(c,n){return n.some((u=>u.kind===c.kind))}function Ks(c,n){return n.some((u=>u==="null"?c===null:u==="array"?Array.isArray(c):u==="object"?c&&!Array.isArray(c)&&typeof c=="object":u===typeof c))}var Ql,ls={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 Se(c){return(c=Math.round(c))<0?0:c>255?255:c}function re(c){return Se(c[c.length-1]==="%"?parseFloat(c)/100*255:parseInt(c))}function te(c){return(n=c[c.length-1]==="%"?parseFloat(c)/100:parseFloat(c))<0?0:n>1?1:n;var n}function xe(c,n,u){return u<0?u+=1:u>1&&(u-=1),6*u<1?c+(n-c)*u*6:2*u<1?n:3*u<2?c+(n-c)*(2/3-u)*6:c}try{Ql={}.parseCSSColor=function(c){var n,u=c.replace(/ /g,"").toLowerCase();if(u in ls)return ls[u].slice();if(u[0]==="#")return u.length===4?(n=parseInt(u.substr(1),16))>=0&&n<=4095?[(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1]:null:u.length===7&&(n=parseInt(u.substr(1),16))>=0&&n<=16777215?[(16711680&n)>>16,(65280&n)>>8,255&n,1]:null;var y=u.indexOf("("),I=u.indexOf(")");if(y!==-1&&I+1===u.length){var k=u.substr(0,y),R=u.substr(y+1,I-(y+1)).split(","),q=1;switch(k){case"rgba":if(R.length!==4)return null;q=te(R.pop());case"rgb":return R.length!==3?null:[re(R[0]),re(R[1]),re(R[2]),q];case"hsla":if(R.length!==4)return null;q=te(R.pop());case"hsl":if(R.length!==3)return null;var G=(parseFloat(R[0])%360+360)%360/360,J=te(R[1]),ae=te(R[2]),ce=ae<=.5?ae*(J+1):ae+J-ae*J,de=2*ae-ce;return[Se(255*xe(de,ce,G+1/3)),Se(255*xe(de,ce,G)),Se(255*xe(de,ce,G-1/3)),q];default:return null}}return null}}catch{}class ve{constructor(n,u,y,I=1){this.r=n,this.g=u,this.b=y,this.a=I}static parse(n){if(!n)return;if(n instanceof ve)return n;
800if(typeof n!="string")return;let u=Ql(n);return u?new ve(u[0]/255*u[3],u[1]/255*u[3],u[2]/255*u[3],u[3]):void 0}toString(){let[n,u,y,I]=this.toArray();return`rgba(${Math.round(n)},${Math.round(u)},${Math.round(y)},${I})`}toArray(){let{r:n,g:u,b:y,a:I}=this;return I===0?[0,0,0,0]:[255*n/I,255*u/I,255*y/I,I]}}ve.black=new ve(0,0,0,1),ve.white=new ve(1,1,1,1),ve.transparent=new ve(0,0,0,0),ve.red=new ve(1,0,0,1);class $e{constructor(n,u,y){this.sensitivity=n?u?"variant":"case":u?"accent":"base",this.locale=y,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(n,u){return this.collator.compare(n,u)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Ke{constructor(n,u,y,I,k){this.text=n,this.image=u,this.scale=y,this.fontStack=I,this.textColor=k}}class Te{constructor(n){this.sections=n}static fromString(n){return new Te([new Ke(n,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some((n=>n.text.length!==0||n.image&&n.image.name.length!==0))}static factory(n){return n instanceof Te?n:Te.fromString(n)}toString(){return this.sections.length===0?"":this.sections.map((n=>n.text)).join("")}}class ke{constructor(n){this.values=n.slice()}static parse(n){if(n instanceof ke)return n;if(typeof n=="number")return new ke([n,n,n,n]);if(Array.isArray(n)&&!(n.length<1||n.length>4)){for(let u of n)if(typeof u!="number")return;switch(n.length){case 1:n=[n[0],n[0],n[0],n[0]];break;case 2:n=[n[0],n[1],n[0],n[1]];break;case 3:n=[n[0],n[1],n[2],n[1]]}return new ke(n)}}toString(){return JSON.stringify(this.values)}}class Ge{constructor(n){this.name=n.name,this.available=n.available}toString(){return this.name}static fromString(n){return n?new Ge({name:n,available:!1}):null}}function pt(c,n,u,y){return typeof c=="number"&&c>=0&&c<=255&&typeof n=="number"&&n>=0&&n<=255&&typeof u=="number"&&u>=0&&u<=255?y===void 0||typeof y=="number"&&y>=0&&y<=1?null:`Invalid rgba value [${[c,n,u,y].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof y=="number"?[c,n,u,y]:[c,n,u]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function zt(c){if(c===null||typeof c=="string"||typeof c=="boolean"||typeof c=="number"||c instanceof ve||c instanceof $e||c instanceof Te||c instanceof ke||c instanceof Ge)return!0;if(Array.isArray(c)){for(let n of c)if(!zt(n))return!1;return!0}if(typeof c=="object"){for(let n in c)if(!zt(c[n]))return!1;return!0}return!1}function dt(c){if(c===null)return ta;if(typeof c=="string")return Wi;if(typeof c=="boolean")return Bi;if(typeof c=="number")return Ht;if(c instanceof ve)return an;if(c instanceof $e)return Ro;if(c instanceof Te)return vn;if(c instanceof ke)return xt;if(c instanceof Ge)return sn;if(Array.isArray(c)){let n=c.length,u;for(let y of c){let I=dt(y);if(u){if(u===I)continue;u=ji;break}u=I}return eo(u||ji,n)}return Lo}function Lt(c){let n=typeof c;return c===null?"":n==="string"||n==="number"||n==="boolean"?String(c):c instanceof ve||c instanceof Te||c instanceof ke||c instanceof Ge?c.toString():JSON.stringify(c)}class gi{constructor(n,u){this.type=n,this.value=u}static parse(n,u){if(n.length!==2)return u.error(`'literal' expression requires exactly one argument, but found ${n.length-1} instead.`);if(!zt(n[1]))return u.error("invalid value");let y=n[1],I=dt(y),k=u.expectedType;return I.kind!=="array"||I.N!==0||!k||k.kind!=="array"||typeof k.N=="number"&&k.N!==0||(I=k),new gi(I,y)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class ei{constructor(n){this.name="ExpressionEvaluationError",this.message=n}toJSON(){return this.message}}let zi={string:Wi,number:Ht,boolean:Bi,object:Lo};class Ri{constructor(n,u){this.type=n,this.args=u}static parse(n,u){if(n.length<2)return u.error("Expected at least one argument.");let y,I=1,k=n[0];if(k==="array"){let q,G;if(n.length>2){let J=n[1];if(typeof J!="string"||!(J in zi)||J==="object")return u.error('The item type argument of "array" must be one of string, number, boolean',1);q=zi[J],I++}else q=ji;if(n.length>3){if(n[2]!==null&&(typeof n[2]!="number"||n[2]<0||n[2]!==Math.floor(n[2])))return u.error('The length argument to "array" must be a positive integer literal',2);G=n[2],I++}y=eo(q,G)}else{if(!zi[k])throw new Error(`Types doesn't contain name = ${k}`);y=zi[k]}let R=[];for(;I<n.length;I++){let q=u.parse(n[I],I,ji);if(!q)return null;R.push(q)}return new Ri(y,R)}evaluate(n){for(let u=0;u<this.args.length;u++){let y=this.args[u].evaluate(n);if(!ao(this.type,dt(y)))return y;if(u===this.args.length-1)throw new ei(`Expected value to be of type ${Ai(this.type)}, but found ${Ai(dt(y))} instead.`)}throw new Error}
800eachChild(n){this.args.forEach(n)}outputDefined(){return this.args.every((n=>n.outputDefined()))}}let rr={"to-boolean":Bi,"to-color":an,"to-number":Ht,"to-string":Wi};class Vi{constructor(n,u){this.type=n,this.args=u}static parse(n,u){if(n.length<2)return u.error("Expected at least one argument.");let y=n[0];if(!rr[y])throw new Error(`Can't parse ${y} as it is not part of the known types`);if((y==="to-boolean"||y==="to-string")&&n.length!==2)return u.error("Expected one argument.");let I=rr[y],k=[];for(let R=1;R<n.length;R++){let q=u.parse(n[R],R,ji);if(!q)return null;k.push(q)}return new Vi(I,k)}evaluate(n){if(this.type.kind==="boolean")return!!this.args[0].evaluate(n);if(this.type.kind==="color"){let u,y;for(let I of this.args){if(u=I.evaluate(n),y=null,u instanceof ve)return u;if(typeof u=="string"){let k=n.parseColor(u);if(k)return k}else if(Array.isArray(u)&&(y=u.length<3||u.length>4?`Invalid rbga value ${JSON.stringify(u)}: expected an array containing either three or four numeric values.`:pt(u[0],u[1],u[2],u[3]),!y))return new ve(u[0]/255,u[1]/255,u[2]/255,u[3])}throw new ei(y||`Could not parse color from value '${typeof u=="string"?u:JSON.stringify(u)}'`)}if(this.type.kind==="padding"){let u;for(let y of this.args){u=y.evaluate(n);let I=ke.parse(u);if(I)return I}throw new ei(`Could not parse padding from value '${typeof u=="string"?u:JSON.stringify(u)}'`)}if(this.type.kind==="number"){let u=null;for(let y of this.args){if(u=y.evaluate(n),u===null)return 0;let I=Number(u);if(!isNaN(I))return I}throw new ei(`Could not convert ${JSON.stringify(u)} to number.`)}return this.type.kind==="formatted"?Te.fromString(Lt(this.args[0].evaluate(n))):this.type.kind==="resolvedImage"?Ge.fromString(Lt(this.args[0].evaluate(n))):Lt(this.args[0].evaluate(n))}eachChild(n){this.args.forEach(n)}outputDefined(){return this.args.every((n=>n.outputDefined()))}}let Hi=["Unknown","Point","LineString","Polygon"];class qi{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Hi[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(n){let u=this._parseColorCache[n];return u||(u=this._parseColorCache[n]=ve.parse(n)),u}}class Fi{constructor(n,u,y,I){this.name=n,this.type=u,this._evaluate=y,this.args=I}evaluate(n){return this._evaluate(n,this.args)}eachChild(n){this.args.forEach(n)}outputDefined(){return!1}static parse(n,u){let y=n[0],I=Fi.definitions[y];if(!I)return u.error(`Unknown expression "${y}". If you wanted a literal array, use ["literal", [...]].`,0);let k=Array.isArray(I)?I[0]:I.type,R=Array.isArray(I)?[[I[1],I[2]]]:I.overloads,q=R.filter((([J])=>!Array.isArray(J)||J.length===n.length-1)),G=null;for(let[J,ae]of q){G=new Cs(u.registry,u.path,null,u.scope);let ce=[],de=!1;for(let ge=1;ge<n.length;ge++){let ye=n[ge],Ue=Array.isArray(J)?J[ge-1]:J.type,Oe=G.parse(ye,1+ce.length,Ue);if(!Oe){de=!0;break}ce.push(Oe)}if(!de)if(Array.isArray(J)&&J.length!==ce.length)G.error(`Expected ${J.length} arguments, but found ${ce.length} instead.`);else{for(let ge=0;ge<ce.length;ge++){let ye=Array.isArray(J)?J[ge]:J.type,Ue=ce[ge];G.concat(ge+1).checkSubtype(ye,Ue.type)}if(G.errors.length===0)return new Fi(y,k,ae,ce)}}if(q.length===1)u.errors.push(...G.errors);else{let J=(q.length?q:R).map((([ce])=>{return de=ce,Array.isArray(de)?`(${de.map(Ai).join(", ")})`:`(${Ai(de.type)}...)`;var de})).join(" | "),ae=[];for(let ce=1;ce<n.length;ce++){let de=u.parse(n[ce],1+ae.length);if(!de)return null;ae.push(Ai(de.type))}u.error(`Expected arguments of type ${J}, but found (${ae.join(", ")}) instead.`)}return null}static register(n,u){Fi.definitions=u;for(let y in u)n[y]=Fi}}class bn{constructor(n,u,y){this.type=Ro,this.locale=y,this.caseSensitive=n,this.diacriticSensitive=u}static parse(n,u){if(n.length!==2)return u.error("Expected one argument.");let y=n[1];if(typeof y!="object"||Array.isArray(y))return u.error("Collator options argument must be an object.");let I=u.parse(y["case-sensitive"]!==void 0&&y["case-sensitive"],1,Bi);if(!I)return null;let k=u.parse(y["diacritic-sensitive"]!==void 0&&y["diacritic-sensitive"],1,Bi);if(!k)return null;let R=null;return y.locale&&(R=u.parse(y.locale,1,Wi),!R)?null:new bn(I,k,R)}evaluate(n){return new $e(this.caseSensitive.evaluate(n),this.diacriticSensitive.evaluate(n),this.locale?this.locale.evaluate(n):null)}eachChild(n){n(this.caseSensitive),n(this.diacriticSensitive),this.locale&&n(this.locale)}outputDefined(){return!1}}let Sr=8192;function En(c,n){c[0]=Math.min(c[0],n[0]),c[1]=Math.min(c[1],n[1]),c[2]=Math.max(c[2],n[0]),c[3]=Math.max(c[3],n[1])}function va(c,n){return!(c[0]<=n[0]||c[2]>=n[2]||c[1]<=n[1]||c[3]>=n[3])}function vo(c,n){let u=(180+c[0])/360,y=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+c[1]*Math.PI/360)))/360,I=Math.pow(2,n.z);return[Math.round(u*I*Sr),Math.round(y*I*Sr)]}function Ir(c,n,u){let y=c[0]-n[0],I=c[1]-n[1],k=c[0]-u[0],R=c[1]-u[1];return y*R-k*I==0&&y*k<=0&&I*R<=0}function Ss(c,n){let u=!1;for(let R=0,q=n.length;R<q;R++){let G=n[R];for(let J=0,ae=G.length;J<ae-1;J++){if(Ir(c,G[J],G[J+1]))return!1;(I=G[J])[1]>(y=c)[1]!=(k=G[J+1])[1]>y[1]&&y[0]<(k[0]-I[0])*(y[1]-I[1])/(k[1]-I[1])+I[0]&&(u=!u)}}var y,I,k;return u}function ec(c,n){for(let u=0;u<n.length;u++)if(Ss(c,n[u]))return!0;return!1}function Wr(c,n,u,y){let I=y[0]-u[0],k=y[1]-u[1],R=(c[0]-u[0])*k-I*(c[1]-u[1]),q=(n[0]-u[0])*k-I*(n[1]-u[1]);return R>0&&q<0||R<0&&q>0}function Kh(c,n,u){for(let J of u)for(let ae=0;ae<J.length-1;++ae)if((q=[(R=J[ae+1])[0]-(k=J[ae])[0],R[1]-k[1]])[0]*(G=[(I=n)[0]-(y=c)[0],I[1]-y[1]])[1]-q[1]*G[0]!=0&&Wr(y,I,k,R)&&Wr(k,R,y,I))return!0;var y,I,k,R,q,G;return!1}function sh(c,n){for(let u=0;u<c.length;++u)if(!Ss(c[u],n))return!1;for(let u=0;u<c.length-1;
vendor: 6,967 bytes, line 800
800++u)if(Kh(c[u],c[u+1],n))return!1;return!0}function Ec(c,n){for(let u=0;u<n.length;u++)if(sh(c,n[u]))return!0;return!1}function Mc(c,n,u){let y=[];for(let I=0;I<c.length;I++){let k=[];for(let R=0;R<c[I].length;R++){let q=vo(c[I][R],u);En(n,q),k.push(q)}y.push(k)}return y}function lh(c,n,u){let y=[];for(let I=0;I<c.length;I++){let k=Mc(c[I],n,u);y.push(k)}return y}function Yh(c,n,u,y){if(c[0]<u[0]||c[0]>u[2]){let I=.5*y,k=c[0]-u[0]>I?-y:u[0]-c[0]>I?y:0;k===0&&(k=c[0]-u[2]>I?-y:u[2]-c[0]>I?y:0),c[0]+=k}En(n,c)}function Pc(c,n,u,y){let I=Math.pow(2,y.z)*Sr,k=[y.x*Sr,y.y*Sr],R=[];for(let q of c)for(let G of q){let J=[G.x+k[0],G.y+k[1]];Yh(J,n,u,I),R.push(J)}return R}function ch(c,n,u,y){let I=Math.pow(2,y.z)*Sr,k=[y.x*Sr,y.y*Sr],R=[];for(let G of c){let J=[];for(let ae of G){let ce=[ae.x+k[0],ae.y+k[1]];En(n,ce),J.push(ce)}R.push(J)}if(n[2]-n[0]<=I/2){(q=n)[0]=q[1]=1/0,q[2]=q[3]=-1/0;for(let G of R)for(let J of G)Yh(J,n,u,I)}var q;return R}class Is{constructor(n,u){this.type=Bi,this.geojson=n,this.geometries=u}static parse(n,u){if(n.length!==2)return u.error(`'within' expression requires exactly one argument, but found ${n.length-1} instead.`);if(zt(n[1])){let y=n[1];if(y.type==="FeatureCollection")for(let I=0;I<y.features.length;++I){let k=y.features[I].geometry.type;if(k==="Polygon"||k==="MultiPolygon")return new Is(y,y.features[I].geometry)}else if(y.type==="Feature"){let I=y.geometry.type;if(I==="Polygon"||I==="MultiPolygon")return new Is(y,y.geometry)}else if(y.type==="Polygon"||y.type==="MultiPolygon")return new Is(y,y)}return u.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(n){if(n.geometry()!=null&&n.canonicalID()!=null){if(n.geometryType()==="Point")return(function(u,y){let I=[1/0,1/0,-1/0,-1/0],k=[1/0,1/0,-1/0,-1/0],R=u.canonicalID();if(y.type==="Polygon"){let q=Mc(y.coordinates,k,R),G=Pc(u.geometry(),I,k,R);if(!va(I,k))return!1;for(let J of G)if(!Ss(J,q))return!1}if(y.type==="MultiPolygon"){let q=lh(y.coordinates,k,R),G=Pc(u.geometry(),I,k,R);if(!va(I,k))return!1;for(let J of G)if(!ec(J,q))return!1}return!0})(n,this.geometries);if(n.geometryType()==="LineString")return(function(u,y){let I=[1/0,1/0,-1/0,-1/0],k=[1/0,1/0,-1/0,-1/0],R=u.canonicalID();if(y.type==="Polygon"){let q=Mc(y.coordinates,k,R),G=ch(u.geometry(),I,k,R);if(!va(I,k))return!1;for(let J of G)if(!sh(J,q))return!1}if(y.type==="MultiPolygon"){let q=lh(y.coordinates,k,R),G=ch(u.geometry(),I,k,R);if(!va(I,k))return!1;for(let J of G)if(!Ec(J,q))return!1}return!0})(n,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}function vl(c){if(c instanceof Fi&&(c.name==="get"&&c.args.length===1||c.name==="feature-state"||c.name==="has"&&c.args.length===1||c.name==="properties"||c.name==="geometry-type"||c.name==="id"||/^filter-/.test(c.name))||c instanceof Is)return!1;let n=!0;return c.eachChild((u=>{n&&!vl(u)&&(n=!1)})),n}function Ys(c){if(c instanceof Fi&&c.name==="feature-state")return!1;let n=!0;return c.eachChild((u=>{n&&!Ys(u)&&(n=!1)})),n}function hh(c,n){if(c instanceof Fi&&n.indexOf(c.name)>=0)return!1;let u=!0;return c.eachChild((y=>{u&&!hh(y,n)&&(u=!1)})),u}class Js{constructor(n,u){this.type=u.type,this.name=n,this.boundExpression=u}static parse(n,u){if(n.length!==2||typeof n[1]!="string")return u.error("'var' expression requires exactly one string literal argument.");let y=n[1];return u.scope.has(y)?new Js(y,u.scope.get(y)):u.error(`Unknown variable "${y}". Make sure "${y}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(n){return this.boundExpression.evaluate(n)}eachChild(){}outputDefined(){return!1}}class Cs{constructor(n,u=[],y,I=new Zr,k=[]){this.registry=n,this.path=u,this.key=u.map((R=>`[${R}]`)).join(""),this.scope=I,this.errors=k,this.expectedType=y}parse(n,u,y,I,k={}){return u?this.concat(u,y,I)._parse(n,k):this._parse(n,k)}_parse(n,u){function y(I,k,R){return R==="assert"?new Ri(k,[I]):R==="coerce"?new Vi(k,[I]):I}if(n!==null&&typeof n!="string"&&typeof n!="boolean"&&typeof n!="number"||(n=["literal",n]),Array.isArray(n)){if(n.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let I=n[0];if(typeof I!="string")return this.error(`Expression name must be a string, but found ${typeof I} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let k=this.registry[I];if(k){let R=k.parse(n,this);if(!R)return null;if(this.expectedType){let q=this.expectedType,G=R.type;if(q.kind!=="string"&&q.kind!=="number"&&q.kind!=="boolean"&&q.kind!=="object"&&q.kind!=="array"||G.kind!=="value")if(q.kind!=="color"&&q.kind!=="formatted"&&q.kind!=="resolvedImage"||G.kind!=="value"&&G.kind!=="string")if(q.kind!=="padding"||G.kind!=="value"&&G.kind!=="number"&&G.kind!=="array"){if(this.checkSubtype(q,G))return null}else R=y(R,q,u.typeAnnotation||"coerce");else R=y(R,q,u.typeAnnotation||"coerce");else R=y(R,q,u.typeAnnotation||"assert")}if(!(R instanceof gi)&&R.type.kind!=="resolvedImage"&&uh(R)){let q=new qi;try{R=new gi(R.type,R.evaluate(q))}catch(G){return this.error(G.message),null}}return R}return this.error(`Unknown expression "${I}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(n===void 0?"'undefined' value invalid. Use null instead.":typeof n=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof n} instead.`)}concat(n,u,y){let I=typeof n=="number"?this.path.concat(n):this.path,k=y?this.scope.concat(y):this.scope;return new Cs(this.registry,I,u||null,k,this.errors)}error(n,...u){let y=`${this.key}${u.map((I=>`[${I}]`)).join("")}`;this.errors.push(new xn(y,n))}checkSubtype(n,u){let y=ao(n,u);return y&&this.error(y),y}}function uh(c){if(c instanceof Js)return uh(c.boundExpression);if(c instanceof Fi&&c.name==="error"||c instanceof bn||c instanceof Is)return!1;let n=c instanceof Vi||c instanceof Ri,u=!0;return c.eachChild((y=>{u=n?u&&uh(y):u&&y instanceof gi})),!!u&&vl(c)&&hh(c,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Es(c,n){let u=c.length-1,y,I,k=0,R=u,q=0;for(;k<=R;)if(q=Math.floor((k+R)/2),y=c[q],I=c[q+1],y<=n){if(q===u||n<I)return q;k=q+1}else{if(!(y>n))throw new ei("Input is not a number.");R=q-1}return 0}class bl{constructor(n,u,y){this.type=n,this.input=u,this.labels=[],this.outputs=[];for(let[I,k]of y)this.labels.push(I),this.outputs.push(k)}static parse(n,u){if(n.length-1<4)return u.error(`Expected at least 4 arguments, but found only ${n.length-1}.`);if((n.length-1)%2!=0)return u.error("Expected an even number of arguments.");let y=u.parse(n[1],1,Ht);if(!y)return null;let I=[],k=null;u.expectedType&&u.expectedType.kind!=="value"&&(k=u.expectedType);for(let R=1;R<n.length;R+=2){let q=R===1?-1/0:n[R],G=n[R+1],J=R,ae=R+1;if(typeof q!="number")return u.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not c
800omputed expressions) for the input values.',J);if(I.length&&I[I.length-1][0]>=q)return u.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',J);let ce=u.parse(G,ae,k);if(!ce)return null;k=k||ce.type,I.push([q,ce])}return new bl(k,y,I)}evaluate(n){let u=this.labels,y=this.outputs;if(u.length===1)return y[0].evaluate(n);let I=this.input.evaluate(n);if(I<=u[0])return y[0].evaluate(n);let k=u.length;return I>=u[k-1]?y[k-1].evaluate(n):y[Es(u,I)].evaluate(n)}eachChild(n){n(this.input);for(let u of this.outputs)n(u)}outputDefined(){return this.outputs.every((n=>n.outputDefined()))}}function Mr(c,n,u){return c*(1-u)+n*u}var ba=Object.freeze({__proto__:null,number:Mr,color:function(c,n,u){return new ve(Mr(c.r,n.r,u),Mr(c.g,n.g,u),Mr(c.b,n.b,u),Mr(c.a,n.a,u))},array:function(c,n,u){return c.map(((y,I)=>Mr(y,n[I],u)))},padding:function(c,n,u){let y=c.values,I=n.values;return new ke([Mr(y[0],I[0],u),Mr(y[1],I[1],u),Mr(y[2],I[2],u),Mr(y[3],I[3],u)])}});let wl=.95047,Yi=1.08883,kc=4/29,ph=6/29,dh=3*ph*ph,Fo=Math.PI/180,so=180/Math.PI;function Br(c){return c>.008856451679035631?Math.pow(c,1/3):c/dh+kc}function Ni(c){return c>ph?c*c*c:dh*(c-kc)}function Cr(c){return 255*(c<=.0031308?12.92*c:1.055*Math.pow(c,1/2.4)-.055)}function cs(c){return(c/=255)<=.04045?c/12.92:Math.pow((c+.055)/1.055,2.4)}function Xi(c){let n=cs(c.r),u=cs(c.g),y=cs(c.b),I=Br((.4124564*n+.3575761*u+.1804375*y)/wl),k=Br((.2126729*n+.7151522*u+.072175*y)/1);return{l:116*k-16,a:500*(I-k),b:200*(k-Br((.0193339*n+.119192*u+.9503041*y)/Yi)),alpha:c.a}}function Bo(c){let n=(c.l+16)/116,u=isNaN(c.a)?n:n+c.a/500,y=isNaN(c.b)?n:n-c.b/200;return n=1*Ni(n),u=wl*Ni(u),y=Yi*Ni(y),new ve(Cr(3.2404542*u-1.5371385*n-.4985314*y),Cr(-.969266*u+1.8760108*n+.041556*y),Cr(.0556434*u-.2040259*n+1.0572252*y),c.alpha)}function bo(c,n,u){let y=n-c;return c+u*(y>180||y<-180?y-360*Math.round(y/360):y)}let hs={forward:Xi,reverse:Bo,interpolate:function(c,n,u){return{l:Mr(c.l,n.l,u),a:Mr(c.a,n.a,u),b:Mr(c.b,n.b,u),alpha:Mr(c.alpha,n.alpha,u)}}},wa={forward:function(c){let{l:n,a:u,b:y}=Xi(c),I=Math.atan2(y,u)*so;return{h:I<0?I+360:I,c:Math.sqrt(u*u+y*y),l:n,alpha:c.a}},reverse:function(c){let n=c.h*Fo,u=c.c;return Bo({l:c.l,a:Math.cos(n)*u,b:Math.sin(n)*u,alpha:c.alpha})},interpolate:function(c,n,u){return{h:bo(c.h,n.h,u),c:Mr(c.c,n.c,u),l:Mr(c.l,n.l,u),alpha:Mr(c.alpha,n.alpha,u)}}};var en=Object.freeze({__proto__:null,lab:hs,hcl:wa});class Vn{constructor(n,u,y,I,k){this.type=n,this.operator=u,this.interpolation=y,this.input=I,this.labels=[],this.outputs=[];for(let[R,q]of k)this.labels.push(R),this.outputs.push(q)}static interpolationFactor(n,u,y,I){let k=0;if(n.name==="exponential")k=Ta(u,n.base,y,I);else if(n.name==="linear")k=Ta(u,1,y,I);else if(n.name==="cubic-bezier"){let R=n.controlPoints;k=new pe(R[0],R[1],R[2],R[3]).solve(Ta(u,1,y,I))}return k}static parse(n,u){let[y,I,k,...R]=n;if(!Array.isArray(I)||I.length===0)return u.error("Expected an interpolation type expression.",1);if(I[0]==="linear")I={name:"linear"};else if(I[0]==="exponential"){let J=I[1];if(typeof J!="number")return u.error("Exponential interpolation requires a numeric base.",1,1);I={name:"exponential",base:J}}else{if(I[0]!=="cubic-bezier")return u.error(`Unknown interpolation type ${String(I[0])}`,1,0);{let J=I.slice(1);if(J.length!==4||J.some((ae=>typeof ae!="number"||ae<0||ae>1)))return u.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);I={name:"cubic-bezier",controlPoints:J}}}if(n.length-1<4)return u.error(`Expected at least 4 arguments, but found only ${n.length-1}.`);if((n.length-1)%2!=0)return u.error("Expected an even number of arguments.");if(k=u.parse(k,2,Ht),!k)return null;let q=[],G=null;y==="interpolate-hcl"||y==="interpolate-lab"?G=an:u.expectedType&&u.expectedType.kind!=="value"&&(G=u.expectedType);for(let J=0;J<R.length;J+=2){let ae=R[J],ce=R[J+1],de=J+3,ge=J+4;if(typeof ae!="number")return u.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not c
800omputed expressions) for the input values.',de);if(q.length&&q[q.length-1][0]>=ae)return u.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',de);let ye=u.parse(ce,ge,G);if(!ye)return null;G=G||ye.type,q.push([ae,ye])}return G.kind==="number"||G.kind==="color"||G.kind==="padding"||G.kind==="array"&&G.itemType.kind==="number"&&typeof G.N=="number"?new Vn(G,y,I,k,q):u.error(`Type ${Ai(G)} is not interpolatable.`)}evaluate(n){let u=this.labels,y=this.outputs;if(u.length===1)return y[0].evaluate(n);let I=this.input.evaluate(n);if(I<=u[0])return y[0].evaluate(n);let k=u.length;if(I>=u[k-1])return y[k-1].evaluate(n);let R=Es(u,I),q=Vn.interpolationFactor(this.interpolation,I,u[R],u[R+1]),G=y[R].evaluate(n),J=y[R+1].evaluate(n);return this.operator==="interpolate"?ba[this.type.kind.toLowerCase()](G,J,q):this.operator==="interpolate-hcl"?wa.reverse(wa.interpolate(wa.forward(G),wa.forward(J),q)):hs.reverse(hs.interpolate(hs.forward(G),hs.forward(J),q))}eachChild(n){n(this.input);for(let u of this.outputs)n(u)}outputDefined(){return this.outputs.every((n=>n.outputDefined()))}}function Ta(c,n,u,y){let I=y-u,k=c-u;return I===0?0:n===1?k/I:(Math.pow(n,k)-1)/(Math.pow(n,I)-1)}class Tl{constructor(n,u){this.type=n,this.args=u}static parse(n,u){if(n.length<2)return u.error("Expectected at least one argument.");let y=null,I=u.expectedType;I&&I.kind!=="value"&&(y=I);let k=[];for(let q of n.slice(1)){let G=u.parse(q,1+k.length,y,void 0,{typeAnnotation:"omit"});if(!G)return null;y=y||G.type,k.push(G)}if(!y)throw new Error("No output type");let R=I&&k.some((q=>ao(I,q.type)));return new Tl(R?ji:y,k)}evaluate(n){let u,y=null,I=0;for(let k of this.args)if(I++,y=k.evaluate(n),y&&y instanceof Ge&&!y.available&&(u||(u=y.name),y=null,I===this.args.length&&(y=u)),y!==null)break;return y}eachChild(n){this.args.forEach(n)}outputDefined(){return this.args.every((n=>n.outputDefined()))}}class to{constructor(n,u){this.type=u.type,this.bindings=[].concat(n),this.result=u}evaluate(n){return this.result.evaluate(n)}eachChild(n){for(let u of this.bindings)n(u[1]);n(this.result)}static parse(n,u){if(n.length<4)return u.error(`Expected at least 3 arguments, but found ${n.length-1} instead.`);let y=[];for(let k=1;k<n.length-1;k+=2){let R=n[k];if(typeof R!="string")return u.error(`Expected string, but found ${typeof R} instead.`,k);if(/[^a-zA-Z0-9_]/.test(R))return u.error("Variable names must contain only alphanumeric characters or '_'.",k);let q=u.parse(n[k+1],k+1);if(!q)return null;y.push([R,q])}let I=u.parse(n[n.length-1],n.length-1,u.expectedType,y);return I?new to(y,I):null}outputDefined(){return this.result.outputDefined()}}class Ms{constructor(n,u,y){this.type=n,this.index=u,this.input=y}static parse(n,u){if(n.length!==3)return u.error(`Expected 2 arguments, but found ${n.length-1} instead.`);let y=u.parse(n[1],1,Ht),I=u.parse(n[2],2,eo(u.expectedType||ji));return y&&I?new Ms(I.type.itemType,y,I):null}evaluate(n){let u=this.index.evaluate(n),y=this.input.evaluate(n);if(u<0)throw new ei(`Array index out of bounds: ${u} < 0.`);if(u>=y.length)throw new ei(`Array index out of bounds: ${u} > ${y.length-1}.`);if(u!==Math.floor(u))throw new ei(`Array index must be an integer, but found ${u} instead.`);return y[u]}eachChild(n){n(this.index),n(this.input)}outputDefined(){return!1}}class ja{constructor(n,u){this.type=Bi,this.needle=n,this.haystack=u}static parse(n,u){if(n.length!==3)return u.error(`Expected 2 arguments, but found ${n.length-1} instead.`);let y=u.parse(n[1],1,ji),I=u.parse(n[2],2,ji);return y&&I?Xs(y.type,[Bi,Wi,Ht,ta,ji])?new ja(y,I):u.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ai(y.type)} instead`):null}evaluate(n){let u=this.needle.evaluate(n),y=this.haystack.evaluate(n);if(!y)return!1;if(!Ks(u,["boolean","string","number","null"]))throw new ei(`Expected first argument to be of type boolean, string, number or null, but found ${Ai(dt(u))} instead.`);if(!Ks(y,["string","array"]))throw new ei(`Expected second argument to be of type array or string, but found ${Ai(dt(y))} instead.`);return y.indexOf(u)>=0}eachChild(n){n(this.needle),n(this.haystack)}outputDefined(){return!0}}class Ac{constructor(n,u,y){this.type=Ht,this.needle=n,this.haystack=u,this.fromIndex=y}static parse(n,u){if(n.length<=2||n.length>=5)return u.error(`Expected 3 or 4 arguments, but found ${n.length-1} instead.`);let y=u.parse(n[1],1,ji),I=u.parse(n[2],2,ji);if(!y||!I)return null;if(!Xs(y.type,[Bi,Wi,Ht,ta,ji]))return u.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ai(y.type)} instead`);if(n.length===4){let k=u.parse(n[3],3,Ht);return k?new Ac(y,I,k):null}return new Ac(y,I)}evaluate(n){let u=this.needle.evaluate(n),y=this.haystack.evaluate(n);if(!Ks(u,["boolean","string","number","null"]))throw new ei(`Expected first argument to be of type boolean, string, number or null, but found ${Ai(dt(u))} instead.`);if(!Ks(y,["string","array"]))throw new ei(`Expected second argument to be of type array or string, but found ${Ai(dt(y))} instead.`);if(this.fromIndex){let I=this.fromIndex.evaluate(n);return y.indexOf(u,I)}return y.indexOf(u)}eachChild(n){n(this.needle),n(this.haystack),this.fromIndex&&n(this.fromIndex)}outputDefined(){return!1}}class zc{constructor(n,u,y,I,k,R){this.inputType=n,this.type=u,this.input=y,this.cases=I,this.outputs=k,this.otherwise=R}static parse(n,u){if(n.length<5)return u.error(`Expected at least 4 arguments, but found only ${n.length-1}.`);if(n.length%2!=1)return u.error("Expected an even number of arguments.");let y,I;u.expectedType&&u.expectedType.kind!=="value"&&(I=u.expectedType);let k={},R=[];for(let J=2;J<n.length-1;J+=2){let ae=n[J],ce=n[J+1];Array.isArray(ae)||(ae=[ae]);let de=u.concat(J);if(ae.length===0)return de.error("Expected at least one branch label.");for(let ye of ae){if(typeof ye!="number"&&typeof ye!="string")return de.error("Branch labels must be numbers or strings.");if(typeof ye=="number"&&Math.abs(ye)>Number.MAX_SAFE_INTEGER)return de.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof ye=="number"&&Math.floor(ye)!==ye)return de.error("Numeric branch labels must be integer values.");if(y){if(de.checkSubtype(y,dt(ye)))return null}else y=dt(ye);if(k[String(ye)]!==void 0)return de.error("Branch labels must be unique.");k[String(ye)]=R.length}let ge=u.parse(ce,J,I);if(!ge)return null;I=I||ge.type,R.push(ge)}let q=u.parse(n[1],1,ji);if(!q)return null;let G=u.parse(n[n.length-1],n.length-1,I);return G?q.type.kind!=="value"&&u.concat(1).checkSubtype(y,q.type)?null:new zc(y,I,q,k,R,G):null}evaluate(n){let u=this.input.evaluate(n);return(dt(u)===this.inputType&&this.outputs[this.cases[u]]||this.otherwise).evaluate(n)}
vendor: 6,373 bytes, line 800
800eachChild(n){n(this.input),this.outputs.forEach(n),n(this.otherwise)}outputDefined(){return this.outputs.every((n=>n.outputDefined()))&&this.otherwise.outputDefined()}}class Ps{constructor(n,u,y){this.type=n,this.branches=u,this.otherwise=y}static parse(n,u){if(n.length<4)return u.error(`Expected at least 3 arguments, but found only ${n.length-1}.`);if(n.length%2!=0)return u.error("Expected an odd number of arguments.");let y;u.expectedType&&u.expectedType.kind!=="value"&&(y=u.expectedType);let I=[];for(let R=1;R<n.length-1;R+=2){let q=u.parse(n[R],R,Bi);if(!q)return null;let G=u.parse(n[R+1],R+1,y);if(!G)return null;I.push([q,G]),y=y||G.type}let k=u.parse(n[n.length-1],n.length-1,y);if(!k)return null;if(!y)throw new Error("Can't infer output type");return new Ps(y,I,k)}evaluate(n){for(let[u,y]of this.branches)if(u.evaluate(n))return y.evaluate(n);return this.otherwise.evaluate(n)}eachChild(n){for(let[u,y]of this.branches)n(u),n(y);n(this.otherwise)}outputDefined(){return this.branches.every((([n,u])=>u.outputDefined()))&&this.otherwise.outputDefined()}}class br{constructor(n,u,y,I){this.type=n,this.input=u,this.beginIndex=y,this.endIndex=I}static parse(n,u){if(n.length<=2||n.length>=5)return u.error(`Expected 3 or 4 arguments, but found ${n.length-1} instead.`);let y=u.parse(n[1],1,ji),I=u.parse(n[2],2,Ht);if(!y||!I)return null;if(!Xs(y.type,[eo(ji),Wi,ji]))return u.error(`Expected first argument to be of type array or string, but found ${Ai(y.type)} instead`);if(n.length===4){let k=u.parse(n[3],3,Ht);return k?new br(y.type,y,I,k):null}return new br(y.type,y,I)}evaluate(n){let u=this.input.evaluate(n),y=this.beginIndex.evaluate(n);if(!Ks(u,["string","array"]))throw new ei(`Expected first argument to be of type array or string, but found ${Ai(dt(u))} instead.`);if(this.endIndex){let I=this.endIndex.evaluate(n);return u.slice(y,I)}return u.slice(y)}eachChild(n){n(this.input),n(this.beginIndex),this.endIndex&&n(this.endIndex)}outputDefined(){return!1}}function Sl(c,n){return c==="=="||c==="!="?n.kind==="boolean"||n.kind==="string"||n.kind==="number"||n.kind==="null"||n.kind==="value":n.kind==="string"||n.kind==="number"||n.kind==="value"}function ar(c,n,u,y){return y.compare(n,u)===0}function Zi(c,n,u){let y=c!=="=="&&c!=="!=";return class M5{constructor(k,R,q){this.type=Bi,this.lhs=k,this.rhs=R,this.collator=q,this.hasUntypedArgument=k.type.kind==="value"||R.type.kind==="value"}static parse(k,R){if(k.length!==3&&k.length!==4)return R.error("Expected two or three arguments.");let q=k[0],G=R.parse(k[1],1,ji);if(!G)return null;if(!Sl(q,G.type))return R.concat(1).error(`"${q}" comparisons are not supported for type '${Ai(G.type)}'.`);let J=R.parse(k[2],2,ji);if(!J)return null;if(!Sl(q,J.type))return R.concat(2).error(`"${q}" comparisons are not supported for type '${Ai(J.type)}'.`);if(G.type.kind!==J.type.kind&&G.type.kind!=="value"&&J.type.kind!=="value")return R.error(`Cannot compare types '${Ai(G.type)}' and '${Ai(J.type)}'.`);y&&(G.type.kind==="value"&&J.type.kind!=="value"?G=new Ri(J.type,[G]):G.type.kind!=="value"&&J.type.kind==="value"&&(J=new Ri(G.type,[J])));let ae=null;if(k.length===4){if(G.type.kind!=="string"&&J.type.kind!=="string"&&G.type.kind!=="value"&&J.type.kind!=="value")return R.error("Cannot use collator to compare non-string types.");if(ae=R.parse(k[3],3,Ro),!ae)return null}return new M5(G,J,ae)}evaluate(k){let R=this.lhs.evaluate(k),q=this.rhs.evaluate(k);if(y&&this.hasUntypedArgument){let G=dt(R),J=dt(q);if(G.kind!==J.kind||G.kind!=="string"&&G.kind!=="number")throw new ei(`Expected arguments for "${c}" to be (string, string) or (number, number), but found (${G.kind}, ${J.kind}) instead.`)}if(this.collator&&!y&&this.hasUntypedArgument){let G=dt(R),J=dt(q);if(G.kind!=="string"||J.kind!=="string")return n(k,R,q)}return this.collator?u(k,R,q,this.collator.evaluate(k)):n(k,R,q)}eachChild(k){k(this.lhs),k(this.rhs),this.collator&&k(this.collator)}outputDefined(){return!0}}}let tc=Zi("==",(function(c,n,u){return n===u}),ar),hr=Zi("!=",(function(c,n,u){return n!==u}),(function(c,n,u,y){return!ar(0,n,u,y)})),qa=Zi("<",(function(c,n,u){return n<u}),(function(c,n,u,y){return y.compare(n,u)<0})),ic=Zi(">",(function(c,n,u){return n>u}),(function(c,n,u,y){return y.compare(n,u)>0})),Il=Zi("<=",(function(c,n,u){return n<=u}),(function(c,n,u,y){return y.compare(n,u)<=0})),rc=Zi(">=",(function(c,n,u){return n>=u}),(function(c,n,u,y){return y.compare(n,u)>=0}));class Dc{constructor(n,u,y,I,k){this.type=Wi,this.number=n,this.locale=u,this.currency=y,this.minFractionDigits=I,this.maxFractionDigits=k}static parse(n,u){if(n.length!==3)return u.error("Expected two arguments.");let y=u.parse(n[1],1,Ht);if(!y)return null;let I=n[2];if(typeof I!="object"||Array.isArray(I))return u.error("NumberFormat options argument must be an object.");let k=null;if(I.locale&&(k=u.parse(I.locale,1,Wi),!k))return null;let R=null;if(I.currency&&(R=u.parse(I.currency,1,Wi),!R))return null;let q=null;if(I["min-fraction-digits"]&&(q=u.parse(I["min-fraction-digits"],1,Ht),!q))return null;let G=null;return I["max-fraction-digits"]&&(G=u.parse(I["max-fraction-digits"],1,Ht),!G)?null:new Dc(y,k,R,q,G)}evaluate(n){return new Intl.NumberFormat(this.locale?this.locale.evaluate(n):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(n):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(n):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(n):void 0}).format(this.number.evaluate(n))}eachChild(n){n(this.number),this.locale&&n(this.locale),this.currency&&n(this.currency),this.minFractionDigits&&n(this.minFractionDigits),this.maxFractionDigits&&n(this.maxFractionDigits)}outputDefined(){return!1}}class Cl{constructor(n){this.type=vn,this.sections=n}static parse(n,u){if(n.length<2)return u.error("Expected at least one argument.");let y=n[1];if(!Array.isArray(y)&&typeof y=="object")return u.error("First argument must be an image or text section.");let I=[],k=!1;for(let R=1;R<=n.length-1;++R){let q=n[R];if(k&&typeof q=="object"&&!Array.isArray(q)){k=!1;let G=null;if(q["font-scale"]&&(G=u.parse(q["font-scale"],1,Ht),!G))return null;let J=null;if(q["text-font"]&&(J=u.parse(q["text-font"],1,eo(Wi)),!J))return null;let ae=null;if(q["text-color"]&&(ae=u.parse(q["text-color"],1,an),!ae))return null;
800let ce=I[I.length-1];ce.scale=G,ce.font=J,ce.textColor=ae}else{let G=u.parse(n[R],1,ji);if(!G)return null;let J=G.type.kind;if(J!=="string"&&J!=="value"&&J!=="null"&&J!=="resolvedImage")return u.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");k=!0,I.push({content:G,scale:null,font:null,textColor:null})}}return new Cl(I)}evaluate(n){return new Te(this.sections.map((u=>{let y=u.content.evaluate(n);return dt(y)===sn?new Ke("",y,null,null,null):new Ke(Lt(y),null,u.scale?u.scale.evaluate(n):null,u.font?u.font.evaluate(n).join(","):null,u.textColor?u.textColor.evaluate(n):null)})))}eachChild(n){for(let u of this.sections)n(u.content),u.scale&&n(u.scale),u.font&&n(u.font),u.textColor&&n(u.textColor)}outputDefined(){return!1}}class mh{constructor(n){this.type=sn,this.input=n}static parse(n,u){if(n.length!==2)return u.error("Expected two arguments.");let y=u.parse(n[1],1,Wi);return y?new mh(y):u.error("No image name provided.")}evaluate(n){let u=this.input.evaluate(n),y=Ge.fromString(u);return y&&n.availableImages&&(y.available=n.availableImages.indexOf(u)>-1),y}eachChild(n){n(this.input)}outputDefined(){return!1}}class fh{constructor(n){this.type=Ht,this.input=n}static parse(n,u){if(n.length!==2)return u.error(`Expected 1 argument, but found ${n.length-1} instead.`);let y=u.parse(n[1],1);return y?y.type.kind!=="array"&&y.type.kind!=="string"&&y.type.kind!=="value"?u.error(`Expected argument of type string or array, but found ${Ai(y.type)} instead.`):new fh(y):null}evaluate(n){let u=this.input.evaluate(n);if(typeof u=="string"||Array.isArray(u))return u.length;throw new ei(`Expected value to be of type string or array, but found ${Ai(dt(u))} instead.`)}eachChild(n){n(this.input)}outputDefined(){return!1}}let El={"==":tc,"!=":hr,">":ic,"<":qa,">=":rc,"<=":Il,array:Ri,at:Ms,boolean:Ri,case:Ps,coalesce:Tl,collator:bn,format:Cl,image:mh,in:ja,"index-of":Ac,interpolate:Vn,"interpolate-hcl":Vn,"interpolate-lab":Vn,length:fh,let:to,literal:gi,match:zc,number:Ri,"number-format":Dc,object:Ri,slice:br,step:bl,string:Ri,"to-boolean":Vi,"to-color":Vi,"to-number":Vi,"to-string":Vi,var:Js,within:Is};function ln(c,[n,u,y,I]){n=n.evaluate(c),u=u.evaluate(c),y=y.evaluate(c);let k=I?I.evaluate(c):1,R=pt(n,u,y,k);if(R)throw new ei(R);return new ve(n/255*k,u/255*k,y/255*k,k)}function Nn(c,n){return c in n}function lo(c,n){let u=n[c];return u===void 0?null:u}function $a(c){return{type:c}}function nc(c){return{result:"success",value:c}}function Hr(c){return{result:"error",value:c}}function yr(c){return c["property-type"]==="data-driven"||c["property-type"]==="cross-faded-data-driven"}function gh(c){return!!c.expression&&c.expression.parameters.indexOf("zoom")>-1}function nr(c){return!!c.expression&&c.expression.interpolated}function gr(c){return c instanceof Number?"number":c instanceof String?"string":c instanceof Boolean?"boolean":Array.isArray(c)?"array":c===null?"null":typeof c}function xr(c){return typeof c=="object"&&c!==null&&!Array.isArray(c)}function zr(c){return c}function Ml(c,n){let u=n.type==="color",y=c.stops&&typeof c.stops[0][0]=="object",I=y||!(y||c.property!==void 0),k=c.type||(nr(n)?"exponential":"interval");if(u||n.type==="padding"){let J=u?ve.parse:ke.parse;(c=xa({},c)).stops&&(c.stops=c.stops.map((ae=>[ae[0],J(ae[1])]))),c.default=J(c.default?c.default:n.default)}if(c.colorSpace&&c.colorSpace!=="rgb"&&!en[c.colorSpace])throw new Error(`Unknown color space: ${c.colorSpace}`);let R,q,G;if(k==="exponential")R=kl;else if(k==="interval")R=Pl;else if(k==="categorical"){R=_h,q=Object.create(null);for(let J of c.stops)q[J[0]]=J[1];G=typeof c.stops[0][0]}else{if(k!=="identity")throw new Error(`Unknown function type "${k}"`);R=ia}if(y){let J={},ae=[];for(let ge=0;ge<c.stops.length;ge++){let ye=c.stops[ge],Ue=ye[0].zoom;J[Ue]===void 0&&(J[Ue]={zoom:Ue,type:c.type,property:c.property,default:c.default,stops:[]},ae.push(Ue)),J[Ue].stops.push([ye[0].value,ye[1]])}let ce=[];for(let ge of ae)ce.push([J[ge].zoom,Ml(J[ge],n)]);let de={name:"linear"};return{kind:"composite",interpolationType:de,interpolationFactor:Vn.interpolationFactor.bind(void 0,de),zoomStops:ce.map((ge=>ge[0])),evaluate:({zoom:ge},ye)=>kl({stops:ce,base:c.base},n,ge).evaluate(ge,ye)}}if(I){let J=k==="exponential"?{name:"exponential",base:c.base!==void 0?c.base:1}:null;return{kind:"camera",interpolationType:J,interpolationFactor:Vn.interpolationFactor.bind(void 0,J),zoomStops:c.stops.map((ae=>ae[0])),evaluate:({zoom:ae})=>R(c,n,ae,q,G)}}return{kind:"source",evaluate(J,ae){let ce=ae&&ae.properties?ae.properties[c.property]:void 0;return ce===void 0?ks(c.default,n.default):R(c,n,ce,q,G)}}}function ks(c,n,u){return c!==void 0?c:n!==void 0?n:u!==void 0?u:void 0}function _h(c,n,u,y,I){return ks(typeof u===I?y[u]:void 0,c.default,n.default)}function Pl(c,n,u){if(gr(u)!=="number")return ks(c.default,n.default);let y=c.stops.length;if(y===1||u<=c.stops[0][0])return c.stops[0][1];if(u>=c.stops[y-1][0])return c.stops[y-1][1];let I=Es(c.stops.map((k=>k[0])),u);return c.stops[I][1]}function kl(c,n,u){let y=c.base!==void 0?c.base:1;if(gr(u)!=="number")return ks(c.default,n.default);let I=c.stops.length;if(I===1||u<=c.stops[0][0])return c.stops[0][1];if(u>
800=c.stops[I-1][0])return c.stops[I-1][1];let k=Es(c.stops.map((ae=>ae[0])),u),R=(function(ae,ce,de,ge){let ye=ge-de,Ue=ae-de;return ye===0?0:ce===1?Ue/ye:(Math.pow(ce,Ue)-1)/(Math.pow(ce,ye)-1)})(u,y,c.stops[k][0],c.stops[k+1][0]),q=c.stops[k][1],G=c.stops[k+1][1],J=ba[n.type]||zr;if(c.colorSpace&&c.colorSpace!=="rgb"){let ae=en[c.colorSpace];J=(ce,de)=>ae.reverse(ae.interpolate(ae.forward(ce),ae.forward(de),R))}return typeof q.evaluate=="function"?{evaluate(...ae){let ce=q.evaluate.apply(void 0,ae),de=G.evaluate.apply(void 0,ae);if(ce!==void 0&&de!==void 0)return J(ce,de,R)}}:J(q,G,R)}function ia(c,n,u){switch(n.type){case"color":u=ve.parse(u);break;case"formatted":u=Te.fromString(u.toString());break;case"resolvedImage":u=Ge.fromString(u.toString());break;case"padding":u=ke.parse(u);break;default:gr(u)===n.type||n.type==="enum"&&n.values[u]||(u=void 0)}return ks(u,c.default,n.default)}Fi.register(El,{error:[{kind:"error"},[Wi],(c,[n])=>{throw new ei(n.evaluate(c))}],typeof:[Wi,[ji],(c,[n])=>Ai(dt(n.evaluate(c)))],"to-rgba":[eo(Ht,4),[an],(c,[n])=>n.evaluate(c).toArray()],rgb:[an,[Ht,Ht,Ht],ln],rgba:[an,[Ht,Ht,Ht,Ht],ln],has:{type:Bi,overloads:[[[Wi],(c,[n])=>Nn(n.evaluate(c),c.properties())],[[Wi,Lo],(c,[n,u])=>Nn(n.evaluate(c),u.evaluate(c))]]},get:{type:ji,overloads:[[[Wi],(c,[n])=>lo(n.evaluate(c),c.properties())],[[Wi,Lo],(c,[n,u])=>lo(n.evaluate(c),u.evaluate(c))]]},"feature-state":[ji,[Wi],(c,[n])=>lo(n.evaluate(c),c.featureState||{})],properties:[Lo,[],c=>c.properties()],"geometry-type":[Wi,[],c=>c.geometryType()],id:[ji,[],c=>c.id()],zoom:[Ht,[],c=>c.globals.zoom],"heatmap-density":[Ht,[],c=>c.globals.heatmapDensity||0],"line-progress":[Ht,[],c=>c.globals.lineProgress||0],accumulated:[ji,[],c=>c.globals.accumulated===void 0?null:c.globals.accumulated],"+":[Ht,$a(Ht),(c,n)=>{let u=0;for(let y of n)u+=y.evaluate(c);return u}],"*":[Ht,$a(Ht),(c,n)=>{let u=1;for(let y of n)u*=y.evaluate(c);return u}],"-":{type:Ht,overloads:[[[Ht,Ht],(c,[n,u])=>n.evaluate(c)-u.evaluate(c)],[[Ht],(c,[n])=>-n.evaluate(c)]]},"/":[Ht,[Ht,Ht],(c,[n,u])=>n.evaluate(c)/u.evaluate(c)],"%":[Ht,[Ht,Ht],(c,[n,u])=>n.evaluate(c)%u.evaluate(c)],ln2:[Ht,[],()=>Math.LN2],pi:[Ht,[],()=>Math.PI],e:[Ht,[],()=>Math.E],"^":[Ht,[Ht,Ht],(c,[n,u])=>Math.pow(n.evaluate(c),u.evaluate(c))],sqrt:[Ht,[Ht],(c,[n])=>Math.sqrt(n.evaluate(c))],log10:[Ht,[Ht],(c,[n])=>Math.log(n.evaluate(c))/Math.LN10],ln:[Ht,[Ht],(c,[n])=>Math.log(n.evaluate(c))],log2:[Ht,[Ht],(c,[n])=>Math.log(n.evaluate(c))/Math.LN2],sin:[Ht,[Ht],(c,[n])=>Math.sin(n.evaluate(c))],cos:[Ht,[Ht],(c,[n])=>Math.cos(n.evaluate(c))],tan:[Ht,[Ht],(c,[n])=>Math.tan(n.evaluate(c))],asin:[Ht,[Ht],(c,[n])=>Math.asin(n.evaluate(c))],acos:[Ht,[Ht],(c,[n])=>Math.acos(n.evaluate(c))],atan:[Ht,[Ht],(c,[n])=>Math.atan(n.evaluate(c))],min:[Ht,$a(Ht),(c,n)=>Math.min(...n.map((u=>u.evaluate(c))))],max:[Ht,$a(Ht),(c,n)=>Math.max(...n.map((u=>u.evaluate(c))))],abs:[Ht,[Ht],(c,[n])=>Math.abs(n.evaluate(c))],round:[Ht,[Ht],(c,[n])=>{let u=n.evaluate(c);return u<0?-Math.round(-u):Math.round(u)}],floor:[Ht,[Ht],(c,[n])=>Math.floor(n.evaluate(c))],ceil:[Ht,[Ht],(c,[n])=>Math.ceil(n.evaluate(c))],"filter-==":[Bi,[Wi,ji],(c,[n,u])=>c.properties()[n.value]===u.value],"filter-id-==":[Bi,[ji],(c,[n])=>c.id()===n.value],"filter-type-==":[Bi,[Wi],(c,[n])=>c.geometryType()===n.value],"filter-<":[Bi,[Wi,ji],(c,[n,u])=>{let y=c.properties()[n.value],I=u.value;return typeof y==typeof I&&y<I}],"filter-id-<":[Bi,[ji],(c,[n])=>{let u=c.id(),y=n.value;return typeof u==typeof y&&u<y}],"filter->":[Bi,[Wi,ji],(c,[n,u])=>{let y=c.properties()[n.value],I=u.value;return typeof y==typeof I&&y>I}],"filter-id->":[Bi,[ji],(c,[n])=>{let u=c.id(),y=n.value;return typeof u==typeof y&&u>y}],"filter-<=":[Bi,[Wi,ji],(c,[n,u])=>{let y=c.properties()[n.value],I=u.value;return typeof y==typeof I&&y<=I}],"filter-id-<=":[Bi,[ji],(c,[n])=>{let u=c.id(),y=n.value;return typeof u==typeof y&&u<=y}],"filter->=":[Bi,[Wi,ji],(c,[n,u])=>{let y=c.properties()[n.value],I=u.value;return typeof y==typeof I&&y>=I}],"filter-id->=":[Bi,[ji],(c,[n])=>{let u=c.id(),y=n.value;return typeof u==typeof y&&u>=y}],"filter-has":[Bi,[ji],(c,[n])=>n.value in c.properties()],"filter-has-id":[Bi,[],c=>c.id()!==null&&c.id()!==void 0],"filter-type-in":[Bi,[eo(Wi)],(c,[n])=>n.value.indexOf(c.geometryType())>=0],"filter-id-in":[Bi,[eo(ji)],(c,[n])=>n.value.indexOf(c.id())>=0],"filter-in-small":[Bi,[Wi,eo(ji)],(c,[n,u])=>u.value.indexOf(c.properties()[n.value])>=0],"filter-in-large":[Bi,[Wi,eo(ji)],(c,[n,u])=>(function(y,I,k,R){for(;k<=R;){let q=k+R>>1;if(I[q]===y)return!0;I[q]>y?R=q-1:k=q+1}return!1})(c.properties()[n.value],u.value,0,u.value.length-1)],all:{type:Bi,overloads:[[[Bi,Bi],(c,[n,u])=>n.evaluate(c)&&u.evaluate(c)],[$a(Bi),(c,n)=>{for(let u of n)if(!u.evaluate(c))return!1;return!0}]]},any:{type:Bi,overloads:[[[Bi,Bi],(c,[n,u])=>n.evaluate(c)||u.evaluate(c)],[$a(Bi),(c,n)=>{for(let u of n)if(u.evaluate(c))return!0;return!1}]]},"!":[Bi,[Bi],(c,[n])=>!n.evaluate(c)],"is-supported-script":[Bi,[Wi],(c,[n])=>{let u=c.globals&&c.globals.isSupportedScript;return!u||u(n.evaluate(c))}],upcase:[Wi,[Wi],(c,[n])=>n.evaluate(c).toUpperCase()],downcase:[Wi,[Wi],(c,[n])=>n.evaluate(c).toLowerCase()],concat:[Wi,$a(ji),(c,n)=>n.map((u=>Lt(u.evaluate(c)))).join("")],"resolved-locale":[Wi,[Ro],(c,[n])=>n.evaluate(c).resolvedLocale()]});class Oo{constructor(n,u){this.expression=n,this._warningHistory={},this._evaluator=new qi,this._defaultValue=u?(function(y){return y.type==="color"&&xr(y.default)?new ve(0,0,0,0):y.type==="color"?ve.parse(y.default)||null:y.type==="padding"?ke.parse(y.default)||null:y.default===void 0?null:y.default})(u):null,this._enumValues=u&&u.type==="enum"?u.values:null}evaluateWithoutErrorHandling(n,u,y,I,k,R){return this._evaluator.globals=n,this._evaluator.feature=u,this._evaluator.featureState=y,this._evaluator.canonical=I,this._evaluator.availableImages=k||null,this._evaluator.formattedSection=R,this.expression.evaluate(this._evaluator)}evaluate(n,u,y,I,k,R){this._evaluator.globals=n,this._evaluator.feature=u||null,this._evaluator.featureState=y||null,this._evaluator.canonical=I,this._evaluator.availableImages=k||null,this._evaluator.formattedSection=R||null;try{let q=this.expression.evaluate(this._evaluator);if(q==null||typeof q=="number"&&q!=q)return this._defaultValue;if(this._enumValues&&!(q in this._enumValues))throw new ei(`Expected value to be one of ${Object.keys(this._enumValues).map((G=>JSON.stringify(G))).join(", ")}, but found ${JSON.stringify(q)} instead.`);return q}catch(q){return this._warningHistory[q.message]||(this._warningHistory[q.message]=!0,typeof console<"u"&&console.warn(q.message)),this._defaultValue}}}function Qs(c){return Array.isArray(c)&&c.length>0&&typeof c[0]=="string"&&c[0]in El}function Al(c,n){let u=new Cs(El,[],n?(function(I){let k={color:an,string:Wi,number:Ht,enum:Wi,boolean:Bi,formatted:vn,padding:xt,resolvedImage:sn};return I.type==="array"?eo(k[I.value]||ji,I.length):k[I.type]})(n):void 0),y=u.parse(c,void 0,void 0,void 0,n&&n.type==="string"?{typeAnnotation:"coerce"}:void 0);return y?nc(new Oo(y,n)):Hr(u.errors)}class Ga{constructor(n,u){this.kind=n,this._styleExpression=u,this.isStateDependent=n!=="constant"&&!Ys(u.expression)}evaluateWithoutErrorHandling(n,u,y,I,k,R){return this._styleExpression.evaluateWithoutErrorHandling(n,u,y,I,k,R)}evaluate(n,u,y,I,k,R){return this._styleExpression.evaluate(n,u,y,I,k,R)}}class zl{constructor(n,u,y,I){this.kind=n,this.zoomStops=y,this._styleExpression=u,this.isStateDependent=n!=="camera"&&!Ys(u.expression),this.interpolationType=I}evaluateWithoutErrorHandling(n,u,y,I,k,R){return this._styleExpression.evaluateWithoutErrorHandling(n,u,y,I,k,R)}evaluate(n,u,y,I,k,R){return this._styleExpression.evaluate(n,u,y,I,k,R)}interpolationFactor(n,u,y){return this.interpolationType?Vn.interpolationFactor(this.interpolationType,n,u,y):0}}function Su(c,n){let u=Al(c,n);if(u.result==="error")return u;
800let y=u.value.expression,I=vl(y);if(!I&&!yr(n))return Hr([new xn("","data expressions not supported")]);let k=hh(y,["zoom"]);if(!k&&!gh(n))return Hr([new xn("","zoom expressions not supported")]);let R=yh(y);return R||k?R instanceof xn?Hr([R]):R instanceof Vn&&!nr(n)?Hr([new xn("",'"interpolate" expressions cannot be used with this property')]):nc(R?new zl(I?"camera":"composite",u.value,R.labels,R instanceof Vn?R.interpolation:void 0):new Ga(I?"constant":"source",u.value)):Hr([new xn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Dl{constructor(n,u){this._parameters=n,this._specification=u,xa(this,Ml(this._parameters,this._specification))}static deserialize(n){return new Dl(n._parameters,n._specification)}static serialize(n){return{_parameters:n._parameters,_specification:n._specification}}}function yh(c){let n=null;if(c instanceof to)n=yh(c.result);else if(c instanceof Tl){for(let u of c.args)if(n=yh(u),n)break}else(c instanceof bl||c instanceof Vn)&&c.input instanceof Fi&&c.input.name==="zoom"&&(n=c);return n instanceof xn||c.eachChild((u=>{let y=yh(u);y instanceof xn?n=y:!n&&y?n=new xn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):n&&y&&n!==y&&(n=new xn("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),n}function Un(c){let n=c.key,u=c.value,y=c.valueSpec||{},I=c.objectElementValidators||{},k=c.style,R=c.styleSpec,q=[],G=gr(u);if(G!=="object")return[new Kt(n,u,`object expected, ${G} found`)];for(let J in u){let ae=J.split(".")[0],ce=y[ae]||y["*"],de;if(I[ae])de=I[ae];else if(y[ae])de=To;else if(I["*"])de=I["*"];else{if(!y["*"]){q.push(new Kt(n,u[J],`unknown property "${J}"`));continue}de=To}q=q.concat(de({key:(n&&`${n}.`)+J,value:u[J],valueSpec:ce,style:k,styleSpec:R,object:u,objectKey:J},u))}for(let J in y)I[J]||y[J].required&&y[J].default===void 0&&u[J]===void 0&&q.push(new Kt(n,u,`missing required property "${J}"`));return q}function Iu(c){let n=c.value,u=c.valueSpec,y=c.style,I=c.styleSpec,k=c.key,R=c.arrayElementValidator||To;if(gr(n)!=="array")return[new Kt(k,n,`array expected, ${gr(n)} found`)];if(u.length&&n.length!==u.length)return[new Kt(k,n,`array length ${u.length} expected, length ${n.length} found`)];if(u["min-length"]&&n.length<u["min-length"])return[new Kt(k,n,`array length at least ${u["min-length"]} expected, length ${n.length} found`)];let q={type:u.value,values:u.values};I.$version<7&&(q.function=u.function),gr(u.value)==="object"&&(q=u.value);let G=[];for(let J=0;J<n.length;J++)G=G.concat(R({array:n,arrayIndex:J,value:n[J],valueSpec:q,style:y,styleSpec:I,key:`${k}[${J}]`}));return G}function Lc(c){let n=c.key,u=c.value,y=c.valueSpec,I=gr(u);return I==="number"&&u!=u&&(I="NaN"),I!=="number"?[new Kt(n,u,`number expected, ${I} found`)]:"minimum"in y&&u<y.minimum?[new Kt(n,u,`${u} is less than the minimum value ${y.minimum}`)]:"maximum"in y&&u>y.maximum?[new Kt(n,u,`${u} is greater than the maximum value ${y.maximum}`)]:[]}function Jh(c){let n=c.valueSpec,u=or(c.value.type),y,I,k,R={},q=u!=="categorical"&&c.value.property===void 0,G=!q,J=gr(c.value.stops)==="array"&&gr(c.value.stops[0])==="array"&&gr(c.value.stops[0][0])==="object",ae=Un({key:c.key,value:c.value,valueSpec:c.styleSpec.function,style:c.style,styleSpec:c.styleSpec,objectElementValidators:{stops:function(ge){if(u==="identity")return[new Kt(ge.key,ge.value,'identity function may not have a "stops" property')];let ye=[],Ue=ge.value;return ye=ye.concat(Iu({key:ge.key,value:Ue,valueSpec:ge.valueSpec,style:ge.style,styleSpec:ge.styleSpec,arrayElementValidator:ce})),gr(Ue)==="array"&&Ue.length===0&&ye.push(new Kt(ge.key,Ue,"array must have at least one stop")),ye},default:function(ge){return To({key:ge.key,value:ge.value,valueSpec:n,style:ge.style,styleSpec:ge.styleSpec})}}});return u==="identity"&&q&&ae.push(new Kt(c.key,c.value,'missing required property "property"')),u==="identity"||c.value.stops||ae.push(new Kt(c.key,c.value,'missing required property "stops"')),u==="exponential"&&c.valueSpec.expression&&!nr(c.valueSpec)&&ae.push(new Kt(c.key,c.value,"exponential functions not supported")),c.styleSpec.$version>=8&&(G&&!yr(c.valueSpec)?ae.push(new Kt(c.key,c.value,"property functions not supported")):q&&!gh(c.valueSpec)&&ae.push(new Kt(c.key,c.value,"zoom functions not supported"))),u!=="categorical"&&!J||c.value.property!==void 0||ae.push(new Kt(c.key,c.value,'"property" property is required')),ae;function ce(ge){let ye=[],Ue=ge.value,Oe=ge.key;
vendor: 5,151 bytes, line 800
800if(gr(Ue)!=="array")return[new Kt(Oe,Ue,`array expected, ${gr(Ue)} found`)];if(Ue.length!==2)return[new Kt(Oe,Ue,`array length 2 expected, length ${Ue.length} found`)];if(J){if(gr(Ue[0])!=="object")return[new Kt(Oe,Ue,`object expected, ${gr(Ue[0])} found`)];if(Ue[0].zoom===void 0)return[new Kt(Oe,Ue,"object stop key must have zoom")];if(Ue[0].value===void 0)return[new Kt(Oe,Ue,"object stop key must have value")];if(k&&k>or(Ue[0].zoom))return[new Kt(Oe,Ue[0].zoom,"stop zoom values must appear in ascending order")];or(Ue[0].zoom)!==k&&(k=or(Ue[0].zoom),I=void 0,R={}),ye=ye.concat(Un({key:`${Oe}[0]`,value:Ue[0],valueSpec:{zoom:{}},style:ge.style,styleSpec:ge.styleSpec,objectElementValidators:{zoom:Lc,value:de}}))}else ye=ye.concat(de({key:`${Oe}[0]`,value:Ue[0],valueSpec:{},style:ge.style,styleSpec:ge.styleSpec},Ue));return Qs(Bn(Ue[1]))?ye.concat([new Kt(`${Oe}[1]`,Ue[1],"expressions are not allowed in function stops.")]):ye.concat(To({key:`${Oe}[1]`,value:Ue[1],valueSpec:n,style:ge.style,styleSpec:ge.styleSpec}))}function de(ge,ye){let Ue=gr(ge.value),Oe=or(ge.value),nt=ge.value!==null?ge.value:ye;if(y){if(Ue!==y)return[new Kt(ge.key,nt,`${Ue} stop domain type must match previous stop domain type ${y}`)]}else y=Ue;if(Ue!=="number"&&Ue!=="string"&&Ue!=="boolean")return[new Kt(ge.key,nt,"stop domain value must be a number, string, or boolean")];if(Ue!=="number"&&u!=="categorical"){let ut=`number expected, ${Ue} found`;return yr(n)&&u===void 0&&(ut+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Kt(ge.key,nt,ut)]}return u!=="categorical"||Ue!=="number"||isFinite(Oe)&&Math.floor(Oe)===Oe?u!=="categorical"&&Ue==="number"&&I!==void 0&&Oe<I?[new Kt(ge.key,nt,"stop domain values must appear in ascending order")]:(I=Oe,u==="categorical"&&Oe in R?[new Kt(ge.key,nt,"stop domain values must be unique")]:(R[Oe]=!0,[])):[new Kt(ge.key,nt,`integer expected, found ${Oe}`)]}}function el(c){let n=(c.expressionContext==="property"?Su:Al)(Bn(c.value),c.valueSpec);if(n.result==="error")return n.value.map((y=>new Kt(`${c.key}${y.key}`,c.value,y.message)));let u=n.value.expression||n.value._styleExpression.expression;if(c.expressionContext==="property"&&c.propertyKey==="text-font"&&!u.outputDefined())return[new Kt(c.key,c.value,`Invalid data expression for "${c.propertyKey}". Output values must be contained as literals within the expression.`)];if(c.expressionContext==="property"&&c.propertyType==="layout"&&!Ys(u))return[new Kt(c.key,c.value,'"feature-state" data expressions are not supported with layout properties.')];if(c.expressionContext==="filter"&&!Ys(u))return[new Kt(c.key,c.value,'"feature-state" data expressions are not supported with filters.')];if(c.expressionContext&&c.expressionContext.indexOf("cluster")===0){if(!hh(u,["zoom","feature-state"]))return[new Kt(c.key,c.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(c.expressionContext==="cluster-initial"&&!vl(u))return[new Kt(c.key,c.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function tl(c){let n=c.key,u=c.value,y=c.valueSpec,I=[];return Array.isArray(y.values)?y.values.indexOf(or(u))===-1&&I.push(new Kt(n,u,`expected one of [${y.values.join(", ")}], ${JSON.stringify(u)} found`)):Object.keys(y.values).indexOf(or(u))===-1&&I.push(new Kt(n,u,`expected one of [${Object.keys(y.values).join(", ")}], ${JSON.stringify(u)} found`)),I}function Ll(c){if(c===!0||c===!1)return!0;if(!Array.isArray(c)||c.length===0)return!1;switch(c[0]){case"has":return c.length>=2&&c[1]!=="$id"&&c[1]!=="$type";case"in":return c.length>=3&&(typeof c[1]!="string"||Array.isArray(c[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return c.length!==3||Array.isArray(c[1])||Array.isArray(c[2]);case"any":case"all":for(let n of c.slice(1))if(!Ll(n)&&typeof n!="boolean")return!1;return!0;default:return!0}}let Cu={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Rc(c){if(c==null)return{filter:()=>!0,needGeometry:!1};Ll(c)||(c=Rl(c));let n=Al(c,Cu);if(n.result==="error")throw new Error(n.value.map((u=>`${u.key}: ${u.message}`)).join(", "));return{filter:(u,y,I)=>n.value.evaluate(u,y,{},I),needGeometry:il(c)}}function Qh(c,n){return c<n?-1:c>n?1:0}function il(c){if(!Array.isArray(c))return!1;if(c[0]==="within")return!0;for(let n=1;n<c.length;n++)if(il(c[n]))return!0;return!1}function Rl(c){if(!c)return!0;let n=c[0];return c.length<=1?n!=="any":n==="=="?Fc(c[1],c[2],"=="):n==="!="?zs(Fc(c[1],c[2],"==")):n==="<"||n===">"||n==="<="||n===">="?Fc(c[1],c[2],n):n==="any"?(u=c.slice(1),["any"].concat(u.map(Rl))):n==="all"?["all"].concat(c.slice(1).map(Rl)):n==="none"?["all"].concat(c.slice(1).map(Rl).map(zs)):n==="in"?As(c[1],c.slice(2)):n==="!in"?zs(As(c[1],c.slice(2))):n==="has"?Bc(c[1]):n==="!has"?zs(Bc(c[1])):n!=="within"||c;var u}function Fc(c,n,u){switch(c){case"$type":return[`filter-type-${u}`,n];case"$id":return[`filter-id-${u}`,n];default:return[`filter-${u}`,c,n]}}
800function As(c,n){if(n.length===0)return!1;switch(c){case"$type":return["filter-type-in",["literal",n]];case"$id":return["filter-id-in",["literal",n]];default:return n.length>200&&!n.some((u=>typeof u!=typeof n[0]))?["filter-in-large",c,["literal",n.sort(Qh)]]:["filter-in-small",c,["literal",n]]}}function Bc(c){switch(c){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",c]}}function zs(c){return["!",c]}function Oc(c){return Ll(Bn(c.value))?el(xa({},c,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Eu(c)}function Eu(c){let n=c.value,u=c.key;if(gr(n)!=="array")return[new Kt(u,n,`array expected, ${gr(n)} found`)];let y=c.styleSpec,I,k=[];if(n.length<1)return[new Kt(u,n,"filter array must have at least 1 element")];switch(k=k.concat(tl({key:`${u}[0]`,value:n[0],valueSpec:y.filter_operator,style:c.style,styleSpec:c.styleSpec})),or(n[0])){case"<":case"<=":case">":case">=":n.length>=2&&or(n[1])==="$type"&&k.push(new Kt(u,n,`"$type" cannot be use with operator "${n[0]}"`));case"==":case"!=":n.length!==3&&k.push(new Kt(u,n,`filter array for operator "${n[0]}" must have 3 elements`));case"in":case"!in":n.length>=2&&(I=gr(n[1]),I!=="string"&&k.push(new Kt(`${u}[1]`,n[1],`string expected, ${I} found`)));for(let R=2;R<n.length;R++)I=gr(n[R]),or(n[1])==="$type"?k=k.concat(tl({key:`${u}[${R}]`,value:n[R],valueSpec:y.geometry_type,style:c.style,styleSpec:c.styleSpec})):I!=="string"&&I!=="number"&&I!=="boolean"&&k.push(new Kt(`${u}[${R}]`,n[R],`string, number, or boolean expected, ${I} found`));break;case"any":case"all":case"none":for(let R=1;R<n.length;R++)k=k.concat(Eu({key:`${u}[${R}]`,value:n[R],style:c.style,styleSpec:c.styleSpec}));break;case"has":case"!has":I=gr(n[1]),n.length!==2?k.push(new Kt(u,n,`filter array for "${n[0]}" operator must have 2 elements`)):I!=="string"&&k.push(new Kt(`${u}[1]`,n[1],`string expected, ${I} found`));break;case"within":I=gr(n[1]),n.length!==2?k.push(new Kt(u,n,`filter array for "${n[0]}" operator must have 2 elements`)):I!=="object"&&k.push(new Kt(`${u}[1]`,n[1],`object expected, ${I} found`))}return k}function Ds(c,n){let u=c.key,y=c.style,I=c.styleSpec,k=c.value,R=c.objectKey,q=I[`${n}_${c.layerType}`];if(!q)return[];let G=R.match(/^(.*)-transition$/);if(n==="paint"&&G&&q[G[1]]&&q[G[1]].transition)return To({key:u,value:k,valueSpec:I.transition,style:y,styleSpec:I});let J=c.valueSpec||q[R];if(!J)return[new Kt(u,k,`unknown property "${R}"`)];let ae;if(gr(k)==="string"&&yr(J)&&!J.tokens&&(ae=/^{([^}]+)}$/.exec(k)))return[new Kt(u,k,`"${R}" does not support interpolation syntax 801Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(ae[1])} }\`.`)];let ce=[];return c.layerType==="symbol"&&(R==="text-field"&&y&&!y.glyphs&&ce.push(new Kt(u,k,'use of "text-field" requires a style "glyphs" property')),R==="text-font"&&xr(Bn(k))&&or(k.type)==="identity"&&ce.push(new Kt(u,k,'"text-font" does not support identity functions'))),ce.concat(To({key:c.key,value:k,valueSpec:J,style:y,styleSpec:I,expressionContext:"property",propertyType:n,propertyKey:R}))}function eu(c){return Ds(c,"paint")}function tu(c){return Ds(c,"layout")}function xh(c){let n=[],u=c.value,y=c.key,I=c.style,k=c.styleSpec;u.type||u.ref||n.push(new Kt(y,u,'either "type" or "ref" is required'));let R=or(u.type),q=or(u.ref);if(u.id){let G=or(u.id);for(let J=0;J<c.arrayIndex;J++){let ae=I.layers[J];or(ae.id)===G&&n.push(new Kt(y,u.id,`duplicate layer id "${u.id}", previously used at line ${ae.id.__line__}`))}}if("ref"in u){let G;["type","source","source-layer","filter","layout"].forEach((J=>{J in u&&n.push(new Kt(y,u[J],`"${J}" is prohibited for ref layers`))})),I.layers.forEach((J=>{or(J.id)===q&&(G=J)})),G?G.ref?n.push(new Kt(y,u.ref,"ref cannot reference another ref layer")):R=or(G.type):n.push(new Kt(y,u.ref,`ref layer "${q}" not found`))}else if(R!=="background")if(u.source){let G=I.sources&&I.sources[u.source],J=G&&or(G.type);G?J==="vector"&&R==="raster"?n.push(new Kt(y,u.source,`layer "${u.id}" requires a raster source`)):J==="raster"&&R!=="raster"?n.push(new Kt(y,u.source,`layer "${u.id}" requires a vector source`)):J!=="vector"||u["source-layer"]?J==="raster-dem"&&R!=="hillshade"?n.push(new Kt(y,u.source,"raster-dem source can only be used with layer type 'hillshade'.")):R!=="line"||!u.paint||!u.paint["line-gradient"]||J==="geojson"&&G.lineMetrics||n.push(new Kt(y,u,`layer "${u.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):n.push(new Kt(y,u,`layer "${u.id}" must specify a "source-layer"`)):n.push(new Kt(y,u.source,`source "${u.source}" not found`))}else n.push(new Kt(y,u,'missing required property "source"'));return n=n.concat(Un({key:y,value:u,valueSpec:k.layer,style:c.style,styleSpec:c.styleSpec,objectElementValidators:{"*":()=>[],type:()=>To({key:`${y}.type`,value:u.type,valueSpec:k.layer.type,style:c.style,styleSpec:c.styleSpec,object:u,objectKey:"type"}),filter:Oc,layout:G=>Un({layer:u,key:G.key,value:G.value,style:G.style,styleSpec:G.styleSpec,objectElementValidators:{"*":J=>tu(xa({layerType:R},J))}}),paint:G=>Un({layer:u,key:G.key,value:G.value,style:G.style,styleSpec:G.styleSpec,objectElementValidators:{"*":J=>eu(xa({layerType:R},J))}})}})),n}function Fl(c){let n=c.value,u=c.key,y=gr(n);return y!=="string"?[new Kt(u,n,`string expected, ${y} found`)]:[]}let Bl={promoteId:function({key:c,value:n}
801){if(gr(n)==="string")return Fl({key:c,value:n});{let u=[];for(let y in n)u.push(...Fl({key:`${c}.${y}`,value:n[y]}));return u}}};function Vo(c){let n=c.value,u=c.key,y=c.styleSpec,I=c.style;if(!n.type)return[new Kt(u,n,'"type" is required')];let k=or(n.type),R;switch(k){case"vector":case"raster":case"raster-dem":return R=Un({key:u,value:n,valueSpec:y[`source_${k.replace("-","_")}`],style:c.style,styleSpec:y,objectElementValidators:Bl}),R;case"geojson":if(R=Un({key:u,value:n,valueSpec:y.source_geojson,style:I,styleSpec:y,objectElementValidators:Bl}),n.cluster)for(let q in n.clusterProperties){let[G,J]=n.clusterProperties[q],ae=typeof G=="string"?[G,["accumulated"],["get",q]]:G;R.push(...el({key:`${u}.${q}.map`,value:J,expressionContext:"cluster-map"})),R.push(...el({key:`${u}.${q}.reduce`,value:ae,expressionContext:"cluster-reduce"}))}return R;case"video":return Un({key:u,value:n,valueSpec:y.source_video,style:I,styleSpec:y});case"image":return Un({key:u,value:n,valueSpec:y.source_image,style:I,styleSpec:y});case"canvas":return[new Kt(u,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return tl({key:`${u}.type`,value:n.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:I,styleSpec:y})}}function Ol(c){let n=c.value,u=c.styleSpec,y=u.light,I=c.style,k=[],R=gr(n);if(n===void 0)return k;if(R!=="object")return k=k.concat([new Kt("light",n,`object expected, ${R} found`)]),k;for(let q in n){let G=q.match(/^(.*)-transition$/);k=k.concat(G&&y[G[1]]&&y[G[1]].transition?To({key:q,value:n[q],valueSpec:u.transition,style:I,styleSpec:u}):y[q]?To({key:q,value:n[q],valueSpec:y[q],style:I,styleSpec:u}):[new Kt(q,n[q],`unknown property "${q}"`)])}return k}function wo(c){let n=c.value,u=c.styleSpec,y=u.terrain,I=c.style,k=[],R=gr(n);if(n===void 0)return k;if(R!=="object")return k=k.concat([new Kt("terrain",n,`object expected, ${R} found`)]),k;for(let q in n)k=k.concat(y[q]?To({key:q,value:n[q],valueSpec:y[q],style:I,styleSpec:u}):[new Kt(q,n[q],`unknown property "${q}"`)]);return k}let rl={"*":()=>[],array:Iu,boolean:function(c){let n=c.value,u=c.key,y=gr(n);return y!=="boolean"?[new Kt(u,n,`boolean expected, ${y} found`)]:[]},number:Lc,color:function(c){let n=c.key,u=c.value,y=gr(u);return y!=="string"?[new Kt(n,u,`color expected, ${y} found`)]:Ql(u)===null?[new Kt(n,u,`color expected, "${u}" found`)]:[]},constants:Ua,enum:tl,filter:Oc,function:Jh,layer:xh,object:Un,source:Vo,light:Ol,terrain:wo,string:Fl,formatted:function(c){return Fl(c).length===0?[]:el(c)},resolvedImage:function(c){return Fl(c).length===0?[]:el(c)},padding:function(c){let n=c.key,u=c.value;if(gr(u)==="array"){if(u.length<1||u.length>4)return[new Kt(n,u,`padding requires 1 to 4 values; ${u.length} values found`)];let y={type:"number"},I=[];for(let k=0;k<u.length;k++)I=I.concat(To({key:`${n}[${k}]`,value:u[k],valueSpec:y}));return I}return Lc({key:n,value:u,valueSpec:{}})}};function To(c){let n=c.value,u=c.valueSpec,y=c.styleSpec;return u.expression&&xr(or(n))?Jh(c):u.expression&&Qs(Bn(n))?el(c):u.type&&rl[u.type]?rl[u.type](c):Un(xa({},c,{valueSpec:u.type?y[u.type]:u}))}function iu(c){let n=c.value,u=c.key,y=Fl(c);return y.length||(n.indexOf("{fontstack}")===-1&&y.push(new Kt(u,n,'"glyphs" url must include a "{fontstack}" token')),n.indexOf("{range}")===-1&&y.push(new Kt(u,n,'"glyphs" url must include a "{range}" token'))),y}function No(c,n=St){let u=[];return u=u.concat(To({key:"",value:c,valueSpec:n.$root,styleSpec:n,style:c,objectElementValidators:{glyphs:iu,"*":()=>[]}})),c.constants&&(u=u.concat(Ua({key:"constants",value:c.constants,style:c,styleSpec:n}))),vh(u)}function vh(c){return[].concat(c).sort(((n,u)=>n.line-u.line))}function us(c){return function(...n){return vh(c.apply(this,n))}}No.source=us(Vo),No.light=us(Ol),No.terrain=us(wo),No.layer=us(xh),No.filter=us(Oc),No.paintProperty=us(eu),No.layoutProperty=us(tu);let Vc=No,ru=Vc.light,Ip=Vc.paintProperty,Mu=Vc.layoutProperty;function dr(c,n){let u=!1;if(n&&n.length)for(let y of n)c.fire(new ya(new Error(y.message))),u=!0;return u}class oc{constructor(n,u,y){let I=this.cells=[];if(n instanceof ArrayBuffer){this.arrayBuffer=n;let R=new Int32Array(this.arrayBuffer);n=R[0],this.d=(u=R[1])+2*(y=R[2]);for(let G=0;G<this.d*this.d;G++){let J=R[3+G],ae=R[3+G+1];I.push(J===ae?null:R.subarray(J,ae))}let q=R[3+I.length+1];this.keys=R.subarray(R[3+I.length],q),this.bboxes=R.subarray(q),this.insert=this._insertReadonly}else{this.d=u+2*y;for(let R=0;R<this.d*this.d;R++)I.push([]);this.keys=[],this.bboxes=[]}this.n=u,this.extent=n,this.padding=y,this.scale=u/n,this.uid=0;let k=y/u*n;this.min=-k,this.max=n+k}
801insert(n,u,y,I,k){this._forEachCell(u,y,I,k,this._insertCell,this.uid++,void 0,void 0),this.keys.push(n),this.bboxes.push(u),this.bboxes.push(y),this.bboxes.push(I),this.bboxes.push(k)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(n,u,y,I,k,R){this.cells[k].push(R)}query(n,u,y,I,k){let R=this.min,q=this.max;if(n<=R&&u<=R&&q<=y&&q<=I&&!k)return Array.prototype.slice.call(this.keys);{let G=[];return this._forEachCell(n,u,y,I,this._queryCell,G,{},k),G}}_queryCell(n,u,y,I,k,R,q,G){let J=this.cells[k];if(J!==null){let ae=this.keys,ce=this.bboxes;for(let de=0;de<J.length;de++){let ge=J[de];if(q[ge]===void 0){let ye=4*ge;(G?G(ce[ye+0],ce[ye+1],ce[ye+2],ce[ye+3]):n<=ce[ye+2]&&u<=ce[ye+3]&&y>=ce[ye+0]&&I>=ce[ye+1])?(q[ge]=!0,R.push(ae[ge])):q[ge]=!1}}}}_forEachCell(n,u,y,I,k,R,q,G){let J=this._convertToCellCoord(n),ae=this._convertToCellCoord(u),ce=this._convertToCellCoord(y),de=this._convertToCellCoord(I);for(let ge=J;ge<=ce;ge++)for(let ye=ae;ye<=de;ye++){let Ue=this.d*ye+ge;if((!G||G(this._convertFromCellCoord(ge),this._convertFromCellCoord(ye),this._convertFromCellCoord(ge+1),this._convertFromCellCoord(ye+1)))&&k.call(this,n,u,y,I,Ue,R,q,G))return}}_convertFromCellCoord(n){return(n-this.padding)/this.scale}_convertToCellCoord(n){return Math.max(0,Math.min(this.d-1,Math.floor(n*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let n=this.cells,u=3+this.cells.length+1+1,y=0;for(let R=0;R<this.cells.length;R++)y+=this.cells[R].length;let I=new Int32Array(u+y+this.keys.length+this.bboxes.length);I[0]=this.extent,I[1]=this.n,I[2]=this.padding;let k=u;for(let R=0;R<n.length;R++){let q=n[R];I[3+R]=k,I.set(q,k),k+=q.length}return I[3+n.length]=k,I.set(this.keys,k),k+=this.keys.length,I[3+n.length+1]=k,I.set(this.bboxes,k),k+=this.bboxes.length,I.buffer}static serialize(n,u){let y=n.toArrayBuffer();return u&&u.push(y),{buffer:y}}static deserialize(n){return new oc(n.buffer)}}let Sa={};function ui(c,n,u={}){if(Sa[c])throw new Error(`${c} is already registered.`);Object.defineProperty(n,"_classRegistryKey",{value:c,writeable:!1}),Sa[c]={klass:n,omit:u.omit||[],shallow:u.shallow||[]}}ui("Object",Object),ui("TransferableGridIndex",oc),ui("Color",ve),ui("Error",Error),ui("AJAXError",Ti),ui("ResolvedImage",Ge),ui("StylePropertyFunction",Dl),ui("StyleExpression",Oo,{omit:["_evaluator"]}),ui("ZoomDependentExpression",zl),ui("ZoomConstantExpression",Ga),ui("CompoundExpression",Fi,{omit:["_evaluate"]});for(let c in El)El[c]._classRegistryKey||ui(`Expression_${c}`,El[c]);function Nc(c){return c&&typeof ArrayBuffer<"u"&&(c instanceof ArrayBuffer||c.constructor&&c.constructor.name==="ArrayBuffer")}function Ls(c,n){if(c==null||typeof c=="boolean"||typeof c=="number"||typeof c=="string"||c instanceof Boolean||c instanceof Number||c instanceof String||c instanceof Date||c instanceof RegExp||c instanceof Blob)return c;if(Nc(c)||Si(c))return n&&n.push(c),c;if(ArrayBuffer.isView(c)){let u=c;return n&&n.push(u.buffer),u}if(c instanceof ImageData)return n&&n.push(c.data.buffer),c;if(Array.isArray(c)){let u=[];for(let y of c)u.push(Ls(y,n));return u}if(typeof c=="object"){let u=c.constructor,y=u._classRegistryKey;if(!y)throw new Error("can't serialize object of unregistered class");if(!Sa[y])throw new Error(`${y} is not registered.`);let I=u.serialize?u.serialize(c,n):{};if(u.serialize){if(n&&I===n[n.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(let k in c){if(!c.hasOwnProperty(k)||Sa[y].omit.indexOf(k)>=0)continue;let R=c[k];I[k]=Sa[y].shallow.indexOf(k)>=0?R:Ls(R,n)}c instanceof Error&&(I.message=c.message)}if(I.$name)throw new Error("$name property is reserved for worker serialization logic.");return y!=="Object"&&(I.$name=y),I}throw new Error("can't serialize object of type "+typeof c)}function Uo(c){if(c==null||typeof c=="boolean"||typeof c=="number"||typeof c=="string"||c instanceof Boolean||c instanceof Number||c instanceof String||c instanceof Date||c instanceof RegExp||c instanceof Blob||Nc(c)||Si(c)||ArrayBuffer.isView(c)||c instanceof ImageData)return c;if(Array.isArray(c))return c.map(Uo);if(typeof c=="object"){let n=c.$name||"Object";if(!Sa[n])throw new Error(`can't deserialize unregistered class ${n}`);let{klass:u}=Sa[n];if(!u)throw new Error(`can't deserialize unregistered class ${n}`);if(u.deserialize)return u.deserialize(c);let y=Object.create(u.prototype);
801for(let I of Object.keys(c)){if(I==="$name")continue;let k=c[I];y[I]=Sa[n].shallow.indexOf(I)>=0?k:Uo(k)}return y}throw new Error("can't deserialize object of type "+typeof c)}class Vl{constructor(){this.first=!0}update(n,u){let y=Math.floor(n);return this.first?(this.first=!1,this.lastIntegerZoom=y,this.lastIntegerZoomTime=0,this.lastZoom=n,this.lastFloorZoom=y,!0):(this.lastFloorZoom>y?(this.lastIntegerZoom=y+1,this.lastIntegerZoomTime=u):this.lastFloorZoom<y&&(this.lastIntegerZoom=y,this.lastIntegerZoomTime=u),n!==this.lastZoom&&(this.lastZoom=n,this.lastFloorZoom=y,!0))}}let Yt={"Latin-1 Supplement":c=>c>=128&&c<=255,Arabic:c=>c>=1536&&c<=1791,"Arabic Supplement":c=>c>=1872&&c<=1919,"Arabic Extended-A":c=>c>=2208&&c<=2303,"Hangul Jamo":c=>c>=4352&&c<=4607,"Unified Canadian Aboriginal Syllabics":c=>c>=5120&&c<=5759,Khmer:c=>c>=6016&&c<=6143,"Unified Canadian Aboriginal Syllabics Extended":c=>c>=6320&&c<=6399,"General Punctuation":c=>c>=8192&&c<=8303,"Letterlike Symbols":c=>c>=8448&&c<=8527,"Number Forms":c=>c>=8528&&c<=8591,"Miscellaneous Technical":c=>c>=8960&&c<=9215,"Control Pictures":c=>c>=9216&&c<=9279,"Optical Character Recognition":c=>c>=9280&&c<=9311,"Enclosed Alphanumerics":c=>c>=9312&&c<=9471,"Geometric Shapes":c=>c>=9632&&c<=9727,"Miscellaneous Symbols":c=>c>=9728&&c<=9983,"Miscellaneous Symbols and Arrows":c=>c>=11008&&c<=11263,"CJK Radicals Supplement":c=>c>=11904&&c<=12031,"Kangxi Radicals":c=>c>=12032&&c<=12255,"Ideographic Description Characters":c=>c>=12272&&c<=12287,"CJK Symbols and Punctuation":c=>c>=12288&&c<=12351,Hiragana:c=>c>=12352&&c<=12447,Katakana:c=>c>=12448&&c<=12543,Bopomofo:c=>c>=12544&&c<=12591,"Hangul Compatibility Jamo":c=>c>=12592&&c<=12687,Kanbun:c=>c>=12688&&c<=12703,"Bopomofo Extended":c=>c>=12704&&c<=12735,"CJK Strokes":c=>c>=12736&&c<=12783,"Katakana Phonetic Extensions":c=>c>=12784&&c<=12799,"Enclosed CJK Letters and Months":c=>c>=12800&&c<=13055,"CJK Compatibility":c=>c>=13056&&c<=13311,"CJK Unified Ideographs Extension A":c=>c>=13312&&c<=19903,"Yijing Hexagram Symbols":c=>c>=19904&&c<=19967,"CJK Unified Ideographs":c=>c>=19968&&c<=40959,"Yi Syllables":c=>c>=40960&&c<=42127,"Yi Radicals":c=>c>=42128&&c<=42191,"Hangul Jamo Extended-A":c=>c>=43360&&c<=43391,"Hangul Syllables":c=>c>=44032&&c<=55215,"Hangul Jamo Extended-B":c=>c>=55216&&c<=55295,"Private Use Area":c=>c>=57344&&c<=63743,"CJK Compatibility Ideographs":c=>c>=63744&&c<=64255,"Arabic Presentation Forms-A":c=>c>=64336&&c<=65023,"Vertical Forms":c=>c>=65040&&c<=65055,"CJK Compatibility Forms":c=>c>=65072&&c<=65103,"Small Form Variants":c=>c>=65104&&c<=65135,"Arabic Presentation Forms-B":c=>c>=65136&&c<=65279,"Halfwidth and Fullwidth Forms":c=>c>=65280&&c<=65519};function So(c){for(let n of c)if(Uc(n.charCodeAt(0)))return!0;return!1}function Pu(c){for(let n of c)if(!bh(n.charCodeAt(0)))return!1;return!0}function bh(c){return!(Yt.Arabic(c)||Yt["Arabic Supplement"](c)||Yt["Arabic Extended-A"](c)||Yt["Arabic Presentation Forms-A"](c)||Yt["Arabic Presentation Forms-B"](c))}function Uc(c){return!(c!==746&&c!==747&&(c<4352||!(Yt["Bopomofo Extended"](c)||Yt.Bopomofo(c)||Yt["CJK Compatibility Forms"](c)&&!(c>=65097&&c<=65103)||Yt["CJK Compatibility Ideographs"](c)||Yt["CJK Compatibility"](c)||Yt["CJK Radicals Supplement"](c)||Yt["CJK Strokes"](c)||!(!Yt["CJK Symbols and Punctuation"](c)||c>=12296&&c<=12305||c>=12308&&c<=12319||c===12336)||Yt["CJK Unified Ideographs Extension A"](c)||Yt["CJK Unified Ideographs"](c)||Yt["Enclosed CJK Letters and Months"](c)||Yt["Hangul Compatibility Jamo"](c)||Yt["Hangul Jamo Extended-A"](c)||Yt["Hangul Jamo Extended-B"](c)||Yt["Hangul Jamo"](c)||Yt["Hangul Syllables"](c)||Yt.Hiragana(c)||Yt["Ideographic Description Characters"](c)||Yt.Kanbun(c)||Yt["Kangxi Radicals"](c)||Yt["Katakana Phonetic Extensions"](c)||Yt.Katakana(c)&&c!==12540||!(!Yt["Halfwidth and Fullwidth Forms"](c)||c===65288||c===6
8015289||c===65293||c>=65306&&c<=65310||c===65339||c===65341||c===65343||c>=65371&&c<=65503||c===65507||c>=65512&&c<=65519)||!(!Yt["Small Form Variants"](c)||c>=65112&&c<=65118||c>=65123&&c<=65126)||Yt["Unified Canadian Aboriginal Syllabics"](c)||Yt["Unified Canadian Aboriginal Syllabics Extended"](c)||Yt["Vertical Forms"](c)||Yt["Yijing Hexagram Symbols"](c)||Yt["Yi Syllables"](c)||Yt["Yi Radicals"](c))))}function nl(c){return!(Uc(c)||(function(n){return!!(Yt["Latin-1 Supplement"](n)&&(n===167||n===169||n===174||n===177||n===188||n===189||n===190||n===215||n===247)||Yt["General Punctuation"](n)&&(n===8214||n===8224||n===8225||n===8240||n===8241||n===8251||n===8252||n===8258||n===8263||n===8264||n===8265||n===8273)||Yt["Letterlike Symbols"](n)||Yt["Number Forms"](n)||Yt["Miscellaneous Technical"](n)&&(n>=8960&&n<=8967||n>=8972&&n<=8991||n>=8996&&n<=9e3||n===9003||n>=9085&&n<=9114||n>=9150&&n<=9165||n===9167||n>=9169&&n<=9179||n>=9186&&n<=9215)||Yt["Control Pictures"](n)&&n!==9251||Yt["Optical Character Recognition"](n)||Yt["Enclosed Alphanumerics"](n)||Yt["Geometric Shapes"](n)||Yt["Miscellaneous Symbols"](n)&&!(n>=9754&&n<=9759)||Yt["Miscellaneous Symbols and Arrows"](n)&&(n>=11026&&n<=11055||n>=11088&&n<=11097||n>=11192&&n<=11243)||Yt["CJK Symbols and Punctuation"](n)||Yt.Katakana(n)||Yt["Private Use Area"](n)||Yt["CJK Compatibility Forms"](n)||Yt["Small Form Variants"](n)||Yt["Halfwidth and Fullwidth Forms"](n)||n===8734||n===8756||n===8757||n>=9984&&n<=10087||n>=10102&&n<=10131||n===65532||n===65533)})(c))}function jc(c){return c>=1424&&c<=2303||Yt["Arabic Presentation Forms-A"](c)||Yt["Arabic Presentation Forms-B"](c)}function wh(c,n){return!(!n&&jc(c)||c>=2304&&c<=3583||c>=3840&&c<=4255||Yt.Khmer(c))}function ac(c){for(let n of c)if(jc(n.charCodeAt(0)))return!0;return!1}let sc="deferred",Th="loading",ol="loaded",al=null,Io="unavailable",ps=null,Ji=function(c){c&&typeof c=="string"&&c.indexOf("NetworkError")>-1&&(Io="error"),al&&al(c)};function Rs(){nu.fire(new oo("pluginStateChange",{pluginStatus:Io,pluginURL:ps}))}let nu=new Na,lc=function(){return Io},cc=function(){if(Io!==sc||!ps)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Io=Th,Rs(),ps&&on({url:ps},(c=>{c?Ji(c):(Io=ol,Rs())}))},Ia={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>Io===ol||Ia.applyArabicShaping!=null,isLoading:()=>Io===Th,setState(c){if(!ci())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");Io=c.pluginStatus,ps=c.pluginURL},isParsed(){if(!ci())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return Ia.applyArabicShaping!=null&&Ia.processBidirectionalText!=null&&Ia.processStyledBidirectionalText!=null},getPluginURL(){if(!ci())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return ps}};class Nr{constructor(n,u){this.zoom=n,u?(this.now=u.now,this.fadeDuration=u.fadeDuration,this.zoomHistory=u.zoomHistory,this.transition=u.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Vl,this.transition={})}isSupportedScript(n){return(function(u,y){for(let I of u)if(!wh(I.charCodeAt(0),y))return!1;return!0})(n,Ia.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let n=this.zoom,u=n-Math.floor(n),y=this.crossFadingFactor();return n>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:u+(1-u)*y}:{fromScale:.5,toScale:1,t:1-(1-y)*u}}}class hc{constructor(n,u){this.property=n,this.value=u,this.expression=(function(y,I){if(xr(y))return new Dl(y,I);if(Qs(y)){let k=Su(y,I);if(k.result==="error")throw new Error(k.value.map((R=>`${R.key}: ${R.message}`)).join(", "));return k.value}{let k=y;return I.type==="color"&&typeof y=="string"?k=ve.parse(y):I.type!=="padding"||typeof y!="number"&&!Array.isArray(y)||(k=ke.parse(y)),{kind:"constant",evaluate:()=>k}}})(u===void 0?n.specification.default:u,n.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}
801possiblyEvaluate(n,u,y){return this.property.possiblyEvaluate(this,n,u,y)}}class Sh{constructor(n){this.property=n,this.value=new hc(n,void 0)}transitioned(n,u){return new qc(this.property,this.value,u,Ct({},n.transition,this.transition),n.now)}untransitioned(){return new qc(this.property,this.value,null,{},0)}}class uc{constructor(n){this._properties=n,this._values=Object.create(n.defaultTransitionablePropertyValues)}getValue(n){return Ut(this._values[n].value.value)}setValue(n,u){Object.prototype.hasOwnProperty.call(this._values,n)||(this._values[n]=new Sh(this._values[n].property)),this._values[n].value=new hc(this._values[n].property,u===null?void 0:Ut(u))}getTransition(n){return Ut(this._values[n].transition)}setTransition(n,u){Object.prototype.hasOwnProperty.call(this._values,n)||(this._values[n]=new Sh(this._values[n].property)),this._values[n].transition=Ut(u)||void 0}serialize(){let n={};for(let u of Object.keys(this._values)){let y=this.getValue(u);y!==void 0&&(n[u]=y);let I=this.getTransition(u);I!==void 0&&(n[`${u}-transition`]=I)}return n}transitioned(n,u){let y=new pc(this._properties);for(let I of Object.keys(this._values))y._values[I]=this._values[I].transitioned(n,u._values[I]);return y}untransitioned(){let n=new pc(this._properties);for(let u of Object.keys(this._values))n._values[u]=this._values[u].untransitioned();return n}}class qc{constructor(n,u,y,I,k){this.property=n,this.value=u,this.begin=k+I.delay||0,this.end=this.begin+I.duration||0,n.specification.transition&&(I.delay||I.duration)&&(this.prior=y)}possiblyEvaluate(n,u,y){let I=n.now||0,k=this.value.possiblyEvaluate(n,u,y),R=this.prior;if(R){if(I>this.end)return this.prior=null,k;if(this.value.isDataDriven())return this.prior=null,k;if(I<this.begin)return R.possiblyEvaluate(n,u,y);{let q=(I-this.begin)/(this.end-this.begin);return this.property.interpolate(R.possiblyEvaluate(n,u,y),k,(function(G){if(G<=0)return 0;if(G>=1)return 1;let J=G*G,ae=J*G;return 4*(G<.5?ae:3*(G-J)+ae-.75)})(q))}}return k}}class pc{constructor(n){this._properties=n,this._values=Object.create(n.defaultTransitioningPropertyValues)}possiblyEvaluate(n,u,y){let I=new dc(this._properties);for(let k of Object.keys(this._values))I._values[k]=this._values[k].possiblyEvaluate(n,u,y);return I}hasTransition(){for(let n of Object.keys(this._values))if(this._values[n].prior)return!0;return!1}}class Ih{constructor(n){this._properties=n,this._values=Object.create(n.defaultPropertyValues)}getValue(n){return Ut(this._values[n].value)}setValue(n,u){this._values[n]=new hc(this._values[n].property,u===null?void 0:Ut(u))}serialize(){let n={};for(let u of Object.keys(this._values)){let y=this.getValue(u);y!==void 0&&(n[u]=y)}return n}possiblyEvaluate(n,u,y){let I=new dc(this._properties);for(let k of Object.keys(this._values))I._values[k]=this._values[k].possiblyEvaluate(n,u,y);return I}}class ra{constructor(n,u,y){this.property=n,this.value=u,this.parameters=y}isConstant(){return this.value.kind==="constant"}constantOr(n){return this.value.kind==="constant"?this.value.value:n}evaluate(n,u,y,I){return this.property.evaluate(this.value,this.parameters,n,u,y,I)}}class dc{constructor(n){this._properties=n,this._values=Object.create(n.defaultPossiblyEvaluatedValues)}get(n){return this._values[n]}}class xi{constructor(n){this.specification=n}possiblyEvaluate(n,u){if(n.isDataDriven())throw new Error("Value should not be data driven");return n.expression.evaluate(u)}interpolate(n,u,y){let I=ba[this.specification.type];return I?I(n,u,y):n}}class Pi{constructor(n,u){this.specification=n,this.overrides=u}possiblyEvaluate(n,u,y,I){return new ra(this,n.expression.kind==="constant"||n.expression.kind==="camera"?{kind:"constant",value:n.expression.evaluate(u,null,{},y,I)}:n.expression,u)}interpolate(n,u,y){if(n.value.kind!=="constant"||u.value.kind!=="constant")return n;if(n.value.value===void 0||u.value.value===void 0)return new ra(this,{kind:"constant",value:void 0},n.parameters);let I=ba[this.specification.type];return I?new ra(this,{kind:"constant",value:I(n.value.value,u.value.value,y)},n.parameters):n}evaluate(n,u,y,I,k,R){return n.kind==="constant"?n.value:n.evaluate(u,y,I,k,R)}}class Za extends Pi{possiblyEvaluate(n,u,y,I){if(n.value===void 0)return new ra(this,{kind:"constant",value:void 0},u);if(n.expression.kind==="constant"){let k=n.expression.evaluate(u,null,{},y,I),R=n.property.specification.type==="resolvedImage"&&typeof k!="string"?k.name:k,q=this._calculate(R,R,R,u);return new ra(this,{kind:"constant",value:q},u)}if(n.expression.kind==="camera"){let k=this._calculate(n.expression.evaluate({zoom:u.zoom-1}),n.expression.evaluate({zoom:u.zoom}),n.expression.evaluate({zoom:u.zoom+1}),u);return new ra(this,{kind:"constant",value:k},u)}return new ra(this,n.expression,u)}evaluate(n,u,y,I,k,R){if(n.kind==="source"){let q=n.evaluate(u,y,I,k,R);return this._calculate(q,q,q,u)}return n.kind==="composite"?this._calculate(n.evaluate({zoom:Math.floor(u.zoom)-1},y,I),n.evaluate({zoom:Math.floor(u.zoom)},y,I),n.evaluate({zoom:Math.floor(u.zoom)+1},y,I),u):n.value}_calculate(n,u,y,I){return I.zoom>I.zoomHistory.lastIntegerZoom?{from:n,to:u}:{from:y,to:u}}interpolate(n){return n}}class sl{constructor(n){this.specification=n}possiblyEvaluate(n,u,y,I){if(n.value!==void 0){if(n.expression.kind==="constant"){let k=n.expression.evaluate(u,null,{},y,I);return this._calculate(k,k,k,u)}return this._calculate(n.expression.evaluate(new Nr(Math.floor(u.zoom-1),u)),n.expression.evaluate(new Nr(Math.floor(u.zoom),u)),n.expression.evaluate(new Nr(Math.floor(u.zoom+1),u)),u)}}_calculate(n,u,y,I){return I.zoom>I.zoomHistory.lastIntegerZoom?{from:n,to:u}:{from:y,to:u}}interpolate(n){return n}}class ds{constructor(n){this.specification=n}possiblyEvaluate(n,u,y,I){return!!n.expression.evaluate(u,null,{},y,I)}interpolate(){return!1}}class io{constructor(n){this.properties=n,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let u in n){let y=n[u];y.specification.overridable&&this.overridableProperties.push(u);let I=this.defaultPropertyValues[u]=new hc(y,void 0),k=this.defaultTransitionablePropertyValues[u]=new Sh(y);this.defaultTransitioningPropertyValues[u]=k.untransitioned(),this.defaultPossiblyEvaluatedValues[u]=I.possiblyEvaluate({})}}}ui("DataDrivenProperty",Pi),ui("DataConstantProperty",xi),ui("CrossFadedDataDrivenProperty",Za),ui("CrossFadedProperty",sl),ui("ColorRampProperty",ds);let Ca="-transition";class ms extends Na{constructor(n,u){if(super(),this.id=n.id,this.type=n.type,this._featureFilter={filter:()=>!0,needGeometry:!1},n.type!=="custom"&&(this.metadata=n.metadata,this.minzoom=n.minzoom,this.maxzoom=n.maxzoom,n.type!=="background"&&(this.source=n.source,this.sourceLayer=n["source-layer"],this.filter=n.filter),u.layout&&(this._unevaluatedLayout=new Ih(u.layout)),u.paint)){this._transitionablePaint=new uc(u.paint);for(let y in n.paint)this.setPaintProperty(y,n.paint[y],{validate:!1});for(let y in n.layout)this.setLayoutProperty(y,n.layout[y],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new dc(u.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(n){return n==="visibility"?this.visibility:this._unevaluatedLayout.getValue(n)}setLayoutProperty(n,u,y={}
801){u!=null&&this._validate(Mu,`layers.${this.id}.layout.${n}`,n,u,y)||(n!=="visibility"?this._unevaluatedLayout.setValue(n,u):this.visibility=u)}getPaintProperty(n){return n.endsWith(Ca)?this._transitionablePaint.getTransition(n.slice(0,-Ca.length)):this._transitionablePaint.getValue(n)}setPaintProperty(n,u,y={}){if(u!=null&&this._validate(Ip,`layers.${this.id}.paint.${n}`,n,u,y))return!1;if(n.endsWith(Ca))return this._transitionablePaint.setTransition(n.slice(0,-Ca.length),u||void 0),!1;{let I=this._transitionablePaint._values[n],k=I.property.specification["property-type"]==="cross-faded-data-driven",R=I.value.isDataDriven(),q=I.value;this._transitionablePaint.setValue(n,u),this._handleSpecialPaintPropertyUpdate(n);let G=this._transitionablePaint._values[n].value;return G.isDataDriven()||R||k||this._handleOverridablePaintPropertyUpdate(n,q,G)}}_handleSpecialPaintPropertyUpdate(n){}_handleOverridablePaintPropertyUpdate(n,u,y){return!1}isHidden(n){return!!(this.minzoom&&n<this.minzoom)||!!(this.maxzoom&&n>=this.maxzoom)||this.visibility==="none"}updateTransitions(n){this._transitioningPaint=this._transitionablePaint.transitioned(n,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(n,u){n.getCrossfadeParameters&&(this._crossfadeParameters=n.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(n,void 0,u)),this.paint=this._transitioningPaint.possiblyEvaluate(n,void 0,u)}
vendor: 12,953 bytes, line 801
801serialize(){let n={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&&(n.layout=n.layout||{},n.layout.visibility=this.visibility),He(n,((u,y)=>!(u===void 0||y==="layout"&&!Object.keys(u).length||y==="paint"&&!Object.keys(u).length)))}_validate(n,u,y,I,k={}){return(!k||k.validate!==!1)&&dr(this,n.call(Vc,{key:u,layerType:this.type,objectKey:y,value:I,styleSpec:St,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let n in this.paint._values){let u=this.paint.get(n);if(u instanceof ra&&yr(u.property.specification)&&(u.value.kind==="source"||u.value.kind==="composite")&&u.value.isStateDependent)return!0}return!1}}let Ch={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Ea{constructor(n,u){this._structArray=n,this._pos1=u*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Xr{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(n,u){return n._trim(),u&&(n.isTransferred=!0,u.push(n.arrayBuffer)),{length:n.length,arrayBuffer:n.arrayBuffer}}static deserialize(n){let u=Object.create(this.prototype);return u.arrayBuffer=n.arrayBuffer,u.length=n.length,u.capacity=n.arrayBuffer.byteLength/u.bytesPerElement,u._refreshViews(),u}_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(n){this.reserve(n),this.length=n}reserve(n){if(n>this.capacity){this.capacity=Math.max(n,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let u=this.uint8;this._refreshViews(),u&&this.uint8.set(u)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function wn(c,n=1){let u=0,y=0;return{members:c.map((I=>{let k=Ch[I.type].BYTES_PER_ELEMENT,R=u=$c(u,Math.max(n,k)),q=I.components||1;return y=Math.max(y,k),u+=k*q,{name:I.name,type:I.type,components:q,offset:R}})),size:$c(u,Math.max(y,n)),alignment:n}}function $c(c,n){return Math.ceil(c/n)*n}class Wa extends Xr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(n,u){let y=this.length;return this.resize(y+1),this.emplace(y,n,u)}emplace(n,u,y){let I=2*n;return this.int16[I+0]=u,this.int16[I+1]=y,n}}Wa.prototype.bytesPerElement=4,ui("StructArrayLayout2i4",Wa);class T extends Xr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(n,u,y,I){let k=this.length;return this.resize(k+1),this.emplace(k,n,u,y,I)}emplace(n,u,y,I,k){let R=4*n;return this.int16[R+0]=u,this.int16[R+1]=y,this.int16[R+2]=I,this.int16[R+3]=k,n}}T.prototype.bytesPerElement=8,ui("StructArrayLayout4i8",T);class s extends Xr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(n,u,y,I,k,R){let q=this.length;return this.resize(q+1),this.emplace(q,n,u,y,I,k,R)}emplace(n,u,y,I,k,R,q){let G=6*n;return this.int16[G+0]=u,this.int16[G+1]=y,this.int16[G+2]=I,this.int16[G+3]=k,this.int16[G+4]=R,this.int16[G+5]=q,n}}s.prototype.bytesPerElement=12,ui("StructArrayLayout2i4i12",s);class d extends Xr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(n,u,y,I,k,R){let q=this.length;return this.resize(q+1),this.emplace(q,n,u,y,I,k,R)}emplace(n,u,y,I,k,R,q){let G=4*n,J=8*n;return this.int16[G+0]=u,this.int16[G+1]=y,this.uint8[J+4]=I,this.uint8[J+5]=k,this.uint8[J+6]=R,this.uint8[J+7]=q,n}}d.prototype.bytesPerElement=8,ui("StructArrayLayout2i4ub8",d);class v extends Xr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(n,u){let y=this.length;return this.resize(y+1),this.emplace(y,n,u)}emplace(n,u,y){let I=2*n;return this.float32[I+0]=u,this.float32[I+1]=y,n}}v.prototype.bytesPerElement=8,ui("StructArrayLayout2f8",v);class S extends Xr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(n,u,y,I,k,R,q,G,J,ae){let ce=this.length;return this.resize(ce+1),this.emplace(ce,n,u,y,I,k,R,q,G,J,ae)}emplace(n,u,y,I,k,R,q,G,J,ae,ce){let de=10*n;return this.uint16[de+0]=u,this.uint16[de+1]=y,this.uint16[de+2]=I,this.uint16[de+3]=k,this.uint16[de+4]=R,this.uint16[de+5]=q,this.uint16[de+6]=G,this.uint16[de+7]=J,this.uint16[de+8]=ae,this.uint16[de+9]=ce,n}}S.prototype.bytesPerElement=20,ui("StructArrayLayout10ui20",S);class z extends Xr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(n,u,y,I,k,R,q,G,J,ae,ce,de){let ge=this.length;return this.resize(ge+1),this.emplace(ge,n,u,y,I,k,R,q,G,J,ae,ce,de)}emplace(n,u,y,I,k,R,q,G,J,ae,ce,de,ge){let ye=12*n;return this.int16[ye+0]=u,this.int16[ye+1]=y,this.int16[ye+2]=I,this.int16[ye+3]=k,this.uint16[ye+4]=R,this.uint16[ye+5]=q,this.uint16[ye+6]=G,this.uint16[ye+7]=J,this.int16[ye+8]=ae,this.int16[ye+9]=ce,this.int16[ye+10]=de,this.int16[ye+11]=ge,n}}z.prototype.bytesPerElement=24,ui("StructArrayLayout4i4ui4i24",z);class j extends Xr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(n,u,y){let I=this.length;return this.resize(I+1),this.emplace(I,n,u,y)}emplace(n,u,y,I){let k=3*n;return this.float32[k+0]=u,this.float32[k+1]=y,this.float32[k+2]=I,n}}j.prototype.bytesPerElement=12,ui("StructArrayLayout3f12",j);class W extends Xr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(n){let u=this.length;return this.resize(u+1),this.emplace(u,n)}emplace(n,u){return this.uint32[1*n+0]=u,n}}W.prototype.bytesPerElement=4,ui("StructArrayLayout1ul4",W);class K extends Xr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(n,u,y,I,k,R,q,G,J){let ae=this.length;return this.resize(ae+1),this.emplace(ae,n,u,y,I,k,R,q,G,J)}emplace(n,u,y,I,k,R,q,G,J,ae){let ce=10*n,de=5*n;return this.int16[ce+0]=u,this.int16[ce+1]=y,this.int16[ce+2]=I,this.int16[ce+3]=k,this.int16[ce+4]=R,this.int16[ce+5]=q,this.uint32[de+3]=G,this.uint16[ce+8]=J,this.uint16[ce+9]=ae,n}}K.prototype.bytesPerElement=20,ui("StructArrayLayout6i1ul2ui20",K);class Q extends Xr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(n,u,y,I,k,R){let q=this.length;return this.resize(q+1),this.emplace(q,n,u,y,I,k,R)}emplace(n,u,y,I,k,R,q){let G=6*n;return this.int16[G+0]=u,this.int16[G+1]=y,this.int16[G+2]=I,this.int16[G+3]=k,this.int16[G+4]=R,this.int16[G+5]=q,n}}Q.prototype.bytesPerElement=12,ui("StructArrayLayout2i2i2i12",Q);class le extends Xr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(n,u,y,I,k){let R=this.length;return this.resize(R+1),this.emplace(R,n,u,y,I,k)}emplace(n,u,y,I,k,R){let q=4*n,G=8*n;return this.float32[q+0]=u,this.float32[q+1]=y,this.float32[q+2]=I,this.int16[G+6]=k,this.int16[G+7]=R,n}}le.prototype.bytesPerElement=16,ui("StructArrayLayout2f1f2i16",le);class he extends Xr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(n,u,y,I){let k=this.length;return this.resize(k+1),this.emplace(k,n,u,y,I)}emplace(n,u,y,I,k){let R=12*n,q=3*n;return this.uint8[R+0]=u,this.uint8[R+1]=y,this.float32[q+1]=I,this.float32[q+2]=k,n}}he.prototype.bytesPerElement=12,ui("StructArrayLayout2ub2f12",he);class fe extends Xr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(n,u,y){let I=this.length;return this.resize(I+1),this.emplace(I,n,u,y)}emplace(n,u,y,I){let k=3*n;return this.uint16[k+0]=u,this.uint16[k+1]=y,this.uint16[k+2]=I,n}}fe.prototype.bytesPerElement=6,ui("StructArrayLayout3ui6",fe);class Re extends Xr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(n,u,y,I,k,R,q,G,J,ae,ce,de,ge,ye,Ue,Oe,nt){let ut=this.length;return this.resize(ut+1),this.emplace(ut,n,u,y,I,k,R,q,G,J,ae,ce,de,ge,ye,Ue,Oe,nt)}emplace(n,u,y,I,k,R,q,G,J,ae,ce,de,ge,ye,Ue,Oe,nt,ut){let tt=24*n,st=12*n,Pt=48*n;return this.int16[tt+0]=u,this.int16[tt+1]=y,this.uint16[tt+2]=I,this.uint16[tt+3]=k,this.uint32[st+2]=R,this.uint32[st+3]=q,this.uint32[st+4]=G,this.uint16[tt+10]=J,this.uint16[tt+11]=ae,this.uint16[tt+12]=ce,this.float32[st+7]=de,this.float32[st+8]=ge,this.uint8[Pt+36]=ye,this.uint8[Pt+37]=Ue,this.uint8[Pt+38]=Oe,this.uint32[st+10]=nt,this.int16[tt+22]=ut,n}}Re.prototype.bytesPerElement=48,ui("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Re);class Me extends Xr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(n,u,y,I,k,R,q,G,J,ae,ce,de,ge,ye,Ue,Oe,nt,ut,tt,st,Pt,kt,di,bi,oi,Jt,Zt,si){let ni=this.length;return this.resize(ni+1),this.emplace(ni,n,u,y,I,k,R,q,G,J,ae,ce,de,ge,ye,Ue,Oe,nt,ut,tt,st,Pt,kt,di,bi,oi,Jt,Zt,si)}emplace(n,u,y,I,k,R,q,G,J,ae,ce,de,ge,ye,Ue,Oe,nt,ut,tt,st,Pt,kt,di,bi,oi,Jt,Zt,si,ni){let Vt=34*n,Di=17*n;return this.int16[Vt+0]=u,this.int16[Vt+1]=y,this.int16[Vt+2]=I,this.int16[Vt+3]=k,this.int16[Vt+4]=R,this.int16[Vt+5]=q,this.int16[Vt+6]=G,this.int16[Vt+7]=J,this.uint16[Vt+8]=ae,this.uint16[Vt+9]=ce,this.uint16[Vt+10]=de,this.uint16[Vt+11]=ge,this.uint16[Vt+12]=ye,this.uint16[Vt+13]=Ue,this.uint16[Vt+14]=Oe,this.uint16[Vt+15]=nt,this.uint16[Vt+16]=ut,this.uint16[Vt+17]=tt,this.uint16[Vt+18]=st,this.uint16[Vt+19]=Pt,this.uint16[Vt+20]=kt,this.uint16[Vt+21]=di,this.uint16[Vt+22]=bi,this.uint32[Di+12]=oi,this.float32[Di+13]=Jt,this.float32[Di+14]=Zt,this.float32[Di+15]=si,this.float32[Di+16]=ni,n}}Me.prototype.bytesPerElement=68,ui("StructArrayLayout8i15ui1ul4f68",Me);class Ae extends Xr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(n){let u=this.length;return this.resize(u+1),this.emplace(u,n)}emplace(n,u){return this.float32[1*n+0]=u,n}}Ae.prototype.bytesPerElement=4,ui("StructArrayLayout1f4",Ae);class Xe extends Xr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(n,u,y){let I=this.length;return this.resize(I+1),this.emplace(I,n,u,y)}emplace(n,u,y,I){let k=3*n;return this.int16[k+0]=u,this.int16[k+1]=y,this.int16[k+2]=I,n}}Xe.prototype.bytesPerElement=6,ui("StructArrayLayout3i6",Xe);class et extends Xr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(n,u,y){let I=this.length;return this.resize(I+1),this.emplace(I,n,u,y)}emplace(n,u,y,I){let k=4*n;return this.uint32[2*n+0]=u,this.uint16[k+2]=y,this.uint16[k+3]=I,n}}et.prototype.bytesPerElement=8,ui("StructArrayLayout1ul2ui8",et);class rt extends Xr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(n,u){let y=this.length;return this.resize(y+1),this.emplace(y,n,u)}emplace(n,u,y){let I=2*n;return this.uint16[I+0]=u,this.uint16[I+1]=y,n}}rt.prototype.bytesPerElement=4,ui("StructArrayLayout2ui4",rt);class Be extends Xr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(n){let u=this.length;return this.resize(u+1),this.emplace(u,n)}emplace(n,u){return this.uint16[1*n+0]=u,n}}Be.prototype.bytesPerElement=2,ui("StructArrayLayout1ui2",Be);class ht extends Xr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(n,u,y,I){let k=this.length;return this.resize(k+1),this.emplace(k,n,u,y,I)}emplace(n,u,y,I,k){let R=4*n;return this.float32[R+0]=u,this.float32[R+1]=y,this.float32[R+2]=I,this.float32[R+3]=k,n}}ht.prototype.bytesPerElement=16,ui("StructArrayLayout4f16",ht);
vendor: 4,605 bytes, line 801
801class ot extends Ea{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new Nt(this.anchorPointX,this.anchorPointY)}}ot.prototype.size=20;class wt extends K{get(n){return new ot(this,n)}}ui("CollisionBoxArray",wt);class Tt extends Ea{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(n){this._structArray.uint8[this._pos1+37]=n}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(n){this._structArray.uint8[this._pos1+38]=n}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(n){this._structArray.uint32[this._pos4+10]=n}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}Tt.prototype.size=48;class Ft extends Re{get(n){return new Tt(this,n)}}ui("PlacedSymbolArray",Ft);class gt extends Ea{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(n){this._structArray.uint32[this._pos4+12]=n}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get textOffset0(){return this._structArray.float32[this._pos4+14]}get textOffset1(){return this._structArray.float32[this._pos4+15]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+16]}}gt.prototype.size=68;class ri extends Me{get(n){return new gt(this,n)}}ui("SymbolInstanceArray",ri);class Xt extends Ae{getoffsetX(n){return this.float32[1*n+0]}}ui("GlyphOffsetArray",Xt);class ai extends Xe{getx(n){return this.int16[3*n+0]}gety(n){return this.int16[3*n+1]}gettileUnitDistanceFromAnchor(n){return this.int16[3*n+2]}}ui("SymbolLineVertexArray",ai);
801class $i extends Ea{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]}}$i.prototype.size=8;class Ui extends et{get(n){return new $i(this,n)}}ui("FeatureIndexArray",Ui);class yi extends Wa{}class vr extends Wa{}class tr extends Wa{}class cr extends s{}class ur extends d{}class mr extends v{}class Lr extends S{}class cn extends z{}class Co extends j{}class Ha extends W{}class ll extends Q{}class na extends he{}class hn extends fe{}class Kn extends rt{}let Qt=wn([{name:"a_pos",components:2,type:"Int16"}],4),{members:Mn}=Qt;class Ki{constructor(n=[]){this.segments=n}prepareSegment(n,u,y,I){let k=this.segments[this.segments.length-1];return n>Ki.MAX_VERTEX_ARRAY_LENGTH&&li(`Max vertices per segment is ${Ki.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${n}`),(!k||k.vertexLength+n>Ki.MAX_VERTEX_ARRAY_LENGTH||k.sortKey!==I)&&(k={vertexOffset:u.length,primitiveOffset:y.length,vertexLength:0,primitiveLength:0},I!==void 0&&(k.sortKey=I),this.segments.push(k)),k}get(){return this.segments}destroy(){for(let n of this.segments)for(let u in n.vaos)n.vaos[u].destroy()}static simpleSegment(n,u,y,I){return new Ki([{vertexOffset:n,primitiveOffset:u,vertexLength:y,primitiveLength:I,vaos:{},sortKey:0}])}}function _r(c,n){return 256*(c=Ze(Math.floor(c),0,255))+Ze(Math.floor(n),0,255)}Ki.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ui("SegmentVector",Ki);let Or=wn([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);
vendor: 4,239 bytes, line 801
801var un={exports:{}},Rr={exports:{}};Rr.exports=function(c,n){var u,y,I,k,R,q,G,J;for(y=c.length-(u=3&c.length),I=n,R=3432918353,q=461845907,J=0;J<y;)G=255&c.charCodeAt(J)|(255&c.charCodeAt(++J))<<8|(255&c.charCodeAt(++J))<<16|(255&c.charCodeAt(++J))<<24,++J,I=27492+(65535&(k=5*(65535&(I=(I^=G=(65535&(G=(G=(65535&G)*R+(((G>>>16)*R&65535)<<16)&4294967295)<<15|G>>>17))*q+(((G>>>16)*q&65535)<<16)&4294967295)<<13|I>>>19))+((5*(I>>>16)&65535)<<16)&4294967295))+((58964+(k>>>16)&65535)<<16);switch(G=0,u){case 3:G^=(255&c.charCodeAt(J+2))<<16;case 2:G^=(255&c.charCodeAt(J+1))<<8;case 1:I^=G=(65535&(G=(G=(65535&(G^=255&c.charCodeAt(J)))*R+(((G>>>16)*R&65535)<<16)&4294967295)<<15|G>>>17))*q+(((G>>>16)*q&65535)<<16)&4294967295}return I^=c.length,I=2246822507*(65535&(I^=I>>>16))+((2246822507*(I>>>16)&65535)<<16)&4294967295,I=3266489909*(65535&(I^=I>>>13))+((3266489909*(I>>>16)&65535)<<16)&4294967295,(I^=I>>>16)>>>0};var Ma={exports:{}};Ma.exports=function(c,n){for(var u,y=c.length,I=n^y,k=0;y>=4;)u=1540483477*(65535&(u=255&c.charCodeAt(k)|(255&c.charCodeAt(++k))<<8|(255&c.charCodeAt(++k))<<16|(255&c.charCodeAt(++k))<<24))+((1540483477*(u>>>16)&65535)<<16),I=1540483477*(65535&I)+((1540483477*(I>>>16)&65535)<<16)^(u=1540483477*(65535&(u^=u>>>24))+((1540483477*(u>>>16)&65535)<<16)),y-=4,++k;switch(y){case 3:I^=(255&c.charCodeAt(k+2))<<16;case 2:I^=(255&c.charCodeAt(k+1))<<8;case 1:I=1540483477*(65535&(I^=255&c.charCodeAt(k)))+((1540483477*(I>>>16)&65535)<<16)}return I=1540483477*(65535&(I^=I>>>13))+((1540483477*(I>>>16)&65535)<<16),(I^=I>>>15)>>>0};var oa=Rr.exports,Eh=Ma.exports;un.exports=oa,un.exports.murmur3=oa,un.exports.murmur2=Eh;class cl{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(n,u,y,I){this.ids.push(Gc(n)),this.positions.push(u,y,I)}getPositions(n){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let u=Gc(n),y=0,I=this.ids.length-1;for(;y<I;){let R=y+I>>1;this.ids[R]>=u?I=R:y=R+1}let k=[];for(;this.ids[y]===u;)k.push({index:this.positions[3*y],start:this.positions[3*y+1],end:this.positions[3*y+2]}),y++;return k}static serialize(n,u){let y=new Float64Array(n.ids),I=new Uint32Array(n.positions);return Mh(y,I,0,y.length-1),u&&u.push(y.buffer,I.buffer),{ids:y,positions:I}}static deserialize(n){let u=new cl;return u.ids=n.ids,u.positions=n.positions,u.indexed=!0,u}}function Gc(c){let n=+c;return!isNaN(n)&&n<=Number.MAX_SAFE_INTEGER?n:un.exports(String(c))}function Mh(c,n,u,y){for(;u<y;){let I=c[u+y>>1],k=u-1,R=y+1;for(;;){do k++;while(c[k]<I);do R--;while(c[R]>I);if(k>=R)break;fs(c,k,R),fs(n,3*k,3*R),fs(n,3*k+1,3*R+1),fs(n,3*k+2,3*R+2)}R-u<y-R?(Mh(c,n,u,R),u=R+1):(Mh(c,n,R+1,y),y=R)}}function fs(c,n,u){let y=c[n];c[n]=c[u],c[u]=y}ui("FeaturePositionMap",cl);class gs{constructor(n,u){this.gl=n.gl,this.location=u}}class Fs extends gs{constructor(n,u){super(n,u),this.current=0}set(n){this.current!==n&&(this.current=n,this.gl.uniform1f(this.location,n))}}class Zc extends gs{constructor(n,u){super(n,u),this.current=[0,0,0,0]}set(n){n[0]===this.current[0]&&n[1]===this.current[1]&&n[2]===this.current[2]&&n[3]===this.current[3]||(this.current=n,this.gl.uniform4f(this.location,n[0],n[1],n[2],n[3]))}}class ku extends gs{constructor(n,u){super(n,u),this.current=ve.transparent}set(n){n.r===this.current.r&&n.g===this.current.g&&n.b===this.current.b&&n.a===this.current.a||(this.current=n,this.gl.uniform4f(this.location,n.r,n.g,n.b,n.a))}}let cd=new Float32Array(16);function ou(c){return[_r(255*c.r,255*c.g),_r(255*c.b,255*c.a)]}class Xa{constructor(n,u,y){this.value=n,this.uniformNames=u.map((I=>`u_${I}`)),this.type=y}setUniform(n,u,y){n.set(y.constantOr(this.value))}getBinding(n,u,y){return this.type==="color"?new ku(n,u):new Fs(n,u)}}class wr{constructor(n,u){this.uniformNames=u.map((y=>`u_${y}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(n,u){this.pixelRatioFrom=u.pixelRatio,this.pixelRatioTo=n.pixelRatio,this.patternFrom=u.tlbr,this.patternTo=n.tlbr}setUniform(n,u,y,I){let k=I==="u_pattern_to"?this.patternTo:I==="u_pattern_from"?this.patternFrom:I==="u_pixel_ratio_to"?this.pixelRatioTo:I==="u_pixel_ratio_from"?this.pixelRatioFrom:null;k&&n.set(k)}
801getBinding(n,u,y){return y.substr(0,9)==="u_pattern"?new Zc(n,u):new Fs(n,u)}}class hl{constructor(n,u,y,I){this.expression=n,this.type=y,this.maxValue=0,this.paintVertexAttributes=u.map((k=>({name:`a_${k}`,type:"Float32",components:y==="color"?2:1,offset:0}))),this.paintVertexArray=new I}populatePaintArray(n,u,y,I,k){let R=this.paintVertexArray.length,q=this.expression.evaluate(new Nr(0),u,{},I,[],k);this.paintVertexArray.resize(n),this._setPaintValue(R,n,q)}updatePaintArray(n,u,y,I){let k=this.expression.evaluate({zoom:0},y,I);this._setPaintValue(n,u,k)}_setPaintValue(n,u,y){if(this.type==="color"){let I=ou(y);for(let k=n;k<u;k++)this.paintVertexArray.emplace(k,I[0],I[1])}else{for(let I=n;I<u;I++)this.paintVertexArray.emplace(I,y);this.maxValue=Math.max(this.maxValue,Math.abs(y))}}upload(n){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=n.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Pa{constructor(n,u,y,I,k,R){this.expression=n,this.uniformNames=u.map((q=>`u_${q}_t`)),this.type=y,this.useIntegerZoom=I,this.zoom=k,this.maxValue=0,this.paintVertexAttributes=u.map((q=>({name:`a_${q}`,type:"Float32",components:y==="color"?4:2,offset:0}))),this.paintVertexArray=new R}populatePaintArray(n,u,y,I,k){let R=this.expression.evaluate(new Nr(this.zoom),u,{},I,[],k),q=this.expression.evaluate(new Nr(this.zoom+1),u,{},I,[],k),G=this.paintVertexArray.length;this.paintVertexArray.resize(n),this._setPaintValue(G,n,R,q)}updatePaintArray(n,u,y,I){let k=this.expression.evaluate({zoom:this.zoom},y,I),R=this.expression.evaluate({zoom:this.zoom+1},y,I);this._setPaintValue(n,u,k,R)}_setPaintValue(n,u,y,I){if(this.type==="color"){let k=ou(y),R=ou(I);for(let q=n;q<u;q++)this.paintVertexArray.emplace(q,k[0],k[1],R[0],R[1])}else{for(let k=n;k<u;k++)this.paintVertexArray.emplace(k,y,I);this.maxValue=Math.max(this.maxValue,Math.abs(y),Math.abs(I))}}upload(n){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=n.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(n,u){let y=this.useIntegerZoom?Math.floor(u.zoom):u.zoom,I=Ze(this.expression.interpolationFactor(y,this.zoom,this.zoom+1),0,1);n.set(I)}getBinding(n,u,y){return new Fs(n,u)}}class _s{constructor(n,u,y,I,k,R){this.expression=n,this.type=u,this.useIntegerZoom=y,this.zoom=I,this.layerId=R,this.zoomInPaintVertexArray=new k,this.zoomOutPaintVertexArray=new k}populatePaintArray(n,u,y){let I=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(n),this.zoomOutPaintVertexArray.resize(n),this._setPaintValues(I,n,u.patterns&&u.patterns[this.layerId],y)}updatePaintArray(n,u,y,I,k){this._setPaintValues(n,u,y.patterns&&y.patterns[this.layerId],k)}_setPaintValues(n,u,y,I){if(!I||!y)return;let{min:k,mid:R,max:q}=y,G=I[k],J=I[R],ae=I[q];if(G&&J&&ae)for(let ce=n;ce<u;ce++)this.zoomInPaintVertexArray.emplace(ce,J.tl[0],J.tl[1],J.br[0],J.br[1],G.tl[0],G.tl[1],G.br[0],G.br[1],J.pixelRatio,G.pixelRatio),this.zoomOutPaintVertexArray.emplace(ce,J.tl[0],J.tl[1],J.br[0],J.br[1],ae.tl[0],ae.tl[1],ae.br[0],ae.br[1],J.pixelRatio,ae.pixelRatio)}upload(n){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=n.createVertexBuffer(this.zoomInPaintVertexArray,Or.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=n.createVertexBuffer(this.zoomOutPaintVertexArray,Or.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class Au{constructor(n,u,y){this.binders={},this._buffers=[];let I=[];for(let k in n.paint._values){if(!y(k))continue;let R=n.paint.get(k);if(!(R instanceof ra&&yr(R.property.specification)))continue;let q=Cp(k,n.type),G=R.value,J=R.property.specification.type,ae=R.property.useIntegerZoom,ce=R.property.specification["property-type"],de=ce==="cross-faded"||ce==="cross-faded-data-driven";if(G.kind==="constant")this.binders[k]=de?new wr(G.value,q):new Xa(G.value,q,J),I.push(`/u_${k}`);else if(G.kind==="source"||de){let ge=Ep(k,J,"source");this.binders[k]=de?new _s(G,J,ae,u,ge,n.id):new hl(G,q,J,ge),I.push(`/a_${k}`)}else{let ge=Ep(k,J,"composite");this.binders[k]=new Pa(G,q,J,ae,u,ge),I.push(`/z_${k}`)}}this.cacheKey=I.sort().join("")}getMaxValue(n){let u=this.binders[n];return u instanceof hl||u instanceof Pa?u.maxValue:0}populatePaintArrays(n,u,y,I,k){for(let R in this.binders){let q=this.binders[R];(q instanceof hl||q instanceof Pa||q instanceof _s)&&q.populatePaintArray(n,u,y,I,k)}}setConstantPatternPositions(n,u){for(let y in this.binders){let I=this.binders[y];I instanceof wr&&I.setConstantPatternPositions(n,u)}}updatePaintArrays(n,u,y,I,k){let R=!1;for(let q in n){let G=u.getPositions(q);for(let J of G){let ae=y.feature(J.index);for(let ce in this.binders){let de=this.binders[ce];if((de instanceof hl||de instanceof Pa||de instanceof _s)&&de.expression.isStateDependent===!0){let ge=I.paint.get(ce);de.expression=ge.value,de.updatePaintArray(J.start,J.end,ae,n[q],k),R=!0}}}}return R}defines(){let n=[];for(let u in this.binders){let y=this.binders[u];(y instanceof Xa||y instanceof wr)&&n.push(...y.uniformNames.map((I=>`#define HAS_UNIFORM_${I}`)))}return n}getBinderAttributes(){let n=[];for(let u in this.binders){let y=this.binders[u];
801if(y instanceof hl||y instanceof Pa)for(let I=0;I<y.paintVertexAttributes.length;I++)n.push(y.paintVertexAttributes[I].name);else if(y instanceof _s)for(let I=0;I<Or.members.length;I++)n.push(Or.members[I].name)}return n}getBinderUniforms(){let n=[];for(let u in this.binders){let y=this.binders[u];if(y instanceof Xa||y instanceof wr||y instanceof Pa)for(let I of y.uniformNames)n.push(I)}return n}getPaintVertexBuffers(){return this._buffers}getUniforms(n,u){let y=[];for(let I in this.binders){let k=this.binders[I];if(k instanceof Xa||k instanceof wr||k instanceof Pa){for(let R of k.uniformNames)if(u[R]){let q=k.getBinding(n,u[R],R);y.push({name:R,property:I,binding:q})}}}return y}setUniforms(n,u,y,I){for(let{name:k,property:R,binding:q}of u)this.binders[R].setUniform(q,I,y.get(R),k)}updatePaintBuffers(n){this._buffers=[];for(let u in this.binders){let y=this.binders[u];if(n&&y instanceof _s){let I=n.fromScale===2?y.zoomInPaintVertexBuffer:y.zoomOutPaintVertexBuffer;I&&this._buffers.push(I)}else(y instanceof hl||y instanceof Pa)&&y.paintVertexBuffer&&this._buffers.push(y.paintVertexBuffer)}}upload(n){for(let u in this.binders){let y=this.binders[u];(y instanceof hl||y instanceof Pa||y instanceof _s)&&y.upload(n)}this.updatePaintBuffers()}destroy(){for(let n in this.binders){let u=this.binders[n];(u instanceof hl||u instanceof Pa||u instanceof _s)&&u.destroy()}}}class Nl{constructor(n,u,y=(()=>!0)){this.programConfigurations={};for(let I of n)this.programConfigurations[I.id]=new Au(I,u,y);this.needsUpload=!1,this._featureMap=new cl,this._bufferOffset=0}populatePaintArrays(n,u,y,I,k,R){for(let q in this.programConfigurations)this.programConfigurations[q].populatePaintArrays(n,u,I,k,R);u.id!==void 0&&this._featureMap.add(u.id,y,this._bufferOffset,n),this._bufferOffset=n,this.needsUpload=!0}updatePaintArrays(n,u,y,I){for(let k of y)this.needsUpload=this.programConfigurations[k.id].updatePaintArrays(n,this._featureMap,u,k,I)||this.needsUpload}get(n){return this.programConfigurations[n]}upload(n){if(this.needsUpload){for(let u in this.programConfigurations)this.programConfigurations[u].upload(n);this.needsUpload=!1}}destroy(){for(let n in this.programConfigurations)this.programConfigurations[n].destroy()}}function Cp(c,n){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[c]||[c.replace(`${n}-`,"").replace(/-/g,"_")]}function Ep(c,n,u){let y={color:{source:v,composite:ht},number:{source:Ae,composite:v}},I=(function(k){return{"line-pattern":{source:Lr,composite:Lr},"fill-pattern":{source:Lr,composite:Lr},"fill-extrusion-pattern":{source:Lr,composite:Lr}}[k]})(c);return I&&I[u]||y[n][u]}ui("ConstantBinder",Xa),ui("CrossFadedConstantBinder",wr),ui("SourceExpressionBinder",hl),ui("CrossFadedCompositeBinder",_s),ui("CompositeExpressionBinder",Pa),ui("ProgramConfiguration",Au,{omit:["_buffers"]}),ui("ProgramConfigurationSet",Nl);var jn=8192;let Ka=Math.pow(2,14)-1,Ph=-Ka-1;function mi(c){let n=jn/c.extent,u=c.loadGeometry();for(let y=0;y<u.length;y++){let I=u[y];for(let k=0;k<I.length;k++){let R=I[k],q=Math.round(R.x*n),G=Math.round(R.y*n);R.x=Ze(q,Ph,Ka),R.y=Ze(G,Ph,Ka),(q<R.x||q>R.x+1||G<R.y||G>R.y+1)&&li("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return u}function Ii(c,n){return{type:c.type,id:c.id,properties:c.properties,geometry:n?mi(c):[]}}function Bs(c,n,u,y,I){c.emplaceBack(2*n+(y+1)/2,2*u+(I+1)/2)}class zu{constructor(n){this.zoom=n.zoom,this.overscaling=n.overscaling,this.layers=n.layers,this.layerIds=this.layers.map((u=>u.id)),this.index=n.index,this.hasPattern=!1,this.layoutVertexArray=new vr,this.indexArray=new hn,this.segments=new Ki,this.programConfigurations=new Nl(n.layers,n.zoom),this.stateDependentLayerIds=this.layers.filter((u=>u.isStateDependent())).map((u=>u.id))}
801populate(n,u,y){let I=this.layers[0],k=[],R=null,q=!1;I.type==="circle"&&(R=I.layout.get("circle-sort-key"),q=!R.isConstant());for(let{feature:G,id:J,index:ae,sourceLayerIndex:ce}of n){let de=this.layers[0]._featureFilter.needGeometry,ge=Ii(G,de);if(!this.layers[0]._featureFilter.filter(new Nr(this.zoom),ge,y))continue;let ye=q?R.evaluate(ge,{},y):void 0,Ue={id:J,properties:G.properties,type:G.type,sourceLayerIndex:ce,index:ae,geometry:de?ge.geometry:mi(G),patterns:{},sortKey:ye};k.push(Ue)}q&&k.sort(((G,J)=>G.sortKey-J.sortKey));for(let G of k){let{geometry:J,index:ae,sourceLayerIndex:ce}=G,de=n[ae].feature;this.addFeature(G,J,ae,y),u.featureIndex.insert(de,J,ae,ce,this.index)}}update(n,u,y){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(n,u,this.stateDependentLayers,y)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(n){this.uploaded||(this.layoutVertexBuffer=n.createVertexBuffer(this.layoutVertexArray,Mn),this.indexBuffer=n.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(n),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(n,u,y,I){for(let k of u)for(let R of k){let q=R.x,G=R.y;if(q<0||q>=jn||G<0||G>=jn)continue;let J=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,n.sortKey),ae=J.vertexLength;Bs(this.layoutVertexArray,q,G,-1,-1),Bs(this.layoutVertexArray,q,G,1,-1),Bs(this.layoutVertexArray,q,G,1,1),Bs(this.layoutVertexArray,q,G,-1,1),this.indexArray.emplaceBack(ae,ae+1,ae+2),this.indexArray.emplaceBack(ae,ae+3,ae+2),J.vertexLength+=4,J.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,n,y,{},I)}}function Wc(c,n){for(let u=0;u<c.length;u++)if(ul(n,c[u]))return!0;for(let u=0;u<n.length;u++)if(ul(c,n[u]))return!0;return!!ka(c,n)}function aa(c,n,u){return!!ul(c,n)||!!kp(n,c,u)}function Mp(c,n){if(c.length===1)return ud(n,c[0]);for(let u=0;u<n.length;u++){let y=n[u];for(let I=0;I<y.length;I++)if(ul(c,y[I]))return!0}for(let u=0;u<c.length;u++)if(ud(n,c[u]))return!0;for(let u=0;u<n.length;u++)if(ka(c,n[u]))return!0;return!1}function Du(c,n,u){if(c.length>1){if(ka(c,n))return!0;for(let y=0;y<n.length;y++)if(kp(n[y],c,u))return!0}for(let y=0;y<c.length;y++)if(kp(c[y],n,u))return!0;return!1}function ka(c,n){if(c.length===0||n.length===0)return!1;for(let u=0;u<c.length-1;u++){let y=c[u],I=c[u+1];for(let k=0;k<n.length-1;k++)if(Pp(y,I,n[k],n[k+1]))return!0}return!1}function Pp(c,n,u,y){return ki(c,u,y)!==ki(n,u,y)&&ki(c,n,u)!==ki(c,n,y)}function kp(c,n,u){let y=u*u;if(n.length===1)return c.distSqr(n[0])<y;for(let I=1;I<n.length;I++)if(hd(c,n[I-1],n[I])<y)return!0;return!1}function hd(c,n,u){let y=n.distSqr(u);if(y===0)return c.distSqr(n);let I=((c.x-n.x)*(u.x-n.x)+(c.y-n.y)*(u.y-n.y))/y;return c.distSqr(I<0?n:I>1?u:u.sub(n)._mult(I)._add(n))}function ud(c,n){let u,y,I,k=!1;for(let R=0;R<c.length;R++){u=c[R];for(let q=0,G=u.length-1;q<u.length;G=q++)y=u[q],I=u[G],y.y>n.y!=I.y>n.y&&n.x<(I.x-y.x)*(n.y-y.y)/(I.y-y.y)+y.x&&(k=!k)}return k}function ul(c,n){let u=!1;for(let y=0,I=c.length-1;y<c.length;I=y++){let k=c[y],R=c[I];k.y>n.y!=R.y>n.y&&n.x<(R.x-k.x)*(n.y-k.y)/(R.y-k.y)+k.x&&(u=!u)}return u}function pn(c,n,u){let y=u[0],I=u[2];if(c.x<y.x&&n.x<y.x||c.x>I.x&&n.x>I.x||c.y<y.y&&n.y<y.y||c.y>I.y&&n.y>I.y)return!1;let k=ki(c,n,u[0]);return k!==ki(c,n,u[1])||k!==ki(c,n,u[2])||k!==ki(c,n,u[3])}function Pr(c,n,u){let y=n.paint.get(c).value;return y.kind==="constant"?y.value:u.programConfigurations.get(n.id).getMaxValue(c)}function au(c){return Math.sqrt(c[0]*c[0]+c[1]*c[1])}function mc(c,n,u,y,I){if(!n[0]&&!n[1])return c;let k=Nt.convert(n)._mult(I);u==="viewport"&&k._rotate(-y);let R=[];for(let q=0;q<c.length;q++)R.push(c[q].sub(k));return R}ui("CircleBucket",zu,{omit:["layers"]});let Lu=new io({"circle-sort-key":new Pi(St.layout_circle["circle-sort-key"])});var Ru={paint:new io({"circle-radius":new Pi(St.paint_circle["circle-radius"]),"circle-color":new Pi(St.paint_circle["circle-color"]),"circle-blur":new Pi(St.paint_circle["circle-blur"]),"circle-opacity":new Pi(St.paint_circle["circle-opacity"]),"circle-translate":new xi(St.paint_circle["circle-translate"]),"circle-translate-anchor":new xi(St.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new xi(St.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new xi(St.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Pi(St.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Pi(St.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Pi(St.paint_circle["circle-stroke-opacity"])}),layout:Lu},ro=1e-6,co=typeof Float32Array<"u"?Float32Array:Array;function kh(){var c=new co(9);return co!=Float32Array&&(c[1]=0,c[2]=0,c[3]=0,c[5]=0,c[6]=0,c[7]=0),c[0]=1,c[4]=1,c[8]=1,c}
801function Os(c){return c[0]=1,c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[5]=1,c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[10]=1,c[11]=0,c[12]=0,c[13]=0,c[14]=0,c[15]=1,c}function su(c,n,u){var y=n[0],I=n[1],k=n[2],R=n[3],q=n[4],G=n[5],J=n[6],ae=n[7],ce=n[8],de=n[9],ge=n[10],ye=n[11],Ue=n[12],Oe=n[13],nt=n[14],ut=n[15],tt=u[0],st=u[1],Pt=u[2],kt=u[3];return c[0]=tt*y+st*q+Pt*ce+kt*Ue,c[1]=tt*I+st*G+Pt*de+kt*Oe,c[2]=tt*k+st*J+Pt*ge+kt*nt,c[3]=tt*R+st*ae+Pt*ye+kt*ut,c[4]=(tt=u[4])*y+(st=u[5])*q+(Pt=u[6])*ce+(kt=u[7])*Ue,c[5]=tt*I+st*G+Pt*de+kt*Oe,c[6]=tt*k+st*J+Pt*ge+kt*nt,c[7]=tt*R+st*ae+Pt*ye+kt*ut,c[8]=(tt=u[8])*y+(st=u[9])*q+(Pt=u[10])*ce+(kt=u[11])*Ue,c[9]=tt*I+st*G+Pt*de+kt*Oe,c[10]=tt*k+st*J+Pt*ge+kt*nt,c[11]=tt*R+st*ae+Pt*ye+kt*ut,c[12]=(tt=u[12])*y+(st=u[13])*q+(Pt=u[14])*ce+(kt=u[15])*Ue,c[13]=tt*I+st*G+Pt*de+kt*Oe,c[14]=tt*k+st*J+Pt*ge+kt*nt,c[15]=tt*R+st*ae+Pt*ye+kt*ut,c}Math.hypot||(Math.hypot=function(){for(var c=0,n=arguments.length;n--;)c+=arguments[n]*arguments[n];return Math.sqrt(c)});var Ul,Fu=su;function Ah(){var c=new co(3);return co!=Float32Array&&(c[0]=0,c[1]=0,c[2]=0),c}function Bu(c,n,u){var y=new co(3);return y[0]=c,y[1]=n,y[2]=u,y}function jl(c,n,u){var y=n[0],I=n[1],k=n[2],R=n[3];return c[0]=u[0]*y+u[4]*I+u[8]*k+u[12]*R,c[1]=u[1]*y+u[5]*I+u[9]*k+u[13]*R,c[2]=u[2]*y+u[6]*I+u[10]*k+u[14]*R,c[3]=u[3]*y+u[7]*I+u[11]*k+u[15]*R,c}function fc(){var c=new co(4);return co!=Float32Array&&(c[0]=0,c[1]=0,c[2]=0),c[3]=1,c}function Ou(c,n){let u=jl([],[c.x,c.y,0,1],n);return new Nt(u[0]/u[3],u[1]/u[3])}Ah(),Ul=new co(4),co!=Float32Array&&(Ul[0]=0,Ul[1]=0,Ul[2]=0,Ul[3]=0),Ah(),Bu(1,0,0),Bu(0,1,0),fc(),fc(),kh(),(function(){var c;c=new co(2),co!=Float32Array&&(c[0]=0,c[1]=0)})();class zh extends zu{}ui("HeatmapBucket",zh,{omit:["layers"]});var Hc={paint:new io({"heatmap-radius":new Pi(St.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Pi(St.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new xi(St.paint_heatmap["heatmap-intensity"]),"heatmap-color":new ds(St.paint_heatmap["heatmap-color"]),"heatmap-opacity":new xi(St.paint_heatmap["heatmap-opacity"])})};function lu(c,{width:n,height:u},y,I){if(I){if(I instanceof Uint8ClampedArray)I=new Uint8Array(I.buffer);else if(I.length!==n*u*y)throw new RangeError(`mismatched image size. expected: ${I.length} but got: ${n*u*y}`)}else I=new Uint8Array(n*u*y);return c.width=n,c.height=u,c.data=I,c}function cu(c,{width:n,height:u},y){if(n===c.width&&u===c.height)return;let I=lu({},{width:n,height:u},y);Dh(c,I,{x:0,y:0},{x:0,y:0},{width:Math.min(c.width,n),height:Math.min(c.height,u)},y),c.width=n,c.height=u,c.data=I.data}function Dh(c,n,u,y,I,k){if(I.width===0||I.height===0)return n;if(I.width>c.width||I.height>c.height||u.x>c.width-I.width||u.y>c.height-I.height)throw new RangeError("out of range source coordinates for image copy");if(I.width>n.width||I.height>n.height||y.x>n.width-I.width||y.y>n.height-I.height)throw new RangeError("out of range destination coordinates for image copy");let R=c.data,q=n.data;if(R===q)throw new Error("srcData equals dstData, so image is already copied");for(let G=0;G<I.height;G++){let J=((u.y+G)*c.width+u.x)*k,ae=((y.y+G)*n.width+y.x)*k;for(let ce=0;ce<I.width*k;ce++)q[ae+ce]=R[J+ce]}return n}class Xc{constructor(n,u){lu(this,n,1,u)}resize(n){cu(this,n,1)}clone(){return new Xc({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(n,u,y,I,k){Dh(n,u,y,I,k,1)}}class _{constructor(n,u){lu(this,n,4,u)}resize(n){cu(this,n,4)}replace(n,u){u?this.data.set(n):this.data=n instanceof Uint8ClampedArray?new Uint8Array(n.buffer):n}clone(){return new _({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(n,u,y,I,k){Dh(n,u,y,I,k,4)}}function t(c){let n={},u=c.resolution||256,y=c.clips?c.clips.length:1,I=c.image||new _({width:u,height:y});if(Math.log(u)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${u}`);let k=(R,q,G)=>{n[c.evaluationKey]=G;let J=c.expression.evaluate(n);I.data[R+q+0]=Math.floor(255*J.r/J.a),I.data[R+q+1]=Math.floor(255*J.g/J.a),I.data[R+q+2]=Math.floor(255*J.b/J.a),I.data[R+q+3]=Math.floor(255*J.a)};if(c.clips)for(let R=0,q=0;R<y;++R,q+=4*u)for(let G=0,J=0;G<u;G++,J+=4){let ae=G/(u-1),{start:ce,end:de}=c.clips[R];k(q,J,ce*(1-ae)+de*ae)}else for(let R=0,q=0;R<u;R++,q+=4)k(0,q,R/(u-1));return I}ui("AlphaImage",Xc),ui("RGBAImage",_);var a={paint:new io({"hillshade-illumination-direction":new xi(St.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new xi(St.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new xi(St.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new xi(St.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new xi(St.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new xi(St.paint_hillshade["hillshade-accent-color"])})};let p=wn([{name:"a_pos",components:2,type:"Int16"}],4),{members:f}=p;var b={exports:{}};function P(c,n,u){u=u||2;var y,I,k,R,q,G,J,ae=n&&n.length,ce=ae?n[0]*u:c.length,de=D(c,0,ce,u,!0),ge=[];if(!de||de.next===de.prev)return ge;if(ae&&(de=(function(Ue,Oe,nt,ut){var tt,st,Pt,kt=[];for(tt=0,st=Oe.length;tt<st;tt++)(Pt=D(Ue,Oe[tt]*ut,tt<st-1?Oe[tt+1]*ut:Ue.length,ut,!1))===Pt.next&&(Pt.steiner=!0),kt.push(De(Pt));
801for(kt.sort(_e),tt=0;tt<kt.length;tt++)nt=Ie(kt[tt],nt);return nt})(c,n,de,u)),c.length>80*u){y=k=c[0],I=R=c[1];for(var ye=u;ye<ce;ye+=u)(q=c[ye])<y&&(y=q),(G=c[ye+1])<I&&(I=G),q>k&&(k=q),G>R&&(R=G);J=(J=Math.max(k-y,R-I))!==0?32767/J:0}return U(de,ge,u,y,I,J,0),ge}function D(c,n,u,y,I){var k,R;if(I===Et(c,n,u,y)>0)for(k=n;k<u;k+=y)R=Dt(k,c[k],c[k+1],R);else for(k=u-y;k>=n;k-=y)R=Dt(k,c[k],c[k+1],R);return R&&qe(R,R.next)&&(_i(R),R=R.next),R}function B(c,n){if(!c)return c;n||(n=c);var u,y=c;do if(u=!1,y.steiner||!qe(y,y.next)&&we(y.prev,y,y.next)!==0)y=y.next;else{if(_i(y),(y=n=y.prev)===y.next)break;u=!0}while(u||y!==n);return n}function U(c,n,u,y,I,k,R){if(c){!R&&k&&(function(ae,ce,de,ge){var ye=ae;do ye.z===0&&(ye.z=Ee(ye.x,ye.y,ce,de,ge)),ye.prevZ=ye.prev,ye.nextZ=ye.next,ye=ye.next;while(ye!==ae);ye.prevZ.nextZ=null,ye.prevZ=null,(function(Ue){var Oe,nt,ut,tt,st,Pt,kt,di,bi=1;do{for(nt=Ue,Ue=null,st=null,Pt=0;nt;){for(Pt++,ut=nt,kt=0,Oe=0;Oe<bi&&(kt++,ut=ut.nextZ);Oe++);for(di=bi;kt>0||di>0&&ut;)kt!==0&&(di===0||!ut||nt.z<=ut.z)?(tt=nt,nt=nt.nextZ,kt--):(tt=ut,ut=ut.nextZ,di--),st?st.nextZ=tt:Ue=tt,tt.prevZ=st,st=tt;nt=ut}st.nextZ=null,bi*=2}while(Pt>1)})(ye)})(c,y,I,k);for(var q,G,J=c;c.prev!==c.next;)if(q=c.prev,G=c.next,k?Y(c,y,I,k):$(c))n.push(q.i/u|0),n.push(c.i/u|0),n.push(G.i/u|0),_i(c),c=G.next,J=G.next;else if((c=G)===J){R?R===1?U(c=ee(B(c),n,u),n,u,y,I,k,2):R===2&&oe(c,n,u,y,I,k):U(B(c),n,u,y,I,k,1);break}}}function $(c){var n=c.prev,u=c,y=c.next;if(we(n,u,y)>=0)return!1;for(var I=n.x,k=u.x,R=y.x,q=n.y,G=u.y,J=y.y,ae=I<k?I<R?I:R:k<R?k:R,ce=q<G?q<J?q:J:G<J?G:J,de=I>k?I>R?I:R:k>R?k:R,ge=q>G?q>J?q:J:G>J?G:J,ye=y.next;ye!==n;){if(ye.x>=ae&&ye.x<=de&&ye.y>=ce&&ye.y<=ge&&je(I,q,k,G,R,J,ye.x,ye.y)&&we(ye.prev,ye,ye.next)>=0)return!1;ye=ye.next}return!0}function Y(c,n,u,y){var I=c.prev,k=c,R=c.next;if(we(I,k,R)>=0)return!1;for(var q=I.x,G=k.x,J=R.x,ae=I.y,ce=k.y,de=R.y,ge=q<G?q<J?q:J:G<J?G:J,ye=ae<ce?ae<de?ae:de:ce<de?ce:de,Ue=q>G?q>J?q:J:G>J?G:J,Oe=ae>ce?ae>de?ae:de:ce>de?ce:de,nt=Ee(ge,ye,n,u,y),ut=Ee(Ue,Oe,n,u,y),tt=c.prevZ,st=c.nextZ;tt&&tt.z>=nt&&st&&st.z<=ut;){if(tt.x>=ge&&tt.x<=Ue&&tt.y>=ye&&tt.y<=Oe&&tt!==I&&tt!==R&&je(q,ae,G,ce,J,de,tt.x,tt.y)&&we(tt.prev,tt,tt.next)>=0||(tt=tt.prevZ,st.x>=ge&&st.x<=Ue&&st.y>=ye&&st.y<=Oe&&st!==I&&st!==R&&je(q,ae,G,ce,J,de,st.x,st.y)&&we(st.prev,st,st.next)>=0))return!1;st=st.nextZ}for(;tt&&tt.z>=nt;){if(tt.x>=ge&&tt.x<=Ue&&tt.y>=ye&&tt.y<=Oe&&tt!==I&&tt!==R&&je(q,ae,G,ce,J,de,tt.x,tt.y)&&we(tt.prev,tt,tt.next)>=0)return!1;tt=tt.prevZ}for(;st&&st.z<=ut;){if(st.x>=ge&&st.x<=Ue&&st.y>=ye&&st.y<=Oe&&st!==I&&st!==R&&je(q,ae,G,ce,J,de,st.x,st.y)&&we(st.prev,st,st.next)>=0)return!1;st=st.nextZ}return!0}function ee(c,n,u){var y=c;do{var I=y.prev,k=y.next.next;!qe(I,k)&&Fe(I,y,y.next,k)&&_t(I,k)&&_t(k,I)&&(n.push(I.i/u|0),n.push(y.i/u|0),n.push(k.i/u|0),_i(y),_i(y.next),y=c=k),y=y.next}while(y!==c);return B(y)}function oe(c,n,u,y,I,k){var R=c;do{for(var q=R.next.next;q!==R.prev;){if(R.i!==q.i&&Le(R,q)){var G=Rt(R,q);return R=B(R,R.next),G=B(G,G.next),U(R,n,u,y,I,k,0),void U(G,n,u,y,I,k,0)}q=q.next}R=R.next}while(R!==c)}function _e(c,n){return c.x-n.x}function Ie(c,n){var u=(function(I,k){var R,q=k,G=I.x,J=I.y,ae=-1/0;do{if(J<=q.y&&J>=q.next.y&&q.next.y!==q.y){var ce=q.x+(J-q.y)*(q.next.x-q.x)/(q.next.y-q.y);if(ce<=G&&ce>ae&&(ae=ce,R=q.x<q.next.x?q:q.next,ce===G))return R}q=q.next}while(q!==k);if(!R)return null;var de,ge=R,ye=R.x,Ue=R.y,Oe=1/0;q=R;do G>=q.x&&q.x>=ye&&G!==q.x&&je(J<Ue?G:ae,J,ye,Ue,J<Ue?ae:G,J,q.x,q.y)&&(de=Math.abs(J-q.y)/(G-q.x),_t(q,I)&&(de<Oe||de===Oe&&(q.x>R.x||q.x===R.x&&ze(R,q)))&&(R=q,Oe=de)),q=q.next;while(q!==ge);return R})(c,n);if(!u)return n;var y=Rt(u,c);return B(y,y.next),B(u,u.next)}function ze(c,n){return we(c.prev,c,n.prev)<0&&we(n.next,c,c.next)<0}function Ee(c,n,u,y,I){return(c=1431655765&((c=858993459&((c=252645135&((c=16711935&((c=(c-u)*I|0)|c<<8))|c<<4))|c<<2))|c<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=(n-y)*I|0)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function De(c){var n=c,u=c;do(n.x<u.x||n.x===u.x&&n.y<u.y)&&(u=n),n=n.next;while(n!==c);return u}function je(c,n,u,y,I,k,R,q){return(I-R)*(n-q)>=(c-R)*(k-q)&&(c-R)*(y-q)>=(u-R)*(n-q)&&(u-R)*(k-q)>=(I-R)*(y-q)}function Le(c,n){return c.next.i!==n.i&&c.prev.i!==n.i&&!(function(u,y){var I=u;do{if(I.i!==u.i&&I.next.i!==u.i&&I.i!==y.i&&I.next.i!==y.i&&Fe(I,I.next,u,y))return!0;I=I.next}while(I!==u);return!1}
801)(c,n)&&(_t(c,n)&&_t(n,c)&&(function(u,y){var I=u,k=!1,R=(u.x+y.x)/2,q=(u.y+y.y)/2;do I.y>q!=I.next.y>q&&I.next.y!==I.y&&R<(I.next.x-I.x)*(q-I.y)/(I.next.y-I.y)+I.x&&(k=!k),I=I.next;while(I!==u);return k})(c,n)&&(we(c.prev,c,n.prev)||we(c,n.prev,n))||qe(c,n)&&we(c.prev,c,c.next)>0&&we(n.prev,n,n.next)>0)}function we(c,n,u){return(n.y-c.y)*(u.x-n.x)-(n.x-c.x)*(u.y-n.y)}function qe(c,n){return c.x===n.x&&c.y===n.y}function Fe(c,n,u,y){var I=ft(we(c,n,u)),k=ft(we(c,n,y)),R=ft(we(u,y,c)),q=ft(we(u,y,n));return I!==k&&R!==q||!(I!==0||!it(c,u,n))||!(k!==0||!it(c,y,n))||!(R!==0||!it(u,c,y))||!(q!==0||!it(u,n,y))}function it(c,n,u){return n.x<=Math.max(c.x,u.x)&&n.x>=Math.min(c.x,u.x)&&n.y<=Math.max(c.y,u.y)&&n.y>=Math.min(c.y,u.y)}function ft(c){return c>0?1:c<0?-1:0}function _t(c,n){return we(c.prev,c,c.next)<0?we(c,n,c.next)>=0&&we(c,c.prev,n)>=0:we(c,n,c.prev)<0||we(c,c.next,n)<0}function Rt(c,n){var u=new Gt(c.i,c.x,c.y),y=new Gt(n.i,n.x,n.y),I=c.next,k=n.prev;return c.next=n,n.prev=c,u.next=I,I.prev=u,y.next=u,u.prev=y,k.next=y,y.prev=k,y}function Dt(c,n,u,y){var I=new Gt(c,n,u);return y?(I.next=y.next,I.prev=y,y.next.prev=I,y.next=I):(I.prev=I,I.next=I),I}function _i(c){c.next.prev=c.prev,c.prev.next=c.next,c.prevZ&&(c.prevZ.nextZ=c.nextZ),c.nextZ&&(c.nextZ.prevZ=c.prevZ)}function Gt(c,n,u){this.i=c,this.x=n,this.y=u,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Et(c,n,u,y){for(var I=0,k=n,R=u-y;k<u;k+=y)I+=(c[R]-c[k])*(c[k+1]+c[R+1]),R=k;return I}function ti(c,n,u,y,I){Ci(c,n,u||0,y||c.length-1,I||Pn)}function Ci(c,n,u,y,I){for(;y>u;){if(y-u>600){var k=y-u+1,R=n-u+1,q=Math.log(k),G=.5*Math.exp(2*q/3),J=.5*Math.sqrt(q*G*(k-G)/k)*(R-k/2<0?-1:1);Ci(c,n,Math.max(u,Math.floor(n-R*G/k+J)),Math.min(y,Math.floor(n+(k-R)*G/k+J)),I)}var ae=c[n],ce=u,de=y;for(fr(c,u,n),I(c[y],ae)>0&&fr(c,u,y);ce<de;){for(fr(c,ce,de),ce++,de--;I(c[ce],ae)<0;)ce++;for(;I(c[de],ae)>0;)de--}I(c[u],ae)===0?fr(c,u,de):fr(c,++de,y),de<=n&&(u=de+1),n<=de&&(y=de-1)}}function fr(c,n,u){var y=c[n];c[n]=c[u],c[u]=y}function Pn(c,n){return c<n?-1:c>n?1:0}function kr(c,n){let u=c.length;if(u<=1)return[c];let y=[],I,k;for(let R=0;R<u;R++){let q=wi(c[R]);q!==0&&(c[R].area=Math.abs(q),k===void 0&&(k=q<0),k===q<0?(I&&y.push(I),I=[c[R]]):I.push(c[R]))}if(I&&y.push(I),n>1)for(let R=0;R<y.length;R++)y[R].length<=n||(ti(y[R],n,1,y[R].length-1,qn),y[R]=y[R].slice(0,n));return y}function qn(c,n){return n.area-c.area}function kn(c,n,u){let y=u.patternDependencies,I=!1;for(let k of n){let R=k.paint.get(`${c}-pattern`);R.isConstant()||(I=!0);let q=R.constantOr(null);q&&(I=!0,y[q.to]=!0,y[q.from]=!0)}return I}function ho(c,n,u,y,I){let k=I.patternDependencies;for(let R of n){let q=R.paint.get(`${c}-pattern`).value;if(q.kind!=="constant"){let G=q.evaluate({zoom:y-1},u,{},I.availableImages),J=q.evaluate({zoom:y},u,{},I.availableImages),ae=q.evaluate({zoom:y+1},u,{},I.availableImages);G=G&&G.name?G.name:G,J=J&&J.name?J.name:J,ae=ae&&ae.name?ae.name:ae,k[G]=!0,k[J]=!0,k[ae]=!0,u.patterns[R.id]={min:G,mid:J,max:ae}}}return u}b.exports=P,b.exports.default=P,P.deviation=function(c,n,u,y){var I=n&&n.length,k=Math.abs(Et(c,0,I?n[0]*u:c.length,u));if(I)for(var R=0,q=n.length;R<q;R++)k-=Math.abs(Et(c,n[R]*u,R<q-1?n[R+1]*u:c.length,u));var G=0;for(R=0;R<y.length;R+=3){var J=y[R]*u,ae=y[R+1]*u,ce=y[R+2]*u;G+=Math.abs((c[J]-c[ce])*(c[ae+1]-c[J+1])-(c[J]-c[ae])*(c[ce+1]-c[J+1]))}return k===0&&G===0?0:Math.abs((G-k)/k)},P.flatten=function(c){for(var n=c[0][0].length,u={vertices:[],holes:[],dimensions:n},y=0,I=0;I<c.length;I++){for(var k=0;k<c[I].length;k++)for(var R=0;R<n;R++)u.vertices.push(c[I][k][R]);I>0&&u.holes.push(y+=c[I-1].length)}return u};class tn{constructor(n){this.zoom=n.zoom,this.overscaling=n.overscaling,this.layers=n.layers,this.layerIds=this.layers.map((u=>u.id)),this.index=n.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new tr,this.indexArray=new hn,this.indexArray2=new Kn,this.programConfigurations=new Nl(n.layers,n.zoom),this.segments=new Ki,this.segments2=new Ki,this.stateDependentLayerIds=this.layers.filter((u=>u.isStateDependent())).map((u=>u.id))}
801populate(n,u,y){this.hasPattern=kn("fill",this.layers,u);let I=this.layers[0].layout.get("fill-sort-key"),k=!I.isConstant(),R=[];for(let{feature:q,id:G,index:J,sourceLayerIndex:ae}of n){let ce=this.layers[0]._featureFilter.needGeometry,de=Ii(q,ce);if(!this.layers[0]._featureFilter.filter(new Nr(this.zoom),de,y))continue;let ge=k?I.evaluate(de,{},y,u.availableImages):void 0,ye={id:G,properties:q.properties,type:q.type,sourceLayerIndex:ae,index:J,geometry:ce?de.geometry:mi(q),patterns:{},sortKey:ge};R.push(ye)}k&&R.sort(((q,G)=>q.sortKey-G.sortKey));for(let q of R){let{geometry:G,index:J,sourceLayerIndex:ae}=q;if(this.hasPattern){let ce=ho("fill",this.layers,q,this.zoom,u);this.patternFeatures.push(ce)}else this.addFeature(q,G,J,y,{});u.featureIndex.insert(n[J].feature,G,J,ae,this.index)}}update(n,u,y){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(n,u,this.stateDependentLayers,y)}addFeatures(n,u,y){for(let I of this.patternFeatures)this.addFeature(I,I.geometry,I.index,u,y)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(n){this.uploaded||(this.layoutVertexBuffer=n.createVertexBuffer(this.layoutVertexArray,f),this.indexBuffer=n.createIndexBuffer(this.indexArray),this.indexBuffer2=n.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(n),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(n,u,y,I,k){for(let R of kr(u,500)){let q=0;for(let ge of R)q+=ge.length;let G=this.segments.prepareSegment(q,this.layoutVertexArray,this.indexArray),J=G.vertexLength,ae=[],ce=[];for(let ge of R){if(ge.length===0)continue;ge!==R[0]&&ce.push(ae.length/2);let ye=this.segments2.prepareSegment(ge.length,this.layoutVertexArray,this.indexArray2),Ue=ye.vertexLength;this.layoutVertexArray.emplaceBack(ge[0].x,ge[0].y),this.indexArray2.emplaceBack(Ue+ge.length-1,Ue),ae.push(ge[0].x),ae.push(ge[0].y);for(let Oe=1;Oe<ge.length;Oe++)this.layoutVertexArray.emplaceBack(ge[Oe].x,ge[Oe].y),this.indexArray2.emplaceBack(Ue+Oe-1,Ue+Oe),ae.push(ge[Oe].x),ae.push(ge[Oe].y);ye.vertexLength+=ge.length,ye.primitiveLength+=ge.length}let de=b.exports(ae,ce);for(let ge=0;ge<de.length;ge+=3)this.indexArray.emplaceBack(J+de[ge],J+de[ge+1],J+de[ge+2]);G.vertexLength+=q,G.primitiveLength+=de.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,n,y,k,I)}}ui("FillBucket",tn,{omit:["layers","patternFeatures"]});let sa=new io({"fill-sort-key":new Pi(St.layout_fill["fill-sort-key"])});var Eo={paint:new io({"fill-antialias":new xi(St.paint_fill["fill-antialias"]),"fill-opacity":new Pi(St.paint_fill["fill-opacity"]),"fill-color":new Pi(St.paint_fill["fill-color"]),"fill-outline-color":new Pi(St.paint_fill["fill-outline-color"]),"fill-translate":new xi(St.paint_fill["fill-translate"]),"fill-translate-anchor":new xi(St.paint_fill["fill-translate-anchor"]),"fill-pattern":new Za(St.paint_fill["fill-pattern"])}),layout:sa};let uo=wn([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),jo=wn([{name:"a_centroid",components:2,type:"Int16"}],4),{members:gc}=uo;var la={},_c=Nt,Mo=Aa;function Aa(c,n,u,y,I){this.properties={},this.extent=u,this.type=0,this._pbf=c,this._geometry=-1,this._keys=y,this._values=I,c.readFields(yc,this,n)}function yc(c,n,u){c==1?n.id=u.readVarint():c==2?(function(y,I){for(var k=y.readVarint()+y.pos;y.pos<k;){var R=I._keys[y.readVarint()],q=I._values[y.readVarint()];I.properties[R]=q}})(u,n):c==3?n.type=u.readVarint():c==4&&(n._geometry=u.pos)}function Vu(c){for(var n,u,y=0,I=0,k=c.length,R=k-1;I<k;R=I++)y+=((u=c[R]).x-(n=c[I]).x)*(n.y+u.y);return y}Aa.types=["Unknown","Point","LineString","Polygon"],Aa.prototype.loadGeometry=function(){var c=this._pbf;c.pos=this._geometry;for(var n,u=c.readVarint()+c.pos,y=1,I=0,k=0,R=0,q=[];c.pos<u;){if(I<=0){var G=c.readVarint();y=7&G,I=G>>3}if(I--,y===1||y===2)k+=c.readSVarint(),R+=c.readSVarint(),y===1&&(n&&q.push(n),n=[]),n.push(new _c(k,R));else{if(y!==7)throw new Error("unknown command "+y);n&&n.push(n[0].clone())}}return n&&q.push(n),q},Aa.prototype.bbox=function(){var c=this._pbf;c.pos=this._geometry;for(var n=c.readVarint()+c.pos,u=1,y=0,I=0,k=0,R=1/0,q=-1/0,G=1/0,J=-1/0;c.pos<n;){if(y<=0){var ae=c.readVarint();u=7&ae,y=ae>>3}if(y--,u===1||u===2)(I+=c.readSVarint())<R&&(R=I),I>
801q&&(q=I),(k+=c.readSVarint())<G&&(G=k),k>J&&(J=k);else if(u!==7)throw new Error("unknown command "+u)}return[R,G,q,J]},Aa.prototype.toGeoJSON=function(c,n,u){var y,I,k=this.extent*Math.pow(2,u),R=this.extent*c,q=this.extent*n,G=this.loadGeometry(),J=Aa.types[this.type];function ae(ge){for(var ye=0;ye<ge.length;ye++){var Ue=ge[ye];ge[ye]=[360*(Ue.x+R)/k-180,360/Math.PI*Math.atan(Math.exp((180-360*(Ue.y+q)/k)*Math.PI/180))-90]}}switch(this.type){case 1:var ce=[];for(y=0;y<G.length;y++)ce[y]=G[y][0];ae(G=ce);break;case 2:for(y=0;y<G.length;y++)ae(G[y]);break;case 3:for(G=(function(ge){var ye=ge.length;if(ye<=1)return[ge];for(var Ue,Oe,nt=[],ut=0;ut<ye;ut++){var tt=Vu(ge[ut]);tt!==0&&(Oe===void 0&&(Oe=tt<0),Oe===tt<0?(Ue&&nt.push(Ue),Ue=[ge[ut]]):Ue.push(ge[ut]))}return Ue&&nt.push(Ue),nt})(G),y=0;y<G.length;y++)for(I=0;I<G[y].length;I++)ae(G[y][I])}G.length===1?G=G[0]:J="Multi"+J;var de={type:"Feature",geometry:{type:J,coordinates:G},properties:this.properties};return"id"in this&&(de.id=this.id),de};var pl=Mo,Vs=za;function za(c,n){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=c,this._keys=[],this._values=[],this._features=[],c.readFields(ys,this,n),this.length=this._features.length}function ys(c,n,u){c===15?n.version=u.readVarint():c===1?n.name=u.readString():c===5?n.extent=u.readVarint():c===2?n._features.push(u.pos):c===3?n._keys.push(u.readString()):c===4&&n._values.push((function(y){for(var I=null,k=y.readVarint()+y.pos;y.pos<k;){var R=y.readVarint()>>3;I=R===1?y.readString():R===2?y.readFloat():R===3?y.readDouble():R===4?y.readVarint64():R===5?y.readVarint():R===6?y.readSVarint():R===7?y.readBoolean():null}return I})(u))}za.prototype.feature=function(c){if(c<0||c>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[c];var n=this._pbf.readVarint()+this._pbf.pos;return new pl(this._pbf,n,this.extent,this._keys,this._values)};var dn=Vs;function Kr(c,n,u){if(c===3){var y=new dn(u,u.readVarint()+u.pos);y.length&&(n[y.name]=y)}}la.VectorTile=function(c,n){this.layers=c.readFields(Kr,{},n)},la.VectorTileFeature=Mo,la.VectorTileLayer=Vs;let Yn=la.VectorTileFeature.types,Yr=Math.pow(2,13);function Ns(c,n,u,y,I,k,R,q){c.emplaceBack(n,u,2*Math.floor(y*Yr)+R,I*Yr*2,k*Yr*2,Math.round(q))}class Lh{constructor(n){this.zoom=n.zoom,this.overscaling=n.overscaling,this.layers=n.layers,this.layerIds=this.layers.map((u=>u.id)),this.index=n.index,this.hasPattern=!1,this.layoutVertexArray=new cr,this.centroidVertexArray=new yi,this.indexArray=new hn,this.programConfigurations=new Nl(n.layers,n.zoom),this.segments=new Ki,this.stateDependentLayerIds=this.layers.filter((u=>u.isStateDependent())).map((u=>u.id))}populate(n,u,y){this.features=[],this.hasPattern=kn("fill-extrusion",this.layers,u);for(let{feature:I,id:k,index:R,sourceLayerIndex:q}of n){let G=this.layers[0]._featureFilter.needGeometry,J=Ii(I,G);if(!this.layers[0]._featureFilter.filter(new Nr(this.zoom),J,y))continue;let ae={id:k,sourceLayerIndex:q,index:R,geometry:G?J.geometry:mi(I),properties:I.properties,type:I.type,patterns:{}};this.hasPattern?this.features.push(ho("fill-extrusion",this.layers,ae,this.zoom,u)):this.addFeature(ae,ae.geometry,R,y,{}),u.featureIndex.insert(I,ae.geometry,R,q,this.index,!0)}}addFeatures(n,u,y){for(let I of this.features){let{geometry:k}=I;this.addFeature(I,k,I.index,u,y)}}update(n,u,y){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(n,u,this.stateDependentLayers,y)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(n){this.uploaded||(this.layoutVertexBuffer=n.createVertexBuffer(this.layoutVertexArray,gc),this.centroidVertexBuffer=n.createVertexBuffer(this.centroidVertexArray,jo.members,!0),this.indexBuffer=n.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(n),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(n,u,y,I,k){let R={x:0,y:0,vertexCount:0};
801for(let q of kr(u,500)){let G=0;for(let ye of q)G+=ye.length;let J=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let ye of q){if(ye.length===0||Ap(ye))continue;let Ue=0;for(let Oe=0;Oe<ye.length;Oe++){let nt=ye[Oe];if(Oe>=1){let ut=ye[Oe-1];if(!ql(nt,ut)){J.vertexLength+4>Ki.MAX_VERTEX_ARRAY_LENGTH&&(J=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let tt=nt.sub(ut)._perp()._unit(),st=ut.dist(nt);Ue+st>32768&&(Ue=0),Ns(this.layoutVertexArray,nt.x,nt.y,tt.x,tt.y,0,0,Ue),Ns(this.layoutVertexArray,nt.x,nt.y,tt.x,tt.y,0,1,Ue),R.x+=2*nt.x,R.y+=2*nt.y,R.vertexCount+=2,Ue+=st,Ns(this.layoutVertexArray,ut.x,ut.y,tt.x,tt.y,0,0,Ue),Ns(this.layoutVertexArray,ut.x,ut.y,tt.x,tt.y,0,1,Ue),R.x+=2*ut.x,R.y+=2*ut.y,R.vertexCount+=2;let Pt=J.vertexLength;this.indexArray.emplaceBack(Pt,Pt+2,Pt+1),this.indexArray.emplaceBack(Pt+1,Pt+2,Pt+3),J.vertexLength+=4,J.primitiveLength+=2}}}}if(J.vertexLength+G>Ki.MAX_VERTEX_ARRAY_LENGTH&&(J=this.segments.prepareSegment(G,this.layoutVertexArray,this.indexArray)),Yn[n.type]!=="Polygon")continue;let ae=[],ce=[],de=J.vertexLength;for(let ye of q)if(ye.length!==0){ye!==q[0]&&ce.push(ae.length/2);for(let Ue=0;Ue<ye.length;Ue++){let Oe=ye[Ue];Ns(this.layoutVertexArray,Oe.x,Oe.y,0,0,1,1,0),R.x+=Oe.x,R.y+=Oe.y,R.vertexCount+=1,ae.push(Oe.x),ae.push(Oe.y)}}let ge=b.exports(ae,ce);for(let ye=0;ye<ge.length;ye+=3)this.indexArray.emplaceBack(de+ge[ye],de+ge[ye+2],de+ge[ye+1]);J.primitiveLength+=ge.length/3,J.vertexLength+=G}for(let q=0;q<R.vertexCount;q++)this.centroidVertexArray.emplaceBack(Math.floor(R.x/R.vertexCount),Math.floor(R.y/R.vertexCount));this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,n,y,k,I)}}function ql(c,n){return c.x===n.x&&(c.x<0||c.x>jn)||c.y===n.y&&(c.y<0||c.y>jn)}function Ap(c){return c.every((n=>n.x<0))||c.every((n=>n.x>jn))||c.every((n=>n.y<0))||c.every((n=>n.y>jn))}ui("FillExtrusionBucket",Lh,{omit:["layers","features"]});var pd={paint:new io({"fill-extrusion-opacity":new xi(St["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Pi(St["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new xi(St["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new xi(St["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Za(St["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Pi(St["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Pi(St["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new xi(St["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};function Kc(c,n){return c.x*n.x+c.y*n.y}function $l(c,n){if(c.length===1){let u=0,y=n[u++],I;for(;!I||y.equals(I);)if(I=n[u++],!I)return 1/0;for(;u<n.length;u++){let k=n[u],R=c[0],q=I.sub(y),G=k.sub(y),J=R.sub(y),ae=Kc(q,q),ce=Kc(q,G),de=Kc(G,G),ge=Kc(J,q),ye=Kc(J,G),Ue=ae*de-ce*ce,Oe=(de*ge-ce*ye)/Ue,nt=(ae*ye-ce*ge)/Ue,ut=y.z*(1-Oe-nt)+I.z*Oe+k.z*nt;if(isFinite(ut))return ut}return 1/0}{let u=1/0;for(let y of n)u=Math.min(u,y.z);return u}}let xc=wn([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:vc}=xc,zp=wn([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Dp}=zp,Nu=la.VectorTileFeature.types,Uu=Math.cos(Math.PI/180*37.5),Lp=Math.pow(2,14)/.5;class dd{constructor(n){this.zoom=n.zoom,this.overscaling=n.overscaling,this.layers=n.layers,this.layerIds=this.layers.map((u=>u.id)),this.index=n.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((u=>{this.gradients[u.id]={}})),this.layoutVertexArray=new ur,this.layoutVertexArray2=new mr,this.indexArray=new hn,this.programConfigurations=new Nl(n.layers,n.zoom),this.segments=new Ki,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((u=>u.isStateDependent())).map((u=>u.id))}populate(n,u,y){this.hasPattern=kn("line",this.layers,u);let I=this.layers[0].layout.get("line-sort-key"),k=!I.isConstant(),R=[];for(let{feature:q,id:G,index:J,sourceLayerIndex:ae}of n){let ce=this.layers[0]._featureFilter.needGeometry,de=Ii(q,ce);if(!this.layers[0]._featureFilter.filter(new Nr(this.zoom),de,y))continue;let ge=k?I.evaluate(de,{},y):void 0,ye={id:G,properties:q.properties,type:q.type,sourceLayerIndex:ae,index:J,geometry:ce?de.geometry:mi(q),patterns:{},sortKey:ge};R.push(ye)}k&&R.sort(((q,G)=>
801q.sortKey-G.sortKey));for(let q of R){let{geometry:G,index:J,sourceLayerIndex:ae}=q;if(this.hasPattern){let ce=ho("line",this.layers,q,this.zoom,u);this.patternFeatures.push(ce)}else this.addFeature(q,G,J,y,{});u.featureIndex.insert(n[J].feature,G,J,ae,this.index)}}update(n,u,y){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(n,u,this.stateDependentLayers,y)}addFeatures(n,u,y){for(let I of this.patternFeatures)this.addFeature(I,I.geometry,I.index,u,y)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(n){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=n.createVertexBuffer(this.layoutVertexArray2,Dp)),this.layoutVertexBuffer=n.createVertexBuffer(this.layoutVertexArray,vc),this.indexBuffer=n.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(n),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(n){if(n.properties&&Object.prototype.hasOwnProperty.call(n.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(n.properties,"mapbox_clip_end"))return{start:+n.properties.mapbox_clip_start,end:+n.properties.mapbox_clip_end}}addFeature(n,u,y,I,k){let R=this.layers[0].layout,q=R.get("line-join").evaluate(n,{}),G=R.get("line-cap"),J=R.get("line-miter-limit"),ae=R.get("line-round-limit");this.lineClips=this.lineFeatureClips(n);for(let ce of u)this.addLine(ce,n,q,G,J,ae);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,n,y,k,I)}addLine(n,u,y,I,k,R){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let nt=0;nt<n.length-1;nt++)this.totalDistance+=n[nt].dist(n[nt+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let q=Nu[u.type]==="Polygon",G=n.length;for(;G>=2&&n[G-1].equals(n[G-2]);)G--;let J=0;for(;J<G-1&&n[J].equals(n[J+1]);)J++;if(G<(q?3:2))return;y==="bevel"&&(k=1.05);let ae=this.overscaling<=16?122880/(512*this.overscaling):0,ce=this.segments.prepareSegment(10*G,this.layoutVertexArray,this.indexArray),de,ge,ye,Ue,Oe;this.e1=this.e2=-1,q&&(de=n[G-2],Oe=n[J].sub(de)._unit()._perp());for(let nt=J;nt<G;nt++){if(ye=nt===G-1?q?n[J+1]:void 0:n[nt+1],ye&&n[nt].equals(ye))continue;Oe&&(Ue=Oe),de&&(ge=de),de=n[nt],Oe=ye?ye.sub(de)._unit()._perp():Ue,Ue=Ue||Oe;let ut=Ue.add(Oe);ut.x===0&&ut.y===0||ut._unit();let tt=Ue.x*Oe.x+Ue.y*Oe.y,st=ut.x*Oe.x+ut.y*Oe.y,Pt=st!==0?1/st:1/0,kt=2*Math.sqrt(2-2*st),di=st<Uu&&ge&&ye,bi=Ue.x*Oe.y-Ue.y*Oe.x>0;if(di&&nt>J){let Zt=de.dist(ge);if(Zt>2*ae){let si=de.sub(de.sub(ge)._mult(ae/Zt)._round());this.updateDistance(ge,si),this.addCurrentVertex(si,Ue,0,0,ce),ge=si}}let oi=ge&&ye,Jt=oi?y:q?"butt":I;if(oi&&Jt==="round"&&(Pt<R?Jt="miter":Pt<=2&&(Jt="fakeround")),Jt==="miter"&&Pt>k&&(Jt="bevel"),Jt==="bevel"&&(Pt>2&&(Jt="flipbevel"),Pt<k&&(Jt="miter")),ge&&this.updateDistance(ge,de),Jt==="miter")ut._mult(Pt),this.addCurrentVertex(de,ut,0,0,ce);else if(Jt==="flipbevel"){if(Pt>100)ut=Oe.mult(-1);else{let Zt=Pt*Ue.add(Oe).mag()/Ue.sub(Oe).mag();ut._perp()._mult(Zt*(bi?-1:1))}this.addCurrentVertex(de,ut,0,0,ce),this.addCurrentVertex(de,ut.mult(-1),0,0,ce)}else if(Jt==="bevel"||Jt==="fakeround"){let Zt=-Math.sqrt(Pt*Pt-1),si=bi?Zt:0,ni=bi?0:Zt;if(ge&&this.addCurrentVertex(de,Ue,si,ni,ce),Jt==="fakeround"){let Vt=Math.round(180*kt/Math.PI/20);for(let Di=1;Di<Vt;Di++){let Ei=Di/Vt;if(Ei!==.5){let Ur=Ei-.5;Ei+=Ei*Ur*(Ei-1)*((1.0904+tt*(tt*(3.55645-1.43519*tt)-3.2452))*Ur*Ur+(.848013+tt*(.215638*tt-1.06021)))}let ir=Oe.sub(Ue)._mult(Ei)._add(Ue)._unit()._mult(bi?-1:1);this.addHalfVertex(de,ir.x,ir.y,!1,bi,0,ce)}}ye&&this.addCurrentVertex(de,Oe,-si,-ni,ce)}else if(Jt==="butt")this.addCurrentVertex(de,ut,0,0,ce);else if(Jt==="square"){let Zt=ge?1:-1;this.addCurrentVertex(de,ut,Zt,Zt,ce)}else Jt==="round"&&(ge&&(this.addCurrentVertex(de,Ue,0,0,ce),this.addCurrentVertex(de,Ue,1,1,ce,!0)),ye&&(this.addCurrentVertex(de,Oe,-1,-1,ce,!0),this.addCurrentVertex(de,Oe,0,0,ce)));if(di&&nt<G-1){let Zt=de.dist(ye);if(Zt>
8012*ae){let si=de.add(ye.sub(de)._mult(ae/Zt)._round());this.updateDistance(de,si),this.addCurrentVertex(si,Oe,0,0,ce),de=si}}}}addCurrentVertex(n,u,y,I,k,R=!1){let q=u.y*I-u.x,G=-u.y-u.x*I;this.addHalfVertex(n,u.x+u.y*y,u.y-u.x*y,R,!1,y,k),this.addHalfVertex(n,q,G,R,!0,-I,k),this.distance>Lp/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(n,u,y,I,k,R))}addHalfVertex({x:n,y:u},y,I,k,R,q,G){let J=.5*(this.lineClips?this.scaledDistance*(Lp-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((n<<1)+(k?1:0),(u<<1)+(R?1:0),Math.round(63*y)+128,Math.round(63*I)+128,1+(q===0?0:q<0?-1:1)|(63&J)<<2,J>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let ae=G.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,ae),G.primitiveLength++),R?this.e2=ae:this.e1=ae}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(n,u){this.distance+=n.dist(u),this.updateScaledDistance()}}ui("LineBucket",dd,{omit:["layers","patternFeatures"]});let V_=new io({"line-cap":new xi(St.layout_line["line-cap"]),"line-join":new Pi(St.layout_line["line-join"]),"line-miter-limit":new xi(St.layout_line["line-miter-limit"]),"line-round-limit":new xi(St.layout_line["line-round-limit"]),"line-sort-key":new Pi(St.layout_line["line-sort-key"])});var md={paint:new io({"line-opacity":new Pi(St.paint_line["line-opacity"]),"line-color":new Pi(St.paint_line["line-color"]),"line-translate":new xi(St.paint_line["line-translate"]),"line-translate-anchor":new xi(St.paint_line["line-translate-anchor"]),"line-width":new Pi(St.paint_line["line-width"]),"line-gap-width":new Pi(St.paint_line["line-gap-width"]),"line-offset":new Pi(St.paint_line["line-offset"]),"line-blur":new Pi(St.paint_line["line-blur"]),"line-dasharray":new sl(St.paint_line["line-dasharray"]),"line-pattern":new Za(St.paint_line["line-pattern"]),"line-gradient":new ds(St.paint_line["line-gradient"])}),layout:V_};let Vf=new class extends Pi{possiblyEvaluate(c,n){return n=new Nr(Math.floor(n.zoom),{now:n.now,fadeDuration:n.fadeDuration,zoomHistory:n.zoomHistory,transition:n.transition}),super.possiblyEvaluate(c,n)}evaluate(c,n,u,y){return n=Ct({},n,{zoom:Math.floor(n.zoom)}),super.evaluate(c,n,u,y)}}(md.paint.properties["line-width"].specification);function fd(c,n){return n>0?n+2*c:c}Vf.useIntegerZoom=!0;let Nf=wn([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Uf=wn([{name:"a_projected_pos",components:3,type:"Float32"}],4);wn([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let ju=wn([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);wn([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);let jf=wn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),qu=wn([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function gd(c,n,u){return c.sections.forEach((y=>{y.text=(function(I,k,R){let q=k.layout.get("text-transform").evaluate(R,{});return q==="uppercase"?I=I.toLocaleUpperCase():q==="lowercase"&&(I=I.toLocaleLowerCase()),Ia.applyArabicShaping&&(I=Ia.applyArabicShaping(I)),I})(y.text,n,u)})),c}wn([{name:"triangle",components:3,type:"Uint16"}]),wn([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}
801]),wn([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}
801]),wn([{type:"Float32",name:"offsetX"}]),wn([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);let Rh={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};var Po=24,_m=Fr,qf=function(c,n,u,y,I){var k,R,q=8*I-y-1,G=(1<<q)-1,J=G>>1,ae=-7,ce=u?I-1:0,de=u?-1:1,ge=c[n+ce];for(ce+=de,k=ge&(1<<-ae)-1,ge>>=-ae,ae+=q;ae>0;k=256*k+c[n+ce],ce+=de,ae-=8);for(R=k&(1<<-ae)-1,k>>=-ae,ae+=y;ae>0;R=256*R+c[n+ce],ce+=de,ae-=8);if(k===0)k=1-J;else{if(k===G)return R?NaN:1/0*(ge?-1:1);R+=Math.pow(2,y),k-=J}return(ge?-1:1)*R*Math.pow(2,k-y)},$f=function(c,n,u,y,I,k){var R,q,G,J=8*k-I-1,ae=(1<<J)-1,ce=ae>>1,de=I===23?Math.pow(2,-24)-Math.pow(2,-77):0,ge=y?0:k-1,ye=y?1:-1,Ue=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(q=isNaN(n)?1:0,R=ae):(R=Math.floor(Math.log(n)/Math.LN2),n*(G=Math.pow(2,-R))<1&&(R--,G*=2),(n+=R+ce>=1?de/G:de*Math.pow(2,1-ce))*G>=2&&(R++,G/=2),R+ce>=ae?(q=0,R=ae):R+ce>=1?(q=(n*G-1)*Math.pow(2,I),R+=ce):(q=n*Math.pow(2,ce-1)*Math.pow(2,I),R=0));I>=8;c[u+ge]=255&q,ge+=ye,q/=256,I-=8);for(R=R<<I|q,J+=I;J>0;c[u+ge]=255&R,ge+=ye,R/=256,J-=8);c[u+ge-ye]|=128*Ue};function Fr(c){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(c)?c:new Uint8Array(c||0),this.pos=0,this.type=0,this.length=this.buf.length}Fr.Varint=0,Fr.Fixed64=1,Fr.Bytes=2,Fr.Fixed32=5;var Yc,Rp=4294967296,ym=1/Rp,xm=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Jc(c){return c.type===Fr.Bytes?c.readVarint()+c.pos:c.pos+1}function $u(c,n,u){return u?4294967296*n+(c>>>0):4294967296*(n>>>0)+(c>>>0)}function vm(c,n,u){var y=n<=16383?1:n<=2097151?2:n<=268435455?3:Math.floor(Math.log(n)/(7*Math.LN2));u.realloc(y);for(var I=u.pos-1;I>=c;I--)u.buf[I+y]=u.buf[I]}function Gf(c,n){for(var u=0;u<c.length;u++)n.writeVarint(c[u])}function N_(c,n){for(var u=0;u<c.length;u++)n.writeSVarint(c[u])}function bm(c,n){for(var u=0;u<c.length;u++)n.writeFloat(c[u])}function Zf(c,n){for(var u=0;u<c.length;u++)n.writeDouble(c[u])}function wm(c,n){for(var u=0;u<c.length;u++)n.writeBoolean(c[u])}function Fp(c,n){for(var u=0;u<c.length;u++)n.writeFixed32(c[u])}function Ya(c,n){for(var u=0;u<c.length;u++)n.writeSFixed32(c[u])}function Wf(c,n){for(var u=0;u<c.length;u++)n.writeFixed64(c[u])}function Hf(c,n){for(var u=0;u<c.length;u++)n.writeSFixed64(c[u])}function Gu(c,n){return(c[n]|c[n+1]<<8|c[n+2]<<16)+16777216*c[n+3]}function Zu(c,n,u){c[u]=n,c[u+1]=n>>>8,c[u+2]=n>>>16,c[u+3]=n>>>24}function Tm(c,n){return(c[n]|c[n+1]<<8|c[n+2]<<16)+(c[n+3]<<24)}function U_(c,n,u){c===1&&u.readMessage(j_,n)}function j_(c,n,u){if(c===3){let{id:y,bitmap:I,width:k,height:R,left:q,top:G,advance:J}=u.readMessage(Xf,{});n.push({id:y,bitmap:new Xc({width:k+6,height:R+6},I),metrics:{width:k,height:R,left:q,top:G,advance:J}})}}function Xf(c,n,u){c===1?n.id=u.readVarint():c===2?n.bitmap=u.readBytes():c===3?n.width=u.readVarint():c===4?n.height=u.readVarint():c===5?n.left=u.readSVarint():c===6?n.top=u.readSVarint():c===7&&(n.advance=u.readVarint())}function Kf(c){let n=0,u=0;for(let R of c)n+=R.w*R.h,u=Math.max(u,R.w);c.sort(((R,q)=>q.h-R.h));let y=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(n/.95)),u),h:1/0}],I=0,k=0;for(let R of c)for(let q=y.length-1;q>=0;q--){let G=y[q];if(!(R.w>G.w||R.h>
801G.h)){if(R.x=G.x,R.y=G.y,k=Math.max(k,R.y+R.h),I=Math.max(I,R.x+R.w),R.w===G.w&&R.h===G.h){let J=y.pop();q<y.length&&(y[q]=J)}else R.h===G.h?(G.x+=R.w,G.w-=R.w):R.w===G.w?(G.y+=R.h,G.h-=R.h):(y.push({x:G.x+R.w,y:G.y,w:G.w-R.w,h:R.h}),G.y+=R.h,G.h-=R.h);break}}return{w:I,h:k,fill:n/(I*k)||0}}Fr.prototype={destroy:function(){this.buf=null},readFields:function(c,n,u){for(u=u||this.length;this.pos<u;){var y=this.readVarint(),I=y>>3,k=this.pos;this.type=7&y,c(I,n,this),this.pos===k&&this.skip(y)}return n},readMessage:function(c,n){return this.readFields(c,n,this.readVarint()+this.pos)},readFixed32:function(){var c=Gu(this.buf,this.pos);return this.pos+=4,c},readSFixed32:function(){var c=Tm(this.buf,this.pos);return this.pos+=4,c},readFixed64:function(){var c=Gu(this.buf,this.pos)+Gu(this.buf,this.pos+4)*Rp;return this.pos+=8,c},readSFixed64:function(){var c=Gu(this.buf,this.pos)+Tm(this.buf,this.pos+4)*Rp;return this.pos+=8,c},readFloat:function(){var c=qf(this.buf,this.pos,!0,23,4);return this.pos+=4,c},readDouble:function(){var c=qf(this.buf,this.pos,!0,52,8);return this.pos+=8,c},readVarint:function(c){var n,u,y=this.buf;return n=127&(u=y[this.pos++]),u<128?n:(n|=(127&(u=y[this.pos++]))<<7,u<128?n:(n|=(127&(u=y[this.pos++]))<<14,u<128?n:(n|=(127&(u=y[this.pos++]))<<21,u<128?n:(function(I,k,R){var q,G,J=R.buf;if(q=(112&(G=J[R.pos++]))>>4,G<128||(q|=(127&(G=J[R.pos++]))<<3,G<128)||(q|=(127&(G=J[R.pos++]))<<10,G<128)||(q|=(127&(G=J[R.pos++]))<<17,G<128)||(q|=(127&(G=J[R.pos++]))<<24,G<128)||(q|=(1&(G=J[R.pos++]))<<31,G<128))return $u(I,q,k);throw new Error("Expected varint not more than 10 bytes")})(n|=(15&(u=y[this.pos]))<<28,c,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var c=this.readVarint();return c%2==1?(c+1)/-2:c/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var c=this.readVarint()+this.pos,n=this.pos;return this.pos=c,c-n>=12&&xm?(function(u,y,I){return xm.decode(u.subarray(y,I))})(this.buf,n,c):(function(u,y,I){for(var k="",R=y;R<I;){var q,G,J,ae=u[R],ce=null,de=ae>239?4:ae>223?3:ae>191?2:1;if(R+de>I)break;de===1?ae<128&&(ce=ae):de===2?(192&(q=u[R+1]))==128&&(ce=(31&ae)<<6|63&q)<=127&&(ce=null):de===3?(G=u[R+2],(192&(q=u[R+1]))==128&&(192&G)==128&&((ce=(15&ae)<<12|(63&q)<<6|63&G)<=2047||ce>=55296&&ce<=57343)&&(ce=null)):de===4&&(G=u[R+2],J=u[R+3],(192&(q=u[R+1]))==128&&(192&G)==128&&(192&J)==128&&((ce=(15&ae)<<18|(63&q)<<12|(63&G)<<6|63&J)<=65535||ce>=1114112)&&(ce=null)),ce===null?(ce=65533,de=1):ce>65535&&(ce-=65536,k+=String.fromCharCode(ce>>>10&1023|55296),ce=56320|1023&ce),k+=String.fromCharCode(ce),R+=de}return k})(this.buf,n,c)},readBytes:function(){var c=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,c);return this.pos=c,n}
vendor: 5,635 bytes, line 801
801,readPackedVarint:function(c,n){if(this.type!==Fr.Bytes)return c.push(this.readVarint(n));var u=Jc(this);for(c=c||[];this.pos<u;)c.push(this.readVarint(n));return c},readPackedSVarint:function(c){if(this.type!==Fr.Bytes)return c.push(this.readSVarint());var n=Jc(this);for(c=c||[];this.pos<n;)c.push(this.readSVarint());return c},readPackedBoolean:function(c){if(this.type!==Fr.Bytes)return c.push(this.readBoolean());var n=Jc(this);for(c=c||[];this.pos<n;)c.push(this.readBoolean());return c},readPackedFloat:function(c){if(this.type!==Fr.Bytes)return c.push(this.readFloat());var n=Jc(this);for(c=c||[];this.pos<n;)c.push(this.readFloat());return c},readPackedDouble:function(c){if(this.type!==Fr.Bytes)return c.push(this.readDouble());var n=Jc(this);for(c=c||[];this.pos<n;)c.push(this.readDouble());return c},readPackedFixed32:function(c){if(this.type!==Fr.Bytes)return c.push(this.readFixed32());var n=Jc(this);for(c=c||[];this.pos<n;)c.push(this.readFixed32());return c},readPackedSFixed32:function(c){if(this.type!==Fr.Bytes)return c.push(this.readSFixed32());var n=Jc(this);for(c=c||[];this.pos<n;)c.push(this.readSFixed32());return c},readPackedFixed64:function(c){if(this.type!==Fr.Bytes)return c.push(this.readFixed64());var n=Jc(this);for(c=c||[];this.pos<n;)c.push(this.readFixed64());return c},readPackedSFixed64:function(c){if(this.type!==Fr.Bytes)return c.push(this.readSFixed64());var n=Jc(this);for(c=c||[];this.pos<n;)c.push(this.readSFixed64());return c},skip:function(c){var n=7&c;if(n===Fr.Varint)for(;this.buf[this.pos++]>127;);else if(n===Fr.Bytes)this.pos=this.readVarint()+this.pos;else if(n===Fr.Fixed32)this.pos+=4;else{if(n!==Fr.Fixed64)throw new Error("Unimplemented type: "+n);this.pos+=8}},writeTag:function(c,n){this.writeVarint(c<<3|n)},realloc:function(c){for(var n=this.length||16;n<this.pos+c;)n*=2;if(n!==this.length){var u=new Uint8Array(n);u.set(this.buf),this.buf=u,this.length=n}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(c){this.realloc(4),Zu(this.buf,c,this.pos),this.pos+=4},writeSFixed32:function(c){this.realloc(4),Zu(this.buf,c,this.pos),this.pos+=4},writeFixed64:function(c){this.realloc(8),Zu(this.buf,-1&c,this.pos),Zu(this.buf,Math.floor(c*ym),this.pos+4),this.pos+=8},writeSFixed64:function(c){this.realloc(8),Zu(this.buf,-1&c,this.pos),Zu(this.buf,Math.floor(c*ym),this.pos+4),this.pos+=8},writeVarint:function(c){(c=+c||0)>268435455||c<0?(function(n,u){var y,I;if(n>=0?(y=n%4294967296|0,I=n/4294967296|0):(I=~(-n/4294967296),4294967295^(y=~(-n%4294967296))?y=y+1|0:(y=0,I=I+1|0)),n>=18446744073709552e3||n<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");u.realloc(10),(function(k,R,q){q.buf[q.pos++]=127&k|128,k>>>=7,q.buf[q.pos++]=127&k|128,k>>>=7,q.buf[q.pos++]=127&k|128,k>>>=7,q.buf[q.pos++]=127&k|128,q.buf[q.pos]=127&(k>>>=7)})(y,0,u),(function(k,R){var q=(7&k)<<4;R.buf[R.pos++]|=q|((k>>>=3)?128:0),k&&(R.buf[R.pos++]=127&k|((k>>>=7)?128:0),k&&(R.buf[R.pos++]=127&k|((k>>>=7)?128:0),k&&(R.buf[R.pos++]=127&k|((k>>>=7)?128:0),k&&(R.buf[R.pos++]=127&k|((k>>>=7)?128:0),k&&(R.buf[R.pos++]=127&k)))))})(I,u)})(c,this):(this.realloc(4),this.buf[this.pos++]=127&c|(c>127?128:0),c<=127||(this.buf[this.pos++]=127&(c>>>=7)|(c>127?128:0),c<=127||(this.buf[this.pos++]=127&(c>>>=7)|(c>127?128:0),c<=127||(this.buf[this.pos++]=c>>>7&127))))},writeSVarint:function(c){this.writeVarint(c<0?2*-c-1:2*c)},writeBoolean:function(c){this.writeVarint(!!c)},writeString:function(c){c=String(c),this.realloc(4*c.length),this.pos++;var n=this.pos;this.pos=(function(y,I,k){for(var R,q,G=0;G<I.length;G++){if((R=I.charCodeAt(G))>55295&&R<57344){if(!q){R>56319||G+1===I.length?(y[k++]=239,y[k++]=191,y[k++]=189):q=R;continue}if(R<56320){y[k++]=239,y[k++]=191,y[k++]=189,q=R;continue}R=q-55296<<10|R-56320|65536,q=null}else q&&(y[k++]=239,y[k++]=191,y[k++]=189,q=null);R<128?y[k++]=R:(R<2048?y[k++]=R>>6|192:(R<65536?y[k++]=R>>12|224:(y[k++]=R>>18|240,y[k++]=R>>12&63|128),y[k++]=R>>6&63|128),y[k++]=63&R|128)}return k})(this.buf,c,this.pos);var u=this.pos-n;u>=128&&vm(n,u,this),this.pos=n-1,this.writeVarint(u),this.pos+=u},writeFloat:function(c){this.realloc(4),$f(this.buf,c,this.pos,!0,23,4),this.pos+=4},writeDouble:function(c){this.realloc(8),$f(this.buf,c,this.pos,!0,52,8),this.pos+=8},writeBytes:function(c){var n=c.length;this.writeVarint(n),this.realloc(n);for(var u=0;u<n;u++)this.buf[this.pos++]=c[u]},writeRawMessage:function(c,n){this.pos++;var u=this.pos;c(n,this);var y=this.pos-u;y>=128&&vm(u,y,this),this.pos=u-1,this.writeVarint(y),this.pos+=y},writeMessage:function(c,n,u){this.writeTag(c,Fr.Bytes),this.writeRawMessage(n,u)},writePackedVarint:function(c,n){n.length&&this.writeMessage(c,Gf,n)},writePackedSVarint:function(c,n){n.length&&this.writeMessage(c,N_,n)},writePackedBoolean:function(c,n){n.length&&this.writeMessage(c,wm,n)},writePackedFloat:function(c,n){n.length&&this.writeMessage(c,bm,n)},writePackedDouble:function(c,n){n.length&&this.writeMessage(c,Zf,n)},writePackedFixed32:function(c,n){n.length&&this.writeMessage(c,Fp,n)},writePackedSFixed32:function(c,n){n.length&&this.writeMessage(c,Ya,n)},writePackedFixed64:function(c,n){n.length&&this.writeMessage(c,Wf,n)},writePackedSFixed64:function(c,n){n.length&&this.writeMessage(c,Hf,n)},writeBytesField:function(c,n){this.writeTag(c,Fr.Bytes),this.writeBytes(n)},writeFixed32Field:function(c,n){this.writeTag(c,Fr.Fixed32),this.writeFixed32(n)},writeSFixed32Field:function(c,n){this.writeTag(c,Fr.Fixed32),this.writeSFixed32(n)},writeFixed64Field:function(c,n){this.writeTag(c,Fr.Fixed64),this.writeFixed64
801(n)},writeSFixed64Field:function(c,n){this.writeTag(c,Fr.Fixed64),this.writeSFixed64(n)},writeVarintField:function(c,n){this.writeTag(c,Fr.Varint),this.writeVarint(n)},writeSVarintField:function(c,n){this.writeTag(c,Fr.Varint),this.writeSVarint(n)},writeStringField:function(c,n){this.writeTag(c,Fr.Bytes),this.writeString(n)},writeFloatField:function(c,n){this.writeTag(c,Fr.Fixed32),this.writeFloat(n)},writeDoubleField:function(c,n){this.writeTag(c,Fr.Fixed64),this.writeDouble(n)},writeBooleanField:function(c,n){this.writeVarintField(c,!!n)}};class _d{constructor(n,{pixelRatio:u,version:y,stretchX:I,stretchY:k,content:R}){this.paddedRect=n,this.pixelRatio=u,this.stretchX=I,this.stretchY=k,this.content=R,this.version=y}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class yd{constructor(n,u){let y={},I={};this.haveRenderCallbacks=[];let k=[];this.addImages(n,y,k),this.addImages(u,I,k);let{w:R,h:q}=Kf(k),G=new _({width:R||1,height:q||1});for(let J in n){let ae=n[J],ce=y[J].paddedRect;_.copy(ae.data,G,{x:0,y:0},{x:ce.x+1,y:ce.y+1},ae.data)}for(let J in u){let ae=u[J],ce=I[J].paddedRect,de=ce.x+1,ge=ce.y+1,ye=ae.data.width,Ue=ae.data.height;_.copy(ae.data,G,{x:0,y:0},{x:de,y:ge},ae.data),_.copy(ae.data,G,{x:0,y:Ue-1},{x:de,y:ge-1},{width:ye,height:1}),_.copy(ae.data,G,{x:0,y:0},{x:de,y:ge+Ue},{width:ye,height:1}),_.copy(ae.data,G,{x:ye-1,y:0},{x:de-1,y:ge},{width:1,height:Ue}),_.copy(ae.data,G,{x:0,y:0},{x:de+ye,y:ge},{width:1,height:Ue})}this.image=G,this.iconPositions=y,this.patternPositions=I}addImages(n,u,y){for(let I in n){let k=n[I],R={x:0,y:0,w:k.data.width+2,h:k.data.height+2};y.push(R),u[I]=new _d(R,k),k.hasRenderCallback&&this.haveRenderCallbacks.push(I)}}patchUpdatedImages(n,u){n.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let y in n.updatedImages)this.patchUpdatedImage(this.iconPositions[y],n.getImage(y),u),this.patchUpdatedImage(this.patternPositions[y],n.getImage(y),u)}patchUpdatedImage(n,u,y){if(!n||!u||n.version===u.version)return;n.version=u.version;let[I,k]=n.tl;y.update(u.data,void 0,{x:I,y:k})}}ui("ImagePosition",_d),ui("ImageAtlas",yd),o.WritingMode=void 0,(Yc=o.WritingMode||(o.WritingMode={}))[Yc.none=0]="none",Yc[Yc.horizontal=1]="horizontal",Yc[Yc.vertical=2]="vertical",Yc[Yc.horizontalOnly=3]="horizontalOnly";let Bp=-17;class Wu{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(n,u){let y=new Wu;return y.scale=n||1,y.fontStack=u,y}static forImage(n){let u=new Wu;return u.imageName=n,u}}class Hu{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(n,u){let y=new Hu;for(let I=0;I<n.sections.length;I++){let k=n.sections[I];k.image?y.addImageSection(k):y.addTextSection(k,u)}return y}length(){return this.text.length}getSection(n){return this.sections[this.sectionIndex[n]]}getSectionIndex(n){return this.sectionIndex[n]}getCharCode(n){return this.text.charCodeAt(n)}verticalizePunctuation(){this.text=(function(n){let u="";for(let y=0;y<n.length;y++){let I=n.charCodeAt(y+1)||null,k=n.charCodeAt(y-1)||null;u+=I&&nl(I)&&!Rh[n[y+1]]||k&&nl(k)&&!Rh[n[y-1]]||!Rh[n[y]]?n[y]:Rh[n[y]]}return u})(this.text)}trim(){let n=0;for(let y=0;y<this.text.length&&vd[this.text.charCodeAt(y)];y++)n++;let u=this.text.length;for(let y=this.text.length-1;y>=0&&y>=n&&vd[this.text.charCodeAt(y)];y--)u--;this.text=this.text.substring(n,u),this.sectionIndex=this.sectionIndex.slice(n,u)}substring(n,u){let y=new Hu;return y.text=this.text.substring(n,u),y.sectionIndex=this.sectionIndex.slice(n,u),y.sections=this.sections,y}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((n,u)=>Math.max(n,this.sections[u].scale)),0)}addTextSection(n,u){this.text+=n.text,this.sections.push(Wu.forText(n.scale,n.fontStack||u));let y=this.sections.length-1;for(let I=0;I<n.text.length;++I)this.sectionIndex.push(y)}addImageSection(n){let u=n.image?n.image.name:"";if(u.length===0)return void li("Can't add FormattedSection with an empty image.");let y=this.getNextImageSectionCharCode();y?(this.text+=String.fromCharCode(y),this.sections.push(Wu.forImage(u)),this.sectionIndex.push(this.sections.length-1)):li("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function xd(c,n,u,y,I,k,R,q,G,J,ae,ce,de,ge,ye,Ue){let Oe=Hu.fromFeature(c,I),nt;ce===o.WritingMode.vertical&&Oe.verticalizePunctuation();let{processBidirectionalText:ut,processStyledBidirectionalText:tt}=Ia;if(ut&&Oe.sections.length===1){nt=[];let kt=ut(Oe.toString(),Im(Oe,J,k,n,y,ge,ye));for(let di of kt){let bi=new Hu;bi.text=di,bi.sections=Oe.sections;for(let oi=0;oi<di.length;oi++)bi.sectionIndex.push(0);nt.push(bi)}}else if(tt){nt=[];let kt=tt(Oe.text,Oe.sectionIndex,Im(Oe,J,k,n,y,ge,ye));for(let di of kt){let bi=new Hu;bi.text=di[0],bi.sectionIndex=di[1],bi.sections=Oe.sections,nt.push(bi)}}else nt=(function(kt,di){let bi=[],oi=kt.text,Jt=0;for(let Zt of di)bi.push(kt.substring(Jt,Zt)),Jt=Zt;return Jt<oi.length&&bi.push(kt.substring(Jt,oi.length)),bi})(Oe,Im(Oe,J,k,n,y,ge,ye));let st=[],Pt={positionedLines:st,text:Oe.toString(),top:ae[1],bottom:ae[1],left:ae[0],right:ae[0],writingMode:ce,iconsInText:!1,verticalizable:!1};return(function(kt,di,bi,oi,Jt,Zt,si,ni,Vt,Di,Ei,ir){let Ur=0,rn=Bp,Dn=0,js=0,qo=ni==="right"?1:ni==="left"?0:.5,Jn=0;for(let Ln of Jt){Ln.trim();let ko=Ln.getMaxScale(),Go=(ko-1)*Po,ha={positionedGlyphs:[],lineOffset:0};kt.positionedLines[Jn]=ha;let Ja=ha.positionedGlyphs,Zo=0;if(!Ln.length()){rn+=Zt,++Jn;continue}for(let no=0;no<Ln.length();no++){let sr=Ln.getSection(no),xs=Ln.getSectionIndex(no),Wo=Ln.getCharCode(no),Ho=0,dl=null,Gl=null,Zl=null,Jr=Po,La=!(Vt===o.WritingMode.horizontal||!Ei&&!Uc(Wo)||Ei&&(vd[Wo]||(po=Wo,Yt.Arabic(po)||Yt["Arabic Supplement"](po)||Yt["Arabic Extended-A"](po)||Yt["Arabic Presentation Forms-A"](po)||Yt["Arabic Presentation Forms-B"](po))));if(sr.imageName){let qs=oi[sr.imageName];if(!qs)continue;Zl=sr.imageName,kt.iconsInText=kt.iconsInText||!0,Gl=qs.paddedRect;let Qa=qs.displaySize;sr.scale=sr.scale*Po/ir,dl={width:Qa[0],height:Qa[1],left:1,top:-3,advance:La?Qa[1]:Qa[0]},Ho=Go+(Po-Qa[1]*sr.scale),Jr=dl.advance;let wc=La?Qa[0]*sr.scale-Po*ko:Qa[1]*sr.scale-Po*ko;wc>0&&wc>Zo&&(Zo=wc)}else{let qs=bi[sr.fontStack],Qa=qs&&qs[Wo];if(Qa&&Qa.rect)Gl=Qa.rect,dl=Qa.metrics;else{let wc=di[sr.fontStack],ap=wc&&wc[Wo];if(!ap)continue;dl=ap.metrics}Ho=(ko-sr.scale)*Po}La?(kt.verticalizable=!0,Ja.push({glyph:Wo,imageName:Zl,x:Ur,y:rn+Ho,vertical:La,scale:sr.scale,fontStack:sr.fontStack,sectionIndex:xs,metrics:dl,rect:Gl}
801),Ur+=Jr*sr.scale+Di):(Ja.push({glyph:Wo,imageName:Zl,x:Ur,y:rn+Ho,vertical:La,scale:sr.scale,fontStack:sr.fontStack,sectionIndex:xs,metrics:dl,rect:Gl}),Ur+=dl.advance*sr.scale+Di)}Ja.length!==0&&(Dn=Math.max(Ur-Di,Dn),q_(Ja,0,Ja.length-1,qo,Zo)),Ur=0;let mn=Zt*ko+Zo;ha.lineOffset=Math.max(Zo,Go),rn+=mn,js=Math.max(mn,js),++Jn}var po;let $o=rn-Bp,{horizontalAlign:ca,verticalAlign:Da}=Cm(si);(function(Ln,ko,Go,ha,Ja,Zo,mn,no,sr){let xs=(ko-Go)*Ja,Wo=0;Wo=Zo!==mn?-no*ha-Bp:(-ha*sr+.5)*mn;for(let Ho of Ln)for(let dl of Ho.positionedGlyphs)dl.x+=xs,dl.y+=Wo})(kt.positionedLines,qo,ca,Da,Dn,js,Zt,$o,Jt.length),kt.top+=-Da*$o,kt.bottom=kt.top+$o,kt.left+=-ca*Dn,kt.right=kt.left+Dn})(Pt,n,u,y,nt,R,q,G,ce,J,de,Ue),!(function(kt){for(let di of kt)if(di.positionedGlyphs.length!==0)return!1;return!0})(st)&&Pt}let vd={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},bd={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 wd(c,n,u,y,I,k){if(n.imageName){let R=y[n.imageName];return R?R.displaySize[0]*n.scale*Po/k+I:0}{let R=u[n.fontStack],q=R&&R[c];return q?q.metrics.advance*n.scale+I:0}}function Sm(c,n,u,y){let I=Math.pow(c-n,2);return y?c<n?I/2:2*I:I+Math.abs(u)*u}function hu(c,n,u){let y=0;return c===10&&(y-=1e4),u&&(y+=150),c!==40&&c!==65288||(y+=50),n!==41&&n!==65289||(y+=50),y}function Xu(c,n,u,y,I,k){let R=null,q=Sm(n,u,I,k);for(let G of y){let J=Sm(n-G.x,u,I,k)+G.badness;J<=q&&(R=G,q=J)}return{index:c,x:n,priorBreak:R,badness:q}}function Yf(c){return c?Yf(c.priorBreak).concat(c.index):[]}function Im(c,n,u,y,I,k,R){if(k!=="point")return[];if(!c)return[];let q=[],G=(function(de,ge,ye,Ue,Oe,nt){let ut=0;for(let tt=0;tt<de.length();tt++){let st=de.getSection(tt);ut+=wd(de.getCharCode(tt),st,Ue,Oe,ge,nt)}return ut/Math.max(1,Math.ceil(ut/ye))})(c,n,u,y,I,R),J=c.text.indexOf("\u200B")>=0,ae=0;for(let de=0;de<c.length();de++){let ge=c.getSection(de),ye=c.getCharCode(de);if(vd[ye]||(ae+=wd(ye,ge,y,I,n,R)),de<c.length()-1){let Ue=!((ce=ye)<11904||!(Yt["Bopomofo Extended"](ce)||Yt.Bopomofo(ce)||Yt["CJK Compatibility Forms"](ce)||Yt["CJK Compatibility Ideographs"](ce)||Yt["CJK Compatibility"](ce)||Yt["CJK Radicals Supplement"](ce)||Yt["CJK Strokes"](ce)||Yt["CJK Symbols and Punctuation"](ce)||Yt["CJK Unified Ideographs Extension A"](ce)||Yt["CJK Unified Ideographs"](ce)||Yt["Enclosed CJK Letters and Months"](ce)||Yt["Halfwidth and Fullwidth Forms"](ce)||Yt.Hiragana(ce)||Yt["Ideographic Description Characters"](ce)||Yt["Kangxi Radicals"](ce)||Yt["Katakana Phonetic Extensions"](ce)||Yt.Katakana(ce)||Yt["Vertical Forms"](ce)||Yt["Yi Radicals"](ce)||Yt["Yi Syllables"](ce)));(bd[ye]||Ue||ge.imageName)&&q.push(Xu(de+1,ae,G,q,hu(ye,c.getCharCode(de+1),Ue&&J),!1))}}var ce;return Yf(Xu(c.length(),ae,G,q,0,!0))}function Cm(c){let n=.5,u=.5;switch(c){case"right":case"top-right":case"bottom-right":n=1;break;case"left":case"top-left":case"bottom-left":n=0}switch(c){case"bottom":case"bottom-right":case"bottom-left":u=1;break;case"top":case"top-right":case"top-left":u=0}return{horizontalAlign:n,verticalAlign:u}}function q_(c,n,u,y,I){if(!y&&!I)return;let k=c[u],R=(c[u].x+k.metrics.advance*k.scale)*y;for(let q=n;q<=u;q++)c[q].x-=R,c[q].y+=I}function $_(c,n,u){let{horizontalAlign:y,verticalAlign:I}=Cm(u),k=n[0]-c.displaySize[0]*y,R=n[1]-c.displaySize[1]*I;return{image:c,top:R,bottom:R+c.displaySize[1],left:k,right:k+c.displaySize[0]}}function Jf(c,n,u,y,I,k){let R=c.image,q;if(R.content){let Oe=R.content,nt=R.pixelRatio||1;q=[Oe[0]/nt,Oe[1]/nt,R.displaySize[0]-Oe[2]/nt,R.displaySize[1]-Oe[3]/nt]}let G=n.left*k,J=n.right*k,ae,ce,de,ge;u==="width"||u==="both"?(ge=I[0]+G-y[3],ce=I[0]+J+y[1]):(ge=I[0]+(G+J-R.displaySize[0])/2,ce=ge+R.displaySize[0]);let ye=n.top*k,Ue=n.bottom*k;return u==="height"||u==="both"?(ae=I[1]+ye-y[0],de=I[1]+Ue+y[2]):(ae=I[1]+(ye+Ue-R.displaySize[1])/2,de=ae+R.displaySize[1]),{image:R,top:ae,right:ce,bottom:de,left:ge,collisionPadding:q}}let Qc=128;function Td(c,n){let{expression:u}=n;if(u.kind==="constant")return{kind:"constant",layoutSize:u.evaluate(new Nr(c+1))};if(u.kind==="source")return{kind:"source"};{let{zoomStops:y,interpolationType:I}=u,k=0;for(;k<y.length&&y[k]<=c;)k++;k=Math.max(0,k-1);let R=k;for(;R<y.length&&y[R]<c+1;)R++;R=Math.min(y.length-1,R);let q=y[k],G=y[R];return u.kind==="composite"?{kind:"composite",minZoom:q,maxZoom:G,interpolationType:I}:{kind:"camera",minZoom:q,maxZoom:G,minSize:u.evaluate(new Nr(q)),maxSize:u.evaluate(new Nr(G)),interpolationType:I}}}class Fh extends Nt{constructor(n,u,y,I){super(n,u),this.angle=y,I!==void 0&&(this.segment=I)}clone(){return new Fh(this.x,this.y,this.angle,this.segment)}}function Em(c,n,u,y,I){if(n.segment===void 0)return!0;let k=n,R=n.segment+1,q=0;for(;q>-u/2;){if(R--,R<0)return!1;q-=c[R].dist(k),k=c[R]}q+=c[R].dist(c[R+1]),R++;let G=[],J=0;for(;q<u/2;){let ae=c[R],ce=c[R+1];if(!ce)return!1;let de=c[R-1].angleTo(ae)-ae.angleTo(ce);for(de=Math.abs((de+3*Math.PI)%(2*Math.PI)-Math.PI),G.push({distance:q,angleDelta:de}),J+=de;q-G[0].distance>y;)J-=G.shift().angleDelta;if(J>I)return!1;R++,q+=ae.dist(ce)}return!0}function Ku(c){let n=0;for(let u=0;u<c.length-1;u++)n+=c[u].dist(c[u+1]);return n}function Qf(c,n,u){return c?.6*n*u:0}function An(c,n){return Math.max(c?c.right-c.left:0,n?n.right-n.left:0)}function Yu(c,n,u,y,I,k){let R=Qf(u,I,k),q=An(u,y)*k,G=0,J=Ku(c)/2;for(let ae=0;ae<c.length-1;ae++){let ce=c[ae],de=c[ae+1],ge=ce.dist(de);
vendor: 1,136 bytes, line 801
801if(G+ge>J){let ye=(J-G)/ge,Ue=Mr(ce.x,de.x,ye),Oe=Mr(ce.y,de.y,ye),nt=new Fh(Ue,Oe,de.angleTo(ce),ae);return nt._round(),!R||Em(c,nt,q,R,n)?nt:void 0}G+=ge}}function eg(c,n,u,y,I,k,R,q,G){let J=Qf(y,k,R),ae=An(y,I),ce=ae*R,de=c[0].x===0||c[0].x===G||c[0].y===0||c[0].y===G;return n-ce<n/4&&(n=ce+n/4),Op(c,de?n/2*q%n:(ae/2+2*k)*R*q%n,n,J,u,ce,de,!1,G)}function Op(c,n,u,y,I,k,R,q,G){let J=k/2,ae=Ku(c),ce=0,de=n-u,ge=[];for(let ye=0;ye<c.length-1;ye++){let Ue=c[ye],Oe=c[ye+1],nt=Ue.dist(Oe),ut=Oe.angleTo(Ue);for(;de+u<ce+nt;){de+=u;let tt=(de-ce)/nt,st=Mr(Ue.x,Oe.x,tt),Pt=Mr(Ue.y,Oe.y,tt);if(st>=0&&st<G&&Pt>=0&&Pt<G&&de-J>=0&&de+J<=ae){let kt=new Fh(st,Pt,ut,ye);kt._round(),y&&!Em(c,kt,k,y,I)||ge.push(kt)}}ce+=nt}return q||ge.length||R||(ge=Op(c,ce/2,u,y,I,k,R,!0,G)),ge}function Vp(c,n,u,y,I){let k=[];for(let R=0;R<c.length;R++){let q=c[R],G;for(let J=0;J<q.length-1;J++){let ae=q[J],ce=q[J+1];ae.x<n&&ce.x<n||(ae.x<n?ae=new Nt(n,ae.y+(n-ae.x)/(ce.x-ae.x)*(ce.y-ae.y))._round():ce.x<n&&(ce=new Nt(n,ae.y+(n-ae.x)/(ce.x-ae.x)*(ce.y-ae.y))._round()),ae.y<u&&ce.y<u||(ae.y<u?ae=new Nt(ae.x+(u-ae.y)/(ce.y-ae.y)*(ce.x-ae.x),u)._roun
801d():ce.y<u&&(ce=new Nt(ae.x+(u-ae.y)/(ce.y-ae.y)*(ce.x-ae.x),u)._round()),ae.x>=y&&ce.x>=y||(ae.x>=y?ae=new Nt(y,ae.y+(y-ae.x)/(ce.x-ae.x)*(ce.y-ae.y))._round():ce.x>=y&&(ce=new Nt(y,ae.y+(y-ae.x)/(ce.x-ae.x)*(ce.y-ae.y))._round()),ae.y>=I&&ce.y>=I||(ae.y>=I?ae=new Nt(ae.x+(I-ae.y)/(ce.y-ae.y)*(ce.x-ae.x),I)._round():ce.y>=I&&(ce=new Nt(ae.x+(I-ae.y)/(ce.y-ae.y)*(ce.x-ae.x),I)._round()),G&&ae.equals(G[G.length-1])||(G=[ae],k.push(G)),G.push(ce)))))}}return k}function Ju(c,n,u,y){let I=[],k=c.image,R=k.pixelRatio,q=k.paddedRect.w-2,G=k.paddedRect.h-2,J=c.right-c.left,ae=c.bottom-c.top,ce=k.stretchX||[[0,q]],de=k.stretchY||[[0,G]],ge=(Zt,si)=>Zt+si[1]-si[0],ye=ce.reduce(ge,0),Ue=de.reduce(ge,0),Oe=q-ye,nt=G-Ue,ut=0,tt=ye,st=0,Pt=Ue,kt=0,di=Oe,bi=0,oi=nt;if(k.content&&y){let Zt=k.content;ut=Np(ce,0,Zt[0]),st=Np(de,0,Zt[1]),tt=Np(ce,Zt[0],Zt[2]),Pt=Np(de,Zt[1],Zt[3]),kt=Zt[0]-ut,bi=Zt[1]-st,di=Zt[2]-Zt[0]-tt,oi=Zt[3]-Zt[1]-Pt}let Jt=(Zt,si,ni,Vt)=>{let Di=Bh(Zt.stretch-ut,tt,J,c.left),Ei=Qu(Zt.fixed-kt,di,Zt.stretch,ye),ir=Bh(si.stretch-st,Pt,ae,c.top),Ur=Qu(si.fixed-bi,oi,si.stretch,Ue),rn=Bh(ni.stretch-ut,tt,J,c.left),Dn=Qu(ni.fixed-kt,di,ni.stretch,ye),js=Bh(Vt.stretch-st,Pt,ae,c.top),qo=Qu(Vt.fixed-bi,oi,Vt.stretch,Ue),Jn=new Nt(Di,ir),po=new Nt(rn,ir),$o=new Nt(rn,js),ca=new Nt(Di,js),Da=new Nt(Ei/R,Ur/R),Ln=new Nt(Dn/R,qo/R),ko=n*Math.PI/180;if(ko){let Ja=Math.sin(ko),Zo=Math.cos(ko),mn=[Zo,-Ja,Ja,Zo];Jn._matMult(mn),po._matMult(mn),ca._matMult(mn),$o._matMult(mn)}let Go=Zt.stretch+Zt.fixed,ha=si.stretch+si.fixed;return{tl:Jn,tr:po,bl:ca,br:$o,tex:{x:k.paddedRect.x+1+Go,y:k.paddedRect.y+1+ha,w:ni.stretch+ni.fixed-Go,h:Vt.stretch+Vt.fixed-ha},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Da,pixelOffsetBR:Ln,minFontScaleX:di/R/J,minFontScaleY:oi/R/ae,isSDF:u}};if(y&&(k.stretchX||k.stretchY)){let Zt=Mm(ce,Oe,ye),si=Mm(de,nt,Ue);for(let ni=0;ni<Zt.length-1;ni++){let Vt=Zt[ni],Di=Zt[ni+1];for(let Ei=0;Ei<si.length-1;Ei++)I.push(Jt(Vt,si[Ei],Di,si[Ei+1]))}}else I.push(Jt({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:q+1},{fixed:0,stretch:G+1}));return I}function Np(c,n,u){let y=0;for(let I of c)y+=Math.max(n,Math.min(u,I[1]))-Math.max(n,Math.min(u,I[0]));return y}function Mm(c,n,u){let y=[{fixed:-1,stretch:0}];for(let[I,k]of c){let R=y[y.length-1];y.push({fixed:I-R.stretch,stretch:R.stretch}),y.push({fixed:I-R.stretch,stretch:R.stretch+(k-I)})}return y.push({fixed:n+1,stretch:u}),y}function Bh(c,n,u,y){return c/n*u+y}function Qu(c,n,u,y){return c-n*u/y}ui("Anchor",Fh);class eh{constructor(n,u,y,I,k,R,q,G,J,ae){if(this.boxStartIndex=n.length,J){let ce=R.top,de=R.bottom,ge=R.collisionPadding;ge&&(ce-=ge[1],de+=ge[3]);let ye=de-ce;ye>0&&(ye=Math.max(10,ye),this.circleDiameter=ye)}else{let ce=R.top*q-G[0],de=R.bottom*q+G[2],ge=R.left*q-G[3],ye=R.right*q+G[1],Ue=R.collisionPadding;if(Ue&&(ge-=Ue[0]*q,ce-=Ue[1]*q,ye+=Ue[2]*q,de+=Ue[3]*q),ae){let Oe=new Nt(ge,ce),nt=new Nt(ye,ce),ut=new Nt(ge,de),tt=new Nt(ye,de),st=ae*Math.PI/180;Oe._rotate(st),nt._rotate(st),ut._rotate(st),tt._rotate(st),ge=Math.min(Oe.x,nt.x,ut.x,tt.x),ye=Math.max(Oe.x,nt.x,ut.x,tt.x),ce=Math.min(Oe.y,nt.y,ut.y,tt.y),de=Math.max(Oe.y,nt.y,ut.y,tt.y)}n.emplaceBack(u.x,u.y,ge,ce,ye,de,y,I,k)}this.boxEndIndex=n.length}}class Sd{constructor(n=[],u=ep){if(this.data=n,this.length=this.data.length,this.compare=u,this.length>0)for(let y=(this.length>>1)-1;y>=0;y--)this._down(y)}push(n){this.data.push(n),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;let n=this.data[0],u=this.data.pop();return this.length--,this.length>0&&(this.data[0]=u,this._down(0)),n}peek(){return this.data[0]}_up(n){let{data:u,compare:y}=this,I=u[n];for(;n>0;){let k=n-1>>1,R=u[k];if(y(I,R)>=0)break;u[n]=R,n=k}u[n]=I}_down(n){let{data:u,compare:y}=this,I=this.length>>1,k=u[n];for(;n<I;){let R=1+(n<<1),q=u[R],G=R+1;if(G<this.length&&y(u[G],q)<0&&(R=G,q=u[G]),y(q,k)>=0)break;u[n]=q,n=R}u[n]=k}}function ep(c,n){return c<n?-1:c>n?1:0}function Up(c,n=1,u=!1){let y=1/0,I=1/0,k=-1/0,R=-1/0,q=c[0];for(let ge=0;ge<q.length;ge++){let ye=q[ge];(!ge||ye.x<y)&&(y=ye.x),(!ge||ye.y<I)&&(I=ye.y),(!ge||ye.x>k)&&(k=ye.x),(!ge||ye.y>R)&&(R=ye.y)}let G=Math.min(k-y,R-I),J=G/2,ae=new Sd([],G_);if(G===0)return new Nt(y,I);for(let ge=y;ge<k;ge+=G)for(let ye=I;ye<R;
801ye+=G)ae.push(new uu(ge+J,ye+J,J,c));let ce=(function(ge){let ye=0,Ue=0,Oe=0,nt=ge[0];for(let ut=0,tt=nt.length,st=tt-1;ut<tt;st=ut++){let Pt=nt[ut],kt=nt[st],di=Pt.x*kt.y-kt.x*Pt.y;Ue+=(Pt.x+kt.x)*di,Oe+=(Pt.y+kt.y)*di,ye+=3*di}return new uu(Ue/ye,Oe/ye,0,ge)})(c),de=ae.length;for(;ae.length;){let ge=ae.pop();(ge.d>ce.d||!ce.d)&&(ce=ge,u&&console.log("found best %d after %d probes",Math.round(1e4*ge.d)/1e4,de)),ge.max-ce.d<=n||(J=ge.h/2,ae.push(new uu(ge.p.x-J,ge.p.y-J,J,c)),ae.push(new uu(ge.p.x+J,ge.p.y-J,J,c)),ae.push(new uu(ge.p.x-J,ge.p.y+J,J,c)),ae.push(new uu(ge.p.x+J,ge.p.y+J,J,c)),de+=4)}return u&&(console.log(`num probes: ${de}`),console.log(`best distance: ${ce.d}`)),ce.p}function G_(c,n){return n.max-c.max}function uu(c,n,u,y){this.p=new Nt(c,n),this.h=u,this.d=(function(I,k){let R=!1,q=1/0;for(let G=0;G<k.length;G++){let J=k[G];for(let ae=0,ce=J.length,de=ce-1;ae<ce;de=ae++){let ge=J[ae],ye=J[de];ge.y>I.y!=ye.y>I.y&&I.x<(ye.x-ge.x)*(I.y-ge.y)/(ye.y-ge.y)+ge.x&&(R=!R),q=Math.min(q,hd(I,ge,ye))}}return(R?1:-1)*Math.sqrt(q)})(this.p,y),this.max=this.d+this.h*Math.SQRT2}let th=Number.POSITIVE_INFINITY;function tg(c,n){return n[1]!==th?(function(u,y,I){let k=0,R=0;switch(y=Math.abs(y),I=Math.abs(I),u){case"top-right":case"top-left":case"top":R=I-7;break;case"bottom-right":case"bottom-left":case"bottom":R=7-I}switch(u){case"top-right":case"bottom-right":case"right":k=-y;break;case"top-left":case"bottom-left":case"left":k=y}return[k,R]})(c,n[0],n[1]):(function(u,y){let I=0,k=0;y<0&&(y=0);let R=y/Math.sqrt(2);switch(u){case"top-right":case"top-left":k=R-7;break;case"bottom-right":case"bottom-left":k=7-R;break;case"bottom":k=7-y;break;case"top":k=y-7}switch(u){case"top-right":case"bottom-right":I=-R;break;case"top-left":case"bottom-left":I=R;break;case"left":I=y;break;case"right":I=-y}return[I,k]})(c,n[0])}function Id(c){switch(c){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function jp(c,n,u,y,I,k,R,q,G,J,ae){let ce=k.textMaxSize.evaluate(n,{});ce===void 0&&(ce=R);let de=c.layers[0].layout,ge=de.get("icon-offset").evaluate(n,{},ae),ye=km(u.horizontal),Ue=R/24,Oe=c.tilePixelRatio*Ue,nt=c.tilePixelRatio*ce/24,ut=c.tilePixelRatio*q,tt=c.tilePixelRatio*de.get("symbol-spacing"),st=de.get("text-padding")*c.tilePixelRatio,Pt=(function(Vt,Di,Ei,ir=1){let Ur=Vt.get("icon-padding").evaluate(Di,{},Ei),rn=Ur&&Ur.values;return[rn[0]*ir,rn[1]*ir,rn[2]*ir,rn[3]*ir]})(de,n,ae,c.tilePixelRatio),kt=de.get("text-max-angle")/180*Math.PI,di=de.get("text-rotation-alignment")!=="viewport"&&de.get("symbol-placement")!=="point",bi=de.get("icon-rotation-alignment")==="map"&&de.get("symbol-placement")!=="point",oi=de.get("symbol-placement"),Jt=tt/2,Zt=de.get("icon-text-fit"),si;y&&Zt!=="none"&&(c.allowVerticalPlacement&&u.vertical&&(si=Jf(y,u.vertical,Zt,de.get("icon-text-fit-padding"),ge,Ue)),ye&&(y=Jf(y,ye,Zt,de.get("icon-text-fit-padding"),ge,Ue)));let ni=(Vt,Di)=>{Di.x<0||Di.x>=jn||Di.y<0||Di.y>=jn||(function(Ei,ir,Ur,rn,Dn,js,qo,Jn,po,$o,ca,Da,Ln,ko,Go,ha,Ja,Zo,mn,no,sr,xs,Wo,Ho,dl){let Gl=Ei.addToLineVertexArray(ir,Ur),Zl,Jr,La,qs,Qa=0,wc=0,ap=0,ng=0,Od=-1,Vd=-1,vs={},Nd=un.exports(""),Ud=0,jd=0;if(Jn._unevaluatedLayout.getValue("text-radial-offset")===void 0?[Ud,jd]=Jn.layout.get("text-offset").evaluate(sr,{},Ho).map((es=>es*Po)):(Ud=Jn.layout.get("text-radial-offset").evaluate(sr,{},Ho)*Po,jd=th),Ei.allowVerticalPlacement&&rn.vertical){let es=Jn.layout.get("text-rotate").evaluate(sr,{},Ho)+90;La=new eh(po,ir,$o,ca,Da,rn.vertical,Ln,ko,Go,es),qo&&(qs=new eh(po,ir,$o,ca,Da,qo,Ja,Zo,Go,es))}if(Dn){let es=Jn.layout.get("icon-rotate").evaluate(sr,{}),Tc=Jn.layout.get("icon-text-fit")!=="none",Kp=Ju(Dn,es,Wo,Tc),lp=qo?Ju(qo,es,Wo,Tc):void 0;Jr=new eh(po,ir,$o,ca,Da,Dn,Ja,Zo,!1,es),Qa=4*Kp.length;let $d=Ei.iconSizeData,Nh=null;$d.kind==="source"?(Nh=[Qc*Jn.layout.get("icon-size").evaluate(sr,{})],Nh[0]>bc&&li(`${Ei.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):$d.kind==="composite"&&(Nh=[Qc*xs.compositeIconSizes[0].evaluate(sr,{},Ho),Qc*xs.compositeIconSizes[1].evaluate(sr,{},Ho)],(Nh[0]>bc||Nh[1]>bc)&&li(`${Ei.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),Ei.addSymbols(Ei.icon,Kp,Nh,no,mn,sr,o.WritingMode.none,ir,Gl.lineStartIndex,Gl.lineLength,-1,Ho),Od=Ei.icon.placedSymbolArray.length-1,lp&&(wc=4*lp.length,Ei.addSymbols(Ei.icon,lp,Nh,no,mn,sr,o.WritingMode.vertical,ir,Gl.lineStartIndex,Gl.lineLength,-1,Ho),Vd=Ei.icon.placedSymbolArray.length-1)}
801let Xp=Object.keys(rn.horizontal);for(let es of Xp){let Tc=rn.horizontal[es];if(!Zl){Nd=un.exports(Tc.text);let lp=Jn.layout.get("text-rotate").evaluate(sr,{},Ho);Zl=new eh(po,ir,$o,ca,Da,Tc,Ln,ko,Go,lp)}let Kp=Tc.positionedLines.length===1;if(ap+=Pm(Ei,ir,Tc,js,Jn,Go,sr,ha,Gl,rn.vertical?o.WritingMode.horizontal:o.WritingMode.horizontalOnly,Kp?Xp:[es],vs,Od,xs,Ho),Kp)break}rn.vertical&&(ng+=Pm(Ei,ir,rn.vertical,js,Jn,Go,sr,ha,Gl,o.WritingMode.vertical,["vertical"],vs,Vd,xs,Ho));let sp=Zl?Zl.boxStartIndex:Ei.collisionBoxArray.length,og=Zl?Zl.boxEndIndex:Ei.collisionBoxArray.length,J_=La?La.boxStartIndex:Ei.collisionBoxArray.length,Q_=La?La.boxEndIndex:Ei.collisionBoxArray.length,ey=Jr?Jr.boxStartIndex:Ei.collisionBoxArray.length,ty=Jr?Jr.boxEndIndex:Ei.collisionBoxArray.length,iy=qs?qs.boxStartIndex:Ei.collisionBoxArray.length,ry=qs?qs.boxEndIndex:Ei.collisionBoxArray.length,Wl=-1,qd=(es,Tc)=>es&&es.circleDiameter?Math.max(es.circleDiameter,Tc):Tc;Wl=qd(Zl,Wl),Wl=qd(La,Wl),Wl=qd(Jr,Wl),Wl=qd(qs,Wl);let ag=Wl>-1?1:0;ag&&(Wl*=dl/Po),Ei.glyphOffsetArray.length>=tp.MAX_GLYPHS&&li("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),sr.sortKey!==void 0&&Ei.addToSortKeyRanges(Ei.symbolInstances.length,sr.sortKey),Ei.symbolInstances.emplaceBack(ir.x,ir.y,vs.right>=0?vs.right:-1,vs.center>=0?vs.center:-1,vs.left>=0?vs.left:-1,vs.vertical||-1,Od,Vd,Nd,sp,og,J_,Q_,ey,ty,iy,ry,$o,ap,ng,Qa,wc,ag,0,Ln,Ud,jd,Wl)})(c,Di,Vt,u,y,I,si,c.layers[0],c.collisionBoxArray,n.index,n.sourceLayerIndex,c.index,Oe,[st,st,st,st],di,G,ut,Pt,bi,ge,n,k,J,ae,R)};if(oi==="line")for(let Vt of Vp(n.geometry,0,0,jn,jn)){let Di=eg(Vt,tt,kt,u.vertical||ye,y,24,nt,c.overscaling,jn);for(let Ei of Di){let ir=ye;ir&&Z_(c,ir.text,Jt,Ei)||ni(Vt,Ei)}}else if(oi==="line-center"){for(let Vt of n.geometry)if(Vt.length>1){let Di=Yu(Vt,kt,u.vertical||ye,y,24,nt);Di&&ni(Vt,Di)}}else if(n.type==="Polygon")for(let Vt of kr(n.geometry,0)){let Di=Up(Vt,16);ni(Vt[0],new Fh(Di.x,Di.y,0))}else if(n.type==="LineString")for(let Vt of n.geometry)ni(Vt,new Fh(Vt[0].x,Vt[0].y,0));else if(n.type==="Point")for(let Vt of n.geometry)for(let Di of Vt)ni([Di],new Fh(Di.x,Di.y,0))}let bc=32640;function Pm(c,n,u,y,I,k,R,q,G,J,ae,ce,de,ge,ye){let Ue=(function(ut,tt,st,Pt,kt,di,bi,oi){let Jt=Pt.layout.get("text-rotate").evaluate(di,{})*Math.PI/180,Zt=[];for(let si of tt.positionedLines)for(let ni of si.positionedGlyphs){if(!ni.rect)continue;let Vt=ni.rect||{},Di=4,Ei=!0,ir=1,Ur=0,rn=(kt||oi)&&ni.vertical,Dn=ni.metrics.advance*ni.scale/2;if(oi&&tt.verticalizable){let mn=(ni.scale-1)*Po,no=(Po-ni.metrics.width*ni.scale)/2;Ur=si.lineOffset/2-(ni.imageName?-no:mn)}if(ni.imageName){let mn=bi[ni.imageName];Ei=mn.sdf,ir=mn.pixelRatio,Di=1/ir}let js=kt?[ni.x+Dn,ni.y]:[0,0],qo=kt?[0,0]:[ni.x+Dn+st[0],ni.y+st[1]-Ur],Jn=[0,0];rn&&(Jn=qo,qo=[0,0]);let po=(ni.metrics.left-Di)*ni.scale-Dn+qo[0],$o=(-ni.metrics.top-Di)*ni.scale+qo[1],ca=po+Vt.w*ni.scale/ir,Da=$o+Vt.h*ni.scale/ir,Ln=new Nt(po,$o),ko=new Nt(ca,$o),Go=new Nt(po,Da),ha=new Nt(ca,Da);if(rn){let mn=new Nt(-Dn,Dn-Bp),no=-Math.PI/2,sr=12-Dn,xs=new Nt(22-sr,-(ni.imageName?sr:0)),Wo=new Nt(...Jn);Ln._rotateAround(no,mn)._add(xs)._add(Wo),ko._rotateAround(no,mn)._add(xs)._add(Wo),Go._rotateAround(no,mn)._add(xs)._add(Wo),ha._rotateAround(no,mn)._add(xs)._add(Wo)}if(Jt){let mn=Math.sin(Jt),no=Math.cos(Jt),sr=[no,-mn,mn,no];Ln._matMult(sr),ko._matMult(sr),Go._matMult(sr),ha._matMult(sr)}let Ja=new Nt(0,0),Zo=new Nt(0,0);Zt.push({tl:Ln,tr:ko,bl:Go,br:ha,tex:Vt,writingMode:tt.writingMode,glyphOffset:js,sectionIndex:ni.sectionIndex,isSDF:Ei,pixelOffsetTL:Ja,pixelOffsetBR:Zo,minFontScaleX:0,minFontScaleY:0})}return Zt})(0,u,q,I,k,R,y,c.allowVerticalPlacement),Oe=c.textSizeData,nt=null;Oe.kind==="source"?(nt=[Qc*I.layout.get("text-size").evaluate(R,{})],nt[0]>bc&&li(`${c.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):Oe.kind==="composite"&&(nt=[Qc*ge.compositeTextSizes[0].evaluate(R,{},ye),Qc*ge.compositeTextSizes[1].evaluate(R,{},ye)],(nt[0]>bc||nt[1]>bc)&&li(`${c.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),c.addSymbols(c.text,Ue,nt,q,k,R,J,n,G.lineStartIndex,G.lineLength,de,ye);for(let ut of ae)ce[ut]=c.text.placedSymbolArray.length-1;return 4*Ue.length}function km(c){for(let n in c)return c[n];return null}function Z_(c,n,u,y){let I=c.compareText;if(n in I){let k=I[n];for(let R=k.length-1;R>=0;R--)if(y.dist(k[R])<u)return!0}else I[n]=[];return I[n].push(y),!1}let W_=la.VectorTileFeature.types,H_=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Cd(c,n,u,y,I,k,R,q,G,J,ae,ce,de){let ge=q?Math.min(bc,Math.round(q[0])):0,ye=q?Math.min(bc,Math.round(q[1])):0;c.emplaceBack(n,u,Math.round(32*y),Math.round(32*I),k,R,(ge<<1)+(G?1:0),ye,16*J,16*ae,256*ce,256*de)}function Am(c,n,u){c.emplaceBack(n.x,n.y,u),c.emplaceBack(n.x,n.y,u),c.emplaceBack(n.x,n.y,u),c.emplaceBack(n.x,n.y,u)}function qp(c){for(let n of c.sections)if(ac(n.text))return!0;return!1}class zm{constructor(n){this.layoutVertexArray=new cn,this.indexArray=new hn,this.programConfigurations=n,this.segments=new Ki,this.dynamicLayoutVertexArray=new Co,this.opacityVertexArray=new Ha,this.placedSymbolArray=new Ft}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(n,u,y,I){this.isEmpty()||(y&&(this.layoutVertexBuffer=n.createVertexBuffer(this.layoutVertexArray,Nf.members),this.indexBuffer=n.createIndexBuffer(this.indexArray,u),this.dynamicLayoutVertexBuffer=n.createVertexBuffer(this.dynamicLayoutVertexArray,Uf.members,!0),this.opacityVertexBuffer=n.createVertexBuffer(this.opacityVertexArray,H_,!0),this.opacityVertexBuffer.itemSize=1),(y||I)&&this.programConfigurations.upload(n))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}ui("SymbolBuffers",zm);class Ed{constructor(n,u,y){this.layoutVertexArray=new n,this.layoutAttributes=u,this.indexArray=new y,this.segments=new Ki,this.collisionVertexArray=new na}upload(n){this.layoutVertexBuffer=n.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=n.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=n.createVertexBuffer(this.collisionVertexArray,ju.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}ui("CollisionBuffers",Ed);class tp{constructor(n){this.collisionBoxArray=n.collisionBoxArray,this.zoom=n.zoom,this.overscaling=n.overscaling,this.layers=n.layers,this.layerIds=this.layers.map((R=>R.id)),this.index=n.index,this.pixelRatio=n.pixelRatio,this.sourceLayerIndex=n.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Os([]),this.placementViewportMatrix=Os([]);let u=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Td(this.zoom,u["text-size"]),this.iconSizeData=Td(this.zoom,u["icon-size"]);let y=this.layers[0].layout,I=y.get("symbol-sort-key"),k=y.get("symbol-z-order");this.canOverlap=$p(y,"text-overlap","text-allow-overlap")!=="never"||$p(y,"icon-overlap","icon-allow-overlap")!=="never"||y.get("text-ignore-placement")||y.get("icon-ignore-placement"),this.sortFeaturesByKey=k!=="viewport-y"&&!I.isConstant(),this.sortFeaturesByY=(k==="viewport-y"||k==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,y.get("symbol-placement")==="point"&&(this.writingModes=y.get("text-writing-mode").map((R=>o.WritingMode[R]))),this.stateDependentLayerIds=this.layers.filter((R=>R.isStateDependent())).map((R=>R.id)),this.sourceID=n.sourceID}createArrays(){this.text=new zm(new Nl(this.layers,this.zoom,(n=>/^text/.test(n)))),this.icon=new zm(new Nl(this.layers,this.zoom,(n=>/^icon/.test(n)))),this.glyphOffsetArray=new Xt,this.lineVertexArray=new ai,this.symbolInstances=new ri}calculateGlyphDependencies(n,u,y,I,k){for(let R=0;R<n.length;
vendor: 6,407 bytes, line 801
801R++)if(u[n.charCodeAt(R)]=!0,(y||I)&&k){let q=Rh[n.charAt(R)];q&&(u[q.charCodeAt(0)]=!0)}}populate(n,u,y){let I=this.layers[0],k=I.layout,R=k.get("text-font"),q=k.get("text-field"),G=k.get("icon-image"),J=(q.value.kind!=="constant"||q.value.value instanceof Te&&!q.value.value.isEmpty()||q.value.value.toString().length>0)&&(R.value.kind!=="constant"||R.value.value.length>0),ae=G.value.kind!=="constant"||!!G.value.value||Object.keys(G.parameters).length>0,ce=k.get("symbol-sort-key");if(this.features=[],!J&&!ae)return;let de=u.iconDependencies,ge=u.glyphDependencies,ye=u.availableImages,Ue=new Nr(this.zoom);for(let{feature:Oe,id:nt,index:ut,sourceLayerIndex:tt}of n){let st=I._featureFilter.needGeometry,Pt=Ii(Oe,st);if(!I._featureFilter.filter(Ue,Pt,y))continue;let kt,di;if(st||(Pt.geometry=mi(Oe)),J){let oi=I.getValueAndResolveTokens("text-field",Pt,y,ye),Jt=Te.factory(oi);qp(Jt)&&(this.hasRTLText=!0),(!this.hasRTLText||lc()==="unavailable"||this.hasRTLText&&Ia.isParsed())&&(kt=gd(Jt,I,Pt))}if(ae){let oi=I.getValueAndResolveTokens("icon-image",Pt,y,ye);di=oi instanceof Ge?oi:Ge.fromString(oi)}if(!kt&&!di)continue;let bi=this.sortFeaturesByKey?ce.evaluate(Pt,{},y):void 0;if(this.features.push({id:nt,text:kt,icon:di,index:ut,sourceLayerIndex:tt,geometry:Pt.geometry,properties:Oe.properties,type:W_[Oe.type],sortKey:bi}),di&&(de[di.name]=!0),kt){let oi=R.evaluate(Pt,{},y).join(","),Jt=k.get("text-rotation-alignment")!=="viewport"&&k.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(o.WritingMode.vertical)>=0;for(let Zt of kt.sections)if(Zt.image)de[Zt.image.name]=!0;else{let si=So(kt.toString()),ni=Zt.fontStack||oi,Vt=ge[ni]=ge[ni]||{};this.calculateGlyphDependencies(Zt.text,Vt,Jt,this.allowVerticalPlacement,si)}}}k.get("symbol-placement")==="line"&&(this.features=(function(Oe){let nt={},ut={},tt=[],st=0;function Pt(oi){tt.push(Oe[oi]),st++}function kt(oi,Jt,Zt){let si=ut[oi];return delete ut[oi],ut[Jt]=si,tt[si].geometry[0].pop(),tt[si].geometry[0]=tt[si].geometry[0].concat(Zt[0]),si}function di(oi,Jt,Zt){let si=nt[Jt];return delete nt[Jt],nt[oi]=si,tt[si].geometry[0].shift(),tt[si].geometry[0]=Zt[0].concat(tt[si].geometry[0]),si}function bi(oi,Jt,Zt){let si=Zt?Jt[0][Jt[0].length-1]:Jt[0][0];return`${oi}:${si.x}:${si.y}`}for(let oi=0;oi<Oe.length;oi++){let Jt=Oe[oi],Zt=Jt.geometry,si=Jt.text?Jt.text.toString():null;if(!si){Pt(oi);continue}let ni=bi(si,Zt),Vt=bi(si,Zt,!0);if(ni in ut&&Vt in nt&&ut[ni]!==nt[Vt]){let Di=di(ni,Vt,Zt),Ei=kt(ni,Vt,tt[Di].geometry);delete nt[ni],delete ut[Vt],ut[bi(si,tt[Ei].geometry,!0)]=Ei,tt[Di].geometry=null}else ni in ut?kt(ni,Vt,Zt):Vt in nt?di(ni,Vt,Zt):(Pt(oi),nt[ni]=st-1,ut[Vt]=st-1)}return tt.filter((oi=>oi.geometry))})(this.features)),this.sortFeaturesByKey&&this.features.sort(((Oe,nt)=>Oe.sortKey-nt.sortKey))}update(n,u,y){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(n,u,this.layers,y),this.icon.programConfigurations.updatePaintArrays(n,u,this.layers,y))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(n){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(n),this.iconCollisionBox.upload(n)),this.text.upload(n,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(n,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(n,u){let y=this.lineVertexArray.length;if(n.segment!==void 0){let I=n.dist(u[n.segment+1]),k=n.dist(u[n.segment]),R={};for(let q=n.segment+1;q<u.length;q++)R[q]={x:u[q].x,y:u[q].y,tileUnitDistanceFromAnchor:I},q<u.length-1&&(I+=u[q+1].dist(u[q]));for(let q=n.segment||0;q>=0;q--)R[q]={x:u[q].x,y:u[q].y,tileUnitDistanceFromAnchor:k},q>0&&(k+=u[q-1].dist(u[q]));for(let q=0;q<u.length;q++){let G=R[q];this.lineVertexArray.emplaceBack(G.x,G.y,G.tileUnitDistanceFromAnchor)}}return{lineStartIndex:y,lineLength:this.lineVertexArray.length-y}}addSymbols(n,u,y,I,k,R,q,G,J,ae,ce,de){let ge=n.indexArray,ye=n.layoutVertexArray,Ue=n.segments.prepareSegment(4*u.length,ye,ge,this.canOverlap?R.sortKey:void 0),Oe=this.glyphOffsetArray.length,nt=Ue.vertexLength,ut=this.allowVerticalPlacement&&q===o.WritingMode.vertical?Math.PI/2:0,tt=R.text&&R.text.sections;for(let st=0;st<u.length;st++){let{tl:Pt,tr:kt,bl:di,br:bi,tex:oi,pixelOffsetTL:Jt,pixelOffsetBR:Zt,minFontScaleX:si,minFontScaleY:ni,glyphOffset:Vt,isSDF:Di,sectionIndex:Ei}=u[st],ir=Ue.vertexLength,Ur=Vt[1];Cd(ye,G.x,G.y,Pt.x,Ur+Pt.y,oi.x,oi.y,y,Di,Jt.x,Jt.y,si,ni),Cd(ye,G.x,G.y,kt.x,Ur+kt.y,oi.x+oi.w,oi.y,y,Di,Zt.x,Jt.y,si,ni),Cd(ye,G.x,G.y,di.x,Ur+di.y,oi.x,oi.y+oi.h,y,Di,Jt.x,Zt.y,si,ni),Cd(ye,G.x,G.y,bi.x,Ur+bi.y,oi.x+oi.w,oi.y+oi.h,y,Di,Zt.x,Zt.y,si,ni),Am(n.dynamicLayoutVertexArray,G,ut),ge.emplaceBack(ir,ir+1,ir+2),ge.emplaceBack(ir+1,ir+2,ir+3),Ue.vertexLength+=4,Ue.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Vt[0]),st!==u.length-1&&Ei===u[st+1].sectionIndex||n.programConfigurations.populatePaintArrays(ye.length,R,R.index,{},de,tt&&tt[Ei])}n.placedSymbolArray.emplaceBack(G.x,G.y,Oe,this.glyphOffsetArray.length-Oe,nt,J,ae,G.segment,y?y[0]:0,y?y[1]:0,I[0],I[1],q,0,!1,0,ce)}_addCollisionDebugVertex(n,u,y,I,k,R){return u.emplaceBack(0,0),n.emplaceBack(y.x,y.y,I,k,Math.round(R.x),Math.round(R.y))}addCollisionDebugVertices(n,u,y,I,k,R,q){let G=k.segments.prepareSegment(4,k.layoutVertexArray,k.indexArray),J=G.vertexLength,ae=k.layoutVertexArray,ce=k.collisionVertexArray,de=q.anchorX,ge=q.anchorY;this._addCollisionDebugVertex(ae,ce,R,de,ge,new Nt(n,u)),this._addCollisionDebugVertex(ae,ce,R,de,ge,new Nt(y,u)),this._addCollisionDebugVertex(ae,ce,R,de,ge,new Nt(y,I)),this._addCollisionDebugVertex(ae,ce,R,de,ge,new Nt(n,I)),G.vertexLength+=4;let ye=k.indexArray;ye.emplaceBack(J,J+1),ye.emplaceBack(J+1,J+2),ye.emplaceBack(J+2,J+3),ye.emplaceBack(J+3,J),G.primitiveLength+=4}addDebugCollisionBoxes(n,u,y,I){for(let k=n;k<u;k++){let R=this.collisionBoxArray.get(k);this.addCollisionDebugVertices(R.x1,R.y1,R.x2,R.y2,I?this.textCollisionBox:this.iconCollisionBox,R.anch
vendor: 10,327 bytes, line 801
801orPoint,y)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Ed(ll,jf.members,Kn),this.iconCollisionBox=new Ed(ll,jf.members,Kn);for(let n=0;n<this.symbolInstances.length;n++){let u=this.symbolInstances.get(n);this.addDebugCollisionBoxes(u.textBoxStartIndex,u.textBoxEndIndex,u,!0),this.addDebugCollisionBoxes(u.verticalTextBoxStartIndex,u.verticalTextBoxEndIndex,u,!0),this.addDebugCollisionBoxes(u.iconBoxStartIndex,u.iconBoxEndIndex,u,!1),this.addDebugCollisionBoxes(u.verticalIconBoxStartIndex,u.verticalIconBoxEndIndex,u,!1)}}_deserializeCollisionBoxesForSymbol(n,u,y,I,k,R,q,G,J){let ae={};for(let ce=u;ce<y;ce++){let de=n.get(ce);ae.textBox={x1:de.x1,y1:de.y1,x2:de.x2,y2:de.y2,anchorPointX:de.anchorPointX,anchorPointY:de.anchorPointY},ae.textFeatureIndex=de.featureIndex;break}for(let ce=I;ce<k;ce++){let de=n.get(ce);ae.verticalTextBox={x1:de.x1,y1:de.y1,x2:de.x2,y2:de.y2,anchorPointX:de.anchorPointX,anchorPointY:de.anchorPointY},ae.verticalTextFeatureIndex=de.featureIndex;break}for(let ce=R;ce<q;ce++){let de=n.get(ce);ae.iconBox={x1:de.x1,y1:de.y1,x2:de.x2,y2:de.y2,anchorPointX:de.anchorPointX,anchorPointY:de.anchorPointY},ae.iconFeatureIndex=de.featureIndex;break}for(let ce=G;ce<J;ce++){let de=n.get(ce);ae.verticalIconBox={x1:de.x1,y1:de.y1,x2:de.x2,y2:de.y2,anchorPointX:de.anchorPointX,anchorPointY:de.anchorPointY},ae.verticalIconFeatureIndex=de.featureIndex;break}return ae}deserializeCollisionBoxes(n){this.collisionArrays=[];for(let u=0;u<this.symbolInstances.length;u++){let y=this.symbolInstances.get(u);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(n,y.textBoxStartIndex,y.textBoxEndIndex,y.verticalTextBoxStartIndex,y.verticalTextBoxEndIndex,y.iconBoxStartIndex,y.iconBoxEndIndex,y.verticalIconBoxStartIndex,y.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(n,u){let y=n.placedSymbolArray.get(u),I=y.vertexStartIndex+4*y.numGlyphs;for(let k=y.vertexStartIndex;k<I;k+=4)n.indexArray.emplaceBack(k,k+1,k+2),n.indexArray.emplaceBack(k+1,k+2,k+3)}getSortedSymbolIndexes(n){if(this.sortedAngle===n&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let u=Math.sin(n),y=Math.cos(n),I=[],k=[],R=[];for(let q=0;q<this.symbolInstances.length;++q){R.push(q);let G=this.symbolInstances.get(q);I.push(0|Math.round(u*G.anchorX+y*G.anchorY)),k.push(G.featureIndex)}return R.sort(((q,G)=>I[q]-I[G]||k[G]-k[q])),R}addToSortKeyRanges(n,u){let y=this.sortKeyRanges[this.sortKeyRanges.length-1];y&&y.sortKey===u?y.symbolInstanceEnd=n+1:this.sortKeyRanges.push({sortKey:u,symbolInstanceStart:n,symbolInstanceEnd:n+1})}sortFeatures(n){if(this.sortFeaturesByY&&this.sortedAngle!==n&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(n),this.sortedAngle=n,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let u of this.symbolInstanceIndexes){let y=this.symbolInstances.get(u);this.featureSortOrder.push(y.featureIndex),[y.rightJustifiedTextSymbolIndex,y.centerJustifiedTextSymbolIndex,y.leftJustifiedTextSymbolIndex].forEach(((I,k,R)=>{I>=0&&R.indexOf(I)===k&&this.addIndicesForPlacedSymbol(this.text,I)})),y.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,y.verticalPlacedTextSymbolIndex),y.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,y.placedIconSymbolIndex),y.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,y.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}ui("SymbolBucket",tp,{omit:["layers","collisionBoxArray","features","compareText"]}),tp.MAX_GLYPHS=65535,tp.addDynamicAttributes=Am;let X_=new io({"symbol-placement":new xi(St.layout_symbol["symbol-placement"]),"symbol-spacing":new xi(St.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new xi(St.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Pi(St.layout_symbol["symbol-sort-key"]),"symbol-z-order":new xi(St.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new xi(St.layout_symbol["icon-allow-overlap"]),"icon-overlap":new xi(St.layout_symbol["icon-overlap"]),"icon-ignore-placement":new xi(St.layout_symbol["icon-ignore-placement"]),"icon-optional":new xi(St.layout_symbol["icon-optional"]),"icon-rotation-alignment":new xi(St.layout_symbol["icon-rotation-alignment"]),"icon-size":new Pi(St.layout_symbol["icon-size"]),"icon-text-fit":new xi(St.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new xi(St.layout_symbol["icon-text-fit-padding"]),"icon-image":new Pi(St.layout_symbol["icon-image"]),"icon-rotate":new Pi(St.layout_symbol["icon-rotate"]),"icon-padding":new Pi(St.layout_symbol["icon-padding"]),"icon-keep-upright":new xi(St.layout_symbol["icon-keep-upright"]),"icon-offset":new Pi(St.layout_symbol["icon-offset"]),"icon-anchor":new Pi(St.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new xi(St.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new xi(St.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new xi(St.layout_symbol["text-rotation-alignment"]),"text-field":new Pi(St.layout_symbol["text-field"]),"text-font":new Pi(St.layout_symbol["text-font"]),"text-size":new Pi(St.layout_symbol["text-size"]),"text-max-width":new Pi(St.layout_symbol["text-max-width"]),"text-line-height":new xi(St.layout_symbol["text-line-height"]),"text-letter-spacing":new Pi(St.layout_symbol["text-letter-spacing"]),"text-justify":new Pi(St.layout_symbol["text-justify"]),"text-radial-offset":new Pi(St.layout_symbol["text-radial-offset"]),"text-variable-anchor":new xi(St.layout_symbol["text-variable-anchor"]),"text-anchor":new Pi(St.layout_symbol["text-anchor"]),"text-max-angle":new xi(St.layout_symbol["text-max-angle"]),"text-writing-mode":new xi(St.layout_symbol["text-writing-mode"]),"text-rotate":new Pi(St.layout_symbol["text-rotate"]),"text-padding":new xi(St.layout_symbol["text-padding"]),"text-keep-upright":new xi(St.layout_symbol["text-keep-upright"]),"text-transform":new Pi(St.layout_symbol["text-transform"]),"text-offset":new Pi(St.layout_symbol["text-offset"]),"text-allow-overlap":new xi(St.layout_symbol["text-allow-overlap"]),"text-overlap":new xi(St.layout_symbol["text-overlap"]),"text-ignore-placement":new xi(St.layout_symbol["text-ignore-placement"]),"text-optional":new xi(St.layout_symbol["text-optional"])});var Dm={paint:new io({"icon-opacity":new Pi(St.paint_symbol["icon-opacity"]),"icon-color":new Pi(St.paint_symbol["icon-color"]),"icon-halo-color":new Pi(St.paint_symbol["icon-halo-color"]),"icon-halo-width":new Pi(St.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Pi(St.paint_symbol["icon-halo-blur"]),"icon-translate":new xi(St.paint_symbol["icon-translate"]),"icon-translate-anchor":new xi(St.paint_symbol["icon-translate-anchor"]),"text-opacity":new Pi(St.paint_symbol["text-opacity"]),"text-color":new Pi(St.paint_symbol["text-color"],{runtimeType:an,getOverride:c=>c.textColor,hasOverride:c=>!!c.textColor}),"text-halo-color":new Pi(St.paint_symbol["text-halo-color"]),"text-halo-width":new Pi(St.paint_symbol["text-halo-width"]),"text-halo-blur":new Pi(St.paint_symbol["text-halo-blur"]),"text-translate":new xi(St.paint_symbol["text-translate"]),"text-translate-anchor":new xi(St.paint_symbol["text-translate-anchor"])}),layout:X_};class Lm{constructor(n){if(n.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=n.property.overrides?n.property.overrides.runtimeType:ta,this.defaultValue=n}evaluate(n){if(n.formattedSection){let u=this.defaultValue.property.overrides;if(u&&u.hasOverride(n.formattedSection))return u.getOverride(n.formattedSection)}return n.feature&&n.featureState?this.defaultValue.evaluate(n.feature,n.featureState):this.defaultValue.property.specification.default}eachChild(n){this.defaultValue.isConstant()||n(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}ui("FormatSectionOverride",Lm,{omit:["defaultValue"]});class Md extends ms{constructor(n){super(n,Dm)}recalculate(n,u){if(super.recalculate(n,u),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){let y=this.layout.get("text-writing-mode");if(y){let I=[];for(let k of y)I.indexOf(k)<0&&I.push(k);this.layout._values["text-writing-mode"]=I}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(n,u,y,I){let k=this.layout.get(n).evaluate(u,{},y,I),R=this._unevaluatedLayout._values[n];return R.isDataDriven()||Qs(R.value)||!k?k:(function(q,G){return G.replace(/{([^{}]+)}/g,((J,ae)=>ae in q?String(q[ae]):""))})(u.properties,k)}createBucket(n){return new tp(n)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let n of Dm.paint.overridableProperties){if(!Md.hasPaintOverride(this.layout,n))continue;let u=this.paint.get(n),y=new Lm(u),I=new Oo(y,u.property.specification),k=null;k=u.value.kind==="constant"||u.value.kind==="source"?new Ga("source",I):new zl("composite",I,u.value.zoomStops),this.paint._values[n]=new ra(u.property,k,u.parameters)}}
801_handleOverridablePaintPropertyUpdate(n,u,y){return!(!this.layout||u.isDataDriven()||y.isDataDriven())&&Md.hasPaintOverride(this.layout,n)}static hasPaintOverride(n,u){let y=n.get("text-field"),I=Dm.paint.properties[u],k=!1,R=q=>{for(let G of q)if(I.overrides&&I.overrides.hasOverride(G))return void(k=!0)};if(y.value.kind==="constant"&&y.value.value instanceof Te)R(y.value.value.sections);else if(y.value.kind==="source"){let q=J=>{k||(J instanceof gi&&dt(J.value)===vn?R(J.value.sections):J instanceof Cl?R(J.sections):J.eachChild(q))},G=y.value;G._styleExpression&&q(G._styleExpression.expression)}return k}}function $p(c,n,u){let y="never",I=c.get(n);return I?y=I:c.get(u)&&(y="always"),y}var Gp={paint:new io({"background-color":new xi(St.paint_background["background-color"]),"background-pattern":new sl(St.paint_background["background-pattern"]),"background-opacity":new xi(St.paint_background["background-opacity"])})},Rm={paint:new io({"raster-opacity":new xi(St.paint_raster["raster-opacity"]),"raster-hue-rotate":new xi(St.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new xi(St.paint_raster["raster-brightness-min"]),"raster-brightness-max":new xi(St.paint_raster["raster-brightness-max"]),"raster-saturation":new xi(St.paint_raster["raster-saturation"]),"raster-contrast":new xi(St.paint_raster["raster-contrast"]),"raster-resampling":new xi(St.paint_raster["raster-resampling"]),"raster-fade-duration":new xi(St.paint_raster["raster-fade-duration"])})};class K_ extends ms{constructor(n){super(n,{}),this.onAdd=u=>{this.implementation.onAdd&&this.implementation.onAdd(u,u.painter.context.gl)},this.onRemove=u=>{this.implementation.onRemove&&this.implementation.onRemove(u,u.painter.context.gl)},this.implementation=n}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}let Y_={circle:class extends ms{constructor(c){super(c,Ru)}createBucket(c){return new zu(c)}queryRadius(c){let n=c;return Pr("circle-radius",this,n)+Pr("circle-stroke-width",this,n)+au(this.paint.get("circle-translate"))}queryIntersectsFeature(c,n,u,y,I,k,R,q){let G=mc(c,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),k.angle,R),J=this.paint.get("circle-radius").evaluate(n,u)+this.paint.get("circle-stroke-width").evaluate(n,u),ae=this.paint.get("circle-pitch-alignment")==="map",ce=ae?G:(function(ge,ye){return ge.map((Ue=>Ou(Ue,ye)))})(G,q),de=ae?J*R:J;for(let ge of y)for(let ye of ge){let Ue=ae?ye:Ou(ye,q),Oe=de,nt=jl([],[ye.x,ye.y,0,1],q);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Oe*=nt[3]/k.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Oe*=k.cameraToCenterDistance/nt[3]),aa(ce,Ue,Oe))return!0}return!1}},heatmap:class extends ms{constructor(c){super(c,Hc),this._updateColorRamp()}createBucket(c){return new zh(c)}_handleSpecialPaintPropertyUpdate(c){c==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=t({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(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}},hillshade:class extends ms{constructor(c){super(c,a)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}},fill:class extends ms{constructor(c){super(c,Eo)}recalculate(c,n){super.recalculate(c,n);let u=this.paint._values["fill-outline-color"];u.value.kind==="constant"&&u.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(c){return new tn(c)}queryRadius(){return au(this.paint.get("fill-translate"))}queryIntersectsFeature(c,n,u,y,I,k,R){return Mp(mc(c,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),k.angle,R),y)}isTileClipped(){return!0}},"fill-extrusion":class extends ms{constructor(c){super(c,pd)}createBucket(c){return new Lh(c)}queryRadius(){return au(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(c,n,u,y,I,k,R,q){let G=mc(c,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),k.angle,R),J=this.paint.get("fill-extrusion-height").evaluate(n,u),ae=this.paint.get("fill-extrusion-base").evaluate(n,u),ce=(function(ge,ye,Ue,Oe){let nt=[];for(let ut of ge){let tt=[ut.x,ut.y,0,1];jl(tt,tt,ye),nt.push(new Nt(tt[0]/tt[3],tt[1]/tt[3]))}return nt})(G,q),de=(function(ge,ye,Ue,Oe){let nt=[],ut=[],tt=Oe[8]*ye,st=Oe[9]*ye,Pt=Oe[10]*ye,kt=Oe[11]*ye,di=Oe[8]*Ue,bi=Oe[9]*Ue,oi=Oe[10]*Ue,Jt=Oe[11]*Ue;for(let Zt of ge){let si=[],ni=[];for(let Vt of Zt){let Di=Vt.x,Ei=Vt.y,ir=Oe[0]*Di+Oe[4]*Ei+Oe[12],Ur=Oe[1]*Di+Oe[5]*Ei+Oe[13],rn=Oe[2]*Di+Oe[6]*Ei+Oe[14],Dn=Oe[3]*Di+Oe[7]*Ei+Oe[15],js=rn+Pt,qo=Dn+kt,Jn=ir+di,po=Ur+bi,$o=rn+oi,ca=Dn+Jt,Da=new Nt((ir+tt)/qo,(Ur+st)/qo);Da.z=js/qo,si.push(Da);let Ln=new Nt(Jn/ca,po/ca);Ln.z=$o/ca,ni.push(Ln)}nt.push(si),ut.push(ni)}return[nt,ut]})(y,ae,J,q);return(function(ge,ye,Ue){let Oe=1/0;Mp(Ue,ye)&&(Oe=$l(Ue,ye[0]));for(let nt=0;nt<ye.length;nt++){let ut=ye[nt],tt=ge[nt];for(let st=0;st<ut.length-1;st++){let Pt=ut[st],kt=[Pt,ut[st+1],tt[st+1],tt[st],Pt];Wc(Ue,kt)&&(Oe=Math.min(Oe,$l(Ue,kt)))}}return Oe!==1/0&&Oe})(de[0],de[1],ce)}},line:class extends ms{constructor(c){super(c,md),this.gradientVersion=0}_handleSpecialPaintPropertyUpdate(c){c==="line-gradient"&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof bl,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER)}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(c,n){super.recalculate(c,n),this.paint._values["line-floorwidth"]=Vf.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,c)}createBucket(c){return new dd(c)}queryRadius(c){let n=c,u=fd(Pr("line-width",this,n),Pr("line-gap-width",this,n)),y=Pr("line-offset",this,n);return u/2+Math.abs(y)+au(this.paint.get("line-translate"))}queryIntersectsFeature(c,n,u,y,I,k,R){let q=mc(c,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),k.angle,R),G=R/2*fd(this.paint.get("line-width").evaluate(n,u),this.paint.get("line-gap-width").evaluate(n,u)),J=this.paint.get("line-offset").evaluate(n,u);return J&&(y=(function(ae,ce){let de=[];for(let ge=0;ge<ae.length;ge++){let ye=ae[ge],Ue=[];for(let Oe=0;Oe<ye.length;Oe++){let nt=ye[Oe-1],ut=ye[Oe],tt=ye[Oe+1],st=Oe===0?new Nt(0,0):ut.sub(nt)._unit()._perp(),Pt=Oe===ye.length-1?new Nt(0,0):tt.sub(ut)._unit()._perp(),kt=st._add(Pt)._unit(),di=kt.x*Pt.x+kt.y*Pt.y;di!==0&&kt._mult(1/di),Ue.push(kt._mult(ce)._add(ut))}de.push(Ue)}return de})(y,J*R)),(function(ae,ce,de){for(let ge=0;ge<ce.length;ge++){let ye=ce[ge];if(ae.length>=3){for(let Ue=0;Ue<ye.length;Ue++)if(ul(ae,ye[Ue]))return!0}if(Du(ae,ye,de))return!0}return!1})(q,y,G)}isTileClipped(){return!0}},symbol:Md,background:class extends ms{constructor(c){super(c,Gp)}},raster:class extends ms{constructor(c){super(c,Rm)}}};class ig{constructor(n){this._callback=n,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(){delete this._channel,this._callback=()=>{}}}let Fm=63710088e-1;class zn{constructor(n,u){if(isNaN(n)||isNaN(u))throw new Error(`Invalid LngLat object: (${n}, ${u})`);if(this.lng=+n,this.lat=+u,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new zn(Bt(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(n){let u=Math.PI/180,y=this.lat*u,I=n.lat*u,k=Math.sin(y)*Math.sin(I)+Math.cos(y)*Math.cos(I)*Math.cos((n.lng-this.lng)*u);return Fm*Math.acos(Math.min(k,1))}toBounds(n=0){let u=360*n/40075017,y=u/Math.cos(Math.PI/180*this.lat);return new pu(new zn(this.lng-y,this.lat-u),new zn(this.lng+y,this.lat+u))}static convert(n){if(n instanceof zn)return n;if(Array.isArray(n)&&(n.length===2||n.length===3))return new zn(Number(n[0]),Number(n[1]));if(!Array.isArray(n)&&typeof n=="object"&&n!==null)return new zn(Number("lng"in n?n.lng:n.lon),Number(n.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>]")}}
801class pu{constructor(n,u){n&&(u?this.setSouthWest(n).setNorthEast(u):n.length===4?this.setSouthWest([n[0],n[1]]).setNorthEast([n[2],n[3]]):this.setSouthWest(n[0]).setNorthEast(n[1]))}setNorthEast(n){return this._ne=n instanceof zn?new zn(n.lng,n.lat):zn.convert(n),this}setSouthWest(n){return this._sw=n instanceof zn?new zn(n.lng,n.lat):zn.convert(n),this}extend(n){let u=this._sw,y=this._ne,I,k;if(n instanceof zn)I=n,k=n;else{if(!(n instanceof pu))return Array.isArray(n)?n.length===4||n.every(Array.isArray)?this.extend(pu.convert(n)):this.extend(zn.convert(n)):this;if(I=n._sw,k=n._ne,!I||!k)return this}return u||y?(u.lng=Math.min(I.lng,u.lng),u.lat=Math.min(I.lat,u.lat),y.lng=Math.max(k.lng,y.lng),y.lat=Math.max(k.lat,y.lat)):(this._sw=new zn(I.lng,I.lat),this._ne=new zn(k.lng,k.lat)),this}getCenter(){return new zn((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 zn(this.getWest(),this.getNorth())}getSouthEast(){return new zn(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(n){let{lng:u,lat:y}=zn.convert(n),I=this._sw.lng<=u&&u<=this._ne.lng;return this._sw.lng>this._ne.lng&&(I=this._sw.lng>=u&&u>=this._ne.lng),this._sw.lat<=y&&y<=this._ne.lat&&I}static convert(n){return n instanceof pu?n:n&&new pu(n)}}let ip=2*Math.PI*Fm;function Bm(c){return ip*Math.cos(c*Math.PI/180)}function Om(c){return(180+c)/360}function Zp(c){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+c*Math.PI/360)))/360}function Pd(c,n){return c/Bm(n)}function kd(c){return 360/Math.PI*Math.atan(Math.exp((180-360*c)*Math.PI/180))-90}class Oh{constructor(n,u,y=0){this.x=+n,this.y=+u,this.z=+y}static fromLngLat(n,u=0){let y=zn.convert(n);return new Oh(Om(y.lng),Zp(y.lat),Pd(u,y.lat))}toLngLat(){return new zn(360*this.x-180,kd(this.y))}toAltitude(){return this.z*Bm(kd(this.y))}meterInMercatorCoordinateUnits(){return 1/ip*(n=kd(this.y),1/Math.cos(n*Math.PI/180));var n}}function Ad(c,n,u){var y=2*Math.PI*6378137/256/Math.pow(2,u);return[c*y-2*Math.PI*6378137/2,n*y-2*Math.PI*6378137/2]}class zd{constructor(n,u,y){if(n<0||n>25||y<0||y>=Math.pow(2,n)||u<0||u>=Math.pow(2,n))throw new Error(`x=${u}, y=${y}, z=${n} outside of bounds. 0<=x<${Math.pow(2,n)}, 0<=y<${Math.pow(2,n)} 0<=z<=25 `);this.z=n,this.x=u,this.y=y,this.key=$n(0,n,n,u,y)}equals(n){return this.z===n.z&&this.x===n.x&&this.y===n.y}url(n,u,y){let I=(R=this.y,q=this.z,G=Ad(256*(k=this.x),256*(R=Math.pow(2,q)-R-1),q),J=Ad(256*(k+1),256*(R+1),q),G[0]+","+G[1]+","+J[0]+","+J[1]);var k,R,q,G,J;let ae=(function(ce,de,ge){let ye,Ue="";for(let Oe=ce;Oe>0;Oe--)ye=1<<Oe-1,Ue+=(de&ye?1:0)+(ge&ye?2:0);return Ue})(this.z,this.x,this.y);return n[(this.x+this.y)%n.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(y==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,u>1?"@2x":"").replace(/{quadkey}/g,ae).replace(/{bbox-epsg-3857}/g,I)}
801isChildOf(n){let u=this.z-n.z;return u>0&&n.x===this.x>>u&&n.y===this.y>>u}getTilePoint(n){let u=Math.pow(2,this.z);return new Nt((n.x*u-this.x)*jn,(n.y*u-this.y)*jn)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Dd{constructor(n,u){this.wrap=n,this.canonical=u,this.key=$n(n,u.z,u.z,u.x,u.y)}}class Us{constructor(n,u,y,I,k){if(n<y)throw new Error(`overscaledZ should be >= z; overscaledZ = ${n}; z = ${y}`);this.overscaledZ=n,this.wrap=u,this.canonical=new zd(y,+I,+k),this.key=$n(u,n,y,I,k)}clone(){return new Us(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(n){return this.overscaledZ===n.overscaledZ&&this.wrap===n.wrap&&this.canonical.equals(n.canonical)}scaledTo(n){if(n>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${n}; overscaledZ = ${this.overscaledZ}`);let u=this.canonical.z-n;return n>this.canonical.z?new Us(n,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Us(n,this.wrap,n,this.canonical.x>>u,this.canonical.y>>u)}calculateScaledKey(n,u){if(n>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${n}; overscaledZ = ${this.overscaledZ}`);let y=this.canonical.z-n;return n>this.canonical.z?$n(this.wrap*+u,n,this.canonical.z,this.canonical.x,this.canonical.y):$n(this.wrap*+u,n,n,this.canonical.x>>y,this.canonical.y>>y)}isChildOf(n){if(n.wrap!==this.wrap)return!1;let u=this.canonical.z-n.canonical.z;return n.overscaledZ===0||n.overscaledZ<this.overscaledZ&&n.canonical.x===this.canonical.x>>u&&n.canonical.y===this.canonical.y>>u}children(n){if(this.overscaledZ>=n)return[new Us(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let u=this.canonical.z+1,y=2*this.canonical.x,I=2*this.canonical.y;return[new Us(u,this.wrap,u,y,I),new Us(u,this.wrap,u,y+1,I),new Us(u,this.wrap,u,y,I+1),new Us(u,this.wrap,u,y+1,I+1)]}isLessThan(n){return this.wrap<n.wrap||!(this.wrap>n.wrap)&&(this.overscaledZ<n.overscaledZ||!(this.overscaledZ>n.overscaledZ)&&(this.canonical.x<n.canonical.x||!(this.canonical.x>n.canonical.x)&&this.canonical.y<n.canonical.y))}wrapped(){return new Us(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(n){return new Us(this.overscaledZ,n,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Dd(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(n){return this.canonical.getTilePoint(new Oh(n.x-this.wrap,n.y))}}function $n(c,n,u,y,I){(c*=2)<0&&(c=-1*c-1);let k=1<<u;return(k*k*c+k*I+y).toString(36)+u.toString(36)+n.toString(36)}ui("CanonicalTileID",zd),ui("OverscaledTileID",Us,{omit:["posMatrix"]});class Ld{constructor(n,u,y){if(this.uid=n,u.height!==u.width)throw new RangeError("DEM tiles must be square");if(y&&y!=="mapbox"&&y!=="terrarium")return void li(`"${y}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=u.height;let I=this.dim=u.height-2;this.data=new Uint32Array(u.data.buffer),this.encoding=y||"mapbox";for(let k=0;k<I;k++)this.data[this._idx(-1,k)]=this.data[this._idx(0,k)],this.data[this._idx(I,k)]=this.data[this._idx(I-1,k)],this.data[this._idx(k,-1)]=this.data[this._idx(k,0)],this.data[this._idx(k,I)]=this.data[this._idx(k,I-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(I,-1)]=this.data[this._idx(I-1,0)],this.data[this._idx(-1,I)]=this.data[this._idx(0,I-1)],this.data[this._idx(I,I)]=this.data[this._idx(I-1,I-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let k=0;k<I;k++)for(let R=0;R<I;R++){let q=this.get(k,R);q>this.max&&(this.max=q),q<this.min&&(this.min=q)}}get(n,u){let y=new Uint8Array(this.data.buffer),I=4*this._idx(n,u);return(this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox)(y[I],y[I+1],y[I+2])}getUnpackVector(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]}_idx(n,u){if(n<-1||n>=this.dim+1||u<-1||u>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(u+1)*this.stride+(n+1)}_unpackMapbox(n,u,y){return(256*n*256+256*u+y)/10-1e4}_unpackTerrarium(n,u,y){return 256*n+u+y/256-32768}getPixels(){return new _({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(n,u,y){if(this.dim!==n.dim)throw new Error("dem dimension mismatch");let I=u*this.dim,k=u*this.dim+this.dim,R=y*this.dim,q=y*this.dim+this.dim;switch(u){case-1:I=k-1;break;case 1:k=I+1}switch(y){case-1:R=q-1;break;case 1:q=R+1}let G=-u*this.dim,J=-y*this.dim;for(let ae=R;ae<q;ae++)for(let ce=I;ce<k;ce++)this.data[this._idx(ce,ae)]=n.data[this._idx(ce+G,ae+J)]}}ui("DEMData",Ld);class rp{constructor(n){this._stringToNumber={},this._numberToString=[];for(let u=0;u<n.length;u++){let y=n[u];this._stringToNumber[y]=u,this._numberToString[u]=y}}encode(n){return this._stringToNumber[n]}decode(n){if(n>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${n} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[n]}}class Rd{constructor(n,u,y,I,k){this.type="Feature",this._vectorTileFeature=n,n._z=u,n._x=y,n._y=I,this.properties=n.properties,this.id=k}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(n){this._geometry=n}toJSON(){let n={geometry:this.geometry};for(let u in this)u!=="_geometry"&&u!=="_vectorTileFeature"&&(n[u]=this[u]);return n}}class Wp{constructor(n,u){this.tileID=n,this.x=n.canonical.x,this.y=n.canonical.y,this.z=n.canonical.z,this.grid=new oc(jn,16,0),this.grid3D=new oc(jn,16,0),this.featureIndexArray=new Ui,this.promoteId=u}insert(n,u,y,I,k,R){let q=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(y,I,k);let G=R?this.grid3D:this.grid;for(let J=0;J<u.length;J++){let ae=u[J],ce=[1/0,1/0,-1/0,-1/0];for(let de=0;de<ae.length;de++){let ge=ae[de];ce[0]=Math.min(ce[0],ge.x),ce[1]=Math.min(ce[1],ge.y),ce[2]=Math.max(ce[2],ge.x),ce[3]=Math.max(ce[3],ge.y)}ce[0]<jn&&ce[1]<jn&&ce[2]>=0&&ce[3]>=0&&G.insert(q,ce[0],ce[1],ce[2],ce[3])}}
801loadVTLayers(){return this.vtLayers||(this.vtLayers=new la.VectorTile(new _m(this.rawTileData)).layers,this.sourceLayerCoder=new rp(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(n,u,y,I){this.loadVTLayers();let k=n.params||{},R=jn/n.tileSize/n.scale,q=Rc(k.filter),G=n.queryGeometry,J=n.queryPadding*R,ae=Bd(G),ce=this.grid.query(ae.minX-J,ae.minY-J,ae.maxX+J,ae.maxY+J),de=Bd(n.cameraQueryGeometry),ge=this.grid3D.query(de.minX-J,de.minY-J,de.maxX+J,de.maxY+J,((Oe,nt,ut,tt)=>(function(st,Pt,kt,di,bi){for(let Jt of st)if(Pt<=Jt.x&&kt<=Jt.y&&di>=Jt.x&&bi>=Jt.y)return!0;let oi=[new Nt(Pt,kt),new Nt(Pt,bi),new Nt(di,bi),new Nt(di,kt)];if(st.length>2){for(let Jt of oi)if(ul(st,Jt))return!0}for(let Jt=0;Jt<st.length-1;Jt++)if(pn(st[Jt],st[Jt+1],oi))return!0;return!1})(n.cameraQueryGeometry,Oe-J,nt-J,ut+J,tt+J)));for(let Oe of ge)ce.push(Oe);ce.sort(np);let ye={},Ue;for(let Oe=0;Oe<ce.length;Oe++){let nt=ce[Oe];if(nt===Ue)continue;Ue=nt;let ut=this.featureIndexArray.get(nt),tt=null;this.loadMatchingFeature(ye,ut.bucketIndex,ut.sourceLayerIndex,ut.featureIndex,q,k.layers,k.availableImages,u,y,I,((st,Pt,kt)=>(tt||(tt=mi(st)),Pt.queryIntersectsFeature(G,st,kt,tt,this.z,n.transform,R,n.pixelPosMatrix))))}return ye}loadMatchingFeature(n,u,y,I,k,R,q,G,J,ae,ce){let de=this.bucketLayerIDs[u];if(R&&!(function(Oe,nt){for(let ut=0;ut<Oe.length;ut++)if(nt.indexOf(Oe[ut])>=0)return!0;return!1})(R,de))return;let ge=this.sourceLayerCoder.decode(y),ye=this.vtLayers[ge].feature(I);if(k.needGeometry){let Oe=Ii(ye,!0);if(!k.filter(new Nr(this.tileID.overscaledZ),Oe,this.tileID.canonical))return}else if(!k.filter(new Nr(this.tileID.overscaledZ),ye))return;let Ue=this.getId(ye,ge);for(let Oe=0;Oe<de.length;Oe++){let nt=de[Oe];if(R&&R.indexOf(nt)<0)continue;let ut=G[nt];if(!ut)continue;let tt={};Ue&&ae&&(tt=ae.getState(ut.sourceLayer||"_geojsonTileLayer",Ue));let st=Ct({},J[nt]);st.paint=Fd(st.paint,ut.paint,ye,tt,q),st.layout=Fd(st.layout,ut.layout,ye,tt,q);let Pt=!ce||ce(ye,ut,tt);if(!Pt)continue;let kt=new Rd(ye,this.z,this.x,this.y,Ue);kt.layer=st;let di=n[nt];di===void 0&&(di=n[nt]=[]),di.push({featureIndex:I,feature:kt,intersectionZ:Pt})}}lookupSymbolFeatures(n,u,y,I,k,R,q,G){let J={};this.loadVTLayers();let ae=Rc(k);for(let ce of n)this.loadMatchingFeature(J,y,I,ce,ae,R,q,G,u);return J}hasLayer(n){for(let u of this.bucketLayerIDs)for(let y of u)if(n===y)return!0;return!1}getId(n,u){let y=n.id;return this.promoteId&&(y=n.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[u]],typeof y=="boolean"&&(y=Number(y))),y}}function Fd(c,n,u,y,I){return At(c,((k,R)=>{let q=n instanceof dc?n.get(R):null;return q&&q.evaluate?q.evaluate(u,y,I):q}))}function Bd(c){let n=1/0,u=1/0,y=-1/0,I=-1/0;for(let k of c)n=Math.min(n,k.x),u=Math.min(u,k.y),y=Math.max(y,k.x),I=Math.max(I,k.y);return{minX:n,minY:u,maxX:y,maxY:I}}function np(c,n){return n-c}var Vh;ui("FeatureIndex",Wp,{omit:["rawTileData","sourceLayerCoder"]}),o.PerformanceMarkers=void 0,(Vh=o.PerformanceMarkers||(o.PerformanceMarkers={})).create="create",Vh.load="load",Vh.fullLoad="fullLoad";let du=null,Hp=[],op=1e3/30,rg={mark(c){performance.mark(c)},frame(c){let n=c;du!=null&&Hp.push(n-du),du=n},clearMetrics(){du=null,Hp=[],performance.clearMeasures("loadTime"),performance.clearMeasures("fullLoadTime");for(let c in o.PerformanceMarkers)performance.clearMarks(o.PerformanceMarkers[c])},getPerformanceMetrics(){performance.measure("loadTime",o.PerformanceMarkers.create,o.PerformanceMarkers.load),performance.measure("fullLoadTime",o.PerformanceMarkers.create,o.PerformanceMarkers.fullLoad);let c=performance.getEntriesByName("loadTime")[0].duration,n=performance.getEntriesByName("fullLoadTime")[0].duration,u=Hp.length,y=1/(Hp.reduce(((k,R)=>k+R),0)/u/1e3),I=Hp.filter((k=>k>op)).reduce(((k,R)=>k+(R-op)/op),0);return{loadTime:c,fullLoadTime:n,fps:y,percentDroppedFrames:I/(u+I)*100}}};o.AJAXError=Ti,o.ARRAY_TYPE=co,o.Actor=class{constructor(c,n,u){this.target=c,this.parent=n,this.mapId=u,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},fi(["receive","process"],this),this.invoker=new ig(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=ci()?c:window}send(c,n,u,y,I=!1){let k=Math.round(1e18*Math.random()).toString(36).substring(0,10);u&&(this.callbacks[k]=u);let R=jt(this.globalScope)?void 0:[];return this.target.postMessage({id:k,type:c,hasCallback:!!u,targetMapId:y,mustQueue:I,sourceMapId:this.mapId,data:Ls(n,R)},R),{cancel:()=>{u&&delete this.callbacks[k],this.target.postMessage({id:k,type:"<cancel>",targetMapId:y,sourceMapId:this.mapId})}}}receive(c){let n=c.data,u=n.id;if(u&&(!n.targetMapId||this.mapId===n.targetMapId))if(n.type==="<cancel>"){delete this.tasks[u];let y=this.cancelCallbacks[u];delete this.cancelCallbacks[u],y&&y()}else ci()||n.mustQueue?(this.tasks[u]=n,this.taskQueue.push(u),this.invoker.trigger()):this.processTask(u,n
801)}process(){if(!this.taskQueue.length)return;let c=this.taskQueue.shift(),n=this.tasks[c];delete this.tasks[c],this.taskQueue.length&&this.invoker.trigger(),n&&this.processTask(c,n)}processTask(c,n){if(n.type==="<response>"){let u=this.callbacks[c];delete this.callbacks[c],u&&(n.error?u(Uo(n.error)):u(null,Uo(n.data)))}else{let u=!1,y=jt(this.globalScope)?void 0:[],I=n.hasCallback?(q,G)=>{u=!0,delete this.cancelCallbacks[c],this.target.postMessage({id:c,type:"<response>",sourceMapId:this.mapId,error:q?Ls(q):null,data:Ls(G,y)},y)}:q=>{u=!0},k=null,R=Uo(n.data);if(this.parent[n.type])k=this.parent[n.type](n.sourceMapId,R,I);else if(this.parent.getWorkerSource){let q=n.type.split(".");k=this.parent.getWorkerSource(n.sourceMapId,q[0],R.source)[q[1]](R,I)}else I(new Error(`Could not find function ${n.type}`));!u&&k&&k.cancel&&(this.cancelCallbacks[c]=k.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},o.AlphaImage=Xc,o.CanonicalTileID=zd,o.CollisionBoxArray=wt,o.CollisionCircleLayoutArray=class extends le{},o.Color=ve,o.DEMData=Ld,o.DataConstantProperty=xi,o.DictionaryCoder=rp,o.EXTENT=jn,o.ErrorEvent=ya,o.EvaluationParameters=Nr,o.Event=oo,o.Evented=Na,o.FeatureIndex=Wp,o.FillBucket=tn,o.FillExtrusionBucket=Lh,o.GeoJSONFeature=Rd,o.ImageAtlas=yd,o.ImagePosition=_d,o.LineBucket=dd,o.LineStripIndexArray=class extends Be{},o.LngLat=zn,o.LngLatBounds=pu,o.MercatorCoordinate=Oh,o.ONE_EM=Po,o.OverscaledTileID=Us,o.PerformanceUtils=rg,o.PosArray=yi,o.Properties=io,o.QuadTriangleArray=class extends fe{},o.RGBAImage=_,o.RasterBoundsArray=class extends T{},o.RequestPerformance=class{constructor(c){this._marks={start:[c.url,"start"].join("#"),end:[c.url,"end"].join("#"),measure:c.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let c=performance.getEntriesByName(this._marks.measure);return c.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),c=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),c}},o.ResourceType=Qn,o.SegmentVector=Ki,o.SymbolBucket=tp,o.Transitionable=uc,o.TriangleIndexArray=hn,o.Uniform1f=Fs,o.Uniform1i=class extends gs{constructor(c,n){super(c,n),this.current=0}set(c){this.current!==c&&(this.current=c,this.gl.uniform1i(this.location,c))}},o.Uniform2f=class extends gs{constructor(c,n){super(c,n),this.current=[0,0]}set(c){c[0]===this.current[0]&&c[1]===this.current[1]||(this.current=c,this.gl.uniform2f(this.location,c[0],c[1]))}},o.Uniform3f=class extends gs{constructor(c,n){super(c,n),this.current=[0,0,0]}set(c){c[0]===this.current[0]&&c[1]===this.current[1]&&c[2]===this.current[2]||(this.current=c,this.gl.uniform3f(this.location,c[0],c[1],c[2]))}},o.Uniform4f=Zc,o.UniformColor=ku,o.UniformMatrix4f=class extends gs{constructor(c,n){super(c,n),this.current=cd}set(c){if(c[12]!==this.current[12]||c[0]!==this.current[0])return this.current=c,void this.gl.uniformMatrix4fv(this.location,!1,c);for(let n=1;n<16;n++)if(c[n]!==this.current[n]){this.current=c,this.gl.uniformMatrix4fv(this.location,!1,c);break}}},o.UnwrappedTileID=Dd,o.ValidationError=Kt,o.ZoomHistory=Vl,o.add=function(c,n,u){return c[0]=n[0]+u[0],c[1]=n[1]+u[1],c[2]=n[2]+u[2],c},o.addDynamicAttributes=Am,o.asyncAll=function(c,n,u){if(!c.length)return u(null,[]);let y=c.length,I=new Array(c.length),k=null;c.forEach(((R,q)=>{n(R,((G,J)=>{G&&(k=G),I[q]=J,--y==0&&u(k,I)}))}))},o.bezier=Qe,o.bindAll=fi,o.cacheEntryPossiblyAdded=function(c){yn++,yn>qr&&(c.getActor().send("enforceCacheSizeLimit",_n),yn=0)}
801,o.clamp=Ze,o.clearTileCache=function(c){let n=caches.delete(pi);c&&n.catch(c).then((()=>c()))},o.clipLine=Vp,o.clone=function(c){var n=new co(16);return n[0]=c[0],n[1]=c[1],n[2]=c[2],n[3]=c[3],n[4]=c[4],n[5]=c[5],n[6]=c[6],n[7]=c[7],n[8]=c[8],n[9]=c[9],n[10]=c[10],n[11]=c[11],n[12]=c[12],n[13]=c[13],n[14]=c[14],n[15]=c[15],n},o.clone$1=Ut,o.clone$2=function(c){var n=new co(3);return n[0]=c[0],n[1]=c[1],n[2]=c[2],n},o.collisionCircleLayout=qu,o.config=Li,o.copy=function(c,n){return c[0]=n[0],c[1]=n[1],c[2]=n[2],c[3]=n[3],c[4]=n[4],c[5]=n[5],c[6]=n[6],c[7]=n[7],c[8]=n[8],c[9]=n[9],c[10]=n[10],c[11]=n[11],c[12]=n[12],c[13]=n[13],c[14]=n[14],c[15]=n[15],c},o.create=function(){var c=new co(16);return co!=Float32Array&&(c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[11]=0,c[12]=0,c[13]=0,c[14]=0),c[0]=1,c[5]=1,c[10]=1,c[15]=1,c},o.create$1=kh,o.createExpression=Al,o.createFilter=Rc,o.createLayout=wn,o.createStyleLayer=function(c){return c.type==="custom"?new K_(c):new Y_[c.type](c)},o.cross=function(c,n,u){var y=n[0],I=n[1],k=n[2],R=u[0],q=u[1],G=u[2];return c[0]=I*G-k*q,c[1]=k*R-y*G,c[2]=y*q-I*R,c},o.dot=function(c,n){return c[0]*n[0]+c[1]*n[1]+c[2]*n[2]},o.dot$1=function(c,n){return c[0]*n[0]+c[1]*n[1]+c[2]*n[2]+c[3]*n[3]},o.ease=ct,o.emitValidationErrors=dr,o.enforceCacheSizeLimit=function(c){Cn(),er&&er.then((n=>{n.keys().then((u=>{for(let y=0;y<u.length-c;y++)n.delete(u[y])}))}))},o.equals=function(c,n){var u=c[0],y=c[1],I=c[2],k=c[3],R=c[4],q=c[5],G=c[6],J=c[7],ae=c[8],ce=c[9],de=c[10],ge=c[11],ye=c[12],Ue=c[13],Oe=c[14],nt=c[15],ut=n[0],tt=n[1],st=n[2],Pt=n[3],kt=n[4],di=n[5],bi=n[6],oi=n[7],Jt=n[8],Zt=n[9],si=n[10],ni=n[11],Vt=n[12],Di=n[13],Ei=n[14],ir=n[15];return Math.abs(u-ut)<=ro*Math.max(1,Math.abs(u),Math.abs(ut))&&Math.abs(y-tt)<=ro*Math.max(1,Math.abs(y),Math.abs(tt))&&Math.abs(I-st)<=ro*Math.max(1,Math.abs(I),Math.abs(st))&&Math.abs(k-Pt)<=ro*Math.max(1,Math.abs(k),Math.abs(Pt))&&Math.abs(R-kt)<=ro*Math.max(1,Math.abs(R),Math.abs(kt))&&Math.abs(q-di)<=ro*Math.max(1,Math.abs(q),Math.abs(di))&&Math.abs(G-bi)<=ro*Math.max(1,Math.abs(G),Math.abs(bi))&&Math.abs(J-oi)<=ro*Math.max(1,Math.abs(J),Math.abs(oi))&&Math.abs(ae-Jt)<=ro*Math.max(1,Math.abs(ae),Math.abs(Jt))&&Math.abs(ce-Zt)<=ro*Math.max(1,Math.abs(ce),Math.abs(Zt))&&Math.abs(de-si)<=ro*Math.max(1,Math.abs(de),Math.abs(si))&&Math.abs(ge-ni)<=ro*Math.max(1,Math.abs(ge),Math.abs(ni))&&Math.abs(ye-Vt)<=ro*Math.max(1,Math.abs(ye),Math.abs(Vt))&&Math.abs(Ue-Di)<=ro*Math.max(1,Math.abs(Ue),Math.abs(Di))&&Math.abs(Oe-Ei)<=ro*Math.max(1,Math.abs(Oe),Math.abs(Ei))&&Math.abs(nt-ir)<=ro*Math.max(1,Math.abs(nt),Math.abs(ir))},o.evaluateSizeForFeature=function(c,{uSize:n,uSizeT:u},{lowerSize:y,upperSize:I}){return c.kind==="source"?y/Qc:c.kind==="composite"?Mr(y/Qc,I/Qc,u):n},o.evaluateSizeForZoom=function(c,n){let u=0,y=0;if(c.kind==="constant")y=c.layoutSize;else if(c.kind!=="source"){let{interpolationType:I,minZoom:k,maxZoom:R}=c,q=I?Ze(Vn.interpolationFactor(I,n,k,R),0,1):0;c.kind==="camera"?y=Mr(c.minSize,c.maxSize,q):u=q}return{uSizeT:u,uSize:y}},o.evaluateVariableOffset=tg,o.evented=nu,o.exported=hi,o.exported$1=zo,o.extend=Ct,o.filterObject=He,o.fromRotation=function(c,n){var u=Math.sin(n),y=Math.cos(n);return c[0]=y,c[1]=u,c[2]=0,c[3]=-u,c[4]=y,c[5]=0,c[6]=0,c[7]=0,c[8]=1,c},o.fromScaling=function(c,n){return c[0]=n[0],c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[5]=n[1],c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[10]=n[2],c[11]=0,c[12]=0,c[13]=0,c[14]=0,c[15]=1,c},o.getAnchorAlignment=Cm,o.getAnchorJustification=Id,o.getArrayBuffer=on,o.getImage=xo,o.getJSON=function(c,n){return Hn(Ct(c,{type:"json"}),n)},o.getOverlapMode=$p,o.getRTLTextPluginStatus=lc,o.getReferrer=nn,o.getVideo=function(c,n){let u=window.document.createElement("video");u.muted=!0,u.onloadstart=function(){n(null,u)};for(let y=0;y<c.length;y++){let I=window.document.createElement("source");Xn(c[y])||(u.crossOrigin="Anonymous"),I.src=c[y],u.appendChild(I)}return{cancel:()=>{}}},o.identity=Os,o.invert=function(c,n){var u=n[0],y=n[1],I=n[2],k=n[3],R=n[4],q=n[5],G=n[6],J=n[7],ae=n[8],ce=n[9],de=n[10],ge=n[11],ye=n[12],Ue=n[13],Oe=n[14],nt=n[15],ut=u*q-y*R,tt=u*G-I*R,st=u*J-k*R,Pt=y*G-I*q,kt=y*J-k*q,di=I*J-k*G,bi=ae*Ue-ce*ye,oi=ae*Oe-de*ye,Jt=ae*nt-ge*ye,Zt=ce*Oe-de*Ue,si=ce*nt-ge*Ue,ni=de*nt-ge*Oe,Vt=ut*ni-tt*si+st*Zt+Pt*Jt-kt*oi+di*bi;
801return Vt?(c[0]=(q*ni-G*si+J*Zt)*(Vt=1/Vt),c[1]=(I*si-y*ni-k*Zt)*Vt,c[2]=(Ue*di-Oe*kt+nt*Pt)*Vt,c[3]=(de*kt-ce*di-ge*Pt)*Vt,c[4]=(G*Jt-R*ni-J*oi)*Vt,c[5]=(u*ni-I*Jt+k*oi)*Vt,c[6]=(Oe*st-ye*di-nt*tt)*Vt,c[7]=(ae*di-de*st+ge*tt)*Vt,c[8]=(R*si-q*Jt+J*bi)*Vt,c[9]=(y*Jt-u*si-k*bi)*Vt,c[10]=(ye*kt-Ue*st+nt*ut)*Vt,c[11]=(ce*st-ae*kt-ge*ut)*Vt,c[12]=(q*oi-R*Zt-G*bi)*Vt,c[13]=(u*Zt-y*oi+I*bi)*Vt,c[14]=(Ue*tt-ye*Pt-Oe*ut)*Vt,c[15]=(ae*Pt-ce*tt+de*ut)*Vt,c):null},o.isImageBitmap=Si,o.isSafari=jt,o.isWorker=ci,o.keysDifference=function(c,n){let u=[];for(let y in c)y in n||u.push(y);return u},o.lazyLoadRTLTextPlugin=function(){Ia.isLoading()||Ia.isLoaded()||lc()!=="deferred"||cc()},o.makeRequest=Hn,o.mapObject=At,o.mercatorXfromLng=Om,o.mercatorYfromLat=Zp,o.mercatorZfromAltitude=Pd,o.mul=Fu,o.mul$1=function(c,n,u){return c[0]=n[0]*u[0],c[1]=n[1]*u[1],c[2]=n[2]*u[2],c[3]=n[3]*u[3],c},o.multiply=su,o.nextPowerOfTwo=function(c){return c<=1?1:Math.pow(2,Math.ceil(Math.log(c)/Math.LN2))},o.normalize=function(c,n){var u=n[0],y=n[1],I=n[2],k=u*u+y*y+I*I;return k>0&&(k=1/Math.sqrt(k)),c[0]=n[0]*k,c[1]=n[1]*k,c[2]=n[2]*k,c},o.number=Mr,o.ortho=function(c,n,u,y,I,k,R){var q=1/(n-u),G=1/(y-I),J=1/(k-R);return c[0]=-2*q,c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[5]=-2*G,c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[10]=2*J,c[11]=0,c[12]=(n+u)*q,c[13]=(I+y)*G,c[14]=(R+k)*J,c[15]=1,c},o.parseCacheControl=Pe,o.parseGlyphPbf=function(c){return new _m(c).readFields(U_,[])},o.pbf=_m,o.performSymbolLayout=function(c){c.bucket.createArrays(),c.bucket.tilePixelRatio=jn/(512*c.bucket.overscaling),c.bucket.compareText={},c.bucket.iconsNeedLinear=!1;let n=c.bucket.layers[0].layout,u=c.bucket.layers[0]._unevaluatedLayout._values,y={layoutIconSize:u["icon-size"].possiblyEvaluate(new Nr(c.bucket.zoom+1),c.canonical),layoutTextSize:u["text-size"].possiblyEvaluate(new Nr(c.bucket.zoom+1),c.canonical),textMaxSize:u["text-size"].possiblyEvaluate(new Nr(18))};if(c.bucket.textSizeData.kind==="composite"){let{minZoom:G,maxZoom:J}=c.bucket.textSizeData;y.compositeTextSizes=[u["text-size"].possiblyEvaluate(new Nr(G),c.canonical),u["text-size"].possiblyEvaluate(new Nr(J),c.canonical)]}if(c.bucket.iconSizeData.kind==="composite"){let{minZoom:G,maxZoom:J}=c.bucket.iconSizeData;y.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new Nr(G),c.canonical),u["icon-size"].possiblyEvaluate(new Nr(J),c.canonical)]}let I=n.get("text-line-height")*Po,k=n.get("text-rotation-alignment")!=="viewport"&&n.get("symbol-placement")!=="point",R=n.get("text-keep-upright"),q=n.get("text-size");for(let G of c.bucket.features){let J=n.get("text-font").evaluate(G,{},c.canonical).join(","),ae=q.evaluate(G,{},c.canonical),ce=y.layoutTextSize.evaluate(G,{},c.canonical),de=y.layoutIconSize.evaluate(G,{},c.canonical),ge={horizontal:{},vertical:void 0},ye=G.text,Ue,Oe=[0,0];if(ye){let tt=ye.toString(),st=n.get("text-letter-spacing").evaluate(G,{},c.canonical)*Po,Pt=Pu(tt)?st:0,kt=n.get("text-anchor").evaluate(G,{},c.canonical),di=n.get("text-variable-anchor");if(!di){let si=n.get("text-radial-offset").evaluate(G,{},c.canonical);Oe=si?tg(kt,[si*Po,th]):n.get("text-offset").evaluate(G,{},c.canonical).map((ni=>ni*Po))}let bi=k?"center":n.get("text-justify").evaluate(G,{},c.canonical),oi=n.get("symbol-placement"),Jt=oi==="point"?n.get("text-max-width").evaluate(G,{},c.canonical)*Po:0,Zt=()=>{c.bucket.allowVerticalPlacement&&So(tt)&&(ge.vertical=xd(ye,c.glyphMap,c.glyphPositions,c.imagePositions,J,Jt,I,kt,"left",Pt,Oe,o.WritingMode.vertical,!0,oi,ce,ae))};if(!k&&di){let si=bi==="auto"?di.map((Vt=>Id(Vt))):[bi],ni=!1;for(let Vt=0;Vt<si.length;Vt++){let Di=si[Vt];if(!ge.horizontal[Di])if(ni)ge.horizontal[Di]=ge.horizontal[0];else{let Ei=xd(ye,c.glyphMap,c.glyphPositions,c.imagePositions,J,Jt,I,"center",Di,Pt,Oe,o.WritingMode.horizontal,!1,oi,ce,ae);Ei&&(ge.horizontal[Di]=Ei,ni=Ei.positionedLines.length===1)}}Zt()}else{bi==="auto"&&(bi=Id(kt));let si=xd(ye,c.glyphMap,c.glyphPositions,c.imagePositions,J,Jt,I,kt,bi,Pt,Oe,o.WritingMode.horizontal,!1,oi,ce,ae);si&&(ge.horizontal[bi]=si),Zt(),So(tt)&&k&&R&&(ge.vertical=xd(ye,c.glyphMap,c.glyphPositions,c.imagePositions,J,Jt,I,kt,bi,Pt,Oe,o.WritingMode.vertical,!1,oi,ce,ae))}}let nt=!1;if(G.icon&&G.icon.name){let tt=c.imageMap[G.icon.name];tt&&(Ue=$_(c.imagePositions[G.icon.name],n.get("icon-offset").evaluate(G,{},c.canonical),n.get("icon-anchor").evaluate(G,{},c.canonical)),nt=!!tt.sdf,c.bucket.sdfIcons===void 0?c.bucket.sdfIcons=nt:c.bucket.sdfIcons!==nt&&li("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(tt.pixelRatio!==c.bucket.pixelRatio||n.get("icon-rotate").constantOr(1)!==0)&&(c.bucket.iconsNeedLinear=!0))}let ut=km(ge.horizontal)||ge.vertical;c.bucket.iconsInText=!!ut&&ut.iconsInText,(ut||Ue)&&jp(c.bucket,G,ge,Ue,c.imageMap,y,ce,de,Oe,nt,c.canonical)}c.showCollisionBoxes&&c.bucket.generateCollisionDebugBuffers()},o.perspective=function(c,n,u,y,I){var k,R=1/Math.tan(n/2);
801return c[0]=R/u,c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[5]=R,c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[11]=-1,c[12]=0,c[13]=0,c[15]=0,I!=null&&I!==1/0?(c[10]=(I+y)*(k=1/(y-I)),c[14]=2*I*y*k):(c[10]=-1,c[14]=-2*y),c},o.pick=function(c,n){let u={};for(let y=0;y<n.length;y++){let I=n[y];I in c&&(u[I]=c[I])}return u},o.plugin=Ia,o.pointGeometry=Nt,o.polygonIntersectsPolygon=Wc,o.potpack=Kf,o.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],o.register=ui,o.registerForPluginStateChange=function(c){return c({pluginStatus:Io,pluginURL:ps}),nu.on("pluginStateChange",c),c},o.renderColorRamp=t,o.rotateX=function(c,n,u){var y=Math.sin(u),I=Math.cos(u),k=n[4],R=n[5],q=n[6],G=n[7],J=n[8],ae=n[9],ce=n[10],de=n[11];return n!==c&&(c[0]=n[0],c[1]=n[1],c[2]=n[2],c[3]=n[3],c[12]=n[12],c[13]=n[13],c[14]=n[14],c[15]=n[15]),c[4]=k*I+J*y,c[5]=R*I+ae*y,c[6]=q*I+ce*y,c[7]=G*I+de*y,c[8]=J*I-k*y,c[9]=ae*I-R*y,c[10]=ce*I-q*y,c[11]=de*I-G*y,c},o.rotateZ=function(c,n,u){var y=Math.sin(u),I=Math.cos(u),k=n[0],R=n[1],q=n[2],G=n[3],J=n[4],ae=n[5],ce=n[6],de=n[7];return n!==c&&(c[8]=n[8],c[9]=n[9],c[10]=n[10],c[11]=n[11],c[12]=n[12],c[13]=n[13],c[14]=n[14],c[15]=n[15]),c[0]=k*I+J*y,c[1]=R*I+ae*y,c[2]=q*I+ce*y,c[3]=G*I+de*y,c[4]=J*I-k*y,c[5]=ae*I-R*y,c[6]=ce*I-q*y,c[7]=de*I-G*y,c},o.scale=function(c,n,u){var y=u[0],I=u[1],k=u[2];return c[0]=n[0]*y,c[1]=n[1]*y,c[2]=n[2]*y,c[3]=n[3]*y,c[4]=n[4]*I,c[5]=n[5]*I,c[6]=n[6]*I,c[7]=n[7]*I,c[8]=n[8]*k,c[9]=n[9]*k,c[10]=n[10]*k,c[11]=n[11]*k,c[12]=n[12],c[13]=n[13],c[14]=n[14],c[15]=n[15],c},o.scale$1=function(c,n,u){return c[0]=n[0]*u,c[1]=n[1]*u,c[2]=n[2]*u,c},o.setCacheLimits=function(c,n){_n=c,qr=n},o.setRTLTextPlugin=function(c,n,u=!1){if(Io===sc||Io===Th||Io===ol)throw new Error("setRTLTextPlugin cannot be called multiple times.");ps=hi.resolveURL(c),Io=sc,al=n,Rs(),u||cc()},o.spec=St,o.sphericalToCartesian=function([c,n,u]){return n+=90,n*=Math.PI/180,u*=Math.PI/180,{x:c*Math.cos(n)*Math.sin(u),y:c*Math.sin(n)*Math.sin(u),z:c*Math.cos(u)}},o.sqrLen=function(c){var n=c[0],u=c[1];return n*n+u*u},o.sub=function(c,n,u){return c[0]=n[0]-u[0],c[1]=n[1]-u[1],c[2]=n[2]-u[2],c},o.toEvaluationFeature=Ii,o.transformMat3=function(c,n,u){var y=n[0],I=n[1],k=n[2];return c[0]=y*u[0]+I*u[3]+k*u[6],c[1]=y*u[1]+I*u[4]+k*u[7],c[2]=y*u[2]+I*u[5]+k*u[8],c},o.transformMat4=jl,o.transformMat4$1=function(c,n,u){var y=n[0],I=n[1];return c[0]=u[0]*y+u[4]*I+u[12],c[1]=u[1]*y+u[5]*I+u[13],c},o.translate=function(c,n,u){var y,I,k,R,q,G,J,ae,ce,de,ge,ye,Ue=u[0],Oe=u[1],nt=u[2];return n===c?(c[12]=n[0]*Ue+n[4]*Oe+n[8]*nt+n[12],c[13]=n[1]*Ue+n[5]*Oe+n[9]*nt+n[13],c[14]=n[2]*Ue+n[6]*Oe+n[10]*nt+n[14],c[15]=n[3]*Ue+n[7]*Oe+n[11]*nt+n[15]):(I=n[1],k=n[2],R=n[3],q=n[4],G=n[5],J=n[6],ae=n[7],ce=n[8],de=n[9],ge=n[10],ye=n[11],c[0]=y=n[0],c[1]=I,c[2]=k,c[3]=R,c[4]=q,c[5]=G,c[6]=J,c[7]=ae,c[8]=ce,c[9]=de,c[10]=ge,c[11]=ye,c[12]=y*Ue+q*Oe+ce*nt+n[12],c[13]=I*Ue+G*Oe+de*nt+n[13],c[14]=k*Ue+J*Oe+ge*nt+n[14],c[15]=R*Ue+ae*Oe+ye*nt+n[15]),c},o.triggerPluginCompletionEvent=Ji,o.unicodeBlockLookup=Yt,o.uniqueId=function(){return Mt++},o.validateCustomStyleLayer=function(c){let n=[],u=c.id;return u===void 0&&n.push({message:`layers.${u}: missing required property "id"`}),c.render===void 0&&n.push({message:`layers.${u}: missing required method "render"`}),c.renderingMode&&c.renderingMode!=="2d"&&c.renderingMode!=="3d"&&n.push({message:`layers.${u}: property "renderingMode" must be either "2d" or "3d"`}),n},o.validateLight=ru,o.validateStyle=Vc,o.vectorTile=la,o.warnOnce=li,o.wrap=Bt})),H(["./shared"],(function(o){"use strict";function pe(Se){let re=typeof Se;if(re==="number"||re==="boolean"||re==="string"||Se==null)return JSON.stringify(Se);if(Array.isArray(Se)){let ve="[";for(let $e of Se)ve+=`${pe($e)},`;return`${ve}]`}let te=Object.keys(Se).sort(),xe="{";for(let ve=0;ve<te.length;ve++)xe+=`${JSON.stringify(te[ve])}:${pe(Se[te[ve]])},`;return`${xe}}`}function Ne(Se){let re="";for(let te of o.refProperties)re+=`/${pe(Se[te])}`;return re}class Qe{constructor(re){this.keyCache={},re&&this.replace(re)}replace(re){this._layerConfigs={},this._layers={},this.update(re,[])}update(re,te){for(let ve of re){this._layerConfigs[ve.id]=ve;let $e=this._layers[ve.id]=o.createStyleLayer(ve);$e._featureFilter=o.createFilter($e.filter),this.keyCache[ve.id]&&delete this.keyCache[ve.id]}for(let ve of te)delete this.keyCache[ve],delete this._layerConfigs[ve],delete this._layers[ve];this.familiesBySource={};let xe=(function(ve,$e){let Ke={};for(let ke=0;ke<ve.length;ke++){let Ge=$e&&$e[ve[ke].id]||Ne(ve[ke]);$e&&($e[ve[ke].id]=Ge);let pt=Ke[Ge];pt||(pt=Ke[Ge]=[]),pt.push(ve[ke])}let Te=[];for(let ke in Ke)Te.push(Ke[ke]);return Te})(Object.values(this._layerConfigs),this.keyCache);for(let ve of xe){let $e=ve.map((zt=>this._layers[zt.id])),Ke=$e[0];if(Ke.visibility==="none")continue;let Te=Ke.source||"",ke=this.familiesBySource[Te];ke||(ke=this.familiesBySource[Te]={});let Ge=Ke.sourceLayer||"_geojsonTileLayer",pt=ke[Ge];pt||(pt=ke[Ge]=[]),pt.push($e)}}}class ct{constructor(re){let te={},xe=[];for(let Te in re){let ke=re[Te],Ge=te[Te]={};for(let pt in ke){let zt=ke[+pt];if(!zt||zt.bitmap.width===0||zt.bitmap.height===0)continue;let dt={x:0,y:0,w:zt.bitmap.width+2,h:zt.bitmap.height+2};xe.push(dt),Ge[pt]={rect:dt,metrics:zt.metrics}}}let{w:ve,h:$e}=o.potpack(xe),Ke=new o.AlphaImage({width:ve||1,height:$e||1});for(let Te in re){let ke=re[Te];for(let Ge in ke){let pt=ke[+Ge];if(!pt||pt.bitmap.width===0||pt.bitmap.height===0)continue;let zt=te[Te][Ge].rect;o.AlphaImage.copy(pt.bitmap,Ke,{x:0,y:0},{x:zt.x+1,y:zt.y+1},pt.bitmap)}}this.image=Ke,this.positions=te}}o.register("GlyphAtlas",ct);
801class Ze{constructor(re){this.tileID=new o.OverscaledTileID(re.tileID.overscaledZ,re.tileID.wrap,re.tileID.canonical.z,re.tileID.canonical.x,re.tileID.canonical.y),this.uid=re.uid,this.zoom=re.zoom,this.pixelRatio=re.pixelRatio,this.tileSize=re.tileSize,this.source=re.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=re.showCollisionBoxes,this.collectResourceTiming=!!re.collectResourceTiming,this.returnDependencies=!!re.returnDependencies,this.promoteId=re.promoteId}parse(re,te,xe,ve,$e){this.status="parsing",this.data=re,this.collisionBoxArray=new o.CollisionBoxArray;let Ke=new o.DictionaryCoder(Object.keys(re.layers).sort()),Te=new o.FeatureIndex(this.tileID,this.promoteId);Te.bucketLayerIDs=[];let ke={},Ge={featureIndex:Te,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:xe},pt=te.familiesBySource[this.source];for(let Vi in pt){let Hi=re.layers[Vi];if(!Hi)continue;Hi.version===1&&o.warnOnce(`Vector tile source "${this.source}" layer "${Vi}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let qi=Ke.encode(Vi),Fi=[];for(let bn=0;bn<Hi.length;bn++){let Sr=Hi.feature(bn),En=Te.getId(Sr,Vi);Fi.push({feature:Sr,id:En,index:bn,sourceLayerIndex:qi})}for(let bn of pt[Vi]){let Sr=bn[0];Sr.source!==this.source&&o.warnOnce(`layer.source = ${Sr.source} does not equal this.source = ${this.source}`),Sr.minzoom&&this.zoom<Math.floor(Sr.minzoom)||Sr.maxzoom&&this.zoom>=Sr.maxzoom||Sr.visibility!=="none"&&(Bt(bn,this.zoom,xe),(ke[Sr.id]=Sr.createBucket({index:Te.bucketLayerIDs.length,layers:bn,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:qi,sourceID:this.source})).populate(Fi,Ge,this.tileID.canonical),Te.bucketLayerIDs.push(bn.map((En=>En.id))))}}let zt,dt,Lt,gi,ei=o.mapObject(Ge.glyphDependencies,(Vi=>Object.keys(Vi).map(Number)));Object.keys(ei).length?ve.send("getGlyphs",{uid:this.uid,stacks:ei},((Vi,Hi)=>{zt||(zt=Vi,dt=Hi,rr.call(this))})):dt={};let zi=Object.keys(Ge.iconDependencies);zi.length?ve.send("getImages",{icons:zi,source:this.source,tileID:this.tileID,type:"icons"},((Vi,Hi)=>{zt||(zt=Vi,Lt=Hi,rr.call(this))})):Lt={};let Ri=Object.keys(Ge.patternDependencies);function rr(){if(zt)return $e(zt);if(dt&&Lt&&gi){let Vi=new ct(dt),Hi=new o.ImageAtlas(Lt,gi);for(let qi in ke){let Fi=ke[qi];Fi instanceof o.SymbolBucket?(Bt(Fi.layers,this.zoom,xe),o.performSymbolLayout({bucket:Fi,glyphMap:dt,glyphPositions:Vi.positions,imageMap:Lt,imagePositions:Hi.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Fi.hasPattern&&(Fi instanceof o.LineBucket||Fi instanceof o.FillBucket||Fi instanceof o.FillExtrusionBucket)&&(Bt(Fi.layers,this.zoom,xe),Fi.addFeatures(Ge,this.tileID.canonical,Hi.patternPositions))}this.status="done",$e(null,{buckets:Object.values(ke).filter((qi=>!qi.isEmpty())),featureIndex:Te,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Vi.image,imageAtlas:Hi,glyphMap:this.returnDependencies?dt:null,iconMap:this.returnDependencies?Lt:null,glyphPositions:this.returnDependencies?Vi.positions:null})}}Ri.length?ve.send("getImages",{icons:Ri,source:this.source,tileID:this.tileID,type:"patterns"},((Vi,Hi)=>{zt||(zt=Vi,gi=Hi,rr.call(this))})):gi={},rr.call(this)}}function Bt(Se,re,te){let xe=new o.EvaluationParameters(re);for(let ve of Se)ve.recalculate(xe,te)}function Ct(Se,re){let te=o.getArrayBuffer(Se.request,((xe,ve,$e,Ke)=>{xe?re(xe):ve&&re(null,{vectorTile:new o.vectorTile.VectorTile(new o.pbf(ve)),rawData:ve,cacheControl:$e,expires:Ke})}));return()=>{te.cancel(),re()}}class Mt{constructor(re,te,xe,ve){this.actor=re,this.layerIndex=te,this.availableImages=xe,this.loadVectorData=ve||Ct,this.loading={},this.loaded={}}loadTile(re,te){let xe=re.uid;this.loading||(this.loading={});let ve=!!(re&&re.request&&re.request.collectResourceTiming)&&new o.RequestPerformance(re.request),$e=this.loading[xe]=new Ze(re);$e.abort=this.loadVectorData(re,((Ke,Te)=>{if(delete this.loading[xe],Ke||!Te)return $e.status="done",this.loaded[xe]=$e,te(Ke);let ke=Te.rawData,Ge={};Te.expires&&(Ge.expires=Te.expires),Te.cacheControl&&(Ge.cacheControl=Te.cacheControl);let pt={};if(ve){let zt=ve.finish();zt&&(pt.resourceTiming=JSON.parse(JSON.stringify(zt)))}$e.vectorTile=Te.vectorTile,$e.parse(Te.vectorTile,this.layerIndex,this.availableImages,this.actor,((zt,dt)=>{if(zt||!dt)return te(zt);te(null,o.extend({rawTileData:ke.slice(0)},dt,Ge,pt))})),this.loaded=this.loaded||{},this.loaded[xe]=$e}))}reloadTile(re,te){let xe=this.loaded,ve=re.uid,$e=this;if(xe&&xe[ve]){let Ke=xe[ve];Ke.showCollisionBoxes=re.showCollisionBoxes;let Te=(ke,Ge)=>{let pt=Ke.reloadCallback;pt&&(delete Ke.reloadCallback,Ke.parse(Ke.vectorTile,$e.layerIndex,this.availableImages,$e.actor,pt)),te(ke,Ge)};Ke.status==="parsing"?Ke.reloadCallback=Te:Ke.status==="done"&&(Ke.vectorTile?Ke.parse(Ke.vectorTile,this.layerIndex,this.availableImages,this.actor,Te):Te())}}abortTile(re,te){let xe=this.loading,ve=re.uid;xe&&xe[ve]&&xe[ve].abort&&(xe[ve].abort(),delete xe[ve]),te()}removeTile(re,te){let xe=this.loaded,ve=re.uid;xe&&xe[ve]&&delete xe[ve],te()}}class fi{constructor(){this.loaded={}}loadTile(re,te){let{uid:xe,encoding:ve,rawImageData:$e}=re,Ke=o.isImageBitmap($e)?this.getImageData($e):$e,Te=new o.DEMData(xe,Ke,ve);this.loaded=this.loaded||{},this.loaded[xe]=Te,te(null,Te)}getImageData(re){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(re.width,re.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=re.width,this.offscreenCanvas.height=re.height,this.offscreenCanvasContext.drawImage(re,0,0,re.width,re.height);let te=this.offscreenCanvasContext.getImageData(-1,-1,re.width+2,re.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new o.RGBAImage({width:te.width,height:te.height},te.data)}removeTile(re){let te=this.loaded,xe=re.uid;te&&te[xe]&&delete te[xe]}}var At=function Se(re,te){var xe,ve=re&&re.type;if(ve==="FeatureCollection")for(xe=0;xe<re.features.length;xe++)Se(re.features[xe],te);else if(ve==="GeometryCollection")for(xe=0;xe<re.geometries.length;xe++)Se(re.geometries[xe],te);else if(ve==="Feature")Se(re.geometry,te);else if(ve==="Polygon")He(re.coordinates,te);else if(ve==="MultiPolygon")for(xe=0;xe<re.coordinates.length;xe++)He(re.coordinates[xe],te);return re};function He(Se,re){if(Se.length!==0){Ut(Se[0],re);for(var te=1;te<Se.length;te++)Ut(Se[te],!re)}}function Ut(Se,re){for(var te=0,xe=0,ve=0,$e=Se.length,Ke=$e-1;ve<$e;Ke=ve++){var Te=(Se[ve][0]-Se[Ke][0])*(Se[Ke][1]+Se[ve][1]),ke=te+Te;xe+=Math.abs(te)>=Math.abs(Te)?te-ke+Te:Te-ke+te,te=ke}te+xe>=0!=!!re&&Se.reverse()}let Mi=o.vectorTile.VectorTileFeature.prototype.toGeoJSON;class li{constructor(re){this._feature=re,this.extent=o.EXTENT,this.type=re.type,this.properties=re.tags,"id"in re&&!isNaN(re.id)&&(this.id=p
801arseInt(re.id,10))}loadGeometry(){if(this._feature.type===1){let re=[];for(let te of this._feature.geometry)re.push([new o.pointGeometry(te[0],te[1])]);return re}{let re=[];for(let te of this._feature.geometry){let xe=[];for(let ve of te)xe.push(new o.pointGeometry(ve[0],ve[1]));re.push(xe)}return re}}toGeoJSON(re,te,xe){return Mi.call(this,re,te,xe)}}class ki{constructor(re){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=o.EXTENT,this.length=re.length,this._features=re}feature(re){return new li(this._features[re])}}var wi={exports:{}},ci=o.pointGeometry,Pe=o.vectorTile.VectorTileFeature,Ve=Ye;function Ye(Se,re){this.options=re||{},this.features=Se,this.length=Se.length}function It(Se,re){this.id=typeof Se.id=="number"?Se.id:void 0,this.type=Se.type,this.rawGeometry=Se.type===1?[Se.geometry]:Se.geometry,this.properties=Se.tags,this.extent=re||4096}Ye.prototype.feature=function(Se){return new It(this.features[Se],this.options.extent)},It.prototype.loadGeometry=function(){var Se=this.rawGeometry;this.geometry=[];for(var re=0;re<Se.length;re++){for(var te=Se[re],xe=[],ve=0;ve<te.length;ve++)xe.push(new ci(te[ve][0],te[ve][1]));this.geometry.push(xe)}return this.geometry},It.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var Se=this.geometry,re=1/0,te=-1/0,xe=1/0,ve=-1/0,$e=0;$e<Se.length;$e++)for(var Ke=Se[$e],Te=0;Te<Ke.length;Te++){var ke=Ke[Te];re=Math.min(re,ke.x),te=Math.max(te,ke.x),xe=Math.min(xe,ke.y),ve=Math.max(ve,ke.y)}return[re,xe,te,ve]},It.prototype.toGeoJSON=Pe.prototype.toGeoJSON;var jt=o.pbf,Si=Ve;function hi(Se){var re=new jt;return(function(te,xe){for(var ve in te.layers)xe.writeMessage(3,Nt,te.layers[ve])})(Se,re),re.finish()}function Nt(Se,re){var te;re.writeVarintField(15,Se.version||1),re.writeStringField(1,Se.name||""),re.writeVarintField(5,Se.extent||4096);var xe={keys:[],values:[],keycache:{},valuecache:{}};for(te=0;te<Se.length;te++)xe.feature=Se.feature(te),re.writeMessage(2,vi,xe);var ve=xe.keys;for(te=0;te<ve.length;te++)re.writeStringField(3,ve[te]);var $e=xe.values;for(te=0;te<$e.length;te++)re.writeMessage(4,_n,$e[te])}function vi(Se,re){var te=Se.feature;te.id!==void 0&&re.writeVarintField(1,te.id),re.writeMessage(2,Li,Se),re.writeVarintField(3,te.type),re.writeMessage(4,lr,te)}function Li(Se,re){var te=Se.feature,xe=Se.keys,ve=Se.values,$e=Se.keycache,Ke=Se.valuecache;for(var Te in te.properties){var ke=te.properties[Te],Ge=$e[Te];if(ke!==null){Ge===void 0&&(xe.push(Te),$e[Te]=Ge=xe.length-1),re.writeVarint(Ge);var pt=typeof ke;pt!=="string"&&pt!=="boolean"&&pt!=="number"&&(ke=JSON.stringify(ke));var zt=pt+":"+ke,dt=Ke[zt];dt===void 0&&(ve.push(ke),Ke[zt]=dt=ve.length-1),re.writeVarint(dt)}}}function pi(Se,re){return(re<<3)+(7&Se)}function er(Se){return Se<<1^Se>>31}function lr(Se,re){for(var te=Se.loadGeometry(),xe=Se.type,ve=0,$e=0,Ke=te.length,Te=0;Te<Ke;Te++){var ke=te[Te],Ge=1;xe===1&&(Ge=ke.length),re.writeVarint(pi(1,Ge));for(var pt=xe===3?ke.length-1:ke.length,zt=0;zt<pt;zt++){zt===1&&xe!==1&&re.writeVarint(pi(2,pt-1));var dt=ke[zt].x-ve,Lt=ke[zt].y-$e;re.writeVarint(er(dt)),re.writeVarint(er(Lt)),ve+=dt,$e+=Lt}xe===3&&re.writeVarint(pi(7,1))}}function _n(Se,re){var te=typeof Se;te==="string"?re.writeStringField(1,Se):te==="boolean"?re.writeBooleanField(7,Se):te==="number"&&(Se%1!=0?re.writeDoubleField(3,Se):Se<0?re.writeSVarintField(6,Se):re.writeVarintField(5,Se))}function qr(Se,re,te,xe,ve,$e){if(ve-xe<=te)return;let Ke=xe+ve>>1;Cn(Se,re,Ke,xe,ve,$e%2),qr(Se,re,te,xe,Ke-1,$e+1),qr(Se,re,te,Ke+1,ve,$e+1)}function Cn(Se,re,te,xe,ve,$e){for(;ve>xe;){if(ve-xe>600){let Ge=ve-xe+1,pt=te-xe+1,zt=Math.log(Ge),dt=.5*Math.exp(2*zt/3),Lt=.5*Math.sqrt(zt*dt*(Ge-dt)/Ge)*(pt-Ge/2<0?-1:1);Cn(Se,re,te,Math.max(xe,Math.floor(te-pt*dt/Ge+Lt)),Math.min(ve,Math.floor(te+(Ge-pt)*dt/Ge+Lt)),$e)}let Ke=re[2*te+$e],Te=xe,ke=ve;for(yn(Se,re,xe,te),re[2*ve+$e]>Ke&&yn(Se,re,xe,ve);Te<ke;){for(yn(Se,re,Te,ke),Te++,ke--;re[2*Te+$e]<Ke;)Te++;for(;re[2*ke+$e]>Ke;)ke--}re[2*xe+$e]===Ke?yn(Se,re,xe,ke):(ke++,yn(Se,re,ke,ve)),ke<=te&&(xe=ke+1),te<=ke&&(ve=ke-1)}}function yn(Se,re,te,xe){zo(Se,te,xe),zo(re,2*te,2*xe),zo(re,2*te+1,2*xe+1)}function zo(Se,re,te){let xe=Se[re];Se[re]=Se[te],Se[te]=xe}function $r(Se,re,te,xe){let ve=Se-te,$e=re-xe;return ve*ve+$e*$e}wi.exports=hi,wi.exports.fromVectorTileJs=hi,wi.exports.fromGeojsonVt=function(Se,re){re=re||{};var te={};for(var xe in Se)te[xe]=new Si(Se[xe].features,re),te[xe].name=xe,te[xe].version=re.version,te[xe].extent=re.extent;return hi({layers:te})},wi.exports.GeoJSONWrapper=Si;let yo=Se=>Se[0],Dr=Se=>Se[1];class fa{constructor(re,te=yo,xe=Dr,ve=64,$e=Float64Array){this.nodeSize=ve,this.points=re;let Ke=re.length<65536?Uint16Array:Uint32Array,Te=this.ids=new Ke(re.length),ke=this.coords=new $e(2*re.length);for(let Ge=0;Ge<re.length;Ge++)Te[Ge]=Ge,ke[2*Ge]=te(re[Ge]),ke[2*Ge+1]=xe(re[Ge]);qr(Te,ke,ve,0,Te.length-1,0)}range(re,te,xe,ve){return(function($e,Ke,Te,ke,Ge,pt,zt){let dt=[0,$e.length-1,0],Lt=[],gi,ei;for(;dt.length;){let zi=dt.pop(),Ri=dt.pop(),rr=dt.pop();if(Ri-rr<=zt){for(let qi=rr;qi<=Ri;qi++)gi=Ke[2*qi],ei=Ke[2*qi+1],gi>=Te&&gi<=Ge&&ei>=ke&&ei<=pt&&Lt.push($e[qi]);continue}let Vi=Math.floor((rr+Ri)/2);gi=Ke[2*Vi],ei=Ke[2*Vi+1],gi>=Te&&gi<=Ge&&ei>=ke&&ei<=pt&&Lt.push($e[Vi]);let Hi=(zi+1)%2;
801(zi===0?Te<=gi:ke<=ei)&&(dt.push(rr),dt.push(Vi-1),dt.push(Hi)),(zi===0?Ge>=gi:pt>=ei)&&(dt.push(Vi+1),dt.push(Ri),dt.push(Hi))}return Lt})(this.ids,this.coords,re,te,xe,ve,this.nodeSize)}within(re,te,xe){return(function(ve,$e,Ke,Te,ke,Ge){let pt=[0,ve.length-1,0],zt=[],dt=ke*ke;for(;pt.length;){let Lt=pt.pop(),gi=pt.pop(),ei=pt.pop();if(gi-ei<=Ge){for(let Hi=ei;Hi<=gi;Hi++)$r($e[2*Hi],$e[2*Hi+1],Ke,Te)<=dt&&zt.push(ve[Hi]);continue}let zi=Math.floor((ei+gi)/2),Ri=$e[2*zi],rr=$e[2*zi+1];$r(Ri,rr,Ke,Te)<=dt&&zt.push(ve[zi]);let Vi=(Lt+1)%2;(Lt===0?Ke-ke<=Ri:Te-ke<=rr)&&(pt.push(ei),pt.push(zi-1),pt.push(Vi)),(Lt===0?Ke+ke>=Ri:Te+ke>=rr)&&(pt.push(zi+1),pt.push(gi),pt.push(Vi))}return zt})(this.ids,this.coords,re,te,xe,this.nodeSize)}}let Do={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:Se=>Se},Qn=Math.fround||(Ti=new Float32Array(1),Se=>(Ti[0]=+Se,Ti[0]));var Ti;class nn{constructor(re){this.options=xo(Object.create(Do),re),this.trees=new Array(this.options.maxZoom+1)}load(re){let{log:te,minZoom:xe,maxZoom:ve,nodeSize:$e}=this.options;te&&console.time("total time");let Ke=`prepare ${re.length} points`;te&&console.time(Ke),this.points=re;let Te=[];for(let ke=0;ke<re.length;ke++)re[ke].geometry&&Te.push(Hn(re[ke],ke));this.trees[ve+1]=new fa(Te,ss,_a,$e,Float32Array),te&&console.timeEnd(Ke);for(let ke=ve;ke>=xe;ke--){let Ge=+Date.now();Te=this._cluster(Te,ke),this.trees[ke]=new fa(Te,ss,_a,$e,Float32Array),te&&console.log("z%d: %d clusters in %dms",ke,Te.length,+Date.now()-Ge)}return te&&console.timeEnd("total time"),this}getClusters(re,te){let xe=((re[0]+180)%360+360)%360-180,ve=Math.max(-90,Math.min(90,re[1])),$e=re[2]===180?180:((re[2]+180)%360+360)%360-180,Ke=Math.max(-90,Math.min(90,re[3]));if(re[2]-re[0]>=360)xe=-180,$e=180;else if(xe>$e){let pt=this.getClusters([xe,ve,180,Ke],te),zt=this.getClusters([-180,ve,$e,Ke],te);return pt.concat(zt)}let Te=this.trees[this._limitZoom(te)],ke=Te.range(Qi(xe),ga(Ke),Qi($e),ga(ve)),Ge=[];for(let pt of ke){let zt=Te.points[pt];Ge.push(zt.numPoints?on(zt):this.points[zt.index])}return Ge}getChildren(re){let te=this._getOriginId(re),xe=this._getOriginZoom(re),ve="No cluster with the specified id.",$e=this.trees[xe];if(!$e)throw new Error(ve);let Ke=$e.points[te];if(!Ke)throw new Error(ve);let Te=this.options.radius/(this.options.extent*Math.pow(2,xe-1)),ke=$e.within(Ke.x,Ke.y,Te),Ge=[];for(let pt of ke){let zt=$e.points[pt];zt.parentId===re&&Ge.push(zt.numPoints?on(zt):this.points[zt.index])}if(Ge.length===0)throw new Error(ve);return Ge}getLeaves(re,te,xe){let ve=[];return this._appendLeaves(ve,re,te=te||10,xe=xe||0,0),ve}getTile(re,te,xe){let ve=this.trees[this._limitZoom(re)],$e=Math.pow(2,re),{extent:Ke,radius:Te}=this.options,ke=Te/Ke,Ge=(xe-ke)/$e,pt=(xe+1+ke)/$e,zt={features:[]};return this._addTileFeatures(ve.range((te-ke)/$e,Ge,(te+1+ke)/$e,pt),ve.points,te,xe,$e,zt),te===0&&this._addTileFeatures(ve.range(1-ke/$e,Ge,1,pt),ve.points,$e,xe,$e,zt),te===$e-1&&this._addTileFeatures(ve.range(0,Ge,ke/$e,pt),ve.points,-1,xe,$e,zt),zt.features.length?zt:null}getClusterExpansionZoom(re){let te=this._getOriginZoom(re)-1;for(;te<=this.options.maxZoom;){let xe=this.getChildren(re);if(te++,xe.length!==1)break;re=xe[0].properties.cluster_id}return te}_appendLeaves(re,te,xe,ve,$e){let Ke=this.getChildren(te);for(let Te of Ke){let ke=Te.properties;if(ke&&ke.cluster?$e+ke.point_count<=ve?$e+=ke.point_count:$e=this._appendLeaves(re,ke.cluster_id,xe,ve,$e):$e<ve?$e++:re.push(Te),re.length===xe)break}return $e}_addTileFeatures(re,te,xe,ve,$e,Ke){for(let Te of re){let ke=te[Te],Ge=ke.numPoints,pt,zt,dt;if(Ge)pt=Xn(ke),zt=ke.x,dt=ke.y;else{let ei=this.points[ke.index];pt=ei.properties,zt=Qi(ei.geometry.coordinates[0]),dt=ga(ei.geometry.coordinates[1])}let Lt={type:1,geometry:[[Math.round(this.options.extent*(zt*$e-xe)),Math.round(this.options.extent*(dt*$e-ve))]],tags:pt},gi;Ge?gi=ke.id:this.options.generateId?gi=ke.index:this.points[ke.index].id&&(gi=this.points[ke.index].id),gi!==void 0&&(Lt.id=gi),Ke.features.push(Lt)}}_limitZoom(re){return Math.max(this.options.minZoom,Math.min(Math.floor(+re),this.options.maxZoom+1))}_cluster(re,te){let xe=[],{radius:ve,extent:$e,reduce:Ke,minPoints:Te}=this.options,ke=ve/($e*Math.pow(2,te));for(let Ge=0;Ge<re.length;Ge++){let pt=re[Ge];if(pt.zoom<=te)continue;pt.zoom=te;let zt=this.trees[te+1],dt=zt.within(pt.x,pt.y,ke),Lt=pt.numPoints||1,gi=Lt;for(let ei of dt){let zi=zt.points[ei];zi.zoom>te&&(gi+=zi.numPoints||1)}if(gi>Lt&&gi>=Te){let ei=pt.x*Lt,zi=pt.y*Lt,Ri=Ke&&Lt>1?this._map(pt,!0):null,rr=(Ge<<5)+(te+1)+this.points.length;for(let Vi of dt){let Hi=zt.points[Vi];if(Hi.zoom<=te)continue;Hi.zoom=te;let qi=Hi.numPoints||1;ei+=Hi.x*qi,zi+=Hi.y*qi,Hi.parentId=rr,Ke&&(Ri||(Ri=this._map(pt,!0)),Ke(Ri,this._map(Hi)))}pt.parentId=rr,xe.push(Gr(ei/gi,zi/gi,rr,gi,Ri))}else if(xe.push(pt),gi>1)for(let ei of dt){let zi=zt.points[ei];zi.zoom<=te||(zi.zoom=te,xe.push(zi))}}return xe}_getOriginId(re){return re-this.points.length>>5}_getOriginZoom(re){return(re-this.points.length)%32}_map(re,te){if(re.numPoints)return te?xo({},re.properties):re.properties;let xe=this.points[re.index].properties,ve=this.options.map(xe);return te&&ve===xe?xo({},ve):ve}}function Gr(Se,re,te,xe,ve){return{x:Qn(Se),y:Qn(re),zoom:1/0,id:te,parentId:-1,numPoints:xe,properties:ve}}function Hn(Se,re){let[te,xe]=Se.geometry.coordinates;return{x:Qn(Qi(te)),y:Qn(ga(xe)),zoom:1/0,index:re,parentId:-1}}function on(Se){return{type:"Feature",id:Se.id,properties:Xn(Se),geometry:{type:"Point",coordinates:[(re=Se.x,360*(re-.5)),as(Se.y)]}};var re}function Xn(Se){let re=Se.numPoints,te=re>=1e4?`${Math.round(re/1e3)}k`:re>=1e3?Math.round(re/100)/10+"k":re;return xo(xo({},Se.properties),{cluster:!0,cluster_id:Se.id,point_count:re,point_count_abbreviated:te})}function Qi(Se){return Se/360+.5}function ga(Se){let re=Math.sin(Se*Math.PI/180),te=.5-.25*Math.log((1+re)/(1-re))/Math.PI;return te<0?0:te>1?1:te}function as(Se){let re=(180-360*Se)*Math.PI/180;return 360*Math.atan(Math.exp(re))/Math.PI-90}function xo(Se,re){for(let te in re)Se[te]=re[te];return Se}function ss(Se){return Se.x}function _a(Se){return Se.y}function oo(Se,re,te,xe){for(var ve,$e=xe,Ke=te-re>>1,Te=te-re,ke=Se[re],Ge=Se[re+1],pt=Se[te],zt=Se[te+1],dt=re+3;dt<te;dt+=3){var Lt=ya(Se[dt],Se[dt+1],ke,Ge,pt,zt);if(Lt>$e)ve=dt,$e=Lt;else if(Lt===$e){var gi=Math.abs(dt-Ke);gi<Te&&(ve=dt,Te=gi)}}$e>xe&&(ve-re>3&&oo(Se,re,ve,xe),Se[ve+2]=$e,te-ve>3&&oo(Se,ve,te,xe))}function ya(Se,re,te,xe,ve,$e){var Ke=ve-te,Te=$e-xe;if(Ke!==0||Te!==0){var ke=((Se-te)*Ke+(re-xe)*Te)/(Ke*Ke+Te*Te);ke>1?(te=ve,xe=$e):ke>0&&(te+=Ke*ke,xe+=Te*ke)}return(Ke=Se-te)*Ke+(Te=re-xe)*Te}function Na(Se,re,te,xe){var ve={id:Se===void 0?null:Se,type:re,geometry:te,tags:xe,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return(function($e){var Ke=$e.geometry,Te=$e.type;if(Te==="Point"||Te==="MultiPoint"||Te==="LineString")St($e,Ke);else if(Te==="Polygon"||Te==="MultiLineString")for(var ke=0;ke<Ke.length;ke++)St($e,Ke[ke]);else if(Te==="MultiPolygon")for(ke=0;ke<Ke.length;ke++)for(var Ge=0;Ge<Ke[ke].length;Ge++)St($e,Ke[ke][Ge])})(ve),ve}function St(Se,re){for(var te=0;te<re.length;te+=3)Se.minX=Math.min(Se.minX,re[te]),Se.minY=Math.min(Se.minY,re[te+1]),Se.maxX=Math.max(Se.maxX,re[te]),Se.maxY=Math.max(Se.maxY,re[te+1])}function Kt(Se,re,te,xe){if(re.geometry){var ve=re.geometry.coordinates,$e=re.geometry.type,Ke=Math.pow(te.tolerance/((1<<te.maxZoom)*te.extent),2),Te=[],ke=re.id;if(te.promoteId?ke=re.properties[te.promoteId]:te.generateId&&(ke=xe||0),$e==="Point")Ua(ve,Te);else if($e==="MultiPoint")for(var Ge=0;Ge<ve.length;Ge++)Ua(ve[Ge],Te);else if($e==="LineString")xa(ve,Te,Ke,!1);else if($e==="MultiLineString"){if(te.lineMetrics){for(Ge=0;Ge<ve.length;
vendor: 10,531 bytes, line 801
801Ge++)xa(ve[Ge],Te=[],Ke,!1),Se.push(Na(ke,"LineString",Te,re.properties));return}or(ve,Te,Ke,!1)}else if($e==="Polygon")or(ve,Te,Ke,!0);else{if($e!=="MultiPolygon"){if($e==="GeometryCollection"){for(Ge=0;Ge<re.geometry.geometries.length;Ge++)Kt(Se,{id:ke,geometry:re.geometry.geometries[Ge],properties:re.properties},te,xe);return}throw new Error("Input data is not a valid GeoJSON object.")}for(Ge=0;Ge<ve.length;Ge++){var pt=[];or(ve[Ge],pt,Ke,!0),Te.push(pt)}}Se.push(Na(ke,$e,Te,re.properties))}}function Ua(Se,re){re.push(Bn(Se[0])),re.push(xn(Se[1])),re.push(0)}function xa(Se,re,te,xe){for(var ve,$e,Ke=0,Te=0;Te<Se.length;Te++){var ke=Bn(Se[Te][0]),Ge=xn(Se[Te][1]);re.push(ke),re.push(Ge),re.push(0),Te>0&&(Ke+=xe?(ve*Ge-ke*$e)/2:Math.sqrt(Math.pow(ke-ve,2)+Math.pow(Ge-$e,2))),ve=ke,$e=Ge}var pt=re.length-3;re[2]=1,oo(re,0,pt,te),re[pt+2]=1,re.size=Math.abs(Ke),re.start=0,re.end=re.size}function or(Se,re,te,xe){for(var ve=0;ve<Se.length;ve++){var $e=[];xa(Se[ve],$e,te,xe),re.push($e)}}function Bn(Se){return Se/360+.5}function xn(Se){var re=Math.sin(Se*Math.PI/180),te=.5-.25*Math.log((1+re)/(1-re))/Math.PI;return te<0?0:te>1?1:te}function Zr(Se,re,te,xe,ve,$e,Ke,Te){if(xe/=re,$e>=(te/=re)&&Ke<xe)return Se;if(Ke<te||$e>=xe)return null;for(var ke=[],Ge=0;Ge<Se.length;Ge++){var pt=Se[Ge],zt=pt.geometry,dt=pt.type,Lt=ve===0?pt.minX:pt.minY,gi=ve===0?pt.maxX:pt.maxY;if(Lt>=te&&gi<xe)ke.push(pt);else if(!(gi<te||Lt>=xe)){var ei=[];if(dt==="Point"||dt==="MultiPoint")ta(zt,ei,te,xe,ve);else if(dt==="LineString")Ht(zt,ei,te,xe,ve,!1,Te.lineMetrics);else if(dt==="MultiLineString")Bi(zt,ei,te,xe,ve,!1);else if(dt==="Polygon")Bi(zt,ei,te,xe,ve,!0);else if(dt==="MultiPolygon")for(var zi=0;zi<zt.length;zi++){var Ri=[];Bi(zt[zi],Ri,te,xe,ve,!0),Ri.length&&ei.push(Ri)}if(ei.length){if(Te.lineMetrics&&dt==="LineString"){for(zi=0;zi<ei.length;zi++)ke.push(Na(pt.id,dt,ei[zi],pt.tags));continue}dt!=="LineString"&&dt!=="MultiLineString"||(ei.length===1?(dt="LineString",ei=ei[0]):dt="MultiLineString"),dt!=="Point"&&dt!=="MultiPoint"||(dt=ei.length===3?"Point":"MultiPoint"),ke.push(Na(pt.id,dt,ei,pt.tags))}}}return ke.length?ke:null}function ta(Se,re,te,xe,ve){for(var $e=0;$e<Se.length;$e+=3){var Ke=Se[$e+ve];Ke>=te&&Ke<=xe&&(re.push(Se[$e]),re.push(Se[$e+1]),re.push(Se[$e+2]))}}function Ht(Se,re,te,xe,ve,$e,Ke){for(var Te,ke,Ge=Wi(Se),pt=ve===0?Lo:ji,zt=Se.start,dt=0;dt<Se.length-3;dt+=3){var Lt=Se[dt],gi=Se[dt+1],ei=Se[dt+2],zi=Se[dt+3],Ri=Se[dt+4],rr=ve===0?Lt:gi,Vi=ve===0?zi:Ri,Hi=!1;Ke&&(Te=Math.sqrt(Math.pow(Lt-zi,2)+Math.pow(gi-Ri,2))),rr<te?Vi>te&&(ke=pt(Ge,Lt,gi,zi,Ri,te),Ke&&(Ge.start=zt+Te*ke)):rr>xe?Vi<xe&&(ke=pt(Ge,Lt,gi,zi,Ri,xe),Ke&&(Ge.start=zt+Te*ke)):an(Ge,Lt,gi,ei),Vi<te&&rr>=te&&(ke=pt(Ge,Lt,gi,zi,Ri,te),Hi=!0),Vi>xe&&rr<=xe&&(ke=pt(Ge,Lt,gi,zi,Ri,xe),Hi=!0),!$e&&Hi&&(Ke&&(Ge.end=zt+Te*ke),re.push(Ge),Ge=Wi(Se)),Ke&&(zt+=Te)}var qi=Se.length-3;Lt=Se[qi],gi=Se[qi+1],ei=Se[qi+2],(rr=ve===0?Lt:gi)>=te&&rr<=xe&&an(Ge,Lt,gi,ei),qi=Ge.length-3,$e&&qi>=3&&(Ge[qi]!==Ge[0]||Ge[qi+1]!==Ge[1])&&an(Ge,Ge[0],Ge[1],Ge[2]),Ge.length&&re.push(Ge)}function Wi(Se){var re=[];return re.size=Se.size,re.start=Se.start,re.end=Se.end,re}function Bi(Se,re,te,xe,ve,$e){for(var Ke=0;Ke<Se.length;Ke++)Ht(Se[Ke],re,te,xe,ve,$e,!1)}function an(Se,re,te,xe){Se.push(re),Se.push(te),Se.push(xe)}function Lo(Se,re,te,xe,ve,$e){var Ke=($e-re)/(xe-re);return Se.push($e),Se.push(te+(ve-te)*Ke),Se.push(1),Ke}function ji(Se,re,te,xe,ve,$e){var Ke=($e-te)/(ve-te);return Se.push(re+(xe-re)*Ke),Se.push($e),Se.push(1),Ke}function Ro(Se,re){for(var te=[],xe=0;xe<Se.length;xe++){var ve,$e=Se[xe],Ke=$e.type;if(Ke==="Point"||Ke==="MultiPoint"||Ke==="LineString")ve=vn($e.geometry,re);else if(Ke==="MultiLineString"||Ke==="Polygon"){ve=[];for(var Te=0;Te<$e.geometry.length;Te++)ve.push(vn($e.geometry[Te],re))}else if(Ke==="MultiPolygon")for(ve=[],Te=0;Te<$e.geometry.length;Te++){for(var ke=[],Ge=0;Ge<$e.geometry[Te].length;Ge++)ke.push(vn($e.geometry[Te][Ge],re));ve.push(ke)}te.push(Na($e.id,Ke,ve,$e.tags))}return te}function vn(Se,re){var te=[];te.size=Se.size,Se.start!==void 0&&(te.start=Se.start,te.end=Se.end);for(var xe=0;xe<Se.length;xe+=3)te.push(Se[xe]+re,Se[xe+1],Se[xe+2]);return te}function xt(Se,re){if(Se.transformed)return Se;var te,xe,ve,$e=1<<Se.z,Ke=Se.x,Te=Se.y;for(te=0;te<Se.features.length;te++){var ke=Se.features[te],Ge=ke.geometry,pt=ke.type;if(ke.geometry=[],pt===1)for(xe=0;xe<Ge.length;xe+=2)ke.geometry.push(sn(Ge[xe],Ge[xe+1],re,$e,Ke,Te));else for(xe=0;xe<Ge.length;xe++){var zt=[];for(ve=0;ve<Ge[xe].length;ve+=2)zt.push(sn(Ge[xe][ve],Ge[xe][ve+1],re,$e,Ke,Te));ke.geometry.push(zt)}}return Se.transformed=!0,Se}function sn(Se,re,te,xe,ve,$e){return[Math.round(te*(Se*xe-ve)),Math.round(te*(re*xe-$e))]}function eo(Se,re,te,xe,ve){for(var $e=re===ve.maxZoom?0:ve.tolerance/((1<<re)*ve.extent),Ke={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:te,y:xe,z:re,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},Te=0;Te<Se.length;Te++){Ke.numFeatures++,Ai(Ke,Se[Te],$e,ve);var ke=Se[Te].minX,Ge=Se[Te].minY,pt=Se[Te].maxX,zt=Se[Te].maxY;ke<Ke.minX&&(Ke.minX=ke),Ge<Ke.minY&&(Ke.minY=Ge),pt>Ke.maxX&&(Ke.maxX=pt),zt>Ke.maxY&&(Ke.maxY=zt)}return Ke}function Ai(Se,re,te,xe){var ve=re.geometry,$e=re.type,Ke=[];if($e==="Point"||$e==="MultiPoint")for(var Te=0;Te<ve.length;Te+=3)Ke.push(ve[Te]),Ke.push(ve[Te+1]),Se.numPoints++,Se.numSimplified++;else if($e==="LineString")On(Ke,ve,Se,te,!1,!1);else if($e==="MultiLineString"||$e==="Polygon")for(Te=0;Te<ve.length;Te++)On(Ke,ve[Te],Se,te,$e==="Polygon",Te===0);else if($e==="MultiPolygon")for(var ke=0;ke<ve.length;ke++){var Ge=ve[ke];for(Te=0;Te<Ge.length;Te++)On(Ke,Ge[Te],Se,te,!0,Te===0)}if(Ke.length){var pt=re.tags||null;if($e==="LineString"&&xe.lineMetrics){for(var zt in pt={},re.tags)pt[zt]=re.tags[zt];pt.mapbox_clip_start=ve.start/ve.size,pt.mapbox_clip_end=ve.end/ve.size}var dt={geometry:Ke,type:$e==="Polygon"||$e==="MultiPolygon"?3:$e==="LineString"||$e==="MultiLineString"?2:1,tags:pt};re.id!==null&&(dt.id=re.id),Se.features.push(dt)}}function On(Se,re,te,xe,ve,$e){var Ke=xe*xe;if(xe>0&&re.size<(ve?Ke:xe))te.numPoints+=re.length/3;else{for(var Te=[],ke=0;ke<re.length;ke+=3)(xe===0||re[ke+2]>Ke)&&(te.numSimplified++,Te.push(re[ke]),Te.push(re[ke+1])),te.numPoints++;ve&&(function(Ge,pt){for(var zt=0,dt=0,Lt=Ge.length,gi=Lt-2;dt<Lt;gi=dt,dt+=2)zt+=(Ge[dt]-Ge[gi])*(Ge[dt+1]+Ge[gi+1]);if(zt>0===pt)for(dt=0,Lt=Ge.length;dt<Lt/2;dt+=2){var ei=Ge[dt],zi=Ge[dt+1];Ge[dt]=Ge[Lt-2-dt],Ge[dt+1]=Ge[Lt-1-dt],Ge[Lt-2-dt]=ei,Ge[Lt-1-dt]=zi}})(Te,$e),Se.push(Te)}}function ao(Se,re){var te=(re=this.options=(function(ve,$e){for(var Ke in $e)ve[Ke]=$e[Ke];return ve})(Object.create(this.options),re)).debug;if(te&&console.time("preprocess data"),re.maxZoom<0||re.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(re.promoteId&&re.generateId)throw new Error("promoteId and generateId cannot be used together.");var xe=(function(ve,$e){var Ke=[];if(ve.type==="FeatureCollection")for(var Te=0;Te<ve.features.length;Te++)Kt(Ke,ve.features[Te],$e,Te);else Kt(Ke,ve.type==="Feature"?ve:{geometry:ve},$e);return Ke})(Se,re);this.tiles={},this.tileCoords=[],te&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",re.indexMaxZoom,re.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),xe=(function(ve,$e){var Ke=$e.buffer/$e.extent,Te=ve,ke=Zr(ve,1,-1-Ke,Ke,0,-1,2,$e),Ge=Zr(ve,1,1-Ke,2+Ke,0,-1,2,$e);return(ke||Ge)&&(Te=Zr(ve,1,-Ke,1+Ke,0,-1,2,$e)||[],ke&&(Te=Ro(ke,1).concat(Te)),Ge&&(Te=Te.concat(Ro(Ge,-1)))),Te})(xe,re),xe.length&&this.splitTile(xe,0,0,0),te&&(xe.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 Xs(Se,re,te){return 32*((1<<Se)*te+re)+Se}function Ks(Se,re){let te=Se.tileID.canonical;if(!this._geoJSONIndex)return re(null,null);let xe=this._geoJSONIndex.getTile(te.z,te.x,te.y);if(!xe)return re(null,null);let ve=new ki(xe.features),$e=wi.exports(ve);$e.byteOffset===0&&$e.byteLength===$e.buffer.byteLength||($e=new Uint8Array($e)),re(null,{vectorTile:ve,rawData:$e.buffer})}ao.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},ao.prototype.splitTile=function(Se,re,te,xe,ve,$e,Ke){for(var Te=[Se,re,te,xe],ke=this.options,Ge=ke.debug;Te.length;){xe=Te.pop(),te=Te.pop(),re=Te.pop(),Se=Te.pop();var pt=1<<re,zt=Xs(re,te,xe),dt=this.tiles[zt];if(!dt&&(Ge>1&&console.time("creation"),dt=this.tiles[zt]=eo(Se,re,te,xe,ke),this.tileCoords.push({z:re,x:te,y:xe}),Ge)){Ge>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",re,te,xe,dt.numFeatures,dt.numPoints,dt.numSimplified),console.timeEnd("creation"));var Lt="z"+re;this.stats[Lt]=(this.stats[Lt]||0)+1,this.total++}if(dt.source=Se,ve){if(re===ke.maxZoom||re===ve)continue;var gi=1<<ve-re;if(te!==Math.floor($e/gi)||xe!==Math.floor(Ke/gi))continue}else if(re===ke.indexMaxZoom||dt.numPoints<=ke.indexMaxPoints)continue;if(dt.source=null,Se.length!==0){Ge>1&&console.time("clipping");var ei,zi,Ri,rr,Vi,Hi,qi=.5*ke.buffer/ke.extent,Fi=.5-qi,bn=.5+qi,Sr=1+qi;ei=zi=Ri=rr=null,Vi=Zr(Se,pt,te-qi,te+bn,0,dt.minX,dt.maxX,ke),Hi=Zr(Se,pt,te+Fi,te+Sr,0,dt.minX,dt.maxX,ke),Se=null,Vi&&(ei=Zr(Vi,pt,xe-qi,xe+bn,1,dt.minY,dt.maxY,ke),zi=Zr(Vi,pt,xe+Fi,xe+Sr,1,dt.minY,dt.maxY,ke),Vi=null),Hi&&(Ri=Zr(Hi,pt,xe-qi,xe+bn,1,dt.minY,dt.maxY,ke),rr=Zr(Hi,pt,xe+Fi,xe+Sr,1,dt.minY,dt.maxY,ke),Hi=null),Ge>1&&console.timeEnd("clipping"),Te.push(ei||[],re+1,2*te,2*xe),Te.push(zi||[],re+1,2*te,2*xe+1),Te.push(Ri||[],re+1,2*te+1,2*xe),Te.push(rr||[],re+1,2*te+1,2*xe+1)}}},ao.prototype.getTile=function(Se,re,te){var xe=this.options,ve=xe.extent,$e=xe.debug;if(Se<0||Se>24)return null;var Ke=1<<Se,Te=Xs(Se,re=(re%Ke+Ke)%Ke,te);if(this.tiles[Te])return xt(this.tiles[Te],ve);$e>1&&console.log("drilling down to z%d-%d-%d",Se,re,te);for(var ke,Ge=Se,pt=re,zt=te;!ke&&Ge>0;)Ge--,pt=Math.floor(pt/2),zt=Math.floor(zt/2),ke=this.tiles[Xs(Ge,pt,zt)];return ke&&ke.source?($e>1&&console.log("found parent tile z%d-%d-%d",Ge,pt,zt),$e>1&&console.time("drilling down"),this.splitTile(ke.source,Ge,pt,zt,Se,re,te),$e>1&&console.timeEnd("drilling down"),this.tiles[Te]?xt(this.tiles[Te],ve):null):null};class Ql extends Mt{constructor(re,te,xe,ve){super(re,te,xe,Ks),ve&&(this.loadGeoJSON=ve)}loadData(re,te){var xe;
801(xe=this._pendingRequest)===null||xe===void 0||xe.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});let ve=!!(re&&re.request&&re.request.collectResourceTiming)&&new o.RequestPerformance(re.request);this._pendingCallback=te,this._pendingRequest=this.loadGeoJSON(re,(($e,Ke)=>{if(delete this._pendingCallback,delete this._pendingRequest,$e||!Ke)return te($e);if(typeof Ke!="object")return te(new Error(`Input data given to '${re.source}' is not a valid GeoJSON object.`));{At(Ke,!0);try{if(re.filter){let ke=o.createExpression(re.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ke.result==="error")throw new Error(ke.value.map((pt=>`${pt.key}: ${pt.message}`)).join(", "));Ke={type:"FeatureCollection",features:Ke.features.filter((pt=>ke.value.evaluate({zoom:0},pt)))}}this._geoJSONIndex=re.cluster?new nn((function({superclusterOptions:ke,clusterProperties:Ge}){if(!Ge||!ke)return ke;let pt={},zt={},dt={accumulated:null,zoom:0},Lt={properties:null},gi=Object.keys(Ge);for(let ei of gi){let[zi,Ri]=Ge[ei],rr=o.createExpression(Ri),Vi=o.createExpression(typeof zi=="string"?[zi,["accumulated"],["get",ei]]:zi);pt[ei]=rr.value,zt[ei]=Vi.value}return ke.map=ei=>{Lt.properties=ei;let zi={};for(let Ri of gi)zi[Ri]=pt[Ri].evaluate(dt,Lt);return zi},ke.reduce=(ei,zi)=>{Lt.properties=zi;for(let Ri of gi)dt.accumulated=ei[Ri],ei[Ri]=zt[Ri].evaluate(dt,Lt)},ke})(re)).load(Ke.features):(function(ke,Ge){return new ao(ke,Ge)})(Ke,re.geojsonVtOptions)}catch(ke){return te(ke)}this.loaded={};let Te={};if(ve){let ke=ve.finish();ke&&(Te.resourceTiming={},Te.resourceTiming[re.source]=JSON.parse(JSON.stringify(ke)))}te(null,Te)}}))}reloadTile(re,te){let xe=this.loaded;return xe&&xe[re.uid]?super.reloadTile(re,te):this.loadTile(re,te)}loadGeoJSON(re,te){if(re.request)return o.getJSON(re.request,te);if(typeof re.data=="string")try{te(null,JSON.parse(re.data))}catch{te(new Error(`Input data given to '${re.source}' is not a valid GeoJSON object.`))}else te(new Error(`Input data given to '${re.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}}removeSource(re,te){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),te()}getClusterExpansionZoom(re,te){try{te(null,this._geoJSONIndex.getClusterExpansionZoom(re.clusterId))}catch(xe){te(xe)}}getClusterChildren(re,te){try{te(null,this._geoJSONIndex.getChildren(re.clusterId))}catch(xe){te(xe)}}getClusterLeaves(re,te){try{te(null,this._geoJSONIndex.getLeaves(re.clusterId,re.limit,re.offset))}catch(xe){te(xe)}}}class ls{constructor(re){this.self=re,this.actor=new o.Actor(re,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:Mt,geojson:Ql},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(te,xe)=>{if(this.workerSourceTypes[te])throw new Error(`Worker source with name "${te}" already registered.`);this.workerSourceTypes[te]=xe},this.self.registerRTLTextPlugin=te=>{if(o.plugin.isParsed())throw new Error("RTL text plugin already registered.");o.plugin.applyArabicShaping=te.applyArabicShaping,o.plugin.processBidirectionalText=te.processBidirectionalText,o.plugin.processStyledBidirectionalText=te.processStyledBidirectionalText}}setReferrer(re,te){this.referrer=te}setImages(re,te,xe){this.availableImages[re]=te;for(let ve in this.workerSources[re]){let $e=this.workerSources[re][ve];for(let Ke in $e)$e[Ke].availableImages=te}xe()}setLayers(re,te,xe){this.getLayerIndex(re).replace(te),xe()}updateLayers(re,te,xe){this.getLayerIndex(re).update(te.layers,te.removedIds),xe()}loadTile(re,te,xe){this.getWorkerSource(re,te.type,te.source).loadTile(te,xe)}loadDEMTile(re,te,xe){this.getDEMWorkerSource(re,te.source).loadTile(te,xe)}reloadTile(re,te,xe){this.getWorkerSource(re,te.type,te.source).reloadTile(te,xe)}abortTile(re,te,xe){this.getWorkerSource(re,te.type,te.source).abortTile(te,xe)}removeTile(re,te,xe){this.getWorkerSource(re,te.type,te.source).removeTile(te,xe)}removeDEMTile(re,te){this.getDEMWorkerSource(re,te.source).removeTile(te)}removeSource(re,te,xe){if(!this.workerSources[re]||!this.workerSources[re][te.type]||!this.workerSources[re][te.type][te.source])return;let ve=this.workerSources[re][te.type][te.source];delete this.workerSources[re][te.type][te.source],ve.removeSource!==void 0?ve.removeSource(te,xe):xe()}loadWorkerSource(re,te,xe){try{this.self.importScripts(te.url),xe()}catch(ve){xe(ve.toString())}}syncRTLPluginState(re,te,xe){try{o.plugin.setState(te);let ve=o.plugin.getPluginURL();if(o.plugin.isLoaded()&&!o.plugin.isParsed()&&ve!=null){this.self.importScripts(ve);let $e=o.plugin.isParsed();xe($e?void 0:new Error(`RTL Text Plugin failed to import scripts from ${ve}`),$e)}}catch(ve){xe(ve.toString())}}getAvailableImages(re){let te=this.availableImages[re];return te||(te=[]),te}getLayerIndex(re){let te=this.layerIndexes[re];return te||(te=this.layerIndexes[re]=new Qe),te}getWorkerSource(re,te,xe){if(this.workerSources[re]||(this.workerSources[re]={}),this.workerSources[re][te]||(this.workerSources[re][te]={}),!this.workerSources[re][te][xe]){let ve={send:($e,Ke,Te)=>{this.actor.send($e,Ke,Te,re)}};this.workerSources[re][te][xe]=new this.workerSourceTypes[te](ve,this.getLayerIndex(re),this.getAvailableImages(re))}return this.workerSources[re][te][xe]}getDEMWorkerSource(re,te){return this.demWorkerSources[re]||(this.demWorkerSources[re]={}),this.demWorkerSources[re][te]||(this.demWorkerSources[re][te]=new fi),this.demWorkerSources[re][te]}enforceCacheSizeLimit(re,te){o.enforceCacheSizeLimit(te)}}return o.isWorker()&&(self.worker=new ls(self)),ls})),H(["./shared"],(function(o){"use strict";var pe=Ne;function Ne(T){return!(function(s){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 v,S,z=new Blob([""],{type:"text/javascript"}),j=URL.createObjectURL(z);try{S=new Worker(j),v=!0}catch{v=!1}return S&&S.terminate(),URL.revokeObjectURL(j),v})()?"Uint8ClampedArray"in window?ArrayBuffer.isView?(function(){var v=document.createElement("canvas");v.width=v.height=1;var S=v.getContext("2d");if(!S)return!1;var z=S.getImageData(0,0,1,1);return z&&z.width===v.width})()?(Qe[d=s&&s.failIfMajorPerformanceCaveat]===void 0&&(Qe[d]=(function(v){var S,z=(function(j){var W=document.createElement("canvas"),K=Object.create(Ne.webGLContextAttributes);return K.failIfMajorPerformanceCaveat=j,W.getContext("webgl",K)||W.getContext("experimental-webgl",K)})(v);if(!z)return!1;try{S=z.createShader(z.VERTEX_SHADER)}catch{return!1}return!(!S||z.isContextLost())&&(z.shaderSource(S,"void main() {}"),z.compileShader(S),z.getShaderParameter(S,z.COMPILE_STATUS)===!0)})(d)),Qe[d]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray supp
801ort":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var d})(T)}var Qe={};function ct(T,s){if(Array.isArray(T)){if(!Array.isArray(s)||T.length!==s.length)return!1;for(let d=0;d<T.length;d++)if(!ct(T[d],s[d]))return!1;return!0}if(typeof T=="object"&&T!==null&&s!==null){if(typeof s!="object"||Object.keys(T).length!==Object.keys(s).length)return!1;for(let d in T)if(!ct(T[d],s[d]))return!1;return!0}return T===s}Ne.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};class Ze{static testProp(s){if(!Ze.docStyle)return s[0];for(let d=0;d<s.length;d++)if(s[d]in Ze.docStyle)return s[d];return s[0]}static create(s,d,v){let S=window.document.createElement(s);return d!==void 0&&(S.className=d),v&&v.appendChild(S),S}static createNS(s,d){return window.document.createElementNS(s,d)}static disableDrag(){Ze.docStyle&&Ze.selectProp&&(Ze.userSelect=Ze.docStyle[Ze.selectProp],Ze.docStyle[Ze.selectProp]="none")}static enableDrag(){Ze.docStyle&&Ze.selectProp&&(Ze.docStyle[Ze.selectProp]=Ze.userSelect)}static setTransform(s,d){s.style[Ze.transformProp]=d}static addEventListener(s,d,v,S={}){s.addEventListener(d,v,"passive"in S?S:S.capture)}static removeEventListener(s,d,v,S={}){s.removeEventListener(d,v,"passive"in S?S:S.capture)}static suppressClickInternal(s){s.preventDefault(),s.stopPropagation(),window.removeEventListener("click",Ze.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",Ze.suppressClickInternal,!0),window.setTimeout((()=>{window.removeEventListener("click",Ze.suppressClickInternal,!0)}),0)}static mousePos(s,d){let v=s.getBoundingClientRect();return new o.pointGeometry(d.clientX-v.left-s.clientLeft,d.clientY-v.top-s.clientTop)}static touchPos(s,d){let v=s.getBoundingClientRect(),S=[];for(let z=0;z<d.length;z++)S.push(new o.pointGeometry(d[z].clientX-v.left-s.clientLeft,d[z].clientY-v.top-s.clientTop));return S}static mouseButton(s){return s.button}static remove(s){s.parentNode&&s.parentNode.removeChild(s)}}Ze.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,Ze.selectProp=Ze.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),Ze.transformProp=Ze.testProp(["transform","WebkitTransform"]);class Bt{constructor(s){this._transformRequestFn=s}transformRequest(s,d){return this._transformRequestFn&&this._transformRequestFn(s,d)||{url:s}}normalizeSpriteURL(s,d,v){let S=(function(z){let j=z.match(Ct);if(!j)throw new Error(`Unable to parse URL "${z}"`);return{protocol:j[1],authority:j[2],path:j[3]||"/",params:j[4]?j[4].split("&"):[]}})(s);return S.path+=`${d}${v}`,(function(z){let j=z.params.length?`?${z.params.join("&")}`:"";return`${z.protocol}://${z.authority}${z.path}${j}`})(S)}setTransformRequest(s){this._transformRequestFn=s}}let Ct=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;class Mt{constructor(s,d,v,S){this.context=s,this.format=v,this.texture=s.gl.createTexture(),this.update(d,S)}update(s,d,v){let{width:S,height:z}=s,j=!(this.size&&this.size[0]===S&&this.size[1]===z||v),{context:W}=this,{gl:K}=W;if(this.useMipmap=!!(d&&d.useMipmap),K.bindTexture(K.TEXTURE_2D,this.texture),W.pixelStoreUnpackFlipY.set(!1),W.pixelStoreUnpack.set(1),W.pixelStoreUnpackPremultiplyAlpha.set(this.format===K.RGBA&&(!d||d.premultiply!==!1)),j)this.size=[S,z],s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement||s instanceof ImageData||o.isImageBitmap(s)?K.texImage2D(K.TEXTURE_2D,0,this.format,this.format,K.UNSIGNED_BYTE,s):K.texImage2D(K.TEXTURE_2D,0,this.format,S,z,0,this.format,K.UNSIGNED_BYTE,s.data);else{let{x:Q,y:le}=v||{x:0,y:0};s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement||s instanceof ImageData||o.isImageBitmap(s)?K.texSubImage2D(K.TEXTURE_2D,0,Q,le,K.RGBA,K.UNSIGNED_BYTE,s):K.texSubImage2D(K.TEXTURE_2D,0,Q,le,S,z,K.RGBA,K.UNSIGNED_BYTE,s.data)}this.useMipmap&&this.isSizePowerOfTwo()&&K.generateMipmap(K.TEXTURE_2D)}bind(s,d,v){let{context:S}=this,{gl:z}=S;z.bindTexture(z.TEXTURE_2D,this.texture),v!==z.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(v=z.LINEAR),s!==this.filter&&(z.texParameteri(z.TEXTURE_2D,z.TEXTURE_MAG_FILTER,s),z.texParameteri(z.TEXTURE_2D,z.TEXTURE_MIN_FILTER,v||s),this.filter=s),d!==this.wrap&&(z.texParameteri(z.TEXTURE_2D,z.TEXTURE_WRAP_S,d),z.texParameteri(z.TEXTURE_2D,z.TEXTURE_WRAP_T,d),this.wrap=d)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:s}=this.context;s.deleteTexture(this.texture),this.texture=null}}function fi(T){let{userImage:s}=T;return!!(s&&s.render&&s.render())&&(T.data.replace(new Uint8Array(s.data.buffer)),!0)}class At extends o.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new o.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(s){if(this.loaded!==s&&(this.loaded=s,s)){for(let{ids:d,callback:v}of this.requestors)this._notify(d,v);this.requestors=[]}}getImage(s){return this.images[s]}addImage(s,d){if(this.images[s])throw new Error(`Image id ${s} already exist, use updateImage instead`);
801this._validate(s,d)&&(this.images[s]=d)}_validate(s,d){let v=!0;return this._validateStretch(d.stretchX,d.data&&d.data.width)||(this.fire(new o.ErrorEvent(new Error(`Image "${s}" has invalid "stretchX" value`))),v=!1),this._validateStretch(d.stretchY,d.data&&d.data.height)||(this.fire(new o.ErrorEvent(new Error(`Image "${s}" has invalid "stretchY" value`))),v=!1),this._validateContent(d.content,d)||(this.fire(new o.ErrorEvent(new Error(`Image "${s}" has invalid "content" value`))),v=!1),v}_validateStretch(s,d){if(!s)return!0;let v=0;for(let S of s){if(S[0]<v||S[1]<S[0]||d<S[1])return!1;v=S[1]}return!0}_validateContent(s,d){return!(s&&(s.length!==4||s[0]<0||d.data.width<s[0]||s[1]<0||d.data.height<s[1]||s[2]<0||d.data.width<s[2]||s[3]<0||d.data.height<s[3]||s[2]<s[0]||s[3]<s[1]))}updateImage(s,d){let v=this.images[s];if(v.data.width!==d.data.width||v.data.height!==d.data.height)throw new Error(`size mismatch between old image (${v.data.width}x${v.data.height}) and new image (${d.data.width}x${d.data.height}).`);d.version=v.version+1,this.images[s]=d,this.updatedImages[s]=!0}removeImage(s){let d=this.images[s];delete this.images[s],delete this.patterns[s],d.userImage&&d.userImage.onRemove&&d.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(s,d){let v=!0;if(!this.isLoaded())for(let S of s)this.images[S]||(v=!1);this.isLoaded()||v?this._notify(s,d):this.requestors.push({ids:s,callback:d})}_notify(s,d){let v={};for(let S of s){this.images[S]||this.fire(new o.Event("styleimagemissing",{id:S}));let z=this.images[S];z?v[S]={data:z.data.clone(),pixelRatio:z.pixelRatio,sdf:z.sdf,version:z.version,stretchX:z.stretchX,stretchY:z.stretchY,content:z.content,hasRenderCallback:!!(z.userImage&&z.userImage.render)}:o.warnOnce(`Image "${S}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}d(null,v)}getPixelSize(){let{width:s,height:d}=this.atlasImage;return{width:s,height:d}}getPattern(s){let d=this.patterns[s],v=this.getImage(s);if(!v)return null;if(d&&d.position.version===v.version)return d.position;if(d)d.position.version=v.version;else{let S={w:v.data.width+2,h:v.data.height+2,x:0,y:0},z=new o.ImagePosition(S,v);this.patterns[s]={bin:S,position:z}}return this._updatePatternAtlas(),this.patterns[s].position}bind(s){let d=s.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new Mt(s,this.atlasImage,d.RGBA),this.atlasTexture.bind(d.LINEAR,d.CLAMP_TO_EDGE)}_updatePatternAtlas(){let s=[];for(let z in this.patterns)s.push(this.patterns[z].bin);let{w:d,h:v}=o.potpack(s),S=this.atlasImage;S.resize({width:d||1,height:v||1});for(let z in this.patterns){let{bin:j}=this.patterns[z],W=j.x+1,K=j.y+1,Q=this.images[z].data,le=Q.width,he=Q.height;o.RGBAImage.copy(Q,S,{x:0,y:0},{x:W,y:K},{width:le,height:he}),o.RGBAImage.copy(Q,S,{x:0,y:he-1},{x:W,y:K-1},{width:le,height:1}),o.RGBAImage.copy(Q,S,{x:0,y:0},{x:W,y:K+he},{width:le,height:1}),o.RGBAImage.copy(Q,S,{x:le-1,y:0},{x:W-1,y:K},{width:1,height:he}),o.RGBAImage.copy(Q,S,{x:0,y:0},{x:W+le,y:K},{width:1,height:he})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(s){for(let d of s){if(this.callbackDispatchedThisFrame[d])continue;this.callbackDispatchedThisFrame[d]=!0;let v=this.images[d];v||o.warnOnce(`Image with ID: "${d}" was not found`),fi(v)&&this.updateImage(d,v)}}}let He=1e20;function Ut(T,s,d,v,S,z,j,W,K){for(let Q=s;Q<s+v;Q++)Mi(T,d*z+Q,z,S,j,W,K);for(let Q=d;Q<d+S;Q++)Mi(T,Q*z+s,1,v,j,W,K)}function Mi(T,s,d,v,S,z,j){z[0]=0,j[0]=-He,j[1]=He,S[0]=T[s];for(let W=1,K=0,Q=0;W<v;W++){S[W]=T[s+W*d];let le=W*W;do{let he=z[K];Q=(S[W]-S[he]+le-he*he)/(W-he)/2}while(Q<=j[K]&&--K>-1);K++,z[K]=W,j[K]=Q,j[K+1]=He}for(let W=0,K=0;W<v;W++){for(;j[K+1]<W;)K++;let Q=z[K],le=W-Q;T[s+W*d]=S[Q]+le*le}}class li{constructor(s,d){this.requestManager=s,this.localIdeographFontFamily=d,this.entries={}}setURL(s){this.url=s}getGlyphs(s,d){let v=[];for(let S in s)for(let z of s[S])v.push({stack:S,id:z});o.asyncAll(v,(({stack:S,id:z},j)=>{let W=this.entries[S];W||(W=this.entries[S]={glyphs:{},requests:{},ranges:{}});let K=W.glyphs[z];if(K!==void 0)return void j(null,{stack:S,id:z,glyph:K});if(K=this._tinySDF(W,S,z),K)return W.glyphs[z]=K,void j(null,{stack:S,id:z,glyph:K});let Q=Math.floor(z/256);if(256*Q>65535)return void j(new Error("glyphs > 65535 not supported"));if(W.ranges[Q])return void j(null,{stack:S,id:z,glyph:K});let le=W.requests[Q];le||(le=W.requests[Q]=[],li.loadGlyphRange(S,Q,this.url,this.requestManager,((he,fe)=>{if(fe){for(let Re in fe)this._doesCharSupportLocalGlyph(+Re)||(W.glyphs[+Re]=fe[+Re]);W.ranges[Q]=!0}for(let Re of le)Re(he,fe);delete W.requests[Q]}))),le.push(((he,fe)=>{he?j(he):fe&&j(null,{stack:S,id:z,glyph:fe[z]||null})}))}),((S,z)=>{if(S)d(S);else if(z){let j={};for(let{stack:W,id:K,glyph:Q}of z)(j[W]||(j[W]={}))[K]=Q&&{id:Q.id,bitmap:Q.bitmap.clone(),metrics:Q.metrics};d(null,j)}}))}_doesCharSupportLocalGlyph(s){return!!this.localIdeographFontFamily&&
801(o.unicodeBlockLookup["CJK Unified Ideographs"](s)||o.unicodeBlockLookup["Hangul Syllables"](s)||o.unicodeBlockLookup.Hiragana(s)||o.unicodeBlockLookup.Katakana(s))}_tinySDF(s,d,v){let S=this.localIdeographFontFamily;if(!S||!this._doesCharSupportLocalGlyph(v))return;let z=s.tinySDF;if(!z){let W="400";/bold/i.test(d)?W="900":/medium/i.test(d)?W="500":/light/i.test(d)&&(W="200"),z=s.tinySDF=new li.TinySDF({fontSize:24,buffer:3,radius:8,cutoff:.25,fontFamily:S,fontWeight:W})}let j=z.draw(String.fromCharCode(v));return{id:v,bitmap:new o.AlphaImage({width:j.width||30,height:j.height||30},j.data),metrics:{width:j.glyphWidth||24,height:j.glyphHeight||24,left:j.glyphLeft||0,top:j.glyphTop-27||-8,advance:j.glyphAdvance||24}}}}li.loadGlyphRange=function(T,s,d,v,S){let z=256*s,j=z+255,W=v.transformRequest(d.replace("{fontstack}",T).replace("{range}",`${z}-${j}`),o.ResourceType.Glyphs);o.getArrayBuffer(W,((K,Q)=>{if(K)S(K);else if(Q){let le={};for(let he of o.parseGlyphPbf(Q))le[he.id]=he;S(null,le)}}))},li.TinySDF=class{constructor({fontSize:T=24,buffer:s=3,radius:d=8,cutoff:v=.25,fontFamily:S="sans-serif",fontWeight:z="normal",fontStyle:j="normal"}={}){this.buffer=s,this.cutoff=v,this.radius=d;let W=this.size=T+4*s,K=this._createCanvas(W),Q=this.ctx=K.getContext("2d",{willReadFrequently:!0});Q.font=`${j} ${z} ${T}px ${S}`,Q.textBaseline="alphabetic",Q.textAlign="left",Q.fillStyle="black",this.gridOuter=new Float64Array(W*W),this.gridInner=new Float64Array(W*W),this.f=new Float64Array(W),this.z=new Float64Array(W+1),this.v=new Uint16Array(W)}_createCanvas(T){let s=document.createElement("canvas");return s.width=s.height=T,s}draw(T){let{width:s,actualBoundingBoxAscent:d,actualBoundingBoxDescent:v,actualBoundingBoxLeft:S,actualBoundingBoxRight:z}=this.ctx.measureText(T),j=Math.ceil(d),W=Math.min(this.size-this.buffer,Math.ceil(z-S)),K=Math.min(this.size-this.buffer,j+Math.ceil(v)),Q=W+2*this.buffer,le=K+2*this.buffer,he=Math.max(Q*le,0),fe=new Uint8ClampedArray(he),Re={data:fe,width:Q,height:le,glyphWidth:W,glyphHeight:K,glyphTop:j,glyphLeft:0,glyphAdvance:s};if(W===0||K===0)return Re;let{ctx:Me,buffer:Ae,gridInner:Xe,gridOuter:et}=this;Me.clearRect(Ae,Ae,W,K),Me.fillText(T,Ae,Ae+j);let rt=Me.getImageData(Ae,Ae,W,K);et.fill(He,0,he),Xe.fill(0,0,he);for(let Be=0;Be<K;Be++)for(let ht=0;ht<W;ht++){let ot=rt.data[4*(Be*W+ht)+3]/255;if(ot===0)continue;let wt=(Be+Ae)*Q+ht+Ae;if(ot===1)et[wt]=0,Xe[wt]=He;else{let Tt=.5-ot;et[wt]=Tt>0?Tt*Tt:0,Xe[wt]=Tt<0?Tt*Tt:0}}Ut(et,0,0,Q,le,Q,this.f,this.v,this.z),Ut(Xe,Ae,Ae,W,K,Q,this.f,this.v,this.z);for(let Be=0;Be<he;Be++){let ht=Math.sqrt(et[Be])-Math.sqrt(Xe[Be]);fe[Be]=Math.round(255-255*(ht/this.radius+this.cutoff))}return Re}};let ki=new o.Properties({anchor:new o.DataConstantProperty(o.spec.light.anchor),position:new class{constructor(){this.specification=o.spec.light.position}possiblyEvaluate(T,s){return o.sphericalToCartesian(T.expression.evaluate(s))}interpolate(T,s,d){return{x:o.number(T.x,s.x,d),y:o.number(T.y,s.y,d),z:o.number(T.z,s.z,d)}}},color:new o.DataConstantProperty(o.spec.light.color),intensity:new o.DataConstantProperty(o.spec.light.intensity)}),wi="-transition";class ci extends o.Evented{constructor(s){super(),this._transitionable=new o.Transitionable(ki),this.setLight(s),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(s,d={}){if(!this._validate(o.validateLight,s,d))for(let v in s){let S=s[v];v.endsWith(wi)?this._transitionable.setTransition(v.slice(0,-wi.length),S):this._transitionable.setValue(v,S)}}updateTransitions(s){this._transitioning=this._transitionable.transitioned(s,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(s){this.properties=this._transitioning.possiblyEvaluate(s)}_validate(s,d,v){return(!v||v.validate!==!1)&&o.emitValidationErrors(this,s.call(o.validateStyle,o.extend({value:d,style:{glyphs:!0,sprite:!0},styleSpec:o.spec})))}}class Pe{constructor(s,d){this.width=s,this.height=d,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(s,d){let v=s.join(",")+String(d);return this.dashEntry[v]||(this.dashEntry[v]=this.addDash(s,d)),this.dashEntry[v]}getDashRanges(s,d,v){let S=[],z=s.length%2==1?-s[s.length-1]*v:0,j=s[0]*v,W=!0;S.push({left:z,right:j,isDash:W,zeroLength:s[0]===0});let K=s[0];for(let Q=1;Q<s.length;Q++){W=!W;
801let le=s[Q];z=K*v,K+=le,j=K*v,S.push({left:z,right:j,isDash:W,zeroLength:le===0})}return S}addRoundDash(s,d,v){let S=d/2;for(let z=-v;z<=v;z++){let j=this.width*(this.nextRow+v+z),W=0,K=s[W];for(let Q=0;Q<this.width;Q++){Q/K.right>1&&(K=s[++W]);let le=Math.abs(Q-K.left),he=Math.abs(Q-K.right),fe=Math.min(le,he),Re,Me=z/v*(S+1);if(K.isDash){let Ae=S-Math.abs(Me);Re=Math.sqrt(fe*fe+Ae*Ae)}else Re=S-Math.sqrt(fe*fe+Me*Me);this.data[j+Q]=Math.max(0,Math.min(255,Re+128))}}}addRegularDash(s){for(let W=s.length-1;W>=0;--W){let K=s[W],Q=s[W+1];K.zeroLength?s.splice(W,1):Q&&Q.isDash===K.isDash&&(Q.left=K.left,s.splice(W,1))}let d=s[0],v=s[s.length-1];d.isDash===v.isDash&&(d.left=v.left-this.width,v.right=d.right+this.width);let S=this.width*this.nextRow,z=0,j=s[z];for(let W=0;W<this.width;W++){W/j.right>1&&(j=s[++z]);let K=Math.abs(W-j.left),Q=Math.abs(W-j.right),le=Math.min(K,Q);this.data[S+W]=Math.max(0,Math.min(255,(j.isDash?le:-le)+128))}}addDash(s,d){let v=d?7:0,S=2*v+1;if(this.nextRow+S>this.height)return o.warnOnce("LineAtlas out of space"),null;let z=0;for(let W=0;W<s.length;W++)z+=s[W];if(z!==0){let W=this.width/z,K=this.getDashRanges(s,this.width,W);d?this.addRoundDash(K,W,v):this.addRegularDash(K)}let j={y:(this.nextRow+v+.5)/this.height,height:2*v/this.height,width:z};return this.nextRow+=S,this.dirty=!0,j}bind(s){let d=s.gl;this.texture?(d.bindTexture(d.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,d.texSubImage2D(d.TEXTURE_2D,0,0,0,this.width,this.height,d.ALPHA,d.UNSIGNED_BYTE,this.data))):(this.texture=d.createTexture(),d.bindTexture(d.TEXTURE_2D,this.texture),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.REPEAT),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.REPEAT),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.LINEAR),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.LINEAR),d.texImage2D(d.TEXTURE_2D,0,d.ALPHA,this.width,this.height,0,d.ALPHA,d.UNSIGNED_BYTE,this.data))}}class Ve{constructor(s,d){this.workerPool=s,this.actors=[],this.currentActor=0,this.id=o.uniqueId();let v=this.workerPool.acquire(this.id);for(let S=0;S<v.length;S++){let z=new Ve.Actor(v[S],d,this.id);z.name=`Worker ${S}`,this.actors.push(z)}if(!this.actors.length)throw new Error("No actors found")}broadcast(s,d,v){o.asyncAll(this.actors,((S,z)=>{S.send(s,d,z)}),v=v||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach((s=>{s.remove()})),this.actors=[],this.workerPool.release(this.id)}}function Ye(T,s,d){let v=function(S,z){if(S)return d(S);if(z){let j=o.pick(o.extend(z,T),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);z.vector_layers&&(j.vectorLayers=z.vector_layers,j.vectorLayerIds=j.vectorLayers.map((W=>W.id))),d(null,j)}};return T.url?o.getJSON(s.transformRequest(T.url,o.ResourceType.Source),v):o.exported.frame((()=>v(null,T)))}Ve.Actor=o.Actor;class It{constructor(s,d,v){this.bounds=o.LngLatBounds.convert(this.validateBounds(s)),this.minzoom=d||0,this.maxzoom=v||24}validateBounds(s){return Array.isArray(s)&&s.length===4?[Math.max(-180,s[0]),Math.max(-90,s[1]),Math.min(180,s[2]),Math.min(90,s[3])]:[-180,-90,180,90]}contains(s){let d=Math.pow(2,s.z),v=Math.floor(o.mercatorXfromLng(this.bounds.getWest())*d),S=Math.floor(o.mercatorYfromLat(this.bounds.getNorth())*d),z=Math.ceil(o.mercatorXfromLng(this.bounds.getEast())*d),j=Math.ceil(o.mercatorYfromLat(this.bounds.getSouth())*d);return s.x>=v&&s.x<z&&s.y>=S&&s.y<j}}class jt extends o.Evented{constructor(s,d,v,S){if(super(),this.id=s,this.dispatcher=v,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,o.extend(this,o.pick(d,["url","scheme","tileSize","promoteId"])),this._options=o.extend({type:"vector"},d),this._collectResourceTiming=d.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(S)}load(){this._loaded=!1,this.fire(new o.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Ye(this._options,this.map._requestManager,((s,d)=>{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),s?this.fire(new o.ErrorEvent(s)):d&&(o.extend(this,d),d.bounds&&(this.tileBounds=new It(d.bounds,this.minzoom,this.maxzoom)),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"content"})))}))}loaded(){return this._loaded}hasTile(s){return!this.tileBounds||this.tileBounds.contains(s.canonical)}onAdd(s){this.map=s,this.load()}setSourceProperty(s){this._tileJSONRequest&&this._tileJSONRequest.cancel(),s(),this.load()}setTiles(s){return this.setSourceProperty((()=>{this._options.tiles=s})),this}setUrl(s){return this.setSourceProperty((()=>{this.url=s,this._options.url=s})),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return o.extend({},this._options)}loadTile(s,d){let v=s.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),S={request:this.map._requestManager.transformRequest(v,o.ResourceType.Tile),uid:s.uid,tileID:s.tileID,zoom:s.tileID.overscaledZ,tileSize:this.tileSize*s.tileID.overscaleFactor(),type:this.t
801ype,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function z(j,W){return delete s.request,s.aborted?d(null):j&&j.status!==404?d(j):(W&&W.resourceTiming&&(s.resourceTiming=W.resourceTiming),this.map._refreshExpiredTiles&&W&&s.setExpiryData(W),s.loadVectorData(W,this.map.painter),o.cacheEntryPossiblyAdded(this.dispatcher),d(null),void(s.reloadCallback&&(this.loadTile(s,s.reloadCallback),s.reloadCallback=null)))}S.request.collectResourceTiming=this._collectResourceTiming,s.actor&&s.state!=="expired"?s.state==="loading"?s.reloadCallback=d:s.request=s.actor.send("reloadTile",S,z.bind(this)):(s.actor=this.dispatcher.getActor(),s.request=s.actor.send("loadTile",S,z.bind(this)))}abortTile(s){s.request&&(s.request.cancel(),delete s.request),s.actor&&s.actor.send("abortTile",{uid:s.uid,type:this.type,source:this.id},void 0)}unloadTile(s){s.unloadVectorData(),s.actor&&s.actor.send("removeTile",{uid:s.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class Si extends o.Evented{constructor(s,d,v,S){super(),this.id=s,this.dispatcher=v,this.setEventedParent(S),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=o.extend({type:"raster"},d),o.extend(this,o.pick(d,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new o.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Ye(this._options,this.map._requestManager,((s,d)=>{this._tileJSONRequest=null,this._loaded=!0,s?this.fire(new o.ErrorEvent(s)):d&&(o.extend(this,d),d.bounds&&(this.tileBounds=new It(d.bounds,this.minzoom,this.maxzoom)),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"content"})))}))}loaded(){return this._loaded}onAdd(s){this.map=s,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return o.extend({},this._options)}hasTile(s){return!this.tileBounds||this.tileBounds.contains(s.canonical)}loadTile(s,d){let v=s.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);s.request=o.getImage(this.map._requestManager.transformRequest(v,o.ResourceType.Tile),((S,z,j)=>{if(delete s.request,s.aborted)s.state="unloaded",d(null);else if(S)s.state="errored",d(S);else if(z){this.map._refreshExpiredTiles&&s.setExpiryData(j);let W=this.map.painter.context,K=W.gl;s.texture=this.map.painter.getTileTexture(z.width),s.texture?s.texture.update(z,{useMipmap:!0}):(s.texture=new Mt(W,z,K.RGBA,{useMipmap:!0}),s.texture.bind(K.LINEAR,K.CLAMP_TO_EDGE,K.LINEAR_MIPMAP_NEAREST),W.extTextureFilterAnisotropic&&K.texParameterf(K.TEXTURE_2D,W.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,W.extTextureFilterAnisotropicMax)),s.state="loaded",o.cacheEntryPossiblyAdded(this.dispatcher),d(null)}}))}abortTile(s,d){s.request&&(s.request.cancel(),delete s.request),d()}unloadTile(s,d){s.texture&&this.map.painter.saveTileTexture(s.texture),d()}hasTransition(){return!1}}let hi;class Nt extends Si{constructor(s,d,v,S){super(s,d,v,S),this.type="raster-dem",this.maxzoom=22,this._options=o.extend({type:"raster-dem"},d),this.encoding=d.encoding||"mapbox"}serialize(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}}loadTile(s,d){let v=s.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);function S(z,j){z&&(s.state="errored",d(z)),j&&(s.dem=j,s.needsHillshadePrepare=!0,s.needsTerrainPrepare=!0,s.state="loaded",d(null))}s.request=o.getImage(this.map._requestManager.transformRequest(v,o.ResourceType.Tile),function(z,j){if(delete s.request,s.aborted)s.state="unloaded",d(null);else if(z)s.state="errored",d(z);else if(j){this.map._refreshExpiredTiles&&s.setExpiryData(j),delete j.cacheControl,delete j.expires;let W=o.isImageBitmap(j)&&(hi==null&&(hi=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),hi)?j:o.exported.getImageData(j,1),K={uid:s.uid,coord:s.tileID,source:this.id,rawImageData:W,encoding:this.encoding};s.actor&&s.state!=="expired"||(s.actor=this.dispatcher.getActor(),s.actor.send("loadDEMTile",K,S.bind(this)))}}.bind(this)),s.neighboringTiles=this._getNeighboringTiles(s.tileID)}_getNeighboringTiles(s){let d=s.canonical,v=Math.pow(2,d.z),S=(d.x-1+v)%v,z=
801d.x===0?s.wrap-1:s.wrap,j=(d.x+1+v)%v,W=d.x+1===v?s.wrap+1:s.wrap,K={};return K[new o.OverscaledTileID(s.overscaledZ,z,d.z,S,d.y).key]={backfilled:!1},K[new o.OverscaledTileID(s.overscaledZ,W,d.z,j,d.y).key]={backfilled:!1},d.y>0&&(K[new o.OverscaledTileID(s.overscaledZ,z,d.z,S,d.y-1).key]={backfilled:!1},K[new o.OverscaledTileID(s.overscaledZ,s.wrap,d.z,d.x,d.y-1).key]={backfilled:!1},K[new o.OverscaledTileID(s.overscaledZ,W,d.z,j,d.y-1).key]={backfilled:!1}),d.y+1<v&&(K[new o.OverscaledTileID(s.overscaledZ,z,d.z,S,d.y+1).key]={backfilled:!1},K[new o.OverscaledTileID(s.overscaledZ,s.wrap,d.z,d.x,d.y+1).key]={backfilled:!1},K[new o.OverscaledTileID(s.overscaledZ,W,d.z,j,d.y+1).key]={backfilled:!1}),K}unloadTile(s){s.demTexture&&this.map.painter.saveTileTexture(s.demTexture),s.fbo&&(s.fbo.destroy(),delete s.fbo),s.dem&&delete s.dem,delete s.neighboringTiles,s.state="unloaded",s.actor&&s.actor.send("removeDEMTile",{uid:s.uid,source:this.id})}}class vi extends o.Evented{constructor(s,d,v,S){super(),this.id=s,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=v.getActor(),this.setEventedParent(S),this._data=d.data,this._options=o.extend({},d),this._collectResourceTiming=d.collectResourceTiming,d.maxzoom!==void 0&&(this.maxzoom=d.maxzoom),d.type&&(this.type=d.type),d.attribution&&(this.attribution=d.attribution),this.promoteId=d.promoteId;let z=o.EXTENT/this.tileSize;this.workerOptions=o.extend({source:this.id,cluster:d.cluster||!1,geojsonVtOptions:{buffer:(d.buffer!==void 0?d.buffer:128)*z,tolerance:(d.tolerance!==void 0?d.tolerance:.375)*z,extent:o.EXTENT,maxZoom:this.maxzoom,lineMetrics:d.lineMetrics||!1,generateId:d.generateId||!1},superclusterOptions:{maxZoom:d.clusterMaxZoom!==void 0?d.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,d.clusterMinPoints||2),extent:o.EXTENT,radius:(d.clusterRadius||50)*z,log:!1,generateId:d.generateId||!1},clusterProperties:d.clusterProperties,filter:d.filter},d.workerOptions)}load(){this._updateWorkerData("metadata")}onAdd(s){this.map=s,this.load()}setData(s){return this._data=s,this._updateWorkerData("content"),this}getClusterExpansionZoom(s,d){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:s,source:this.id},d),this}getClusterChildren(s,d){return this.actor.send("geojson.getClusterChildren",{clusterId:s,source:this.id},d),this}getClusterLeaves(s,d,v,S){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:s,limit:d,offset:v},S),this}_updateWorkerData(s){let d=o.extend({},this.workerOptions),v=this._data;typeof v=="string"?(d.request=this.map._requestManager.transformRequest(o.exported.resolveURL(v),o.ResourceType.Source),d.request.collectResourceTiming=this._collectResourceTiming):d.data=JSON.stringify(v),this._pendingLoads++,this.fire(new o.Event("dataloading",{dataType:"source"})),this.actor.send(`${this.type}.loadData`,d,((S,z)=>{if(this._pendingLoads--,this._removed||z&&z.abandoned)return void this.fire(new o.Event("dataabort",{dataType:"source",sourceDataType:s}));let j=null;if(z&&z.resourceTiming&&z.resourceTiming[this.id]&&(j=z.resourceTiming[this.id].slice(0)),S)return void this.fire(new o.ErrorEvent(S));let W={dataType:"source",sourceDataType:s};this._collectResourceTiming&&j&&j.length>0&&o.extend(W,{resourceTiming:j}),this.fire(new o.Event("data",W))}))}loaded(){return this._pendingLoads===0}loadTile(s,d){let v=s.actor?"reloadTile":"loadTile";s.actor=this.actor;let S={type:this.type,uid:s.uid,tileID:s.tileID,zoom:s.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};s.request=this.actor.send(v,S,((z,j)=>(delete s.request,s.unloadVectorData(),s.aborted?d(null):z?d(z):(s.loadVectorData(j,this.map.painter,v==="reloadTile"),d(null)))))}abortTile(s){s.request&&(s.request.cancel(),delete s.request),s.aborted=!0}unloadTile(s){s.unloadVectorData(),this.actor.send("removeTile",{uid:s.uid,type:this.t
801ype,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}serialize(){return o.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Li=o.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class pi extends o.Evented{constructor(s,d,v,S){super(),this.id=s,this.dispatcher=v,this.coordinates=d.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(S),this.options=d}load(s,d){this._loaded=!1,this.fire(new o.Event("dataloading",{dataType:"source"})),this.url=this.options.url,o.getImage(this.map._requestManager.transformRequest(this.url,o.ResourceType.Image),((v,S)=>{this._loaded=!0,v?this.fire(new o.ErrorEvent(v)):S&&(this.image=S,s&&(this.coordinates=s),d&&d(),this._finishLoading())}))}loaded(){return this._loaded}updateImage(s){return this.image&&s.url?(this.options.url=s.url,this.load(s.coordinates,(()=>{this.texture=null})),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(s){this.map=s,this.load()}setCoordinates(s){this.coordinates=s;let d=s.map(o.MercatorCoordinate.fromLngLat);this.tileID=(function(S){let z=1/0,j=1/0,W=-1/0,K=-1/0;for(let fe of S)z=Math.min(z,fe.x),j=Math.min(j,fe.y),W=Math.max(W,fe.x),K=Math.max(K,fe.y);let Q=Math.max(W-z,K-j),le=Math.max(0,Math.floor(-Math.log(Q)/Math.LN2)),he=Math.pow(2,le);return new o.CanonicalTileID(le,Math.floor((z+W)/2*he),Math.floor((j+K)/2*he))})(d),this.minzoom=this.maxzoom=this.tileID.z;let v=d.map((S=>this.tileID.getTilePoint(S)._round()));return this._boundsArray=new o.RasterBoundsArray,this._boundsArray.emplaceBack(v[0].x,v[0].y,0,0),this._boundsArray.emplaceBack(v[1].x,v[1].y,o.EXTENT,0),this._boundsArray.emplaceBack(v[3].x,v[3].y,0,o.EXTENT),this._boundsArray.emplaceBack(v[2].x,v[2].y,o.EXTENT,o.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let s=this.map.painter.context,d=s.gl;this.boundsBuffer||(this.boundsBuffer=s.createVertexBuffer(this._boundsArray,Li.members)),this.boundsSegments||(this.boundsSegments=o.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new Mt(s,this.image,d.RGBA),this.texture.bind(d.LINEAR,d.CLAMP_TO_EDGE));for(let v in this.tiles){let S=this.tiles[v];S.state!=="loaded"&&(S.state="loaded",S.texture=this.texture)}}loadTile(s,d){this.tileID&&this.tileID.equals(s.tileID.canonical)?(this.tiles[String(s.tileID.wrap)]=s,s.buckets={},d(null)):(s.state="errored",d(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class er extends pi{constructor(s,d,v,S){super(s,d,v,S),this.roundZoom=!0,this.type="video",this.options=d}load(){this._loaded=!1;let s=this.options;this.urls=[];for(let d of s.urls)this.urls.push(this.map._requestManager.transformRequest(d,o.ResourceType.Source).url);o.getVideo(this.urls,((d,v)=>{this._loaded=!0,d?this.fire(new o.ErrorEvent(d)):v&&(this.video=v,this.video.loop=!0,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(s){if(this.video){let d=this.video.seekable;s<d.start(0)||s>d.end(0)?this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${d.start(0)} and ${d.end(0)}-second mark.`))):this.video.currentTime=s}}getVideo(){return this.video}
801onAdd(s){this.map||(this.map=s,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let s=this.map.painter.context,d=s.gl;this.boundsBuffer||(this.boundsBuffer=s.createVertexBuffer(this._boundsArray,Li.members)),this.boundsSegments||(this.boundsSegments=o.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(d.LINEAR,d.CLAMP_TO_EDGE),d.texSubImage2D(d.TEXTURE_2D,0,0,0,d.RGBA,d.UNSIGNED_BYTE,this.video)):(this.texture=new Mt(s,this.video,d.RGBA),this.texture.bind(d.LINEAR,d.CLAMP_TO_EDGE));for(let v in this.tiles){let S=this.tiles[v];S.state!=="loaded"&&(S.state="loaded",S.texture=this.texture)}}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class lr extends pi{constructor(s,d,v,S){super(s,d,v,S),d.coordinates?Array.isArray(d.coordinates)&&d.coordinates.length===4&&!d.coordinates.some((z=>!Array.isArray(z)||z.length!==2||z.some((j=>typeof j!="number"))))||this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${s}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${s}`,null,'missing required property "coordinates"'))),d.animate&&typeof d.animate!="boolean"&&this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${s}`,null,'optional "animate" property must be a boolean value'))),d.canvas?typeof d.canvas=="string"||d.canvas instanceof HTMLCanvasElement||this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${s}`,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 o.ErrorEvent(new o.ValidationError(`sources.${s}`,null,'missing required property "canvas"'))),this.options=d,this.animate=d.animate===void 0||d.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new o.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(s){this.map=s,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let s=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,s=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,s=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let d=this.map.painter.context,v=d.gl;this.boundsBuffer||(this.boundsBuffer=d.createVertexBuffer(this._boundsArray,Li.members)),this.boundsSegments||(this.boundsSegments=o.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(s||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new Mt(d,this.canvas,v.RGBA,{premultiply:!0});for(let S in this.tiles){let z=this.tiles[S];z.state!=="loaded"&&(z.state="loaded",z.texture=this.texture)}}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let s of[this.canvas.width,this.canvas.height])if(isNaN(s)||s<=0)return!0;return!1}}let _n={vector:jt,raster:Si,"raster-dem":Nt,geojson:vi,video:er,image:pi,canvas:lr};function qr(T,s){let d=o.create();return o.translate(d,d,[1,1,0]),o.scale(d,d,[.5*T.width,.5*T.height,1]),o.multiply(d,d,T.calculatePosMatrix(s.toUnwrapped()))}function Cn(T,s,d,v,S,z){let j=(function(he,fe,Re){if(he)for(let Me of he){let Ae=fe[Me];if(Ae&&Ae.source===Re&&Ae.type==="fill-extrusion")return!0}else for(let Me in fe){let Ae=fe[Me];if(Ae.source===Re&&Ae.type==="fill-extrusion")return!0}return!1})(S&&S.layers,s,T.id),W=z.maxPitchScaleFactor(),K=T.tilesIn(v,W,j);K.sort(yn);let Q=[];for(let he of K)Q.push({wrappedTileID:he.tileID.wrapped().key,queryResults:he.tile.queryRenderedFeatures(s,d,T._state,he.queryGeometry,he.cameraQueryGeometry,he.scale,S,z,W,qr(T.transform,he.tileID))});let le=(function(he){let fe={},Re={};for(let Me of he){let Ae=Me.queryResults,Xe=Me.wrappedTileID,et=Re[Xe]=Re[Xe]||{};for(let rt in Ae){let Be=Ae[rt],ht=et[rt]=et[rt]||{},ot=fe[rt]=fe[rt]||[];for(let wt of Be)ht[wt.featureIndex]||(ht[wt.featureIndex]=!0,ot.push(wt))}}return fe})(Q);for(let he in le)le[he].forEach((fe=>{let Re=fe.feature,Me=T.getFeatureState(Re.layer["source-layer"],Re.id);Re.source=Re.layer.source,Re.layer["source-layer"]&&(Re.sourceLayer=Re.layer["source-layer"]),Re.state=Me}));return le}function yn(T,s){let d=T.tileID,v=s.tileID;return d.overscaledZ-v.overscaledZ||d.canonical.y-v.canonical.y||d.wrap-v.wrap||d.canonical.x-v.canonical.x}class zo{constructor(s,d){this.tileID=s,this.uid=o.uniqueId(),this.uses=0,this.tileSize=d,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.textures=[],this.textureCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(s){let d=s+this.timeAdded;d<o.exported.now()||this.fadeEndTime&&d<this.fadeEndTime||(this.fadeEndTime=d)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(s){this.demTexture&&s.saveTileTexture(this.demTexture),this.textures.forEac
801h((d=>s.saveTileTexture(d))),this.demTexture=null,this.textures=[],this.textureCoords={}}loadVectorData(s,d,v){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",s){s.featureIndex&&(this.latestFeatureIndex=s.featureIndex,s.rawTileData?(this.latestRawTileData=s.rawTileData,this.latestFeatureIndex.rawTileData=s.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=s.collisionBoxArray,this.buckets=(function(S,z){let j={};if(!z)return j;for(let W of S){let K=W.layerIds.map((Q=>z.getLayer(Q))).filter(Boolean);if(K.length!==0){W.layers=K,W.stateDependentLayerIds&&(W.stateDependentLayers=W.stateDependentLayerIds.map((Q=>K.filter((le=>le.id===Q))[0])));for(let Q of K)j[Q.id]=W}}return j})(s.buckets,d.style),this.hasSymbolBuckets=!1;for(let S in this.buckets){let z=this.buckets[S];if(z instanceof o.SymbolBucket){if(this.hasSymbolBuckets=!0,!v)break;z.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let S in this.buckets){let z=this.buckets[S];if(z instanceof o.SymbolBucket&&z.hasRTLText){this.hasRTLText=!0,o.lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(let S in this.buckets){let z=this.buckets[S];this.queryPadding=Math.max(this.queryPadding,d.style.getLayer(S).queryRadius(z))}s.imageAtlas&&(this.imageAtlas=s.imageAtlas),s.glyphAtlasImage&&(this.glyphAtlasImage=s.glyphAtlasImage)}else this.collisionBoxArray=new o.CollisionBoxArray}unloadVectorData(){for(let s in this.buckets)this.buckets[s].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(s){return this.buckets[s.id]}upload(s){for(let v in this.buckets){let S=this.buckets[v];S.uploadPending()&&S.upload(s)}let d=s.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Mt(s,this.imageAtlas.image,d.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Mt(s,this.glyphAtlasImage,d.ALPHA),this.glyphAtlasImage=null)}prepare(s){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(s,this.imageAtlasTexture)}queryRenderedFeatures(s,d,v,S,z,j,W,K,Q,le){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:S,cameraQueryGeometry:z,scale:j,tileSize:this.tileSize,pixelPosMatrix:le,transform:K,params:W,queryPadding:this.queryPadding*Q},s,d,v):{}}querySourceFeatures(s,d){let v=this.latestFeatureIndex;if(!v||!v.rawTileData)return;let S=v.loadVTLayers(),z=d?d.sourceLayer:"",j=S._geojsonTileLayer||S[z];if(!j)return;let W=o.createFilter(d&&d.filter),{z:K,x:Q,y:le}=this.tileID.canonical,he={z:K,x:Q,y:le};for(let fe=0;fe<j.length;fe++){let Re=j.feature(fe);if(W.needGeometry){let Xe=o.toEvaluationFeature(Re,!0);if(!W.filter(new o.EvaluationParameters(this.tileID.overscaledZ),Xe,this.tileID.canonical))continue}else if(!W.filter(new o.EvaluationParameters(this.tileID.overscaledZ),Re))continue;let Me=v.getId(Re,z),Ae=new o.GeoJSONFeature(Re,K,Q,le,Me);Ae.tile=he,s.push(Ae)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(s){let d=this.expirationTime;if(s.cacheControl){let v=o.parseCacheControl(s.cacheControl);v["max-age"]&&(this.expirationTime=Date.now()+1e3*v["max-age"])}else s.expires&&(this.expirationTime=new Date(s.expires).getTime());if(this.expirationTime){let v=Date.now(),S=!1;if(this.expirationTime>v)S=!1;else if(d)if(this.expirationTime<d)S=!0;else{let z=this.expirationTime-d;z?this.expirationTime=v+Math.max(z,3e4):S=!0}else S=!0;S?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)}setFeatureState(s,d){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(s).length===0)return;let v=this.latestFeatureIndex.loadVTLayers();for(let S in this.buckets){if(!d.style.hasLayer(S))continue;let z=this.buckets[S],j=z.layers[0].sourceLayer||"_geojsonTileLayer",W=v[j],K=s[j];if(!W||!K||Object.keys(K).length===0)continue;z.update(K,W,this.imageAtlas&&this.imageAtlas.patternPositions||{});let Q=d&&d.style&&d.style.getLayer(S);Q&&(this.queryPadding=Math.max(this.queryPadding,Q.queryRadius(z)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<o.exported.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(s){this.symbolFadeHoldUntil=o.exported.now()+s}
801setDependencies(s,d){let v={};for(let S of d)v[S]=!0;this.dependencies[s]=v}hasDependency(s,d){for(let v of s){let S=this.dependencies[v];if(S){for(let z of d)if(S[z])return!0}}return!1}}class $r{constructor(s,d){this.max=s,this.onRemove=d,this.reset()}reset(){for(let s in this.data)for(let d of this.data[s])d.timeout&&clearTimeout(d.timeout),this.onRemove(d.value);return this.data={},this.order=[],this}add(s,d,v){let S=s.wrapped().key;this.data[S]===void 0&&(this.data[S]=[]);let z={value:d,timeout:void 0};if(v!==void 0&&(z.timeout=setTimeout((()=>{this.remove(s,z)}),v)),this.data[S].push(z),this.order.push(S),this.order.length>this.max){let j=this._getAndRemoveByKey(this.order[0]);j&&this.onRemove(j)}return this}has(s){return s.wrapped().key in this.data}getAndRemove(s){return this.has(s)?this._getAndRemoveByKey(s.wrapped().key):null}_getAndRemoveByKey(s){let d=this.data[s].shift();return d.timeout&&clearTimeout(d.timeout),this.data[s].length===0&&delete this.data[s],this.order.splice(this.order.indexOf(s),1),d.value}getByKey(s){let d=this.data[s];return d?d[0].value:null}get(s){return this.has(s)?this.data[s.wrapped().key][0].value:null}remove(s,d){if(!this.has(s))return this;let v=s.wrapped().key,S=d===void 0?0:this.data[v].indexOf(d),z=this.data[v][S];return this.data[v].splice(S,1),z.timeout&&clearTimeout(z.timeout),this.data[v].length===0&&delete this.data[v],this.onRemove(z.value),this.order.splice(this.order.indexOf(v),1),this}setMaxSize(s){for(this.max=s;this.order.length>this.max;){let d=this._getAndRemoveByKey(this.order[0]);d&&this.onRemove(d)}return this}filter(s){let d=[];for(let v in this.data)for(let S of this.data[v])s(S.value)||d.push(S);for(let v of d)this.remove(v.value.tileID,v)}}class yo{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(s,d,v){let S=String(d);if(this.stateChanges[s]=this.stateChanges[s]||{},this.stateChanges[s][S]=this.stateChanges[s][S]||{},o.extend(this.stateChanges[s][S],v),this.deletedStates[s]===null){this.deletedStates[s]={};for(let z in this.state[s])z!==S&&(this.deletedStates[s][z]=null)}else if(this.deletedStates[s]&&this.deletedStates[s][S]===null){this.deletedStates[s][S]={};for(let z in this.state[s][S])v[z]||(this.deletedStates[s][S][z]=null)}else for(let z in v)this.deletedStates[s]&&this.deletedStates[s][S]&&this.deletedStates[s][S][z]===null&&delete this.deletedStates[s][S][z]}removeFeatureState(s,d,v){if(this.deletedStates[s]===null)return;let S=String(d);if(this.deletedStates[s]=this.deletedStates[s]||{},v&&d!==void 0)this.deletedStates[s][S]!==null&&(this.deletedStates[s][S]=this.deletedStates[s][S]||{},this.deletedStates[s][S][v]=null);else if(d!==void 0)if(this.stateChanges[s]&&this.stateChanges[s][S])for(v in this.deletedStates[s][S]={},this.stateChanges[s][S])this.deletedStates[s][S][v]=null;else this.deletedStates[s][S]=null;else this.deletedStates[s]=null}getState(s,d){let v=String(d),S=o.extend({},(this.state[s]||{})[v],(this.stateChanges[s]||{})[v]);if(this.deletedStates[s]===null)return{};if(this.deletedStates[s]){let z=this.deletedStates[s][d];if(z===null)return{};for(let j in z)delete S[j]}return S}initializeTileState(s,d){s.setFeatureState(this.state,d)}coalesceChanges(s,d){let v={};for(let S in this.stateChanges){this.state[S]=this.state[S]||{};let z={};for(let j in this.stateChanges[S])this.state[S][j]||(this.state[S][j]={}),o.extend(this.state[S][j],this.stateChanges[S][j]),z[j]=this.state[S][j];v[S]=z}for(let S in this.deletedStates){this.state[S]=this.state[S]||{};let z={};if(this.deletedStates[S]===null)for(let j in this.state[S])z[j]={},this.state[S][j]={};else for(let j in this.deletedStates[S]){if(this.deletedStates[S][j]===null)this.state[S][j]={};else for(let W of Object.keys(this.deletedStates[S][j]))delete this.state[S][j][W];z[j]=this.state[S][j]}v[S]=v[S]||{},o.extend(v[S],z)}if(this.stateChanges={},this.deletedStates={},Object.keys(v).length!==0)for(let S in s)s[S].setFeatureState(v,d)}}class Dr extends o.Evented{constructor(s,d,v){super(),this.id=s,this.dispatcher=v,this.on("data",(S=>{S.dataType==="source"&&S.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&S.dataType==="source"&&S.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain))})),this.on("dataloading",(()=>{this._sourceErrored=!1})),this.on("error",(()=>{this._sourceErrored=this._source.loaded()})),this._source=(function(S,z,j,W){let K=new _n[z.type](S,z,j,W);if(K.id!==S)throw new Error(`Expected Source id to be ${S} instead of ${K.id}`);return o.bindAll(["load","abort","unload","serialize","prepare"],K),K})(s,d,v,this),this._tiles={},this._cache=new $r(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={}
801,this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new yo}onAdd(s){this.map=s,this._maxTileCacheSize=s?s._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(s)}onRemove(s){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(s)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(let s in this._tiles){let d=this._tiles[s];if(d.state!=="loaded"&&d.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let s=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,s&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(s,d){return this._source.loadTile(s,d)}_unloadTile(s){if(this._source.unloadTile)return this._source.unloadTile(s,(()=>{}))}_abortTile(s){this._source.abortTile&&this._source.abortTile(s,(()=>{})),this._source.fire(new o.Event("dataabort",{tile:s,coord:s.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(s){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let d in this._tiles){let v=this._tiles[d];v.upload(s),v.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map((s=>s.tileID)).sort(fa).map((s=>s.key))}getRenderableIds(s){let d=[];for(let v in this._tiles)this._isIdRenderable(v,s)&&d.push(this._tiles[v]);return s?d.sort(((v,S)=>{let z=v.tileID,j=S.tileID,W=new o.pointGeometry(z.canonical.x,z.canonical.y)._rotate(this.transform.angle),K=new o.pointGeometry(j.canonical.x,j.canonical.y)._rotate(this.transform.angle);return z.overscaledZ-j.overscaledZ||K.y-W.y||K.x-W.x})).map((v=>v.tileID.key)):d.map((v=>v.tileID)).sort(fa).map((v=>v.key))}hasRenderableParent(s){let d=this.findLoadedParent(s,0);return!!d&&this._isIdRenderable(d.tileID.key)}_isIdRenderable(s,d){return this._tiles[s]&&this._tiles[s].hasData()&&!this._coveredTiles[s]&&(d||!this._tiles[s].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(let s in this._tiles)this._tiles[s].state!=="errored"&&this._reloadTile(s,"reloading")}}_reloadTile(s,d){let v=this._tiles[s];v&&(v.state!=="loading"&&(v.state=d),this._loadTile(v,this._tileLoaded.bind(this,v,s,d)))}_tileLoaded(s,d,v,S){if(S)return s.state="errored",void(S.status!==404?this._source.fire(new o.ErrorEvent(S,{tile:s})):this.update(this.transform,this.terrain));s.timeAdded=o.exported.now(),v==="expired"&&(s.refreshedUponExpiration=!0),this._setTileReloadTimer(d,s),this.getSource().type==="raster-dem"&&s.dem&&this._backfillDEM(s),this._state.initializeTileState(s,this.map?this.map.painter:null),s.aborted||this._source.fire(new o.Event("data",{dataType:"source",tile:s,coord:s.tileID}))}_backfillDEM(s){let d=this.getRenderableIds();for(let S=0;S<d.length;S++){let z=d[S];if(s.neighboringTiles&&s.neighboringTiles[z]){let j=this.getTileByID(z);v(s,j),v(j,s)}}function v(S,z){S.needsHillshadePrepare=!0,S.needsTerrainPrepare=!0;let j=z.tileID.canonical.x-S.tileID.canonical.x,W=z.tileID.canonical.y-S.tileID.canonical.y,K=Math.pow(2,S.tileID.canonical.z),Q=z.tileID.key;j===0&&W===0||Math.abs(W)>1||(Math.abs(j)>1&&(Math.abs(j+K)===1?j+=K:Math.abs(j-K)===1&&(j-=K)),z.dem&&S.dem&&(S.dem.backfillBorder(z.dem,j,W),S.neighboringTiles&&S.neighboringTiles[Q]&&(S.neighboringTiles[Q].backfilled=!0)))}}getTile(s){return this.getTileByID(s.key)}getTileByID(s){return this._tiles[s]}_retainLoadedChildren(s,d,v,S){for(let z in this._tiles){let j=this._tiles[z];if(S[z]||!j.hasData()||j.tileID.overscaledZ<=d||j.tileID.overscaledZ>v)continue;let W=j.tileID;for(;j&&j.tileID.overscaledZ>d+1;){let Q=j.tileID.scaledTo(j.tileID.overscaledZ-1);j=this._tiles[Q.key],j&&j.hasData()&&(W=Q)}let K=W;for(;K.overscaledZ>d;)if(K=K.scaledTo(K.overscaledZ-1),s[K.key]){S[W.key]=W;break}}}findLoadedParent(s,d){if(s.key in this._loadedParentTiles){let v=this._loadedParentTiles[s.key];return v&&v.tileID.overscaledZ>=d?v:null}for(let v=s.overscaledZ-1;v>=d;v--){let S=s.scaledTo(v),z=this._getLoadedTile(S);if(z)return z}}_getLoadedTile(s){let d=this._tiles[s.key];return d&&d.hasData()?d:this._cache.getByKey(s.wrapped().key)}updateCacheSize(s){let d=Math.ceil(s.width/this._source.tileSize)+1,v=Math.ceil(s.height/this._source.tileSize)+1,S=Math.floor(d*v*5),z=typeof this._maxTileC
801acheSize=="number"?Math.min(this._maxTileCacheSize,S):S;this._cache.setMaxSize(z)}handleWrapJump(s){let d=Math.round((s-(this._prevLng===void 0?s:this._prevLng))/360);if(this._prevLng=s,d){let v={};for(let S in this._tiles){let z=this._tiles[S];z.tileID=z.tileID.unwrapTo(z.tileID.wrap+d),v[z.tileID.key]=z}this._tiles=v;for(let S in this._timers)clearTimeout(this._timers[S]),delete this._timers[S];for(let S in this._tiles)this._setTileReloadTimer(S,this._tiles[S])}}update(s,d){if(this.transform=s,this.terrain=d,!this._sourceLoaded||this._paused)return;let v;this.updateCacheSize(s),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?v=s.getVisibleUnwrappedCoordinates(this._source.tileID).map((Q=>new o.OverscaledTileID(Q.canonical.z,Q.wrap,Q.canonical.z,Q.canonical.x,Q.canonical.y))):(v=s.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:d}),this._source.hasTile&&(v=v.filter((Q=>this._source.hasTile(Q))))):v=[];let S=s.coveringZoomLevel(this._source),z=Math.max(S-Dr.maxOverzooming,this._source.minzoom),j=Math.max(S+Dr.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){let Q={};for(let le of v)if(le.canonical.z>this._source.minzoom){let he=le.scaledTo(le.canonical.z-1);Q[he.key]=he;let fe=le.scaledTo(Math.max(this._source.minzoom,Math.min(le.canonical.z,5)));Q[fe.key]=fe}v=v.concat(Object.values(Q))}let W=this._updateRetainedTiles(v,S);if(Do(this._source.type)){let Q={},le={},he=Object.keys(W);for(let fe of he){let Re=W[fe],Me=this._tiles[fe];if(!Me||Me.fadeEndTime&&Me.fadeEndTime<=o.exported.now())continue;let Ae=this.findLoadedParent(Re,z);Ae&&(this._addTile(Ae.tileID),Q[Ae.tileID.key]=Ae.tileID),le[fe]=Re}this._retainLoadedChildren(le,S,j,W);for(let fe in Q)W[fe]||(this._coveredTiles[fe]=!0,W[fe]=Q[fe]);if(d){let fe={},Re={};for(let Me of v)this._tiles[Me.key].hasData()?fe[Me.key]=Me:Re[Me.key]=Me;for(let Me in Re){let Ae=Re[Me].children(this._source.maxzoom);this._tiles[Ae[0].key]&&this._tiles[Ae[1].key]&&this._tiles[Ae[2].key]&&this._tiles[Ae[3].key]&&(fe[Ae[0].key]=W[Ae[0].key]=Ae[0],fe[Ae[1].key]=W[Ae[1].key]=Ae[1],fe[Ae[2].key]=W[Ae[2].key]=Ae[2],fe[Ae[3].key]=W[Ae[3].key]=Ae[3],delete Re[Me])}for(let Me in Re){let Ae=this.findLoadedParent(Re[Me],this._source.minzoom);if(Ae){fe[Ae.tileID.key]=W[Ae.tileID.key]=Ae.tileID;for(let Xe in fe)fe[Xe].isChildOf(Ae.tileID)&&delete fe[Xe]}}for(let Me in this._tiles)fe[Me]||(this._coveredTiles[Me]=!0)}}for(let Q in W)this._tiles[Q].clearFadeHold();let K=o.keysDifference(this._tiles,W);for(let Q of K){let le=this._tiles[Q];le.hasSymbolBuckets&&!le.holdingForFade()?le.setHoldDuration(this.map._fadeDuration):le.hasSymbolBuckets&&!le.symbolFadeFinished()||this._removeTile(Q)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(let s in this._tiles)this._tiles[s].holdingForFade()&&this._removeTile(s)}_updateRetainedTiles(s,d){let v={},S={},z=Math.max(d-Dr.maxOverzooming,this._source.minzoom),j=Math.max(d+Dr.maxUnderzooming,this._source.minzoom),W={};for(let K of s){let Q=this._addTile(K);v[K.key]=K,Q.hasData()||d<this._source.maxzoom&&(W[K.key]=K)}this._retainLoadedChildren(W,d,j,v);for(let K of s){let Q=this._tiles[K.key];if(Q.hasData())continue;if(d+1>this._source.maxzoom){let he=K.children(this._source.maxzoom)[0],fe=this.getTile(he);if(fe&&fe.hasData()){v[he.key]=he;continue}}else{let he=K.children(this._source.maxzoom);if(v[he[0].key]&&v[he[1].key]&&v[he[2].key]&&v[he[3].key])continue}let le=Q.wasRequested();for(let he=K.overscaledZ-1;he>=z;--he){let fe=K.scaledTo(he);if(S[fe.key]||(S[fe.key]=!0,Q=this.getTile(fe),!Q&&le&&(Q=this._addTile(fe)),Q&&(v[fe.key]=fe,le=Q.wasRequested(),Q.hasData())))break}}return v}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let s in this._tiles){let d=[],v,S=this._tiles[s].tileID;for(;S.overscaledZ>0;){if(S.key in this._loadedParentTiles){v=this._loadedParentTiles[S.key];break}d.push(S.key);let z=S.scaledTo(S.overscaledZ-1);if(v=this._getLoadedTile(z),v)break;S=z}for(let z of d)this._loadedParentTiles[z]=v}}_addTile(s){let d=this._tiles[s.key];if(d)return d;d=this._cache.getAndRemove(s),d&&(this._setTileReloadTimer(s.key,d),d.tileID=s,this._state.initializeTileState(d,this.map?this.map.painter:null),this._cacheTimers[s.key]&&(clearTimeout(this._cacheTimers[s.key]),delete this._cacheTimers[s.key],this._setTileReloadTimer(s.key,d)));let v=d;return d||(d=new zo(s,this._source.tileSize*s.overscaleFactor()),this._loadTile(d,this._tileLoaded.bind(this,d,s.key,d.state))),d.uses++,this._tiles[s.key]=d,v||this._source.fire(new o.Event("dataloading",{tile:d,coord:d.tileID,dataType:"source"})),d}_setTileReloadTimer(s,d){s in this._timers&&(clearTimeout(this._timers[s]),delete this._timers[s]);let v=d.getExpiryTimeout();v&&(this._timers[s]=setTimeout((()=>{this._reloadTile(s,"expired"),delete this._timers[s]}),v))}_removeTile(s){let d=this._tiles[s];d&&(d.uses--,delete this._tiles[s],this._timers[s]&&(clearTimeout(this._timers[s]),delete this._timers[s]),d.uses>0||(d.hasData()&&d.state!=="reloading"?this._cache.add(d.tileID,d,d.getExpiryTimeout()):(d.aborted=!0,this._abortTile(d),this._unloadTile(d))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let s in this._tiles)this._removeTile(s);this._cache.reset()}tilesIn(s,d,v){let S=[],z=this.transform;if(!z)return S;let j=v?z.getCameraQueryGeometry(s):s,W=s.map((Me=>z.pointCoordinate(Me,this.terrain))),K=j.map((Me=>z.pointCoordinate(Me,this.terrain))),Q=this.getIds(),le=1/0,he=1/0,fe=-1/0,Re=-1/0;for(let Me of K)le=Math.min(le,Me.x),he=Math.min(he,Me.y),fe=Math.max(fe,Me.x),Re=Math.max(Re,Me.y);for(let Me=0;Me<Q.length;Me++){let Ae=this._tiles[Q[Me]];if(Ae.holdingForFade())continue;
801let Xe=Ae.tileID,et=Math.pow(2,z.zoom-Ae.tileID.overscaledZ),rt=d*Ae.queryPadding*o.EXTENT/Ae.tileSize/et,Be=[Xe.getTilePoint(new o.MercatorCoordinate(le,he)),Xe.getTilePoint(new o.MercatorCoordinate(fe,Re))];if(Be[0].x-rt<o.EXTENT&&Be[0].y-rt<o.EXTENT&&Be[1].x+rt>=0&&Be[1].y+rt>=0){let ht=W.map((wt=>Xe.getTilePoint(wt))),ot=K.map((wt=>Xe.getTilePoint(wt)));S.push({tile:Ae,tileID:Xe,queryGeometry:ht,cameraQueryGeometry:ot,scale:et})}}return S}getVisibleCoordinates(s){let d=this.getRenderableIds(s).map((v=>this._tiles[v].tileID));for(let v of d)v.posMatrix=this.transform.calculatePosMatrix(v.toUnwrapped());return d}hasTransition(){if(this._source.hasTransition())return!0;if(Do(this._source.type))for(let s in this._tiles){let d=this._tiles[s];if(d.fadeEndTime!==void 0&&d.fadeEndTime>=o.exported.now())return!0}return!1}setFeatureState(s,d,v){this._state.updateState(s=s||"_geojsonTileLayer",d,v)}removeFeatureState(s,d,v){this._state.removeFeatureState(s=s||"_geojsonTileLayer",d,v)}getFeatureState(s,d){return this._state.getState(s=s||"_geojsonTileLayer",d)}setDependencies(s,d,v){let S=this._tiles[s];S&&S.setDependencies(d,v)}reloadTilesForDependencies(s,d){for(let v in this._tiles)this._tiles[v].hasDependency(s,d)&&this._reloadTile(v,"reloading");this._cache.filter((v=>!v.hasDependency(s,d)))}}function fa(T,s){let d=Math.abs(2*T.wrap)-+(T.wrap<0),v=Math.abs(2*s.wrap)-+(s.wrap<0);return T.overscaledZ-s.overscaledZ||v-d||s.canonical.y-T.canonical.y||s.canonical.x-T.canonical.x}function Do(T){return T==="raster"||T==="image"||T==="video"}Dr.maxOverzooming=10,Dr.maxUnderzooming=3;let Qn="mapboxgl_preloaded_worker_pool";class Ti{constructor(){this.active={}}acquire(s){if(!this.workers)for(this.workers=[];this.workers.length<Ti.workerCount;)this.workers.push(new Worker(Wa.workerUrl));return this.active[s]=!0,this.workers.slice()}release(s){delete this.active[s],this.numActive()===0&&(this.workers.forEach((d=>{d.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[Qn]}numActive(){return Object.keys(this.active).length}}let nn=Math.floor(o.exported.hardwareConcurrency/2),Gr;function Hn(){return Gr||(Gr=new Ti),Gr}function on(T,s){let d={};for(let v in T)v!=="ref"&&(d[v]=T[v]);return o.refProperties.forEach((v=>{v in s&&(d[v]=s[v])})),d}function Xn(T){T=T.slice();let s=Object.create(null);for(let d=0;d<T.length;d++)s[T[d].id]=T[d];for(let d=0;d<T.length;d++)"ref"in T[d]&&(T[d]=on(T[d],s[T[d].ref]));return T}Ti.workerCount=Math.max(Math.min(nn,6),1);let Qi={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function ga(T,s,d){d.push({command:Qi.addSource,args:[T,s[T]]})}function as(T,s,d){s.push({command:Qi.removeSource,args:[T]}),d[T]=!0}function xo(T,s,d,v){as(T,d,v),ga(T,s,d)}function ss(T,s,d){let v;for(v in T[d])if(Object.prototype.hasOwnProperty.call(T[d],v)&&v!=="data"&&!ct(T[d][v],s[d][v]))return!1;for(v in s[d])if(Object.prototype.hasOwnProperty.call(s[d],v)&&v!=="data"&&!ct(T[d][v],s[d][v]))return!1;return!0}function _a(T,s,d,v,S,z){let j;for(j in s=s||{},T=T||{})Object.prototype.hasOwnProperty.call(T,j)&&(ct(T[j],s[j])||d.push({command:z,args:[v,j,s[j],S]}));for(j in s)Object.prototype.hasOwnProperty.call(s,j)&&!Object.prototype.hasOwnProperty.call(T,j)&&(ct(T[j],s[j])||d.push({command:z,args:[v,j,s[j],S]}))}function oo(T){return T.id}function ya(T,s){return T[s.id]=s,T}class Na{constructor(s,d){this.reset(s,d)}reset(s,d){this.points=s||[],this._distances=[0];for(let v=1;v<this.points.length;v++)this._distances[v]=this._distances[v-1]+this.points[v].dist(this.points[v-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(d||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(s){if(this.points.length===1)return this.points[0];s=o.clamp(s,0,1);let d=1,v=this._distances[d],S=s*this.paddedLength+this.padding;
vendor: 4,106 bytes, line 801
801for(;v<S&&d<this._distances.length;)v=this._distances[++d];let z=d-1,j=this._distances[z],W=v-j,K=W>0?(S-j)/W:0;return this.points[z].mult(1-K).add(this.points[d].mult(K))}}function St(T,s){let d=!0;return T==="always"||T!=="never"&&s!=="never"||(d=!1),d}class Kt{constructor(s,d,v){let S=this.boxCells=[],z=this.circleCells=[];this.xCellCount=Math.ceil(s/v),this.yCellCount=Math.ceil(d/v);for(let j=0;j<this.xCellCount*this.yCellCount;j++)S.push([]),z.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=s,this.height=d,this.xScale=this.xCellCount/s,this.yScale=this.yCellCount/d,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(s,d,v,S,z){this._forEachCell(d,v,S,z,this._insertBoxCell,this.boxUid++),this.boxKeys.push(s),this.bboxes.push(d),this.bboxes.push(v),this.bboxes.push(S),this.bboxes.push(z)}insertCircle(s,d,v,S){this._forEachCell(d-S,v-S,d+S,v+S,this._insertCircleCell,this.circleUid++),this.circleKeys.push(s),this.circles.push(d),this.circles.push(v),this.circles.push(S)}_insertBoxCell(s,d,v,S,z,j){this.boxCells[z].push(j)}_insertCircleCell(s,d,v,S,z,j){this.circleCells[z].push(j)}_query(s,d,v,S,z,j,W){if(v<0||s>this.width||S<0||d>this.height)return[];let K=[];if(s<=0&&d<=0&&this.width<=v&&this.height<=S){if(z)return[{key:null,x1:s,y1:d,x2:v,y2:S}];for(let Q=0;Q<this.boxKeys.length;Q++)K.push({key:this.boxKeys[Q],x1:this.bboxes[4*Q],y1:this.bboxes[4*Q+1],x2:this.bboxes[4*Q+2],y2:this.bboxes[4*Q+3]});for(let Q=0;Q<this.circleKeys.length;Q++){let le=this.circles[3*Q],he=this.circles[3*Q+1],fe=this.circles[3*Q+2];K.push({key:this.circleKeys[Q],x1:le-fe,y1:he-fe,x2:le+fe,y2:he+fe})}}else this._forEachCell(s,d,v,S,this._queryCell,K,{hitTest:z,overlapMode:j,seenUids:{box:{},circle:{}}},W);return K}query(s,d,v,S){return this._query(s,d,v,S,!1,null)}hitTest(s,d,v,S,z,j){return this._query(s,d,v,S,!0,z,j).length>0}hitTestCircle(s,d,v,S,z){let j=s-v,W=s+v,K=d-v,Q=d+v;if(W<0||j>this.width||Q<0||K>this.height)return!1;let le=[];return this._forEachCell(j,K,W,Q,this._queryCellCircle,le,{hitTest:!0,overlapMode:S,circle:{x:s,y:d,radius:v},seenUids:{box:{},circle:{}}},z),le.length>0}_queryCell(s,d,v,S,z,j,W,K){let{seenUids:Q,hitTest:le,overlapMode:he}=W,fe=this.boxCells[z];if(fe!==null){let Me=this.bboxes;for(let Ae of fe)if(!Q.box[Ae]){Q.box[Ae]=!0;let Xe=4*Ae,et=this.boxKeys[Ae];if(s<=Me[Xe+2]&&d<=Me[Xe+3]&&v>=Me[Xe+0]&&S>=Me[Xe+1]&&(!K||K(et))&&(!le||!St(he,et.overlapMode))&&(j.push({key:et,x1:Me[Xe],y1:Me[Xe+1],x2:Me[Xe+2],y2:Me[Xe+3]}),le))return!0}}let Re=this.circleCells[z];if(Re!==null){let Me=this.circles;for(let Ae of Re)if(!Q.circle[Ae]){Q.circle[Ae]=!0;let Xe=3*Ae,et=this.circleKeys[Ae];if(this._circleAndRectCollide(Me[Xe],Me[Xe+1],Me[Xe+2],s,d,v,S)&&(!K||K(et))&&(!le||!St(he,et.overlapMode))){let rt=Me[Xe],Be=Me[Xe+1],ht=Me[Xe+2];if(j.push({key:et,x1:rt-ht,y1:Be-ht,x2:rt+ht,y2:Be+ht}),le)return!0}}}return!1}_queryCellCircle(s,d,v,S,z,j,W,K){let{circle:Q,seenUids:le,overlapMode:he}=W,fe=this.boxCells[z];if(fe!==null){let Me=this.bboxes;for(let Ae of fe)if(!le.box[Ae]){le.box[Ae]=!0;let Xe=4*Ae,et=this.boxKeys[Ae];if(this._circleAndRectCollide(Q.x,Q.y,Q.radius,Me[Xe+0],Me[Xe+1],Me[Xe+2],Me[Xe+3])&&(!K||K(et))&&!St(he,et.overlapMode))return j.push(!0),!0}}let Re=this.circleCells[z];if(Re!==null){let Me=this.circles;for(let Ae of Re)if(!le.circle[Ae]){le.circle[Ae]=!0;let Xe=3*Ae,et=this.circleKeys[Ae];if(this._circlesCollide(Me[Xe],Me[Xe+1],Me[Xe+2],Q.x,Q.y,Q.radius)&&(!K||K(et))&&!St(he,et.overlapMode))return j.push(!0),!0}}}_forEachCell(s,d,v,S,z,j,W,K){let Q=this._convertToXCellCoord(s),le=this._convertToYCellCoord(d),he=this._convertToXCellCoord(v),fe=this._convertToYCellCoord(S);for(let Re=Q;Re<=he;Re++)for(let Me=le;Me<=fe;Me++)if(z.call(this,s,d,v,S,this.xCellCount*Me+Re,j,W,K))return}_convertToXCellCoord(s){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(s*this.xScale)))}_convertToYCellCoord(s){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(s*this.yScale)))}_circlesCollide(s,d,v,S,z,j){let W=S-s,K=z-d,Q=v+j;return Q*Q>W*W+K*K}
801_circleAndRectCollide(s,d,v,S,z,j,W){let K=(j-S)/2,Q=Math.abs(s-(S+K));if(Q>K+v)return!1;let le=(W-z)/2,he=Math.abs(d-(z+le));if(he>le+v)return!1;if(Q<=K||he<=le)return!0;let fe=Q-K,Re=he-le;return fe*fe+Re*Re<=v*v}}function Ua(T,s,d,v,S){let z=o.create();return s?(o.scale(z,z,[1/S,1/S,1]),d||o.rotateZ(z,z,v.angle)):o.multiply(z,v.labelPlaneMatrix,T),z}function xa(T,s,d,v,S){if(s){let z=o.clone(T);return o.scale(z,z,[S,S,1]),d||o.rotateZ(z,z,-v.angle),z}return v.glCoordMatrix}function or(T,s,d){let v;d?(v=[T.x,T.y,d(T.x,T.y),1],o.transformMat4(v,v,s)):(v=[T.x,T.y,0,1],Ro(v,v,s));let S=v[3];return{point:new o.pointGeometry(v[0]/S,v[1]/S),signedDistanceFromCamera:S}}function Bn(T,s){return .5+T/s*.5}function xn(T,s){let d=T[0]/T[3],v=T[1]/T[3];return d>=-s[0]&&d<=s[0]&&v>=-s[1]&&v<=s[1]}function Zr(T,s,d,v,S,z,j,W,K,Q){let le=v?T.textSizeData:T.iconSizeData,he=o.evaluateSizeForZoom(le,d.transform.zoom),fe=[256/d.width*2+1,256/d.height*2+1],Re=v?T.text.dynamicLayoutVertexArray:T.icon.dynamicLayoutVertexArray;Re.clear();let Me=T.lineVertexArray,Ae=v?T.text.placedSymbolArray:T.icon.placedSymbolArray,Xe=d.transform.width/d.transform.height,et=!1;for(let rt=0;rt<Ae.length;rt++){let Be=Ae.get(rt);if(Be.hidden||Be.writingMode===o.WritingMode.vertical&&!et){ji(Be.numGlyphs,Re);continue}let ht;if(et=!1,Q?(ht=[Be.anchorX,Be.anchorY,Q(Be.anchorX,Be.anchorY),1],o.transformMat4(ht,ht,s)):(ht=[Be.anchorX,Be.anchorY,0,1],Ro(ht,ht,s)),!xn(ht,fe)){ji(Be.numGlyphs,Re);continue}let ot=Bn(d.transform.cameraToCenterDistance,ht[3]),wt=o.evaluateSizeForFeature(le,he,Be),Tt=j?wt/ot:wt*ot,Ft=new o.pointGeometry(Be.anchorX,Be.anchorY),gt=or(Ft,S,Q).point,ri={},Xt=Wi(Be,Tt,!1,W,s,S,z,T.glyphOffsetArray,Me,Re,gt,Ft,ri,Xe,K,Q);et=Xt.useVertical,(Xt.notEnoughRoom||et||Xt.needsFlipping&&Wi(Be,Tt,!0,W,s,S,z,T.glyphOffsetArray,Me,Re,gt,Ft,ri,Xe,K,Q).notEnoughRoom)&&ji(Be.numGlyphs,Re)}v?T.text.dynamicLayoutVertexBuffer.updateData(Re):T.icon.dynamicLayoutVertexBuffer.updateData(Re)}function ta(T,s,d,v,S,z,j,W,K,Q,le,he,fe){let Re=W.glyphStartIndex+W.numGlyphs,Me=W.lineStartIndex,Ae=W.lineStartIndex+W.lineLength,Xe=s.getoffsetX(W.glyphStartIndex),et=s.getoffsetX(Re-1),rt=an(T*Xe,d,v,S,z,j,W.segment,Me,Ae,K,Q,le,he,fe);if(!rt)return null;let Be=an(T*et,d,v,S,z,j,W.segment,Me,Ae,K,Q,le,he,fe);return Be?{first:rt,last:Be}:null}function Ht(T,s,d,v){return T===o.WritingMode.horizontal&&Math.abs(d.y-s.y)>Math.abs(d.x-s.x)*v?{useVertical:!0}:(T===o.WritingMode.vertical?s.y<d.y:s.x>d.x)?{needsFlipping:!0}:null}function Wi(T,s,d,v,S,z,j,W,K,Q,le,he,fe,Re,Me,Ae){let Xe=s/24,et=T.lineOffsetX*Xe,rt=T.lineOffsetY*Xe,Be;if(T.numGlyphs>1){let ht=T.glyphStartIndex+T.numGlyphs,ot=T.lineStartIndex,wt=T.lineStartIndex+T.lineLength,Tt=ta(Xe,W,et,rt,d,le,he,T,K,z,fe,Me,Ae);if(!Tt)return{notEnoughRoom:!0};let Ft=or(Tt.first.point,j,Ae).point,gt=or(Tt.last.point,j,Ae).point;if(v&&!d){let ri=Ht(T.writingMode,Ft,gt,Re);if(ri)return ri}Be=[Tt.first];for(let ri=T.glyphStartIndex+1;ri<ht-1;ri++)Be.push(an(Xe*W.getoffsetX(ri),et,rt,d,le,he,T.segment,ot,wt,K,z,fe,Me,Ae));Be.push(Tt.last)}else{if(v&&!d){let ot=or(he,S,Ae).point,wt=T.lineStartIndex+T.segment+1,Tt=new o.pointGeometry(K.getx(wt),K.gety(wt)),Ft=or(Tt,S,Ae),gt=Ft.signedDistanceFromCamera>0?Ft.point:Bi(he,Tt,ot,1,S,Ae),ri=Ht(T.writingMode,ot,gt,Re);if(ri)return ri}let ht=an(Xe*W.getoffsetX(T.glyphStartIndex),et,rt,d,le,he,T.segment,T.lineStartIndex,T.lineStartIndex+T.lineLength,K,z,fe,Me,Ae);if(!ht)return{notEnoughRoom:!0};Be=[ht]}for(let ht of Be)o.addDynamicAttributes(Q,ht.point,ht.angle);return{}}function Bi(T,s,d,v,S,z){let j=or(T.add(T.sub(s)._unit()),S,z).point,W=d.sub(j);return d.add(W._mult(v/W.mag()))}function an(T,s,d,v,S,z,j,W,K,Q,le,he,fe,Re){let Me=v?T-s:T+s,Ae=Me>0?1:-1,Xe=0;v&&(Ae*=-1,Xe=Math.PI),Ae<0&&(Xe+=Math.PI);let et=Ae>0?W+j:W+j+1,rt=S,Be=S,ht=0,ot=0,wt=Math.abs(Me),Tt=[];for(;ht+ot<=wt;){if(et+=Ae,et<W||et>=K)return null;if(Be=rt,Tt.push(rt),rt=he[et],rt===void 0){let ai=new o.pointGeometry(Q.getx(et),Q.gety(et)),$i=or(ai,le,Re);if($i.signedDistanceFromCamera>0)rt=he[et]=$i.point;else{let Ui=et-Ae;rt=Bi(ht===0?z:new o.pointGeometry(Q.getx(Ui),Q.gety(Ui)),ai,Be,wt-ht+1,le,Re)}}ht+=ot,ot=Be.dist(rt)}let Ft=(wt-ht)/ot,gt=rt.sub(Be),ri=gt.mult(Ft)._add(Be);ri._add(gt._unit()._perp()._mult(d*Ae));let Xt=Xe+Math.atan2(rt.y-Be.y,rt.x-Be.x);return Tt.push(ri),{point:ri,angle:fe?Xt:0,path:Tt}}let Lo=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ji(T,s){for(let d=0;d<T;d++){let v=s.length;s.resize(v+4),s.float32.set(Lo,3*v)}}function Ro(T,s,d){let v=s[0],S=s[1];
801return T[0]=d[0]*v+d[4]*S+d[12],T[1]=d[1]*v+d[5]*S+d[13],T[3]=d[3]*v+d[7]*S+d[15],T}let vn=100;class xt{constructor(s,d=new Kt(s.width+200,s.height+200,25),v=new Kt(s.width+200,s.height+200,25)){this.transform=s,this.grid=d,this.ignoredGrid=v,this.pitchfactor=Math.cos(s._pitch)*s.cameraToCenterDistance,this.screenRightBoundary=s.width+vn,this.screenBottomBoundary=s.height+vn,this.gridRightBoundary=s.width+200,this.gridBottomBoundary=s.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(s,d,v,S,z,j){let W=this.projectAndGetPerspectiveRatio(S,s.anchorPointX,s.anchorPointY,j),K=v*W.perspectiveRatio,Q=s.x1*K+W.point.x,le=s.y1*K+W.point.y,he=s.x2*K+W.point.x,fe=s.y2*K+W.point.y;return!this.isInsideGrid(Q,le,he,fe)||d!=="always"&&this.grid.hitTest(Q,le,he,fe,d,z)||W.perspectiveRatio<this.perspectiveRatioCutoff?{box:[],offscreen:!1}:{box:[Q,le,he,fe],offscreen:this.isOffscreen(Q,le,he,fe)}}placeCollisionCircles(s,d,v,S,z,j,W,K,Q,le,he,fe,Re,Me){let Ae=[],Xe=new o.pointGeometry(d.anchorX,d.anchorY),et=or(Xe,j,Me),rt=Bn(this.transform.cameraToCenterDistance,et.signedDistanceFromCamera),Be=(le?z/rt:z*rt)/o.ONE_EM,ht=or(Xe,W,Me).point,ot=ta(Be,S,d.lineOffsetX*Be,d.lineOffsetY*Be,!1,ht,Xe,d,v,W,{},!1,Me),wt=!1,Tt=!1,Ft=!0;if(ot){let gt=.5*fe*rt+Re,ri=new o.pointGeometry(-100,-100),Xt=new o.pointGeometry(this.screenRightBoundary,this.screenBottomBoundary),ai=new Na,$i=ot.first,Ui=ot.last,yi=[];for(let cr=$i.path.length-1;cr>=1;cr--)yi.push($i.path[cr]);for(let cr=1;cr<Ui.path.length;cr++)yi.push(Ui.path[cr]);let vr=2.5*gt;if(K){let cr=yi.map((ur=>or(ur,K,Me)));yi=cr.some((ur=>ur.signedDistanceFromCamera<=0))?[]:cr.map((ur=>ur.point))}let tr=[];if(yi.length>0){let cr=yi[0].clone(),ur=yi[0].clone();for(let mr=1;mr<yi.length;mr++)cr.x=Math.min(cr.x,yi[mr].x),cr.y=Math.min(cr.y,yi[mr].y),ur.x=Math.max(ur.x,yi[mr].x),ur.y=Math.max(ur.y,yi[mr].y);tr=cr.x>=ri.x&&ur.x<=Xt.x&&cr.y>=ri.y&&ur.y<=Xt.y?[yi]:ur.x<ri.x||cr.x>Xt.x||ur.y<ri.y||cr.y>Xt.y?[]:o.clipLine([yi],ri.x,ri.y,Xt.x,Xt.y)}for(let cr of tr){ai.reset(cr,.25*gt);let ur=0;ur=ai.length<=.5*gt?1:Math.ceil(ai.paddedLength/vr)+1;for(let mr=0;mr<ur;mr++){let Lr=mr/Math.max(ur-1,1),cn=ai.lerp(Lr),Co=cn.x+vn,Ha=cn.y+vn;Ae.push(Co,Ha,gt,0);let ll=Co-gt,na=Ha-gt,hn=Co+gt,Kn=Ha+gt;if(Ft=Ft&&this.isOffscreen(ll,na,hn,Kn),Tt=Tt||this.isInsideGrid(ll,na,hn,Kn),s!=="always"&&this.grid.hitTestCircle(Co,Ha,gt,s,he)&&(wt=!0,!Q))return{circles:[],offscreen:!1,collisionDetected:wt}}}}return{circles:!Q&&wt||!Tt||rt<this.perspectiveRatioCutoff?[]:Ae,offscreen:Ft,collisionDetected:wt}}queryRenderedSymbols(s){if(s.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let d=[],v=1/0,S=1/0,z=-1/0,j=-1/0;for(let le of s){let he=new o.pointGeometry(le.x+vn,le.y+vn);v=Math.min(v,he.x),S=Math.min(S,he.y),z=Math.max(z,he.x),j=Math.max(j,he.y),d.push(he)}let W=this.grid.query(v,S,z,j).concat(this.ignoredGrid.query(v,S,z,j)),K={},Q={};for(let le of W){let he=le.key;if(K[he.bucketInstanceId]===void 0&&(K[he.bucketInstanceId]={}),K[he.bucketInstanceId][he.featureIndex])continue;let fe=[new o.pointGeometry(le.x1,le.y1),new o.pointGeometry(le.x2,le.y1),new o.pointGeometry(le.x2,le.y2),new o.pointGeometry(le.x1,le.y2)];o.polygonIntersectsPolygon(d,fe)&&(K[he.bucketInstanceId][he.featureIndex]=!0,Q[he.bucketInstanceId]===void 0&&(Q[he.bucketInstanceId]=[]),Q[he.bucketInstanceId].push(he.featureIndex))}return Q}insertCollisionBox(s,d,v,S,z,j){(v?this.ignoredGrid:this.grid).insert({bucketInstanceId:S,featureIndex:z,collisionGroupID:j,overlapMode:d},s[0],s[1],s[2],s[3])}insertCollisionCircles(s,d,v,S,z,j){let W=v?this.ignoredGrid:this.grid,K={bucketInstanceId:S,featureIndex:z,collisionGroupID:j,overlapMode:d};for(let Q=0;Q<s.length;Q+=4)W.insertCircle(K,s[Q],s[Q+1],s[Q+2])}projectAndGetPerspectiveRatio(s,d,v,S){let z;return S?(z=[d,v,S(d,v),1],o.transformMat4(z,z,s)):(z=[d,v,0,1],Ro(z,z,s)),{point:new o.pointGeometry((z[0]/z[3]+1)/2*this.transform.width+vn,(-z[1]/z[3]+1)/2*this.transform.height+vn),perspectiveRatio:.5+this.transform.cameraToCenterDistance/z[3]*.5}}isOffscreen(s,d,v,S){return v<vn||s>=this.screenRightBoundary||S<vn||d>this.screenBottomBoundary}isInsideGrid(s,d,v,S){return v>=0&&s<this.gridRightBoundary&&S>=0&&d<this.gridBottomBoundary}getViewportMatrix(){let s=o.identity([]);return o.translate(s,s,[-100,-100,0]),s}}function sn(T,s,d){return s*(o.EXTENT/(T.tileSize*Math.pow(2,d-T.tileID.overscaledZ
801)))}class eo{constructor(s,d,v,S){this.opacity=s?Math.max(0,Math.min(1,s.opacity+(s.placed?d:-d))):S&&v?1:0,this.placed=v}isHidden(){return this.opacity===0&&!this.placed}}class Ai{constructor(s,d,v,S,z){this.text=new eo(s?s.text:null,d,v,z),this.icon=new eo(s?s.icon:null,d,S,z)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class On{constructor(s,d,v){this.text=s,this.icon=d,this.skipFade=v}}class ao{constructor(){this.invProjMatrix=o.create(),this.viewportMatrix=o.create(),this.circles=[]}}class Xs{constructor(s,d,v,S,z){this.bucketInstanceId=s,this.featureIndex=d,this.sourceLayerIndex=v,this.bucketIndex=S,this.tileID=z}}class Ks{constructor(s){this.crossSourceCollisions=s,this.maxGroupID=0,this.collisionGroups={}}get(s){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[s]){let d=++this.maxGroupID;this.collisionGroups[s]={ID:d,predicate:v=>v.collisionGroupID===d}}return this.collisionGroups[s]}}function Ql(T,s,d,v,S){let{horizontalAlign:z,verticalAlign:j}=o.getAnchorAlignment(T),W=-(z-.5)*s,K=-(j-.5)*d,Q=o.evaluateVariableOffset(T,v);return new o.pointGeometry(W+Q[0]*S,K+Q[1]*S)}function ls(T,s,d,v,S,z){let{x1:j,x2:W,y1:K,y2:Q,anchorPointX:le,anchorPointY:he}=T,fe=new o.pointGeometry(s,d);return v&&fe._rotate(S?z:-z),{x1:j+fe.x,y1:K+fe.y,x2:W+fe.x,y2:Q+fe.y,anchorPointX:le,anchorPointY:he}}class Se{constructor(s,d,v,S,z){this.transform=s.clone(),this.terrain=d,this.collisionIndex=new xt(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=v,this.retainedQueryData={},this.collisionGroups=new Ks(S),this.collisionCircleArrays={},this.prevPlacement=z,z&&(z.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(s,d,v,S){let z=v.getBucket(d),j=v.latestFeatureIndex;if(!z||!j||d.id!==z.layerIds[0])return;let W=v.collisionBoxArray,K=z.layers[0].layout,Q=Math.pow(2,this.transform.zoom-v.tileID.overscaledZ),le=v.tileSize/o.EXTENT,he=this.transform.calculatePosMatrix(v.tileID.toUnwrapped()),fe=K.get("text-pitch-alignment")==="map",Re=K.get("text-rotation-alignment")==="map",Me=sn(v,1,this.transform.zoom),Ae=Ua(he,fe,Re,this.transform,Me),Xe=null;if(fe){let rt=xa(he,fe,Re,this.transform,Me);Xe=o.multiply([],this.transform.labelPlaneMatrix,rt)}this.retainedQueryData[z.bucketInstanceId]=new Xs(z.bucketInstanceId,j,z.sourceLayerIndex,z.index,v.tileID);let et={bucket:z,layout:K,posMatrix:he,textLabelPlaneMatrix:Ae,labelToScreenMatrix:Xe,scale:Q,textPixelRatio:le,holdingForFade:v.holdingForFade(),collisionBoxArray:W,partiallyEvaluatedTextSize:o.evaluateSizeForZoom(z.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(z.sourceID)};if(S)for(let rt of z.sortKeyRanges){let{sortKey:Be,symbolInstanceStart:ht,symbolInstanceEnd:ot}=rt;s.push({sortKey:Be,symbolInstanceStart:ht,symbolInstanceEnd:ot,parameters:et})}else s.push({symbolInstanceStart:0,symbolInstanceEnd:z.symbolInstances.length,parameters:et})}attemptAnchorPlacement(s,d,v,S,z,j,W,K,Q,le,he,fe,Re,Me,Ae,Xe){let et=[fe.textOffset0,fe.textOffset1],rt=Ql(s,v,S,et,z),Be=this.collisionIndex.placeCollisionBox(ls(d,rt.x,rt.y,j,W,this.transform.angle),he,K,Q,le.predicate,Xe);if((!Ae||this.collisionIndex.placeCollisionBox(ls(Ae,rt.x,rt.y,j,W,this.transform.angle),he,K,Q,le.predicate,Xe).box.length!==0)&&Be.box.length>0){let ht;if(this.prevPlacement&&this.prevPlacement.variableOffsets[fe.crossTileID]&&this.prevPlacement.placements[fe.crossTileID]&&this.prevPlacement.placements[fe.crossTileID].text&&(ht=this.prevPlacement.variableOffsets[fe.crossTileID].anchor),fe.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[fe.crossTileID]={textOffset:et,width:v,height:S,anchor:s,textBoxScale:z,prevAnchor:ht},this.markUsedJustification(Re,s,fe,Me),Re.allowVerticalPlacement&&(this.markUsedOrientation(Re,Me,fe),this.placedOrientations[fe.crossTileID]=Me),{shift:rt,placedGlyphBoxes:Be}}}placeLayerBucketPart(s,d,v){let{bucket:S,layout:z,posMatrix:j,textLabelPlaneMatrix:W,labelToScreenMatrix:K,textPixelRatio:Q,holdingForFade:le,collisionBoxArray:he,partiallyEvaluatedTextSize:fe,collisionGroup:Re}=s.parameters,Me=z.get("text-optional"),Ae=z.get("icon-optional"),Xe=o.getOverlapMode(z,"text-overlap","text-allow-overlap"),et=Xe==="always",rt=o.getOverlapMode(z,"icon-overlap","icon-allow-overlap"),Be=rt==="always",ht=z.get("text-rotation-alignment")==="map",ot=z.get("text-pitch-alignment")==="map",wt=z.get("icon-text-fit")!=="none",Tt=z.get("symbol-z-order")==="viewport-y",Ft=et&&(Be||!S.hasIconData()||Ae),gt=Be&&(et||!S.hasTextData()||Me);!S.collisionArrays&&he&&S.deserializeCollisionBoxes(he);let ri=(Xt,ai)=>{if(d[Xt.crossTileID])return;if(le)return void(this.placements[Xt.crossTileID]=new On(!1,!1,!1));let $i=!1,Ui=!1,yi=!0,vr=null,tr={box:null,offscreen:null},cr={box:null,offscreen:null},ur=null,mr=null,Lr=null,cn=0,Co=0,Ha=0;ai.textFeatureIndex?cn=ai.textFeatureIndex:Xt.useRuntimeCollisionCircles&&(cn=Xt.featureIndex),ai.verticalTextFeatureIndex&&(Co=ai.verticalTextFeatureIndex);let ll=this.retainedQueryData[S.bucketInstanceId].tileID,na=this.terrain?(Mn,Ki)=>this.terrain.getElevation(ll,Mn,Ki):null;for(let Mn of["textBox","verticalTextBox","iconBox","verticalIconBox"]){let Ki=ai[Mn];
801Ki&&(Ki.elevation=na?na(Ki.anchorPointX,Ki.anchorPointY):0)}let hn=ai.textBox;if(hn){let Mn=_r=>{let Or=o.WritingMode.horizontal;if(S.allowVerticalPlacement&&!_r&&this.prevPlacement){let un=this.prevPlacement.placedOrientations[Xt.crossTileID];un&&(this.placedOrientations[Xt.crossTileID]=un,Or=un,this.markUsedOrientation(S,Or,Xt))}return Or},Ki=(_r,Or)=>{if(S.allowVerticalPlacement&&Xt.numVerticalGlyphVertices>0&&ai.verticalTextBox){for(let un of S.writingModes)if(un===o.WritingMode.vertical?(tr=Or(),cr=tr):tr=_r(),tr&&tr.box&&tr.box.length)break}else tr=_r()};if(z.get("text-variable-anchor")){let _r=z.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[Xt.crossTileID]){let Rr=this.prevPlacement.variableOffsets[Xt.crossTileID];_r.indexOf(Rr.anchor)>0&&(_r=_r.filter((Ma=>Ma!==Rr.anchor)),_r.unshift(Rr.anchor))}let Or=(Rr,Ma,oa)=>{let Eh=Rr.x2-Rr.x1,cl=Rr.y2-Rr.y1,Gc=Xt.textBoxScale,Mh=wt&&rt==="never"?Ma:null,fs={box:[],offscreen:!1},gs=Xe!=="never"?2*_r.length:_r.length;for(let Fs=0;Fs<gs;++Fs){let Zc=this.attemptAnchorPlacement(_r[Fs%_r.length],Rr,Eh,cl,Gc,ht,ot,Q,j,Re,Fs>=_r.length?Xe:"never",Xt,S,oa,Mh,na);if(Zc&&(fs=Zc.placedGlyphBoxes,fs&&fs.box&&fs.box.length)){$i=!0,vr=Zc.shift;break}}return fs};Ki((()=>Or(hn,ai.iconBox,o.WritingMode.horizontal)),(()=>{let Rr=ai.verticalTextBox;return S.allowVerticalPlacement&&!(tr&&tr.box&&tr.box.length)&&Xt.numVerticalGlyphVertices>0&&Rr?Or(Rr,ai.verticalIconBox,o.WritingMode.vertical):{box:null,offscreen:null}})),tr&&($i=tr.box,yi=tr.offscreen);let un=Mn(tr&&tr.box);if(!$i&&this.prevPlacement){let Rr=this.prevPlacement.variableOffsets[Xt.crossTileID];Rr&&(this.variableOffsets[Xt.crossTileID]=Rr,this.markUsedJustification(S,Rr.anchor,Xt,un))}}else{let _r=(Or,un)=>{let Rr=this.collisionIndex.placeCollisionBox(Or,Xe,Q,j,Re.predicate,na);return Rr&&Rr.box&&Rr.box.length&&(this.markUsedOrientation(S,un,Xt),this.placedOrientations[Xt.crossTileID]=un),Rr};Ki((()=>_r(hn,o.WritingMode.horizontal)),(()=>{let Or=ai.verticalTextBox;return S.allowVerticalPlacement&&Xt.numVerticalGlyphVertices>0&&Or?_r(Or,o.WritingMode.vertical):{box:null,offscreen:null}})),Mn(tr&&tr.box&&tr.box.length)}}if(ur=tr,$i=ur&&ur.box&&ur.box.length>0,yi=ur&&ur.offscreen,Xt.useRuntimeCollisionCircles){let Mn=S.text.placedSymbolArray.get(Xt.centerJustifiedTextSymbolIndex),Ki=o.evaluateSizeForFeature(S.textSizeData,fe,Mn),_r=z.get("text-padding");mr=this.collisionIndex.placeCollisionCircles(Xe,Mn,S.lineVertexArray,S.glyphOffsetArray,Ki,j,W,K,v,ot,Re.predicate,Xt.collisionCircleDiameter,_r,na),mr.circles.length&&mr.collisionDetected&&!v&&o.warnOnce("Collisions detected, but collision boxes are not shown"),$i=et||mr.circles.length>0&&!mr.collisionDetected,yi=yi&&mr.offscreen}if(ai.iconFeatureIndex&&(Ha=ai.iconFeatureIndex),ai.iconBox){let Mn=Ki=>{let _r=wt&&vr?ls(Ki,vr.x,vr.y,ht,ot,this.transform.angle):Ki;return this.collisionIndex.placeCollisionBox(_r,rt,Q,j,Re.predicate,na)};cr&&cr.box&&cr.box.length&&ai.verticalIconBox?(Lr=Mn(ai.verticalIconBox),Ui=Lr.box.length>0):(Lr=Mn(ai.iconBox),Ui=Lr.box.length>0),yi=yi&&Lr.offscreen}let Kn=Me||Xt.numHorizontalGlyphVertices===0&&Xt.numVerticalGlyphVertices===0,Qt=Ae||Xt.numIconVertices===0;if(Kn||Qt?Qt?Kn||(Ui=Ui&&$i):$i=Ui&&$i:Ui=$i=Ui&&$i,$i&&ur&&ur.box&&this.collisionIndex.insertCollisionBox(ur.box,Xe,z.get("text-ignore-placement"),S.bucketInstanceId,cr&&cr.box&&Co?Co:cn,Re.ID),Ui&&Lr&&this.collisionIndex.insertCollisionBox(Lr.box,rt,z.get("icon-ignore-placement"),S.bucketInstanceId,Ha,Re.ID),mr&&($i&&this.collisionIndex.insertCollisionCircles(mr.circles,Xe,z.get("text-ignore-placement"),S.bucketInstanceId,cn,Re.ID),v)){let Mn=S.bucketInstanceId,Ki=this.collisionCircleArrays[Mn];Ki===void 0&&(Ki=this.collisionCircleArrays[Mn]=new ao);for(let _r=0;_r<mr.circles.length;_r+=4)Ki.circles.push(mr.circles[_r+0]),Ki.circles.push(mr.circles[_r+1]),Ki.circles.push(mr.circles[_r+2]),Ki.circles.push(mr.collisionDetected?1:0)}if(Xt.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(S.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[Xt.crossTileID]=new On($i||Ft,Ui||gt,yi||S.justReloaded),d[Xt.crossTileID]=!0};if(Tt){if(s.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");
801let Xt=S.getSortedSymbolIndexes(this.transform.angle);for(let ai=Xt.length-1;ai>=0;--ai){let $i=Xt[ai];ri(S.symbolInstances.get($i),S.collisionArrays[$i])}}else for(let Xt=s.symbolInstanceStart;Xt<s.symbolInstanceEnd;Xt++)ri(S.symbolInstances.get(Xt),S.collisionArrays[Xt]);if(v&&S.bucketInstanceId in this.collisionCircleArrays){let Xt=this.collisionCircleArrays[S.bucketInstanceId];o.invert(Xt.invProjMatrix,j),Xt.viewportMatrix=this.collisionIndex.getViewportMatrix()}S.justReloaded=!1}markUsedJustification(s,d,v,S){let z;z=S===o.WritingMode.vertical?v.verticalPlacedTextSymbolIndex:{left:v.leftJustifiedTextSymbolIndex,center:v.centerJustifiedTextSymbolIndex,right:v.rightJustifiedTextSymbolIndex}[o.getAnchorJustification(d)];let j=[v.leftJustifiedTextSymbolIndex,v.centerJustifiedTextSymbolIndex,v.rightJustifiedTextSymbolIndex,v.verticalPlacedTextSymbolIndex];for(let W of j)W>=0&&(s.text.placedSymbolArray.get(W).crossTileID=z>=0&&W!==z?0:v.crossTileID)}markUsedOrientation(s,d,v){let S=d===o.WritingMode.horizontal||d===o.WritingMode.horizontalOnly?d:0,z=d===o.WritingMode.vertical?d:0,j=[v.leftJustifiedTextSymbolIndex,v.centerJustifiedTextSymbolIndex,v.rightJustifiedTextSymbolIndex];for(let W of j)s.text.placedSymbolArray.get(W).placedOrientation=S;v.verticalPlacedTextSymbolIndex&&(s.text.placedSymbolArray.get(v.verticalPlacedTextSymbolIndex).placedOrientation=z)}commit(s){this.commitTime=s,this.zoomAtLastRecencyCheck=this.transform.zoom;let d=this.prevPlacement,v=!1;this.prevZoomAdjustment=d?d.zoomAdjustment(this.transform.zoom):0;let S=d?d.symbolFadeChange(s):1,z=d?d.opacities:{},j=d?d.variableOffsets:{},W=d?d.placedOrientations:{};for(let K in this.placements){let Q=this.placements[K],le=z[K];le?(this.opacities[K]=new Ai(le,S,Q.text,Q.icon),v=v||Q.text!==le.text.placed||Q.icon!==le.icon.placed):(this.opacities[K]=new Ai(null,S,Q.text,Q.icon,Q.skipFade),v=v||Q.text||Q.icon)}for(let K in z){let Q=z[K];if(!this.opacities[K]){let le=new Ai(Q,S,!1,!1);le.isHidden()||(this.opacities[K]=le,v=v||Q.text.placed||Q.icon.placed)}}for(let K in j)this.variableOffsets[K]||!this.opacities[K]||this.opacities[K].isHidden()||(this.variableOffsets[K]=j[K]);for(let K in W)this.placedOrientations[K]||!this.opacities[K]||this.opacities[K].isHidden()||(this.placedOrientations[K]=W[K]);if(d&&d.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");v?this.lastPlacementChangeTime=s:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=d?d.lastPlacementChangeTime:s)}updateLayerOpacities(s,d){let v={};for(let S of d){let z=S.getBucket(s);z&&S.latestFeatureIndex&&s.id===z.layerIds[0]&&this.updateBucketOpacities(z,v,S.collisionBoxArray)}}updateBucketOpacities(s,d,v){s.hasTextData()&&s.text.opacityVertexArray.clear(),s.hasIconData()&&s.icon.opacityVertexArray.clear(),s.hasIconCollisionBoxData()&&s.iconCollisionBox.collisionVertexArray.clear(),s.hasTextCollisionBoxData()&&s.textCollisionBox.collisionVertexArray.clear();let S=s.layers[0].layout,z=new Ai(null,0,!1,!1,!0),j=S.get("text-allow-overlap"),W=S.get("icon-allow-overlap"),K=S.get("text-variable-anchor"),Q=S.get("text-rotation-alignment")==="map",le=S.get("text-pitch-alignment")==="map",he=S.get("icon-text-fit")!=="none",fe=new Ai(null,0,j&&(W||!s.hasIconData()||S.get("icon-optional")),W&&(j||!s.hasTextData()||S.get("text-optional")),!0);!s.collisionArrays&&v&&(s.hasIconCollisionBoxData()||s.hasTextCollisionBoxData())&&s.deserializeCollisionBoxes(v);let Re=(Me,Ae,Xe)=>{for(let et=0;et<Ae/4;et++)Me.opacityVertexArray.emplaceBack(Xe)};for(let Me=0;Me<s.symbolInstances.length;Me++){let Ae=s.symbolInstances.get(Me),{numHorizontalGlyphVertices:Xe,numVerticalGlyphVertices:et,crossTileID:rt}=Ae,Be=this.opacities[rt];d[rt]?Be=z:Be||(Be=fe,this.opacities[rt]=Be),d[rt]=!0;let ht=Ae.numIconVertices>0,ot=this.placedOrientations[Ae.crossTileID],wt=ot===o.WritingMode.vertical,Tt=ot===o.WritingMode.horizontal||ot===o.WritingMode.horizontalOnly;if(Xe>0||et>0){let Ft=Ge(Be.text);Re(s.text,Xe,wt?pt:Ft),Re(s.text,et,Tt?pt:Ft);let gt=Be.text.isHidden();[Ae.rightJustifiedTextSymbolIndex,Ae.centerJustifiedTextSymbolIndex,Ae.leftJustifiedTextSymbolIndex].forEac
801h((ai=>{ai>=0&&(s.text.placedSymbolArray.get(ai).hidden=gt||wt?1:0)})),Ae.verticalPlacedTextSymbolIndex>=0&&(s.text.placedSymbolArray.get(Ae.verticalPlacedTextSymbolIndex).hidden=gt||Tt?1:0);let ri=this.variableOffsets[Ae.crossTileID];ri&&this.markUsedJustification(s,ri.anchor,Ae,ot);let Xt=this.placedOrientations[Ae.crossTileID];Xt&&(this.markUsedJustification(s,"left",Ae,Xt),this.markUsedOrientation(s,Xt,Ae))}if(ht){let Ft=Ge(Be.icon),gt=!(he&&Ae.verticalPlacedIconSymbolIndex&&wt);Ae.placedIconSymbolIndex>=0&&(Re(s.icon,Ae.numIconVertices,gt?Ft:pt),s.icon.placedSymbolArray.get(Ae.placedIconSymbolIndex).hidden=Be.icon.isHidden()),Ae.verticalPlacedIconSymbolIndex>=0&&(Re(s.icon,Ae.numVerticalIconVertices,gt?pt:Ft),s.icon.placedSymbolArray.get(Ae.verticalPlacedIconSymbolIndex).hidden=Be.icon.isHidden())}if(s.hasIconCollisionBoxData()||s.hasTextCollisionBoxData()){let Ft=s.collisionArrays[Me];if(Ft){let gt=new o.pointGeometry(0,0);if(Ft.textBox||Ft.verticalTextBox){let Xt=!0;if(K){let ai=this.variableOffsets[rt];ai?(gt=Ql(ai.anchor,ai.width,ai.height,ai.textOffset,ai.textBoxScale),Q&>._rotate(le?this.transform.angle:-this.transform.angle)):Xt=!1}Ft.textBox&&re(s.textCollisionBox.collisionVertexArray,Be.text.placed,!Xt||wt,gt.x,gt.y),Ft.verticalTextBox&&re(s.textCollisionBox.collisionVertexArray,Be.text.placed,!Xt||Tt,gt.x,gt.y)}let ri=!!(!Tt&&Ft.verticalIconBox);Ft.iconBox&&re(s.iconCollisionBox.collisionVertexArray,Be.icon.placed,ri,he?gt.x:0,he?gt.y:0),Ft.verticalIconBox&&re(s.iconCollisionBox.collisionVertexArray,Be.icon.placed,!ri,he?gt.x:0,he?gt.y:0)}}}if(s.sortFeatures(this.transform.angle),this.retainedQueryData[s.bucketInstanceId]&&(this.retainedQueryData[s.bucketInstanceId].featureSortOrder=s.featureSortOrder),s.hasTextData()&&s.text.opacityVertexBuffer&&s.text.opacityVertexBuffer.updateData(s.text.opacityVertexArray),s.hasIconData()&&s.icon.opacityVertexBuffer&&s.icon.opacityVertexBuffer.updateData(s.icon.opacityVertexArray),s.hasIconCollisionBoxData()&&s.iconCollisionBox.collisionVertexBuffer&&s.iconCollisionBox.collisionVertexBuffer.updateData(s.iconCollisionBox.collisionVertexArray),s.hasTextCollisionBoxData()&&s.textCollisionBox.collisionVertexBuffer&&s.textCollisionBox.collisionVertexBuffer.updateData(s.textCollisionBox.collisionVertexArray),s.text.opacityVertexArray.length!==s.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${s.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${s.text.layoutVertexArray.length}) / 4`);if(s.icon.opacityVertexArray.length!==s.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${s.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${s.icon.layoutVertexArray.length}) / 4`);if(s.bucketInstanceId in this.collisionCircleArrays){let Me=this.collisionCircleArrays[s.bucketInstanceId];s.placementInvProjMatrix=Me.invProjMatrix,s.placementViewportMatrix=Me.viewportMatrix,s.collisionCircleArray=Me.circles,delete this.collisionCircleArrays[s.bucketInstanceId]}}symbolFadeChange(s){return this.fadeDuration===0?1:(s-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(s){return Math.max(0,(this.transform.zoom-s)/1.5)}hasTransitions(s){return this.stale||s-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(s,d){let v=this.zoomAtLastRecencyCheck===d?1-this.zoomAdjustment(d):1;return this.zoomAtLastRecencyCheck=d,this.commitTime+this.fadeDuration*v>s}setStale(){this.stale=!0}}function re(T,s,d,v,S){T.emplaceBack(s?1:0,d?1:0,v||0,S||0),T.emplaceBack(s?1:0,d?1:0,v||0,S||0),T.emplaceBack(s?1:0,d?1:0,v||0,S||0),T.emplaceBack(s?1:0,d?1:0,v||0,S||0)}let te=Math.pow(2,25),xe=Math.pow(2,24),ve=Math.pow(2,17),$e=Math.pow(2,16),Ke=Math.pow(2,9),Te=Math.pow(2,8),ke=Math.pow(2,1);function Ge(T){if(T.opacity===0&&!T.placed)return 0;if(T.opacity===1&&T.placed)return 4294967295;let s=T.placed?1:0,d=Math.floor(127*T.opacity);return d*te+s*xe+d*ve+s*$e+d*Ke+s*Te+d*ke+s}let pt=0;class zt{constructor(s){this._sortAcrossTiles=s.layout.get("symbol-z-order")!=="viewport-y"&&!s.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(s,d,v,S,z){let j=this._bucketParts;for(;this._currentTileIndex<s.length;)if(d.getBucketParts(j,S,s[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,z())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,j.sort(((W,K)=>W.sortKey-K.sortKey)));this._currentPartIndex<j.length;)if(d.placeLayerBucketPart(j[this._currentPartIndex],this._seenCrossTileIDs,v),this._currentPartIndex++,z())return!0;return!1}}class dt{constructor(s,d,v,S,z,j,W,K){this.placement=new Se(s,d,j,W,K),this._currentPlacementIndex=v.length-1,this._forceFullPlacement=S,this._showCollisionBoxes=z,this._done=!1}isDone(){return this._done}continuePlacement(s,d,v){let S=o.exported.now(),z=()=>{let j=o.exported.now()-S;return!this._forceFullPlacement&&j>2};for(;this._currentPlacementIndex>=0;){let j=d[s[this._currentPlacementIndex]],W=this.placement.collisionIndex.transform.zoom;if(j.type==="symbol"&&(!j.minzoom||j.minzoom<=W)&&(!j.maxzoom||j.maxzoom>W)){if(this._inProgressLayer||(this._inProgressLayer=new zt(j)),this._inProgressLayer.continuePlacement(v[j.source],this.placement,this._showCollisionBoxes,j,z))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(s){return this.placement.commit(s),this.placement}}let Lt=512/o.EXTENT/2;class gi{constructor(s,d,v){this.tileID=s,this.indexedSymbolInstances={},this.bucketInstanceId=v;for(let S=0;S<d.length;S++){let z=d.get(S),j=z.key;this.indexedSymbolInstances[j]||(this.indexedSymbolInstances[j]=[]),this.indexedSymbolInstances[j].push({crossTileID:z.crossTileID,coord:this.getScaledCoordinates(z,s)})}}getScaledCoordinates(s,d){let v=Lt/Math.pow(2,d.canonical.z-this.tileID.canonical.z);
801return{x:Math.floor((d.canonical.x*o.EXTENT+s.anchorX)*v),y:Math.floor((d.canonical.y*o.EXTENT+s.anchorY)*v)}}findMatches(s,d,v){let S=this.tileID.canonical.z<d.canonical.z?1:Math.pow(2,this.tileID.canonical.z-d.canonical.z);for(let z=0;z<s.length;z++){let j=s.get(z);if(j.crossTileID)continue;let W=this.indexedSymbolInstances[j.key];if(!W)continue;let K=this.getScaledCoordinates(j,d);for(let Q of W)if(Math.abs(Q.coord.x-K.x)<=S&&Math.abs(Q.coord.y-K.y)<=S&&!v[Q.crossTileID]){v[Q.crossTileID]=!0,j.crossTileID=Q.crossTileID;break}}}}class ei{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class zi{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(s){let d=Math.round((s-this.lng)/360);if(d!==0)for(let v in this.indexes){let S=this.indexes[v],z={};for(let j in S){let W=S[j];W.tileID=W.tileID.unwrapTo(W.tileID.wrap+d),z[W.tileID.key]=W}this.indexes[v]=z}this.lng=s}addBucket(s,d,v){if(this.indexes[s.overscaledZ]&&this.indexes[s.overscaledZ][s.key]){if(this.indexes[s.overscaledZ][s.key].bucketInstanceId===d.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(s.overscaledZ,this.indexes[s.overscaledZ][s.key])}for(let z=0;z<d.symbolInstances.length;z++)d.symbolInstances.get(z).crossTileID=0;this.usedCrossTileIDs[s.overscaledZ]||(this.usedCrossTileIDs[s.overscaledZ]={});let S=this.usedCrossTileIDs[s.overscaledZ];for(let z in this.indexes){let j=this.indexes[z];if(Number(z)>s.overscaledZ)for(let W in j){let K=j[W];K.tileID.isChildOf(s)&&K.findMatches(d.symbolInstances,s,S)}else{let W=j[s.scaledTo(Number(z)).key];W&&W.findMatches(d.symbolInstances,s,S)}}for(let z=0;z<d.symbolInstances.length;z++){let j=d.symbolInstances.get(z);j.crossTileID||(j.crossTileID=v.generate(),S[j.crossTileID]=!0)}return this.indexes[s.overscaledZ]===void 0&&(this.indexes[s.overscaledZ]={}),this.indexes[s.overscaledZ][s.key]=new gi(s,d.symbolInstances,d.bucketInstanceId),!0}removeBucketCrossTileIDs(s,d){for(let v in d.indexedSymbolInstances)for(let S of d.indexedSymbolInstances[v])delete this.usedCrossTileIDs[s][S.crossTileID]}removeStaleBuckets(s){let d=!1;for(let v in this.indexes){let S=this.indexes[v];for(let z in S)s[S[z].bucketInstanceId]||(this.removeBucketCrossTileIDs(v,S[z]),delete S[z],d=!0)}return d}}class Ri{constructor(){this.layerIndexes={},this.crossTileIDs=new ei,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(s,d,v){let S=this.layerIndexes[s.id];S===void 0&&(S=this.layerIndexes[s.id]=new zi);let z=!1,j={};S.handleWrapJump(v);for(let W of d){let K=W.getBucket(s);K&&s.id===K.layerIds[0]&&(K.bucketInstanceId||(K.bucketInstanceId=++this.maxBucketInstanceId),S.addBucket(W.tileID,K,this.crossTileIDs)&&(z=!0),j[K.bucketInstanceId]=!0)}return S.removeStaleBuckets(j)&&(z=!0),z}pruneUnusedLayers(s){let d={};s.forEach((v=>{d[v]=!0}));for(let v in this.layerIndexes)d[v]||delete this.layerIndexes[v]}}var rr=o.createLayout([{name:"a_pos",type:"Int16",components:2}]);class Vi extends o.Evented{constructor(s){super(),this.sourceCache=s,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.renderHistory=[],this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,this.renderHistorySize=s._cache.max,s.usedForTerrain=!0,s.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null;for(let s in this._tiles){let d=this._tiles[s];d.textures.forEach((v=>v.destroy())),d.textures=[]}}update(s,d){this.sourceCache.update(s,d),this._renderableTilesKeys=[];for(let v of s.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:d}))this._renderableTilesKeys.push(v.key),this._tiles[v.key]||(v.posMatrix=new Float64Array(16),o.ortho(v.posMatrix,0,o.EXTENT,0,o.EXTENT,0,1),this._tiles[v.key]=new zo(v,this.tileSize))}removeOutdated(s){let d={};this.renderHistory=this.renderHistory.filter(((v,S)=>this.renderHistory.indexOf(v)===S)).slice(0,this.renderHistorySize);for(let v of this._renderableTilesKeys)d[v]=!0;for(let v of this.renderHistory)d[v]=!0;for(let v in this._tiles)d[v]||(this._tiles[v].clearTextures(s),delete this._tiles[v])}getRenderableTiles(){return this._renderableTilesKeys.map((s=>this.getTileByID(s)))}getTileByID(s){return this._tiles[s]}getTerrainCoords(s){let d={};for(let v of this._renderableTilesKeys){let S=this._tiles[v].tileID;if(S.canonical.equals(s.canonical)){let z=s.clone();z.posMatrix=new Float64Array(16),o.ortho(z.posMatrix,0,o.EXTENT,0,o.EXTENT,0,1),d[v]=z}else if(S.canonical.isChildOf(s.canonical)){let z=s.clone();z.posMatrix=new Float64Array(16);let j=S.canonical.z-s.canonical.z,W=S.canonical.x-(S.canonical.x>>j<<j),K=S.canonical.y-(S.canonical.y>>j<<j),Q=o.EXTENT>>j;o.ortho(z.posMatrix,0,Q,0,Q,0,1),o.translate(z.posMatrix,z.posMatrix,[-W*Q,-K*Q,0]),d[v]=z}else if(s.canonical.isChildOf(S.canonical)){let z=s.clone();z.posMatrix=new Float64Array(16);let j=s.canonical.z-S.canonical.z,W=s.canonical.x-(s.canonical.x>>j<<j),K=s.canonical.y-(s.canonical.y>>j<<j),Q=o.EXTENT>>j;o.ortho(z.posMatrix,0,o.EXTENT,0,o.EXTENT,0,1),o.translate(z.posMatrix,z.posMatrix,[W*Q,K*Q,0]),o.scale(z.posMatrix,z.posMatrix,[1/2**j,1/2**j,0]),d[v]=z}}return d}getSourceTile(s,d){let v=this.sourceCache._source,S=s.overscaledZ-this.deltaZoom;if(S>v.maxzoom&&(S=v.maxzoom),S<v.minzoom)return null;this._sourceTileCache[s.key]||(this._sourceTileCache[s.key]=s.scaledTo(S).key);let z=this.sourceCache.getTileByID(this._sourceTileCache[s.key]);if((!z||!z.dem)&&d)for(;S>=v.minzoom&&(!z||!z.dem);)z=this.sourceCache.getTileByID(s.scaledTo(S--).key);return z}tilesAfterTime(s=Date.now()){return Object.values(this._tiles).filter((d=>d.timeLoaded>=s))}}class Hi{constructor(s,d,v){this.style=s,this.sourceCache=new Vi(d),this.options=v,this.exaggeration=typeof v.exaggeration=="number"?v.exaggeration:1,this.elevationOffset=typeof v.elevationOffset=="number"?v.elevationOffset:450,this.qual
801ityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024,this.clearRerenderCache()}getDEMElevation(s,d,v,S=o.EXTENT){if(!(d>=0&&d<S&&v>=0&&v<S))return this.elevationOffset;let z=0,j=this.getTerrainData(s);if(j.tile&&j.tile.dem){let W=o.transformMat4$1([],[d/S*o.EXTENT,v/S*o.EXTENT],j.u_terrain_matrix),K=[W[0]*j.tile.dem.dim,W[1]*j.tile.dem.dim],Q=[Math.floor(K[0]),Math.floor(K[1])],le=j.tile.dem.get(Q[0],Q[1]),he=j.tile.dem.get(Q[0],Q[1]+1),fe=j.tile.dem.get(Q[0]+1,Q[1]),Re=j.tile.dem.get(Q[0]+1,Q[1]+1);z=o.number(o.number(le,he,K[0]-Q[0]),o.number(fe,Re,K[0]-Q[0]),K[1]-Q[1])}return z}rememberForRerender(s,d){for(let v in this.sourceCache._tiles){let S=this.sourceCache._tiles[v];(S.tileID.equals(d)||S.tileID.isChildOf(d))&&(s===this.sourceCache.sourceCache.id&&(S.timeLoaded=Date.now()),this._rerender[s]=this._rerender[s]||{},this._rerender[s][S.tileID.key]=!0)}}needsRerender(s,d){return this._rerender[s]&&this._rerender[s][d.key]}clearRerenderCache(){this._rerender={}}getElevation(s,d,v,S=o.EXTENT){return(this.getDEMElevation(s,d,v,S)+this.elevationOffset)*this.exaggeration}getTerrainData(s){if(!this._emptyDemTexture){let S=this.style.map.painter.context,z
801=new o.RGBAImage({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new Mt(S,z,S.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new Mt(S,new o.RGBAImage({width:1,height:1}),S.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(S.gl.NEAREST,S.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=o.identity([])}let d=this.sourceCache.getSourceTile(s,!0);if(d&&d.dem&&(!d.demTexture||d.needsTerrainPrepare)){let S=this.style.map.painter.context;d.demTexture=this.style.map.painter.getTileTexture(d.dem.stride),d.demTexture?d.demTexture.update(d.dem.getPixels(),{premultiply:!1}):d.demTexture=new Mt(S,d.dem.getPixels(),S.gl.RGBA,{premultiply:!1}),d.demTexture.bind(S.gl.NEAREST,S.gl.CLAMP_TO_EDGE),d.needsTerrainPrepare=!1}let v=d&&d+d.tileID.key+s.key;if(v&&!this._demMatrixCache[v]){let S=this.sourceCache.sourceCache._source.maxzoom,z=s.canonical.z-d.tileID.canonical.z;s.overscaledZ>s.canonical.z&&(s.canonical.z>=S?z=s.canonical.z-S:o.warnOnce("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let j=s.canonical.x-(s.canonical.x>>z<<z),W=s.canonical.y-(s.canonical.y>>z<<z),K=o.fromScaling(new Float64Array(16),[1/(o.EXTENT<<z),1/(o.EXTENT<<z),0]);o.translate(K,K,[j*o.EXTENT,W*o.EXTENT,0]),this._demMatrixCache[s.key]={matrix:K,coord:s}}return{u_depth:2,u_terrain:3,u_terrain_dim:d&&d.dem&&d.dem.dim||1,u_terrain_matrix:v?this._demMatrixCache[s.key].matrix:this._emptyDemMatrix,u_terrain_unpack:d&&d.dem&&d.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_offset:this.elevationOffset,u_terrain_exaggeration:this.exaggeration,texture:(d&&d.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:d}}getRTTFramebuffer(){let s=this.style.map.painter;if(!this._rttFramebuffer){let d=this.sourceCache.tileSize*this.qualityFactor;this._rttFramebuffer=s.context.createFramebuffer(d,d,!0),this._rttFramebuffer.depthAttachment.set(s.context.createRenderbuffer(s.context.gl.DEPTH_COMPONENT16,d,d))}return this._rttFramebuffer}getFramebuffer(s){let d=this.style.map.painter,v=d.width/devicePixelRatio,S=d.height/devicePixelRatio;return!this._fbo||this._fbo.width===v&&this._fbo.height===S||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new Mt(d.context,{width:v,height:S,data:null},d.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(d.context.gl.NEAREST,d.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new Mt(d.context,{width:v,height:S,data:null},d.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(d.context.gl.NEAREST,d.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=d.context.createFramebuffer(v,S,!0),this._fbo.depthAttachment.set(d.context.createRenderbuffer(d.context.gl.DEPTH_COMPONENT16,v,S))),this._fbo.colorAttachment.set(s==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let s=this.style.map.painter.context;if(this._coordsTexture)return this._coordsTexture;let d=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let z=0,j=0;z<this._coordsTextureSize;z++)for(let W=0;W<this._coordsTextureSize;W++,j+=4)d[j+0]=255&W,d[j+1]=255&z,d[j+2]=W>>8<<4|z>>8,d[j+3]=0;let v=new o.RGBAImage({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(d.buffer)),S=new Mt(s,v,s.gl.RGBA,{premultiply:!1});return S.bind(s.gl.NEAREST,s.gl.CLAMP_TO_EDGE),this._coordsTexture=S,S}pointCoordinate(s){let d=new Uint8Array(4),v=this.style.map.painter,S=v.context,z
801=S.gl;S.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),z.readPixels(s.x,v.height/devicePixelRatio-s.y-1,1,1,z.RGBA,z.UNSIGNED_BYTE,d),S.bindFramebuffer.set(null);let j=d[0]+(d[2]>>4<<8),W=d[1]+((15&d[2])<<8),K=this.coordsIndex[255-d[3]],Q=K&&this.sourceCache.getTileByID(K);if(!Q)return null;let le=this._coordsTextureSize,he=(1<<Q.tileID.canonical.z)*le;return new o.MercatorCoordinate((Q.tileID.canonical.x*le+j)/he,(Q.tileID.canonical.y*le+W)/he,this.getElevation(Q.tileID,j,W,le))}getTerrainMesh(){if(this._mesh)return this._mesh;let s=this.style.map.painter.context,d=new o.PosArray,v=new o.TriangleIndexArray,S=this.meshSize,z=o.EXTENT/S,j=S*S;for(let W=0;W<=S;W++)for(let K=0;K<=S;K++)d.emplaceBack(K*z,W*z);for(let W=0;W<j;W+=S+1)for(let K=0;K<S;K++)v.emplaceBack(K+W,S+K+W+1,S+K+W+2),v.emplaceBack(K+W,S+K+W+2,K+W+1);return this._mesh={indexBuffer:s.createIndexBuffer(v),vertexBuffer:s.createVertexBuffer(d,rr.members),segments:o.SegmentVector.simpleSegment(0,0,d.length,v.length)},this._mesh}getMinMaxElevation(s){let d=this.getTerrainData(s).tile,v={minElevation:null,maxElevation:null};return d&&d.dem&&(v.minElevation=(d.dem.min+this.elevationOffset)*this.exaggeration,v.maxElevation=(d.dem.max+this.elevationOffset)*this.exaggeration),v}}let qi=(T,s)=>o.emitValidationErrors(T,s&&s.filter((d=>d.identifier!=="source.canvas"))),Fi=o.pick(Qi,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),bn=o.pick(Qi,["setCenter","setZoom","setBearing","setPitch"]),Sr=(function(){let T={},s=o.spec.$version;for(let d in o.spec.$root){let v=o.spec.$root[d];if(v.required){let S=null;S=d==="version"?s:v.type==="array"?[]:{},S!=null&&(T[d]=S)}}return T})();class En extends o.Evented{constructor(s,d={}){super(),this.map=s,this.dispatcher=new Ve(Hn(),this),this.imageManager=new At,this.imageManager.setEventedParent(this),this.glyphManager=new li(s._requestManager,d.localIdeographFontFamily),this.lineAtlas=new Pe(256,512),this.crossTileSymbolIndex=new Ri,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new o.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",o.getReferrer());let v=this;this._rtlTextPluginCallback=En.registerForPluginStateChange((S=>{v.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:S.pluginStatus,pluginURL:S.pluginURL},((z,j)=>{if(o.triggerPluginCompletionEvent(z),j&&j.every((W=>W)))for(let W in v.sourceCaches)v.sourceCaches[W].reload()}))})),this.on("data",(S=>{if(S.dataType!=="source"||S.sourceDataType!=="metadata")return;let z=this.sourceCaches[S.sourceId];if(!z)return;let j=z.getSource();if(j&&j.vectorLayerIds)for(let W in this._layers){let K=this._layers[W];K.source===j.id&&this._validateLayer(K)}}))}loadURL(s,d={}){this.fire(new o.Event("dataloading",{dataType:"style"}));let v=typeof d.validate!="boolean"||d.validate,S=this.map._requestManager.transformRequest(s,o.ResourceType.Style);this._request=o.getJSON(S,((z,j)=>{this._request=null,z?this.fire(new o.ErrorEvent(z)):j&&this._load(j,v)}))}loadJSON(s,d={}){this.fire(new o.Event("dataloading",{dataType:"style"})),this._request=o.exported.frame((()=>{this._request=null,this._load(s,d.validate!==!1)}))}loadEmpty(){this.fire(new o.Event("dataloading",{dataType:"style"})),this._load(Sr,!1)}_load(s,d){if(d&&qi(this,o.validateStyle(s)))return;this._loaded=!0,this.stylesheet=s;for(let S in s.sources)this.addSource(S,s.sources[S],{validate:!1});s.sprite?this._loadSprite(s.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(s.glyphs);let v=Xn(this.stylesheet.layers);this._order=v.map((S=>S.id)),this._layers={},this._serializedLayers={};for(let S of v)S=o.createStyleLayer(S),S.setEventedParent(this,{layer:{id:S.id}}),this._layers[S.id]=S,this._serializedLayers[S.id]=S.serialize();this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new ci(this.stylesheet.light),this.setTerrain(this.stylesheet.terrain),this.fire(new o.Event("data",{dataType:"style"})),this.fire(new o.Event("style.load"))}_loadSprite(s){this._spriteRequest=(function(d,v,S,z){let j,W,K,Q=S>1?"@2x":"",le=o.getJSON(v.transformRequest(v.normalizeSpriteURL(d,Q,".json"),o.ResourceType.SpriteJSON),((Re,Me)=>
801{le=null,K||(K=Re,j=Me,fe())})),he=o.getImage(v.transformRequest(v.normalizeSpriteURL(d,Q,".png"),o.ResourceType.SpriteImage),((Re,Me)=>{he=null,K||(K=Re,W=Me,fe())}));function fe(){if(K)z(K);else if(j&&W){let Re=o.exported.getImageData(W),Me={};for(let Ae in j){let{width:Xe,height:et,x:rt,y:Be,sdf:ht,pixelRatio:ot,stretchX:wt,stretchY:Tt,content:Ft}=j[Ae],gt=new o.RGBAImage({width:Xe,height:et});o.RGBAImage.copy(Re,gt,{x:rt,y:Be},{x:0,y:0},{width:Xe,height:et}),Me[Ae]={data:gt,pixelRatio:ot,sdf:ht,stretchX:wt,stretchY:Tt,content:Ft}}z(null,Me)}}return{cancel(){le&&(le.cancel(),le=null),he&&(he.cancel(),he=null)}}})(s,this.map._requestManager,this.map.getPixelRatio(),((d,v)=>{if(this._spriteRequest=null,d)this.fire(new o.ErrorEvent(d));else if(v)for(let S in v)this.imageManager.addImage(S,v[S]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new o.Event("data",{dataType:"style"}))}))}_validateLayer(s){let d=this.sourceCaches[s.source];if(!d)return;let v=s.sourceLayer;if(!v)return;let S=d.getSource();(S.type==="geojson"||S.vectorLayerIds&&S.vectorLayerIds.indexOf(v)===-1)&&this.fire(new o.ErrorEvent(new Error(`Source layer "${v}" does not exist on source "${S.id}" as specified by style layer "${s.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let s in this.sourceCaches)if(!this.sourceCaches[s].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(s){let d=[];for(let v of s){let S=this._layers[v];S.type!=="custom"&&d.push(S.serialize())}return d}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(let s in this.sourceCaches)if(this.sourceCaches[s].hasTransition())return!0;for(let s in this._layers)if(this._layers[s].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(s){if(!this._loaded)return;let d=this._changed;if(this._changed){let S=Object.keys(this._updatedLayers),z=Object.keys(this._removedLayers);(S.length||z.length)&&this._updateWorkerLayers(S,z);for(let j in this._updatedSources){let W=this._updatedSources[j];if(W==="reload")this._reloadSource(j);else{if(W!=="clear")throw new Error(`Invalid action ${W}`);this._clearSource(j)}}this._updateTilesForChangedImages();for(let j in this._updatedPaintProps)this._layers[j].updateTransitions(s);this.light.updateTransitions(s),this._resetUpdates()}let v={};for(let S in this.sourceCaches){let z=this.sourceCaches[S];v[S]=z.used,z.used=!1}for(let S of this._order){let z=this._layers[S];z.recalculate(s,this._availableImages),!z.isHidden(s.zoom)&&z.source&&(this.sourceCaches[z.source].used=!0)}for(let S in v){let z=this.sourceCaches[S];v[S]!==z.used&&z.fire(new o.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:S}))}this.light.recalculate(s),this.z=s.zoom,d&&this.fire(new o.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){let s=Object.keys(this._changedImages);if(s.length){for(let d in this.sourceCaches)this.sourceCaches[d].reloadTilesForDependencies(["icons","patterns"],s);this._changedImages={}}}_updateWorkerLayers(s,d){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(s),removedIds:d})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setTerrain(s){if(this._checkLoaded(),this._terrainDataCallback&&this.off("data",this._terrainDataCallback),this._terrainfreezeElevationCallback&&this.map.off("freezeElevation",this._terrainfreezeElevationCallback),s){let d=this.sourceCaches[s.source];if(!d)throw new Error(`cannot load terrain, because there exists no source with ID: ${s.source}`);this.terrain=new Hi(this,d,s),this.map.transform.updateElevation(this.terrain),this._terrainfreezeElevationCallback=v=>{v.freeze?this.map.transform.freezeElevation=!0:(this.map.transform.freezeElevation=!1,this.map.transform.recalculateZoom(this.terrain))},this._terrainDataCallback=v=>{v.tile&&(v.sourceId===s.source?(this.map.transform.updateElevation(this.terrain),this.terrain.rememberForRerender(v.sourceId,v.tile.tileID)):v.source.type==="geojson"&&this.terrain.rememberForRerender(v.sourceId,v.tile.tileID))},this.on("data",this._terrainDataCallback),this.map.on("freezeElevation",this._terrainfreezeElevationCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.map.transform.updateElevation(this.terrain);this.map.fire(new o.Event("terrain",{terrain:s}))}setState(s){if(this._checkLoaded(),qi(this,o.validateStyle(s)))return!1;(s=o.clone$1(s)).layers=Xn(s.layers);let d=(function(S,z){if(!S)return[{command:Qi.setStyle,args:[z]}];let j=[];try{if(!ct(S.version,z.version))return[{command:Qi.setStyle,args:[z]}];ct(S.center,z.center)||j.push({command:Qi.setCenter,args:[z.center]}),ct(S.zoom,z.zoom)||j.push({command:Qi.setZoom,args:[z.zoom]}),ct(S.bearing,z.bearing)||j.push({command:Qi.setBearing,args:[z.bearing]}),ct(S.pitch,z.pitch)||j.push({command:Qi.setPitch,args:[z.pitch]}),ct(S.sprite,z.sprite)||j.push({command:Qi.setSprite,args:[z.sprite]}),ct(S.glyphs,z.glyphs)||j.push({command:Qi.setGlyphs,args:[z.glyphs]}),ct(S.transition,z.transition)||j.push({command:Qi.setTransition,args:[z.transition]}),ct(S.light,z.light)||j.push({command:Qi.setLight,args:[z.light]});let W={},K=[];(function(le,he,fe,Re){let Me;for(Me in he=he||{},le=le||{})Object.prototype.hasOwnProperty.call(le,Me)&&(Object.prototype.hasOwnProperty.call(he,Me)||as(Me,fe,Re));for(Me in he)Object.prototype.hasOwnProperty.call(he,Me)&&(Object.prototype.hasOwnProperty.call(le,Me)?ct(le[Me],he[Me])||(le[Me].type==="geojson"&&he[Me].type==="geojson"&&ss(le,he,Me)?fe.push({command:Qi.setGeoJSONSourceData,args:[Me,he[Me].data]}):xo(Me,he,fe,Re)):ga(Me,he,fe))})(S.sources,z.sources,K,W);let Q=[];
801S.layers&&S.layers.forEach((le=>{W[le.source]?j.push({command:Qi.removeLayer,args:[le.id]}):Q.push(le)})),j=j.concat(K),(function(le,he,fe){he=he||[];let Re=(le=le||[]).map(oo),Me=he.map(oo),Ae=le.reduce(ya,{}),Xe=he.reduce(ya,{}),et=Re.slice(),rt=Object.create(null),Be,ht,ot,wt,Tt,Ft,gt;for(Be=0,ht=0;Be<Re.length;Be++)ot=Re[Be],Object.prototype.hasOwnProperty.call(Xe,ot)?ht++:(fe.push({command:Qi.removeLayer,args:[ot]}),et.splice(et.indexOf(ot,ht),1));for(Be=0,ht=0;Be<Me.length;Be++)ot=Me[Me.length-1-Be],et[et.length-1-Be]!==ot&&(Object.prototype.hasOwnProperty.call(Ae,ot)?(fe.push({command:Qi.removeLayer,args:[ot]}),et.splice(et.lastIndexOf(ot,et.length-ht),1)):ht++,Ft=et[et.length-Be],fe.push({command:Qi.addLayer,args:[Xe[ot],Ft]}),et.splice(et.length-Be,0,ot),rt[ot]=!0);for(Be=0;Be<Me.length;Be++)if(ot=Me[Be],wt=Ae[ot],Tt=Xe[ot],!rt[ot]&&!ct(wt,Tt))if(ct(wt.source,Tt.source)&&ct(wt["source-layer"],Tt["source-layer"])&&ct(wt.type,Tt.type)){for(gt in _a(wt.layout,Tt.layout,fe,ot,null,Qi.setLayoutProperty),_a(wt.paint,Tt.paint,fe,ot,null,Qi.setPaintProperty),ct(wt.filter,Tt.filter)||fe.push({command:Qi.setFilter,args:[ot,Tt.filter]}),ct(wt.minzoom,Tt.minzoom)&&ct(wt.maxzoom,Tt.maxzoom)||fe.push({command:Qi.setLayerZoomRange,args:[ot,Tt.minzoom,Tt.maxzoom]}),wt)Object.prototype.hasOwnProperty.call(wt,gt)&>!=="layout"&>!=="paint"&>!=="filter"&>!=="metadata"&>!=="minzoom"&>!=="maxzoom"&&(gt.indexOf("paint.")===0?_a(wt[gt],Tt[gt],fe,ot,gt.slice(6),Qi.setPaintProperty):ct(wt[gt],Tt[gt])||fe.push({command:Qi.setLayerProperty,args:[ot,gt,Tt[gt]]}));for(gt in Tt)Object.prototype.hasOwnProperty.call(Tt,gt)&&!Object.prototype.hasOwnProperty.call(wt,gt)&>!=="layout"&>!=="paint"&>!=="filter"&>!=="metadata"&>!=="minzoom"&>!=="maxzoom"&&(gt.indexOf("paint.")===0?_a(wt[gt],Tt[gt],fe,ot,gt.slice(6),Qi.setPaintProperty):ct(wt[gt],Tt[gt])||fe.push({command:Qi.setLayerProperty,args:[ot,gt,Tt[gt]]}))}else fe.push({command:Qi.removeLayer,args:[ot]}),Ft=et[et.lastIndexOf(ot)+1],fe.push({command:Qi.addLayer,args:[Tt,Ft]})})(Q,z.layers,j)}catch(W){console.warn("Unable to compute style diff:",W),j=[{command:Qi.setStyle,args:[z]}]}return j})(this.serialize(),s).filter((S=>!(S.command in bn)));if(d.length===0)return!1;let v=d.filter((S=>!(S.command in Fi)));if(v.length>0)throw new Error(`Unimplemented: ${v.map((S=>S.command)).join(", ")}.`);return d.forEach((S=>{S.command!=="setTransition"&&this[S.command].apply(this,S.args)})),this.stylesheet=s,!0}addImage(s,d){if(this.getImage(s))return this.fire(new o.ErrorEvent(new Error(`An image named "${s}" already exists.`)));this.imageManager.addImage(s,d),this._afterImageUpdated(s)}updateImage(s,d){this.imageManager.updateImage(s,d)}getImage(s){return this.imageManager.getImage(s)}removeImage(s){if(!this.getImage(s))return this.fire(new o.ErrorEvent(new Error(`An image named "${s}" does not exist.`)));this.imageManager.removeImage(s),this._afterImageUpdated(s)}_afterImageUpdated(s){this._availableImages=this.imageManager.listImages(),this._changedImages[s]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new o.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(s,d,v={}){if(this._checkLoaded(),this.sourceCaches[s]!==void 0)throw new Error(`Source "${s}" already exists.`);if(!d.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(d).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(d.type)>=0&&this._validate(o.validateStyle.source,`sources.${s}`,d,null,v))return;this.map&&this.map._collectResourceTiming&&(d.collectResourceTiming=!0);let S=this.sourceCaches[s]=new Dr(s,d,this.dispatcher);S.style=this,S.setEventedParent(this,(()=>({isSourceLoaded:this.loaded(),source:S.serialize(),sourceId:s}))),S.onAdd(this.map),this._changed=!0}removeSource(s){if(this._checkLoaded(),this.sourceCaches[s]===void 0)throw new Error("There is no source with this ID");for(let v in this._layers)if(this._layers[v].source===s)return this.fire(new o.ErrorEvent(new Error(`Source "${s}" cannot be removed while layer "${v}" is using it.`)));let d=this.sourceCaches[s];delete this.sourceCaches[s],delete this._updatedSources[s],d.fire(new o.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:s})),d.setEventedParent(null),d.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(s,d){if(this._checkLoaded(),this.sourceCaches[s]===void 0)throw new Error(`There is no source with this ID=${s}`);let v=this.sourceCaches[s].getSource();if(v.type!=="geojson")throw new Error(`geojsonSource.type is ${v.type}, which is !== 'geojson`);v.setData(d),this._changed=!0}getSource(s){return this.sourceCaches[s]&&this.sourceCaches[s].getSource()}addLayer(s,d,v={}){this._checkLoaded();let S=s.id;if(this.getLayer(S))return void this.fire(new o.ErrorEvent(new Error(`Layer "${S}" already exists on this map.`)));let z;if(s.type==="custom"){if(qi(this,o.validateCustomStyleLayer(s)))return;z=o.createStyleLayer(s)}else{if(typeof s.source=="object"&&(this.addSource(S,s.source),s=o.clone$1(s),s=o.extend(s,{source:S}
801)),this._validate(o.validateStyle.layer,`layers.${S}`,s,{arrayIndex:-1},v))return;z=o.createStyleLayer(s),this._validateLayer(z),z.setEventedParent(this,{layer:{id:S}}),this._serializedLayers[z.id]=z.serialize()}let j=d?this._order.indexOf(d):this._order.length;if(d&&j===-1)this.fire(new o.ErrorEvent(new Error(`Cannot add layer "${S}" before non-existing layer "${d}".`)));else{if(this._order.splice(j,0,S),this._layerOrderChanged=!0,this._layers[S]=z,this._removedLayers[S]&&z.source&&z.type!=="custom"){let W=this._removedLayers[S];delete this._removedLayers[S],W.type!==z.type?this._updatedSources[z.source]="clear":(this._updatedSources[z.source]="reload",this.sourceCaches[z.source].pause())}this._updateLayer(z),z.onAdd&&z.onAdd(this.map)}}moveLayer(s,d){if(this._checkLoaded(),this._changed=!0,!this._layers[s])return void this.fire(new o.ErrorEvent(new Error(`The layer '${s}' does not exist in the map's style and cannot be moved.`)));if(s===d)return;let v=this._order.indexOf(s);this._order.splice(v,1);let S=d?this._order.indexOf(d):this._order.length;d&&S===-1?this.fire(new o.ErrorEvent(new Error(`Cannot move layer "${s}" before non-existing layer "${d}".`))):(this._order.splice(S,0,s),this._layerOrderChanged=!0)}removeLayer(s){this._checkLoaded();let d=this._layers[s];if(!d)return void this.fire(new o.ErrorEvent(new Error(`Cannot remove non-existing layer "${s}".`)));d.setEventedParent(null);let v=this._order.indexOf(s);this._order.splice(v,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[s]=d,delete this._layers[s],delete this._serializedLayers[s],delete this._updatedLayers[s],delete this._updatedPaintProps[s],d.onRemove&&d.onRemove(this.map)}getLayer(s){return this._layers[s]}hasLayer(s){return s in this._layers}setLayerZoomRange(s,d,v){this._checkLoaded();let S=this.getLayer(s);S?S.minzoom===d&&S.maxzoom===v||(d!=null&&(S.minzoom=d),v!=null&&(S.maxzoom=v),this._updateLayer(S)):this.fire(new o.ErrorEvent(new Error(`Cannot set the zoom range of non-existing layer "${s}".`)))}setFilter(s,d,v={}){this._checkLoaded();let S=this.getLayer(s);if(S){if(!ct(S.filter,d))return d==null?(S.filter=void 0,void this._updateLayer(S)):void(this._validate(o.validateStyle.filter,`layers.${S.id}.filter`,d,null,v)||(S.filter=o.clone$1(d),this._updateLayer(S)))}else this.fire(new o.ErrorEvent(new Error(`Cannot filter non-existing layer "${s}".`)))}getFilter(s){return o.clone$1(this.getLayer(s).filter)}setLayoutProperty(s,d,v,S={}){this._checkLoaded();let z=this.getLayer(s);z?ct(z.getLayoutProperty(d),v)||(z.setLayoutProperty(d,v,S),this._updateLayer(z)):this.fire(new o.ErrorEvent(new Error(`Cannot style non-existing layer "${s}".`)))}getLayoutProperty(s,d){let v=this.getLayer(s);if(v)return v.getLayoutProperty(d);this.fire(new o.ErrorEvent(new Error(`Cannot get style of non-existing layer "${s}".`)))}setPaintProperty(s,d,v,S={}){this._checkLoaded();let z=this.getLayer(s);z?ct(z.getPaintProperty(d),v)||(z.setPaintProperty(d,v,S)&&this._updateLayer(z),this._changed=!0,this._updatedPaintProps[s]=!0):this.fire(new o.ErrorEvent(new Error(`Cannot style non-existing layer "${s}".`)))}getPaintProperty(s,d){return this.getLayer(s).getPaintProperty(d)}setFeatureState(s,d){this._checkLoaded();let v=s.source,S=s.sourceLayer,z=this.sourceCaches[v];if(z===void 0)return void this.fire(new o.ErrorEvent(new Error(`The source '${v}' does not exist in the map's style.`)));let j=z.getSource().type;j==="geojson"&&S?this.fire(new o.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):j!=="vector"||S?(s.id===void 0&&this.fire(new o.ErrorEvent(new Error("The feature id parameter must be provided."))),z.setFeatureState(S,s.id,d)):this.fire(new o.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(s,d){this._checkLoaded();let v=s.source,S=this.sourceCaches[v];if(S===void 0)return void this.fire(new o.ErrorEvent(new Error(`The source '${v}' does not exist in the map's style.`)));let z=S.getSource().type,j=z==="vector"?s.sourceLayer:void 0;z!=="vector"||j?d&&typeof s.id!="string"&&typeof s.id!="number"?this.fire(new o.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):S.removeFeatureState(j,s.id,d):this.fire(new o.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(s){this._checkLoaded();let d=s.source,v=s.sourceLayer,S=this.sourceCaches[d];if(S!==void 0)return S.getSource().type!=="vector"||v?(s.id===void 0&&this.fire(new o.ErrorEvent(new Error("The feature id parameter must be provided."))),S.getFeatureState(v,s.id)):void this.fire(new o.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new o.ErrorEvent(new Error(`The source '${d}' does not exist in the map's style.`)))}getTransition(){return o.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){return o.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:o.mapObject(this.sourceCaches,(s=>
801s.serialize())),layers:this._serializeLayers(this._order)},(s=>s!==void 0))}_updateLayer(s){this._updatedLayers[s.id]=!0,s.source&&!this._updatedSources[s.source]&&this.sourceCaches[s.source].getSource().type!=="raster"&&(this._updatedSources[s.source]="reload",this.sourceCaches[s.source].pause()),this._changed=!0}_flattenAndSortRenderedFeatures(s){let d=j=>this._layers[j].type==="fill-extrusion",v={},S=[];for(let j=this._order.length-1;j>=0;j--){let W=this._order[j];if(d(W)){v[W]=j;for(let K of s){let Q=K[W];if(Q)for(let le of Q)S.push(le)}}}S.sort(((j,W)=>W.intersectionZ-j.intersectionZ));let z=[];for(let j=this._order.length-1;j>=0;j--){let W=this._order[j];if(d(W))for(let K=S.length-1;K>=0;K--){let Q=S[K].feature;if(v[Q.layer.id]<j)break;z.push(Q),S.pop()}else for(let K of s){let Q=K[W];if(Q)for(let le of Q)z.push(le.feature)}}return z}queryRenderedFeatures(s,d,v){d&&d.filter&&this._validate(o.validateStyle.filter,"queryRenderedFeatures.filter",d.filter,null,d);let S={};if(d&&d.layers){if(!Array.isArray(d.layers))return this.fire(new o.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(let j of d.layers){let W=this._layers[j];if(!W)return this.fire(new o.ErrorEvent(new Error(`The layer '${j}' does not exist in the map's style and cannot be queried for features.`))),[];S[W.source]=!0}}let z=[];d.availableImages=this._availableImages;for(let j in this.sourceCaches)d.layers&&!S[j]||z.push(Cn(this.sourceCaches[j],this._layers,this._serializedLayers,s,d,v));return this.placement&&z.push((function(j,W,K,Q,le,he,fe){let Re={},Me=he.queryRenderedSymbols(Q),Ae=[];for(let Xe of Object.keys(Me).map(Number))Ae.push(fe[Xe]);Ae.sort(yn);for(let Xe of Ae){let et=Xe.featureIndex.lookupSymbolFeatures(Me[Xe.bucketInstanceId],W,Xe.bucketIndex,Xe.sourceLayerIndex,le.filter,le.layers,le.availableImages,j);for(let rt in et){let Be=Re[rt]=Re[rt]||[],ht=et[rt];ht.sort(((ot,wt)=>{let Tt=Xe.featureSortOrder;if(Tt){let Ft=Tt.indexOf(ot.featureIndex);return Tt.indexOf(wt.featureIndex)-Ft}return wt.featureIndex-ot.featureIndex}));for(let ot of ht)Be.push(ot)}}for(let Xe in Re)Re[Xe].forEach((et=>{let rt=et.feature,Be=K[j[Xe].source].getFeatureState(rt.layer["source-layer"],rt.id);rt.source=rt.layer.source,rt.layer["source-layer"]&&(rt.sourceLayer=rt.layer["source-layer"]),rt.state=Be}));return Re})(this._layers,this._serializedLayers,this.sourceCaches,s,d,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(z)}querySourceFeatures(s,d){d&&d.filter&&this._validate(o.validateStyle.filter,"querySourceFeatures.filter",d.filter,null,d);let v=this.sourceCaches[s];return v?(function(S,z){let j=S.getRenderableIds().map((Q=>S.getTileByID(Q))),W=[],K={};for(let Q=0;Q<j.length;Q++){let le=j[Q],he=le.tileID.canonical.key;K[he]||(K[he]=!0,le.querySourceFeatures(W,z))}return W})(v,d):[]}addSourceType(s,d,v){return En.getSourceType(s)?v(new Error(`A source type called "${s}" already exists.`)):(En.setSourceType(s,d),d.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:s,url:d.workerSourceURL},v):v(null,null))}getLight(){return this.light.getLight()}setLight(s,d={}){this._checkLoaded();let v=this.light.getLight(),S=!1;for(let j in s)if(!ct(s[j],v[j])){S=!0;break}if(!S)return;let z={now:o.exported.now(),transition:o.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(s,d),this.light.updateTransitions(z)}_validate(s,d,v,S,z={}){return(!z||z.validate!==!1)&&qi(this,s.call(o.validateStyle,o.extend({key:d,style:this.serialize(),value:v,styleSpec:o.spec},S)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),o.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(let s in this._layers)this._layers[s].setEventedParent(null);for(let s in this.sourceCaches){let d=this.sourceCaches[s];d.setEventedParent(null),d.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(s){this.sourceCaches[s].clearTiles()}_reloadSource(s){this.sourceCaches[s].resume(),this.sourceCaches[s].reload()}_updateSources(s){for(let d in this.sourceCaches)this.sourceCaches[d].update(s,this.terrain)}_generateCollisionBoxes(){for(let s in this.sourceCaches)this._reloadSource(s)}_updatePlacement(s,d,v,S,z=!1){let j=!1,W=!1,K={};for(let Q of this._order){let le=this._layers[Q];if(le.type!=="symbol")continue;if(!K[le.source]){let fe=this.sourceCaches[le.source];K[le.source]=fe.getRenderableIds(!0).map((Re=>fe.getTileByID(Re))).sort(((Re,Me)=>Me.tileID.overscaledZ-Re.tileID.overscaledZ||(Re.tileID.isLessThan(Me.tileID)?-1:1)))}let he=this.crossTileSymbolIndex.addLayer(le,K[le.source],s.center.lng);j=j||he}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((z=z||this._layerOrderChanged||v===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(o.exported.now(),s.zoom))&&(this.pauseablePlacement=new dt(s,this.terrain,this._order,z,d,v,S,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,K),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(o.exported.now()),W=!0),j&&this.pauseablePlacement.placement.setStale()),W||j)for(let Q of this._order){let le=this._layers[Q];le.type==="symbol"&&this.placement.updateLayerOpacities(le,K[le.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(o.exported.now())}_releaseSymbolFadeTiles(){for(let s in this.sourceCaches)this.sourceCaches[s].releaseSymbolFadeTiles()}getImages(s,d,v){this.imageManager.getImages(d.icons,v),this._updateTilesForChangedImages();let S=this.sourceCaches[d.source];S&&S.setDependencies(d.tileID.key,d.type,d.icons)}getGlyphs(s,d,v){this.glyphManager.getGlyphs(d.stacks,v)}
801getResource(s,d,v){return o.makeRequest(d,v)}}En.getSourceType=function(T){return _n[T]},En.setSourceType=function(T,s){_n[T]=s},En.registerForPluginStateChange=o.registerForPluginStateChange;var va="attribute vec2 a_pos;uniform mat4 u_matrix;varying vec2 v_texture_pos;varying float v_depth;void main() {v_texture_pos=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);v_depth=gl_Position.z/gl_Position.w;}";let vo={prelude:Ir(`#ifdef GL_ES 802precision mediump float; 803#else 804#if !defined(lowp) 805#define lowp 806#endif 807#if !defined(mediump) 808#define mediump 809#endif 810#if !defined(highp) 811#define highp 812#endif 813#endif`,`#ifdef GL_ES 814precision highp float; 815#else 816#if !defined(lowp) 817#define lowp 818#endif 819#if !defined(mediump) 820#define mediump 821#endif 822#if !defined(highp) 823#define highp 824#endif 825#endif 826vec2 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 827);}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;} 828#ifdef TERRAIN3D 829uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_offset;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; 830#endif 831const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { 832#ifdef TERRAIN3D 833highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); 834#else 835return 1.0; 836#endif 837}float calculate_visibility(vec4 pos) { 838#ifdef TERRAIN3D 839vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; 840#else 841return 1.0; 842#endif 843}float ele(vec2 pos) { 844#ifdef TERRAIN3D 845vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; 846#else 847return 0.0; 848#endif 849}float get_elevation(vec2 pos) { 850#ifdef TERRAIN3D 851vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return (elevation+u_terrain_offset)*u_terrain_exaggeration; 852#else 853return 0.0; 854#endif 855}`),background:Ir(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; 856#ifdef OVERDRAW_INSPECTOR 857gl_FragColor=vec4(1.0); 858#endif 859}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:Ir(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; 860#ifdef OVERDRAW_INSPECTOR 861gl_FragColor=vec4(1.0); 862#endif 863}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:Ir(`varying vec3 v_data;varying float v_visibility; 864#pragma mapbox: define highp vec4 color 865#pragma mapbox: define mediump float radius 866#pragma mapbox: define lowp float blur 867#pragma mapbox: define lowp float opacity 868#pragma mapbox: define highp vec4 stroke_color 869#pragma mapbox: define mediump float stroke_width 870#pragma mapbox: define lowp float stroke_opacity 871void main() { 872#pragma mapbox: initialize highp vec4 color 873#pragma mapbox: initialize mediump float radius 874#pragma mapbox: initialize lowp float blur 875#pragma mapbox: initialize lowp float opacity 876#pragma mapbox: initialize highp vec4 stroke_color 877#pragma mapbox: initialize mediump float stroke_width 878#pragma mapbox: initialize lowp float stroke_opacity 879vec2 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
879/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); 880#ifdef OVERDRAW_INSPECTOR 881gl_FragColor=vec4(1.0); 882#endif 883}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; 884#pragma mapbox: define highp vec4 color 885#pragma mapbox: define mediump float radius 886#pragma mapbox: define lowp float blur 887#pragma mapbox: define lowp float opacity 888#pragma mapbox: define highp vec4 stroke_color 889#pragma mapbox: define mediump float stroke_width 890#pragma mapbox: define lowp float stroke_opacity 891void main(void) { 892#pragma mapbox: initialize highp vec4 color 893#pragma mapbox: initialize mediump float radius 894#pragma mapbox: initialize lowp float blur 895#pragma mapbox: initialize lowp float opacity 896#pragma mapbox: initialize highp vec4 stroke_color 897#pragma mapbox: initialize mediump float stroke_width 898#pragma mapbox: initialize lowp float stroke_opacity 899vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:Ir("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:Ir(`uniform highp float u_intensity;varying vec2 v_extrude; 900#pragma mapbox: define highp float weight 901#define GAUSS_COEF 0.3989422804014327 902void main() { 903#pragma mapbox: initialize highp float weight 904float 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); 905#ifdef OVERDRAW_INSPECTOR 906gl_FragColor=vec4(1.0); 907#endif 908}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; 909#pragma mapbox: define highp float weight 910#pragma mapbox: define mediump float radius 911const highp float ZERO=1.0/255.0/16.0; 912#define GAUSS_COEF 0.3989422804014327 913void main(void) { 914#pragma mapbox: initialize highp float weight 915#pragma mapbox: initialize mediump float radius 916vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:Ir(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; 917#ifdef OVERDRAW_INSPECTOR 918gl_FragColor=vec4(0.0); 919#endif 920}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:Ir("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Ir("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:Ir("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:Ir(`#pragma mapbox: define highp vec4 color 921#pragma mapbox: define lowp float opacity 922void main() { 923#pragma mapbox: initialize highp vec4 color 924#pragma mapbox: initialize lowp float opacity 925gl_FragColor=color*opacity; 926#ifdef OVERDRAW_INSPECTOR 927gl_FragColor=vec4(1.0); 928#endif 929}`,`attribute vec2 a_pos;uniform mat4 u_matrix; 930#pragma mapbox: define highp vec4 color 931#pragma mapbox: define lowp float opacity 932void main() { 933#pragma mapbox: initialize highp vec4 color 934#pragma mapbox: initialize lowp float opacity 935gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:Ir(`varying vec2 v_pos; 936#pragma mapbox: define highp vec4 outline_color 937#pragma mapbox: define lowp float opacity 938void main() { 939#pragma mapbox: initialize highp vec4 outline_color 940#pragma mapbox: initialize lowp float opacity 941float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); 942#ifdef OVERDRAW_INSPECTOR 943gl_FragColor=vec4(1.0); 944#endif 945}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; 946#pragma mapbox: define highp vec4 outline_color 947#pragma mapbox: define lowp float opacity 948void main() { 949#pragma mapbox: initialize highp vec4 outline_color 950#pragma mapbox: initialize lowp float opacity 951gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:Ir(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; 952#pragma mapbox: define lowp float opacity 953#pragma mapbox: define lowp vec4 pattern_from 954#pragma mapbox: define lowp vec4 pattern_to 955void main() { 956#pragma mapbox: initialize lowp float opacity 957#pragma mapbox: initialize mediump vec4 pattern_from 958#pragma mapbox: initialize mediump vec4 pattern_to 959vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity; 960#ifdef OVERDRAW_INSPECTOR 961gl_FragColor=vec4(1.0); 962#endif 963}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; 964#pragma mapbox: define lowp float opacity 965#pragma mapbox: define lowp vec4 pattern_from 966#pragma mapbox: define lowp vec4 pattern_to 967#pragma mapbox: define lowp float pixel_ratio_from 968#pragma mapbox: define lowp float pixel_ratio_to 969void main() { 970#pragma mapbox: initialize lowp float opacity 971#pragma mapbox: initialize mediump vec4 pattern_from 972#pragma mapbox: initialize mediump vec4 pattern_to 973#pragma mapbox: initialize lowp float pixel_ratio_from 974#pragma mapbox: initialize lowp float pixel_ratio_to 975vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:Ir(`#ifdef GL_ES 976precision highp float; 977#endif 978uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; 979#pragma mapbox: define lowp float opacity 980#pragma mapbox: define lowp vec4 pattern_from 981#pragma mapbox: define lowp vec4 pattern_to 982void main() { 983#pragma mapbox: initialize lowp float opacity 984#pragma mapbox: initialize mediump vec4 pattern_from 985#pragma mapbox: initialize mediump vec4 pattern_to 986vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity; 987#ifdef OVERDRAW_INSPECTOR 988gl_FragColor=vec4(1.0); 989#endif 990}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b; 991#pragma mapbox: define lowp float opacity 992#pragma mapbox: define lowp vec4 pattern_from 993#pragma mapbox: define lowp vec4 pattern_to 994#pragma mapbox: define lowp float pixel_ratio_from 995#pragma mapbox: define lowp float pixel_ratio_to 996void main() { 997#pragma mapbox: initialize lowp float opacity 998#pragma mapbox: initialize mediump vec4 pattern_from 999#pragma mapbox: initialize mediump vec4 pattern_to 1000#pragma mapbox: initialize lowp float pixel_ratio_from 1001#pragma mapbox: initialize lowp float pixel_ratio_to 1002vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:Ir(`varying vec4 v_color;void main() {gl_FragColor=v_color; 1003#ifdef OVERDRAW_INSPECTOR 1004gl_FragColor=vec4(1.0); 1005#endif 1006}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed; 1007#ifdef TERRAIN3D 1008attribute vec2 a_centroid; 1009#endif 1010varying vec4 v_color; 1011#pragma mapbox: define highp float base 1012#pragma mapbox: define highp float height 1013#pragma mapbox: define highp vec4 color 1014void main() { 1015#pragma mapbox: initialize highp float base 1016#pragma mapbox: initialize highp float height 1017#pragma mapbox: initialize highp vec4 color 1018vec3 normal=a_normal_ed.xyz; 1019#ifdef TERRAIN3D 1020float baseDelta=10.0;float ele=get_elevation(a_centroid); 1021#else 1022float baseDelta=0.0;float ele=0.0; 1023#endif 1024base=max(0.0,ele+base-baseDelta);height=max(0.0,ele+height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:Ir(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; 1025#pragma mapbox: define lowp float base 1026#pragma mapbox: define lowp float height 1027#pragma mapbox: define lowp vec4 pattern_from 1028#pragma mapbox: define lowp vec4 pattern_to 1029#pragma mapbox: define lowp float pixel_ratio_from 1030#pragma mapbox: define lowp float pixel_ratio_to 1031void main() { 1032#pragma mapbox: initialize lowp float base 1033#pragma mapbox: initialize lowp float height 1034#pragma mapbox: initialize mediump vec4 pattern_from 1035#pragma mapbox: initialize mediump vec4 pattern_to 1036#pragma mapbox: initialize lowp float pixel_ratio_from 1037#pragma mapbox: initialize lowp float pixel_ratio_to 1038vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; 1039#ifdef OVERDRAW_INSPECTOR 1040gl_FragColor=vec4(1.0); 1041#endif 1042}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u
1042_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed; 1043#ifdef TERRAIN3D 1044attribute vec2 a_centroid; 1045#endif 1046varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; 1047#pragma mapbox: define lowp float base 1048#pragma mapbox: define lowp float height 1049#pragma mapbox: define lowp vec4 pattern_from 1050#pragma mapbox: define lowp vec4 pattern_to 1051#pragma mapbox: define lowp float pixel_ratio_from 1052#pragma mapbox: define lowp float pixel_ratio_to 1053void main() { 1054#pragma mapbox: initialize lowp float base 1055#pragma mapbox: initialize lowp float height 1056#pragma mapbox: initialize mediump vec4 pattern_from 1057#pragma mapbox: initialize mediump vec4 pattern_to 1058#pragma mapbox: initialize lowp float pixel_ratio_from 1059#pragma mapbox: initialize lowp float pixel_ratio_to 1060vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to; 1061#ifdef TERRAIN3D 1062float baseDelta=10.0;float ele=get_elevation(a_centroid); 1063#else 1064float baseDelta=0.0;float ele=0.0; 1065#endif 1066base=max(0.0,ele+base-baseDelta);height=max(0.0,ele+height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 1067? a_pos 1068: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:Ir(`#ifdef GL_ES 1069precision highp float; 1070#endif 1071uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); 1072#ifdef OVERDRAW_INSPECTOR 1073gl_FragColor=vec4(1.0); 1074#endif 1075}`,"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:Ir(`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; 1076#define PI 3.141592653589793 1077void 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;
1077float 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; 1078#ifdef OVERDRAW_INSPECTOR 1079gl_FragColor=vec4(1.0); 1080#endif 1081}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:Ir(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; 1082#pragma mapbox: define highp vec4 color 1083#pragma mapbox: define lowp float blur 1084#pragma mapbox: define lowp float opacity 1085void main() { 1086#pragma mapbox: initialize highp vec4 color 1087#pragma mapbox: initialize lowp float blur 1088#pragma mapbox: initialize lowp float opacity 1089float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity); 1090#ifdef OVERDRAW_INSPECTOR 1091gl_FragColor=vec4(1.0); 1092#endif 1093}`,` 1094#define scale 0.015873016 1095attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; 1096#pragma mapbox: define highp vec4 color 1097#pragma mapbox: define lowp float blur 1098#pragma mapbox: define lowp float opacity 1099#pragma mapbox: define mediump float gapwidth 1100#pragma mapbox: define lowp float offset 1101#pragma mapbox: define mediump float width 1102void main() { 1103#pragma mapbox: initialize highp vec4 color 1104#pragma mapbox: initialize lowp float blur 1105#pragma mapbox: initialize lowp float opacity 1106#pragma mapbox: initialize mediump float gapwidth 1107#pragma mapbox: initialize lowp float offset 1108#pragma mapbox: initialize mediump float width 1109float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; 1110#ifdef TERRAIN3D 1111v_gamma_scale=1.0; 1112#else 1113float 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; 1114#endif 1115v_width2=vec2(outset,inset);}`),lineGradient:Ir(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; 1116#pragma mapbox: define lowp float blur 1117#pragma mapbox: define lowp float opacity 1118void main() { 1119#pragma mapbox: initialize lowp float blur 1120#pragma mapbox: initialize lowp float opacity 1121float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); 1122#ifdef OVERDRAW_INSPECTOR 1123gl_FragColor=vec4(1.0); 1124#endif 1125}`,` 1126#define scale 0.015873016 1127attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; 1128#pragma mapbox: define lowp float blur 1129#pragma mapbox: define lowp float opacity 1130#pragma mapbox: define mediump float gapwidth 1131#pragma mapbox: define lowp float offset 1132#pragma mapbox: define mediump float width 1133void main() { 1134#pragma mapbox: initialize lowp float blur 1135#pragma mapbox: initialize lowp float opacity 1136#pragma mapbox: initialize mediump float gapwidth 1137#pragma mapbox: initialize lowp float offset 1138#pragma mapbox: initialize mediump float width 1139float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; 1140#ifdef TERRAIN3D 1141v_gamma_scale=1.0; 1142#else 1143float 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; 1144#endif 1145v_width2=vec2(outset,inset);}`),linePattern:Ir(`#ifdef GL_ES 1146precision highp float; 1147#endif 1148uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; 1149#pragma mapbox: define lowp vec4 pattern_from 1150#pragma mapbox: define lowp vec4 pattern_to 1151#pragma mapbox: define lowp float pixel_ratio_from 1152#pragma mapbox: define lowp float pixel_ratio_to 1153#pragma mapbox: define lowp float blur 1154#pragma mapbox: define lowp float opacity 1155void main() { 1156#pragma mapbox: initialize mediump vec4 pattern_from 1157#pragma mapbox: initialize mediump vec4 pattern_to 1158#pragma mapbox: initialize lowp float pixel_ratio_from 1159#pragma mapbox: initialize lowp float pixel_ratio_to 1160#pragma mapbox: initialize lowp float blur 1161#pragma mapbox: initialize lowp float opacity 1162vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; 1163#ifdef OVERDRAW_INSPECTOR 1164gl_FragColor=vec4(1.0); 1165#endif 1166}`,` 1167#define scale 0.015873016 1168#define LINE_DISTANCE_SCALE 2.0 1169attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; 1170#pragma mapbox: define lowp float blur 1171#pragma mapbox: define lowp float opacity 1172#pragma mapbox: define lowp float offset 1173#pragma mapbox: define mediump float gapwidth 1174#pragma mapbox: define mediump float width 1175#pragma mapbox: define lowp float floorwidth 1176#pragma mapbox: define lowp vec4 pattern_from 1177#pragma mapbox: define lowp vec4 pattern_to 1178#pragma mapbox: define lowp float pixel_ratio_from 1179#pragma mapbox: define lowp float pixel_ratio_to 1180void main() { 1181#pragma mapbox: initialize lowp float blur 1182#pragma mapbox: initialize lowp float opacity 1183#pragma mapbox: initialize lowp float offset 1184#pragma mapbox: initialize mediump float gapwidth 1185#pragma mapbox: initialize mediump float width 1186#pragma mapbox: initialize lowp float floorwidth 1187#pragma mapbox: initialize mediump vec4 pattern_from 1188#pragma mapbox: initialize mediump vec4 pattern_to 1189#pragma mapbox: initialize lowp float pixel_ratio_from 1190#pragma mapbox: initialize lowp float pixel_ratio_to 1191float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; 1192#ifdef TERRAIN3D 1193v_gamma_scale=1.0; 1194#else 1195float 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; 1196#endif 1197v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Ir(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;
1197uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; 1198#pragma mapbox: define highp vec4 color 1199#pragma mapbox: define lowp float blur 1200#pragma mapbox: define lowp float opacity 1201#pragma mapbox: define mediump float width 1202#pragma mapbox: define lowp float floorwidth 1203void main() { 1204#pragma mapbox: initialize highp vec4 color 1205#pragma mapbox: initialize lowp float blur 1206#pragma mapbox: initialize lowp float opacity 1207#pragma mapbox: initialize mediump float width 1208#pragma mapbox: initialize lowp float floorwidth 1209float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); 1210#ifdef OVERDRAW_INSPECTOR 1211gl_FragColor=vec4(1.0); 1212#endif 1213}`,` 1214#define scale 0.015873016 1215#define LINE_DISTANCE_SCALE 2.0 1216attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; 1217#pragma mapbox: define highp vec4 color 1218#pragma mapbox: define lowp float blur 1219#pragma mapbox: define lowp float opacity 1220#pragma mapbox: define mediump float gapwidth 1221#pragma mapbox: define lowp float offset 1222#pragma mapbox: define mediump float width 1223#pragma mapbox: define lowp float floorwidth 1224void main() { 1225#pragma mapbox: initialize highp vec4 color 1226#pragma mapbox: initialize lowp float blur 1227#pragma mapbox: initialize lowp float opacity 1228#pragma mapbox: initialize mediump float gapwidth 1229#pragma mapbox: initialize lowp float offset 1230#pragma mapbox: initialize mediump float width 1231#pragma mapbox: initialize lowp float floorwidth 1232float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; 1233#ifdef TERRAIN3D 1234v_gamma_scale=1.0; 1235#else 1236float 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; 1237#endif 1238v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:Ir(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); 1239#ifdef OVERDRAW_INSPECTOR 1240gl_FragColor=vec4(1.0); 1241#endif 1242}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:Ir(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; 1243#pragma mapbox: define lowp float opacity 1244void main() { 1245#pragma mapbox: initialize lowp float opacity 1246lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; 1247#ifdef OVERDRAW_INSPECTOR 1248gl_FragColor=vec4(1.0); 1249#endif 1250}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity; 1251#pragma mapbox: define lowp float opacity 1252void main() { 1253#pragma mapbox: initialize lowp float opacity 1254vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? 1255camera_to_anchor_distance/u_camera_to_center_distance : 1256u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:Ir(`#define SDF_PX 8.0 1257uniform 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; 1258#pragma mapbox: define highp vec4 fill_color 1259#pragma mapbox: define highp vec4 halo_color 1260#pragma mapbox: define lowp float opacity 1261#pragma mapbox: define lowp float halo_width 1262#pragma mapbox: define lowp float halo_blur 1263void main() { 1264#pragma mapbox: initialize highp vec4 fill_color 1265#pragma mapbox: initialize highp vec4 halo_color 1266#pragma mapbox: initialize lowp float opacity 1267#pragma mapbox: initialize lowp float halo_width 1268#pragma mapbox: initialize lowp float halo_blur 1269float 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); 1270#ifdef OVERDRAW_INSPECTOR 1271gl_FragColor=vec4(1.0); 1272#endif 1273}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1; 1274#pragma mapbox: define highp vec4 fill_color 1275#pragma mapbox: define highp vec4 halo_color 1276#pragma mapbox: define lowp float opacity 1277#pragma mapbox: define lowp float halo_width 1278#pragma mapbox: define lowp float halo_blur 1279void main() { 1280#pragma mapbox: initialize highp vec4 fill_color 1281#pragma mapbox: initialize highp vec4 halo_color 1282#pragma mapbox: initialize lowp float opacity 1283#pragma mapbox: initialize lowp float halo_width 1284#pragma mapbox: initialize lowp float halo_blur 1285vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? 1286camera_to_anchor_distance/u_camera_to_center_distance : 1287u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:Ir(`#define SDF_PX 8.0 1288#define SDF 1.0 1289#define ICON 0.0 1290uniform 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; 1291#pragma mapbox: define highp vec4 fill_color 1292#pragma mapbox: define highp vec4 halo_color 1293#pragma mapbox: define lowp float opacity 1294#pragma mapbox: define lowp float halo_width 1295#pragma mapbox: define lowp float halo_blur 1296void main() { 1297#pragma mapbox: initialize highp vec4 fill_color 1298#pragma mapbox: initialize highp vec4 halo_color 1299#pragma mapbox: initialize lowp float opacity 1300#pragma mapbox: initialize lowp float halo_width 1301#pragma mapbox: initialize lowp float halo_blur 1302float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;
1302gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; 1303#ifdef OVERDRAW_INSPECTOR 1304gl_FragColor=vec4(1.0); 1305#endif 1306return;}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); 1307#ifdef OVERDRAW_INSPECTOR 1308gl_FragColor=vec4(1.0); 1309#endif 1310}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1; 1311#pragma mapbox: define highp vec4 fill_color 1312#pragma mapbox: define highp vec4 halo_color 1313#pragma mapbox: define lowp float opacity 1314#pragma mapbox: define lowp float halo_width 1315#pragma mapbox: define lowp float halo_blur 1316void main() { 1317#pragma mapbox: initialize highp vec4 fill_color 1318#pragma mapbox: initialize highp vec4 halo_color 1319#pragma mapbox: initialize lowp float opacity 1320#pragma mapbox: initialize lowp float halo_width 1321#pragma mapbox: initialize lowp float halo_blur 1322vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? 1323camera_to_anchor_distance/u_camera_to_center_distance : 1324u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:Ir("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",va),terrainDepth:Ir("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}",va),terrainCoords:Ir("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",va)};
1324function Ir(T,s){let d=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,v=s.match(/attribute ([\w]+) ([\w]+)/g),S=T.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),z=s.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),j=z?z.concat(S):S,W={};return{fragmentSource:T=T.replace(d,((K,Q,le,he,fe)=>(W[fe]=!0,Q==="define"?` 1325#ifndef HAS_UNIFORM_u_${fe} 1326varying ${le} ${he} ${fe}; 1327#else 1328uniform ${le} ${he} u_${fe}; 1329#endif 1330`:` 1331#ifdef HAS_UNIFORM_u_${fe} 1332 ${le} ${he} ${fe} = u_${fe}; 1333#endif 1334`))),vertexSource:s=s.replace(d,((K,Q,le,he,fe)=>{let Re=he==="float"?"vec2":"vec4",Me=fe.match(/color/)?"color":Re;return W[fe]?Q==="define"?` 1335#ifndef HAS_UNIFORM_u_${fe} 1336uniform lowp float u_${fe}_t; 1337attribute ${le} ${Re} a_${fe}; 1338varying ${le} ${he} ${fe}; 1339#else 1340uniform ${le} ${he} u_${fe}; 1341#endif 1342`:Me==="vec4"?` 1343#ifndef HAS_UNIFORM_u_${fe} 1344 ${fe} = a_${fe}; 1345#else 1346 ${le} ${he} ${fe} = u_${fe}; 1347#endif 1348`:` 1349#ifndef HAS_UNIFORM_u_${fe} 1350 ${fe} = unpack_mix_${Me}(a_${fe}, u_${fe}_t); 1351#else 1352 ${le} ${he} ${fe} = u_${fe}; 1353#endif 1354`:Q==="define"?` 1355#ifndef HAS_UNIFORM_u_${fe} 1356uniform lowp float u_${fe}_t; 1357attribute ${le} ${Re} a_${fe}; 1358#else 1359uniform ${le} ${he} u_${fe}; 1360#endif 1361`:Me==="vec4"?` 1362#ifndef HAS_UNIFORM_u_${fe} 1363 ${le} ${he} ${fe} = a_${fe}; 1364#else 1365 ${le} ${he} ${fe} = u_${fe}; 1366#endif 1367`:` 1368#ifndef HAS_UNIFORM_u_${fe} 1369 ${le} ${he} ${fe} = unpack_mix_${Me}(a_${fe}, u_${fe}_t); 1370#else 1371 ${le} ${he} ${fe} = u_${fe}; 1372#endif 1373`})),staticAttributes:v,staticUniforms:j}}class Ss{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(s,d,v,S,z,j,W,K,Q){this.context=s;let le=this.boundPaintVertexBuffers.length!==S.length;for(let he=0;!le&&he<S.length;he++)this.boundPaintVertexBuffers[he]!==S[he]&&(le=!0);s.extVertexArrayObject&&this.vao&&this.boundProgram===d&&this.boundLayoutVertexBuffer===v&&!le&&this.boundIndexBuffer===z&&this.boundVertexOffset===j&&this.boundDynamicVertexBuffer===W&&this.boundDynamicVertexBuffer2===K&&this.boundDynamicVertexBuffer3===Q?(s.bindVertexArrayOES.set(this.vao),W&&W.bind(),z&&z.dynamicDraw&&z.bind(),K&&K.bind(),Q&&Q.bind()):this.freshBind(d,v,S,z,j,W,K,Q)}freshBind(s,d,v,S,z,j,W,K){let Q,le=s.numAttributes,he=this.context,fe=he.gl;if(he.extVertexArrayObject)this.vao&&this.destroy(),this.vao=he.extVertexArrayObject.createVertexArrayOES(),he.bindVertexArrayOES.set(this.vao),Q=0,this.boundProgram=s,this.boundLayoutVertexBuffer=d,this.boundPaintVertexBuffers=v,this.boundIndexBuffer=S,this.boundVertexOffset=z,this.boundDynamicVertexBuffer=j,this.boundDynamicVertexBuffer2=W,this.boundDynamicVertexBuffer3=K;else{Q=he.currentNumAttributes||0;for(let Re=le;Re<Q;Re++)fe.disableVertexAttribArray(Re)}d.enableAttributes(fe,s);for(let Re of v)Re.enableAttributes(fe,s);j&&j.enableAttributes(fe,s),W&&W.enableAttributes(fe,s),K&&K.enableAttributes(fe,s),d.bind(),d.setVertexAttribPointers(fe,s,z);for(let Re of v)Re.bind(),Re.setVertexAttribPointers(fe,s,z);j&&(j.bind(),j.setVertexAttribPointers(fe,s,z)),S&&S.bind(),W&&(W.bind(),W.setVertexAttribPointers(fe,s,z)),K&&(K.bind(),K.setVertexAttribPointers(fe,s,z)),he.currentNumAttributes=le}destroy(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)}}function ec(T){let s=[];for(let d=0;d<T.length;d++){if(T[d]===null)continue;let v=T[d].split(" ");s.push(v.pop())}return s}class Wr{constructor(s,d,v,S,z,j,W){let K=s.gl;this.program=K.createProgram();let Q=ec(v.staticAttributes),le=S?S.getBinderAttributes():[],he=Q.concat(le),fe=vo.prelude.staticUniforms?ec(vo.prelude.staticUniforms):[],Re=v.staticUniforms?ec(v.staticUniforms):[],Me=S?S.getBinderUniforms():[],Ae=fe.concat(Re).concat(Me),Xe=[];for(let Tt of Ae)Xe.indexOf(Tt)<0&&Xe.push(Tt);let et=S?S.defines():[];j&&et.push("#define OVERDRAW_INSPECTOR;"),W&&et.push("#define TERRAIN3D;");let rt=et.concat(vo.prelude.fragmentSource,v.fragmentSource).join(` 1374`),Be=et.concat(vo.prelude.vertexSource,v.vertexSource).join(` 1375`),ht=K.createShader(K.FRAGMENT_SHADER);if(K.isContextLost())return void(this.failedToCreate=!0);K.shaderSource(ht,rt),K.compileShader(ht),K.attachShader(this.program,ht);
1375let ot=K.createShader(K.VERTEX_SHADER);if(K.isContextLost())return void(this.failedToCreate=!0);K.shaderSource(ot,Be),K.compileShader(ot),K.attachShader(this.program,ot),this.attributes={};let wt={};this.numAttributes=he.length;for(let Tt=0;Tt<this.numAttributes;Tt++)he[Tt]&&(K.bindAttribLocation(this.program,Tt,he[Tt]),this.attributes[he[Tt]]=Tt);K.linkProgram(this.program),K.deleteShader(ot),K.deleteShader(ht);for(let Tt=0;Tt<Xe.length;Tt++){let Ft=Xe[Tt];if(Ft&&!wt[Ft]){let gt=K.getUniformLocation(this.program,Ft);gt&&(wt[Ft]=gt)}}this.fixedUniforms=z(s,wt),this.terrainUniforms=((Tt,Ft)=>({u_depth:new o.Uniform1i(Tt,Ft.u_depth),u_terrain:new o.Uniform1i(Tt,Ft.u_terrain),u_terrain_dim:new o.Uniform1f(Tt,Ft.u_terrain_dim),u_terrain_matrix:new o.UniformMatrix4f(Tt,Ft.u_terrain_matrix),u_terrain_unpack:new o.Uniform4f(Tt,Ft.u_terrain_unpack),u_terrain_offset:new o.Uniform1f(Tt,Ft.u_terrain_offset),u_terrain_exaggeration:new o.Uniform1f(Tt,Ft.u_terrain_exaggeration)}))(s,wt),this.binderUniforms=S?S.getUniforms(s,wt):[]}draw(s,d,v,S,z,j,W,K,Q,le,he,fe,Re,Me,Ae,Xe,et,rt){let Be=s.gl;if(this.failedToCreate)return;if(s.program.set(this.program),s.setDepthMode(v),s.setStencilMode(S),s.setColorMode(z),s.setCullFace(j),K){s.activeTexture.set(Be.TEXTURE2),Be.bindTexture(Be.TEXTURE_2D,K.depthTexture),s.activeTexture.set(Be.TEXTURE3),Be.bindTexture(Be.TEXTURE_2D,K.texture);for(let ot in this.terrainUniforms)this.terrainUniforms[ot].set(K[ot])}for(let ot in this.fixedUniforms)this.fixedUniforms[ot].set(W[ot]);Ae&&Ae.setUniforms(s,this.binderUniforms,Re,{zoom:Me});let ht=0;switch(d){case Be.LINES:ht=2;break;case Be.TRIANGLES:ht=3;break;case Be.LINE_STRIP:ht=1}for(let ot of fe.get()){let wt=ot.vaos||(ot.vaos={});(wt[Q]||(wt[Q]=new Ss)).bind(s,this,le,Ae?Ae.getPaintVertexBuffers():[],he,ot.vertexOffset,Xe,et,rt),Be.drawElements(d,ot.primitiveLength*ht,Be.UNSIGNED_SHORT,ot.primitiveOffset*ht*2)}}}function Kh(T,s,d){let v=1/sn(d,1,s.transform.tileZoom),S=Math.pow(2,d.tileID.overscaledZ),z=d.tileSize*Math.pow(2,s.transform.tileZoom)/S,j=z*(d.tileID.canonical.x+d.tileID.wrap*S),W=z*d.tileID.canonical.y;return{u_image:0,u_texsize:d.imageAtlasTexture.size,u_scale:[v,T.fromScale,T.toScale],u_fade:T.t,u_pixel_coord_upper:[j>>16,W>>16],u_pixel_coord_lower:[65535&j,65535&W]}}let sh=(T,s,d,v)=>{let S=s.style.light,z=S.properties.get("position"),j=[z.x,z.y,z.z],W=o.create$1();S.properties.get("anchor")==="viewport"&&o.fromRotation(W,-s.transform.angle),o.transformMat3(j,j,W);let K=S.properties.get("color");return{u_matrix:T,u_lightpos:j,u_lightintensity:S.properties.get("intensity"),u_lightcolor:[K.r,K.g,K.b],u_vertical_gradient:+d,u_opacity:v}},Ec=(T,s,d,v,S,z,j)=>o.extend(sh(T,s,d,v),Kh(z,s,j),{u_height_factor:-Math.pow(2,S.overscaledZ)/j.tileSize/8}),Mc=T=>({u_matrix:T}),lh=(T,s,d,v)=>o.extend(Mc(T),Kh(d,s,v)),Yh=(T,s)=>({u_matrix:T,u_world:s}),Pc=(T,s,d,v,S)=>o.extend(lh(T,s,d,v),{u_world:S}),ch=(T,s,d,v)=>{let S=T.transform,z,j;if(v.paint.get("circle-pitch-alignment")==="map"){let W=sn(d,1,S.zoom);z=!0,j=[W,W]}else z=!1,j=S.pixelsToGLUnits;return{u_camera_to_center_distance:S.cameraToCenterDistance,u_scale_with_map:+(v.paint.get("circle-pitch-scale")==="map"),u_matrix:T.translatePosMatrix(s.posMatrix,d,v.paint.get("circle-translate"),v.paint.get("circle-translate-anchor")),u_pitch_with_map:+z,u_device_pixel_ratio:T.pixelRatio,u_extrude_scale:j}},Is=(T,s,d)=>{let v=sn(d,1,s.zoom),S=Math.pow(2,s.zoom-d.tileID.overscaledZ),z=d.tileID.overscaleFactor();return{u_matrix:T,u_camera_to_center_distance:s.cameraToCenterDistance,u_pixels_to_tile_units:v,u_extrude_scale:[s.pixelsToGLUnits[0]/(v*S),s.pixelsToGLUnits[1]/(v*S)],u_overscale_factor:z}},vl=(T,s,d=1)=>({u_matrix:T,u_color:s,u_overlay:0,u_overlay_scale:d}),Ys=T=>({u_matrix:T}),hh=(T,s,d,v)=>({u_matrix:T,u_extrude_scale:sn(s,1,d),u_intensity:v});function Js(T,s){let d=Math.pow(2,s.canonical.z),v=s.canonical.y;return[new o.MercatorCoordinate(0,v/d).toLngLat().lat,new o.MercatorCoordinate(0,(v+1)/d).toLngLat().lat]}let Cs=(T,s,d,v)=>{let S=T.transform;return{u_matrix:ba(T,s,d,v),u_ratio:1/sn(s,1,S.zoom),u_device_pixel_ratio:T.pixelRatio,u_units_to_pixels:[1/S.pixelsToGLUnits[0],1/S.pixelsToGLUnits[1]]}},uh=(T,s,d,v,S)=>o.extend(Cs(T,s,d,S),{u_image:0,u_image_height:v}),Es=(T,s,d,v,S)=>{let z=T.transform,j=Mr(s,z);return{u_matrix:ba(T,s,d,S),u_texsize:s.imageAtlasTexture.size,u_ratio:1/sn(s,1,z.zoom),u_device_pixel_ratio:T.pixelRatio,u_image:0,u_scale:[j,v.fromScale,v.toScale],u_fade:v.t,u_units_to_pixels:[1/z.pixelsToGLUnits[0],1/z.pixelsToGLUnits[1]]}},bl=(T,s,d,v,S,z)=>{let j=T.lineAtlas,W=Mr(s,T.transform),K=d.layout.get("line-cap")==="round",Q=j.getDash(v.from,K),le=j.getDash(v.to,K),he=Q.width*S.fromScale,fe=le.width*S.toScale;return o.extend(Cs(T,s,d,z),{u_patternscale_a:[W/he,-Q.height/2],u_patternscale_b:[W/fe,-le.height/2],u_sdfgamma:j.width/(256*Math.min(he,fe)*T.pixelRatio)/2,u_image:0,u_tex_y_a:Q.y,u_tex_y_b:le.y,u_mi
1375x:S.t})};function Mr(T,s){return 1/sn(T,1,s.tileZoom)}function ba(T,s,d,v){return T.translatePosMatrix(v?v.posMatrix:s.tileID.posMatrix,s,d.paint.get("line-translate"),d.paint.get("line-translate-anchor"))}let wl=(T,s,d,v,S)=>{return{u_matrix:T,u_tl_parent:s,u_scale_parent:d,u_buffer_scale:1,u_fade_t:v.mix,u_opacity:v.opacity*S.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:S.paint.get("raster-brightness-min"),u_brightness_high:S.paint.get("raster-brightness-max"),u_saturation_factor:(j=S.paint.get("raster-saturation"),j>0?1-1/(1.001-j):-j),u_contrast_factor:(z=S.paint.get("raster-contrast"),z>0?1/(1-z):1+z),u_spin_weights:Yi(S.paint.get("raster-hue-rotate"))};var z,j};function Yi(T){T*=Math.PI/180;let s=Math.sin(T),d=Math.cos(T);return[(2*d+1)/3,(-Math.sqrt(3)*s-d+1)/3,(Math.sqrt(3)*s-d+1)/3]}let kc=(T,s,d,v,S,z,j,W,K,Q)=>{let le=S.transform;return{u_is_size_zoom_constant:+(T==="constant"||T==="source"),u_is_size_feature_constant:+(T==="constant"||T==="camera"),u_size_t:s?s.uSizeT:0,u_size:s?s.uSize:0,u_camera_to_center_distance:le.cameraToCenterDistance,u_pitch:le.pitch/360*2*Math.PI,u_rotate_symbol:+d,u_aspect_ratio:le.width/le.height,u_fade_change:S.options.fadeDuration?S.symbolFadeChange:1,u_matrix:z,u_label_plane_matrix:j,u_coord_matrix:W,u_is_text:+K,u_pitch_with_map:+v,u_texsize:Q,u_texture:0}},ph=(T,s,d,v,S,z,j,W,K,Q,le)=>{let he=S.transform;return o.extend(kc(T,s,d,v,S,z,j,W,K,Q),{u_gamma_scale:v?Math.cos(he._pitch)*he.cameraToCenterDistance:1,u_device_pixel_ratio:S.pixelRatio,u_is_halo:+le})},dh=(T,s,d,v,S,z,j,W,K,Q)=>o.extend(ph(T,s,d,v,S,z,j,W,!0,K,!0),{u_texsize_icon:Q,u_texture_icon:1}),Fo=(T,s,d)=>({u_matrix:T,u_opacity:s,u_color:d}),so=(T,s,d,v,S,z)=>o.extend((function(j,W,K,Q){let le=K.imageManager.getPattern(j.from.toString()),he=K.imageManager.getPattern(j.to.toString()),{width:fe,height:Re}=K.imageManager.getPixelSize(),Me=Math.pow(2,Q.tileID.overscaledZ),Ae=Q.tileSize*Math.pow(2,K.transform.tileZoom)/Me,Xe=Ae*(Q.tileID.canonical.x+Q.tileID.wrap*Me),et=Ae*Q.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:le.tl,u_pattern_br_a:le.br,u_pattern_tl_b:he.tl,u_pattern_br_b:he.br,u_texsize:[fe,Re],u_mix:W.t,u_pattern_size_a:le.displaySize,u_pattern_size_b:he.displaySize,u_scale_a:W.fromScale,u_scale_b:W.toScale,u_tile_units_to_pixels:1/sn(Q,1,K.transform.tileZoom),u_pixel_coord_upper:[Xe>>16,et>>16],u_pixel_coord_lower:[65535&Xe,65535&et]}})(v,z,d,S),{u_matrix:T,u_opacity:s}),Br={fillExtrusion:(T,s)=>({u_matrix:new o.UniformMatrix4f(T,s.u_matrix),u_lightpos:new o.Uniform3f(T,s.u_lightpos),u_lightintensity:new o.Uniform1f(T,s.u_lightintensity),u_lightcolor:new o.Uniform3f(T,s.u_lightcolor),u_vertical_gradient:new o.Uniform1f(T,s.u_vertical_gradient),u_opacity:new o.Uniform1f(T,s.u_opacity)}),fillExtrusionPattern:(T,s)=>({u_matrix:new o.UniformMatrix4f(T,s.u_matrix),u_lightpos:new o.Uniform3f(T,s.u_lightpos),u_lightintensity:new o.Uniform1f(T,s.u_lightintensity),u_lightcolor:new o.Uniform3f(T,s.u_lightcolor),u_vertical_gradient:new o.Uniform1f(T,s.u_vertical_gradient),u_height_factor:new o.Uniform1f(T,s.u_height_factor),u_image:new o.Uniform1i(T,s.u_image),u_texsize:new o.Uniform2f(T,s.u_texsize),u_pixel_coord_upper:new o.Uniform2f(T,s.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(T,s.u_pixel_coord_lower),u_scale:new o.Uniform3f(T,s.u_scale),u_fade:new o.Uniform1f(T,s.u_fade),u_opacity:new o.Uniform1f(T,s.u_opacity)}),fill:(T,s)=>({u_matrix:new o.UniformMatrix4f(T,s.u_matrix)}),fillPattern:(T,s)=>({u_matrix:new o.UniformMatrix4f(T,s.u_matrix),u_image:new o.Uniform1i(T,s.u_image),u_texsize:new o.Uniform2f(T,s.u_texsize),u_pixel_coord_upper:new o.Uniform2f(T,s.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(T,s.u_pixel_coord_lower),u_scale:new o.Uniform3f(T,s.u_scale),u_fade:new o.Uniform1f(T,s.u_fade)}),fillOutline:(T,s)=>({u_matrix:new o.UniformMatrix4f(T,s.u_matrix),u_world:new o.Uniform2f(T,s.u_world)}),fillOutlinePattern:(T,s)=>({u_matrix:new o.UniformMatrix4f(T,s.u_matrix),u_world:new o.Uniform2f(T,s.u_world),u_image:new o.Uniform1i(T,s.u_image),u_texsize:new o.Uniform2f(T,s.u_texsize),u_pixel_coord_upper:new o.Uniform2f(T,s.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(T,s.u_pixel_coord_lower),u_scale:new o.Uniform3f(T,s.u_scale),u_fade:new o.Uniform1f(T,s.u_fade)}),circle:(T,s)=>({u_camera_to_center_distance:new o.Uniform1f(T,s.u_camera_to_center_distance),u_scale_with_map:new o.Uniform1i(T,s.u_scale_with_map),u_pitch_with_map:new o.Uniform1i(T,s.u_pitch_with_map),u_extrude_scale:new o.Uniform2f(T,s.u_extrude_scale),u_device_pixel_ratio:new o.Uniform1f(T,s.u_device_pixel_ratio),u_matrix:new o.UniformMatrix4f(T,s.u_matrix)}),collisionBox:(T,s)=>({u_matrix:new o.UniformMatrix4f(T,s.u_matrix),u_camera_to_center_distance:new o.Uniform1f(T,s.u_camera_to_center_distance),u_pixels_to_tile_units:new o.Uniform1f(T,s.u_pixels_to_tile_units),u_extrude_scale:new o.Uniform2f(T,s.u_extrude_scale),u_overscale_factor:new o.Uniform1f(T,s.u_overscale_factor)}),collisionCircle:(T,s)=>({u_matrix:new o.UniformMatrix4f(T,s.u_matrix),u_inv_matrix:new o.UniformMatrix4f(T,s.u_inv_matrix
1375),u_camera_to_center_distance:new o.Uniform1f(T,s.u_camera_to_center_distance),u_viewport_size:new o.Uniform2f(T,s.u_viewport_size)}),debug:(T,s)=>({u_color:new o.UniformColor(T,s.u_color),u_matrix:new o.UniformMatrix4f(T,s.u_matrix),u_overlay:new o.Uniform1i(T,s.u_overlay),u_overlay_scale:new o.Uniform1f(T,s.u_overlay_scale)}),clippingMask:(T,s)=>({u_matrix:new o.UniformMatrix4f(T,s.u_matrix)}),heatmap:(T,s)=>({u_extrude_scale:new o.Uniform1f(T,s.u_extrude_scale),u_intensity:new o.Uniform1f(T,s.u_intensity),u_matrix:new o.UniformMatrix4f(T,s.u_matrix)}),heatmapTexture:(T,s)=>({u_matrix:new o.UniformMatrix4f(T,s.u_matrix),u_world:new o.Uniform2f(T,s.u_world),u_image:new o.Uniform1i(T,s.u_image),u_color_ramp:new o.Uniform1i(T,s.u_color_ramp),u_opacity:new o.Uniform1f(T,s.u_opacity)}),hillshade:(T,s)=>({u_matrix:new o.UniformMatrix4f(T,s.u_matrix),u_image:new o.Uniform1i(T,s.u_image),u_latrange:new o.Uniform2f(T,s.u_latrange),u_light:new o.Uniform2f(T,s.u_light),u_shadow:new o.UniformColor(T,s.u_shadow),u_highlight:new o.UniformColor(T,s.u_highlight),u_accent:new o.UniformColor(T,s.u_accent)}),hillshadePrepare:(T,s)=>({u_matrix:new o.UniformMatrix4f(T,s.u_matrix),u_image:new o.Uniform1i(T,s.u_image),u_dimension:new o.Uniform2f(T,s.u_dimension),u_zoom:new o.Uniform1f(T,s.u_zoom),u_unpack:new o.Uniform4f(T,s.u_unpack)}),line:(T,s)=>({u_matrix:new o.UniformMatrix4f(T,s.u_matrix),u_ratio:new o.Uniform1f(T,s.u_ratio),u_device_pixel_ratio:new o.Uniform1f(T,s.u_device_pixel_ratio),u_units_to_pixels:new o.Uniform2f(T,s.u_units_to_pixels)}),lineGradient:(T,s)=>({u_matrix:new o.UniformMatrix4f(T,s.u_matrix),u_ratio:new o.Uniform1f(T,s.u_ratio),u_device_pixel_ratio:new o.Uniform1f(T,s.u_device_pixel_ratio),u_units_to_pixels:new o.Uniform2f(T,s.u_units_to_pixels),u_image:new o.Uniform1i(T,s.u_image),u_image_height:new o.Uniform1f(T,s.u_image_height)}),linePattern:(T,s)=>({u_matrix:new o.UniformMatrix4f(T,s.u_matrix),u_texsize:new o.Uniform2f(T,s.u_texsize),u_ratio:new o.Uniform1f(T,s.u_ratio),u_device_pixel_ratio:new o.Uniform1f(T,s.u_device_pixel_ratio),u_image:new o.Uniform1i(T,s.u_image),u_units_to_pixels:new o.Uniform2f(T,s.u_units_to_pixels),u_scale:new o.Uniform3f(T,s.u_scale),u_fade:new o.Uniform1f(T,s.u_fade)}),lineSDF:(T,s)=>({u_matrix:new o.UniformMatrix4f(T,s.u_matrix),u_ratio:new o.Uniform1f(T,s.u_ratio),u_device_pixel_ratio:new o.Uniform1f(T,s.u_device_pixel_ratio),u_units_to_pixels:new o.Uniform2f(T,s.u_units_to_pixels),u_patternscale_a:new o.Uniform2f(T,s.u_patternscale_a),u_patternscale_b:new o.Uniform2f(T,s.u_patternscale_b),u_sdfgamma:new o.Uniform1f(T,s.u_sdfgamma),u_image:new o.Uniform1i(T,s.u_image),u_tex_y_a:new o.Uniform1f(T,s.u_tex_y_a),u_tex_y_b:new o.Uniform1f(T,s.u_tex_y_b),u_mix:new o.Uniform1f(T,s.u_mix)}),raster:(T,s)=>({u_matrix:new o.UniformMatrix4f(T,s.u_matrix),u_tl_parent:new o.Uniform2f(T,s.u_tl_parent),u_scale_parent:new o.Uniform1f(T,s.u_scale_parent),u_buffer_scale:new o.Uniform1f(T,s.u_buffer_scale),u_fade_t:new o.Uniform1f(T,s.u_fade_t),u_opacity:new o.Uniform1f(T,s.u_opacity),u_image0:new o.Uniform1i(T,s.u_image0),u_image1:new o.Uniform1i(T,s.u_image1),u_brightness_low:new o.Uniform1f(T,s.u_brightness_low),u_brightness_high:new o.Uniform1f(T,s.u_brightness_high),u_saturation_factor:new o.Uniform1f(T,s.u_saturation_factor),u_contrast_factor:new o.Uniform1f(T,s.u_contrast_factor),u_spin_weights:new o.Uniform3f(T,s.u_spin_weights)}),symbolIcon:(T,s)=>({u_is_size_zoom_constant:new o.Uniform1i(T,s.u_is_size_zoom_constant),u_is_size_feature_constant:new o.Uniform1i(T,s.u_is_size_feature_constant),u_size_t:new o.Uniform1f(T,s.u_size_t),u_size:new o.Uniform1f(T,s.u_size),u_camera_to_center_distance:new o.Uniform1f(T,s.u_camera_to_center_distance),u_pitch:new o.Uniform1f(T,s.u_pitch),u_rotate_symbol:new o.Uniform1i(T,s.u_rotate_symbol),u_aspect_ratio:new o.Uniform1f(T,s.u_aspect_ratio),u_fade_change:new o.Uniform1f(T,s.u_fade_change),u_matrix:new o.UniformMatrix4f(T,s.u_matrix),u_label_plane_matrix:new o.UniformMatrix4f(T,s.u_label_plane_matrix),u_coord_matrix:new o.UniformMatrix4f(T,s.u_coord_matrix),u_is_text:new o.Uniform1i(T,s.u_is_text),u_pitch_with_map:new o.Uniform1i(T,s.u_pitch_with_map),u_texsize:new o.Uniform2f(T,s.u_texsize),u_texture:new o.Uniform1i(T,s.u_texture)}),symbolSDF:(T,s)=>({u_is_size_zoom_constant:new o.Uniform1i(T,s.u_is_size_zoom_constant),u_is_size_feature_constant:new o.Uniform1i(T,s.u_is_size_feature_constant),u_size_t:new o.Uniform1f(T,s.u_size_t),u_size:new o.Uniform1f(T,s.u_size),u_camera_to_center_distance:new o.Uniform1f(T,s.u_camera_to_center_distance),u_pitch:new o.Uniform1f(T,s.u_pitch),u_rotate_symbol:new o.Uniform1i(T,s.u_rotate_symbol),u_aspect_ratio:new o.Uniform1f(T,s.u_aspect_ratio),u_fade_change:new o.Uniform1f(T,s.u_fade_change),u_matrix:new o.UniformMatrix4f(T,s.u_matrix),u_label_plane_matrix:new o.UniformMatrix4f(T,s.u_label_plane_matrix
1375),u_coord_matrix:new o.UniformMatrix4f(T,s.u_coord_matrix),u_is_text:new o.Uniform1i(T,s.u_is_text),u_pitch_with_map:new o.Uniform1i(T,s.u_pitch_with_map),u_texsize:new o.Uniform2f(T,s.u_texsize),u_texture:new o.Uniform1i(T,s.u_texture),u_gamma_scale:new o.Uniform1f(T,s.u_gamma_scale),u_device_pixel_ratio:new o.Uniform1f(T,s.u_device_pixel_ratio),u_is_halo:new o.Uniform1i(T,s.u_is_halo)}),symbolTextAndIcon:(T,s)=>({u_is_size_zoom_constant:new o.Uniform1i(T,s.u_is_size_zoom_constant),u_is_size_feature_constant:new o.Uniform1i(T,s.u_is_size_feature_constant),u_size_t:new o.Uniform1f(T,s.u_size_t),u_size:new o.Uniform1f(T,s.u_size),u_camera_to_center_distance:new o.Uniform1f(T,s.u_camera_to_center_distance),u_pitch:new o.Uniform1f(T,s.u_pitch),u_rotate_symbol:new o.Uniform1i(T,s.u_rotate_symbol),u_aspect_ratio:new o.Uniform1f(T,s.u_aspect_ratio),u_fade_change:new o.Uniform1f(T,s.u_fade_change),u_matrix:new o.UniformMatrix4f(T,s.u_matrix),u_label_plane_matrix:new o.UniformMatrix4f(T,s.u_label_plane_matrix),u_coord_matrix:new o.UniformMatrix4f(T,s.u_coord_matrix),u_is_text:new o.Uniform1i(T,s.u_is_text),u_pitch_with_map:new o.Uniform1i(T,s.u_pitch_with_map),u_texsize:new o.Uniform2f(T,s.u_texsize),u_texsize_icon:new o.Uniform2f(T,s.u_texsize_icon),u_texture:new o.Uniform1i(T,s.u_texture),u_texture_icon:new o.Uniform1i(T,s.u_texture_icon),u_gamma_scale:new o.Uniform1f(T,s.u_gamma_scale),u_device_pixel_ratio:new o.Uniform1f(T,s.u_device_pixel_ratio),u_is_halo:new o.Uniform1i(T,s.u_is_halo)}),background:(T,s)=>({u_matrix:new o.UniformMatrix4f(T,s.u_matrix),u_opacity:new o.Uniform1f(T,s.u_opacity),u_color:new o.UniformColor(T,s.u_color)}),backgroundPattern:(T,s)=>({u_matrix:new o.UniformMatrix4f(T,s.u_matrix),u_opacity:new o.Uniform1f(T,s.u_opacity),u_image:new o.Uniform1i(T,s.u_image),u_pattern_tl_a:new o.Uniform2f(T,s.u_pattern_tl_a),u_pattern_br_a:new o.Uniform2f(T,s.u_pattern_br_a),u_pattern_tl_b:new o.Uniform2f(T,s.u_pattern_tl_b),u_pattern_br_b:new o.Uniform2f(T,s.u_pattern_br_b),u_texsize:new o.Uniform2f(T,s.u_texsize),u_mix:new o.Uniform1f(T,s.u_mix),u_pattern_size_a:new o.Uniform2f(T,s.u_pattern_size_a),u_pattern_size_b:new o.Uniform2f(T,s.u_pattern_size_b),u_scale_a:new o.Uniform1f(T,s.u_scale_a),u_scale_b:new o.Uniform1f(T,s.u_scale_b),u_pixel_coord_upper:new o.Uniform2f(T,s.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(T,s.u_pixel_coord_lower),u_tile_units_to_pixels:new o.Uniform1f(T,s.u_tile_units_to_pixels)}),terrain:(T,s)=>({u_matrix:new o.UniformMatrix4f(T,s.u_matrix),u_texture:new o.Uniform1i(T,s.u_texture)}),terrainDepth:(T,s)=>({u_matrix:new o.UniformMatrix4f(T,s.u_matrix)}),terrainCoords:(T,s)=>({u_matrix:new o.UniformMatrix4f(T,s.u_matrix),u_texture:new o.Uniform1i(T,s.u_texture),u_terrain_coords_id:new o.Uniform1f(T,s.u_terrain_coords_id)})};class Ni{constructor(s,d,v){this.context=s;let S=s.gl;this.buffer=S.createBuffer(),this.dynamicDraw=!!v,this.context.unbindVAO(),s.bindElementBuffer.set(this.buffer),S.bufferData(S.ELEMENT_ARRAY_BUFFER,d.arrayBuffer,this.dynamicDraw?S.DYNAMIC_DRAW:S.STATIC_DRAW),this.dynamicDraw||delete d.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(s){let d=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),d.bufferSubData(d.ELEMENT_ARRAY_BUFFER,0,s.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let Cr={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class cs{constructor(s,d,v,S){this.length=d.length,this.attributes=v,this.itemSize=d.bytesPerElement,this.dynamicDraw=S,this.context=s;let z=s.gl;this.buffer=z.createBuffer(),s.bindVertexBuffer.set(this.buffer),z.bufferData(z.ARRAY_BUFFER,d.arrayBuffer,this.dynamicDraw?z.DYNAMIC_DRAW:z.STATIC_DRAW),this.dynamicDraw||delete d.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(s){if(s.length!==this.length)throw new Error(`Length of new data is ${s.length}, which doesn't match current length of ${this.length}`);let d=this.context.gl;this.bind(),d.bufferSubData(d.ARRAY_BUFFER,0,s.arrayBuffer)}
vendor: 6,819 bytes, line 1375
1375enableAttributes(s,d){for(let v=0;v<this.attributes.length;v++){let S=d.attributes[this.attributes[v].name];S!==void 0&&s.enableVertexAttribArray(S)}}setVertexAttribPointers(s,d,v){for(let S=0;S<this.attributes.length;S++){let z=this.attributes[S],j=d.attributes[z.name];j!==void 0&&s.vertexAttribPointer(j,z.components,s[Cr[z.type]],!1,this.itemSize,z.offset+this.itemSize*(v||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class Xi{constructor(s){this.gl=s.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(s){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class Bo extends Xi{getDefault(){return o.Color.transparent}set(s){let d=this.current;(s.r!==d.r||s.g!==d.g||s.b!==d.b||s.a!==d.a||this.dirty)&&(this.gl.clearColor(s.r,s.g,s.b,s.a),this.current=s,this.dirty=!1)}}class bo extends Xi{getDefault(){return 1}set(s){(s!==this.current||this.dirty)&&(this.gl.clearDepth(s),this.current=s,this.dirty=!1)}}class hs extends Xi{getDefault(){return 0}set(s){(s!==this.current||this.dirty)&&(this.gl.clearStencil(s),this.current=s,this.dirty=!1)}}class wa extends Xi{getDefault(){return[!0,!0,!0,!0]}set(s){let d=this.current;(s[0]!==d[0]||s[1]!==d[1]||s[2]!==d[2]||s[3]!==d[3]||this.dirty)&&(this.gl.colorMask(s[0],s[1],s[2],s[3]),this.current=s,this.dirty=!1)}}class en extends Xi{getDefault(){return!0}set(s){(s!==this.current||this.dirty)&&(this.gl.depthMask(s),this.current=s,this.dirty=!1)}}class Vn extends Xi{getDefault(){return 255}set(s){(s!==this.current||this.dirty)&&(this.gl.stencilMask(s),this.current=s,this.dirty=!1)}}class Ta extends Xi{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(s){let d=this.current;(s.func!==d.func||s.ref!==d.ref||s.mask!==d.mask||this.dirty)&&(this.gl.stencilFunc(s.func,s.ref,s.mask),this.current=s,this.dirty=!1)}}class Tl extends Xi{getDefault(){let s=this.gl;return[s.KEEP,s.KEEP,s.KEEP]}set(s){let d=this.current;(s[0]!==d[0]||s[1]!==d[1]||s[2]!==d[2]||this.dirty)&&(this.gl.stencilOp(s[0],s[1],s[2]),this.current=s,this.dirty=!1)}}class to extends Xi{getDefault(){return!1}set(s){if(s===this.current&&!this.dirty)return;let d=this.gl;s?d.enable(d.STENCIL_TEST):d.disable(d.STENCIL_TEST),this.current=s,this.dirty=!1}}class Ms extends Xi{getDefault(){return[0,1]}set(s){let d=this.current;(s[0]!==d[0]||s[1]!==d[1]||this.dirty)&&(this.gl.depthRange(s[0],s[1]),this.current=s,this.dirty=!1)}}class ja extends Xi{getDefault(){return!1}set(s){if(s===this.current&&!this.dirty)return;let d=this.gl;s?d.enable(d.DEPTH_TEST):d.disable(d.DEPTH_TEST),this.current=s,this.dirty=!1}}class Ac extends Xi{getDefault(){return this.gl.LESS}set(s){(s!==this.current||this.dirty)&&(this.gl.depthFunc(s),this.current=s,this.dirty=!1)}}class zc extends Xi{getDefault(){return!1}set(s){if(s===this.current&&!this.dirty)return;let d=this.gl;s?d.enable(d.BLEND):d.disable(d.BLEND),this.current=s,this.dirty=!1}}class Ps extends Xi{getDefault(){let s=this.gl;return[s.ONE,s.ZERO]}set(s){let d=this.current;(s[0]!==d[0]||s[1]!==d[1]||this.dirty)&&(this.gl.blendFunc(s[0],s[1]),this.current=s,this.dirty=!1)}}class br extends Xi{getDefault(){return o.Color.transparent}set(s){let d=this.current;(s.r!==d.r||s.g!==d.g||s.b!==d.b||s.a!==d.a||this.dirty)&&(this.gl.blendColor(s.r,s.g,s.b,s.a),this.current=s,this.dirty=!1)}}class Sl extends Xi{getDefault(){return this.gl.FUNC_ADD}set(s){(s!==this.current||this.dirty)&&(this.gl.blendEquation(s),this.current=s,this.dirty=!1)}}class ar extends Xi{getDefault(){return!1}set(s){if(s===this.current&&!this.dirty)return;let d=this.gl;s?d.enable(d.CULL_FACE):d.disable(d.CULL_FACE),this.current=s,this.dirty=!1}}class Zi extends Xi{getDefault(){return this.gl.BACK}set(s){(s!==this.current||this.dirty)&&(this.gl.cullFace(s),this.current=s,this.dirty=!1)}}class tc extends Xi{getDefault(){return this.gl.CCW}set(s){(s!==this.current||this.dirty)&&(this.gl.frontFace(s),this.current=s,this.dirty=!1)}}class hr extends Xi{getDefault(){return null}set(s){(s!==this.current||this.dirty)&&(this.gl.useProgram(s),this.current=s,this.dirty=!1)}}class qa extends Xi{getDefault(){return this.gl.TEXTURE0}set(s){(s!==this.current||this.dirty)&&(this.gl.activeTexture(s),this.current=s,this.dirty=!1)}}class ic extends Xi{getDefault(){let s=this.gl;return[0,0,s.drawingBufferWidth,s.drawingBufferHeight]}set(s){let d=this.current;(s[0]!==d[0]||s[1]!==d[1]||s[2]!==d[2]||s[3]!==d[3]||this.dirty)&&(this.gl.viewport(s[0],s[1],s[2],s[3]),this.current=s,this.dirty=!1)}}class Il extends Xi{getDefault(){return null}set(s){if(s===this.current&&!this.dirty)return;let d=this.gl;d.bindFramebuffer(d.FRAMEBUFFER,s),this.current=s,this.dirty=!1}}class rc extends Xi{getDefault(){return null}set(s){if(s===this.current&&!this.dirty)return;let d=this.gl;d.bindRenderbuffer(d.RENDERBUFFER,s),this.current=s,this.dirty=!1}}class Dc extends Xi{getDefault(){return null}set(s){if(s===this.current&&!this.dirty)return;let d=this.gl;d.bindTexture(d.TEXTURE_2D,s),this.current=s,this.dirty=!1}}class Cl extends Xi{getDefault(){return null}set(s){if(s===this.current&&!this.dirty)return;let d=this.gl;d.bindBuffer(d.ARRAY_BUFFER,s),this.current=s,this.dirty=!1}}class mh extends Xi{getDefault(){return null}set(s){let d=this.gl;d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,s),this.current=s,this.dirty=!1}}class fh extends Xi{constructor(s){super(s),this.vao=s.extVertexArrayObject}getDefault(){return null}set(s){this.vao&&(s!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(s),this.current=s,this.dirty=!1)}}class El extends Xi{getDefault(){return 4}set(s){if(s===this.current&&!this.dirty)return;let d=this.gl;d.pixelStorei(d.UNPACK_ALIGNMENT,s),this.current=s,this.dirty=!1}}class ln extends Xi{getDefault(){return!1}set(s){if(s===this.current&&!this.dirty)return;let d=this.gl;d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s),this.current=s,this.dirty=!1}}class Nn extends Xi{getDefault(){return!1}set(s){if(s===this.current&&!this.dirty)return;let d=this.gl;d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,s),this.current=s,this.dirty=!1}}class lo extends Xi{constructor(s,d){super(s),this.context=s,this.parent=d}getDefault(){return null}}class $a extends lo{setDirty(){this.dirty=!0}set(s){if(s===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let d=this.gl;d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,s,0),this.current=s,this.dirty=!1}}class nc extends lo{set(s){if(s===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let d=this.gl;d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_ATTACHMENT,d.RENDERBUFFER,s),this.current=s,this.dirty=!1}}class Hr{constructor(s,d,v,S){this.context=s,this.width=d,this.height=v;let z=s.gl,j=this.framebuffer=z.createFramebuffer();
1375if(this.colorAttachment=new $a(s,j),S&&(this.depthAttachment=new nc(s,j)),z.checkFramebufferStatus(z.FRAMEBUFFER)!==z.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){let s=this.context.gl,d=this.colorAttachment.get();if(d&&s.deleteTexture(d),this.depthAttachment){let v=this.depthAttachment.get();v&&s.deleteRenderbuffer(v)}s.deleteFramebuffer(this.framebuffer)}}class yr{constructor(s,d,v){this.blendFunction=s,this.blendColor=d,this.mask=v}}yr.Replace=[1,0],yr.disabled=new yr(yr.Replace,o.Color.transparent,[!1,!1,!1,!1]),yr.unblended=new yr(yr.Replace,o.Color.transparent,[!0,!0,!0,!0]),yr.alphaBlended=new yr([1,771],o.Color.transparent,[!0,!0,!0,!0]);class gh{constructor(s){this.gl=s,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new Bo(this),this.clearDepth=new bo(this),this.clearStencil=new hs(this),this.colorMask=new wa(this),this.depthMask=new en(this),this.stencilMask=new Vn(this),this.stencilFunc=new Ta(this),this.stencilOp=new Tl(this),this.stencilTest=new to(this),this.depthRange=new Ms(this),this.depthTest=new ja(this),this.depthFunc=new Ac(this),this.blend=new zc(this),this.blendFunc=new Ps(this),this.blendColor=new br(this),this.blendEquation=new Sl(this),this.cullFace=new ar(this),this.cullFaceSide=new Zi(this),this.frontFace=new tc(this),this.program=new hr(this),this.activeTexture=new qa(this),this.viewport=new ic(this),this.bindFramebuffer=new Il(this),this.bindRenderbuffer=new rc(this),this.bindTexture=new Dc(this),this.bindVertexBuffer=new Cl(this),this.bindElementBuffer=new mh(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new fh(this),this.pixelStoreUnpack=new El(this),this.pixelStoreUnpackPremultiplyAlpha=new ln(this),this.pixelStoreUnpackFlipY=new Nn(this),this.extTextureFilterAnisotropic=s.getExtension("EXT_texture_filter_anisotropic")||s.getExtension("MOZ_EXT_texture_filter_anisotropic")||s.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=s.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=s.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(s.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=s.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=s.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=s.getParameter(s.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(s,d){return new Ni(this,s,d)}createVertexBuffer(s,d,v){return new cs(this,s,d,v)}createRenderbuffer(s,d,v){let S=this.gl,z=S.createRenderbuffer();return this.bindRenderbuffer.set(z),S.renderbufferStorage(S.RENDERBUFFER,s,d,v),this.bindRenderbuffer.set(null),z}createFramebuffer(s,d,v){return new Hr(this,s,d,v)}clear({color:s,depth:d}){let v=this.gl,S=0;s&&(S|=v.COLOR_BUFFER_BIT,this.clearColor.set(s),this.colorMask.set([!0,!0,!0,!0])),d!==void 0&&(S|=v.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(d),this.depthMask.set(!0)),v.clear(S)}setCullFace(s){s.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(s.mode),this.frontFace.set(s.frontFace))}setDepthMode(s){s.func!==this.gl.ALWAYS||s.mask?(this.depthTest.set(!0),this.depthFunc.set(s.func),this.depthMask.set(s.mask),this.depthRange.set(s.range)):this.depthTest.set(!1)}setStencilMode(s){s.test.func!==this.gl.ALWAYS||s.mask?(this.stencilTest.set(!0),this.stencilMask.set(s.mask),this.stencilOp.set([s.fail,s.depthFail,s.pass
1375]),this.stencilFunc.set({func:s.test.func,ref:s.ref,mask:s.test.mask})):this.stencilTest.set(!1)}setColorMode(s){ct(s.blendFunction,yr.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(s.blendFunction),this.blendColor.set(s.blendColor)),this.colorMask.set(s.mask)}unbindVAO(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)}}class nr{constructor(s,d,v){this.func=s,this.mask=d,this.range=v}}nr.ReadOnly=!1,nr.ReadWrite=!0,nr.disabled=new nr(519,nr.ReadOnly,[0,1]);let gr=7680;class xr{constructor(s,d,v,S,z,j){this.test=s,this.ref=d,this.mask=v,this.fail=S,this.depthFail=z,this.pass=j}}xr.disabled=new xr({func:519,mask:0},0,0,gr,gr,gr);class zr{constructor(s,d,v){this.enable=s,this.mode=d,this.frontFace=v}}let Ml;function ks(T,s,d,v,S,z,j){let W=T.context,K=W.gl,Q=T.useProgram("collisionBox"),le=[],he=0,fe=0;for(let Be=0;Be<v.length;Be++){let ht=v[Be],ot=s.getTile(ht),wt=ot.getBucket(d);if(!wt)continue;let Tt=ht.posMatrix;S[0]===0&&S[1]===0||(Tt=T.translatePosMatrix(ht.posMatrix,ot,S,z));let Ft=j?wt.textCollisionBox:wt.iconCollisionBox,gt=wt.collisionCircleArray;if(gt.length>0){let ri=o.create(),Xt=Tt;o.mul(ri,wt.placementInvProjMatrix,T.transform.glCoordMatrix),o.mul(ri,ri,wt.placementViewportMatrix),le.push({circleArray:gt,circleOffset:fe,transform:Xt,invTransform:ri,coord:ht}),he+=gt.length/4,fe=he}Ft&&Q.draw(W,K.LINES,nr.disabled,xr.disabled,T.colorModeForRenderPass(),zr.disabled,Is(Tt,T.transform,ot),T.style.terrain&&T.style.terrain.getTerrainData(ht),d.id,Ft.layoutVertexBuffer,Ft.indexBuffer,Ft.segments,null,T.transform.zoom,null,null,Ft.collisionVertexBuffer)}if(!j||!le.length)return;let Re=T.useProgram("collisionCircle"),Me=new o.CollisionCircleLayoutArray;Me.resize(4*he),Me._trim();let Ae=0;for(let Be of le)for(let ht=0;ht<Be.circleArray.length/4;ht++){let ot=4*ht,wt=Be.circleArray[ot+0],Tt=Be.circleArray[ot+1],Ft=Be.circleArray[ot+2],gt=Be.circleArray[ot+3];Me.emplace(Ae++,wt,Tt,Ft,gt,0),Me.emplace(Ae++,wt,Tt,Ft,gt,1),Me.emplace(Ae++,wt,Tt,Ft,gt,2),Me.emplace(Ae++,wt,Tt,Ft,gt,3)}(!Ml||Ml.length<2*he)&&(Ml=(function(Be){let ht=2*Be,ot=new o.QuadTriangleArray;ot.resize(ht),ot._trim();for(let wt=0;wt<ht;wt++){let Tt=6*wt;ot.uint16[Tt+0]=4*wt+0,ot.uint16[Tt+1]=4*wt+1,ot.uint16[Tt+2]=4*wt+2,ot.uint16[Tt+3]=4*wt+2,ot.uint16[Tt+4]=4*wt+3,ot.uint16[Tt+5]=4*wt+0}return ot})(he));let Xe=W.createIndexBuffer(Ml,!0),et=W.createVertexBuffer(Me,o.collisionCircleLayout.members,!0);for(let Be of le){let ht={u_matrix:Be.transform,u_inv_matrix:Be.invTransform,u_camera_to_center_distance:(rt=T.transform).cameraToCenterDistance,u_viewport_size:[rt.width,rt.height]};Re.draw(W,K.TRIANGLES,nr.disabled,xr.disabled,T.colorModeForRenderPass(),zr.disabled,ht,T.style.terrain&&T.style.terrain.getTerrainData(Be.coord),d.id,et,Xe,o.SegmentVector.simpleSegment(0,2*Be.circleOffset,Be.circleArray.length,Be.circleArray.length/2),null,T.transform.zoom,null,null,null)}var rt;et.destroy(),Xe.destroy()}zr.disabled=new zr(!1,1029,2305),zr.backCCW=new zr(!0,1029,2305);let _h=o.identity(new Float32Array(16));function Pl(T,s,d,v,S,z){let{horizontalAlign:j,verticalAlign:W}=o.getAnchorAlignment(T),K=-(j-.5)*s,Q=-(W-.5)*d,le=o.evaluateVariableOffset(T,v);return new o.pointGeometry((K/S+le[0])*z,(Q/S+le[1])*z)}function kl(T,s,d,v,S,z,j,W,K,Q,le){let he=T.text.placedSymbolArray,fe=T.text.dynamicLayoutVertexArray,Re=T.icon.dynamicLayoutVertexArray,Me={};fe.clear();for(let Ae=0;Ae<he.length;Ae++){let Xe=he.get(Ae),et=T.allowVerticalPlacement&&!Xe.placedOrientation,rt=Xe.hidden||!Xe.crossTileID||et?null:v[Xe.crossTileID];if(rt){let Be=new o.pointGeometry(Xe.anchorX,Xe.anchorY),ht=or(Be,d?j:z,le),ot=Bn(S.cameraToCenterDistance,ht.signedDistanceFromCamera),wt=o.evaluateSizeForFeature(T.textSizeData,K,Xe)*ot/o.ONE_EM;d&&(wt*=T.tilePixelRatio/W);let{width:Tt,height:Ft,anchor:gt,textOffset:ri,textBoxScale:Xt}=rt,ai=Pl(gt,Tt,Ft,ri,Xt,wt),$i=d?or(Be.add(ai),z,le).point:ht.point.add(s?ai.rotate(-S.angle):ai),Ui=T.allowVerticalPlacement&&Xe.placedOrientation===o.WritingMode.vertical?Math.PI/2:0;for(let yi=0;yi<Xe.numGlyphs;yi++)o.addDynamicAttributes(fe,$i,Ui);Q&&Xe.associatedIconIndex>=0&&(Me[Xe.associatedIconIndex]={shiftedAnchor:$i,angle:Ui})}else ji(Xe.numGlyphs,fe)}if(Q){Re.clear();let Ae=T.icon.placedSymbolArray;for(let Xe=0;Xe<Ae.length;Xe++){let et=Ae.get(Xe);if(et.hidden)ji(et.numGlyphs,Re);else{let rt=Me[Xe];
1375if(rt)for(let Be=0;Be<et.numGlyphs;Be++)o.addDynamicAttributes(Re,rt.shiftedAnchor,rt.angle);else ji(et.numGlyphs,Re)}}T.icon.dynamicLayoutVertexBuffer.updateData(Re)}T.text.dynamicLayoutVertexBuffer.updateData(fe)}function ia(T,s,d){return d.iconsInText&&s?"symbolTextAndIcon":T?"symbolSDF":"symbolIcon"}function Oo(T,s,d,v,S,z,j,W,K,Q,le,he){let fe=T.context,Re=fe.gl,Me=T.transform,Ae=W==="map",Xe=K==="map",et=W!=="viewport"&&d.layout.get("symbol-placement")!=="point",rt=Ae&&!Xe&&!et,Be=!d.layout.get("symbol-sort-key").isConstant(),ht=!1,ot=T.depthModeForSublayer(0,nr.ReadOnly),wt=d.layout.get("text-variable-anchor"),Tt=[];for(let Ft of v){let gt=s.getTile(Ft),ri=gt.getBucket(d);if(!ri)continue;let Xt=S?ri.text:ri.icon;if(!Xt||!Xt.segments.get().length)continue;let ai=Xt.programConfigurations.get(d.id),$i=S||ri.sdfIcons,Ui=S?ri.textSizeData:ri.iconSizeData,yi=Xe||Me.pitch!==0,vr=T.useProgram(ia($i,S,ri),ai),tr=o.evaluateSizeForZoom(Ui,Me.zoom),cr=T.style.terrain&&T.style.terrain.getTerrainData(Ft),ur,mr,Lr,cn,Co=[0,0],Ha=null;if(S){if(mr=gt.glyphAtlasTexture,Lr=Re.LINEAR,ur=gt.glyphAtlasTexture.size,ri.iconsInText){Co=gt.imageAtlasTexture.size,Ha=gt.imageAtlasTexture;let Ma=Ui.kind==="composite"||Ui.kind==="camera";cn=yi||T.options.rotating||T.options.zooming||Ma?Re.LINEAR:Re.NEAREST}}else{let Ma=d.layout.get("icon-size").constantOr(0)!==1||ri.iconsNeedLinear;mr=gt.imageAtlasTexture,Lr=$i||T.options.rotating||T.options.zooming||Ma||yi?Re.LINEAR:Re.NEAREST,ur=gt.imageAtlasTexture.size}let ll=sn(gt,1,T.transform.zoom),na=Ua(Ft.posMatrix,Xe,Ae,T.transform,ll),hn=xa(Ft.posMatrix,Xe,Ae,T.transform,ll),Kn=wt&&ri.hasTextData(),Qt=d.layout.get("icon-text-fit")!=="none"&&Kn&&ri.hasIconData();if(et){let Ma=T.style.terrain?(Eh,cl)=>T.style.terrain.getElevation(Ft,Eh,cl):null,oa=d.layout.get("text-rotation-alignment")==="map";Zr(ri,Ft.posMatrix,T,S,na,hn,Xe,Q,oa,Ma)}let Mn=T.translatePosMatrix(Ft.posMatrix,gt,z,j),Ki=et||S&&wt||Qt?_h:na,_r=T.translatePosMatrix(hn,gt,z,j,!0),Or=$i&&d.paint.get(S?"text-halo-width":"icon-halo-width").constantOr(1)!==0,un;un=$i?ri.iconsInText?dh(Ui.kind,tr,rt,Xe,T,Mn,Ki,_r,ur,Co):ph(Ui.kind,tr,rt,Xe,T,Mn,Ki,_r,S,ur,!0):kc(Ui.kind,tr,rt,Xe,T,Mn,Ki,_r,S,ur);let Rr={program:vr,buffers:Xt,uniformValues:un,atlasTexture:mr,atlasTextureIcon:Ha,atlasInterpolation:Lr,atlasInterpolationIcon:cn,isSDF:$i,hasHalo:Or};if(Be&&ri.canOverlap){ht=!0;let Ma=Xt.segments.get();for(let oa of Ma)Tt.push({segments:new o.SegmentVector([oa]),sortKey:oa.sortKey,state:Rr,terrainData:cr})}else Tt.push({segments:Xt.segments,sortKey:0,state:Rr,terrainData:cr})}ht&&Tt.sort(((Ft,gt)=>Ft.sortKey-gt.sortKey));for(let Ft of Tt){let gt=Ft.state;if(fe.activeTexture.set(Re.TEXTURE0),gt.atlasTexture.bind(gt.atlasInterpolation,Re.CLAMP_TO_EDGE),gt.atlasTextureIcon&&(fe.activeTexture.set(Re.TEXTURE1),gt.atlasTextureIcon&>.atlasTextureIcon.bind(gt.atlasInterpolationIcon,Re.CLAMP_TO_EDGE)),gt.isSDF){let ri=gt.uniformValues;gt.hasHalo&&(ri.u_is_halo=1,Qs(gt.buffers,Ft.segments,d,T,gt.program,ot,le,he,ri,Ft.terrainData)),ri.u_is_halo=0}Qs(gt.buffers,Ft.segments,d,T,gt.program,ot,le,he,gt.uniformValues,Ft.terrainData)}}function Qs(T,s,d,v,S,z,j,W,K,Q){let le=v.context;S.draw(le,le.gl.TRIANGLES,z,j,W,zr.disabled,K,Q,d.id,T.layoutVertexBuffer,T.indexBuffer,s,d.paint,v.transform.zoom,T.programConfigurations.get(d.id),T.dynamicLayoutVertexBuffer,T.opacityVertexBuffer)}function Al(T,s,d,v,S,z,j){let W=T.context.gl,K=d.paint.get("fill-pattern"),Q=K&&K.constantOr(1),le=d.getCrossfadeParameters(),he,fe,Re,Me,Ae;j?(fe=Q&&!d.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",he=W.LINES):(fe=Q?"fillPattern":"fill",he=W.TRIANGLES);for(let Xe of v){let et=s.getTile(Xe);if(Q&&!et.patternsLoaded())continue;let rt=et.getBucket(d);if(!rt)continue;let Be=rt.programConfigurations.get(d.id),ht=T.useProgram(fe,Be),ot=T.style.terrain&&T.style.terrain.getTerrainData(Xe);Q&&(T.context.activeTexture.set(W.TEXTURE0),et.imageAtlasTexture.bind(W.LINEAR,W.CLAMP_TO_EDGE),Be.updatePaintBuffers(le));let wt=K.constantOr(null);
1375if(wt&&et.imageAtlas){let gt=et.imageAtlas,ri=gt.patternPositions[wt.to.toString()],Xt=gt.patternPositions[wt.from.toString()];ri&&Xt&&Be.setConstantPatternPositions(ri,Xt)}let Tt=ot?Xe:null,Ft=T.translatePosMatrix(Tt?Tt.posMatrix:Xe.posMatrix,et,d.paint.get("fill-translate"),d.paint.get("fill-translate-anchor"));if(j){Me=rt.indexBuffer2,Ae=rt.segments2;let gt=[W.drawingBufferWidth,W.drawingBufferHeight];Re=fe==="fillOutlinePattern"&&Q?Pc(Ft,T,le,et,gt):Yh(Ft,gt)}else Me=rt.indexBuffer,Ae=rt.segments,Re=Q?lh(Ft,T,le,et):Mc(Ft);ht.draw(T.context,he,S,T.stencilModeForClipping(Xe),z,zr.disabled,Re,ot,d.id,rt.layoutVertexBuffer,Me,Ae,d.paint,T.transform.zoom,Be)}}function Ga(T,s,d,v,S,z,j){let W=T.context,K=W.gl,Q=d.paint.get("fill-extrusion-pattern"),le=Q.constantOr(1),he=d.getCrossfadeParameters(),fe=d.paint.get("fill-extrusion-opacity");for(let Re of v){let Me=s.getTile(Re),Ae=Me.getBucket(d);if(!Ae)continue;let Xe=T.style.terrain&&T.style.terrain.getTerrainData(Re),et=Ae.programConfigurations.get(d.id),rt=T.useProgram(le?"fillExtrusionPattern":"fillExtrusion",et);le&&(T.context.activeTexture.set(K.TEXTURE0),Me.imageAtlasTexture.bind(K.LINEAR,K.CLAMP_TO_EDGE),et.updatePaintBuffers(he));let Be=Q.constantOr(null);if(Be&&Me.imageAtlas){let Tt=Me.imageAtlas,Ft=Tt.patternPositions[Be.to.toString()],gt=Tt.patternPositions[Be.from.toString()];Ft&>&&et.setConstantPatternPositions(Ft,gt)}let ht=T.translatePosMatrix(Re.posMatrix,Me,d.paint.get("fill-extrusion-translate"),d.paint.get("fill-extrusion-translate-anchor")),ot=d.paint.get("fill-extrusion-vertical-gradient"),wt=le?Ec(ht,T,ot,fe,Re,he,Me):sh(ht,T,ot,fe);rt.draw(W,W.gl.TRIANGLES,S,z,j,zr.backCCW,wt,Xe,d.id,Ae.layoutVertexBuffer,Ae.indexBuffer,Ae.segments,d.paint,T.transform.zoom,et,T.style.terrain&&Ae.centroidVertexBuffer)}}function zl(T,s,d,v,S,z,j){let W=T.context,K=W.gl,Q=d.fbo;if(!Q)return;let le=T.useProgram("hillshade"),he=T.style.terrain&&T.style.terrain.getTerrainData(s);W.activeTexture.set(K.TEXTURE0),K.bindTexture(K.TEXTURE_2D,Q.colorAttachment.get()),le.draw(W,K.TRIANGLES,S,z,j,zr.disabled,((fe,Re,Me,Ae)=>{let Xe=Me.paint.get("hillshade-shadow-color"),et=Me.paint.get("hillshade-highlight-color"),rt=Me.paint.get("hillshade-accent-color"),Be=Me.paint.get("hillshade-illumination-direction")*(Math.PI/180);Me.paint.get("hillshade-illumination-anchor")==="viewport"&&(Be-=fe.transform.angle);let ht=!fe.options.moving;return{u_matrix:Ae?Ae.posMatrix:fe.transform.calculatePosMatrix(Re.tileID.toUnwrapped(),ht),u_image:0,u_latrange:Js(0,Re.tileID),u_light:[Me.paint.get("hillshade-exaggeration"),Be],u_shadow:Xe,u_highlight:et,u_accent:rt}})(T,d,v,he?s:null),he,v.id,T.rasterBoundsBuffer,T.quadTriangleIndexBuffer,T.rasterBoundsSegments)}function Su(T,s,d,v,S,z){let j=T.context,W=j.gl,K=s.dem;if(K&&K.data){let Q=K.dim,le=K.stride,he=K.getPixels();if(j.activeTexture.set(W.TEXTURE1),j.pixelStoreUnpackPremultiplyAlpha.set(!1),s.demTexture=s.demTexture||T.getTileTexture(le),s.demTexture){let Re=s.demTexture;Re.update(he,{premultiply:!1}),Re.bind(W.NEAREST,W.CLAMP_TO_EDGE)}else s.demTexture=new Mt(j,he,W.RGBA,{premultiply:!1}),s.demTexture.bind(W.NEAREST,W.CLAMP_TO_EDGE);j.activeTexture.set(W.TEXTURE0);let fe=s.fbo;if(!fe){let Re=new Mt(j,{width:Q,height:Q,data:null},W.RGBA);Re.bind(W.LINEAR,W.CLAMP_TO_EDGE),fe=s.fbo=j.createFramebuffer(Q,Q,!0),fe.colorAttachment.set(Re.texture)}j.bindFramebuffer.set(fe.framebuffer),j.viewport.set([0,0,Q,Q]),T.useProgram("hillshadePrepare").draw(j,W.TRIANGLES,v,S,z,zr.disabled,((Re,Me)=>{let Ae=Me.stride,Xe=o.create();return o.ortho(Xe,0,o.EXTENT,-o.EXTENT,0,0,1),o.translate(Xe,Xe,[0,-o.EXTENT,0]),{u_matrix:Xe,u_image:1,u_dimension:[Ae,Ae],u_zoom:Re.overscaledZ,u_unpack:Me.getUnpackVector()}})(s.tileID,K),null,d.id,T.rasterBoundsBuffer,T.quadTriangleIndexBuffer,T.rasterBoundsSegments),s.needsHillshadePrepare=!1}}function Dl(T,s,d,v,S,z){let j=v.paint.get("raster-fade-duration");if(!z&&j>0){let W=o.exported.now(),K=(W-T.timeAdded)/j,Q=s?(W-s.timeAdded)/j:-1,le=d.getSource(),he=S.coveringZoomLevel({tileSize:le.tileSize,roundZoom:le.roundZoom}),fe=!s||Math.abs(s.tileID.overscaledZ-he)>Math.abs(T.tileID.overscaledZ-he),Re=fe&&T.refreshedUponExpiration?1:o.clamp(fe?K:1-Q,0,1);return T.refreshedUponExpiration&&K>=1&&(T.refreshedUponExpiration=!1),s?{opacity:1,mix:1-Re}:{opacity:Re,mix:0}}return{opacity:1,mix:0}}let yh=new o.Color(1,0,0,1),Un=new o.Color(0,1,0,1),Iu=new o.Color(0,0,1,1),Lc=new o.Color(1,0,1,1),Jh=new o.Color(0,1,1,1);function el(T,s,d,v){Ll(T,0,s+d/2,T.transform.width,d,v)}function tl(T,s,d,v){Ll(T,s-d/2,0,d,T.transform.height,v)}function Ll(T,s,d,v,S,z){let j=T.context,W=j.gl;W.enable(W.SCISSOR_TEST),W.scissor(s*T.pixelRatio,d*T.pixelRatio,v*T.pixelRatio,S*T.pixelRatio),j.clear({color:z}),W.disable(W.SCISSOR_TEST)}function Cu(T,s,d){let v=T.context,S=v.gl,z=d.posMatrix,j=T.useProgram("debug"),W=nr.disabled,K=xr.disabled,Q=T.colorModeForRenderPass(),le="$debug",he=T.style.terrain&&T.style.terrain.getTerrainData(d);v.activeTexture.set(S.TEXTURE0),T.emptyTexture.bind(S.LINEAR,S.CLAMP_TO_EDGE);let fe=s.getTileByID(d.key).latestRawTileData,Re=Math.floor((fe&&fe.byteLength||0)/1024),Me=s.getTile(d).tileSize,Ae=512/Math.min(Me,512)*(d.overscaledZ/T.transform.zoom)*.5,Xe=d.canonical.toString();d.overscaledZ!==d.canonical.z&&(Xe+=` => ${d.overscaledZ}`),(function(et,rt){et.initDebugOverlayCanvas();let Be=et.debugOverlayCanvas,ht=et.context.gl,ot=et.debugOverlayCanvas.getContext("2d");
1375ot.clearRect(0,0,Be.width,Be.height),ot.shadowColor="white",ot.shadowBlur=2,ot.lineWidth=1.5,ot.strokeStyle="white",ot.textBaseline="top",ot.font="bold 36px Open Sans, sans-serif",ot.fillText(rt,5,5),ot.strokeText(rt,5,5),et.debugOverlayTexture.update(Be),et.debugOverlayTexture.bind(ht.LINEAR,ht.CLAMP_TO_EDGE)})(T,`${Xe} ${Re}kB`),j.draw(v,S.TRIANGLES,W,K,yr.alphaBlended,zr.disabled,vl(z,o.Color.transparent,Ae),null,le,T.debugBuffer,T.quadTriangleIndexBuffer,T.debugSegments),j.draw(v,S.LINE_STRIP,W,K,Q,zr.disabled,vl(z,o.Color.red),he,le,T.debugBuffer,T.tileBorderIndexBuffer,T.debugSegments)}function Rc(T,s,d){let v=T.context,S=v.gl,z=T.colorModeForRenderPass(),j=new nr(S.LEQUAL,nr.ReadWrite,T.depthRangeFor3D),W=T.useProgram("terrain"),K=s.getTerrainMesh(),Q=s.getTerrainData(d.tileID);v.bindFramebuffer.set(null),v.viewport.set([0,0,T.width,T.height]),v.activeTexture.set(S.TEXTURE0),S.bindTexture(S.TEXTURE_2D,s.getRTTFramebuffer().colorAttachment.get());let le=T.transform.calculatePosMatrix(d.tileID.toUnwrapped());W.draw(v,S.TRIANGLES,j,xr.disabled,z,zr.backCCW,{u_matrix:le,u_texture:0},Q,"terrain",K.vertexBuffer,K.indexBuffer,K.segments)}
1375function Qh(T,s,d,v){let S=T.context,z=d.tileSize*s.qualityFactor;d.textures[v]||(d.textures[v]=T.getTileTexture(z)||new Mt(S,{width:z,height:z,data:null},S.gl.RGBA),d.textures[v].bind(S.gl.LINEAR,S.gl.CLAMP_TO_EDGE),v===0&&s.sourceCache.renderHistory.unshift(d.tileID.key));let j=s.getRTTFramebuffer();j.colorAttachment.set(d.textures[v].texture),S.bindFramebuffer.set(j.framebuffer),S.viewport.set([0,0,z,z])}class il{constructor(s){this._coordsDescendingInv={},this._coordsDescendingInvStr={},this.painter=s,this._renderToTexture={background:!0,fill:!0,line:!0,raster:!0},this._coordsDescendingInv={},this._coordsDescendingInvStr={},this._stacks=[],this._prevType=null,this._rerender={},this._renderableTiles=s.style.terrain.sourceCache.getRenderableTiles(),this._init()}_init(){let s=this.painter.style,d=s.terrain;for(let v in s.sourceCaches){this._coordsDescendingInv[v]={};let S=s.sourceCaches[v].getVisibleCoordinates();for(let z of S){let j=d.sourceCache.getTerrainCoords(z);for(let W in j)this._coordsDescendingInv[v][W]||(this._coordsDescendingInv[v][W]=[]),this._coordsDescendingInv[v][W].push(j[W])}}for(let v of s._order){let S=s._layers[v],z=S.source;if(this._renderToTexture[S.type]&&!this._coordsDescendingInvStr[z]){this._coordsDescendingInvStr[z]={};for(let j in this._coordsDescendingInv[z])this._coordsDescendingInvStr[z][j]=this._coordsDescendingInv[z][j].map((W=>W.key)).sort().join()}}return this._renderableTiles.forEach((v=>{for(let S in this._coordsDescendingInvStr){let z=this._coordsDescendingInvStr[S][v.tileID.key];z&&z!==v.textureCoords[S]&&v.clearTextures(this.painter),d.needsRerender(S,v.tileID)&&v.clearTextures(this.painter)}this._rerender[v.tileID.key]=!v.textures.length})),d.clearRerenderCache(),d.sourceCache.removeOutdated(this.painter),this}renderLayer(s){let d=s.type,v=this.painter,S=v.style._order,z=v.currentLayer,j=z+1===S.length;if(this._renderToTexture[d]&&(this._prevType&&this._renderToTexture[this._prevType]||this._stacks.push([]),this._prevType=d,this._stacks[this._stacks.length-1].push(S[z]),!j))return!0;if(this._renderToTexture[this._prevType]||d==="hillshade"||this._renderToTexture[d]&&j){this._prevType=d;let W=this._stacks.length-1,K=this._stacks[W]||[];for(let Q of this._renderableTiles){if(Qh(v,v.style.terrain,Q,W),this._rerender[Q.tileID.key]){v.context.clear({color:o.Color.transparent});for(let le=0;le<K.length;le++){let he=v.style._layers[K[le]],fe=he.source?this._coordsDescendingInv[he.source][Q.tileID.key]:[Q.tileID];v._renderTileClippingMasks(he,fe),v.renderLayer(v,v.style.sourceCaches[he.source],he,fe),he.source&&(Q.textureCoords[he.source]=this._coordsDescendingInvStr[he.source][Q.tileID.key])}}Rc(v,v.style.terrain,Q)}if(d==="hillshade"){this._stacks.push([S[z]]);for(let Q of this._renderableTiles){let le=this._coordsDescendingInv[s.source][Q.tileID.key];Qh(v,v.style.terrain,Q,this._stacks.length-1),v.context.clear({color:o.Color.transparent}),v._renderTileClippingMasks(s,le),v.renderLayer(v,v.style.sourceCaches[s.source],s,le),Rc(v,v.style.terrain,Q)}return!0}return this._renderToTexture[d]}return!1}}let Rl={symbol:function(T,s,d,v,S){if(T.renderPass!=="translucent")return;let z=xr.disabled,j=T.colorModeForRenderPass();d.layout.get("text-variable-anchor")&&(function(W,K,Q,le,he,fe,Re){let Me=K.transform,Ae=he==="map",Xe=fe==="map";for(let et of W){let rt=le.getTile(et),Be=rt.getBucket(Q);if(!Be||!Be.text||!Be.text.segments.get().length)continue;let ht=o.evaluateSizeForZoom(Be.textSizeData,Me.zoom),ot=sn(rt,1,K.transform.zoom),wt=Ua(et.posMatrix,Xe,Ae,K.transform,ot),Tt=Q.layout.get("icon-text-fit")!=="none"&&Be.hasIconData();if(ht){let Ft=Math.pow(2,Me.zoom-rt.tileID.overscaledZ);kl(Be,Ae,Xe,Re,Me,wt,et.posMatrix,Ft,ht,Tt,K.style.terrain?(gt,ri)=>K.style.terrain.getElevation(et,gt,ri):null)}}})(v,T,d,s,d.layout.get("text-rotation-alignment"),d.layout.get("text-pitch-alignment"),S),d.paint.get("icon-opacity").constantOr(1)!==0&&Oo(T,s,d,v,!1,d.paint.get("icon-translate"),d.paint.get("icon-translate-anchor"),d.layout.get("icon-rotation-alignment"),d.layout.get("icon-pitch-alignment"),d.layout.get("icon-keep-upright"),z,j),d.paint.get("text-opacity").constantOr(1)!==0&&Oo(T,s,d,v,!0,d.paint.get("text-translate"),d.paint.get("text-translate-anchor"),d.layout.get("text-rotation-alignment"),d.layout.get("text-pitch-alignment"),d.layout.get("text-keep-upright"),z,j),s.map.showCollisionBoxes&&(ks(T,s,d,v,d.paint.get("text-translate"),d.paint.get("text-translate-anchor"),!0),ks(T,s,d,v,d.paint.get("icon-translate"),d.paint.get("icon-translate-anchor"),!1))},circle:function(T,s,d,v){if(T.renderPass!=="translucent")return;let S=d.paint.get("circle-opacity"),z=d.paint.get("circle-stroke-width"),j=d.paint.get("circle-stroke-opacity"),W=!d.layout.get("
1375circle-sort-key").isConstant();if(S.constantOr(1)===0&&(z.constantOr(1)===0||j.constantOr(1)===0))return;let K=T.context,Q=K.gl,le=T.depthModeForSublayer(0,nr.ReadOnly),he=xr.disabled,fe=T.colorModeForRenderPass(),Re=[];for(let Me=0;Me<v.length;Me++){let Ae=v[Me],Xe=s.getTile(Ae),et=Xe.getBucket(d);if(!et)continue;let rt=et.programConfigurations.get(d.id),Be=T.useProgram("circle",rt),ht=et.layoutVertexBuffer,ot=et.indexBuffer,wt=T.style.terrain&&T.style.terrain.getTerrainData(Ae),Tt={programConfiguration:rt,program:Be,layoutVertexBuffer:ht,indexBuffer:ot,uniformValues:ch(T,Ae,Xe,d),terrainData:wt};if(W){let Ft=et.segments.get();for(let gt of Ft)Re.push({segments:new o.SegmentVector([gt]),sortKey:gt.sortKey,state:Tt})}else Re.push({segments:et.segments,sortKey:0,state:Tt})}W&&Re.sort(((Me,Ae)=>Me.sortKey-Ae.sortKey));for(let Me of Re){let{programConfiguration:Ae,program:Xe,layoutVertexBuffer:et,indexBuffer:rt,uniformValues:Be,terrainData:ht}=Me.state;Xe.draw(K,Q.TRIANGLES,le,he,fe,zr.disabled,Be,ht,d.id,et,rt,Me.segments,d.paint,T.transform.zoom,Ae)}},heatmap:function(T,s,d,v){if(d.paint.get("heatmap-opacity")!==0)if(T.renderPass==="offscreen"){let S=T.context,z
1375=S.gl,j=xr.disabled,W=new yr([z.ONE,z.ONE],o.Color.transparent,[!0,!0,!0,!0]);(function(K,Q,le){let he=K.gl;K.activeTexture.set(he.TEXTURE1),K.viewport.set([0,0,Q.width/4,Q.height/4]);let fe=le.heatmapFbo;if(fe)he.bindTexture(he.TEXTURE_2D,fe.colorAttachment.get()),K.bindFramebuffer.set(fe.framebuffer);else{let Re=he.createTexture();he.bindTexture(he.TEXTURE_2D,Re),he.texParameteri(he.TEXTURE_2D,he.TEXTURE_WRAP_S,he.CLAMP_TO_EDGE),he.texParameteri(he.TEXTURE_2D,he.TEXTURE_WRAP_T,he.CLAMP_TO_EDGE),he.texParameteri(he.TEXTURE_2D,he.TEXTURE_MIN_FILTER,he.LINEAR),he.texParameteri(he.TEXTURE_2D,he.TEXTURE_MAG_FILTER,he.LINEAR),fe=le.heatmapFbo=K.createFramebuffer(Q.width/4,Q.height/4,!1),(function(Me,Ae,Xe,et){let rt=Me.gl;rt.texImage2D(rt.TEXTURE_2D,0,rt.RGBA,Ae.width/4,Ae.height/4,0,rt.RGBA,Me.extRenderToTextureHalfFloat?Me.extTextureHalfFloat.HALF_FLOAT_OES:rt.UNSIGNED_BYTE,null),et.colorAttachment.set(Xe)})(K,Q,Re,fe)}})(S,T,d),S.clear({color:o.Color.transparent});for(let K=0;K<v.length;K++){let Q=v[K];if(s.hasRenderableParent(Q))continue;let le=s.getTile(Q),he=le.getBucket(d);if(!he)continue;let fe=he.programConfigurations.get(d.id),Re=T.useProgram("heatmap",fe),{zoom:Me}=T.transform;Re.draw(S,z.TRIANGLES,nr.disabled,j,W,zr.disabled,hh(Q.posMatrix,le,Me,d.paint.get("heatmap-intensity")),null,d.id,he.layoutVertexBuffer,he.indexBuffer,he.segments,d.paint,T.transform.zoom,fe)}S.viewport.set([0,0,T.width,T.height])}else T.renderPass==="translucent"&&(T.context.setColorMode(T.colorModeForRenderPass()),(function(S,z){let j=S.context,W=j.gl,K=z.heatmapFbo;if(!K)return;j.activeTexture.set(W.TEXTURE0),W.bindTexture(W.TEXTURE_2D,K.colorAttachment.get()),j.activeTexture.set(W.TEXTURE1);let Q=z.colorRampTexture;Q||(Q=z.colorRampTexture=new Mt(j,z.colorRamp,W.RGBA)),Q.bind(W.LINEAR,W.CLAMP_TO_EDGE),S.useProgram("heatmapTexture").draw(j,W.TRIANGLES,nr.disabled,xr.disabled,S.colorModeForRenderPass(),zr.disabled,((le,he,fe,Re)=>{let Me=o.create();o.ortho(Me,0,le.width,le.height,0,0,1);let Ae=le.context.gl;return{u_matrix:Me,u_world:[Ae.drawingBufferWidth,Ae.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:he.paint.get("heatmap-opacity")}})(S,z),null,z.id,S.viewportBuffer,S.quadTriangleIndexBuffer,S.viewportSegments,z.paint,S.transform.zoom)})(T,d))},line:function(T,s,d,v){if(T.renderPass!=="translucent")return;let S=d.paint.get("line-opacity"),z=d.paint.get("line-width");if(S.constantOr(1)===0||z.constantOr(1)===0)return;let j=T.depthModeForSublayer(0,nr.ReadOnly),W=T.colorModeForRenderPass(),K=d.paint.get("line-dasharray"),Q=d.paint.get("line-pattern"),le=Q.constantOr(1),he=d.paint.get("line-gradient"),fe=d.getCrossfadeParameters(),Re=le?"linePattern":K?"lineSDF":he?"lineGradient":"line",Me=T.context,Ae=Me.gl,Xe=!0;for(let et of v){let rt=s.getTile(et);if(le&&!rt.patternsLoaded())continue;let Be=rt.getBucket(d);if(!Be)continue;let ht=Be.programConfigurations.get(d.id),ot=T.context.program.get(),wt=T.useProgram(Re,ht),Tt=Xe||wt.program!==ot,Ft=T.style.terrain&&T.style.terrain.getTerrainData(et),gt=Q.constantOr(null);if(gt&&rt.imageAtlas){let ai=rt.imageAtlas,$i=ai.patternPositions[gt.to.toString()],Ui=ai.patternPositions[gt.from.toString()];$i&&Ui&&ht.setConstantPatternPositions($i,Ui)}let ri=Ft?et:null,Xt=le?Es(T,rt,d,fe,ri):K?bl(T,rt,d,K,fe,ri):he?uh(T,rt,d,Be.lineClipsArray.length,ri):Cs(T,rt,d,ri);if(le)Me.activeTexture.set(Ae.TEXTURE0),rt.imageAtlasTexture.bind(Ae.LINEAR,Ae.CLAMP_TO_EDGE),ht.updatePaintBuffers(fe);else if(K&&(Tt||T.lineAtlas.dirty))Me.activeTexture.set(Ae.TEXTURE0),T.lineAtlas.bind(Me);else if(he){let ai=Be.gradients[d.id],$i=ai.texture;if(d.gradientVersion!==ai.version){let Ui=256;if(d.stepInterpolant){let yi=s.getSource().maxzoom,vr=et.canonical.z===yi?Math.ceil(1<<T.transform.maxZoom-et.canonical.z):1;Ui=o.clamp(o.nextPowerOfTwo(Be.maxLineLength/o.EXTENT*1024*vr),256,Me.maxTextureSize)}ai.gradient=o.renderColorRamp({expression:d.gradientExpression(),evaluationKey:"lineProgress",resolution:Ui,image:ai.gradient||void 0,clips:Be.lineClipsArray}),ai.texture?ai.texture.update(ai.gradient):ai.texture=new Mt(Me,ai.gradient,Ae.RGBA),ai.version=d.gradientVersion,$i=ai.texture}Me.activeTexture.set(Ae.TEXTURE0),$i.bind(d.stepInterpolant?Ae.NEAREST:Ae.LINEAR,Ae.CLAMP_TO_EDGE)}wt.draw(Me,Ae.TRIANGLES,j,T.stencilModeForClipping(et),W,zr.disabled,Xt,Ft,d.id,Be.layoutVertexBuffer,Be.indexBuffer,Be.segments,d.paint,T.transform.zoom,ht,Be.layoutVertexBuffer2),Xe=!1}},fill:function(T,s,d,v){let S=d.paint.get("fill-color"),z=d.paint.get("fill-opacity");if(z.constantOr(1)===0)return;let j=T.colorModeForRenderPass(),W=d.paint.get("fill-pattern"),K=T.opaquePassEnabledForLayer()&&!W.constantOr(1)&&S.constantOr(o.Color.transparent).a===1&&z.constantOr(0)===1?"opaque":"translucent";if(T.renderPass===K){let Q=T.depthModeForSublayer(1,T.renderPass==="opaque"?nr.ReadWrite:nr.ReadOnly);Al(T,s,d,v,Q,j,!1)}if(T.renderPass==="translucent"&&d.paint.get("fill-antialias")){let Q=T.depthModeForSublayer(d.getPaintProperty("fill-outline-color")?2:0,nr.ReadOnly);Al(T,s,d,v,Q,j,!0)}},"fill-extrusion":function(T,s,d,v){let S=d.paint.get("fill-extrusion-opacity");if(S!==0&&T.renderPass==="translucent"){let z=new nr(T.context.gl.LEQUAL,nr.ReadWrite,T.depthRangeFor3D);if(S!==1||d.paint.get("fill-extrusion-pattern").constantOr(1))Ga(T,s,d,v,z,xr.disabled,yr.disabled),Ga(T,s,d,v,z,T.stencilModeFor3D(),T.colorModeForRenderPass());else{let j=T.colorModeForRenderPass();Ga(T,s,d,v,z,xr.disabled,j)}}},hillshade:function(T,s,d,v){if(T.renderPass!=="offscreen"&&T.renderPass!=="translucent")return;
1375let S=T.context,z=T.depthModeForSublayer(0,nr.ReadOnly),j=T.colorModeForRenderPass(),[W,K]=T.renderPass==="translucent"?T.stencilConfigForOverlap(v):[{},v];for(let Q of K){let le=s.getTile(Q);le.needsHillshadePrepare!==void 0&&le.needsHillshadePrepare&&T.renderPass==="offscreen"?Su(T,le,d,z,xr.disabled,j):T.renderPass==="translucent"&&zl(T,Q,le,d,z,W[Q.overscaledZ],j)}S.viewport.set([0,0,T.width,T.height])},raster:function(T,s,d,v){if(T.renderPass!=="translucent"||d.paint.get("raster-opacity")===0||!v.length)return;let S=T.context,z=S.gl,j=s.getSource(),W=T.useProgram("raster"),K=T.colorModeForRenderPass(),[Q,le]=j instanceof pi?[{},v]:T.stencilConfigForOverlap(v),he=le[le.length-1].overscaledZ,fe=!T.options.moving;for(let Re of le){let Me=T.depthModeForSublayer(Re.overscaledZ-he,d.paint.get("raster-opacity")===1?nr.ReadWrite:nr.ReadOnly,z.LESS),Ae=s.getTile(Re);Ae.registerFadeDuration(d.paint.get("raster-fade-duration"));let Xe=s.findLoadedParent(Re,0),et=Dl(Ae,Xe,s,d,T.transform,T.style.terrain),rt,Be,ht=d.paint.get("raster-resampling")==="nearest"?z.NEAREST:z.LINEAR;S.activeTexture.set(z.TEXTURE0),Ae.texture.bind(ht,z.CLAMP_TO_EDGE,z.LINEAR_MIPMAP_NEAREST),S.activeTexture.set(z.TEXTURE1),Xe?(Xe.texture.bind(ht,z.CLAMP_TO_EDGE,z.LINEAR_MIPMAP_NEAREST),rt=Math.pow(2,Xe.tileID.overscaledZ-Ae.tileID.overscaledZ),Be=[Ae.tileID.canonical.x*rt%1,Ae.tileID.canonical.y*rt%1]):Ae.texture.bind(ht,z.CLAMP_TO_EDGE,z.LINEAR_MIPMAP_NEAREST);let ot=T.style.terrain&&T.style.terrain.getTerrainData(Re),wt=ot?Re:null,Tt=wt?wt.posMatrix:T.transform.calculatePosMatrix(Re.toUnwrapped(),fe),Ft=wl(Tt,Be||[0,0],rt||1,et,d);j instanceof pi?W.draw(S,z.TRIANGLES,Me,xr.disabled,K,zr.disabled,Ft,ot,d.id,j.boundsBuffer,T.quadTriangleIndexBuffer,j.boundsSegments):W.draw(S,z.TRIANGLES,Me,Q[Re.overscaledZ],K,zr.disabled,Ft,ot,d.id,T.rasterBoundsBuffer,T.quadTriangleIndexBuffer,T.rasterBoundsSegments)}},background:function(T,s,d,v){let S=d.paint.get("background-color"),z=d.paint.get("background-opacity");if(z===0)return;let j=T.context,W=j.gl,K=T.transform,Q=K.tileSize,le=d.paint.get("background-pattern");if(T.isPatternMissing(le))return;let he=!le&&S.a===1&&z===1&&T.opaquePassEnabledForLayer()?"opaque":"translucent";if(T.renderPass!==he)return;let fe=xr.disabled,Re=T.depthModeForSublayer(0,he==="opaque"?nr.ReadWrite:nr.ReadOnly),Me=T.colorModeForRenderPass(),Ae=T.useProgram(le?"backgroundPattern":"background"),Xe=v||K.coveringTiles({tileSize:Q,terrain:T.style.terrain});le&&(j.activeTexture.set(W.TEXTURE0),T.imageManager.bind(T.context));let et=d.getCrossfadeParameters();for(let rt of Xe){let Be=v?rt.posMatrix:T.transform.calculatePosMatrix(rt.toUnwrapped()),ht=le?so(Be,z,T,le,{tileID:rt,tileSize:Q},et):Fo(Be,z,S),ot=T.style.terrain&&T.style.terrain.getTerrainData(rt);Ae.draw(j,W.TRIANGLES,Re,fe,Me,zr.disabled,ht,ot,d.id,T.tileExtentBuffer,T.quadTriangleIndexBuffer,T.tileExtentSegments)}},debug:function(T,s,d){for(let v=0;v<d.length;v++)Cu(T,s,d[v])},custom:function(T,s,d){let v=T.context,S=d.implementation;if(T.renderPass==="offscreen"){let z=S.prerender;z&&(T.setCustomLayerDefaults(),v.setColorMode(T.colorModeForRenderPass()),z.call(S,v.gl,T.transform.customLayerMatrix()),v.setDirty(),T.setBaseState())}else if(T.renderPass==="translucent"){T.setCustomLayerDefaults(),v.setColorMode(T.colorModeForRenderPass()),v.setStencilMode(xr.disabled);let z=S.renderingMode==="3d"?new nr(T.context.gl.LEQUAL,nr.ReadWrite,T.depthRangeFor3D):T.depthModeForSublayer(0,nr.ReadOnly);v.setDepthMode(z),S.render(v.gl,T.transform.customLayerMatrix()),v.setDirty(),T.setBaseState(),v.bindFramebuffer.set(null)}}};class Fc{constructor(s,d){this.context=new gh(s),this.transform=d,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:o.create(),renderTime:0},this.setup(),this.numSublayers=Dr.maxUnderzooming+Dr.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Ri,this.gpuTimers={}}resize(s,d,v){if(this.width=s*v,this.height=d*v,this.pixelRatio=v,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let S of this.style._order)this.style._layers[S].resize()}setup(){let s=this.context,d=new o.PosArray;d.emplaceBack(0,0),d.emplaceBack(o.EXTENT,0),d.emplaceBack(0,o.EXTENT),d.emplaceBack(o.EXTENT,o.EXTENT),this.tileExtentBuffer=s.createVertexBuffer(d,rr.members),this.tileExtentSegments=o.SegmentVector.simpleSegment(0,0,4,2);let v=new o.PosArray;v.emplaceBack(0,0),v.emplaceBack(o.EXTENT,0),v.emplaceBack(0,o.EXTENT),v.emplaceBack(o.EXTENT,o.EXTENT),this.debugBuffer=s.createVertexBuffer(v,rr.members),this.debugSegments=o.SegmentVector.simpleSegment(0,0,4,5);let S=new o.RasterBoundsArray;S.emplaceBack(0,0,0,0),S.emplaceBack(o.EXTENT,0,o.EXTENT,0),S.emplaceBack(0,o.EXTENT,0,o.EXTENT),S.emplaceBack(o.EXTENT,o.EXTENT,o.EXTENT,o.EXTENT),this.rasterBoundsBuffer=s.createVertexBuffer(S,Li.members),this.rasterBoundsSegments=o.SegmentVector.simpleSegment(0,0,4,2);let z=new o.PosArray;
1375z.emplaceBack(0,0),z.emplaceBack(1,0),z.emplaceBack(0,1),z.emplaceBack(1,1),this.viewportBuffer=s.createVertexBuffer(z,rr.members),this.viewportSegments=o.SegmentVector.simpleSegment(0,0,4,2);let j=new o.LineStripIndexArray;j.emplaceBack(0),j.emplaceBack(1),j.emplaceBack(3),j.emplaceBack(2),j.emplaceBack(0),this.tileBorderIndexBuffer=s.createIndexBuffer(j);let W=new o.TriangleIndexArray;W.emplaceBack(0,1,2),W.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=s.createIndexBuffer(W),this.emptyTexture=new Mt(s,{width:1,height:1,data:new Uint8Array([0,0,0,0])},s.gl.RGBA);let K=this.context.gl;this.stencilClearMode=new xr({func:K.ALWAYS,mask:0},0,255,K.ZERO,K.ZERO,K.ZERO)}clearStencil(){let s=this.context,d=s.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let v=o.create();o.ortho(v,0,this.width,this.height,0,0,1),o.scale(v,v,[d.drawingBufferWidth,d.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(s,d.TRIANGLES,nr.disabled,this.stencilClearMode,yr.disabled,zr.disabled,Ys(v),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(s,d){if(this.currentStencilSource===s.source||!s.isTileClipped()||!d||!d.length)return;this.currentStencilSource=s.source;let v=this.context,S=v.gl;this.nextStencilID+d.length>256&&this.clearStencil(),v.setColorMode(yr.disabled),v.setDepthMode(nr.disabled);let z=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let j of d){let W=this._tileClippingMaskIDs[j.key]=this.nextStencilID++,K=this.style.terrain&&this.style.terrain.getTerrainData(j);z.draw(v,S.TRIANGLES,nr.disabled,new xr({func:S.ALWAYS,mask:0},W,255,S.KEEP,S.KEEP,S.REPLACE),yr.disabled,zr.disabled,Ys(j.posMatrix),K,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let s=this.nextStencilID++,d=this.context.gl;return new xr({func:d.NOTEQUAL,mask:255},s,255,d.KEEP,d.KEEP,d.REPLACE)}stencilModeForClipping(s){let d=this.context.gl;return new xr({func:d.EQUAL,mask:255},this._tileClippingMaskIDs[s.key],0,d.KEEP,d.KEEP,d.REPLACE)}stencilConfigForOverlap(s){let d=this.context.gl,v=s.sort(((j,W)=>W.overscaledZ-j.overscaledZ)),S=v[v.length-1].overscaledZ,z=v[0].overscaledZ-S+1;if(z>1){this.currentStencilSource=void 0,this.nextStencilID+z>256&&this.clearStencil();let j={};for(let W=0;W<z;W++)j[W+S]=new xr({func:d.GEQUAL,mask:255},W+this.nextStencilID,255,d.KEEP,d.KEEP,d.REPLACE);return this.nextStencilID+=z,[j,v]}return[{[S]:xr.disabled},v]}colorModeForRenderPass(){let s=this.context.gl;return this._showOverdrawInspector?new yr([s.CONSTANT_COLOR,s.ONE],new o.Color(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?yr.unblended:yr.alphaBlended}depthModeForSublayer(s,d,v){if(!this.opaquePassEnabledForLayer())return nr.disabled;let S=1-((1+this.currentLayer)*this.numSublayers+s)*this.depthEpsilon;return new nr(v||this.context.gl.LEQUAL,d,[S,S])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(s,d){this.style=s,this.options=d,this.lineAtlas=s.lineAtlas,this.imageManager=s.imageManager,this.glyphManager=s.glyphManager,this.symbolFadeChange=s.placement.symbolFadeChange(o.exported.now()),this.imageManager.beginFrame();let v=this.style._order,S=this.style.sourceCaches,z=this.style.terrain&&new il(this);for(let Q in S){let le=S[Q];le.used&&le.prepare(this.context)}let j={},W={},K={};for(let Q in S){let le=S[Q];j[Q]=le.getVisibleCoordinates(),W[Q]=j[Q].slice().reverse(),K[Q]=le.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let Q=0;Q<v.length;Q++)if(this.style._layers[v[Q]].is3D()){this.opaquePassCutoff=Q;break}if(z){this.opaquePassCutoff=0;let Q=this.style.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime);(this.terrainFacilitator.dirty||!o.equals(this.terrainFacilitator.matrix,this.transform.projMatrix)||Q.length)&&(o.copy(this.terrainFacilitator.matrix,this.transform.projMatrix),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,(function(le,he){let fe=le.context,Re=fe.gl,Me=yr.unblended,Ae=new nr(Re.LEQUAL,nr.ReadWrite,[0,1]),Xe=he.getTerrainMesh(),et=he.sourceCache.getRenderableTiles(),rt=le.useProgram("terrainDepth");fe.bindFramebuffer.set(he.getFramebuffer("depth").framebuffer),fe.viewport.set([0,0,le.width/devicePixelRatio,le.height/devicePixelRatio]),fe.clear({color:o.Color.transparent,depth:1});for(let Be of et){let ht=he.getTerrainData(Be.tileID),ot=le.transform.calculatePosMatrix(Be.tileID.toUnwrapped());rt.draw(fe,Re.TRIANGLES,Ae,xr.disabled,Me,zr.backCCW,{u_matrix:ot},ht,"terrain",Xe.vertexBuffer,Xe.indexBuffer,Xe.segments)}fe.bindFramebuffer.set(null),fe.viewport.set([0,0,le.width,le.height])})(this,this.style.terrain),(function(le,he){let fe=le.context,Re=fe.gl,Me=yr.unblended,Ae=new nr(Re.LEQUAL,nr.ReadWrite,[0,1]),Xe=he.getTerrainMesh(),et=he.getCoordsTexture(),rt=he.sourceCache.getRenderableTiles(),Be=le.useProgram("terrainCoords");fe.bindFramebuffer.set(he.getFramebuffer("coords").framebuffer),fe.viewport.set([0,0,le.width/devicePixelRatio,le.height/devicePixelRatio]),fe.clear({color:o.Color.transparent,depth:1}),he.coordsIndex=[];for(let ht of rt){let ot=he.getTerrainData(ht.tileID);fe.activeTexture.set(Re.TEXTURE0),Re.bindTexture(Re.TEXTURE_2D,et.texture);let wt=le.transform.calculatePosMatrix(ht.tileID.toUnwrapped());Be.draw(fe,Re.TRIANGLES,Ae,xr.disabled,Me,zr.backCCW,{u_matrix:wt,u_terrain_coords_id:(255-he.coordsIndex.length)/255,u_texture:0},ot,"terrain",Xe.vertexBuffer,Xe.indexBuffer,Xe.segments),he.coordsIndex.push(ht.tileID.key)}fe.bindFramebuffer.set(null),fe.viewport.set([0,0,le.width,le.height])})(this,this.style.terrain))}this.renderPass="offscreen";for(let Q of v){let le=this.style._layers[Q];if(!le.hasOffscreenPass()||le.isHidden(this.transform.zoom))continue;let he=W[le.source];(le.type==="custom"||he.length)&&this.renderLayer(this,S[le.source],le,he)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:d.showOverdrawInspector?o.Color.black:o.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=d.showOverdrawInspector,this.depthRangeFor3D=[0,1-(s._order.length+2)*this.numSublayers*this.depthEpsilon],!z)for(this.renderPass="opaque",this.currentLayer=v.length-1;this.currentLayer>=0;this.currentLayer--){let Q=this.style._layers[v[this.currentLayer]],le=S[Q.source],he=j[Q.source];this._renderTileClippingMasks(Q,he),this.renderLayer(this,le,Q,he)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<v.length;this.currentLayer++){let Q=this.style._layers[v[this.currentLayer]],le=S[Q.source];if(z&&z.renderLayer(Q))continue;let he=(Q.type==="symbol"?K:W)[Q.source];this._renderTileClippingMasks(Q,j[Q.source]),this.renderLayer(this,le,Q,he)}if(this.options.showTileBoundaries){let Q,le;
1375Object.values(this.style._layers).forEach((he=>{he.source&&!he.isHidden(this.transform.zoom)&&(he.source!==(le&&le.id)&&(le=this.style.sourceCaches[he.source]),(!Q||Q.getSource().maxzoom<le.getSource().maxzoom)&&(Q=le))})),Q&&Rl.debug(this,Q,Q.getVisibleCoordinates())}this.options.showPadding&&(function(Q){let le=Q.transform.padding;el(Q,Q.transform.height-(le.top||0),3,yh),el(Q,le.bottom||0,3,Un),tl(Q,le.left||0,3,Iu),tl(Q,Q.transform.width-(le.right||0),3,Lc);let he=Q.transform.centerPoint;(function(fe,Re,Me,Ae){Ll(fe,Re-1,Me-10,2,20,Ae),Ll(fe,Re-10,Me-1,20,2,Ae)})(Q,he.x,Q.transform.height-he.y,Jh)})(this),this.context.setDefault()}renderLayer(s,d,v,S){v.isHidden(this.transform.zoom)||(v.type==="background"||v.type==="custom"||(S||[]).length)&&(this.id=v.id,this.gpuTimingStart(v),Rl[v.type](s,d,v,S,this.style.placement.variableOffsets),this.gpuTimingEnd())}gpuTimingStart(s){if(!this.options.gpuTiming)return;let d=this.context.extTimerQuery,v=this.gpuTimers[s.id];v||(v=this.gpuTimers[s.id]={calls:0,cpuTime:0,query:d.createQueryEXT()}),v.calls++,d.beginQueryEXT(d.TIME_ELAPSED_EXT,v.query)}gpuTimingEnd(){if(!this.options.gpuTiming)return;let s=this.context.extTimerQuery;s.endQueryEXT(s.TIME_ELAPSED_EXT)}collectGpuTimers(){let s=this.gpuTimers;return this.gpuTimers={},s}queryGpuTimers(s){let d={};for(let v in s){let S=s[v],z=this.context.extTimerQuery,j=z.getQueryObjectEXT(S.query,z.QUERY_RESULT_EXT)/1e6;z.deleteQueryEXT(S.query),d[v]=j}return d}translatePosMatrix(s,d,v,S,z){if(!v[0]&&!v[1])return s;let j=z?S==="map"?this.transform.angle:0:S==="viewport"?-this.transform.angle:0;if(j){let Q=Math.sin(j),le=Math.cos(j);v=[v[0]*le-v[1]*Q,v[0]*Q+v[1]*le]}let W=[z?v[0]:sn(d,v[0],this.transform.zoom),z?v[1]:sn(d,v[1],this.transform.zoom),0],K=new Float32Array(16);return o.translate(K,s,W),K}saveTileTexture(s){let d=this._tileTextures[s.size[0]];d?d.push(s):this._tileTextures[s.size[0]]=[s]}getTileTexture(s){let d=this._tileTextures[s];return d&&d.length>0?d.pop():null}isPatternMissing(s){if(!s)return!1;if(!s.from||!s.to)return!0;let d=this.imageManager.getPattern(s.from.toString()),v=this.imageManager.getPattern(s.to.toString());return!d||!v}useProgram(s,d){this.cache=this.cache||{};let v=s+(d?d.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.terrain?"/terrain":"");return this.cache[v]||(this.cache[v]=new Wr(this.context,s,vo[s],d,Br[s],this._showOverdrawInspector,this.style.terrain)),this.cache[v]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){let s=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(s.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new Mt(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}}class As{constructor(s,d){this.points=s,this.planes=d}static fromInvProjectionMatrix(s,d,v){let S=Math.pow(2,v),z=[[-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((W=>{let K=1/(W=o.transformMat4([],W,s))[3]/d*S;return o.mul$1(W,W,[K,K,1/W[3],K])})),j=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((W=>{let K=o.sub([],z[W[0]],z[W[1]]),Q=o.sub([],z[W[2]],z[W[1]]),le=o.normalize([],o.cross([],K,Q)),he=-o.dot(le,z[W[1]]);return le.concat(he)}));return new As(z,j)}}class Bc{constructor(s,d){this.min=s,this.max=d,this.center=o.scale$1([],o.add([],this.min,this.max),.5)}quadrant(s){let d=[s%2==0,s<2],v=o.clone$2(this.min),S=o.clone$2(this.max);for(let z=0;z<d.length;z++)v[z]=d[z]?this.min[z]:this.center[z],S[z]=d[z]?this.center[z]:this.max[z];return S[2]=this.max[2],new Bc(v,S)}distanceX(s){return Math.max(Math.min(this.max[0],s[0]),this.min[0])-s[0]}distanceY(s){return Math.max(Math.min(this.max[1],s[1]),this.min[1])-s[1]}intersects(s){let d=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],
13751],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]],v=!0;for(let S=0;S<s.planes.length;S++){let z=s.planes[S],j=0;for(let W=0;W<d.length;W++)o.dot$1(z,d[W])>=0&&j++;if(j===0)return 0;j!==d.length&&(v=!1)}if(v)return 2;for(let S=0;S<3;S++){let z=Number.MAX_VALUE,j=-Number.MAX_VALUE;for(let W=0;W<s.points.length;W++){let K=s.points[W][S]-this.min[S];z=Math.min(z,K),j=Math.max(j,K)}if(j<0||z>this.max[S]-this.min[S])return 0}return 1}}class zs{constructor(s=0,d=0,v=0,S=0){if(isNaN(s)||s<0||isNaN(d)||d<0||isNaN(v)||v<0||isNaN(S)||S<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=s,this.bottom=d,this.left=v,this.right=S}interpolate(s,d,v){return d.top!=null&&s.top!=null&&(this.top=o.number(s.top,d.top,v)),d.bottom!=null&&s.bottom!=null&&(this.bottom=o.number(s.bottom,d.bottom,v)),d.left!=null&&s.left!=null&&(this.left=o.number(s.left,d.left,v)),d.right!=null&&s.right!=null&&(this.right=o.number(s.right,d.right,v)),this}getCenter(s,d){let v=o.clamp((this.left+s-this.right)/2,0,s),S=o.clamp((this.top+d-this.bottom)/2,0,d);return new o.pointGeometry(v,S)}equals(s){return this.top===s.top&&this.bottom===s.bottom&&this.left===s.left&&this.right===s.right}clone(){return new zs(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class Oc{constructor(s,d,v,S,z){this.tileSize=512,this.maxValidLatitude=85.051129,this.freezeElevation=!1,this._renderWorldCopies=z===void 0||!!z,this._minZoom=s||0,this._maxZoom=d||22,this._minPitch=v??0,this._maxPitch=S??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new o.LngLat(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new zs,this._posMatrixCache={},this._alignedPosMatrixCache={}}clone(){let s=new Oc(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return s.tileSize=this.tileSize,s.latRange=this.latRange,s.width=this.width,s.height=this.height,s._center=this._center,s._elevation=this._elevation,s.zoom=this.zoom,s.angle=this.angle,s._fov=this._fov,s._pitch=this._pitch,s._unmodified=this._unmodified,s._edgeInsets=this._edgeInsets.clone(),s._calcMatrices(),s}get minZoom(){return this._minZoom}set minZoom(s){this._minZoom!==s&&(this._minZoom=s,this.zoom=Math.max(this.zoom,s))}get maxZoom(){return this._maxZoom}set maxZoom(s){this._maxZoom!==s&&(this._maxZoom=s,this.zoom=Math.min(this.zoom,s))}get minPitch(){return this._minPitch}set minPitch(s){this._minPitch!==s&&(this._minPitch=s,this.pitch=Math.max(this.pitch,s))}get maxPitch(){return this._maxPitch}set maxPitch(s){this._maxPitch!==s&&(this._maxPitch=s,this.pitch=Math.min(this.pitch,s))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(s){s===void 0?s=!0:s===null&&(s=!1),this._renderWorldCopies=s}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new o.pointGeometry(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(s){let d=-o.wrap(s,-180,180)*Math.PI/180;var v;this.angle!==d&&(this._unmodified=!1,this.angle=d,this._calcMatrices(),this.rotationMatrix=(v=new o.ARRAY_TYPE(4),o.ARRAY_TYPE!=Float32Array&&(v[1]=0,v[2]=0),v[0]=1,v[3]=1,v),(function(S,z,j){var W=z[0],K=z[1],Q=z[2],le=z[3],he=Math.sin(j),fe=Math.cos(j);S[0]=W*fe+Q*he,S[1]=K*fe+le*he,S[2]=W*-he+Q*fe,S[3]=K*-he+le*fe})(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(s){let d=o.clamp(s,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==d&&(this._unmodified=!1,this._pitch=d,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(s){s=Math.max(.01,Math.min(60,s)),this._fov!==s&&(this._unmodified=!1,this._fov=s/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(s){let d=Math.min(Math.max(s,this.minZoom),this.maxZoom);this._zoom!==d&&(this._unmodified=!1,this._zoom=d,this.scale=this.zoomScale(d),this.tileZoom=Math.floor(d),this.zoomFraction=d-this.tileZoom,this._constrain(),this._calcMatrices())}get center(){return this._center}set center(s){s.lat===this._center.lat&&s.lng===this._center.lng||(this._unmodified=!1,this._center=s,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(s){s!==this._elevation&&(this._elevation=s,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(s){this._edgeInsets.equals(s)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,s,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(s){return this._edgeInsets.equals(s)}interpolatePadding(s,d,v){this._unmodified=!1,this._edgeInsets.interpolate(s,d,v),this._constrain(),this._calcMatrices()}coveringZoomLevel(s){let d=(s.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/s.tileSize));return Math.max(0,d)}getVisibleUnwrappedCoordinates(s){let d=[new o.UnwrappedTileID(0,s)];if(this._renderWorldCopies){let v=this.pointCoordinate(new o.pointGeometry(0,0)),S=this.pointCoordinate(new o.pointGeometry(this.width,0)),z=this.pointCoordinate(new o.pointGeometry(this.width,this.height)),j=this.pointCoordinate(new o.pointGeometry(0,this.height)),W=Math.floor(Math.min(v.x,S.x,z.x,j.x)),K=Math.floor(Math.max(v.x,S.x,z.x,j.x)),Q=1;for(let le=W-Q;le<=K+Q;le++)le!==0&&d.push(new o.UnwrappedTileID(le,s))}return d}coveringTiles(s){var d,v;let S=this.coveringZoomLevel(s),z=S;if(s.minzoom!==void 0&&S<s.minzoom)return[];s.maxzoom!==void 0&&S>s.maxzoom&&(S=s.maxzoom);let j=this.pointCoordinate(this.getCameraPoint()),W=o.MercatorCoordinate.fromLngLat(this.center),K=Math.pow(2,S),Q=[K*j.x,K*j.y,0],le=[K*W.x,K*W.y,0],he=As.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,S),fe=s.minzoom||0;!s.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(fe=S);let Re=s.terrain?2/Math.min(this.tileSize,s.tileSize)*this.tileSize:3,Me=Be=>({aabb:new Bc([Be*K,0,0],[(Be+1)*K,K,0]),zoom:0,x:0,y:0,wrap:Be,fullyVisible:!1}),Ae=[],Xe=[],et=S,rt=s.reparseOverscaled?z:S;if(this._renderWorldCopies)for(let Be=1;Be<=3;Be++)Ae.push(Me(-Be)),Ae.push(Me(Be));for(Ae.push(Me(0));Ae.length>0;){let Be=Ae.pop(),ht=Be.x,ot=Be.y,wt=Be.fullyVisible;if(!wt){let ai=Be.aabb.intersects(he);
1375if(ai===0)continue;wt=ai===2}let Tt=s.terrain?Q:le,Ft=Be.aabb.distanceX(Tt),gt=Be.aabb.distanceY(Tt),ri=Math.max(Math.abs(Ft),Math.abs(gt)),Xt=Re+(1<<et-Be.zoom)-2;if(Be.zoom===et||ri>Xt&&Be.zoom>=fe){let ai=et-Be.zoom,$i=Q[0]-.5-(ht<<ai),Ui=Q[1]-.5-(ot<<ai);Xe.push({tileID:new o.OverscaledTileID(Be.zoom===et?rt:Be.zoom,Be.wrap,Be.zoom,ht,ot),distanceSq:o.sqrLen([le[0]-.5-ht,le[1]-.5-ot]),tileDistanceToCamera:Math.sqrt($i*$i+Ui*Ui)})}else for(let ai=0;ai<4;ai++){let $i=(ht<<1)+ai%2,Ui=(ot<<1)+(ai>>1),yi=Be.zoom+1,vr=Be.aabb.quadrant(ai);if(s.terrain){let tr=new o.OverscaledTileID(yi,Be.wrap,yi,$i,Ui),cr=s.terrain.getMinMaxElevation(tr),ur=(d=cr.minElevation)!==null&&d!==void 0?d:this.elevation,mr=(v=cr.maxElevation)!==null&&v!==void 0?v:this.elevation;vr=new Bc([vr.min[0],vr.min[1],ur],[vr.max[0],vr.max[1],mr])}Ae.push({aabb:vr,zoom:yi,x:$i,y:Ui,wrap:Be.wrap,fullyVisible:wt})}}return Xe.sort(((Be,ht)=>Be.distanceSq-ht.distanceSq)).map((Be=>Be.tileID))}resize(s,d){this.width=s,this.height=d,this.pixelsToGLUnits=[2/s,-2/d],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(s){return Math.pow(2,s)}scaleZoom(s){return Math.log(s)/Math.LN2}project(s){let d=o.clamp(s.lat,-this.maxValidLatitude,this.maxValidLatitude);return new o.pointGeometry(o.mercatorXfromLng(s.lng)*this.worldSize,o.mercatorYfromLat(d)*this.worldSize)}unproject(s){return new o.MercatorCoordinate(s.x/this.worldSize,s.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}updateElevation(s){this.freezeElevation||(this.elevation=s?this.getElevation(this._center,s):0)}getElevation(s,d){let v=o.MercatorCoordinate.fromLngLat(s),S=(1<<this.tileZoom)*o.EXTENT,z=v.x*S,j=v.y*S,W=Math.floor(z/o.EXTENT),K=Math.floor(j/o.EXTENT),Q=new o.OverscaledTileID(this.tileZoom,0,this.tileZoom,W,K);return d.getElevation(Q,z%o.EXTENT,j%o.EXTENT,o.EXTENT)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(s){let d=this.pointLocation(this.centerPoint,s),v=this.getElevation(d,s);if(!(this.elevation-v))return;let S=this.getCameraPosition(),z=o.MercatorCoordinate.fromLngLat(S.lngLat,S.altitude),j=o.MercatorCoordinate.fromLngLat(d,v),W=z.x-j.x,K=z.y-j.y,Q=z.z-j.z,le=Math.sqrt(W*W+K*K+Q*Q),he=this.scaleZoom(this.cameraToCenterDistance/le/this.tileSize);this._elevation=v,this._center=d,this.zoom=he}setLocationAtPoint(s,d){let v=this.pointCoordinate(d),S=this.pointCoordinate(this.centerPoint),z=this.locationCoordinate(s),j=new o.MercatorCoordinate(z.x-(v.x-S.x),z.y-(v.y-S.y));this.center=this.coordinateLocation(j),this._renderWorldCopies&&
1375(this.center=this.center.wrap())}locationPoint(s,d){return d?this.coordinatePoint(this.locationCoordinate(s),this.getElevation(s,d),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(s))}pointLocation(s,d){return this.coordinateLocation(this.pointCoordinate(s,d))}locationCoordinate(s){return o.MercatorCoordinate.fromLngLat(s)}coordinateLocation(s){return s&&s.toLngLat()}pointCoordinate(s,d){if(d){let fe=d.pointCoordinate(s);if(fe!=null)return fe}let v=[s.x,s.y,0,1],S=[s.x,s.y,1,1];o.transformMat4(v,v,this.pixelMatrixInverse),o.transformMat4(S,S,this.pixelMatrixInverse);let z=v[3],j=S[3],W=v[1]/z,K=S[1]/j,Q=v[2]/z,le=S[2]/j,he=Q===le?0:(0-Q)/(le-Q);return new o.MercatorCoordinate(o.number(v[0]/z,S[0]/j,he)/this.worldSize,o.number(W,K,he)/this.worldSize)}coordinatePoint(s,d=0,v=this.pixelMatrix){let S=[s.x*this.worldSize,s.y*this.worldSize,d,1];return o.transformMat4(S,S,v),new o.pointGeometry(S[0]/S[3],S[1]/S[3])}getBounds(){let s=Math.max(0,this.height/2-this.getHorizon());return new o.LngLatBounds().extend(this.pointLocation(new o.pointGeometry(0,s))).extend(this.pointLocation(new o.pointGeometry(this.width,s))).extend(this.pointLocation(new o.pointGeometry(this.width,this.height))).extend(this.pointLocation(new o.pointGeometry(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new o.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(s){s?(this.lngRange=[s.getWest(),s.getEast()],this.latRange=[s.getSouth(),s.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(s,d=!1){let v=s.key,S=d?this._alignedPosMatrixCache:this._posMatrixCache;if(S[v])return S[v];let z=s.canonical,j=this.worldSize/this.zoomScale(z.z),W=z.x+Math.pow(2,z.z)*s.wrap,K=o.identity(new Float64Array(16));return o.translate(K,K,[W*j,z.y*j,0]),o.scale(K,K,[j/o.EXTENT,j/o.EXTENT,1]),o.multiply(K,d?this.alignedProjMatrix:this.projMatrix,K),S[v]=new Float32Array(K),S[v]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let s,d,v,S,z=-90,j=90,W=-180,K=180,Q=this.size,le=this._unmodified;if(this.latRange){let Re=this.latRange;z=o.mercatorYfromLat(Re[1])*this.worldSize,j=o.mercatorYfromLat(Re[0])*this.worldSize,s=j-z<Q.y?Q.y/(j-z):0}if(this.lngRange){let Re=this.lngRange;W=o.wrap(o.mercatorXfromLng(Re[0])*this.worldSize,0,this.worldSize),K=o.wrap(o.mercatorXfromLng(Re[1])*this.worldSize,0,this.worldSize),K<W&&(K+=this.worldSize),d=K-W<Q.x?Q.x/(K-W):0}let he=this.point,fe=Math.max(d||0,s||0);if(fe)return this.center=this.unproject(new o.pointGeometry(d?(K+W)/2:he.x,s?(j+z)/2:he.y)),this.zoom+=this.scaleZoom(fe),this._unmodified=le,void(this._constraining=!1);if(this.latRange){let Re=he.y,Me=Q.y/2;Re-Me<z&&(S=z+Me),Re+Me>j&&(S=j-Me)}if(this.lngRange){let Re=(W+K)/2,Me=o.wrap(he.x,Re-this.worldSize/2,Re+this.worldSize/2),Ae=Q.x/2;Me-Ae<W&&(v=W+Ae),Me+Ae>K&&(v=K-Ae)}v===void 0&&S===void 0||(this.center=this.unproject(new o.pointGeometry(v!==void 0?v:he.x,S!==void 0?S:he.y)).wrap()),this._unmodified=le,this._constraining=!1}_calcMatrices(){if(!this.height)return;let s=this.centerOffset,d=this.point.x,v=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=o.mercatorZfromAltitude(1,this.center.lat)*this.worldSize;let S=o.identity(new Float64Array(16));o.scale(S,S,[this.width/2,-this.height/2,1]),o.translate(S,S,[1,-1,0]),this.labelPlaneMatrix=S,S=o.identity(new Float64Array(16)),o.scale(S,S,[1,-1,1]),o.translate(S,S,[-1,-1,0]),o.scale(S,S,[2/this.width,2/this.height,1]),this.glCoordMatrix=S,this.cameraToSeaLevelDistance=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch);let z=Math.PI/2+this._pitch,j=this._fov*(.5+s.y/this.height),W=Math.sin(j)*this.cameraToSeaLevelDistance/Math.sin(o.clamp(Math.PI-z-j,.01,Math.PI-.01)),K=this.getHorizon(),Q=2*Math.atan(K/this.cameraToCenterDistance)*(.5+s.y/(2*K)),le=Math.sin(Q)*this.cameraToSeaLevelDistance/Math.sin(o.clamp(Math.PI-z-Q,.01,Math.PI-.01)),he=Math.cos(Math.PI/2-this._pitch)*W+this.cameraToSeaLevelDistance,fe=Math.cos(Math.PI/2-this._pitch)*le+this.cameraToSeaLevelDistance,Re=1.01*Math.min(he,fe),Me=this.height/50;S=new Float64Array(16),o.perspective(S,this._fov,this.width/this.height,Me,Re),S[8]=2*-s.x/this.width,S[9]=2*s.y/this.height,o.scale(S,S,[1,-1,1]),o.translate(S,S,[0,0,-this.cameraToCenterDistance]),o.rotateX(S,S,this._pitch),o.rotateZ(S,S,this.angle),o.translate(S,S,[-d,-v,0]),this.mercatorMatrix=o.scale([],S,[this.worldSize,this.worldSize,this.worldSize]),o.scale(S,S,[1,1,this._pixelPerMeter]),this.pixelMatrix=o.multiply(new Float64Array(16),this.labelPlaneMatr
1375ix,S),o.translate(S,S,[0,0,-this.elevation]),this.projMatrix=S,this.invProjMatrix=o.invert([],S),this.pixelMatrix3D=o.multiply(new Float64Array(16),this.labelPlaneMatrix,S);let Ae=this.width%2/2,Xe=this.height%2/2,et=Math.cos(this.angle),rt=Math.sin(this.angle),Be=d-Math.round(d)+et*Ae+rt*Xe,ht=v-Math.round(v)+et*Xe+rt*Ae,ot=new Float64Array(S);if(o.translate(ot,ot,[Be>.5?Be-1:Be,ht>.5?ht-1:ht,0]),this.alignedProjMatrix=ot,S=o.invert(new Float64Array(16),this.pixelMatrix),!S)throw new Error("failed to invert matrix");this.pixelMatrixInverse=S,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let s=this.pointCoordinate(new o.pointGeometry(0,0)),d=[s.x*this.worldSize,s.y*this.worldSize,0,1];return o.transformMat4(d,d,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let s=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new o.pointGeometry(0,s))}getCameraQueryGeometry(s){let d=this.getCameraPoint();if(s.length===1)return[s[0],d];{let v=d.x,S=d.y,z=d.x,j=d.y;for(let W of s)v=Math.min(v,W.x),S=Math.min(S,W.y),z=Math.max(z,W.x),j=Math.max(j,W.y);return[new o.pointGeometry(v,S),new o.pointGeometry(z,S),new o.pointGeometry(z,j),new o.pointGeometry(v,j),new o.pointGeometry(v,S)]}}}class Eu{constructor(s){this._hashName=s&&encodeURIComponent(s),o.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(function(d,v){let S=!1,z=null,j=()=>{z=null,S&&(d(),z=setTimeout(j,300),S=!1)};return()=>(S=!0,z||j(),z)})(this._updateHashUnthrottled.bind(this))}addTo(s){return this._map=s,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(s){let d=this._map.getCenter(),v=Math.round(100*this._map.getZoom())/100,S=Math.ceil((v*Math.LN2+Math.log(512/360/.5))/Math.LN10),z=Math.pow(10,S),j=Math.round(d.lng*z)/z,W=Math.round(d.lat*z)/z,K=this._map.getBearing(),Q=this._map.getPitch(),le="";if(le+=s?`/${j}/${W}/${v}`:`${v}/${W}/${j}`,(K||Q)&&(le+="/"+Math.round(10*K)/10),Q&&(le+=`/${Math.round(Q)}`),this._hashName){let he=this._hashName,fe=!1,Re=window.location.hash.slice(1).split("&").map((Me=>{let Ae=Me.split("=")[0];return Ae===he?(fe=!0,`${Ae}=${le}`):Me})).filter((Me=>Me));return fe||Re.push(`${he}=${le}`),`#${Re.join("&")}`}return`#${le}`}_getCurrentHash(){let s=window.location.hash.replace("#","");if(this._hashName){let d;return s.split("&").map((v=>v.split("="))).forEach((v=>{v[0]===this._hashName&&(d=v)})),(d&&d[1]||"").split("/")}return s.split("/")}_onHashChange(){let s=this._getCurrentHash();if(s.length>=3&&!s.some((d=>isNaN(d)))){let d=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(s[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+s[2],+s[1]],zoom:+s[0],bearing:d,pitch:+(s[4]||0)}),!0}return!1}_updateHashUnthrottled(){let s=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,s)}catch{}}}let Ds={linearity:.3,easing:o.bezier(0,0,.3,1)},eu=o.extend({deceleration:2500,maxSpeed:1400},Ds),tu=o.extend({deceleration:20,maxSpeed:1400},Ds),xh=o.extend({deceleration:1e3,maxSpeed:360},Ds),Fl=o.extend({deceleration:1e3,maxSpeed:90},Ds);class Bl{constructor(s){this._map=s,this.clear()}clear(){this._inertiaBuffer=[]}record(s){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:o.exported.now(),settings:s})}_drainInertiaBuffer(){let s=this._inertiaBuffer,d=o.exported.now();for(;s.length>0&&d-s[0].time>160;)s.shift()}_onMoveEnd(s){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let d={zoom:0,bearing:0,pitch:0,pan:new o.pointGeometry(0,0),pinchAround:void 0,around:void 0};for(let{settings:z}of this._inertiaBuffer)d.zoom+=z.zoomDelta||0,d.bearing+=z.bearingDelta||0,d.pitch+=z.pitchDelta||0,z.panDelta&&d.pan._add(z.panDelta),z.around&&(d.around=z.around),z.pinchAround&&(d.pinchAround=z.pinchAround);let v=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,S={};if(d.pan.mag()){let z=Ol(d.pan.mag(),v,o.extend({},eu,s||{}));S.offset=d.pan.mult(z.amount/d.pan.mag()),S.center=this._map.transform.center,Vo(S,z)}if(d.zoom){let z=Ol(d.zoom,v,tu);S.zoom=this._map.transform.zoom+z.amount,Vo(S,z)}if(d.bearing){let z=Ol(d.bearing,v,xh);
vendor: 6,443 bytes, line 1375
1375S.bearing=this._map.transform.bearing+o.clamp(z.amount,-179,179),Vo(S,z)}if(d.pitch){let z=Ol(d.pitch,v,Fl);S.pitch=this._map.transform.pitch+z.amount,Vo(S,z)}if(S.zoom||S.bearing){let z=d.pinchAround===void 0?d.around:d.pinchAround;S.around=z?this._map.unproject(z):this._map.getCenter()}return this.clear(),o.extend(S,{noMoveStart:!0})}}function Vo(T,s){(!T.duration||T.duration<s.duration)&&(T.duration=s.duration,T.easing=s.easing)}function Ol(T,s,d){let{maxSpeed:v,linearity:S,deceleration:z}=d,j=o.clamp(T*S/(s/1e3),-v,v),W=Math.abs(j)/(z*S);return{easing:d.easing,duration:1e3*W,amount:j*(W/2)}}class wo extends o.Event{constructor(s,d,v,S={}){let z=Ze.mousePos(d.getCanvasContainer(),v),j=d.unproject(z);super(s,o.extend({point:z,lngLat:j,originalEvent:v},S)),this._defaultPrevented=!1,this.target=d}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class rl extends o.Event{constructor(s,d,v){let S=s==="touchend"?v.changedTouches:v.touches,z=Ze.touchPos(d.getCanvasContainer(),S),j=z.map((K=>d.unproject(K))),W=z.reduce(((K,Q,le,he)=>K.add(Q.div(he.length))),new o.pointGeometry(0,0));super(s,{points:z,point:W,lngLats:j,lngLat:d.unproject(W),originalEvent:v}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class To extends o.Event{constructor(s,d,v){super(s,{originalEvent:v}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class iu{constructor(s,d){this._map=s,this._clickTolerance=d.clickTolerance}reset(){delete this._mousedownPos}wheel(s){return this._firePreventable(new To(s.type,this._map,s))}mousedown(s,d){return this._mousedownPos=d,this._firePreventable(new wo(s.type,this._map,s))}mouseup(s){this._map.fire(new wo(s.type,this._map,s))}click(s,d){this._mousedownPos&&this._mousedownPos.dist(d)>=this._clickTolerance||this._map.fire(new wo(s.type,this._map,s))}dblclick(s){return this._firePreventable(new wo(s.type,this._map,s))}mouseover(s){this._map.fire(new wo(s.type,this._map,s))}mouseout(s){this._map.fire(new wo(s.type,this._map,s))}touchstart(s){return this._firePreventable(new rl(s.type,this._map,s))}touchmove(s){this._map.fire(new rl(s.type,this._map,s))}touchend(s){this._map.fire(new rl(s.type,this._map,s))}touchcancel(s){this._map.fire(new rl(s.type,this._map,s))}_firePreventable(s){if(this._map.fire(s),s.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class No{constructor(s){this._map=s}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(s){this._map.fire(new wo(s.type,this._map,s))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new wo("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(s){this._delayContextMenu?this._contextMenuEvent=s:this._ignoreContextMenu||this._map.fire(new wo(s.type,this._map,s)),this._map.listens("contextmenu")&&s.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class vh{constructor(s,d){this._map=s,this._el=s.getCanvasContainer(),this._container=s.getContainer(),this._clickTolerance=d.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(s,d){this.isEnabled()&&s.shiftKey&&s.button===0&&(Ze.disableDrag(),this._startPos=this._lastPos=d,this._active=!0)}mousemoveWindow(s,d){if(!this._active)return;let v=d;if(this._lastPos.equals(v)||!this._box&&v.dist(this._startPos)<this._clickTolerance)return;let S=this._startPos;this._lastPos=v,this._box||(this._box=Ze.create("div","maplibregl-boxzoom mapboxgl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair","mapboxgl-crosshair"),this._fireEvent("boxzoomstart",s));let z=Math.min(S.x,v.x),j=Math.max(S.x,v.x),W=Math.min(S.y,v.y),K=Math.max(S.y,v.y);Ze.setTransform(this._box,`translate(${z}px,${W}px)`),this._box.style.width=j-z+"px",this._box.style.height=K-W+"px"}mouseupWindow(s,d){if(!this._active||s.button!==0)return;let v=this._startPos,S=d;if(this.reset(),Ze.suppressClick(),v.x!==S.x||v.y!==S.y)return this._map.fire(new o.Event("boxzoomend",{originalEvent:s})),{cameraAnimation:z=>z.fitScreenCoordinates(v,S,this._map.getBearing(),{linear:!0})};this._fireEvent("boxzoomcancel",s)}keydown(s){this._active&&s.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",s))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair","mapboxgl-crosshair"),this._box&&(Ze.remove(this._box),this._box=null),Ze.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(s,d){return this._map.fire(new o.Event(s,{originalEvent:d}))}}function us(T,s){if(T.length!==s.length)throw new Error(`The number of touches and points are not equal - touches ${T.length}, points ${s.length}`);let d={};for(let v=0;v<T.length;v++)d[T[v].identifier]=s[v];return d}class Vc{constructor(s){this.reset(),this.numTouches=s.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(s,d,v){(this.centroid||v.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=s.timeStamp),v.length===this.numTouches&&(this.centroid=(function(S){let z=new o.pointGeometry(0,0);for(let j of S)z._add(j);return z.div(S.length)})(d),this.touches=us(v,d)))}touchmove(s,d,v){if(this.aborted||!this.centroid)return;let S=us(v,d);for(let z in this.touches){let j=this.touches[z],W=S[z];(!W||W.dist(j)>30)&&(this.aborted=!0)}}touchend(s,d,v){if((!this.centroid||s.timeStamp-this.startTime>500)&&(this.aborted=!0),v.length===0){let S=!this.aborted&&this.centroid;if(this.reset(),S)return S}}}class ru{constructor(s){this.singleTap=new Vc(s),this.numTaps=s.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(s,d,v){this.singleTap.touchstart(s,d,v)}touchmove(s,d,v){this.singleTap.touchmove(s,d,v)}touchend(s,d,v){let S=this.singleTap.touchend(s,d,v);if(S){let z=s.timeStamp-this.lastTime<500,j=!this.lastTap||this.lastTap.dist(S)<30;if(z&&j||this.reset(),this.count++,this.lastTime=s.timeStamp,this.lastTap=S,this.count===this.numTaps)return this.reset(),S}}}
1375class Ip{constructor(){this._zoomIn=new ru({numTouches:1,numTaps:2}),this._zoomOut=new ru({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(s,d,v){this._zoomIn.touchstart(s,d,v),this._zoomOut.touchstart(s,d,v)}touchmove(s,d,v){this._zoomIn.touchmove(s,d,v),this._zoomOut.touchmove(s,d,v)}touchend(s,d,v){let S=this._zoomIn.touchend(s,d,v),z=this._zoomOut.touchend(s,d,v);return S?(this._active=!0,s.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:j=>j.easeTo({duration:300,zoom:j.getZoom()+1,around:j.unproject(S)},{originalEvent:s})}):z?(this._active=!0,s.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:j=>j.easeTo({duration:300,zoom:j.getZoom()-1,around:j.unproject(z)},{originalEvent:s})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}let Mu={0:1,2:2};class dr{constructor(s){this.reset(),this._clickTolerance=s.clickTolerance||1}reset(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton}_correctButton(s,d){return!1}_move(s,d){return{}}mousedown(s,d){if(this._lastPoint)return;let v=Ze.mouseButton(s);this._correctButton(s,v)&&(this._lastPoint=d,this._eventButton=v)}mousemoveWindow(s,d){let v=this._lastPoint;if(v){if(s.preventDefault(),(function(S,z){let j=Mu[z];return S.buttons===void 0||(S.buttons&j)!==j})(s,this._eventButton))this.reset();else if(this._moved||!(d.dist(v)<this._clickTolerance))return this._moved=!0,this._lastPoint=d,this._move(v,d)}}mouseupWindow(s){this._lastPoint&&Ze.mouseButton(s)===this._eventButton&&(this._moved&&Ze.suppressClick(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class oc extends dr{mousedown(s,d){super.mousedown(s,d),this._lastPoint&&(this._active=!0)}_correctButton(s,d){return d===0&&!s.ctrlKey}_move(s,d){return{around:d,panDelta:d.sub(s)}}}class Sa extends dr{_correctButton(s,d){return d===0&&s.ctrlKey||d===2}_move(s,d){let v=.8*(d.x-s.x);if(v)return this._active=!0,{bearingDelta:v}}contextmenu(s){s.preventDefault()}}class ui extends dr{_correctButton(s,d){return d===0&&s.ctrlKey||d===2}_move(s,d){let v=-.5*(d.y-s.y);if(v)return this._active=!0,{pitchDelta:v}}contextmenu(s){s.preventDefault()}}class Nc{constructor(s,d){this._minTouches=s.cooperativeGestures?2:1,this._clickTolerance=s.clickTolerance||1,this._map=d,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new o.pointGeometry(0,0),setTimeout((()=>{this._cancelCooperativeMessage=!1}),200)}touchstart(s,d,v){return this._calculateTransform(s,d,v)}touchmove(s,d,v){if(this._map._cooperativeGestures&&(this._minTouches===2&&v.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(s,!1,v.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(v.length<this._minTouches))return s.preventDefault(),this._calculateTransform(s,d,v)}touchend(s,d,v){this._calculateTransform(s,d,v),this._active&&v.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(s,d,v){v.length>0&&(this._active=!0);let S=us(v,d),z=new o.pointGeometry(0,0),j=new o.pointGeometry(0,0),W=0;for(let Q in S){let le=S[Q],he=this._touches[Q];he&&(z._add(le),j._add(le.sub(he)),W++,S[Q]=le)}if(this._touches=S,W<this._minTouches||!j.mag())return;let K=j.div(W);return this._sum._add(K),this._sum.mag()<this._clickTolerance?void 0:{around:z.div(W),panDelta:K}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ls{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}_start(s){}_move(s,d,v){return{}}touchstart(s,d,v){this._firstTwoTouches||v.length<2||(this._firstTwoTouches=[v[0].identifier,v[1].identifier],this._start([d[0],d[1]]))}touchmove(s,d,v){if(!this._firstTwoTouches)return;s.preventDefault();let[S,z]=this._firstTwoTouches,j=Uo(v,d,S),W=Uo(v,d,z);
1375if(!j||!W)return;let K=this._aroundCenter?null:j.add(W).div(2);return this._move([j,W],K,s)}touchend(s,d,v){if(!this._firstTwoTouches)return;let[S,z]=this._firstTwoTouches,j=Uo(v,d,S),W=Uo(v,d,z);j&&W||(this._active&&Ze.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(s){this._enabled=!0,this._aroundCenter=!!s&&s.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function Uo(T,s,d){for(let v=0;v<T.length;v++)if(T[v].identifier===d)return s[v]}function Vl(T,s){return Math.log(T/s)/Math.LN2}class Yt extends Ls{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(s){this._startDistance=this._distance=s[0].dist(s[1])}_move(s,d){let v=this._distance;if(this._distance=s[0].dist(s[1]),this._active||!(Math.abs(Vl(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Vl(this._distance,v),pinchAround:d}}}function So(T,s){return 180*T.angleWith(s)/Math.PI}class Pu extends Ls{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(s){this._startVector=this._vector=s[0].sub(s[1]),this._minDiameter=s[0].dist(s[1])}_move(s,d){let v=this._vector;if(this._vector=s[0].sub(s[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:So(this._vector,v),pinchAround:d}}_isBelowThreshold(s){this._minDiameter=Math.min(this._minDiameter,s.mag());let d=25/(Math.PI*this._minDiameter)*360,v=So(s,this._startVector);return Math.abs(v)<d}}function bh(T){return Math.abs(T.y)>Math.abs(T.x)}class Uc extends Ls{constructor(s){super(),this._map=s}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(s,d,v){super.touchstart(s,d,v),this._currentTouchCount=v.length}_start(s){this._lastPoints=s,bh(s[0].sub(s[1]))&&(this._valid=!1)}_move(s,d,v){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;let S=s[0].sub(this._lastPoints[0]),z=s[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(S,z,v.timeStamp),this._valid?(this._lastPoints=s,this._active=!0,{pitchDelta:(S.y+z.y)/2*-.5}):void 0}gestureBeginsVertically(s,d,v){if(this._valid!==void 0)return this._valid;let S=s.mag()>=2,z=d.mag()>=2;if(!S&&!z)return;if(!S||!z)return this._firstMove===void 0&&(this._firstMove=v),v-this._firstMove<100&&void 0;let j=s.y>0==d.y>0;return bh(s)&&bh(d)&&j}}let nl={panStep:100,bearingStep:15,pitchStep:10};class jc{constructor(){let s=nl;this._panStep=s.panStep,this._bearingStep=s.bearingStep,this._pitchStep=s.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(s){if(s.altKey||s.ctrlKey||s.metaKey)return;let d=0,v=0,S=0,z=0,j=0;switch(s.keyCode){case 61:case 107:case 171:case 187:d=1;break;case 189:case 109:case 173:d=-1;break;case 37:s.shiftKey?v=-1:(s.preventDefault(),z=-1);break;case 39:s.shiftKey?v=1:(s.preventDefault(),z=1);break;case 38:s.shiftKey?S=1:(s.preventDefault(),j=-1);break;case 40:s.shiftKey?S=-1:(s.preventDefault(),j=1);break;default:return}return this._rotationDisabled&&(v=0,S=0),{cameraAnimation:W=>{let K=W.getZoom();W.easeTo({duration:300,easeId:"keyboardHandler",easing:wh,zoom:d?Math.round(K)+d*(s.shiftKey?2:1):K,bearing:W.getBearing()+v*this._bearingStep,pitch:W.getPitch()+S*this._pitchStep,offset:[-z*this._panStep,-j*this._panStep],center:W.getCenter()},{originalEvent:s})}}}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 wh(T){return T*(2-T)}let ac=4.000244140625;class sc{constructor(s,d){this._map=s,this._el=s.getCanvasContainer(),this._handler=d,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,o.bindAll(["_onTimeout"],this)}setZoomRate(s){this._defaultZoomRate=s}setWheelZoomRate(s){this._wheelZoomRate=s}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(s){this.isEnabled()||(this._enabled=!0,this._aroundCenter=s&&s.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(s){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!this._map._metaPress)return;s.preventDefault()}let d=s.deltaMode===WheelEvent.DOM_DELTA_LINE?40*s.deltaY:s.deltaY,v=o.exported.now(),S=v-(this._lastWheelEventTime||0);this._lastWheelEventTime=v,d!==0&&d%ac==0?this._type="wheel":d!==0&&Math.abs(d)<4?this._type="trackpad":S>400?(this._type=null,this._lastValue=d,this._timeout=setTimeout(this._onTimeout,40,s)):this._type||(this._type=Math.abs(S*d)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,d+=this._lastValue)),s.shiftKey&&d&&(d/=4),this._type&&(this._lastWheelEvent=s,this._delta-=d,this._active||this._start(s)),s.preventDefault()}_onTimeout(s){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(s)}_start(s){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);let d=Ze.mousePos(this._el,s);this._around=o.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(d)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRe
1375nderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let s=this._map.transform;if(this._delta!==0){let W=this._type==="wheel"&&Math.abs(this._delta)>ac?this._wheelZoomRate:this._defaultZoomRate,K=2/(1+Math.exp(-Math.abs(this._delta*W)));this._delta<0&&K!==0&&(K=1/K);let Q=typeof this._targetZoom=="number"?s.zoomScale(this._targetZoom):s.scale;this._targetZoom=Math.min(s.maxZoom,Math.max(s.minZoom,s.scaleZoom(Q*K))),this._type==="wheel"&&(this._startZoom=s.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let d=typeof this._targetZoom=="number"?this._targetZoom:s.zoom,v=this._startZoom,S=this._easing,z,j=!1;if(this._type==="wheel"&&v&&S){let W=Math.min((o.exported.now()-this._lastWheelEventTime)/200,1),K=S(W);z=o.number(v,d,K),W<1?this._frameId||(this._frameId=!0):j=!0}else z=d,j=!0;return this._active=!0,j&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!j,zoomDelta:z-s.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(s){let d=o.ease;if(this._prevEase){let v=this._prevEase,S=(o.exported.now()-v.start)/v.duration,z=v.easing(S+.01)-v.easing(S),j=.27/Math.sqrt(z*z+1e-4)*.01,W=Math.sqrt(.0729-j*j);d=o.bezier(j,W,.25,1)}return this._prevEase={start:o.exported.now(),duration:s,easing:d},d}reset(){this._active=!1}}class Th{constructor(s,d){this._clickZoom=s,this._tapZoom=d}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 ol{constructor(){this.reset()}reset(){this._active=!1}dblclick(s,d){return s.preventDefault(),{cameraAnimation:v=>{v.easeTo({duration:300,zoom:v.getZoom()+(s.shiftKey?-1:1),around:v.unproject(d)},{originalEvent:s})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class al{constructor(){this._tap=new ru({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()}touchstart(s,d,v){this._swipePoint||(this._tapTime&&s.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?v.length>0&&(this._swipePoint=d[0],this._swipeTouch=v[0].identifier):this._tap.touchstart(s,d,v))}touchmove(s,d,v){if(this._tapTime){if(this._swipePoint){if(v[0].identifier!==this._swipeTouch)return;let S=d[0],z=S.y-this._swipePoint.y;return this._swipePoint=S,s.preventDefault(),this._active=!0,{zoomDelta:z/128}}}else this._tap.touchmove(s,d,v)}touchend(s,d,v){this._tapTime?this._swipePoint&&v.length===0&&this.reset():this._tap.touchend(s,d,v)&&(this._tapTime=s.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Io{constructor(s,d,v){this._el=s,this._mousePan=d,this._touchPan=v}enable(s){this._inertiaOptions=s||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class ps{constructor(s,d,v){this._pitchWithRotate=s.pitchWithRotate,this._mouseRotate=d,this._mousePitch=v}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 Ji{constructor(s,d,v,S){this._el=s,this._touchZoom=d,this._touchRotate=v,this._tapDragZoom=S,this._rotationDisabled=!1,this._enabled=!0}enable(s){this._touchZoom.enable(s),this._rotationDisabled||this._touchRotate.enable(s),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate","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()}}let Rs=T=>T.zoom||T.drag||T.pitch||T.rotate;class nu extends o.Event{}function lc(T){return T.panDelta&&T.panDelta.mag()||T.zoomDelta||T.bearingDelta||T.pitchDelta}class cc{constructor(s,d){this._map=s,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Bl(s),this._bearingSnap=d.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(d),o.bindAll(["handleEvent","handleWindowEvent"],this);let v=this._el;this._listeners=[[v,"touchstart",{passive:!0}],[v,"touchmove",{passive:!1}],[v,"touchend",void 0],[v,"touchcancel",void 0],[v,"mousedown",void 0],[v,"mousemove",void 0],[v,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[v,"mouseover",void 0],[v,"mouseout",void 0],[v,"dblclick",void 0],[v,"click",void 0],[v,"keydown",{capture:!1}],[v,"keyup",void 0],[v,"wheel",{passive:!1}],[v,"contextmenu",void 0],[window,"blur",void 0]];for(let[S,z,j]of this._listeners)Ze.addEventListener(S,z,S===document?this.handleWindowEvent:this.handleEvent,j)}destroy(){for(let[s,d,v]of this._listeners)Ze.removeEventListener(s,d,s===document?this.handleWindowEvent:this.handleEvent,v)}_addDefaultHandlers(s){let d=this._map,v=d.getCanvasContainer();this._add("mapEvent",new iu(d,s));let S=d.boxZoom=new vh(d,s);this._add("boxZoom",S);let z=new Ip,j=new ol;d.doubleClickZoom=new Th(j,z),this._add("tapZoom",z),this._add("clickZoom",j);let W=new al;this._add("tapDragZoom",W);let K=d.touchPitch=new Uc(d);this._add("touchPitch",K);let Q=new Sa(s),le=new ui(s);d.dragRotate=new ps(s,Q,le),this._add("mouseRotate",Q,["mousePitch"]),this._add("mousePitch",le,["mouseRotate"]);let he=new oc(s),fe=new Nc(s,d);d.dragPan=new Io(v,he,fe),this._add("mousePan",he),this._add("touchPan",fe,["touchZoom","touchRotate"]);let Re=new Pu,Me=new Yt;d.touchZoomRotate=new Ji(v,Me,Re,W),this._add("touchRotate",Re,["touchPan","touchZoom"]),this._add("touchZoom",Me,["touchPan","touchRotate"]);let Ae=d.scrollZoom=new sc(d,this);this._add("scrollZoom",Ae,["mousePan"]);let Xe=d.keyboard=new jc;
1375this._add("keyboard",Xe),this._add("blockableMapEvent",new No(d));for(let et of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])s.interactive&&s[et]&&d[et].enable(s[et])}_add(s,d,v){this._handlers.push({handlerName:s,handler:d,allowed:v}),this._handlersById[s]=d}stop(s){if(!this._updatingCamera){for(let{handler:d}of this._handlers)d.reset();this._inertia.clear(),this._fireEvents({},{},s),this._changes=[]}}isActive(){for(let{handler:s}of this._handlers)if(s.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Rs(this._eventsInProgress)||this.isZooming()}_blockedByActive(s,d,v){for(let S in s)if(S!==v&&(!d||d.indexOf(S)<0))return!0;return!1}handleWindowEvent(s){this.handleEvent(s,`${s.type}Window`)}_getMapTouches(s){let d=[];for(let v of s)this._el.contains(v.target)&&d.push(v);return d}handleEvent(s,d){if(s.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let v=s.type==="renderFrame"?void 0:s,S={needsRenderFrame:!1},z={},j={},W=s.touches,K=W?this._getMapTouches(W):void 0,Q=K?Ze.touchPos(this._el,K):Ze.mousePos(this._el,s);for(let{handlerName:fe,handler:Re,allowed:Me}of this._handlers){if(!Re.isEnabled())continue;let Ae;this._blockedByActive(j,Me,fe)?Re.reset():Re[d||s.type]&&(Ae=Re[d||s.type](s,Q,K),this.mergeHandlerResult(S,z,Ae,fe,v),Ae&&Ae.needsRenderFrame&&this._triggerRenderFrame()),(Ae||Re.isActive())&&(j[fe]=Re)}let le={};for(let fe in this._previousActiveHandlers)j[fe]||(le[fe]=v);this._previousActiveHandlers=j,(Object.keys(le).length||lc(S))&&(this._changes.push([S,z,le]),this._triggerRenderFrame()),(Object.keys(j).length||lc(S))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:he}=S;he&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],he(this._map))}mergeHandlerResult(s,d,v,S,z){if(!v)return;o.extend(s,v);let j={handlerName:S,originalEvent:v.originalEvent||z};v.zoomDelta!==void 0&&(d.zoom=j),v.panDelta!==void 0&&(d.drag=j),v.pitchDelta!==void 0&&(d.pitch=j),v.bearingDelta!==void 0&&(d.rotate=j)}_applyChanges(){let s={},d={},v={};for(let[S,z,j]of this._changes)S.panDelta&&(s.panDelta=(s.panDelta||new o.pointGeometry(0,0))._add(S.panDelta)),S.zoomDelta&&(s.zoomDelta=(s.zoomDelta||0)+S.zoomDelta),S.bearingDelta&&(s.bearingDelta=(s.bearingDelta||0)+S.bearingDelta),S.pitchDelta&&(s.pitchDelta=(s.pitchDelta||0)+S.pitchDelta),S.around!==void 0&&(s.around=S.around),S.pinchAround!==void 0&&(s.pinchAround=S.pinchAround),S.noInertia&&(s.noInertia=S.noInertia),o.extend(d,z),o.extend(v,j);this._updateMapTransform(s,d,v),this._changes=[]}_updateMapTransform(s,d,v){let S=this._map,z=S.transform,j=S.style&&S.style.terrain;if(!(lc(s)||j&&this._drag))return this._fireEvents(d,v,!0);let{panDelta:W,zoomDelta:K,bearingDelta:Q,pitchDelta:le,around:he,pinchAround:fe}=s;fe!==void 0&&(he=fe),S._stop(!0),he=he||S.transform.centerPoint;let Re=z.pointLocation(W?he.sub(W):he);Q&&(z.bearing+=Q),le&&(z.pitch+=le),K&&(z.zoom+=K),j?d.drag&&!this._drag?(this._drag={center:z.centerPoint,lngLat:z.pointLocation(he),point:he,handlerName:d.drag.handlerName},S.fire(new o.Event("freezeElevation",{freeze:!0}))):this._drag&&v[this._drag.handlerName]?(S.fire(new o.Event("freezeElevation",{freeze:!1})),this._drag=null):d.drag&&this._drag&&(z.center=z.pointLocation(z.centerPoint.sub(W))):z.setLocationAtPoint(Re,he),this._map._update(),s.noInertia||this._inertia.record(s),this._fireEvents(d,v,!0)}_fireEvents(s,d,v){let S=Rs(this._eventsInProgress),z=Rs(s),j={};for(let le in s){let{originalEvent:he}=s[le];this._eventsInProgress[le]||(j[`${le}start`]=he),this._eventsInProgress[le]=s[le]}!S&&z&&this._fireEvent("movestart",z.originalEvent);for(let le in j)this._fireEvent(le,j[le]);z&&this._fireEvent("move",z.originalEvent);for(let le in s){let{originalEvent:he}=s[le];this._fireEvent(le,he)}let W={},K;for(let le in this._eventsInProgress){let{handlerName:he,originalEvent:fe}=this._eventsInProgress[le];this._handlersById[he].isActive()||(delete this._eventsInProgress[le],K=d[he]||fe,W[`${le}end`]=K)}for(let le in W)this._fireEvent(le,W[le]);let Q=Rs(this._eventsInProgress);if(v&&(S||z)&&!Q){this._updatingCamera=!0;let le=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),he=fe=>fe!==0&&-this._bearingSnap<fe&&fe<this._bearingSnap;
1375le?(he(le.bearing||this._map.getBearing())&&(le.bearing=0),this._map.easeTo(le,{originalEvent:K})):(this._map.fire(new o.Event("moveend",{originalEvent:K})),he(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(s,d){this._map.fire(new o.Event(s,d?{originalEvent:d}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((s=>{delete this._frameId,this.handleEvent(new nu("renderFrame",{timeStamp:s})),this._applyChanges()}))}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}let Ia={extend:(T,...s)=>o.extend(T,...s),run(T){T()},logToElement(T,s=!1,d="log"){let v=window.document.getElementById(d);v&&(s&&(v.innerHTML=""),v.innerHTML+=`<br>${T}`)}};class Nr extends o.Evented{constructor(s,d){super(),this._moving=!1,this._zooming=!1,this.transform=s,this._bearingSnap=d.bearingSnap,o.bindAll(["_renderFrameCallback"],this)}getCenter(){return new o.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(s,d){return this.jumpTo({center:s},d)}panBy(s,d,v){return s=o.pointGeometry.convert(s).mult(-1),this.panTo(this.transform.center,o.extend({offset:s},d),v)}panTo(s,d,v){return this.easeTo(o.extend({center:s},d),v)}getZoom(){return this.transform.zoom}setZoom(s,d){return this.jumpTo({zoom:s},d),this}zoomTo(s,d,v){return this.easeTo(o.extend({zoom:s},d),v)}zoomIn(s,d){return this.zoomTo(this.getZoom()+1,s,d),this}zoomOut(s,d){return this.zoomTo(this.getZoom()-1,s,d),this}getBearing(){return this.transform.bearing}setBearing(s,d){return this.jumpTo({bearing:s},d),this}getPadding(){return this.transform.padding}setPadding(s,d){return this.jumpTo({padding:s},d),this}rotateTo(s,d,v){return this.easeTo(o.extend({bearing:s},d),v)}resetNorth(s,d){return this.rotateTo(0,o.extend({duration:1e3},s),d),this}resetNorthPitch(s,d){return this.easeTo(o.extend({bearing:0,pitch:0,duration:1e3},s),d),this}snapToNorth(s,d){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(s,d):this}getPitch(){return this.transform.pitch}setPitch(s,d){return this.jumpTo({pitch:s},d),this}cameraForBounds(s,d){s=o.LngLatBounds.convert(s);let v=d&&d.bearing||0;return this._cameraForBoxAndBearing(s.getNorthWest(),s.getSouthEast(),v,d)}_cameraForBoxAndBearing(s,d,v,S){let z={top:0,bottom:0,right:0,left:0};if(typeof(S=o.extend({padding:z,offset:[0,0],maxZoom:this.transform.maxZoom},S)).padding=="number"){let ot=S.padding;S.padding={top:ot,bottom:ot,right:ot,left:ot}}S.padding=o.extend(z,S.padding);let j=this.transform,W=j.padding,K=j.project(o.LngLat.convert(s)),Q=j.project(o.LngLat.convert(d)),le=K.rotate(-v*Math.PI/180),he=Q.rotate(-v*Math.PI/180),fe=new o.pointGeometry(Math.max(le.x,he.x),Math.max(le.y,he.y)),Re=new o.pointGeometry(Math.min(le.x,he.x),Math.min(le.y,he.y)),Me=fe.sub(Re),Ae=(j.width-(W.left+W.right+S.padding.left+S.padding.right))/Me.x,Xe=(j.height-(W.top+W.bottom+S.padding.top+S.padding.bottom))/Me.y;if(Xe<0||Ae<0)return void o.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.");let et=Math.min(j.scaleZoom(j.scale*Math.min(Ae,Xe)),S.maxZoom),rt=o.pointGeometry.convert(S.offset),Be=new o.pointGeometry((S.padding.left-S.padding.right)/2,(S.padding.top-S.padding.bottom)/2).rotate(v*Math.PI/180),ht=rt.add(Be).mult(j.scale/j.zoomScale(et));return{center:j.unproject(K.add(Q).div(2).sub(ht)),zoom:et,bearing:v}}fitBounds(s,d,v){return this._fitInternal(this.cameraForBounds(s,d),d,v)}fitScreenCoordinates(s,d,v,S,z){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(o.pointGeometry.convert(s)),this.transform.pointLocation(o.pointGeometry.convert(d)),v,S),S,z)}_fitInternal(s,d,v){return s?(delete(d=o.extend(s,d)).padding,d.linear?this.easeTo(d,v):this.flyTo(d,v)):this}jumpTo(s,d){this.stop();let v=this.transform,S=!1,z=!1,j=!1;return"zoom"in s&&v.zoom!==+s.zoom&&(S=!0,v.zoom=+s.zoom),s.center!==void 0&&(v.center=o.LngLat.convert(s.center)),"bearing"in s&&v.bearing!==+s.bearing&&(z=!0,v.bearing=+s.bearing),"pitch"in s&&v.pitch!==+s.pitch&&(j=!0,v.pitch=+s.pitch),s.padding==null||v.
1375isPaddingEqual(s.padding)||(v.padding=s.padding),this.fire(new o.Event("movestart",d)).fire(new o.Event("move",d)),S&&this.fire(new o.Event("zoomstart",d)).fire(new o.Event("zoom",d)).fire(new o.Event("zoomend",d)),z&&this.fire(new o.Event("rotatestart",d)).fire(new o.Event("rotate",d)).fire(new o.Event("rotateend",d)),j&&this.fire(new o.Event("pitchstart",d)).fire(new o.Event("pitch",d)).fire(new o.Event("pitchend",d)),this.fire(new o.Event("moveend",d))}calculateCameraOptionsFromTo(s,d,v,S=0){let z=o.MercatorCoordinate.fromLngLat(s,d),j=o.MercatorCoordinate.fromLngLat(v,S),W=j.x-z.x,K=j.y-z.y,Q=j.z-z.z,le=Math.hypot(W,K,Q);if(le===0)throw new Error("Can't calculate camera options with same From and To");let he=Math.hypot(W,K),fe=this.transform.scaleZoom(this.transform.cameraToCenterDistance/le/this.transform.tileSize),Re=180*Math.atan2(W,-K)/Math.PI,Me=180*Math.acos(he/le)/Math.PI;return Me=Q<0?90-Me:90+Me,{center:j.toLngLat(),zoom:fe,pitch:Me,bearing:Re}}easeTo(s,d){this._stop(!1,s.easeId),((s=o.extend({offset:[0,0],duration:500,easing:o.ease},s)).animate===!1||!s.essential&&o.exported.prefersReducedMotion)&&(s.duration=0);let v=this.transform,S=this.getZoom(),z=this.getBearing(),j=this.getPitch(),W=this.getPadding(),K="zoom"in s?+s.zoom:S,Q="bearing"in s?this._normalizeBearing(s.bearing,z):z,le="pitch"in s?+s.pitch:j,he="padding"in s?s.padding:v.padding,fe=o.pointGeometry.convert(s.offset),Re=v.centerPoint.add(fe),Me=v.pointLocation(Re),Ae=o.LngLat.convert(s.center||Me);this._normalizeCenter(Ae);let Xe=v.project(Me),et=v.project(Ae).sub(Xe),rt=v.zoomScale(K-S),Be,ht;s.around&&(Be=o.LngLat.convert(s.around),ht=v.locationPoint(Be));let ot={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||K!==S,this._rotating=this._rotating||z!==Q,this._pitching=this._pitching||le!==j,this._padding=!v.isPaddingEqual(he),this._easeId=s.easeId,this._prepareEase(d,s.noMoveStart,ot),this._ease((wt=>{if(this._zooming&&(v.zoom=o.number(S,K,wt)),this._rotating&&(v.bearing=o.number(z,Q,wt)),this._pitching&&(v.pitch=o.number(j,le,wt)),this._padding&&(v.interpolatePadding(W,he,wt),Re=v.centerPoint.add(fe)),Be)v.setLocationAtPoint(Be,ht);else{let Tt=v.zoomScale(v.zoom-S),Ft=K>S?Math.min(2,rt):Math.max(.5,rt),gt=Math.pow(Ft,1-wt),ri=v.unproject(Xe.add(et.mult(wt*gt)).mult(Tt));v.setLocationAtPoint(v.renderWorldCopies?ri.wrap():ri,Re)}this._fireMoveEvents(d)}),(wt=>{this._afterEase(d,wt)}),s),this}_prepareEase(s,d,v={}){this._moving=!0,this.fire(new o.Event("freezeElevation",{freeze:!0})),d||v.moving||this.fire(new o.Event("movestart",s)),this._zooming&&!v.zooming&&this.fire(new o.Event("zoomstart",s)),this._rotating&&!v.rotating&&this.fire(new o.Event("rotatestart",s)),this._pitching&&!v.pitching&&this.fire(new o.Event("pitchstart",s))}_fireMoveEvents(s){this.fire(new o.Event("move",s)),this._zooming&&this.fire(new o.Event("zoom",s)),this._rotating&&this.fire(new o.Event("rotate",s)),this._pitching&&this.fire(new o.Event("pitch",s))}_afterEase(s,d){if(this._easeId&&d&&this._easeId===d)return;delete this._easeId,this.fire(new o.Event("freezeElevation",{freeze:!1}));let v=this._zooming,S=this._rotating,z=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,v&&this.fire(new o.Event("zoomend",s)),S&&this.fire(new o.Event("rotateend",s)),z&&this.fire(new o.Event("pitchend",s)),this.fire(new o.Event("moveend",s))}flyTo(s,d){if(!s.essential&&o.exported.prefersReducedMotion){let yi=o.pick(s,["center","zoom","bearing","pitch","around"]);return this.jumpTo(yi,d)}this.stop(),s=o.extend({offset:[0,0],speed:1.2,curve:1.42,easing:o.ease},s);let v=this.transform,S=this.getZoom(),z=this.getBearing(),j=this.getPitch(),W=this.getPadding(),K="zoom"in s?o.clamp(+s.zoom,v.minZoom,v.maxZoom):S,Q="bearing"in s?this._normalizeBearing(s.bearing,z):z,le="pitch"in s?+s.pitch:j,he="padding"in s?s.padding:v.padding,fe=v.zoomScale(K-S),Re=o.pointGeometry.convert(s.offset),Me=v.centerPoint.add(Re),Ae=v.pointLocation(Me),Xe=o.LngLat.convert(s.center||Ae);this._normalizeCenter(Xe);let et=v.project(Ae),rt=v.project(Xe).sub(et),Be=s.curve,ht=Math.max(v.width,v.height),ot=ht/fe,wt=rt.mag();if("minZoom"in s){let yi=o.clamp(Math.min(s.minZoom,S,K),v.minZoom,v.maxZoom),vr
1375=ht/v.zoomScale(yi-S);Be=Math.sqrt(vr/wt*2)}let Tt=Be*Be;function Ft(yi){let vr=(ot*ot-ht*ht+(yi?-1:1)*Tt*Tt*wt*wt)/(2*(yi?ot:ht)*Tt*wt);return Math.log(Math.sqrt(vr*vr+1)-vr)}function gt(yi){return(Math.exp(yi)-Math.exp(-yi))/2}function ri(yi){return(Math.exp(yi)+Math.exp(-yi))/2}let Xt=Ft(0),ai=function(yi){return ri(Xt)/ri(Xt+Be*yi)},$i=function(yi){return ht*((ri(Xt)*(gt(vr=Xt+Be*yi)/ri(vr))-gt(Xt))/Tt)/wt;var vr},Ui=(Ft(1)-Xt)/Be;if(Math.abs(wt)<1e-6||!isFinite(Ui)){if(Math.abs(ht-ot)<1e-6)return this.easeTo(s,d);let yi=ot<ht?-1:1;Ui=Math.abs(Math.log(ot/ht))/Be,$i=function(){return 0},ai=function(vr){return Math.exp(yi*Be*vr)}}return s.duration="duration"in s?+s.duration:1e3*Ui/("screenSpeed"in s?+s.screenSpeed/Be:+s.speed),s.maxDuration&&s.duration>s.maxDuration&&(s.duration=0),this._zooming=!0,this._rotating=z!==Q,this._pitching=le!==j,this._padding=!v.isPaddingEqual(he),this._prepareEase(d,!1),this._ease((yi=>{let vr=yi*Ui,tr=1/ai(vr);v.zoom=yi===1?K:S+v.scaleZoom(tr),this._rotating&&(v.bearing=o.number(z,Q,yi)),this._pitching&&(v.pitch=o.number(j,le,yi)),this._padding&&(v.interpolatePadding(W,he,yi),Me=v.centerPoint.add(Re));let cr=yi===1?Xe:v.unproject(et.add(rt.mult($i(vr))).mult(tr));v.setLocationAtPoint(v.renderWorldCopies?cr.wrap():cr,Me),this._fireMoveEvents(d)}),(()=>this._afterEase(d)),s),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(s,d){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let v=this._onEaseEnd;delete this._onEaseEnd,v.call(this,d)}if(!s){let v=this.handlers;v&&v.stop(!1)}return this}_ease(s,d,v){v.animate===!1||v.duration===0?(s(1),d()):(this._easeStart=o.exported.now(),this._easeOptions=v,this._onEaseFrame=s,this._onEaseEnd=d,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){let s=Math.min((o.exported.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(s)),s<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(s,d){s=o.wrap(s,-180,180);let v=Math.abs(s-d);return Math.abs(s-360-d)<v&&(s-=360),Math.abs(s+360-d)<v&&(s+=360),s}_normalizeCenter(s){let d=this.transform;if(!d.renderWorldCopies||d.lngRange)return;let v=s.lng-d.center.lng;s.lng+=v>180?-360:v<-180?360:0}}class hc{constructor(s={}){this.options=s,o.bindAll(["_toggleAttribution","_updateData","_updateCompact","_updateCompactMinimize"],this)}getDefaultPosition(){return"bottom-right"}onAdd(s){return this._map=s,this._compact=this.options&&this.options.compact,this._container=Ze.create("details","maplibregl-ctrl maplibregl-ctrl-attrib mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=Ze.create("summary","maplibregl-ctrl-attrib-button mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=Ze.create("div","maplibregl-ctrl-attrib-inner mapboxgl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){Ze.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(s,d){let v=this._map._getUIString(`AttributionControl.${d}`);s.title=v,s.setAttribute("aria-label",v)}_toggleAttribution(){this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")):(this._container.classList.add("maplibregl-compact-show","mapboxgl-compact-show"),this._container.removeAttribute("open")))}_updateData(s){!s||s.sourceDataType!=="metadata"&&s.sourceDataType!=="visibility"&&s.dataType!=="style"&&s.type!=="terrain"||this._updateAttributions()}_updateAttributions(){if(!this._map.style)return;let s=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?s=s.concat(this.options.customAttribution.map((S=>
1375typeof S!="string"?"":S))):typeof this.options.customAttribution=="string"&&s.push(this.options.customAttribution)),this._map.style.stylesheet){let S=this._map.style.stylesheet;this.styleOwner=S.owner,this.styleId=S.id}let d=this._map.style.sourceCaches;for(let S in d){let z=d[S];if(z.used||z.usedForTerrain){let j=z.getSource();j.attribution&&s.indexOf(j.attribution)<0&&s.push(j.attribution)}}s=s.filter((S=>String(S).trim())),s.sort(((S,z)=>S.length-z.length)),s=s.filter(((S,z)=>{for(let j=z+1;j<s.length;j++)if(s[j].indexOf(S)>=0)return!1;return!0}));let v=s.join(" | ");v!==this._attribHTML&&(this._attribHTML=v,s.length?(this._innerContainer.innerHTML=v,this._container.classList.remove("maplibregl-attrib-empty","mapboxgl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty","mapboxgl-attrib-empty"),this._updateCompact(),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","mapboxgl-compact","maplibregl-compact-show","mapboxgl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show","mapboxgl-compact","mapboxgl-compact-show"))}_updateCompactMinimize(){this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")}}class Sh{constructor(s={}){this.options=s,o.bindAll(["_updateCompact"],this)}getDefaultPosition(){return"bottom-left"}onAdd(s){this._map=s,this._compact=this.options&&this.options.compact,this._container=Ze.create("div","maplibregl-ctrl mapboxgl-ctrl");let d=Ze.create("a","maplibregl-ctrl-logo mapboxgl-ctrl-logo");return d.target="_blank",d.rel="noopener nofollow",d.href="https://maplibre.org/",d.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),d.setAttribute("rel","noopener nofollow"),this._container.appendChild(d),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){Ze.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}_updateCompact(){let s=this._container.children;if(s.length){let d=s[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&d.classList.add("maplibregl-compact","mapboxgl-compact"):d.classList.remove("maplibregl-compact","mapboxgl-compact")}}}class uc{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(s){let d=++this._id;return this._queue.push({callback:s,id:d,cancelled:!1}),d}remove(s){let d=this._currentlyRunning,v=d?this._queue.concat(d):this._queue;for(let S of v)if(S.id===s)return void(S.cancelled=!0)}run(s=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let d=this._currentlyRunning=this._queue;this._queue=[];for(let v of d)if(!v.cancelled&&(v.callback(s),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}let qc={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"},pc={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:void 0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileC
1375acheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,fadeDuration:300,crossSourceCollisions:!0},Ih={showCompass:!0,showZoom:!0,visualizePitch:!1};class ra{constructor(s,d,v=!1){this._clickTolerance=10,this.element=d,this.mouseRotate=new Sa({clickTolerance:s.dragRotate._mouseRotate._clickTolerance}),this.map=s,v&&(this.mousePitch=new ui({clickTolerance:s.dragRotate._mousePitch._clickTolerance})),o.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),Ze.addEventListener(d,"mousedown",this.mousedown),Ze.addEventListener(d,"touchstart",this.touchstart,{passive:!1}),Ze.addEventListener(d,"touchmove",this.touchmove),Ze.addEventListener(d,"touchend",this.touchend),Ze.addEventListener(d,"touchcancel",this.reset)}down(s,d){this.mouseRotate.mousedown(s,d),this.mousePitch&&this.mousePitch.mousedown(s,d),Ze.disableDrag()}move(s,d){let v=this.map,S=this.mouseRotate.mousemoveWindow(s,d);if(S&&S.bearingDelta&&v.setBearing(v.getBearing()+S.bearingDelta),this.mousePitch){let z=this.mousePitch.mousemoveWindow(s,d);z&&z.pitchDelta&&v.setPitch(v.getPitch()+z.pitchDelta)}}off(){let s=this.element;Ze.removeEventListener(s,"mousedown",this.mousedown),Ze.removeEventListener(s,"touchstart",this.touchstart,{passive:!1}),Ze.removeEventListener(s,"touchmove",this.touchmove),Ze.removeEventListener(s,"touchend",this.touchend),Ze.removeEventListener(s,"touchcancel",this.reset),this.offTemp()}offTemp(){Ze.enableDrag(),Ze.removeEventListener(window,"mousemove",this.mousemove),Ze.removeEventListener(window,"mouseup",this.mouseup)}mousedown(s){this.down(o.extend({},s,{ctrlKey:!0,preventDefault:()=>s.preventDefault()}),Ze.mousePos(this.element,s)),Ze.addEventListener(window,"mousemove",this.mousemove),Ze.addEventListener(window,"mouseup",this.mouseup)}mousemove(s){this.move(s,Ze.mousePos(this.element,s))}mouseup(s){this.mouseRotate.mouseupWindow(s),this.mousePitch&&this.mousePitch.mouseupWindow(s),this.offTemp()}touchstart(s){s.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=Ze.touchPos(this.element,s.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>s.preventDefault()},this._startPos))}touchmove(s){s.targetTouches.length!==1?this.reset():(this._lastPos=Ze.touchPos(this.element,s.targetTouches)[0],this.move({preventDefault:()=>s.preventDefault()},this._lastPos))}touchend(s){s.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()}}function dc(T,s,d){if(T=new o.LngLat(T.lng,T.lat),s){let v=new o.LngLat(T.lng-360,T.lat),S=new o.LngLat(T.lng+360,T.lat),z=d.locationPoint(T).distSqr(s);d.locationPoint(v).distSqr(s)<z?T=v:d.locationPoint(S).distSqr(s)<z&&(T=S)}for(;Math.abs(T.lng-d.center.lng)>180;){let v=d.locationPoint(T);if(v.x>=0&&v.y>=0&&v.x<=d.width&&v.y<=d.height)break;T.lng>d.center.lng?T.lng-=360:T.lng+=360}return T}let xi={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Pi(T,s,d){let v=T.classList;for(let S in xi)v.remove(`maplibregl-${d}-anchor-${S}`,`mapboxgl-${d}-anchor-${S}`);v.add(`maplibregl-${d}-anchor-${s}`,`mapboxgl-${d}-anchor-${s}`)}class Za extends o.Evented{constructor(s,d){if(super(),(s instanceof HTMLElement||d)&&(s=o.extend({element:s},d)),o.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=s&&s.anchor||"center",this._color=s&&s.color||"#3FB1CE",this._scale=s&&s.scale||1,this._draggable=s&&s.draggable||!1,this._clickTolerance=s&&s.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=s&&s.rotation||0,this._rotationAlignment=s&&s.rotationAlignment||"auto",this._pitchAlignment=s&&s.pitchAlignment&&s.pitchAlignment!=="auto"?s.pitchAlignment:this._rotationAlignment,s&&s.element)this._element=s.element,this._offset=o.pointGeometry.convert(s&&s.offset||[0,0]);else{this._defaultMarker=!0,this._element=Ze.create("div"),this._element.setAttribute("aria-label","Map marker");let v=Ze.createNS("http://www.w3.org/2000/svg","svg"),S=41,z=27;v.setAttributeNS(null,"display","block"),v.setAttributeNS(null,"height",`${S}px`),v.setAttributeNS(null,"width",`${z}px`),v.setAttributeNS(null,"viewBox",`0 0 ${z} ${S}`);let j=Ze.createNS("http://www.w3.org/2000/svg","g");
1375j.setAttributeNS(null,"stroke","none"),j.setAttributeNS(null,"stroke-width","1"),j.setAttributeNS(null,"fill","none"),j.setAttributeNS(null,"fill-rule","evenodd");let W=Ze.createNS("http://www.w3.org/2000/svg","g");W.setAttributeNS(null,"fill-rule","nonzero");let K=Ze.createNS("http://www.w3.org/2000/svg","g");K.setAttributeNS(null,"transform","translate(3.0, 29.0)"),K.setAttributeNS(null,"fill","#000000");let Q=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(let rt of Q){let Be=Ze.createNS("http://www.w3.org/2000/svg","ellipse");Be.setAttributeNS(null,"opacity","0.04"),Be.setAttributeNS(null,"cx","10.5"),Be.setAttributeNS(null,"cy","5.80029008"),Be.setAttributeNS(null,"rx",rt.rx),Be.setAttributeNS(null,"ry",rt.ry),K.appendChild(Be)}let le=Ze.createNS("http://www.w3.org/2000/svg","g");le.setAttributeNS(null,"fill",this._color);let he=Ze.createNS("http://www.w3.org/2000/svg","path");he.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),le.appendChild(he);let fe=Ze.createNS("http://www.w3.org/2000/svg","g");fe.setAttributeNS(null,"opacity","0.25"),fe.setAttributeNS(null,"fill","#000000");let Re=Ze.createNS("http://www.w3.org/2000/svg","path");Re.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),fe.appendChild(Re);let Me=Ze.createNS("http://www.w3.org/2000/svg","g");Me.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Me.setAttributeNS(null,"fill","#FFFFFF");let Ae=Ze.createNS("http://www.w3.org/2000/svg","g");Ae.setAttributeNS(null,"transform","translate(8.0, 8.0)");let Xe=Ze.createNS("http://www.w3.org/2000/svg","circle");Xe.setAttributeNS(null,"fill","#000000"),Xe.setAttributeNS(null,"opacity","0.25"),Xe.setAttributeNS(null,"cx","5.5"),Xe.setAttributeNS(null,"cy","5.5"),Xe.setAttributeNS(null,"r","5.4999962");let et=Ze.createNS("http://www.w3.org/2000/svg","circle");et.setAttributeNS(null,"fill","#FFFFFF"),et.setAttributeNS(null,"cx","5.5"),et.setAttributeNS(null,"cy","5.5"),et.setAttributeNS(null,"r","5.4999962"),Ae.appendChild(Xe),Ae.appendChild(et),W.appendChild(K),W.appendChild(le),W.appendChild(fe),W.appendChild(Me),W.appendChild(Ae),v.appendChild(W),v.setAttributeNS(null,"height",S*this._scale+"px"),v.setAttributeNS(null,"width",z*this._scale+"px"),this._element.appendChild(v),this._offset=o.pointGeometry.convert(s&&s.offset||[0,-14])}this._element.classList.add("maplibregl-marker","mapboxgl-marker"),this._element.addEventListener("dragstart",(v=>{v.preventDefault()})),this._element.addEventListener("mousedown",(v=>{v.preventDefault()})),Pi(this._element,this._anchor,"marker"),this._popup=null}addTo(s){return this.remove(),this._map=s,s.getCanvasContainer().appendChild(this._element),s.on("move",this._update),s.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),Ze.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(s){return this._lngLat=o.LngLat.convert(s),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(s){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),s){if(!("offset"in s.options)){let S=Math.sqrt(Math.pow(13.5,2)/2);s.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[
13750,-38.1],"bottom-left":[S,-1*(38.1-13.5+S)],"bottom-right":[-S,-1*(38.1-13.5+S)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=s,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}_onKeyPress(s){let d=s.code,v=s.charCode||s.keyCode;d!=="Space"&&d!=="Enter"&&v!==32&&v!==13||this.togglePopup()}_onMapClick(s){let d=s.originalEvent.target,v=this._element;this._popup&&(d===v||v.contains(d))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){let s=this._popup;return s?(s.isOpen()?s.remove():s.addTo(this._map),this):this}_update(s){if(!this._map)return;this._map.transform.renderWorldCopies&&(this._lngLat=dc(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let d="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?d=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(d=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let v="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?v="rotateX(0deg)":this._pitchAlignment==="map"&&(v=`rotateX(${this._map.getPitch()}deg)`),s&&s.type!=="moveend"||(this._pos=this._pos.round()),Ze.setTransform(this._element,`${xi[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${v} ${d}`),this._map.style&&this._map.style.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout((()=>{let S=this._map.unproject(this._pos),z=40075016686e-3*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=S.distanceTo(this._lngLat)>20*z?"0.2":"1.0",this._opacityTimeout=null}),100))}getOffset(){return this._offset}setOffset(s){return this._offset=o.pointGeometry.convert(s),this._update(),this}_onMove(s){if(!this._isDragging){let d=this._clickTolerance||this._map._clickTolerance;this._isDragging=s.point.dist(this._pointerdownPos)>=d}this._isDragging&&(this._pos=s.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new o.Event("dragstart"))),this.fire(new o.Event("drag")))}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new o.Event("dragend")),this._state="inactive"}_addDragHandler(s){this._element.contains(s.originalEvent.target)&&(s.preventDefault(),this._positionDelta=s.point.sub(this._pos).add(this._offset),this._pointerdownPos=s.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))}setDraggable(s){return this._draggable=!!s,this._map&&(s?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(s){return this._rotation=s||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(s){return this._rotationAlignment=s||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(s){return this._pitchAlignment=s&&s!=="auto"?s:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}let sl={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},ds,io=0,Ca=!1,ms={maxWidth:100,unit:"metric"};function Ch(T,s,d){let v=d&&d.maxWidth||100,S=T._container.clientHeight/2,z=T.unproject([0,S]),j=T.unproject([v,S]),W=z.distanceTo(j);
1375if(d&&d.unit==="imperial"){let K=3.2808*W;K>5280?Ea(s,v,K/5280,T._getUIString("ScaleControl.Miles")):Ea(s,v,K,T._getUIString("ScaleControl.Feet"))}else d&&d.unit==="nautical"?Ea(s,v,W/1852,T._getUIString("ScaleControl.NauticalMiles")):W>=1e3?Ea(s,v,W/1e3,T._getUIString("ScaleControl.Kilometers")):Ea(s,v,W,T._getUIString("ScaleControl.Meters"))}function Ea(T,s,d,v){let S=(function(z){let j=Math.pow(10,`${Math.floor(z)}`.length-1),W=z/j;return W=W>=10?10:W>=5?5:W>=3?3:W>=2?2:W>=1?1:(function(K){let Q=Math.pow(10,Math.ceil(-Math.log(K)/Math.LN10));return Math.round(K*Q)/Q})(W),j*W})(d);T.style.width=s*(S/d)+"px",T.innerHTML=`${S} ${v}`}let Xr={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},wn=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function $c(T){if(T){if(typeof T=="number"){let s=Math.round(Math.sqrt(.5*Math.pow(T,2)));return{center:new o.pointGeometry(0,0),top:new o.pointGeometry(0,T),"top-left":new o.pointGeometry(s,s),"top-right":new o.pointGeometry(-s,s),bottom:new o.pointGeometry(0,-T),"bottom-left":new o.pointGeometry(s,-s),"bottom-right":new o.pointGeometry(-s,-s),left:new o.pointGeometry(T,0),right:new o.pointGeometry(-T,0)}}if(T instanceof o.pointGeometry||Array.isArray(T)){let s=o.pointGeometry.convert(T);return{center:s,top:s,"top-left":s,"top-right":s,bottom:s,"bottom-left":s,"bottom-right":s,left:s,right:s}}return{center:o.pointGeometry.convert(T.center||[0,0]),top:o.pointGeometry.convert(T.top||[0,0]),"top-left":o.pointGeometry.convert(T["top-left"]||[0,0]),"top-right":o.pointGeometry.convert(T["top-right"]||[0,0]),bottom:o.pointGeometry.convert(T.bottom||[0,0]),"bottom-left":o.pointGeometry.convert(T["bottom-left"]||[0,0]),"bottom-right":o.pointGeometry.convert(T["bottom-right"]||[0,0]),left:o.pointGeometry.convert(T.left||[0,0]),right:o.pointGeometry.convert(T.right||[0,0])}}return $c(new o.pointGeometry(0,0))}let Wa={supported:pe,setRTLTextPlugin:o.setRTLTextPlugin,getRTLTextPluginStatus:o.getRTLTextPluginStatus,Map:class extends Nr{constructor(T){var s;if(o.PerformanceUtils.mark(o.PerformanceMarkers.create),(T=o.extend({},pc,T)).minZoom!=null&&T.maxZoom!=null&&T.minZoom>T.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(T.minPitch!=null&&T.maxPitch!=null&&T.minPitch>T.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(T.minPitch!=null&&T.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(T.maxPitch!=null&&T.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Oc(T.minZoom,T.maxZoom,T.minPitch,T.maxPitch,T.renderWorldCopies),{bearingSnap:T.bearingSnap}),this._interactive=T.interactive,this._cooperativeGestures=T.cooperativeGestures,this._maxTileCacheSize=T.maxTileCacheSize,this._failIfMajorPerformanceCaveat=T.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=T.preserveDrawingBuffer,this._antialias=T.antialias,this._trackResize=T.trackResize,this._bearingSnap=T.bearingSnap,this._refreshExpiredTiles=T.refreshExpiredTiles,this._fadeDuration=T.fadeDuration,this._crossSourceCollisions=T.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=T.collectResourceTiming,this._renderTaskQueue=new uc,this._controls=[],this._mapId=o.uniqueId(),this._locale=o.extend({},qc,T.locale),this._clickTolerance=T.clickTolerance,this._pixelRatio=(s=T.pixelRatio)!==null&&s!==void 0?s:devicePixelRatio,this._requestManager=new Bt(T.transformRequest),typeof T.container=="string"){if(this._container=document.getElementById(T.container),!this._container)throw new Error(`Container '${T.container}' not found.`)}else{if(!(T.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=T.container}if(T.maxBounds&&this.setMaxBounds(T.maxBounds),o.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",(()=>this._update(!1))),this.on("moveend",(()=>this._update(!1))),this.on("zoom",(()=>this._update(!0))),this.on("terrain",(()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)})),typeof window<"u"&&(addEventListener("online",this._onWindowOnline,!1),addEventListener("resize",this._onWindowResize,!1),addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new cc(this,T),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=T.hash&&new Eu(typeof T.hash=="string"&&T.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:T.center,zoom:T.zoom,bearing:T.bearing,pitch:T.pitch}),T.bounds&&(this.resize(),this.fitBounds(T.bounds,o.extend({},T.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=T.localIdeographFontFamily,T.style&&this.setStyle(T.style,{localIdeographFontFamily:T.localIdeographFontFamily}),T.attributionControl&&this.addControl(new hc({customAttribution:T.customAttribution})),T.maplibreLogo&&this.addControl(new Sh,T.logoPosition),this.on("style.load",(()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)})),this.on("data",(d=>{this._update(d.dataType==="style"),this.fire(new o.Event(`${d.dataType}data`,d))})),this.on("dataloading",(d=>{this.fire(new o.Event(`${d.dataType}dataloading`,d))})),this.on("dataabort",(d=>{this.fire(new o.Event("sourcedataabort",d))}))}_getMapId(){return this._mapId}addControl(T,s){if(s===void 0&&(s=T.getDefaultPosition?T.getDefaultPosition():"top-right"),!T||!T.onAdd)return this.fire(new o.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let d=T.onAdd(this);this._controls.push(T);let v=this._controlPositions[s];return s.indexOf("bottom")!==-1?v.insertBefore(d,v.firstChild):v.appendChild(d),this}
1375removeControl(T){if(!T||!T.onRemove)return this.fire(new o.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let s=this._controls.indexOf(T);return s>-1&&this._controls.splice(s,1),T.onRemove(this),this}hasControl(T){return this._controls.indexOf(T)>-1}calculateCameraOptionsFromTo(T,s,d,v){return v==null&&this.style.terrain&&(v=this.transform.getElevation(d,this.style.terrain)),super.calculateCameraOptionsFromTo(T,s,d,v)}resize(T){let s=this._containerDimensions(),d=s[0],v=s[1];this._resizeCanvas(d,v,this.getPixelRatio()),this.transform.resize(d,v),this.painter.resize(d,v,this.getPixelRatio());let S=!this._moving;return S&&(this.stop(),this.fire(new o.Event("movestart",T)).fire(new o.Event("move",T))),this.fire(new o.Event("resize",T)),S&&this.fire(new o.Event("moveend",T)),this}getPixelRatio(){return this._pixelRatio}setPixelRatio(T){let[s,d]=this._containerDimensions();this._pixelRatio=T,this._resizeCanvas(s,d,T),this.painter.resize(s,d,T)}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(T){return this.transform.setMaxBounds(o.LngLatBounds.convert(T)),this._update()}setMinZoom(T){if((T=T??-2)>=-2&&T<=this.transform.maxZoom)return this.transform.minZoom=T,this._update(),this.getZoom()<T&&this.setZoom(T),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(T){if((T=T??22)>=this.transform.minZoom)return this.transform.maxZoom=T,this._update(),this.getZoom()>T&&this.setZoom(T),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(T){if((T=T??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(T>=0&&T<=this.transform.maxPitch)return this.transform.minPitch=T,this._update(),this.getPitch()<T&&this.setPitch(T),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(T){if((T=T??60)>85)throw new Error("maxPitch must be less than or equal to 85");if(T>=this.transform.minPitch)return this.transform.maxPitch=T,this._update(),this.getPitch()>T&&this.setPitch(T),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(T){return this.transform.renderWorldCopies=T,this._update()}project(T){return this.transform.locationPoint(o.LngLat.convert(T),this.style&&this.style.terrain)}unproject(T){return this.transform.pointLocation(o.pointGeometry.convert(T),this.style&&this.style.terrain)}isMoving(){return this._moving||this.handlers.isMoving()}isZooming(){return this._zooming||this.handlers.isZooming()}isRotating(){return this._rotating||this.handlers.isRotating()}_createDelegatedListener(T,s,d){if(T==="mouseenter"||T==="mouseover"){let v=!1;return{layer:s,listener:d,delegates:{mousemove:z=>{let j=this.getLayer(s)?this.queryRenderedFeatures(z.point,{layers:[s]}):[];j.length?v||(v=!0,d.call(this,new wo(T,this,z.originalEvent,{features:j}))):v=!1},mouseout:()=>{v=!1}}}}if(T==="mouseleave"||T==="mouseout"){let v=!1;return{layer:s,listener:d,delegates:{mousemove:j=>{(this.getLayer(s)?this.queryRenderedFeatures(j.point,{layers:[s]}):[]).length?v=!0:v&&(v=!1,d.call(this,new wo(T,this,j.originalEvent)))},mouseout:j=>{v&&(v=!1,d.call(this,new wo(T,this,j.originalEvent)))}}}}{let v=S=>{let z=this.getLayer(s)?this.queryRenderedFeatures(S.point,{layers:[s]}):[];z.length&&(S.features=z,d.call(this,S),delete S.features)};return{layer:s,listener:d,delegates:{[T]:v}}}}on(T,s,d){if(d===void 0)return super.on(T,s);let v=this._createDelegatedListener(T,s,d);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[T]=this._delegatedListeners[T]||[],this._delegatedListeners[T].push(v);for(let S in v.delegates)this.on(S,v.delegates[S]);return this}once(T,s,d){if(d===void 0)return super.once(T,s);let v=this._createDelegatedListener(T,s,d);for(let S in v.delegates)this.once(S,v.delegates[S]);return this}off(T,s,d){return d===void 0?super.off(T,s):(this._delegatedListeners&&this._delegatedListeners[T]&&(v=>{let S=this._delegatedListeners[T];for(let z=0;z<S.length;z++){let j=S[z];if(j.layer===s&&j.listener===d){for(let W in j.delegates)this.off(W,j.delegates[W]);return S.splice(z,1),this}}})(),this)}queryRenderedFeatures(T,s){if(!this.style)return[];let d;if(s!==void 0||T===void 0||T instanceof o.pointGeometry||Array.isArray(T)||(s=T,T=void 0),s=s||{},(T=T||[[0,0],[this.transform.width,this.transform.height]])instanceof o.pointGeometry||typeof T[0]=="number")d=[o.pointGeometry.convert(T)];else{let v=o.pointGeometry.convert(T[0]),S=o.pointGeometry.convert(T[1]);d=[v,new o.pointGeometry(S.x,v.y),S,new o.pointGeometry(v.x,S.y),v]}return this.style.queryRenderedFeatures(d,s,this.transform)}querySourceFeatures(T,s){return this.style.querySourceFeatures(T,s)}setStyle(T,s){return(s=o.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},s)).diff!==!1&&s.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&T?(this._diffStyle(T,s),this):(this._localIdeographFontFamily=s.localIdeographFontFamily,this._updateStyle(T,s))}setTransformRequest(T){return this._requestManager.setTransformRequest(T),this}_getUIString(T){let s=this._locale[T];if(s==null)throw new Error(`Missing UI string '${T}'`);return s}_updateStyle(T,s){return this.style&&(this.style.setEventedParent(null),this.style._remove()),T?(this.style=new En(this,s||{}),this.style.setEventedParent(this,{style:this.style}),typeof T=="string"?this.style.loadURL(T):this.style.loadJSON(T),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new En(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(T,s){if(typeof T=="string"){let d=this._requestManager.transformRequest(T,o.ResourceType.Style);o.getJSON(d,((v,S)=>{v?this.fire(new o.ErrorEvent(v)):S&&this._updateDiff(S,s)}))}else typeof T=="object"&&this._updateDiff(T,s)}_updateDiff(T,s){try{this.style.setState(T)&&this._update(!0)}catch(d){o.warnOnce(`Unable to perform style diff: ${d.message||d.error||d}. Rebuilding the style from scratch.`),this._updateStyle(T,s)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():o.warnOnce("There is no style added to the map.")}addSource(T,s){return this._lazyInitEmptyStyle(),this.style.addSource(T,s),this._update(!0)}isSourceLoaded(T){let s=this.style&&this.style.sourceCaches[T];if(s!==void 0)return s.loaded();this.fire(new o.ErrorEvent(new Error(`There is no source with ID '${T}'`)))}setTerrain(T){return this.style.setTerrain(T),this}getTerrain(){return this.style.terrain&&this.style.terrain.options}areTilesLoaded(){let T=this.style&&this.style.sourceCaches;for(let s in T){let d=T[s]._tiles;for(let v in d){let S=d[v];if(S.state!=="loaded"&&S.state!=="errored")return!1}}return!0}addSourceType(T,s,d){return this._lazyInitEmptyStyle(),this.style.addSourceType(T,s,d)}removeSource(T){return this.style.removeSource(T),this._update(!0)}getSource(T){return this.style.getSource(T)}addImage(T,s,{pixelRatio:d=1,sdf:v=!1,stretchX:S,stretchY:z,content:j}={}){if(this._lazyInitEmptyStyle(),s instanceof HTMLImageElement||o.isImageBitmap(s)){let{width:W,height:K,data:Q}=o.exported.getImageData(s);this.style.addImage(T,{data:new o.RGBAImage({width:W,height:K},Q),pixelRatio:d,stretchX:S,stretchY:z,content:j,sdf:v,version:0})}else{if(s.width===void 0||s.height===void 0)return this.fire(new o.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`")));{let{width:W,height:K,data:Q}=s,le=s;this.style.addImage(T,{data:new o.RGBAImage({width:W,height:K},new Uint8Array(Q)),pixelRatio:d,stretchX:S,stretchY:z,content:j,sdf:v,version:0,userImage:le}),le.onAdd&&le.onAdd(this,T)}}}updateImage(T,s){let d=this.style.getImage(T);if(!d)return this.fire(new o.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let v=s instanceof HTMLImageElement||o.isImageBitmap(s)?o.exported.getImageData(s):s,{width:S,height:z,data:j}=v;if(S===void 0||z===void 0)return this.fire(new o.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`")));if(S!==d.data.width||z!==d.data.height)return this.fire(new o.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));let W=!(s instanceof HTMLImageElement||o.isImageBitmap(s));d.data.replace(j,W),this.style.updateImage(T,d)}hasImage(T){return T?!!this.style.getImage(T):(this.fire(new o.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(T){this.style.removeImage(T)}loadImage(T,s){o.getImage(this._requestManager.transformRequest(T,o.ResourceType.Image),s)}listImages(){return this.style.listImages()}addLayer(T,s){return this._lazyInitEmptyStyle(),this.style.addLayer(T,s),this._update(!0)}moveLayer(T,s){return this.style.moveLayer(T,s),this._update(!0)}removeLayer(T){return this.style.removeLayer(T),this._update(!0)}getLayer(T){return this.style.getLayer(T)}setLayerZoomRange(T,s,d){return this.style.setLayerZoomRange(T,s,d),this._update(!0)}setFilter(T,s,d={}){return this.style.setFilter(T,s,d),this._update(!0)}getFilter(T){return this.style.getFilter(T)}setPaintProperty(T,s,d,v={}){return this.style.setPaintProperty(T,s,d,v),this._update(!0)}getPaintProperty(T,s){return this.style.getPaintProperty(T,s)}setLayoutProperty(T,s,d,v={}){return this.style.setLayoutProperty(T,s,d,v),this._update(!0)}getLayoutProperty(T,s){return this.style.getLayoutProperty(T,s)}setLight(T,s={}){return this._lazyInitEmptyStyle(),this.style.setLight(T,s),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(T,s){return this.style.setFeatureState(T,s),this._update()}removeFeatureState(T,s){return this.style.removeFeatureState(T,s),this._update()}getFeatureState(T){return this.style.getFeatureState(T)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let T=0,s=0;return this._container&&(T=this._container.clientWidth||400,s=this._container.clientHeight||300),[T,s]}_setupContainer(){let T=this._container;T.classList.add("maplibregl-map","mapboxgl-map");let s=this._canvasContainer=Ze.create("div","maplibregl-canvas-container mapboxgl-canvas-container",T);this._interactive&&s.classList.add("maplibregl-interactive","mapboxgl-interactive"),this._canvas=Ze.create("canvas","maplibregl-canvas mapboxgl-canvas",s),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","regi
1375on");let d=this._containerDimensions();this._resizeCanvas(d[0],d[1],this.getPixelRatio());let v=this._controlContainer=Ze.create("div","maplibregl-control-container mapboxgl-control-container",T),S=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((z=>{S[z]=Ze.create("div",`maplibregl-ctrl-${z} mapboxgl-ctrl-${z}`,v)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_setupCooperativeGestures(){let T=this._container;this._metaPress=!1,this._cooperativeGesturesScreen=Ze.create("div","maplibregl-cooperative-gesture-screen",T);let s="Control",d=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";navigator.platform.indexOf("Mac")===0&&(d=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use \u2318 + scroll to zoom the map",s="Meta"),this._cooperativeGesturesScreen.innerHTML=` 1376 <div class="maplibregl-desktop-message">${d}</div> 1377 <div class="maplibregl-mobile-message">${typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}</div> 1378 `,document.addEventListener("keydown",(v=>{v.key===s&&(this._metaPress=!0)})),document.addEventListener("keyup",(v=>{v.key===s&&(this._metaPress=!1)})),this._canvasContainer.addEventListener("wheel",(v=>
1378{this._onCooperativeGesture(v,this._metaPress,1)}),!1),this._canvasContainer.classList.remove("mapboxgl-touch-drag-pan","maplibregl-touch-drag-pan")}_resizeCanvas(T,s,d){this._canvas.width=d*T,this._canvas.height=d*s,this._canvas.style.width=`${T}px`,this._canvas.style.height=`${s}px`}_setupPainter(){let T=o.extend({},pe.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),s=this._canvas.getContext("webgl",T)||this._canvas.getContext("experimental-webgl",T);s?(this.painter=new Fc(s,this.transform),o.exported$1.testSupport(s)):this.fire(new o.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(T){T.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new o.Event("webglcontextlost",{originalEvent:T}))}_contextRestored(T){this._setupPainter(),this.resize(),this._update(),this.fire(new o.Event("webglcontextrestored",{originalEvent:T}))}_onMapScroll(T){if(T.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}_onCooperativeGesture(T,s,d){return!s&&d<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout((()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")}),100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(T){return this.style?(this._styleDirty=this._styleDirty||T,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(T){return this._update(),this._renderTaskQueue.add(T)}_cancelRenderFrame(T){this._renderTaskQueue.remove(T)}_render(T){let s,d=0,v=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(s=v.createQueryEXT(),v.beginQueryEXT(v.TIME_ELAPSED_EXT,s),d=o.exported.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(T),this._removed)return;let S=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let j=this.transform.zoom,W=o.exported.now();this.style.zoomHistory.update(j,W);let K=new o.EvaluationParameters(j,{now:W,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),Q=K.crossFadingFactor();Q===1&&Q===this._crossFadingFactor||(S=!0,this._crossFadingFactor=Q),this.style.update(K)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.style.terrain&&this.style.terrain.sourceCache.update(this.transform,this.style.terrain),this.transform.updateElevation(this.style.terrain),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new o.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,o.PerformanceUtils.mark(o.PerformanceMarkers.load),this.fire(new o.Event("load"))),this.style&&(this.style.hasTransitions()||S)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){let j=o.exported.now()-d;v.endQueryEXT(v.TIME_ELAPSED_EXT,s),setTimeout((()=>{let W=v.getQueryObjectEXT(s,v.QUERY_RESULT_EXT)/1e6;v.deleteQueryEXT(s),this.fire(new o.Event("gpu-timing-frame",{cpuTime:j,gpuTime:W}))}),50)}if(this.listens("gpu-timing-layer")){let j=this.painter.collectGpuTimers();setTimeout((()=>{let W=this.painter.queryGpuTimers(j);this.fire(new o.Event("gpu-timing-layer",{layerTimes:W}))}),50)}let z=this._sourcesDirty||this._styleDirty||this._placementDirty;return z||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new o.Event("idle")),!this._loaded||this._fullyLoaded||z||(this._fullyLoaded=!0,o.PerformanceUtils.mark(o.PerformanceMarkers.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){this._hash&&this._hash.remove();for(let s of this._controls)s.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&(removeEventListener("resize",this._onWindowResize,!1),removeEventListener("orientationchange",this._onWindowResize,!1),removeEventListener("online",this._onWindowOnline,!1));let T=this.painter.context.gl.getExtension("WEBGL_lose_context");T&&T.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),Ze.remove(this._canvasContainer),Ze.remove(this._controlContainer),this._cooperativeGestures&&Ze.remove(this._cooperativeGesturesScreen),this._container.classList.remove("maplibregl-map","mapboxgl-map"),o.PerformanceUtils.clearMetrics(),this._removed=!0,this.fire(new o.Event("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=o.exported.frame((T=>{o.PerformanceUtils.frame(T),this._frame=null,this._render(T)})))}_onWindowOnline(){this._update()}_onWindowResize(T){this._trackResize&&this.resize({originalEvent:T})._update()}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(T){this._showTileBoundaries!==T&&(this._showTileBoundaries=T,this._update())}get showPadding(){return!!this._showPadding}set showPadding(T){this._showPadding!==T&&(this._showPadding=T,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(T){this._showCollisionBoxes!==T&&(this._showCollisionBoxes=T,T?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(T){this._showOverdrawInspector!==T&&(this._showOverdrawInspector=T,this._update())}get repaint(){return!!this._repaint}set repaint(T){this._repaint!==T&&(this._repaint=T,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(T){this._vertices=T,this._update()}_setCacheLimits(T,s){o.setCacheLimits(T,s)}get version(){return"2.4.0"}},NavigationControl:class{constructor(T){this.options=o.extend({},Ih,T),this._container=Ze.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(s=>s.preventDefault())),this.options.showZoom&&(o.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in mapboxgl-ctrl-zoom-in",(s=>this._map.zoomIn({},{originalEvent:s}))),Ze.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out mapboxgl-ctrl-zoom-out",(s=>this._map.zoomOut({},{originalEvent:s}))),Ze.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(o.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("maplibregl-ctrl-compass mapboxgl-ctrl-compass",(s=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:s}):this._map.resetNorth({},{originalEvent:s})})),this._compassIcon=Ze.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){let T=this._map.getZoom(),s=T===this._map.getMaxZoom(),d=T===this._map.getMinZoom();this._zoomInButton.disabled=s,this._zoomOutButton.disabled=d,this._zoomInButton.setAttribute("aria-disabled",s.toString()),this._zoomOutButton.setAttribute("aria-disabled",d.toString())}_rotateCompassArrow(){let T=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)
1378),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=T}onAdd(T){return this._map=T,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new ra(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){Ze.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(T,s){let d=Ze.create("button",T,this._container);return d.type="button",d.addEventListener("click",s),d}_setButtonTitle(T,s){let d=this._map._getUIString(`NavigationControl.${s}`);T.title=d,T.setAttribute("aria-label",d)}},GeolocateControl:class extends o.Evented{constructor(T){super(),this.options=o.extend({},sl,T),o.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}onAdd(T){var s;return this._map=T,this._container=Ze.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),s=this._setupUI,ds!==void 0?s(ds):window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then((d=>{ds=d.state!=="denied",s(ds)})):(ds=!!window.navigator.geolocation,s(ds)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),Ze.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,io=0,Ca=!1}_isOutOfMapMaxBounds(T){let s=this._map.getMaxBounds(),d=T.coords;return s&&(d.longitude<s.getWest()||d.longitude>s.getEast()||d.latitude<s.getSouth()||d.latitude>s.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_onSuccess(T){if(this._map){if(this._isOutOfMapMaxBounds(T))return this._setErrorState(),this.fire(new o.Event("outofmaxbounds",T)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=T,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(T),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(T),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new o.Event("geolocate",T)),this._finish()}}_updateCamera(T){let s=new o.LngLat(T.coords.longitude,T.coords.latitude),d=T.coords.accuracy,v=this._map.getBearing(),S=o.extend({bearing:v},this.options.fitBoundsOptions);this._map.fitBounds(s.toBounds(d),S,{geolocateSource:!0})}_updateMarker(T){if(T){let s=new o.LngLat(T.coords.longitude,T.coords.latitude);this._accuracyCircleMarker.setLngLat(s).addTo(this._map),this._userLocationDotMarker.setLngLat(s).addTo(this._map),this._accuracy=T.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){let T=this._map._container.clientHeight/2,s=this._map.unproject([0,T]),d=this._map.unproject([1,T]),v=s.distanceTo(d),S=Math.ceil(2*this._accuracy/v);this._circleElement.style.width=`${S}px`,this._circleElement.style.height=`${S}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_onError(T){if(this._map){if(this.options.trackUserLocation)if(T.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(T.code===3&&Ca)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new o.Event("error",T)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(T){if(this._container.addEventListener("contextmenu",(s=>s.preventDefault())),this._geolocateButton=Ze.create("button","maplibregl-ctrl-geolocate mapboxgl-ctrl-geolocate",this._container),Ze.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",T===!1){o.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");let s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s)}else{let s=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","fal
1378se"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=Ze.create("div","maplibregl-user-location-dot mapboxgl-user-location-dot"),this._userLocationDotMarker=new Za(this._dotElement),this._circleElement=Ze.create("div","maplibregl-user-location-accuracy-circle mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Za({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(s=>{s.geolocateSource||this._watchState!=="ACTIVE_LOCK"||s.originalEvent&&s.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this.fire(new o.Event("trackuserlocationend")))}))}trigger(){if(!this._setup)return o.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 o.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":io--,Ca=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this.fire(new o.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new o.Event("trackuserlocationstart"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let T;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),io++,io>1?(T={maximumAge:6e5,timeout:0},Ca=!0):(T=this.options.positionOptions,Ca=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,T)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:hc,LogoControl:Sh,ScaleControl:class{constructor(T){this.options=o.extend({},ms,T),o.bindAll(["_onMove","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_onMove(){Ch(this._map,this._container,this.options)}onAdd(T){return this._map=T,this._container=Ze.create("div","maplibregl-ctrl maplibregl-ctrl-scale mapboxgl-ctrl mapboxgl-ctrl-scale",T.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){Ze.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}setUnit(T){this.options.unit=T,Ch(this._map,this._container,this.options)}},FullscreenControl:class{constructor(T){this._fullscreen=!1,T&&T.container&&(T.container instanceof HTMLElement?this._container=T.container:o.warnOnce("Full screen control 'container' must be a DOM element.")),o.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(T){return this._map=T,this._container||(this._container=this._map.getContainer()),this._controlContainer=Ze.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",o.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){Ze.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!!(document.fullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled)}_setupUI(){let T=this._fullscreenButton=Ze.create("button","maplibregl-ctrl-fullscreen mapboxgl-ctrl-fullscreen",this._controlContainer);Ze.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",T).setAttribute("aria-hidden","true"),T.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){let T=this._getTitle();this._fullscreenButton.setAttribute("aria-label",T),this._fullscreenButton.title=T}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen&&window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},TerrainControl:class{constructor(T){this.options=T,o.bindAll(["_toggleTerrain","_updateTerrainIcon"],this)}onAdd(T){return this._map=T,this._container=Ze.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._terrainButton=Ze.create("button","maplibregl-ctrl-terrain mapboxgl-ctrl-terrain",this._container),Ze.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.t
1378ype="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){Ze.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}_toggleTerrain(){this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()}_updateTerrainIcon(){this._terrainButton.classList.remove("maplibregl-ctrl-terrain","mapboxgl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled","mapboxgl-ctrl-terrain-enabled"),this._map.style.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled","mapboxgl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain","mapboxgl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))}},Popup:class extends o.Evented{constructor(T){super(),this.options=o.extend(Object.create(Xr),T),o.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}addTo(T){return this._map&&this.remove(),this._map=T,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new o.Event("open")),this}isOpen(){return!!this._map}remove(){return this._content&&Ze.remove(this._content),this._container&&(Ze.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new o.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(T){return this._lngLat=o.LngLat.convert(T),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer","mapboxgl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")),this}getElement(){return this._container}setText(T){return this.setDOMContent(document.createTextNode(T))}setHTML(T){let s=document.createDocumentFragment(),d=document.createElement("body"),v;for(d.innerHTML=T;v=d.firstChild,v;)s.appendChild(v);return this.setDOMContent(s)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(T){return this.options.maxWidth=T,this._update(),this}setDOMContent(T){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=Ze.create("div","maplibregl-popup-content mapboxgl-popup-content",this._container);return this._content.appendChild(T),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(T){this._container&&this._container.classList.add(T)}removeClassName(T){this._container&&this._container.classList.remove(T)}setOffset(T){return this.options.offset=T,this._update(),this}toggleClassName(T){if(this._container)return this._container.classList.toggle(T)}_createCloseButton(){this.options.closeButton&&(this._closeButton=Ze.create("button","maplibregl-popup-close-button mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_onMouseUp(T){this._update(T.point)}_onMouseMove(T){this._update(T.point)}_onDrag(T){this._update(T.point)}_update(T){if(!this._map||!this._lngLat&&!this._trackPointer||!this._content||(this._container||(this._container=Ze.create("div","maplibregl-popup mapboxgl-popup",this._map.getContainer()),this._tip=Ze.create("div","maplibregl-popup-tip mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((z=>this._container.classList.add(z))),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=dc(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!T))return;let s=this._pos=this._trackPointer&&T?T:this._map.project(this._lngLat),d=this.options.anchor,v=$c(this.options.offset);if(!d){let z=this._container.offsetWidth,j=this._container.offsetHeight,W;W=s.y+v.bottom.y<j?["top"]:s.y>this._map.transform.height-j?["bottom"]:[],s.x<z/2?W.push("left"):s.x>
1378this._map.transform.width-z/2&&W.push("right"),d=W.length===0?"bottom":W.join("-")}let S=s.add(v[d]).round();Ze.setTransform(this._container,`${xi[d]} translate(${S.x}px,${S.y}px)`),Pi(this._container,d,"popup")}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let T=this._container.querySelector(wn);T&&T.focus()}_onClose(){this.remove()}},Marker:Za,Style:En,LngLat:o.LngLat,LngLatBounds:o.LngLatBounds,Point:o.pointGeometry,MercatorCoordinate:o.MercatorCoordinate,Evented:o.Evented,AJAXError:o.AJAXError,config:o.config,CanvasSource:lr,GeoJSONSource:vi,ImageSource:pi,RasterDEMTileSource:Nt,RasterTileSource:Si,VectorTileSource:jt,VideoSource:er,prewarm:function(){Hn().acquire(Qn)},clearPrewarmedResources:function(){let T=Gr;T&&(T.isPreloaded()&&T.numActive()===1?(T.release(Qn),Gr=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 version(){return"2.4.0"},get workerCount(){return Ti.workerCount},set workerCount(T){Ti.workerCount=T},get maxParallelImageRequests(){return o.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(T){o.config.MAX_PARALLEL_IMAGE_REQUESTS=T},clearStorage(T){o.clearTileCache(T)},workerUrl:"",addProtocol(T,s){o.config.REGISTERED_PROTOCOLS[T]=s},removeProtocol(T){delete o.config.REGISTERED_PROTOCOLS[T]}};return Ia.extend(Wa,{isSafari:o.isSafari,getPerformanceMetrics:o.PerformanceUtils.getPerformanceMetrics}),Wa}));var V=F;return V}))});var UT="https://tiles.openstreetmap.us/vector/openmaptiles.json";var Xl={OPENMAPTILES_URL:UT,SHIELD_TEXT_BBOX_COLOR:null,SHIELD_TEXT_HALO_COLOR_OVERRIDE:null};var rb=_p(Qv());function By(O,E={},F=null){let H=new XMLHttpRequest,V=E.url,o=[];for(let Ne in O)o.push(`${Ne}=${encodeURIComponent(O[Ne])}`);let pe=o.join("&");E.type.toLowerCase()==="get"&&(V+="?"+pe),H.open(E.type,V,!0);for(let Ne in E.headers){let Qe=E.headers[Ne];typeof Qe=="function"&&(Qe=Qe(O,E)),H.setRequestHeader(Ne,Qe)}return F&&(H.onreadystatechange=F),H.send(O),H}var os={},nb=/[\\^$.*+?()[\]{}|]/g,HT=RegExp(nb.source),vg=document.createElement("div"),XT={containerTokenfield:`<div class="tokenfield tokenfield-mode-tokens"> 1379 <input class="tokenfield-copy-helper" 1380 style="display:none;position:fixed;top:-1000px;right:1000px;" 1381 tabindex="-1" 1382 type="text" 1383 /> 1384 <div class="tokenfield-set"> 1385 <ul></ul> 1386 </div> 1387 <input class="tokenfield-input" /> 1388 <div class="tokenfield-suggest"> 1389 <ul class="tokenfield-suggest-list"></ul> 1390 </div> 1391 </div>`,containerList:`<div class="tokenfield tokenfield-mode-list"> 1392 <input class="tokenfield-input" /> 1393 <div class="tokenfield-suggest"> 1394 <ul class="tokenfield-suggest-list"></ul> 1395 </div> 1396 <div class="tokenfield-set"> 1397 <ul></ul> 1398 </div> 1399 </div>`,suggestItem:'<li class="tokenfield-suggest-item"></li>',setItem:`<li class="tokenfield-set-item"> 1400 <span class="item-label"></span> 1401 <a href="#" class="item-remove" tabindex="-1">\xD7</a> 1402 <input class="item-input" type="hidden" /> 1403 </li>`};function Oy(){return((1+Math.random())*65536|0).toString(16)+((1+Math.random())*65536|0).toString(16)}function eb(O,E){return O.indexOf(E)>=0}function KT(O){let E=[O];for(;O.parentNode;)O=O.parentNode,E.push(O);return E}function tb(O){return O.nodeName?O:typeof O=="string"?document.querySelector(O):null}function Vy(O,E){return O.nodeName?O:(O=O.replace(/(\t|\n$)/g,""),vg.innerHTML="",vg.innerHTML=O,E===!0?vg.childNodes:vg.childNodes[0])}function YT(O){if(typeof O=="string")return O;if(O===null)return"";let E=O+"";return E==="0"&&1/O===-1/0?"-0":E}function ib(O){return O.key||O.keyIdentifier?O.key||String.fromCharCode(parseInt(O.keyIdentifier.substr(2),16)):null}function JT(O){return O=YT(O),O&&HT.test(O)?O.replace(nb,"\\$&"):O}function QT(){return{_defaults:{focusedItem:null,cache:{},timer:null,xhr:null,suggested:!1,suggestedItems:[],setItems:[],events:{},delimiters:{}},_options:{el:null,form:!0,mode:"tokenfield",addItemOnBlur:!1,addItemsOnPaste:!1,keepItemsOrder:!0,setItems:[],items:[],newItems:!0,multiple:!0,maxItems:0,minLength:0,keys:{17:"ctrl",16:"shift",91:"meta",8:"delete",27:"esc",37:"left",38:"up",39:"right",40:"down",46:"delete",65:"select",67:"copy",88:"cut",9:"delimiter",13:"delimiter",108:"delimiter"},matchRegex:"{value}",matchFlags:"i",matchStart:!1,matchEnd:!1,delimiters:[],copyProperty:"name",copyDelimiter:", ",remote:{type:"GET",url:null,queryParam:"q",delay:300,timestampParam:"t",params:{},headers:{}},placeholder:null,inputType:"text",minChars:2,maxSuggest:10,maxSuggestWindow:10,filterSetItems:!0,filterMatchCase:!1,singleInput:!1,singleInputValue:"id",singleInputDelimiter:", ",itemLabel:"name",itemName:"items",newItemName:"items_new",itemValue:"id",newItemValue:"name",itemData:"name",validateNewItem:null}}}var Ny=class extends rb.default{constructor(E={}){super();let{_defaults:F,_options:H}=QT();this.id=Oy(),this.key=`key_${this.id}`,this._vars=Object.assign({},F),this._options=Object.assign({},H,E),this._options.keys=Object.assign({},H.keys,E.keys),this._options.remote=Object.assign({},H.remote,E.remote),this._templates=Object.assign({}
1403,XT,E.templates),this._vars.setItems=this._prepareData(this.remapData(this._options.setItems||[])),this._focused=!1,this._input=null,this._form=!1,this._html={};let V=this._options;V.delimiters.forEach(pe=>{this._vars.delimiters[pe]=!0});let o=tb(V.el);if(o)this.el=o;else throw new Error(`Selector: DOM Element ${V.el} not found.`);if(V.singleInput){let pe=tb(V.singleInput);pe?this._input=pe:this._input=this.el}if(this.el.tokenfield=this,V.placeholder===null&&(V.placeholder=V.el.placeholder||""),V.form){let pe=!1;if(V.form.nodeName)pe=V.form;else if(V.form===!0){let Ne=this.el;for(;Ne.parentNode;){if(Ne.nodeName==="FORM"){pe=Ne;break}Ne=Ne.parentNode}}else if(typeof pe=="string"&&(pe=document.querySelector(pe),!pe))throw new Error(`Selector: DOM Element ${V.form} not found.`);this._form=pe}else throw new Error("Cannot create tokenfield without DOM Element.");os[this.id]=this,this._render()}_render(){let E=this._options,F=this._html;return E.mode==="tokenfield"?F.container=Vy(this._templates.containerTokenfield):F.container=Vy(this._templates.containerList),F.suggest=F.container.querySelector(".tokenfield-suggest"),F.suggestList=F.container.querySelector(".tokenfield-suggest-list"),F.items=F.container.querySelector(".tokenfield-set > ul"),F.input=F.container.querySelector(".tokenfield-input"),F.input.setAttribute("type",E.inputType),E.mode==="tokenfield"?F.input.placeholder=this._vars.setItems.length?"":E.placeholder:F.input.placeholder=E.placeholder,F.copyHelper=F.container.querySelector(".tokenfield-copy-helper"),E.el.style.display="none",F.suggest.style.display="none",this._renderSizer(),F.container.tokenfield=this,E.el.parentElement.insertBefore(F.container,E.el),F.container.insertBefore(E.el,F.container.firstChild),this._setEvents(),this._renderItems(),E.mode==="tokenfield"&&this._minimizeInput()._resizeInput(),this}_renderSizer(){let E=this._html,F=this._getBounds(),H=window.getComputedStyle(E.container),V=parseInt(H.paddingLeft,10)+parseInt(H.paddingRight,10),o={width:"auto",height:"auto",overflow:"hidden",whiteSpace:"pre",maxWidth:F.width-V+"px",position:"fixed",top:"-10000px",left:"10000px",fontSize:H.fontSize,paddingLeft:H.paddingLeft,paddingRight:H.paddingRight};E.sizer=document.createElement("div"),E.sizer.id="tokenfield-sizer-"+this.id;for(let pe in o)E.sizer.style[pe]=o[pe];E.container.appendChild(E.sizer)}_minimizeInput(){return this._options.mode==="tokenfield"&&(this._html.input.style.width="20px"),this}_refreshInput(E=!0){let F=this._vars,H=this._html;if(E&&(H.input.value=""),this._options.mode==="tokenfield"){this._resizeInput();let V=F.setItems.length?"":this._options.placeholder;H.input.setAttribute("placeholder",V)}else this._options.mode==="list"&&H.input.setAttribute("placeholder",this._options.placeholder);return this}_resizeInput(E=""){let F=this._html,H=this._getBounds(),V=window.getComputedStyle(F.container),o=parseInt(V.paddingRight,10)+parseInt(V.borderRightWidth,10),pe=o+parseInt(V.paddingLeft,10)+parseInt(V.borderLeftWidth,10);if(F.sizer.innerHTML=E,F.sizer.style.maxWidth=H.width-o+"px",H.width===0){F.input.style.width="100%";return}else F.input.style.width="20px";let Ne=F.sizer.getBoundingClientRect(),Qe=F.input.getBoundingClientRect(),ct=H.width-(Qe.left-H.left)-o;Ne.width>ct?F.input.style.width=H.width-pe-1+"px":F.input.style.width=ct-1+"px"}_fetchData(E){let F=this._vars,H=this._options,V=H.remote,o=Object.assign({},H.params);for(let pe in V.params)o[pe]=V.params[pe];V.limit&&(o[V.limit]=H.remote.limit),o[V.queryParam]=E,o[V.timestampParam]=Math.round(new Date().getTime()/1e3),F.xhr=By(o,H.remote,()=>{if(F.xhr&&F.xhr.readyState==4){if(F.xhr.status==200){let pe=JSON.parse(F.xhr.responseText);F.cache[E]=pe;let Ne=this._prepareData(this.remapData(pe)),Qe=this._filterData(E,Ne);F.suggestedItems=H.filterSetItems?this._filterSetItems(Qe):Qe,this.showSuggestions()}else if(F.xhr.status>0)throw new Error("Error while loading remote data.");this._abortXhr()}})}remapData(E){return E}_prepareData(E){return E.map(F=>Object.assign({},F,{[this.key]:Oy()}))}_filterData(E,F){let H=this._options,V=H.matchRegex.replace("{value}",JT(E));H.matchStart?V="^"+V:H.matchEnd&&(V=V+"$");let o=new RegExp(V,H.matchFlags);return F.filter(pe=>o.test(pe[H.itemData]))}_abortXhr(){let E=this._vars;E.xhr!==null&&(E.xhr.abort(),E.xhr=null)}_filterSetItems(E){let F=this._options.itemValue,H=this._vars;if(!H.setItems.length)return E;let V=H.setItems.map(o=>o[F]);return E.filter(o=>V.indexOf(o[F])===-1)}_setEvents(){let E=this._vars,F=this._html;E.events.onClick=this._onClick.bind(this),E.events.onMouseDown=this._onMouseDown.bind(this),E.events.onMouseOver=this._onMouseOver.bind(this),E.events.onFocus=this._onFocus.bind(this),E.events.onResize=this._onResize.bind(this),E.events.onReset=this._onReset.bind(this),E.events.onKeyDown=this._onKeyDown.bind(this),E.events.onFocusOut=this._onFocusOut.bind(this),F.container.addEventListener("click",E.events.onClick),Object.keys(os).length===1&&(document.addEventListener("mousedown",E.events.onMouseDown),window.addEventListener("resize",E.events.onResize)),this._form&&this._form.nodeName&&this._form.addEventListener("reset",E.events.onReset),F.suggestList.addEventListener("mouseover",E.events.onMouseOver),F.input.addEventListener("focus",E.events.onFocus)}_onMouseOver(E){let F=E.target;F.classList.contains("tokenfield-suggest-item")&&([].slice.call(this._html.suggestList.querySelectorAll(".selected")).forEac
1403h(V=>{V!==F&&V.classList.remove("selected")}),F.classList.add("selected"),this._selectItem(F.key,!1),this._refreshItemsSelection())}_onReset(){this.setItems(this._options.setItems)}_onFocus(){let E=this._vars,F=this._html,H=this._options;F.input.removeEventListener("keydown",E.events.onKeyDown),F.input.addEventListener("keydown",E.events.onKeyDown),F.input.addEventListener("focusout",E.events.onFocusOut),H.addItemsOnPaste&&(E.events.onPaste=this._onPaste.bind(this),F.input.addEventListener("paste",E.events.onPaste)),this._focused=!0,this._html.container.classList.add("focused"),H.mode==="tokenfield"&&this._resizeInput(),F.input.value.trim().length>=H.minChars&&this.showSuggestions()}_onFocusOut(E){let F=this._vars,H=this._options,V=this._html;if(V.input.removeEventListener("keydown",F.events.onKeyDown),V.input.removeEventListener("focusout",F.events.onFocusOut),typeof F.events.onPaste<"u"&&V.input.removeEventListener("paste",F.events.onPaste),E.relatedTarget&&E.relatedTarget===V.copyHelper)return;let o=H.multiple&&!H.maxItems||!H.multiple&&!F.setItems.length||H.multiple&&H.maxItems&&F.setItems.length<H.maxItems;this._focused&&H.addItemOnBlur&&o&&this._newItem(V.input.value)?this._renderItems()._refreshInput():this._defocusItems()._renderItems(),this._focused=!1,this._html.container.classList.remove("focused")}_onMouseDown(E){let F=null;for(let H in os)if(os[H]._html.container.contains(E.target)){F=os[H];break}if(F){for(let H in os)H!==F.id&&(os[H].hideSuggestions(),os[H].blur());E.target!==F._html.input&&E.preventDefault()}else for(let H in os)os[H].hideSuggestions(),os[H].blur()}_onResize(){for(let E in os)os[E]._options.mode==="tokenfield"&&os[E]._resizeInput(os[E]._html.input.value)}_onPaste(E){let F=this._vars,H=this._options,V=E.clipboardData.getData("text"),o=[V];if(H.delimiters.length){let Ne=H.delimiters.join("|"),Qe=new RegExp(`(${Ne})`,"ig");o=V.split(Qe)}o.map(Ne=>Ne.trim()).filter(Ne=>Ne.length>0&&Ne.length>=H.minLength&&typeof F.delimiters[Ne]>"u").map(Ne=>this._newItem(Ne)).length&&(setTimeout(()=>{this._renderItems()._refreshInput()._deselectItems().hideSuggestions()},1),E.preventDefault())}_onKeyDown(E){let F=this._vars,H=this._options,V=this._html;H.maxItems&&F.setItems.length>=H.maxItems&&E.preventDefault(),H.mode==="tokenfield"&&setTimeout(()=>{this._resizeInput(V.input.value)},1);let o=ib(E);if(typeof H.keys[E.keyCode]<"u"||eb(H.delimiters,o)){if(this._keyAction(E))return!0}else this._defocusItems()._refreshItems();clearTimeout(F.timer),this._abortXhr(),(!H.maxItems||F.setItems.length<H.maxItems)&&setTimeout(()=>{this._keyInput(E)},1)}_keyAction(E){let F=this.key,H=null,V=this._vars,o=this._options,pe=this._html,Ne=o.keys[E.keyCode],Qe=pe.input.value.trim(),ct=ib(E);eb(o.delimiters,ct)&&typeof Ne>"u"&&(Ne="delimiter");let Ze=this._getSelectedItems();switch(Ze.length&&(H=Ze[0]),Ne){case"esc":this._deselectItems()._defocusItems()._renderItems().hideSuggestions();break;case"up":this._vars.suggested&&(this._selectPrevItem()._refreshItemsSelection(),E.preventDefault()),this._defocusItems()._renderItems();break;case"down":this._vars.suggested&&(this._selectNextItem()._refreshItemsSelection(),E.preventDefault()),this._defocusItems()._renderItems();break;case"left":(this.getFocusedItems().length||!pe.input.selectionStart&&!pe.input.selectionEnd)&&(this._focusPrevItem(E.shiftKey),E.preventDefault());break;case"right":(this.getFocusedItems().length||pe.input.selectionStart===Qe.length)&&(this._focusNextItem(E.shiftKey),E.preventDefault());break;case"delimiter":if(this._abortXhr(),this._defocusItems(),!o.multiple&&V.setItems.length>=1)return!1;Qe=this.onInput(Qe,E),H?this._addItem(H):Qe.length&&(H=this._newItem(Qe)),H&&this._minimizeInput()._renderItems().focus()._refreshInput()._refreshSuggestions()._deselectItems(),E.preventDefault();break;case"select":if(!Qe.length&&(E.ctrlKey||E.metaKey))this._vars.setItems.forEach(Bt=>{Bt.focused=!0}),this._refreshItems();else return!1;break;case"cut":{if(this.getFocusedItems().length&&(E.ctrlKey||E.metaKey))this._copy()._delete(E);else return!1;break}case"copy":{if(this.getFocusedItems().length&&(E.ctrlKey||E.metaKey))this._copy();else return!1;break}case"delete":{this._abortXhr();let Bt=this.getFocusedItems();!pe.input.selectionEnd&&E.keyCode===8||pe.input.selectionStart===Qe.length&&E.keyCode===46||Bt.length?this._delete(E):V.timer=setTimeout(()=>{this._keyInput(E)},o.delay);break}default:break}return!0}_copy(){let E=this._options,F=this._html,H=this.getFocusedItems().map(V=>
1403V[E.copyProperty]).join(E.copyDelimiter);return F.copyHelper.style.display="block",F.copyHelper.value=H,F.copyHelper.focus(),F.copyHelper.select(),document.execCommand("copy"),F.copyHelper.style.display="none",F.copyHelper.value="",F.input.focus(),this}_delete(E){let F=this._vars,H=this._options,V=this.key,o=this._html,pe=this.getFocusedItems();return H.mode==="tokenfield"&&F.setItems.length?pe.length?(pe.forEach(Ne=>{this._removeItem(Ne[V])}),this._refreshSuggestions()._keyInput(E)):o.input.selectionStart||this._focusItem(F.setItems[F.setItems.length-1][V]):pe.length&&(pe.forEach(Ne=>{this._removeItem(Ne[V])}),this._refreshSuggestions()._keyInput(E)),this._minimizeInput()._renderItems()._refreshInput(!1),this}_keyInput(E){let F=this._vars,H=this._options,V=this._html;this._defocusItems()._refreshItems();let o=this.onInput(V.input.value.trim(),E);if(E.type==="keydown"&&this.emit("input",this,o,E),o.length<H.minChars)return this.hideSuggestions(),!1;if(!H.multiple&&F.setItems.length>=1)return!1;if(typeof F.cache[o]>"u"){if(H.remote.url)F.timer=setTimeout(()=>{this._fetchData(o)},H.delay);else if(!H.remote.url&&H.items.length){let pe=this._prepareData(H.items),Ne=this._filterData(o,pe);F.suggestedItems=H.filterSetItems?this._filterSetItems(Ne):Ne,this.showSuggestions()}}else{let pe=this._prepareData(this.remapData(F.cache[o])),Ne=this._filterData(o,pe);F.suggestedItems=H.filterSetItems?this._filterSetItems(Ne):Ne,this.showSuggestions()}return this}_onClick(E){let F=E.target;if(F.classList.contains("item-remove"))E.preventDefault(),this._removeItem(F.key)._defocusItems()._minimizeInput()._renderItems()._refreshInput(!1)._keyInput(E);else if(F.classList.contains("tokenfield-suggest-item")){let H=this._getSuggestedItem(F.key);this._addItem(H)._minimizeInput()._renderItems()._refreshInput()._refreshSuggestions()}else{let H=KT(F).filter(V=>V.classList&&V.classList.contains("tokenfield-set-item"))[0];H?(this._focusItem(H.key,E.shiftKey,E.ctrlKey||E.metaKey,!0),this._refreshItems()):this._keyInput(E)}this.focus()}_selectPrevItem(){let E=this.key,F=this._options,H=this._vars.suggestedItems,V=this._getSelectedItemIndex();return H.length?(V!==null?V===0?F.newItems?this._deselectItems():this._selectItem(H[H.length-1][E]):this._selectItem(H[V-1][E]):this._selectItem(H[H.length-1][E]),this):this}_selectNextItem(){let E=this.key,F=this._options,H=this._vars.suggestedItems,V=this._getSelectedItemIndex();return H.length?(V!==null?V===H.length-1?F.newItems?this._deselectItems():this._selectItem(H[0][E]):this._selectItem(H[V+1][E]):this._selectItem(H[0][E]),this):this}_focusPrevItem(E=!1){let F=this.key,H=this._vars.setItems,V=this._getFocusedItemIndex();if(!H.length)return this;if(V!==null)if(V===0&&!E)this._defocusItems();else if(V===0&&E){let o=this._getFocusedItemIndex(!0);this._defocusItem(H[o][F])}else this._focusItem(H[V-1][F],E,!1,!0);else this._focusItem(H[H.length-1][F],!1,!1,!0);return this._refreshItems(),this}_focusNextItem(E=!1){let F=this.key,H=this._vars.setItems,V=this._getFocusedItemIndex(!0);return H.length?(V!==null?V===H.length-1&&!E?this._defocusItems():V===H.length-1&&E?this._focusItem(H[0][F],E):this._focusItem(H[V+1][F],E):this._focusItem(H[0][F],!1),this._refreshItems(),this):this}_getSelectedItems(){let E=this.key,F=this._vars.setItems.map(H=>H[E]);return this._vars.suggestedItems.filter(H=>H.selected&&F.indexOf(H[E])<0)}_selectItem(E,F=!1){this._vars.suggestedItems.forEach(H=>{if(H.selected=H[this.key]===E,H.selected&&F){let V=parseInt(this._html.suggest.style.maxHeight,10);if(V){let o=this._html.suggestList.getBoundingClientRect(),pe=H.el.getBoundingClientRect(),Ne=pe.top-o.top,Qe=Ne+pe.height;Qe>=V+this._html.suggest.scrollTop?this._html.suggest.scrollTop=Qe-V:Ne<this._html.suggest.scrollTop&&(this._html.suggest.scrollTop=Ne)}}})}_deselectItem(E){return this._vars.suggestedItems.every(F=>F[this.key]===E?(F.selected=!1,!1):!0),this}_deselectItems(){return this._vars.suggestedItems.forEach(E=>{E.selected=!1}),this}_refreshItemsSelection(){this._vars.suggestedItems.forEach(E=>{E.selected&&E.el?E.el.classList.add("selected"):E.el&&E.el.classList.remove("selected")})}_getSelectedItemIndex(){let E=null;return this._vars.suggestedItems.every((F,H)=>F.selected?(E=H,!1):!0),E}_getFocusedItemIndex(E=!1){let F=null;return this._vars.setItems.every((H,V)=>!(H.focused&&(F=V,!E))),F}_getItem(E,F=null){F===null&&(F=this.key);let H=this._filterItems(this._vars.setItems,E,F);return H.length?H[0]:null}_getSuggestedItem(E,F=null){F===null&&(F=this.key);let H=this._filterItems(this._vars.suggestedItems,E,F);return H.length?H[0]:null}_getAvailableItem(E,F=null){F===null&&(F=this.key);let H=this._filterItems(this._options.items,E,F);return H.length?H[0]:null}_filterItems(E,F,H){let V=this._options.filterMatchCase;return E.filter(o=>typeof o[H]=="string"&&typeof F=="string"?V?o[H]===F:o[H].toLowerCase()==F.toLowerCase():o[H]==F)}_removeItem(E){return this._vars.setItems.every((F,H)=>
1403F[this.key]===E?(this.emit("removeToken",this,F),this._vars.setItems.splice(H,1),this.emit("removedToken",this,F),this.emit("change",this),!1):!0),this}_addItem(E){E.focused=!1;let F=this._options;if((E.isNew&&!this._getItem(E[F.itemData],F.itemData)||!this._getItem(E[F.itemValue],F.itemValue))&&(this.emit("addToken",this,E),!this._options.maxItems||this._options.maxItems&&this._vars.setItems.length<this._options.maxItems)){E.selected=!1;let H=Object.assign({},E);this._vars.setItems.push(H),this.emit("addedToken",this,H),this.emit("change",this)}return this}getFocusedItem(){let E=this._vars.setItems.filter(F=>F.focused)[0];return E.length?E[0]:null}getFocusedItems(){return this._vars.setItems.filter(E=>E.focused)}_focusItem(E,F=!1,H=!1,V=!1){if(F){let o=null,pe=null,Ne=null,Qe=this._vars.setItems.length;if(this._vars.setItems.forEach((ct,Ze)=>{ct[this.key]===E&&(Ne=Ze),o===null&&ct.focused&&(o=Ze),ct.focused&&(pe=Ze)}),(Ne===0||Ne===Qe-1)&&o===null&&pe===null)return;o===null&&pe===null?this._vars.setItems[Ne].focused=!0:Ne===0&&pe===Qe-1&&!V?this._vars.setItems[o].focused=!1:(o=Math.min(Ne,o),pe=Math.max(Ne,pe),this._vars.setItems.forEach((ct,Ze)=>{ct.focused=Ne===Ze||Ze>=o&&Ze<=pe}))}else this._vars.setItems.forEach(o=>{H?o.focused=o[this.key]===E?!o.focused:o.focused:o.focused=o[this.key]===E});return this}_defocusItem(E){return this._vars.setItems.filter(F=>{F[this.key]===E&&(F.focused=!1)})}_defocusItems(){return this._vars.setItems.forEach(E=>{E.focused=!1}),this}_newItem(E){let F=this._options;if(typeof E=="string"&&(!E.length||E.length<F.minLength))return null;let H=this._getItem(E,F.itemData)||this._getSuggestedItem(E,F.itemData)||this._getAvailableItem(E,F.itemData);if(!H&&F.newItems){if(typeof F.validateNewItem=="function"&&!F.validateNewItem(E))return null;H={isNew:!0,[this.key]:Oy(),[F.itemData]:E},this.emit("newToken",this,H)}return H?(this._addItem(H),H):null}_buildEl(E){return Vy(E)}_getBounds(){return this._html.container.getBoundingClientRect()}_renderItems(){let E=this._vars,F=this._options,H=this._html;return H.items.innerHTML="",E.setItems.forEach((V,o)=>{let pe=this._renderItem(V,o);H.items.appendChild(pe),V.el=pe,V.focused?V.el.classList.add("focused"):V.el.classList.remove("focused")}),E.setItems.length>1&&F.mode==="tokenfield"?H.input.setAttribute("placeholder",""):F.mode==="list"&&H.input.setAttribute("placeholder",F.placeholder),this._input&&(this._input.value=E.setItems.map(V=>V[F.singleInputValue]).join(F.singleInputDelimiter)),this}_refreshItems(){this._vars.setItems.forEach(F=>{F.el&&(F.focused?F.el.classList.add("focused"):F.el.classList.remove("focused"))})}_renderItem(E,F){let H=this._options,V=this.renderSetItemHtml(E),o=V.querySelector(".item-label"),pe=V.querySelector(".item-input"),Ne=V.querySelector(".item-remove"),Qe=H.keepItemsOrder?`[${F}]`:"[]";return V.key=E[this.key],Ne.key=E[this.key],pe.setAttribute("name",(E.isNew?H.newItemName:H.itemName)+Qe),pe.value=E[E.isNew?H.newItemValue:H.itemValue]||null,o.textContent=this.renderSetItemLabel(E),E.focused&&V.classList.add("focused"),V}onInput(E,F){return E}renderSetItemHtml(){return this._buildEl(this._templates.setItem)}renderSetItemLabel(E){return E[this._options.itemLabel]}renderSuggestions(E){let F=this._vars,H=this._options,V=this._html,o=this._getSelectedItemIndex();if(!E.length)return this;if(H.maxSuggestWindow===0&&(V.suggest.style.maxHeight=null),!F.suggestedItems.length)return this;!H.newItems&&o===null&&(E[0].selected=!0);let pe=0;E.every((Qe,ct)=>{if(ct>=H.maxSuggest)return!1;let Ze=V.suggestList.childNodes[ct],Bt=Qe.el=this.renderSuggestedItem(Qe);return Ze?Ze.itemValue===Qe[H.itemValue]?(Ze.key=Qe[this.key],Qe.el=Ze):V.suggestList.replaceChild(Bt,Ze):Ze||V.suggestList.a
1403ppendChild(Bt),H.maxSuggestWindow>0&&ct<H.maxSuggestWindow&&(pe+=V.suggestList.childNodes[ct].getBoundingClientRect().height),H.maxSuggestWindow>0&&ct===H.maxSuggestWindow&&(V.suggest.style.maxHeight=pe+"px"),!0});let Ne=V.suggestList.childElementCount-E.length;if(Ne>0)for(let Qe=Ne-1;Qe>=0;Qe--)V.suggestList.removeChild(V.suggestList.childNodes[E.length+Qe]);return this}renderSuggestedItem(E){let F=this._options,H=this._buildEl(this._templates.suggestItem);return H.key=E[this.key],H.itemValue=E[F.itemValue],H.innerHTML=this.renderSuggestedItemContent(E),H.setAttribute("title",E[F.itemData]),E.selected&&H.classList.add("selected"),F.filterSetItems||(this._getItem(E[F.itemValue],F.itemValue)||this._getItem(E[F.itemData],F.itemData))&&H.classList.add("set"),H}renderSuggestedItemContent(E){return E[this._options.itemData]}_refreshSuggestions(){let E=this._vars,F=this._options;if(this._html.input.value.length<F.minChars)return this.hideSuggestions(),this;let H=this._prepareData(F.items),V=this._filterData(this._html.input.value,H);return E.suggestedItems=F.filterSetItems?this._filterSetItems(V):V,E.suggestedItems.length&&(!F.maxItems||F.maxItems&&E.setItems.length<F.maxItems)?(this.renderSuggestions(E.suggestedItems),this):(this.hideSuggestions(),this)}showSuggestions(){let E=this._vars,F=this._options;return E.suggestedItems.length?(this.emit("showSuggestions",this),(!F.maxItems||F.maxItems&&E.setItems.length<F.maxItems)&&(this._html.suggest.style.display="block",E.suggested=!0,this.renderSuggestions(E.suggestedItems)),this.emit("shownSuggestions",this)):this.hideSuggestions(),this}hideSuggestions(){return this.emit("hideSuggestions",this),this._vars.suggested=!1,this._html.suggest.style.display="none",this._html.suggestList.innerHTML="",this.emit("hiddenSuggestions",this),this}setSuggestedItems(E){if(!Array.isArray(E))throw new Error("Argument must be an array of objects.");this._options.items=E,this._refreshSuggestions()}getItems(){return this._vars.setItems.map(E=>{let F=Object.assign({},E);return delete F[this.key],delete F.focused,delete F.selected,delete F.el,F})}setItems(E=[]){return this._vars.setItems=[],this.addItems(E),this}addItems(E=[]){let F=this._options.itemValue;
1403return Array.isArray(E)||(E=[E]),this._prepareData(E).forEach(H=>{(H.isNew||typeof H[F]<"u")&&this._addItem(H)}),this._minimizeInput()._renderItems()._refreshInput().hideSuggestions(),this}sortItems(){let E=[];[...this._html.items.childNodes].forEach(F=>{let H=this._getItem(F.key);H&&E.push(H)}),this.setItems(E)}removeItem(E){let F=this._options;typeof E=="object"&&(E[F.itemValue]||E[F.newItemValue])&&(E=E[F.itemValue]||E[F.newItemValue]);let H=this._getItem(E,F.itemValue)||this._getItem(E,F.newItemValue);return H?(this._removeItem(H[this.key])._renderItems(),this):this}emptyItems(){return this._vars.setItems=[],this._renderItems()._refreshInput().hideSuggestions(),this.emit("change",this),this}getSuggestedItems(){return this._vars.suggestedItems.map(E=>Object.assign({},E))}focus(){return this._html.container.classList.add("focused"),this._focused||this._html.input.focus(),this}blur(){return this._html.container.classList.remove("focused"),this._focused&&this._html.input.blur(),this}remove(){let E=this._html;E.container.parentElement.insertBefore(this.el,E.container),E.container.remove(),this.el.style.display="block",Object.keys(os).length===1&&(document.removeEventListener("mousedown",this._vars.events.onMouseDown),window.removeEventListener("resize",this._vars.events.onResize)),this._form&&this._form.nodeName&&this._form.removeEventListener("reset",this._vars.events.onReset),delete os[this.id],delete this.el.tokenfield}},ob=Ny;var jh="diplomat";function sb(O){let E=new URLSearchParams(O.hash.substr(1)).get("language");return E===""?null:E}function eS(O){return O.reduce((E,F)=>[...E,...E.map(H=>[...H,F])],[[]])}function ab(O){return O.variants??O.minimize().baseName.match(/-([-\w]+)/)?.[1]}function tS(O){let E;try{E=new Intl.Locale(O)}catch{return[]}let F=E.maximize(),H=[F.script,F.region,ab(F),F.numberingSystem].filter(Qe=>Qe),V=eS(H).map(Qe=>[F.language,...Qe].join("-"));V.push(E+""),V.push(E.baseName);let o=V.map(Qe=>{try{return new Intl.Locale(Qe)}catch{}}).filter(Qe=>Qe),pe=Qe=>{let ct=Qe+"",Ze=0;return Ze+=ct.length??0,Ze+=ct.split("-").length??0,Ze+=ab(Qe)?.length??0,Ze+=ct.match(/(?:-[tx]-|-u-\w\w-)\w+/)?.[0]?.length??0,Ze};o.sort((Qe,ct)=>pe(ct)-pe(Qe));let Ne=o.map(Qe=>Qe+"");return[...new Set(Ne)]}function Va(){if(typeof window>"u"||typeof navigator>"u")return[];let F=(sb(window.location)?.split(",")??navigator.languages??[navigator.language]).flatMap(H=>tS(H));return[...new Set(F)]}var lb="name";function iS(O,E={}){return[...O.flatMap(F=>{let V=(E.localizedNamePropertyFormat||"name:$1").replaceAll("$1",F),o=[[F,V]];return E.includesLegacyFields&&(F==="de"||F==="en")&&o.push([F,V.replaceAll(":","_")]),o}),["mul",E.unlocalizedNameProperty||lb]]}function bg(O,E={}){return["coalesce",...iS(O,E).map(([H,V])=>["get",V])]}function $m(O,E,F){if(!O||O[0]!=="let")return;let H=O.indexOf(E);H%2===1?O[H+1]=F:O.splice(-1,0,E,F)}var Zs=`${jh}__localizedName`,qy=`${jh}__localizedCollator`,wg=`${jh}__diacriticInsensitiveCollator`;function cb(O,E,F){if(!Array.isArray(O)||O[0]==="literal")return;if(O[0]==="get")return O.length===2&&O[1]===E?F:void 0;let H=!1;if(O.forEach((V,o)=>{if(!o)return;let pe=cb(V,E,F);pe!==void 0&&(O[o]=pe,H=!0)}),H)return O}var hb=" \u2022 ";function rS(O,E,F){let H=O.layout&&O.layout["text-field"];if(!H||H[0]==="let"&&H.includes(Zs))return;let V=O.layout&&O.layout["symbol-placement"],Ne=cb(H,E||lb,F?mb:V==="line"||V==="line-center"?db:pb);Ne!==void 0&&(O.layout["text-field"]=["let",Zs,"",Ne])}function ub(O,E,F,H){if(!("layout"in O)||!("text-field"in O.layout))return;let V=O.layout["text-field"];$m(V,Zs,O["source-layer"]==="transportation_name"?H:F),$m(V,qy,["collator",{"case-sensitive":!1,"diacritic-sensitive":!0,locale:E}]),$m(V,wg,["collator",{"case-sensitive":!1,"diacritic-sensitive":!/^en\b/.test(E),locale:E}])}function $y(O,E=Va(),F={}){let H=bg(E,F),V=bg(E,{...F,includesLegacyFields:!0});for(let o of O)ub(o,E[0],H,V)}function yp(O,E,F){let o=["join",["split",["join",["split",O,";;"],"\x91\uFFFC\x92"],"; "],";"],pe=`${jh}__values`,Ne=`${jh}__omissionIndex`,Qe=`${jh}__abridgedValues`;
1403return["let",pe,["split",o,";"],["let",Ne,F?["index-of",F,["var",pe]]:-1,["let",Qe,["match",["var",Ne],-1,["join",["var",pe],E],["concat",["join",["slice",["var",pe],0,["var",Ne]],E],["case",["any",["==",["var",Ne],0],["==",["var",Ne],["-",["length",["var",pe]],1]]],"",E],["join",["slice",["var",pe],["+",["var",Ne],1]],E]]],["join",["split",["var",Qe],"\x91\uFFFC\x92"],";"]]]]}var pb=yp(["var",Zs],` 1404`),Wn=["let",Zs,"",pb],db=yp(["var",Zs],hb),Gm=["let",Zs,"",db];function nS(O,E,F){let H=" ,";return["all",["==",["slice",O,0,["length",E]],E,F],["in",["slice",["concat",O,H[0]],["length",E],["+",["length",E],1]],H]]}function oS(O,E){return["concat",E,["slice",O,["length",E]]]}function aS(O,E,F){let H=" ",V=`${jh}__suffixStart`;return["let",V,["-",["length",O],["length",E]],["all",["==",["slice",O,["var",V]],E,F],["==",["slice",O,["-",["var",V],1],["var",V]],H]]]}function sS(O,E){return["concat",["slice",O,0,["-",["length",O],["length",E]]],E]}var Uy=`${jh}__localizedNameList`,jy=`${jh}__nameList`,mb=["let",Uy,yp(["var",Zs],` 1405`),["case",["==",["var",Zs],["get","name"],["var",qy]],["format",["var",Uy]],["let",jy,yp(["get","name"],` 1406`),["case",nS(["var",Zs],["get","name"],["var",wg]),["format",oS(["var",Zs],["var",jy])],aS(["var",Zs],["get","name"],["var",wg]),["format",sS(["var",Zs],["var",jy])],["format",["var",Uy],` 1407`,"(\u2068",{"font-scale":.8},yp(["get","name"],hb,["var",Zs]),{"font-scale":.8},"\u2069)",{"font-scale":.8}]]]]],qh=["let",Zs,"",qy,["collator",{}],wg,["collator",{}],mb],lS={ABW:"AW",AFG:"AF",AGO:"AO",AIA:"AI",ALB:"AL",AND:"AD",ARE:"AE",ARG:"AR",ARM:"AM",ASM:"AS",ATA:"AQ",ATF:"TF",ATG:"AG",AUS:"AU",AUT:"AT",AZE:"AZ",BDI:"BI",BEL:"BE",BEN:"BJ",BFA:"BF",BGD:"BD",BGR:"BG",BHR:"BH",BHS:"BS",BIH:"BA",BLM:"BL",BLR:"BY",BLZ:"BZ",BMU:"BM",BOL:"BO",BRA:"BR",BRB:"BB",BRN:"BN",BTN:"BT",BVT:"BV",BWA:"BW",CAF:"CF",CAN:"CA",CCK:"CC",CHE:"CH",CHL:"CL",CHN:"CN",CIV:"CI",CMR:"CM",COD:"CD",COG:"CG",COK:"CK",COL:"CO",COM:"KM",CPV:"CV",CRI:"CR",CUB:"CU",CUW:"CW",CXR:"CX",CYM:"KY",CYP:"CY",CZE:"CZ",DEU:"DE",DJI:"DJ",DMA:"DM",DNK:"DK",DOM:"DO",DZA:"DZ",ECU:"EC",EGY:"EG",ERI:"ER",ESH:"EH",ESP:"ES",EST:"EE",ETH:"ET",FIN:"FI",FJI:"FJ",FLK:"FK",FRA:"FR",FRO:"FO",FSM:"FM",FXX:"FX",GAB:"GA",GBR:"GB",GEO:"GE",GGY:"GG",GHA:"GH",GIB:"GI",GIN:"GN",GLP:"GP",GMB:"GM",GNB:"GW",GNQ:"GQ",GRC:"GR",GRD:"GD",GRL:"GL",GTM:"GT",GUF:"GF",GUM:"GU",GUY:"GY",HKG:"HK",HMD:"HM",HND:"HN",HRV:"HR",HTI:"HT",HUN:"HU",IDN:"ID",IMN:"IM",IND:"IN",IOT:"IO",IRL:"IE",IRN:"IR",IRQ:"IQ",ISL:"IS",ISR:"IL",ITA:"IT",JAM:"JM",JEY:"JE",JOR:"JO",JPN:"JP",KAZ:"KZ",KEN:"KE",KGZ:"KG",KHM:"KH",KIR:"KI",KNA:"KN",KOR:"KR",KWT:"KW",LAO:"LA",LBN:"LB",LBR:"LR",LBY:"LY",LCA:"LC",LIE:"LI",LKA:"LK",LSO:"LS",LTU:"LT",LUX:"LU",LVA:"LV",MAC:"MO",MAF:"MF",MAR:"MA",MCO:"MC",MDA:"MD",MDG:"MG",MDV:"MV",MEX:"MX",MHL:"MH",MKD:"MK",MLI:"ML",MLT:"MT",MMR:"MM",MNE:"ME",MNG:"MN",MNP:"MP",MOZ:"MZ",MRT:"MR",MSR:"MS",MTQ:"MQ",MUS:"MU",MWI:"MW",MYS:"MY",MYT:"YT",NAM:"NA",NCL:"NC",NER:"NE",NFK:"NF",NGA:"NG",NIC:"NI",NIU:"NU",NLD:"NL",NOR:"NO",NPL:"NP",NRU:"NR",NZL:"NZ",OMN:"OM",PAK:"PK",PAN:"PA",PCN:"PN",PER:"PE",PHL:"PH",PLW:"PW",PNG:"PG",POL:"PL",PRI:"PR",PRK:"KP",PRT:"PT",PRY:"PY",PSE:"PS",PYF:"PF",QAT:"QA",REU:"RE",ROU:"RO",RUS:"RU",RWA:"RW",SAU:"SA",SDN:"SD",SEN:"SN",SGP:"SG",SGS:"GS",SHN:"SH",SJM:"SJ",SLB:"SB",SLE:"SL",SLV:"SV",SMR:"SM",SOM:"SO",SPM:"PM",SRB:"RS",SSD:"SS",STP:"ST",SUR:"SR",SVK:"SK",SVN:"SI",SWE:"SE",SWZ:"SZ",SXM:"SX",SYC:"SC",SYR:"SY",TCA:"TC",TCD:"TD",TGO:"TG",THA:"TH",TJK:"TJ",TKL:"TK",TKM:"TM",TLS:"TL",TON:"TO",TTO:"TT",TUN:"TN",TUR:"TR",TUV:"TV",TWN:"TW",TZA:"TZ",UGA:"UG",UKR:"UA",UMI:"UM",URY:"UY",USA:"US",UZB:"UZ",VAT:"VA",VCT:"VC",VEN:"VE",VGB:"VG",VIR:"VI",VNM:"VN",VUT:"VU",WLF:"WF",WSM:"WS",YEM:"YE",ZAF:"ZA",ZMB:"ZM",ZWE:"ZW"},Gy=`${jh}__countryNamesByCode`;function fb(O,E={}){let F=new Intl.DisplayNames(O,{type:"region",fallback:"none"});return Object.fromEntries(Object.entries(lS).map(H=>{let V=F.of(H[1]);return V&&E?.uppercase&&(V=V.toLocaleUpperCase(O).replaceAll(" "," ")),[H[0],V]}))}function Zy(O,E={}){let F={};return F[Gy]=fb(O,{uppercase:E?.uppercaseCountryNames}),F}function Sg(O){return["let","code",O,["coalesce",["get",["var","code"],["coalesce",["global-state",Gy],["literal",{}]]],["concat","(",["var","code"],")"]]]}function Tg(O,E=Va(),F={}){let H=O.getStyle(),V=bg(E,F),o=bg(E,{...F,includesLegacyFields:!0});for(let Ne of H.layers){let Qe=Ne["source-layer"];(!F.layers&&!F.sourceLayers||F.layers?.includes(Ne.id)||Qe&&F.sourceLayers?.includes(Qe))&&rS(Ne,F?.unlocalizedNameProperty,F?.glossLocalNames),ub(Ne,E[0],V,o)}let pe=fb(E,{uppercase:F?.uppercaseCountryNames});O.setGlobalStateProperty(Gy,pe),O.setStyle(H)}typeof window<"u"&&(window.Diplomat={getGlobalStateForLocalization:Zy,getLanguageFromURL:sb,getLocales:Va,getLocalizedCountryNameExpression:Sg,listValuesExpression:yp,localizeLayers:$y,localizeStyle:Tg,localizedName:Wn,localizedNameInline:Gm,localizedNameWithLocalGloss:qh},"maplibregl"in window&&(maplibregl.Diplomat=window.Diplomat,maplibregl.Map.prototype.localizeStyle=function(O=Va(),E={}){Tg(this,O,E)}));var Wm=Va(),Wy=new Intl.DisplayNames(Wm,{type:"language"}),cS=["ar-Latn","az-Arab","az-Latn","ba-Arab","ba-Cyrl","be-tarask","bo-Latn-pinyin","bo-Latn-wylie","bs-Cyrl","bs-Latn","cmn-Latn","cnr-Cyrl","cnr-Latn","cr-Latn","cr-latin","crh-Arab","crh-Cyrl","crk-Latn","el-Latn","en-US","en-fonipa","fa-Latn","fr-gallo","hak-Hant","hi-Latn","iu-Latn","ja-Hira","ja-Hrkt","ja-Jpan","ja-Kana","ja-Latn","ka-Latn","kab-Arab","kab-Tfng","kk-Arab","kk-Cyrl","kk-Latn","km-Latn","ko-CN","ko-Hani","ko-KP","ko-KR","ko-Kana","ko-Kore","ko-Latn","ku-Arab","ky-Arab","ky-Cyrl","lo-Latn","mn-Cyrl","mn-Mong","ms-Arab","my-Latn","nan-Hans","nan-Hant","nan-Latn-pehoeji","nan-Latn-tailo","oc-provenc-grmistr","pa-Arab","pt-BR","ru-Latn","sr-Latn","su-Latn","th-Latn","tk-Arab","tt-Arab","tt-Cyrl","ug-Arab","uk-Latn","uz-Arab","uz-Cyrl","uz-Latn","vi-Hani","yue-Hans","yue-Hant","yue-Latn","yue-Latn-HK","yue-Latn-jyutping","zh-Bopo","zh-Hans","zh-Hans-CN","zh-Hans-MY","zh-Hans-SG","zh-Hant","zh-Hant-CN","zh-Hant-HK","zh-Hant-MO","zh-Hant-TW","zh-Latn","zh-Latn-pinyin","zh-Latn-tongyong","zh-Latn-wadegile"],Zm;function hS(){if(Zm)return Zm;let O="abcdefghijklmnopqrstuvwxyz".split("").flatMap((V,o,pe)=>pe.flatMap(Ne=>[V+Ne].concat(pe.map(Qe=>V+Ne+Qe))));
1407O.push(...cS),O.sort();let E=new Set(O.map(V=>new Intl.Locale(V).baseName)),F={};for(let V of E){let o=Wy.of(V);o!==V&&(F[V]=o)}Zm=Object.entries(F).map(([V,o])=>({id:V,name:o}));let H=new Intl.Collator(Wm);return Zm.sort((V,o)=>H.compare(V.name,o.name)),Zm}function uS(O){let E=O.join(","),F=window.location.hash.substr(1),H=new URLSearchParams(F);H.set("language",E),window.location.hash=`#${H}`}var Ig=class{onAdd(E){this._map=E,this._container=document.createElement("div"),this._container.className="maplibregl-ctrl language-control",this._label=document.createElement("span"),this._label.className="language-label",this._container.appendChild(this._label),this._languageNameLabel=document.createElement("span"),this._languageNameLabel.className="language-name",this._label.appendChild(this._languageNameLabel),this._overflowLabel=document.createElement("span"),this._overflowLabel.className="language-overflow",this._label.appendChild(this._overflowLabel);let F=this._dialog=document.getElementById("language-dialog");return document.getElementById("language-dialog-done").addEventListener("click",()=>{F.close()}),this._dialog.addEventListener("close",this.dialogDidClose),this._opener=document.createElement("button"),this._opener.className="language-dialog-opener",this._opener.textContent="Change",this._opener.addEventListener("click",this.openDialog),this._container.appendChild(this._opener),this._map.once("load",V=>this.displayLocales()),this._map.on("americana.languagechange",V=>this.displayLocales()),this._container}onRemove(){this._container.parentNode.removeChild(this._container),this._map.off("americana.languagechange"),delete this._map,this._opener.removeEventListener("click",this.openDialog),delete this._opener,this._dialog.removeEventListener("close",this.dialogDidClose),delete this._dialog}openDialog(){if(document.getElementById("language-dialog").showModal(),document.body.classList.add("language-dialog-open"),!this._tokenField){let E=document.getElementById("language-field"),F=new Intl.ListFormat(Wm,{type:"unit"}),H=new Intl.Locale(Wm[0]).minimize(),V=new Set([Wy.of(H),H.baseName]);E.placeholder=F.format([...V]);let o=this._tokenField=new ob({el:E,items:hS(),addItemOnBlur:!0,validateNewItem:pe=>{try{return new Intl.Locale(pe)}catch{}}});o.on("change",function(){let pe=this.getItems().map(Ne=>Ne.id||Ne.name);uS(pe)}),document.getElementById("language-reset").addEventListener("click",()=>{o.emptyItems()})}document.querySelectorAll(".tokenfield-input").forEach(E=>E.setAttribute("autofocus","")),this._tokenField.focus()}dialogDidClose(){document.body.classList.remove("language-dialog-open")}displayLocales(){let E=this._map.locales,F=new Intl.ListFormat(E,{type:"disjunction"}),H=E.map(Ne=>{try{return Wy.of(Ne)||Ne}catch{return Ne}}),o=H[0].split(/(\p{gc=Ps}.+?\p{gc=Pe})/u),pe=[];for(let Ne of o)if(Ne.match(/\p{gc=Ps}/u)){let Qe=document.createElement("span");Qe.className="language-qualifier",Qe.textContent=Ne,pe.push(Qe)}else pe.push(document.createTextNode(Ne));if(this._languageNameLabel.replaceChildren(...pe),H.length>1){let Ne=H.length-1,Qe=new Intl.NumberFormat(Wm,{signDisplay:"always"});this._overflowLabel.textContent=Qe.format(Ne)}this._label.setAttribute("title",F.format(H))}};var gm=_p(id(),1);var xb=_p(id(),1);var Qo,Yl,Kl=-1,Ky=[],Yy=[],_b;function yb(O,E){return O.filter(function(F){return F!==void 0&&F!=""}).join(E)}function vb(O){let E=Ky[O],F=Yy[O];Kl=-1,Ky=[],Yy=[],Yl.innerHTML="",Qo.value="",Qo.classList.remove("pending"),map.getCanvas().focus(),E!=null?map.fitBounds(E):map.setCenter({lat:F[1],lon:F[0]})}function pS(O,E,F){switch(O){case"house":switch(E){case"highway":return F==="bus_stop"?F:"road";case"aeroway":return F==="aerodrome"?"airport":F;case"railway":return`train ${F}`;case"man_made":case"tourism":case"amenity":case"leisure":return F;default:return E}case"district":case"locality":return E==="landuse"?`${F} area`:F;case"tunnel":return E}return O}function dS(O){let E=O.properties,F=pS(E.type,E.osm_key,E.osm_value).replaceAll("_"," "),H=yb([E.housenumber,E.street]," "),V=E.name;V==null&&(V=H,H=void 0);let o=yb([H,E.city,E.county,E.state,E.country],", "),pe=document.createElement("li");pe.className="gc-result-item",pe.role="option";let Ne=document.createElement("div");Ne.className="gc-result-category",Ne.innerText=F;let Qe=document.createElement("div");Qe.className="gc-result-name",Qe.innerText=V;let ct=document.createElement("div");return ct.className="gc-result-description",ct.innerText=o,pe.appendChild(Ne),pe.appendChild(Qe),pe.appendChild(ct),pe}function mS(O){Yl.innerHTML="";for(let E=0;E<O.features.length;E++){Ky[E]=O.features[E].properties.extent,Yy[E]=O.features[E].geometry.coordinates;let F=dS(O.features[E]);Yl.appendChild(F),F.onclick=H=>vb(E)}}function fS(O){let E=O.target.value;if(Kl=-1,E.length<3){Qo.classList.remove("pending"),Yl.innerHTML="";return}let F=map.getCenter(),H=new URL("https://photon.komoot.io/api/?limit=3");console.log(map.getZoom()),map.getZoom()>5&&(H.searchParams.set("lat",F.lat),H.searchParams.set("lon",F.lng)),H.searchParams.set("q",O.target.value),gS(H)}async function gS(O){_b?.abort();let E=new AbortController;_b=E;
1407try{Qo.classList.contains("pending")||(Qo.classList.add("pending"),Qo.animate({backgroundImage:["none","none"]},300));let H=await(await fetch(O,{signal:E.signal})).json();if(E.signal.aborted)return;Qo.classList.remove("pending"),mS(H)}catch(F){F instanceof DOMException}}function _S(O){if(O.defaultPrevented)return;let E=Kl;switch(O.code){case"ArrowUp":Kl--,O.preventDefault();break;case"ArrowDown":Kl++,O.preventDefault();break;case"Enter":if(Yl.children.length===0){O.preventDefault();return}let F=Kl<0?0:Kl;vb(F);return;default:return}if(Kl>=Yl.children.length&&(Kl=Yl.children.length-1),Kl<-1&&(Kl=-1),E>=0&&Yl.children[E].classList.remove("gc-result-item-selected"),Kl>=0){let F=Yl.children[Kl];F.classList.add("gc-result-item-selected"),Qo.ariaActiveDescendantElement=F}else Qo.ariaActiveDescendantElement=null}var Cg=class extends xb.Evented{constructor(){super()}onAdd(E){this._map=E,Qo=document.createElement("input"),Qo.id="geocoder-search-input",Qo.type="search",Qo.role="combobox",Qo.ariaExpanded=!0,Qo.setAttribute("aria-controls","geocoder-live-results"),Qo.placeholder="Search",Qo.autocomplete="off",Qo.addEventListener("input",fS),Qo.addEventListener("keydown",_S);var F=document.createElement("form");return F.appendChild(Qo),Yl=document.createElement("ul"),Yl.id="geocoder-live-results",Yl.role="listbox",this._container=document.createElement("div"),this._container.id="geocoder-search-panel",this._container.className="maplibregl-ctrl",this._container.append(F,Yl),this._container}onRemove(){this._container.parentNode.removeChild(this._container),this._map=void 0}};var xS=Object.create,Cb=Object.defineProperty,vS=Object.getOwnPropertyDescriptor,bS=Object.getOwnPropertyNames,wS=Object.getPrototypeOf,TS=Object.prototype.hasOwnProperty,SS=(O,E)=>()=>(E||O((E={exports:{}}).exports,E),E.exports),IS=(O,E,F,H)=>{if(E&&typeof E=="object"||typeof E=="function")for(let V of bS(E))!TS.call(O,V)&&V!==F&&Cb(O,V,{get:()=>E[V],enumerable:!(H=vS(E,V))||H.enumerable});return O},CS=(O,E,F)=>(F=O!=null?xS(wS(O)):{},IS(E||!O||!O.__esModule?Cb(F,"default",{value:O,enumerable:!0}):F,O)),ES=SS((O,E)=>{"use strict";E.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],ol
1407ive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}),bb=CS(ES(),1),MS=PS,wb={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function PS(O){var E,F=[],H=1,V;if(typeof O=="string")if(O=O.toLowerCase(),bb.default[O])F=bb.default[O].slice(),V="rgb";else if(O==="transparent")H=0,V="rgb",F=[0,0,0];
1407else if(/^#[A-Fa-f0-9]+$/.test(O)){var o=O.slice(1),pe=o.length,Ne=pe<=4;H=1,Ne?(F=[parseInt(o[0]+o[0],16),parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16)],pe===4&&(H=parseInt(o[3]+o[3],16)/255)):(F=[parseInt(o[0]+o[1],16),parseInt(o[2]+o[3],16),parseInt(o[4]+o[5],16)],pe===8&&(H=parseInt(o[6]+o[7],16)/255)),F[0]||(F[0]=0),F[1]||(F[1]=0),F[2]||(F[2]=0),V="rgb"}else if(E=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(O)){var Qe=E[1],ct=Qe==="rgb",o=Qe.replace(/a$/,"");V=o;var pe=o==="cmyk"?4:o==="gray"?1:3;F=E[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(Ct,Mt){if(/%$/.test(Ct))return Mt===pe?parseFloat(Ct)/100:o==="rgb"?parseFloat(Ct)*255/100:parseFloat(Ct);if(o[Mt]==="h"){if(/deg$/.test(Ct))return parseFloat(Ct);if(wb[Ct]!==void 0)return wb[Ct]}return parseFloat(Ct)}),Qe===o&&F.push(1),H=ct||F[pe]===void 0?1:F[pe],F=F.slice(0,pe)}else O.length>10&&/[0-9](?:\s|\/)/.test(O)&&(F=O.match(/([0-9]+)/g).map(function(Ze){return parseFloat(Ze)}),V=O.match(/([a-z])/ig).join("").toLowerCase());else isNaN(O)?Array.isArray(O)||O.length?(F=[O[0],O[1],O[2]],V="rgb",H=O.length===4?O[3]:1):O instanceof Object&&(O.r!=null||O.red!=null||O.R!=null?(V="rgb",F=[O.r||O.red||O.R||0,O.g||O.green||O.G||0,O.b||O.blue||O.B||0]):(V="hsl",F=[O.h||O.hue||O.H||0,O.s||O.saturation||O.S||0,O.l||O.lightness||O.L||O.b||O.brightness]),H=O.a||O.alpha||O.opacity||1,O.opacity!=null&&(H/=100)):(V="rgb",F=[O>>>16,(O&65280)>>>8,O&255]);return{space:V,values:F,alpha:H}}var t0={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]},Jy={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(O){var E=O[0]/360,F=O[1]/100,H=O[2]/100,V,o,pe,Ne,Qe,ct=0;if(F===0)return Qe=H*255,[Qe,Qe,Qe];for(o=H<.5?H*(1+F):H+F-H*F,V=2*H-o,Ne=[0,0,0];ct<3;)pe=E+1/3*-(ct-1),pe<0?pe++:pe>1&&pe--,Qe=6*pe<1?V+(o-V)*6*pe:2*pe<1?o:3*pe<2?V+(o-V)*(2/3-pe)*6:V,Ne[ct++]=Qe*255;return Ne}};t0.hsl=function(O){var E=O[0]/255,F=O[1]/255,H=O[2]/255,V=Math.min(E,F,H),o=Math.max(E,F,H),pe=o-V,Ne,Qe,ct;return o===V?Ne=0:E===o?Ne=(F-H)/pe:F===o?Ne=2+(H-E)/pe:H===o&&(Ne=4+(E-F)/pe),Ne=Math.min(Ne*60,360),Ne<0&&(Ne+=360),ct=(V+o)/2,o===V?Qe=0:ct<=.5?Qe=pe/(o+V):Qe=pe/(2-o-V),[Ne,Qe*100,ct*100]};function Eg(O){Array.isArray(O)&&O.raw&&(O=String.raw(...arguments));var E,F,H,V=MS(O);if(!V.space)return[];let o=V.space[0]==="h"?Jy.min:t0.min,pe=V.space[0]==="h"?Jy.max:t0.max;return E=Array(3),E[0]=Math.min(Math.max(V.values[0],o[0]),pe[0]),E[1]=Math.min(Math.max(V.values[1],o[1]),pe[1]),E[2]=Math.min(Math.max(V.values[2],o[2]),pe[2]),V.space[0]==="h"&&(E=Jy.rgb(E)),E.push(Math.min(Math.max(V.alpha,0),1)),E}var kS='"sans-serif-condensed", "Arial Narrow", sans-serif',Hm=(O,E)=>`condensed 500 ${O}px ${E||kS}`,Tb=11.8;function Qy(O,E,F){return 255-O/255*(255-F)-(1-O/255)*(255-E)}function AS(O,E,F,H){E[H]=O[F],E[H+1]=O[F+1],E[H+2]=O[F+2],E[H+3]=O[F+3]}function zS(O,E,F,H,V,o){E[H]=Qy(O[F],V[0],o[0]),E[H+1]=Qy(O[F+1],V[1],o[1]),E[H+2]=Qy(O[F+2],V[2],o[2]),E[H+3]=O[F+3]}function r0(O,E,F,H,V,o){let pe=O.createImageData(E.data.width,E.data.height),Ne=V||o?zS:AS,Qe=Eg(V||"#000"),ct=Eg(o||"#fff");if(H)for(let Ze=0;Ze<E.data.height;Ze++)for(let Bt=0;Bt<E.data.width;Bt++){let Ct=((E.data.height-Ze-1)*E.data.width+Bt)*4,Mt=(Ze*E.data.width+Bt)*4;Ne(E.data.data,pe.data,Mt,Ct,Qe,ct)}else for(let Ze=0;Ze<E.data.data.length;Ze+=4)Ne(E.data.data,pe.data,Ze,Ze,Qe,ct);O.putImageData(pe,0,F)}var xp={Middle:"middle",Top:"top",Bottom:"bottom"},DS={top:0,bottom:0,left:0,right:0};function Eb(O,E){var F=O.width,H=O.height,V=E.width,o=E.height;return F*H/Math.sqrt(F*F*o*o+H*H*V*V)}function LS(O,E){return{scale:Eb(O,E),valign:xp.Middle}}function RS(O,E){return{scale:Eb(O,{height:E.width/2,width:E.height}),valign:xp.Top}}function Mb(O,E){var F=O.height/E.height,H=O.width/E.width;return{scale:Math.min(H,F),valign:xp.Middle}}function FS(O,E,F){let H=2;return F!==void 0&&F.radius!==void 0&&(H=F.radius),Mb({width:O.width-H*(2-Math.sqrt(2)),height:O.height-H*(2-Math.sqrt(2))},E)}function Pb(O,E){let F=O.width,H=O.height,V=E.width,o=E.height;return{scale:F*H/(H*V+F*o),valign:xp.Middle}}function BS(O,E){return{scale:Pb(O,E).scale,valign:xp.Top}}function OS(){if(typeof window>"u")return!1;let O=window.navigator.userAgent;return/WebKit/i.test(O)&&!/Chrome/i.test(O)}function kb(O,E,F,H,V,o=14){let pe=O.px(F.top)||0,Ne=O.px(F.bottom)||0,Qe=O.px(F.left)||0,ct=O.px(F.right)||0,Ze=O.px(o),Bt=O.gfxFactory.createGraphics(H);Bt.font=Hm(Tb,O.options.shieldFont),Bt.textAlign="left",Bt.textBaseline="top";let Ct=Bt.measureText(E),Mt=Math.abs(Ct.actualBoundingBoxLeft)+Math.abs(Ct.actualBoundingBoxRight),fi=Math.abs(Ct.actualBoundingBoxDescent)+Math.abs(Ct.actualBoundingBoxAscent);fi*=.9,OS()&&(fi*=.54);let At=H.height-pe-Ne,He=H.width-Qe-ct,Ut=Qe+He/2,Mi=zb[V.constraintFunc],li=Mi({height:At,width:He},{height:fi,width:Mt},V.options);var ki=Math.min(Ze,Tb*li.scale);Bt.font=Hm(ki,O.options.shieldFont),Bt.textAlign="left",Bt.textBaseline="top",Ct=Bt.measureText(E),fi=Math.abs(Ct.actualBoundingBoxDescent)+Math.abs(Ct.actualBoundingBoxAscent);let wi;switch(li.valign){case xp.Top:wi=pe+Ct.actualBoundingBoxAscent;break;case xp.Bottom:wi=pe+At-fi+Ct.actualBoundingBoxAscent;break;case xp.Middle:default:wi=pe+(At-fi)/2;break}return{xBaseline:Ut,yBaseline:wi,fontPx:ki}}var VS={padding:{top:0,bottom:0,left:0,right:0},shapeBlank:{drawFunc:"rect",params:{fillColor:"white",strokeColor:"black"}}};function NS(O,E,F,H){F==null&&(F=VS);var V=F.padding||DS,o={constraintFunc:"rect"},pe=14;return typeof F.textLayout<"u"&&(o=F.textLayout),typeof F.maxFontSize<"u"&&(pe=Math.min(pe,F.maxFontSize)),kb(O,E,V,H,o,pe)}function US(O,E,F,H){Ab(O,E,H),E.fillText(F,H.xBaseline,H.yBaseline)}function Sb(O,E,F,H){Ab(O,E,H),E.shadowColor=E.strokeStyle.toString(),E.shadowBlur=0,E.lineWidth=O.px(2),E.strokeText(F,H.xBaseline,H.yBaseline),E.shadowColor=null,E.shadowBlur=null}function Ab(O,E,F){E.textAlign="center",E.textBaseline="top",E.font=Hm(F.fontPx,O.options.shieldFont)}function jS(O,E,F){var H=O.emptySprite();return H.font=Hm(F,O.options.shieldFont),Math.ceil(H.measureText(E).width)}var zb={};function am(O,E){zb[O]=E}am("diamond",Pb);am("ellipse",LS);am("rect",Mb);am("roundedRect",FS);am("southHalfEllipse",RS);am("triangleDown",BS);function qS(O,E,F){Mg(O,E,{fillColor:"white",strokeColor:"black",outlineWidth:1,radius:2,rectWidth:20});let H=F.fillColor,V=O.px(.5),o=O.shieldSize()/3-V;return E.beginPath(),E.arc(O.shieldSize()/2,O.shieldSize()/2,o,0,2*Math.PI,!1),E.fillStyle=H,E.strokeStyle=F.strokeColor,E.fill(),E.lineWidth=V,E.stroke(),20}function $S(O,E,F){Mg(O,E,{fillColor:"#006747",strokeColor:"white",outlineWidth:1,radius:2,rectWidth:20});let H=F.fillColor,V=O.px(.5),o=.15*O.shieldSize()+V,pe=.7*O.shieldSize()-2*V,Ne=.4*O.shieldSize()+V,Qe=.45*O.shieldSize()-2*V;return E.beginPath(),E.rect(o,Ne,pe,Qe),E.fillStyle=H,E.strokeStyle=F.strokeColor,E.fill(),E.lineWidth=V,E.stroke(),20}function GS(){_l("branson",$S,20),_l("paBelt",qS,20)}var ZS=20,WS=34,HS=18;function Ic(O,E,F,H){if(i0[H]!==void 0)return O.px(i0[H]);let V=E.rectWidth==null?null:E.rectWidth,o=E.sideAngle==null?0:E.sideAngle,pe=Math.tan(o);if(V==null){let Ne=jS(O,F,O.px(HS))+O.px(2),Qe=O.px(ZS);switch(H){case"pentagon":let ct=E.yOffset==null?0:E.yOffset;Ne+=(O.shieldSize()-O.px(ct))*pe/2;break;case"trapezoid":Ne+=O.shieldSize()*pe/2;break;case"triangle":Qe+=O.px(2);break;case"diamond":case"hexagonHorizontal":Qe+=O.px(4);break}return Math.max(Qe,Math.min(O.px(WS),Ne))}else return O.px(V)}function XS(O,E,F,H){let V=F.fillColor==null?"white":F.fillColor,o=F.strokeColor==null?"black":F.strokeColor,pe=Ic(O,F,H),Ne=O.px(1),Qe=pe/2-Ne,ct=O.shieldSize()/2-Ne;return E.beginPath(),E.ellipse(E.canvas.width/2,O.shieldSize()/2,Qe,ct,0,0,2*Math.PI,!1),E.fillStyle=V,E.fill(),E.lineWidth=Ne,E.strokeStyle=o,E.stroke(),pe}function KS(O,E,F,H){return F.radius=O.shieldSize()/O.px(2),Mg(O,E,F,H)}function Mg(O,E,F,H){let V=F.fillColor==null?"white":F.fillColor,o=F.strokeColor==null?"black":F.strokeColor,pe=F.radius==null?0:F.radius,Ne=F.outlineWidth==null?1:F.outlineWidth,Qe=Ic(O,F,H),ct=O.px(Ne),Ze=ct/2,Bt=O.px(pe),Ct=Ze,Mt=Ze+Bt,fi=Qe-Ze-Bt,At=Qe-Ze,He=Ze,Ut=Ze+Bt,Mi=O.shieldSize()-Ze-Bt,li=O.shieldSize()-Ze;return E.beginPath(),E.moveTo(fi,He),E.arcTo(At,He,At,Ut,Bt),E.ar
1407cTo(At,li,fi,li,Bt),E.arcTo(Ct,li,Ct,Mi,Bt),E.arcTo(Ct,He,Mt,He,Bt),E.closePath(),E.lineWidth=ct,E.fillStyle=V,E.fill(),o!=null&&(E.strokeStyle=o,E.stroke()),Qe}function YS(O,E,F,H){let V=F.yOffset==null?0:F.yOffset,o=F.fillColor==null?"white":F.fillColor,pe=F.strokeColor==null?"black":F.strokeColor,Ne=F.radius==null?0:F.radius,Qe=F.outlineWidth==null?1:F.outlineWidth,ct=Ic(O,F,H),Ze=O.px(Qe),Bt=Ze/2,Ct=O.px(Ne),Mt=O.px(V),fi=Bt,At=ct-Bt,He=Bt,Ut=O.shieldSize()-Bt,Mi=fi+Ct,li=(fi+At)/2,ki=He+Ct,wi=Ut-Mt,ci=(2*fi+li)/3,Pe=(li+2*At)/3,Ve=(wi+Ut)/2,Ye=(Ve+2*Ut)/3;return E.beginPath(),E.moveTo(li,Ut),E.bezierCurveTo(ci,Ye,fi,Ve,fi,wi),E.arcTo(fi,He,Mi,He,Ct),E.arcTo(At,He,At,ki,Ct),E.lineTo(At,wi),E.bezierCurveTo(At,Ve,Pe,Ye,li,Ut),E.closePath(),E.lineWidth=Ze,E.fillStyle=o,E.fill(),pe!=null&&(E.strokeStyle=pe,E.stroke()),ct}function JS(O,E,F,H){let V=F.pointUp==null?!1:F.pointUp,o=F.fillColor==null?"white":F.fillColor,pe=F.strokeColor==null?"black":F.strokeColor,Ne=F.outlineWidth==null?1:F.outlineWidth,Qe=V?-1:1,ct=Ic(O,F,H),Ze=O.px(Ne),Bt=Ze/2,Ct=Bt,Mt=ct-Bt,fi=V?O.shieldSize()-Bt:Bt,At=V?Bt:O.shieldSize()-Bt,He=Ct+O.px(1),Ut=Ct+O.px(2.5),Mi=(Ct+Mt)/2,li=Mt-O.px(2.5),ki=Mt-O.px(1),wi=fi+Qe*O.px(2),ci=fi+Qe*O.px(4.5),Pe=fi+Qe*O.px(7),Ve=At-Qe*O.px(6),Ye=At-Qe*O.px(1),It=(Ct+Mi)/2,jt=(Mi+Mt)/2;return E.beginPath(),E.moveTo(Mi,At),E.bezierCurveTo(It,Ye,Ct,Ve,Ct,Pe),E.bezierCurveTo(Ct,ci,He,wi,Ut,fi),E.lineTo(li,fi),E.bezierCurveTo(ki,wi,Mt,ci,Mt,Pe),E.bezierCurveTo(Mt,Ve,jt,Ye,Mi,At),E.closePath(),E.lineWidth=Ze,E.fillStyle=o,E.fill(),pe!=null&&(E.strokeStyle=pe,E.stroke()),ct}function QS(O,E,F,H){let V=F.pointUp==null?!1:F.pointUp,o=F.fillColor==null?"white":F.fillColor,pe=F.strokeColor==null?"black":F.strokeColor,Ne=F.radius==null?0:F.radius,Qe=F.outlineWidth==null?1:F.outlineWidth,ct=V?-1:1,Ze=Ic(O,F,H,"triangle"),Bt=O.px(Qe),Ct=Bt/2,Mt=O.px(Ne),fi=Ct,At=Ze-Ct,He=V?O.shieldSize()-Ct:Ct,Ut=V?Ct:O.shieldSize()-Ct,Mi=fi+Mt,li=(fi+At)/2,ki=At-Mt,wi=He+ct*Mt,ci=Math.atan((li-Mi)/Math.abs(Ut-Mt-wi)),Pe=Math.sin(ci),Ve=Math.cos(ci),Ye=Math.tan(ci/2),It=Math.tan(Math.PI/4-ci/2),jt=Mi-Mt*Ve,Si=li-Mt*It,hi=li+Mt*It,Nt=ki+Mt*Ve,vi=wi+ct*Mt*Ye,Li=wi+ct*Mt*Pe,pi=Ut-ct*Mt*(1-Pe);return E.beginPath(),E.moveTo(li,Ut),E.arcTo(Si,Ut,jt,Li,Mt),E.arcTo(fi,vi,fi,wi,Mt),E.arcTo(fi,He,Mi,He,Mt),E.arcTo(At,He,At,wi,Mt),E.arcTo(At,vi,Nt,Li,Mt),E.arcTo(hi,Ut,li,Ut,Mt),E.closePath(),E.lineWidth=Bt,E.fillStyle=o,E.fill(),pe!=null&&(E.strokeStyle=pe,E.stroke()),Ze}function eI(O,E,F,H){let V=F.shortSideUp==null?!1:F.shortSideUp,o=F.sideAngle==null?0:F.sideAngle,pe=F.fillColor==null?"white":F.fillColor,Ne=F.strokeColor==null?"black":F.strokeColor,Qe=F.radius==null?0:F.radius,ct=F.outlineWidth==null?1:F.outlineWidth,Ze=V?-1:1,Bt=Math.sin(o),Ct=Math.cos(o),Mt=Math.tan(o),fi=Ic(O,F,H,"trapezoid"),At=O.px(ct),He=At/2,Ut=O.px(Qe),Mi=He,li=fi-He,ki=V?O.shieldSize()-He:He,wi=V?He:O.shieldSize()-He,ci=ki+Ze*Ut*(1+Bt),Pe=wi-Ze*Ut*(1-Bt),Ve=Mi+(ci-ki)*Mt,Ye=Ve+Ut*Ct,It=Mi+Ze*(Pe-ki)*Mt,jt=Mi+Ze*(wi-ki)*Mt,Si=It+Ze*Ut*Ct,hi=fi-jt,Nt=fi-It,vi=fi-Ye;return E.beginPath(),E.moveTo(vi,ki),E.arcTo(li,ki,Nt,Pe,Ut),E.arcTo(hi,wi,Si,wi,Ut),E.arcTo(jt,wi,Ve,ci,Ut),E.arcTo(Mi,ki,vi,ki,Ut),E.closePath(),E.lineWidth=At,E.fillStyle=pe,E.fill(),Ne!=null&&(E.strokeStyle=Ne,E.stroke()),fi}function tI(O,E,F,H){let V=F.fillColor==null?"white":F.fillColor,o=F.strokeColor==null?"black":F.strokeColor,pe=F.radius==null?0:F.radius,Ne=F.outlineWidth==null?1:F.outlineWidth,Qe=n0(O,"diamond"),ct=Ic(O,F,H,"diamond"),Ze=O.px(Ne),Bt=Ze/2,Ct=O.px(pe),Mt=Bt,fi=ct-Bt,At=Bt,He=Qe-Bt,Ut=(Mt+fi)/2,Mi=(At+He)/2,li=Math.atan((Ut-Ct-Mt)/(He-Ct-Mi)),ki=Math.sin(li),wi=Math.cos(li),ci=Math.tan(li/2),Pe=Math.tan(Math.PI/4-li/2),Ve=Mt+Ct*(1-wi),Ye=Ut-Ct*wi,It=Ut-Ct*Pe,jt=Ut+Ct*Pe,Si=Ut+Ct*wi,hi=fi-Ct*(1-wi),Nt=At+Ct*(1-ki),vi=Mi-Ct*ki,Li=Mi-Ct*ci,pi=Mi+Ct*ci,er=Mi+Ct*ki,lr=He-Ct*(1-ki);return E.beginPath(),E.moveTo(Ut,He),E.arcTo(It,He,Ve,er,Ct),E.arcTo(Mt,pi,Mt,Mi,Ct),E.arcTo(Mt,Li,Ye,Nt,Ct),E.arcTo(It,At,Ut,At,Ct),E.arcTo(jt,At,hi,vi,Ct),E.arcTo(fi,Li,fi,Mi,Ct),E.arcTo(fi,pi,Si,lr,Ct),E.arcTo(jt,He,Ut,He,Ct),E.closePath(),E.lineWidth=Ze,E.fillStyle=V,E.fill(),o!=null&&(E.strokeStyle=o,E.stroke()),ct}function iI(O,E,F,H){let V=F.pointUp==null?!0:F.pointUp,o=F.yOffset==null?0:F.yOffset,pe=F.sideAngle==null?0:F.sideAngle,Ne=F.fillColor==null?"white":F.fillColor,Qe=F.strokeColor==null?"black":F.strokeColor,ct=F.radius1==null?0:F.radius1,Ze=F.radius2==null?0:F.radius2,Bt=F.outlineWidth==null?1:F.outlineWidth,Ct=V?-1:1,Mt=Math.sin(pe),fi=Math.cos(pe),At=Math.tan(pe),He=Ic(O,F,H,"pentagon"),Ut=O.px(Bt),Mi=Ut/2,li=O.px(ct),ki=O.px(Ze),wi=O.px(o),ci=Mi,Pe=He-Mi,Ve=V?O.shieldSize()-Mi:Mi,Ye=V?Mi:O.shieldSize()-Mi,It=Ye-Ct*wi,jt=ci+Ct*(It-Ve)*At,Si=(ci+Pe)/2,hi=Pe-Ct*(It-Ve)*At,Nt=Math.atan(wi/(Si-ci)),vi=(Math.PI/2-Nt+pe)/2,Li=Math.tan(vi),pi=(Math.PI/2-pe)/2,er=Math.tan(pi),lr=ci+li*Li*Mt,_n=jt+ki*er,qr=hi-ki*er,Cn=Pe-li*Li*Mt,yn=It-Ct*li*Li*fi;
1407return E.beginPath(),E.moveTo(Si,Ye),E.arcTo(ci,It,lr,yn,li),E.arcTo(jt,Ve,_n,Ve,ki),E.lineTo(qr,Ve),E.arcTo(hi,Ve,Cn,yn,ki),E.arcTo(Pe,It,Si,Ye,li),E.closePath(),E.lineWidth=Ut,E.fillStyle=Ne,E.fill(),Qe!=null&&(E.strokeStyle=Qe,E.stroke()),He}function rI(O,E,F,H){let V=F.yOffset==null?0:F.yOffset,o=F.fillColor==null?"white":F.fillColor,pe=F.strokeColor==null?"black":F.strokeColor,Ne=F.radius==null?0:F.radius,Qe=F.outlineWidth==null?1:F.outlineWidth,ct=Ic(O,F,H),Ze=O.px(Qe),Bt=Ze/2,Ct=O.px(Ne),Mt=O.px(V),fi=Bt,At=ct-Bt,He=Bt,Ut=O.shieldSize()-Bt,Mi=(fi+At)/2,li=He+Mt,ki=Ut-Mt,wi=Ct*Math.tan(Math.PI/4-Math.asin(Mt/(Mi-fi))/2),ci=li+wi,Pe=ki-wi;return E.beginPath(),E.moveTo(Mi,Ut),E.arcTo(fi,ki,fi,Pe,Ct),E.arcTo(fi,li,Mi,He,Ct),E.lineTo(Mi,He),E.arcTo(At,li,At,ci,Ct),E.arcTo(At,ki,Mi,Ut,Ct),E.lineTo(Mi,Ut),E.closePath(),E.lineWidth=Ze,E.fillStyle=o,E.fill(),pe!=null&&(E.strokeStyle=pe,E.stroke()),ct}function nI(O,E,F,H){let V=F.sideAngle==null?0:F.sideAngle,o=F.fillColor==null?"white":F.fillColor,pe=F.strokeColor==null?"black":F.strokeColor,Ne=F.radius==null?0:F.radius,Qe=F.outlineWidth==null?1:F.outlineWidth,ct=Math.sin(V),Ze=Math.cos(V),Bt=Math.tan(V),Ct=Math.tan(Math.PI/4-V/2),Mt=Ic(O,F,H,"hexagonHorizontal"),fi=O.px(Qe),At=fi/2,He=O.px(Ne),Ut=At,Mi=Mt-At,li=At,ki=O.shieldSize()-At,wi=(li+ki)/2,ci=li+He*Ct*Ze,Pe=wi-He*ct,Ve=wi+He*ct,Ye=ki-He*Ct*Ze,It=Ut+(wi-Pe)*Bt,jt=Ut+(wi-li)*Bt,Si=Mi-(wi-li)*Bt,hi=Mi-(wi-Pe)*Bt,Nt=jt-He*Ct*ct,vi=jt+He*Ct,Li=Si-He*Ct,pi=Si+He*Ct*ct;return E.beginPath(),E.moveTo(vi,li),E.arcTo(Si,li,pi,ci,He),E.arcTo(Mi,wi,hi,Ve,He),E.arcTo(Si,ki,Li,ki,He),E.arcTo(jt,ki,Nt,Ye,He),E.arcTo(Ut,wi,It,Pe,He),E.arcTo(jt,li,vi,li,He),E.closePath(),E.lineWidth=fi,E.fillStyle=o,E.fill(),pe!=null&&(E.strokeStyle=pe,E.stroke()),Mt}function oI(O,E,F,H){let V=F.yOffset==null?0:F.yOffset,o=F.sideAngle==null?0:F.sideAngle,pe=F.fillColor==null?"white":F.fillColor,Ne=F.strokeColor==null?"black":F.strokeColor,Qe=F.radius==null?0:F.radius,ct=F.outlineWidth==null?1:F.outlineWidth,Ze=Math.sin(o),Bt=Math.cos(o),Ct=Math.tan(o),Mt=Ic(O,F,H),fi=O.px(ct),At=fi/2,He=O.px(Qe),Ut=O.px(V),Mi=At,li=Mt-At,ki=At,wi=O.shieldSize()-At,ci=Mi+He*Ct*Ze,Pe=(Mi+li)/2,Ve=li-He*Ct*Ze,Ye=ki+Ut,It=(ki+wi)/2,jt=wi-Ut,Si=Mi+(It-Ye)*Ct,hi=li-(It-Ye)*Ct,Nt=It-He*Ct*Bt,vi=It+He*Ct*Bt,Li=Math.atan(Ut/(Pe-Si)),pi=Math.sin(Li),er=Math.cos(Li),lr=(Math.PI/2-o-Li)/2,_n=Math.cos(lr),qr=He*Math.cos(o+lr)/_n,Cn=He*Math.sin(o+lr)/_n,yn=Si+qr-He*Bt,zo=Si+qr-He*pi,$r=hi-qr+He*pi,yo=hi-qr+He*Bt,Dr=Ye+Cn-He*er,fa=Ye+Cn-He*Ze,Do=jt-Cn+He*Ze,Qn=jt-Cn+He*er;return E.beginPath(),E.moveTo(Pe,wi),E.arcTo(Si,jt,yn,Do,He),E.arcTo(Mi,It,ci,Nt,He),E.arcTo(Si,Ye,zo,Dr,He),E.lineTo(Pe,ki),E.arcTo(hi,Ye,yo,fa,He),E.arcTo(li,It,Ve,vi,He),E.arcTo(hi,jt,$r,Qn,He),E.lineTo(Pe,wi),E.closePath(),E.lineWidth=fi,E.fillStyle=pe,E.fill(),Ne!=null&&(E.strokeStyle=Ne,E.stroke()),Mt}function n0(O,E){return E==="diamond"?O.shieldSize()+O.px(4):O.shieldSize()}function aI(O,E,F,H,V){return Db[E](O,F,H,V)}var Db={},i0={};function _l(O,E,F){Db[O]=E,F!==void 0&&(i0[O]=F)}_l("diamond",tI);_l("ellipse",XS);_l("escutcheon",YS);_l("fishhead",JS);_l("hexagonVertical",rI);_l("hexagonHorizontal",nI);_l("octagonVertical",oI);_l("pentagon",iI);_l("pill",KS);_l("roundedRectangle",Mg);_l("trapezoid",eI);_l("triangle",QS);GS();var sI={constraintFunc:"rect"};function lI(O,E,F){F.bannerTextColor?E.fillStyle=F.bannerTextColor:E.fillStyle=O.options.bannerTextColor,Lb(O,E,F,uI)}function cI(O,E,F){F.bannerTextHaloColor?E.strokeStyle=E.shadowColor=F.bannerTextHaloColor:E.strokeStyle=E.shadowColor=O.options.bannerTextHaloColor,Lb(O,E,F,pI)}function Lb(O,E,F,H){if(!(F==null||typeof F.banners>"u"))for(var V=0;V<F.banners.length;V++)H(O,E,F.banners[V],V)}function hI(O){return O==null||typeof O.banners>"u"?0:O.banners.length}function uI(O,E,F,H){Rb(O,E,F,H,!0)}function pI(O,E,F,H){Rb(O,E,F,H,!1)}function Rb(O,E,F,H,V){let o={top:0,bottom:0,left:0,right:0},pe={width:E.canvas.width,height:O.px(O.options.bannerHeight-O.options.bannerPadding)},Ne=kb(O,F,o,pe,sI);E.font=Hm(Ne.fontPx,O.options.shieldFont),E.textBaseline="top",E.textAlign="center",V?E.fillText(F,Ne.xBaseline,Ne.yBaseline+H*O.px(O.options.bannerHeight+O.options.bannerPadding)):(E.shadowBlur=0,E.lineWidth=O.px(2),E.strokeText(F,Ne.xBaseline,Ne.yBaseline+H*O.px(O.options.bannerHeight+O.options.bannerPadding)),E.shadowColor=null,E.shadowBlur=null)}var dI=/[1IJijl .-]/g,mI=7;function e0(O){return O!==null&&O.length!==0&&O.length<=mI}function fI(O,E,F){let H=null,V,o=0,pe;if(Array.isArray(E.spriteBlank)){let Ne=(F.ref.match(dI)??[]).length,Qe=Math.ceil(F.ref.length-Ne/3),ct=E.spriteBlank.length-1,Ze=E.spriteBlank.map(Ct=>parseInt(Ct.split("_").reverse()[0])),Bt=Qe>Ze[ct]?ct:Math.max(0,Ze.indexOf(Qe));H=O.spriteRepo.getSprite(E.spriteBlank[Bt])}else H=O.spriteRepo.getSprite(E.spriteBlank);return H}function gI(O){return O!=null&&typeof O.textColor<"u"?O.textColor:"black"}function _I(O){return typeof O.shapeBlank<"u"?(E,F,H)=>aI(E,O.shapeBlank.drawFunc,F,O.shapeBlank.params,H):(console.warn(`Draw function not defined in: 1408${O}`),(E,F,H)=>{})}function yI(O,E){return typeof E.shapeBlank<"u"?n0(O,E.shapeBlank.drawFunc):O.shieldSize()}function xI(O,E,F,H,V){if(F.notext)return E;var o=NS(O,H.ref,F,V);return typeof O.debugOptions?.shieldTextHaloColor<"u"?(E.strokeStyle=O.debugOptions.shieldTextHaloColor,Sb(O,E,H.ref,o)):F.textHaloColor&&(E.strokeStyle=F.textHaloColor,Sb(O,E,H.ref,o)),E.fillStyle=gI(F),US(O,E,H.ref,o),O.debugOptions?.shieldTextBboxColor&&(E.strokeStyle=O.debugOptions.shieldTextBboxColor,E.lineWidth=O.px(1),E.strokeRect(O.px(F.padding.left-.5),O.px(F.padding.top-.5),V.width-O.px(F.padding.left+F.padding.right-1),V.height-O.px(F.padding.top+F.padding.bottom-1))),E}function Ib(O,E,F,H){let V=Ob(O,E);V==null&&(console.warn("Didn't produce a shield for",JSON.stringify(E)),V=O.gfxFactory.createGraphics({width:1,height:1})),Fb(O,F,V,H)}function Fb(O,E,F,H){let V=F.getImageData(0,0,F.canvas.width,F.canvas.height);O.spriteRepo.putSprite(E,{width:F.canvas.width,height:F.canvas.height,data:V.data},{pixelRatio:O.px(1)},H)}function vI(O,E){Fb(O,E,O.emptySprite(),!1)}function Bb(O,E){return E.ref?E.ref:E.refsByName&&O.name&&E.refsByName[O.name]?E.refsByName[O.name]:O.ref}function bI(O,E){if(!O)return null;let F=O[E.network];if(E==null)return null;if(F==null)return console.debug("Generic shield for",JSON.stringify(E)),e0(E.ref)?O.default:null;var H=Bb(E,F);return F.overrideByRef&&(F={...F,...F.overrideByRef[H]}),F.overrideByName&&(F={...F,...F.overrideByName[E.name||""]}),!e0(H)&&"noref"in F&&(F=F.noref,F.notext=!0),!e0(H)&&!F.ref&&!(F.refsByName&&E.name)&&(!F.notext||!F.spriteBlank&&!F.shapeBlank)?null:F}function wI(O){let E=parseInt(O,10);if(isNaN(E))return O;let F="M".repeat(E/1e3)+"D".repeat(E%1e3/500)+"C".repeat(E%500/100)+"L".repeat(E%100/50)+"X".repeat(E%50/10)+"V".repeat(E%10/5)+"I".repeat(E%5);return F=F.replace("DCCCC","CM").replace("CCCC","CD").replace("LXXXX","XC").replace("XXXX","XL").replace("VIIII","IX").replace("IIII","IV"),F+O.slice(E.toString().length)}function TI(O,E,F){let H=Math.max(O.shieldSize(),Ic(O,E.shapeBlank.params,F,E.shapeBlank.drawFunc)),V=n0(O,E.shapeBlank.drawFunc);return{width:H,height:V}}function SI(O,E){return E===0?0:E*O.px(O.options.bannerHeight)+(E-1)*O.px(O.options.bannerPadding)}function Ob(O,E){let F=bI(O.shieldDef,E);if(F==null)return null;E.ref=Bb(E,F);let H=hI(F),V=fI(O,F,E),o=O.shieldSize(),pe=O.shieldSize(),Ne=null;if(V==null){if(typeof F.shapeBlank<"u"){let Ze=TI(O,F,E.ref);o=Ze.width,pe=Ze.height}Ne={width:o,height:yI(O,F)}}else o=V.data.width,pe=V.data.height,Ne={width:o,height:pe};let Qe=SI(O,H);pe+=Qe;let ct=O.gfxFactory.createGraphics({width:o,height:pe});return E.ref&&F.numberingSystem==="roman"&&(E.ref=wI(E.ref)),cI(O,ct,F),ct.save(),ct.translate(0,Qe),V==null?_I(F)(O,ct,E.ref):r0(ct,V,Qe,F.verticalReflect,F.colorLighten,F.colorDarken),xI(O,ct,F,E,Ne),ct.restore(
1408),lI(O,ct,F),ct}function o0(){return(typeof window<"u"&&window.devicePixelRatio)>1?2:1}var II=class{createGraphics(O){var E=document.createElement("canvas").getContext("2d"),E=document.createElement("canvas").getContext("2d",{willReadFrequently:!0});return E.imageSmoothingQuality="high",E.textAlign="center",E.textBaseline="top",E.canvas.width=O.width,E.canvas.height=O.height,E}pixelRatio(){return o0()}},CI=class{emptySprite(){return this._emptySpriteCache||(this._emptySpriteCache=this.gfxFactory.createGraphics({width:1,height:1})),this._emptySpriteCache}px(O){return O*this.gfxFactory.pixelRatio()}shieldSize(){return this.px(this.options.shieldSize)}},EI=class{constructor(O){this.map=O}getSprite(O){return this.map.style.getImage(O)}putSprite(O,E,F,H){H&&this.map.listImages().includes(O)?(this.map.removeImage(O),this.map.addImage(O,E)):this.map.addImage(O,E,F)}},MI=class{constructor(O){this._shieldPredicate=()=>!0,this._networkPredicate=()=>!0,this._fontsLoaded=!1,this._preFontImageCache=new Map,this._shieldDefCallbacks=[],this._routeParser=O,this._renderContext=new CI,this._renderContext.gfxFactory=new II}setShields(O){this._renderContext.options=O.options;for(let[E,F]of Object.entries(O.networks))if(F&&F.bannerMap)for(let[H,V]of Object.entries(F.bannerMap)){let o={...F,banners:V};O.networks[H]=o}this._renderContext.shieldDef=O.networks,this._fontSpec="1em "+O.options.shieldFont,console.log("ShieldJSON loaded"),this._map&&this.reloadShieldsOnFontLoad(),this._shieldDefCallbacks.forEach(E=>E(O.networks))}onFontsLoaded(){if(this._fontsLoaded=!0,this._preFontImageCache.size!=0){console.log("Re-processing shields with loaded fonts");for(let[O,E]of this._preFontImageCache.entries())Ib(this._renderContext,E,O,!0);this._preFontImageCache.clear(),this._map.redraw()}}getShieldDefinitions(){return this._renderContext.shieldDef}debugOptions(O){return this._renderContext.debugOptions=O,this}filterImageID(O){return this._shieldPredicate=O,this}filterNetwork(O){return this._networkPredicate=O,this}graphicsFactory(O){return this._renderContext.gfxFactory=O,this}renderOnMaplibreGL(O){return this._map=O,this._fontSpec&&this.reloadShieldsOnFontLoad(),this.renderOnRepository(new EI(O)),O.on("styleimagemissing",this.getStyleImageMissingHandler()),this}reloadShieldsOnFontLoad(){!this._fontsLoaded&&!document.fonts.check(this._fontSpec)?document.fonts.load(this._fontSpec).then(()=>this.onFontsLoaded()):this._fontsLoaded=!0}onShieldDefLoad(O){return this._renderContext.shieldDef?O(this._renderContext.shieldDef):this._shieldDefCallbacks.push(O),this}renderOnRepository(O){return this._renderContext.spriteRepo||(this._renderContext.spriteRepo=O),this}getStyleImageMissingHandler(){return O=>{try{if(!this._shieldPredicate(O.id))return;let E=this._routeParser.parse(O.id);if(!this._networkPredicate(E.network)){vI(this._renderContext,O.id);return}E&&(!this._fontsLoaded&&E.ref&&this._preFontImageCache.set(O.id,E),Ib(this._renderContext,E,O.id,!1))}catch(E){console.error(`Exception while loading image \u2018${O?.id}\u2019: 1409`,E)}}}getGraphicForRoute(O,E,F){return Ob(this._renderContext,{network:O,ref:E,name:F})}emptySprite(){return this._renderContext.emptySprite()}createGraphics(O){return this._renderContext.gfxFactory.createGraphics(O)}pixelRatio(){return this._renderContext.px(1)}};var Vb=class extends MI{constructor(O,E){super(E),this.setShieldURL(O)}async setShieldURL(O){await fetch(O).then(E=>E.json()).then(E=>super.setShields(E)).catch(E=>console.error(E))}},PI=class{constructor(){this.sprites={}}getSprite(O){return this.sprites[O]}hasSprite(O){return O in this.sprites}putSprite(O,E){this.sprites[O]=E}},s4=new PI;var kg=["network","ref","name","color"];function kI(O){let E=["concat","shield"];for(let F of kg)E.push(` 1410`),E.push(["coalesce",["get",`route_${O}_${F}`],""]);return E}function AI(O){return["case",["any",...kg.map(E=>["has",`route_${O}_${E}`])],["image",kI(O)],["literal",""]]}function Ag(O){let E=O.split(` 1411`);E.shift();let F=Object.fromEntries(kg.map((H,V)=>[H,E[V]]));return F.imageName=O,F}var Nb=["format"];for(Pg=1;Pg<=8;Pg++)Nb.push(AI(Pg));var Pg,zI={"text-rotation-alignment":"viewport-glyph","text-font":["Americana-Regular"],"text-field":Nb,"text-anchor":"center","text-letter-spacing":.7,"symbol-placement":"line","text-max-angle":180,"text-pitch-alignment":"viewport","symbol-sort-key":["match",["get","class"],"motorway",0,"trunk",1,"primary",2,"secondary",3,"tertiary",4,5]},zg={type:"symbol",source:"openmaptiles","source-layer":"transportation_name",id:"highway-shield",layout:zI,paint:{"text-opacity":["step",["zoom"],["match",["get","class"],"motorway",1,0],8,["match",["get","class"],["motorway","trunk"],1,0],10,["match",["get","class"],["motorway","trunk","primary"],1,0],11,["match",["get","class"],["motorway","trunk","primary","secondary"],1,0],12,["match",["get","class"],["motorway","trunk","primary","secondary","tertiary"],1,0],14,1]},filter:["any",...kg.map(O=>["has",`route_1_${O}`])]};var qb=_p(id(),1),DI=30,a0=o0(),jb="OpenStreetMap Americana";function LI(O,E){return O[0].toLocaleUpperCase(E)+O.substring(1)}var Xm=class{constructor(E){this._shieldDefs=E}onAdd(E){this._map=E,this._container=document.createElement("div"),this._container.className="maplibregl-ctrl",this._container.style.clear="none";let F=document.createElement("div");F.className="maplibregl-ctrl-group",this._container.appendChild(F);let H=document.createElement("button");return H.textContent="Legend",H.style.width="5em",F.appendChild(H
1411),this._popup=new qb.Popup({closeOnMove:!0,anchor:"bottom-left",maxWidth:`${DI}em`,offset:[0,-4]}),H.addEventListener("click",()=>{if(this._popup.isOpen()){this.close();return}let V=H.getClientRects()[0],o=[V.x,V.y];this.open(o)}),this._map.on("americana.languagechange",()=>this.onLanguageChange()),this._container}onRemove(){this._container.parentNode.removeChild(this._container),this._map=void 0}onLanguageChange(){this.close(),this.purgeNetworkMetadata()}open(E){this.close();let F=this.getContents();this._popup.setDOMContent(F);let H=this._map.unproject(E);this._popup.setLngLat(H).addTo(this._map),this.completeNetworkLabels(),document.getElementById("legend-container").scrollTop=0}close(){this._popup.remove()}getContents(){let E=document.getElementById("legend").content.cloneNode(!0),F=this.sections.find(H=>H.id==="shields");F.rows=this.getShieldRows(),F.sourceURL=`https://query.wikidata.org/embed.html#${encodeURIComponent(this.getNetworkMetadataQuery())}`;for(let H of this.sections){let V=this.getSection(H);if(!V)continue;if(H.id&&(V.id=`legend-section-${H.id}`),E.getElementById("legend-container").appendChild(V),H.source){let pe=E.querySelector(".legend-source");pe.textContent="Source: ";let Ne=document.createElement("a");Ne.href=H.sourceURL,Ne.textContent=H.source,pe.append(Ne)}}return E}getSection(E){let F=document.getElementById("legend-section").content.cloneNode(!0);F.querySelector("summary").textContent=E.name;let H=E.rows;if(!H&&E.entries&&(H=E.entries.map(o=>this.getMatchedEntry(o)).filter(o=>o).map(o=>this.getRowForEntry(o)).filter(o=>o)),!!H.length)return F.querySelector(".legend-row-container").replaceChildren(...H),E.source||F.querySelector("tfoot").remove(),F.querySelector(".legend-section")}getMatchedEntry(E){let F=this._map.queryRenderedFeatures({layers:E.layers,filter:E.filter}),H=F[0];if(!H||H.layer.type==="line"&&H.layer.paint?.["line-opacity"]===0)return;let V={feature:H};if(Object.assign(V,E),H.layer.type==="fill"||H.layer.type==="fill-extrusion")V.fill=H,V.stroke=F.find(o=>o.id===H.id&&o.layer.type==="line");else if(H.layer.type==="line")if(V.fill=F.find(o=>o.id===H.id&&(o.layer.type==="fill"||o.layer.type==="fill-extrusion")),V.fill)V.stroke=H;else{V.lines=[];let o=new Set;for(let pe of F)pe.id!==H.id||pe.layer.type!=="line"||o.has(pe.layer.id)||(o.add(pe.layer.id),V.lines.unshift(pe))}return V}getRowForEntry(E){let F="legend-row-symbol";E.lines?F="legend-row-line":E.fill&&(F="legend-row-swatch");let V=document.getElementById(F).content.cloneNode(!0).querySelector("tr");if(E.fill){let pe=V.querySelector(".swatch");Object.assign(pe.style,this.getSwatchStyle(E.fill,E.stroke))}else if(E.lines){let pe=V.querySelector(".line");this.populateLineCell(pe,E.lines)}else if(E.feature){let pe=V.querySelector(".label");this.populateTextLabelFromSymbol(pe,E.feature);let Ne=V.querySelector(".icon"),Qe=this.getIconImageFromSymbol(E.feature);Qe?Ne.appendChild(Qe):(Ne.remove(),pe.setAttribute("colspan",2))}else return;let o=V.querySelector(".description");return o.textContent=E.description,V}getIconImageFromSymbol(E){let F=E.layer.layout["icon-image"],H=F?.name??F;if(!H)return;let V=E.layer.layout["icon-size"],o=this._map.style.getImage(H);return this.getImageFromStyle(o,V)}populateTextLabelFromSymbol(E,F){let H=F.layer.layout["text-field"];if(!H)return;E.textContent=H.sections?.[0].text??H.replace(/\{(\w+)\}/g,(Bt,Ct)=>F.properties[Ct]??Bt);let V=F.layer.layout["text-font"]?.[0]?.match(/\bBold\b/)?"bold":"normal",o=F.layer.layout["text-font"]?.[0]?.match(/\bItalic\b/)?"italic":"normal",pe=F.layer.layout["text-justify"]||"center";F.layer.layout["icon-image"]&&(pe="right");let Ne=F.layer.paint["text-halo-width"]??0,Qe=F.layer.paint["text-halo-color"]||"black",ct=F.layer.paint["text-halo-blur"]??0,Ze=[-Ne,Ne].flatMap(Bt=>[-Ne,Ne].map(Ct=>`${Qe} ${Bt}px ${Ct}px ${ct}px`));Object.assign(E.style,{color:F.layer.paint["text-color"],fontWeight:V,fontStyle:o,fontSize:`${F.layer.layout["text-size"]??16}px`,letterSpacing:`${F.layer.layout["text-letter-spacing"]}em`,lineHeight:`${F.layer.layout["text-line-height"]??1.2}em`,maxWidth:"10vw",textAlign:pe==="auto"?"right":pe,textShadow:Ze.join(", "),textTransform:F.layer.layout["text-transform"],verticalAlign:"middle",width:`${F.layer.layout["text-max-width"]??10}em`})}getSwatchStyle(E,F){let H=E?.layer.paint["fill-color"]||E?.layer.paint["fill-extrusion-color"],V=E?.layer.paint["fill-opacity"];if(H&&V){let pe=V??H.a??1;H=`rgba(${H.r*255/pe}, ${H.g*255/pe}, ${H.b*255/pe}, ${pe})`}let o="solid";return F?.layer.paint["line-dasharray"]?o="dashed":E?.layer.paint["fill-extrusion-height"]&&(o="outset"),{backgroundColor:H,borderColor:F?.layer.paint["line-color"]||H||"transparent",borderStyle:o,borderWidth:`${F?.layer.paint["line-width"]??1}px`,opacity:E?.layer.paint["fill-extrusion-opacity"]??1}}populateLineCell(E,F){let H=Ne=>{let Qe=Ne.layer.paint["line-width"]??1,ct=Ne.layer.paint["line-gap-width"];return Math.max(1/a0,ct?Qe*2+ct:Qe)},V=F.map(H),o=Math.max(...V),pe=E.querySelector("svg");pe.style.height=`${o}px`;for(let Ne of F){let Qe=document.createElementNS("http://www.w3.org/2000/svg","line");Qe.setAttribute("y1",`${o/2}px`),Qe.setAttribute("y2",`${o/2}px`),Qe.setAttribute("x2","100%");let ct=Ne.layer.paint["line-width"]??1,Ze=Ne.layer.paint["line-dasharray"]?.from.map(fi=>fi*ct),Bt=H(Ne),Ct=Ne.layer.paint["line-gap-width"],Mt;Ct&&(Mt=`polygon(evenodd, ${[[0,-Bt/2],[100,-Bt/2],[100,-Ct/2],[0,-Ct/2],[0,Ct/2],[100,Ct/2],[100,Bt/2],[0,Bt/2]].map(At=>`${At[0]}% ${At[1]}px`).join(", ")})`),Object.assign(Qe.style,{opacity:Ne.layer.paint["line-opacity"]??1,stroke:Ne.layer.paint["line-color"]||fillColor,strokeDasharray:Ze?.join(" "),strokeWidth:Bt,clipPath:Mt}),pe.appendChild(Qe)}}getShieldRows(){let F=this._map.queryRenderedFeatures({layers:[zg.id]}).flatMap(At=>At.layer.layout["text-field"].sections).filter(At=>At.image&&At.image).map(At=>Ag(At.image.name)),H={},V=new Set;for(let At of F){At.network in H||(H[At.network]={overridesByRef:{},overridesByName:{}});let He=H[At.network],Ut=this._shieldDefs[At.network];At.ref&&Ut?.overrideByRef?.[At.ref]?He.overridesByRef[At.ref]||(He.overridesByRef[At.ref]=At.imageName):At.name&&Ut?.overrideByName?.[At.name]?He.overridesByName[At.name]||(He.overridesByName[At.name]=Ut.overrideByName[At.name].spriteBlank):!He.ref&&At.ref?He.ref=At.imageName:!He.noRef&&!At.ref&&(He.noRef=At.imageName),Ut||V.add(At.network)}let o=At=>{let He=H[At];return He?[Object.values(He.overridesByName).length>0?"":He.noRef,He.ref,...Object.values(He.overridesByRef),...Object.values(He.overridesByName)].filter(Ut=>Ut):[]},pe=[...Object.keys(this._shieldDefs),...[...V.values()].sort()],Ne=new Set,Qe={},ct=[],Ze=new Set;for(let At of pe){if(!(At in H))continue;let He=this._networkMetadata?.[At]||this._ukNetworkMetadata?.[At],Ut=He?.network.value;if(Ut){if(Ze.has(Ut))continue;Ze.add(Ut)}let li=(Ut&&this._networksByQID[Ut]||[At]).flatMap(ci=>o(ci)),ki=this.getShieldRow(At,li,He);if(!ki)continue;let wi=At.match(/^(?:omt-)?(\w\w)(?:[-:]|$)/)?.[1]?.toUpperCase();wi?(wi in Qe||(Qe[wi]=[]),Qe[wi].push(ki),Ne.add(wi)):ct.push(ki)}let Bt=Va(),Ct=new Intl.DisplayNames(Bt,{type:"region"}),Mt=[...Ne].map(At=>{let He=Ct.of(At)??At;return{code:At,name:He}}).sort((At,He)=>At.name.localeCompare(He.name,Bt[0]));ct.length&&(Mt.unshift({code:"*",name:"International"}),Qe["*"]=ct);let fi=[];for(let At of Mt){if(Mt.length>1){let Ut=document.getElementById("legend-rowgroup").content.cloneNode(!0).querySelector("tr");Ut.querySelector("th").textContent=At.name,fi.push(Ut)}fi.push(...Qe[At.code])}return fi}getShieldRow(E,F,H){let V=F.map(ct=>this._map.style.getImage(ct)).map(ct=>this.getImageFromStyle(ct)).filter(ct=>ct);if(!V.length)return;let pe=document.getElementById("legend-row-symbol").content.cloneNode(!0).querySelector("tr");pe.dataset.network=E,pe.querySelector(".icon").replaceChildren(...V);let Ne=pe.querySelector(".description"),Qe=document.createElement("code");return Qe.textContent=E,Ne.appendChild(Qe),this.prettifyNetworkLabel(pe,H),pe}prettifyNetworkLabel(E,F){if(E.dataset.pending=!F,!F)return;let H=E.querySelector(".description"),V=document.createElement("a");V.href=F.network.value,V.target="_blank";let o=F.networkLabel["xml:lang"];if(V.textContent=LI(F.networkLabel.value,o),o){V.setAttribute("lang",o),H.replaceChildren(V);let pe=Va();if(o.match(/^\w+/)?.[0]!==pe[0].match(/^\w+/)?.[0]){let Ne=document.createElement("span");Ne.className="language";let Qe=new Intl.DisplayNames(pe,{type:"language"});Ne.textContent=Qe.of(o),H.append(" ",Ne)}}else H.querySelector("code").replaceChildren(V)}getImageFromStyle(E,F=1){let H=E.userImage;if(H?.width===1||H?.height===1)return;let V=new ImageData(H?.data||new Uint8ClampedArray(E.data.data),H?.width||E.data.width,H?.height||E.data.height),o=document.createElement("canvas");o.width=V.width,o.height=V.height,o.getContext("2d").putImageData(V,0,0);let Ne=new Image(V.width*F/a0,V.height*F/a0);return Ne.src=o.toDataURL("image/png"),Ne.className="shield",Ne}async completeNetworkLabels(){if(!await this.getNetworkMetadata())return;let H=document.getElementById("legend-section-shields")?.querySelector(".legend-row-container"),V=H?.querySelectorAll('[data-pending="true"]')??[];
1411if(V.length!==0){for(let o of V)if(o.dataset.network?.startsWith("omt-gb-")){await this.getUKNetworkMetadata();break}H.replaceChildren(...this.getShieldRows())}}async getNetworkMetadata(){if(this._networkMetadata)return this._networkMetadata;let E=`https://query.wikidata.org/sparql?query=${encodeURIComponent(this.getNetworkMetadataQuery())}&format=json`,H=await(await fetch(E,{headers:{"Api-User-Agent":jb}})).json();this._networkMetadata=Object.fromEntries(H.results.bindings.map(o=>[o.value.value,o]));let V={};for(let o of H.results.bindings){let pe=o.network.value;pe in V||(V[pe]=[]),V[pe].push(o.value.value)}return this._networksByQID=V,this._networkMetadata}async getUKNetworkMetadata(){if(this._ukNetworkMetadata)return this._ukNetworkMetadata;let E=`https://query.wikidata.org/sparql?query=${encodeURIComponent(this.getNetworkMetadataQuery("GB"))}&format=json`,H=await(await fetch(E,{headers:{"Api-User-Agent":jb}})).json();return this._ukNetworkMetadata=Object.fromEntries(H.results.bindings.map(V=>[V.value.value,V])),this._ukNetworkMetadata}purgeNetworkMetadata(){delete this._networkMetadata,delete this._ukNetworkMetadata,delete this._networksByQID}getNetworkMetadataQuery(E){let F=Va().join(","),H,V="",o="";return E==="GB"?H="?network wdt:P361 wd:Q115856945; p:P528 [ ps:P528 ?value; pq:P972 wd:Q110613756 ]":(H="?network wdt:P1282 ?tag",V='FILTER(REGEX(?tag, "^network="))',o="BIND(SUBSTR(?tag, 9) AS ?value)"),` 1412SELECT ?value ?network ?networkLabel WHERE { 1413 ${H}. 1414 ${V} 1415 ${o} 1416 SERVICE wikibase:label { bd:serviceParam wikibase:language "${F},en". } 1417} 1418ORDER BY ?value 1419`}};var Dg=class{_updateButton(){this._map.shadesHills?(this._button.classList.add("maplibregl-ctrl-terrain-enabled"),this._button.title="Disable terrain"):(this._button.classList.remove("maplibregl-ctrl-terrain-enabled"),this._button.title="Enable terrain")}_onClick=()=>{this._map.shadesHills=!this._map.shadesHills,this._updateButton()};onAdd(E){this._map=E,this._container=document.createElement("div"),this._container.className="maplibregl-ctrl maplibregl-ctrl-group",this._button=document.createElement("button"),this._button.className="maplibregl-ctrl-terrain",this._map.on("americana.terrain",()=>this._updateButton()),this._button.addEventListener("click",this._onClick),this._container.append(this._button);let F=document.createElement("span");return F.className="maplibregl-ctrl-icon",F.setAttribute("aria-hidden","true"),this._button.append(F),this._container}onRemove(){this._container.remove(),this._map.off("americana.terrain"),this._map=void 0}};var ea="hsl(30, 44%, 96%)",$b="hsla(30, 44%, 96%, 0.8)",Gb="hsla(30, 14%, 63%, 1)",Zb="hsla(30, 44%, 99%, 1)",yu="hsl(211, 50%, 85%)",Wb="hsla(211, 50%, 85%, 0.5)",Hb="hsla(211, 60%, 85%, 0.3)",Xb="hsl(211, 100%, 30%)",Kb="hsl(211, 42%, 70%)",sm="hsl(211, 42%, 50%)",Yb="hsl(211, 43%, 28%)";var Lg="hsl(0, 2%, 47%)",s0="hsl(281, 35%, 86%)",Jb="hsl(136, 41%, 89%)",Qb="hsl(80, 18%, 87%)",e2="hsl(136, 41%, 75%)",t2="hsla(136, 41%, 70%, 50%)",i2="hsla(80, 23%, 62%, 45%)",r2="hsla(136, 41%, 60%, 50%)",Rg="hsl(136, 71%, 29%)",Fg="hsl(90, 27%, 94%)",l0="hsl(310, 41%, 59%)",n2="hsl(310, 71%, 29%)",o2="hsl(34, 40%, 92%)",a2="hsl(34, 40%, 80%)",s2="hsl(34, 40%, 35%)",l2="hsl(34, 40%, 96%)",c2="hsl(250, 41%, 95%)",h2="hsl(250, 41%, 79%)",Km="hsl(250, 41%, 79%)",lm="hsl(250, 71%, 29%)",Bg="hsl(211, 43%, 28%)",pa={black:"black",blue:"#003f87",brown:"#693f23",green:"#006747",mauve:"#a20067",orange:"#f38f00",texas_orange:"#bf5700",pink:"#df4661",purple:"#6d2077",red:"#bf2033",tan:"#ddcba4",white:"white",yellow:"#ffcd00",yellow_green:"#c4d600"},x4={black:pa.black,blue:pa.blue,brown:pa.brown,green:pa.green,orange:pa.orange,pink:pa.pink,purple:pa.purple,red:pa.red,tan:pa.tan,white:pa.white,yellow:pa.yellow,yellow_green:pa.yellow_green},u2="hsl(0, 0%, 90%)",p2="hsl(0, 0%, 60%)",d2="hsl(0, 0%, 60%)",m2="hsl(0, 0%, 50%)",f2="hsl(0, 0%, 50%)",g2="hsl(0, 0%, 60%)",_2="hsl(0, 0%, 50%)",y2="hsl(0, 0%, 50%)",RI={tollRoad:48,park:136,water:211,airport:273,borderCasing:281},Oi={infrastructure:pa.blue,consumer:pa.texas_orange,outdoor:pa.green,attraction:pa.brown,airport:`hsl(${RI.airport}, 100%, 28%)`,transport:pa.mauve};var $h=["interpolate",["linear"],["zoom"],4,$b,5,ea],xu=["interpolate",["linear"],["zoom"],4,.5,5,0],h0={"text-color":"#444","text-halo-color":$h,"text-halo-width":2,"text-halo-blur":xu},x2=["step",["zoom"],["<=",["get","rank"],2],6,["<=",["get","rank"],4],7,["<=",["get","rank"],5],8,["<=",["get","rank"],9],10,[">=",["get","rank"],1]],u0=["match",["get","capital"],2,"place_star_in_circle",3,"place_star",4,"place_star",5,"place_dot_in_circle",6,"place_dot_in_circle","place_dot"];function p0(O){return["==",["get","class"],O]}var Og={id:"place_village",type:"symbol",paint:h0,filter:["all",p0("village"),x2],layout:{"text-font":["Americana-Bold"],"text-size":{base:1,stops:[[5,8],[8,10],[12,12]
1419]},"icon-image":u0,"icon-size":{base:1,stops:[[4,.12],[7,.25],[11,.5]]},"text-field":qh,"text-anchor":"bottom","text-variable-anchor":["bottom","bottom-right","bottom-left","right","left"],"text-justify":"auto","text-radial-offset":.5,"icon-optional":!1,"text-max-width":8,"icon-padding":0,"text-padding":1,"icon-allow-overlap":!1},source:"openmaptiles",minzoom:11,maxzoom:14,"source-layer":"place"},Vg={id:"place_town",type:"symbol",paint:h0,filter:["all",p0("town"),x2],layout:{"text-font":["Americana-Bold"],"text-size":{base:1.2,stops:[[5,8],[8,10],[12,18]]},"icon-image":u0,"icon-size":{base:1.2,stops:[[4,.25],[7,.35],[11,.7]]},"text-field":qh,"text-anchor":"bottom","text-variable-anchor":["bottom","bottom-right","bottom-left","right","left"],"text-justify":"auto","text-radial-offset":.5,"icon-optional":!1,"text-max-width":8,"icon-padding":0,"text-padding":1,"icon-allow-overlap":!1},source:"openmaptiles",minzoom:4,maxzoom:13,"source-layer":"place"},Ng={id:"place_city",type:"symbol",paint:h0,filter:["all",p0("city"),["step",["zoom"],["<=",["get","rank"],2],5,["<=",["get","rank"],4],6,[">=",["get","rank"],1]]],layout:{"text-font":["Americana-Bold"],"text-size":{base:1.2,stops:[[4,11],[7,14],[11,24]]},"icon-image":u0,"icon-size":{base:1.2,stops:[[4,.4],[7,.5],[11,.9]]},"text-field":qh,"text-anchor":"bottom","text-variable-anchor":["bottom","bottom-right","bottom-left","right","left"],"text-justify":"auto","text-radial-offset":["match",["get","capital"],2,.7,.5],"icon-optional":!1,"text-max-width":8,"icon-padding":0,"text-padding":1,"icon-allow-overlap":!1},source:"openmaptiles",minzoom:4,maxzoom:12,"source-layer":"place",metadata:{}},d0={id:"place_suburb",type:"symbol",paint:{"text-color":Bg,"text-halo-color":$h,"text-halo-width":["interpolate",["exponential",1.2],["zoom"],3,1.5,6,2.5],"text-halo-blur":xu},filter:["==",["get","class"],"suburb"],layout:{"text-font":["Americana-Regular"],"text-size":{base:1.2,stops:[[10,12],[12,15],[14,18]]},"text-field":Wn,"text-padding":1,"text-transform":"uppercase","text-letter-spacing":{base:.04,stops:[[11,.04],[12,.08],[13,.2],[14,.4]]},"text-variable-anchor":["center"],"text-radial-offset":["interpolate",["exponential",1.6],["zoom"],3,.5,7,3],"text-max-width":6},source:"openmaptiles",maxzoom:15,minzoom:11,"source-layer":"place"},m0={id:"place_quarter",type:"symbol",paint:{"text-color":Bg,"text-halo-color":$h,"text-halo-width":["interpolate",["exponential",1.2],["zoom"],3,1.5,6,2.5],"text-halo-blur":xu},filter:["==",["get","class"],"quarter"],layout:{"text-font":["Americana-Regular"],"text-size":{base:1.2,stops:[[13,12],[14,14],[16,18]]},"text-field":Wn,"text-padding":1,"text-transform":"uppercase","text-letter-spacing":{base:.04,stops:[[14,.08],[15,.2]]},"text-variable-anchor":["center"],"text-radial-offset":["interpolate",["exponential",1.6],["zoom"],3,.5,7,3],"text-max-width":6},source:"openmaptiles",maxzoom:16,minzoom:13,"source-layer":"place"},f0={id:"place_neighborhood",type:"symbol",paint:{"text-color":Bg,"text-halo-color":$h,"text-halo-width":["interpolate",["exponential",1.2],["zoom"],3,1.5,6,2.5],"text-halo-blur":xu},filter:["==",["get","class"],"neighbourhood"],layout:{"text-font":["Americana-Regular"],"text-size":{base:1.2,stops:[[14,12],[16,14]]},"text-field":Wn,"text-padding":1,"text-transform":"uppercase","text-letter-spacing":{base:.04,stops:[[15,.08],[16,.2]]},"text-variable-anchor":["center"],"text-radial-offset":["interpolate",["exponential",1.6],["zoom"],3,.5,7,3],"text-max-width":6},source:"openmaptiles",maxzoom:17,minzoom:14,"source-layer":"place"},g0={id:"place_state",type:"symbol",paint:{"text-color":"hsl(45, 6%, 10%)","text-halo-color":$h,"text-halo-width":["interpolate",["exponential",1.2],["zoom"],3,1.5,6,2.5],"text-halo-blur":xu},filter:["in",["get","class"],["literal",["state","province"]]],layout:{"text-font":["Americana-Regular"],"text-size":{base:1.2,stops:[[3,8],[6,14]]},"text-field":Wn,"text-padding":1,"text-transform":"uppercase","text-letter-spacing":.04,"text-variable-anchor":["center","top","bottom"],"text-radial-offset":["interpolate",["exponential",1.6],["zoom"],3,.5,7,3],"text-max-width":6},source:"openmaptiles",maxzoom:7,minzoom:3,"source-layer":"place"},_0={id:"place_country-other",type:"symbol",paint:{"text-color":"#334","text-halo-blur":.5,"text-halo-color":$h,"text-halo-width":["interpolate",["linear"],["zoom"],3,1.5,7,2.5]},filter:["all",["==",["get","class"],"country"],["!",["has","iso_a2"]]],layout:{"text-font":["Americana-Regular"],"text-size":{stops:[[3,9],[7,15]]},"text-field":Wn,"text-max-width":6.25,"text-transform":"none"},source:"openmaptiles","source-layer":"place"},y0={id:"place_country-3",type:"symbol",paint:{"text-color":"#334","text-halo-blur":xu,"text-halo-color":$h,"text-halo-width":["interpolate",["linear"],["zoom"],3,1.5,7,2.5]},filter:["all",[">=",["get","rank"],3],["==",["get","class"],"country"],["has","iso_a2"]],layout:{"text-font":["Americana-Regular"],"text-size":{stops:[[3,11],[7,17]]},"text-field":Wn,"text-max-width":6.25,"text-transform":"none"},source:"openmaptiles","source-layer":"place"},x0={id:"place_country-2",type:"symbol",paint:{"text-color":"#334","text-halo-blur":xu,"text-halo-color":$h,"text-halo-width":["interpolate",["linear"],["zoom"],1,1,5,2.4]},filter:["all",["==",["get","rank"],2],["==",["get","class"],"country"],["has","iso_a2"]],layout:{"text-font":["Americana-Regular"],"text-size":{stops:[[2,11],[5,17]]},"text-field":Wn,"text-max-width":6.25,"text-transform":"none"},source:"openmaptiles","source-layer":"place"},v0={id:"place_country-1",type:"symbol",paint:{"text-color":"#334","text-halo-blur":xu,"text-halo-color":$h,"text-halo-width":["interpolate",["linear"],["zoom"],1,1,4,2.5,6,3]},filter:["all",["==",["get","rank"],1],["==",["get","class"],"country"],["has","iso_a2"]],layout:{"text-font":["Americana-Regular"],"text-size":{stops:[[1,11],[4,22],[6,19]]},"text-field":Wn,"text-max-width":["step",["zoom"],6.25,3,12],"text-transform":"none","text-offset":["step",["zoom"],["literal",[0,0]],3,["literal",[0,.5]]]},source:"openmaptiles","source-layer":"place"},b0={id:"place_continent",type:"symbol",paint:{"text-color":"#633","text-halo-color":$h,"text-halo-blur":xu,"text-halo-width":1},filter:["==",["get","class"],"continent"],layout:{"text-font":["Americana-Regular"],"text-size":13,"text-field":Wn,"text-justify":"center","text-transform":"uppercase"},source:"openmaptiles",maxzoom:1,"source-layer":"place"},Ym=[Og.id,Vg.id,Ng.id],c0=["!",["has","capital"]],v2=[{description:"Continent",layers:[b0.id]},{description:"Country or dependency",layers:[_0.id,y0.id,x0.id,v0.id]},{description:"State or province",layers:[g0.id]},{description:"Large city",layers:[Ng.id],filter:c0},{description:"Town",layers:[Vg.id],filter:c0},{description:"Small village",layers:[Og.id],filter:c0},{description:"Major district",layers:[d0.id]},{description:"Large neighborhood",layers:[m0.id]},{description:"Neighborhood",layers:[f0.id]},{description:"National capital",layers:Ym,filter:["==",["get","capital"],2]},{description:"Regional capital",layers:Ym,filter:["==",["get","capital"],3]},{description:"State or provincial capital",layers:Ym,filter:["==",["get","capital"],4]},{description:"Local capital",layers:Ym,filter:["==",["get","capital"],5]},{description:"County seat or equivalent",layers:Ym,filter:["==",["get","capital"],6]}];var w0={id:"urbanized-area",type:"fill",minzoom:4,maxzoom:6,filter:["==",["get","class"],"residential"],paint:{"fill-color":["interpolate-lab",["linear"],["zoom"],4,"hsl(41, 90%, 85%)",5,"hsl(41, 90%, 80%)",5.5,"hsl(41, 90%, 80%)",6,ea]},source:"openmaptiles","source-layer":"landuse"},w2=[{description:"Urban area",layers:[w0.id]}];var T0={id:"boundary_city",type:"line",paint:{"line-color":Lg,"line-dasharray":[2,4],"line-width":1,"line-offset":0},filter:["all",["==",["get","admin_level"],8],["==",["get","disputed"],0],["==",["get","maritime"],0]],minzoom:11,layout:{"line-join":"round",visibility:"visible"},source:"openmaptiles","source-layer":"boundary"},jg={id:"boundary_county_casing",type:"line",paint:{"line-color":s0,"line-width":{stops:[[11,5],[12,6]]}},filter:["all",["==",["get","admin_level"],6],["==",["get","disputed"],0],["==",["get","maritime"],0]],minzoom:11,layout:{"line-join":"round",visibility:"visible"},source:"openmaptiles","source-layer":"boundary"},S0={id:"boundary_county",type:"line",paint:{"line-color":Lg,"line-dasharray":[3,3],"line-width":1,"line-offset":0},filter:["all",["==",["get","admin_level"],6],["==",["get","disputed"],0],["==",["get","maritime"],0]],minzoom:9,layout:{"line-join":"round",visibility:"visible"},source:"openmaptiles","source-layer":"boundary"},I0={id:"boundary_region_casing",type:"line",paint:{"line-color":s0,"line-width":{stops:[[8,5],[9,6]]}},filter:["all",["==",["get","admin_level"],5],["==",["get","disputed"],0],["==",["get","maritime"],0]],minzoom:8,layout:{"line-join":"round",visibility:"visible"},source:"openmaptiles","source-layer":"boundary"},C0={id:"boundary_region",type:"line",paint:{"line-color":Lg,"line-dasharray":[5,4],"line-width":1,"line-offset":0},filter:["all",["==",["get","admin_level"],5],["==",["get","disputed"],0],["==",["get","maritime"],0]],minzoom:6,layout:{"line-join":"round",visibility:"visible"},source:"openmaptiles","source-layer":"boundary"},qg={id:"boundary_state_casing",type:"line",paint:{"line-color":{base:1.2,stops:[[3,`hsl(${251}, 25%, 94%)`],[7,`hsl(${281}, 30%, 90%)`]]},"line-width":{base:1.2,stops:[[3,4],[12,20],[16,30]]}},filter:["all",["in",["get","admin_level"],["literal",[3,4]]],["==",["get","maritime"],0]],minzoom:3,layout:{"line-join":"round","line-cap":"round",visibility:"visible"},source:"openmaptiles","source-layer":"boundary"},E0={id:"boundary_state",type:"line",paint:{"line-color":{base:1.2,stops:[[3,`hsl(${0}, 2%, 60%)`],[7,`hsl(${0}, 2%, 48%)`]]},"line-dasharray":{stops:[[3,[4,4,4,4,12,4]],[6,[3.5,3,3.5,3,20,3]],[8,[2.5,2.5,2.5,2.5,20,2.5]],[10,[2,2.5,2,2.5,12,2.5]]]},"line-width":{stops:[[3,.5],[10,1.5]]},"line-offset":0},filter:["all",["in",["get","admin_level"],["literal",[3,4]]],["==",["get","maritime"],0]],minzoom:3,layout:{"line-join":"round","line-cap":"round",visibility:"visible"},source:"openmaptiles","source-layer":"boundary"},S2=["any",["==",["get","maritime"],0],["all",["has","adm0_l"],["has","adm0_r"]]],$g={id:"boundary_country_casing",type:"line",paint:{"line-color":{base:1.2,stops:[[3,`hsl(${251}, 35%, 86%)`],[7,`hsl(${281}, 35%, 86%)`]]}
1419,"line-opacity":{base:1,stops:[[0,.4],[4,1]]},"line-width":{base:1.2,stops:[[2,4],[12,25],[16,50]]}},filter:["all",["==",["get","admin_level"],2],["==",["get","maritime"],0]],minzoom:2,layout:{"line-cap":"round","line-join":"round",visibility:"visible"},source:"openmaptiles","source-layer":"boundary"},M0={id:"boundary_country",type:"line",paint:{"line-color":{base:1.2,stops:[[3,`hsl(${0}, 2%, 47%)`],[7,`hsl(${0}, 2%, 37%)`]]},"line-opacity":{base:1,stops:[[0,.4],[4,1],[5,.8]]},"line-width":{stops:[[2,1],[4,1.5],[10,2.25]]},"line-dasharray":{stops:[[3,[10,1,3,1]]]},"line-blur":0},filter:["all",["==",["get","admin_level"],2],["==",["get","disputed"],0],[...S2]],maxzoom:24,layout:{"line-join":"round",visibility:"visible"},source:"openmaptiles","source-layer":"boundary"},Gg={id:"boundary_country_label_left",type:"symbol",paint:{"text-color":{base:1.2,stops:[[3,`hsl(${0}, 2%, 24%)`],[7,`hsl(${0}, 2%, 18%)`]]}},layout:{"symbol-placement":"line","text-font":["Americana-Bold"],"text-size":{stops:[[3,6],[7,10]]},"text-field":Sg(["get","adm0_l"]),"text-offset":[0,-1],"text-max-angle":30,"text-letter-spacing":.1,"text-ignore-placement":!0},filter:[...S2],maxzoom:24,source:"openmaptiles","source-layer":"boundary"},I2={...Gg,id:"boundary_country_label_right",layout:{...Gg.layout,"text-field":Sg(["get","adm0_r"]),"text-offset":[0,1]}},C2=[{description:"Country or dependency",layers:[M0.id,$g.id]},{description:"State or province",layers:[E0.id,qg.id]},{description:"County or county-equivalent",layers:[S0.id,jg.id]},{description:"Region",layers:[C0.id,I0.id]},{description:"City, town, or village",layers:[T0.id]},{description:"Disputed border",layers:[$g.id,qg.id,jg.id],filter:["==",["get","disputed"],1]}];function M2(O,E){return Zg(O,["==",["coalesce",["get","layer"],0],E],"_layer_"+E)}function FI(O){return JSON.parse(JSON.stringify(O))}function Jm(O,E){var F=FI(O);return F.id=E,F}function Zg(O,E,F){var H=Jm(O,O.id+F);if(!["all","any"].includes(H.filter[0]))throw new TypeError("Unlikely filter");return H.filter.push(E),H}var A0=11,Wg=4,BI=5,rd=7,z0=9,tf=11,D0=12,OI=13,VI=15,Wh=1.2,Fn=0,In=48,Qm=322,NI=["step",["zoom"],["literal",[1]],A0,["literal",[.5,.25]]],Hg=["get","brunnel"],Er=["get","class"],g_=["coalesce",["get","expressway"],0],D2=["coalesce",["get","layer"],0],cf=["coalesce",["get","ramp"],0],hf=["coalesce",["get","toll"],0],Ts=["match",Er],fo=["match",hf,1],bp=["==",hf,1],Hh=["!=",hf,1],Xh=["==",cf,1],Jl=["!=",cf,1],hm=["match",cf,1],pm=["==",g_,1],bu=["!=",g_,1],Zh=["match",g_,1],c1=["match",["get","service"],["parking_aisle","driveway"]],L2=["==",["get","surface"],"unpaved"];function L0(O,E){return O==null?E??null:E==null?O:["all",O,E]}var P0=["step",["zoom"],[...hm,0,["match",["get","network"],"us-interstate",1,0]],BI,[...hm,0,[...Ts,["motorway","trunk"],1,0]],rd,[...Ts,["motorway","trunk","primary"],1,0],z0,[...Ts,["motorway","trunk","primary","secondary"],1,0],tf,[...Ts,["motorway","trunk","primary","secondary","tertiary","busway","bus_guideway"],1,0],D0,[...Ts,"service",0,1],OI,[...Ts,"service",[...c1,0,1],1],VI,1],UI=["+",D2,.1,["*",-.1,cf],["*",.2,hf]],jI=["+",D2,.1,["*",-.1,cf],["*",.2,hf],["*",.4,g_]];function qI(O,E){var F=["in",Er,["literal",["motorway","trunk","primary","secondary","tertiary","busway","bus_guideway","minor","service"]]];return F=L0(F,E),O==null?F:L0(F,O==="surface"?["!",["in",Hg,["literal",["bridge","tunnel"]]]]:["==",Hg,O])}var $I={type:"line",source:"openmaptiles","source-layer":"transportation"};function GI(O,E,F){var H=["road",O].join("_");return E!=null&&(H+="_"+E),F!=null&&(H+="_"+F.join("_").replaceAll("=","").replaceAll("-","_")),H}function k0(O,E,F,H,V){var o=Jm($I,GI(O,E,V)),pe=qI(E,V);return pe!=null&&(o.filter=pe),o.minzoom=F,H&&(o.maxzoom=H),o}var Gh=[...Ts,["motorway","trunk"],[...hm,.5,1],"primary",[...hm,.45,.9],"secondary",[...hm,.3,[...Zh,.7,.6]],["tertiary","busway","bus_guideway"],[...hm,.25,.5],"minor",.3,"service",[...c1,.15,.2],.2],k2=[4,["*",.5,Gh],9,Gh,12,["*",[...Ts,"motorway",3.2,[...Zh,3.5,4]],Gh],16,["*",[...Zh,8,9],Gh],20,["*",[...Zh,64,72],Gh]],ZI=[4,["*",[...Ts,"motorway",1.5,.5],Gh],9,["*",[...Ts,"motorway",3,[...Zh,3,1.2]],Gh],12,["*",[...Ts,"motorway",5,[...Zh,7,5]],Gh],16,["*",[...Zh,14,11],Gh],20,["*",[...Zh,112,88],Gh]],A2=["match",Hg,"tunnel",[...Ts,["motorway","trunk"],[...fo,[...Zh,`hsl(${In}, 41%, 85%)`,`hsl(${In}, 41%, 80%)`],`hsl(${Fn}, 41%, 80%)`],["primary","secondary","tertiary","busway","bus_guideway"],"hsl(0, 0%, 80%)","hsl(0, 0%, 90%)"]],z2=[...Ts,"trunk",[...fo,`hsl(${In}, 77%, 50%)`,`hsl(${Fn}, 77%, 50%)`]],WI=["step",["zoom"],[...A2,[...z2,"hsl(0, 0%, 90%)"]],15,[...A2,[...z2,"hsl(0, 0%, 23%)"]]],HI=["match",Hg,"tunnel",[...Ts,"motorway",[...fo,`hsl(${In}, 71%, 90%)`,`hsl(${Fn}, 71%, 90%)`],"trunk",[...fo,`hsl(${In}, 77%, 90%)`,`hsl(${Fn}, 77%, 90%)`],["busway","bus_guideway"],`hsl(${Qm}, 25%, 93%)`,[...fo,`hsl(${In}, 100%, 95%)`,`hsl(${Fn}, 0%, 95%)`]]],uf=[...HI,[...Ts,"trunk",[...Zh,[...fo,`hsl(${In}, 95%, 95%)`,`hsl(${Fn}, 95%, 95%)`],[...fo,`hsl(${In}, 77%, 50%)`,`hsl(${Fn}, 77%, 50%)`]],[...fo,`hsl(${In}, 100%, 75%)`,`hsl(${Fn}, 100%, 100%)`]]],XI=[...Ts,"motorway",[...fo,`hsl(${In}, 50%, 70%)`,`hsl(${Fn}, 50%, 70%)`],"trunk",[...fo,`hsl(${In}, 95%, 80%)`,`hsl(${Fn}, 95%, 80%)`],[...fo,`hsl(${In}, 100%, 40%)`,`hsl(${Fn}, 0%, 80%)`]];function __(O,E,F){let H=F?[F,`hsl(${O}, 0%, 23%)`]:[];return["interpolate",["exponential",Wh],["zoom"],E,`hsl(${O}, 0%, 75%)`,...H,14.9999,`hsl(${O}, 0%, 23%)`,15,`hsl(${O}, 100%, 100%)`]}function y_(O,E,F){let H=F?[F,`hsl(${O}, 100%, 40%)`]:[];return["interpolate",["exponential",Wh],["zoom"],E,`hsl(${O}, 100%, 75%)`,...H,14.9999,`hsl(${O}, 100%, 40%)`,15,`hsl(${O}, 100%, 75%)`]}function h1(O,E){return["interpolate",["exponential",Wh],["zoom"],O,"hsl(0, 0%, 75%)",E,"hsl(0, 0%, 23%)"]}var Hs=class{constructor(){this.brunnel="surface",this.minZoomFill=4,this.minZoomCasing=4,this.casingColor=WI,this.fillColor=uf,this.sortKey=jI}fill=function(){var E=k0("fill",this.brunnel,this.minZoomFill,this.maxZoomFill,this.constraints);return E.layout={"line-cap":"round","line-join":"round",visibility:"visible","line-sort-key":this.sortKey},E.paint={"line-opacity":P0,"line-color":this.fillColor,"line-width":["interpolate",["exponential",Wh],["zoom"],...k2],"line-blur"
1419:.5},E};casing=function(){var E=k0("casing",this.brunnel,this.minZoomCasing,this.maxZoomCasing,this.constraints);return E.layout={"line-cap":this.brunnel==="bridge"?"butt":"round","line-join":this.brunnel==="bridge"?"bevel":"round",visibility:"visible","line-sort-key":this.sortKey},E.paint={"line-opacity":P0,"line-color":this.casingColor,"line-width":["interpolate",["exponential",Wh],["zoom"],...ZI]},this.brunnel==="tunnel"?E.paint["line-dasharray"]=NI:E.paint["line-blur"]=.5,E};surface=function(){var E=k0("surface",this.brunnel,Math.min(this.minZoomCasing,this.minZoomFill),Math.max(this.maxZoomCasing,this.maxZoomFill),this.constraints);return E.filter=L0(E.filter,L2),E.layout={"line-cap":"butt","line-join":"round",visibility:"visible","line-sort-key":this.sortKey},E.paint={"line-opacity":P0,"line-dasharray":[4,4],"line-color":XI,"line-width":["interpolate",["exponential",Wh],["zoom"],...k2],"line-blur":.5},E}},Xg=class extends Hs{constructor(){super(),this.constraints=["any",["all",["!",["in",Er,["literal",["motorway","trunk"]]]],bu,Jl],["all",["==",Er,"trunk"],pm]]}},Kg=class extends Hs{constructor(){super(),this.constraints=["all",["!",["in",Er,["literal",["motorway","trunk"]]]],bu,Xh]}},Yg=class extends Hs{constructor(){super(),this.constraints=["any",["all",["==",Er,"trunk"],Jl],["all",["in",Er,["literal",["primary","secondary","tertiary","busway","bus_guideway"]]],pm]]}},Jg=class extends Hs{constructor(){super(),this.constraints=["all",["==",Er,"trunk"],Xh]}},R0=class extends Hs{constructor(){super(),this.brunnel="bridge"}},F0=class extends Xg{constructor(){super(),this.brunnel="bridge"}},B0=class extends Kg{constructor(){super(),this.brunnel="bridge"}},O0=class extends Yg{constructor(){super(),this.brunnel="bridge"}},V0=class extends Jg{constructor(){super(),this.brunnel="bridge"}},N0=class extends Hs{constructor(){super(),this.brunnel="tunnel"}},rf=class extends Hs{constructor(){super(),this.constraints=["all",["==",Er,"motorway"],Jl],this.sortKey=UI,this.minZoomFill=Wg,this.minZoomCasing=Wg,this.fillColor=["interpolate",["exponential",Wh],["zoom"],4,[...fo,`hsl(${In}, 70%, 76%)`,`hsl(${Fn}, 70%, 76%)`],6,[...fo,`hsl(${In}, 70%, 66%)`,`hsl(${Fn}, 70%, 66%)`],A0-.5,[...fo,`hsl(${In}, 70%, 60%)`,`hsl(${Fn}, 70%, 60%)`],14,[...fo,`hsl(${In}, 71%, 45%)`,`hsl(${Fn}, 71%, 35%)`]],this.casingColor=["interpolate",["exponential",Wh],["zoom"],4,[...fo,`hsl(${In}, 10%, 85%)`,`hsl(${Fn}, 10%, 85%)`],6,[...fo,`hsl(${In}, 60%, 50%)`,`hsl(${Fn}, 60%, 50%)`],A0-.5,[...fo,`hsl(${In}, 71%, 40%)`,`hsl(${Fn}, 71%, 40%)`],14,[...fo,`hsl(${In}, 51%, 9%)`,`hsl(${Fn}, 51%, 9%)`]]}},nf=class extends Hs{constructor(){super(),this.constraints=["all",["==",Er,"trunk"],Jl,bu],this.minZoomFill=Wg,this.minZoomCasing=Wg,this.fillColor=uf,this.casingColor=["interpolate",["exponential",Wh],["zoom"],5,[...fo,`hsl(${In}, 77%, 50%)`,`hsl(${Fn}, 77%, 50%)`],9,[...fo,`hsl(${In}, 77%, 50%)`,`hsl(${Fn}, 77%, 50%)`],15,[...fo,`hsl(${In}, 70%, 18%)`,`hsl(${Fn}, 70%, 18%)`]]}},nd=class extends Hs{constructor(){super(),this.constraints=["all",["==",Er,"primary"],Jl,bu,Hh],this.minZoomFill=rd,this.minZoomCasing=rd,this.fillColor=__(Fn,this.minZoomFill,this.minZoomFill+2)}},of=class extends nd{constructor(){super(),this.constraints=["all",["==",Er,"primary"],Jl,bu,bp],this.fillColor=y_(In,this.minZoomFill,this.minZoomFill+2)}},Qg=class extends nd{constructor(){super(),this.constraints=["all",["==",Er,"primary"],Jl,pm],this.fillColor=uf,this.casingColor=h1(this.minZoomCasing,this.minZoomCasing+2)}},od=class extends Hs{constructor(){super(),this.constraints=["all",["==",Er,"secondary"],Jl,bu,Hh],this.minZoomFill=z0,this.minZoomCasing=z0,this.fillColor=__(Fn,this.minZoomFill,this.minZoomFill+2)}},af=class extends od{constructor(){super(),this.constraints=["all",["==",Er,"secondary"],Jl,bu,bp],this.fillColor=y_(In,this.minZoomFill,this.minZoomFill+2)}},e_=class extends od{constructor(){super(),this.constraints=["all",["==",Er,"secondary"],Jl,pm],this.fillColor=uf,this.casingColor=h1(this.minZoomCasing,this.minZoomCasing+2)}},vp=class extends Hs{constructor(){super(),this.constraints=["all",["==",Er,"tert
1419iary"],Jl,bu,Hh],this.minZoomFill=tf,this.minZoomCasing=tf,this.fillColor=__(Fn,this.minZoomFill,this.minZoomFill+2)}},sf=class extends vp{constructor(){super(),this.constraints=["all",["==",Er,"tertiary"],Jl,bu,bp],this.fillColor=y_(In,this.minZoomFill,this.minZoomFill+2)}},t_=class extends vp{constructor(){super(),this.constraints=["all",["==",Er,"tertiary"],Jl,pm],this.fillColor=uf,this.casingColor=h1(this.minZoomCasing,this.minZoomCasing+2)}},i_=class extends vp{constructor(){super(),this.constraints=["in",Er,["literal",["busway","bus_guideway"]]],this.minZoomFill=tf,this.minZoomCasing=tf,this.fillColor=["interpolate",["exponential",Wh],["zoom"],this.minZoomFill,`hsl(${Qm}, 25%, 75%)`,this.minZoomFill+2,`hsl(${Qm}, 25%, 50%)`,14.9999,`hsl(${Qm}, 25%, 50%)`,15,`hsl(${Qm}, 25%, 80%)`],this.surfaceColor=`hsl(${this.hue}, 0%, 80%)`}},lf=class extends Hs{constructor(){super(),this.constraints=["all",["in",Er,["literal",["minor","service"]]],Hh],this.minZoomFill=D0,this.minZoomCasing=D0,this.fillColor=__(Fn,this.minZoomFill)}},r_=class extends lf{constructor(){super(),this.constraints=["all",["in",Er,["literal",["minor","service"]]],bp],this.fillColor=y_(In,this.minZoomFill)}},n_=class extends rf{constructor(){super(),this.constraints=["all",["==",Er,"motorway"],Xh],this.minZoomFill=rd,this.minZoomCasing=rd}},o_=class extends nf{constructor(){super(),this.constraints=["all",["==",Er,"trunk"],Xh],this.minZoomFill=rd,this.minZoomCasing=rd}},a_=class extends nd{constructor(){super(),this.constraints=["all",["==",Er,"primary"],Xh,Hh]}},s_=class extends of{constructor(){super(),this.constraints=["all",["==",Er,"primary"],Xh,bp]}},l_=class extends od{constructor(){super(),this.constraints=["all",["==",Er,"secondary"],Xh,Hh]}},c_=class extends af{constructor(){super(),this.constraints=["all",["==",Er,"secondary"],Xh,bp]}},h_=class extends vp{constructor(){super(),this.constraints=["all",["==",Er,"tert
1419iary"],Xh,Hh]}},u_=class extends sf{constructor(){super(),this.constraints=["all",["==",Er,"tertiary"],Xh,bp]}},U0=class extends rf{constructor(){super(),this.brunnel="bridge"}},j0=class extends nf{constructor(){super(),this.brunnel="bridge"}},q0=class extends nd{constructor(){super(),this.brunnel="bridge"}},$0=class extends of{constructor(){super(),this.brunnel="bridge"}},G0=class extends Qg{constructor(){super(),this.brunnel="bridge"}},Z0=class extends od{constructor(){super(),this.brunnel="bridge"}},W0=class extends af{constructor(){super(),this.brunnel="bridge"}},H0=class extends e_{constructor(){super(),this.brunnel="bridge"}},X0=class extends vp{constructor(){super(),this.brunnel="bridge"}},K0=class extends sf{constructor(){super(),this.brunnel="bridge"}},Y0=class extends t_{constructor(){super(),this.brunnel="bridge"}},J0=class extends i_{constructor(){super(),this.brunnel="bridge"}},Q0=class extends lf{constructor(){super(),this.brunnel="bridge"}},e1=class extends r_{constructor(){super(),this.brunnel="bridge"}},t1=class extends n_{constructor(){super(),this.brunnel="bridge"}},i1=class extends o_{constructor(){super(),this.brunnel="bridge"}},r1=class extends a_{constructor(){super(),this.brunnel="bridge"}},n1=class extends s_{constructor(){super(),this.brunnel="bridge"}},o1=class extends l_{constructor(){super(),this.brunnel="bridge"}},a1=class extends c_{constructor(){super(),this.brunnel="bridge"}},s1=class extends h_{constructor(){super(),this.brunnel="bridge"}},l1=class extends u_{constructor(){super(),this.brunnel="bridge"}},u1=new Hs,R2=new R0,p1=new N0,Cc=new Xg,F2=new Kg,B2=new F0,O2=new B0,d1=new Yg,V2=new Jg,N2=new O0,U2=new V0,vu=new rf,um=new nf,p_=new nd,x_=new of,d_=new Qg,m_=new od,v_=new af,m1=new e_,f_=new vp,b_=new sf,f1=new t_,g1=new i_,ef=new lf,w_=new r_,_1=new U0,j2=new j0,q2=new q0,$2=new $0,G2=new G0,Z2=new Z0,W2=new W0,H2=new H0,X2=new X0,K2=new K0,Y2=new Y0,J2=new J0,Q2=new Q0,ew=new e1,y1=new n_,tw=new o_,iw=new a_,rw=new s_,nw=new l_,ow=new c_,aw=new h_,sw=new u_,x1=new t1,lw=new i1,cw=new r1,hw=new n1,uw=new o1,pw=new a1,dw=new s1,mw=new l1,w4=[vu.fill().id,vu.casing().id,um.casing().id,x_.fill().id,v_.fill().id,b_.fill().id,w_.fill().id,Cc.casing().id],fw=[{description:"Freeway (controlled access, divided)",layers:[vu.fill().id,vu.casing().id],filter:Hh},{description:"Expressway (limited access, divided)",layers:[d1.fill().id,Cc.casing().id,d_.casing().id,d_.casing().id,m1.casing().id,f1.casing().id],filter:["all",pm,Hh]},{description:"Principal highway",layers:[um.casing().id],filter:Hh},{description:"Major arterial road",layers:[p_.fill().id,Cc.casing().id],filter:["==",Er,"primary"]},{description:"Minor arterial road",layers:[m_.fill().id,Cc.casing().id],filter:["==",Er,"secondary"]},{description:"Collector road",layers:[f_.fill().id,Cc.casing().id],filter:["==",Er,"tert
1419iary"]},{description:"Local road",layers:[ef.fill().id,Cc.casing().id],filter:["match",Er,["minor","service"],!0,!1]},{description:"Driveway or parking aisle",layers:[ef.fill().id,Cc.casing().id],filter:["all",["==",Er,"service"],[...c1,!0,!1]]},{description:"Toll road",layers:[vu.fill().id,vu.casing().id,um.casing().id,x_.fill().id,v_.fill().id,b_.fill().id,w_.fill().id,Cc.casing().id],filter:bp},{description:"Busway",layers:[g1.fill().id,Cc.casing().id],filter:["==",Er,"busway"]},{description:"Unpaved road",layers:[u1.surface().id,um.casing().id,p_.fill().id,m_.fill().id,f_.fill().id,ef.fill().id,Cc.casing().id],filter:L2}];var v1=["match",["get","class"],["motorway_construction","trunk_construction"]],b1={id:"highway-construction",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["in",["get","class"],["literal",["motorway_construction","trunk_construction","primary_construction","secondary_construction","tertiary_construction","minor_construction","service_construction"]]],minzoom:9,paint:{"line-color":["interpolate-lab",["exponential",2],["zoom"],10,[...v1,"lightcoral","lightslategray"],13,[...v1,"maroon","lightslategray"],15,[...v1,"maroon","slategray"]],"line-opacity":["interpolate",["exponential",2],["zoom"],10,0,11,1],"line-blur":.75,"line-width":1,"line-dasharray":[2.5,1.25],"line-offset":0,"line-gap-width":["interpolate",["exponential",1.2],["zoom"],11,0,20,2]}},_w=[{description:"Road under construction",layers:[b1.id]}];var w1={id:"highway-exit",type:"symbol",filter:["all",["==",["get","subclass"],"junction"],["!=",["get","ref"],""]],source:"openmaptiles","source-layer":"transportation_name",minzoom:14,layout:{"text-field":yp(["get","ref"],` 1420`),"text-font":["Americana-Bold"],"text-size":9,"text-line-height":1},paint:{"text-color":"hsla(60, 100%, 50%, 1)","text-halo-color":"#000000","text-halo-width":.75}},xw=[{description:"Freeway or expressway exit",layers:[w1.id]}];var KI=1.2;function pf(O,E){if(Array.isArray(O)){var F=[O[0],O[1]];for(let H=2;H<O.length-1;H++)H%2==0?F.push(O[H]):F.push(pf(O[H],E));return F.push(pf(O[O.length-1],E)),F}else return O*E}function T1(O){return["interpolate",["exponential",KI],["zoom"],8,pf(O,1/16),12,pf(O,1/4),20,O]}function YI(O){return["all",O==="surface"?["match",["get","brunnel"],["bridge","tunnel"],!1,!0]:["match",["get","brunnel"],O,!0,!1],["in",["get","class"],["literal",["rail","transit"]]]]}var Mw={type:"line",source:"openmaptiles","source-layer":"transportation"},dm=["match",["get","service"],["siding","spur","yard"]],wp=[...dm,!0,!1],wu=[...dm,!1,!0],ad=["!=",["get","service"],"crossover"],bw=["match",["get","brunnel"],"tunnel",u2,["match",["get","subclass"],"subway",m2,"light_rail",f2,"tram",g2,"monorail",_2,"funicular",y2,"narrow_gauge",d2,p2]],ww=["match",["get","subclass"],["rail","preserved","narrow_gauge","subway"],[...dm,2,4],"monorail",[...dm,1.6,3.2],[...dm,1.25,2.5]],S1=["step",["zoom"],["match",["get","subclass"],["rail","preserved","narrow_gauge"],1,0],14,1],Pw={...Mw,id:"rail_bridge-casing",filter:["all",["==",["get","brunnel"],"bridge"],["in",["get","class"],["literal",["rail","transit"]]]],minzoom:13,layout:{"line-cap":"butt","line-join":"bevel",visibility:"visible"},paint:{"line-color":ea,"line-opacity":S1,"line-width":T1([...dm,4,6])}};function JI(O,E,F){var H=["rail",O,E].join("_");return F!=null&&(H+="_"+F.join("_").replaceAll("=","").replaceAll("-","_")),H}function Tw(O,E,F,H,V){var o=Jm(Mw,JI(O,E,V));return o.filter=YI(E),o.minzoom=F,H&&(o.maxzoom=H),o}var Tp=class{constructor(){this.brunnel="surface",this.minZoom=10}fill=function(){var E=Tw("fill",this.brunnel,this.minZoom,null,this.constraints);return E.layout={"line-cap":"butt","line-join":"bevel",visibility:"visible"},E.paint={"line-color":bw,"line-opacity":S1,"line-width":T1(ww)},this.constraints!=null&&E.filter.push(this.constraints),E};dashes=function(){var E=Tw("dashes",this.brunnel,this.minZoom,null,this.constraints);return E.layout={"line-cap":"butt","line-join":"bevel",visibility:"visible"},E.paint={"line-color":bw,"line-opacity":S1,"line-width":T1(pf(ww,this.dashWidthFactor)),"line-dasharray":this.dashArray.map(F=>F/2/this.dashWidthFactor)},this.constraints!=null&&E.filter.push(this.constraints),E.filter.push(ad),E}},I1=class extends Tp{constructor(){super(),this.brunnel="bridge"}},C1=class extends Tp{constructor(){super(),this.brunnel="tunnel"}},sd=class extends Tp{constructor(){super(),this.constraints=["all",["in",["get","subclass"],["literal",["rail","preserved"]]],wu],this.brunnel="surface",this.dashWidthFactor=3,this.dashArray=[1,25]}},df=class extends sd{constructor(){super(),this.constraints=["all",["in",["get","subclass"],["literal",["rail","preserved"]]],wp],this.dashWidthFactor=4,this.dashArray=[1,50]}},mm=class extends sd{constructor(){super(),this.constraints=["all",["==",["get","subclass"],"narrow_gauge"],wu],this.dashWidthFactor=2,this.dashArray=[1,1,1,15]}},mf=class extends mm{constructor(){super(),this.constraints=["all",["==",["get","subclass"],"narrow_gauge"],wp],this.dashWidthFactor=3,this.dashArray=[1,2,1,30]}},fm=class extends Tp{constructor(){super(),this.constraints=["all",["in",["get","subclass"],["literal",["light_rail","tram"]]],wu],this.brunnel="surface",this.minZoom=14,this.dashWidthFactor=2,this.dashArray=[1,6]}},ff=class extends fm{constructor(){super(),this.constraints=["all",["in",["get","subclass"],["literal",["light_rail","tram"]]],wp],this.dashWidthFactor=3,this.dashArray=[1,12]}},gf=class extends Tp{constructor(){super(),this.constraints=["==",["get","subclass"],"funicular"],this.brunnel="surface",this.minZoom=14,this.dashWidthFactor=2.3,this.dashArray=[1,2]}},E1=class extends sd{constructor(){super(),this.brunnel="bridge"}},M1=class extends df{constructor(){super(),this.brunnel="bridge"}},P1=class extends mm{constructor(){super(),this.brunnel="bridge"}},k1=class extends mf{constructor(){super(),this.brunnel="bridge"}},A1=class extends gf{constructor(){super(),this.brunnel="bridge"}},z1=class extends fm{constructor(){super(),this.brunnel="bridge"}},D1=class extends ff{constructor(){super(),this.brunnel="bridge"}},L1=class extends sd{constructor(){super(),this.brunnel="tunnel"}},R1=class extends df{constructor(){super(),this.brunnel="tunnel"}},F1=class extends mm{constructor(){super(),this.brunnel="tunnel"}},B1=class extends mf{constructor(){super(),this.brunnel="tunnel"}},O1=class extends gf{constructor(){super(),this.brunnel="tunnel"}},V1=class extends fm{constructor(){super(),this.brunnel="tunnel"}},N1=class extends ff{constructor(){super(),this.brunnel="tunnel"}};function U1(O){let E=[];O.forEach(F=>E.push(Zg(F,["!",["has","layer"]],"_layer_bottom")));for(let F=1;F<=4;F++)O.forEach(H=>E.push(M2(H,F)));return O.forEach(F=>E.push(Zg(F,[">=",["coalesce",["get","layer"],0],5],"_layer_top"))),E}var yl=new Tp,j1=new I1,S_=new C1,q1=new sd,kw=new E1,Aw=new L1,$1=new df,zw=new M1,Dw=new R1,G1=new mm,Lw=new P1,Rw=new F1,Z1=new mf,Fw=new k1,Bw=new B1,I_=new fm,Ow=new z1,Vw=new V1,C_=new ff,Nw=new D1,Uw=new N1,W1=new gf,jw=new A1,qw=new O1,T_=["==",["get","subclass"],"rail"];var Sw=["==",["get","subclass"],"narrow_gauge"],Iw=["==",["get","subclass"],"subway"],Cw=["==",["get","subclass"],"light_rail"],Ew=["==",["get","subclass"],"tram"],$w=[{description:"Main or branch line track",layers:[q1.dashes().id,yl.fill().id],filter:["all",T_,wu,ad]},{description:"Siding, spur, or yard track",layers:[$1.dashes().id,yl.fill().id],filter:["all",T_,wp]},{description:"Narrow-gauge mainline track",layers:[G1.dashes().id,yl.fill().id],filter:["all",Sw,T_,wu,ad]},{description:"Narrow-gauge siding, spur, or yard track",layers:[Z1.dashes().id,yl.fill().id],filter:["all",Sw,T_,wp]},{description:"Subway line",layers:[S_.fill().id,yl.fill().id],filter:["all",Iw,wu,ad]},{description:"Subway siding or yard track",layers:[S_.fill().id,yl.fill().id],filter:["all",Iw,wp]},{description:"Monorail line",layers:[...U1([j1.fill()]).map(O=>O.id),yl.fill().id],filter:["all",["==",["get","subclass"],"monorail"],wu,ad]},{description:"Light rail line",layers:[I_.dashes().id,yl.fill().id],filter:["all",Cw,wu,ad]},{description:"Light rail siding or yard track",layers:[C_.dashes().id,yl.fill().id],filter:["all",Cw,wp]},{description:"Streetcar line",layers:[I_.dashes().id,yl.fill().id],filter:["all",Ew,wu,ad]},{description:"Streetcar siding or yard track",layers:[C_.dashes().id,yl.fill().id],filter:["all",Ew,wp]},{description:"Funicular or inclined elevator",layers:[W1.dashes().id,yl.fill().id],filter:["==",["get","subclass"],"funicular"]}];var P_=["any",["!",["has","iata"]],["!",["has","icao"]],["==",["get","class"],"private"]],Zw={"icon-image":["match",["get","class"],"military",`poi 1421sprite=poi_military_plane 1422color=`+Oi.airport,`poi 1423sprite=poi_plane 1424color=`+Oi.airport],"text-anchor":"bottom","text-variable-anchor":["bottom","bottom-right","bottom-left","right","left"],"text-padding":8,"icon-allow-overlap":!1},Ww={id:"airport_fill",type:"fill",filter:["==",["get","class"],"aerodrome"],paint:{"fill-color":c2},layout:{visibility:"visible"},source:"openmaptiles",metadata:{},"source-layer":"aeroway"},Hw={id:"airport_outline",type:"line",filter:["==",["get","class"],"aerodrome"],paint:{"line-color":h2},layout:{visibility:"visible"},source:"openmaptiles",metadata:{},"source-layer":"aeroway"},H1={id:"airport_runway",type:"line",filter:["all",["==",["get","class"],"runway"],["==",["geometry-type"],"LineString"]],paint:{"line-color":Km,"line-width":{base:1.7,stops:[[12,3],[15,15],[17,30]]}},layout:{"line-cap":"butt",visibility:"visible"},source:"openmaptiles",metadata:{},"source-layer":"aeroway"},Xw={id:"airport_runway_area",type:"fill",filter:["all",["==",["get","class"],"runway"],["==",["geometry-type"],"Polygon"]],paint:{"fill-color":Km},layout:{visibility:"visible"},source:"openmaptiles",metadata:{},"source-layer":"aeroway"},X1={id:"airport_taxiway",type:"line",filter:["all",["==",["get","class"],"taxiway"],["==",["geometry-type"],"LineString"]],paint:{"line-color":Km,"line-width":{base:1.7,stops:[[12,1],[15,5]]}},layout:{"line-cap":"butt",visibility:"visible"},minzoom:12,source:"openmaptiles",metadata:{},"source-layer":"aeroway"},Kw={id:"airport_taxiway_area",type:"fill",filter:["all",["==",["get","class"],"taxiway"],["==",["geometry-type"],"Polygon"]],paint:{"fill-color":Km},layout:{visibility:"visible"},minzoom:12,source:"openmaptiles",metadata:{},"source-layer":"aeroway"},E_={id:"airport_ref_label",type:"symbol",maxzoom:15,filter:["!",P_],paint:{"text-color":lm,"text-halo-blur":1,"text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1},layout:{visibility:"visible","text-field":["coalesce",["get","iata"],["get","icao"]],"text-font":["Americana-Bold"],"text-size":10,...Zw},source:"openmaptiles",metadata:{},"source-layer":"aerodrome_label"},Yw={id:"airport_ref_label_minor",type:"symbol",minzoom:13,maxzoom:15,filter:P_,paint:{"text-color":lm,"text-halo-blur":1,"text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1},layout:{visibility:"visible","text-field":["coalesce",["get","iata"],["get","icao"]],"text-font":["Americana-Bold"],"text-size":10},source:"openmaptiles",metadata:{},"source-layer":"aerodrome_label"},M_={id:"airport_label",type:"symbol",minzoom:11,maxzoom:15,filter:["!",P_],paint:{"text-color":lm,"text-halo-blur":1,"text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1},layout:{visibility:"visible","text-field":Wn,"text-font":["Americana-Bold"],"text-size":10,...Zw},source:"openmaptiles","source-layer":"aerodrome_label"},Jw={id:"airport_label_minor",type:"symbol",minzoom:13,maxzoom:15,filter:P_,paint:{"text-color":lm,"text-halo-blur":1,"text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1},layout:{visibility:"visible","text-field":Wn,"text-font":["Americana-Bold"],"text-size":10},source:"openmaptiles","source-layer":"aerodrome_label"},K1={id:"airport_gate_label",type:"symbol",filter:["==",["get","class"],"gate"],minzoom:15,paint:{"text-color":lm,"text-halo-blur":1,"text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1},layout:{visibility:"visible","text-field":["get","ref"],"text-font":["Americana-Bold"],"text-size":10},source:"openmaptiles","source-layer":"aeroway"},Qw=[{description:"Civilian airport",layers:[E_.id,M_.id],filter:["!=",["get","class"],"military"]},{description:"Military air base",layers:[E_.id,M_.id],filter:["==",["get","class"],"military"]},{description:"Runway",layers:[H1.id]},{description:"Taxiway",layers:[X1.id]},{description:"Gate",layers:[K1.id]}];var Ot={aerialway_station:{classes:{aerialway:["station"]},sprite:"poi_aerialway_circle",color:Oi.transport,description:"Aerial lift station"},bar:{classes:{bar:["bar"],beer:["beer","pub"]},sprite:"poi_martini_glass",color:Oi.consumer,description:"Bar or pub"},bookstore:{classes:{library:["books"]},sprite:"poi_book_upright",color:Oi.consumer,description:"Bookstore"},bus_station:{classes:{bus:["bus_station"]},sprite:"poi_bus_circle",color:Oi.transport,description:"Bus station"},bus_stop:{classes:{bus:["bus_stop"]},sprite:"poi_bus",color:Oi.transport,description:"Bus stop"},car_repair:{classes:{car:["car_repair"]},sprite:"poi_car_repair",color:Oi.consumer,description:"Car mechanic"},car_shop:{classes:{car:["car"]},sprite:"poi_car_shop",color:Oi.consumer,description:"Car dealership"},cemetery:{classes:{cemetery:["cemetery","grave_yard"]},sprite:"poi_gravestone",color:Oi.outdoor,description:"Cemetery"},charging_station:{classes:{fuel:["charging_station"]},sprite:"poi_charging_station",color:Oi.consumer,description:"Charging station"},taxi:{classes:{office:["taxi"]},sprite:"poi_taxi",color:Oi.transport,description:"Taxi stand"},coffee:{classes:{cafe:["cafe"]},sprite:"poi_coffee_cup",color:Oi.consumer,description:"Coffee shop"},food_court:{classes:{fast_food:["food_court"]},sprite:"poi_restaurant_circle",color:Oi.consumer,description:"Food court"},fire_station:{classes:{fire_station:["fire_station"]}
1424,sprite:"poi_fire_station",color:Oi.infrastructure,description:"Fire station"},fuel:{classes:{fuel:["fuel"]},sprite:"poi_fuel",color:Oi.consumer,description:"Gas station"},hospital:{classes:{hospital:["hospital"]},sprite:"poi_hospital",color:Oi.infrastructure,description:"Hospital"},hotel:{classes:{lodging:["hotel","motel","guest_house"]},sprite:"poi_hotel",color:Oi.consumer,description:"Hotel"},hostel:{classes:{lodging:["hostel"]},sprite:"poi_hostel",color:Oi.consumer,description:"Hostel"},library:{classes:{library:["library"]},sprite:"poi_book_upright",color:Oi.infrastructure,description:"Library"},medical:{classes:{hospital:["clinic"],doctors:["doctors"]},sprite:"poi_health_cross",color:Oi.infrastructure,description:"Doctor's office or clinic"},museum:{classes:{museum:["museum"]},sprite:"poi_museum",color:Oi.attraction,description:"Museum"},parking:{classes:{parking:["parking"]},sprite:"poi_p",color:Oi.infrastructure,description:"Parking"},police:{classes:{police:["police"]},sprite:"poi_police_shield",color:Oi.infrastru
1424cture,description:"Police station"},post_office:{classes:{post:["post_office"]},sprite:"poi_envelope",color:Oi.infrastructure,description:"Post office"},pow_buddhist:{classes:{place_of_worship:["buddhist"]},sprite:"poi_pow_buddhist",color:Oi.infrastructure,description:"Buddhist place of worship"},pow_christian:{classes:{place_of_worship:["christian"]},sprite:"poi_pow_christian",color:Oi.infrastructure,description:"Christian place of worship"},pow_hindu:{classes:{place_of_worship:["hindu"]},sprite:"poi_pow_hindu",color:Oi.infrastructure,description:"Hindu place of worship"},pow_jewish:{classes:{place_of_worship:["jewish"]},sprite:"poi_pow_jewish",color:Oi.infrastructure,description:"Jewish place of worship"},pow_muslim:{classes:{place_of_worship:["muslim"]},sprite:"poi_pow_muslim",color:Oi.infrastructure,description:"Muslim place of worship"},pow_sikh:{classes:{place_of_worship:["sikh"]},sprite:"poi_pow_sikh",color:Oi.infrastructure,description:"Sikh place of worship"},pow_shinto:{classes:{place_of_worship:["shinto"]}
1424,sprite:"poi_pow_shinto",color:Oi.infrastructure,description:"Shinto place of worship"},pow_taoist:{classes:{place_of_worship:["taoist"]},sprite:"poi_pow_taoist",color:Oi.infrastructure,description:"Taoist place of worship"},pow_uu:{classes:{place_of_worship:["unitarian_universalist"]},sprite:"poi_pow_uu",color:Oi.infrastructure,description:"Unitarian Universalist place of worship"},railway_station:{classes:{railway:["station","halt"]},sprite:"poi_rail_circle",color:Oi.transport,description:"Train or subway station"},rail_subway_station:{classes:{railway:["subway"]},sprite:"poi_rail_circle",color:Oi.transport,description:"Train or subway station"},railway_stop:{classes:{railway:["tram_stop"]},sprite:"poi_rail",color:Oi.transport,description:"Tram stop"},restaurant:{classes:{restaurant:["restaurant"],fast_food:["fast_food"]},sprite:"poi_restaurant",color:Oi.consumer,description:"Restaurant or fast food"},school:{classes:{school:["kindergarten","school"]},sprite:"poi_school",color:Oi.infrastructure,description:"School"},supermarket:{classes:{grocery:["supermarket"]},sprite:"poi_supermarket",color:Oi.consumer,description:"Supermarket"},college:{classes:{college:["college","university"]}
1424,sprite:"poi_mortarboard",color:Oi.infrastructure,description:"College or university"},campsite:{classes:{campsite:["camp_site"]},sprite:"poi_tent_circle",color:Oi.outdoor,description:"Campground"},baseball:{classes:{pitch:["baseball","softball"]},sprite:"poi_baseball",color:Oi.outdoor,description:"Baseball or softball field"},basketball:{classes:{pitch:["basketball"]},sprite:"poi_basketball",color:Oi.outdoor,description:"Basketball court"},football:{classes:{pitch:["american_football"]},sprite:"poi_american_football",color:Oi.outdoor,description:"Football field"},equestrian:{classes:{pitch:["equestrian"]},sprite:"poi_horse",color:Oi.outdoor,description:"Horse riding arena"},four_square:{classes:{pitch:["four_square"]},sprite:"poi_four_square",color:Oi.outdoor,description:"Four square court"},pickleball:{classes:{pitch:["pickleball"]},sprite:"poi_pickleball",color:Oi.outdoor,description:"Pickleball court"},skateboard:{classes:{pitch:["skateboard"]},sprite:"poi_skateboard",color:Oi.outdoor,description:"Skate park"},soccer:{classes:{pitch:["soccer","futsal"]},sprite:"poi_soccer",color:Oi.outdoor,description:"Soccer field"},tennis:{classes:{pitch:["tennis"]},sprite:"poi_tennis_racket",color:Oi.outdoor,description:"Tennis court"},volleyball:{classes:{pitch:["volleyball","beachvolleyball"]},sprite:"poi_volleyball",color:Oi.outdoor,description:"Volleyball court"},townhall:{classes:{town_hall:["townhall"]}
1424,sprite:"poi_town_hall",color:Oi.infrastructure,description:"City hall"}};function QI(){let O={};for(var E in Ot){let V=Ot[E].classes;for(var F in V)O[F]||(O[F]=["match",["at",0,["split",["get","subclass"],";"]]]),O[F].push(V[F]),O[F].push(`sprite=${Ot[E].sprite} 1425color=${Ot[E].color}`)}let H=[];for(var F in O)H.push(F),H.push(O[F].concat(["poi"]));return H}var eC=["concat",`poi 1426`,["match",["get","class"],...QI(),"poi"]];function k_(O,E){let F={};for(let[V,o]of O)for(let pe of V)for(let Ne in pe.classes)F[Ne]||(F[Ne]=["match",["at",0,["split",["get","subclass"],";"]]]),F[Ne].push(pe.classes[Ne]),F[Ne].push(o);let H=[];for(let V in F)H.push(V),H.push(F[V].concat([E]));return H}var Y1={id:"poi",type:"symbol",paint:{"text-halo-color":ea,"text-halo-width":1.5,"icon-halo-width":.4,"text-halo-blur":1,"icon-halo-blur":.2,"text-color":["match",["get","class"],...k_([[[Ot.fuel,Ot.bar,Ot.bookstore,Ot.coffee,Ot.supermarket,Ot.car_shop,Ot.car_repair,Ot.food_court,Ot.hotel,Ot.hostel,Ot.restaurant,Ot.charging_station],Oi.consumer],[[Ot.aerialway_station,Ot.bus_station,Ot.bus_stop,Ot.railway_station,Ot.rail_subway_station,Ot.railway_stop,Ot.taxi],Oi.transport],[[Ot.museum],Oi.attraction],[[Ot.hospital,Ot.fire_station,Ot.parking,Ot.police,Ot.school,Ot.college,Ot.library,Ot.townhall,Ot.post_office,Ot.pow_christian,Ot.pow_buddhist,Ot.pow_hindu,Ot.pow_jewish,Ot.pow_muslim,Ot.pow_sikh,Ot.pow_shinto,Ot.pow_taoist,Ot.pow_uu],Oi.infrastructure],[[Ot.cemetery,Ot.campsite,Ot.baseball,Ot.basketball,Ot.equestrian,Ot.football,Ot.four_square,Ot.pickleball,Ot.skateboard,Ot.soccer,Ot.tennis,Ot.volleyball],Oi.outdoor]],Oi.infrastructure),Oi.infrastructure]},filter:[">=",["zoom"],["match",["get","class"],...k_([[[Ot.college],10],[[Ot.railway_station],12],[[Ot.aerialway_station,Ot.rail_subway_station,Ot.bus_station,Ot.campsite],14],[[Ot.bus_stop,Ot.fire_station,Ot.food_court,Ot.hospital,Ot.library,Ot.museum,Ot.police,Ot.fuel,Ot.post_office,Ot.pow_buddhist,Ot.pow_christian,Ot.pow_hindu,Ot.pow_jewish,Ot.pow_muslim,Ot.pow_sikh,Ot.pow_shinto,Ot.pow_taoist,Ot.pow_uu,Ot.school,Ot.supermarket,Ot.charging_station,Ot.railway_stop,Ot.townhall],15],[[Ot.bar,Ot.bookstore,Ot.coffee,Ot.car_shop,Ot.car_repair,Ot.taxi,Ot.hotel,Ot.hostel,Ot.restaurant,Ot.baseball,Ot.basketball,Ot.equestrian,Ot.football,Ot.pickleball,Ot.skateboard,Ot.soccer,Ot.tennis,Ot.volleyball],16],[[Ot.medical,Ot.parking,Ot.cemetery],17],[[Ot.four_square],18]],99),99]],layout:{"text-font":["Americana-Regular"],"icon-optional":!1,"text-size":{base:1,stops:[[15,10],[17,12]]},"icon-image":eC,"icon-size":1,"text-field":["step",["zoom"],["match",["get","class"],...k_([[[Ot.bus_stop,Ot.railway_stop,Ot.fuel,Ot.supermarket,Ot.food_court,Ot.charging_station],""]],Wn),Wn],16,["match",["get","class"],...k_([[[Ot.bus_stop],""]],Wn),Wn],17,Wn],"text-variable-anchor":["left","right","bottom"],"text-justify":"auto","text-radial-offset":1.2,"text-max-width":5,"icon-padding":0,"text-padding":0,"icon-allow-overlap":!1,"symbol-sort-key":["get","rank"]},source:"openmaptiles","source-layer":"poi"},t5={id:"iconless_poi",type:"symbol",paint:{"text-halo-color":Fg,"text-halo-width":1,"icon-halo-width":.4,"text-halo-blur":1,"icon-halo-blur":.2,"text-color":Rg},filter:["all",["<",["zoom"],17],["==",["get","subclass"],"cemetery"]],layout:{"text-font":["Americana-Bold"],"text-size":10,"text-field":Wn,"text-anchor":"center","text-justify":"center","text-radial-offset":0,"text-max-width":5,"text-padding":0,"symbol-sort-key":["get","rank"]},source:"openmaptiles","source-layer":"poi"},i5=Object.values(Object.entries(Ot).reduce((O,[E,F])=>{let H=`${F.sprite}|${F.color}|${F.description}`;return O[H]?Object.entries(F.classes).forEach(([V,o])=>{O[H].classes[V]?O[H].classes[V]=[...new Set([...O[H].classes[V],...o])]:O[H].classes[V]=o}):O[H]={description:F.description,classes:{...F.classes}},O},{})).map(({description:O,classes:E})=>({description:O,layers:[Y1.id],filter:["all",["in",["get","class"],["literal",Object.keys(E)]],["in",["get","subclass"],["literal",Object.values(E).flat()]]]}));var tC=["step",["zoom"],["<=",["get","rank"],2],10,[">=",["get","rank"],1]],A_={id:"protected-area_fill",type:"fill",paint:{"fill-color":Jb},source:"openmaptiles","source-layer":"park"},z_={id:"protected-area_outline",type:"line",paint:{"line-color":t2},source:"openmaptiles",metadata:{},"source-layer":"park"},J1={id:"protected-area_label",type:"symbol",filter:tC,paint:{"text-color":Rg,"text-halo-blur":1,"text-halo-color":Fg,"text-halo-width":1},layout:{"text-field":Wn,"text-font":["Americana-Bold"],"text-size":10,"symbol-sort-key":["get","rank"]},source:"openmaptiles","source-layer":"park"},Q1={...A_,id:"park_fill",filter:["==",["get","subclass"],"park"],"source-layer":"landcover"},ex={id:"cemetery-fill",type:"fill",filter:["==","class","cemetery"],paint:{"fill-color":Qb},layout:{visibility:"visible"},source:"openmaptiles",metadata:{},"source-layer":"landuse"},tx={id:"pitch-fill",type:"fill",filter:["==","class","pitch"],paint:{"fill-color":e2},layout:{visibility:"visible"},source:"openmaptiles",metadata:{},"source-layer":"landuse"},ix={...z_,id:"park_outline",filter:["==",["get","subclass"],"park"],"source-layer":"landcover"},rx={id:"cemetery-outline",type:"line",filter:["==","class","cemetery"],paint:{"line-color":i2},layout:{visibility:"visible"},source:"openmaptiles",metadata:{},"source-layer":"landuse"},nx={id:"pitch-outline",type:"line",filter:["==","class","pitch"],paint:{"line-color":r2},layout:{visibility:"visible"},source:"openmaptiles",metadata:{},"source-layer":"landuse"},n5={...J1,id:"park_label",filter:["==",["get","class"],"park"],"source-layer":"poi"}
1426,o5=[{description:"Park",layers:[A_.id,z_.id,Q1.id,ix.id]},{description:"Cemetery",layers:[ex.id,rx.id]},{description:"Sports field",layers:[tx.id,nx.id]}];var ox={id:"building",type:"fill-extrusion",paint:{"fill-extrusion-color":["interpolate",["linear"],["zoom"],13,"hsl(0, 0%, 87%)",16,"hsl(0, 0%, 80%)"],"fill-extrusion-height":3,"fill-extrusion-opacity":.85},layout:{visibility:"visible"},source:"openmaptiles","source-layer":"building"},s5=[{description:"Building",layers:[ox.id]}];var D_=["river","canal"],ax=["stream"],Sp={id:"waterway",type:"line",source:"openmaptiles","source-layer":"waterway",layout:{"line-join":"round","line-cap":"round"},filter:["!=",["get","intermittent"],1],paint:{"line-color":["interpolate",["exponential",.5],["zoom"],13,Kb,15,yu],"line-width":["interpolate",["exponential",2],["zoom"],3,.5,16,["case",["in",["get","class"],["literal",D_]],10,["in",["get","class"],["literal",ax]],6,2]],"line-opacity":["case",["==",["get","brunnel"],"tunnel"],.3,1]}},sx={...Sp,id:"waterway_intermittent",filter:["==",["get","intermittent"],1],paint:{...Sp.paint,"line-dasharray":[2,3]}},_f={id:"water",type:"fill",paint:{"fill-color":["case",["any",["==",["get","intermittent"],1],["==",["get","brunnel"],"tunnel"]],Hb,yu],"fill-outline-color":Wb},source:"openmaptiles","source-layer":"water"},yf={id:"water_line",type:"line",filter:["all",["!=",["get","intermittent"],1],["match",["get","class"],D_,[">=",["zoom"],8],ax,[">=",["zoom"],16],"lake",[">=",["zoom"],8],!0]],paint:{"line-color":sm},layout:{"line-cap":"round","line-join":"round"},source:"openmaptiles","source-layer":"water"},lx={id:"water_line_intermittent",type:"line",minzoom:8,filter:["all",["==",["get","intermittent"],1]],paint:{"line-color":Xb,"line-dasharray":[10,6],"line-width":.5},layout:yf.layout,source:"openmaptiles","source-layer":"water"},cx={"text-halo-color":["match",["get","class"],["sea","ocean"],yu,ea],"text-color":Yb,"text-halo-width":.75,"text-halo-blur":.25},c5={"symbol-placement":"line","text-field":Gm,"text-font":["Americana-Italic"],"text-max-angle":55},h5={id:"waterway_label",type:"symbol",source:"openmaptiles","source-layer":"waterway",filter:["!=",["get","brunnel"],"tunnel"],layout:{...c5,"text-size":["interpolate",["exponential",2],["zoom"],3,8,12,["case",["in",["get","class"],["literal",D_]],14,10],20,["case",["in",["get","class"],["literal",D_]],40,["in",["get","class"],["literal",ax]],20,15]],"text-letter-spacing":.15},paint:cx},u5={id:"water_label",type:"symbol",filter:["all",["==",["geometry-type"],"LineString"]],source:"openmaptiles","source-layer":"water_name",layout:{...c5,"text-size":["interpolate",["exponential",2],["zoom"],3,11,12,18,20,40],"text-letter-spacing":.25},paint:cx},p5={id:"water_point_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==",["geometry-type"],"Point"]],layout:{"text-field":Wn,"text-font":["Americana-Bold-Italic"],"text-size":["interpolate",["exponential",2],["zoom"],3,["match",["get","class"],"ocean",16,"sea",12,8],12,["match",["get","class"],"ocean",28,"sea",21,14],20,["match",["get","class"],"ocean",80,"sea",60,40]],"text-letter-spacing":.25},paint:cx},d5=[{description:"Ocean, sea, or bay",layers:[_f.id,yf.id],filter:["==",["get","class"],"ocean"]},{description:"Lake or pond",layers:[_f.id,yf.id],filter:["all",["==",["get","class"],"lake"],["!=",["get","intermittent"],1]]},{description:"Intermittent lake or pond",layers:[_f.id,lx.id],filter:["all",["==",["get","class"],"lake"],["==",["get","intermittent"],1]]},{description:"River",layers:[Sp.id],filter:["all",["==",["get","class"],"river"],["!=",["get","intermittent"],1]]},{description:"Canal",layers:[Sp.id],filter:["all",["==",["get","class"],"canal"],["!=",["get","intermittent"],1]]},{description:"Creek",layers:[Sp.id],filter:["all",["==",["get","class"],"stream"],["!=",["get","intermittent"],1]]},{description:"Intermittent river or creek",layers:[Sp.id,sx.id],filter:["==",["get","intermittent"],1]}];var iC=1.2,hx={id:"ferry",type:"line",paint:{"line-color":sm,"line-dasharray":[7,5],"line-width":["interpolate",["exponential",iC],["zoom"],4,.55,12,1]},filter:["any",["==",["get","class"],"ferry"],["==",["get","subclass"],"ferry"]],layout:{visibility:"visible"},source:"openmaptiles","source-layer":"transportation"},f5=[{description:"Ferry route",layers:[hx.id]}];var L_=1.2,_5=["interpolate",["exponential",L_],["zoom"],12,1.2,14.9999,2.4,15,1.2,16,1.2,20,2.4],y5=["interpolate",["exponential",L_],["zoom"],12,0,15,0,16,1,20,16],rC=["interpolate",["exponential",L_],["zoom"],12,2,15.9999,4,16,2,20,4],nC=["interpolate",["exponential",L_],["zoom"],12,0,16,0,20,14.4],ux={id:"lift",type:"line",paint:{"line-color":l0,"line-width":_5,"line-gap-width":y5},filter:["all",["==",["get","class"],"aerialway"],["in",["get","subclass"],["literal",["chair_lift","cable_car","gondola","mixed_lift"]]]],layout:{visibility:"visible"},source:"openmaptiles","source-layer":"transportation"},x5={id:"lift_casing",type:"line",paint:{"line-color":ea,"line-width":rC,"line-gap-width":nC},filter:["all",["==",["get","class"],"aerialway"],["in",["get","subclass"],["literal",["chair_lift","cable_car","gondola","mixed_lift"]]]],layout:{visibility:"visible"},source:"openmaptiles","source-layer":"transportation"},px={id:"drag_lift",type:"line",paint:{"line-color":l0,"line-width":_5,"line-gap-width":y5,"line-dasharray":[5,1]},filter:["all",["==",["get","class"],"aerialway"],["in",["get","subclass"],["literal",["drag_lift","platter","j-bar","t-bar"]]]],layout:{visibility:"visible"},source:"openmaptiles","source-layer":"transportation"},v5=[{description:"Aerial tramway or chairlift",layers:[ux.id]},{description:"Drag lift",layers:[px.id]}];var dx={id:"aboriginal_fill",type:"fill",filter:["==",["get","class"],"aboriginal_lands"],paint:{"fill-color":o2},layout:{visibility:"visible"},source:"openmaptiles",metadata:{},"source-layer":"boundary"},mx={id:"aboriginal_outline",type:"line",filter:["==",["get","class"],"aboriginal_lands"],paint:{"line-color":a2},layout:{visibility:"visible"},source:"openmaptiles",metadata:{},"source-layer":"boundary"},w5={id:"aboriginal_label",type:"symbol",filter:["==",["get","class"],"aboriginal_lands"],paint:{"text-color":s2,"text-halo-blur":1,"text-halo-color":l2,"text-halo-width":1.5},layout:{"text-field":qh,"text-font":["Americana-Regular"],"text-size":{base:10,stops:[[6,11],[10,12],[12,15],[14,18]]},"text-padding":1,"text-transform":"uppercase","symbol-sort-key":["get","rank"]},source:"openmaptiles","source-layer":"place"},T5=[{description:"Tribal reservation or other native land",layers:[dx.id,mx.id]}];var oC=["step",["zoom"],["<=",["get","rank"],1],13,["<=",["get","rank"],2],
142614,[">=",["get","rank"],1]];function fx(O=Va()[0]){return["case",["==",["get","customary_ft"],1],["number-format",["get","ele_ft"],{unit:"foot",locale:O}],["number-format",["get","ele"],{unit:"meter",locale:O}]]}var aC=["let","eleUnits",fx(),["case",["all",["has","name"],["has","ele"]],["concat",qh,` 1427`,["var","eleUnits"]],["has","name"],qh,["has","ele"],["var","eleUnits"],["literal",""]]],gx={id:"peak",type:"symbol",paint:{"text-halo-color":ea,"text-halo-width":1.5,"icon-halo-width":.4,"text-halo-blur":1,"icon-halo-blur":.2,"text-color":pa.black},filter:["all",["in",["get","class"],["literal",["peak","volcano"]]],oC],layout:{"text-font":["Americana-Italic"],"text-size":9,"icon-image":"peak","icon-size":1,"text-field":aC,"text-anchor":"bottom","text-variable-anchor":["left","right"],"text-justify":"auto","text-radial-offset":.7,"icon-optional":!1,"text-max-width":8,"icon-padding":1,"text-padding":1,"icon-allow-overlap":!1,"symbol-sort-key":["*",-1,["get","ele"]]},minzoom:8,source:"openmaptiles","source-layer":"mountain_peak"},I5=[{description:"Peak",layers:[gx.id]}];var E5=[{name:"Populated places",entries:v2},{name:"Borders",entries:C2},{name:"Roads",entries:[...fw,..._w,...xw]},{id:"shields",name:"Route markers",source:"Wikidata"},{name:"Railroads",entries:$w},{name:"Aerial lifts",entries:v5},{name:"Aviation",entries:Qw},{name:"Points of interest",entries:[...i5,...I5]},{name:"Structures",entries:s5},{name:"Land use",entries:[...w2,...o5,...T5]},{name:"Water",entries:[...d5,...f5]}];var k5=_p(P5(),1);var gn=class{constructor(E){this.id=E,this.sampleData=[]}getId(){return this.id}addSampleData(E){if(typeof E.getGeoJson!="function")throw"Samples must implement getGeoJson().";return this.sampleData.push(E),E}getSampleData(){return this.sampleData}getGeoJson(E){var F=[];return this.sampleData.forEach(H=>{H.getGeoJson(E).features.forEach((V,o)=>{F.push(V)})}),{type:"FeatureCollection",features:F}}};var xf=class{constructor(E={}){this.samples={},this.options=E,this.options.permalinks?this.permalinks=!0:this.permalinks=!1}addSample(E){if(typeof E.getId!="function")throw"Samples must implement getId().";if(typeof E.getName!="function")throw"Samples must implement getName().";if(typeof E.getDescription!="function")throw"Samples must implement getDescription().";if(typeof E.getLayers!="function")throw"Samples must implement getLayers().";return this.samples[E.getId()]=E,E}onAdd(E){this._map=E,this._container=document.createElement("div"),this._container.className="maplibregl-ctrl mapboxgl-ctrl openmapsamples-control-container";var F=document.createElement("div");return F.className="maplibregl-ctrl-group mapboxgl-ctrl-group",this._container.appendChild(F),this._button=document.createElement("button"),this._button.className="openmapsamples-control-button",F.appendChild(this._button),this._button.textContent="Samples",this._button.onclick=this.showControls.bind(this),this._controls=document.createElement("div"),this._controls.className="openmapsamples-control-overlay",this._container.appendChild(this._controls),this._closer=document.createElement("button"),this._closer.className="openmapsamples-control-closer",this._controls.appendChild(this._closer),this._closer.textContent="\xD7",this._closer.onclick=this.hideControls.bind(this),this._title=document.createElement("h2"),this._title.className="openmapsamples-control-title",this._controls.appendChild(this._title),this._title.textContent="Samples",this.hideControls(),this.permalinks&&(setTimeout(this.setStateFromUrl.bind(this),2e3),window.addEventListener("popstate",this.setStateFromUrl.bind(this))),this._container}onRemove(){this._container.parentNode.removeChild(this._container),this._map=void 0}showControls(){this._button.style.display="none",this._controls.style.display="block",this._samplesMenu||this.initializeSamplesMenu(),this._sampleControls||(this._sampleControls=document.createElement("div"),this._sampleControls.className="openmapsamples-sample-controls",this._controls.appendChild(this._sampleControls))}hideControls(){this._button.style.display="block",this._controls.style.display="none"}updatePermalink(){if(this.permalinks){var E=new URL(window.location.href);this.getActiveSampleId()?(E.searchParams.set("omss",this.getActiveSampleId()),E.searchParams.set("omsv",this.getActiveSampleVariantId())):(E.searchParams.delete("omss"),E.searchParams.delete("omsv"));var F={hash:E.hash,omss:this.getActiveSampleId(),omsv:this.getActiveSampleVariantId()};window.history.pushState(F,"oms",E)}}setStateFromUrl(){if(this.permalinks){let H=new URL(window.location.href);var E=null,F=null;let o=window.location.hash.replace("#","").split("/");(o.length===3||o.length===4)&&(E=parseFloat(o[0]),F=[parseFloat(o[2]),parseFloat(o[1])]);let pe=H.searchParams.get("omss");if(pe){this.showControls(),this.setActiveSampleId(pe);let Ne=H.searchParams.get("omsv");Ne&&this.setActiveSampleVariantId(Ne)}else this.getActiveSampleId()&&this.clearDisplayedSample();pe&&E&&this._map.setZoom(E),pe&&F&&this._map.setCenter(F)}}initializeSamplesMenu(){this._samplesMenu=document.createElement("select"),this._samplesMenu.className="openmapsamples-control-samples-menu",this._controls.appendChild(this._samplesMenu),this._chooseOrClear=document.createElement("option"),this._chooseOrClear.value="",this._chooseOrClear.textContent="Choose a Sample...",this._samplesMenu.appendChild(this._chooseOrClear);for(let H in this.samples){var E=this.samples[H],F=document.createElement("option");F.value=H,F.textContent=E.getName(),this._samplesMenu.appendChild(F)}this._samplesMenu.onchange=this.chooseSample.bind(this)}getActiveSampleId(){return this._samplesMenu?this._samplesMenu.value:null}getActiveSampleVariantId(){return this._variantSelect?this._variantSelect.value:null}setActiveSampleId(E){this._samplesMenu.value=E,this.chooseSample()}setActiveSampleVariantId(E){this._variantSelect&&(this._variantSelect.value=E,this.changeVariant(this.samples[this.getActiveSampleId()]))}chooseSample(){this.getActiveSampleId()==""?(this.clearDisplayedSample(),this._chooseOrClear.textContent="Choose a Sample...",this.updatePermalink()):(this.displaySample(this.samples[this.getActiveSampleId()]),this._chooseOrClear.textContent="Clear...",this.updatePermalink())}displaySample(E){this._sampleControls.innerHTML="";var F=document.createElement("label");F.htmlFor="openmapsamples-variant-select",F.textContent="Variants: ",this._sampleControls.appendChild(F),this._previousVariantButton=document.createElement("button"),this._previousVariantButton.className="openmapsamples-variant-increment",this._previousVariantButton.id="openmapsamples-variant-previous",this._previousVariantButton.textContent="\u25C0\uFE0E",this._previousVariantButton.onclick=this.decrementVariant.bind(this,E),this._sampleControls.appendChild(this._previousVariantButton),this._variantSelect=document.createElement("select"),this._variantSelect.className="openmapsamples-variant-select",this._variantSelect.id="openmapsamples-variant-select",this._sampleControls.appendChild(this._variantSelect),this.variant=E.getZoom();let H=E.getZoomVariants();var V=Object.keys(H);V.sort((pe,Ne)=>
1427pe-Ne),V.forEach(pe=>{var Ne=document.createElement("option");Ne.value=pe,Ne.textContent="z="+pe,this._variantSelect.appendChild(Ne)}),this._variantSelect.value=this.variant,this._variantSelect.onchange=this.changeVariant.bind(this,E),this._nextVariantButton=document.createElement("button"),this._nextVariantButton.className="openmapsamples-variant-increment",this._nextVariantButton.id="openmapsamples-variant-next",this._nextVariantButton.textContent="\u25BA",this._nextVariantButton.onclick=this.incrementVariant.bind(this,E),this._sampleControls.appendChild(this._nextVariantButton);var o=document.createElement("div");o.className="openmapsamples-sample-description",o.innerHTML=E.getDescription(),this._sampleControls.appendChild(o),this.restoreOriginalStyle(),this.saveOriginalStyle(),this.replaceStyleWithSampleData(E),this._map.setCenter(E.getCenter()),this._map.setZoom(E.getZoom())}clearDisplayedSample(){this._sampleControls.innerHTML="",this.restoreOriginalStyle()}saveOriginalStyle(){this.originalStyle||(this.originalStyle=this._map.getStyle(),this.originalCenter=this._map.getCenter(),this.originalZoom=this._map.getZoom())}restoreOriginalStyle(){this.originalStyle&&(this._map.setCenter(this.originalCenter),this._map.setZoom(this.originalZoom),this._map.setStyle(this.originalStyle),delete this.originalStyle)}replaceStyleWithSampleData(E){var F=this,H=this._map.getStyle();(0,k5.addProtocol)("openmapsamples-"+E.getId(),(o,pe)=>{let Qe=o.url.split("/")[2],ct=F.getSampleZoom(E);if(E.hasLayer(Qe))var Ze=E.getLayer(Qe).getGeoJson(ct);else var Ze=new gn().getGeoJson(ct);return pe(null,Ze)});var V=[];for(let o of H.layers){let pe=o.id,Ne=o.source,Qe=o["source-layer"];if(pe&&Ne&&Qe){V.push(Ne);let ct="openmapsamples-"+E.getId()+"-"+Qe;H.sources[ct]={type:"geojson",data:`openmapsamples-${E.getId()}://${Qe}`},o.source=ct,delete o["source-layer"]}}for(let o in V)delete H.sources[o];this._map.setStyle(H)}getSampleZoom(E){let F=E.getZoomVariants();return F&&F[this.variant]?this.variant:E.getZoom()}changeVariant(E){this.variant!=this._variantSelect.value&&(this.variant=this._variantSelect.value,this.restoreOriginalStyle(),this.saveOriginalStyle(),this.replaceStyleWithSampleData(E),this._map.setCenter(E.getZoomVariantCenter(this.variant)),this._map.setZoom(this.variant),this.updatePermalink())}decrementVariant(E){this._variantSelect.selectedIndex>0&&(this._variantSelect.selectedIndex=this._variantSelect.selectedIndex-1,this.changeVariant(E))}incrementVariant(E){this._variantSelect.selectedIndex<this._variantSelect.options.length-1&&(this._variantSelect.selectedIndex=this._variantSelect.selectedIndex+1,this.changeVariant(E))}};var da=class{constructor(E,F,H="",V=[0,0],o=1){this.id=E,this.name=F,this.description=H,this.samples=[],this.setCenter(V),this.setZoom(o),this.variants={},this.layers={}}getId(){return this.id}getName(){return this.name}getDescription(){return this.description}setCenter(E){if(typeof E!="object")throw"center must be an Array of [lon, lat] format.";if(typeof E[0]!="number")throw"center[0] must be a numeric longitude value.";if(typeof E[1]!="number")throw"center[1] must be a numeric latitude value.";this.center=E}setZoom(E){if(typeof E!="number"||E<0)throw"zoom must be a positive number.";this.zoom=E}setZoomVariant(E,F=null){Object.keys(this.variants).length===0&&(this.variants[this.getZoom()]={zoom:this.getZoom(),center:this.getCenter()}),F||(F=this.getCenter()),this.variants[E]={zoom:E,center:F}}getCenter(){return this.center}getZoom(){return this.zoom}getZoomVariants(){return Object.keys(this.variants).length===0&&this.setZoomVariant(this.getZoom(),this.getCenter()),this.variants}getZoomVariantCenter(E){let F=this.getZoomVariants();if(!F[E])throw console.log(F),"Unknown variant "+E+" in "+F;return F[E].center}addLayer(E){if(typeof E.getId!="function")throw"Layers must implement getId().";if(typeof E.getGeoJson!="function")throw"Layers must implement getGeoJson().";if(this.layers[E.getId()])throw"A layer already exists with id: "+E.getId();return this.layers[E.getId()]=E,E}removeLayer(E){if(!this.layers[E])throw"No layer exists with id: "+E;delete this.layers[E]}getLayer(E){if(!this.layers[E])throw"No layer exists with id: "+E;return this.layers[E]}hasLayer(E){return this.layers[E]}getLayers(){return this.layers}};var ld=class{constructor(E,F,H){this.rows=E,this.columns=F,this.center=H,this.rowHeightMultiplier=20,this.columnWidthMultiplier=20}getGeoJson(E){var F=[];for(let H in this.rows)for(let V in this.columns)F.push(this.getFeature(H,V,E));return{type:"FeatureCollection",features:F}}getFeatureProperties(E,F,H){return{...this.rows[E],...this.columns[F]}}getFeature(E,F,H){return{type:"Feature",geometry:this.getFeatureGeometry(E,F,H),properties:this.getFeatureProperties(E,F,H)}}getColumnOffset(E){let F=this.columns.length/2;return E-F}getRowOffset(E){let F=this.rows.length/2;return(E-F)*-1}getColumnWidth(E,F,H){return typeof this.columnWidthCallback=="function"?this.columnWidthCallback(E,F,H):this.columnWidthMultiplier/H/Math.pow(2,E-4)}getRowHeight(E,F,H){return typeof this.rowHeightCallback=="function"?this.rowHeightCallback(E,F,H):this.rowHeightMultiplier/H/Math.pow(2,E-4)}setColumnWidthCallback(E){if(typeof E!="function")throw"Callback must be a function.";this.columnWidthCallback=E}setRowHeightCallback(E){if(typeof E!="function")throw"Callback must be a function.";this.rowHeightCallback=E}};var ma=class extends ld{constructor(E,F,H){super(E,F,H),this.rowHeightMultiplier=20,this.columnWidthMultiplier=36}getFeatureGeometry(E,F,H){return{type:"LineString",coordinates:[[this.get
1427StartLon(E,F,H),this.getStartLat(E,F,H)],[this.getEndLon(E,F,H),this.getEndLat(E,F,H)]]}}getStartLon(E,F,H){return this.center[0]+this.getColumnOffset(F)*this.getColumnWidth(H,F,this.columns.length)}getEndLon(E,F,H){return this.getStartLon(E,F,H)+this.getColumnWidth(H,F,this.columns.length)}getStartLat(E,F,H){return this.center[1]+this.getRowOffset(E)*this.getRowHeight(H,E,this.rows.length)}getEndLat(E,F,H){return this.getStartLat(E,F,H)}};var go=class{constructor(E,F={}){this.sampleData=E,this.propertyMapping=F}getGeoJson(E){var F=this.sampleData.getGeoJson(E);return F.features.forEach(H=>{this.copyPropertiesInFeature(H)}),F}copyPropertiesInFeature(E){if(this.propertyMapping)for(let F in this.propertyMapping)E.properties[F]&&this.propertyMapping[F].forEach(V=>{E.properties[V]=E.properties[F]})}};var Qr=class{constructor(E,F=[]){this.sampleData=E,this.propertiesToRemove=F}getGeoJson(E){var F=this.sampleData.getGeoJson(E);return F.features.forEach(H=>{this.removePropertiesInFeature(H)}),F}removePropertiesInFeature(E){this.propertiesToRemove.length&&this.propertiesToRemove.forEach(F=>{E.properties[F]&&delete E.properties[F]})}};var bf=new da("highway-attributes","Highway Attributes",'A grid of highways showing possible attribute combinations. (<a href="https://github.com/adamfranco/OpenMapSamples/blob/main/samples/OpenMapTiles/HighwayAttributes.js">source</a>)',[0,0],15),A5=new ma([{name:"motorway",class:"motorway"},{name:"trunk",class:"trunk"},{name:"trnk expy",class:"trunk",expressway:1},{name:"primary",class:"primary"},{name:"pri expy",class:"primary",expressway:1},{name:"secondary",class:"secondary"},{name:"sec expy",class:"secondary",expressway:1},{name:"tertiary",class:"tertiary"},{name:"ter expy",class:"tertiary",expressway:1},{name:"minor",class:"minor"},{name:"service",class:"service"},{name:"driveway",class:"service",service:"driveway"},{name:"alley",class:"service",service:"alley"},{name:"parking_aisle",class:"service",service:"parking_aisle"},{name:"raceway",class:"raceway"},{name:"track",class:"track"},{name:"path",class:"path",subclass:"path"},{name:"cycleway",class:"path",subclass:"cycleway"},{name:"bridleway",class:"path",subclass:"bridleway"},{name:"footway",class:"path",subclass:"footway"},{name:"steps",class:"path",subclass:"steps"}],[{},{name:"bridge",brunnel:"bridge",layer:1},{name:"tunnel",brunnel:"tunnel",layer:-1},{name:"ford",brunnel:"ford"},{name:"oneway",oneway:1},{name:"paved",surface:"paved"},{name:"unpaved",surface:"unpaved"}],[0,0]);bf.addLayer(new gn("transportation")).addSampleData(new Qr(A5,["name"]));bf.addLayer(new gn("transportation_name")).addSampleData(new go(new Qr(A5,["brunnel","layer","surface","expressway","oneway"]),{name:["name_en","name_de","name_int","name:latin"]}));for(vf=4;vf<=20;vf=vf+1)bf.setZoomVariant(vf);var vf;var Tf=new da("highway-construction-attributes","Highway Construction Attributes",'A grid of highways under construction showing possible attribute combinations. (<a href="https://github.com/adamfranco/OpenMapSamples/blob/main/samples/OpenMapTiles/HighwayConstructionAttributes.js">source</a>)',[0,0],15),z5=new ma([{name:"motorway",class:"motorway_construction"},{name:"trunk",class:"trunk_construction"},{name:"trnk expy",class:"trunk_construction",expressway:1},{name:"primary",class:"primary_construction"},{name:"pri expy",class:"primary_construction",expressway:1},{name:"secondary",class:"secondary_construction"},{name:"sec expy",class:"secondary_construction",expressway:1},{name:"tertiary",class:"tertiary_construction"},{name:"ter expy",class:"tertiary_construction",expressway:1},{name:"minor",class:"minor_construction"},{name:"service",class:"service_construction"},{name:"driveway",class:"service_construction",service:"driveway"},{name:"alley",class:"service_construction",service:"alley"},{name:"parking_aisle",class:"service_construction",service:"parking_aisle"},{name:"raceway",class:"raceway_construction"},{name:"track",class:"track_construction"},{name:"path",class:"path_construction",subclass:"path"},{name:"cycleway",class:"path_construction",subclass:"cycleway"},{name:"bridleway",class:"path_construction",subclass:"bridleway"},{name:"footway",class:"path_construction",subclass:"footway"},{name:"steps",class:"path_construction",subclass:"steps"}],[{},{name:"bridge",brunnel:"bridge",layer:1},{name:"tunnel",brunnel:"tunnel",layer:-1},{name:"ford",brunnel:"ford"},{name:"oneway",oneway:1},{name:"paved",surface:"paved"},{name:"unpaved",surface:"unpaved"}],[0,0]);Tf.addLayer(new gn("transportation")).addSampleData(new Qr(z5,["name"]));Tf.addLayer(new gn("transportation_name")).addSampleData(new go(new Qr(z5,["brunnel","layer","surface","expressway","oneway"]),{name:["name_en","name_de","name_int","name:latin"]}));for(wf=4;wf<=20;wf=wf+1)Tf.setZoomVariant(wf);var wf;var If=new da("highway-link-attributes","Highway Link Attributes",'A grid of highways and links showing possible attribute combinations. (<a href="https://github.com/adamfranco/OpenMapSamples/blob/main/samples/OpenMapTiles/HighwayLinkAttributes.js">source</a>)',[0,0],15),D5=new ma([{name:"motorway",class:"motorway"},{name:"moto link",class:"motorway",ramp:1},{name:"trunk",class:"trunk"},{name:"trnk expy",class:"trunk",expressway:1},{name:"trnk link",class:"trunk",ramp:1},{name:"primary",class:"primary"},{name:"pri expy",class:"primary",expressway:1},{name:"pri link",class:"primary",ramp:1},{name:"secondary",class:"secondary"},{name:"sec expy",class:"secondary",expressway:1},{name:"sec link",class:"secondary",ramp:1},{name:"tertiary",class:"tertiary"},{name:"ter expy",class:"tertiary",expressway:1},{name:"ter link",class:"tertiary",ramp:1},{name:"minor",class:"minor"},{name:"service",class:"service"}],[{},{name:"bridge",brunnel:"bridge",layer:1},{name:"tunnel",brunnel:"tunnel",layer:-1},{name:"ford",brunnel:"ford"},{name:"oneway",oneway:1},{name:"paved",surface:"paved"},{name:"unpaved",surface:"unpaved"}],[0,0]);If.addLayer(new gn("transportation")).addSampleData(new Qr(D5,["name"]));If.addLayer(new gn("transportation_name")).addSampleData(new go(new Qr(D5,["brunnel","layer","surface","expressway","oneway"]),{name:["name_en","name_de","name_int","name:latin"]}));for(Sf=4;Sf<=20;Sf=Sf+1)If.setZoomVariant(Sf);var Sf;var Ef=new da("highway-toll-attributes","Highway Toll Attributes",'A grid of highways and links showing possible attribute combinations with toll=1. The left side is standard, the right side is toll=1. (<a href="https://github.com/adamfranco/OpenMapSamples/blob/main/samples/OpenMapTiles/HighwayTollAttributes.js">source</a>)',[0,0],15),L5=new ma([{name:"motorway",class:"motorway"},{name:"moto link",class:"motorway",ramp:1},{name:"trunk",class:"trunk"},{name:"trnk expy",class:"trunk",expressway:1},{name:"trnk link",class:"trunk",ramp:1},{name:"primary",class:"primary"},{name:"pri expy",class:"primary",expressway:1},{name:"pri link",class:"primary",ramp:1},{name:"secondary",class:"secondary"},{name:"sec expy",class:"secondary",expressway:1},{name:"sec link",class:"secondary",ramp:1},{name:"tertiary",class:"tertiary"},{name:"ter expy",class:"tertiary",expressway:1},{name:"ter link",class:"tertiary",ramp:1},{name:"minor",class:"minor"},{name:"service",class:"service"}],[{},{name:"bridge",brunnel:"bridge",layer:1},{name:"tunnel",brunnel:"tunnel",layer:-1},{name:"ford",brunnel:"ford"},{name:"oneway",oneway:1},{name:"paved",surface:"paved"},{name:"unpaved",surface:"unpaved"},{name:"toll",toll:1},{name:"bridge",brunnel:"bridge",layer:1,toll:1},{name:"tunnel",brunnel:"tunnel",layer:-1,toll:1},{name:"ford",brunnel:"ford",toll:1},{name:"oneway",oneway:1,toll:1},{name:"paved",surface:"paved",toll:1},{name:"unpaved",surface:"unpaved",toll:1}],[0,0]);Ef.addLayer(new gn("transportation")).addSampleData(new Qr(L5,["name"]));Ef.addLayer(new gn("transportation_name")).addSampleData(new go(new Qr(L5,["brunnel","layer","surface","expressway","oneway"]),{name:["name_en","name_de","name_int","name:latin"]}));for(Cf=4;Cf<=20;Cf=Cf+1)Ef.setZoomVariant(Cf);var Cf;var Tu=class extends ma{constructor(E,F,H){super(F,E,H),this.rowHeightMultiplier=30,this.columnWidthMultiplier=20}getGeoJson(E){var F=[];for(let H in this.columns)for(let V in this.rows)F.push(this.getFeature(V,H,E));return{type:"FeatureCollection",features:F}}getFeatureProperties(E,F,H){return{...this.columns[F],...this.rows[E]}}
1427getEndLon(E,F,H){return this.getStartLon(E,F,H)}getEndLat(E,F,H){return this.getStartLat(E,F,H)-this.getRowHeight(H,E,this.rows.length)}};var Pf=new da("highway-intersections","Highway Intersections",'A grid of highway intesections for each class. (<a href="https://github.com/adamfranco/OpenMapSamples/blob/main/samples/OpenMapTiles/HighwayIntersections.js">source</a>)',[0,0],15),R5=[{},{name:"motorway",class:"motorway"},{name:"trunk",class:"trunk"},{name:"trunk expressway",class:"trunk",expressway:1},{name:"primary",class:"primary"},{name:"primary expressway",class:"primary",expressway:1},{name:"secondary",class:"secondary"},{name:"secondary expressway",class:"secondary",expressway:1},{name:"tertiary",class:"tertiary"},{name:"tertiary expressway",class:"tertiary",expressway:1},{name:"minor",class:"minor"},{name:"service",class:"service"},{name:"driveway",class:"service",service:"driveway"},{name:"alley",class:"service",service:"alley"},{name:"parking_aisle",class:"service",service:"parking_aisle"}],F5=new ma(R5,[{},{name:""},{name:""},{name:""},{name:""}],[0,0]),B5=new Tu(R5,[{},{name:""},{name:""},{name:""},{name:""}],[0,0]),O5=Pf.addLayer(new gn("transportation"));O5.addSampleData(new Qr(F5,["name"]));O5.addSampleData(new Qr(B5,["name"]));var V5=Pf.addLayer(new gn("transportation_name"));V5.addSampleData(new go(new Qr(F5,["brunnel","layer","surface","expressway","oneway"]),{name:["name_en","name_de","name_int","name:latin"]}));V5.addSampleData(new go(new Qr(B5,["brunnel","layer","surface","expressway","oneway"]),{name:["name_en","name_de","name_int","name:latin"]}));for(Mf=4;Mf<=20;Mf=Mf+1)Pf.setZoomVariant(Mf);var Mf;var Af=new da("highway-link-intersections","Highway Link Intersections",'A grid of highway intesections for each class and link. (<a href="https://github.com/adamfranco/OpenMapSamples/blob/main/samples/OpenMapTiles/HighwayLinkIntersections.js">source</a>)',[0,0],15),N5=[{},{name:"motorway",class:"motorway"},{name:"motorway link",class:"motorway",ramp:1},{name:"trunk",class:"trunk"},{name:"trunk expressway",class:"trunk",expressway:1},{name:"trunk link",class:"trunk"},{name:"primary",class:"primary"},{name:"primary expressway",class:"primary",expressway:1},{name:"primary link",class:"primary",ramp:1},{name:"secondary",class:"secondary"},{name:"secondary expressway",class:"secondary",expressway:1},{name:"secondary link",class:"secondary",ramp:1},{name:"tertiary",class:"tertiary"},{name:"tertiary expressway",class:"tertiary",expressway:1},{name:"tertiary link",class:"tertiary",ramp:1},{name:"minor",class:"minor"},{name:"service",class:"service"}],U5=new ma(N5,[{},{name:""},{name:""},{name:""},{name:""}],[0,0]),j5=new Tu(N5,[{},{name:""},{name:""},{name:""},{name:""}],[0,0]),q5=Af.addLayer(new gn("transportation"));q5.addSampleData(new Qr(U5,["name"]));q5.addSampleData(new Qr(j5,["name"]));var $5=Af.addLayer(new gn("transportation_name"));$5.addSampleData(new go(new Qr(U5,["brunnel","layer","surface","expressway","oneway"]),{name:["name_en","name_de","name_int","name:latin"]}));$5.addSampleData(new go(new Qr(j5,["brunnel","layer","surface","expressway","oneway"]),{name:["name_en","name_de","name_int","name:latin"]}));for(kf=4;kf<=20;kf=kf+1)Af.setZoomVariant(kf);var kf;var Df=new da("highway-bridge-tunnel","Highway Bridge & Tunnel",'A grid of highways at different bridge and tunnel layers. Rows are <code>highway=motorway</code> while columns are <code>highway=primary</code> (<a href="https://github.com/adamfranco/OpenMapSamples/blob/main/samples/OpenMapTiles/HighwayBridgeAndTunnel.js">source</a>)',[0,0],15),G5=new ma([{name:"bridge layer=-1",class:"motorway",layer:-1,brunnel:"bridge"},{name:"bridge layer=0",class:"motorway",layer:0,brunnel:"bridge"},{name:"bridge layer=1",class:"motorway",layer:1,brunnel:"bridge"},{name:"bridge layer=2",class:"motorway",layer:2,brunnel:"bridge"},{name:"tunnel layer=-1",class:"motorway",layer:-1,brunnel:"tunnel"},{name:"tunnel layer=0",class:"motorway",layer:0,brunnel:"tunnel"},{name:"tunnel layer=1",class:"motorway",layer:1,brunnel:"tunnel"},{name:"tunnel layer=2",class:"motorway",layer:2,brunnel:"tunnel"},{name:"normal layer=-1",class:"motorway",layer:-1},{name:"normal layer=0",class:"motorway",layer:0},{name:"normal layer=1",class:"motorway",layer:1},{name:"normal layer=2",class:"motorway",layer:2}],[{},{name:""},{name:""},{name:""},{name:""},{name:""}],[0,0]),Z5=new Tu([{name:"bridge layer=-1",class:"primary",layer:-1,brunnel:"bridge"},{name:"bridge layer=0",class:"primary",layer:0,brunnel:"bridge"},{name:"bridge layer=1",class:"primary",layer:1,brunnel:"bridge"},{name:"bridge layer=2",class:"primary",layer:2,brunnel:"bridge"},{name:"tunnel layer=-1",class:"primary",layer:-1,brunnel:"tunnel"},{name:"tunnel layer=0",class:"primary",layer:0,brunnel:"tunnel"},{name:"tunnel layer=1",class:"primary",layer:1,brunnel:"tunnel"},{name:"tunnel layer=2",class:"primary",layer:2,brunnel:"tunnel"},{name:"normal layer=-1",class:"primary",layer:-1},{name:"normal layer=0",class:"primary",layer:0},{name:"normal layer=1",class:"primary",layer:1},{name:"normal layer=2",class:"primary",layer:2}],[{},{name:""},{name:""},{name:""},{name:""},{name:""}],[0,0]),W5=Df.addLayer(new gn("transportation"));W5.addSampleData(new Qr(G5,["name"]));W5.addSampleData(new Qr(Z5,["name"]));var H5=Df.addLayer(new gn("transportation_name"));H5.addSampleData(new go(new Qr(G5,["brunnel","layer","surface","expressway","oneway"]),{name:["name_en","name_de","name_int","name:latin"]}));H5.addSampleData(new go(new Qr(Z5,["brunnel","layer","surface","expressway","oneway"]),{name:["name_en","name_de","name_int","name:latin"]}));for(zf=4;zf<=20;zf=zf+1)Df.setZoomVariant(zf);var zf;var Lf=class extends ld{constructor(E,F,H){super(E,F,H),this.rowHeightMultiplier=40,this.columnWidthMultiplier=40}getFeatureGeometry(E,F,H){return{type:"Point",coordinates:[this.getLon(E,F,H),this.getLat(E,F,H)]}}getLon(E,F,H){return this.center[0]+this.getColumnOffset(F)*this.getColumnWidth(H,F,this.columns.length)}getLat(E,F,H){return this.center[1]+this.getRowOffset(E)*this.getRowHeight(H,E,this.rows.length)}};var R_=new da("places","Places",'A grid of <a href="https://openmaptiles.org/schema/#place">places</a>, modified by rank. (<a href="https://github.com/adamfranco/OpenMapSamples/blob/main/samples/OpenMapTiles/Places.js">source</a>)',[0,0],8),X5=new Lf([{name:"continent",class:"continent"},{name:"country",class:"country"},{name:"state",class:"state"},{name:"province",class:"province"},{name:"capital city 2",class:"city",capital:2},{name:"capital city 4",class:"city",capital:4},{name:"city",class:"city"},{name:"town",class:"town"},{name:"village",class:"village"},{name:"hamlet",class:"hamlet"},{name:"suburb",class:"suburb"},{name:"quarter",class:"quarter"},{name:"neighbourhood",class:"neighbourhood"},{name:"isolated_dwelling",class:"isolated_dwelling"}],[{},{name:"rank 1",rank:1},{name:"rank 2",rank:2},{name:"rank 3",rank:3},{name:"rank 4",rank:4},{name:"rank 5",rank:5},{name:"rank 6",rank:6},{name:"rank 7",rank:7},{name:"rank 8",rank:8},{name:"rank 9",rank:9},{name:"rank 10",rank:10},{name:"rank 11",rank:11},{name:"rank 12",rank:12},{name:"rank 13",rank:13},{name:"rank 14",rank:14},{name:"rank 15",rank:15},{name:"rank 16",rank:16},{name:"rank 17",rank:17},{name:"rank 18",rank:18},{name:"rank 19",rank:19},{name:"rank 20",rank:20}],[0,0]);X5.columnWidthMultiplier=60;R_.addLayer(new gn("place")).addSampleData(new go(X5,{name:["name_en","name_de","name_int","name:latin"]}));for(Rf=0;Rf<=20;Rf=Rf+1)R_.setZoomVariant(Rf);var Rf;var K5=[bf,Tf,If,Ef,Pf,Af,Df,R_];var Y5=O=>O&&O.startsWith("shield"),J5=O=>
1427!/^[lrni][chimpw]n$/.test(O),Q5={parse:O=>Ag(O),format:(O,E,F)=>`shield 1428${O} 1429${E} 1430${F} 1431`};var kM=_p(id(),1);function e3(O,E,F){try{lC(O,E,F)}catch(H){console.error(`Exception while loading image \u2018${F?.id}\u2019: 1432`,H)}}function lC(O,E,F){let H=F.id.split(` 1433`)[1].split("=")[1],V=F.id.split(` 1434`)[2].split("=")[1],o=E.style.getImage(H);if(!o){console.error(`No such sprite ${H}`);return}let pe=o.data.width,Ne=o.data.height,Qe=O.createGraphics({width:pe,height:Ne});r0(Qe,o,0,!1,V),Qe==null&&(console.warn("Didn't produce an icon for",JSON.stringify(F.id)),Qe=O.createGraphics({width:1,height:1}));let ct=Qe.getImageData(0,0,Qe.canvas.width,Qe.canvas.height);E.addImage(F.id,{width:Qe.canvas.width,height:Qe.canvas.height,data:ct.data},{pixelRatio:O.pixelRatio()})}var xx=ea,t3={id:"background",type:"background",paint:{"background-color":xx},layout:{visibility:"visible"}},i3={id:"pier_area",type:"fill",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["get","class"],"pier"],["==",["geometry-type"],"Polygon"]],paint:{"fill-color":xx},layout:{visibility:"visible"}},r3={id:"pier_line",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["get","class"],"pier"],["==",["geometry-type"],"LineString"]],paint:{"line-color":xx,"line-width":{base:1.7,stops:[[14,1],[20,20]]}},layout:{"line-cap":"butt",visibility:"visible"}};var Ff={id:"hillshading",type:"hillshade",source:"dem",layout:{visibility:"none"},paint:{"hillshade-exaggeration":["interpolate",["linear"],["zoom"],12,.5,17,.3],"hillshade-shadow-color":Gb,"hillshade-highlight-color":Zb}};var vx=["match",["get","class"]],bx=["all",["==",["get","oneway"],1],["!=",["get","ramp"],1],["in",["get","class"],["literal",["motorway","trunk","primary","secondary","tertiary","busway","minor","service"]]]],F_={id:"oneway_surface",filter:[...bx,["!",["in",["get","brunnel"],["literal",["bridge","tunnel"]]]]],source:"openmaptiles","source-layer":"transportation",type:"symbol",minzoom:15,layout:{"icon-size":["interpolate",["exponential",1.2],["zoom"],15,[...vx,["motorway","trunk","primary"],.5,.3],19,[...vx,["motorway","trunk","primary"],1,"secondary",.8,.6]],"icon-image":["match",["get","brunnel"],"tunnel","oneway_black",["match",["get","toll"],1,"oneway_black",[...vx,"motorway","oneway_white","oneway_black"]]],visibility:"visible","icon-padding":2,"symbol-spacing":["interpolate",["exponential",1.2],["zoom"],15,75,19,300],"symbol-placement":"line","icon-rotation-alignment":"map"},paint:{"icon-opacity":.5}},n3={...F_,id:"oneway_tunnel",filter:[...bx,["==",["get","brunnel"],"tunnel"]],paint:{"icon-opacity":.2}},o3={...F_,id:"oneway_bridge",filter:[...bx,["==",["get","brunnel"],"bridge"]]};var _o=["match",["get","class"]],Bf=["motorway","trunk"],c3=[...Bf,"primary"],Of=[...c3,"secondary","tertiary","busway"],h3=[...Of,"minor"],a3=[...h3,"service"],s3=["motorway_construction","trunk_construction"],l3=["primary_construction","secondary_construction","tertiary_construction","minor_construction","service_construction"],u3={id:"road_label",type:"symbol",paint:{"text-color":[..._o,s3,"maroon",l3,"slategray","ferry",sm,"aerialway",n2,"#333"],"text-halo-color":["step",["zoom"],[..._o,"ferry",yu,ea],16,[..._o,"ferry",yu,Bf,"white",ea],17,[..._o,"ferry",yu,Of,"white",ea],18,[..._o,"ferry",yu,"white"]],"text-halo-blur":.5,"text-halo-width":2,"text-opacity":["step",["zoom"],[..._o,"motorway",1,0],10,[..._o,Bf,1,0],11,[..._o,c3,1,"ferry",1,0],12,[..._o,Of,1,["ferry","aerialway"],1,0],13,[..._o,h3,1,["ferry","aerialway"],1,0],14,[..._o,a3,1,["ferry","aerialway"],1,0],15,1]},filter:["in",["get","class"],["literal",[...a3,...s3,...l3,"ferry","aerialway"]]],layout:{"text-font":[..._o,["ferry","aerialway"],["literal",["Americana-Italic"]],["literal",["Americana-Regular"]]],"text-field":[...Gm],"text-max-angle":20,"symbol-placement":"line","text-size":["step",["zoom"],12,16,[..._o,Bf,10,12],17,[..._o,["secondary","tertiary","busway"],10,12],18,[..._o,["ferry","aerialway",...Of],12,10]],"text-anchor":["step",["zoom"],[..._o,"aerialway","center","bottom"],16,[..._o,"aerialway","center",Bf,"center","bottom"],17,[..._o,"aerialway","center",Of,"center","bottom"],18,"center"],"text-offset":["interpolate",["exponential",1.2],["zoom"],15,[..._o,"aerialway",["literal",[0,-.7]],["literal",[0,0]]],16,[..._o,"aerialway",["literal",[0,-.9]],["literal",[0,0]]],20,[..._o,"aerialway",["literal",[0,-1.5]],["literal",[0,0]]]],"symbol-sort-key":[..._o,"aerialway",0,"motorway",1,"trunk",2,["primary","ferry"],3,"
1434secondary",4,["tertiary","minor","busway"],5,6]},source:"openmaptiles","source-layer":"transportation_name"},p3={id:"bridge_spacer",type:"symbol",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["get","brunnel"],"bridge"],["in",["geometry-type"],["literal",["LineString"]]],["!=",["get","oneway"],1]],paint:{"icon-opacity":0},layout:{"symbol-placement":"line","symbol-spacing":2,"icon-image":"place_dot","icon-allow-overlap":!0,"icon-size":.1}};function d3(O){let E=[];E.push(t3,w0,dx,A_,Ww,ex,Q1,tx,jg,I0,qg,$g,Ff,yf,lx,Sp,sx,_f,mx,z_,Hw,ix,rx,nx,T0,S0,C0,E0,M0,i3,r3,Aw.dashes(),Dw.dashes(),Rw.dashes(),Bw.dashes(),Vw.dashes(),Uw.dashes(),qw.dashes(),S_.fill(),b1,p1.casing(),p1.fill(),n3,hx,H1,Xw,X1,Kw,y1.casing(),tw.casing(),F2.casing(),vu.casing(),um.casing(),d_.casing(),m1.casing(),f1.casing(),Cc.casing(),y1.fill(),V2.fill(),iw.fill(),rw.fill(),nw.fill(),ow.fill(),aw.fill(),sw.fill(),ef.fill(),w_.fill(),g1.fill(),f_.fill(),b_.fill(),m_.fill(),v_.fill(),p_.fill(),x_.fill(),d1.fill(),vu.fill(),u1.surface(),q1.dashes(),$1.dashes(),G1.dashes(),Z1.dashes(),I_.dashes(),C_.dashes(),W1.dashes(),yl.fill(),F_,px),E.push(ox);var F=[Pw,lw.casing(),x1.casing(),O2.casing(),Y2.casing(),H2.casing(),G2.casing(),j2.casing(),_1.casing(),B2.casing(),dw.fill(),mw.fill(),uw.fill(),pw.fill(),cw.fill(),hw.fill(),U2.fill(),x1.fill(),Q2.fill(),ew.fill(),J2.fill(),X2.fill(),K2.fill(),Z2.fill(),W2.fill(),q2.fill(),$2.fill(),N2.fill(),_1.fill(),R2.surface(),kw.dashes(),zw.dashes(),Lw.dashes(),Fw.dashes(),Ow.dashes(),Nw.dashes(),jw.dashes(),j1.fill(),o3];return E.push(...U1(F)),E.push(x5,ux,Gg,I2,h5,p3,u3,w5,J1,n5,u5,p5,E_,Yw,M_,Jw,K1,zg,w1,gx,Y1,t5,g0,f0,m0,d0,Og,Vg,Ng,_0,y0,x0,v0,b0),$y(E,O),E}function m3(O,E,F,H){return{name:"Americana",glyphs:F,layers:d3(H),sources:{openmaptiles:{url:O,type:"vector"},dem:{attribution:'<a target="_blank" rel="noopener" href="https://registry.opendata.aws/terrain-tiles/">Terrain Tiles</a>',type:"raster-dem",tiles:["https://s3.amazonaws.com/elevation-tiles-prod/terrarium/{z}/{x}/{y}.png"],encoding:"terrarium",tileSize:256,maxzoom:13}},sprite:E,light:{anchor:"viewport",color:"white",intensity:.12},version:8}}var wx=_p(id(),1);var f3=_p(id(),1);var B_=class extends f3.default.Map{get locales(){return Va()}set locales(E){Tg(this);let F=this.getLayoutProperty("peak","text-field");$m(F,"eleUnits",fx(E[0])),this.setLayoutProperty("peak","text-field",F),this.fire("americana.languagechange")}localize(){this.locales=Va()}get shadesHills(){return this.getLayoutProperty(Ff.id,"visibility")!=="none"}set shadesHills(E){Promise.resolve(this.style.loaded()||this.once("styledata")).then(()=>{this.setLayoutProperty(Ff.id,"visibility",E?"visible":"none"),this.fire("americana.terrain")})}};function g3(){var O=window.location,E=(O.protocol+"//"+O.host+gC(O.pathname)).replace(/\/+$/,"");return m3(Xl.OPENMAPTILES_URL,`${E}/sprites/sprite`,Xl.FONT_URL??"https://font.americanamap.org/{fontstack}/{range}.pbf",Va())}function gC(O){let E=O.lastIndexOf("/");return E===-1?O:O.substring(0,E+1)}function _3(){wx.default.setRTLTextPlugin("https://unpkg.com/@mapbox/[email protected]/mapbox-gl-rtl-text.min.js",!0)}function y3(O,E,F,H){O.maplibregl=wx.default;let V=O.map=new B_(F),o=new Vb("shields.json",Q5).debugOptions(H).filterImageID(Y5).filterNetwork(J5).renderOnMaplibreGL(V).onShieldDefLoad(E);return V.once("styledata",pe=>{let Ne=Zy(Va(),{uppercaseCountryNames:!0});for(let[Qe,ct]of Object.entries(Ne))V.setGlobalStateProperty(Qe,ct)}),V.on("styleimagemissing",function(pe){switch(pe.id.split(` 1435`)[0]){case"shield":break;case"poi":e3(o,V,pe);break;default:console.warn("Image id not recognized:",JSON.stringify(pe.id));break}}),V}var O_={};Xl.SHIELD_TEXT_HALO_COLOR_OVERRIDE&&(O_.shieldTextHaloColor=Xl.SHIELD_TEXT_HALO_COLOR_OVERRIDE);Xl.SHIELD_TEXT_BBOX_COLOR&&(O_.shieldTextBboxColor=Xl.SHIELD_TEXT_BBOX_COLOR);function v3(){let O=window.location.hash.substr(1);O.includes("=")||(O=`#map=${O}`),window.location.hash=O}v3();_3();var xl=y3(window,O=>_C(O),{container:"map",hash:"map",antialias:!0,style:g3(),center:[-94,40.5],zoom:4,attributionControl:!1,experimentalZoomLevelsToOverscale:0},O_),b3=new xf({permalinks:!0});
1435K5.forEach((O,E)=>{b3.addSample(O)});var Tx;function _C(O){Tx=new Xm(O),Tx.sections=E5,xl.addControl(Tx,"bottom-left"),xl.addControl(b3,"bottom-left"),window.top===window.self&&xl.getCanvas().focus();let E=new Ig;xl.addControl(new gm.AttributionControl(w3)),xl.addControl(E,"bottom-right"),xl.addControl(new Cg,"top-left"),xl.addControl(new gm.NavigationControl,"top-left"),xl.addControl(new gm.GlobeControl,"top-left"),xl.addControl(new Dg,"top-left"),window.addEventListener("languagechange",F=>{xl.localize()}),window.addEventListener("hashchange",F=>{v3(),x3(new URL(F.oldURL),new URL(F.newURL))}),xl.once("styledata",()=>{x3(null,window.location)}),window.LIVE_RELOAD&&new EventSource("/esbuild").addEventListener("change",()=>location.reload())}function x3(O,E){let F=new URLSearchParams(O?.hash.substr(1)),H=new URLSearchParams(E.hash.substr(1));(F.get("language")||null)!==(H.get("language")||null)&&xl.localize(),(F.get("projection")||null)!==(H.get("projection")||null)&&xl.setProjection({type:H.get("projection")||"mercator"}),F.has("terrain")!==H.has("terrain")&&(xl.shadesHills=H.has("terrain"))}var w3={customAttribution:""};Xl.ATTRIBUTION_TEXT!=null&&(w3={customAttribution:Xl.ATTRIBUTION_TEXT});Xl.ATTRIBUTION_LOGO!=null&&(document.getElementById("attribution-logo").innerHTML=Xl.ATTRIBUTION_LOGO);export{xl as map}; 1436/*! Bundled license information: 1437 1438maplibre-gl/dist/maplibre-gl.js: 1439 (** 1440 * MapLibre GL JS 1441 * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v5.24.0/LICENSE.txt 1442 *) 1443*/ 1444//# sourceMappingURL=americana.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.