PageSourceSearch

https://fcr.ca/wp-content/themes/fcrtheme/dist/build.js?ver=1790931408

js fcr.ca collected 2026-10-02 10:36:19 UTC 1,850,434 bytes, 2 lines download raw bytes

1/*! For license information please see build.js.LICENSE.txt */
2!function(){var e={62:function(e,t,i){"use strict";i(629)("trimLeft",function(e){return function(){return e(this,1)}},"trimStart")},107:function(e,t,i){"use strict";var n=i(4228),r=i(3048),o="number";e.exports=function(e){if("string"!==e&&e!==o&&"default"!==e)throw TypeError("Incorrect hint");return r(n(this),e!=o)}},128:function(e){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},157:function(e,t,i){var n=i(7087),r=Math.max,o=Math.min;e.exports=function(e,t){return(e=n(e))<0?r(e+t,0):o(e,t)}},177:function(e,t,i){"use strict";var n=i(2127),r=i(1485),o=i(8942),s="startsWith",a=""[s];n(n.P+n.F*i(5203)(s),"String",{startsWith:function(e){var t=o(this,e,s),i=r(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),n=String(e);return a?a.call(t,n,i):t.slice(i,i+n.length)===n}})},179:function(e,t,i){!function(t,n){e.exports?e.exports=n(i(4831),i(7943)):n(t.Flickity,t.imagesLoaded)}("undefined"!=typeof window?window:this,function(e,t){return e.create.imagesLoaded=function(){this.on("activate",this.imagesLoaded)},e.prototype.imagesLoaded=function(){this.options.imagesLoaded&&t(this.slider).on("progress",(e,t)=>{let i=this.getParentCell(t.img);this.cellSizeChange(i&&i.element),this.options.freeScroll||this.positionSliderAtSelected()})},e})},210:function(e,t,i){var n=i(2127);n(n.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},237:function(e,t,i){for(var n,r=i(7526),o=i(3341),s=i(4415),a=s("typed_array"),l=s("view"),c=!(!r.ArrayBuffer||!r.DataView),u=c,h=0,d="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");h<9;)(n=r[d[h++]])?(o(n.prototype,a,!0),o(n.prototype,l,!0)):u=!1;e.exports={ABV:c,CONSTR:u,TYPED:a,VIEW:l}},328:function(e,t,i){i(8624),e.exports=self.fetch.bind(self)},333:function(e,t,i){i(7209)("Uint8",1,function(e){return function(t,i,n){return e(this,t,i,n)}},!0)},341:function(e,t,i){"use strict";var n=i(5411),r=i(4228),o=i(9190),s=i(8828),a=i(1485),l=i(2535),c=i(9600),u=i(9448),h=Math.min,d=[].push,f="split",p="length",m="lastIndex",_=4294967295,g=!u(function(){RegExp(_,"y")});i(9228)("split",2,function(e,t,i,u){var y;return y="c"=="abbc"[f](/(b)*/)[1]||4!="test"[f](/(?:)/,-1)[p]||2!="ab"[f](/(?:ab)*/)[p]||4!="."[f](/(.?)(.?)/)[p]||"."[f](/()()/)[p]>1||""[f](/.?/)[p]?function(e,t){var r=String(this);if(void 0===e&&0===t)return[];if(!n(e))return i.call(r,e,t);for(var o,s,a,l=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),h=0,f=void 0===t?_:t>>>0,g=new RegExp(e.source,u+"g");(o=c.call(g,r))&&!((s=g[m])>h&&(l.push(r.slice(h,o.index)),o[p]>1&&o.index<r[p]&&d.apply(l,o.slice(1)),a=o[0][p],h=s,l[p]>=f));)g[m]===o.index&&g[m]++;return h===r[p]?!a&&g.test("")||l.push(""):l.push(r.slice(h)),l[p]>f?l.slice(0,f):l}:"0"[f](void 0,0)[p]?function(e,t){return void 0===e&&0===t?[]:i.call(this,e,t)}:i,[function(i,n){var r=e(this),o=null==i?void 0:i[t];return void 0!==o?o.call(i,r,n):y.call(String(r),i,n)},function(e,t){var n=u(y,e,this,t,y!==i);if(n.done)return n.value;var c=r(e),d=String(this),f=o(c,RegExp),p=c.unicode,m=(c.ignoreCase?"i":"")+(c.multiline?"m":"")+(c.unicode?"u":"")+(g?"y":"g"),v=new f(g?c:"^(?:"+c.source+")",m),x=void 0===t?_:t>>>0;if(0===x)return[];if(0===d.length)return null===l(v,d)?[d]:[];for(var b=0,w=0,T=[];w<d.length;){v.lastIndex=g?w:0;var S,E=l(v,g?d:d.slice(w));if(null===E||(S=h(a(v.lastIndex+(g?0:w)),d.length))===b)w=s(d,w,p);else{if(T.push(d.slice(b,w)),T.length===x)return T;for(var I=1;I<=E.length-1;I++)if(T.push(E[I]),T.length===x)return T;w=b=S}}return T.push(d.slice(b)),T}]})},345:function(e,t,i){var n=i(2127);n(n.S,"Math",{sign:i(3733)})},489:function(e,t,i){var n=i(7967).f,r=Function.prototype,o=/^\s*function ([^ (]*)/,s="name";s in r||i(1763)&&n(r,s,{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(e){return""}}})},521:function(e,t,i){"use strict";i(629)("trimRight",function(e){return function(){return e(this,2)}},"trimEnd")},571:function(e,t,i){var n=i(2127),r=i(2738);n(n.G+n.F*(parseInt!=r),{parseInt:r})},627:function(e,t,i){var n=i(7917),r=i(8270),o=i(766)("IE_PROTO"),s=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=r(e),n(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},629:function(e,t,i){var n=i(2127),r=i(3344),o=i(9448),s=i(832),a="["+s+"]",l=RegExp("^"+a+a+"*"),c=RegExp(a+a+"*$"),u=function(e,t,i){var r={},a=o(function(){return!!s[e]()||"​…"!="​…"[e]()}),l=r[e]=a?t(h):s[e];i&&(r[i]=l),n(n.P+n.F*a,"String",r)},h=u.trim=function(e,t){return e=String(r(e)),1&t&&(e=e.replace(l,"")),2&t&&(e=e.replace(c,"")),e};e.exports=u},660:function(e,t,i){var n=i(2127);n(n.G+n.W+n.F*!i(237).ABV,{DataView:i(8032).DataView})},752:function(e,t,i){var n=i(4401);e.exports=function(e,t){if(!n(e))return e;var i,r;if(t&&"function"==typeof(i=e.toString)&&!n(r=i.call(e)))return r;if("function"==typeof(i=e.valueOf)&&!n(r=i.call(e)))return r;if(!t&&"function"==typeof(i=e.toString)&&!n(r=i.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},762:function(e,t,i){var n=i(4848),r=i(7574)("iterator"),o=i(906);e.exports=i(6094).getIteratorMethod=function(e){if(null!=e)return e[r]||e["@@iterator"]||o[n(e)]}},766:function(e,t,i){var n=i(4556)("keys"),r=i(4415);e.exports=function(e){return n[e]||(n[e]=r(e))}},812:function(e,t,i){var n=i(4401);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},832:function(e){e.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},842:function(e){e.exports=function(){"use strict";var e,t,i;function n(n,r){if(e)if(t){var o="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+e+")(sharedChunk); ("+t+")(sharedChunk); self.onerror = null;",s={};e(s),i=r(s),"undefined"!=typeof window&&window&&window.URL&&window.URL.createObjectURL&&(i.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else t=r;else e=r}return n(0,function(e){var t=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array;function n(e,t){var i=t[0],n=t[1],r=t[2],o=t[3],s=i*o-r*n;return s?(e[0]=o*(s=1/s),e[1]=-n*s,e[2]=-r*s,e[3]=i*s,e):null}function r(){var e=new i(9);return i!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function o(e,t){var i=t[0],n=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8];return e[0]=s*u-a*c,e[1]=r*c-n*u,e[2]=n*a-r*s,e[3]=a*l-o*u,e[4]=i*u-r*l,e[5]=r*o-i*a,e[6]=o*c-s*l,e[7]=n*l-i*c,e[8]=i*s-n*o,e}function s(e,t,i){var n=t[0],r=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=i[0],f=i[1],p=i[2],m=i[3],_=i[4],g=i[5],y=i[6],v=i[7],x=i[8];return e[0]=d*n+f*s+p*c,e[1]=d*r+f*a+p*u,e[2]=d*o+f*l+p*h,e[3]=m*n+_*s+g*c,e[4]=m*r+_*a+g*u,e[5]=m*o+_*l+g*h,e[6]=y*n+v*s+x*c,e[7]=y*r+v*a+x*u,e[8]=y*o+v*l+x*h,e}function a(){var e=new i(16);return i!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function l(e){var t=new i(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function c(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10
vendor: 7,993 bytes, line 2
2]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function u(e,t){var i=t[0],n=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],f=t[11],p=t[12],m=t[13],_=t[14],g=t[15],y=i*a-n*s,v=i*l-r*s,x=i*c-o*s,b=n*l-r*a,w=n*c-o*a,T=r*c-o*l,S=u*m-h*p,E=u*_-d*p,I=u*g-f*p,A=h*_-d*m,M=h*g-f*m,C=d*g-f*_,P=y*C-v*M+x*A+b*I-w*E+T*S;return P?(e[0]=(a*C-l*M+c*A)*(P=1/P),e[1]=(r*M-n*C-o*A)*P,e[2]=(m*T-_*w+g*b)*P,e[3]=(d*w-h*T-f*b)*P,e[4]=(l*I-s*C-c*E)*P,e[5]=(i*C-r*I+o*E)*P,e[6]=(_*x-p*T-g*v)*P,e[7]=(u*T-d*x+f*v)*P,e[8]=(s*M-a*I+c*S)*P,e[9]=(n*I-i*M-o*S)*P,e[10]=(p*w-m*x+g*y)*P,e[11]=(h*x-u*w-f*y)*P,e[12]=(a*E-s*A-l*S)*P,e[13]=(i*A-n*E+r*S)*P,e[14]=(m*v-p*b-_*y)*P,e[15]=(u*b-h*v+d*y)*P,e):null}function h(e,t,i){var n=t[0],r=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],f=t[10],p=t[11],m=t[12],_=t[13],g=t[14],y=t[15],v=i[0],x=i[1],b=i[2],w=i[3];return e[0]=v*n+x*a+b*h+w*m,e[1]=v*r+x*l+b*d+w*_,e[2]=v*o+x*c+b*f+w*g,e[3]=v*s+x*u+b*p+w*y,e[4]=(v=i[4])*n+(x=i[5])*a+(b=i[6])*h+(w=i[7])*m,e[5]=v*r+x*l+b*d+w*_,e[6]=v*o+x*c+b*f+w*g,e[7]=v*s+x*u+b*p+w*y,e[8]=(v=i[8])*n+(x=i[9])*a+(b=i[10])*h+(w=i[11])*m,e[9]=v*r+x*l+b*d+w*_,e[10]=v*o+x*c+b*f+w*g,e[11]=v*s+x*u+b*p+w*y,e[12]=(v=i[12])*n+(x=i[13])*a+(b=i[14])*h+(w=i[15])*m,e[13]=v*r+x*l+b*d+w*_,e[14]=v*o+x*c+b*f+w*g,e[15]=v*s+x*u+b*p+w*y,e}function d(e,t,i){var n,r,o,s,a,l,c,u,h,d,f,p,m=i[0],_=i[1],g=i[2];return t===e?(e[12]=t[0]*m+t[4]*_+t[8]*g+t[12],e[13]=t[1]*m+t[5]*_+t[9]*g+t[13],e[14]=t[2]*m+t[6]*_+t[10]*g+t[14],e[15]=t[3]*m+t[7]*_+t[11]*g+t[15]):(r=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],f=t[10],p=t[11],e[0]=n=t[0],e[1]=r,e[2]=o,e[3]=s,e[4]=a,e[5]=l,e[6]=c,e[7]=u,e[8]=h,e[9]=d,e[10]=f,e[11]=p,e[12]=n*m+a*_+h*g+t[12],e[13]=r*m+l*_+d*g+t[13],e[14]=o*m+c*_+f*g+t[14],e[15]=s*m+u*_+p*g+t[15]),e}function f(e,t,i){var n=i[0],r=i[1],o=i[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function p(e,t,i){var n=Math.sin(i),r=Math.cos(i),o=t[4],s=t[5],a=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*r+c*n,e[5]=s*r+u*n,e[6]=a*r+h*n,e[7]=l*r+d*n,e[8]=c*r-o*n,e[9]=u*r-s*n,e[10]=h*r-a*n,e[11]=d*r-l*n,e}function m(e,t,i){var n=Math.sin(i),r=Math.cos(i),o=t[0],s=t[1],a=t[2],l=t[3],c=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*r-c*n,e[1]=s*r-u*n,e[2]=a*r-h*n,e[3]=l*r-d*n,e[8]=o*n+c*r,e[9]=s*n+u*r,e[10]=a*n+h*r,e[11]=l*n+d*r,e}function _(e,t,i){var n=Math.sin(i),r=Math.cos(i),o=t[0],s=t[1],a=t[2],l=t[3],c=t[4],u=t[5],h=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*r+c*n,e[1]=s*r+u*n,e[2]=a*r+h*n,e[3]=l*r+d*n,e[4]=c*r-o*n,e[5]=u*r-s*n,e[6]=h*r-a*n,e[7]=d*r-l*n,e}function g(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function y(e,i,n){var r,o,s,a=n[0],l=n[1],c=n[2],u=Math.sqrt(a*a+l*l+c*c);return u<t?null:(a*=u=1/u,l*=u,c*=u,r=Math.sin(i),o=Math.cos(i),e[0]=a*a*(s=1-o)+o,e[1]=l*a*s+c*r,e[2]=c*a*s-l*r,e[3]=0,e[4]=a*l*s-c*r,e[5]=l*l*s+o,e[6]=c*l*s+a*r,e[7]=0,e[8]=a*c*s+l*r,e[9]=l*c*s-a*r,e[10]=c*c*s+o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function v(e,t){var i=t[0],n=t[1],r=t[2],o=t[4],s=t[5],a=t[6],l=t[8],c=t[9],u=t[10];return e[0]=Math.sqrt(i*i+n*n+r*r),e[1]=Math.sqrt(o*o+s*s+a*a),e[2]=Math.sqrt(l*l+c*c+u*u),e}function x(e,t){var i=t[0],n=t[1],r=t[2],o=t[3],s=i+i,a=n+n,l=r+r,c=i*s,u=n*s,h=n*a,d=r*s,f=r*a,p=r*l,m=o*s,_=o*a,g=o*l;return e[0]=1-h-p,e[1]=u+g,e[2]=d-_,e[3]=0,e[4]=u-g,e[5]=1-c-p,e[6]=f+m,e[7]=0,e[8]=d+_,e[9]=f-m,e[10]=1-c-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}var b=h;function w(){var e=new i(3);return i!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function T(e){var t=new i(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function S(e){var t=e[0],i=e[1],n=e[2];return Math.sqrt(t*t+i*i+n*n)}function E(e,t,n){var r=new i(3);return r[0]=e,r[1]=t,r[2]=n,r}function I(e,t,i,n){return e[0]=t,e[1]=i,e[2]=n,e}function A(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e}function M(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e}function C(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e[2]=t[2]*i[2],e}function P(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e[2]=Math.min(t[2],i[2]),e}function D(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e[2]=Math.max(t[2],i[2]),e}function R(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}function L(e,t,i,n){return e[0]=t[0]+i[0]*n,e[1]=t[1]+i[1]*n,e[2]=t[2]+i[2]*n,e}function z(e,t){var i=t[0]-e[0],n=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(i*i+n*n+r*r)}function O(e,t){var i=t[0]-e[0],n=t[1]-e[1],r=t[2]-e[2];return i*i+n*n+r*r}function F(e){var t=e[0],i=e[1],n=e[2];return t*t+i*i+n*n}function k(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function B(e,t){var i=t[0],n=t[1],r=t[2],o=i*i+n*n+r*r;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function N(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function V(e,t,i){var n=t[0],r=t[1],o=t[2],s=i[0],a=i[1],l=i[2];return e[0]=r*l-o*a,e[1]=o*s-n*l,e[2]=n*a-r*s,e}function U(e,t,i,n){var r=t[0],o=t[1],s=t[2];return e[0]=r+n*(i[0]-r),e[1]=o+n*(i[1]-o),e[2]=s+n*(i[2]-s),e}function j(e,t,i){var n=t[0],r=t[1],o=t[2],s=i[3]*n+i[7]*r+i[11]*o+i[15];return e[0]=(i[0]*n+i[4]*r+i[8]*o+i[12])/(s=s||1),e[1]=(i[1]*n+i[5]*r+i[9]*o+i[13])/s,e[2]=(i[2]*n+i[6]*r+i[10]*o+i[14])/s,e}function G(e,t,i){var n=t[0],r=t[1],o=t[2];return e[0]=n*i[0]+r*i[3]+o*i[6],e[1]=n*i[1]+r*i[4]+o*i[7],e[2]=n*i[2]+r*i[5]+o*i[8],e}function q(e,t,i){var n=i[0],r=i[1],o=i[2],s=i[3],a=t[0],l=t[1],c=t[2],u=r*c-o*l,h=o*a-n*c,d=n*l-r*a;return e[0]=a+s*(u+=u)+r*(d+=d)-o*(h+=h),e[1]=l+s*h+o*u-n*d,e[2]=c+s*d+n*h-r*u,e}function H(e){return e[0]=0,e[1]=0,e[2]=0,e}function $(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}var W=M,Z=C,X=S;function Y(){var e=new i(4);return i!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function K(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e}function J(e,t){var i=t[0],n=t[1],r=t[2],o=t[3],s=i*i+n*n+r*r+o*o;return s>0&&(s=1/Math.sqrt(s)),e[0]=i*s,e[1]=n*s,e[2]=r*s,e[3]=o*s,e}function Q(e,t,i){var n=t[0],r=t[1],o=t[2],s=t[3];return e[0]=i[0]*n+i[4]*r+i[8]*o+i[12]*s,e[1]=i[1]*n+i[5]*r+i[9]*o+i[13]*s,e[2]=i[2]*n+i[6]*r+i[10]*o+i[14]*s,e[3]=i[3]*n+i[7]*r+i[11]*o+i[15]*s,e}function ee(){var e=new i(4);return i!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function te(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function ie(e,t,i){i*=.5;var n=t[0],r=t[1],o=t[2],s=t[3],a=Math.sin(i),l=Math.cos(i);return e[0]=n*l+s*a,e[1]=r*l+o*a,e[2]=o*l-r*a,e[3]=s*l-n*a,e}function ne(e,t,i){i*=.5;var n=t[0],r=t[1],o=t[2],s=t[3],a=Math.sin(i),l=Math.cos(i);return e[0]=n*l-o*a,e[1]=r*l+s*a,e[2]=o*l+n*a,e[3]=s*l-r*a,e}w(),Y();var re,oe,se,ae=J,le=(re=w(),oe=E(1,0,0),se=E(0,1,0),function(e,t,i){var n=N(t,i);return n<-.999999?(V(re,oe,t),X(re)<1e-6&&V(re,se,t),B(re,re),function(e,t,i){i*=.5;var n=Math.sin(i);e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(i)}(e,re,Math.PI),e):n>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(V(re,t,i),e[0]=re[0],e[1]=re[1],e[2]=re[2],e[3]=1+n,ae(e,e))});function ce(){var e=new i(2);return i!=Float32Array&&(e[0]=0,e[1]=0),e}function ue(e,t){var n=new i(2);return n[0]=e,n[1]=t,n}function he(e,t,i){return e[0]=t,e[1]=i,e}function de(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e}function fe(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e}function pe(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e}function me(e){var t=e[0],i=e[1];return Math.sqrt(t*t+i*i)}function _e(e,t){var i=t[0],n=t[1],r=i*i+n*n;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}function ge(e,t){return e[0]*t[0]+e[1]*t[1]}ee(),ee(),r();var ye,ve,xe=fe;
2function be(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}ce();var we=function(){if(ve)return ye;function e(e,t,i,n){this.cx=3*e,this.bx=3*(i-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=i,this.p2y=n}return ve=1,ye=e,e.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,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var i=e,n=0;n<8;n++){var r=this.sampleCurveX(i)-e;if(Math.abs(r)<t)return i;var o=this.sampleCurveDerivativeX(i);if(Math.abs(o)<1e-6)break;i-=r/o}var s=0,a=1;for(i=e,n=0;n<20&&(r=this.sampleCurveX(i),!(Math.abs(r-e)<t));n++)e>r?s=i:a=i,i=.5*(a-s)+s;return i},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},ye}(),Te=be(we);function Se(e,t){this.x=e,this.y=t}function Ee(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!Ee(e[i],t[i]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==t){if("object"!=typeof t)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!Ee(e[i],t[i]))return!1;return!0}return e===t}Se.prototype={clone(){return new Se(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},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(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){const t=e.x-this.x,i=e.y-this.y;return t*t+i*i},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){const t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){const e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){const t=Math.cos(e),i=Math.sin(e),n=i*this.x+t*this.y;return this.x=t*this.x-i*this.y,this.y=n,this},_rotateAround(e,t){const i=Math.cos(e),n=Math.sin(e),r=t.y+n*(this.x-t.x)+i*(this.y-t.y);return this.x=t.x+i*(this.x-t.x)-n*(this.y-t.y),this.y=r,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:Se},Se.convert=function(e){if(e instanceof Se)return e;if(Array.isArray(e))return new Se(+e[0],+e[1]);if(void 0!==e.x&&void 0!==e.y)return new Se(+e.x,+e.y);throw new Error("Expected [x, y] or {x, y} point format")};const Ie=Math.PI/180,Ae=180/Math.PI;function Me(e){return e*Ie}function Ce(e){return e*Ae}const Pe=[[0,0],[1,0],[1,1],[0,1]];function De(e){if(e<=0)return 0;if(e>=1)return 1;const t=e*e,i=t*e;return 4*(e<.5?i:3*(e-t)+i-.75)}function Re(e,t,i,n){const r=new Te(e,t,i,n);return function(e){return r.solve(e)}}const Le=Re(.25,.1,.25,1);function ze(e,t,i){return Math.min(i,Math.max(t,e))}function Oe(e,t,i){return(i=ze((i-e)/(t-e),0,1))*i*(3-2*i)}function Fe(e,t,i){const n=i-t,r=((e-t)%n+n)%n+t;return r===t?i:r}function ke(e,t,i){if(!e.length)return i(null,[]);let n=e.length;const r=new Array(e.length);let o=null;e.forEach((e,s)=>{t(e,(e,t)=>{e&&(o=e),r[s]=t,0==--n&&i(o,r)})})}let Be=1;function Ne(){return Be++}function Ve(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log2(e)))}
2function Ue(e,t){e.forEach(e=>{t[e]&&(t[e]=t[e].bind(t))})}function je(e,t,i){const n={};for(const i in e)n[i]=t.call(this,e[i],i,e);return n}function Ge(e,t,i){const n={};for(const i in e)t.call(this,e[i],i,e)&&(n[i]=e[i]);return n}function qe(e){return Array.isArray(e)?e.map(qe):"object"==typeof e&&e?je(e,qe):e}function He(e,t){for(let i=0;i<e.length;i++)if(t.indexOf(e[i])>=0)return!0;return!1}const $e={};function We(e){$e[e]||("undefined"!=typeof console&&console.warn(e),$e[e]=!0)}function Ze(e,t,i){return(i.y-e.y)*(t.x-e.x)>(t.y-e.y)*(i.x-e.x)}function Xe(e){let t=0;for(let i,n,r=0,o=e.length,s=o-1;r<o;s=r++)i=e[r],n=e[s],t+=(n.x-i.x)*(i.y+n.y);return t}function Ye([e,t,i]){const n=Me(t+90),r=Me(i);return{x:e*Math.cos(n)*Math.sin(r),y:e*Math.sin(n)*Math.sin(r),z:e*Math.cos(r),azimuthal:t,polar:i}}function Ke(e){return("undefined"!=typeof self||void 0!==e)&&"undefined"!=typeof WorkerGlobalScope&&(void 0!==e?e:self)instanceof WorkerGlobalScope}function Je(e){const t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(e,i,n,r)=>{const o=n||r;return t[i]=!o||o.toLowerCase(),""}),t["max-age"]){const e=parseInt(t["max-age"],10);isNaN(e)?delete t["max-age"]:t["max-age"]=e}return t}let Qe=null;function et(e,t){return[e[4*t],e[4*t+1],e[4*t+2],e[4*t+3]]}function tt(e,t,i,n){for(;t<i;){const r=t+i>>1;e[r]<n?t=r+1:i=r}return t}function it(e,t,i,n){for(;t<i;){const r=t+i>>1;e[r]<=n?t=r+1:i=r}return t}function nt(e){return e>0?1/(1.001-e):1+e}function rt(e){return e>0?1-1/(1.001-e):-e}function ot(e,t,i){return(e-t.min)*(i.max-i.min)/(t.max-t.min)+i.min}const st={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!st.API_URL)return null;try{const e=new URL(st.API_URL);return"api.mapbox.cn"===e.hostname?"https://events.mapbox.cn/events/v2":"api.mapbox.com"===e.hostname?"https://events.mapbox.com/events/v2":null}catch(e){return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",RASTERARRAYS_URL_PREFIX:"rasterarrays/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,DEFAULT_STYLE:"mapbox://styles/mapbox/standard",MAX_PARALLEL_IMAGE_REQUESTS:16,DRACO_URL:"https://api.mapbox.com/mapbox-gl-js/draco_decoder_gltf_v1.5.6.wasm",MESHOPT_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_base_v0.20.wasm",MESHOPT_SIMD_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_simd_v0.20.wasm",BUILDING_GEN_URL:"https://api.mapbox.com/mapbox-gl-js/building-gen/building_gen_v1.2.4.wasm",GLYPHS_URL:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf",TILES3D_URL_PREFIX:"3dtiles/v1"};function at(e){return st.API_URL_REGEX.test(e)}function lt(e){return st.API_SPRITE_REGEX.test(e)}let ct,ut,ht,dt,ft,pt;function mt(){return null==ct&&(ct=self.OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),ct}const _t={now:()=>void 0!==dt?dt:performance.now(),setNow(e){dt=e},restoreNow(){dt=void 0},frame(e){const t=requestAnimationFrame(e);return{cancel:()=>cancelAnimationFrame(t)}},getImageData(e,t=0){const{width:i,height:n}=e;ft||(ft=document.createElement("canvas"));const r=ft.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return(i>ft.width||n>ft.height)&&(ft.width=i,ft.height=n),r.clearRect(-t,-t,i+2*t,n+2*t),r.drawImage(e,0,0,i,n),r.getImageData(-t,-t,i+2*t,n+2*t)},resolveURL:e=>(ut||(ut=document.createElement("a")),ut.href=e,ut.href),get devicePixelRatio(){return window.devicePixelRatio},get prefersReducedMotion(){return!!window.matchMedia&&(null==ht&&(ht=window.matchMedia("(prefers-reduced-motion: reduce)")),ht.matches)},hasCanvasFingerprintNoise(){if(void 0!==pt)return pt;if(!mt())return pt=!1,!1;const e=new OffscreenCanvas(85,1),t=e.getContext("2d",{willReadFrequently:!0});let i=0;for(let n=0;n<e.width;++n)t.fillStyle=`rgba(${i++},${i++},${i++}, 255)`,t.fillRect(n,0,1,1);const n=t.getImageData(0,0,e.width,e.height);i=0;for(let e=0;e<n.data.length;++e)if(e%4!=3&&i++!==n.data[e])return pt=!0,!0;return pt=!1,!1}};function gt(e,t){const i=e.indexOf("?");if(i<0)return`${e}?${new URLSearchParams(t).toString()}`;const n=new URLSearchParams(e.slice(i));for(const e in t)n.set(e,t[e]);return`${e.slice(0,i)}?${n.toString()}`}
2function yt(e,t={persistentParams:[]}){const i=e.indexOf("?");if(i<0)return e;const n=new URLSearchParams,r=new URLSearchParams(e.slice(i));for(const e of t.persistentParams){const t=r.get(e);t&&n.set(e,t)}const o=n.toString();return`${e.slice(0,i)}${o.length>0?`?${o}`:""}`}const vt="mapbox-tiles";let xt=500,bt=50;const wt=["language","worldview","jobid"];let Tt,St;function Et(){try{return caches}catch(e){}}function It(){const e=Et();e&&null==Tt&&(Tt=e.open(vt))}let At=1/0;const Mt={supported:!1,testSupport:function(e){!Dt&&Pt&&(Rt?zt(e):Ct=e)}};let Ct,Pt,Dt=!1,Rt=!1;const Lt="undefined"!=typeof self?self:{};function zt(e){const t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,Pt),e.isContextLost())return;Mt.supported=!0}catch(e){}e.deleteTexture(t),Dt=!0}Lt.document&&(Pt=Lt.document.createElement("img"),Pt.onload=function(){Ct&&zt(Ct),Ct=null,Rt=!0},Pt.onerror=function(){Dt=!0,Ct=null},Pt.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const Ot={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Iconset:"Iconset",Image:"Image",Model:"Model"};"function"==typeof Object.freeze&&Object.freeze(Ot);class Ft extends Error{constructor(e,t,i){401===t&&at(i)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=t,this.url=i}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const kt=Ke()?()=>self.worker.referrer:()=>("blob:"===location.protocol?parent:self).location.href,Bt=function(e,t){if(!(/^file:/.test(i=e.url)||/^file:/.test(kt())&&!/^\w+:/.test(i))){if(self.fetch&&self.Request&&self.AbortController&&Request.prototype.hasOwnProperty("signal"))return function(e,t){const i=new AbortController,n=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:kt(),referrerPolicy:e.referrerPolicy,signal:i.signal});let r=!1,o=!1;const s=(a=n.url).indexOf("sku=")>0&&at(a);var a;"json"===e.type&&n.headers.set("Accept","application/json");const l=(i,r,a)=>{if(o)return;if(i&&"SecurityError"!==i.message&&We(i.toString()),r&&a)return c(r);const l=Date.now();fetch(n).then(i=>{if(i.ok){const e=s?i.clone():null;return c(i,e,l)}return t(new Ft(i.statusText,i.status,e.url))}).catch(i=>{"AbortError"!==i.name&&t(new Error(`${i.message} ${e.url}`))})},c=(i,s,a)=>{("arrayBuffer"===e.type?i.arrayBuffer():"json"===e.type?i.json():i.text()).then(e=>{o||(s&&a&&function(e,t,i){if(It(),null==Tt)return;const n=Je(t.headers.get("Cache-Control")||"");if(n["no-store"])return;const r={status:t.status,statusText:t.statusText,headers:new Headers};t.headers.forEach((e,t)=>r.headers.set(t,e)),n["max-age"]&&r.headers.set("Expires",new Date(i+1e3*n["max-age"]).toUTCString());const o=r.headers.get("Expires");if(!o)return;if(new Date(o).getTime()-i<42e4)return;
2let s=yt(e.url,{persistentParams:wt});if(206===t.status){const t=e.headers.get("Range");if(!t)return;r.status=200,s=gt(s,{range:t})}!function(e,t){if(void 0===St)try{new Response(new ReadableStream),St=!0}catch(e){St=!1}St?t(e.body):e.blob().then(t).catch(e=>We(e.message))}(t,e=>{const i=new Response(200!==(n=t.status)&&404!==n&&[101,103,204,205,304].includes(n)?null:e,r);var n;It(),null!=Tt&&Tt.then(e=>e.put(s,i)).catch(e=>We(e.message))})}(n,s,a),r=!0,t(null,e,i.headers))}).catch(e=>{o||t(new Error(e.message))})};return s?function(e,t){if(It(),null==Tt)return t(null);Tt.then(i=>{let n=yt(e.url,{persistentParams:wt});const r=e.headers.get("Range");r&&(n=gt(n,{range:r})),i.match(n).then(e=>{const r=function(e){if(!e)return!1;const t=new Date(e.headers.get("Expires")||0),i=Je(e.headers.get("Cache-Control")||"");return Number(t)>Date.now()&&!i["no-cache"]}(e);i.delete(n).catch(t),r&&i.put(n,e.clone()).catch(t),t(null,e,r)}).catch(t)}).catch(t)}(n,l):l(null,null),{cancel:()=>{o=!0,r||i.abort()}}}(e,t);if(Ke(self)&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var i;return function(e,t){const i=new XMLHttpRequest;i.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(i.responseType="arraybuffer");for(const t in e.headers)i.setRequestHeader(t,e.headers[t]);return"json"===e.type&&(i.responseType="text",i.setRequestHeader("Accept","application/json")),i.withCredentials="include"===e.credentials,i.onerror=()=>{t(new Error(i.statusText))},i.onload=()=>{if((i.status>=200&&i.status<300||0===i.status)&&null!==i.response){let n=i.response;if("json"===e.type)try{n=JSON.parse(i.response)}catch(e){return t(e)}const r=new Headers;i.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(e=>{const t=e.split(": "),i=t.shift(),n=t.join(": ");r.append(i,n)}),t(null,n,r)}else t(new Ft(i.statusText,i.status,e.url))},i.send(e.body),{cancel:()=>i.abort()}}(e,t)},Nt=function(e,t){return Bt(Object.assign(e,{type:"arrayBuffer"}),t)};function Vt(e){const t=document.createElement("a");return t.href=e,t.protocol===location.protocol&&t.host===location.host}const Ut="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let jt,Gt;jt=[],Gt=0;const qt=function(e,t){if(Mt.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),Gt>=st.MAX_PARALLEL_IMAGE_REQUESTS){const i={requestParameters:e,callback:t,cancelled:!1,cancel(){this.cancelled=!0}};return jt.push(i),i}Gt++;let i=!1;const n=()=>
2{if(!i)for(i=!0,Gt--;jt.length&&Gt<st.MAX_PARALLEL_IMAGE_REQUESTS;){const e=jt.shift(),{requestParameters:t,callback:i,cancelled:n}=e;n||(e.cancel=qt(t,i).cancel)}},r=Nt(e,(e,i,r)=>{n(),e?t(e):i&&(self.createImageBitmap?function(e,t){const i=new Blob([new Uint8Array(e)],{type:"image/png"});createImageBitmap(i).then(e=>{t(null,e)}).catch(e=>{t(new Error(`Could not load image because of ${e.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(i,(e,i)=>t(e,i,r)):function(e,t){const i=new Image;i.onload=()=>{t(null,i),URL.revokeObjectURL(i.src),i.onload=null,requestAnimationFrame(()=>{i.src=Ut})},i.onerror=()=>t(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const n=new Blob([new Uint8Array(e)],{type:"image/png"});i.src=e.byteLength?URL.createObjectURL(n):Ut}(i,(e,i)=>t(e,i,r)))});return{cancel:()=>{r.cancel(),n()}}};var Ht,$t,Wt,Zt={exports:{}},Xt={exports:{}},Yt={exports:{}},Kt=function(){if(Wt)return Zt.exports;Wt=1;var e=(Ht||(Ht=1,Xt.exports=function(e,t){var i,n,r,o,s,a,l,c;for(n=e.length-(i=3&e.length),r=t,s=3432918353,a=461845907,c=0;c<n;)l=255&e.charCodeAt(c)|(255&e.charCodeAt(++c))<<8|(255&e.charCodeAt(++c))<<16|(255&e.charCodeAt(++c))<<24,++c,r=27492+(65535&(o=5*(65535&(r=(r^=l=(65535&(l=(l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<13|r>>>19))+((5*(r>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,i){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:r^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(c)))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295}return r^=e.length,r=2246822507*(65535&(r^=r>>>16))+((2246822507*(r>>>16)&65535)<<16)&4294967295,r=3266489909*(65535&(r^=r>>>13))+((3266489909*(r>>>16)&65535)<<16)&4294967295,(r^=r>>>16)>>>0}
2),Xt.exports),t=($t||($t=1,Yt.exports=function(e,t){for(var i,n=e.length,r=t^n,o=0;n>=4;)i=1540483477*(65535&(i=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(i>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:r^=(255&e.charCodeAt(o+2))<<16;case 2:r^=(255&e.charCodeAt(o+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(o)))+((1540483477*(r>>>16)&65535)<<16)}return r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16),(r^=r>>>15)>>>0}),Yt.exports);return Zt.exports=e,Zt.exports.murmur3=e,Zt.exports.murmur2=t,Zt.exports}(),Jt=be(Kt);class Qt{constructor(e,...t){Object.assign(this,t[0]||{}),this.type=e}}class ei extends Qt{constructor(e,t={}){super("error",Object.assign({error:e},t))}}function ti(e,t,i){i[e]&&-1!==i[e].indexOf(t)||(i[e]=i[e]||[],i[e].push(t))}function ii(e,t,i){if(i&&i[e]){const n=i[e].indexOf(t);-1!==n&&i[e].splice(n,1)}}class ni{on(e,t){return this._listeners=this._listeners||{},ti(e,t,this._listeners),this}off(e,t){return ii(e,t,this._listeners),ii(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},ti(e,t,this._oneTimeListeners),this):new Promise(t=>{this.once(e,t)})}fire(e,t){const i="string"==typeof e?new Qt(e,t):e,n=i.type;if(this.listens(n)){i.target=this;const e=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(const t of e)t.call(this,i);const t=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(const e of t)ii(n,e,this._oneTimeListeners),e.call(this,i);const r=this._eventedParent;if(r){const e="function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData;Object.assign(i,e),r.fire(i)}}else i instanceof ei&&console.error(i.error);return this}listens(e){return!!(this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e))}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}}class ri{constructor(e){"string"==typeof e?this.name=e:(this.name=e.name,this.iconsetId=e.iconsetId)}static from(e){return new ri(e)}static toString(e){return e.iconsetId?`${e.name}�${e.iconsetId}`:e.name}static parse(e){const[t,i]=e.split("�");return new ri({name:t,iconsetId:i})}static isEqual(e,t){return e.name===t.name&&e.iconsetId===t.iconsetId}toString(){return ri.toString(this)}serialize(){return{name:this.name,iconsetId:this.iconsetId}}}var oi,si={},ai=function(){if(oi)return si;oi=1;var e={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 t(e){return(e=Math.round(e))<0?0:e>255?255:e}function i(e){return t("%"===e[e.length-1]?parseFloat(e)/100*255:parseInt(e))}function n(e){return(t="%"===e[e.length-1]?parseFloat(e)/100:parseFloat(e))<0?0:t>1?1:t;var t}function r(e,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}try{si.parseCSSColor=function(o){var s,a=o.replace(/ /g,"").toLowerCase();if(a in e)return e[a].slice();if("#"===a[0])return 4===a.length?(s=parseInt(a.substr(1),16))>=0&&s<=4095?[(3840&s)>>4|(3840&s)>>8,240&s|(240&s)>>4,15&s|(15&s)<<4,1]:null:7===a.length&&(s=parseInt(a.substr(1),16))>=0&&s<=16777215?[(16711680&s)>>16,(65280&s)>>8,255&s,1]:null;var l=a.indexOf("("),c=a.indexOf(")");if(-1!==l&&c+1===a.length){var u=a.substr(0,l),h=a.substr(l+1,c-(l+1)).split(","),d=1;switch(u){case"rgba":if(4!==h.length)return null;d=n(h.pop());case"rgb":return 3!==h.length?null:[i(h[0]),i(h[1]),i(h[2]),d];case"hsla":if(4!==h.length)return null;d=n(h.pop());case"hsl":if(3!==h.length)return null;var f=(parseFloat(h[0])%360+360)%360/360,p=n(h[1]),m=n(h[2]),_=m<=.5?m*(p+1):m+p-m*p,g=2*m-_;return[t(255*r(g,_,f+1/3)),t(255*r(g,_,f)),t(255*r(g,_,f-1/3)),d];default:return null}}return null}}catch(e){}return si}
vendor: 9,791 bytes, line 2
2();class li{constructor(e,t,i,n=1){this.r=e,this.g=t,this.b=i,this.a=n}static parse(e){if(!e)return;if(e instanceof li)return e;if("string"!=typeof e)return;const t=ai.parseCSSColor(e);return t?new li(t[0]/255,t[1]/255,t[2]/255,t[3]):void 0}toString(){const[e,t,i,n]=[this.r,this.g,this.b,this.a];return`rgba(${Math.round(255*e)},${Math.round(255*t)},${Math.round(255*i)},${n})`}toNonPremultipliedRenderColor(e){const{r:t,g:i,b:n,a:r}=this;return new ui(e,t,i,n,r)}toPremultipliedRenderColor(e){const{r:t,g:i,b:n,a:r}=this;return new hi(e,t*r,i*r,n*r,r)}clone(){return new li(this.r,this.g,this.b,this.a)}}class ci{constructor(e,t,i,n,r,o=!1){if(this.premultiplied=!1,this.premultiplied=o,e){const o=e.image.height,s=o*o;this.premultiplied?(t=0===r?0:t/r*(o-1),i=0===r?0:i/r*(o-1),n=0===r?0:n/r*(o-1)):(t*=o-1,i*=o-1,n*=o-1);const a=Math.floor(t),l=Math.floor(i),c=Math.floor(n),u=Math.ceil(t),h=Math.ceil(i),d=Math.ceil(n),f=t-a,p=i-l,m=n-c,_=e.image.data,g=4*(a+l*s+c*o),y=4*(a+l*s+d*o),v=4*(a+h*s+c*o),x=4*(a+h*s+d*o),b=4*(u+l*s+c*o),w=4*(u+l*s+d*o),T=4*(u+h*s+c*o),S=4*(u+h*s+d*o);if(g<0||S>=_.length)throw new Error("out of range");this.r=di(di(di(_[g],_[y],m),di(_[v],_[x],m),p),di(di(_[b],_[w],m),di(_[T],_[S],m),p),f)/255*(this.premultiplied?r:1),this.g=di(di(di(_[g+1],_[y+1],m),di(_[v+1],_[x+1],m),p),di(di(_[b+1],_[w+1],m),di(_[T+1],_[S+1],m),p),f)/255*(this.premultiplied?r:1),this.b=di(di(di(_[g+2],_[y+2],m),di(_[v+2],_[x+2],m),p),di(di(_[b+2],_[w+2],m),di(_[T+2],_[S+2],m),p),f)/255*(this.premultiplied?r:1),this.a=r}else this.r=t,this.g=i,this.b=n,this.a=r}toArray(){const{r:e,g:t,b:i,a:n}=this;return[255*e,255*t,255*i,n]}toHslaArray(){let{r:e,g:t,b:i,a:n}=this;if(this.premultiplied){if(0===n)return[0,0,0,0];const r=1/n;e*=r,t*=r,i*=r}const r=Math.min(Math.max(e,0),1),o=Math.min(Math.max(t,0),1),s=Math.min(Math.max(i,0),1),a=Math.min(r,o,s),l=Math.max(r,o,s),c=l-a,u=.5*(a+l);if(0===c)return[0,0,100*u,n];const h=u>.5?c/(2-l-a):c/(l+a);let d;switch(l){case r:d=60*((o-s)/c+(o<s?6:0));break;case o:d=60*((s-r)/c+2);break;default:d=60*((r-o)/c+4)}return[d,100*h,100*u,n]}toArray01(){const{r:e,g:t,b:i,a:n}=this;return[e,t,i,n]}toArray01Scaled(e){const{r:t,g:i,b:n}=this;return[t*e,i*e,n*e]}toArray01Linear(){const{r:e,g:t,b:i,a:n}=this;return[Math.pow(e,2.2),Math.pow(t,2.2),Math.pow(i,2.2),n]}}class ui extends ci{constructor(e,t,i,n,r){super(e,t,i,n,r,!1)}}class hi extends ci{constructor(e,t,i,n,r){super(e,t,i,n,r,!0)}}function di(e,t,i){return e*(1-i)+t*i}function fi(e,t,i){return e.map((e,n)=>di(e,t[n],i))}li.black=new li(0,0,0,1),li.white=new li(1,1,1,1),li.transparent=new li(0,0,0,0),li.red=new li(1,0,0,1),li.blue=new li(0,0,1,1);var pi=Object.freeze({__proto__:null,array:fi,color:function(e,t,i){return new li(di(e.r,t.r,i),di(e.g,t.g,i),di(e.b,t.b,i),di(e.a,t.a,i))},number:di});class mi extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class _i{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[e,i]of t)this.bindings[e]=i}concat(e){return new _i(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)}}const gi={kind:"null"},yi={kind:"number"},vi={kind:"string"},xi={kind:"boolean"},bi={kind:"color"},wi={kind:"object"},Ti={kind:"value"},Si={kind:"collator"},Ei={kind:"formatted"},Ii={kind:"resolvedImage"};function Ai(e,t){return{kind:"array",itemType:e,N:t}}function Mi(e){if("array"===e.kind){const t=Mi(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const Ci=[gi,yi,vi,xi,bi,Ei,wi,Ai(Ti),Ii];function Pi(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!Pi(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of Ci)if(!Pi(e,t))return null}return`Expected ${Mi(e)} but found ${Mi(t)} instead.`}function Di(e,t){return t.some(t=>t.kind===e.kind)}function Ri(e,t){return t.some(t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e)}function Li(e,t){return"array"===e.kind&&"array"===t.kind?e.N===t.N&&Li(e.itemType,t.itemType):e.kind===t.kind}class zi{constructor(e,t,i){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Oi{constructor(e,t,i,n,r){this.text=e.normalize?e.normalize():e,this.image=t,this.scale=i,this.fontStack=n,this.textColor=r}}class Fi{constructor(e){this.sections=e}static fromString(e){return new Fi([new Oi(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(e=>0!==e.text.length||!!e.image&&e.image.hasPrimary())}static factory(e){return e instanceof Fi?e:Fi.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map(e=>e.text).join("")}serialize(){const e=["format"];for(const t of this.sections){if(t.image){const i=t.image.getPrimary().id.toString();e.push(["image",i]);continue}e.push(t.text);const i={};t.fontStack&&(i["text-font"]=["literal",t.fontStack.split(",")]),t.scale&&(i["font-scale"]=t.scale),t.textColor&&(i["text-color"]=["rgba"].concat(t.textColor.toNonPremultipliedRenderColor(null).toArray())),e.push(i)}return e}}class ki{constructor(e,t={}){this.id=ri.from(e),this.params=t.params,this.sx=t.sx||1,this.sy=t.sy||1}toString(){return JSON.stringify(this)}static parse(e){let t,i,n,r;try{({id:t,params:i,sx:n,sy:r}=JSON.parse(e)||{})}catch(e){return null}return t?new ki(t,{params:i,sx:n,sy:r}):null}scaleSelf(e,t=e){return this.sx*=e,this.sy*=t,this}}class Bi{constructor(e,t,i,n,r=!1){this.primaryId=ri.from(e),this.primaryOptions=t,i&&(this.secondaryId=ri.from(i)),this.secondaryOptions=n,this.available=r}toString(){return this.primaryId&&this.secondaryId?`[${this.primaryId.name},${this.secondaryId.name}]`:this.primaryId.name}hasPrimary(){return!!this.primaryId}getPrimary(){return new ki(this.primaryId,this.primaryOptions)}hasSecondary(){return!!this.secondaryId}getSecondary(){return this.secondaryId?new ki(this.secondaryId,this.secondaryOptions):null}static from(e){return"string"==typeof e?Bi.build({name:e}):e}static build(e,t,i,n){return!e||"object"==typeof e&&!("name"in e)?null:new Bi(e,i,t,n)}}function Ni(e,t,i,n){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[e,t,i,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[e,t,i,n]:[e,t,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Vi(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof li)return!0;if(e instanceof zi)return!0;if(e instanceof Fi)return!0;if(e instanceof Bi)return!0;if(Array.isArray(e)){for(const t of e)if(!Vi(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!Vi(e[t]))return!1;return!0}return!1}function Ui(e){if(null===e)return gi;if("string"==typeof e)return vi;if("boolean"==typeof e)return xi;if("number"==typeof e)return yi;if(e instanceof li)return bi;if(e instanceof zi)return Si;if(e instanceof Fi)return Ei;if(e instanceof Bi)return Ii;if(Array.isArray(e)){const t=e.length;let i;for(const t of e){const e=Ui(t);if(i){if(i===e)continue;i=Ti;break}i=e}return Ai(i||Ti,t)}return wi}function ji(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Fi||e instanceof Bi||e instanceof li?e.toString():JSON.stringify(e)}class Gi{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Vi(e[1]))return t.error("invalid value");const i=e[1];let n=Ui(i);const r=t.expectedType;return"array"!==n.kind||0!==n.N||!r||"array"!==r.kind||"number"==typeof r.N&&0!==r.N||(n=r),new Gi(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof li?["rgba"].concat(this.value.toNonPremultipliedRenderColor(null).toArray()):this.value instanceof Fi?this.value.serialize():this.value}}class qi{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const Hi={string:vi,number:yi,boolean:xi,object:wi};class $i{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let i,n=1;const r=e[0];if("array"===r){let r,o;if(e.length>2){const i=e[1];if("string"!=typeof i||!(i in Hi)||"object"===i)return t.error('The item type argument of "array" must be one of string, number, boolean',1);r=Hi[i],n++}else r=Ti;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);o=e[2],n++}i=Ai(r,o)}else i=Hi[r];const o=[];for(;n<e.length;n++){const i=t.parse(e[n],n,Ti);if(!i)return null;o.push(i)}return new $i(i,o)}evaluate(e){for(let t=0;t<this.args.length;t++){const i=this.args[t].evaluate(e);if(!Pi(this.type,Ui(i)))return i;if(t===this.args.length-1)throw new qi(`The expression ${JSON.stringify(this.args[t].serialize())} evaluated to ${Mi(Ui(i))} but was expected to be of type ${Mi(this.type)}.`)}return null}
vendor: 9,666 bytes, line 2
2eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=this.type,t=[e.kind];if("array"===e.kind){const i=e.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){t.push(i.kind);const n=e.N;("number"==typeof n||this.args.length>1)&&t.push(n)}}return t.concat(this.args.map(e=>e.serialize()))}}class Wi{constructor(e){this.type=Ei,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const i=e[1];if(!Array.isArray(i)&&"object"==typeof i)return t.error("First argument must be an image or text section.");const n=[];let r=!1;for(let i=1;i<=e.length-1;++i){const o=e[i];if(r&&"object"==typeof o&&!Array.isArray(o)){r=!1;let e=null;if(o["font-scale"]&&(e=t.parseObjectValue(o["font-scale"],i,"font-scale",yi),!e))return null;let s=null;if(o["text-font"]&&(s=t.parseObjectValue(o["text-font"],i,"text-font",Ai(vi)),!s))return null;let a=null;if(o["text-color"]&&(a=t.parseObjectValue(o["text-color"],i,"text-color",bi),!a))return null;const l=n[n.length-1];l.scale=e,l.font=s,l.textColor=a}else{const o=t.parse(e[i],i,Ti);if(!o)return null;const s=o.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");r=!0,n.push({content:o,scale:null,font:null,textColor:null})}}return new Wi(n)}evaluate(e){return new Fi(this.sections.map(t=>{const i=t.content.evaluate(e);return Li(Ui(i),Ii)?new Oi("",i,null,null,null):new Oi(ji(i),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)}))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const t of this.sections){e.push(t.content.serialize());const i={};t.scale&&(i["font-scale"]=t.scale.serialize()),t.font&&(i["text-font"]=t.font.serialize()),t.textColor&&(i["text-color"]=t.textColor.serialize()),e.push(i)}return e}}class Zi{constructor(e,t,i,n){this._imageWarnHistory={},this.type=Ii,this.namePrimary=e,this.nameSecondary=t,i&&(this.paramsPrimary=i.params,this.iconsetIdPrimary=i.iconset?i.iconset.id:void 0),n&&(this.paramsSecondary=n.params,this.iconsetIdSecondary=n.iconset?n.iconset.id:void 0)}static parse(e,t){if(e.length<2)return t.error("Expected two or more arguments.");let i=1;const n=[];function r(){if(i<e.length){const r=t.parse(e[i],i++,vi);return r?(n.push({image:r,options:{}}),!0):(t.error(n.length?"Secondary image variant is not a string.":"No image name provided."),!1)}return!0}function o(){if(i<e.length){const o=e[i];if(null===(r=o)||"object"!=typeof r||Array.isArray(r))return!0;const s=o.params,a=o.iconset,l=t.concat(i);if(!s&&!a)return i++,!0;if(s){if("object"!=typeof s||s.constructor!==Object)return l.error('Image options "params" should be an object'),!1;const e={},t=l.concat(void 0,"params");for(const i in s){if(!i)return t.error("Image parameter name should be non-empty"),!1;const n=t.concat(void 0,i).parse(s[i],void 0,bi,void 0,{typeAnnotation:"coerce"});if(!n)return!1;e[i]=n}n[n.length-1].options.params=e}if(a){if("object"!=typeof a||a.constructor!==Object)return l.error('Image options "iconset" should be an object'),!1;if(!a.id)return l.error('Image options "iconset" should have an "id" property'),!1;n[n.length-1].options.iconset=a}return i++,!0}var r;return!0}for(let e=0;e<2;e++)if(!r()||!o())return;return new Zi(n[0].image,n[1]?n[1].image:void 0,n[0].options,n[1]?n[1].options:void 0)}evaluateParams(e,t){const i={};if(t){for(const n in t)if(t[n])try{i[n]=t[n].evaluate(e)}catch(e){continue}if(0!==Object.keys(i).length)return{params:i}}}evaluate(e){const t={name:this.namePrimary.evaluate(e),iconsetId:this.iconsetIdPrimary},i=this.nameSecondary?{name:this.nameSecondary.evaluate(e),iconsetId:this.iconsetIdSecondary}:void 0,n=Bi.build(t,i,this.paramsPrimary?this.evaluateParams(e,this.paramsPrimary):void 0,this.paramsSecondary?this.evaluateParams(e,this.paramsSecondary):void 0);if(n&&e.availableImages){const t=n.getPrimary().id;if(n.available=e.availableImages.some(e=>ri.isEqual(e,t)),n.available){const t=n.getSecondary()?n.getSecondary().id:null;t&&(n.available=e.availableImages.some(e=>ri.isEqual(e,t)))}}return n}eachChild(e){if(e(this.namePrimary),this.paramsPrimary)for(const t in this.paramsPrimary)this.paramsPrimary[t]&&e(this.paramsPrimary[t]);if(this.nameSecondary&&(e(this.nameSecondary),this.paramsSecondary))for(const t in this.paramsSecondary)this.paramsSecondary[t]&&e(this.paramsSecondary[t])}outputDefined(){return!1}serializeOptions(e,t){const i={};if(t&&(i.iconset={id:t}),e){i.params={};for(const t in e)e[t]&&(i.params[t]=e[t].serialize())}return Object.keys(i).length>0?i:void 0}serialize(){const e=["image",this.namePrimary.serialize()];if(this.paramsPrimary||this.iconsetIdPrimary){const t=this.serializeOptions(this.paramsPrimary,this.iconsetIdPrimary);t&&e.push(t)}if(this.nameSecondary&&(e.push(this.nameSecondary.serialize()),this.paramsSecondary||this.iconsetIdSecondary)){const t=this.serializeOptions(this.paramsSecondary,this.iconsetIdSecondary);t&&e.push(t)}return e}}function Xi(e){return Ki(e)?"string":Ji(e)?"number":Qi(e)?"boolean":Array.isArray(e)?"array":null===e?"null":Yi(e)?"object":typeof e}function Yi(e){return null!=e&&!Array.isArray(e)&&"function"!=typeof e&&!(e instanceof String||e instanceof Number||e instanceof Boolean)&&"object"==typeof e}function Ki(e){return"string"==typeof e||e instanceof String}function Ji(e){return"number"==typeof e||e instanceof Number}function Qi(e){return"boolean"==typeof e||e instanceof Boolean}const en={"to-boolean":xi,"to-color":bi,"to-number":yi,"to-string":vi};class tn{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const i=e[0],n=[];let r=gi;if("to-array"===i){if(!Array.isArray(e[1]))return null;const i=e[1].length;if(t.expectedType){if("array"!==t.expectedType.kind)return t.error(`Expected ${t.expectedType.kind} but found array.`);r=Ai(t.expectedType.itemType,i)}else{if(!(i>0&&Vi(e[1][0])))return null;r=Ai(Ui(e[1][0]),i)}for(let o=0;o<i;o++){const i=e[1][o];let s;if(Array.isArray(i))s=t.parse(i,void 0,r.itemType);else{const e=Xi(i);if(e!==r.itemType.kind)return t.error(`Expected ${r.itemType.kind} but found ${e}.`);s=t.registry.literal.parse(["literal",void 0===i?null:i],t)}if(!s)return null;n.push(s)}}else{if(("to-boolean"===i||"to-string"===i)&&2!==e.length)return t.error("Expected one argument.");r=en[i];for(let i=1;i<e.length;i++){const r=t.parse(e[i],i,Ti);if(!r)return null;n.push(r)}}return new tn(r,n)}evaluate(e){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(e));if("color"===this.type.kind){let t,i;for(const n of this.args){if(t=n.evaluate(e),i=null,t instanceof li)return t;if("string"==typeof t){const i=e.parseColor(t);if(i)return i}else if(Array.isArray(t)&&(i=t.length<3||t.length>4?`Invalid rbga value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:Ni(t[0],t[1],t[2],t[3]),!i))return new li(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new qi(i||`Could not parse color from value '${"string"==typeof t?t:String(JSON.stringify(t))}'`)}if("number"===this.type.kind){let t=null;for(const i of this.args){if(t=i.evaluate(e),null===t)return 0;const n=Number(t);if(!isNaN(n))return n}throw new qi(`Could not convert ${JSON.stringify(t)} to number.`)}return"formatted"===this.type.kind?Fi.fromString(ji(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?Bi.build(ji(this.args[0].evaluate(e))):"array"===this.type.kind?this.args.map(t=>t.evaluate(e)):ji(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){if("formatted"===this.type.kind)return new Wi([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Zi(this.args[0]).serialize();const e="array"===this.type.kind?[]:[`to-${this.type.kind}`];return this.eachChild(t=>{e.push(t.serialize())}),e}}const nn=["Unknown","Point","LineString","Polygon"];class rn{constructor(e,t,i){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null,this.scope=e,this.options=t,this.iconImageUseTheme=i}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?nn[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||{}}measureLight(e){return this.globals.brightness||0}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const e=this.featureDistanceData.center,t=this.featureDistanceData.scale,{x:i,y:n}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(i*t-e[0])+this.featureDistanceData.bearing[1]*(n*t-e[1])}return 0}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=li.parse(e)),t}getConfig(e){return this.options?this.options.get(e):null}}class on{constructor(e,t,i,n,r){this.name=e,this.type=t,this._evaluate=i,this.args=n,this._overloadIndex=r}evaluate(e){if(!this._evaluate){const e=on.definitions[this.name];this._evaluate=Array.isArray(e)?e[2]:e.overloads[this._overloadIndex][1]}return this._evaluate(e,this.args)}
vendor: 7,845 bytes, line 2
2eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(e=>e.serialize()))}static parse(e,t){const i=e[0],n=on.definitions[i];if(!n)return t.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const r=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=[];let a=null,l=-1;for(const[n,c]of o){if(Array.isArray(n)&&n.length!==e.length-1)continue;s.push(n),l++,a=new Tr(t.registry,t.path,null,t.scope,void 0,t._scope,t.options,t.iconImageUseTheme);const o=[];let u=!1;for(let t=1;t<e.length;t++){const i=e[t],r=Array.isArray(n)?n[t-1]:n.type,s=a.parse(i,1+o.length,r);if(!s){u=!0;break}o.push(s)}if(!u)if(Array.isArray(n)&&n.length!==o.length)a.error(`Expected ${n.length} arguments, but found ${o.length} instead.`);else{for(let e=0;e<o.length;e++){const t=Array.isArray(n)?n[e]:n.type,i=o[e];a.concat(e+1).checkSubtype(t,i.type)}if(0===a.errors.length)return new on(i,r,c,o,l)}}if(1===s.length)t.errors.push(...a.errors);else{const i=(s.length?s:o.map(([e])=>e)).map(sn).join(" | "),n=[];for(let i=1;i<e.length;i++){const r=t.parse(e[i],1+n.length);if(!r)return null;n.push(Mi(r.type))}t.error(`Expected arguments of type ${i}, but found (${n.join(", ")}) instead.`)}return null}static register(e,t){on.definitions=t;for(const i in t)e[i]=on}}function sn(e){return Array.isArray(e)?`(${e.map(Mi).join(", ")})`:`(${Mi(e.type)}...)`}class an{constructor(e,t,i){this.type=Si,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument.");const i=e[1];if("object"!=typeof i||Array.isArray(i))return t.error("Collator options argument must be an object.");const n=void 0===i["case-sensitive"]?t.parse(!1,1,xi):t.parseObjectValue(i["case-sensitive"],1,"case-sensitive",xi);if(!n)return null;const r=void 0===i["diacritic-sensitive"]?t.parse(!1,1,xi):t.parseObjectValue(i["diacritic-sensitive"],1,"diacritic-sensitive",xi);if(!r)return null;let o=null;return i.locale&&(o=t.parseObjectValue(i.locale,1,"locale",vi),!o)?null:new an(n,r,o)}evaluate(e){return new zi(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}serialize(){const e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]}}function ln(e,t,i=0,n=e.length-1,r=un){for(;n>i;){if(n-i>600){const o=n-i+1,s=t-i+1,a=Math.log(o),l=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1);ln(e,t,Math.max(i,Math.floor(t-s*l/o+c)),Math.min(n,Math.floor(t+(o-s)*l/o+c)),r)}const o=e[t];let s=i,a=n;for(cn(e,i,t),r(e[n],o)>0&&cn(e,i,n);s<a;){for(cn(e,s,a),s++,a--;r(e[s],o)<0;)s++;for(;r(e[a],o)>0;)a--}0===r(e[i],o)?cn(e,i,a):(a++,cn(e,a,n)),a<=t&&(i=a+1),t<=a&&(n=a-1)}}function cn(e,t,i){const n=e[t];e[t]=e[i],e[i]=n}function un(e,t){return e<t?-1:e>t?1:0}function hn(e){let t=0;for(let i,n,r=0,o=e.length,s=o-1;r<o;s=r++)i=e[r],n=e[s],t+=(n.x-i.x)*(i.y+n.y);return t}function dn(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function fn(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function pn(e,t,i){const n=e[0]-t[0],r=e[1]-t[1],o=e[0]-i[0],s=e[1]-i[1];return n*s-o*r==0&&n*o<=0&&r*s<=0}function mn(e,t,i=!1){let n=!1;for(let a=0,l=t.length;a<l;a++){const l=t[a];for(let t=0,a=l.length,c=a-1;t<a;c=t++){const a=l[c],u=l[t];if(pn(e,a,u))return i;(o=a)[1]>(r=e)[1]!=(s=u)[1]>r[1]&&r[0]<(s[0]-o[0])*(r[1]-o[1])/(s[1]-o[1])+o[0]&&(n=!n)}}var r,o,s;return n}function _n(e,t,i,n){const r=n[0]-i[0],o=n[1]-i[1],s=(e[0]-i[0])*o-r*(e[1]-i[1]),a=(t[0]-i[0])*o-r*(t[1]-i[1]);return s>0&&a<0||s<0&&a>0}function gn(e,t,i,n){return 0!=(r=[n[0]-i[0],n[1]-i[1]])[0]*(o=[t[0]-e[0],t[1]-e[1]])[1]-r[1]*o[0]&&!(!_n(e,t,i,n)||!_n(i,n,e,t));var r,o}function yn(e){const t=new Se(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),i=new Se(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(const n of e[0])t.x>n.x&&(t.x=n.x),t.y>n.y&&(t.y=n.y),i.x<n.x&&(i.x=n.x),i.y<n.y&&(i.y=n.y);return{min:t,max:i}}const vn=8192;function xn(e,t){const i=(180+e[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,r=Math.pow(2,t.z);return[Math.round(i*r*vn),Math.round(n*r*vn)]}function bn(e,t){for(let i=0;i<t.length;i++)if(mn(e,t[i]))return!0;return!1}function wn(e,t,i){for(const n of i)for(let i=0,r=n.length,o=r-1;i<r;o=i++)if(gn(e,t,n[o],n[i]))return!0;return!1}function Tn(e,t){for(let i=0;i<e.length;++i)if(!mn(e[i],t))return!1;for(let i=0;i<e.length-1;++i)if(wn(e[i],e[i+1],t))return!1;return!0}function Sn(e,t){for(let i=0;i<t.length;i++)if(Tn(e,t[i]))return!0;return!1}function En(e,t,i){const n=[];for(let r=0;r<e.length;r++){const o=[];for(let n=0;n<e[r].length;n++){const s=xn(e[r][n],i);dn(t,s),o.push(s)}n.push(o)}return n}function In(e,t,i){const n=[];for(let r=0;r<e.length;r++){const o=En(e[r],t,i);n.push(o)}return n}function An(e,t,i,n){if(e[0]<i[0]||e[0]>i[2]){const t=.5*n;let r=e[0]-i[0]>t?-n:i[0]-e[0]>t?n:0;0===r&&(r=e[0]-i[2]>t?-n:i[2]-e[0]>t?n:0),e[0]+=r}dn(t,e)}function Mn(e,t,i,n){const r=Math.pow(2,n.z)*vn,o=[n.x*vn,n.y*vn],s=[];if(!e)return s;for(const n of e)for(const e of n){const n=[e.x+o[0],e.y+o[1]];An(n,t,i,r),s.push(n)}return s}function Cn(e,t,i,n){const r=Math.pow(2,n.z)*vn,o=[n.x*vn,n.y*vn],s=[];if(!e)return s;for(const i of e){const e=[];for(const n of i){const i=[n.x+o[0],n.y+o[1]];dn(t,i),e.push(i)}s.push(e)}if(t[2]-t[0]<=r/2){(a=t)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const e of s)for(const n of e)An(n,t,i,r)}var a;return s}class Pn{constructor(e,t){this.type=xi,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Vi(e[1])){const t=e[1];if("FeatureCollection"===t.type)for(let e=0;e<t.features.length;++e){const i=t.features[e].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new Pn(t,t.features[e].geometry)}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new Pn(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new Pn(t,t)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=e.canonicalID();if(!r)return!1;if("Polygon"===t.type){const o=En(t.coordinates,n,r),s=Mn(e.geometry(),i,n,r);if(!fn(i,n))return!1;for(const e of s)if(!mn(e,o))return!1}if("MultiPolygon"===t.type){const o=In(t.coordinates,n,r),s=Mn(e.geometry(),i,n,r);if(!fn(i,n))return!1;for(const e of s)if(!bn(e,o))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=e.canonicalID();if(!r)return!1;if("Polygon"===t.type){const o=En(t.coordinates,n,r),s=Cn(e.geometry(),i,n,r);if(!fn(i,n))return!1;for(const e of s)if(!Tn(e,o))return!1}if("MultiPolygon"===t.type){const o=In(t.coordinates,n,r),s=Cn(e.geometry(),i,n,r);if(!fn(i,n))return!1;for(const e of s)if(!Sn(e,o))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}const Dn={kilometers:1,miles:1e3/1609.344,nauticalmiles:1e3/1852,meters:1e3,metres:1e3,yards:1e3/.9144,feet:1e3/.3048,inches:1e3/.0254},Rn=1/298.257223563,Ln=Rn*(2-Rn),zn=Math.PI/180;class On{static fromTile(e,t,i){const n=Math.PI*(1-2*(e+.5)/Math.pow(2,t)),r=Math.atan(.5*(Math.exp(n)-Math.exp(-n)))
2/zn;return new On(r,i)}static get units(){return Dn}constructor(e,t){if(void 0===e)throw new Error("No latitude given.");if(t&&!Dn[t])throw new Error(`Unknown unit ${t}. Use one of: ${Object.keys(Dn).join(", ")}`);const i=6378.137*zn*(t?Dn[t]:1),n=Math.cos(e*zn),r=1/(1-Ln*(1-n*n)),o=Math.sqrt(r);this.kx=i*o*n,this.ky=i*o*r*(1-Ln)}distance(e,t){const i=Bn(e[0]-t[0])*this.kx,n=(e[1]-t[1])*this.ky;return Math.sqrt(i*i+n*n)}bearing(e,t){const i=Bn(t[0]-e[0])*this.kx;return Math.atan2(i,(t[1]-e[1])*this.ky)/zn}destination(e,t,i){const n=i*zn;return this.offset(e,Math.sin(n)*t,Math.cos(n)*t)}offset(e,t,i){return[e[0]+t/this.kx,e[1]+i/this.ky]}lineDistance(e){let t=0;for(let i=0;i<e.length-1;i++)t+=this.distance(e[i],e[i+1]);return t}area(e){let t=0;for(let i=0;i<e.length;i++){const n=e[i];for(let e=0,r=n.length,o=r-1;e<r;o=e++)t+=Bn(n[e][0]-n[o][0])*(n[e][1]+n[o][1])*(i?-1:1)}return Math.abs(t)/2*this.kx*this.ky}along(e,t){let i=0;if(t<=0)return e[0];for(let n=0;n<e.length-1;n++){const r=e[n],o=e[n+1],s=this.distance(r,o);if(i+=s,i>t)return kn(r,o,(t-(i-s))/s)}return e[e.length-1]}pointToSegmentDistance(e,t,i){let[n,r]=t,o=Bn(i[0]-n)*this.kx,s=(i[1]-r)*this.ky;if(0!==o||0!==s){const t=(Bn(e[0]-n)*this.kx*o+(e[1]-r)*this.ky*s)/(o*o+s*s);t>1?(n=i[0],r=i[1]):t>0&&(n+=o/this.kx*t,r+=s/this.ky*t)}return o=Bn(e[0]-n)*this.kx,s=(e[1]-r)*this.ky,Math.sqrt(o*o+s*s)}pointOnLine(e,t){let i=1/0,n=e[0][0],r=e[0][1],o=0,s=0;for(let a=0;a<e.length-1;a++){let l=e[a][0],c=e[a][1],u=Bn(e[a+1][0]-l)*this.kx,h=(e[a+1][1]-c)*this.ky,d=0;0===u&&0===h||(d=(Bn(t[0]-l)*this.kx*u+(t[1]-c)*this.ky*h)/(u*u+h*h),d>1?(l=e[a+1][0],c=e[a+1][1]):d>0&&(l+=u/this.kx*d,c+=h/this.ky*d)),u=Bn(t[0]-l)*this.kx,h=(t[1]-c)*this.ky;const f=u*u+h*h;f<i&&(i=f,n=l,r=c,o=a,s=d)}return{point:[n,r],index:o,t:Math.max(0,Math.min(1,s))}}lineSlice(e,t,i){let n=this.pointOnLine(i,e),r=this.pointOnLine(i,t);if(n.index>r.index||n.index===r.index&&n.t>r.t){const e=n;n=r,r=e}const o=[n.point],s=n.index+1,a=r.index;!Fn(i[s],o[0])&&s<=a&&o.push(i[s]);for(let e=s+1;e<=a;e++)o.push(i[e]);return Fn(i[a],r.point)||o.push(r.point),o}lineSliceAlong(e,t,i){let n=0;const r=[];for(let o=0;o<i.length-1;o++){const s=i[o],a=i[o+1],l=this.distance(s,a);if(n+=l,n>e&&0===r.length&&r.push(kn(s,a,(e-(n-l))/l)),n>=t)return r.push(kn(s,a,(t-(n-l))/l)),r;n>e&&r.push(a)}return r}bufferPoint(e,t){const i=t/this.ky,n=t/this.kx;return[e[0]-n,e[1]-i,e[0]+n,e[1]+i]}bufferBBox(e,t){const i=t/this.ky,n=t/this.kx;return[e[0]-n,e[1]-i,e[2]+n,e[3]+i]}insideBBox(e,t){return Bn(e[0]-t[0])>=0&&Bn(e[0]-t[2])<=0&&e[1]>=t[1]&&e[1]<=t[3]}}function Fn(e,t){return e[0]===t[0]&&e[1]===t[1]}function kn(e,t,i){const n=Bn(t[0]-e[0]);return[e[0]+n*i,e[1]+(t[1]-e[1])*i]}function Bn(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}class Nn{constructor(e=[],t=(e,t)=>e<t?-1:e>t?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:i}=this,n=t[e];for(;e>0;){const r=e-1>>1,o=t[r];if(i(n,o)>=0)break;t[e]=o,e=r}t[e]=n}_down(e){const{data:t,compare:i}=this,n=this.length>>1,r=t[e];for(;e<n;){let n=1+(e<<1);const o=n+1;if(o<this.length&&i(t[o],t[n])<0&&(n=o),i(t[n],r)>=0)break;t[e]=t[n],e=n}t[e]=r}}var Vn=8192;function Un(e,t){return t.dist-e.dist}function jn(e){const t=[1/0,1/0,-1/0,-1/0];if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}function Gn(e){return e[1]-e[0]+1}function qn(e,t){const i=e[1]>=e[0]&&e[1]<t;return i||console.warn("Distance Expression: Index is out of range"),i}function Hn(e,t){if(e[0]>e[1])return[null,null];const i=Gn(e);if(t){if(2===i)return[e,null];const t=Math.floor(i/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}{if(1===i)return[e,null];const t=Math.floor(i/2)-1;return[[e[0],e[0]+t],[e[0]+t+1,e[1]]]}}function $n(e,t){const i=[1/0,1/0,-1/0,-1/0];if(!qn(t,e.length))return i;for(let n=t[0];n<=t[1];++n)dn(i,e[n]);return i}function Wn(e){const t=[1/0,1/0,-1/0,-1/0];for(let i=0;i<e.length;++i)for(let n=0;n<e[i].length;++n)dn(t,e[i][n]);return t}function Zn(e,t,i){if(jn(e)||jn(t))return NaN;let n=0,r=0;return e[2]<t[0]&&(n=t[0]-e[2]),e[0]>t[2]&&(n=e[0]-t[2]),e[1]>t[3]&&(r=e[1]-t[3]),e[3]<t[1]&&(r=t[1]-e[3]),i.distance([0,0],[n,r])}function Xn(e){return 360*e-180}function Yn(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180)
2)-90}function Kn(e,t){const i=Math.pow(2,t.z),n=(e.y/Vn+t.y)/i;return[Xn((e.x/Vn+t.x)/i),Yn(n)]}function Jn(e,t){const i=[];for(let n=0;n<e.length;++n)i.push(Kn(e[n],t));return i}function Qn(e,t,i){const n=i.pointOnLine(t,e).point;return i.distance(e,n)}function er(e,t,i,n,r){const o=i.slice(n[0],n[1]+1);let s=1/0;for(let i=t[0];i<=t[1];++i)if(0===(s=Math.min(s,Qn(e[i],o,r))))return 0;return s}function tr(e,t,i,n,r){const o=Math.min(r.pointToSegmentDistance(e,i,n),r.pointToSegmentDistance(t,i,n)),s=Math.min(r.pointToSegmentDistance(i,e,t),r.pointToSegmentDistance(n,e,t));return Math.min(o,s)}function ir(e,t,i,n,r){if(!qn(t,e.length)||!qn(n,i.length))return NaN;let o=1/0;for(let s=t[0];s<t[1];++s)for(let t=n[0];t<n[1];++t){if(gn(e[s],e[s+1],i[t],i[t+1]))return 0;o=Math.min(o,tr(e[s],e[s+1],i[t],i[t+1],r))}return o}function nr(e,t,i,n,r){if(!qn(t,e.length)||!qn(n,i.length))return NaN;let o=1/0;for(let s=t[0];s<=t[1];++s)for(let t=n[0];t<=n[1];++t)if(0===(o=Math.min(o,r.distance(e[s],i[t]))))return o;return o}function rr(e,t,i){if(mn(e,t,!0))return 0;let n=1/0;for(const r of t){const t=r.length;if(t<2)return console.warn("Distance Expression: Invalid polygon!"),NaN;if(r[0]!==r[t-1]&&0===(n=Math.min(n,i.pointToSegmentDistance(e,r[t-1],r[0]))))return n;if(0===(n=Math.min(n,Qn(e,r,i))))return n}return n}function or(e,t,i,n){if(!qn(t,e.length))return NaN;for(let n=t[0];n<=t[1];++n)if(mn(e[n],i,!0))return 0;let r=1/0;for(let o=t[0];o<t[1];++o)for(const t of i)for(let i=0,s=t.length,a=s-1;i<s;a=i++){if(gn(e[o],e[o+1],t[a],t[i]))return 0;r=Math.min(r,tr(e[o],e[o+1],t[a],t[i],n))}return r}function sr(e,t){for(const i of e)for(let e=0;e<=i.length-1;++e)if(mn(i[e],t,!0))return!0;return!1}function ar(e,t,i,n=1/0){const r=Wn(e),o=Wn(t);if(n!==1/0&&Zn(r,o,i)>=n)return n;if(fn(r,o)){if(sr(e,t))return 0}else if(sr(t,e))return 0;let s=n;for(const n of e)for(let e=0,r=n.length,o=r-1;e<r;o=e++)for(const r of t)for(let t=0,a=r.length,l=a-1;t<a;l=t++){if(gn(n[o],n[e],r[l],r[t]))return 0;s=Math.min(s,tr(n[o],n[e],r[l],r[t],i))}return s}function lr(e,t,i,n,r,o,s){if(null===o||null===s)return;const a=Zn($n(n,o),$n(r,s),i);a<t&&e.push({dist:a,range1:o,range2:s})}function cr(e,t,i,n,r=1/0){let o=Math.min(n.distance(e[0],i[0][0]),r);if(0===o)return o;const s=new Nn([{dist:0,range1:[0,e.length-1],range2:[0,0]}],Un),a=t?50:100,l=Wn(i);for(;s.length;){const r=s.pop();if(r.dist>=o)continue;const c=r.range1;if(Gn(c)<=a){if(!qn(c,e.length))return NaN;if(t){const t=or(e,c,i,n);if(0===(o=Math.min(o,t)))return o}else for(let t=c[0];t<=c[1];++t){const r=rr(e[t],i,n);if(0===(o=Math.min(o,r)))return o}}else{const i=Hn(c,t);if(null!==i[0]){const t=Zn($n(e,i[0]),l,n);t<o&&s.push({dist:t,range1:i[0],range2:[0,0]})}if(null!==i[1]){const t=Zn($n(e,i[1]),l,n);t<o&&s.push({dist:t,range1:i[1],range2:[0,0]})}}}return o}function ur(e,t,i,n,r,o=1/0){let s=Math.min(o,r.distance(e[0],i[0]));if(0===s)return s;const a=new Nn([{dist:0,range1:[0,e.length-1],range2:[0,i.length-1]}],Un),l=t?50:100,c=n?50:100;for(;a.length;){const o=a.pop();if(o.dist>=s)continue;const u=o.range1,h=o.range2;if(Gn(u)<=l&&Gn(h)<=c){if(!qn(u,e.length)||!qn(h,i.length))return NaN;if(t&&n?s=Math.min(s,ir(e,u,i,h,r)):t||n?t&&!n?s=Math.min(s,er(i,h,e,u,r)):!t&&n&&(s=Math.min(s,er(e,u,i,h,r))):s=Math.min(s,nr(e,u,i,h,r)),0===s)return s}else{const o=Hn(u,t),l=Hn(h,n);lr(a,s,r,e,i,o[0],l[0]),lr(a,s,r,e,i,o[0],l[1]),lr(a,s,r,e,i,o[1],l[0]),lr(a,s,r,e,i,o[1],l[1])}}return s}function hr(e,t,i,n,r=1/0){let o=r;const s=$n(e,[0,e.length-1]);for(const r of i)if(!(o!==1/0&&Zn(s,$n(r,[0,r.length-1]),n)>=o)&&(o=Math.min(o,ur(e,t,r,!0,n,o)),0===o))return o;return o}function dr(e,t,i,n,r=1/0){let o=r;const s=$n(e,[0,e.length-1]);for(const r of i){if(o!==1/0&&Zn(s,Wn(r),n)>=o)continue;const i=cr(e,t,r,n,o);if(isNaN(i))return i;if(0===(o=Math.min(o,i)))return o}return o}function fr(e){return"Point"===e||"MultiPoint"===e||"LineString"===e||"MultiLineString"===e||"Polygon"===e||"MultiPolygon"===e}class pr{constructor(e,t){this.type=yi,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'distance' expression requires either one argument, but found ' ${e.length-1} instead.`);if(Vi(e[1])){const t=e[1];if("FeatureCollection"===t.type){for(let e=0;e<t.features.length;++e)if(fr(t.features[e].geometry.type))return new pr(t,t.features[e].geometry)}else if("Feature"===t.type){if(fr(t.geometry.type))return new pr(t,t.geometry)}else if(fr(t.type))return new pr(t,t)}return t.error("'distance' expression needs to be an array with format ['Distance', GeoJSONObj].")}evaluate(e){const t=e.geometry(),i=e.canonicalID();if(null!=t&&null!=i){if("Point"===e.geometryType())return function(e,t,i){const n=[];for(const i of e)for(const e of i)n.push(Kn(e,t));const r=new On(n[0][1],"meters");return"Point"===i.type||"MultiPoint"===i.type||"LineString"===i.type?ur(n,!1,"Point"===i.type?[i.coordinates]:i.coordinates,"LineString"===i.type,r):"MultiLineString"===i.type?hr(n,!1,i.coordinates,r):"Polygon"===i.t
2ype||"MultiPolygon"===i.type?dr(n,!1,"Polygon"===i.type?[i.coordinates]:i.coordinates,r):null}(t,i,this.geometries);if("LineString"===e.geometryType())return function(e,t,i){const n=[];for(const i of e){const e=[];for(const n of i)e.push(Kn(n,t));n.push(e)}const r=new On(n[0][0][1],"meters");if("Point"===i.type||"MultiPoint"===i.type||"LineString"===i.type)return hr("Point"===i.type?[i.coordinates]:i.coordinates,"LineString"===i.type,n,r);if("MultiLineString"===i.type){let e=1/0;for(let t=0;t<i.coordinates.length;t++){const o=hr(i.coordinates[t],!0,n,r,e);if(isNaN(o))return o;if(0===(e=Math.min(e,o)))return e}return e}if("Polygon"===i.type||"MultiPolygon"===i.type){let e=1/0;for(let t=0;t<n.length;t++){const o=dr(n[t],!0,"Polygon"===i.type?[i.coordinates]:i.coordinates,r,e);if(isNaN(o))return o;if(0===(e=Math.min(e,o)))return e}return e}return null}(t,i,this.geometries);if("Polygon"===e.geometryType())return function(e,t,i){const n=[];for(const i of function(e){const t=e.length;if(t<=1)return[e];const i=[];let n,r;for(let o=0;o<t;o++){const t=hn(e[o]);0!==t&&(e[o].area=Math.abs(t),void 0===r&&(r=t<0),r===t<0?(n&&i.push(n),n=[e[o]]):n.push(e[o]))}return n&&i.push(n),i}(e)){const e=[];for(let n=0;n<i.length;++n)e.push(Jn(i[n],t));n.push(e)}const r=new On(n[0][0][0][1],"meters");if("Point"===i.type||"MultiPoint"===i.type||"LineString"===i.type)return dr("Point"===i.type?[i.coordinates]:i.coordinates,"LineString"===i.type,n,r);if("MultiLineString"===i.type){let e=1/0;for(let t=0;t<i.coordinates.length;t++){const o=dr(i.coordinates[t],!0,n,r,e);if(isNaN(o))return o;if(0===(e=Math.min(e,o)))return e}return e}return"Polygon"===i.type||"MultiPolygon"===i.type?function(e,t,i){let n=1/0;for(const r of e)for(const e of t){const t=ar(r,e,i,n);if(isNaN(t))return t;if(0===(n=Math.min(n,t)))return n}return n}("Polygon"===i.type?[i.coordinates]:i.coordinates,n,r):null}(t,i,this.geometries);console.warn("Distance Expression: currently only evaluates valid Point/LineString/Polygon geometries.")}else console.warn("Distance Expression: requirs valid feature and canonical information.");return null}eachChild(){}outputDefined(){return!0}serialize(){return["distance",this.geojson]}}function mr(e){if(e instanceof on){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof Pn)return!1;if(e instanceof pr)return!1;if(e instanceof br)return e.featureConstant;let t=!0;return e.eachChild(e=>{t&&!mr(e)&&(t=!1)}),t}function _r(e){if(e instanceof on&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild(e=>{t&&!_r(e)&&(t=!1)}),t}function gr(e,t){if(e instanceof on&&t.indexOf(e.name)>=0)return!1;let i=!0;return e.eachChild(e=>{i&&!gr(e,t)&&(i=!1)}),i}function yr(e,t,i){return[e,t,i].filter(Boolean).join("�")}function vr(e,t){switch(e){case"string":return ji(t);case"number":return+t;case"boolean":return!!t;case"color":return li.parse(t);case"formatted":return Fi.fromString(ji(t));case"resolvedImage":return Bi.build(ji(t))}return t}function xr(e,t,i,n){return void 0!==n&&(e=n*Math.round(e/n)),void 0!==t&&e<t&&(e=t),void 0!==i&&e>i&&(e=i),e}class br{constructor(e,t,i,n=!1){this.type=e,this.key=t,this.scope=i,this.featureConstant=n}static parse(e,t){let i=t.expectedType;if(null==i&&(i=Ti),e.length<2||e.length>3)return t.error("Invalid number of arguments for 'config' expression.");const n=t.parse(e[1],1);if(!(n instanceof Gi))return t.error("Key name of 'config' expression must be a string literal.");let r,o=!0;const s=ji(n.value);if(e.length>=3){const i=t.parse(e[2],2);if(!(i instanceof Gi))return t.error("Scope of 'config' expression must be a string literal.");r=ji(i.value)}if(t.options){const e=yr(s,r,t._scope),i=t.options.get(e);i&&(o=mr(i.value||i.default))}return new br(i,s,r,o)}evaluate(e){const t=yr(this.key,this.scope,e.scope),i=e.getConfig(t);if(!i)return null;const{type:n,value:r,values:o,minValue:s,maxValue:a,stepValue:l}=i,c=i.default.evaluate(e);let u=c;if(r){const t=e.scope;e.scope=(t||"").split("�").slice(1).join("�"),u=r.evaluate(e),e.scope=t}return n&&(u=vr(n,u)),void 0===u||void 0===s&&void 0===a&&void 0===l||("number"==typeof u?u=xr(u,s,a,l):Array.isArray(u)&&(u=u.map(e=>"number"==typeof e?xr(e,s,a,l):e))),void 0!==r&&void 0!==u&&o&&!o.includes(u)&&(u=c,n&&(u=vr(n,u))),(n&&n!==this.type||void 0!==u&&!Li(Ui(u),this.type))&&(u=vr(this.type.kind,u)),u}eachChild(){}outputDefined(){return!1}serialize(){const e=["config",this.key];return this.scope&&e.concat(this.scope),e}}class wr{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");const i=e[1];return t.scope.has(i)?new wr(i,t.scope.get(i)):t.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class Tr{constructor(e,t=[],i,n=new _i,r=[],o,s,a){this.registry=e,this.path=t,this.key=t.map(e=>"string"==typeof e?`['${e}']`:`[${e}]`).join(""),this.scope=n,this.errors=r,this.expectedType=i,this._scope=o,this.options=s,this.iconImageUseTheme=a}parse(e,t,i,n,r={}){return t||i?this.concat(t,null,i,n)._parse(e,r):this._parse(e,r)}parseObjectValue(e,t,i,n,r,o={}){return this.concat(t,i,n,r)._parse(e,o)}_parse(e,t){function i(e,t,i){return"assert"===i?new $i(t,[e]):"coerce"===i?new tn(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const n="string"==typeof e[0]?this.registry[e[0]]:void 0;if(n){let r=n.parse(e,this);if(!r)return null;if(this.expectedType){const e=this.expectedType,n=r.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==n.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==n.kind&&"string"!==n.kind){if(this.checkSubtype(e,n))return null}else r=i(r,e,t.typeAnnotation||"coerce");else r=i(r,e,t.typeAnnotation||"assert")}if(!(r instanceof Gi)&&"resolvedImage"!==r.type.kind&&Sr(r)){const t=new rn(this._scope,this.options,this.iconImageUseTheme);try{r=new Gi(r.type,r.evaluate(t))}catch(e){return this.error(e.message),null}}return r}return tn.parse(["to-array",e],this)}return this.error(void 0===e?"'undefined' value invalid. Use null instead.":"object"==typeof e?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,t,i,n){let r="number"==typeof e?this.path.concat(e):this.path;r="string"==typeof t?r.concat(t):r;const o=n?this.scope.concat(n):this.scope;return new Tr(this.registry,r,i||null,o,this.errors,this._scope,this.options,this.iconImageUseTheme)}error(e,...t){const i=`${this.key}${t.map(e=>`[${e}]`).join("")}`;this.errors.push(new mi(i,e))}checkSubtype(e,t){const i=Pi(e,t);return i&&this.error(i),i}}function Sr(e){if(e instanceof wr)return Sr(e.boundExpression);if(e instanceof on&&"error"===e.name)return!1;if(e instanceof an)return!1;
vendor: 5,206 bytes, line 2
2if(e instanceof Pn)return!1;if(e instanceof pr)return!1;if(e instanceof br)return!1;const t=e instanceof tn||e instanceof $i;let i=!0;return e.eachChild(e=>{i=t?i&&Sr(e):i&&e instanceof Gi}),!!i&&mr(e)&&gr(e,["zoom","heatmap-density","worldview","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])}function Er(e,t){const i=e.length-1;let n,r,o=0,s=i,a=0;for(;o<=s;)if(a=Math.floor((o+s)/2),n=e[a],r=e[a+1],n<=t){if(a===i||t<r)return a;o=a+1}else{if(!(n>t))throw new qi("Input is not a number.");s=a-1}return 0}class Ir{constructor(e,t,i){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[e,t]of i)this.labels.push(e),this.outputs.push(t)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");const i=t.parse(e[1],1,yi);if(!i)return null;const n=[];let r=null;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);for(let i=1;i<e.length;i+=2){const o=1===i?-1/0:e[i],s=e[i+1],a=i,l=i+1;if("number"!=typeof o)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',a);if(n.length&&n[n.length-1][0]>=o)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);const c=t.parse(s,l,r);if(!c)return null;r=r||c.type,n.push([o,c])}return new Ir(r,i,n)}evaluate(e){const t=this.labels,i=this.outputs;if(1===t.length)return i[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return i[0].evaluate(e);const r=t.length;return n>=t[r-1]?i[r-1].evaluate(e):i[Er(t,n)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){const e=["step",this.input.serialize()];for(let t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e}}const Ar=.95047,Mr=1.08883,Cr=4/29,Pr=6/29,Dr=3*Pr*Pr,Rr=Pr*Pr*Pr,Lr=Math.PI/180,zr=180/Math.PI;function Or(e){return e>Rr?Math.pow(e,1/3):e/Dr+Cr}function Fr(e){return e>Pr?e*e*e:Dr*(e-Cr)}function kr(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Br(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Nr(e){const t=Br(e.r),i=Br(e.g),n=Br(e.b),r=Or((.4124564*t+.3575761*i+.1804375*n)/Ar),o=Or((.2126729*t+.7151522*i+.072175*n)/1);return{l:116*o-16,a:500*(r-o),b:200*(o-Or((.0193339*t+.119192*i+.9503041*n)/Mr)),alpha:e.a}}function Vr(e){let t=(e.l+16)/116,i=isNaN(e.a)?t:t+e.a/500,n=isNaN(e.b)?t:t-e.b/200;return t=1*Fr(t),i=Ar*Fr(i),n=Mr*Fr(n),new li(kr(3.2404542*i-1.5371385*t-.4985314*n),kr(-.969266*i+1.8760108*t+.041556*n),kr(.0556434*i-.2040259*t+1.0572252*n),e.alpha)}function Ur(e,t,i){const n=t-e;return e+i*(n>180||n<-180?n-360*Math.round(n/360):n)}const jr={forward:Nr,reverse:Vr,interpolate:function(e,t,i){return{l:di(e.l,t.l,i),a:di(e.a,t.a,i),b:di(e.b,t.b,i),alpha:di(e.alpha,t.alpha,i)}}},Gr={forward:function(e){const{l:t,a:i,b:n}=Nr(e),r=Math.atan2(n,i)*zr;return{h:r<0?r+360:r,c:Math.sqrt(i*i+n*n),l:t,alpha:e.a}},reverse:function(e){const t=e.h*Lr,i=e.c;return Vr({l:e.l,a:Math.cos(t)*i,b:Math.sin(t)*i,alpha:e.alpha})},interpolate:function(e,t,i){return{h:Ur(e.h,t.h,i),c:di(e.c,t.c,i),l:di(e.l,t.l,i),alpha:di(e.alpha,t.alpha,i)}}};var qr=Object.freeze({__proto__:null,hcl:Gr,lab:jr});class Hr{constructor(e,t,i,n,r){this.type=e,this.operator=t,this.interpolation=i,this.input=n,this.labels=[],this.outputs=[];for(const[e,t]of r)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,i,n){let r=0;if("exponential"===e.name)r=$r(t,e.base,i,n);else if("linear"===e.name)r=$r(t,1,i,n);else if("cubic-bezier"===e.name){const o=e.controlPoints;r=new Te(o[0],o[1],o[2],o[3]).solve($r(t,1,i,n))}return r}static parse(e,t){let[i,n,r,...o]=e;if(!Array.isArray(n)||0===n.length)return t.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const e=n[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return t.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const e=n.slice(1);if(4!==e.length||e.some(e=>"number"!=typeof e||e<0||e>1))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length-1>3&&(e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(r=t.parse(r,2,yi),!r)return null;const s=[];let a=null;"interpolate-hcl"===i||"interpolate-lab"===i?a=bi:t.expectedType&&"value"!==t.expectedType.kind&&(a=t.expectedType);for(let e=0;e<o.length;e+=2){const i=o[e],n=o[e+1],r=e+3,l=e+4;if("number"!=typeof i)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not c
2omputed expressions) for the input values.',r);if(s.length&&s[s.length-1][0]>=i)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',r);const c=t.parse(n,l,a);if(!c)return null;a=a||c.type,s.push([i,c])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new Hr(a,i,n,r,s):t.error(`Type ${Mi(a)} is not interpolatable.`)}evaluate(e){const t=this.labels,i=this.outputs;if(1===t.length)return i[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return i[0].evaluate(e);const r=t.length;if(n>=t[r-1])return i[r-1].evaluate(e);const o=Er(t,n),s=Hr.interpolationFactor(this.interpolation,n,t[o],t[o+1]),a=i[o].evaluate(e),l=i[o+1].evaluate(e);return"interpolate"===this.operator?pi[this.type.kind.toLowerCase()](a,l,s):"interpolate-hcl"===this.operator?Gr.reverse(Gr.interpolate(Gr.forward(a),Gr.forward(l),s)):jr.reverse(jr.interpolate(jr.forward(a),jr.forward(l),s))}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){let e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier",...this.interpolation.controlPoints];const t=[this.operator,e,this.input.serialize()];for(let e=0;e<this.labels.length;e++)t.push(this.labels[e],this.outputs[e].serialize());return t}}function $r(e,t,i,n){const r=n-i,o=e-i;return 0===r?0:1===t?o/r:(Math.pow(t,o)-1)/(Math.pow(t,r)-1)}class Wr{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expectected at least one argument.");let i=null;const n=t.expectedType;n&&"value"!==n.kind&&(i=n);const r=[];for(const n of e.slice(1)){const e=t.parse(n,1+r.length,i,void 0,{typeAnnotation:"omit"});if(!e)return null;i=i||e.type,r.push(e)}const o=n&&r.some(e=>Pi(n,e.type));return new Wr(o?Ti:i,r)}evaluate(e){let t,i=null,n=0;for(const r of this.args){if(n++,i=r.evaluate(e),i&&i instanceof Bi&&!i.available&&(t||(t=i),i=null,n===this.args.length))return t;if(null!==i)break}return i}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=["coalesce"];return this.eachChild(t=>{e.push(t.serialize())}),e}}class Zr{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const i=[];for(let n=1;n<e.length-1;n+=2){const r=e[n];if("string"!=typeof r)return t.error(`Expected string, but found ${typeof r} instead.`,n);if(/[^a-zA-Z0-9_]/.test(r))return t.error("Variable names must contain only alphanumeric characters or '_'.",n);const o=t.parse(e[n+1],n+1);if(!o)return null;i.push([r,o])}const n=t.parse(e[e.length-1],e.length-1,t.expectedType,i);return n?new Zr(i,n):null}outputDefined(){return this.result.outputDefined()}serialize(){const e=["let"];for(const[t,i]of this.bindings)e.push(t,i.serialize());return e.push(this.result.serialize()),e}}class Xr{constructor(e,t,i){this.type=e,this.index=t,this.input=i}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,yi),n=t.parse(e[2],2,Ai(t.expectedType||Ti));return i&&n?new Xr(n.type.itemType,i,n):null}evaluate(e){const t=this.index.evaluate(e),i=this.input.evaluate(e);if(t<0)throw new qi("Array index out of bounds: negative index");if(t>=i.length)throw new qi("Array index out of bounds: index exceeds array size");if(t!==Math.floor(t))throw new qi("Array index must be an integer. Use at-interpolated for fractional indices");return i[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class Yr{constructor(e,t,i){this.type=e,this.index=t,this.input=i}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,yi),n=t.parse(e[2],2,Ai(t.expectedType||Ti));return i&&n?new Yr(n.type.itemType,i,n):null}evaluate(e){const t=this.index.evaluate(e),i=this.input.evaluate(e);if(t<0)throw new qi(`Array index out of bounds: ${t} < 0.`);if(t>i.length-1)throw new qi(`Array index out of bounds: ${t} > ${i.length-1}.`);if(t===Math.floor(t))return i[t];const n=Math.floor(t),r=Math.ceil(t),o=i[n],s=i[r];if("number"!=typeof o||"number"!=typeof s)throw new qi(`Cannot interpolate between non-number values at index ${t}.`);const a=t-n;return o*(1-a)+s*a}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at-interpolated",this.index.serialize(),this.input.serialize()]}}class Kr{constructor(e,t){this.type=xi,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,Ti),n=t.parse(e[2],2,Ti);return i&&n?Di(i.type,[xi,vi,yi,gi,Ti])?new Kr(i,n):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Mi(i.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(null==i)return!1;if(!Ri(t,["boolean","string","number","null"]))throw new qi(`Expected first argument to be of type boolean, string, number or null, but found ${Mi(Ui(t))} instead.`);if(!Ri(i,["string","array"]))throw new qi(`Expected second argument to be of type array or string, but found ${Mi(Ui(i))} instead.`);return i.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class Jr{constructor(e,t,i){this.type=yi,this.needle=e,this.haystack=t,this.fromIndex=i}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,Ti),n=t.parse(e[2],2,Ti);if(!i||!n)return null;if(!Di(i.type,[xi,vi,yi,gi,Ti]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Mi(i.type)} instead`);if(4===e.length){const r=t.parse(e[3],3,yi);return r?new Jr(i,n,r):null}return new Jr(i,n)}evaluate(e){const t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!Ri(t,["boolean","string","number","null"]))throw new qi(`Expected first argument to be of type boolean, string, number or null, but found ${Mi(Ui(t))} instead.`);if(!Ri(i,["string","array"]))throw new qi(`Expected second argument to be of type array or string, but found ${Mi(Ui(i))} instead.`);if(this.fromIndex){const n=this.fromIndex.evaluate(e);return i.indexOf(t,n)}return i.indexOf(t)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class Qr{constructor(e,t,i,n,r,o){this.inputType=e,this.type=t,this.input=i,this.cases=n,this.outputs=r,this.otherwise=o}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let i,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);const r={},o=[];for(let s=2;s<e.length-1;s+=2){let a=e[s];const l=e[s+1];
vendor: 4,463 bytes, line 2
2Array.isArray(a)||(a=[a]);const c=t.concat(s);if(0===a.length)return c.error("Expected at least one branch label.");for(const e of a){if("number"!=typeof e&&"string"!=typeof e)return c.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return c.error("Numeric branch labels must be integer values.");if(i){if(c.checkSubtype(i,Ui(e)))return null}else i=Ui(e);if(void 0!==r[String(e)])return c.error("Branch labels must be unique.");r[String(e)]=o.length}const u=t.parse(l,s,n);if(!u)return null;n=n||u.type,o.push(u)}const s=t.parse(e[1],1,Ti);if(!s)return null;const a=t.parse(e[e.length-1],e.length-1,n);return a?"value"!==s.type.kind&&t.concat(1).checkSubtype(i,s.type)?null:new Qr(i,n,s,r,o,a):null}evaluate(e){const t=this.input.evaluate(e);return(Li(Ui(t),this.inputType)&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],t=Object.keys(this.cases).sort(),i=[],n={};for(const e of t){const t=n[this.cases[e]];void 0===t?(n[this.cases[e]]=i.length,i.push([this.cases[e],[e]])):i[t][1].push(e)}const r=e=>"number"===this.inputType.kind?Number(e):e;for(const[t,n]of i)e.push(1===n.length?r(n[0]):n.map(r)),e.push(this.outputs[t].serialize());return e.push(this.otherwise.serialize()),e}}class eo{constructor(e,t,i){this.type=e,this.branches=t,this.otherwise=i}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let i;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);const n=[];for(let r=1;r<e.length-1;r+=2){const o=t.parse(e[r],r,xi);if(!o)return null;const s=t.parse(e[r+1],r+1,i);if(!s)return null;n.push([o,s]),i=i||s.type}const r=t.parse(e[e.length-1],e.length-1,i);return r?new eo(i,n,r):null}evaluate(e){for(const[t,i]of this.branches)if(t.evaluate(e))return i.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,i]of this.branches)e(t),e(i);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild(t=>{e.push(t.serialize())}),e}}class to{constructor(e,t,i,n){this.type=e,this.input=t,this.beginIndex=i,this.endIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,Ti),n=t.parse(e[2],2,yi);if(!i||!n)return null;if(!Di(i.type,[Ai(Ti),vi,Ti]))return t.error(`Expected first argument to be of type array or string, but found ${Mi(i.type)} instead`);if(4===e.length){const r=t.parse(e[3],3,yi);return r?new to(i.type,i,n,r):null}return new to(i.type,i,n)}evaluate(e){const t=this.input.evaluate(e),i=this.beginIndex.evaluate(e);if(!Ri(t,["string","array"]))throw new qi(`Expected first argument to be of type array or string, but found ${Mi(Ui(t))} instead.`);if(this.endIndex){const n=this.endIndex.evaluate(e);return t.slice(i,n)}return t.slice(i)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}class io{constructor(e,t){this.type=Ai(vi),this.str=e,this.delimiter=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,vi),n=t.parse(e[2],2,vi);return i&&n?new io(i,n):void 0}evaluate(e){const t=this.str.evaluate(e),i=this.delimiter.evaluate(e);return t.split(i)}eachChild(e){e(this.str),e(this.delimiter)}outputDefined(){return!1}serialize(){return["split",this.str.serialize(),this.delimiter.serialize()]}}function no(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function ro(e,t,i,n){return 0===n.compare(t,i)}function oo(e,t,i){const n="=="!==e&&"!="!==e;
vendor: 8,529 bytes, line 2
2return class r{constructor(e,t,i){this.type=xi,this.lhs=e,this.rhs=t,this.collator=i,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const i=e[0];let o=t.parse(e[1],1,Ti);if(!o)return null;if(!no(i,o.type))return t.concat(1).error(`"${i}" comparisons are not supported for type '${Mi(o.type)}'.`);let s=t.parse(e[2],2,Ti);if(!s)return null;if(!no(i,s.type))return t.concat(2).error(`"${i}" comparisons are not supported for type '${Mi(s.type)}'.`);if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return t.error(`Cannot compare types '${Mi(o.type)}' and '${Mi(s.type)}'.`);n&&("value"===o.type.kind&&"value"!==s.type.kind?o=new $i(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new $i(o.type,[s])));let a=null;if(4===e.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return t.error("Cannot use collator to compare non-string types.");if(a=t.parse(e[3],3,Si),!a)return null}return new r(o,s,a)}evaluate(r){const o=this.lhs.evaluate(r),s=this.rhs.evaluate(r);if(n&&this.hasUntypedArgument){const t=Ui(o),i=Ui(s);if(t.kind!==i.kind||"string"!==t.kind&&"number"!==t.kind)throw new qi(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${i.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const e=Ui(o),i=Ui(s);if("string"!==e.kind||"string"!==i.kind)return t(r,o,s)}return this.collator?i(r,o,s,this.collator.evaluate(r)):t(r,o,s)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}serialize(){const t=[e];return this.eachChild(e=>{t.push(e.serialize())}),t}}}const so=oo("==",function(e,t,i){return t===i},ro),ao=oo("!=",function(e,t,i){return t!==i},function(e,t,i,n){return!ro(0,t,i,n)}),lo=oo("<",function(e,t,i){return t<i},function(e,t,i,n){return n.compare(t,i)<0}),co=oo(">",function(e,t,i){return t>i},function(e,t,i,n){return n.compare(t,i)>0}),uo=oo("<=",function(e,t,i){return t<=i},function(e,t,i,n){return n.compare(t,i)<=0}),ho=oo(">=",function(e,t,i){return t>=i},function(e,t,i,n){return n.compare(t,i)>=0});class fo{constructor(e,t,i,n,r,o){this.type=vi,this.number=e,this.locale=t,this.currency=i,this.unit=n,this.minFractionDigits=r,this.maxFractionDigits=o}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const i=t.parse(e[1],1,yi);if(!i)return null;const n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");let r=null;if(n.locale&&(r=t.parseObjectValue(n.locale,2,"locale",vi),!r))return null;let o=null;if(n.currency&&(o=t.parseObjectValue(n.currency,2,"currency",vi),!o))return null;let s=null;if(n.unit&&(s=t.parseObjectValue(n.unit,2,"unit",vi),!s))return null;let a=null;if(n["min-fraction-digits"]&&(a=t.parseObjectValue(n["min-fraction-digits"],2,"min-fraction-digits",yi),!a))return null;let l=null;return n["max-fraction-digits"]&&(l=t.parseObjectValue(n["max-fraction-digits"],2,"max-fraction-digits",yi),!l)?null:new fo(i,r,o,s,a,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class po{constructor(e){this.type=yi,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const i=t.parse(e[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?t.error(`Expected argument of type string or array, but found ${Mi(i.type)} instead.`):new po(i):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new qi(`Expected value to be of type string or array, but found ${Mi(Ui(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild(t=>{e.push(t.serialize())}),e}}function mo(e){return function(){e=1831565813+(e|=0)|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}const _o={"==":so,"!=":ao,">":co,"<":lo,">=":ho,"<=":uo,array:$i,at:Xr,"at-interpolated":Yr,boolean:$i,case:eo,coalesce:Wr,collator:an,format:Wi,image:Zi,in:Kr,"index-of":Jr,interpolate:Hr,"interpolate-hcl":Hr,"interpolate-lab":Hr,length:po,let:Zr,literal:Gi,match:Qr,number:$i,"number-format":fo,object:$i,slice:to,step:Ir,string:$i,"to-boolean":tn,"to-color":tn,"to-number":tn,"to-string":tn,var:wr,within:Pn,distance:pr,config:br,split:io};function go(e,[t,i,n,r]){t=t.evaluate(e),i=i.evaluate(e),n=n.evaluate(e);const o=r?r.evaluate(e):1,s=Ni(t,i,n,o);if(s)throw new qi(s);return new li(t/255,i/255,n/255,o)}function yo(e,[t,i,n,r]){t=t.evaluate(e),i=i.evaluate(e),n=n.evaluate(e);const o=r?r.evaluate(e):1,s=function(e,t,i,n){return"number"==typeof e&&e>=0&&e<=360?"number"==typeof t&&t>=0&&t<=100&&"number"==typeof i&&i>=0&&i<=100?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid hsla value [${[e,t,i,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid hsla value [${("number"==typeof n?[e,t,i,n]:[e,t,i]).join(", ")}]: 's', and 'l' must be between 0 and 100.`:`Invalid hsla value [${("number"==typeof n?[e,t,i,n]:[e,t,i]).join(", ")}]: 'h' must be between 0 and 360.`}(t,i,n,o);if(s)throw new qi(s);const a=`hsla(${t}, ${i}%, ${n}%, ${o})`,l=li.parse(a);if(!l)throw new qi(`Failed to parse HSLA color: ${a}`);return l}function vo(e,t){return e in t}function xo(e,t){const i=t[e];return void 0===i?null:i}function bo(e){return{type:e}}function wo(e){if(e instanceof br)return new Set([e.key]);let t=new Set;return e.eachChild(e=>{t=new Set([...t,...wo(e)])}),t}function To(e){if(e instanceof on&&"is-active-floor"===e.name)return!0;let t=!1;return e.eachChild(e=>{!t&&To(e)&&(t=!0)}),t}function So(e){return{result:"success",value:e}}function Eo(e){return{result:"error",value:e}}function Io(e,t){return!!e&&!!e.parameters&&e.parameters.indexOf(t)>-1}function Ao(e){return"data-driven"===e["property-type"]}function Mo(e){return Io(e.expression,"measure-light")}function Co(e){return Io(e.expression,"zoom")}function Po(e){return!!e.expression&&e.expression.interpolated}function Do(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Ro(e){return e}function Lo(e,t){const i="color"===t.type,n=e.stops&&"object"==typeof e.stops[0][0],r=n||!(n||void 0!==e.property),o=e.type||(Po(t)?"exponential":"interval");if(i&&((e=Object.assign({},e)).stops&&(e.stops=e.stops.map(e=>[e[0],li.parse(e[1])])),e.default=li.parse(e.default?e.default:t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!qr[e.colorSpace])throw new Error(`Unknown color space: ${e.colorSpace}`);let s,a,l;if("exponential"===o)s=ko;else if("interval"===o)s=Fo;else if("categorical"===o){s=Oo,a=Object.create(null);for(const t of e.stops)a[t[0]]=t[1];l=typeof e.stops[0][0]}else{if("identity"!==o)throw new Error(`Unknown function type "${o}"`);s=Bo}if(n){const i={},n=[];for(let t=0;t<e.stops.length;t++){const r=e.stops[t],o=r[0].zoom;void 0===i[o]&&(i[o]={zoom:o,type:e.type,property:e.property,default:e.default,stops:[]},n.push(o)),i[o].stops.push([r[0].value,r[1]])}const r=[];for(const e of n)r.push([i[e].zoom,Lo(i[e],t)]);const o={name:"linear"};return{kind:"composite",interpolationType:o,interpolationFactor:Hr.interpolationFactor.bind(void 0,o),zoomStops:r.map(e=>e[0]),evaluate:({zoom:i},n)=>ko({stops:r,base:e.base},t,i).evaluate(i,n)}}if(r){const i="exponential"===o?{name:"exponential",base:void 0!==e.base?e.base
vendor: 9,872 bytes, line 2
2:1}:null;return{kind:"camera",interpolationType:i,interpolationFactor:Hr.interpolationFactor.bind(void 0,i),zoomStops:e.stops.map(e=>e[0]),evaluate:({zoom:i})=>s(e,t,i,a,l)}}return{kind:"source",evaluate(i,n){const r=n&&n.properties?n.properties[e.property]:void 0;return void 0===r?zo(e.default,t.default):s(e,t,r,a,l)}}}function zo(e,t,i){return void 0!==e?e:void 0!==t?t:void 0!==i?i:void 0}function Oo(e,t,i,n,r){return zo(typeof i===r?n[i]:void 0,e.default,t.default)}function Fo(e,t,i){if(!Ji(i))return zo(e.default,t.default);const n=e.stops.length;if(1===n)return e.stops[0][1];if(i<=e.stops[0][0])return e.stops[0][1];if(i>=e.stops[n-1][0])return e.stops[n-1][1];const r=Er(e.stops.map(e=>e[0]),i);return e.stops[r][1]}function ko(e,t,i){const n=void 0!==e.base?e.base:1;if(!Ji(i))return zo(e.default,t.default);const r=e.stops.length;if(1===r)return e.stops[0][1];if(i<=e.stops[0][0])return e.stops[0][1];if(i>=e.stops[r-1][0])return e.stops[r-1][1];const o=Er(e.stops.map(e=>e[0]),i),s=function(e,t,i,n){const r=n-i,o=e-i;return 0===r?0:1===t?o/r:(Math.pow(t,o)-1)/(Math.pow(t,r)-1)}(i,n,e.stops[o][0],e.stops[o+1][0]),a=e.stops[o][1],l=e.stops[o+1][1];let c=pi[t.type]||Ro;if(e.colorSpace&&"rgb"!==e.colorSpace){const t=qr[e.colorSpace];c=(e,i)=>t.reverse(t.interpolate(t.forward(e),t.forward(i),s))}return"function"==typeof a.evaluate?{evaluate(...e){const t=a.evaluate.apply(void 0,e),i=l.evaluate.apply(void 0,e);if(void 0!==t&&void 0!==i)return c(t,i,s)}}:c(a,l,s)}function Bo(e,t,i){return"color"===t.type?i=li.parse(i):"formatted"===t.type?i=Fi.fromString(i.toString()):"resolvedImage"===t.type?i=Bi.build(i.toString()):Xi(i)===t.type||"enum"===t.type&&t.values[i]||(i=void 0),zo(i,e.default,t.default)}on.register(_o,{error:[{kind:"error"},[vi],(e,[t])=>{throw new qi(t.evaluate(e))}],typeof:[vi,[Ti],(e,[t])=>Mi(Ui(t.evaluate(e)))],"to-rgba":[Ai(yi,4),[bi],(e,[t])=>t.evaluate(e).toNonPremultipliedRenderColor(null).toArray()],"to-hsla":[Ai(yi,4),[bi],(e,[t])=>t.evaluate(e).toNonPremultipliedRenderColor(null).toHslaArray()],rgb:[bi,[yi,yi,yi],go],rgba:[bi,[yi,yi,yi,yi],go],hsl:[bi,[yi,yi,yi],yo],hsla:[bi,[yi,yi,yi,yi],yo],has:{type:xi,overloads:[[[vi],(e,[t])=>vo(t.evaluate(e),e.properties())],[[vi,wi],(e,[t,i])=>vo(t.evaluate(e),i.evaluate(e))]]},get:{type:Ti,overloads:[[[vi],(e,[t])=>xo(t.evaluate(e),e.properties())],[[vi,wi],(e,[t,i])=>xo(t.evaluate(e),i.evaluate(e))]]},"feature-state":[Ti,[vi],(e,[t])=>xo(t.evaluate(e),e.featureState||{})],properties:[wi,[],e=>e.properties()],"geometry-type":[vi,[],e=>e.geometryType()],worldview:[vi,[],e=>e.globals.worldview||""],"is-active-floor":[xi,bo(vi),(e,t)=>{if(!(e.globals.activeFloors&&e.globals.activeFloors.size>0))return!1;const i=e.globals.activeFloors;return t.some(t=>{const n=t.evaluate(e);return i.has(n)})}],id:[Ti,[],e=>e.id()],zoom:[yi,[],e=>e.globals.zoom],pitch:[yi,[],e=>e.globals.pitch||0],"distance-from-center":[yi,[],e=>e.distanceFromCenter()],"measure-light":[yi,[vi],(e,[t])=>e.measureLight(t.evaluate(e))],"heatmap-density":[yi,[],e=>e.globals.heatmapDensity||0],"line-progress":[yi,[],e=>e.globals.lineProgress||0],"raster-value":[yi,[],e=>e.globals.rasterValue||0],"raster-particle-speed":[yi,[],e=>e.globals.rasterParticleSpeed||0],"sky-radial-progress":[yi,[],e=>e.globals.skyRadialProgress||0],accumulated:[Ti,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[yi,bo(yi),(e,t)=>{let i=0;for(const n of t)i+=n.evaluate(e);return i}],"*":[yi,bo(yi),(e,t)=>{let i=1;for(const n of t)i*=n.evaluate(e);return i}],"-":{type:yi,overloads:[[[yi,yi],(e,[t,i])=>t.evaluate(e)-i.evaluate(e)],[[yi],(e,[t])=>-t.evaluate(e)]]},"/":[yi,[yi,yi],(e,[t,i])=>t.evaluate(e)/i.evaluate(e)],"%":[yi,[yi,yi],(e,[t,i])=>t.evaluate(e)%i.evaluate(e)],ln2:[yi,[],()=>Math.LN2],pi:[yi,[],()=>Math.PI],e:[yi,[],()=>Math.E],"^":[yi,[yi,yi],(e,[t,i])=>Math.pow(t.evaluate(e),i.evaluate(e))],sqrt:[yi,[yi],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[yi,[yi],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[yi,[yi],(e,[t])=>Math.log(t.evaluate(e))],log2:[yi,[yi],(e,[t])=>Math.log2(t.evaluate(e))],sin:[yi,[yi],(e,[t])=>Math.sin(t.evaluate(e))],cos:[yi,[yi],(e,[t])=>Math.cos(t.evaluate(e))],tan:[yi,[yi],(e,[t])=>Math.tan(t.evaluate(e))],asin:[yi,[yi],(e,[t])=>Math.asin(t.evaluate(e))],acos:[yi,[yi],(e,[t])=>Math.acos(t.evaluate(e))],atan:[yi,[yi],(e,[t])=>Math.atan(t.evaluate(e))],min:[yi,bo(yi),(e,t)=>Math.min(...t.map(t=>t.evaluate(e)))],max:[yi,bo(yi),(e,t)=>Math.max(...t.map(t=>t.evaluate(e)))],abs:[yi,[yi],(e,[t])=>Math.abs(t.evaluate(e))],round:[yi,[yi],(e,[t])=>{const i=t.evaluate(e);return i<0?-Math.round(-i):Math.round(i)}],floor:[yi,[yi],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[yi,[yi],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[xi,[vi,Ti],(e,[t,i])=>e.properties()[t.value]===i.value],"filter-id-==":[xi,[Ti],(e,[t])=>e.id()===t.value],"filter-type-==":[xi,[vi],(e,[t])=>e.geometryType()===t.value],"filter-<":[xi,[vi,Ti],(e,[t,i])=>{const n=e.properties()[t.value],r=i.value;return typeof n==typeof r&&n<r}],"filter-id-<":[xi,[Ti],(e,[t])=>{const i=e.id(),n=t.value;return typeof i==typeof n&&i<n}],"filter->":[xi,[vi,Ti],(e,[t,i])=>{const n=e.properties()[t.value],r=i.value;return typeof n==typeof r&&n>r}],"filter-id->":[xi,[Ti],(e,[t])=>{const i=e.id(),n=t.value;return typeof i==typeof n&&i>n}],"filter-<=":[xi,[vi,Ti],(e,[t,i])=>{const n=e.properties()[t.value],r=i.value;return typeof n==typeof r&&n<=r}],"filter-id-<=":[xi,[Ti],(e,[t])=>{const i=e.id(),n=t.value;return typeof i==typeof n&&i<=n}],"filter->=":[xi,[vi,Ti],(e,[t,i])=>{const n=e.properties()[t.value],r=i.value;return typeof n==typeof r&&n>=r}],"filter-id->=":[xi,[Ti],(e,[t])=>{const i=e.id(),n=t.value;return typeof i==typeof n&&i>=n}],"filter-has":[xi,[Ti],(e,[t])=>t.value in e.properties()],"filter-has-id":[xi,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[xi,[Ai(vi)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[xi,[Ai(Ti)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[xi,[vi,Ai(Ti)],(e,[t,i])=>i.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[xi,[vi,Ai(Ti)],(e,[t,i])=>function(e,t,i,n){for(;i<=n;){const r=i+n>>1;if(t[r]===e)return!0;t[r]>e?n=r-1:i=r+1}return!1}(e.properties()[t.value],i.value,0,i.value.length-1)],all:{type:xi,overloads:[[[xi,xi],(e,[t,i])=>t.evaluate(e)&&i.evaluate(e)],[bo(xi),(e,t)=>{for(const i of t)if(!i.evaluate(e))return!1;return!0}]]},any:{type:xi,overloads:[[[xi,xi],(e,[t,i])=>t.evaluate(e)||i.evaluate(e)],[bo(xi),(e,t)=>{for(const i of t)if(i.evaluate(e))return!0;return!1}]]},"!":[xi,[xi],(e,[t])=>!t.evaluate(e)],"is-supported-script":[xi,[vi],(e,[t])=>{const i=e.globals&&e.globals.isSupportedScript;return!i||i(t.evaluate(e))}],upcase:[vi,[vi],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[vi,[vi],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[vi,bo(Ti),(e,t)=>t.map(t=>ji(t.evaluate(e))).join("")],"resolved-locale":[vi,[Si],(e,[t])=>t.evaluate(e).resolvedLocale()],random:[yi,[yi,yi,Ti],(e,t)=>{const[i,n,r]=t.map(t=>t.evaluate(e));if(i>n)return i;if(i===n)return i;let o;if("string"==typeof r)o=function(e){let t=0;if(0===e.length)return t;for(let i=0;i<e.length;i++)t=(t<<5)-t+e.charCodeAt(i),t|=0;return t}(r);else{if("number"!=typeof r)throw new qi(`Invalid seed input: ${r}`);o=r}return i+mo(o)()*(n-i)}]});class No{constructor(e,t,i,n,r){this.expression=e,this._warningHistory={},this._scope=i,this._options=n,this._iconImageUseTheme=r,this._evaluator=new rn(i,n,r),this._defaultValue=t?function(e){return"color"===e.type&&(Do(e.default)||Array.isArray(e.default))?new li(0,0,0,0):"color"===e.type?li.parse(e.default)||null:void 0===e.default?null:e.default}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null,this.configDependencies=wo(e),this.isIndoorDependent=To(e)}evaluateWithoutErrorHandling(e,t,i,n,r,o,s,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=i,this._evaluator.canonical=n||null,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o,this._evaluator.featureTileCoord=s||null,this._evaluator.featureDistanceData=a||null,this.expression.evaluate(this._evaluator)}evaluate(e,t,i,n,r,o,s,a,l){this._evaluator||(this._evaluator=new rn(this._scope,this._options,this._iconImageUseTheme)),this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=i||null,this._evaluator.canonical=n||null,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o||null,this._evaluator.featureTileCoord=s||null,this._evaluator.featureDistanceData=a||null,this._evaluator.iconImageUseTheme=l||null;try{const e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new qi(`Expected value to be one of ${Object.keys(this._enumValues).map(e=>JSON.stringify(e)).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){const t=e;return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(`Failed to evaluate expression "${JSON.stringify(this.expression.serialize())}". ${t.message}`)),this._defaultValue}}}function Vo(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in _o}function Uo(e,t,i,n,r){const o=new Tr(_o,[],t?function(e){const t={color:bi,string:vi,number:yi,enum:vi,boolean:xi,formatted:Ei,resolvedImage:Ii};return"array"===e.type?Ai(t[e.value]||Ti,e.length):t[e.type]}(t):void 0,void 0,void 0,i,n,r),s=o.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return s?So(new No(s,t,i,n,r)):Eo(o.errors)}class jo{constructor(e,t,i,n){this.kind=e,this._styleExpression=t,this.isLightConstant=i,this.isLineProgressConstant=n,this.isStateDependent="constant"!==e&&!_r(t.expression),this.configDependencies=wo(t.expression),this.isIndo
2orDependent=To(t.expression)}evaluateWithoutErrorHandling(e,t,i,n,r,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,n,r,o)}evaluate(e,t,i,n,r,o,s){return this._styleExpression.evaluate(e,t,i,n,r,o,void 0,void 0,s)}}class Go{constructor(e,t,i,n,r,o){this.kind=e,this.zoomStops=i,this._styleExpression=t,this.isStateDependent="camera"!==e&&!_r(t.expression),this.isIndoorDependent=To(t.expression),this.isLightConstant=r,this.isLineProgressConstant=o,this.configDependencies=wo(t.expression),this.interpolationType=n}evaluateWithoutErrorHandling(e,t,i,n,r,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,n,r,o)}evaluate(e,t,i,n,r,o){return this._styleExpression.evaluate(e,t,i,n,r,o)}interpolationFactor(e,t,i){return this.interpolationType?Hr.interpolationFactor(this.interpolationType,e,t,i):0}}function qo(e,t,i,n,r){if("error"===(e=Uo(e,t,i,n,r)).result)return e;const o=e.value.expression,s=mr(o);if(!s&&!Ao(t))return Eo([new mi("","data expressions not supported")]);const a=gr(o,["zoom","pitch","distance-from-center"]);if(!a&&!Co(t))return Eo([new mi("","zoom expressions not supported")]);const l=gr(o,["measure-light"]);if(!l&&!Mo(t))return Eo([new mi("","measure-light expression not supported")]);const c=gr(o,["line-progress"]);if(!c&&!function(e){return Io(e.expression,"line-progress")}(t))return Eo([new mi("","line-progress expression not supported")]);const u=t.expression&&t.expression.relaxZoomRestriction,h=$o(o);return h||a||u?h instanceof mi?Eo([h]):h instanceof Hr&&!Po(t)?Eo([new mi("",'"interpolate" expressions cannot be used with this property')]):So(h?new Go(s&&c?"camera":"composite",e.value,h.labels,h instanceof Hr?h.interpolation:void 0,l,c):new jo(s&&c?"constant":"source",e.value,l,c)):Eo([new mi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression, or in the properties of atmosphere.')])}class Ho{constructor(e,t){this._parameters=e,this._specification=t,Object.assign(this,Lo(this._parameters,this._specification))}static deserialize(e){return new Ho(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function $o(e){let t=null;if(e instanceof Zr)t=$o(e.result);else if(e instanceof Wr){for(const i of e.args)if(t=$o(i),t)break}else(e instanceof Ir||e instanceof Hr)&&e.input instanceof on&&"zoom"===e.input.name&&(t=e);return t instanceof mi||e.eachChild(e=>{const i=$o(e);i instanceof mi?t=i:t&&i&&t!==i&&(t=new mi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}var Wo,Zo,Xo=function(){if(Zo)return Wo;Zo=1,Wo=t;var e=3;function t(t,i,n){var r=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var o=new Int32Array(this.arrayBuffer);t=o[0],this.d=(i=o[1])+2*(n=o[2]);for(var s=0;s<this.d*this.d;s++){var a=o[e+s],l=o[e+s+1];r.push(a===l?null:o.subarray(a,l))}var c=o[e+r.length+1];this.keys=o.subarray(o[e+r.length],c),this.bboxes=o.subarray(c),this.insert=this._insertReadonly}else{this.d=i+2*n;for(var u=0;u<this.d*this.d;u++)r.push([]);this.keys=[],this.bboxes=[]}this.n=i,this.extent=t,this.padding=n,this.scale=i/t,this.uid=0;var h=n/i*t;this.min=-h,this.max=t+h}return t.prototype.insert=function(e,t,i,n,r){this._forEachCell(t,i,n,r,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(r)},t.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},t.prototype._insertCell=function(e,t,i,n,r,o){this.cells[r].push(o)},t.prototype.query=function(e,t,i,n,r){var o=this.min,s=this.max;if(e<=o&&t<=o&&s<=i&&s<=n&&!r)return Array.prototype.slice.call(this.keys);var a=[];return this._forEachCell(e,t,i,n,this._queryCell,a,{},r),a},t.prototype._queryCell=function(e,t,i,n,r,o,s,a){var l=this.cells[r];if(null!==l)for(var c=this.keys,u=this.bboxes,h=0;h<l.length;h++){var d=l[h];if(void 0===s[d]){var f=4*d;(a?a(u[f+0],u[f+1],u[f+2],u[f+3]):e<=u[f+2]&&t<=u[f+3]&&i>=u[f+0]&&n>=u[f+1])?(s[d]=!0,o.push(c[d])):s[d]=!1}}},t.prototype._forEachCell=function(e,t,i,n,r,o,s,a){for(var l=this._convertToCellCoord(e),c=this._convertToCellCoord(t),u=this._convertToCellCoord(i),h=this._convertToCellCoord(n),d=l;d<=u;d++)for(var f=c;f<=h;f++){var p=this.d*f+d;if((!a||a(this._convertFromCellCoord(d),this._convertFromCellCoord(f),this._convertFromCellCoord(d+1),this._convertFromCellCoord(f+1)))&&r.call(this,e,t,i,n,p,o,s,a))return}},t.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},t.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},t.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,i=e+this.cells.length+1+1,n=0,r=0;r<this.cells.length;r++)n+=this.cells[r].length;var o=new Int32Array(i+n+this.keys.length+this.bboxes.length);o[0]=this.extent,o[1]=this.n,o[2]=this.padding;
2for(var s=i,a=0;a<t.length;a++){var l=t[a];o[e+a]=s,o.set(l,s),s+=l.length}return o[e+t.length]=s,o.set(this.keys,s),o[e+t.length+1]=s+=this.keys.length,o.set(this.bboxes,s),s+=this.bboxes.length,o.buffer},Wo}(),Yo=be(Xo);const Ko={};function Jo(e,t,i={}){Object.defineProperty(e,"_classRegistryKey",{value:t,writable:!1}),Ko[t]={klass:e,omit:i.omit||[]}}Jo(Object,"Object"),Yo.serialize=function(e,t){const i=e.toArrayBuffer();return t&&t.add(i),{buffer:i}},Yo.deserialize=function(e){return new Yo(e.buffer)},Object.defineProperty(Yo,"name",{value:"Grid"}),Jo(Yo,"Grid"),delete Se.prototype.constructor,Jo(li,"Color"),Jo(Error,"Error"),Jo(Fi,"Formatted"),Jo(Oi,"FormattedSection"),Jo(Ft,"AJAXError"),Jo(Bi,"ResolvedImage"),Jo(Ho,"StylePropertyFunction"),Jo(No,"StyleExpression",{omit:["_evaluator"]}),Jo(ri,"ImageId"),Jo(ki,"ImageVariant"),Jo(Go,"ZoomDependentExpression"),Jo(jo,"ZoomConstantExpression"),Jo(on,"CompoundExpression",{omit:["_evaluate"]});for(const e in _o)Ko[_o[e]._classRegistryKey]||Jo(_o[e],`Expression${e}`);function Qo(e){return e&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function es(e,t){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(Qo(e)||e instanceof ImageBitmap)return t&&t.add(e),e;if(ArrayBuffer.isView(e))return t&&t.add(e.buffer),e;if(e instanceof ImageData)return t&&t.add(e.data.buffer),e;if(Array.isArray(e)){const i=[];for(const n of e)i.push(es(n,t));return i}if(e instanceof Map){const i={$name:"Map",entries:[]};for(const[n,r]of e.entries())i.entries.push(es(n),es(r,t));return i}if(e instanceof Set){const t={$name:"Set"};let i=0;for(const n of e.values())t[++i]=es(n);return t}if("bigint"==typeof e)return{$name:"BigInt",value:e.toString()};if("object"==typeof e){const i=e.constructor,n=i._classRegistryKey;if(!n)throw new Error(`Can't serialize object of unregistered class "${i.name}".`);const r=i.serialize?i.serialize(e,t):{};if(!i.serialize){for(const i in e)e.hasOwnProperty(i)&&(Ko[n].omit.indexOf(i)>=0||(r[i]=es(e[i],t)));e instanceof Error&&(r.message=e.message)}if(r.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==n&&(r.$name=n),r}throw new Error("can't serialize object of type "+typeof e)}function ts(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||Qo(e)||e instanceof ImageBitmap||ArrayBuffer.isView(e)||e instanceof ImageData)return e;if(Array.isArray(e))return e.map(ts);if("object"==typeof e){const t=e.$name||"Object";if("Map"===t){const t=e.entries||[],i=new Map;for(let e=0;e<t.length;e+=2)i.set(ts(t[e]),ts(t[e+1]));return i}if("Set"===t){const t=new Set;for(const i of Object.keys(e))"$name"!==i&&t.add(ts(e[i]));return t}if("BigInt"===t)return BigInt(e.value);const{klass:i}=Ko[t];if(!i)throw new Error(`Can't deserialize unregistered class "${t}".`);if(i.deserialize)return i.deserialize(e);const n=Object.create(i.prototype);for(const t of Object.keys(e))"$name"!==t&&(n[t]=ts(e[t]));return n}throw new Error("can't deserialize object of type "+typeof e)}const is=e=>e>=128&&e<=255,ns=e=>e>=1536&&e<=1791,rs=e=>e>=1872&&e<=1919,os=e=>e>=2208&&e<=2303,ss=e=>e>=4352&&e<=4607,as=e=>e>=5120&&e<=5759,ls=e=>e>=6016&&e<=6143,cs=e=>e>=6320&&e<=6399,us=e=>e>=8192&&e<=8303,hs=e=>e>=8448&&e<=8527,ds=e=>e>=8528&&e<=8591,fs=e=>e>=8960&&e<=9215,ps=e=>e>=9216&&e<=9279,ms=e=>e>=9280&&e<=9311,_s=e=>e>=9312&&e<=9471,gs=e=>e>=9632&&e<=9727,ys=e=>e>=9728&&e<=9983,vs=e=>e>=11008&&e<=11263,xs=e=>e>=11904&&e<=12031,bs=e=>e>=12032&&e<=12255,ws=e=>e>=12272&&e<=12287,Ts=e=>e>=12288&&e<=12351,Ss=e=>e>=12352&&e<=12447,Es=e=>e>=12448&&e<=12543,Is=e=>e>=12544&&e<=12591,As=e=>e>=12592&&e<=12687,Ms=e=>e>=12688&&e<=12703,Cs=e=>e>=12704&&e<=12735,Ps=e=>e>=12736&&e<=12783,Ds=e=>e>=12784&&e<=12799,Rs=e=>e>=12800&&e<=13055,Ls=e=>e>=13056&&e<=13311,zs=e=>e>=13312&&e<=19903,Os=e=>e>=19904&&e<=19967,Fs=e=>e>=19968&&e<=40959,ks=e=>e>=40960&&e<=42127,Bs=e=>e>=42128&&e<=42191,Ns=e=>e>=43360&&e<=43391,Vs=e=>e>=44032&&e<=55215,Us=e=>e>=55216&&e<=55295,js=e=>e>=57344&&e<=63743,Gs=e=>e>=63744&&e<=64255,qs=e=>e>=64336&&e<=65023,Hs=e=>e>=65040&&e<=65055,$s=e=>e>=65072&&e<=65103,Ws=e=>e>=65104&&e<=65135,Zs=e=>e>=65136&&e<=65279,Xs=e=>e>=65280&&e<=65519,Ys=e=>e>=66736&&e<=66815,Ks=e=>e>=131072&&e<=173791;function Js(e){for(const t of e)if(ta(t.charCodeAt(0)))return!0;return!1}function Qs(e){for(const t of e)if(!ea(t.charCodeAt(0)))return!1;return!0}function ea(e){return!(ns(e)||rs(e)||os(e)||qs(e)||Zs(e))}function ta(e){return!(746!==e&&747!==e&&(e<4352||!(Cs(e)||Is(e)||$s(e)&&!(e>=65097&&e<=65103)||Gs(e)||Ls(e)||xs(e)||Ps(e)||!(!Ts(e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||zs(e)||Fs(e)||Rs(e)||As(e)||Ns(e)||Us(e)||ss(e)||Vs(e)||Ss(e)||ws(e)||Ms(e)||bs(e)||Ds(e)||Es(e)&&12540!==e||!(!Xs(e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!Ws(e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||as(e)||cs(e)||Hs(e)||Os(e)||ks(e)||Bs(e))))}function ia(e){return!(ta(e)||function(e){return!!(is(e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||us(e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||hs(e)||ds(e)||fs(e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||ps(e)&&9251!==e||ms(e)||_s(e)||gs(e)||ys(e)&&!(e>=9754&&e<=9759)||vs(e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Ts(e)||Es(e)||js(e)||$s(e)||Ws(e)||Xs(e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e)}(e))}function na(e){return ns(e)||rs(e)||os(e)||qs(e)||Zs(e)}function ra(e){return e>=1424&&e<=2303||qs(e)||Zs(e)}function oa(e,t){return!(!t&&ra(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||ls(e))}function sa(e){for(const t of e)if(ra(t.charCodeAt(0)))return!0;return!1}const aa={unavailable:"unavailable",deferred:"deferred",loading:"loading",parsing:"parsing",parsed:"parsed",loaded:"loaded",error:"error"};let la=null,ca=aa.unavailable,ua=null;const ha=function(e){e&&"string"==typeof e&&e.indexOf("NetworkError")>-1&&(ca=aa.error),la&&la(e)};function da(){fa.fire(new Qt("pluginStateChange",{pluginStatus:ca,pluginURL:ua}))}const fa=new ni,pa=function(){return ca},ma=function(){if(ca!==aa.deferred||!ua)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");ca=aa.loading,da(),ua&&Nt({url:ua},e=>{e?ha(e):(ca=aa.loaded,da())})},_a={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>ca===aa.loaded||null!=_a.applyArabicShaping,isLoading:()=>ca===aa.loading,setState(e){ca=e.pluginStatus,ua=e.pluginURL},isParsing:()=>ca===aa.parsing,isParsed:()=>ca===aa.parsed,getPluginURL:()=>ua};class ga{constructor(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.transition=t.transition,this.pitch=t.pitch,this.brightness=t.brightness,this.worldview=t.worldview,this.activeFloors=t.activeFloors):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0,this.brightness=0)}isSupportedScript(e){return function(e,t){for(const i of e)if(!oa(i.charCodeAt(0),t))return!1;return!0}(e,_a.isLoaded())}}class ya{constructor(e,t,i,n,r){this.property=e,this.value=t,this.expression=function(e,t,i,n,r){if(Do(e))return new Ho(e,t);if(Vo(e)||Array.isArray(e)&&e.length>0){const o=qo(e,t,i,n,r);if("error"===o.result)throw new Error(o.value.map(e=>`${e.key}: ${e.message}`).join(", "));return o.value}{let i=e;return"string"==typeof e&&"color"===t.type&&(i=li.parse(e)),{kind:"constant",configDependencies:new Set,isIndoorDependent:!1,evaluate:()=>i}}}(void 0===t?e.specification.default:t,e.specification,i,n,r)}
vendor: 4,720 bytes, line 2
2isIndoorDependent(){return this.expression.isIndoorDependent}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,t,i,n){return this.property.possiblyEvaluate(this,e,t,i,n)}}class va{constructor(e,t,i,n){this.property=e,this.value=new ya(e,void 0,t,i,n)}transitioned(e,t){return new ba(this.property,this.value,t,Object.assign({},e.transition,this.transition),e.now)}untransitioned(){return new ba(this.property,this.value,null,{},0)}}class xa{constructor(e,t,i,n){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._scope=t,this._options=i,this._iconImageUseTheme=n,this._isIndoorDependent=!1,this.configDependencies=new Set}getValue(e){return qe(this._values[e].value.value)}setValue(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new va(this._values[e].property,this._scope,this._options,this._iconImageUseTheme)),this._values[e].value=new ya(this._values[e].property,null===t?void 0:qe(t),this._scope,this._options,this._iconImageUseTheme),this._values[e].value.expression.configDependencies&&(this.configDependencies=new Set([...this.configDependencies,...this._values[e].value.expression.configDependencies]),this._isIndoorDependent=this._isIndoorDependent||this._values[e].value.isIndoorDependent())}setTransitionOrValue(e,t){t&&(this._options=t);const i=this._properties.properties;if(e)for(const t in e){const n=e[t];if(t.endsWith("-transition")){const e=t.slice(0,-11);i[e]&&this.setTransition(e,n)}else i.hasOwnProperty(t)&&this.setValue(t,n)}}getTransition(e){return qe(this._values[e].transition)}setTransition(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new va(this._values[e].property)),this._values[e].transition=qe(t)||void 0}serialize(){const e={};for(const t of Object.keys(this._values)){const i=this.getValue(t);void 0!==i&&(e[t]=i);const n=this.getTransition(t);void 0!==n&&(e[`${t}-transition`]=n)}return e}transitioned(e,t){const i=new wa(this._properties);for(const n of Object.keys(this._values))i._values[n]=this._values[n].transitioned(e,t._values[n]);return i}untransitioned(){const e=new wa(this._properties);for(const t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}isIndoorDependent(){return this._isIndoorDependent}}class ba{constructor(e,t,i,n,r){const o=n.delay||0,s=n.duration||0;r=r||0,this.property=e,this.value=t,this.begin=r+o,this.end=this.begin+s,e.specification.transition&&(n.delay||n.duration)&&(this.prior=i)}possiblyEvaluate(e,t,i){const n=e.now||0,r=this.value.possiblyEvaluate(e,t,i),o=this.prior;if(o){if(n>this.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(n<this.begin)return o.possiblyEvaluate(e,t,i);{const s=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(e,t,i),r,De(s))}}return r}}class wa{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,i){const n=new Ea(this._properties);for(const r of Object.keys(this._values))n._values[r]=this._values[r].possiblyEvaluate(e,t,i);return n}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Ta{constructor(e,t,i,n){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._scope=t,this._options=i,this._iconImageUseTheme=n,this._isIndoorDependent=!1,this.configDependencies=new Set}getValue(e){return qe(this._values[e].value)}setValue(e,t){this._values[e]=new ya(this._values[e].property,null===t?void 0:qe(t),this._scope,this._options,this._iconImageUseTheme),this._values[e].expression.configDependencies&&(this.configDependencies=new Set([...this.configDependencies,...this._values[e].expression.configDependencies]),this._isIndoorDependent=this._isIndoorDependent||this._values[e].isIndoorDependent())}serialize(){const e={};for(const t of Object.keys(this._values)){const i=this.getValue(t);void 0!==i&&(e[t]=i)}return e}possiblyEvaluate(e,t,i,n){const r=new Ea(this._properties);for(const o of Object.keys(this._values))r._values[o]=this._values[o].possiblyEvaluate(e,t,i,n);return r}isIndoorDependent(){return this._isIndoorDependent}}class Sa{constructor(e,t,i,n){this.property=e,this.value=t,this.parameters=i,this.iconImageUseTheme=n}isConstant(){return"constant"===this.value.kind}constantOr(e){return"constant"===this.value.kind?this.value.value:e}evaluate(e,t,i,n){return this.property.evaluate(this.value,this.parameters,e,t,i,n,this.iconImageUseTheme)}}class Ea{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Ia{constructor(e){this.specification=e}
vendor: 5,709 bytes, line 2
2possiblyEvaluate(e,t){return e.expression.evaluate(t)}interpolate(e,t,i){const n=pi[this.specification.type];return n?n(e,t,i):e}}class Aa{constructor(e,t){this.specification=e,this.overrides=t}possiblyEvaluate(e,t,i,n,r){return"constant"===e.expression.kind||"camera"===e.expression.kind?new Sa(this,{kind:"constant",value:e.expression.evaluate(t,null,{},i,n,void 0,r)},t):new Sa(this,e.expression,t,r)}interpolate(e,t,i){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new Sa(this,{kind:"constant",value:void 0},e.parameters);const n=pi[this.specification.type];return n?new Sa(this,{kind:"constant",value:n(e.value.value,t.value.value,i)},e.parameters):e}evaluate(e,t,i,n,r,o,s){return"constant"===e.kind?e.value:e.evaluate(t,i,n,r,o,void 0,s)}}class Ma{constructor(e){this.specification=e}possiblyEvaluate(e,t,i,n){return!!e.expression.evaluate(t,null,{},i,n)}interpolate(){return!1}}class Ca{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];const t=new ga(0,{});for(const i in e){const n=e[i];n.specification.overridable&&this.overridableProperties.push(i);const r=this.defaultPropertyValues[i]=new ya(n,void 0),o=this.defaultTransitionablePropertyValues[i]=new va(n);this.defaultTransitioningPropertyValues[i]=o.untransitioned(),this.defaultPossiblyEvaluatedValues[i]=r.possiblyEvaluate(t)}}}Jo(Aa,"DataDrivenProperty"),Jo(Ia,"DataConstantProperty"),Jo(Ma,"ColorRampProperty");var Pa=JSON.parse('{"$version":8,"$root":{"version":{"type":"enum","values":[8]},"fragment":{"type":"boolean"},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360},"pitch":{"type":"number","default":0},"light":{"type":"light"},"lights":{"type":"array","value":"light-3d"},"terrain":{"type":"terrain","optional":true},"fog":{"type":"fog"},"snow":{"type":"snow"},"rain":{"type":"rain"},"camera":{"type":"camera"},"color-theme":{"type":"colorTheme"},"indoor":{"type":"indoor"},"imports":{"type":"array","value":"import"},"iconsets":{"type":"iconsets"},"schema":{"type":"schema"},"sources":{"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string","default":"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"type":"array","value":"layer"},"models":{"type":"models"},"featuresets":{"type":"featuresets"}},"featuresets":{"*":{"type":"featureset"}},"featureset":{"metadata":{"type":"*"},"selectors":{"type":"array","value":"selector"}},"selector":{"layer":{"type":"string"},"properties":{"type":"selectorProperty"},"featureNamespace":{"type":"string"},"_uniqueFeatureID":{"type":"boolean"}},"selectorProperty":{"*":{"type":"*"}},"model":{"type":"string"},"import":{"id":{"type":"string"},"url":{"type":"string"},"config":{"type":"config"},"data":{"type":"$root"},"color-theme":{"type":"colorTheme","optional":true}},"config":{"*":{"type":"*"}},"schema":{"*":{"type":"option"}},"option":{"default":{"type":"*","expression":{}},"type":{"type":"enum","values":{"string":1,"number":1,"boolean":1,"color":1}},"array":{"type":"boolean"},"minValue":{"type":"number"},"maxValue":{"type":"number"},"stepValue":{"type":"number"},"values":{"type":"array","value":"*"},"metadata":{"type":"*"}},"models":{"*":{"type":"model"}},"light-3d":{"id":{"type":"string"},"properties":{"type":"properties"},"type":{"type":"enum","values":{"ambient":{},"directional":{},"flat":{}}}},"properties":["properties_light_directional","properties_light_ambient","properties_light_flat"],"properties_light_directional":{"direction":{"type":"array","default":[210,30],"minimum":[0,0],"maximum":[360,90],"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"use-theme":true,"transition":true},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"cast-shadows":{"type":"boolean","default":false},"shadow-quality":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"parameters":["zoom"]}},"shadow-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"properties_light_ambient":{"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"use-theme":true,"transition":true},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"properties_light_flat":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"use-theme":true,"transition":true},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"iconsets":{"*":{"type":"iconset"}},"iconset":["iconset_sprite","iconset_source"],"iconset_sprite":{"type":{"type":"enum","values":{"sprite":1}},"url":{"type":"string"}},"iconset_source":{"type":{"type":"enum","values":{"source":1}}
2,"source":{"type":"string"}},"sources":{"*":{"type":"source"}},"source":["source_vector","source_raster","source_raster_dem","source_raster_array","source_geojson","source_video","source_image","source_model"],"source_vector":{"type":{"type":"enum","values":{"vector":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"extra_bounds":{"type":"array","value":{"type":"array","value":"number","length":4}},"scheme":{"type":"enum","values":{"xyz":1,"tms":1},"default":"xyz"},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"attribution":{"type":"string"},"promoteId":{"type":"promoteId"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster":{"type":{"type":"enum","values":{"raster":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"extra_bounds":{"type":"array","value":{"type":"array","value":"number","length":4}},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"scheme":{"type":"enum","values":{"xyz":1,"tms":1},"default":"xyz"},"attribution":{"type":"string"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"type":"enum","values":{"raster-dem":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"extra_bounds":{"type":"array","value":{"type":"array","value":"number","length":4}},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"attribution":{"type":"string"},"encoding":{"type":"enum","values":{"terrarium":1,"mapbox":1},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_array":{"type":{"type":"enum","values":{"raster-array":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"extra_bounds":{"type":"array","value":{"type":"array","value":"number","length":4}},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"attribution":{"type":"string"},"rasterLayers":{"type":"*"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"type":"enum","values":{"geojson":1}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"},"dynamic":{"type":"boolean","default":false}},"source_video":{"type":{"type":"enum","values":{"video":1}},"urls":{"type":"array","value":"string"},"coordinates":{"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"type":"enum","values":{"image":1}},"url":{"type":"string"},"coordinates":{"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"modelNodeOverride":{"orientation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360}},"modelNodeOverrides":{"*":{"type":"modelNodeOverride"}},"modelMaterialOverride":{"model-color":{"type":"color"},"model-color-mix-intensity":{"type":"number"},"model-opacity":{"type":"number"},"model-emissive-strength":{"type":"number"}},"modelMaterialOverrides":{"*":{"type":"modelMaterialOverride"}},"modelSourceModel":{"uri":{"type":"string"},"position":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[-180,-90],"maximum":[180,90]},"orientation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360},"nodeOverrides":{"type":"modelNodeOverrides"},"materialOverrides":{"type":"modelMaterialOverrides"},"nodeOverrideNames":{"type":"array","value":"string"},"materialOverrideNames":{"type":"array","value":"string"},"featureProperties":{"type":"*"}},"modelSourceModels":{"*":{"type":"modelSourceModel"}},"source_model":{"type":{"type":"enum","values":{"model":1,"batched-model":1}},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"tiles":{"type":"array","value":"string"},"models":{"type":"modelSourceModels"}},"layer":{"id":{"type":"string"},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"building":{},"raster":{},"raster-particle":{},"hillshade":{},"model":{},"background":{},"sky":{},"slot":{},"clip":{}}},"metadata":{"type":"*"},"source":{"type":"string"},"source-layer":{"type":"string"},"slot":{"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"},"appearances":{"type":"array","value":"appearance","supported-layer-types":["symbol"]}},"appearance":{"condition":{"type":"boolean","expression":{"interpolated":true,"parameters":["zoom","pitch","feature","feature-state","measure-light","distance-from-center"]},"property-type":"data-driven"},"name":{"type":"string"},"properties":{"type":"*"}},"layout":["layout_clip","layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_building","layout_symbol","layout_raster","layout_raster-particle","layout_hillshade","layout_background","layout_sky","layout_model"],"layout_background":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_model":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}},"model-id":{"type":"string","default":"","property-type":"data-driven","expression":{"parameters":["zoom","feature"]}}},"layout_clip":{"clip-layer-types":{"type":"array","value":"enum","values":{"model":1,"symbol":1},"default":[],"expression":{}},"clip-layer-scope":{"type":"array","value":"string","default":[],"expression":{}}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}},"fill-elevation-reference":{"type":"enum","values":{"none":1,"hd-road-base":1,"hd-road-markup":1},"default":"none","expression":{}},"fill-construct-bridge-guard-rail":{"type":"boolean","default":"true","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"}},"layout_circle":{"circle-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"circle-elevation-reference":{"type":"enum","values":{"none":1,"hd-road-markup":1},"default":"none","expression":{}},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}},"fill-extrusion-edge-radius":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{}}},"layout_building":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}},"building-facade":{"type":"boolean","default":false,"expression":{"parameters":["feature"]},"property-type":"data-driven"},"building-facade-floors":{"type":"number","minimum":1,"maximum":200,"default":3,"property-type":"data-driven","expression":{"parameters":["feature"]}},"building-facade-unit-width":{"type":"number","minimum":1,"maximum":20,"default":3.1,"property-type":"data-driven","expression":{"parameters":["feature"]}},"building-facade-window":{"type":"array","length":2,"value":"number","minimum":0.1,"maximum":1,"default":[0.9,0.9],"property-type":"data-driven","expression":{"parameters":["feature"]}},"building-roof-shape":{"type":"enum","values":{"flat":1,"hipped":1,"gabled":1,"parapet":1,"mansard":1,"skillion":1,"pyramidal":1},"default":"flat","expression":{"parameters":["feature"]},"property-type":"data-driven"},"building-height":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{},"property-type":"data-driven"},"building-base":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{},"property-type":"data-driven"},"building-flood-light-wall-radius":{"property-type":"data-driven","type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"building-flood-light-ground-radius":{"property-type":"data-driven","type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"building-flip-roof-orientation":{"property-type":"data-driven","type":"boolean","default":false,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":1,"round":1,"square":1},"default":"butt","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":1,"round":1,"miter":1,"none":1},"default":"miter","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"expression":{"interpolated":true,"parameters":["zoom"]}},"line-round-limit":{"type":"number","default":1.05,"expression":{"interpolated":true,"parameters":["zoom"]}},"line-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-z-offset":{"type":"number","default":0,"expression":{"parameters":["zoom","feature","line-progress"]},"property-type":"data-driven"},"line-elevation-reference":{"type":"enum","values":{"none":1,"sea":1,"ground":1,"hd-road-markup":1},"default":"none","expression":{}},"line-cross-slope":{"type":"number","expression":{}},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}},"line-width-unit":{"type":"enum","values":{"pixels":1,"meters":1},"default":"pixels","expression":{"parameters":["zoom"]}}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":1,"line":1,"line-center":1},"default":"point","expression":{"parameters":["zoom"]}},"symbol-spacing":{"type":"number","default":250,"minimum":1,"expression":{"interpolated":true,"parameters":["zoom"]}},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"symbol-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":1,"viewport-y":1,"source":1},"default":"auto","expression":{"parameters":["zoom"]}},"symbol-z-elevate":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"symbol-elevation-reference":{"type":"enum","values":{"sea":1,"ground":1,"hd-road-markup":1},"default":"ground","expression":{"parameters":["zoom"]}},"icon-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]}},"icon-size":{"type":"number","default":1,"minimum":0,"appearance":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-size-scale-range":{"type":"array","value":"number","length":2,"default":[0.8,2],"minimum":[0.1,0.1],"maximum":[10,10],"expression":{}},"icon-text-fit":{"type":"enum","values":{"none":1,"width":1,"height":1,"both":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-image":{"type":"resolvedImage","tokens":true,"appearance":true,"use-theme":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"appearance":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]}},"icon-keep-upright":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"appearance":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"}
2,"icon-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]}},"text-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]}},"text-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]}},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-font":{"type":"array","value":"string","default":["Open Sans Regular","Arial Unicode MS Regular"],"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"appearance":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size-scale-range":{"type":"array","value":"number","length":2,"default":[0.8,2],"minimum":[0.1,0.1],"maximum":[10,10],"expression":{}},"text-max-width":{"type":"number","default":10,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":1,"left":1,"center":1,"right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","default":0,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["zoom","feature"]}},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"expression":{"parameters":["zoom"]}},"text-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"expression":{"interpolated":true,"parameters":["zoom"]}},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":1,"vertical":1},"expression":{"parameters":["zoom"]}},"text-rotate":{"type":"number","default":0,"period":360,"appearance":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]}},"text-keep-upright":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"text-transform":{"type":"enum","values":{"none":1,"uppercase":1,"lowercase":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-offset":{"type":"array","value":"number","length":2,"default":[0,0],"appearance":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"text-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"text-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_raster-particle":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_hillshade":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_raster":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_raster-particle":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_clip":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_model":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_building":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":1,"!=":1,">":1,">=":1,"<":1,"<=":1,"in":1,"!in":1,"all":1,"any":1,"none":1,"has":1,"!has":1}},"geometry_type":{"type":"enum","values":{"Point":1,"LineString":1,"Polygon":1}},"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":1,"exponential":1,"interval":1,"categorical":1},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":1,"lab":1,"hcl":1},"default":"rgb"},"default":{"type":"*"}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"high-color":{"type":"color","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"space-color":{"type":"color","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"horizon-blend":{"type":"number","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"star-intensity":{"type":"number","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vertical-range":{"type":"array","default":[0,0],"minimum":0,"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}}},"snow":{"density":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,0.85],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,0.3],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette-color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"center-thinning":{"type":"number","default":0.4,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"direction":{"type":"array","default":[0,50],"minimum":0,"maximum":360,"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"flake-size":{"type":"number","default":0.71,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true}},"rain":{"density":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,0.5],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"color":{"type":"color","default":["interpolate",["linear"],["measure-light","brightness"],0,"#03113d",0.3,"#a8adbc"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"opacity":{"type":"number","default":["interpolate",["linear"],["measure-light","brightness"],0,0.88,1,0.7],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette-color":{"type":"color","default":["interpolate",["linear"],["measure-light","brightness"],0,"#001736",0.3,"#464646"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"center-thinning":{"type":"number","default":0.57,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"direction":{"type":"array","default":[0,80],"minimum":0,"maximum":360,"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"droplet-size":{"type":"array","default":[2.6,18.2],"minimum":0,"maximum":50,"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"distortion-strength":{"type":"number","default":0.7,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true}},"camera":{"camera-projection":{"type":"enum","values":{"perspective":1,"orthographic":1},"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"default":"perspective"}},"colorTheme":{"data":{"type":"string","expression":{}}},"indoor_source":{"sourceId":{"type":"string"},"sourceLayers":{"type":"array","value":"string"}},"indoor":{"*":{"type":"indoor_source"}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"use-theme":true,"transition":true},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":1,"equalEarth":1,"equirectangular":1,"lambertConformalConic":1,"mercator":1,"naturalEarth":1,"winkelTripel":1,"globe":1},"default":"mercator"},"center":{"type":"array","length":2,"value":"number","minimum":[-180,-90],"maximum":[180,90]},"parallels":{"type":"array","length":2,"value":"number","minimum":[-90,-90],"maximum":[90,90]}},"terrain":{"source":{"type":"string"},"exaggeration":{"type":"number","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_building","paint_symbol","paint_raster","paint_raster-particle","paint_hillshade","paint_background","paint_sky","paint_model"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"fill-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-pattern-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-z-offset":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-bridge-guard-rail-color":{"type":"color","default":"rgba(241, 236, 225, 255)","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature"]},"property-type":"data-driven"},"fill-tunnel-structure-color":{"type":"color","default":"rgba(241, 236, 225, 255)","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","meas
2ure-light"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"fill-extrusion-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-pattern-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-height-alignment":{"type":"enum","values":{"terrain":1,"flat":1},"default":"flat"},"fill-extrusion-base-alignment":{"type":"enum","values":{"terrain":1,"flat":1},"default":"terrain"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-ambient-occlusion-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-wall-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-flood-light-color":{"type":"color","default":"#ffffff","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-wall-radius":{"property-type":"data-driven","type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-radius":{"property-type":"data-driven","type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-vertical-scale":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-rounded-roof":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{}},"fill-extrusion-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"fill-extrusion-line-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-cast-shadows":{"type":"boolean","default":true}},"paint_building":{"building-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"building-ambient-occlusion-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"parameters":[]},"transition":true},"building-ambient-occlusion-ground-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"building-ambient-occlusion-ground-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"building-ambient-occlusion-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"building-vertical-scale":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"building-cast-shadows":{"type":"boolean","default":true},"building-color":{"type":"color","default":"rgba(193, 154, 127, 1)","use-theme":true,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"property-type":"data-driven"},"building-emissive-strength":{"type":"number","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"property-type":"data-driven"},"building-facade-emissive-chance":{"type":"number","default":0.35,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["measure-light","zoom"]}},"building-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{}},"building-flood-light-color":{"type":"color","default":"#ffffff","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"building-flood-light-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"building-flood-light-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"line-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light","line-progress"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"}
2,"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"line-gradient":{"type":"color","use-theme":true,"expression":{"interpolated":true,"parameters":["line-progress"]}},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1]},"line-trim-fade-range":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"line-trim-color":{"type":"color","default":"transparent","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"line-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-driven"},"line-border-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-border-color":{"type":"color","default":"rgba(0, 0, 0, 0)","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-occlusion-opacity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"circle-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"circle-pitch-scale":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"circle-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]}},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"use-theme":true,"expression":{"interpolated":true,"parameters":["heatmap-density"]}},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-occlusion-opacity":{"type":"number","minimum":0,"maximum":1,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"text-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"icon-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"icon-image-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-occlusion-opacity":{"type":"number","minimum":0,"maximum":1,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"overridable":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"text-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"icon-color-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{}},"icon-color-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{}},"icon-color-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{}},"icon-color-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{}},"symbol-z-offset":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-color":{"type":"color","use-theme":true,"expression":{"interpolated":true,"parameters":["raster-value"]}},"raster-color-mix":{"type":"array","default":[0.2126,0.7152,0.0722,0],"length":4,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-color-range":{"type":"array","length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-resampling":{"type":"enum","values":{"linear":1,"nearest":1},"default":"linear","expression":{"parameters":["zoom"]}},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"raster-array-band":{"type":"string"},"raster-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}}},"paint_raster-particle":{"raster-particle-array-band":{"type":"string"},"raster-particle-count":{"type":"number","default":512,"minimum":1},"raster-particle-color":{"type":"color","use-theme":true,"expression":{"interpolated":true,"parameters":["raster-particle-speed"]}},"raster-particle-max-speed":{"type":"number","default":1,"minimum":1},"raster-particle-speed-factor":{"type":"number","default":0.2,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-particle-fade-opacity-factor":{"type":"number","default":0.98,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-particle-reset-rate-factor":{"type":"number","default":0.8,"minimum":0,"maximum":1},"raster-particle-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"expression":{"interpolated":true,"parameters":["zoom"]}},"hillshade-illumination-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]}},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"hillshade-shadow-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"hillshade-accent-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"hillshade-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}}},"paint_background":{"background-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":[]}},"background-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"background-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom"]}},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"background-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":1,"atmosphere":1},"default":"atmosphere","expression":{"parameters":["zoom"]}},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]}},"sky-atmosphere-sun-intensity":{"type":"number","default":10,"minimum":0,"maximum":100},"sky-gradient-center":{"type":"array","value":"number","default":[0,0],"length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]}},"sky-gradient-radius":{"type":"number","default":90,"minimum":0,"maximum":180,"expression":{"parameters":["zoom"]}},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"use-theme":true,"expression":{"interpolated":true,"parameters":["sky-radial-progress"]}},"sky-atmosphere-halo-color":{"type":"color","default":"white","use-theme":true},"sky-atmosphere-color":{"type":"color","default":"white","use-theme":true},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}}},"paint_model":{"model-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"property-type":"data-driven"},"model-rotation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-scale":{"type":"array","value":"number","length":3,"default":[1,1,1],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-translation":{"type":"array","value":"number","length":3,"default":[0,0,0],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-color":{"type":"color","default":"#ffffff","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light","zoom"]},"use-theme":true,"transition":true},"model-color-mix-intensity":{"type":"number","property-type":"data-driven","default
2":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-type":{"type":"enum","values":{"common-3d":1,"location-indicator":1},"default":"common-3d"},"model-cast-shadows":{"type":"boolean","default":true},"model-receive-shadows":{"type":"boolean","default":true},"model-ambient-occlusion-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"model-emissive-strength":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-roughness":{"type":"number","default":1,"minimum":0,"maximum":1,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state"]},"transition":true},"model-height-based-emissive-strength-multiplier":{"type":"array","default":[1,1,1,1,0],"length":5,"value":"number","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{}},"model-front-cutoff":{"type":"array","value":"number","expression":{"interpolated":true,"parameters":["zoom"]},"length":3,"default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1]},"model-elevation-reference":{"type":"enum","values":{"sea":1,"ground":1,"hd-road-markup":1},"default":"ground","expression":{}}},"transition":{"duration":{"type":"number","default":300,"minimum":0},"delay":{"type":"number","default":0,"minimum":0}},"promoteId":{"*":{"type":"*"}}}');function Da(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function Ra(e){if(Array.isArray(e))return e.map(Ra);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){const t={};for(const i in e)t[i]=Ra(e[i]);return t}return Da(e)}function La(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!La(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}function za(e,t="",i=null,n="fill"){if(null==e)return{filter:()=>!0,needGeometry:!1,needFeature:!1};La(e)||(e=Ua(e));const r=e;let o=!0;try{o=function(e){if(!ka(e))return e;let t=Ra(e);return Fa(t),t=Oa(t),t}(r)}catch(e){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(r,null,2)}\n        `)}let s=null,a=null;if("background"!==n&&"sky"!==n&&"slot"!==n){a=Pa[`filter_${n}`];const e=Uo(o,a,t,i);if("error"===e.result)throw new Error(e.value.map(e=>`${e.key}: ${e.message}`).join(", "));s=(t,i,n)=>e.value.evaluate(t,i,{},n)}let l=null,c=null;if(o!==r){const e=Uo(r,a,t,i);if("error"===e.result)throw new Error(e.value.map(e=>`${e.key}: ${e.message}`).join(", "));l=(t,i,n,r,o)=>e.value.evaluate(t,i,{},n,void 0,void 0,r,o),c=!mr(e.value.expression)}return{filter:s,dynamicFilter:l||void 0,needGeometry:Va(o),needFeature:!!c}}function Oa(e){if(!Array.isArray(e))return e;const t=function(e){if(Ba.has(e[0]))for(let t=1;t<e.length;t++)if(ka(e[t]))return!0;return e}(e);return!0===t?t:t.map(e=>Oa(e))}function Fa(e){let t=!1;const i=[];if("case"===e[0]){for(let n=1;n<e.length-1;n+=2)t=t||ka(e[n]),i.push(e[n+1]);i.push(e[e.length-1])}else if("match"===e[0]){t=t||ka(e[1]);for(let t=2;t<e.length-1;t+=2)i.push(e[t+1]);i.push(e[e.length-1])}else if("step"===e[0]){t=t||ka(e[1]);for(let t=1;t<e.length-1;t+=2)i.push(e[t+1])}t&&(e.length=0,e.push("any",...i));for(let t=1;t<e.length;t++)Fa(e[t])}function ka(e){if(!Array.isArray(e))return!1;if("pitch"===(t=e[0])||"distance-from-center"===t)return!0;var t;for(let t=1;t<e.length;t++)if(ka(e[t]))return!0;return!1}const Ba=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function Na(e,t){return e<t?-1:e>t?1:0}function Va(e){if(!Array.isArray(e))return!1;if("within"===e[0]||"distance"===e[0])return!0;for(let t=1;t<e.length;t++)if(Va(e[t]))return!0;return!1}function Ua(e){if(!e)return!0;const t=e[0];return e.length<=1?"any"!==t:"=="===t?ja(e[1],e[2],"=="):"!="===t?Ha(ja(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?ja(e[1],e[2],t):"any"===t?(i=e.slice(1),["any"].concat(i.map(Ua)
2)):"all"===t?["all"].concat(e.slice(1).map(Ua)):"none"===t?["all"].concat(e.slice(1).map(Ua).map(Ha)):"in"===t?Ga(e[1],e.slice(2)):"!in"===t?Ha(Ga(e[1],e.slice(2))):"has"===t?qa(e[1]):"!has"!==t||Ha(qa(e[1]));var i}function ja(e,t,i){switch(e){case"$type":return[`filter-type-${i}`,t];case"$id":return[`filter-id-${i}`,t];default:return[`filter-${i}`,e,t]}}function Ga(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(e=>typeof e!=typeof t[0])?["filter-in-large",e,["literal",t.sort(Na)]]:["filter-in-small",e,["literal",t]]}}function qa(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function Ha(e){return["!",e]}const $a="�";function Wa(e,t){return t?`${e}${$a}${t}`:e}let Za;const Xa=()=>Za||(Za=new Ca({"icon-size":new Aa(Pa.layout_symbol["icon-size"]),"icon-image":new Aa(Pa.layout_symbol["icon-image"]),"icon-rotate":new Aa(Pa.layout_symbol["icon-rotate"]),"icon-offset":new Aa(Pa.layout_symbol["icon-offset"]),"text-size":new Aa(Pa.layout_symbol["text-size"]),"text-rotate":new Aa(Pa.layout_symbol["text-rotate"]),"text-offset":new Aa(Pa.layout_symbol["text-offset"])}));class Ya{constructor(e,t,i,n,r,o){const s=Uo(e,Pa.appearance.condition);if("success"===s.result&&(this.condition=s.value),this.name=t,i){this.properties=new Ea(Xa()),this.unevaluatedLayout=new Ta(Xa(),n,r,o);for(const e in i)this.unevaluatedLayout.setValue(e,i[e])}}isActive(e){return!(this.condition||!e.isHidden||"hidden"!==this.name)||this.condition.evaluate(e.globals,e.feature,e.featureState,e.canonical)}getCondition(){return this.condition}getName(){return this.name}getProperty(e){return this.properties.get(e)}getUnevaluatedProperties(){return this.unevaluatedLayout}getUnevaluatedProperty(e){return this.unevaluatedLayout._values[e]}recalculate(e,t,i){this.unevaluatedLayout&&(this.properties=this.unevaluatedLayout.possiblyEvaluate(e,void 0,t,i))}serialize(){const e={};return e.condition=this.condition.expression.serialize(),this.name&&(e.name=this.name),this.unevaluatedLayout&&(e.properties=this.unevaluatedLayout.serialize()),e}hasIconProperties(){const e=this.hasProperty("icon-image"),t=this.hasProperty("icon-size"),i=this.hasProperty("icon-offset"),n=this.hasProperty("icon-rotate");return e||t||i||n}hasTextProperties(){const e=this.hasProperty("text-size"),t=this.hasProperty("text-offset"),i=this.hasProperty("text-rotate");return e||t||i}hasProperty(e){return void 0!==this.getUnevaluatedProperty(e).value}}const Ka="-transition",Ja=new Set(["fill","line","background","hillshade","raster"]);class Qa extends ni{constructor(e,t,i,n,r,o){if(super(),this.id=e.id,this.fqid=Wa(this.id,i),this.type=e.type,this.scope=i,this.lut=n,this.options=r,this.iconImageUseTheme=o,this.appearances=new Array,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,this.expressionDependencies={isIndoorDependent:!1,configDependencies:new Set},"custom"!==e.type){if(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type&&"background"!==e.type&&"sky"!==e.type&&"slot"!==e.type){this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter;const t=Uo(this.filter,Pa[`filter_${e.type}`]);"error"!==t.result&&(this.expressionDependencies.configDependencies=new Set([...this.expressionDependencies.configDependencies,...t.value.configDependencies]),this.expressionDependencies.isIndoorDependent=this.expressionDependencies.isIndoorDependent||t.value.isIndoorDependent)}if(e.slot&&(this.slot=e.slot),e.appearances&&this.setAppearances(e.appearances),t.layout&&(this._unevaluatedLayout=new Ta(t.layout,this.scope,r,this.iconImageUseTheme),this.expressionDependencies.configDependencies=new Set([...this.expressionDependencies.configDependencies,...this._unevaluatedLayout.configDependencies]),this.expressionDependencies.isIndoorDependent=this.expressionDependencies.isIndoorDependent||this._unevaluatedLayout.isIndoorDependent()),t.paint){this._transitionablePaint=new xa(t.paint,this.scope,r);for(const t in e.paint)this.setPaintProperty(t,e.paint[t]);for(const t in e.layout)this.setLayoutProperty(t,e.layout[t]);this.expressionDependencies.configDependencies=new Set([...this.expressionDependencies.configDependencies,...this._transitionablePaint.configDependencies]),this.expressionDependencies.isIndoorDependent=this.expressionDependencies.isIndoorDependent||this._transitionablePaint.isIndoorDependent(),this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ea(t.paint)}}}onAdd(e){}onRemove(e){}isDraped(e){return!this.is3D(!0)&&Ja.has(this.type)}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,t){if("custom"===this.type&&"visibility"===e)return void(this.visibility=t);const i=this._unevaluatedLayout;i._properties.properties[e]&&(i.setValue(e,t),this.expressionDependencies.configDependencies=new Set([...this.expressionDependencies.configDependencies,...i.configDependencies]),this.expressionDependencies.isIndoorDependent=this.expressionDependencies.isIndoorDependent||i.isIndoorDependent(),"visibility"===e&&this.possiblyEvaluateVisibility())}
2setAppearances(e){this.appearances=[],e.forEach(e=>{this.appearances.push(new Ya(e.condition,e.name,e.properties,this.scope,this.options,this.iconImageUseTheme))})}possiblyEvaluateVisibility(){this._unevaluatedLayout._values.visibility&&(this.visibility=this._unevaluatedLayout._values.visibility.possiblyEvaluate({zoom:0}))}getPaintProperty(e){return e.endsWith(Ka)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}isPaintProperty(e){return!!this._transitionablePaint._properties.properties[e]}setPaintProperty(e,t){const i=this._transitionablePaint,n=i._properties.properties;if(e.endsWith(Ka)){const r=e.slice(0,-11);return n[r]&&i.setTransition(r,t||void 0),!1}if(!n[e])return!1;const r=i._values[e],o=r.value.isDataDriven(),s=r.value;i.setValue(e,t),this.expressionDependencies.configDependencies=new Set([...this.expressionDependencies.configDependencies,...i.configDependencies]),this.expressionDependencies.isIndoorDependent=this.expressionDependencies.isIndoorDependent||i.isIndoorDependent(),this._handleSpecialPaintPropertyUpdate(e);const a=i._values[e].value,l=a.isDataDriven(),c=e.endsWith("pattern")||"line-dasharray"===e;return l||o||c||this._handleOverridablePaintPropertyUpdate(e,s,a)}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getDefaultProgramParams(e,t,i){return null}_handleOverridablePaintPropertyUpdate(e,t,i){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,t){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t,this.iconImageUseTheme)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}
vendor: 8,476 bytes, line 2
2serialize(){const e={id:this.id,type:this.type,slot:this.slot,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 0!==this.appearances.length&&(e.appearances=this.appearances.map(e=>e.serialize())),Ge(e,(e,t)=>!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length))}is3D(e){return!1}hasElevation(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}hasShadowPass(){return!1}canCastShadows(){return!1}hasLightBeamPass(){return!1}cutoffRange(){return 0}tileCoverLift(){return 0}resize(){}_clear(){}isStateDependent(){for(const e in this.paint._values){const t=this.paint.get(e);if(t instanceof Sa&&Ao(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}for(const e of this.appearances)if(!_r(e.condition.expression))return!0;return!1}compileFilter(e){this._filterCompiled||(this._featureFilter=za(this.filter,this.scope,e),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}getLayerRenderingStats(){return this._stats}resetLayerRenderingStats(e){this._stats&&("shadow"===e.renderPass?this._stats.numRenderedVerticesInShadowPass=0:this._stats.numRenderedVerticesInTransparentPass=0)}getAppearances(){return this.appearances}queryRenderedFeatures(e,t,i){return{}}queryRadius(e){}queryIntersectsFeature(e,t,i,n,r,o,s,a,l){}}const el={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class tl{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}const il=new ArrayBuffer(0);class nl{constructor(){this._reallocCount=0,this.capacity=0,this.length=0}static serialize(e,t){return e._trim(),t&&e.arrayBuffer&&t.add(e.arrayBuffer),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,e.arrayBuffer?t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement:(t.capacity=0,t.arrayBuffer=il),t._refreshViews(),t}_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._reallocCount++,this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}reserveForAdditional(e){this.reserve(this.length+e)}_refreshViews(){throw new Error("StructArray#_refreshViews() must be implemented by each concrete StructArray layout")}emplace(...e){throw new Error("StructArray#emplace() must be implemented by each concrete StructArray layout")}emplaceBack(...e){throw new Error("StructArray#emplaceBack() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function rl(e,t=1){let i=0,n=0;return{members:e.map(e=>{const r=el[e.type].BYTES_PER_ELEMENT,o=i=ol(i,Math.max(t,r)),s=e.components||1;return n=Math.max(n,r),i+=r*s,{name:e.name,type:e.type,components:s,offset:o}}),size:ol(i,Math.max(n,t)),alignment:t}}function ol(e,t){return Math.ceil(e/t)*t}class sl extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){const i=this.length;return this.resize(i+1),this.emplace(i,e,t)}emplace(e,t,i){const n=2*e;return this.int16[n+0]=t,this.int16[n+1]=i,e}}sl.prototype.bytesPerElement=4,Jo(sl,"StructArrayLayout2i4");class al extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,i)}emplace(e,t,i,n){const r=3*e;return this.int16[r+0]=t,this.int16[r+1]=i,this.int16[r+2]=n,e}}al.prototype.bytesPerElement=6,Jo(al,"StructArrayLayout3i6");class ll extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,i,n)}emplace(e,t,i,n,r){const o=4*e;return this.int16[o+0]=t,this.int16[o+1]=i,this.int16[o+2]=n,this.int16[o+3]=r,e}}ll.prototype.bytesPerElement=8,Jo(ll,"StructArrayLayout4i8");class cl extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.float32[1*e+0]=t,e}}cl.prototype.bytesPerElement=4,Jo(cl,"StructArrayLayout1f4");class ul extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,i)}emplace(e,t,i,n){const r=4*e,o=2*e;return this.int16[r+0]=t,this.int16[r+1]=i,this.float32[o+1]=n,e}}ul.prototype.bytesPerElement=8,Jo(ul,"StructArrayLayout2i1f8");class hl extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,i)}emplace(e,t,i,n){const r=4*e;return this.int16[r+0]=t,this.int16[r+1]=i,this.int16[r+2]=n,e}}hl.prototype.bytesPerElement=8,Jo(hl,"StructArrayLayout3i8");class dl extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,i,n,r)}emplace(e,t,i,n,r,o){const s=5*e;return this.int16[s+0]=t,this.int16[s+1]=i,this.int16[s+2]=n,this.int16[s+3]=r,this.int16[s+4]=o,e}}dl.prototype.bytesPerElement=10,Jo(dl,"StructArrayLayout5i10");class fl extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,i,n,r,o,s)}emplace(e,t,i,n,r,o,s,a){const l=6*e,c=12*e,u=3*e;return this.int16[l+0]=t,this.int16[l+1]=i,this.uint8[c+4]=n,this.uint8[c+5]=r,this.uint8[c+6]=o,this.uint8[c+7]=s,this.float32[u+2]=a,e}}fl.prototype.bytesPerElement=12,Jo(fl,"StructArrayLayout2i4ub1f12");class pl extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,i)}emplace(e,t,i,n){const r=3*e;return this.float32[r+0]=t,this.float32[r+1]=i,this.float32[r+2]=n,e}}pl.prototype.bytesPerElement=12,Jo(pl,"StructArrayLayout3f12");class ml extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,i,n,r)}emplace(e,t,i,n,r,o){const s=6*e,a=3*e;return this.uint16[s+0]=t,this.uint16[s+1]=i,this.uint16[s+2]=n,this.uint16[s+3]=r,this.float32[a+2]=o,e}}ml.prototype.bytesPerElement=12,Jo(ml,"StructArrayLayout4ui1f12");class _l extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,i,n)}emplace(e,t,i,n,r){const o=4*e;return this.uint16[o+0]=t,this.uint16[o+1]=i,this.uint16[o+2]=n,this.uint16[o+3]=r,e}}_l.prototype.bytesPerElement=8,Jo(_l,"StructArrayLayout4ui8");class gl extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,i,n,r,o)}emplace(e,t,i,n,r,o,s){const a=6*e;return this.int16[a+0]=t,this.int16[a+1]=i,this.int16[a+2]=n,this.int16[a+3]=r,this.int16[a+4]=o,this.int16[a+
vendor: 15,787 bytes, line 2
25]=s,e}}gl.prototype.bytesPerElement=12,Jo(gl,"StructArrayLayout6i12");class yl extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o,s,a,l,c,u,h){const d=this.length;return this.resize(d+1),this.emplace(d,e,t,i,n,r,o,s,a,l,c,u,h)}emplace(e,t,i,n,r,o,s,a,l,c,u,h,d){const f=12*e;return this.int16[f+0]=t,this.int16[f+1]=i,this.int16[f+2]=n,this.int16[f+3]=r,this.uint16[f+4]=o,this.uint16[f+5]=s,this.uint16[f+6]=a,this.uint16[f+7]=l,this.int16[f+8]=c,this.int16[f+9]=u,this.int16[f+10]=h,this.int16[f+11]=d,e}}yl.prototype.bytesPerElement=24,Jo(yl,"StructArrayLayout4i4ui4i24");class vl extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,i,n,r,o)}emplace(e,t,i,n,r,o,s){const a=10*e,l=5*e;return this.int16[a+0]=t,this.int16[a+1]=i,this.int16[a+2]=n,this.float32[l+2]=r,this.float32[l+3]=o,this.float32[l+4]=s,e}}vl.prototype.bytesPerElement=20,Jo(vl,"StructArrayLayout3i3f20");class xl extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,i,n)}emplace(e,t,i,n,r){const o=4*e;return this.float32[o+0]=t,this.float32[o+1]=i,this.float32[o+2]=n,this.float32[o+3]=r,e}}xl.prototype.bytesPerElement=16,Jo(xl,"StructArrayLayout4f16");class bl extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint32[1*e+0]=t,e}}bl.prototype.bytesPerElement=4,Jo(bl,"StructArrayLayout1ul4");class wl extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){const i=this.length;return this.resize(i+1),this.emplace(i,e,t)}emplace(e,t,i){const n=2*e;return this.uint16[n+0]=t,this.uint16[n+1]=i,e}}wl.prototype.bytesPerElement=4,Jo(wl,"StructArrayLayout2ui4");class Tl extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o,s,a,l,c,u,h,d){const f=this.length;return this.resize(f+1),this.emplace(f,e,t,i,n,r,o,s,a,l,c,u,h,d)}emplace(e,t,i,n,r,o,s,a,l,c,u,h,d,f){const p=20*e,m=10*e;return this.int16[p+0]=t,this.int16[p+1]=i,this.int16[p+2]=n,this.int16[p+3]=r,this.int16[p+4]=o,this.float32[m+3]=s,this.float32[m+4]=a,this.float32[m+5]=l,this.float32[m+6]=c,this.int16[p+14]=u,this.uint32[m+8]=h,this.uint16[p+18]=d,this.uint16[p+19]=f,e}}Tl.prototype.bytesPerElement=40,Jo(Tl,"StructArrayLayout5i4f1i1ul2ui40");class Sl extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,i,n,r,o,s)}emplace(e,t,i,n,r,o,s,a){const l=8*e;return this.int16[l+0]=t,this.int16[l+1]=i,this.int16[l+2]=n,this.int16[l+4]=r,this.int16[l+5]=o,this.int16[l+6]=s,this.int16[l+7]=a,e}}Sl.prototype.bytesPerElement=16,Jo(Sl,"StructArrayLayout3i2i2i16");class El extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,i,n,r)}emplace(e,t,i,n,r,o){const s=4*e,a=8*e;return this.float32[s+0]=t,this.float32[s+1]=i,this.float32[s+2]=n,this.int16[a+6]=r,this.int16[a+7]=o,e}}El.prototype.bytesPerElement=16,Jo(El,"StructArrayLayout2f1f2i16");class Il extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,i,n,r,o)}emplace(e,t,i,n,r,o,s){const a=20*e,l=5*e;return this.uint8[a+0]=t,this.uint8[a+1]=i,this.float32[l+1]=n,this.float32[l+2]=r,this.float32[l+3]=o,this.float32[l+4]=s,e}}Il.prototype.bytesPerElement=20,Jo(Il,"StructArrayLayout2ub4f20");class Al extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,i)}emplace(e,t,i,n){const r=3*e;return this.uint16[r+0]=t,this.uint16[r+1]=i,this.uint16[r+2]=n,e}}Al.prototype.bytesPerElement=6,Jo(Al,"StructArrayLayout3ui6");class Ml extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v,x){const b=this.length;return this.resize(b+1),this.emplace(b,e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v,x)}emplace(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v,x,b){const w=30*e,T=15*e,S=60*e;return this.int16[w+0]=t,this.int16[w+1]=i,this.int16[w+2]=n,this.float32[T+2]=r,this.float32[T+3]=o,this.uint16[w+8]=s,this.uint16[w+9]=a,this.uint32[T+5]=l,this.uint32[T+6]=c,this.uint32[T+7]=u,this.uint16[w+16]=h,this.uint16[w+17]=d,this.uint16[w+18]=f,this.float32[T+10]=p,this.float32[T+11]=m,this.uint8[S+48]=_,this.uint8[S+49]=g,this.uint8[S+50]=y,this.uint32[T+13]=v,this.int16[w+28]=x,this.uint8[S+58]=b,e}}Ml.prototype.bytesPerElement=60,Jo(Ml,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class Cl extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v,x,b,w,T,S,E,I,A,M,C,P,D,R){const L=this.length;return this.resize(L+1),this.emplace(L,e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v,x,b,w,T,S,E,I,A,M,C,P,D,R)}emplace(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v,x,b,w,T,S,E,I,A,M,C,P,D,R,L){const z=20*e,O=40*e,F=80*e;return this.float32[z+0]=t,this.float32[z+1]=i,this.int16[O+4]=n,this.int16[O+5]=r,this.int16[O+6]=o,this.int16[O+7]=s,this.int16[O+8]=a,this.int16[O+9]=l,this.int16[O+10]=c,this.int16[O+11]=u,this.int16[O+12]=h,this.uint16[O+13]=d,this.uint16[O+14]=f,this.uint16[O+15]=p,this.uint16[O+16]=m,this.uint16[O+17]=_,this.uint16[O+18]=g,this.uint16[O+19]=y,this.uint16[O+20]=v,this.uint16[O+21]=x,this.uint16[O+22]=b,this.uint16[O+23]=w,this.uint16[O+24]=T,this.uint16[O+25]=S,this.uint16[O+26]=E,this.uint16[O+27]=I,this.uint32[z+14]=A,this.float32[z+15]=M,this.float32[z+16]=C,this.float32[z+17]=P,this.float32[z+18]=D,this.uint8[F+76]=R,this.uint16[O+39]=L,e}}Cl.prototype.bytesPerElement=80,Jo(Cl,"StructArrayLayout2f9i15ui1ul4f1ub1ui80");class Pl extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,i,n,r,o)}emplace(e,t,i,n,r,o,s){const a=6*e;return this.float32[a+0]=t,this.float32[a+1]=i,this.float32[a+2]=n,this.float32[a+3]=r,this.float32[a+4]=o,this.float32[a+5]=s,e}}Pl.prototype.bytesPerElement=24,Jo(Pl,"StructArrayLayout6f24");class Dl extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,i,n,r)}emplace(e,t,i,n,r,o){const s=5*e;return this.float32[s+0]=t,this.float32[s+1]=i,this.float32[s+2]=n,this.float32[s+3]=r,this.float32[s+4]=o,e}}Dl.prototype.bytesPerElement=20,Jo(Dl,"StructArrayLayout5f20");class Rl extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,i,n,r,o,s)}emplace(e,t,i,n,r,o,s,a){const l=7*e;return this.float32[l+0]=t,this.float32[l+1]=i,this.float32[l+2]=n,this.float32[l+3]=r,this.float32[l+4]=o,this.float32[l+5]=s,this.float32[l+6]=a,e}}Rl.prototype.bytesPerElement=28,Jo(Rl,"StructArrayLayout7f28");class Ll extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o,s,a,l,c,u){const h=this.length;return this.resize(h+1),this.emplace(h,e,t,i,n,r,o,s,a,l,c,u)}emplace(e,t,i,n,r,o,s,a,l,c,u,h){const d=11*e;return this.float32[d+0]=t,this.float32[d+1]=i,this.float32[d+2]=n,this.float32[d+3]=r,this.float32[d+4]=o,this.float32[d+5]=s,this.float32[d+6]=a,this.float32[d+7]=l,this.float32[d+8]=c,this.float32[d+9]=u,this.float32[d+10]=h,e}}Ll.prototype.bytesPerElement=44,Jo(Ll,"StructArrayLayout11f44");class zl extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o,s,a,l){const c=this.length;return this.resize(c+1),this.emplace(c,e,t,i,n,r,o,s,a,l)}emplace(e,t,i,n,r,o,s,a,l,c){const u=9*e;return this.float32[u+0]=t,this.float32[u+1]=i,this.float32[u+2]=n,this.float32[u+3]=r,this.float32[u+4]=o,this.float32[u+5]=s,this.float32[u+6]=a,this.float32[u+7]=l,this.float32[u+8]=c,e}}zl.prototype.bytesPerElement=36,Jo(zl,"StructArrayLayout9f36");class Ol extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){const i=this.length;return this.resize(i+1),this.emplace(i,e,t)}emplace(e,t,i){const n=2*e;return this.float32[n+0]=t,this.float32[n+1]=i,e}}Ol.prototype.bytesPerElement=8,Jo(Ol,"StructArrayLayout2f8");class Fl extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,i,n)}emplace(e,t,i,n,r){const o=6*e;return this.uint32[3*e+0]=t,this.uint16[o+2]=i,this.uint16[o+3]=n,this.uint16[o+4]=r,e}}Fl.prototype.bytesPerElement=12,Jo(Fl,"StructArrayLayout1ul3ui12");class kl extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint16[1*e+0]=t,e}}kl.prototype.bytesPerElement=2,Jo(kl,"StructArrayLayout1ui2");class Bl extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m){const _=this.length;return this.resize(_+1),this.emplace(_,e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m)}emplace(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_){const g=16*e;return this.float32[g+0]=t,this.float32[g+1]=i,this.float32[g+2]=n,this.float32[g+3]=r,this.float32[g+4]=o,this.float32[g+5]=s,this.float32[g+6]=a,this.float32[g+7]=l,this.float32[g+8]=c,this.float32[g+9]=u,this.float32[g+10]=h,this.float32[g+11]=d,this.float32[g+12]=f,this.float32[g+13]=p,this.float32[g+14]=m,this.float32[g+15]=_,e}}Bl.prototype.bytesPerElement=64,Jo(Bl,"StructArrayLayout16f64");class Nl extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,i,n,r,o,s)}emplace(e,t,i,n,r,o,s,a){const l=10*e,c=5*e;return this.uint16[l+0]=t,this.uint16[l+1]=i,this.uint16[l+2]=n,this.uint16[l+3]=r,this.float32[c+2]=o,this.float32[c+3]=s,this.float32[c+4]=a,e}}Nl.prototype.bytesPerElement=20,Jo(Nl,"StructArrayLayout4ui3f20");class Vl extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.int16[1*e+0]=t,e}}Vl.prototype.bytesPerElement=2,Jo(Vl,"StructArrayLayout1i2");class Ul extends nl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint8[1*e+0]=t,e}}Ul.prototype.bytesPerElement=1,Jo(Ul,"StructArrayLayout1ub1");class jl extends tl{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}jl.prototype.size=40;class Gl extends Tl{get(e){return new jl(this,e)}}Jo(Gl,"CollisionBoxArray");class ql extends tl{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(e){this._structArray.uint8[this._pos1+49]=e}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(e){this._structArray.uint8[this._pos1+50]=e}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(e){this._structArray.uint32[this._pos4+13]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(e){this._structArray.uint8[this._pos1+58]=e}}ql.prototype.size=60;class Hl extends Ml{get(e){return new ql(this,e)}}Jo(Hl,"PlacedSymbolArray");class $l extends tl{get tileAnchorX(){return this._structArray.float32[this._pos4+0]}get tileAnchorY(){return this._structArray.float32[this._pos4+1]}get projectedAnchorX(){return this._structArray.int16[this._pos2+4]}get projectedAnchorY(){return this._structArray.int16[this._pos2+5]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+6]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+7]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}
vendor: 19,197 bytes, line 2
2get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+11]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get key(){return this._structArray.uint16[this._pos2+13]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+14]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+15]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+17]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+19]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+21]}get featureIndex(){return this._structArray.uint16[this._pos2+22]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+23]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numIconVertices(){return this._structArray.uint16[this._pos2+25]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+26]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+27]}get crossTileID(){return this._structArray.uint32[this._pos4+14]}set crossTileID(e){this._structArray.uint32[this._pos4+14]=e}get textOffset0(){return this._structArray.float32[this._pos4+15]}get textOffset1(){return this._structArray.float32[this._pos4+16]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+17]}get zOffset(){return this._structArray.float32[this._pos4+18]}set zOffset(e){this._structArray.float32[this._pos4+18]=e}get hasIconTextFit(){return this._structArray.uint8[this._pos1+76]}get elevationFeatureIndex(){return this._structArray.uint16[this._pos2+39]}}$l.prototype.size=80;class Wl extends Cl{get(e){return new $l(this,e)}}Jo(Wl,"SymbolInstanceArray");class Zl extends cl{getoffsetX(e){return this.float32[1*e+0]}}Jo(Zl,"GlyphOffsetArray");class Xl extends sl{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}Jo(Xl,"SymbolLineVertexArray");class Yl extends tl{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}Yl.prototype.size=12;class Kl extends Fl{get(e){return new Yl(this,e)}}Jo(Kl,"FeatureIndexArray");class Jl extends wl{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}Jo(Jl,"FillExtrusionCentroidArray");class Ql extends tl{get a_join_normal_inside0(){return this._structArray.int16[this._pos2+0]}get a_join_normal_inside1(){return this._structArray.int16[this._pos2+1]}get a_join_normal_inside2(){return this._structArray.int16[this._pos2+2]}}Ql.prototype.size=6;class ec extends al{get(e){return new Ql(this,e)}}Jo(ec,"FillExtrusionWallArray");const tc=rl([{name:"a_pos",components:2,type:"Int16"}],4),ic=rl([{name:"a_circle_z_offset",components:1,type:"Float32"}],4),nc=rl([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class rc{constructor(e=[]){this.segments=e}_prepareSegment(e,t,i,n){let r=this.segments[this.segments.length-1];return e>rc.MAX_VERTEX_ARRAY_LENGTH&&We(`Max vertices per segment is ${rc.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!r||r.vertexLength+e>rc.MAX_VERTEX_ARRAY_LENGTH||r.sortKey!==n)&&(r={vertexOffset:t,primitiveOffset:i,vertexLength:0,primitiveLength:0},void 0!==n&&(r.sortKey=n),this.segments.push(r)),r}prepareSegment(e,t,i,n){return this._prepareSegment(e,t.length,i.length,n)}get(){return this.segments}destroy(){for(const e of this.segments)for(const t in e.vaos)e.vaos[t].destroy()}static simpleSegment(e,t,i,n){return new rc([{vertexOffset:e,primitiveOffset:t,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}}function oc(e,t){return 256*(e=ze(Math.floor(e),0,255))+ze(Math.floor(t),0,255)}rc.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Jo(rc,"SegmentVector");const sc=rl([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),ac=rl([{name:"a_pattern_b",components:4,type:"Uint16"}]),lc=rl([{name:"a_dash",components:4,type:"Uint16"}]);class cc{constructor(){this.ids=[],this.uniqueIds=[],this.positions=[],this.indexed=!1}add(e,t,i,n){this.ids.push(uc(e)),this.positions.push(t,i,n)}eachPosition(e,t){const i=uc(e);let n=0,r=this.ids.length-1;for(;n<r;){const e=n+r>>1;this.ids[e]>=i?r=e:n=e+1}for(;this.ids[n]===i;)t(this.positions[3*n],this.positions[3*n+1],this.positions[3*n+2]),n++}static serialize(e,t){const i=new Float64Array(e.ids),n=new Uint32Array(e.positions);return hc(i,n,0,i.length-1),t&&(t.add(i.buffer),t.add(n.buffer)),{ids:i,positions:n}}static deserialize(e){const t=new cc;let i;t.ids=e.ids,t.positions=e.positions;for(const e of t.ids)e!==i&&t.uniqueIds.push(e),i=e;return t.indexed=!0,t}}function uc(e){const t=+e;return Number.isSafeInteger(t)?t:Jt(String(e))}function hc(e,t,i,n){for(;i<n;){const r=e[i+n>>1];let o=i-1,s=n+1;for(;;){do{o++}while(e[o]<r);do{s--}while(e[s]>r);if(o>=s)break;dc(e,o,s),dc(t,3*o,3*s),dc(t,3*o+1,3*s+1),dc(t,3*o+2,3*s+2)}s-i<n-s?(hc(e,t,i,s),i=s+1):(hc(e,t,s+1,n),n=s)}}function dc(e,t,i){const n=e[t];e[t]=e[i],e[i]=n}Jo(cc,"FeaturePositionMap");class fc{constructor(e){this.gl=e.gl,this.initialized=!1}fetchUniformLocation(e,t){return this.location||this.initialized||(this.location=this.gl.getUniformLocation(e,t),this.initialized=!0),!!this.location}set(e,t,i){throw new Error("Uniform#set() must be implemented by each concrete Uniform")}}class pc extends fc{constructor(e){super(e),this.current=0}set(e,t,i){this.fetchUniformLocation(e,t)&&this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}}class mc extends fc{constructor(e){super(e),this.current=0}set(e,t,i){this.fetchUniformLocation(e,t)&&this.current!==i&&(this.current=i,this.gl.uniform1f(this.location,i))}}class _c extends fc{constructor(e){super(e),this.current=[0,0]}set(e,t,i){this.fetchUniformLocation(e,t)&&(i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1])))}}class gc extends fc{constructor(e){super(e),this.current=[0,0,0]}set(e,t,i){this.fetchUniformLocation(e,t)&&(i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2])))}}class yc extends fc{constructor(e){super(e),this.current=[0,0,0,0]}set(e,t,i){this.fetchUniformLocation(e,t)&&(i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]&&i[3]===this.current[3]||(this.current=i,this.gl.uniform4f(this.location,i[0],i[1],i[2],i[3])))}}class vc extends fc{constructor(e){super(e),this.current=li.transparent.toPremultipliedRenderColor(null)}set(e,t,i){this.fetchUniformLocation(e,t)&&(i.r===this.current.r&&i.g===this.current.g&&i.b===this.current.b&&i.a===this.current.a||(this.current=i,this.gl.uniform4f(this.location,i.r,i.g,i.b,i.a)))}}const xc=new Float32Array(16);class bc extends fc{constructor(e){super(e),this.current=xc}set(e,t,i){if(this.fetchUniformLocation(e,t)){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let e=1;e<16;e++)if(i[e]!==this.current[e]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}}}const wc=new Float32Array(9),Tc=new Float32Array(4);class Sc extends fc{constructor(e){super(e),this.current=Tc}set(e,t,i){if(this.fetchUniformLocation(e,t))for(let e=0;e<4;e++)if(i[e]!==this.current[e]){this.current=i,this.gl.uniformMatrix2fv(this.location,!1,i);break}}}function Ec(e){return[oc(255*e.r,255*e.g),oc(255*e.b,255*e.a)]}function Ic(e,t,i,n,r,o,s,a){return!!e&&("composite"===e.kind||"source"===e.kind?"none"===e.evaluate(new ga(0,{brightness:o,worldview:a}),t,i,r,n,s):"none"===e.value)}class Ac{constructor(e,t,i,n){this.value=e,this.uniformNames=t.map(e=>`u_${e}`),this.type=i,this.context=n}setUniform(e,t,i,n,r){const o=n.constantOr(this.value);t.set(e,r,o instanceof li?o.toPremultipliedRenderColor(this.lutExpression&&"constant"===this.lutExpression.kind&&"none"===this.lutExpression.value?null:this.context.lut):o)}getBinding(e,t){return"color"===this.type?new vc(e):new mc(e)}}class Mc{constructor(e,t){this.uniformNames=t.map(e=>`u_${e}`),this.pattern=null,this.patternTransition=null,this.pixelRatio=1}setConstantPatternPositions(e,t){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br),this.patternTransition=t?t.tl.concat(t.br):this.pattern}setUniform(e,t,i,n,r){let o=null;"u_pattern"!==r&&"u_dash"!==r||(o=this.pattern),"u_pattern_b"===r&&(o=this.patternTransition),"u_pixel_ratio"===r&&(o=this.pixelRatio),o&&t.set(e,r,o)}getBinding(e,t){return"u_pattern"===t||"u_pattern_b"===t||"u_dash"===t?new yc(e):new mc(e)}}class Cc{constructor(e,t,i,n){this.expression=e,this.type=i,this.maxValue=0,this.paintVertexAttributes=t.map(e=>({name:`a_${e}`,type:"Float32",components:"color"===i?2:1,offset:0})),this.paintVertexArray=new n}populatePaintArray(e,t,i,n,r,o,s,a){const l=this.paintVertexArray.length,c="composite"===this.expression.kind||"source"===this.expression.kind?this.expression.evaluate(new ga(0,{brightness:o,worldview:a}),t,{},r,n,s):"constant"===this.expression.kind&&this.expression.value,u=Ic(this.lutExpression,t,{},n,r,o,s,a);this.paintVertexArray.resize(e),this._setPaintValue(l,e,c,u?null:this.context.lut)}updatePaintArray(e,t,i,n,r,o,s,a){const l="composite"===this.expression.kind||"source"===this.expression.kind?this.expression.evaluate({zoom:0,brightness:s,worldview:a},i,n,void 0,r):"constant"===this.expression.kind&&this.expression.value,c=Ic(this.lutExpression,i,n,r,void 0,s,void 0,a);this._setPaintValue(e,t,l,c?null:this.context.lut)}_setPaintValue(e,t,i,n){if("color"===this.type){const r=Ec(i.toPremultipliedRenderColor(n));for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,r[0],r[1])}else{for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,i);this.maxValue=Math.max(this.maxValue,Math.abs(i))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.lutExpression&&"constant"!==this.lutExpression.kind&&(this.lutExpression.isStateDependent||!this.lutExpression.isLightConstant)||"constant"!==this.expression.kind&&(this.expression.isStateDependent||!this.expression.isLightConstant)))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Pc{constructor(e,t,i,n,r,o){this.expression=e,this.uniformNames=t.map(e=>`u_${e}_t`),this.type=i,this.useIntegerZoom=n,this.context=r,this.maxValue=0,this.paintVertexAttributes=t.map(e=>({name:`a_${e}`,type:"Float32",components:"color"===i?4:2,offset:0})),this.paintVertexArray=new o}populatePaintArray(e,t,i,n,r,o,s,a){const l=this.expression.evaluate(new ga(this.context.zoom,{brightness:o,worldview:a}),t,{},r,n,s),c=this.expression.evaluate(new ga(this.context.zoom+1,{brightness:o,worldview:a}),t,{},r,n,s),u=Ic(this.lutExpression,t,{},n,r,o,s,a),h=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(h,e,l,c,u?null:this.context.lut)}updatePaintArray(e,t,i,n,r,o,s,a){const l=this.expression.evaluate({zoom:this.context.zoom,brightness:s,worldview:a},i,n,void 0,r),c=this.expression.evaluate({zoom:this.context.zoom+1,brightness:s,worldview:a},i,n,void 0,r),u=Ic(this.lutExpression,i,n,r,void 0,s,void 0,a);this._setPaintValue(e,t,l,c,u?null:this.context.lut)}_setPaintValue(e,t,i,n,r){if("color"===this.type){const n=Ec(i.toPremultipliedRenderColor(r)),o=Ec(i.toPremultipliedRenderColor(r));for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,n[0],n[1],o[0],o[1])}else{for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,i,n);this.maxValue=Math.max(this.maxValue,Math.abs(i),Math.abs(n))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t,i,n,r){const o=this.useIntegerZoom?Math.floor(i.zoom):i.zoom,s=ze(this.expression.interpolationFactor(o,this.context.zoom,this.context.zoom+1),0,1);t.set(e,r,s)}getBinding(e,t){return new mc(e)}}class Dc{constructor(e,t,i,n,r){this.expression=e,this.layerId=r,this.paintVertexAttributes=("array"===i?lc:sc).members;for(let e=0;e<t.length;++e);this.paintVertexArray=new n,this.paintTransitionVertexArray=new _l}populatePaintArray(e,t,i,n){const r=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValues(r,e,t.patterns&&t.patterns[this.layerId],i)}updatePaintArray(e,t,i,n,r,o,s){this._setPaintValues(e,t,i.patterns&&i.patterns[this.layerId],o)}_setPaintValues(e,t,i,n){if(!n||!i)return;const r=n[i[0]],o=n[i[1]];if(r){if(r){const{tl:i,br:n,pixelRatio:o}=r;for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,i[0],i[1],n[0],n[1],o)}if(o){this.paintTransitionVertexArray.resize(this.paintVertexArray.length);const{tl:i,br:n}=o;for(let r=e;r<t;r++)this.paintTransitionVertexArray.emplace(r,i[0],i[1],n[0],n[1])}}}upload(e){const t=this.expression.isStateDependent||!this.expression.isLightConstant;this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,t)),this.paintTransitionVertexArray&&this.paintTransitionVertexArray.length&&(this.paintTransitionVertexBuffer=e.createVertexBuffer(this.paintTransitionVertexArray,ac.members,t))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy(),this.paintTransitionVertexBuffer&&this.paintTransitionVertexBuffer.destroy()}}class Rc{constructor(e,t,i=()=>!0){this.binders={},this._buffers=[],this.context=t;const n=[];for(const r in e.paint._values){const o=e.paint.get(r);if(r.endsWith("-use-theme"))continue;if(!i(r))continue;if(!(o instanceof Sa&&Ao(o.property.specification)))continue;const s=Oc(r,e.type),a=o.value,l=o.property.specification.type,c=!!o.property.useIntegerZoom,u="line-dasharray"===r||r.endsWith("pattern"),h=e.paint.get(`${r}-use-theme`),d="line-dasharray"===r&&"constant"!==e.layout.get("line-cap").value.kind||h&&"constant"!==h.value.kind;if("constant"!==a.kind||d)if("source"===a.kind||d||u){const t=Bc(r,l,"source");this.binders[r]=u?new Dc(a,s,l,t,e.id):new Cc(a,s,l,t),n.push(`/a_${r}`)}else{const e=Bc(r,l,"composite");this.binders[r]=new Pc(a,s,l,c,t,e),n.push(`/z_${r}`)}else this.binders[r]=u?new Mc(a.value,s):new Ac(a.value,s,l,t),n.push(`/u_${r}`);h&&(this.binders[r].lutExpression=h.value)}this.cacheKey=n.sort().join("")}getMaxValue(e){const t=this.binders[e];return t instanceof Cc||t instanceof Pc?t.maxValue:0}populatePaintArrays(e,t,i,n,r,o,s,a){for(const l in this.binders){const c=this.binders[l];c.context=this.context,(c instanceof Cc||c instanceof Pc||c instanceof Dc)&&c.populatePaintArray(e,t,i,n,r,o,s,a)}}setConstantPatternPositions(e,t){for(const i in this.binders){const n=this.binders[i];n instanceof Mc&&n.setConstantPatternPositions(e,t)}}getPatternTransitionVertexBuffer(e){const t=this.binders[e];return t instanceof Dc?t.paintTransitionVertexBuffer:null}updatePaintArrays(e,t,i,n,r,o,s,a,l,c){let u=!1;const h=Object.keys(e),d=0!==h.length&&!a,f=d?h:t.uniqueIds;this.context.lut=r.lut;for(const a in this.binders){const h=this.binders[a];if(h.context=this.context,(h instanceof Cc||h instanceof Pc||h instanceof Dc)&&h.expression&&h.expression.kind&&"constant"!==h.expression.kind&&(!0===h.expression.isStateDependent||!1===h.expression.isLightConstant)){const p=r.paint.get(a);h.expression=p.value;for(const i of f){const r=e[i.toString()];t.eachPosition(i,(e,t,i)=>{const a=n.feature(e);h.updatePaintArray(t,i,a,r,o,s,l,c)})}if(!d)for(const t of i.uniqueIds){const r=e[t.toString()];i.eachPosition(t,(e,t,i)=>{const a=n.feature(e);h.updatePaintArray(t,i,a,r,o,s,l,c)})}u=!0}}return u}defines(){const e=[];for(const t in this.binders){const i=this.binders[t];(i instanceof Ac||i instanceof Mc)&&e.push(...i.uniformNames.map(e=>`#define HAS_UNIFORM_${e}`))}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e){const t=[];for(const i in this.binders){const n=this.binders[i];if(n instanceof Ac||n instanceof Mc||n instanceof Pc)for(const r of n.uniformNames)t.push({name:r,property:i,binding:n.getBinding(e,r)})}return t}setUniforms(e,t,i,n,r){for(const{name:t,property:o,binding:s}of i)this.binders[o].setUniform(e,s,r,n.get(o),t)}updatePaintBuffers(){this._buffers=[];for(const e in this.binders){const t=this.binders[e];(t instanceof Cc||t instanceof Pc||t instanceof Dc)&&t.paintVertexBuffer&&this._buffers.push(t.paintVertexBuffer),t instanceof Dc&&t.paintTransitionVertexBuffer&&this._buffers.push(t.paintTransitionVertexBuffer)}}upload(e){for(const t in this.binders){const i=this.binders[t];(i instanceof Cc||i instanceof Pc||i instanceof Dc)&&i.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const t=this.binders[e];(t instanceof Cc||t instanceof Pc||t instanceof Dc)&&t.destroy()}}}class Lc{constructor(e,t,i=()=>!0){this.programConfigurations={};for(const n of e)this.programConfigurations[n.id]=new Rc(n,t,i);this.needsUpload=!1,this._featureMap=new cc,this._featureMapWithoutIds=new cc,this._bufferOffset=0,this._idlessCounter=0}populatePaintArrays(e,t,i,n,r,o,s,a,l){for(const i in this.programConfigurations)this.programConfigurations[i].populatePaintArrays(e,t,n,r,o,s,a,l);void 0!==t.id?this._featureMap.add(t.id,i,this._bufferOffset,e):(this._featureMapWithoutIds.add(this._idlessCounter,i,this._bufferOffset,e),this._idlessCounter+=1),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,i,n,r,o,s,a){for(const l of i)this.needsUpload=this.programConfigurations[l.id].updatePaintArrays(e,this._featureMap,this._featureMapWithoutIds,t,l,n,r,o,s||0,a)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}const zc={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-occlusion-opacity":["occlusion_opacity"],"icon-occlusion-opacity":["occlusion_opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-emissive-strength":["emissive_strength"],"icon-emissive-strength":["emissive_strength"],"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"],"symbol-z-offset":["z_offset"],"line-gap-width":["ga
2pwidth"],"line-pattern":["pattern","pixel_ratio","pattern_b"],"fill-pattern":["pattern","pixel_ratio","pattern_b"],"fill-extrusion-pattern":["pattern","pixel_ratio","pattern_b"],"line-dasharray":["dash"],"fill-bridge-guard-rail-color":["structure_color"],"fill-tunnel-structure-color":["structure_color"]};function Oc(e,t){return zc[e]||[e.replace(`${t}-`,"").replace(/-/g,"_")]}const Fc={"line-pattern":{source:ml,composite:ml},"fill-pattern":{source:ml,composite:ml},"fill-extrusion-pattern":{source:ml,composite:ml},"line-dasharray":{source:_l,composite:_l}},kc={color:{source:Ol,composite:xl},number:{source:cl,composite:Ol}};function Bc(e,t,i){const n=Fc[e];return n&&n[i]||kc[t][i]}Jo(Ac,"ConstantBinder"),Jo(Mc,"PatternConstantBinder"),Jo(Cc,"SourceExpressionBinder"),Jo(Dc,"PatternCompositeBinder"),Jo(Pc,"CompositeExpressionBinder"),Jo(Rc,"ProgramConfiguration",{omit:["_buffers"]}),Jo(Lc,"ProgramConfigurationSet");const Nc=Vn/Math.PI/2,Vc=64,Uc=[Vc,32,16],jc=-Nc,Gc=Nc;function qc(e,t,i,n=Nc){return i=Me(i),[e*Math.sin(i)*n,-t*n,e*Math.cos(i)*n]}function Hc(e,t,i){return qc(Math.cos(Me(e)),Math.sin(Me(e)),t,i)}const $c=6371008.8,Wc=2*Math.PI*$c;class Zc{constructor(e,t){if(isNaN(e)||isNaN(t))throw new Error(`Invalid LngLat object: (${e}, ${t})`);if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Zc(Fe(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const t=Math.PI/180,i=this.lat*t,n=e.lat*t,r=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((e.lng-this.lng)*t);return $c*Math.acos(Math.min(r,1))}toBounds(e=0){const t=360*e/40075017,i=t/Math.cos(Math.PI/180*this.lat);return new Xc({lng:this.lng-i,lat:this.lat-t},{lng:this.lng+i,lat:this.lat+t})}toEcef(e){return Hc(this.lat,this.lng,Nc+e*Nc/$c)}static convert(e){if(e instanceof Zc)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new Zc(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new Zc(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>]")}}class Xc{constructor(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):Array.isArray(e)&&4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))}setNorthEast(e){return this._ne=e instanceof Zc?new Zc(e.lng,e.lat):Zc.convert(e),this}setSouthWest(e){return this._sw=e instanceof Zc?new Zc(e.lng,e.lat):Zc.convert(e),this}extend(e){const t=this._sw,i=this._ne;let n,r;if(e instanceof Zc)n=e,r=e;else{if(!(e instanceof Xc))return Array.isArray(e)?4===e.length||e.every(Array.isArray)?this.extend(Xc.convert(e)):this.extend(Zc.convert(e)):"object"==typeof e&&null!==e&&e.hasOwnProperty("lat")&&(e.hasOwnProperty("lon")||e.hasOwnProperty("lng"))?this.extend(Zc.convert(e)):this;if(n=e._sw,r=e._ne,!n||!r)return this}return t||i?(t.lng=Math.min(n.lng,t.lng),t.lat=Math.min(n.lat,t.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Zc(n.lng,n.lat),this._ne=new Zc(r.lng,r.lat)),this}getCenter(){return new Zc((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 Zc(this.getWest(),this.getNorth())}getSouthEast(){return new Zc(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:t,lat:i}=Zc.convert(e);let n=this._sw.lng<=t&&t<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=t&&t>=this._ne.lng),this._sw.lat<=i&&i<=this._ne.lat&&n}static convert(e){if(e)return e instanceof Xc?e:new Xc(e)}}function Yc(e){return Wc*Math.cos(e*Math.PI/180)}function Kc(e){return(180+e)/360}
vendor: 5,774 bytes, line 2
2function Jc(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Qc(e,t){return e/Yc(t)}function eu(e){return 360*e-180}function tu(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}function iu(e,t){return e*Yc(tu(t))}const nu=85.051129;function ru(e){return Math.cos(Me(ze(e,-nu,nu)))}function ou(e,t){const i=ze(t,0,25.5),n=Math.pow(2,i);return ru(e)*Wc/(512*n)}function su(e){return 1/Math.cos(e*Math.PI/180)}function au(e,t=0){const i=Math.exp(Math.PI*(1-(e.y+t/Vn)/(1<<e.z)*2));return 80150034*i/(i*i+1)/Vn/(1<<e.z)}class lu{constructor(e,t,i=0){this.x=+e,this.y=+t,this.z=+i}static fromLngLat(e,t=0){const i=Zc.convert(e);return new lu(Kc(i.lng),Jc(i.lat),Qc(t,i.lat))}toLngLat(){return new Zc(eu(this.x),tu(this.y))}toAltitude(){return iu(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Wc*su(tu(this.y))}}function cu(e,t,i,n,r,o,s,a,l){const c=(t+n)/2,u=(i+r)/2,h=new Se(c,u);a(h),function(e,t,i,n,r,o){const s=i-r,a=n-o;return Math.abs((n-t)*s-(i-e)*a)/Math.hypot(s,a)}(h.x,h.y,o.x,o.y,s.x,s.y)>=l?(cu(e,t,i,c,u,o,h,a,l),cu(e,c,u,n,r,h,s,a,l)):e.push(s)}function uu(e,t,i){let n=e[0],r=n.x,o=n.y;t(n);const s=[n];for(let a=1;a<e.length;a++){const l=e[a],{x:c,y:u}=l;t(l),cu(s,r,o,c,u,n,l,t,i),r=c,o=u,n=l}return s}function hu(e,t,i,n){if(n(t,i)){const r=t.add(i)._mult(.5);hu(e,t,r,n),hu(e,r,i,n)}else e.push(i)}function du(e,t){let i=e[0];const n=[i];for(let r=1;r<e.length;r++){const o=e[r];hu(n,i,o,t),i=o}return n}const fu=Math.pow(2,14)-1,pu=-fu-1;function mu(e,t){const i=Math.round(e.x*t),n=Math.round(e.y*t);return e.x=ze(i,pu,fu),e.y=ze(n,pu,fu),(i<e.x||i>e.x+1||n<e.y||n>e.y+1)&&We("Geometry exceeds allowed extent, reduce your vector tile buffer size"),e}function _u(e,t,i){const n=e.loadGeometry(),r=e.extent,o=Vn/r;if(t&&i&&i.projection.isReprojectedInTileSpace){const o=1<<t.z,{scale:s,x:a,y:l,projection:c}=i,u=e=>{const i=eu((t.x+e.x/r)/o),n=tu((t.y+e.y/r)/o),u=c.project(i,n);e.x=(u.x*s-a)*r,e.y=(u.y*s-l)*r};for(let t=0;t<n.length;t++)if(1!==e.type)n[t]=uu(n[t],u,1);else{const e=[];for(const i of n[t])i.x<0||i.x>=r||i.y<0||i.y>=r||(u(i),e.push(i));n[t]=e}}for(const e of n)for(const t of e)mu(t,o);return n}function gu(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?_u(e):[]}}class yu{constructor(e,t,i,n,r){this.properties={},this.extent=i,this.type=0,this.id=void 0,this._pbf=e,this._geometry=-1,this._keys=n,this._values=r,e.readFields(vu,this,t)}loadGeometry(){const e=this._pbf;e.pos=this._geometry;const t=e.readVarint()+e.pos,i=[];let n,r=1,o=0,s=0,a=0;for(;e.pos<t;){if(o<=0){const t=e.readVarint();r=7&t,o=t>>3}if(o--,1===r||2===r)s+=e.readSVarint(),a+=e.readSVarint(),1===r&&(n&&i.push(n),n=[]),n&&n.push(new Se(s,a));else{if(7!==r)throw new Error(`unknown command ${r}`);n&&n.push(n[0].clone())}}return n&&i.push(n),i}bbox(){const e=this._pbf;e.pos=this._geometry;const t=e.readVarint()+e.pos;let i=1,n=0,r=0,o=0,s=1/0,a=-1/0,l=1/0,c=-1/0;for(;e.pos<t;){if(n<=0){const t=e.readVarint();i=7&t,n=t>>3}if(n--,1===i||2===i)r+=e.readSVarint(),o+=e.readSVarint(),r<s&&(s=r),r>a&&(a=r),o<l&&(l=o),o>c&&(c=o);else if(7!==i)throw new Error(`unknown command ${i}`)}return[s,l,a,c]}toGeoJSON(e,t,i){const n=this.extent*Math.pow(2,i),r=this.extent*e,o=this.extent*t,s=this.loadGeometry();function a(e){return[360*(e.x+r)/n-180,360/Math.PI*Math.atan(Math.exp((1-2*(e.y+o)/n)*Math.PI))-90]}function l(e){return e.map(a)}let c;if(1===this.type){const e=[];for(const t of s)e.push(t[0]);const t=l(e);c=1===e.length?{type:"Point",coordinates:t[0]}:{type:"MultiPoint",coordinates:t}}else if(2===this.type){const e=s.map(l);c=1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}}else{if(3!==this.type)throw new Error("unknown feature type");{const e=function(e){const t=e.length;if(t<=1)return[e];const i=[];let n,r;for(let o=0;o<t;o++){const t=xu(e[o]);0!==t&&(void 0===r&&(r=t<0),r===t<0?(n&&i.push(n),n=[e[o]]):n&&n.push(e[o]))}return n&&i.push(n),i}(s),t=[];for(const i of e)t.push(i.map(l));c=1===t.length?{type:"Polygon",coordinates:t[0]}:{type:"MultiPolygon",coordinates:t}}}const u={type:"Feature",geometry:c,properties:this.properties};return null!=this.id&&(u.id=this.id),u}}function vu(e,t,i){1===e?t.id=i.readVarint():2===e?function(e,t){const i=e.readVarint()+e.pos;for(;e.pos<i;){const i=t._keys[e.readVarint()],n=t._values[e.readVarint()];t.properties[i]=n}}(i,t):3===e?t.type=i.readVarint():4===e&&(t._geometry=i.pos)}function xu(e){let t=0;for(let i,n,r=0,o=e.length,s=o-1;r<o;s=r++)i=e[r],n=e[s],t+=(n.x-i.x)*(i.y+n.y);return t}yu.types=["Unknown","Point","LineString","Polygon"];class bu{constructor(e,t){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(wu,this,t),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];const t=this._pbf.readVarint()+this._pbf.pos;return new yu(this._pbf,t,this.extent,this._keys,this._values)}}function wu(e,t,i){15===e?t.version=i.readVarint():1===e?t.name=i.readString():5===e?t.extent=i.readVarint():2===e?t._features.push(i.pos):3===e?t._keys.push(i.readString()):4===e&&t._values.push(function(e){let t=null;const i=e.readVarint()+e.pos;for(;e.pos<i;){const i=e.readVarint()>>3;t=1===i?e.readString():2===i?e.readFloat():3===i?e.readDouble():4===i?e.readVarint64():5===i?e.readVarint():6===i?e.readSVarint():7===i?e.readBoolean():null}if(null==t)throw new Error("unknown feature value");return t}(i))}class Tu{constructor(e,t){this.layers=e.readFields(Su,{},t)}}function Su(e,t,i){if(3===e){const e=new bu(i,i.readVarint()+i.pos);e.length&&(t[e.name]=e)}}const Eu="3d_elevation_id",Iu="level";
2class Au{constructor(){this._valid=!1}reset(e){return this.feature=e,this._valid=!0,this._geometry=e.loadGeometry(),0!==this._geometry.length&&0!==this._geometry[0].length||(this._valid=!1),this}geometry(e,t){return this._valid&&e(t(this._geometry)),this}require(e,t,i){return this.get(e,!0,t,i)}optional(e,t,i){return this.get(e,!1,t,i)}success(){return this._valid}get(e,t,i,n){const r=this.feature.properties.hasOwnProperty(e)?+this.feature.properties[e]:void 0;return this._valid&&void 0!==r&&!Number.isNaN(r)?i(n?n(r):r):t&&(this._valid=!1),this}}class Mu{constructor(e,t){this.featureFunc=e,this.vertexFunc=t}parseFeature(e,t,i){return this.featureFunc(e,t,i)}parseVertex(e,t,i){return this.vertexFunc(e,t,i)}}const Cu=new Mu((e,t,i)=>e.reset(t).require(Eu,e=>{i.id=e}).optional("fixed_height_relative",e=>{i.constantHeight=e},Du.decodeRelativeHeight).geometry(e=>{i.bounds=e},yn).success(),(e,t,i)=>e.reset(t).require(Eu,e=>{i.id=e}).require("elevation_idx",e=>{i.idx=e}).require("extent",e=>{i.extent=e}).require("height_relative",e=>{i.height=e},Du.decodeRelativeHeight).geometry(e=>{i.position=e},Du.getPoint).success()),Pu=new Mu((e,t,i)=>e.reset(t).require(Eu,e=>{i.id=e}).optional("fixed_height",e=>{i.constantHeight=e},Du.decodeMetricHeight).geometry(e=>{i.bounds=e},yn).success(),(e,t,i)=>e.reset(t).require(Eu,e=>{i.id=e}).require("elevation_idx",e=>{i.idx=e}).require("extent",e=>{i.extent=e}).require("height",e=>{i.height=e},Du.decodeMetricHeight).geometry(e=>{i.position=e},Du.getPoint).success());class Du{static getPoint(e){return ue(e[0][0].x,e[0][0].y)}static decodeRelativeHeight(e){return 1e-4*e*5}static decodeMetricHeight(e){return 1e-4*e}static getVersionSchema(e){return e?"1.0.1"===e?Pu:void 0:Cu}static parse(e){const t=[],i=[],n=e.length,r=new Au;for(let o=0;o<n;o++){const n=e.feature(o),s=n.properties.version,a=Du.getVersionSchema(s);if(void 0===a){We(`Unknown elevation feature version number ${s||"(unknown)"}`);continue}const l=n.properties.type;if(!l)continue;const c=yu.types[n.type];if("Point"===c&&"curve_point"===l){const e={};a.parseVertex(r,n,e)&&t.push(e)}else if("Polygon"===c&&"curve_meta"===l){const e={};a.parseFeature(r,n,e)&&i.push(e)}}return{vertices:t,features:i}}}class Ru{constructor(e,t){this.pos=e,this.dir=t}intersectsPlane(e,t,i){const n=ge(t,this.dir);if(Math.abs(n)<1e-6)return!1;const r=((e[0]-this.pos[0])*t[0]+(e[1]-this.pos[1])*t[1])/n;return i[0]=this.pos[0]+this.dir[0]*r,i[1]=this.pos[1]+this.dir[1]*r,!0}}class Lu{constructor(e,t){this.pos=e,this.dir=t}intersectsPlane(e,t,i){const n=N(t,this.dir);if(Math.abs(n)<1e-6)return!1;const r=((e[0]-this.pos[0])*t[0]+(e[1]-this.pos[1])*t[1]+(e[2]-this.pos[2])*t[2])/n;return i[0]=this.pos[0]+this.dir[0]*r,i[1]=this.pos[1]+this.dir[1]*r,i[2]=this.pos[2]+this.dir[2]*r,!0}closestPointOnSphere(e,i,n){if(function(e,i){var n=e[0],r=e[1],o=e[2],s=i[0],a=i[1],l=i[2];return Math.abs(n-s)<=t*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(r-a)<=t*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(o-l)<=t*Math.max(1,Math.abs(o),Math.abs(l))}(this.pos,e)||0===i)return n[0]=n[1]=n[2]=0,!1;const[r,o,s]=this.dir,a=this.pos[0]-e[0],l=this.pos[1]-e[1],c=this.pos[2]-e[2],u=r*r+o*o+s*s,h=2*(a*r+l*o+c*s),d=h*h-4*u*(a*a+l*l+c*c-i*i);if(d<0){const e=Math.max(-h/2,0),t=a+r*e,u=l+o*e,d=c+s*e,f=Math.hypot(t,u,d);return n[0]=t*i/f,n[1]=u*i/f,n[2]=d*i/f,!1}{const e=(-h-Math.sqrt(d))/(2*u);if(e<0){const e=Math.hypot(a,l,c);return n[0]=a*i/e,n[1]=l*i/e,n[2]=c*i/e,!1}return n[0]=a+r*e,n[1]=l+o*e,n[2]=c+s*e,!0}}}class zu{constructor(e,t,i,n,r){this.TL=e,this.TR=t,this.BR=i,this.BL=n,this.horizon=r}static fromInvProjectionMatrix(e,t,i){const n=[-1,1,1],r=[1,1,1],o=[1,-1,1],s=[-1,-1,1],a=j(n,n,e),l=j(r,r,e),c=j(o,o,e),u=j(s,s,e);return new zu(a,l,c,u,t/i)}}function Ou(e,t,i){let n=1/0,r=-1/0;const o=[];for(const s of e){W(o,s,t);const e=N(o,i);n=Math.min(n,e),r=Math.max(r,e)}return[n,r]}function Fu(e,t){let i=!0;for(let n=0;n<e.planes.length;n++){const r=e.planes[n];let o=0;for(let e=0;e<t.length;e++)o+=+(N(r,t[e])+r[3]>=0);if(0===o)return 0;o!==t.length&&(i=!1)}return i?2:1}function ku(e,t){for(const i of e.projections){const n=Ou(t,e.points[0],i.axis);if(i.projection[1]<n[0]||i.projection[0]>n[1])return 0}return 1}function Bu(e,t){let i=0;const n=[0,0,0,0];for(let s=0;s<e.length;s++)n[0]=e[s][0],n[1]=e[s][1],n[2]=e[s][2],n[3]=1,(r=n)[0]*(o=t)[0]+r[1]*o[1]+r[2]*o[2]+r[3]*o[3]>=0&&i++;var r,o;return i}class Nu{constructor(e,t){this.points=e||new Array(8).fill([0,0,0]),this.planes=t||new Array(6).fill([
vendor: 6,752 bytes, line 2
20,0,0,0]),this.bounds=Vu.fromPoints(this.points),this.projections=[],this.frustumEdges=[W([],this.points[2],this.points[3]),W([],this.points[0],this.points[3]),W([],this.points[4],this.points[0]),W([],this.points[5],this.points[1]),W([],this.points[6],this.points[2]),W([],this.points[7],this.points[3])];for(const e of this.frustumEdges){const t=[0,-e[2],e[1]],i=[e[2],0,-e[0]];this.projections.push({axis:t,projection:Ou(this.points,this.points[0],t)}),this.projections.push({axis:i,projection:Ou(this.points,this.points[0],i)})}}static fromInvProjectionMatrix(e,t,i,n){const r=Math.pow(2,i),o=[[-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(i=>{const o=Q([],i,e),s=1/o[3]/t*r;return(a=o)[0]=(l=o)[0]*(c=[s,s,n?1/o[3]:s,s])[0],a[1]=l[1]*c[1],a[2]=l[2]*c[2],a[3]=l[3]*c[3],a;var a,l,c}),s=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(e=>{const t=B([],V([],W([],o[e[0]],o[e[1]]),W([],o[e[2]],o[e[1]]))),i=-N(t,o[e[1]]);return t.concat(i)}),a=[];for(let e=0;e<o.length;e++)a.push([o[e][0],o[e][1],o[e][2]]);return new Nu(a,s)}intersectsPrecise(e,t,i){for(let i=0;i<t.length;i++)if(!Bu(e,t[i]))return 0;for(let t=0;t<this.planes.length;t++)if(!Bu(e,this.planes[t]))return 0;for(const t of i)for(const i of this.frustumEdges){const n=V([],t,i),r=S(n);if(0===r)continue;R(n,n,1/r);const o=Ou(this.points,this.points[0],n),s=Ou(e,this.points[0],n);if(o[0]>s[1]||s[0]>o[1])return 0}return 1}containsPoint(e){for(const t of this.planes){const i=t[3];if(N([t[0],t[1],t[2]],e)+i<0)return!1}return!0}}class Vu{static fromPoints(e){const t=[1/0,1/0,1/0],i=[-1/0,-1/0,-1/0];for(const n of e)P(t,t,n),D(i,i,n);return new Vu(t,i)}static fromTileIdAndHeight(e,t,i){const n=1<<e.canonical.z,r=e.canonical.x,o=e.canonical.y;return new Vu([r/n,o/n,t],[(r+1)/n,(o+1)/n,i])}static applyTransform(e,t){const i=e.getCorners();for(let e=0;e<i.length;++e)j(i[e],i[e],t);return Vu.fromPoints(i)}static applyTransformFast(e,t){const i=[t[12],t[13],t[14]],n=[...i];for(let r=0;r<3;r++)for(let o=0;o<3;o++){const s=t[4*o+r],a=s*e.min[o],l=s*e.max[o];i[r]+=Math.min(a,l),n[r]+=Math.max(a,l)}return new Vu(i,n)}static projectAabbCorners(e,t){const i=e.getCorners();for(let e=0;e<i.length;++e)j(i[e],i[e],t);return i}constructor(e,t){this.min=e,this.max=t,this.center=R([],A([],this.min,this.max),.5)}quadrant(e){const t=[e%2==0,e<2],i=T(this.min),n=T(this.max);for(let e=0;e<t.length;e++)i[e]=t[e]?this.min[e]:this.center[e],n[e]=t[e]?this.center[e]:this.max[e];return n[2]=this.max[2],new Vu(i,n)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}distanceZ(e){return Math.max(Math.min(this.max[2],e[2]),this.min[2])-e[2]}getCorners(){const e=this.min,t=this.max;return[[e[0],e[1],e[2]],[t[0],e[1],e[2]],[t[0],t[1],e[2]],[e[0],t[1],e[2]],[e[0],e[1],t[2]],[t[0],e[1],t[2]],[t[0],t[1],t[2]],[e[0],t[1],t[2]]]}intersects(e){return this.intersectsAabb(e.bounds)?Fu(e,this.getCorners()):0}intersectsFlat(e){return this.intersectsAabb(e.bounds)?Fu(e,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsPrecise(e,t){return t||this.intersects(e)?ku(e,this.getCorners()):0}intersectsPreciseFlat(e,t){return t||this.intersectsFlat(e)?ku(e,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsAabb(e){for(let t=0;t<3;++t)if(this.min[t]>e.max[t]||e.min[t]>this.max[t])return!1;return!0}intersectsAabbXY(e){return!(this.min[0]>e.max[0]||e.min[0]>this.max[0]||this.min[1]>e.max[1]||e.min[1]>this.max[1])}encapsulate(e){for(let t=0;t<3;t++)this.min[t]=Math.min(this.min[t],e.min[t]),this.max[t]=Math.max(this.max[t],e.max[t])}encapsulatePoint(e){for(let t=0;t<3;t++)this.min[t]=Math.min(this.min[t],e[t]),this.max[t]=Math.max(this.max[t],e[t])}closestPoint(e){return[Math.max(Math.min(this.max[0],e[0]),this.min[0]),Math.max(Math.min(this.max[1],e[1]),this.min[1]),Math.max(Math.min(this.max[2],e[2]),this.min[2])]}}Jo(Vu,"Aabb");class Uu{constructor(e,t){this.feature=e,this.metersToTile=t,this.index=0}get(){const e=this.feature.vertices[this.index],t=this.feature.vertexProps[this.index].dir,i=t[1],n=-t[0],r=(e.extent+1)*this.metersToTile;return[new Se(Math.trunc(e.position[0]+i*r),Math.trunc(e.position[1]+n*r)),new Se(Math.trunc(e.position[0]-i*r),Math.trunc(e.position[1]-n*r))]}next(){this.index++}valid(){return this.index<this.feature.vertices.length}}class ju{constructor(e,t,i,n,r,o){if(this.vertices=new Array,this.vertexProps=new Array,this.edges=new Array,this.edgeProps=new Array,this._tmpVec2=[ce(),ce(),ce(),ce(),ce(),ce(),ce()],this.id=e,this.heightRange={min:i,max:i},this.safeArea=t,this.constantHeight=i,null==this.constantHeight&&(null!=this.constantHeight||0!==n.length)){this.vertices=n,this.edges=r,this.edges=this.edges.filter(e=>{return e.a<this.vertices.length&&e.b<this.vertices.length&&!((t=this.vertices[e.a].position)[0]===(i=this.vertices[e.b].position)[0]&&t[1]===i[1]);var t,i}),this.heightRange={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};for(const e of this.vertices)this.vertexProps.push({dir:ue(0,0)}),this.heightRange.min=Math.min(this.heightRange.min,e.height),this.heightRange.max=Math.max(this.heightRange.max,e.height);for(const e of this.edges){const t=this.vertices[e.a].position,i=this.vertices[e.b].position,n=fe(ce(),i,t),r=me(n),o=pe(ce(),n,1/r);this.edgeProps.push({vec:n,dir:o,len:r});const s=this.vertexProps[e.a].dir,a=this.vertexProps[e.b].dir;de(s,s,o),de(a,a,o)}for(const e of this.vertexProps)0===e.dir[0]&&0===e.dir[1]||_e(e.dir,e.dir);this.tessellate(o)}}pointElevation(e){if(null!=this.constantHeight)return this.constantHeight;const t=this.getClosestEdge(e);if(null==t)return 0;const[i,n]=t;return di(this.vertices[this.edges[i].a].height,this.vertices[this.edges[i].b].height,n)}computeSlopeNormal(e,t){const i=this.getClosestEdge(e);if(!i)return E(0,0,1);const n=i[0],r=this.edges[n],o=this.edgeProps[n].vec,s=E(o[0],o[1],(this.vertices[r.b].height-this.vertices[r.a].height)*t),a=E(s[1],-s[0],0);V(a,a,s);const l=S(a);return l>0?R(a,a,1/l):I(a,0,0,1)}getSafeArea(){return this.safeArea}isTunnel(){return this.heightRange.max<=-5}getClosestEdge(e){if(0===this.edges.length)return;let t=0,i=Number.POSITIVE_INFINITY,n=0;const[r,o,s,a,l,c,u]=this._tmpVec2;he(u,e.x,e.y);const h=new Ru(u,null);for(let e=0;e<this.edges.length;e++){const d=this.edges[e],f=this.edgeProps[e].dir;h.dir=f;const p=this.vertices[d.a].position,m=this.vertices[d.b].position,_=h.intersectsPlane(p,this.vertexProps[d.a].dir,r),g=h.intersectsPlane(m,this.vertexProps[d.b].dir,o);if(!_||!g)continue;fe(s,o,r),fe(a,u,r);const y=ge(s,s),v=y>
vendor: 4,038 bytes, line 2
20?ge(a,s)/y:0,x=ze(v,0,1),b=Math.abs((v-x)*this.edgeProps[e].len);fe(l,u,p),he(c,f[1],-f[0]);const w=b+Math.abs(ge(l,c));w<i&&(t=e,i=w,n=x)}return[t,n]}tessellate(e){const t=w(),i=w(),n=w(),r=w();for(let o=this.edges.length-1;o>=0;--o){const s=this.edges[o].a,a=this.edges[o].b,{position:l,height:c,extent:u}=this.vertices[s],{position:h,height:d,extent:f}=this.vertices[a],p=this.vertexProps[s].dir,m=this.vertexProps[a].dir;if(I(t,l[0]/e,l[1]/e,c),I(i,h[0]/e,h[1]/e,d),I(n,p[1],-p[0],0),R(n,n,u),I(r,m[1],-m[0],0),R(r,r,f),this.distSqLines(E(t[0]+.5*n[0],t[1]+.5*n[1],t[2]+.5*n[2]),E(i[0]-.5*r[0],i[1]-.5*r[1],i[2]-.5*r[2]),E(t[0]-.5*n[0],t[1]-.5*n[1],t[2]-.5*n[2]),E(i[0]+.5*r[0],i[1]+.5*r[1],i[2]+.5*r[2]))<=.0025000000000000005)continue;const _=this.vertices.length,g=de(ce(),l,h);this.vertices.push({position:pe(g,g,.5),height:.5*(c+d),extent:.5*(u+f)});const y=de(ce(),p,m);this.vertexProps.push({dir:_e(y,y)}),this.edges.splice(o,1),this.edgeProps.splice(o,1),this.edges.push({a:s,b:_}),this.edges.push({a:_,b:a});const v=fe(ce(),this.vertices[_].position,l),x=me(v),b={vec:v,dir:pe(ce(),v,1/x),len:x};this.edgeProps.push(b),this.edgeProps.push(b)}}distSqLines(e,t,i,n){const r=M(w(),t,e),o=M(w(),n,i),s=M(w(),e,i),a=N(r,r),l=N(r,o),c=N(r,s),u=N(o,o),h=N(o,s),d=a*u-l*l;if(0===d)return O(U(r,i,n,N(s,o)/N(o,o)),e);const f=(a*h-l*c)/d;return O(U(r,e,t,(l*h-c*u)/d),U(o,i,n,f))}}class Gu{static parseFrom(e,t){const i=Du.parse(e);if(!i)return[];let{vertices:n,features:r}=i;const o=1/au(t);r.sort((e,t)=>e.id-t.id),n.sort((e,t)=>e.id-t.id||e.idx-t.idx),n=n.filter((e,t,i)=>t===i.findIndex(t=>t.id===e.id&&t.idx===e.idx));const s=new Array;let a=0;const l=n.length;for(const e of r){if(e.constantHeight){s.push(new ju(e.id,e.bounds,e.constantHeight));continue}for(;a!==l&&n[a].id<e.id;)a++;if(a===l||n[a].id!==e.id)continue;const t=new Array,i=new Array,r=a;for(;a!==l&&n[a].id===e.id;){const e=n[a];if(t.push({position:e.position,height:e.height,extent:e.extent}),a!==r&&n[a-1].idx===e.idx-1){const e=a-r;i.push({a:e-1,b:e})}a++}s.push(new ju(e.id,e.bounds,void 0,t,i,o))}return s}static getElevationFeature(e,t){if(!t)return;const i=+e.properties[Eu];return Number.isNaN(i)?void 0:t.find(e=>e.id===i)}}class qu{constructor(e,t){this.zScale=1,this.xOffset=0,this.yOffset=0,e.equals(t)||(this.zScale=Math.pow(2,t.z-e.z),this.xOffset=(e.x*this.zScale-t.x)*Vn,this.yOffset=(e.y*this.zScale-t.y)*Vn)}constantElevation(e,t){if(null!=e.constantHeight)return this.computeBiasedHeight(e.constantHeight,t)}pointElevation(e,t,i){const n=this.constantElevation(t,i);return null!=n?n:(e.x=e.x*this.zScale+this.xOffset,e.y=e.y*this.zScale+this.yOffset,this.computeBiasedHeight(t.pointElevation(e),i))}computeBiasedHeight(e,t){return t<=0?e:e+t*Oe(0,t,e>=0?e:Math.abs(.5*e))}}Jo(ju,"ElevationFeature");class Hu{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new sl,this.indexArray=new Al,this.segments=new rc,this.programConfigurations=new Lc(e.layers,{zoom:e.zoom,lut:e.lut}),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.elevationMode=this.layers[0].layout.get("circle-elevation-reference"),this.hasElevation=!1,"none"!==this.elevationMode&&(this.elevatedLayoutVertexArray=new cl),this.worldview=e.worldview,this.hasAppearances=null}updateFootprints(e,t){}updateAppearances(e,t,i,n){}populate(e,t,i,n){const r=this.layers[0],o=[];let s=null;"circle"===r.type&&(s=r.layout.get("circle-sort-key"));for(const{feature:r,id:a,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,u=gu(r,e);if(!this.layers[0]._featureFilter.filter(new ga(this.zoom,{worldview:this.worldview,activeFloors:t.activeFloors}),u,i))continue;const h=s?s.evaluate(u,{},i):void 0,d={id:a,properties:r.properties,type:r.type,sourceLayerIndex:c,index:l,geometry:e?u.geometry:_u(r,i,n),patterns:{},sortKey:h};o.push(d)}s&&o.sort((e,t)=>
vendor: 8,074 bytes, line 2
2e.sortKey-t.sortKey);let a=null;"globe"===n.projection.name&&(this.globeExtVertexArray=new gl,a=n.projection);for(const n of o){const{geometry:r,index:o,sourceLayerIndex:s}=n,l=e[o].feature;this.addFeature(n,r,o,t.availableImages,i,a,t.brightness,t.elevationFeatures),t.featureIndex.insert(l,r,o,s,this.index)}this.hasElevation||(this.elevatedLayoutVertexArray=void 0)}update(e,t,i,n,r,o,s){this.programConfigurations.updatePaintArrays(e,t,r,i,n,o,s,this.worldview)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,tc.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,nc.members)),this.elevatedLayoutVertexArray&&(this.elevatedLayoutVertexBuffer=e.createVertexBuffer(this.elevatedLayoutVertexArray,ic.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy(),this.elevatedLayoutVertexBuffer&&this.elevatedLayoutVertexBuffer.destroy())}addFeature(e,t,i,n,r,o,s,a){let l;"none"!==this.elevationMode&&(l=Gu.getElevationFeature(e,a));for(const i of t)for(const t of i){const i=t.x,n=t.y;if(i<0||i>=Vn||n<0||n>=Vn)continue;if(o){const e=o.projectTilePoint(i,n,r),t=o.upVector(r,i,n);this.addGlobeExtVertex(e,t),this.addGlobeExtVertex(e,t),this.addGlobeExtVertex(e,t),this.addGlobeExtVertex(e,t)}const s=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),a=s.vertexLength;if(this.addCircleVertex(i,n,-1,-1),this.addCircleVertex(i,n,1,-1),this.addCircleVertex(i,n,1,1),this.addCircleVertex(i,n,-1,1),"none"!==this.elevationMode){const e=l?l.pointElevation(new Se(i,n)):0;this.hasElevation=this.hasElevation||0!==e;for(let t=0;t<4;t++)this.elevatedLayoutVertexArray.emplaceBack(e)}this.indexArray.emplaceBack(a,a+1,a+2),this.indexArray.emplaceBack(a,a+2,a+3),s.vertexLength+=4,s.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,{},n,r,s,void 0,this.worldview)}addCircleVertex(e,t,i,n){this.layoutVertexArray.emplaceBack(2*e+(i+1)/2,2*t+(n+1)/2)}addGlobeExtVertex(e,t){const i=16384;this.globeExtVertexArray.emplaceBack(e.x,e.y,e.z,t[0]*i,t[1]*i,t[2]*i)}}function $u(e,t){for(let i=0;i<e.length;i++)if(nh(t,e[i]))return!0;for(let i=0;i<t.length;i++)if(nh(e,t[i]))return!0;return!!Yu(e,t)}function Wu(e,t,i){return!!nh(e,t)||!!eh(t,e,i)}function Zu(e,t){if(1===e.length)return ih(t,e[0]);for(let i=0;i<t.length;i++){const n=t[i];for(let t=0;t<n.length;t++)if(nh(e,n[t]))return!0}for(let i=0;i<e.length;i++)if(ih(t,e[i]))return!0;for(let i=0;i<t.length;i++)if(Yu(e,t[i]))return!0;return!1}function Xu(e,t,i){if(e.length>1){if(Yu(e,t))return!0;for(let n=0;n<t.length;n++)if(eh(t[n],e,i))return!0}for(let n=0;n<e.length;n++)if(eh(e[n],t,i))return!0;return!1}function Yu(e,t){if(0===e.length||0===t.length)return!1;for(let i=0;i<e.length-1;i++){const n=e[i],r=e[i+1];for(let e=0;e<t.length-1;e++)if(Ku(n,r,t[e],t[e+1]))return!0}return!1}function Ku(e,t,i,n){return Ze(e,i,n)!==Ze(t,i,n)&&Ze(e,t,i)!==Ze(e,t,n)}function Ju(e,t,i){return(e.x-i.x)*(t.y-i.y)-(e.y-i.y)*(t.x-i.x)}function Qu(e,t,i,n){const r=Ju(e,t,n),o=Ju(e,t,i);if(Math.sign(r)===Math.sign(o))return;const s=Ju(i,n,e),a=s+o-r;return Math.sign(s)!==Math.sign(a)?[s/(s-a),o/(o-r)]:void 0}function eh(e,t,i){const n=i*i;if(1===t.length)return e.distSqr(t[0])<n;for(let i=1;i<t.length;i++)if(th(e,t[i-1],t[i])<n)return!0;return!1}function th(e,t,i){const n=t.distSqr(i);if(0===n)return e.distSqr(t);const r=((e.x-t.x)*(i.x-t.x)+(e.y-t.y)*(i.y-t.y))/n;return e.distSqr(r<0?t:r>1?i:i.sub(t)._mult(r)._add(t))}function ih(e,t){let i,n,r,o=!1;for(let s=0;s<e.length;s++){i=e[s];for(let e=0,s=i.length-1;e<i.length;s=e++)n=i[e],r=i[s],n.y>t.y!=r.y>t.y&&t.x<(r.x-n.x)*(t.y-n.y)/(r.y-n.y)+n.x&&(o=!o)}return o}function nh(e,t){let i=!1;for(let n=0,r=e.length-1;n<e.length;r=n++){const o=e[n],s=e[r];o.y>t.y!=s.y>t.y&&t.x<(s.x-o.x)*(t.y-o.y)/(s.y-o.y)+o.x&&(i=!i)}return i}function rh(e,t,i,n,r){for(const o of e)if(t<=o.x&&i<=o.y&&n>=o.x&&r>=o.y)return!0;const o=[new Se(t,i),new Se(t,r),new Se(n,r),new Se(n,i)];if(e.length>2)for(const t of o)if(nh(e,t))return!0;for(let t=0;t<e.length-1;t++)if(oh(e[t],e[t+1],o))return!0;return!1}function oh(e,t,i){const n=i[0],r=i[2];if(e.x<n.x&&t.x<n.x||e.x>r.x&&t.x>r.x||e.y<n.y&&t.y<n.y||e.y>r.y&&t.y>r.y)return!1;const o=Ze(e,t,i[0]);return o!==Ze(e,t,i[1])||o!==Ze(e,t,i[2])||o!==Ze(e,t,i[3])}function sh(e,t,i,n,r,o){let s=t.y-e.y,a=e.x-t.x;if(o=o||0){const e=s*s+a*a;if(0===e)return!0;const t=Math.sqrt(e);s/=t,a/=t}return!((i.x-e.x)*s+(i.y-e.y)*a-o<0||(n.x-e.x)*s+(n.y-e.y)*a-o<0||(r.x-e.x)*s+(r.y-e.y)*a-o<0)}function ah(e,t,i,n,r,o,s){return!(sh(e,t,n,r,o,s)||sh(t,i,n,r,o,s)||sh(i,e,n,r,o,s)||sh(n,r,e,t,i,s)||sh(r,o,e,t,i,s)||sh(o,n,e,t,i,s))}function lh(e,t,i){const n=t.paint.get(e).value;return"constant"===n.kind?n.value:i.programConfigurations.get(t.id).getMaxValue(e)}function ch(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function uh(e,t,i,n,r){if(!t[0]&&!t[1])return e;const o=Se.convert(t)._mult(r);"viewport"===i&&o._rotate(-n);const s=[];for(let t=0;t<e.length;t++)s.push(e[t].sub(o));return s}function hh(e,t,i,n){const r=Se.convert(e)._mult(n);return"viewport"===t&&r._rotate(-i),r}let dh,fh;function ph(e,t,i){var n=2*Math.PI*6378137/256/Math.pow(2,i);return[e*n-2*Math.PI*6378137/2,t*n-2*Math.PI*6378137/2]}Jo(Hu,"CircleBucket",{omit:["layers"]});class mh{constructor(e,t,i){this.z=e,this.x=t,this.y=i,this.key=yh(0,e,e,t,i)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}isChildOf(e){const t=this.z-e.z;return 0===e.z||e.z<this.z&&e.x===this.x>>t&&e.y===this.y>>t}url(e,t){const i=function(e,t,i){var n=ph(256*e,256*(t=Math.pow(2,i)-t-1),i),r=ph(256*(e+1),256*(t+1),i);return n[0]+","+n[1]+","+r[0]+","+r[1]}(this.x,this.y,this.z),n=function(e,t,i){let n,r="";for(let o=e;o>0;o--)n=1<<o-1,r+=(t&n?1:0)+(i&n?2:0);return r}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===t?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",n).replace("{bbox-epsg-3857}",i)}toString(){return`${this.z}/${this.x}/${this.y}`}}class _h{constructor(e,t){this.wrap=e,this.canonical=t,this.key=yh(e,t.z,t.z,t.x,t.y)}}class gh{constructor(e,t,i,n,r){this.overscaledZ=e,this.wrap=t,this.canonical=new mh(i,+n,+r),this.key=0===t&&e===i?this.canonical.key:yh(t,e,i,n,r)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){const t=this.canonical.z-e;return e>this.canonical.z?new gh(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new gh(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)}calculateScaledKey(e,t=!0){if(this.overscaledZ===e&&t)return this.key;if(e>this.canonical.z)return yh(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y);{const i=this.canonical.z-e;return yh(this.wrap*+t,e,e,this.canonical.x>>i,this.canonical.y>>i)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;const t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ<this.overscaledZ&&e.canonical.z<this.canonical.z&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}children(e){if(this.overscaledZ>=e)return[new gh(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const t=this.canonical.z+1,i=2*this.canonical.x,n=2*this.canonical.y;return[new gh(t,this.wrap,t,i,n),new gh(t,this.wrap,t,i+1,n),new gh(t,this.wrap,t,i,n+1),new gh(t,this.wrap,t,i+1,n+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>
vendor: 5,406 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 gh(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new gh(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 _h(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}}function yh(e,t,i,n,r){const o=1<<Math.min(i,22);let s=o*(r%o)+n%o;return e&&i<22&&(s+=o*o*((e<0?-2*e-1:2*e)%(1<<2*(22-i)))),16*(32*s+i)+(t-i)}const vh=[e=>{let t=e.canonical.x-1,i=e.wrap;return t<0&&(t=(1<<e.canonical.z)-1,i--),new gh(e.overscaledZ,i,e.canonical.z,t,e.canonical.y)},e=>{let t=e.canonical.x+1,i=e.wrap;return t===1<<e.canonical.z&&(t=0,i++),new gh(e.overscaledZ,i,e.canonical.z,t,e.canonical.y)},e=>new gh(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,(0===e.canonical.y?1<<e.canonical.z:e.canonical.y)-1),e=>new gh(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y===(1<<e.canonical.z)-1?0:e.canonical.y+1)];Jo(mh,"CanonicalTileID"),Jo(gh,"OverscaledTileID",{omit:["projMatrix","expandedProjMatrix"]});const xh=rl([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:bh}=xh,wh=rl([{name:"a_pos_3",components:3,type:"Int16"}]);var Th=rl([{name:"a_pos",type:"Int16",components:2}]);function Sh(e){return e*Nc/$c}const Eh=[new Vu([jc,jc,jc],[Gc,Gc,Gc]),new Vu([jc,jc,jc],[0,0,Gc]),new Vu([0,jc,jc],[Gc,0,Gc]),new Vu([jc,0,jc],[0,Gc,Gc]),new Vu([0,0,jc],[Gc,Gc,Gc])];function Ih(e,t,i,n=!0){const r=R([],e._camera.position,e.worldSize),o=[t,i,1,1];Q(o,o,e.pixelMatrixInverse),K(o,o,1/o[3]);const s=B([],W([],o,r)),a=e.globeMatrix,l=[a[12],a[13],a[14]],c=W([],l,r),u=S(c),h=B([],c),d=e.worldSize/(2*Math.PI),f=N(h,s),p=Math.asin(d/u);if(p<Math.acos(f)){if(!n)return null;const e=[],t=[];R(e,s,u/f),B(t,W(t,e,c)),B(s,A(s,c,R(s,t,Math.tan(p)*u)))}const m=[];new Lu(r,s).closestPointOnSphere(l,d,m);const _=B([],et(a,0)),g=B([],et(a,1)),y=B([],et(a,2)),v=N(_,m),x=N(g,m),b=N(y,m),w=Ce(Math.asin(-x/d));let T=Ce(Math.atan2(v,b));T=e.center.lng+function(e,t){const i=(t-e+180)%360-180;return i<-180?i+360:i}(e.center.lng,T);const E=Kc(T),I=ze(Jc(w),0,1);return new lu(E,I)}class Ah{constructor(e,t,i){this.a=W([],e,i),this.b=W([],t,i),this.center=i;const n=B([],this.a),r=B([],this.b);this.angle=Math.acos(N(n,r))}}function Mh(e,t){if(0===e.angle)return null;let i;return i=0===e.a[t]?1/e.angle*.5*Math.PI:1/e.angle*Math.atan(e.b[t]/e.a[t]/Math.sin(e.angle)-1/Math.tan(e.angle)),i<0||i>1?null:function(e,t,i,n){const r=Math.sin(i);return e*(Math.sin((1-n)*i)/r)+t*(Math.sin(n*i)/r)}(e.a[t],e.b[t],e.angle,ze(i,0,1))+e.center[t]}function Ch(e){if(e.z<=1)return Eh[e.z+2*e.y+e.x];const t=zh(Lh(e));return Vu.fromPoints(t)}function Ph(e,t,i){return R(e,e,1-i),L(e,e,t,i)}function Dh(e,t,i){for(const n of e)j(n,n,t),R(n,n,i)}function Rh(e,t,i,n){const r=t/e.worldSize,o=e.globeMatrix;if(i.z<=1){const e=Ch(i).getCorners();return Dh(e,o,r),Vu.fromPoints(e)}const s=Lh(i,n),a=zh(s,Nc+Sh(e._tileCoverLift));Dh(a,o,r);const l=Number.MAX_VALUE,c=[-l,-l,-l],u=[l,l,l];if(s.contains(e.center)){for(const e of a)P(u,u,e),D(c,c,e);c[2]=0;const t=e.point,i=[t.x*r,t.y*r,0];return P(u,u,i),D(c,c,i),new Vu(u,c)}if(e._tileCoverLift>0){for(const e of a)P(u,u,e),D(c,c,e);return new Vu(u,c)}const h=[o[12]*r,o[13]*r,o[14]*r],d=s.getCenter(),f=ze(e.center.lat,-nu,nu),p=ze(d.lat,-nu,nu),m=Kc(e.center.lng),_=Jc(f);let g=m-Kc(d.lng);const y=_-Jc(p);g>.5?g-=1:g<-.5&&(g+=1);let v=0;Math.abs(g)>Math.abs(y)?v=g>=0?1:3:(v=y>=0?0:2,L(h,h,[o[4]*r,o[5]*r,o[6]*r],-Math.sin(Me(y>=0?s.getSouth():s.getNorth()))*Nc));const x=a[v],b=a[(v+1)%4],w=new Ah(x,b,h),T=[Mh(w,0)||x[0],Mh(w,1)||x[1],Mh(w,2)||x[2]],S=Gh(e.zoom);if(S>0){const n=function({x:e,y:t,z:i},n,r,o,s){const a=1/(1<<i);let l=e*a,c=l+a,u=t*a,h=u+a,d=0;const f=(l+c)/2-o;return f>.5?d=-1:f<-.5&&(d=1),l=((l+d)*n-(o*=n))*r+o,c=((c+d)*n-o)*r+o,u=(u*n-(s*=n))*r+s,h=(h*n-s)*r+s,[[l,h,0],[c,h,0],[c,u,0],[l,u,0]]}(i,t,e._pixelsPerMercatorPixel,m,_);for(let e=0;e<a.length;e++)Ph(a[e],n[e],S);const r=A([],n[v],n[(v+1)%4]);R(r,r,.5),Ph(T,r,S)}for(const e of a)P(u,u,e),D(c,c,e);return u[2]=Math.min(x[2],b[2]),P(u,u,T),D(c,c,T),new Vu(u,c)}function Lh({x:e,y:t,z:i},n=!1){const r=1/(1<<i),o=new Zc(eu(e*r),t===(1<<i)-1&&n?-90:tu((t+1)*r)),s=new Zc(eu((e+1)*r),0===t&&n?90:tu(t*r));return new Xc(o,s)}function zh(e,t=Nc){const i=Me(e.getNorth()),n=Me(e.getSouth()),r=Math.cos(i),o=Math.cos(n),s=Math.sin(i),a=Math.sin(n),l=e.getWest(),c=e.getEast();return[qc(o,a,l,t),qc(o,a,c,t),qc(r,s,c,t),qc(r,s,l,t)]}function Oh(e,t,i,n){const r=1<<i.z,o=(e/Vn+i.x)/r;return Hc(tu((t/Vn+i.y)/r),eu(o),n)}function Fh({min:e,max:t}){return 16383/Math.max(t[0]-e[0],t[1]-e[1],t[2]-e[2])}const kh=new Float64Array(16);function Bh(e){const t=Fh(e),i=g(kh,[t,t,t]);return d(i,i,k([],e.min))}function Nh(e){const t=(n=e.min,(i=kh)[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=n[0],i[13]=n[1],i[14]=n[2],i[15]=1,i);var i,n;const r=1/Fh(e);return f(t,t,[r,r,r])}function Vh(e){const t=Vn/(2*Math.PI);return e/(2*Math.PI)/t}function Uh(e,t){return Vn/(512*Math.pow(2,e))*Fh(Ch(t))}function jh(e,t,i,n,r){const o=Vh(i),s=[e,t,-i/(2*Math.PI)],a=c(new Float64Array(16));
vendor: 5,713 bytes, line 2
2return d(a,a,s),f(a,a,[o,o,o]),p(a,a,Me(-r)),m(a,a,Me(-n)),a}function Gh(e){return Oe(5,6,e)}function qh(e,t){const i=Hc(t.lat,t.lng),n=function(e){const t=Hc(e._center.lat,e._center.lng);let i=V([],E(0,1,0),t);const n=y([],-e.angle,t);i=j(i,i,n),y(n,-e._pitch,i);const r=B([],t);return R(r,r,Sh(e.cameraToCenterDistance/e.pixelsPerMeter)),j(r,r,n),A([],t,r)}(e);return s=(r=M([],n,i))[0],a=r[1],l=r[2],c=(o=i)[0],u=o[1],h=o[2],f=(d=Math.sqrt((s*s+a*a+l*l)*(c*c+u*u+h*h)))&&N(r,o)/d,Math.acos(Math.min(Math.max(f,-1),1));var r,o,s,a,l,c,u,h,d,f}function Hh(e,t){return qh(e,t)>Math.PI/2*1.01}const $h=Me(85),Wh=Math.cos($h),Zh=Math.sin($h),Xh=a(),Yh=e=>{const t=[];return"map"===e.paint.get("circle-pitch-alignment")&&t.push("PITCH_WITH_MAP"),"map"===e.paint.get("circle-pitch-scale")&&t.push("SCALE_WITH_MAP"),t};function Kh(e,t,i,n,r,o,s,a,l){if(o&&e.queryGeometry.isAboveHorizon)return!1;o&&(l*=e.pixelToTileUnitsFactor);const c=e.tileID.canonical,u=i.projection.upVectorScale(c,i.center.lat,i.worldSize).metersToTile;for(const h of t)for(const t of h){const h=t.add(a),d=r&&i.elevation?i.elevation.exaggeration()*r.getElevationAt(h.x,h.y,!0):0,f=i.projection.projectTilePoint(h.x,h.y,c);if(d>0){const e=i.projection.upVector(c,h.x,h.y);f.x+=e[0]*u*d,f.y+=e[1]*u*d,f.z+=e[2]*u*d}const p=o?h:Jh(f.x,f.y,f.z,n),m=o?e.tilespaceRays.map(e=>td(e,d)):e.queryGeometry.screenGeometry,_=Q([],[f.x,f.y,f.z,1],n);if(!s&&o?l*=_[3]/i.cameraToCenterDistance:s&&!o&&(l*=i.cameraToCenterDistance/_[3]),o){const e=tu((t.y/Vn+c.y)/(1<<c.z));l/=i.projection.pixelsPerMeter(e,1)/Qc(1,e)}if(Wu(m,p,l))return!0}return!1}function Jh(e,t,i,n){const r=Q([],[e,t,i,1],n);return new Se(r[0]/r[3],r[1]/r[3])}const Qh=E(0,0,0),ed=E(0,0,1);function td(e,t){const i=w();return Qh[2]=t,e.intersectsPlane(Qh,ed,i),new Se(i[0],i[1])}class id extends Hu{}let nd,rd,od,sd;function ad(e,{width:t,height:i},n,r){if(r){if(r instanceof Uint8ClampedArray)r=new Uint8Array(r.buffer);else if(r.length!==t*i*n)throw new RangeError("mismatched image size")}else r=new Uint8Array(t*i*n);return e.width=t,e.height=i,e.data=r,e}function ld(e,t,i){const{width:n,height:r}=t;n===e.width&&r===e.height||(cd(e,t,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,n),height:Math.min(e.height,r)},i,null),e.width=n,e.height=r,e.data=t.data)}function cd(e,t,i,n,r,o,s,a){if(0===r.width||0===r.height)return t;if(r.width>e.width||r.height>e.height||i.x>e.width-r.width||i.y>e.height-r.height)throw new RangeError("out of range source coordinates for image copy");if(r.width>t.width||r.height>t.height||n.x>t.width-r.width||n.y>t.height-r.height)throw new RangeError("out of range destination coordinates for image copy");const l=e.data,c=t.data,u=4===o&&a;for(let a=0;a<r.height;a++){const h=((i.y+a)*e.width+i.x)*o,d=((n.y+a)*t.width+n.x)*o;if(u)for(let e=0;e<r.width;e++){const t=h+e*o+3,i=d+e*o;c[i+0]=255,c[i+1]=255,c[i+2]=255,c[i+3]=l[t]}else if(s)for(let e=0;e<r.width;e++){const t=h+e*o,i=d+e*o,n=new li(l[t+0]/255,l[t+1]/255,l[t+2]/255,l[t+3]).toNonPremultipliedRenderColor(s).toArray();c[i+0]=n[0],c[i+1]=n[1],c[i+2]=n[2],c[i+3]=n[3]}else for(let e=0;e<r.width*o;e++)c[d+e]=l[h+e]}return t}Jo(id,"HeatmapBucket",{omit:["layers"]});class ud{constructor(e,t){ad(this,e,1,t)}resize(e){ld(this,new ud(e),1)}clone(){return new ud({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,i,n,r){cd(e,t,i,n,r,1,null)}}class hd{constructor(e,t){ad(this,e,4,t)}resize(e){ld(this,new hd(e),4)}replace(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new hd({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,i,n,r,o,s){cd(e,t,i,n,r,4,o,s)}}class dd{constructor(e,t){this.width=e.width,this.height=e.height,this.data=t instanceof Uint8Array?new Float32Array(t.buffer):t}}function fd(e){const t={},i=e.resolution||256,n=e.clips?e.clips.length:1,r=e.image||new hd({width:i,height:n}),o=(i,n,o)=>{t[e.evaluationKey]=o;const s=e.expression.evaluate(t),a=s?s.toNonPremultipliedRenderColor(null):null;a&&(r.data[i+n+0]=Math.floor(255*a.r),r.data[i+n+1]=Math.floor(255*a.g),r.data[i+n+2]=Math.floor(255*a.b),r.data[i+n+3]=Math.floor(255*a.a))};if(e.clips)for(let t=0,r=0;t<n;++t,r+=4*i)for(let n=0,s=0;n<i;n++,s+=4){const a=n/(i-1),{start:l,end:c}=e.clips[t];o(r,s,l*(1-a)+c*a)}else for(let e=0,t=0;e<i;e++,t+=4)o(0,t,e/(i-1));return r}Jo(ud,"AlphaImage"),Jo(hd,"RGBAImage");const pd=rl([{name:"a_pos",components:2,type:"Int16"}],4),md=rl([{name:"a_road_z_offset",components:1,type:"Float32"}],4),_d=rl([{name:"a_pos",components:2,type:"Int16"},{name:"a_height",components:1,type:"Float32"}],4),gd=rl([{name:"a_pos_normal_3",components:3,type:"Int16"}],4);function yd(e,t,i=2){const n=t&&t.length,r=n?t[0]*i:e.length;let o=vd(e,0,r,i,!0);const s=[];if(!o||o.next===o.prev)return s;let a,l,c;if(n&&(o=function(e,t,i,n){const r=[];for(let i=0,o=t.length;i<o;i++){const s=vd(e,t[i]*n,i<o-1?t[i+1]*n:e.length,n,!1);s===s.next&&(s.steiner=!0),r.push(Pd(s))}r.sort(Id);for(let e=0;e<r.length;e++)i=Ad(r[e],i);return i}(e,t,o,i)),e.length>80*i){a=e[0],l=e[1];let t=a,n=l;for(let o=i;o<r;o+=i){const i=e[o],r=e[o+1];i<a&&(a=i),r<l&&(l=r),i>t&&(t=i),r>n&&(n=r)}c=Math.max(t-a,n-l),c=0!==c?32767/c:0}return bd(o,s,i,a,l,c,0),s}function vd(e,t,i,n,r){let o;if(r===function(e,t,i,n){let r=0;for(let o=t,s=i-n;o<i;o+=n)r+=(e[s]-e[o])*(e[o+1]+e[s+1]),s=o;return r}(e,t,i,n)>0)for(let r=t;r<i;r+=n)o=Ud(r/n|0,e[r],e[r+1],o);else for(let r=i-n;r>=t;r-=n)o=Ud(r/n|0,e[r],e[r+1],o);return o&&Od(o,o.next)&&(jd(o),o=o.next),o}function xd(e,t){if(!e)return e;t||(t=e);let i,n=e;do{if(i=!1,n.steiner||!Od(n,n.next)&&0!==zd(n.prev,n,n.next))n=n.next;else{if(jd(n),n=t=n.prev,n===n.next)break;
vendor: 2,860 bytes, line 2
2i=!0}}while(i||n!==t);return t}function bd(e,t,i,n,r,o,s){if(!e)return;!s&&o&&function(e,t,i,n){let r=e;do{0===r.z&&(r.z=Cd(r.x,r.y,t,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){let t,i=1;do{let n,r=e;e=null;let o=null;for(t=0;r;){t++;let s=r,a=0;for(let e=0;e<i&&(a++,s=s.nextZ,s);e++);let l=i;for(;a>0||l>0&&s;)0!==a&&(0===l||!s||r.z<=s.z)?(n=r,r=r.nextZ,a--):(n=s,s=s.nextZ,l--),o?o.nextZ=n:e=n,n.prevZ=o,o=n;r=s}o.nextZ=null,i*=2}while(t>1)}(r)}(e,n,r,o);let a=e;for(;e.prev!==e.next;){const l=e.prev,c=e.next;if(o?Td(e,n,r,o):wd(e))t.push(l.i,e.i,c.i),jd(e),e=c.next,a=c.next;else if((e=c)===a){s?1===s?bd(e=Sd(xd(e),t),t,i,n,r,o,2):2===s&&Ed(e,t,i,n,r,o):bd(xd(e),t,i,n,r,o,1);break}}}function wd(e){const t=e.prev,i=e,n=e.next;if(zd(t,i,n)>=0)return!1;const r=t.x,o=i.x,s=n.x,a=t.y,l=i.y,c=n.y,u=Math.min(r,o,s),h=Math.min(a,l,c),d=Math.max(r,o,s),f=Math.max(a,l,c);let p=n.next;for(;p!==t;){if(p.x>=u&&p.x<=d&&p.y>=h&&p.y<=f&&Rd(r,a,o,l,s,c,p.x,p.y)&&zd(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Td(e,t,i,n){const r=e.prev,o=e,s=e.next;if(zd(r,o,s)>=0)return!1;const a=r.x,l=o.x,c=s.x,u=r.y,h=o.y,d=s.y,f=Math.min(a,l,c),p=Math.min(u,h,d),m=Math.max(a,l,c),_=Math.max(u,h,d),g=Cd(f,p,t,i,n),y=Cd(m,_,t,i,n);let v=e.prevZ,x=e.nextZ;for(;v&&v.z>=g&&x&&x.z<=y;){if(v.x>=f&&v.x<=m&&v.y>=p&&v.y<=_&&v!==r&&v!==s&&Rd(a,u,l,h,c,d,v.x,v.y)&&zd(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,x.x>=f&&x.x<=m&&x.y>=p&&x.y<=_&&x!==r&&x!==s&&Rd(a,u,l,h,c,d,x.x,x.y)&&zd(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;v&&v.z>=g;){if(v.x>=f&&v.x<=m&&v.y>=p&&v.y<=_&&v!==r&&v!==s&&Rd(a,u,l,h,c,d,v.x,v.y)&&zd(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;x&&x.z<=y;){if(x.x>=f&&x.x<=m&&x.y>=p&&x.y<=_&&x!==r&&x!==s&&Rd(a,u,l,h,c,d,x.x,x.y)&&zd(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function Sd(e,t){let i=e;do{const n=i.prev,r=i.next.next;!Od(n,r)&&Fd(n,i,i.next,r)&&Nd(n,r)&&Nd(r,n)&&(t.push(n.i,i.i,r.i),jd(i),jd(i.next),i=e=r),i=i.next}while(i!==e);return xd(i)}function Ed(e,t,i,n,r,o){let s=e;do{let e=s.next.next;for(;e!==s.prev;){if(s.i!==e.i&&Ld(s,e)){let a=Vd(s,e);return s=xd(s,s.next),a=xd(a,a.next),bd(s,t,i,n,r,o,0),void bd(a,t,i,n,r,o,0)}e=e.next}s=s.next}while(s!==e)}function Id(e,t){let i=e.x-t.x;return 0===i&&(i=e.y-t.y,0===i)&&(i=(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)),i}function Ad(e,t){const i=function(e,t){let i=t;const n=e.x,r=e.y;let o,s=-1/0;if(Od(e,i))return i;do{if(Od(e,i.next))return i.next;if(r<=i.y&&r>=i.next.y&&i.next.y!==i.y){const e=i.x+(r-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(e<=n&&e>s&&(s=e,o=i.x<i.next.x?i:i.next,e===n))return o}i=i.next}while(i!==t);if(!o)return null;const a=o,l=o.x,c=o.y;let u=1/0;i=o;do{if(n>=i.x&&i.x>=l&&n!==i.x&&Dd(r<c?n:s,r,l,c,r<c?s:n,r,i.x,i.y)){const t=Math.abs(r-i.y)/(n-i.x);Nd(i,e)&&(t<u||t===u&&(i.x>
vendor: 17,609 bytes, line 2
2o.x||i.x===o.x&&Md(o,i)))&&(o=i,u=t)}i=i.next}while(i!==a);return o}(e,t);if(!i)return t;const n=Vd(i,e);return xd(n,n.next),xd(i,i.next)}function Md(e,t){return zd(e.prev,e,t.prev)<0&&zd(t.next,e,e.next)<0}function Cd(e,t,i,n,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Pd(e){let t=e,i=e;do{(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next}while(t!==e);return i}function Dd(e,t,i,n,r,o,s,a){return(r-s)*(t-a)>=(e-s)*(o-a)&&(e-s)*(n-a)>=(i-s)*(t-a)&&(i-s)*(o-a)>=(r-s)*(n-a)}function Rd(e,t,i,n,r,o,s,a){return!(e===s&&t===a)&&Dd(e,t,i,n,r,o,s,a)}function Ld(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&Fd(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(e,t)&&(Nd(e,t)&&Nd(t,e)&&function(e,t){let i=e,n=!1;const r=(e.x+t.x)/2,o=(e.y+t.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&r<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==e);return n}(e,t)&&(zd(e.prev,e,t.prev)||zd(e,t.prev,t))||Od(e,t)&&zd(e.prev,e,e.next)>0&&zd(t.prev,t,t.next)>0)}function zd(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function Od(e,t){return e.x===t.x&&e.y===t.y}function Fd(e,t,i,n){const r=Bd(zd(e,t,i)),o=Bd(zd(e,t,n)),s=Bd(zd(i,n,e)),a=Bd(zd(i,n,t));return r!==o&&s!==a||!(0!==r||!kd(e,i,t))||!(0!==o||!kd(e,n,t))||!(0!==s||!kd(i,e,n))||!(0!==a||!kd(i,t,n))}function kd(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function Bd(e){return e>0?1:e<0?-1:0}function Nd(e,t){return zd(e.prev,e,e.next)<0?zd(e,t,e.next)>=0&&zd(e,e.prev,t)>=0:zd(e,t,e.prev)<0||zd(e,e.next,t)<0}function Vd(e,t){const i=Gd(e.i,e.x,e.y),n=Gd(t.i,t.x,t.y),r=e.next,o=t.prev;return e.next=t,t.prev=e,i.next=r,r.prev=i,n.next=i,i.prev=n,o.next=n,n.prev=o,n}function Ud(e,t,i,n){const r=Gd(e,t,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function jd(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Gd(e,t,i){return{i:e,x:t,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function qd(e,t){const i=e.length;if(i<=1)return[e];const n=[];let r,o;for(let t=0;t<i;t++){const i=Xe(e[t]);0!==i&&(e[t].area=Math.abs(i),void 0===o&&(o=i<0),o===i<0?(r&&n.push(r),r=[e[t]]):r.push(e[t]))}if(r&&n.push(r),t>1)for(let e=0;e<n.length;e++)n[e].length<=t||(ln(n[e],t,1,n[e].length-1,Hd),n[e]=n[e].slice(0,t));return n}function Hd(e,t){return t.area-e.area}function $d(e,t,i=1){if(!e)return null;const n="string"==typeof e?Bi.from(e).getPrimary():e.getPrimary(),r="string"==typeof e?null:e.getSecondary();for(const e of[n,r]){if(!e)continue;const n=e.id.toString();t.has(n)||t.set(n,[]),e.scaleSelf(i),t.get(n).push(e)}return{primary:n.toString(),secondary:r?r.toString():null}}function Wd(e,t,i,n){const r=n.patternDependencies;let o=!1;for(const n of t){const t=n.paint.get(`${e}-pattern`);t.isConstant()||(o=!0),$d(t.constantOr(null),r,i)&&(o=!0)}return o}function Zd(e,t,i,n,r,o){const s=o.patternDependencies;for(const a of t){const t=a.paint.get(`${e}-pattern`).value;if("constant"!==t.kind){let e=t.evaluate({zoom:n},i,{},o.availableImages);e=e&&e.name?e.name:e;const l=$d(e,s,r);if(!l)continue;const{primary:c,secondary:u}=l;c&&(i.patterns[a.id]=[c,u].filter(Boolean))}}return i}class Xd{constructor(){this.polygons=new Map}add(e,...t){const i=this.polygons.get(e);i?i.push(...t):this.polygons.set(e,t)}merge(e){for(const[t,i]of e.polygons)this.add(t,...i)}}class Yd{constructor(){this.portals=[]}static isOnBorder(e,t){return e<=0&&t<=0||e>=Vn&&t>=Vn}static evaluate(e){if(0===e.length)return new Yd;let t=[];for(const i of e)t.push(...i.portals);if(0===t.length)return new Yd;for(const e of t){const t=e.va,i=e.vb;(Yd.isOnBorder(t.x,i.x)||Yd.isOnBorder(t.y,i.y))&&(e.type="border")}const i=t.filter(e=>"unevaluated"!==e.type),n=t.filter(e=>"unevaluated"===e.type);if(0===n.length)return new Yd;n.sort((e,t)=>e.hash===t.hash?e.isTunnel===t.isTunnel?0:e.isTunnel?-1:1:e.hash<t.hash?1:-1),t=i.concat(n);let r=i.length,o=r,s=r;do{if(o++,o===t.length||t[r].hash!==t[o].hash){if(o-r==2){s<r&&(t[s]=t[r],t[r]=null);const e=t[s],i=t[o-1];e.type=e.isTunnel!==i.isTunnel?"tunnel":"polygon",e.connection={a:e.connection.a,b:i.connection.a},s++}r=o}}while(r!==t.length);return t.splice(s),t.sort((e,t)=>e.hash<t.hash?1:-1),{portals:t}}}Jo(Yd,"ElevationPortalGraph"),Jo(Xd,"ElevationPolygons");class Kd{constructor(e,t,i){this.outPositions=e,this.outNormals=t,this.outIndices=i,this.vertexLookup=new Map}addVertex(e,t,i){let n=e[2];null!=i&&(n*=i);const r=`${e[0]},${e[1]},${e[2]},${t[0]},${t[1]},${t[2]}`,o=this.vertexLookup.get(r);if(null!=o)return o;const s=this.outPositions.length;this.vertexLookup.set(r,s);const a=Math.trunc(16384*t[0]),l=Math.trunc(16384*t[1]),c=Math.trunc(16384*t[2]);return this.outPositions.emplaceBack(e[0],e[1],n),this.outNormals.emplaceBack(a,l,c),s}addTriangle(e,t,i){this.outIndices.emplaceBack(e,t,i)}addTriangles(e,t,i){if(0===e.length)return;const n=1===i.length,r=w(),o=w();for(let s=0;s<e.length;s+=3){const a=t[e[s+0]],l=t[e[s+1]],c=t[e[s+2]],u=n?i[0]:i[e[s+1]],h=n?i[0]:i[e[s+2]];I(r,a.x,a.y,n?i[0]:i[e[s+0]]);const d=this.addVertex(r,o);I(r,l.x,l.y,u);const f=this.addVertex(r,o);I(r,c.x,c.y,h);const p=this.addVertex(r,o);this.outIndices.emplaceBack(d,f,p)}}addQuad(e,t,i,n,r,o){const s=this.addVertex(e,r,o),a=this.addVertex(t,r,o),l=this.addVertex(i,r,o),c=this.addVertex(n,r,o);this.addTriangle(s,a,l),this.addTriangle(l,c,s)}getVertexCount(){return this.outPositions.length}clearVertexLookup(){this.vertexLookup.clear()}}class Jd{constructor(e,t,i,n){this.unevaluatedPortals=new Yd,this.portalPolygons=new Xd,this.bridgeFeatureSections=[],this.tunnelFeatureSections=[],this.vertexHashLookup=new Map,this.unevalVertices=[],this.unevalHeights=[],this.unevalTriangles=[],this.unevalTunnelTriangles=[],this.unevalEdges=[],this.vertexPositions=new ul,this.vertexNormals=new hl,this.indexArray=new Al,this.tileToMeters=au(e),this.bridgeProgramConfigurations=new Lc(t,{zoom:i,lut:n},e=>"fill-tunnel-structure-color"!==e),this.tunnelProgramConfigurations=new Lc(t,{zoom:i,lut:n},e=>"fill-bridge-guard-rail-color"!==e)}addVertices(e,t){const i=this.unevalVertices.length;for(let i=0;i<e.length;i++)this.unevalVertices.push(e[i]),this.unevalHeights.push(t[i]);return i}addTriangles(e,t,i){const n=i?this.unevalTunnelTriangles:this.unevalTriangles;for(const i of e)n.push(i+t)}addRenderableRing(e,t,i,n,r,o){const s=[new Se(r.min.x,r.min.y),new Se(r.max.x,r.min.y),new Se(r.max.x,r.max.y),new Se(r.min.x,r.max.y)];for(let a=0;a<i-1;a++){const i=t+a,l=i+1,c=this.unevalVertices[i],u=this.unevalVertices[l];if(!(c.x>=r.min.x&&c.x<=r.max.x&&c.y>=r.min.y&&c.y<=r.max.y||u.x>=r.min.x&&u.x<=r.max.x&&u.y>=r.min.y&&u.y<=r.max.y||oh(c,u,s)))continue;if(this.isOnBorder(c.x,u.x)||this.isOnBorder(c.y,u.y))continue;const h=Jd.computeEdgeHash(this.unevalVertices[i],this.unevalVertices[l]);let d,f=this.vertexHashLookup.get(Jd.computePosHash(c));null!=f?d=f.next:(f=this.vertexHashLookup.get(Jd.computePosHash(u)),d=null!=f?f.prev:h),this.unevalEdges.push({polygonIdx:e,a:i,b:l,hash:h,portalHash:d,isTunnel:n,type:"unevaluated",featureInfo:o})}}addPortalCandidates(e,t,i,n,r){if(0===t.length)return;this.portalPolygons.add(e,{geometry:t,zLevel:r});const o=t[0];this.vertexHashLookup.clear();let s=Jd.computeEdgeHash(o[o.length-2],o[o.length-1]);for(let t=0;t<o.length-1;t++){const r=o[t+0],a=o[t+1],l=ue(a.x-r.x,a.y-r.y),c=me(l);if(0===c)continue;let u="unevaluated";const h=n.pointElevation(r),d=n.pointElevation(a);Math.abs(h)<.01&&Math.abs(d)<.01?u="entrance":(this.isOnBorder(r.x,a.x)||this.isOnBorder(r.y,a.y))&&(u="border");const f=Jd.computeEdgeHash(r,a);this.unevaluatedPortals.portals.push({connection:{a:e,b:void 0},va:r,vb:a,vab:l,length:c,hash:f,isTunnel:i,type:u});const p=Jd.computePosHash(r);this.vertexHashLookup.set(p,{prev:s,next:f}),s=f}}construct(e){if(0===this.unevalVertices.length)return;const t=()=>({vertexOffset:0,primitiveOffset:this.indexArray.length}),i=e=>{e.primitiveLength=this.indexArray.length-e.primitiveOffset},n=new Kd(this.vertexPositions,this.vertexNormals,this.indexArray);this.prepareEdges(e.portals,this.unevalEdges);const r=t(),o=t(),s=t(),a=(e,t)=>{e.sort((e,i)=>e.type===t&&i.type!==t?-1:e.type!==t&&i.type===t?1:0);const i=e.findIndex(e=>e.type!==t);return i>=0?i:e.length};let l=0;this.unevalEdges.length>0&&(l=a(this.unevalEdges,"none"),this.constructBridgeStructures(n,this.unevalVertices,this.unevalHeights,this.unevalEdges,{min:0,max:l},this.tileToMeters)),i(s);const c=t(),u=t();if(this.unevalEdges.length>0){const e=this.unevalEdges.splice(l),t=a(e,"tunnel")+l;this.unevalEdges.push(...e),this.constructTunnelStructures(n,this.unevalVertices,this.unevalHeights,this.unevalEdges,{min:0,max:l},{min:l,max:t})}i(c),n.addTriangles(this.unevalTriangles,this.unevalVertices,this.unevalHeights),i(u),n.addTriangles(this.unevalTunnelTriangles,this.unevalVertices,this.unevalHeights),i(o),n.addTriangles(this.unevalTunnelTriangles,this.unevalVertices,[-.1]),i(r),this.maskSegments=rc.simpleSegment(0,u.primitiveOffset,0,u.primitiveLength),this.depthSegments=rc.simpleSegment(0,o.primitiveOffset,0,o.primitiveLength),this.renderableBridgeSegments=rc.simpleSegment(0,s.primitiveOffset,0,s.primitiveLength),this.renderableTunnelSegments=rc.simpleSegment(0,c.primitiveOffset,0,c.primitiveLength),this.shadowCasterSegments=rc.simpleSegment(0,r.primitiveOffset,0,r.primitiveLength)}update(e,t,i,n,r,o,s,a){this.bridgeProgramConfigurations.updatePaintArrays(e,t,r,i,n,o,s,a),this.tunnelProgramConfigurations.updatePaintArrays(e,t,r,i,n,o,s,a)}upload(e){this.vertexBuffer||0===this.vertexPositions.length||0===this.vertexNormals.length||0===this.indexArray.length||(this.vertexBuffer=e.createVertexBuffer(this.vertexPositions,_d.members),this.vertexBufferNormal=e.createVertexBuffer(this.vertexNormals,gd.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.bridgeProgramConfigurations.upload(e),this.tunnelProgramConfigurations.upload(e))}destroy(){this.vertexBuffer&&(this.vertexBuffer.destroy(),this.vertexBufferNormal.destroy(),this.indexBuffer.destroy()),this.maskSegments&&(this.maskSegments.destroy(),this.depthSegments.destroy(),this.renderableBridgeSegments.destroy(),this.renderableTunnelSegments.destroy(),this.shadowCasterSegments.destroy()),this.bridgeProgramConfigurations.destroy(),this.tunnelProgramConfigurations.destroy()}populatePaintArrays(e,t,i,n,r){const o=(o,s)=>{for(let a=0;a<s.length-1;a++){const l=s[a].featureIndex,c=s[a+1].vertexStart,u=e.feature(l);o.populatePaintArrays(c,u,l,{},i,t,n,void 0,r)}};o(this.bridgeProgramConfigurations,this.bridgeFeatureSections),o(this.tunnelProgramConfigurations,this.tunnelFeatureSections)}computeVertexConnections(e,t,i,n,r){const o=new Map;for(let s=n;s<r;s++){const n=i[s],r=n.a,a=n.b,l=Jd.computePosHash(e[r]),c=Jd.computePosHash(e[a]);let u=o.get(l);u||(u={},o.set(l,u));let h=o.get(c);h||(h={},o.set(c,h)),t[r]<=0&&t[a]<=0||(u.to=a,h.from=r)}return o}isTerminalVertex(e,t){const i=Jd.computePosHash(this.unevalVertices[e]),n=t.get(i);return!n||!n.from||!n.to}constructBridgeStructures(e,t,i,n,r,o){e.clearVertexLookup();const s=this.computeVertexConnections(t,i,n,r.min,r.max),a=1/o,l=.5*a,c=(e,n)=>I(e,t[n].x,t[n].y,i[n]*a),u=w(),h=w(),d=w(),f=w(),p=w(),m=(e,i)=>{const n=s.get(Jd.computePosHash(t[i])),r=n.from,o=n.to;if(!r||!o)return;c(u,r),c(h,i),c(d,o),H(f),$(u,h)||(W(p,h,u),B(f,p)),$(d,h)||(W(p,d,h),A(f,f,B(p,p)));const a=X(f);return a>0?R(e,f,1/a):void 0};let _=Number.POSITIVE_INFINITY;this.sortSubarray(n,r.min,r.max,(e,t)=>e.featureInfo.featureIndex-t.featureInfo.featureIndex);const g=w(),y=w(),v=w(),x=w(),b=w(),T=w(),S=w(),E=w(),M=w(),C=[w(),w(),w(),w()],P=[w(),w(),w(),w()],D=[{coord:new Se(0,0),height:0},{coord:new Se(0,0),height:0}],L=(e,t)=>e>t;for(let c=r.min;c<r.max;c++){const r=n[c];if(!r.featureInfo.guardRailEnabled)continue;if(!this.prepareEdgePoints(D,t,i,r,L))continue;const[u,h]=D;if(I(g,u.coord.x,u.coord.y,a*u.height),I(y,h.coord.x,h.coord.y,a*h.height),$(g,y))continue;W(v,y,g),B(v,v);const d=m(E,r.a)||v,f=m(M,r.b)||v;I(x,d[1],-d[0],0),B(x,x),I(b,f[1],-f[0],0),B(b,b),V(E,x,d),B(T,E),V(E,b,f),B(S,E),A(C[0],g,R(E,W(E,x,T),l)),A(C[1],g,R(E,A(E,x,T),l)),A(C[2],g,R(E,T,l)),C[3]=g,A(P[0],y,R(E,W(E,b,S),l)),A(P[1],y,R(E,A(E,b,S),l)),A(P[2],y,R(E,S,l)),P[3]=y,_=this.addFeatureSection(r.featureInfo.featureIndex,_,this.bridgeFeatureSections,e);const p=e.addVertex(C[0],x,o),w=e.addVertex(C[1],x,o),z=e.addVertex(P[0],b,o),O=e.addVertex(P[1],b,o);e.addTriangle(p,w,z),e.addTriangle(w,O,z);const F=e.addVertex(C[1],T,o),N=e.addVertex(C[2],T,o),U=e.addVertex(P[1],S,o),j=e.addVertex(P[2],S,o);e.addTriangle(F,N,U),e.addTriangle(N,j,U),k(x,x),k(b,b);const G=e.addVertex(C[2],x,o),q=e.addVertex(C[3],x,o),H=e.addVertex(P[2],b,o),Z=e.addVertex(P[3],b,o);e.addTriangle(G,q,H),e.addTriangle(q,Z,H);const X=this.isTerminalVertex(r.a,s),Y=this.isTerminalVertex(r.b,s);u.height<.01&&X&&e.addQuad(C[3],C[2],C[1],C[0],k(d,d),o),h.height<.01&&Y&&e.addQuad(P[0],P[1],P[2],P[3],f,o)}this.bridgeFeatureSections.push({featureIndex:Number.POSITIVE_INFINITY,vertexStart:e.getVertexCount()})}constructTunnelStructures(e,t,i,n,r,o){e.clearVertexLookup();let s=Number.POSITIVE_INFINITY;const a=(e,t)=>e.featureInfo.featureIndex-t.featureInfo.featureIndex;this.sortSubarray(n,r.min,r.max,a),this.sortSubarray(n,o.min,o.max,a);const l=e=>B(e,e),c=[{coord:new Se(0,0),height:0},{coord:new Se(0,0),height:0}],u=(e,t)=>e<t,h=w(),d=w(),f=w(),p=w(),m=w();for(let o=r.min;o<r.max;o++){if(!this.prepareEdgePoints(c,t,i,n[o],u))continue;const[r,a]=c,_=l(I(m,-(a.coord.y-r.coord.y),a.coord.x-r.coord.x,0));s=this.addFeatureSection(n[o].featureInfo.featureIndex,s,this.tunnelFeatureSections,e),e.addQuad(I(h,r.coord.x,r.coord.y,r.height),I(d,a.coord.x,a.coord.y,a.height),I(f,a.coord.x,a.coord.y,n[o].isTunnel?-.1:0),I(p,r.coord.x,r.coord.y,n[o].isTunnel?-.1:0),_)}for(let r=o.min;r<o.max;r++){const o=n[r];o.isTunnel&&([o.a,o.b]=[o.b,o.a]);const a=t[o.a],c=t[o.b],u=l(I(m,-(c.y-a.y),c.x-a.x,0));s=this.addFeatureSection(o.featureInfo.featureIndex,s,this.tunnelFeatureSections,e),e.addQuad(I(h,c.x,c.y,0),I(d,a.x,a.y,0),I(f,a.x,a.y,i[o.a]+4),I(p,c.x,c.y,i[o.b]+4),u),e.addQuad(I(h,a.x,a.y,0),I(d,c.x,c.y,0),I(f,c.x,c.y,i[o.b]+4),I(p,a.x,a.y,i[o.a]+4),u)}this.tunnelFeatureSections.push({featureIndex:Number.POSITIVE_INFINITY,vertexStart:e.getVertexCount()})}setElevatedPoint(e,t,i,n){e.coord.x=t,e.coord.y=i,e.height=n}prepareEdgePoints(e,t,i,n,r){let o=t[n.a].x,s=t[n.a].y,a=t[n.b].x,l=t[n.b].y,c=i[n.a],u=i[n.b];const h=r(c,0),d=r(u,0);if(h&&d)return this.setElevatedPoint(e[0],o,s,c),this.setElevatedPoint(e[1],a,l,u),!0;if(!h&&!d)return!1;if(h){if(!d){const e=u/(u-c);a=di(a,o,e),l=di(l,s,e),u=di(u,c,e)}}else{const e=c/(c-u);o=di(o,a,e),s=di(s,l,e),c=di(c,u,e)}return this.setElevatedPoint(e[0],o,s,c),this.setElevatedPoint(e[1],a,l,u),!0}prepareEdges(e,t){if(0===t.length)return;t.sort((e,t)=>e.hash===t.hash?t.polygonIdx-e.polygonIdx:t.hash>e.hash?1:-1);let i=0,n=0,r=0,o=t[i].polygonIdx;do{n++,(n===t.length||t[i].hash!==t[n].hash)&&((1==n-i||t[n-1].polygonIdx!==o)&&(r<i&&(t[r]=t[i],t[i]=null),t[r].type="none",r++),i=n,i!==t.length&&(o=t[i].polygonIdx))}while(i!==t.length);if(t.splice(r),0!==t.length&&0!==e.length){t.sort((e,t)=>e.portalHash<t.portalHash?1:-1);let i=0,n=0;for(;i!==t.length&&n!==e.length;){const r=t[i],o=e[n];r.portalHash>o.hash?i++:o.hash>r.portalHash?n++:(r.type=o.type,i++)}}}isOnBorder(e,t){return e<=0&&t<=0||e>=Vn&&t>=Vn}addFeatureSection(e,t,i,n){return e!==t&&(t=e,i.push({featureIndex:e,vertexStart:n.getVertexCount()}),n.clearVertexLookup()),t}sortSubarray(e,t,i,n){const r=e.slice(t,i);r.sort(n),e.splice(t,r.length,...r)}static computeEdgeHash(e,t){return(e.y===t.y&&e.x>t.x||e.y>t.y)&&([e,t]=[t,e]),BigInt(Jd.computePosHash(e))<<32n|BigInt(Jd.computePosHash(t))}static computePosHash(e){return((65535&e.x)<<16|65535&e.y)>>>0}}var Qd,ef={exports:{}},tf=(Qd||(Qd=1,function(e){function t(e,t){return e>t?1:e<t?-1:0}var i=function(e,i){void 0===e&&(e=t),void 0===i&&(i=!1),this._compare=e,this._root=null,this._size=0,this._noDuplicates=!!i},n={size:{configurable:!0}};function r(e,t,i,n,o){var s=o-n;if(s>0){var a=n+Math.floor(s/2),l={key:t[a],data:i[a],parent:e};return l.left=r(l,t,i,n,a),l.right=r(l,t,i,a+1,o),l}return null}function o(e,t,i,n,r){if(!(i>=n)){for(var s=e[i+n>>1],a=i-1,l=n+1;;){do{a++}while(r(e[a],s)<0);do{l--}while(r(e[l],s)>0);if(a>=l)break;var c=e[a];e[a]=e[l],e[l]=c,c=t[a],t[a]=t[l],t[l]=c}o(e,t,i,l,r),o(e,t,l+1,n,r)}}i.prototype.rotateLeft=function(e){var t=e.right;t&&(e.right=t.left,t.left&&(t.left.parent=e),t.parent=e.parent),e.parent?e===e.parent.left?e.parent.left=t:e.parent.right=t:this._root=t,t&&(t.left=e),e.parent=t},i.prototype.rotateRight=function(e){var t=e.left;t&&(e.left=t.right,t.right&&(t.right.parent=e),t.parent=e.parent),e.parent?e===e.parent.left?e.parent.left=t:e.parent.right=t:this._root=t,t&&(t.right=e),e.parent=t},i.prototype._splay=function(e){for(;e.parent;){var t=e.parent;t.parent?t.left===e&&t.parent.left===t?(this.rotateRight(t.parent),this.rotateRight(t)):t.right===e&&t.parent.right===t?(this.rotateLeft(t.parent),this.rotateLeft(t)):t.left===e&&t.parent.right===t?(this.rotateRight(t),this.rotateLeft(t)):(this.rotateLeft(t),this.rotateRight(t)):t.left===e?this.rotateRight(t):this.rotateLeft(t)}},i.prototype.splay=function(e){for(var t,i,n,r,o;e.parent;
2)(i=(t=e.parent).parent)&&i.parent?((n=i.parent).left===i?n.left=e:n.right=e,e.parent=n):(e.parent=null,this._root=e),r=e.left,o=e.right,e===t.left?(i&&(i.left===t?(t.right?(i.left=t.right,i.left.parent=i):i.left=null,t.right=i,i.parent=t):(r?(i.right=r,r.parent=i):i.right=null,e.left=i,i.parent=e)),o?(t.left=o,o.parent=t):t.left=null,e.right=t,t.parent=e):(i&&(i.right===t?(t.left?(i.right=t.left,i.right.parent=i):i.right=null,t.left=i,i.parent=t):(o?(i.left=o,o.parent=i):i.left=null,e.right=i,i.parent=e)),r?(t.right=r,r.parent=t):t.right=null,e.left=t,t.parent=e)},i.prototype.replace=function(e,t){e.parent?e===e.parent.left?e.parent.left=t:e.parent.right=t:this._root=t,t&&(t.parent=e.parent)},i.prototype.minNode=function(e){if(void 0===e&&(e=this._root),e)for(;e.left;)e=e.left;return e},i.prototype.maxNode=function(e){if(void 0===e&&(e=this._root),e)for(;e.right;)e=e.right;return e},i.prototype.insert=function(e,t){var i=this._root,n=null,r=this._compare;if(this._noDuplicates)for(;i;){if(n=i,0===r(i.key,e))return;i=r(i.key,e)<0?i.right:i.left}else for(;i;)n=i,i=r(i.key,e)<0?i.right:i.left;return i={key:e,data:t,left:null,right:null,parent:n},n?r(n.key,i.key)<0?n.right=i:n.left=i:this._root=i,this.splay(i),this._size++,i},i.prototype.find=function(e){for(var t=this._root,i=this._compare;t;){var n=i(t.key,e);if(n<0)t=t.right;else{if(!(n>0))return t;t=t.left}}return null},i.prototype.contains=function(e){for(var t=this._root,i=this._compare;t;){var n=i(e,t.key);if(0===n)return!0;t=n<0?t.left:t.right}return!1},i.prototype.remove=function(e){var t=this.find(e);if(!t)return!1;if(this.splay(t),t.left)if(t.right){var i=this.minNode(t.right);i.parent!==t&&(this.replace(i,i.right),i.right=t.right,i.right.parent=i),this.replace(t,i),i.left=t.left,i.left.parent=i}else this.replace(t,t.left);else this.replace(t,t.right);return this._size--,!0},i.prototype.removeNode=function(e){if(!e)return!1;if(this.splay(e),e.left)if(e.right){var t=this.minNode(e.right);t.parent!==e&&(this.replace(t,t.right),t.right=e.right,t.right.parent=t),this.replace(e,t),t.left=e.left,t.left.parent=t}else this.replace(e,e.left);else this.replace(e,e.right);return this._size--,!0},i.prototype.erase=function(e){var t=this.find(e);if(t){this.splay(t);var i=t.left,n=t.right,r=null;i&&(i.parent=null,r=this.maxNode(i),this.splay(r),this._root=r),n&&(i?r.right=n:this._root=n,n.parent=r),this._size--}},i.prototype.pop=function(){var e=this._root,t=null;if(e){for(;e.left;)e=e.left;t={key:e.key,data:e.data},this.remove(e.key)}return t},i.prototype.next=function(e){var t=e;if(t)if(t.right)for(t=t.right;t&&t.left;)t=t.left;else for(t=e.parent;t&&t.right===e;)e=t,t=t.parent;return t},i.prototype.prev=function(e){var t=e;if(t)if(t.left)for(t=t.left;t&&t.right;)t=t.right;else for(t=e.parent;t&&t.left===e;)e=t,t=t.parent;return t},i.prototype.forEach=function(e){for(var t=this._root,i=[],n=!1,r=0;!n;)t?(i.push(t),t=t.left):i.length>0?(e(t=i.pop(),r++),t=t.right):n=!0;return this},i.prototype.range=function(e,t,i,n){for(var r=[],o=this._compare,s=this._root;0!==r.length||s;)if(s)r.push(s),s=s.left;else{if(o((s=r.pop()).key,t)>0)break;if(o(s.key,e)>=0&&i.call(n,s))return this;s=s.right}return this},i.prototype.keys=function(){for(var e=this._root,t=[],i=[],n=!1;!n;)e?(t.push(e),e=e.left):t.length>0?(e=t.pop(),i.push(e.key),e=e.right):n=!0;return i},i.prototype.values=function(){for(var e=this._root,t=[],i=[],n=!1;!n;)e?(t.push(e),e=e.left):t.length>0?(e=t.pop(),i.push(e.data),e=e.right):n=!0;return i},i.prototype.at=function(e){for(var t=this._root,i=[],n=!1,r=0;!n;)if(t)i.push(t),t=t.left;else if(i.length>0){if(t=i.pop(),r===e)return t;r++,t=t.right}else n=!0;return null},i.prototype.load=function(e,t,i){if(void 0===e&&(e=[]),void 0===t&&(t=[]),void 0===i&&(i=!1),0!==this._size)throw new Error("bulk-load: tree is not empty");var n=e.length;return i&&o(e,t,0,n-1,this._compare),this._root=r(null,e,t,0,n),this._size=n,this},i.prototype.min=function(){var e=this.minNode(this._root);return e?e.key:null},i.prototype.max=function(){var e=this.maxNode(this._root);return e?e.key:null},i.prototype.isEmpty=function(){return null===this._root},n.size.get=function(){return this._size},i.createTree=function(e,t,n,r,o){return new i(n,o).load(e,t,r)},Object.defineProperties(i.prototype,n);function s(e,t,i){null===t?(e.inOut=!1,e.otherInOut=!0):(e.isSubject===t.isSubject?(e.inOut=!t.inOut,e.otherInOut=t.otherInOut):(e.inOut=!t.otherInOut,e.otherInOut=t.isVertical()?!t.inOut:t.inOut),t&&(e.prevInResult=!a(t,i)||t.isVertical()?t.prevInResult:t));var n=a(e,i);e.resultTransition=n?function(e,t){var i,n=!e.inOut,r=!e.otherInOut;switch(t){case 0:i=n&&r;break;case 1:i=n||r;break;case 3:i=n^r;break;case 2:i=e.isSubject?n&&!r:r&&!n}return i?1:-1}(e,i):0}function a(e,t){switch(e.type){case 0:switch(t){case 0:return!e.otherInOut;case 1:return e.otherInOut;case 2:return e.isSubject&&e.otherInOut||!e.isSubject&&!e.otherInOut;case 3:return!0}break;case 2:return 0===t||1===t;case 3:return 2===t;case 1:return!1}return!1}var l=function(e,t,i,n,r){this.left=t,this.point=e,this.otherEvent=i,this.isSubject=n,this.type=r||0,this.inOut=!1,this.otherInOut=!1,this.prevInResult=null,this.resultTransition=0,this.otherPos=-1,this.outputContourId=-1,this.isExteriorRing=!0},c={inResult:{configurable:!0}};function u(e,t){return e[0]===t[0]&&e[1]===t[1]}l.prototype.isBelow=function(e){var t=this.point,i=this.otherEvent.point;
2return this.left?(t[0]-e[0])*(i[1]-e[1])-(i[0]-e[0])*(t[1]-e[1])>0:(i[0]-e[0])*(t[1]-e[1])-(t[0]-e[0])*(i[1]-e[1])>0},l.prototype.isAbove=function(e){return!this.isBelow(e)},l.prototype.isVertical=function(){return this.point[0]===this.otherEvent.point[0]},c.inResult.get=function(){return 0!==this.resultTransition},l.prototype.clone=function(){var e=new l(this.point,this.left,this.otherEvent,this.isSubject,this.type);return e.contourId=this.contourId,e.resultTransition=this.resultTransition,e.prevInResult=this.prevInResult,e.isExteriorRing=this.isExteriorRing,e.inOut=this.inOut,e.otherInOut=this.otherInOut,e},Object.defineProperties(l.prototype,c);var h=11102230246251565e-32,d=134217729,f=(3+8*h)*h;function p(e,t,i,n,r){var o,s,a,l,c=t[0],u=n[0],h=0,d=0;u>c==u>-c?(o=c,c=t[++h]):(o=u,u=n[++d]);var f=0;if(h<e&&d<i)for(u>c==u>-c?(a=o-((s=c+o)-c),c=t[++h]):(a=o-((s=u+o)-u),u=n[++d]),o=s,0!==a&&(r[f++]=a);h<e&&d<i;)u>c==u>-c?(a=o-((s=o+c)-(l=s-o))+(c-l),c=t[++h]):(a=o-((s=o+u)-(l=s-o))+(u-l),u=n[++d]),o=s,0!==a&&(r[f++]=a);for(;h<e;)a=o-((s=o+c)-(l=s-o))+(c-l),c=t[++h],o=s,0!==a&&(r[f++]=a);for(;d<i;)a=o-((s=o+u)-(l=s-o))+(u-l),u=n[++d],o=s,0!==a&&(r[f++]=a);return 0===o&&0!==f||(r[f++]=o),f}function m(e){return new Float64Array(e)}var _=m(4),g=m(8),y=m(12),v=m(16),x=m(4);function b(e,t,i){var n=function(e,t,i,n,r,o){var s=(t-o)*(i-r),a=(e-r)*(n-o),l=s-a;if(0===s||0===a||s>0!=a>0)return l;var c=Math.abs(s+a);return Math.abs(l)>=33306690738754716e-32*c?l:-function(e,t,i,n,r,o,s){var a,l,c,u,h,m,b,w,T,S,E,I,A,M,C,P,D,R,L=e-r,z=i-r,O=t-o,F=n-o;_[0]=(C=(w=L-(b=(m=d*L)-(m-L)))*(S=F-(T=(m=d*F)-(m-F)))-((M=L*F)-b*T-w*T-b*S))-((E=C-(D=(w=O-(b=(m=d*O)-(m-O)))*(S=z-(T=(m=d*z)-(m-z)))-((P=O*z)-b*T-w*T-b*S)))+(h=C-E))+(h-D),_[1]=(A=M-((I=M+E)-(h=I-M))+(E-h))-((E=A-P)+(h=A-E))+(h-P),_[2]=I-((R=I+E)-(h=R-I))+(E-h),_[3]=R;var k=function(e,t){for(var i=t[0],n=1;n<4;n++)i+=t[n];return i}(0,_),B=22204460492503146e-32*s;if(k>=B||-k>=B)return k;if(a=e-(L+(h=e-L))+(h-r),c=i-(z+(h=i-z))+(h-r),l=t-(O+(h=t-O))+(h-o),u=n-(F+(h=n-F))+(h-o),0===a&&0===l&&0===c&&0===u)return k;if(B=11093356479670487e-47*s+f*Math.abs(k),(k+=L*u+F*a-(O*c+z*l))>=B||-k>=B)return k;x[0]=(C=(w=a-(b=(m=d*a)-(m-a)))*(S=F-(T=(m=d*F)-(m-F)))-((M=a*F)-b*T-w*T-b*S))-((E=C-(D=(w=l-(b=(m=d*l)-(m-l)))*(S=z-(T=(m=d*z)-(m-z)))-((P=l*z)-b*T-w*T-b*S)))+(h=C-E))+(h-D),x[1]=(A=M-((I=M+E)-(h=I-M))+(E-h))-((E=A-P)+(h=A-E))+(h-P),x[2]=I-((R=I+E)-(h=R-I))+(E-h),x[3]=R;var N=p(4,_,4,x,g);x[0]=(C=(w=L-(b=(m=d*L)-(m-L)))*(S=u-(T=(m=d*u)-(m-u)))-((M=L*u)-b*T-w*T-b*S))-((E=C-(D=(w=O-(b=(m=d*O)-(m-O)))*(S=c-(T=(m=d*c)-(m-c)))-((P=O*c)-b*T-w*T-b*S)))+(h=C-E))+(h-D),x[1]=(A=M-((I=M+E)-(h=I-M))+(E-h))-((E=A-P)+(h=A-E))+(h-P),x[2]=I-((R=I+E)-(h=R-I))+(E-h),x[3]=R;var V=p(N,g,4,x,y);x[0]=(C=(w=a-(b=(m=d*a)-(m-a)))*(S=u-(T=(m=d*u)-(m-u)))-((M=a*u)-b*T-w*T-b*S))-((E=C-(D=(w=l-(b=(m=d*l)-(m-l)))*(S=c-(T=(m=d*c)-(m-c)))-((P=l*c)-b*T-w*T-b*S)))+(h=C-E))+(h-D),x[1]=(A=M-((I=M+E)-(h=I-M))+(E-h))-((E=A-P)+(h=A-E))+(h-P),x[2]=I-((R=I+E)-(h=R-I))+(E-h),x[3]=R;var U=p(V,y,4,x,v);return v[U-1]}(e,t,i,n,r,o,c)}(e[0],e[1],t[0],t[1],i[0],i[1]);return n>0?-1:n<0?1:0}function w(e,t){var i=e.point,n=t.point;return i[0]>n[0]?1:i[0]<n[0]?-1:i[1]!==n[1]?i[1]>n[1]?1:-1:function(e,t,i){return e.left!==t.left?e.left?1:-1:0!==b(i,e.otherEvent.point,t.otherEvent.point)?e.isBelow(t.otherEvent.point)?-1:1:!e.isSubject&&t.isSubject?1:-1}(e,t,i)}function T(e,t,i){var n=new l(t,!1,e,e.isSubject),r=new l(t,!0,e.otherEvent,e.isSubject);return u(e.point,e.otherEvent.point)&&console.warn("what is that, a collapsed segment?",e),n.contourId=r.contourId=e.contourId,w(r,e.otherEvent)>0&&(e.otherEvent.left=!0,r.left=!1),e.otherEvent.otherEvent=r,e.otherEvent=n,i.push(r),i.push(n),i}function S(e,t){return e[0]*t[1]-e[1]*t[0]}function E(e,t){return e[0]*t[0]+e[1]*t[1]}function I(e,t,i){var n=function(e,t,i,n){var r=[t[0]-e[0],t[1]-e[1]],o=[n[0]-i[0],n[1]-i[1]];function s(e,t,i){return[e[0]+t*i[0],e[1]+t*i[1]]}var a=[i[0]-e[0],i[1]-e[1]],l=S(r,o),c=l*l,u=E(r,r);if(c>0){var h=S(a,o)/l;if(h<0||h>1)return null;var d=S(a,r)/l;return d<0||d>1?null:0===h||1===h?[s(e,h,r)]:0===d||1===d?[s(i,d,o)]:[s(e,h,r)]}if((c=(l=S(a,r))*l)>0)return null;var f=E(r,a)/u,p=f+E(r,o)/u,m=Math.min(f,p),_=Math.max(f,p);return m<=1&&_>=0?1===m?[s(e,m>0?m:0,r)]:0===_?[s(e,_<1?_:1,r)]:[s(e,m>0?m:0,r),s(e,_<1?_:1,r)]:null}(e.point,e.otherEvent.point,t.point,t.otherEvent.point),r=n?n.length:0;if(0===r)return 0;if(1===r&&(u(e.point,t.point)||u(e.otherEvent.point,t.otherEvent.point)))return 0;if(2===r&&e.isSubject===t.isSubject)return 0;if(1===r)return u(e.point,n[0])||u(e.otherEvent.point,n[0])||T(e,n[0],i),u(t.point,n[0])||u(t.otherEvent.point,n[0])||T(t,n[0],i),1;var o=[],s=!1,a=!1;return u(e.point,t.point)?s=!0:1===w(e,t)?o.push(t,e):o.push(e,t),u(e.otherEvent.point,t.otherEvent.point)?a=!0:1===w(e.otherEvent,t.otherEvent)?o.push(t.otherEvent,e.otherEvent):o.push(e.otherEvent,t.otherEvent),s&&a||s?(t.type=1,e.type=t.inOut===e.inOut?2:3,s&&!a&&T(o[1].otherEvent,o[0].point,i),2):a?(T(o[0],o[1].point,i),3):o[0]!==o[3].otherEvent?(T(o[0],o[1].point,i),T(o[1],o[2].point,i),3):(T(o[0],o[1].point,i),T(o[3].otherEvent,o[2].point,i),3)}function A(e,t){if(e===t)return 0;if(0!==b(e.point,e.otherEvent.point,t.point)||0!==b(e.point,e.otherEvent.point,t.otherEvent.point))return u(e.point,t.point)?e.isBelow(t.otherEvent.point)?-1:1:e.point[0]===t.point[0]?e.point[1]<t.point[1]?-1:1:1===w(e,t)?t.isAbove(e.point)?-1:1:e.isBelow(t.point)?-1:1;if(e.isSubject!==t.isSubject)return e.isSubject?-1:1;var i=e.point,n=t.point;return i[0]===n[0]&&i[1]===n[1]?(i=e.otherEvent.point)[0]===(n=t.otherEvent.point)[0]&&i[1]===n[1]?0:e.contourId>t.contourId?1:-1:1===w(e,t)?1:-1}var M=function(){this.points=[],this.holeIds=[],this.holeOf=null,this.depth=null};function C(e,t,i,n){var r,o=e+1,s=t[e].point,a=t.length;for(o<a&&(r=t[o].point);o<a&&r[0]===s[0]&&r[1]===s[1];){if(!i[o])return o;++o<a&&(r=t[o].point)}for(o=e-1;i[o]&&o>n;)o--;return o}M.prototype.isExterior=function(){return null==this.holeOf};var P=R,D=R;function R(e,t){if(!(this instanceof R))return new R(e,t);if(this.data=e||[],this.length=this.data.length,this.compare=t||L,this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this._down(i)}function L(e,t){return e<t?-1:e>t?1:0}R.prototype={push:function(e){this.data.push(e),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var e=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),e}},peek:function(){return this.data[0]},_up:function(e){for(var t=this.data,i=this.compare,n=t[e];e>0;){var r=e-1>>1,o=t[r];if(i(n,o)>=0)break;t[e]=o,e=r}t[e]=n},_down:function(e){for(var t=this.data,i=this.compare,n=this.length>>1,r=t[e];e<n;){var o=1+(e<<1),s=o+1,a=t[o];if(s<this.length&&i(t[s],a)<0&&(o=s,a=t[s]),i(a,r)>=0)break;t[e]=a,e=o}t[e]=r}},P.default=D;var z=Math.max,O=Math.min,F=0;function k(e,t,i,n,r,o){var s,a,c,u,h,d;for(s=0,a=e.length-1;s<a;s++)if(u=e[s+1],h=new l(c=e[s],!1,void 0,t),d=new l(u,!1,h,t),h.otherEvent=d,c[0]!==u[0]||c[1]!==u[1]){h.contourId=d.c
2ontourId=i,o||(h.isExteriorRing=!1,d.isExteriorRing=!1),w(h,d)>0?d.left=!0:h.left=!0;var f=c[0],p=c[1];r[0]=O(r[0],f),r[1]=O(r[1],p),r[2]=z(r[2],f),r[3]=z(r[3],p),n.push(h),n.push(d)}}var B=[];function N(e,t,n){"number"==typeof e[0][0][0]&&(e=[e]),"number"==typeof t[0][0][0]&&(t=[t]);var r=function(e,t,i){var n=null;return e.length*t.length==0&&(0===i?n=B:2===i?n=e:1!==i&&3!==i||(n=0===e.length?t:e)),n}(e,t,n);if(r)return r===B?null:r;var o=[1/0,1/0,-1/0,-1/0],a=[1/0,1/0,-1/0,-1/0],l=function(e,t,i,n,r){var o,s,a,l,c,u,h=new P(null,w);for(a=0,l=e.length;a<l;a++)for(c=0,u=(o=e[a]).length;c<u;c++)(s=0===c)&&F++,k(o[c],!0,F,h,i,s);for(a=0,l=t.length;a<l;a++)for(c=0,u=(o=t[a]).length;c<u;c++)s=0===c,2===r&&(s=!1),s&&F++,k(o[c],!1,F,h,n,s);return h}(e,t,o,a,n);if(r=function(e,t,i,n,r){var o=null;return(i[0]>n[2]||n[0]>i[2]||i[1]>n[3]||n[1]>i[3])&&(0===r?o=B:2===r?o=e:1!==r&&3!==r||(o=e.concat(t))),o}(e,t,o,a,n))return r===B?null:r;for(var c=function(e){var t,i,n=function(e){var t,i,n,r,o=[];for(i=0,n=e.length;i<n;i++)((t=e[i]).left&&t.inResult||!t.left&&t.otherEvent.inResult)&&o.push(t);for(var s=!1;!s;)for(s=!0,i=0,n=o.length;i<n;i++)i+1<n&&1===w(o[i],o[i+1])&&(r=o[i],o[i]=o[i+1],o[i+1]=r,s=!1);for(i=0,n=o.length;i<n;i++)(t=o[i]).otherPos=i;for(i=0,n=o.length;i<n;i++)(t=o[i]).left||(r=t.otherPos,t.otherPos=t.otherEvent.otherPos,t.otherEvent.otherPos=r);return o}(e),r={},o=[],s=function(){if(!r[t]){var e=o.length,i=function(e,t,i){var n=new M;if(null!=e.prevInResult){var r=e.prevInResult,o=r.outputContourId;if(r.resultTransition>0){var s=t[o];if(null!=s.holeOf){var a=s.holeOf;t[a].holeIds.push(i),n.holeOf=a,n.depth=t[o].depth}else t[o].holeIds.push(i),n.holeOf=o,n.depth=t[o].depth+1}else n.holeOf=null,n.depth=t[o].depth}else n.holeOf=null,n.depth=0;return n}(n[t],o,e),s=function(t){r[t]=!0,t<n.length&&n[t]&&(n[t].outputContourId=e)},a=t,l=t;for(i.points.push(n[t].point);s(a),s(a=n[a].otherPos),i.points.push(n[a].point),!((a=C(a,n,r,l))==l||a>=n.length)&&n[a];);o.push(i)}};for(t=0,i=n.length;t<i;t++)s();return o}(function(e,t,n,r,o,a){for(var l,c,u,h=new i(A),d=[],f=Math.min(r[2],o[2]);0!==e.length;){var p=e.pop();if(d.push(p),0===a&&p.point[0]>f||2===a&&p.point[0]>r[2])break;if(p.left){c=l=h.insert(p),l=l!==(u=h.minNode())?h.prev(l):null,c=h.next(c);var m=l?l.key:null;if(s(p,m,a),c&&2===I(p,c.key,e)&&(s(p,m,a),s(c.key,p,a)),l&&2===I(l.key,p,e)){var _=l;s(m,(_=_!==u?h.prev(_):null)?_.key:null,a),s(p,m,a)}}else c=l=h.find(p=p.otherEvent),l&&c&&(l=l!==u?h.prev(l):null,c=h.next(c),h.remove(p),c&&l&&I(l.key,c.key,e))}return d}(l,0,0,o,a,n)),u=[],h=0;h<c.length;h++){var d=c[h];if(d.isExterior()){for(var f=[d.points],p=0;p<d.holeIds.length;p++)f.push(c[d.holeIds[p]].points);u.push(f)}}return u}var V={UNION:1,DIFFERENCE:2,INTERSECTION:0,XOR:3};e.diff=function(e,t){return N(e,t,2)},e.intersection=function(e,t){return N(e,t,0)},e.operations=V,e.union=function(e,t){return N(e,t,1)},e.xor=function(e,t){return N(e,t,3)},Object.defineProperty(e,"__esModule",{value:!0})}(ef.exports)),ef.exports);function nf(e,t,i,n){const r=[],o=0===n?(e,t,i,n,r,o)=>{e.push(new Se(o,i+(o-t)/(n-t)*(r-i)))}:(e,t,i,n,r,o)=>{e.push(new Se(t+(o-i)/(r-i)*(n-t),o))};for(const s of e){const e=[];for(const r of s){if(r.length<=2)continue;const s=[];for(let e=0;e<r.length-1;e++){const a=r[e].x,l=r[e].y,c=r[e+1].x,u=r[e+1].y,h=0===n?a:l,d=0===n?c:u;h<t?d>t&&o(s,a,l,c,u,t):h>i?d<i&&o(s,a,l,c,u,i):s.push(r[e]),d<t&&h>=t&&o(s,a,l,c,u,t),d>i&&h<=i&&o(s,a,l,c,u,i)}let a=r[r.length-1];const l=0===n?a.x:a.y;l>=t&&l<=i&&s.push(a),s.length&&(a=s[s.length-1],s[0].x===a.x&&s[0].y===a.y||s.push(s[0]),e.push(s))}e.length&&r.push(e)}return r}function rf(e,t){const i=sf(e),n=sf([t]),r=tf.intersection(i,n);return null==r?[]:af(r)}function of(e,t){const i=65536;let n=sf(e,i);const r=[];for(;t.valid();t.next()){const[e,n]=t.get(),o=e.x*i,s=e.y*i,a=n.x*i,l=n.y*i,c=a-o,u=l-s,h=Math.hypot(c,u);if(0===h)continue;const d=Math.trunc(u/h*3),f=-Math.trunc(c/h*3);r.push([[[o,s],[a,l],[a+d,l+f],[o+d,s+f],[o,s]]])}return r.length>0&&(n=tf.diff(n,r)),af(n,1/i)}function sf(e,t=1){return[e.map(e=>e.map(e=>[e.x*t,e.y*t]))]}function af(e,t=1){return e.map(e=>e.map((e,i)=>{const n=e.map(e=>new Se(e[0]*t,e[1]*t).round());return i>0&&n.reverse(),n}))}class lf{constructor(e,t){this.layoutVertexArray=new sl,this.indexArray=new Al,this.lineIndexArray=new wl,this.triangleSegments=new rc,this.lineSegments=new rc,this.programConfigurations=new Lc(e.layers,{zoom:e.zoom,lut:e.lut}),this.uploaded=!1,t&&(this.elevatedLayoutVertexArray=new cl)}update(e,t,i,n,r,o,s,a){this.programConfigurations.updatePaintArrays(e,t,r,i,n,o,s,a)}isEmpty(){return 0===this.layoutVertexArray.length}needsUpload(){return this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,pd.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.lineIndexBuffer=e.createIndexBuffer(this.lineIndexArray),this.elevatedLayoutVertexArray&&this.elevatedLayoutVertexArray.length>0&&(this.elevatedLayoutVertexBuffer=e.createVertexBuffer(this.elevatedLayoutVertexArray,md.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.elevatedLayoutVertexBuffer&&this.elevatedLayoutVertexBuffer.destroy(),this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.lineIndexBuffer.destroy(),this.programConfigurations.destroy(),this.triangleSegments.destroy(),this.lineSegments.destroy())}populatePaintArrays(e,t,i,n,r,o,s){this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,t,i,n,r,o,void 0,s)}}class cf{constructor(e){this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lut=e.lut,this.bufferData=new lf(e,!1),this.elevationBufferData=new lf(e,!0),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.projection=e.projection,this.elevationMode=this.layers[0].layout.get("fill-elevation-reference"),this.sourceLayerIndex=e.s
2ourceLayerIndex,this.worldview=e.worldview,this.hasAppearances=null}updateFootprints(e,t){}updateAppearances(e,t,i,n){}populate(e,t,i,n){this.hasPattern=Wd("fill",this.layers,this.pixelRatio,t);const r=this.layers[0].layout.get("fill-sort-key"),o=[];for(const{feature:s,id:a,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,u=gu(s,e);if(!this.layers[0]._featureFilter.filter(new ga(this.zoom,{worldview:this.worldview,activeFloors:t.activeFloors}),u,i))continue;const h=r?r.evaluate(u,{},i,t.availableImages):void 0,d={id:a,properties:s.properties,type:s.type,sourceLayerIndex:c,index:l,geometry:e?u.geometry:_u(s,i,n),patterns:{},sortKey:h};o.push(d)}r&&o.sort((e,t)=>e.sortKey-t.sortKey);for(const n of o){const{geometry:r,index:o,sourceLayerIndex:s}=n;if(this.hasPattern){const e=Zd("fill",this.layers,n,this.zoom,this.pixelRatio,t);this.patternFeatures.push(e)}else this.addFeature(n,r,o,i,{},t.availableImages,t.brightness,t.elevationFeatures);t.featureIndex.insert(e[o].feature,r,o,s,this.index)}}update(e,t,i,n,r,o,s){this.bufferData.update(e,t,i,n,r,o,s,this.worldview),this.elevationBufferData.update(e,t,i,n,r,o,s,this.worldview),this.elevatedStructures&&this.elevatedStructures.update(e,t,i,n,r,o,s,this.worldview)}addFeatures(e,t,i,n,r,o){for(const r of this.patternFeatures)this.addFeature(r,r.geometry,r.index,t,i,n,o,e.elevationFeatures)}isEmpty(){return this.bufferData.isEmpty()&&this.elevationBufferData.isEmpty()}uploadPending(){return!this.uploaded||this.bufferData.needsUpload()||this.elevationBufferData.needsUpload()}upload(e){this.bufferData.upload(e),this.elevationBufferData.upload(e),this.elevatedStructures&&this.elevatedStructures.upload(e)}destroy(){this.bufferData.destroy(),this.elevationBufferData.destroy(),this.elevatedStructures&&this.elevatedStructures.destroy()}addFeature(e,t,i,n,r,o=[],s,a){const l=qd(t,500);"none"!==this.elevationMode?this.addElevatedRoadFeature(e,l,n,i,a):this.addGeometry(l,this.bufferData),this.bufferData.populatePaintArrays(e,i,r,o,n,s,this.worldview),this.elevationBufferData.populatePaintArrays(e,i,r,o,n,s,this.worldview)}getUnevaluatedPortalGraph(){return this.elevatedStructures?this.elevatedStructures.unevaluatedPortals:void 0}getElevationPolygons(){return this.elevatedStructures?this.elevatedStructures.portalPolygons:void 0}setEvaluatedPortalGraph(e,t,i,n,r){this.elevatedStructures&&(this.elevatedStructures.construct(e),this.elevatedStructures.populatePaintArrays(t,i,n,r,this.worldview))}addElevatedRoadFeature(e,t,i,n,r){const o=new Array,s=Gu.getElevationFeature(e,r);if(!s)return void this.addGeometry(t,this.bufferData);{const e=this.clipPolygonsToTile(t,1);e.length>0&&o.push({polygons:e,elevationFeature:s,elevationTileID:i})}const a={guardRailEnabled:this.layers[0].layout.get("fill-construct-bridge-guard-rail").evaluate(e,{},i),featureIndex:n};for(const t of o)if(t.elevationFeature){if("hd-road-base"===this.elevationMode){this.elevatedStructures||(this.elevatedStructures=new Jd(t.elevationTileID,this.layers,this.zoom,this.lut));const i=t.elevationFeature.isTunnel();let n=0;e.properties.hasOwnProperty(Iu)&&(n=+e.properties[Iu]);for(const e of t.polygons)this.elevatedStructures.addPortalCandidates(t.elevationFeature.id,e,i,t.elevationFeature,n)}null==t.elevationFeature.constantHeight&&(t.polygons=this.prepareElevatedPolygons(t.polygons,t.elevationFeature,t.elevationTileID));const r=new qu(i,t.elevationTileID);this.addElevatedGeometry(t.polygons,r,t.elevationFeature,"hd-road-base"===this.elevationMode?0:.05,n,a)}}addElevatedGeometry(e,t,i,n,r,o){const s={elevation:i,elevationSampler:t,bias:n,index:r,featureInfo:o},[a,l]=this.addGeometry(e,this.elevationBufferData,s);null==this.elevationBufferData.heightRange?this.elevationBufferData.heightRange={min:a,max:l}:(this.elevationBufferData.heightRange.min=Math.min(this.elevationBufferData.heightRange.min,a),this.elevationBufferData.heightRange.max=Math.max(this.elevationBufferData.heightRange.max,l))}addGeometry(e,t,i){let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=null;i&&(o=i.elevationSampler.constantElevation(i.elevation,i.bias),null!=o&&(n=o,r=o));const s=(e,s,a)=>
vendor: 4,147 bytes, line 2
2{if(null!=i)if(s.push(e),null!=o)t.elevatedLayoutVertexArray.emplaceBack(o),a.push(o);else{const o=i.elevationSampler.pointElevation(e,i.elevation,i.bias);t.elevatedLayoutVertexArray.emplaceBack(o),a.push(o),n=Math.min(n,o),r=Math.max(r,o)}};for(const n of e){let e=0;for(const t of n)e+=t.length;const r=t.triangleSegments.prepareSegment(e,t.layoutVertexArray,t.indexArray),o=r.vertexLength,a=[],l=[],c=[],u=[],h=[],d=t.layoutVertexArray.length;for(const e of n){if(0===e.length)continue;e!==n[0]&&l.push(a.length/2);const r=t.lineSegments.prepareSegment(e.length,t.layoutVertexArray,t.lineIndexArray),o=r.vertexLength;i&&h.push(t.layoutVertexArray.length-d),s(e[0],c,u),t.layoutVertexArray.emplaceBack(e[0].x,e[0].y),t.lineIndexArray.emplaceBack(o+e.length-1,o),a.push(e[0].x),a.push(e[0].y);for(let i=1;i<e.length;i++)s(e[i],c,u),t.layoutVertexArray.emplaceBack(e[i].x,e[i].y),t.lineIndexArray.emplaceBack(o+i-1,o+i),a.push(e[i].x),a.push(e[i].y);r.vertexLength+=e.length,r.primitiveLength+=e.length}const f=yd(a,l);for(let e=0;e<f.length;e+=3)t.indexArray.emplaceBack(o+f[e],o+f[e+1],o+f[e+2]);if(f.length>0&&i&&"hd-road-base"===this.elevationMode){const e=i.elevation.isTunnel(),t=i.elevation.safeArea,n=this.elevatedStructures.addVertices(c,u);this.elevatedStructures.addTriangles(f,n,e);const r=h.length;if(r>0){for(let o=0;o<r-1;o++)this.elevatedStructures.addRenderableRing(i.index,h[o]+n,h[o+1]-h[o],e,t,i.featureInfo);this.elevatedStructures.addRenderableRing(i.index,h[r-1]+n,c.length-h[r-1],e,t,i.featureInfo)}}r.vertexLength+=e,r.primitiveLength+=f.length/3}return[n,r]}prepareElevatedPolygons(e,t,i){const n=1/au(i),r=[];for(const i of e){const e=of(i,new Uu(t,n));r.push(...e)}return r}clipPolygonsToTile(e,t){const i=-t,n=-t,r=Vn+t,o=Vn+t;let s=0;const a=[],l=[];for(;s<e.length;s++){const t=e[s],c=yn(t);(c.min.x>=i&&c.max.x<=r&&c.min.y>=n&&c.max.y<=o?a:l).push(t)}if(a.length===e.length)return e;const c=[new Se(i,n),new Se(r,n),new Se(r,o),new Se(i,o),new Se(i,n)],u=a;for(const e of l)u.push(...rf(e,c));return u}}let uf,hf,df,ff;Jo(cf,"FillBucket",{omit:["layers","patternFeatures"]}),Jo(lf,"FillBufferData"),Jo(Jd,"ElevatedStructures");class pf{constructor(e,t,i,n){if(this.triangleCount=t.length/3,this.min=new Se(0,0),this.max=new Se(0,0),this.xScale=0,this.yScale=0,this.cellsX=0,this.cellsY=0,this.cells=[],this.payload=[],0===this.triangleCount||0===e.length)return;const[r,o]=[e[0].clone(),e[0].clone()];for(let t=1;t<e.length;++t){const i=e[t];r.x=Math.min(r.x,i.x),r.y=Math.min(r.y,i.y),o.x=Math.max(o.x,i.x),o.y=Math.max(o.y,i.y)}if(n){const e=Math.ceil(Math.max(o.x-r.x,o.y-r.y)/n);i=Math.max(i,e)}if(0===i)return;this.min=r,this.max=o;const s=this.max.sub(this.min);s.x=Math.max(s.x,1),s.y=Math.max(s.y,1);const a=Math.max(s.x,s.y)/i;this.cellsX=Math.max(1,Math.ceil(s.x/a)),this.cellsY=Math.max(1,Math.ceil(s.y/a)),this.xScale=1/a,this.yScale=1/a;const l=[];for(let i=0;i<this.triangleCount;i++){const n=e[t[3*i+0]].sub(this.min),r=e[t[3*i+1]].sub(this.min),o=e[t[3*i+2]].sub(this.min),s=mf(Math.floor(Math.min(n.x,r.x,o.x)),this.xScale,this.cellsX),c=mf(Math.floor(Math.max(n.x,r.x,o.x)),this.xScale,this.cellsX),u=mf(Math.floor(Math.min(n.y,r.y,o.y)),this.yScale,this.cellsY),h=mf(Math.floor(Math.max(n.y,r.y,o.y)),this.yScale,this.cellsY),d=new Se(0,0),f=new Se(0,0),p=new Se(0,0),m=new Se(0,0);for(let e=u;e<=h;++e){d.y=f.y=e*a,p.y=m.y=(e+1)*a;for(let t=s;t<=c;++t)d.x=p.x=t*a,f.x=m.x=(t+1)*a,(ah(n,r,o,d,f,m)||ah(n,r,o,d,m,p))&&l.push({cellIdx:e*this.cellsX+t,triIdx:i})}}if(0===l.length)return;l.sort((e,t)=>e.cellIdx-t.cellIdx||e.triIdx-t.triIdx);let c=0;for(;c<l.length;){const e=l[c].cellIdx,t={start:this.payload.length,len:0};for(;c<l.length&&l[c].cellIdx===e;)++t.len,this.payload.push(l[c++].triIdx);this.cells[e]=t}}_lazyInitLookup(){this.lookup||(this.lookup=new Uint8Array(Math.ceil(this.triangleCount/8))),this.lookup.fill(0)}queryPoint(e,t){if(0===this.triangleCount||0===this.cells.length)return;if(e.x>this.max.x||this.min.x>e.x||e.y>this.max.y||this.min.y>e.y)return;const i=mf(e.x-this.min.x,this.xScale,this.cellsX),n=mf(e.y-this.min.y,this.yScale,this.cellsY),r=this.cells[n*this.cellsX+i
vendor: 8,297 bytes, line 2
2];if(r){this._lazyInitLookup();for(let e=0;e<r.len;e++){const i=this.payload[r.start+e],n=Math.floor(i/8),o=1<<i%8;if(!(this.lookup[n]&o)&&(this.lookup[n]|=o,t.push(i),t.length===this.triangleCount))return}}}query(e,t,i){if(0===this.triangleCount||0===this.cells.length)return;if(e.x>this.max.x||this.min.x>t.x)return;if(e.y>this.max.y||this.min.y>t.y)return;this._lazyInitLookup();const n=mf(e.x-this.min.x,this.xScale,this.cellsX),r=mf(t.x-this.min.x,this.xScale,this.cellsX),o=mf(e.y-this.min.y,this.yScale,this.cellsY),s=mf(t.y-this.min.y,this.yScale,this.cellsY);for(let e=o;e<=s;e++)for(let t=n;t<=r;t++){const n=this.cells[e*this.cellsX+t];if(n)for(let e=0;e<n.len;e++){const t=this.payload[n.start+e],r=Math.floor(t/8),o=1<<t%8;if(!(this.lookup[r]&o)&&(this.lookup[r]|=o,i.push(t),i.length===this.triangleCount))return}}}}function mf(e,t,i){return Math.max(0,Math.min(i-1,Math.floor(e*t)))}Jo(pf,"TriangleGridIndex");class _f{constructor(e){this.zoom=e.zoom,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.index=e.index,this.hasPattern=!1,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.footprints=[],this.worldview=e.worldview,this.hasAppearances=null}updateFootprints(e,t){for(const i of this.footprints)t.push({footprint:i,id:e})}updateAppearances(e,t,i,n){}populate(e,t,i,n){const r=[];for(const{feature:o,id:s,index:a,sourceLayerIndex:l}of e){const e=this.layers[0]._featureFilter.needGeometry,c=gu(o,e);if(!this.layers[0]._featureFilter.filter(new ga(this.zoom,{worldview:this.worldview,activeFloors:t.activeFloors}),c,i))continue;const u={id:s,properties:o.properties,type:o.type,sourceLayerIndex:l,index:a,geometry:e?c.geometry:_u(o,i,n),patterns:{}};r.push(u)}for(const n of r){const{geometry:r,index:o,sourceLayerIndex:s}=n;this.addFeature(n,r,o,i,{},t.availableImages,t.brightness),t.featureIndex.insert(e[o].feature,r,o,s,this.index)}}isEmpty(){return 0===this.footprints.length}uploadPending(){return!1}upload(e){}update(e,t,i,n,r,o,s){}destroy(){}addFeature(e,t,i,n,r,o=[],s){for(const e of qd(t,2)){const t=[],i=[],n=[],r=new Se(1/0,1/0),o=new Se(-1/0,-1/0);for(const s of e)if(0!==s.length){s!==e[0]&&n.push(i.length/2);for(let e=0;e<s.length;e++)i.push(s[e].x),i.push(s[e].y),t.push(s[e]),r.x=Math.min(r.x,s[e].x),r.y=Math.min(r.y,s[e].y),o.x=Math.max(o.x,s[e].x),o.y=Math.max(o.y,s[e].y)}const s=yd(i,n),a=new pf(t,s,8,256);this.footprints.push({vertices:t,indices:s,grid:a,min:r,max:o})}}}Jo(_f,"ClipBucket",{omit:["layers"]});const gf=rl([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),yf=rl([{name:"a_pos_end",components:4,type:"Int16"},{name:"a_angular_offset_factor",components:1,type:"Int16"}]),vf=rl([{name:"a_flood_light_ground_radius",components:1,type:"Float32"}]),xf=rl([{name:"a_centroid_pos",components:2,type:"Uint16"}]),bf=rl([{name:"a_join_normal_inside",components:3,type:"Int16"}]),wf=rl([{name:"a_hidden_by_landmark",components:1,type:"Uint8"}]),Tf=rl([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),{members:Sf}=gf,Ef=Number.MAX_SAFE_INTEGER,If=Ef-1;function Af(e,t,i,n){return e.order<t||e.order===Ef||!(e.clipMask&i)||function(e,t){return 0!==t.length&&void 0===t.find(t=>t===e)}(n,e.clipScope)}function Mf(e,t){return e.x-t.x||e.y-t.y}function Cf(e,t){return 0===Mf(e.min,t.min)&&0===Mf(e.max,t.max)}function Pf(e,t){return!(e.min.x>t.max.x||e.max.x<t.min.x||e.min.y>t.max.y||e.max.y<t.min.y)}function Df(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(e[i].sourceId!==t[i].sourceId||!Cf(e[i],t[i])||e[i].order!==t[i].order||e[i].clipMask!==t[i].clipMask||!Ee(e[i].clipScope,t[i].clipScope))return!1;return!0}function Rf(e,t,i){const n=1/Vn,r=1/(1<<i.canonical.z),o=(t.x*n+i.canonical.x)*r+i.wrap,s=(t.y*n+i.canonical.y)*r;return{min:new Se((e.x*n+i.canonical.x)*r+i.wrap,(e.y*n+i.canonical.y)*r),max:new Se(o,s)}}function Lf(e,t,i){const n=1<<i.canonical.z,r=((t.x-i.wrap)*n-i.canonical.x)*Vn,o=(t.y*n-i.canonical.y)*Vn;return{min:new Se(((e.x-i.wrap)*n-i.canonical.x)*Vn,(e.y*n-i.canonical.y)*Vn),max:new Se(r,o)}}function zf(e,t,i,n,r,o,s){const a=e.indices,l=e.vertices,c=[];for(let u=n;u<n+r;u+=3){const n=t[i[u+0]+o],r=t[i[u+1]+o],h=t[i[u+2]+o],d=Math.min(n.x,r.x,h.x),f=Math.max(n.x,r.x,h.x),p=Math.min(n.y,r.y,h.y),m=Math.max(n.y,r.y,h.y);c.length=0,e.grid.query(new Se(d,p),new Se(f,m),c);for(let e=0;e<c.length;e++){const t=c[e];if(ah(l[a[3*t+0]],l[a[3*t+1]],l[a[3*t+2]],n,r,h,s))return!0}}return!1}function Of(e,t,i,n){if(!e||!i)return!1;let r=e.vertices;if(!t.canonical.equals(n.canonical)||t.wrap!==n.wrap){if(i.vertices.length<e.vertices.length)return Of(i,n,e,t);const o=t.canonical,s=n.canonical,a=Math.pow(2,s.z-o.z);r=e.vertices.map(e=>new Se((e.x+o.x*Vn)*a-s.x*Vn,(e.y+o.y*Vn)*a-s.y*Vn))}return zf(i,r,e.indices,0,e.indices.length,0,0)}function Ff(e,t,i,n){const r=Math.pow(2,n.z-i.z);return new Se((e+i.x*Vn)*r-n.x*Vn,(t+i.y*Vn)*r-n.y*Vn)}function kf(e,t){const i=[];t.grid.queryPoint(e,i);const n=t.indices,r=t.vertices;for(let t=0;t<i.length;t++){const o=i[t];if(nh([r[n[3*o+0]],r[n[3*o+1]],r[n[3*o+2]]],e))return!0}return!1}const Bf=[new Se(0,0),new Se(Vn,0),new Se(Vn,Vn),new Se(0,Vn)];function Nf(e,t){const i=[];let n=[];if(!t||e.length<2)return[e];if(2===e.length)return oh(e[0],e[1],Bf)?[e]:[];for(let t=0;t<e.length+2;t++){const r=e[t%e.length],o=e[(t+1)%e.length],s=oh(0===t?e[e.length-1]:e[(t-1)%e.length],r,Bf),a=oh(r,o,Bf),l=s||a;l&&n.push(r),l&&a||n.length>0&&(n.length>1&&i.push(n),n=[])}return n.length>1&&i.push(n),i}const Vf=yu.types,Uf=["fill-extrusion-base","fill-extrusion-height","fill-extrusion-color","fill-extrusion-pattern","fill-extrusion-flood-light-wall-radius","fill-extrusion-line-width","fill-extrusion-emissive-strength"],jf=["fill-extrusion-flood-light-ground-radius"],Gf=Math.pow(2,13),qf=Math.pow(2,15)-1,Hf=new Se(0,1),$f=2147483648;function Wf(e,t,i,n,r,o,s,a){e.emplaceBack((t<<1)+s,(i<<1)+o,(Math.floor(n*Gf)<<1)+r,Math.round(a))}function Zf(e,t,i){e.emplaceBack(t.x*Vn,t.y*Vn,i?1:0)}function Xf(e,t,i,n,r,o){e.emplaceBack(t.x,t.y,(i.x<<1)+n,(i.y<<1)+r,o)}function Yf(e,t,i){const n=16384;e.emplaceBack(t.x,t.y,t.z,i[0]*n,i[1]*n,i[2]*n)}class Kf{constructor(){this.vertexOffset=0,this.vertexCount=0,this.indexOffset=0,this.indexCount=0}}class Jf{constructor(){this.centroidXY=new Se(0,0),this.vertexArrayOffset=0,this.vertexCount=0,this.groundVertexArrayOffset=0,this.groundVertexCount=0,this.flags=0,this.footprintSegIdx=-1,this.footprintSegLen=0,this.polygonSegIdx=-1,this.polygonSegLen=0,this.min=new Se(Number.MAX_VALUE,Number.MAX_VALUE),this.max=new Se(-Number.MAX_VALUE,-Number.MAX_VALUE),this.height=0,this.buildingId=0}span(){return new Se(this.max.x-this.min.x,this.max.y-this.min.y)}}class Qf{constructor(){this.acc=new Se(0,0),this.accCount=0,this.centroidDataIndex=0}startRing(e,t){e.min.x===Number.MAX_VALUE&&(e.min.x=e.max.x=t.x,e.min.y=e.max.y=t.y)}appendEdge(e,t,i){this.accCount++,this.acc._add(t);let n=!!this.borders;t.x<e.min.x?(e.min.x=t.x,n=!0):t.x>e.max.x&&(e.max.x=t.x,n=!0),t.y<e.min.y?(e.min.y=t.y,n=!0):t.y>e.max.y&&(e.max.y=t.y,n=!0),((0===t.x||t.x===Vn)&&t.x===i.x)!=((0===t.y||t.y===Vn)&&t.y===i.y)&&this.processBorderOverlap(t,i),n&&this.checkBorderIntersection(t,i)}checkBorderIntersection(e,t){t.x<0!=e.x<0&&this.addBorderIntersection(0,di(t.y,e.y,(0-t.x)/(e.x-t.x))),t.x>Vn!=e.x>Vn&&this.addBorderIntersection(1,di(t.y,e.y,(Vn-t.x)/(e.x-t.x))),t.y<0!=e.y<0&&this.addBorderIntersection(2,di(t.x,e.x,(0-t.y)/(e.y-t.y))),t.y>Vn!=e.y>Vn&&this.addBorderIntersection(3,di(t.x,e.x,(Vn-t.y)/(e.y-t.y)))}addBorderIntersection(e,t){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const i=this.borders[e];t<i[0]&&(i[0]=t),t>i[1]&&(i[1]=t)}processBorderOverlap(e,t){if(e.x===t.x){if(e.y===t.y)return;const i=0===e.x?0:1;this.addBorderIntersection(i,t.y),this.addBorderIntersection(i,e.y)}else{const i=0===e.y?2:3;this.addBorderIntersection(i,t.x),this.addBorderIntersection(i,e.x)}}centroid(){return 0===this.accCount?new Se(0,0):new Se(Math.floor(Math.max(0,this.acc.x)/this.accCount),Math.floor(Math.max(0,this.acc.y)/this.accCount))}intersectsCount(){return this.borders?this.borders.reduce((e,t)=>
vendor: 9,866 bytes, line 2
2e+ +(t[0]!==Number.MAX_VALUE),0):0}}function ep(e,t){const i=e.add(t)._unit(),n=ze(e.x*i.x+e.y*i.y,-1,1);var r,o,s;return r=Math.acos(n),Math.min(4,Math.max(-4,Math.tan(r)))/4*qf*((o=e).x*(s=t).y-o.y*s.x<0?-1:1)}const tp=[e=>e.x<0,e=>e.x>Vn,e=>e.y<0,e=>e.y>Vn];function ip(e,t,i,n){const r=[4];if(0===n)return r;i._mult(n);const o=e.sub(i),s=t.sub(i),a=[e,t,o,s];for(let e=0;e<4;e++)for(const t of a)if(tp[e](t)){r.push(e);break}return r}class np{constructor(e){this.groundRadiusArray=null,this.groundRadiusBuffer=null,this.vertexArray=new dl,this.indexArray=new Al,this.programConfigurations=new Lc(e.layers,{zoom:e.zoom,lut:e.lut},e=>jf.includes(e)),this._segments=new rc,this.hiddenByLandmarkVertexArray=new Ul,this._segmentToGroundQuads={},this._segmentToGroundQuads[0]=[],this._segmentToRegionTriCounts={},this._segmentToRegionTriCounts[0]=[0,0,0,0,0],this.regionSegments={},this.regionSegments[4]=new rc}getDefaultSegment(){return this.regionSegments[4]}hasData(){return 0!==this.vertexArray.length}addData(e,t,i,n=!1){const r=e.length;if(r>2){let o=Math.max(0,this._segments.get().length-1);const s=this._segments._prepareSegment(4*r,this.vertexArray.length,2*this._segmentToGroundQuads[o].length);let a;o!==this._segments.get().length-1&&(o++,this._segmentToGroundQuads[o]=[],this._segmentToRegionTriCounts[o]=[0,0,0,0,0]);{const t=e[0],i=e[1];a=ep(t.sub(e[r-1])._perp()._unit(),i.sub(t)._perp()._unit())}for(let l=0;l<r;l++){const c=l===r-1?0:l+1,u=e[l],h=e[c],d=e[c===r-1?0:c+1],f=h.sub(u)._perp()._unit(),p=ep(f,d.sub(h)._perp()._unit()),m=a,_=p;if(lp(u,h,t)||n&&cp(u,t)&&cp(h,t)){a=p;continue}const g=s.vertexLength;Xf(this.vertexArray,u,h,1,1,m),Xf(this.vertexArray,u,h,1,0,m),Xf(this.vertexArray,u,h,0,1,_),Xf(this.vertexArray,u,h,0,0,_),s.vertexLength+=4;const y=ip(u,h,f,i);for(const e of y)this._segmentToGroundQuads[o].push({id:g,region:e}),this._segmentToRegionTriCounts[o][e]+=2,s.primitiveLength+=2;a=p}}}prepareBorderSegments(){if(!this.hasData())return;const e=this._segments.get(),t=e.length;for(let e=0;e<t;e++)this._segmentToGroundQuads[e].sort((e,t)=>e.region-t.region);for(let i=0;i<t;i++){const t=this._segmentToGroundQuads[i],n=e[i],r=this._segmentToRegionTriCounts[i];r.reduce((e,t)=>e+t,0);let o=0;for(let e=0;e<=4;e++){const t=r[e];if(0!==t){let i=this.regionSegments[e];i||(i=this.regionSegments[e]=new rc);const r={vertexOffset:n.vertexOffset,primitiveOffset:n.primitiveOffset+o,vertexLength:n.vertexLength,primitiveLength:t};i.get().push(r)}o+=t}for(let e=0;e<t.length;e++){const i=t[e].id;this.indexArray.emplaceBack(i,i+1,i+3),this.indexArray.emplaceBack(i,i+3,i+2)}}this._segmentToGroundQuads=null,this._segmentToRegionTriCounts=null,this._segments.destroy(),this._segments=null}addPaintPropertiesData(e,t,i,n,r,o,s){this.hasData()&&this.programConfigurations.populatePaintArrays(this.vertexArray.length,e,t,i,n,r,o,void 0,s)}upload(e){this.hasData()&&(this.vertexBuffer=e.createVertexBuffer(this.vertexArray,yf.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),null!=this.groundRadiusArray&&(this.groundRadiusBuffer=e.createVertexBuffer(this.groundRadiusArray,vf.members)))}uploadPaintProperties(e){this.hasData()&&this.programConfigurations.upload(e)}update(e,t,i,n,r,o,s,a){this.hasData()&&this.programConfigurations.updatePaintArrays(e,t,i,n,r,o,s,a)}updateHiddenByLandmark(e){this.updateHiddenByLandmarkRange(e.groundVertexArrayOffset,e.groundVertexCount,!!(e.flags&$f))}updateHiddenByLandmarkRange(e,t,i){if(!this.hasData())return;const n=t+e;if(0!==t){for(let t=e;t<n;++t)this.hiddenByLandmarkVertexArray.emplace(t,i?1:0);this._needsHiddenByLandmarkUpdate=!0}}uploadHiddenByLandmark(e){this.hasData()&&this._needsHiddenByLandmarkUpdate&&(!this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexArray.length>0?this.hiddenByLandmarkVertexBuffer=e.createVertexBuffer(this.hiddenByLandmarkVertexArray,wf.members,!0):this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.updateData(this.hiddenByLandmarkVertexArray),this._needsHiddenByLandmarkUpdate=!1)}destroy(){if(this.vertexBuffer){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.destroy(),this.groundRadiusBuffer&&this.groundRadiusBuffer.destroy(),this._segments&&this._segments.destroy(),this.programConfigurations.destroy();for(let e=0;e<=4;e++){const t=this.regionSegments[e];t&&t.destroy()}}}}class rp{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaling=e.overscaling,this.layers=e.layers,this.pixelRatio=e.pixelRatio,this.layerIds=this.layers.map(e=>e.fqid),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.activeReplacements=[],this.replacementUpdateTime=0,this.centroidData=[],this.footprintIndices=new Al,this.footprintVertices=new sl,this.footprintSegments=[],this.layoutVertexArray=new ll,this.centroidVertexArray=new Jl,this.wallVertexArray=new ec,this.indexArray=new Al,this.programConfigurations=new Lc(e.layers,{zoom:e.zoom,lut:e.lut},e=>Uf.includes(e)),this.segments=new rc,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.groundEffect=new np(e),this.maxHeight=0,this.partLookup={},this.triangleSubSegments=[],this.polygonSegments=[],this.worldview=e.worldview,this.hasAppearances=null}updateFootprints(e,t){}updateAppearances(e,t,i,n){}populate(e,t,i,n){this.features=[],this.hasPattern=Wd("fill-extrusion",this.layers,this.pixelRatio,t),this.featuresOnBorder=[],this.borderFeatureIndices=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.selfDEMTileTimestamp=Number.MAX_VALUE,this.borderDEMTileTimestamp=[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE],this.tileToMeter=au(i),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter,this.wallMode=0!==this.layers[0].paint.get("fill-extrusion-line-width").constantOr(1);for(const{feature:r,id:o,index:s,sourceLayerIndex:a}of e){const e=this.layers[0]._featureFilter.needGeometry,l=gu(r,e);if(!this.layers[0]._featureFilter.filter(new ga(this.zoom,{worldview:this.worldview,activeFloors:t.activeFloors}),l,i))continue;const c={id:o,sourceLayerIndex:a,index:s,geometry:e?l.geometry:_u(r,i,n),properties:r.properties,type:r.type,patterns:{}},u=this.layoutVertexArray.length,h="Polygon"===Vf[c.type];if(this.hasPattern)this.features.push({featureId:r.id,feature:Zd("fill-extrusion",this.layers,c,this.zoom,this.pixelRatio,t)});else if(this.wallMode)for(const e of c.geometry)for(const o of Nf(e,h))this.addFeature(r.id,c,[o],s,i,{},t.availableImages,n,t.brightness);else this.addFeature(r.id,c,c.geometry,s,i,{},t.availableImages,n,t.brightness);t.featureIndex.insert(r,c.geometry,s,a,this.index,u)}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles(),this.groundEffect.prepareBorderSegments(),this.polygonSegments.length=0}addFeatures(e,t,i,n,r,o){for(const{featureId:e,feature:s}of this.features){const a="Polygon"===Vf[s.type],{geometry:l}=s;if(this.wallMode)for(const c of l)for(const l of Nf(c,a))this.addFeature(e,s,[l],s.index,t,i,n,r,o);else this.addFeature(e,s,l,s.index,t,i,n,r,o)}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles()}update(e,t,i,n,r,o,s){this.programConfigurations.updatePaintArrays(e,t,r,i,n,o,s,this.worldview),this.groundEffect.update(e,t,r,i,n,o,s,this.worldview)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Sf),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.wallVertexBuffer=e.createVertexBuffer(this.wallVertexArray,bf.members),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=e.createVertexBuffer(this.layoutVertexExtArray,Tf.members,!0)),this.groundEffect.upload(e)),this.groundEffect.uploadPaintProperties(e),this.programConfigurations.upload(e),this.uploaded=!0}uploadCentroid(e){this.groundEffect.uploadHiddenByLandmark(e),this.needsCentroidUpdate&&(!this.centroidVertexBuffer&&this.centroidVertexArray.length>0?this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,xf.members,!0):this.centroidVertexBuffer&&this.centroidVertexBuffer.updateData(this.centroidVertexArray),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.groundEffect.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,i,n,r,o,s,a,l){const c=this.layers[0].paint.get("fill-extrusion-flood-light-ground-radius").evaluate(t,{})/this.tileToMeter,u=[new Se(0,0),new Se(Vn,Vn)],h=a.projection,d="globe"===h.name,f=this.wallMode||"Polygon"===Vf[t.type],p=new Qf;p.centroidDataIndex=this.centroidData.length;const m=new Jf;m.buildingId=e,t.properties&&t.properties.hasOwnProperty("building_id")&&(m.buildingId=t.properties.building_id);const _=this.layers[0].paint.get("fill-extrusion-base").evaluate(t,{},r)<=0,g=this.layers[0].paint.get("fill-extrusion-height").evaluate(t,{},r);let y;if(m.height=g,m.vertexArrayOffset=this.layoutVertexArray.length,m.groundVertexArrayOffset=this.groundEffect.vertexArray.length,d&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new gl),this.wallMode){if(d)return void We("Non zero fill-extrusion-line-width is not yet supported on globe.");if(1!==i.length)return;y=function(e){const t=e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y,i=function(e){let t=0;const i=e.length;for(let n=0;n<i;n++)t+=(e[(n+1)%i].x-e[n].x)*(e[(n+1)%i].y+e[n].y);return t>=0}(e);i||(e=e.reverse());const n={geometry:[],joinNormals:[],indices:[]}
vendor: 3,993 bytes, line 2
2,r=[],o=[],s=[];let a=e.length;for(;a>=2&&e[a-1].equals(e[a-2]);)a--;if(a<(t?3:2))return n;let l,c,u,h,d,f=0;for(;f<a-1&&e[f].equals(e[f+1]);)f++;t&&(l=e[a-2],d=e[f].sub(l)._unit()._perp());for(let i=f;i<a;i++){if(u=i===a-1?t?e[f+1]:void 0:e[i+1],u&&e[i].equals(u))continue;d&&(h=d),l&&(c=l),l=e[i],d=u?u.sub(l)._unit()._perp():h,h=h||d;let n=h.add(d);0===n.x&&0===n.y||n._unit();const p=n.x*d.x+n.y*d.y,m=0!==p?1/p:1/0,_=h.x*d.y-h.y*d.x>0;let g="miter";const y=2;"miter"===g&&m>y&&(g="bevel"),"bevel"===g&&(m>100&&(g="flipbevel"),m<y&&(g="miter"));const v=(e,t,i,n)=>{const a=new Se(e.x,e.y),l=new Se(e.x,e.y);a.x+=t.x*n,a.y+=t.y*n,l.x-=t.x*Math.max(i,1),l.y-=t.y*Math.max(i,1),s.push(t),r.push(a),o.push(l)};if("miter"===g)n._mult(m),v(l,n,0,0);else if("flipbevel"===g)n=d.mult(-1),v(l,n,0,0),v(l,n.mult(-1),0,0);else{const e=-Math.sqrt(m*m-1),t=_?e:0,i=_?0:e;c&&v(l,h,t,i),u&&v(l,d,t,i)}}n.geometry=[...r,...o.reverse(),r[0]],n.joinNormals=[...s,...s.reverse(),s[s.length-1]];const p=n.geometry.length-1;for(let e=0;e<p/2;e++)if(e+1<p/2){let t=e,i=e+1,r=p-1-e,o=p-2-e;t=0===t?p-1:t-1,i=0===i?p-1:i-1,r=0===r?p-1:r-1,o=0===o?p-1:o-1,n.indices.push(r),n.indices.push(i),n.indices.push(t),n.indices.push(r),n.indices.push(o),n.indices.push(i)}return n}(i[0]),i=[y.geometry]}const v=(e,t)=>e<(t.length-1)/2||e===t.length-1,x=this.wallMode?[i]:qd(i,500);for(let e=x.length-1;e>=0;e--){const t=x[e];(0===t.length||(b=t[0]).every(e=>e.x<=0)||b.every(e=>e.x>=Vn)||b.every(e=>e.y<=0)||b.every(e=>e.y>=Vn))&&x.splice(e,1)}var b;let w;if(d)w=fp(x,u,r);else{w=[];for(const e of x)w.push({polygon:e,bounds:u})}const T=f?this.edgeRadius:0,S=T>0&&this.zoom<17,E=(e,t)=>{if(0===e.length)return!1;const i=e[e.length-1];return t.x===i.x&&t.y===i.y};for(const{polygon:e,bounds:t}of w){let i=0,n=0;for(const t of e)f&&!t[0].equals(t[t.length-1])&&t.push(t[0]),n+=f?t.length-1:t.length;const o=this.segments.prepareSegment((f?5:4)*n,this.layoutVertexArray,this.indexArray);m.footprintSegIdx<0&&(m.footprintSegIdx=this.footprintSegments.length),m.polygonSegIdx<0&&(m.polygonSegIdx=this.polygonSegments.length);const s={triangleArrayOffset:this.indexArray.length,triangleCount:0,triangleSegIdx:this.segments.segments.length-1},a=new Kf;if(a.vertexOffset=this.footprintVertices.length,a.indexOffset=3*this.footprintIndices.length,a.ringIndices=[],f){const n=[],s=[];i=o.vertexLength;for(let i=0;i<e.length;i++){const l=e[i];l.length&&0!==i&&s.push(n.length/2);const u=[];let f,p;f=l[1].sub(l[0])._perp()._unit(),a.ringIndices.push(l.length-1);for(let e=1;e<l.length;e++){const t=l[e],i=l[e===l.length-1?1:e+1],s=t.clone();if(T){p=i.sub(t)._perp()._unit();const e=f.add(p)._unit(),n=T*Math.min(4,1/(f.x*e.x+f.y*e.y));s.x+=n*e.x,s.y+=n*e.y,s.x=Math.round(s.x),s.y=Math.round(s.y),f=p}if(!_||0!==T&&!S||E(u,s)||u.push(s),Wf(this.layoutVertexArray,s.x,s.y,0,0,1,1,0),this.wallMode){const t=v(e,l);Zf(this.wallVertexArray,y.joinNormals[e],!t)}o.vertexLength++,this.footprintVertices.emplaceBack(t.x,t.y),n.push(t.x,t.y),d&&Yf(this.layoutVertexExtArray,h.projectTilePoint(s.x,s.y,r),h.upVector(r,s.x,s.y))}_&&(0===T||S)&&(0!==u.length&&E(u,u[0])&&u.pop(),this.groundEffect.addData(u,t,c))}const l=this.wallMode?y.indices:yd(n,s);for(let e=0;e<l.length;e+=3)this.footprintIndices.emplaceBack(a.vertexOffset+l[e+0],a.vertexOffset+l[e+1],a.vertexOffset+l[e+2]),this.indexArray.emplaceBack(i+l[e],i+l[e+2],i+l[e+1]),o.primitiveLength++;a.indexCount+=l.length,a.vertexCount+=this.footprintVertices.length-a.vertexOffset}for(let n=0;n<e.length;n++){const s=e[n];p.startRing(m,s[0]);let a=s.length>4&&up(s[s.length-2],s[0],s[1]),l=T?sp(s[s.length-2],s[0],s[1],T):0;const u=[];let g,x,b;x=s[1].sub(s[0])._perp()._unit();let w=!0;for(let e=1,n=0;e<s.length;e++){let c=s[e-1],f=s[e];const S=s[e===s.length-1?1:e+1];if(p.appendEdge(m,f,c),lp(f,c,t)){T&&(x=S.sub(f)._perp()._unit(),w=!w);continue}const I=f.sub(c)._perp(),A=I.x/(Math.abs(I.x)+Math.abs(I.y)),M=I.y>0?1:0,C=c.dist(f);if(n+C>32768&&(n=0),T){b=S.sub(f)._perp()._unit();
vendor: 9,333 bytes, line 2
2let e=ap(c,f,S,op(x,b),T);isNaN(e)&&(e=0);const t=f.sub(c)._unit();c=c.add(t.mult(l))._round(),f=f.add(t.mult(-e))._round(),l=e,x=b,_&&this.zoom>=17&&(E(u,c)||u.push(c),E(u,f)||u.push(f))}const P=o.vertexLength,D=s.length>4&&up(c,f,S);let R=hp(n,a,w);if(Wf(this.layoutVertexArray,c.x,c.y,A,M,0,0,R),Wf(this.layoutVertexArray,c.x,c.y,A,M,0,1,R),this.wallMode){const t=v(e-1,s),i=y.joinNormals[e-1];Zf(this.wallVertexArray,i,t),Zf(this.wallVertexArray,i,t)}if(n+=C,R=hp(n,D,!w),a=D,Wf(this.layoutVertexArray,f.x,f.y,A,M,0,0,R),Wf(this.layoutVertexArray,f.x,f.y,A,M,0,1,R),this.wallMode){const t=v(e,s),i=y.joinNormals[e];Zf(this.wallVertexArray,i,t),Zf(this.wallVertexArray,i,t)}if(o.vertexLength+=4,this.indexArray.emplaceBack(P+0,P+1,P+2),this.indexArray.emplaceBack(P+1,P+3,P+2),o.primitiveLength+=2,T){const n=i+(1===e?s.length-2:e-2),r=1===e?i:n+1;if(this.indexArray.emplaceBack(P+1,n,P+3),this.indexArray.emplaceBack(n,r,P+3),o.primitiveLength+=2,void 0===g&&(g=P),!lp(S,s[e],t)){const t=e===s.length-1?g:o.vertexLength;this.indexArray.emplaceBack(P+2,P+3,t),this.indexArray.emplaceBack(P+3,t+1,t),this.indexArray.emplaceBack(P+3,r,t+1),o.primitiveLength+=3}w=!w}if(d){const e=this.layoutVertexExtArray,t=h.projectTilePoint(c.x,c.y,r),i=h.projectTilePoint(f.x,f.y,r),n=h.upVector(r,c.x,c.y),o=h.upVector(r,f.x,f.y);Yf(e,t,n),Yf(e,t,n),Yf(e,i,o),Yf(e,i,o)}}f&&(i+=s.length-1),_&&T&&this.zoom>=17&&(0!==u.length&&E(u,u[0])&&u.pop(),this.groundEffect.addData(u,t,c,T>0))}this.footprintSegments.push(a),s.triangleCount=this.indexArray.length-s.triangleArrayOffset,this.polygonSegments.push(s),++m.footprintSegLen,++m.polygonSegLen}if(m.vertexCount=this.layoutVertexArray.length-m.vertexArrayOffset,m.groundVertexCount=this.groundEffect.vertexArray.length-m.groundVertexArrayOffset,0!==m.vertexCount){if(m.centroidXY=p.borders?Hf:this.encodeCentroid(p,m),this.centroidData.push(m),p.borders){this.featuresOnBorder.push(p);const e=this.featuresOnBorder.length-1;for(let t=0;t<p.borders.length;t++)p.borders[t][0]!==Number.MAX_VALUE&&this.borderFeatureIndices[t].push(e)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,o,s,r,l,void 0,this.worldview),this.groundEffect.addPaintPropertiesData(t,n,o,s,r,l,this.worldview),this.maxHeight=Math.max(this.maxHeight,g)}}sortBorders(){for(let e=0;e<this.borderFeatureIndices.length;e++)this.borderFeatureIndices[e].sort((t,i)=>this.featuresOnBorder[t].borders[e][0]-this.featuresOnBorder[i].borders[e][0])}splitToSubtiles(){const e=[];for(let t=0;t<this.centroidData.length;t++){const i=this.centroidData[t],n=+(i.min.y+i.max.y>Vn),r=2*n+(+(i.min.x+i.max.x>Vn)^n);for(let n=0;n<i.polygonSegLen;n++){const o=i.polygonSegIdx+n;e.push({centroidIdx:t,subtile:r,polygonSegmentIdx:o,triangleSegmentIdx:this.polygonSegments[o].triangleSegIdx})}}const t=new Al;e.sort((e,t)=>e.triangleSegmentIdx===t.triangleSegmentIdx?e.subtile-t.subtile:e.triangleSegmentIdx-t.triangleSegmentIdx);let i=0,n=0,r=0;for(const t of e){if(t.triangleSegmentIdx!==i)break;r++}const o=e.length;for(;n!==e.length;){i=e[n].triangleSegmentIdx;let s=0,a=n,l=n;for(let t=a;t<r&&e[t].subtile===s;t++)l++;for(;a!==r;){const n=e[a];s=n.subtile;const o=this.centroidData[n.centroidIdx].min.clone(),c=this.centroidData[n.centroidIdx].max.clone(),u={vertexOffset:this.segments.segments[i].vertexOffset,primitiveOffset:t.length,vertexLength:this.segments.segments[i].vertexLength,primitiveLength:0,sortKey:void 0,vaos:{}};for(let i=a;i<l;i++){const n=e[i],r=this.polygonSegments[n.polygonSegmentIdx],s=this.centroidData[n.centroidIdx].min,a=this.centroidData[n.centroidIdx].max,l=this.indexArray.uint16;for(let e=r.triangleArrayOffset;e<r.triangleArrayOffset+r.triangleCount;e++)t.emplaceBack(l[3*e],l[3*e+1],l[3*e+2]);u.primitiveLength+=r.triangleCount,o.x=Math.min(o.x,s.x),o.y=Math.min(o.y,s.y),c.x=Math.max(c.x,a.x),c.y=Math.max(c.y,a.y)}u.primitiveLength>0&&this.triangleSubSegments.push({segment:u,min:o,max:c}),a=l;for(let t=a;t<r&&e[t].subtile===e[a].subtile;t++)l++}n=r;for(let t=n;t<o&&e[t].triangleSegmentIdx===e[n].triangleSegmentIdx;t++)r++}t._trim(),this.indexArray=t}getVisibleSegments(e,t,i){const n=new rc;if(this.wallMode){for(const e of this.triangleSubSegments)n.segments.push(e.segment);return n}let r=0,o=0;const s=1<<e.canonical.z;if(t){const i=t.getMinMaxForTile(e);i&&(r=i.min,o=i.max)}o+=this.maxHeight;const a=e.toUnwrapped();let l;const c=[a.canonical.x/s+a.wrap,a.canonical.y/s],u=[(a.canonical.x+1)/s+a.wrap,(a.canonical.y+1)/s],h=(e,t,i)=>[e[0]*(1-i[0])+t[0]*i[0],e[1]*(1-i[1])+t[1]*i[1]],d=[],f=[];for(const e of this.triangleSubSegments){d[0]=e.min.x/Vn,d[1]=e.min.y/Vn,f[0]=e.max.x/Vn,f[1]=e.max.y/Vn;const t=h(c,u,d),s=h(c,u,f);if(0===new Vu([t[0],t[1],r],[s[0],s[1],o]).intersectsPrecise(i)){l&&(n.segments.push(l),l=void 0);continue}const a=e.segment;l&&l.vertexOffset!==a.vertexOffset&&(n.segments.push(l),l=void 0),l?(l.vertexLength+=a.vertexLength,l.primitiveLength+=a.primitiveLength):l={vertexOffset:a.vertexOffset,primitiveLength:a.primitiveLength,vertexLength:a.vertexLength,primitiveOffset:a.primitiveOffset,sortKey:void 0,vaos:{}}}return l&&n.segments.push(l),n}encodeCentroid(e,t){const i=e.centroid(),n=t.span(),r=Math.min(7,Math.round(n.x*this.tileToMeter/10)),o=Math.min(7,Math.round(n.y*this.tileToMeter/10));return new Se(ze(i.x,1,8191)<<3|r,ze(i.y,1,8191)<<3|o)}encodeBorderCentroid(e){if(!e.borders)return new Se(0,0);const t=e.borders,i=Number.MAX_VALUE;if(t[0][0]!==i||t[1][0]!==i){const e=t[0][0]!==i?0:1;return new Se(6|(t[0][0]!==i?0:65528),(t[e][0]+t[e][1])/2<<3|6)}{const e=t[2][0]!==i?2:3;return new Se((t[e][0]+t[e][1])/2<<3|6,6|(t[2][0]!==i?0:65528))}}showCentroid(e){const t=this.centroidData[e.centroidDataIndex];t.flags&=2147483647,t.centroidXY.x=0,t.centroidXY.y=0,this.writeCentroidToBuffer(t)}writeCentroidToBuffer(e){this.groundEffect.updateHiddenByLandmark(e);const t=e.vertexArrayOffset,i=e.vertexCount+e.vertexArrayOffset,n=e.flags&$f?Hf:e.centroidXY,r=this.centroidVertexArray.geta_centroid_pos0(t);if(this.centroidVertexArray.geta_centroid_pos1(t)!==n.y||r!==n.x){for(let e=t;e<i;++e)this.centroidVertexArray.emplace(e,n.x,n.y);this.needsCentroidUpdate=!0}}createCentroidsBuffer(){this.centroidVertexArray.resize(this.layoutVertexArray.length),this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length);for(const e of this.centroidData)this.writeCentroidToBuffer(e)}updateReplacement(e,t,i){if(t.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=t.updateTime;const n=t.getReplacementRegionsForTile(e.toUnwrapped());if(Df(this.activeReplacements,n))return;if(this.activeReplacements=n,0===this.centroidVertexArray.length)this.createCentroidsBuffer();else for(const e of this.centroidData)e.flags&=2147483647;const r=[];for(const t of this.activeReplacements){if(t.order<i)continue;const n=Math.max(1,Math.pow(2,t.footprintTileId.canonical.z-e.canonical.z));if(t.footprint.buildingIds)for(const e of this.centroidData)e.flags&$f||t.min.x>e.max.x||e.min.x>t.max.x||t.min.y>e.max.y||e.min.y>t.max.y||t.footprint.buildingIds.has(e.buildingId)&&(e.flags|=$f);else for(const i of this.centroidData)if(!(i.flags&$f||t.min.x>i.max.x||i.min.x>t.max.x||t.min.y>i.max.y||i.min.y>t.max.y))for(let o=0;o<i.footprintSegLen;o++){const s=this.footprintSegments[i.footprintSegIdx+o];if(r.length=0,pp(this.footprintVertices,s.vertexOffset,s.vertexCount,t.footprintTileId.canonical,e.canonical,r),zf(t.footprint,r,this.footprintIndices.uint16,s.indexOffset,s.indexCount,-s.vertexOffset,-n)){i.flags|=$f;break}}}for(const e of this.centroidData)this.writeCentroidToBuffer(e);this.borderDoneWithNeighborZ=[-1,-1,-1,-1]}footprintContainsPoint(e,t,i){let n=!1;for(let r=0;r<i.footprintSegLen;r++){const o=this.footprintSegments[i.footprintSegIdx+r];let s=0;for(const i of o.ringIndices){for(let r=s,a=i+s-1;r<i+s;a=r++){const i=this.footprintVertices.int16[2*(r+o.vertexOffset)+0],s=this.footprintVertices.int16[2*(r+o.vertexOffset)+1],l=this.footprintVertices.int16[2*(a+o.vertexOffset)+1];s>t!=l>t&&e<(this.footprintVertices.int16[2*(a+o.vertexOffset)+0]-i)*(t-s)/(l-s)+i&&(n=!n)}s=i}}return n}getHeightAtTileCoord(e,t){let i=Number.NEGATIVE_INFINITY,n=!0;const r=4*(e+Vn)*Vn+(t+Vn);if(this.partLookup.hasOwnProperty(r)){const e=this.partLookup[r];return e?{height:e.height,hidden:!!(e.flags&$f)}:void 0}for(const o of this.centroidData)e>o.max.x||o.min.x>e||t>o.max.y||o.min.y>t||o.height<=i||this.footprintContainsPoint(e,t,o)&&(i=o.height,this.partLookup[r]=o,n=!!(o.flags&$f));if(i!==Number.NEGATIVE_INFINITY)return{height:i,hidden:n};this.partLookup[r]=void 0}}function op(e,t){const i=e.add(t)._unit();return e.x*i.x+e.y*i.y}function sp(e,t,i,n){const r=t.sub(e)._perp()._unit(),o=i.sub(t)._perp()._unit();return ap(e,t,i,op(r,o),n)}function ap(e,t,i,n,r){const o=Math.sqrt(1-n*n);return Math.min(e.dist(t)/3,t.dist(i)/3,r*o/n)}function lp(e,t,i){return e.x<i[0].x&&t.x<i[0].x||e.x>i[1].x&&t.x>i[1].x||e.y<i[0].y&&t.y<i[0].y||e.y>i[1].y&&t.y>i[1].y}function cp(e,t){return e.x<t[0].x||e.x>t[1].x||e.y<t[0].y||e.y>t[1].y}function up(e,t,i){if(e.x<0||e.x>=Vn||t.x<0||t.x>=Vn||i.x<0||i.x>=Vn)return!1;const n=i.sub(t),r=n.perp(),o=e.sub(t);return(n.x*o.x+n.y*o.y)/Math.sqrt((n.x*n.x+n.y*n.y)*(o.x*o.x+o.y*o.y))>-.866&&r.x*o.x+r.y*o.y<0}function hp(e,t,i){const n=t?2|e:-3&e;return i?1|n:-2&n}
vendor: 4,158 bytes, line 2
2function dp(){const e=Math.PI/32,t=Math.tan(e),i=$c;return i*Math.sqrt(1+2*t*t)-i}function fp(e,t,i){const n=1<<i.z,r=eu(i.x/n),o=eu((i.x+1)/n),s=tu(i.y/n),a=tu((i.y+1)/n);return function(e,t,i,n,r=0,o){const s=[];if(!e.length||!i||!n)return s;const a=(e,t)=>{for(const i of e)s.push({polygon:i,bounds:t})},l=Math.ceil(Math.log2(i)),c=Math.ceil(Math.log2(n)),u=l-c,h=[];for(let e=0;e<Math.abs(u);e++)h.push(u>0?0:1);for(let e=0;e<Math.min(l,c);e++)h.push(0),h.push(1);let d=e;if(d=nf(d,t[0].y-r,t[1].y+r,1),d=nf(d,t[0].x-r,t[1].x+r,0),!d.length)return s;const f=[];for(h.length?f.push({polygons:d,bounds:t,depth:0}):a(d,t);f.length;){const e=f.pop(),t=e.depth,i=h[t],n=e.bounds[0],s=e.bounds[1],l=0===i?n.x:n.y,c=0===i?s.x:s.y,u=o?o(i,l,c):.5*(l+c),d=nf(e.polygons,l-r,u+r,i),p=nf(e.polygons,u-r,c+r,i);if(d.length){const e=[n,new Se(0===i?u:s.x,1===i?u:s.y)];h.length>t+1?f.push({polygons:d,bounds:e,depth:t+1}):a(d,e)}if(p.length){const e=[new Se(0===i?u:n.x,1===i?u:n.y),s];h.length>t+1?f.push({polygons:p,bounds:e,depth:t+1}):a(p,e)}}return s}(e,t,Math.ceil((o-r)/11.25),Math.ceil((s-a)/11.25),1,(e,t,r)=>{if(0===e)return.5*(t+r);{const e=tu((i.y+t/Vn)/n);return(Jc(.5*(tu((i.y+r/Vn)/n)+e))*n-i.y)*Vn}})}function pp(e,t,i,n,r,o){const s=Math.pow(2,n.z-r.z);for(let a=0;a<i;a++){let i=e.int16[2*(a+t)+0],l=e.int16[2*(a+t)+1];i=(i+r.x*Vn)*s-n.x*Vn,l=(l+r.y*Vn)*s-n.y*Vn,o.push(new Se(i,l))}}let mp,_p;Jo(rp,"FillExtrusionBucket",{omit:["layers","features"]}),Jo(Jf,"PartData"),Jo(Kf,"FootprintSegment"),Jo(Qf,"BorderCentroidData"),Jo(np,"GroundEffect");class gp extends Se{constructor(e,t,i){super(e,t),this.z=i}}class yp extends gp{constructor(e,t,i,n){super(e,t,i),this.w=n}}function vp(e,t,i,n){const r="x"===i?"y":"x",o=(n-e[i])/(t[i]-e[i]);e[r]=Math.round(e[r]+(t[r]-e[r])*o),e[i]=n,e.hasOwnProperty("z")&&(e.z=di(e.z,t.z,o)),e.hasOwnProperty("w")&&(e.w=di(e.w,t.w,o))}function xp(e,t,i,n){const r=i,o=n;for(const i of["x","y"]){let n=e,s=t;n[i]>=s[i]&&(n=t,s=e),n[i]<r&&s[i]>r&&vp(n,s,i,r),n[i]<o&&s[i]>o&&vp(s,n,i,o)}}function bp(e,t,i,n,r,o){const s=[];for(let a=0;a<e.length;a++){const l=e[a];let c;const u=s.length;let h=0;for(let e=0;e<l.length-1;e++){let u=l[e],d=l[e+1],f=0;const p=h;let m,_;o&&(f=Math.hypot(d.x-u.x,d.y-u.y),h+=f,m=u,_=d),u.x<t&&d.x<t||(u.x<t?u=new Se(t,u.y+(t-u.x)/(d.x-u.x)*(d.y-u.y))._round():d.x<t&&(d=new Se(t,u.y+(t-u.x)/(d.x-u.x)*(d.y-u.y))._round()),u.y<i&&d.y<i||(u.y<i?u=new Se(u.x+(i-u.y)/(d.y-u.y)*(d.x-u.x),i)._round():d.y<i&&(d=new Se(u.x+(i-u.y)/(d.y-u.y)*(d.x-u.x),i)._round()),u.x>=n&&d.x>=n||(u.x>=n?u=new Se(n,u.y+(n-u.x)/(d.x-u.x)*(d.y-u.y))._round():d.x>=n&&(d=new Se(n,u.y+(n-u.x)/(d.x-u.x)*(d.y-u.y))._round()),u.y>=r&&d.y>=r||(u.y>=r?u=new Se(u.x+(r-u.y)/(d.y-u.y)*(d.x-u.x),r)._round():d.y>=r&&(d=new Se(u.x+(r-u.y)/(d.y-u.y)*(d.x-u.x),r)._round()),c&&u.equals(c[c.length-1])||(c=[u],s.push(c),o&&o.push({progress:{min:p+Tp(m,_,u)*f,max:1},parentIndex:a,prevPoint:m,nextPoint:_})),c.push(d),o&&(o[o.length-1].progress.max=p+Tp(m,_,d)*f,o[o.length-1].nextPoint=_)))))}if(o&&h>0)for(let e=u;e<s.length;e++)o[e].progress.min/=h,o[e].progress.max/=h}return s}function wp(e,t,i,n,r){if(e.length<2)return void n.push(e);const o=[];for(;t.valid();){const[i,n]=t.get();for(let t=0;t<e.length-1;t++){const r=e[t],s=e[t+1],a=Qu(r,s,i,n);if(a){const[e]=a,i=new Se(di(r.x,s.x,e),di(r.y,s.y,e));o.push({t:t+e,distance:0,point:i})}}t.next()}if(0===o.length)return void n.push(e);o.sort((e,t)=>e.t-t.t);let s=0,a=0,l=[];for(n.push(l);s!==e.length;){if(a===o.length){for(;s!==e.length;)0!==l.length&&l[l.length-1].equals(e[s])||l.push(e[s]),s++;break}o[a].t<=s?(0!==l.length&&l[l.length-1].equals(o[a].point)||l.push(o[a].point),Math.trunc(o[a].t),a++):(0!==l.length&&l[l.length-1].equals(e[s])||l.push(e[s]),s++)}}function Tp(e,t,i){return e.x!==t.x?(i.x-e.x)/(t.x-e.x):e.y!==t.y?(i.y-e.y)/(t.y-e.y):0}function Sp(e,t){return e.x*t.x+e.y*t.y}function Ep(e,t){if(1===e.length){let i=0;const n=t[i++];let r;for(;!r||n.equals(r);)if(r=t[i++],!r)return 1/0;for(;i<t.length;i++){const o=t[i],s=e[0],a=r.sub(n),l=o.sub(n),c=s.sub(n),u=Sp(a,a),h=Sp(a,l),d=Sp(l,l),f=Sp(c,a),p=Sp(c,l),m=u*d-h*h,_=(d*f-h*p)/m,g=(u*p-h*f)/m,
2y=n.z*(1-_-g)+r.z*_+o.z*g;if(isFinite(y))return y}return 1/0}{let e=1/0;for(const i of t)e=Math.min(e,i.z);return e}}function Ip(e,t,i){let n=1/0;Zu(i,t)&&(n=Ep(i,t[0]));for(let r=0;r<t.length;r++){const o=t[r],s=e[r];for(let e=0;e<o.length-1;e++){const t=o[e],r=[t,o[e+1],s[e+1],s[e],t];$u(i,r)&&(n=Math.min(n,Ep(i,r)))}}return n!==1/0&&n}function Ap(e,t,i,n,r,o,s,a,l,c,u){return"globe"===e.projection.name?function(e,t,i,n,r,o,s,a,l,c,u){const h=[],d=[],f=e.projection.upVectorScale(u,e.center.lat,e.worldSize).metersToTile,p=[0,0,0,1],m=[0,0,0,1],_=(e,t,i,n)=>{e[0]=t,e[1]=i,e[2]=n,e[3]=1},g=dp();i>0&&(i+=g),n+=g;for(const g of t){const t=[],y=[];for(const h of g){const d=h.x+r.x,g=h.y+r.y,v=e.projection.projectTilePoint(d,g,u),x=e.projection.upVector(u,h.x,h.y);let b=i,w=n;if(s){const e=Mp(d,g,i,n,s,a,l,c);b+=e.base,w+=e.top}0!==i?_(p,v.x+x[0]*f*b,v.y+x[1]*f*b,v.z+x[2]*f*b):_(p,v.x,v.y,v.z),_(m,v.x+x[0]*f*w,v.y+x[1]*f*w,v.z+x[2]*f*w),j(p,p,o),j(m,m,o),t.push(new gp(p[0],p[1],p[2])),y.push(new gp(m[0],m[1],m[2]))}h.push(t),d.push(y)}return[h,d]}(e,t,i,n,r,o,s,a,l,c,u):s?function(e,t,i,n,r,o,s,a,l){const c=[],u=[],h=[0,0,0,1];for(const d of e){const e=[],f=[];for(const c of d){const u=c.x+n.x,d=c.y+n.y,p=Mp(u,d,t,i,o,s,a,l);h[0]=u,h[1]=d,h[2]=p.base,h[3]=1,Q(h,h,r),h[3]=Math.max(h[3],1e-5);const m=new gp(h[0]/h[3],h[1]/h[3],h[2]/h[3]);h[0]=u,h[1]=d,h[2]=p.top,h[3]=1,Q(h,h,r),h[3]=Math.max(h[3],1e-5);const _=new gp(h[0]/h[3],h[1]/h[3],h[2]/h[3]);e.push(m),f.push(_)}c.push(e),u.push(f)}return[c,u]}(t,i,n,r,o,s,a,l,c):function(e,t,i,n,r){const o=[],s=[],a=r[8]*t,l=r[9]*t,c=r[10]*t,u=r[11]*t,h=r[8]*i,d=r[9]*i,f=r[10]*i,p=r[11]*i;for(const t of e){const e=[],i=[];for(const o of t){const t=o.x+n.x,s=o.y+n.y,m=r[0]*t+r[4]*s+r[12],_=r[1]*t+r[5]*s+r[13],g=r[2]*t+r[6]*s+r[14],y=r[3]*t+r[7]*s+r[15],v=m+a,x=_+l,b=g+c,w=Math.max(y+u,1e-5),T=m+h,S=_+d,E=g+f,I=Math.max(y+p,1e-5);e.push(new gp(v/w,x/w,b/w)),i.push(new gp(T/I,S/I,E/I))}o.push(e),s.push(i)}return[o,s]}(t,i,n,r,o)}function Mp(e,t,i,n,r,o,s,a){const l=s*r.getElevationAt(e,t,!0,!0),c=0!==o[0],u=c?0===o[1]?s*(o[0]/7-450):s*function(e,t,i){const n=Math.floor(t[0]/8),r=Math.floor(t[1]/8),o=10*(t[0]-8*n),s=10*(t[1]-8*r),a=e.getElevationAt(n,r,!0,!0),l=e.getMeterToDEM(i),c=Math.floor(.5*(o*l-1)),u=Math.floor(.5*(s*l-1)),h=e.tileCoordToPixel(n,r),d=2*c+1,f=2*u+1,p=function(e,t,i,n,r){return[e.getElevationAtPixel(t,i,!0),e.getElevationAtPixel(t+r,i,!0),e.getElevationAtPixel(t,i+r,!0),e.getElevationAtPixel(t+n,i+r,!0)]}(e,h.x-c,h.y-u,d,f),m=Math.abs(p[0]-p[1]),_=Math.abs(p[2]-p[3]),g=Math.abs(p[0]-p[2])+Math.abs(p[1]-p[3]),y=Math.min(.25,.5*l*(m+_)/d),v=Math.min(.25,.5*l*g/f);return a+Math.max(y*o,v*s)}(r,o,a):l;return{base:l+(0===i?-1:i),top:c?Math.max(u+n,l+i+2):l+n}}class Cp{constructor(e){this._callback=e,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){this._channel=void 0,this._callback=()=>{}}}class Pp{constructor(){this.tasks={},this.taskQueue=[],Ue(["process"],this),this.invoker=new Cp(this.process),this.nextId=0}add(e,t){const i=this.nextId++,n=function({type:e,isSymbolTile:t,zoom:i}){return i=i||0,"message"===e?0:"maybePrepare"!==e||t?"parseTile"!==e||t?"parseTile"===e&&t?300-i:"maybePrepare"===e&&t?400-i:500:200-i:100-i}(t);if(0===n){try{e()}finally{}return null}return this.tasks[i]={fn:e,metadata:t,priority:n,id:i},this.taskQueue.push(i),this.invoker.trigger(),{cancel:()=>{delete this.tasks[i]}}}process(){try{if(this.taskQueue=this.taskQueue.filter(e=>!!this.tasks[e]),!this.taskQueue.length)return;const e=this.pick();if(null===e)return;const t=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),!t)return;t.fn()}finally{}}pick(){let e=null,t=1/0;for(let i=0;i<this.taskQueue.length;i++){const n=this.tasks[this.taskQueue[i]];n.priority<t&&(t=n.priority,e=i)}if(null===e)return null;const i=this.taskQueue[e];return this.taskQueue.splice(e,1),i}remove(){this.invoker.remove()}}class Dp{constructor(e,t,i){this.target=e,this.parent=t,this.mapId=i,this.callbacks={},this.cancelCallbacks={},Ue(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.scheduler
2=new Pp}send(e,t,i,n,r=!1,o){const s=Math.round(1e18*Math.random()).toString(36).substring(0,10);i&&(i.metadata=o,this.callbacks[s]=i);const a=new Set;return this.target.postMessage({id:s,type:e,hasCallback:!!i,targetMapId:n,mustQueue:r,sourceMapId:this.mapId,data:es(t,a)},a),{cancel:()=>{i&&delete this.callbacks[s],this.target.postMessage({id:s,type:"<cancel>",targetMapId:n,sourceMapId:this.mapId})}}}receive(e){const t=e.data;if(!t)return;const i=t.id;if(i&&(!t.targetMapId||this.mapId===t.targetMapId))if("<cancel>"===t.type){const e=this.cancelCallbacks[i];delete this.cancelCallbacks[i],e&&e.cancel()}else if(t.mustQueue||Ke(self)){const e=this.callbacks[i],n=this.scheduler.add(()=>this.processTask(i,t),e&&e.metadata||{type:"message"});n&&(this.cancelCallbacks[i]=n)}else this.processTask(i,t)}processTask(e,t){if(delete this.cancelCallbacks[e],"<response>"===t.type){const i=this.callbacks[e];delete this.callbacks[e],i&&(t.error?i(ts(t.error)):i(null,ts(t.data)))}else{const i=new Set,n=t.hasCallback?(t,n)=>{this.target.postMessage({id:e,type:"<response>",sourceMapId:this.mapId,error:t?es(t):null,data:es(n,i)},i)}:()=>{},r=ts(t.data);if(this.parent[t.type])this.parent[t.type](t.sourceMapId,r,n);else if(this.parent.getWorkerSource){const e=t.type.split("."),{source:i,scope:o}=r;this.parent.getWorkerSource(t.sourceMapId,e[0],i,o)[e[1]](r,n)}else n(new Error(`Could not find function ${t.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}}var Rp={workerUrl:"",workerClass:null,workerParams:void 0};const Lp="mapboxgl_preloaded_worker_pool";class zp{constructor(e){this.active={},this.name=e}acquire(e,t=zp.workerCount){if(!this.workers)for(this.workers=[];this.workers.length<t;){const t=(i=`${this.name||""}WorkerPool: ${e}-${this.workers.length}`,null!=Rp.workerClass?new Rp.workerClass:new self.Worker(Rp.workerUrl,Object.assign({name:i},Rp.workerParams)));this.workers.push(t)}var i;return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],this.workers&&0===this.numActive()&&(this.workers.forEach(e=>{e.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Lp]}numActive(){return Object.keys(this.active).length}}zp.workerCount=2;class Op{constructor(e,t,i="Worker",n=zp.workerCount){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=Ne();const r=this.workerPool.acquire(this.id,n);for(let e=0;e<r.length;e++){const n=new Op.Actor(r[e],t,this.id);n.name=`${i} ${e}`,this.actors.push(n)}this.ready=!1,this.broadcast("checkIfReady",null,()=>{this.ready=!0})}broadcast(e,t,i){ke(this.actors,(i,n)=>{i.send(e,t,n)},i=i||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(e=>{e.remove()}),this.actors=[],this.workerPool.release(this.id)}}let Fp,kp;function Bp(){return Fp||(Fp=new zp),Fp}Op.Actor=Dp;const Np=4096;class Vp{constructor(e){this.module=e,this.memoryStack=this.module.malloc(Np),this.memoryStackNextFree=this.memoryStack}createIntArray(e){const t=this.memoryStackNextFree;return this.memoryStackNextFree+=e.length*Int32Array.BYTES_PER_ELEMENT,this.memoryStackNextFree-this.memoryStack>Np?-1:(new Int32Array(this.module.heap32.buffer,t,e.length).set(e),t)}createFloatArray(e){const t=this.memoryStackNextFree;return this.memoryStackNextFree+=e.length*Float32Array.BYTES_PER_ELEMENT,this.memoryStackNextFree-this.memoryStack>Np?-1:(new Float32Array(this.module.heapF32.buffer,t,e.length).set(e),t)}readStringBuffer(e){let t="";for(;0!==this.module.heapU8[e];)t+=String.fromCharCode(this.module.heapU8[e]),++e;return t}setStyle(e){const t=e.normalScale;this.module.setStyle(t[0],t[1],t[2],e.tileToMeters)}setAOOptions(e,t){this.module.setAOOptions(e?1:0,t)}setMetricOptions(e,t){this.module.setMetricOptions(e?1:0,t)}setStructuralOptions(e){this.module.setStructuralOptions(e?1:0)}setFacadeOptions(e,t){this.module.setFacadeOptions(e,t?1:0)}setFauxFacadeOptions(e,t,i){this.module.setFauxFacadeOptions(e?1:0,t?1:0,i)}setFacadeClassifierOptions(e){this.module.setFacadeClassifierOptions(e)}generateMesh(e,t){this.memoryStackNextFree=this.memoryStack;for(const t of e){const e=this.createIntArray(t.ringIndices),i=this.createFloatArray(t.coordinates);if(-1===e||-1===i)return`building_gen: Out of stack memory: ${this.memoryStackNextFree-this.memoryStack}/4096`;this.module.addFeature(t.id,t.sourceId,t.minHeight,t.height,t.roofType,i,e,t.ringIndices.length-1)}for(const e of t){let t;t=e.entrances?JSON.parse(e.entrances):[];const i=this.createFloatArray(t),n=this.createFloatArray(e.coordinates);if(-1===i||-1===n)return`building_gen: Out of stack memory: ${this.memoryStackNextFree-this.memoryStack}/4096`;this.module.addFacade(e.sourceId,e.crossPerc,e.distanceToRoad,i,t.length,n,e.coordinates.length)}if(!this.module.generateMesh()){const e=this.module.getLastError();return this.readStringBuffer(e)}
2const i=this.module.getMeshCount(),n=new Array(i);for(let e=0;e<i;e++){const t=this.module.getPositionsPtr(e),i=this.module.getPositionsLength(e),r=new Float32Array(this.module.heapF32.buffer,t,i),o=this.module.getNormalsPtr(e),s=this.module.getNormalsLength(e),a=new Float32Array(this.module.heapF32.buffer,o,s),l=this.module.getAOPtr(e),c=this.module.getAOLength(e),u=new Float32Array(this.module.heapF32.buffer,l,c),h=this.module.getUVPtr(e),d=this.module.getUVLength(e),f=new Float32Array(this.module.heapF32.buffer,h,d),p=this.module.getFauxFacadePtr(e),m=this.module.getFauxFacadeLength(e),_=new Uint8Array(this.module.heapU8.buffer,p,m),g=this.module.getIndicesPtr(e),y=this.module.getIndicesLength(e),v=new Int16Array(this.module.heap16.buffer,g,y),x=this.module.getBuildingPart(e);n[e]={positions:r,normals:a,ao:u,uv:f,isFauxFacade:_,indices:v,buildingPart:x}}const r=this.module.getRingCount(),o=[];for(let e=0;e<r;e++){const t=this.module.getRingPtr(e),i=this.module.getRingLength(e),n=new Float32Array(this.module.heapF32.buffer,t,i);o.push(n)}return{meshes:n,outerRingLength:this.module.getOuterRingLength(),modifiedPolygonRings:o}}}let Up,jp,Gp,qp,Hp,$p=null,Wp=null,Zp=null,Xp=null;function Yp(){return Ke(self)&&self.worker.dracoUrl?self.worker.dracoUrl:jp||st.DRACO_URL}function Kp(){if(Ke(self)&&self.worker.meshoptUrl)return self.worker.meshoptUrl;if(qp)return qp;const e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]);if("object"!=typeof WebAssembly)throw new Error("WebAssembly not supported, cannot instantiate meshoptimizer");return qp=WebAssembly.validate(e)?st.MESHOPT_SIMD_URL:st.MESHOPT_URL,qp}const Jp={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Qp={5120:"DT_INT8",5121:"DT_UINT8",5122:"DT_INT16",5123:"DT_UINT16",5125:"DT_UINT32",5126:"DT_FLOAT32"},em={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};function tm(e,t,i){const n=i.json.bufferViews.length,r=i.buffers.length;t.bufferView=n,i.json.bufferViews[n]={buffer:r,byteLength:e.byteLength},i.buffers[r]=e}const im="KHR_draco_mesh_compression";function nm(e,t){const i=e.extensions&&e.extensions[im];if(!i)return;const n=new Gp.Decoder,r=um(t,i.bufferView),o=new Gp.Mesh;if(!n.DecodeArrayToMesh(r,r.byteLength,o))throw new Error("Failed to decode Draco mesh");const s=t.json.accessors[e.indices],a=Jp[s.componentType],l=s.count*a.BYTES_PER_ELEMENT,c=Gp._malloc(l);a===Uint16Array?n.GetTrianglesUInt16Array(o,l,c):n.GetTrianglesUInt32Array(o,l,c),tm(Gp.memory.buffer.slice(c,c+l),s,t),Gp._free(c);for(const r of Object.keys(i.attributes)){const s=n.GetAttributeByUniqueId(o,i.attributes[r]),a=t.json.accessors[e.attributes[r]],l=Qp[a.componentType],c=a.count*em[a.type]*Jp[a.componentType].BYTES_PER_ELEMENT,u=Gp._malloc(c);n.GetAttributeDataArrayForAllPoints(o,s,Gp[l],c,u),tm(Gp.memory.buffer.slice(u,u+c),a,t),Gp._free(u)}n.destroy(),o.destroy(),delete e.extensions[im]}const rm="EXT_meshopt_compression";function om(e,t){if(!e.extensions||!e.extensions[rm])return;const i=e.extensions[rm],n=new Uint8Array(t.buffers[i.buffer],i.byteOffset||0,i.byteLength||0),r=new Uint8Array(i.count*i.byteStride);Hp.decodeGltfBuffer(r,i.count,i.byteStride,n,i.mode,i.filter),e.buffer=t.buffers.length,e.byteOffset=0,t.buffers[e.buffer]=r.buffer,delete e.extensions[rm]}const sm=1179937895,am=new TextDecoder("utf8");function lm(e,t){return new URL(e,t).href}function cm(e,t,i,n){return fetch(lm(e.uri,n)).then(e=>e.arrayBuffer()).then(e=>{t.buffers[i]=e})}function um(e,t){const i=e.json.bufferViews[t];return new Uint8Array(e.buffers[i.buffer],i.byteOffset||0,i.byteLength)}function hm(e,t,i,n){if(e.uri){const r=lm(e.uri,n);return fetch(r).then(e=>e.blob()).then(e=>createImageBitmap(e)).then(e=>{t.images[i]=e})}if(void 0!==e.bufferView){const n=um(t,e.bufferView),r=new Blob([n],{type:e.mimeType});return createImageBitmap(r).then(e=>{t.images[i]=e})}}function dm(e,t=0,i){const n={json:null,images:[],buffers:[]};if(new Uint32Array(e,t,1)[0]===sm){const i=new Uint32Array(e,t);let r=2;const o=(i[r++]>>2)-3,s=i[r++]>>2;if(r++,n.json=JSON.parse(am.decode(i.subarray(r,r+s))),r+=s,r<o){const o=i[r++];r++;const s=t+(r<<2);n.buffers[0]=e.slice(s,s+o)}}else n.json=JSON.parse(am.decode(new Uint8Array(e,t)));const{buffers:r,images:o,meshes:s,extensionsUsed:a,bufferViews:l}=n.json;let c=Promise.resolve();if(r){const e=[];for(let t=0;t<r.length;t++){const o=r[t];o.uri?e.push(cm(o,n,t,i)):n.buffers[t]||(n.buffers[t]=null)}c=Promise.all(e)}return c.then(()=>{const e=[],t=a&&a.includes(im),r=a&&a.includes(rm);if(t&&e.push(function(){if(!Gp)return null!=Up?Up:(Up=function(e){let t,i=null;function n(){t=new Uint8Array(i.buffer)}function r(){throw new Error("Unexpected Draco error.")}const o={a:{a:r,d:function(e,i,n){return t.copyWithin(e,i,i+n)},c:function(e){const r=t.length,o=Math.max(e>>>0,Math.ceil(1.2*r)),s=Math.ceil((o-r)/65536);try{return i.grow(s),n(),!0}catch(e){return!1}},b:r}};return(WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(e,o):e.then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,o))).then(e=>{const{Rb:r,Qb:o,P:s,T:a,X:l,Ja:c,La:u,Qa:h,Va:d,Wa:f,eb:p,jb:m,f:_,e:g,yb:y,zb:v,Ab:x,Bb:b,Db:w,Gb:T}=e.instance.exports;i=g;const S=(()=>{let e=0,i=0,n=0,s=0;return a=>{n&&(r(s),r(e),i+=n,n=e=0),e||(i+=128,e=o(i));const l=a.length+7&-8;let c=e;l>=i&&(n=l,c=s=o(l));for(let e=0;e<a.length;e++)t[c+e]=a[e];return c}})();return n(),_(),{memory:g,_free:r,_malloc:o,Mesh:class{constructor(){this.ptr=s()}destroy(){a(this.ptr)}},Decoder:class{constructor(){this.ptr=c()}destroy(){m(this.ptr)}DecodeArrayToMesh(e,t,i){const n=S(e),r=u(this.ptr,n,t,i.ptr);return!!l(r)}GetAttributeByUniqueId(e,t){return{ptr:h(this.ptr,e.ptr,t)}}GetTrianglesUInt16Array(e,t,i){d(this.ptr,e.ptr,t,i)}GetTrianglesUInt32Array(e,t,i){f(this.ptr,e.ptr,t,i)}GetAttributeDataArrayForAllPoints(e,t,i,n,r){p(this.ptr,e.ptr,t.ptr,i,n,r)}},DT_INT8:y(),DT_UINT8:v(),DT_INT16:x(),DT_UINT16:b(),DT_UINT32:w(),DT_FLOAT32:T()}})}(fetch(Yp())),Up.then(e=>{Gp=e,Up=void 0}))}()),r&&e.push(function(){if(Hp)return;const e=function(e){let t;const i=WebAssembly.instantiateStreaming(e,{}).then(e=>{t=e.instance,t.exports.__wasm_call_ctors()}),n={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},r={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return{ready:i,supported:!0,decodeGltfBuffer(e,i,o,s,a,l){!function(e,t,i,n,r,o,s){const a=e.exports.sbrk,l=n+3&-4,c=a(l*r),u=a(o.length),h=new Uint8Array(e.exports.memory.buffer);h.set(o,u);const d=t(c,n,r,u,o.length);if(0===d&&s&&s(c,l,r),i.set(h.subarray(c,c+n*r)),a(c-a(0)),0!==d)throw new Error(`Malformed buffer data: ${d}`)}(t,t.exports[r[a]],e,i,o,s,t.exports[n[l]])}}}(fetch(Kp()));return e.ready.then(()=>{Hp=e})}()),o)for(let t=0;t<o.length;t++)e.push(hm(o[t],n,t,i));return(e.length?Promise.all(e):Promise.resolve()).then(()=>
vendor: 7,035 bytes, line 2
2{if(t&&s)for(const{primitives:e}of s)for(const t of e)nm(t,n);if(r&&s&&l)for(const e of l)om(e,n);return n})})}function fm(e){return fetch(e).then(e=>e.arrayBuffer()).then(t=>dm(t,0,e))}function pm(e){switch(e){case WebGL2RenderingContext.RGBA8:return WebGL2RenderingContext.RGBA;case WebGL2RenderingContext.DEPTH_COMPONENT16:return WebGL2RenderingContext.DEPTH_COMPONENT;case WebGL2RenderingContext.DEPTH24_STENCIL8:return WebGL2RenderingContext.DEPTH_STENCIL;case WebGL2RenderingContext.R8:case WebGL2RenderingContext.R32F:return WebGL2RenderingContext.RED}}function mm(e){switch(e){case WebGL2RenderingContext.RGBA8:return WebGL2RenderingContext.UNSIGNED_BYTE;case WebGL2RenderingContext.DEPTH_COMPONENT16:return WebGL2RenderingContext.UNSIGNED_SHORT;case WebGL2RenderingContext.DEPTH24_STENCIL8:return WebGL2RenderingContext.UNSIGNED_INT_24_8;case WebGL2RenderingContext.R8:return WebGL2RenderingContext.UNSIGNED_BYTE;case WebGL2RenderingContext.R32F:return WebGL2RenderingContext.FLOAT}}class _m{constructor(e,t,i,n){this.context=e,this.format=i,this.useMipmap=n&&n.useMipmap,this.texture=e.gl.createTexture(),this.update(t,{premultiply:n&&n.premultiply})}update(e,t){const i=e&&e instanceof HTMLVideoElement&&0===e.width?e.videoWidth:e.width,n=e&&e instanceof HTMLVideoElement&&0===e.height?e.videoHeight:e.height,{context:r}=this,{gl:o}=r,{x:s,y:a}=t&&t.position?t.position:{x:0,y:0},l=s+i,c=a+n;!this.size||this.size[0]===l&&this.size[1]===c||(o.bindTexture(o.TEXTURE_2D,null),o.deleteTexture(this.texture),this.texture=o.createTexture(),this.size=null),o.bindTexture(o.TEXTURE_2D,this.texture),r.pixelStoreUnpackFlipY.set(!1),r.pixelStoreUnpack.set(1),r.pixelStoreUnpackPremultiplyAlpha.set(this.format===o.RGBA8&&(!t||!1!==t.premultiply));const u=e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||ImageBitmap&&e instanceof ImageBitmap;if(!this.size&&l>0&&c>0){const e=this.useMipmap?Math.floor(Math.log2(Math.max(l,c)))+1:1;o.texStorage2D(o.TEXTURE_2D,e,this.format,l,c),this.size=[l,c]}this.size&&(u?o.texSubImage2D(o.TEXTURE_2D,0,s,a,pm(this.format),mm(this.format),e):"data"in e&&e.data&&o.texSubImage2D(o.TEXTURE_2D,0,s,a,i,n,pm(this.format),mm(this.format),e.data)),this.useMipmap&&o.generateMipmap(o.TEXTURE_2D)}bind(e,t,i=!1){const{context:n}=this,{gl:r}=n;r.bindTexture(r.TEXTURE_2D,this.texture),e!==this.minFilter&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,e),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,this.useMipmap&&!i?e===r.NEAREST?r.NEAREST_MIPMAP_NEAREST:r.LINEAR_MIPMAP_LINEAR:e),this.minFilter=e),t!==this.wrapS&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,t),this.wrapS=t)}bindExtraParam(e,t,i,n,r){const{context:o}=this,{gl:s}=o;s.bindTexture(s.TEXTURE_2D,this.texture),t!==this.magFilter&&(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,t),this.magFilter=t),e!==this.minFilter&&(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,this.useMipmap?e===s.NEAREST?s.NEAREST_MIPMAP_NEAREST:s.LINEAR_MIPMAP_LINEAR:e),this.minFilter=e),i!==this.wrapS&&(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,i),this.wrapS=i),n!==this.wrapT&&(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,n),this.wrapT=n),r!==this.compareMode&&(r?(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_COMPARE_MODE,s.COMPARE_REF_TO_TEXTURE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_COMPARE_FUNC,r)):s.texParameteri(s.TEXTURE_2D,s.TEXTURE_COMPARE_MODE,s.NONE),this.compareMode=r)}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}class gm{constructor(e,t){this.context=e,this.texture=t}bind(e,t){const{context:i}=this,{gl:n}=i;n.bindTexture(n.TEXTURE_2D,this.texture),e!==this.minFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,e),this.minFilter=e),t!==this.wrapS&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,t),this.wrapS=t)}}const ym=rl([{name:"a_pos_3f",components:3,type:"Float32"}]),vm=rl([{name:"a_color_3f",components:3,type:"Float32"}]),xm=rl([{name:"a_color_4f",components:4,type:"Float32"}]),bm=rl([{name:"a_uv_2f",components:2,type:"Float32"}]),wm=rl([{name:"a_normal_3f",components:3,type:"Float32"}]),Tm=rl([{name:"a_normal_matrix0",components:4,type:"Float32"},{name:"a_normal_matrix1",components:4,type:"Float32"},{name:"a_normal_matrix2",components:4,type:"Float32"},{name:"a_normal_matrix3",components:4,type:"Float32"}]),Sm=rl([{name:"a_pbr",components:4,type:"Uint16"},{name:"a_heightBasedEmissiveStrength",components:3,type:"Float32"}]);function Em(e,t){const i=Am(e.projection,e.zoom,e.width,e.height),n=function(e,t,i,n,r){const o=new Zc(i.lng-180*Mm,i.lat),s=new Zc(i.lng+180*Mm,i.lat),a=e.project(o.lng,o.lat),l=e.project(s.lng,s.lat),u=-Math.atan2(l.y-a.y,l.x-a.x),d=lu.fromLngLat(i);d.y=ze(d.y,-1+Mm,1-Mm);const p=d.toLngLat(),m=e.project(p.lng,p.lat),g=lu.fromLngLat(p);g.x+=Mm;const y=g.toLngLat(),v=e.project(y.lng,y.lat),x=Pm(v.x-m.x,v.y-m.y,u),b=lu.fromLngLat(p);b.y+=Mm;const w=b.toLngLat(),T=e.project(w.lng,w.lat),S=Pm(T.x-m.x,T.y-m.y,u),E=Math.abs(x.x)/Math.abs(S.y),I=c([]);_(I,I,-u*(1-(r?0:n)));const A=c([]);return f(A,A,[1,1-(1-E)*n,1]),A[4]=-S.x/S.y*n,_(A,A,u),h(A,I,A),A}(e.projection,0,e.center,i,t),r=Im(e);return f(n,n,[r,r,1]),n}function Im(e){const t=e.projection,i=Am(e.projection,e.zoom,e.width,e.height),n=Cm(t,e.center),r=Cm(t,Zc.convert(t.center));return Math.pow(2,n*i+(1-i)*r)}function Am(e,t,i,n,r=1/0){const o=e.range;if(!o)return 0;const s=Math.min(r,Math.max(i,n)),a=Math.log2(s/1024);return Oe(o[0]+a,o[1]+a,t)}const Mm=1/4e4;function Cm(e,t){const i=ze(t.lat,-nu,nu),n=new Zc(t.lng-180*Mm,i),r=new Zc(t.lng+180*Mm,i),o=e.project(n.lng,i),s=e.project(r.lng,i),a=lu.fromLngLat(n),l=lu.fromLngLat(r),c=s.x-o.x,u=s.y-o.y,h=l.x-a.x,d=l.y-a.y,f=Math.sqrt((h*h+d*d)/(c*c+u*u));return Math.log2(f)}function Pm(e,t,i){const n=Math.cos(i),r=Math.sin(i);return{x:e*n-t*r,y:e*r+t*n}}function Dm(e,t,i){c(e),_(e,e,Me(t[2])),p(e,e,Me(t[0])),m(e,e,Me(t[1])),f(e,e,i),h(e,e,[1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1])}function Rm(e,t,i,n,r,o,s,a){const l=[i[0]-t[0],i[1]-t[1],0],c=[n[0]-t[0],n[1]-t[1],0];if(S(l)<1e-12||S(c)<1e-12)return te(e);const u=V([],l,c);B(u,u),M(c,n,t),l[2]=(o-r)*a,c[2]=(s-r)*a;const h=l;return V(h,l,c),B(h,h),le(e,u,h)}function Lm(e,t,i=!1){const n=Gh(t.zoom),r=function(e,t,i){const n=t.worldSize,r=[e[12],e[13],e[14]],o=tu(r[1]/n),s=eu(r[0]/n),a=c([]),l=Qc(1,o)*n,u=Qc(1,0)*n*ou(o,t.zoom),p=1/Vh(n);let m=u*p;if(i){const e=Am(t.projection,t.zoom,t.width,t.height,1024);m=p*t.projection.pixelSpaceConversion(t.center.lat,n,e)}const _=Hc(o,s);A(_,_,R([],B([],_),l*m*r[2]));const g=function(e){const t=[e[0],e[1],e[2]];let i=[0,1,0];const n=V([],i,t);return V(i,t,n),0===F(i)&&(i=[0,1,0],V(n,t,i)),B(n,n),B(i,i),B(t,t),[n[0],n[1],n[2],0,i[0],i[1],i[2],0,t[0],t[1],t[2],0,e[0],e[1],e[2],1]}(_);f(a,a,[m,m,m*l]),d(a,a,[-r[0],-r[1],-r[2]]);const y=h([],t.globeMatrix,g);return h(y,y,a),h(y,y,e),y}(e,t,i);if(n>
vendor: 1,818 bytes, line 2
20){const i=function(e,t){const i=t.worldSize,n=Qc(1,0)*i*ou(t.center.lat,t.zoom)/Vh(i),r=Qc(1,t.center.lat)*i,o=c([]);m(o,o,Me(t.center.lng)),p(o,o,Me(t.center.lat)),d(o,o,[0,0,Nc]),f(o,o,[n,n,n*r]);const s=t.point;return d(o,o,[-s.x,-s.y,0]),h(o,o,e),h(o,t.globeMatrix,o)}(e,t);return function(e,t,i){const n=(e,t,i)=>{const n=S(e),r=S(t),o=Ph(e,t,i);return R(o,o,1/S(o)*di(n,r,i))},r=n([e[0],e[1],e[2]],[t[0],t[1],t[2]],i),o=n([e[4],e[5],e[6]],[t[4],t[5],t[6]],i),s=n([e[8],e[9],e[10]],[t[8],t[9],t[10]],i),a=Ph([e[12],e[13],e[14]],[t[12],t[13],t[14]],i);return[r[0],r[1],r[2],0,o[0],o[1],o[2],0,s[0],s[1],s[2],0,a[0],a[1],a[2],1]}(r,i,n)}return r}function zm(e,t,i,n){const r=Vu.projectAabbCorners(n,i);let o=Number.MAX_VALUE;for(let e=0;e<r.length;++e){const i=r[e];i[0]=(.5*i[0]+.5)*t.width,i[1]=(.5-.5*i[1])*t.height,i[2]<o&&(o=i[2])}const s=function(e){const t=[];let i=0;for(let t=1;t<e.length;t++)(e[t][0]<e[i][0]||e[t][0]===e[i][0]&&e[t][1]<e[i][1])&&(i=t);let n,r=i;const o=new Uint8Array(e.length);do{if(o[r])break;t.push(new Se(e[r][0],e[r][1])),o[r]=1,n=(r+1)%e.length;for(let t=0;t<e.length;t++){if(e[t][0]===e[n][0]&&e[t][1]===e[n][1]||e[t][0]===e[r][0]&&e[t][1]===e[r][1])continue;const i=[e[t][0]-e[r][0],e[t][1]-e[r][1]],o=[e[n][0]-e[r][0],e[n][1]-e[r][1]],s=i[0]*o[1]-i[1]*o[0];(s>0||0===s&&i[0]*o[0]+i[1]*o[1]>=0&&i[0]*i[0]+i[1]*i[1]>o[0]*o[0]+o[1]*o[1])&&(n=t)}r=n}while(r!==i);return t.length>0&&t.push(t[0]),t}(r);if($u(e,s))return o}const Om=64,Fm={CoordinateSpaceTile:1,HasMapboxMeshFeatures:4,HasMeshoptCompression:8};function km(e,t,i,n,r,o,s,a,l,u=!1){const p=i.zoom,m=i.project(n),_=ou(n.lat,p),g=1/_;c(e),d(e,e,[m.x+s[0]*g,m.y+s[1]*g,s[2]]);let y=1,v=1;const b=i.worldSize;if(u){if("mercator"===i.projection.name){let e=0;i.elevation&&(e=i.elevation.getAtPointOrZero(new lu(m.x/b,m.y/b),
vendor: 1,735 bytes, line 2
20));const t=Q([],[m.x,m.y,e,1],i.projMatrix)[3]/i.cameraToCenterDistance;y=t,v=t*ou(i.center.lat,p)}else if("globe"===i.projection.name){const t=Lm(e,i),r=[0,0,0,1];Q(r,r,h([],i.projMatrix,t));const o=r[3]/i.cameraToCenterDistance,s=Gh(p),a=i.projection.pixelsPerMeter(n.lat,b)*ou(n.lat,p),l=i.projection.pixelsPerMeter(i.center.lat,b)*ou(i.center.lat,p);y=o/di(a,ru(i.center.lat),s),v=o*_/a,y*=l,v*=l}}else y=g;f(e,e,[y,y,v]);const w=[...e],T=t.orientation,S=[];if(Dm(S,[T[0]+(r?r[0]:0),T[1]+(r?r[1]:0),T[2]+(r?r[2]:0)],o),h(e,w,S),a&&i.elevation){let r=0;const o=[];if(l&&i.elevation){r=function(e,t,i,n,r){const o=t.elevation;if(!o)return 0;const s=Vu.projectAabbCorners(i,n),a=Qc(1,r.lat)*t.worldSize,l=function(e,t){const i=[0,0,1],n=[{corners:[0,1,3,2],dotProductWithUp:0},{corners:[1,5,2,6],dotProductWithUp:0},{corners:[0,4,1,5],dotProductWithUp:0},{corners:[2,6,3,7],dotProductWithUp:0},{corners:[4,7,5,6],dotProductWithUp:0},{corners:[0,3,4,7],dotProductWithUp:0}];for(const r of n){const n=e[r.corners[0]],o=e[r.corners[1]],s=e[r.corners[2]],a=[o[0]-n[0],o[1]-n[1],t*(o[2]-n[2])],l=V(a,a,[s[0]-n[0],s[1]-n[1],t*(s[2]-n[2])]);B(l,l),r.dotProductWithUp=N(l,i)}return n.sort((e,t)=>e.dotProductWithUp-t.dotProductWithUp),n[0].corners}(s,a),c=s[l[0]],u=s[l[1]],h=s[l[2]],d=s[l[3]],f=o.getAtPointOrZero(new lu(c[0]/t.worldSize,c[1]/t.worldSize),0),p=o.getAtPointOrZero(new lu(u[0]/t.worldSize,u[1]/t.worldSize),0),m=o.getAtPointOrZero(new lu(h[0]/t.worldSize,h[1]/t.worldSize),0),_=o.getAtPointOrZero(new lu(d[0]/t.worldSize,d[1]/t.worldSize),0),g=(f+_)/2,y=(p+m)/2;return g>y?p<m?Rm(e,u,d,c,p,_,f,a):Rm(e,h,c,d,m,f,_,a):f<_?Rm(e,c,u,h,f,p,m,a):Rm(e,d,h,u,_,m,p,a),Math.max(g,y)}(o,i,t.aabb,e,n);const s=h([],x([],o),S);h(e,w,s)}
2else r=i.elevation.getAtPointOrZero(new lu(m.x/b,m.y/b),0);0!==r&&(e[14]+=r)}}class Bm{constructor(e,t,i,n,r){this.materialOverrides=new Map,this.nodeOverrides=new Map,this.materialOverrideNames=[],this.nodeOverrideNames=[],this.featureProperties={},this.id=e,this.uri=t,this.position=null!=i?new Zc(i[0],i[1]):new Zc(0,0),this.orientation=null!=n?n:[0,0,0],this.nodes=r,this.uploaded=!1,this.aabb=new Vu([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),this.matrix=[]}_applyTransformations(e,t){h(e.globalMatrix,t,e.localMatrix);const i=this.nodeOverrides.get(e.name);if(void 0!==i){const t=[];r=i.orientation,c(n=t),m(n,n,Me(r[1])),_(n,n,Me(r[2])),p(n,n,Me(r[0])),h(e.globalMatrix,e.globalMatrix,t)}var n,r;if(e.meshes)for(const t of e.meshes){const i=Vu.applyTransformFast(t.aabb,e.globalMatrix);this.aabb.encapsulate(i)}if(e.children)for(const t of e.children)this._applyTransformations(t,e.globalMatrix)}computeBoundsAndApplyParent(){const e=c([]);this.aabb=new Vu([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);for(const t of this.nodes)this._applyTransformations(t,e)}computeModelMatrix(e,t,i,n,r,o,s=!1){km(this.matrix,this,e.transform,this.position,t,i,n,r,o,s)}upload(e){if(!this.uploaded){for(const t of this.nodes)Um(t,e);for(const e of this.nodes)jm(e);this.uploaded=!0}}destroy(){for(const e of this.nodes)Gm(e)}}function Nm(e,t,i=!1){e.uploaded||(e.gfxTexture=new _m(t,e.image,i?t.gl.R8:t.gl.RGBA8,{useMipmap:e.sampler.minFilter>=t.gl.NEAREST_MIPMAP_NEAREST}),e.uploaded=!0,e.image=null)}function Vm(e,t,i){e.indexBuffer=t.createIndexBuffer(e.indexArray,!1,!0),e.vertexBuffer=t.createVertexBuffer(e.vertexArray,ym.members,!1,!0),e.normalArray&&(e.normalBuffer=t.createVertexBuffer(e.normalArray,wm.members,!1,!0)),e.texcoordArray&&(e.texcoordBuffer=t.createVertexBuffer(e.texcoordArray,bm.members,!1,!0)),e.colorArray&&(e.colorBuffer=t.createVertexBuffer(e.colorArray,(12===e.colorArray.bytesPerElement?vm:xm).members,!1,!0)),e.featureArray&&(e.pbrBuffer=t.createVertexBuffer(e.featureArray,Sm.members,!0)),e.segments=rc.simpleSegment(0,0,e.vertexArray.length,e.indexArray.length);const n=e.material;n.pbrMetallicRoughness.baseColorTexture&&Nm(n.pbrMetallicRoughness.baseColorTexture,t),n.pbrMetallicRoughness.metallicRoughnessTexture&&Nm(n.pbrMetallicRoughness.metallicRoughnessTexture,t),n.normalTexture&&Nm(n.normalTexture,t),n.occlusionTexture&&Nm(n.occlusionTexture,t,i),n.emissionTexture&&Nm(n.emissionTexture,t)}function Um(e,t,i){if(e.meshes)for(const n of e.meshes)Vm(n,t,i);if(e.children)for(const n of e.children)Um(n,t,i)}function jm(e){if(e.meshes)for(const t of e.meshes)t.indexArray.destroy(),t.vertexArray.destroy(),t.colorArray&&t.colorArray.destroy(),t.normalArray&&t.normalArray.destroy(),t.texcoordArray&&t.texcoordArray.destroy(),t.featureArray&&t.featureArray.destroy();if(e.children)for(const t of e.children)jm(t)}function Gm(e){if(e.meshes)for(const i of e.meshes)i.vertexBuffer&&(i.vertexBuffer.destroy(),i.indexBuffer.destroy(),i.normalBuffer&&i.normalBuffer.destroy(),i.texcoordBuffer&&i.texcoordBuffer.destroy(),i.colorBuffer&&i.colorBuffer.destroy(),i.pbrBuffer&&i.pbrBuffer.destroy(),i.segments.destroy(),i.material&&((t=i.material).pbrMetallicRoughness.baseColorTexture&&t.pbrMetallicRoughness.baseColorTexture.gfxTexture&&t.pbrMetallicRoughness.baseColorTexture.gfxTexture.destroy(),t.pbrMetallicRoughness.metallicRoughnessTexture&&t.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture&&t.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture.destroy(),t.normalTexture&&t.normalTexture.gfxTexture&&t.normalTexture.gfxTexture.destroy(),t.emissionTexture&&t.emissionTexture.gfxTexture&&t.emissionTexture.gfxTexture.destroy(),t.occlusionTexture&&t.occlusionTexture.gfxTexture&&t.occlusionTexture.gfxTexture.destroy()));var t;if(e.children)for(const t of e.children)Gm(t)}function qm(e,t){const i=e.json.bufferViews[t.bufferView],n=Jp[t.componentType];return new n(e.buffers[i.buffer],(t.byteOffset||0)+(i.byteOffset||0),t.count*(i.byteStride&&i.byteStride!==em[t.type]*n.BYTES_PER_ELEMENT?i.byteStride/n.BYTES_PER_ELEMENT:em[t.type]))}function Hm(e,t,i,n){const r=Jp[t.componentType],o=function(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:return 1}}(r),s=e.json.bufferViews[t.bufferView],a=s.byteStride?s.byteStride/r.BYTES_PER_ELEMENT:em[t.type],l=i.float32,c=l.length/i.capacity;for(let e=0,i=0;e<t.count*a;e+=a,i+=c)for(let t=0;t<c;t++)l[i+t]=n[e+t]*o;i._trim()}function $m(e,t,i){const n=e.indices,r=e.attributes,o={};o.indexArray=new Al;const s=t.json.accessors[n],a=s.count/3;o.indexArray.reserve(a);const l=qm(t,s);for(let e=0;e<a;e++)o.indexArray.emplaceBack(l[3*e],l[3*e+1],l[3*e+2]);o.indexArray._trim(),o.vertexArray=new pl;const c=t.json.accessors[r.POSITION];o.vertexArray.reserve(c.count);const u=qm(t,c);for(let e=0;e<c.count;e++)o.vertexArray.emplaceBack(u[3*e],u[3*e+1],u[3*e+2]);if(o.vertexArray._trim(),o.aabb=new Vu(c.min,c.max),o.centroid=function(e,t){const i=[0,0,0],n=e.length;if(n>0){for(let r=0;r<n;r++){const n=3*e[r];i[0]+=t[n],i[1]+=t[n+1],i[2]+=t[n+2]}i[0]/=n,i[1]/=n,i[2]/=n}return i}(l,u),void 0!==r.COLOR_0){const e=t.json.accessors[r.COLOR_0],i=em[e.type],n=qm
vendor: 4,409 bytes, line 2
2(t,e);o.colorArray=3===i?new pl:new xl,o.colorArray.resize(e.count),Hm(t,e,o.colorArray,n)}if(void 0!==r.NORMAL){o.normalArray=new pl;const e=t.json.accessors[r.NORMAL];o.normalArray.resize(e.count);const i=qm(t,e);Hm(t,e,o.normalArray,i)}if(void 0!==r.TEXCOORD_0&&i.length>0){o.texcoordArray=new Ol;const e=t.json.accessors[r.TEXCOORD_0];o.texcoordArray.resize(e.count);const i=qm(t,e);Hm(t,e,o.texcoordArray,i)}if(void 0!==r._FEATURE_ID_RGBA4444){const e=t.json.accessors[r._FEATURE_ID_RGBA4444];t.json.extensionsUsed&&t.json.extensionsUsed.includes("EXT_meshopt_compression")&&(o.featureData=qm(t,e))}void 0!==r._FEATURE_RGBA4444&&(o.featureData=new Uint32Array(qm(t,t.json.accessors[r._FEATURE_RGBA4444]).buffer));const h=e.material;return o.material=function(e,t){const{emissiveFactor:i=[0,0,0],alphaMode:n="OPAQUE",alphaCutoff:r=.5,normalTexture:o,occlusionTexture:s,emissiveTexture:a,doubleSided:l,name:c}=e,{baseColorFactor:u=[1,1,1,1],metallicFactor:h=1,roughnessFactor:d=1,baseColorTexture:f,metallicRoughnessTexture:p}=e.pbrMetallicRoughness||{},m=s?t[s.index]:void 0;if(s&&s.extensions&&s.extensions.KHR_texture_transform&&m){const e=s.extensions.KHR_texture_transform;m.offsetScale=[e.offset[0],e.offset[1],e.scale[0],e.scale[1]]}return{name:c,pbrMetallicRoughness:{baseColorFactor:new li(...u),metallicFactor:h,roughnessFactor:d,baseColorTexture:f?t[f.index]:void 0,metallicRoughnessTexture:p?t[p.index]:void 0},doubleSided:l,emissiveFactor:new li(...i),alphaMode:n,alphaCutoff:r,normalTexture:o?t[o.index]:void 0,occlusionTexture:m,emissionTexture:a?t[a.index]:void 0,defined:void 0===e.defined}}(void 0!==h?t.json.materials[h]:{defined:!1},i),o}function Wm(e,t,i){const{matrix:n,rotation:r,translation:o,scale:s,mesh:a,extras:c,children:u,name:h}=e,d={};if(d.name=h,d.localMatrix=n||function(e,t,i,n){var r=t[0],o=t[1],s=t[2],a=t[3],l=r+r,c=o+o,u=s+s,h=r*l,d=r*c,f=r*u,p=o*c,m=o*u,_=s*u,g=a*l,y=a*c,v=a*u,x=n[0],b=n[1],w=n[2];return e[0]=(1-(p+_))*x,e[1]=(d+v)*x,e[2]=(f-y)*x,e[3]=0,e[4]=(d-v)*b,e[5]=(1-(h+_))*b,e[6]=(m+g)*b,e[7]=0,e[8]=(f+y)*w,e[9]=(m-g)*w,e[10]=(1-(h+p))*w,e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e}([],r||[0,0,0,1],o||[0,0,0],s||[1,1,1]),d.globalMatrix=l(d.localMatrix),void 0!==a){d.meshes=i[a];const e=d.anchor=[0,0];for(const t of d.meshes){const{min:i,max:n}=t.aabb;e[0]+=i[0]+n[0],e[1]+=i[1]+n[1]}e[0]=Math.floor(e[0]/d.meshes.length/2),e[1]=Math.floor(e[1]/d.meshes.length/2)}if(c&&(c.id&&(d.id=c.id),c.lights&&(d.lights=function(e){if(!e.length)return[];const t=function(e){const t=atob(e),i=new Uint8Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.codePointAt(e);return i}(e),i=[],n=t.length/24,r=new Uint16Array(t.buffer),o=new Float32Array(t.buffer);for(let e=0;e<n;e++){const t=r[2*e*6]/30,n=r[2*e*6+1]/30,s=r[2*e*6+10]/100,a=o[6*e+1],l=o[6*e+2],c=o[6*e+3],u=o[6*e+4],h=c-a,d=u-l,f=Math.hypot(h,d);i.push({pos:[a+.5*h,l+.5*d,n],normal:[d/f,-h/f,0],width:f,height:t,depth:s,points:[a,l,c,u]})}return i}(c.lights)),c.MAPBOX_geometry_bloom&&(d.isGeometryBloom=c.MAPBOX_geometry_bloom)),u){const e=[];for(const n of u)e.push(Wm(t.json.nodes[n],t,i));d.children=e}return d}function Zm(e){if(0===e.vertices.length||0===e.indices.length)return null;const t=new pf(e.vertices,e.indices,8,256),[i,n]=[t.min.clone(),t.max.clone()];return{vertices:e.vertices,indices:e.indices,grid:t,min:i,max:n}}function Xm(e){if(!e.extras||!e.extras.ground)return null;const t=e.extras.ground;if(!t||!Array.isArray(t)||0===t.length)return null;const i=t[0];if(!i||!Array.isArray(i)||0===i.length)return null;const n=[];for(const e of i){if(!Array.isArray(e)||2!==e.length)continue;const t=e[0],i=e[1];"number"==typeof t&&"number"==typeof i&&n.push(new Se(t,i))}if(n.length<3)return null;n.length>1&&n[n.length-1].equals(n[0])&&n.pop();let r=0;for(let e=0;e<n.length;e++){const t=n[e],i=n[(e+1)%n.length],o=n[(e+2)%n.length];r+=(t.x-i.x)*(o.y-i.y)-(o.x-i.x)*(t.y-i.y)}r>0&&n.reverse();const o=yd(n.flatMap(e=>[e.x,e.y]),[]);return 0===o.length?null:{vertices:n,indices:o}}function Ym(e,t){const i=[],n=[];let r=0;const o=[];for(const s of e){r=i.length;const e=s.vertexArray.float32,a=s.indexArray.uint16;for(let n=0;n<s.vertexArray.length;n++)o[0]=e[3*n+0],o[1]=e[3*n+1],o[2]=e[3*n+2],j(o,o,t),i.push(new Se(o[0],o[1]));for(let e=0;e<3*s.indexArray.length;e++)n.push(a[e]+r)}if(n.length%3!=0)return null;for(let e=0;e<n.length;e+=3){const t=i[n[e+0]],r=i[n[e+1]],o=i[n[e+2]];
vendor: 11,475 bytes, line 2
2(t.x-r.x)*(o.y-r.y)-(o.x-r.x)*(t.y-r.y)>0&&([n[e+1],n[e+2]]=[n[e+2],n[e+1]])}return{vertices:i,indices:n}}function Km(e){const t=function(e,t){const i=[],n=WebGL2RenderingContext;if(e.json.textures)for(const r of e.json.textures){const o={magFilter:n.LINEAR,minFilter:n.NEAREST,wrapS:n.REPEAT,wrapT:n.REPEAT};void 0!==r.sampler&&Object.assign(o,e.json.samplers[r.sampler]),i.push({image:t[r.source],sampler:o,uploaded:!1})}return i}(e,e.images),i=function(e,t){const i=[];for(const n of e.json.meshes){const r=[];for(const i of n.primitives)r.push($m(i,e,t));i.push(r)}return i}(e,t),{scenes:n,scene:r,nodes:o}=e.json,s=n?n[r||0].nodes:[...o.keys()],a=[];for(const t of s)a.push(Wm(o[t],e,i));return function(e,t,i){const n={},r=new Set;for(let o=0;o<e.length;o++){const e=i[t[o]];if(!e.extras)continue;const s=e.extras["mapbox:footprint:version"],a=e.extras["mapbox:footprint:id"];(s||a)&&r.add(o),"1.0.0"===s&&a&&(n[a]=o)}for(let o=0;o<e.length;o++){if(r.has(o))continue;const s=e[o],a=i[t[o]];if(!a.extras)continue;let l=null;s.id in n&&(l=Ym(e[n[s.id]].meshes,s.localMatrix)),l||(l=Xm(a)),l&&(s.footprint=Zm(l))}if(r.size>0){const t=Array.from(r.values()).sort((e,t)=>e-t);for(let i=t.length-1;i>=0;i--)e.splice(t[i],1)}}(a,s,e.json.nodes),a}function Jm(e){e.heightmap=new Float32Array(4096),e.heightmap.fill(-1);const t=e.vertexArray.float32,i=e.aabb.min[0]-1,n=e.aabb.min[1]-1,r=Om/(e.aabb.max[0]-i+2),o=Om/(e.aabb.max[1]-n+2);for(let s=0;s<t.length;s+=3){const a=t[s+2],l=(t[s+0]-i)*r|0,c=(t[s+1]-n)*o|0;a>e.heightmap[c*Om+l]&&(e.heightmap[c*Om+l]=a)}}function Qm(e,t,i,n,r){i.reserve(i.length+4*e.length),n.reserve(n.length+10*e.length),r.reserve(r.length+10*e.length);let o=n.length;for(const s of e){const e=Math.min(10,Math.max(4,1.3*s.height))*t,a=[-s.normal[1],s.normal[0],0],l=Math.min(.29,.1*s.width/s.depth),c=s.width-2*s.depth*t*(l+.01),u=L([],s.pos,a,c/2),h=L([],s.pos,a,-c/2),d=[u[0],u[1],u[2]+s.height],f=[h[0],h[1],h[2]+s.height],p=L([],s.normal,a,l);R(p,p,e);const m=L([],s.normal,a,-l);R(m,m,e),A(p,u,p),A(m,h,m),u[2]+=.1,h[2]+=.1,n.emplaceBack(p[0],p[1],p[2]),n.emplaceBack(m[0],m[1],m[2]),n.emplaceBack(u[0],u[1],u[2]),n.emplaceBack(h[0],h[1],h[2]),n.emplaceBack(d[0],d[1],d[2]),n.emplaceBack(f[0],f[1],f[2]),n.emplaceBack(u[0],u[1],u[2]),n.emplaceBack(h[0],h[1],h[2]),n.emplaceBack(p[0],p[1],p[2]),n.emplaceBack(m[0],m[1],m[2]);const _=c/e/2;r.emplaceBack(-_-l,-1,_,.8),r.emplaceBack(_+l,-1,_,.8),r.emplaceBack(-_,0,_,1.3),r.emplaceBack(_,0,_,1.3),r.emplaceBack(_+l,-.8,_,.7),r.emplaceBack(_+l,-.8,_,.7),r.emplaceBack(0,0,_,1.3),r.emplaceBack(0,0,_,1.3),r.emplaceBack(_+l,-1.2,_,.8),r.emplaceBack(_+l,-1.2,_,.8),i.emplaceBack(6+o,4+o,8+o),i.emplaceBack(7+o,9+o,5+o),i.emplaceBack(0+o,1+o,2+o),i.emplaceBack(1+o,3+o,2+o),o+=10}}function e_(e,t){const i={};i.indexArray=new Al,i.vertexArray=new pl,i.colorArray=new xl,Qm(e,t,i.indexArray,i.vertexArray,i.colorArray);const n={defined:!0};n.emissiveFactor=li.black;const r={};return r.baseColorFactor=li.white,n.pbrMetallicRoughness=r,i.material=n,i.aabb=new Vu([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),i}const t_=rl([{name:"a_pos_3f",components:3,type:"Float32"}]),i_=rl([{name:"a_normal_3",components:3,type:"Int16"}]),n_=rl([{name:"a_centroid_3",components:3,type:"Int16"}]),r_=rl([{name:"a_part_color_emissive",components:2,type:"Uint16"}]),o_=rl([{name:"a_faux_facade_color_emissive",components:2,type:"Uint16"}]),s_=rl([{name:"a_faux_facade_data",components:4,type:"Uint16"}]),a_=rl([{name:"a_faux_facade_vertical_range",components:2,type:"Uint16"}]),l_=rl([{name:"a_bloom_attenuation",components:4,type:"Float32"}]),c_=rl([{name:"a_flood_light_wall_radius_1i16",components:1,type:"Uint16"}]),u_=yu.types,h_=32767;function d_(e,t){const i=Vn+t;for(const n of e)for(const e of n)if(e.x<-t||e.x>i||e.y<-t||e.y>i)return!1;return!0}function f_(e){switch(e){case"flat":return 3;case"hipped":return 1;case"gabled":return 2;case"parapet":return 0;case"mansard":return 4;case"skillion":return 5;case"pyramidal":return 6;default:throw new Error(`Unknown roof shape: ${e}`)}}class p_{constructor(){this.layoutVertexArray=new pl,this.layoutAttenuationArray=new xl,this.layoutColorArray=new wl,this.indexArray=new Al,this.indexArrayForConflation=new Al,this.segmentsBucket=new rc}}class m_{constructor(e){this.layoutFacadePaintArray=null,this.layoutFacadeDataArray=null,this.layoutFacadeVerticalRangeArray=null,this.segmentsBucket=new rc,this.entranceBloom=new p_;const t=66560;this.layoutVertexArray=new pl,this.layoutVertexArray.reserve(t),this.layoutNormalArray=new al,this.layoutNormalArray.reserve(t),this.layoutCentroidArray=new al,this.layoutCentroidArray.reserve(t),this.layoutColorArray=new wl,this.layoutColorArray.reserve(t),this.layoutFloodLightDataArray=new kl,this.layoutFloodLightDataArray.reserve(t),this.layoutAOArray=new Ul,this.layoutAOArray.reserve(t),this.indexArray=new Al,this.indexArray.reserve(66560),this.indexArrayForConflation=new Al,this.segmentsBucket=new rc,this.entranceBloom=new p_,e&&(this.layoutFacadePaintArray=new wl,this.layoutFacadeDataArray=new _l,this.layoutFacadeVerticalRangeArray=new wl)}reserve(e,t,i){this.layoutVertexArray.reserveForAdditional(e),this.layoutCentroidArray.reserveForAdditional(e),this.layoutFloodLightDataArray.reserveForAdditional(e),this.layoutNormalArray.reserveForAdditional(e),this.layoutAOArray.reserveForAdditional(e),this.layoutColorArray.reserveForAdditional(e),this.indexArray.reserveForAdditional(t),i&&(this.layoutFacadePaintArray.reserveForAdditional(e),this.layoutFacadeDataArray.reserveForAdditional(e),this.layoutFacadeVerticalRangeArray.reserveForAdditional(e))}}class __{constructor(e){this.colorBufferUploaded=!1,this.maxHeight=0,this.replacementUpdateTime=0,this.activeReplacements=[],this.footprints=[],this.footprintsVertices=new Ol,this.footprintsIndices=new kl,this.footprintsMin=new Se(1/0,1/0),this.footprintsMax=new Se(-1/0,-1/0),this.featuresOnBorder=[],this.buildingWithoutFacade=new m_(!1),this.buildingWithFacade=new m_(!0),this.indexArrayForConflationUploaded=!1,this.featureFootprintLookup=new Map,this.buildingIds=new Set,this.footprintLookup={},this.zoom=e.zoom,this.canonical=e.canonical,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.index=e.index,this.hasPattern=!1,this.worldview=e.worldview,this.lut=e.lut,this.programConfigurations=new Lc(e.layers,{zoom:e.zoom,lut:e.lut}),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.projection=e.projection,this.groundEffect=new np(e),this.groundEffect.groundRadiusArray=new cl,this.hasAppearances=null}updateFootprints(e,t){const i=new pf([],[],1),n={vertices:[],indices:new Uint32Array(0),grid:i,min:this.footprintsMin,max:this.footprintsMax,buildingIds:this.buildingIds};t.push({footprint:n,id:e})}updateAppearances(e,t,i,n){}prepare(){return function(){if(null!=Xp||null!=Zp)return null;if(null!=Wp)return Wp;const e=fetch(st.BUILDING_GEN_URL);return Wp=function(e){let t,i,n,r,o;function s(){t=new Uint8Array(o.buffer),i=new Int16Array(o.buffer),n=new Int32Array(o.buffer),r=new Float32Array(o.buffer)}function a(){throw new Error("Unexpected BuildingGen error.")}const l=()=>{},c={a:{a:a,f:function(e){const i=t.length,n=Math.max(e>>>0,Math.ceil(1.2*i)),r=Math.ceil((n-i)/65536);try{return o.grow(r),s(),!0}catch(e){return!1}},g:a,b:l,c:l,d:l,e:l}};return(WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(e,c):e.then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,c))).then(e=>{const a=e.instance.exports;return(0,a.g)(),o=a.f,s(),new Vp({setStyle:a.h,setAOOptions:a.i,setMetricOptions:a.j,setStructuralOptions:a.k,setFacadeOptions:a.l,setFauxFacadeOptions:a.m,setFacadeClassifierOptions:a.n,addFeature:a.o,addFacade:a.p,generateMesh:a.q,getLastError:a.r,getOuterRingLength:a.s,getMeshCount:a.t,getPositionsPtr:a.u,getPositionsLength:a.v,getNormalsPtr:a.w,getNormalsLength:a.x,getAOPtr:a.y,getAOLength:a.z,getUVPtr:a.A,getUVLength:a.B,getFauxFacadePtr:a.C,getFauxFacadeLength:a.D,getIndicesPtr:a.E,getIndicesLength:a.F,getBuildingPart:a.G,getRingCount:a.H,getRingPtr:a.I,getRingLength:a.J,malloc:a.K,free:a.L,heapU8:t,heap16:i,heap32:n,heapF32:r})})}(e).then(e=>(Wp=null,Xp=e,Xp)).catch(e=>{We("Could not load building-gen"),Wp=null,Zp=e}),Wp}()}populate(e,t,i,n){const r=Xp;if(!r)return;const o=au(i);this.tileToMeter=o,this.brightness=t.brightness,r.setStyle({normalScale:[1,-1,o],tileToMeters:o}),r.setAOOptions(!1,.3),r.setMetricOptions(!1,16),r.setStructuralOptions(!0),r.setFacadeClassifierOptions(3);const s=new Map,a=new Map;let l=0;for(const{feature:t}of e){if("LineString"!==u_[t.type]){s.set(t.id,t.properties.source_id);continue}const e=this.layers[0]._featureFilter.needGeometry;if(e&&!this.layers[0]._featureFilter.filter(new ga(this.zoom),t,i))continue;const r=gu(t,e);if(!e&&!this.layers[0]._featureFilter.filter(new ga(this.zoom),r,i))continue;const o=e?r.geometry:_u(t,i,n),c=[];for(const e of o)for(const t of e)c.push(t.x),c.push(t.y);const u={coordinates:c,crossPerc:t.properties.cross_perc,distanceToRoad:t.properties.distance_to_road,entrances:t.properties.entrances,sourceId:0},h=t.properties.source_id;let d=a.get(h);d||(d=[],a.set(h,d)),d.push(u),++l}this.maxHeight=0;const c=new Array,u=new Set,h=e=>{null!=e&&u.add(e)},d=(e,t)=>{null!=e&&c.push({buildingId:e,footprintIndex:t})},f=64*(e.length-l),p=f/2;this.buildingWithFacade.reserve(f,p,!0),this.buildingWithoutFacade.reserve(2*f,2*p,!1),this.footprintsIndices.reserve(16*(e.length-l)),this.footprintsVertices.reserve(8*(e.length-l));for(const{feature:l,id:c,index:f,sourceLayerIndex:p}of e){if("LineString"===u_[l.type])continue;const e=this.layers[0]._featureFilter.needGeometry;if(e&&!this.layers[0]._featureFilter.filter(new ga(this.zoom),l,i))continue;let m=null;if(l.properties&&l.properties.hasOwnProperty("building_id")&&(m=l.properties.building_id,u.has(m)))continue;const _=gu(l,e);if(!e&&!this.layers[0]._featureFilter.filter(new ga(this.zoom),_,i))continue;const g=e?_.geometry:_u(l,i,n),y=qd(g,500);let v=!1;for(const e of y)if(1!==e.length){v=!0;break}if(v){h(m);continue}if(!d_(g,163)){h(m);continue}const x=this.layers[0],b=f_(x.layout.get("building-roof-shape").evaluate(l,{},i)),w=x.layout.get("building-base").evaluate(l,{},i),T=x.layout.get("building-height").evaluate(l,{},i),S=x.layout.get("building-flood-light-ground-radius").evaluate(l,{},i),E=x.paint.get("building-ambient-occlusion-intensity"),I=S/this.tileToMeter;l.properties["building-part"]="roof";const A=x.paint.get("building-color").evaluate(l,{},this.canonical).toPremultipliedRenderColor(this.lut),M=x.paint.get("building-emissive-strength").evaluate(l,{},this.canonical);l.properties["building-part"]="wall";const C=x.paint.get("building-color").evaluate(l,{},this.canonical).toPremultipliedRenderColor(this.lut),P=x.paint.get("building-emissive-strength").evaluate(l,{},this.canonical);l.properties["building-part"]="window";const D=x.paint.get("building-color").evaluate(l,{},this.canonical).toPremultipliedRenderColor(this.lut),R=x.paint.get("building-emissive-strength").evaluate(l,{},this.canonical);l.properties["building-part"]="door";const L=x.paint.get("building-color").evaluate(l,{},this.canonical).toPremultipliedRenderColor(this.lut),z=x.paint.get("building-emissive-strength").evaluate(l,{},this.canonical);let O=x.layout.get("building-flood-light-wall-radius").evaluate(l,{},i);O=ze(O,0,2048);const F=O/2048*h_,k=s.get(c),B=a.get(k)||[],N=0!==B.length&&x.layout.get("building-facade").evaluate(l,{},i);
vendor: 5,530 bytes, line 2
2r.setFacadeOptions(4,!0),r.setFauxFacadeOptions(N,!1,1);let V=0,U=0,j=0,G=0,q=0,H=0,$=0,W=0,Z=0,X=0,Y=0;if(N){let e=Math.round(x.layout.get("building-facade-floors").evaluate(l,{},i));if(0===w){e=Math.max(1,e-(B.length>0?1:0));let t=4;if(T>100){const e=[10,13,15];t=e[l.id?l.id%e.length:0]}else T<=10&&(t=3);r.setFacadeOptions(t,!0),q=(T<15?1.3:1.61803)*t/o}else q=w/o;H=T/o,q=Math.min(q,H),j=x.layout.get("building-facade-unit-width").evaluate(l,{},i)/o,G=(H-q)/e,r.setFauxFacadeOptions(!0,!0,j);const t=x.layout.get("building-facade-window").evaluate(l,{},i);V=t[0],U=t[1],$=Math.floor(65535*Math.min(1,q/Vn)),W=Math.floor(65535*Math.min(1,H/Vn)),Z=Math.floor(255*V)<<8|Math.floor(255*U),X=Math.floor(65535*Math.min(1,j/Vn)),Y=Math.floor(65535*Math.min(1,G/Vn))}const K=Array(y.length),J={x:1/0,y:1/0},Q={x:-1/0,y:-1/0},ee={x:0,y:0};let te=0;for(let e=0;e<y.length;e++){const t=y[e];if(t.length>0){const i=[],n=Array(t.length+1);n[0]=0;for(let e=0;e<t.length;e++){const r=t[e];for(let e=0;e<r.length;e++){const t=r[r.length-e-1];J.x=Math.min(J.x,t.x),J.y=Math.min(J.y,t.y),Q.x=Math.max(Q.x,t.x),Q.y=Math.max(Q.y,t.y),ee.x+=t.x,ee.y+=t.y,te++,i.push(t.x),i.push(t.y)}n[e+1]=i.length}K[e]={id:l.id?l.id:0,height:T,minHeight:w,sourceId:0,roofType:b,coordinates:i,ringIndices:n}}}ee.x/=te||1,ee.y/=te||1;const ie=r.generateMesh(K,B);if("string"==typeof ie){We(`Unable to generate building ${l.id}: ${ie}`),h(m);continue}if(0===ie.meshes.length||0===ie.modifiedPolygonRings.length){h(m);continue}const ne=N?this.buildingWithFacade:this.buildingWithoutFacade;let re=0;for(const e of ie.meshes)re+=e.positions.length/3;const oe=ne.segmentsBucket.prepareSegment(re,ne.layoutVertexArray,ne.indexArray),se=[];let ae=null,le=0,ce=-1;const ue=ne.layoutVertexArray.length,he=ue+re;ne.layoutVertexArray.resize(he),ne.layoutCentroidArray.resize(he),ne.layoutNormalArray.resize(he),ne.layoutAOArray.resize(he),ne.layoutColorArray.resize(he),ne.layoutFloodLightDataArray.resize(he),N&&(ne.layoutFacadePaintArray.resize(he),ne.layoutFacadeDataArray.resize(he),ne.layoutFacadeVerticalRangeArray.resize(he));const de=ne.indexArray.length;let fe=0,pe=ue;for(const e of ie.meshes){let t,i;if(1===e.buildingPart)t=A,i=M;else if(0===e.buildingPart)t=C,i=P;else if(2===e.buildingPart)t=D,i=R;else{if(3!==e.buildingPart)continue;t=L,i=z}if(i=ze(i,0,1),3===e.buildingPart){const t=new Array;for(let i=0;i<e.positions.length;i+=12){const n=e.positions[i+0],r=e.positions[i+1],o=e.positions[i+3],s=e.positions[i+4],a=e.positions[i+2],l=e.positions[i+8]-a,c=1,u=o-n,h=s-r,d=Math.hypot(u,h);t.push({pos:[n+.5*u,r+.5*h,a],normal:[h/d,-u/d,0],width:d,height:l,depth:c,points:[n,r,o,s]})}const i=ne.entranceBloom.segmentsBucket.prepareSegment(10*t.length,ne.entranceBloom.layoutVertexArray,ne.entranceBloom.indexArray),n=ne.entranceBloom.layoutVertexArray.length;le=ne.entranceBloom.indexArray.length,Qm(t,.5/this.tileToMeter,ne.entranceBloom.indexArray,ne.entranceBloom.layoutVertexArray,ne.entranceBloom.layoutAttenuationArray);const r=ne.entranceBloom.layoutVertexArray.length-n;ce=ne.entranceBloom.indexArray.length-le;for(let e=0;e<r;e++)ne.entranceBloom.layoutColorArray.emplaceBack(255*L.r<<8|255*L.g,255*L.b<<8|51*z);i.vertexLength+=r,i.primitiveLength+=ce,ae={part:e.buildingPart,vertexOffset:n,vertexLength:r}}ne.layoutVertexArray.float32.set(e.positions,3*pe);const n=e.positions.length/3;for(let r=0;r<n;++r){const n=3*r;fe=Math.max(fe,e.positions[n+2]);const o=e.normals[n+1]*h_,s=e.normals[n+2]*h_,a=3*(pe+r);ne.layoutNormalArray.int16[a]=e.normals[n]*h_,ne.layoutNormalArray.int16[a+1]=o,ne.layoutNormalArray.int16[a+2]=s;const l=e.ao[r];ne.layoutAOArray.uint8[pe+r]=255*l;const c=1+(l-1)*E,u=255*t.b*c<<8|255*i;ne.layoutColorArray.uint16[2*(pe+r)]=255*t.r*c<<8|255*t.g*c,ne.layoutColorArray.uint16[2*(pe+r)+1]=u}const r=Math.floor(ee.x),o=Math.floor(ee.y),s=Math.floor(T);for(let e=0;e<n;++e){const t=3*(pe+e);ne.layoutCentroidArray.int16[t]=r,ne.layoutCentroidArray.int16[t+1]=o,ne.layoutCentroidArray.int16[t+2]=s}if(ne.layoutFloodLightDataArray.uint16.fill(0===e.buildingPart?F:0,pe,pe+n),N){const t=255*D.r<<8|255*D.g,i=255*D.b<<8|255*R;for(let e=0;e<n;++e){const n=2*(pe+e);ne.layoutFacadePaintArray.uint16[n]=t,ne.layoutFacadePaintArray.uint16[n+1]=i}for(let t=0;t<n;++t)if(e.isFauxFacade[t]){const i=Math.min(65535,Math.floor(e.uv[2*t]*ie.outerRingLength));ne.layoutFacadeDataArray.emplace(pe+t,1|i,Z,X,Y),ne.layoutFacadeVerticalRangeArray.emplace(pe+t,$,W)}else ne.layoutFacadeDataArray.emplace(pe+t,0,0,0,0),ne.layoutFacadeVerticalRangeArray.emplace(pe+t,0,0)}const a=oe.vertexLength,l=e.indices.length/3,c=ne.indexArray.length;ne.indexArray.resize(c+l);for(let t=0;t<l;++t){const i=3*t,n=3*c+i;ne.indexArray.uint16[n]=a+e.indices[i],ne.indexArray.uint16[n+1]=a+e.indices[i+1],ne.indexArray.uint16[n+2]=a+e.indices[i+2]}1!==e.buildingPart&&0!==e.buildingPart&&2!==e.buildingPart&&3!==e.buildingPart||se.push({part:e.buildingPart,vertexOffset:pe,vertexLength:e.positions.length/3}),pe+=n,oe.vertexLength+=n,oe.primitiveLength+=e.indices.length/3}this.maxHeight=Math.max(this.maxHeight,fe);const me=ne.indexArray.length-de,_e=this.footprintsIndices.length,ge=this.footprintsVertices.length,ye=[],ve=new Se(1/0,1/0),xe=new Se(-1/0,-1/0),be=this.groundEffect.vertexArray.length;for(const e of ie.modifiedPolygonRings){const t=[],i=new Se(1/0,1/0),n=new Se(-1/0,-1/0);for(let r=0;r<e.length;r+=2){const o=e.length-r-2;i.x=Math.min(i.x,e[o]),i.y=Math.min(i.y,e[o+1]),n.x=Math.max(n.x,e[o]),n.y=Math.max(n.y,e[o+1]);const s=new Se(e[o],e[o+1]);
vendor: 12,118 bytes, line 2
2t.push(s),ye.push(s.x,s.y),this.footprintsVertices.emplaceBack(s.x,s.y)}ve.x=Math.min(ve.x,i.x),ve.y=Math.min(ve.y,i.y),xe.x=Math.max(xe.x,n.x),xe.y=Math.max(xe.y,n.y),this.groundEffect.addData(t,[i,n],I)}const we=this.groundEffect.vertexArray.length-be;this.groundEffect.groundRadiusArray.reserveForAdditional(we);for(let e=0;e<we;e++)this.groundEffect.groundRadiusArray.emplaceBack(S);(J.x<0||Q.x>Vn||J.y<0||Q.y>Vn)&&this.featuresOnBorder.push({featureId:l.id,footprintIndex:this.footprints.length});{const e=yd(ye,null,2);this.footprintsIndices.resize(this.footprintsIndices.length+e.length),this.footprintsIndices.uint16.set(e,_e),this.buildingIds.add(null!=m?m:l.id),this.footprintsMin.x=Math.min(this.footprintsMin.x,ve.x),this.footprintsMin.y=Math.min(this.footprintsMin.y,ve.y),this.footprintsMax.x=Math.max(this.footprintsMax.x,xe.x),this.footprintsMax.y=Math.max(this.footprintsMax.y,xe.y);const t={footprintVertexOffset:ge,footprintVertexLength:this.footprintsVertices.length-ge,footprintIndexOffset:_e,footprintIndexLength:this.footprintsIndices.length-_e,min:ve,max:xe,hiddenFlags:0,indicesOffset:de,indicesLength:me,bloomIndicesOffset:le,bloomIndicesLength:ce,groundEffectVertexOffset:be,groundEffectVertexLength:we,hasFauxFacade:N,height:fe,promoteId:c,feature:_,parts:se,buildingBloom:ae},i=this.footprints.length;void 0!==l.id&&this.featureFootprintLookup.set(l.id,i),d(m,i),this.footprints.push(t)}this.programConfigurations.populatePaintArrays(ne.layoutVertexArray.length,l,f,{},t.availableImages,i,t.brightness),this.groundEffect.addPaintPropertiesData(l,f,{},t.availableImages,i,t.brightness),t.featureIndex.insert(l,g,f,p,this.index,ue)}c.forEach(({buildingId:e,footprintIndex:t})=>{u.has(e)&&(this.footprints[t].hiddenFlags|=4)});const m=new Set;this.buildingIds.forEach((e,t,i)=>{u.has(e)||m.add(e)}),this.buildingIds=m,this.groundEffect.prepareBorderSegments()}update(e,t,i,n,r,o,s){this.programConfigurations.updatePaintArrays(e,t,r,i,n,o,s),this.groundEffect.update(e,t,r,i,n,o,s),this.evaluate(this.layers[0],e),this.colorBufferUploaded=!1}isEmpty(){return 0===this.buildingWithoutFacade.layoutVertexArray.length&&0===this.buildingWithFacade.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(e){const t=t=>{t.layoutVertexBuffer=e.createVertexBuffer(t.layoutVertexArray,t_.members),t.layoutNormalBuffer=e.createVertexBuffer(t.layoutNormalArray,i_.members),t.layoutCentroidBuffer=e.createVertexBuffer(t.layoutCentroidArray,n_.members),t.layoutFloodLightDataBuffer=e.createVertexBuffer(t.layoutFloodLightDataArray,c_.members),t.layoutFacadeDataArray&&t.layoutFacadeDataArray.length&&(t.layoutFacadeDataBuffer=e.createVertexBuffer(t.layoutFacadeDataArray,s_.members)),t.layoutFacadeVerticalRangeArray&&t.layoutFacadeVerticalRangeArray.length&&(t.layoutFacadeVerticalRangeBuffer=e.createVertexBuffer(t.layoutFacadeVerticalRangeArray,a_.members)),t.entranceBloom.layoutVertexArray.length&&(t.entranceBloom.layoutVertexBuffer=e.createVertexBuffer(t.entranceBloom.layoutVertexArray,t_.members),t.entranceBloom.layoutAttenuationBuffer=e.createVertexBuffer(t.entranceBloom.layoutAttenuationArray,l_.members)),this.uploadUpdatedColorBuffer(e),this.uploadUpdatedIndexBuffer(e)};this.uploaded||(t(this.buildingWithoutFacade),t(this.buildingWithFacade),this.groundEffect.upload(e)),this.groundEffect.uploadPaintProperties(e),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){const e=e=>{e.layoutVertexBuffer&&(e.layoutVertexBuffer.destroy(),e.layoutNormalBuffer.destroy(),e.layoutColorBuffer.destroy(),e.segmentsBucket.destroy(),e.indexBuffer&&e.indexBuffer.destroy(),e.entranceBloom.layoutVertexBuffer&&(e.entranceBloom.layoutVertexBuffer.destroy(),e.entranceBloom.layoutColorBuffer.destroy(),e.entranceBloom.layoutAttenuationBuffer.destroy(),e.entranceBloom.indexBuffer.destroy(),e.entranceBloom.segmentsBucket.destroy()))};e(this.buildingWithoutFacade),e(this.buildingWithFacade),this.groundEffect.destroy(),this.programConfigurations.destroy()}updateFootprintHiddenFlags(e,t,i=!0){let n=!1;const r=i?t:0,o=0|(i?-1:~t);0===this.groundEffect.hiddenByLandmarkVertexArray.length&&this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length);for(const t of e){const e=this.footprints[t],i=e.hiddenFlags&o|r;e.hiddenFlags!==i&&(e.hiddenFlags=i,n=!0,this.groundEffect.updateHiddenByLandmarkRange(e.groundEffectVertexOffset,e.groundEffectVertexLength,0!==e.hiddenFlags))}return n&&(this.indexArrayForConflationUploaded=!1),n}uploadUpdatedIndexBuffer(e){if(this.groundEffect.uploadHiddenByLandmark(e),this.indexArrayForConflationUploaded)return;const t=e=>{0!==e.indexArray.length&&(e.indexArrayForConflation.resize(e.indexArray.length),e.indexArrayForConflation.uint16.set(e.indexArray.uint16),e.entranceBloom.indexArrayForConflation.resize(e.entranceBloom.indexArray.length),e.entranceBloom.indexArrayForConflation.uint16.set(e.entranceBloom.indexArray.uint16))};t(this.buildingWithoutFacade),t(this.buildingWithFacade);for(const e of this.footprints){const t=e.hasFauxFacade?this.buildingWithFacade:this.buildingWithoutFacade,i=e.indicesOffset+e.indicesLength;if(0!==e.hiddenFlags){for(let n=e.indicesOffset;n<i;n++)t.indexArrayForConflation.uint16[3*n+0]=0,t.indexArrayForConflation.uint16[3*n+1]=0,t.indexArrayForConflation.uint16[3*n+2]=0;const n=e.bloomIndicesOffset+e.bloomIndicesLength;for(let i=e.bloomIndicesOffset;i<n;i++)t.entranceBloom.indexArrayForConflation.uint16[3*i+0]=0,t.entranceBloom.indexArrayForConflation.uint16[3*i+1]=0,t.entranceBloom.indexArrayForConflation.uint16[3*i+2]=0}}const i=t=>{0!==t.indexArray.length&&(t.indexBuffer?t.indexBuffer.updateData(t.indexArrayForConflation):t.indexBuffer=e.createIndexBuffer(t.indexArrayForConflation,!0),t.entranceBloom.indexBuffer?t.entranceBloom.indexBuffer.updateData(t.entranceBloom.indexArrayForConflation):t.entranceBloom.indexBuffer=e.createIndexBuffer(t.entranceBloom.indexArrayForConflation,!0))};i(this.buildingWithoutFacade),i(this.buildingWithFacade),this.indexArrayForConflationUploaded=!0}uploadUpdatedColorBuffer(e){const t=t=>{t.layoutColorBuffer?t.layoutColorBuffer.updateData(t.layoutColorArray):t.layoutColorBuffer=e.createVertexBuffer(t.layoutColorArray,r_.members,!0),t.layoutFacadePaintArray&&(t.layoutFacadePaintBuffer?t.layoutFacadePaintBuffer.updateData(t.layoutFacadePaintArray):t.layoutFacadePaintBuffer=e.createVertexBuffer(t.layoutFacadePaintArray,o_.members,!0)),t.entranceBloom.layoutColorBuffer?t.entranceBloom.layoutColorBuffer.updateData(t.entranceBloom.layoutColorArray):t.entranceBloom.layoutColorBuffer=e.createVertexBuffer(t.entranceBloom.layoutColorArray,r_.members,!0)};t(this.buildingWithoutFacade),t(this.buildingWithFacade),this.colorBufferUploaded=!0}evaluate(e,t){const i=e.paint.get("building-ambient-occlusion-intensity");for(const n of this.footprints){if(4&n.hiddenFlags)continue;const r=t[n.promoteId],o=n.feature;o.properties["building-part"]="roof";const s=e.paint.get("building-color").evaluate(o,r,this.canonical).toPremultipliedRenderColor(this.lut),a=e.paint.get("building-emissive-strength").evaluate(o,r,this.canonical);o.properties["building-part"]="wall";const l=e.paint.get("building-color").evaluate(o,r,this.canonical).toPremultipliedRenderColor(this.lut),c=e.paint.get("building-emissive-strength").evaluate(o,r,this.canonical);o.properties["building-part"]="window";const u=e.paint.get("building-color").evaluate(o,r,this.canonical).toPremultipliedRenderColor(this.lut),h=e.paint.get("building-emissive-strength").evaluate(o,r,this.canonical);o.properties["building-part"]="door";const d=e.paint.get("building-color").evaluate(o,r,this.canonical).toPremultipliedRenderColor(this.lut),f=e.paint.get("building-emissive-strength").evaluate(o,r,this.canonical),p=n.hasFauxFacade?this.buildingWithFacade:this.buildingWithoutFacade;for(const e of n.parts){let t,r=s;1===e.part?(r=s,t=a):0===e.part?(r=l,t=c):2===e.part?(r=u,t=h):3===e.part&&(r=d,t=f),t=ze(t,0,1);for(let o=0;o<e.vertexLength;o++){const s=e.vertexOffset+o,a=1+(p.layoutAOArray.uint8[s]/255-1)*i;p.layoutColorArray.emplace(s,r.r*a*255<<8|r.g*a*255,r.b*a*255<<8|255*t),n.hasFauxFacade&&p.layoutFacadePaintArray.emplace(s,255*u.r<<8|255*u.g,255*u.b<<8|255*h)}}const m=n.buildingBloom;if(m)for(let e=0;e<m.vertexLength;e++)p.entranceBloom.layoutColorArray.emplace(m.vertexOffset+e,255*d.r<<8|255*d.g,255*d.b<<8|51*f)}}needsEvaluation(){return!this.colorBufferUploaded}updateReplacement(e,t,i){if(t.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=t.updateTime;const n=t.getReplacementRegionsForTile(e.toUnwrapped());if(Df(this.activeReplacements,n))return;this.activeReplacements=n;for(const e of this.footprints)e.hiddenFlags&=-2;const r=[];for(const t of this.activeReplacements){if(t.order<=If)continue;const i=Math.max(1,Math.pow(2,t.footprintTileId.canonical.z-e.canonical.z));for(const n of this.footprints)n.min.x>t.max.x||n.max.x<t.min.x||n.min.y>t.max.y||n.max.y<t.min.y||(r.length=0,y_(this.footprintsVertices,n.footprintVertexOffset,n.footprintVertexLength,t.footprintTileId.canonical,e.canonical,r),zf(t.footprint,r,this.footprintsIndices.uint16,n.footprintIndexOffset,n.footprintIndexLength,0,-i)&&(n.hiddenFlags|=1))}0===this.groundEffect.hiddenByLandmarkVertexArray.length&&this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length);for(const e of this.footprints)this.groundEffect.updateHiddenByLandmarkRange(e.groundEffectVertexOffset,e.groundEffectVertexLength,0!==e.hiddenFlags);this.indexArrayForConflationUploaded=!1}getFootprint(e){if(void 0!==e.id){const t=this.featureFootprintLookup.get(e.id);return this.footprints[t]}return null}getHeightAtTileCoord(e,t){let i=Number.NEGATIVE_INFINITY,n=!0;const r=4*(e+Vn)*Vn+(t+Vn);if(this.footprintLookup.hasOwnProperty(r)){const e=this.footprintLookup[r];return e?{height:e.height,hidden:0!==e.hiddenFlags}:void 0}const o=new Se(e,t);for(const s of this.footprints)e>s.max.x||s.min.x>e||t>s.max.y||s.min.y>t||s.height<=i||g_(o,this.footprintsVertices.float32.subarray(2*s.footprintVertexOffset,2*(s.footprintVertexOffset+s.footprintVertexLength)),this.footprintsIndices.uint16.subarray(s.footprintIndexOffset,s.footprintIndexOffset+s.footprintIndexLength))&&(i=s.height,this.footprintLookup[r]=s,n=0!==s.hiddenFlags);if(i!==Number.NEGATIVE_INFINITY)return{height:i,hidden:n};this.footprintLookup[r]=void 0}}function g_(e,t,i){for(let n=0;n<i.length;n+=3){const r=i[n],o=i[n+1],s=i[n+2],a=t[2*r+0],l=t[2*r+1],c=t[2*o+0],u=t[2*o+1],h=t[2*s+0],d=t[2*s+1],f=(a-h)*(e.y-d)-(l-d)*(e.x-h),p=(c-a)*(e.y-l)-(u-l)*(e.x-a);if(f<0!=p<0&&0!==f&&0!==p)continue;const m=(h-c)*(e.y-u)-(d-u)*(e.x-c);if(0===m||m<0==f+p<=0)return!0}return!1}function y_(e,t,i,n,r,o){const s=Math.pow(2,n.z-r.z);for(let a=0;a<i;a++){let i=e.float32[2*(a+t)+0],l=e.float32[2*(a+t)+1];i=(i+r.x*Vn)*s-n.x*Vn,l=(l+r.y*Vn)*s-n.y*Vn,o.push(new Se(i,l))}}let v_,x_;Jo(__,"BuildingBucket",{omit:["layers"]}),Jo(m_,"BuildingGeometry"),Jo(p_,"BuildingBloomGeometry");const b_=rl([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),w_=rl([{name:"a_z_offset_width",components:3,type:"Float32"}],4),{members:T_}=b_,S_=rl([{name:"a_packed",components:3,type:"Float32"}]),{members:E_}=S_,I_=rl([{name:"a_pattern_data",components:3,type:"Float32"}]),{members:A_}=I_;class M_{constructor(e,t){this.width=e,this.height=t,this.nextRow=0,this.image=new ud({width:e,height:t}),this.positions={},this.uploaded=!1}getDash(e,t){const i=this.getKey(e,t);return this.positions[i]}trim(){const e=this.width,t=this.height=Ve(this.nextRow);this.image.resize({width:e,height:t})}getKey(e,t){return e.join(",")+t}getDashRanges(e,t,i){const n=[];let r=e.length%2==1?-e[e.length-1]*i:0,o=e[0]*i,s=!0;n.push({left:r,right:o,isDash:s,zeroLength:0===e[0]});let a=e[0];for(let t=1;t<e.length;t++){s=!s;const l=e[t];r=a*i,a+=l,o=a*i,n.push({left:r,right:o,isDash:s,zeroLength:0===l})}return n}addRoundDash(e,t,i){const n=t/2;
vendor: 3,668 bytes, line 2
2for(let t=-i;t<=i;t++){const r=this.width*(this.nextRow+i+t);let o=0,s=e[o];for(let a=0;a<this.width;a++){a/s.right>1&&(s=e[++o]);const l=Math.abs(a-s.left),c=Math.abs(a-s.right),u=Math.min(l,c);let h;const d=t/i*(n+1);if(s.isDash){const e=n-Math.abs(d);h=Math.sqrt(u*u+e*e)}else h=n-Math.sqrt(u*u+d*d);this.image.data[r+a]=Math.max(0,Math.min(255,h+128))}}}addRegularDash(e,t){for(let t=e.length-1;t>=0;--t){const i=e[t],n=e[t+1];i.zeroLength?e.splice(t,1):n&&n.isDash===i.isDash&&(n.left=i.left,e.splice(t,1))}const i=e[0],n=e[e.length-1];i.isDash===n.isDash&&(i.left=n.left-this.width,n.right=i.right+this.width);const r=this.width*this.nextRow;let o=0,s=e[o];for(let i=0;i<this.width;i++){i/s.right>1&&(s=e[++o]);const n=Math.abs(i-s.left),a=Math.abs(i-s.right),l=Math.min(n,a);this.image.data[r+i]=Math.max(0,Math.min(255,(s.isDash?l:-l)+t+128))}}addDash(e,t){const i=this.getKey(e,t);if(this.positions[i])return this.positions[i];const n="round"===t,r=n?7:0,o=2*r+1;if(this.nextRow+o>this.height)return We("LineAtlas out of space"),null;0===e.length&&e.push(1);let s=0;for(let t=0;t<e.length;t++)e[t]<0&&(We("Negative value is found in line dasharray, replacing values with 0"),e[t]=0),s+=e[t];if(0!==s){const i=this.width/s,o=this.getDashRanges(e,this.width,i);n?this.addRoundDash(o,i,r):this.addRegularDash(o,"square"===t?.5*i:0)}const a=this.nextRow+r;this.nextRow+=o;const l={tl:[a,r],br:[s,0]};return this.positions[i]=l,l}}Jo(M_,"LineAtlas");const C_=yu.types,P_=Math.cos(Math.PI/180*37.5),D_=Math.cos(Math.PI/180*5);class R_{constructor(e){this.evaluationGlobals={zoom:0,lineProgress:void 0},this.elevationType="none",this.zoom=e.zoom,this.evaluationGlobals.zoom=this.zoom,this.overscaling=e.overscaling,this.pixelRatio=e.pixelRatio,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.hasCrossSlope=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(e=>{this.gradients[e.id]={}}),this.layoutVertexArray=new fl,this.layoutVertexArray2=new pl,this.patternVertexArray=new pl,this.indexArray=new Al,this.programConfigurations=new Lc(e.layers,{zoom:e.zoom,lut:e.lut}),this.segments=new rc,this.maxLineLength=0,this.zOffsetVertexArray=new pl,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.tessellationStep=e.tessellationStep?e.tessellationStep:128,this.worldview=e.worldview,this.hasAppearances=null}updateFootprints(e,t){}updateAppearances(e,t,i,n){}populate(e,t,i,n){this.hasPattern=Wd("line",this.layers,this.pixelRatio,t);const r=this.layers[0].layout.get("line-sort-key");this.tileToMeter=au(i);const o=this.layers[0].layout.get("line-elevation-reference");if("hd-road-markup"===o)this.elevationType="road";else{const e=this.layers[0].layout.get("line-z-offset"),t=e.isConstant()&&!e.constantOr(0);this.elevationType="sea"!==o&&"ground"!==o&&t?"none":"offset","offset"===this.elevationType&&"none"===o&&We(`line-elevation-reference: ground is used for the layer ${this.layerIds[0]} because non-zero line-z-offset value was found.`)}const s=this.layers[0].layout.get("line-cross-slope");this.hasCrossSlope="offset"===this.elevationType&&void 0!==s;const a=[];for(const{feature:o,id:s,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,u=gu(o,e);if(!this.layers[0]._featureFilter.filter(new ga(this.zoom,{worldview:this.worldview,activeFloors:t.activeFloors}),u,i))continue;const h=r?r.evaluate(u,{},i):void 0,d={id:s,properties:o.properties,type:o.type,sourceLayerIndex:c,index:l,geometry:e?u.geometry:_u(o,i,n),patterns:{},sortKey:h};a.push(d)}r&&a.sort((e,t)=>
2e.sortKey-t.sortKey);const{lineAtlas:l,featureIndex:c}=t,u=this.addConstantDashes(l);for(const n of a){const{geometry:r,index:o,sourceLayerIndex:s}=n;if(u&&this.addFeatureDashes(n,l),this.hasPattern){const e=Zd("line",this.layers,n,this.zoom,this.pixelRatio,t);this.patternFeatures.push(e)}else this.addFeature(n,r,o,i,l.positions,t.availableImages,t.brightness,t.elevationFeatures);c.insert(e[o].feature,r,o,s,this.index)}}addConstantDashes(e){let t=!1;for(const i of this.layers){const n=i.paint.get("line-dasharray").value,r=i.layout.get("line-cap").value;if("constant"!==n.kind||"constant"!==r.kind)t=!0;else{const t=r.value,i=n.value;if(!i)continue;e.addDash(i,t)}}return t}addFeatureDashes(e,t){const i=this.zoom;for(const n of this.layers){const r=n.paint.get("line-dasharray").value,o=n.layout.get("line-cap").value;if("constant"===r.kind&&"constant"===o.kind)continue;let s,a;if("constant"===r.kind){if(s=r.value,!s)continue}else s=r.evaluate({zoom:i},e);a="constant"===o.kind?o.value:o.evaluate({zoom:i},e),t.addDash(s,a),e.patterns[n.id]=[t.getKey(s,a)]}}update(e,t,i,n,r,o,s,a){this.programConfigurations.updatePaintArrays(e,t,r,i,n,o,s,a)}addFeatures(e,t,i,n,r,o){for(const r of this.patternFeatures)this.addFeature(r,r.geometry,r.index,t,i,n,o,e.elevationFeatures)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,E_)),0!==this.patternVertexArray.length&&(this.patternVertexBuffer=e.createVertexBuffer(this.patternVertexArray,A_)),!this.zOffsetVertexBuffer&&this.zOffsetVertexArray.length>0&&(this.zOffsetVertexBuffer=e.createVertexBuffer(this.zOffsetVertexArray,w_.members,!0)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,T_),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy(),this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e,t){let i,n;if(t&&t>0?(i=`mapbox_clip_start_${t}`,n=`mapbox_clip_end_${t}`):(i="mapbox_clip_start",n="mapbox_clip_end"),e.properties&&e.properties.hasOwnProperty(i)&&e.properties.hasOwnProperty(n))return{start:+e.properties[i],end:+e.properties[n]}}addFeature(e,t,i,n,r,o,s,a){const l=this.layers[0].layout,c=l.get("line-join").evaluate(e,{}),u=l.get("line-cap").evaluate(e,{}),h=l.get("line-miter-limit"),d=l.get("line-round-limit");this.lineClips=this.lineFeatureClips(e),this.lineFeature=e;const f=!(!e.properties||!e.properties.hasOwnProperty("mapbox_line_metrics"))&&e.properties.mapbox_line_metrics;this.zOffsetValue=l.get("line-z-offset").value;const p=this.layers[0].paint.get("line-width").value;if("constant"!==p.kind&&!1===p.isLineProgressConstant&&(this.variableWidthValue=p),"road"===this.elevationType){const i=this.layoutVertexArray.length;if(!this.addElevatedRoadFeature(e,t,n,a,c,u,h,d)){const[r,o]=this.clipRuntimeLinesToTile(t,1);for(let t=0;t<r.length;t++){const i=r[t],s=o[t],a={progress:{min:s.progress.min,max:s.progress.max},nextDir:this.computeSegNextDir(s,i),prevDir:this.computeSegPrevDir(s,i)};this.addLine(i,e,n,c,u,h,d,a,f&&s.parentIndex>0?s.parentIndex:null)}this.fillNonElevatedRoadSegment(i)}}else for(let i=0;i<t.length;i++)this.addLine(t[i],e,n,c,u,h,d,void 0,f&&i>0?i:null);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,r,o,n,s,void 0,this.worldview)}computeSegNextDir(e,t){return e.nextPoint.sub(t.at(-2)).unit()}computeSegPrevDir(e,t){return t[1].sub(e.prevPoint).unit()}clipLinesToTile(e,t){return bp(e,-t,-t,Vn+t,Vn+t)}clipRuntimeLinesToTile(e,t){const i=[];return[bp(e,-t,-t,Vn+t,Vn+t,i),i]}addElevatedRoadFeature(e,t,i,n,r,o,s,a){const l=[],c=Gu.getElevationFeature(e,n);if(c){const e=this.clipLinesToTile(t,1),n=this.prepareElevatedLines(e,c,i);for(const e of n)l.push({geometry:e,elevation:c,elevationTileID:i,segment:{progress:{min:0,max:1},nextDir:void 0,prevDir:void 0}})}if(0===l.length)return!1;for(const t of l){const n=this.layoutVertexArray.length;this.addLine(t.geometry,e,i,r,o,s,a);const l=new qu(i,t.elevationTileID);if(t.elevation)for(let e=n;e<this.layoutVertexArray.length;e++){const i=new Se(this.layoutVertexArray.int16[6*e]>>1,this.layoutVertexArray.int16[6*e+1]>>1),n=l.pointElevation(i,t.elevation,.05);this.updateHeightRange(n),this.zOffsetVertexArray.emplaceBack(n,0,0)}else this.fillNonElevatedRoadSegment(n)}return!0}prepareElevatedLines(e,t,i){if(null!=t.constantHeight)return e;const n=[],r=1/au(i);for(const i of e)wp(i,new Uu(t,r),0,n);return n}fillNonElevatedRoadSegment(e){for(let t=e;t<this.layoutVertexArray.length;t++)this.zOffsetVertexArray.emplaceBack(0,0,0)}updateHeightRange(e){this.heightRange?(this.heightRange.min=Math.min(this.heightRange.min,e),this.heightRange.max=Math.max(this.heightRange.max,e)):this.heightRange={min:e,max:e}}addLine(e,t,i,n,r,o,s,a,l){this.distance=0,this.prevDistance=0,this.scaledDistance=0,this.totalDistance=0,this.totalFeatureLength=0,this.lineS
vendor: 9,086 bytes, line 2
2oFar=0,this.currentVertex=void 0,this.lineClips=l?this.lineFeatureClips(t,l):this.lineClips;const c="none"===n;this.patternJoinNone=this.hasPattern&&c,this.segmentStart=0,this.segmentStartf32=0,this.segmentPoints=[];const u=a&&a.progress.min>0,h=a&&a.progress.max<1;if(this.lineClips){let i={min:this.lineClips.start,max:this.lineClips.end},n=1;if(a){const e=this.lineClips.end-this.lineClips.start;i=function(e,t,i){return{min:ot(e.min,t,i),max:ot(e.max,t,i)}}(a.progress,{min:0,max:1},i),e>0&&(n=(i.max-i.min)/e)}const r=+t.properties.mapbox_clip_feature_len,o=+t.properties.mapbox_clip_seg_len;if(Number.isNaN(r)||Number.isNaN(o)){for(let t=0;t<e.length-1;t++)this.totalDistance+=e[t].dist(e[t+1]);const t=this.totalDistance/(i.max-i.min);this.totalFeatureLength=Number.isFinite(t)?t:0,this.lineClips.start=i.min,this.lineClips.end=i.max,this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}else this.totalFeatureLength=r,this.distance=o*n,this.lineClips.start=i.min,this.lineClips.end=i.max,this.maxLineLength=Math.max(this.maxLineLength,this.distance);this.lineClipsArray.push(this.lineClips),this.updateScaledDistance()}const d="Polygon"===C_[t.type];let f=e.length;for(;f>=2&&e[f-1].equals(e[f-2]);)f--;let p=0;for(;p<f-1&&e[p].equals(e[p+1]);)p++;if(f<(d?3:2))return;"bevel"===n&&(o=1.05);const m=this.segments.prepareSegment(10*f,this.layoutVertexArray,this.indexArray);let _,g,y,v,x,b,w,T;a&&a.prevDir&&(b=a.prevDir.perp()),a&&a.nextDir&&(w=a.nextDir.perp()),this.e1=this.e2=-1,d&&(_=e[f-2],x=e[p].sub(_)._unit()._perp());for(let t=p;t<f;t++){if(y=t===f-1?d?e[p+1]:void 0:e[t+1],y&&e[t].equals(y))continue;x&&(v=x),_&&(g=_),_=e[t],T=this.evaluateLineProgressFeatures(g?g.dist(_):0),x=y?y.sub(_)._unit()._perp():v,v=v||x;const i=g&&y;let a=i?n:d||c?"butt":r;const l=v.x*x.x+v.y*x.y;if(c){const e=function(e){if(e.patternJoinNone){const t=e.segmentPoints.length/2,i=e.lineSoFar-e.segmentStart;for(let n=0;n<t;++n){const t=e.segmentPoints[2*n+1],r=Math.round(e.segmentPoints[2*n])+.5+.25*t;e.patternVertexArray.emplaceBack(r,i,e.segmentStart),e.patternVertexArray.emplaceBack(r,i,e.segmentStart)}e.segmentPoints.length=0}e.e1=e.e2=-1};if(i&&l<D_){this.updateDistance(g,_),this.addCurrentVertex(_,v,1,1,m,T),e(this),this.addCurrentVertex(_,x,-1,-1,m,T);continue}if(g){if(!y){this.updateDistance(g,_),this.addCurrentVertex(_,v,1,1,m,T),e(this);continue}a="miter"}}let S=v.add(x);0===S.x&&0===S.y||S._unit();const E=S.x*x.x+S.y*x.y,I=0!==E?1/E:1/0,A=2*Math.sqrt(2-2*E),M=E<P_&&g&&y,C=v.x*x.y-v.y*x.x>0,P=this.overscaling<=16?15*Vn/(512*this.overscaling):0;if(i&&"round"===a)if(I<s)a="miter";else if(I<=2){const e=L_(_,-10,8202);a="offset"===this.elevationType&&(e||this.hasCrossSlope)?"miter":"fakeround"}if("miter"===a&&I>o&&(a="bevel"),"bevel"===a&&(I>2&&(a="flipbevel"),I<o&&(a="miter")),g&&!("miter"===a&&M)&&this.updateDistance(g,_),"miter"===a)if(M){const e=_.dist(g);if(e>2*P){const t=_.sub(_.sub(g)._mult(P/e)._round());this.updateDistance(g,t),this.addCurrentVertex(t,v,0,0,m,T),g=t}this.updateDistance(g,_),S._mult(I),this.addCurrentVertex(_,S,0,0,m,T);const t=_.dist(y);if(t>2*P){const e=_.add(y.sub(_)._mult(P/t)._round());this.updateDistance(_,e),this.addCurrentVertex(e,x,0,0,m,T),_=e}}else S._mult(I),this.addCurrentVertex(_,S,0,0,m,T);else if("flipbevel"===a){if(I>100)S=x.mult(-1);else{const e=I*v.add(x).mag()/v.sub(x).mag();S._perp()._mult(e*(C?-1:1))}this.addCurrentVertex(_,S,0,0,m,T),this.addCurrentVertex(_,S.mult(-1),0,0,m,T)}else if("bevel"===a||"fakeround"===a){null!=T&&g&&this.addCurrentVertex(_,w||v,-1,-1,m,T);const e=_.dist(g)<=2*P&&"bevel"!==a,t=S.mult(C?1:-1);t._mult(I);const i=x.mult(C?-1:1),n=v.mult(C?-1:1),r=this.evaluateLineProgressFeatures(this.distance);if(null==T&&(this.addHalfVertex(_,t.x,t.y,!1,!C,0,m,r),e||this.addHalfVertex(_,t.x+2*n.x,t.y+2*n.y,!1,C,0,m,r)),"fakeround"===a){const e=Math.round(180*A/Math.PI/20);this.addHalfVertex(_,n.x,n.y,!1,C,0,m,r);for(let t=0;t<e;t++){let o=t/e;if(.5!==o){const e=o-.5;o+=o*e*(o-1)*((1.0904+l*(l*(3.55645-1.43519*l)-3.2452))*e*e+(.848013+l*(.215638*l-1.06021)))}const s=i.sub(n)._mult(o)._add(n)._unit();this.addHalfVertex(_,s.x,s.y,!1,C,0,m,r)}this.addHalfVertex(_,i.x,i.y,!1,C,0,m,r)}e||null!=T||this.addHalfVertex(_,t.x+2*i.x,t.y+2*i.y,!1,C,0,m,r),null!=T&&y&&this.addCurrentVertex(_,b||x,1,1,m,T)}else if("butt"===a)this.addCurrentVertex(_,S,0,0,m,T);else if("square"===a){if(!g){const e=u?0:-1;this.addCurrentVertex(_,S,e,e,m,T)}if(this.addCurrentVertex(_,S,0,0,m,T),g){const e=h?0:1;this.addCurrentVertex(_,S,e,e,m,T)}}else if("round"===a){if(g){const e=!i&&w?w:v;this.addCurrentVertex(_,e,0,0,m,T),!i&&h||this.addCurrentVertex(_,e,1,1,m,T,!0)}if(y){const e=!i&&b?b:x;!i&&u||this.addCurrentVertex(_,e,-1,-1,m,T,!0),this.addCurrentVertex(_,e,0,0,m,T)}}}}addVerticesTo(e,t,i,n,r,o,s,a,l,c){const u=(t.w-e.w)/this.tessellationStep|0;let h=0;const d=this.scaledDistance;if(u>1){this.lineSoFar=e.w;const d=(t.x-e.x)/u,f=(t.y-e.y)/u,p=(t.z-e.z)/u,m=(t.w-e.w)/u;for(let t=1;t<u;++t){e.x+=d,e.y+=f,e.z+=p,this.lineSoFar+=m,h+=m;const t=this.evaluateLineProgressFeatures(this.prevDistance+h);this.scaledDistance=(this.prevDistance+h)/this.totalDistance,this.addHalfVertex(e,i,n,c,!1,s,l,t),this.addHalfVertex(e,r,o,c,!0,-a,l,t)}}this.lineSoFar=t.w,this.scaledDistance=d;const f=this.evaluateLineProgressFeatures(this.distance);this.addHalfVertex(t,i,n,c,!1,s,l,f),this.addHalfVertex(t,r,o,c,!0,-a,l,f)}evaluateLineProgressFeatures(e){if(!this.variableWidthValue&&"offset"!==this.elevationType)return null;this.evaluationGlobals.lineProgress=0,this.lineClips?this.evaluationGlobals.lineProgress=Math.min(1,(this.totalFeatureLength*this.lineClips.start+e)/this.totalFeatureLength):We(`line-progress evaluation for ${this.layerIds[0]} requires enabling 'lineMetrics' for the source.`);let t=0;return this.variableWidthValue&&"constant"!==this.variableWidthValue.kind&&(t=this.variableWidthValue.evaluate(this.evaluationGlobals,this.lineFeature)||0),"offset"!==this.elevationType?{zOffset:0,variableWidth:t}:"constant"===this.zOffsetValue.kind?{zOffset:this.zOffsetValue.value,variableWidth:t}:{zOffset:this.zOffsetValue.evaluate(this.evaluationGlobals,this.lineFeature)||0,variableWidth:t}}addCurrentVertex(e,t,i,n,r,o,s=!1){const a=t.x+t.y*i,l=t.y-t.x*i,c=t.y*n-t.x,u=-t.y-t.x*n;if(null!=o){const t="offset"===this.elevationType,h=-10,d=8202,f=o.zOffset,p=new yp(e.x,e.y,f,this.lineSoFar),m=!!t&&L_(e,h,d),_=this.lineSoFar,g=this.distance;if(this.currentVertex)if(m){const t=this.currentVertexIsOutside,o=this.currentVertex,m=new yp(e.x,e.y,f,this.lineSoFar);if(xp(o,m,h,d),!L_(m,h,d)){if(t){this.e1=this.e2=-1,this.distance-=o.dist(p),this.lineSoFar=o.w;const e=this.evaluateLineProgressFeatures(o.w-this.totalFeatureLength*(this.lineClips?this.lineClips.start:0));this.addHalfVertex(o,a,l,s,!1,i,r,e),this.addHalfVertex(o,c,u,s,!0,-n,r,e),this.prevDistance=this.distance}this.distance=this.prevDistance+o.dist(m),this.scaledDistance=this.distance/this.totalDistance,this.addVerticesTo(o,m,a,l,c,u,i,n,r,s),this.distance=g,this.scaledDistance=this.distance/this.totalDistance}}else{const e=this.currentVertex;if(this.currentVertexIsOutside){xp(e,p,h,d),this.e1=this.e2=-1,this.distance-=e.dist(p),this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=e.w;const t=this.evaluateLineProgressFeatures(e.w-this.totalFeatureLength*(this.lineClips?this.lineClips.start:0));this.addHalfVertex(e,a,l,s,!1,i,r,t),this.addHalfVertex(e,c,u,s,!0,-n,r,t),this.prevDistance=this.distance,this.distance=g,this.scaledDistance=this.distance/this.totalDistance}this.addVerticesTo(e,p,a,l,c,u,i,n,r,s)}else m||(this.addHalfVertex(e,a,l,s,!1,i,r,o),this.addHalfVertex(e,c,u,s,!0,-n,r,o));this.currentVertex=p,this.currentVertexIsOutside=m,this.lineSoFar=_}else this.addHalfVertex(e,a,l,s,!1,i,r,o),this.addHalfVertex(e,c,u,s,!0,-n,r,o)}addHalfVertex({x:e,y:t},i,n,r,o,s,a,l){if(this.patternJoinNone&&(0===this.segmentPoints.length&&(this.segmentStart=this.lineSoFar,this.segmentStartf32=Math.fround(this.lineSoFar)),o||this.segmentPoints.push(this.lineSoFar-this.segmentStart,s)),this.layoutVertexArray.emplaceBack((e<<1)+(r?1:0),(t<<1)+(o?1:0),Math.round(63*i)+128,Math.round(63*n)+128,1+(0===s?0:s<0?-1:1),0,this.lineSoFar-this.segmentStartf32),this.lineClips){const e=di(this.lineClips.start,this.lineClips.end,this.scaledDistance);this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,e)}const c=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,c),a.primitiveLength++),o?this.e2=c:this.e1=c,null!=l&&this.zOffsetVertexArray.emplaceBack(l.zOffset,l.variableWidth,l.variableWidth)}updateScaledDistance(){this.lineClips?(this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=this.totalFeatureLength*this.lineClips.start+this.distance):this.lineSoFar=this.distance}updateDistance(e,t){this.prevDistance=this.distance,this.distance+=e.dist(t),this.updateScaledDistance()}}function L_(e,t,i){return e.x<t||e.x>i||e.y<t||e.y>i}let z_,O_;function F_(e,t,i){return t*(Vn/(e.tileSize*Math.pow(2,i-e.tileID.overscaledZ
2)))}Jo(R_,"LineBucket",{omit:["layers","patternFeatures","currentVertex","currentVertexIsOutside"]});const k_=(e,t,i)=>(1-i)*e+i*t;function B_(e,t){return 1/F_(e,1,t.tileZoom)}function N_(e,t,i,n){return e.translatePosMatrix(n||t.tileID.projMatrix,t,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}const V_=e=>{const t=[];U_(e)&&t.push("RENDER_LINE_DASH"),e.paint.get("line-gradient")&&t.push("RENDER_LINE_GRADIENT");const i=e.paint.get("line-trim-offset");0===i[0]&&0===i[1]||t.push("RENDER_LINE_TRIM_OFFSET"),0!==e.paint.get("line-border-width").constantOr(1)&&t.push("RENDER_LINE_BORDER");const n="none"===e.layout.get("line-join").constantOr("miter"),r=!!e.paint.get("line-pattern").constantOr(1);return n&&r&&t.push("LINE_JOIN_NONE"),t};function U_(e){const t=e.paint.get("line-dasharray").value;return"constant"!==t.kind||t.value}let j_;const G_=()=>j_||(j_={layout:z_||(z_=new Ca({"line-cap":new Aa(Pa.layout_line["line-cap"]),"line-join":new Aa(Pa.layout_line["line-join"]),"line-miter-limit":new Ia(Pa.layout_line["line-miter-limit"]),"line-round-limit":new Ia(Pa.layout_line["line-round-limit"]),"line-sort-key":new Aa(Pa.layout_line["line-sort-key"]),"line-z-offset":new Aa(Pa.layout_line["line-z-offset"]),"line-elevation-reference":new Ia(Pa.layout_line["line-elevation-reference"]),"line-cross-slope":new Ia(Pa.layout_line["line-cross-slope"]),visibility:new Ia(Pa.layout_line.visibility),"line-width-unit":new Ia(Pa.layout_line["line-width-unit"])})),paint:O_||(O_=new Ca({"line-opacity":new Aa(Pa.paint_line["line-opacity"]),"line-color":new Aa(Pa.paint_line["line-color"]),"line-translate":new Ia(Pa.paint_line["line-translate"]),"line-translate-anchor":new Ia(Pa.paint_line["line-translate-anchor"]),"line-width":new Aa(Pa.paint_line["line-width"]),"line-gap-width":new Aa(Pa.paint_line["line-gap-width"]),"line-offset":new Aa(Pa.paint_line["line-offset"]),"line-blur":new Aa(Pa.paint_line["line-blur"]),"line-dasharray":new Aa(Pa.paint_line["line-dasharray"]),"line-pattern":new Aa(Pa.paint_line["line-pattern"]),"line-pattern-cross-fade":new Ia(Pa.paint_line["line-pattern-cross-fade"]),"line-gradient":new Ma(Pa.paint_line["line-gradient"]),"line-trim-offset":new Ia(Pa.paint_line["line-trim-offset"]),"line-trim-fade-range":new Ia(Pa.paint_line["line-trim-fade-range"]),"line-trim-color":new Ia(Pa.paint_line["line-trim-color"]),"line-emissive-strength":new Aa(Pa.paint_line["line-emissive-strength"]),"line-border-width":new Aa(Pa.paint_line["line-border-width"]),"line-border-color":new Aa(Pa.paint_line["line-border-color"]),"line-occlusion-opacity":new Ia(Pa.paint_line["line-occlusion-opacity"]),"line-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"}),"line-gradient-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"}),"line-trim-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"}),"line-border-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"})}))},j_);class q_ extends Aa{possiblyEvaluate(e,t){return t=new ga(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,transition:t.transition,worldview:t.worldview}),super.possiblyEvaluate(e,t)}evaluate(e,t,i,n){return t=Object.assign({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,i,n)}}let H_;function $_(e,t){return t>0?t+2*e:e}const W_=rl([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Z_=rl([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),X_=rl([{name:"a_projected_pos",components:4,type:"Float32"}],4);rl([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Y_=rl([{name:"a_auto_z_offset",components:1,type:"Float32"}],4),K_=rl([{name:"a_x_axis",components:3,type:"Float32"},{name:"a_y_axis",components:3,type:"Float32"}]),J_=rl([{name:"a_texb",components:2,type:"Uint16"}]),Q_=rl([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_elevation_from_sea",components:2,type:"Float32"}]),eg=rl([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"},{name:"a_auto_z_offset",components:1,type:"Float32"}]);rl([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const tg=rl([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),ig=rl([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);rl([{name:"triangle",components:3,type:"Uint16"}]),rl([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Uint8",name:"flipState"}]),rl([{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Float32",name:"zOffset"},{type:"Uint8",name:"hasIconTextFit"},{type:"Uint16",name:"elevationFeatureIndex"}
vendor: 6,133 bytes, line 2
2]),rl([{type:"Float32",name:"offsetX"}]),rl([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var ng=24;function rg(e,t,i){return e.sections.forEach(e=>{e.text=function(e,t,i){const n=t.layout.get("text-transform").evaluate(i,{});return"uppercase"===n?e=e.toLocaleUpperCase():"lowercase"===n&&(e=e.toLocaleLowerCase()),_a.applyArabicShaping&&(e=_a.applyArabicShaping(e)),e}(e.text,t,i)}),e}const og={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂","←":"↑","→":"↓"};function sg(e){return"︶"===e||"﹈"===e||"︸"===e||"﹄"===e||"﹂"===e||"︾"===e||"︼"===e||"︺"===e||"︘"===e||"﹀"===e||"︐"===e||"︓"===e||"︔"===e||"`"===e||" ̄"===e||"︑"===e||"︒"===e}function ag(e){return"︵"===e||"﹇"===e||"︷"===e||"﹃"===e||"﹁"===e||"︽"===e||"︻"===e||"︹"===e||"︗"===e||"︿"===e}const lg=4294967296,cg=1/lg,ug="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");let hg=class{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,t,i=this.length){for(;this.pos<i;){const i=this.readVarint(),n=i>>3,r=this.pos;this.type=7&i,e(n,t,this),this.pos===r&&this.skip(i)}return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){const e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){const e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*lg;return this.pos+=8,e}readSFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*lg;return this.pos+=8,e}readFloat(){const e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){const e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){const t=this.buf;let i,n;return n=t[this.pos++],i=127&n,n<128?i:(n=t[this.pos++],i|=(127&n)<<7,n<128?i:(n=t[this.pos++],i|=(127&n)<<14,n<128?i:(n=t[this.pos++],i|=(127&n)<<21,n<128?i:(n=t[this.pos],i|=(15&n)<<28,function(e,t,i){const n=i.buf;let r,o;if(o=n[i.pos++],r=(112&o)>>4,o<128)return dg(e,r,t);if(o=n[i.pos++],r|=(127&o)<<3,o<128)return dg(e,r,t);if(o=n[i.pos++],r|=(127&o)<<10,o<128)return dg(e,r,t);if(o=n[i.pos++],r|=(127&o)<<17,o<128)return dg(e,r,t);if(o=n[i.pos++],r|=(127&o)<<24,o<128)return dg(e,r,t);if(o=n[i.pos++],r|=(1&o)<<31,o<128)return dg(e,r,t);throw new Error("Expected varint not more than 10 bytes")}(i,e,this)))))}readVarint64(){return this.readVarint(!0)}readSVarint(){const e=this.readVarint();return e%2==1?(e+1)/-2:e/2}readBoolean(){return Boolean(this.readVarint())}readString(){const e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&ug?ug.decode(this.buf.subarray(t,e)):function(e,t,i){let n="",r=t;for(;r<i;){const t=e[r];let o,s,a,l=null,c=t>239?4:t>223?3:t>191?2:1;if(r+c>i)break;1===c?t<128&&(l=t):2===c?(o=e[r+1],128==(192&o)&&(l=(31&t)<<6|63&o,l<=127&&(l=null))):3===c?(o=e[r+1],s=e[r+2],128==(192&o)&&128==(192&s)&&(l=(15&t)<<12|(63&o)<<6|63&s,(l<=2047||l>=55296&&l<=57343)&&(l=null))):4===c&&(o=e[r+1],s=e[r+2],a=e[r+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(l=(15&t)<<18|(63&o)<<12|(63&s)<<6|63&a,(l<=65535||l>=1114112)&&(l=null))),null===l?(l=65533,c=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),r+=c}return n}(this.buf,t,e)}readBytes(){const e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){const i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readVarint(t));return e}readPackedSVarint(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFloat());return e}readPackedDouble(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed64());return e}readPackedEnd(){return 2===this.type?this.readVarint()+this.pos:this.pos+1}skip(e){const t=7&e;if(0===t)for(;this.buf[this.pos++]>127;);else if(2===t)this.pos=this.readVarint()+this.pos;else if(5===t)this.pos+=4;else{if(1!==t)throw new Error(`Unimplemented type: ${t}`);this.pos+=8}}writeTag(e,t){this.writeVarint(e<<3|t)}realloc(e){let t=this.length||16;for(;t<this.pos+e;)t*=2;if(t!==this.length){const e=new Uint8Array(t);e.set(this.buf),this.buf=e,this.dataView=new DataView(e.buffer),this.length=t}}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,417 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*cg),!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*cg),!0),this.pos+=8}writeVarint(e){(e=+e||0)>268435455||e<0?function(e,t){let i,n;if(e>=0?(i=e%4294967296|0,n=e/4294967296|0):(i=~(-e%4294967296),n=~(-e/4294967296),4294967295^i?i=i+1|0:(i=0,n=n+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,i){i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,i.buf[i.pos]=127&(e>>>=7)}(i,0,t),function(e,t){const i=(7&e)<<4;t.buf[t.pos++]|=i|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(n,t)}(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++;const t=this.pos;this.pos=function(e,t,i){for(let n,r,o=0;o<t.length;o++){if(n=t.charCodeAt(o),n>55295&&n<57344){if(!r){n>56319||o+1===t.length?(e[i++]=239,e[i++]=191,e[i++]=189):r=n;continue}if(n<56320){e[i++]=239,e[i++]=191,e[i++]=189,r=n;continue}n=r-55296<<10|n-56320|65536,r=null}else r&&(e[i++]=239,e[i++]=191,e[i++]=189,r=null);n<128?e[i++]=n:(n<2048?e[i++]=n>>6|192:(n<65536?e[i++]=n>>12|224:(e[i++]=n>>18|240,e[i++]=n>>12&63|128),e[i++]=n>>6&63|128),e[i++]=63&n|128)}return i}(this.buf,e,this.pos);const i=this.pos-t;i>=128&&fg(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i}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){const t=e.length;this.writeVarint(t),this.realloc(t);for(let i=0;i<t;i++)this.buf[this.pos++]=e[i]}writeRawMessage(e,t){this.pos++;const i=this.pos;e(t,this);const n=this.pos-i;n>=128&&fg(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n}writeMessage(e,t,i){this.writeTag(e,2),this.writeRawMessage(t,i)}writePackedVarint(e,t){t.length&&this.writeMessage(e,pg,t)}writePackedSVarint(e,t){t.length&&this.writeMessage(e,mg,t)}writePackedBoolean(e,t){t.length&&this.writeMessage(e,yg,t)}writePackedFloat(e,t){t.length&&this.writeMessage(e,_g,t)}writePackedDouble(e,t){t.length&&this.writeMessage(e,gg,t)}writePackedFixed32(e,t){t.length&&this.writeMessage(e,vg,t)}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,xg,t)}writePackedFixed64(e,t){t.length&&this.writeMessage(e,bg,t)}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,wg,t)}writeBytesField(e,t){this.writeTag(e,2),this.writeBytes(t)}writeFixed32Field(e,t){this.writeTag(e,5),this.writeFixed32(t)}writeSFixed32Field(e,t){this.writeTag(e,5),this.writeSFixed32(t)}writeFixed64Field(e,t){this.writeTag(e,1),this.writeFixed64(t)}writeSFixed64Field(e,t){this.writeTag(e,1),this.writeSFixed64(t)}writeVarintField(e,t){this.writeTag(e,0),this.writeVarint(t)}writeSVarintField(e,t){this.writeTag(e,0),this.writeSVarint(t)}writeStringField(e,t){this.writeTag(e,2),this.writeString(t)}writeFloatField(e,t){this.writeTag(e,5),this.writeFloat(t)}writeDoubleField(e,t){this.writeTag(e,1),this.writeDouble(t)}writeBooleanField(e,t){this.writeVarintField(e,+t)}};function dg(e,t,i){return i?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function fg(e,t,i){const n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));i.realloc(n);for(let t=i.pos-1;t>=e;t--)i.buf[t+n]=i.buf[t]}function pg(e,t){for(let i=0;i<e.length;i++)t.writeVarint(e[i])}function mg(e,t){for(let i=0;i<e.length;i++)t.writeSVarint(e[i])}function _g(e,t){for(let i=0;i<e.length;i++)t.writeFloat(e[i])}function gg(e,t){for(let i=0;i<e.length;i++)t.writeDouble(e[i])}function yg(e,t){for(let i=0;i<e.length;i++)t.writeBoolean(e[i])}function vg(e,t){for(let i=0;i<e.length;i++)t.writeFixed32(e[i])}function xg(e,t){for(let i=0;i<e.length;i++)t.writeSFixed32(e[i])}function bg(e,t){for(let i=0;i<e.length;
vendor: 4,895 bytes, line 2
2i++)t.writeFixed64(e[i])}function wg(e,t){for(let i=0;i<e.length;i++)t.writeSFixed64(e[i])}function Tg(e,t,i){t.glyphs=[],1===e&&i.readMessage(Sg,t)}function Sg(e,t,i){if(3===e){const{id:e,bitmap:n,width:r,height:o,left:s,top:a,advance:l}=i.readMessage(Eg,{});t.glyphs.push({id:e,bitmap:new ud({width:r+6,height:o+6},n),metrics:{width:r,height:o,left:s,top:a,advance:l}})}else 4===e?t.ascender=i.readSVarint():5===e&&(t.descender=i.readSVarint())}function Eg(e,t,i){1===e?t.id=i.readVarint():2===e?t.bitmap=i.readBytes():3===e?t.width=i.readVarint():4===e?t.height=i.readVarint():5===e?t.left=i.readSVarint():6===e?t.top=i.readSVarint():7===e&&(t.advance=i.readVarint())}const Ig={horizontal:1,vertical:2,horizontalOnly:3};class Ag{constructor(){this.scale=1,this.fontStack="",this.image=null}static forText(e,t){const i=new Ag;return i.scale=e||1,i.fontStack=t,i}static forImage(e){const t=new Ag;return t.image=e,t}}class Mg{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,t,i){const n=new Mg;for(let r=0;r<e.sections.length;r++){const o=e.sections[r];o.image?n.addImageSection(o,i):n.addTextSection(o,t)}return n}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSections(){return this.sections}getSectionIndex(e){return this.sectionIndex[e]}getCodePoint(e){return this.text.codePointAt(e)}verticalizePunctuation(e){this.text=function(e,t){let i="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n+1)||null,o=e.charCodeAt(n-1)||null;i+=!t&&(r&&ia(r)&&!og[e[n+1]]||o&&ia(o)&&!og[e[n-1]])||!og[e[n]]?e[n]:og[e[n]]}return i}(this.text,e)}trim(){let e=0;for(let t=0;t<this.text.length&&Pg[this.text.charCodeAt(t)];t++)e++;let t=this.text.length;for(let i=this.text.length-1;i>=0&&i>=e&&Pg[this.text.charCodeAt(i)];i--)t--;this.text=this.text.substring(e,t),this.sectionIndex=this.sectionIndex.slice(e,t)}substring(e,t){const i=new Mg;return i.text=this.text.substring(e,t),i.sectionIndex=this.sectionIndex.slice(e,t),i.sections=this.sections,i}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,t)=>Math.max(e,this.sections[t].scale),0)}addTextSection(e,t){this.text+=e.text,this.sections.push(Ag.forText(e.scale,e.fontStack||t));const i=this.sections.length-1;for(let t=0;t<e.text.length;++t)this.sectionIndex.push(i)}addImageSection(e,t){const i=e.image?e.image.getPrimary():null;if(!i)return void We("Can't add FormattedSection with an empty image.");i.scaleSelf(t);const n=this.getNextImageSectionCharCode();n?(this.text+=String.fromCodePoint(n),this.sections.push(Ag.forImage(i)),this.sectionIndex.push(this.sections.length-1)):We("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Cg(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m=1){const _=Mg.fromFeature(e,r,m);h===Ig.vertical&&_.verticalizePunctuation(d);let g=[];const y=function(e,t,i,n,r,o){if(!e)return[];const s=[],a=function(e,t,i,n,r,o){let s=0;for(let i=0;i<e.length();i++){const a=e.getSection(i);s+=Rg(e.getCodePoint(i),a,n,r,t,o)}return s/Math.max(1,Math.ceil(s/i))}(e,t,i,n,r,o),l=e.text.indexOf("​")>=0;let c=0;for(let i=0;i<e.length();i++){const h=e.getSection(i),d=e.getCodePoint(i);if(Pg[d]||(c+=Rg(d,h,n,r,t,o)),i<e.length()-1){const t=!((u=d)<11904||!(Cs(u)||Is(u)||$s(u)||Gs(u)||Ls(u)||xs(u)||Ps(u)||Ts(u)||zs(u)||Fs(u)||Rs(u)||Xs(u)||Ss(u)||ws(u)||bs(u)||Ds(u)||Es(u)||Hs(u)||Bs(u)||ks(u)));(Dg[d]||t||h.image)&&s.push(Og(i+1,c,a,s,zg(d,e.getCodePoint(i+1),t&&l),!1))}}var u;return Fg(Og(e.length(),c,a,s,0,!0))}(_,c,o,t,n,f),{processBidirectionalText:v,processStyledBidirectionalText:x}=_a;if(v&&1===_.sections.length){const e=v(_.toString(),y);for(const t of e){const e=new Mg;e.text=t,e.sections=_.sections;for(let i=0;i<t.length;i++)e.sectionIndex.push(0);g.push(e)}}else if(x){const e=x(_.text,_.sectionIndex,y);for(const t of e){const e=new Mg;e.text=t[0],e.sectionIndex=t[1],e.sections=_.sections,g.push(e)}}else g=function(e,t){const i=[],n=e.text;let r=0;for(const n of t)i.push(e.substring(r,n)),r=n;return r<n.length&&i.push(e.substring(r,n.length)),i}(_,y);const b=[],w={positionedLines:b,text:_.toString(),top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:h,iconsInText:!1,verticalizable:!1,hasBaseline:!1};if(function(e,t,i,n,r,o,s,a,l,c,u,h){let d=0,f=0,p=0;const m="right"===a?1:"left"===a?0:.5;let _=!1;for(const e of r){const i=e.getSections();for(const e of i){if(e.image)continue;const i=t[e.fontStack];if(i&&(_=void 0!==i.ascender&&void 0!==i.descender,!_))break}if(!_)break}let g=0;for(const s of r){s.trim();const r=s.getMaxScale(),a=(r-1)*ng,v={positionedGlyphs:[],lineOffset:0};e.positionedLines[g]=v;const x=v.positionedGlyphs;let b=0;if(!s.length()){f+=o,++g;continue}let w=0,T=0;for(let o=0;o<s.length();
2o++){const a=s.getSection(o),p=s.getSectionIndex(o),m=s.getCodePoint(o);let g=a.scale,v=null,S=null,E=null,I=ng,A=0,M=l;M===Ig.vertical&&(12312===(y=m)||12313===y||12316===y||12540===y||12448===y)&&(M=Ig.horizontal);const C=!(M===Ig.horizontal||!u&&!ta(m)||u&&(Pg[m]||na(m)));if(a.image){const t=n.get(a.image.toString());if(!t)continue;E=a.image,e.iconsInText=e.iconsInText||!0,S=t.paddedRect;const i=t.displaySize;g=g*ng/h,v={width:i[0],height:i[1],left:0,top:-3,advance:C?i[1]:i[0],localGlyph:!1},A=_?-v.height*g:r*ng-17-i[1]*g,I=v.advance;const o=(C?i[0]:i[1])*g-ng*r;o>0&&o>b&&(b=o)}else{const e=i[a.fontStack];if(!e)continue;e[m]&&(S=e[m]);const n=t[a.fontStack];if(!n)continue;const o=n.glyphs[m];if(!o)continue;if(v=o.metrics,I=8203!==m?ng:0,_){const e=void 0!==n.ascender?Math.abs(n.ascender):0,t=void 0!==n.descender?Math.abs(n.descender):0,i=(e+t)*g;w<i&&(w=i,T=(e-t)/2*g),A=-e*g}else A=(r-g)*ng-17}C?(e.verticalizable=!0,x.push({glyph:m,image:E,x:d,y:f+A,vertical:C,scale:g,localGlyph:v.localGlyph,fontStack:a.fontStack,sectionIndex:p,metrics:v,rect:S}),d+=I*g+c):(x.push({glyph:m,image:E,x:d,y:f+A,vertical:C,scale:g,localGlyph:v.localGlyph,fontStack:a.fontStack,sectionIndex:p,metrics:v,rect:S}),d+=v.advance*g+c)}0!==x.length&&(p=Math.max(d-c,p),_?Bg(x,m,b,T,o*r/2):Bg(x,m,b,0,o/2)),d=0;const S=o*r+b;v.lineOffset=Math.max(b,a),f+=S,++g}var y;const v=f,{horizontalAlign:x,verticalAlign:b}=kg(s);(function(e,t,i,n,r,o){const s=(t-i)*r,a=-o*n;for(const t of e)for(const e of t.positionedGlyphs)e.x+=s,e.y+=a})(e.positionedLines,m,x,b,p,v),e.top+=-b*v,e.bottom=e.top+v,e.left+=-x*p,e.right=e.left+p,e.hasBaseline=_}(w,t,i,n,g,s,a,l,h,c,d,p),!function(e){for(const t of e)if(0!==t.positionedGlyphs.length)return!1;return!0}(b))return w}const Pg={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Dg={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 Rg(e,t,i,n,r,o){if(t.image){const e=n.get(t.image.toString());return e?e.displaySize[0]*t.scale*ng/o+r:0}{const n=i[t.fontStack],o=n&&n.glyphs[e];return o?o.metrics.advance*t.scale+r:0}}function Lg(e,t,i,n){const r=Math.pow(e-t,2);return n?e<t?r/2:2*r:r+Math.abs(i)*i}function zg(e,t,i){let n=0;return 10===e&&(n-=1e4),i&&(n+=150),40!==e&&65288!==e||(n+=50),41!==t&&65289!==t||(n+=50),n}function Og(e,t,i,n,r,o){let s=null,a=Lg(t,i,r,o);for(const e of n){const n=Lg(t-e.x,i,r,o)+e.badness;n<=a&&(s=e,a=n)}return{index:e,x:t,priorBreak:s,badness:a}}function Fg(e){return e?Fg(e.priorBreak).concat(e.index):[]}function kg(e){let t=.5,i=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:t,verticalAlign:i}}function Bg(e,t,i,n,r){if(!(t||i||n||r))return;const o=e.length-1,s=e[o],a=(s.x+s.metrics.advance*s.scale)*t;for(let t=0;t<=o;t++)e[t].x-=a,e[t].y+=i+n+r}function Ng(e){return void 0!==e.imagePrimary&&void 0!==e.top&&void 0!==e.bottom&&void 0!==e.left&&void 0!==e.right}function Vg(e,t,i,n){const{horizontalAlign:r,verticalAlign:o}=kg(n),s=i[0]-e.displaySize[0]*r,a=i[1]-e.displaySize[1]*o;return{imagePrimary:e,imageSecondary:t,top:a,bottom:a+e.displaySize[1],left:s,right:s+e.displaySize[0]}}function Ug(e,t,i,n,r,o){const s=e.imagePrimary;let a;if(s.content){const e=s.content,t=s.pixelRatio||1;a=[e[0]/t,e[1]/t,s.displaySize[0]-e[2]/t,s.displaySize[1]-e[3]/t]}const l=t.left*o,c=t.right*o;let u,h,d,f;"width"===i||"both"===i?(f=r[0]+l-n[3],h=r[0]+c+n[1]):(f=r[0]+(l+c-s.displaySize[0])/2,h=f+s.displaySize[0]);const p=t.top*o,m=t.bottom*o;return"height"===i||"both"===i?(u=r[1]+p-n[0],d=r[1]+m+n[2]):(u=r[1]+(p+m-s.displaySize[1])/2,d=u+s.displaySize[1]),{imagePrimary:s,imageSecondary:void 0,top:u,right:h,bottom:d,left:f,collisionPadding:a}}function jg(e){return!e.imagePrimary.stretchX}function Gg(e){return!e.imagePrimary.stretchY}function qg(e){return{width:e.right-e.left,height:e.bottom-e.top}}const Hg=128;function $g(e,t,i){const{expression:n}=t;if("constant"===n.kind)return{kind:"constant",layoutSize:n.evaluate(new ga(e+1,{worldview:i}))};if("source"===n.kind)return{kind:"source"};{const{zoomStops:t,interpolationType:r}=n;let o=0;for(;o<t.length&&t[o]<=e;)o++;o=Math.max(0,o-1);let s=o;for(;s<t.length&&t[s]<e+1;)s++;s=Math.min(t.length-1,s);const a=t[o],l=t[s];return"composite"===n.kind?{kind:"composite",minZoom:a,maxZoom:l,interpolationType:r}:{kind:"camera",minZoom:a,maxZoom:l,minSize:n.evaluate(new ga(a,{worldview:i})),maxSize:n.evaluate(new ga(l,{worldview:i})),interpolationType:r}}}function Wg(e,{uSize:t,uSizeT:i},{lowerSize:n,upperSize:r}
vendor: 6,435 bytes, line 2
2){return"source"===e.kind?n/Hg:"composite"===e.kind?di(n/Hg,r/Hg,i):t}function Zg(e,t,i=1){let n=0,r=0;if("constant"===e.kind)r=e.layoutSize*i;else if("source"!==e.kind){const{interpolationType:o,minZoom:s,maxZoom:a}=e,l=o?ze(Hr.interpolationFactor(o,t,s,a),0,1):0;"camera"===e.kind?r=di(e.minSize,e.maxSize,l)*i:n=l*i}return{uSizeT:n,uSize:r}}class Xg extends Se{constructor(e,t,i,n,r){super(e,t),this.angle=n,this.z=i,void 0!==r&&(this.segment=r)}clone(){return new Xg(this.x,this.y,this.z,this.angle,this.segment)}}function Yg(e,t,i,n,r){if(void 0===t.segment)return!0;let o=t,s=t.segment+1,a=0;for(;a>-i/2;){if(s--,s<0)return!1;a-=e[s].dist(o),o=e[s]}a+=e[s].dist(e[s+1]),s++;const l=[];let c=0;for(;a<i/2;){const t=e[s],i=e[s+1];if(!i)return!1;let o=e[s-1].angleTo(t)-t.angleTo(i);for(o=Math.abs((o+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:a,angleDelta:o}),c+=o;a-l[0].distance>n;)c-=l.shift().angleDelta;if(c>r)return!1;s++,a+=t.dist(i)}return!0}function Kg(e){let t=0;for(let i=0;i<e.length-1;i++)t+=e[i].dist(e[i+1]);return t}function Jg(e,t,i){return e?.6*t*i:0}function Qg(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function ey(e,t,i,n,r,o){const s=Jg(i,r,o),a=Qg(i,n)*o;let l=0;const c=Kg(e)/2;for(let i=0;i<e.length-1;i++){const n=e[i],r=e[i+1],o=n.dist(r);if(l+o>c){const u=(c-l)/o,h=di(n.x,r.x,u),d=di(n.y,r.y,u),f=new Xg(h,d,0,r.angleTo(n),i);return!s||Yg(e,f,a,s,t)?f:void 0}l+=o}}function ty(e,t,i,n,r,o,s,a,l){const c=Jg(n,o,s),u=Qg(n,r),h=u*s,d=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-h<t/4&&(t=h+t/4),iy(e,d?t/2*a%t:(u/2+2*o)*s*a%t,t,c,i,h,d,!1,l)}function iy(e,t,i,n,r,o,s,a,l){const c=o/2,u=Kg(e);let h=0,d=t-i,f=[];for(let t=0;t<e.length-1;t++){const s=e[t],a=e[t+1],p=s.dist(a),m=a.angleTo(s);for(;d+i<h+p;){d+=i;const _=(d-h)/p,g=di(s.x,a.x,_),y=di(s.y,a.y,_);if(g>=0&&g<l&&y>=0&&y<l&&d-c>=0&&d+c<=u){const i=new Xg(g,y,0,m,t);n&&!Yg(e,i,o,n,r)||f.push(i)}}h+=p}return a||f.length||s||(f=iy(e,h/2,i,n,r,o,s,!0,l)),f}function ny(e){let t=0,i=0;for(const n of e)t+=n.w*n.h,i=Math.max(i,n.w);e.sort((e,t)=>t.h-e.h);const n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),i),h:1/0}];let r=0,o=0;for(const t of e)for(let e=n.length-1;e>=0;e--){const i=n[e];if(!(t.w>i.w||t.h>i.h)){if(t.x=i.x,t.y=i.y,o=Math.max(o,t.y+t.h),r=Math.max(r,t.x+t.w),t.w===i.w&&t.h===i.h){const t=n.pop();t&&e<n.length&&(n[e]=t)}else t.h===i.h?(i.x+=t.w,i.w-=t.w):t.w===i.w?(i.y+=t.h,i.h-=t.h):(n.push({x:i.x+t.w,y:i.y,w:i.w-t.w,h:t.h}),i.y+=t.h,i.h-=t.h);break}}return{w:r,h:o,fill:t/(r*o)||0}}Jo(Xg,"Anchor");class ry{static getImagePositionScale(e,t,i){if(t&&e){const{sx:t,sy:i}=e;return{x:t,y:i}}return{x:i,y:i}}constructor(e,t,i,n){this.paddedRect=e;const{pixelRatio:r,version:o,stretchX:s,stretchY:a,content:l,sdf:c,usvg:u}=t;this.pixelRatio=r,this.stretchX=s,this.stretchY=a,this.content=l,this.version=o,this.padding=i,this.sdf=c,this.usvg=u,this.scale=ry.getImagePositionScale(n,u,r)}get tl(){return[this.paddedRect.x+this.padding,this.paddedRect.y+this.padding]}get br(){return[this.paddedRect.x+this.paddedRect.w-this.padding,this.paddedRect.y+this.paddedRect.h-this.padding]}get displaySize(){return[(this.paddedRect.w-2*this.padding)/this.scale.x,(this.paddedRect.h-2*this.padding)/this.scale.y]}}function oy(e,t,i){const n=ki.parse(e),r=function(e,t,i=[1,1]){return{x:0,y:0,w:(e.data?e.data.width:e.width*i[0])+2*t,h:(e.data?e.data.height:e.height*i[1])+2*t}}(t,i,[n.sx,n.sy]);return{bin:r,imagePosition:new ry(r,t,i,n),imageVariant:n}}class sy{constructor(e,t,i){const n=new Map,r=new Map;this.haveRenderCallbacks=[];const o=[];this.addImages(e,n,1,o),this.addImages(t,r,2,o);const{w:s,h:a}=ny(o),l=new hd({width:s||1,height:a||1});for(const[t,i]of e.entries()){const e=n.get(t).paddedRect;hd.copy(i.data,l,{x:0,y:0},{x:e.x+1,y:e.y+1},i.data,null,i.sdf)}for(const[e,n]of t.entries()){const t=r.get(e),o=t.paddedRect;let s=t.padding;const a=o.x+s,c=o.y+s,u=n.data.width,h=n.data.height;s=s>1?s-1:s,hd.copy(n.data,l,{x:0,y:0},{x:a,y:c},n.data,i),hd.copy(n.data,l,{x:0,y:h-s},{x:a,y:c-s},{width:u,height:s},i),hd.copy(n.data,l,{x:0,y:0},{x:a,y:c+h},{width:u,height:s},i),hd.copy(n.data,l,{x:u-s,y:0},{x:a-s,y:c},{width:s,height:h},i),hd.copy(n.data,l,{x:0,y:0},{x:a+u,y:c},{width:s,height:h},i),hd.copy(n.data,l,{x:u-s,y:h-s},{x:a-s,y:c-s},{width:s,height:s},i),hd.copy(n.data,l,{x:0,y:h-s},{x:a+u,y:c-s},{width:s,height:s},i),hd.copy(n.data,l,{x:0,y:0},{x:a+u,y:c+h},{width:s,height:s},i),hd.copy(n.data,l,{x:u-s,y:0},{x:a-s,y:c+h},{width:s,height:s},i)}this.lut=i,this.image=l,this.iconPositions=n,this.patternPositions=r}addImages(e,t,i,n){for(const[r,o]of e.entries()){const{bin:e,imagePosition:s,imageVariant:a}=oy(r,o,i);t.set(r,s),n.push(e),o.hasRenderCallback&&this.haveRenderCallbacks.push(a.id)}}patchUpdatedImages(e,t,i){this.haveRenderCallbacks=this.haveRenderCallbacks.filter(t=>e.hasImage(t,i)),e.dispatchRenderCallbacks(this.haveRenderCallbacks,i);for(const n of e.getUpdatedImages(i)){for(const r of this.iconPositions.keys()){const o=ki.parse(r);if(ri.isEqual(o.id,n)){const o=e.getImage(n,i);this.patchUpdatedImage(this.iconPositions.get(r),o,t,null)}}for(const r of this.patternPositions.keys()){const o=ki.parse(r);if(ri.isEqual(o.id,n)){const o=e.getImage(n,i);this.patchUpdatedImage(this.patternPositions.get(r),o,t,this.lut)}}}}patchUpdatedImage(e,t,i,n=null){if(!e||!t)return;if(e.version===t.version)return;e.version=t.version;const[r,o]=e.tl,s=e.sdf;if(this.lut||s){const e={width:t.data.width,height:t.data.height},a=new hd(e);hd.copy(t.data,a,{x:0,y:0},{x:0,y:0},e,n,s),i.update(a,{position:{x:r,y:o}})}else i.update(t.data,{position:{x:r,y:o}})}}Jo(ry,"ImagePosition"),Jo(sy,"ImageAtlas");const ay=1e20;function ly(e,t,i,n,r,o,s,a,l){for(let c=t;c<t+n;c++)cy(e,i*o+c,o,r,s,a,l);for(let c=i;c<i+r;c++)cy(e,c*o+t,1,n,s,a,l)}function cy(e,t,i,n,r,o,s){o[0]=0,s[0]=-ay,s[1]=ay,r[0]=e[t];for(let a=1,l=0,c=0;a<n;a++){r[a]=e[t+a*i];const n=a*a;do{const e=o[l];c=(r[a]-r[e]+n-e*e)/(a-e)/2}while(c<=s[l]&&--l>-1);l++,o[l]=a,s[l]=c,s[l+1]=ay}for(let a=0,l=0;a<n;a++){for(;s[l+1]<a;)l++;const n=o[l],c=a-n;e[t+a*i]=r[n]+c*c}}const uy={none:0,ideographs:1,all:2};class hy{constructor(e,t,i){this.requestManager=e,this.localGlyphMode=t,this.localFontFamily=i,this.url="",this.entries={},this.localGlyphs={200:{},400:{},500:{},900:{}}}setURL(e){this.url=e}getGlyphs(e,t){const i=[],n=this.url||st.GLYPHS_URL;for(const t in e)for(const n of e[t])i.push({stack:t,id:n});
2ke(i,({stack:e,id:t},i)=>{let r=this.entries[e];r||(r=this.entries[e]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let o=r.glyphs[t];if(void 0!==o)return void i(null,{stack:e,id:t,glyph:o});if(o=this._tinySDF(r,e,t),o)return r.glyphs[t]=o,void i(null,{stack:e,id:t,glyph:o});const s=Math.floor(t/256);if(256*s>65535)return We("glyphs > 65535 not supported"),void i(null,{stack:e,id:t,glyph:o});if(r.ranges[s])return void i(null,{stack:e,id:t,glyph:o});let a=r.requests[s];a||(a=r.requests[s]=[],hy.loadGlyphRange(e,s,n,this.requestManager,(e,t)=>{if(t){r.ascender=t.ascender,r.descender=t.descender;for(const e in t.glyphs)this._doesCharSupportLocalGlyph(+e)||(r.glyphs[+e]=t.glyphs[+e]);r.ranges[s]=!0}for(const i of a)i(e,t);delete r.requests[s]})),a.push((n,r)=>{n?i(n):r&&i(null,{stack:e,id:t,glyph:r.glyphs[t]||null})})},(e,i)=>{if(e)t(e);else if(i){const e={};for(const{stack:t,id:n,glyph:r}of i)void 0===e[t]&&(e[t]={}),void 0===e[t].glyphs&&(e[t].glyphs={}),e[t].glyphs[n]=r&&{id:r.id,bitmap:r.bitmap.clone(),metrics:r.metrics},e[t].ascender=this.entries[t].ascender,e[t].descender=this.entries[t].descender;t(null,e)}})}_doesCharSupportLocalGlyph(e){return this.localGlyphMode!==uy.none&&(this.localGlyphMode===uy.all?!!this.localFontFamily:!!this.localFontFamily&&(Fs(e)||Vs(e)||Ss(e)||Es(e)||Ts(e)||zs(e)||Ks(e)||Ys(e)))}_tinySDF(e,t,i){const n=this.localFontFamily;if(!n||!this._doesCharSupportLocalGlyph(i))return;let r=e.tinySDF;if(!r){let i="400";/bold/i.test(t)?i="900":/medium/i.test(t)?i="500":/light/i.test(t)&&(i="200"),r=e.tinySDF=new hy.TinySDF({fontFamily:n,fontWeight:i,fontSize:48,buffer:6,radius:16}),r.fontWeight=i}if(this.localGlyphs[r.fontWeight][i])return this.localGlyphs[r.fontWeight][i];const o=String.fromCodePoint(i),{data:s,width:a,height:l,glyphWidth:c,glyphHeight:u,glyphLeft:h,glyphTop:d,glyphAdvance:f}=r.draw(o);return this.localGlyphs[r.fontWeight][i]={id:i,bitmap:new ud({width:a,height:l},s),metrics:{width:c/2,height:u/2,left:h/2,top:d/2-27,advance:f/2,localGlyph:!0}}}}hy.loadGlyphRange=function(e,t,i,n,r){const o=256*t,s=o+255,a=n.transformRequest(n.normalizeGlyphsURL(i).replace("{fontstack}",e).replace("{range}",`${o}-${s}`),Ot.Glyphs);Nt(a,(e,t)=>{if(e)r(e);else if(t){const e={},i=function(e){return new hg(e).readFields(Tg,{})}(t);for(const t of i.glyphs)e[t.id]=t;r(null,{glyphs:e,ascender:i.ascender,descender:i.descender})}})},hy.TinySDF=class{constructor({fontSize:e=24,buffer:t=3,radius:i=8,cutoff:n=.25,fontFamily:r="sans-serif",fontWeight:o="normal",fontStyle:s="normal",lang:a=null}={}){this.buffer=t,this.cutoff=n,this.radius=i,this.lang=a;const l=this.size=e+4*t,c=this._createCanvas(l),u=this.ctx=c.getContext("2d",{willReadFrequently:!0});u.font=`${s} ${o} ${e}px ${r}`,u.textBaseline="alphabetic",u.textAlign="left",u.fillStyle="black",this.gridOuter=new Float64Array(l*l),this.gridInner=new Float64Array(l*l),this.f=new Float64Array(l),this.z=new Float64Array(l+1),this.v=new Uint16Array(l)}_createCanvas(e){const t=document.createElement("canvas");return t.width=t.height=e,t}draw(e){const{width:t,actualBoundingBoxAscent:i,actualBoundingBoxDescent:n,actualBoundingBoxLeft:r,actualBoundingBoxRight:o}=this.ctx.measureText(e),s=Math.ceil(i),a=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(o-r))),l=Math.min(this.size-this.buffer,s+Math.ceil(n)),c=a+2*this.buffer,u=l+2*this.buffer,h=Math.max(c*u,0),d=new Uint8ClampedArray(h),f={data:d,width:c,height:u,glyphWidth:a,glyphHeight:l,glyphTop:s,glyphLeft:0,glyphAdvance:t};if(0===a||0===l)return f;const{ctx:p,buffer:m,gridInner:_,gridOuter:g}=this;this.lang&&(p.lang=this.lang),p.clearRect(m,m,a,l),p.fillText(e,m,m+s);const y=p.getImageData(m,m,a,l);g.fill(ay,0,h),_.fill(0,0,h);for(let e=0;e<l;e++)for(let t=0;t<a;t++){const i=y.data[4*(e*a+t)+3]/255;if(0===i)continue;const n=(e+m)*c+t+m;if(1===i)g[n]=0,_[n]=ay;else{const e=.5-i;g[n]=e>0?e*e:0,_[n]=e<0?e*e:0}}ly(g,0,0,c,u,c,this.f,this.v,this.z),ly(_,m,m,a,l,c,this.f,this.v,this.z);for(let e=0;e<h;e++){const t=Math.sqrt(g[e])-Math.sqrt(_[e]);d[e]=Math.round(255-255*(t/this.radius+this.cutoff))}return f}};function dy(e,t){return e+t[1]-t[0]}function fy(e,t,i,n,r=1){const o=[],s=e.imagePrimary,a=s.pixelRatio,l=s.paddedRect.w-2,c=s.paddedRect.h-2,u=(e.right-e.left)*r,h=(e.bottom-e.top)*r,d=s.stretchX||[[0,l]],f=s.stretchY||[[0,c]],p=d.reduce(dy,0),m=f.reduce(dy,0),_=l-p,g=c-m;let y=0,v=p,x=0,b=m,w=0,T=_,S=0,E=g;if(s.content&&n){const e=s.content;y=my(d,0,e[0]),x=my(f,0,e[1]),v=my(d,e[0],e[2]),b=my(f,e[1],e[3]),w=e[0]-y,S=e[1]-x,T=e[2]-e[0]-v,E=e[3]-e[1]-b}const I=(n,o,l,c)=>{const d=yy(n.stretch-y,v,u,e.left*r),f=vy(n.fixed-w,T,n.stretch,p),_=yy(o.stretch-x,b,h,e.to
vendor: 5,045 bytes, line 2
2p*r),g=vy(o.fixed-S,E,o.stretch,m),I=yy(l.stretch-y,v,u,e.left*r),A=vy(l.fixed-w,T,l.stretch,p),M=yy(c.stretch-x,b,h,e.top*r),C=vy(c.fixed-S,E,c.stretch,m),P=new Se(d,_),D=new Se(I,_),R=new Se(I,M),L=new Se(d,M),z=new Se(f/a,g/a),O=new Se(A/a,C/a),F=t*Math.PI/180;if(F){const e=Math.sin(F),t=Math.cos(F),i=[t,-e,e,t];P._matMult(i),D._matMult(i),L._matMult(i),R._matMult(i)}const k=n.stretch+n.fixed,B=l.stretch+l.fixed,N=o.stretch+o.fixed,V=c.stretch+c.fixed,U=e.imageSecondary;return{tl:P,tr:D,bl:L,br:R,texPrimary:{x:s.paddedRect.x+1+k,y:s.paddedRect.y+1+N,w:B-k,h:V-N},texSecondary:U?{x:U.paddedRect.x+1+k,y:U.paddedRect.y+1+N,w:B-k,h:V-N}:void 0,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:z,pixelOffsetBR:O,minFontScaleX:T/a/u,minFontScaleY:E/a/h,isSDF:i}};if(n&&(s.stretchX||s.stretchY)){const e=_y(d,_,p),t=_y(f,g,m);for(let i=0;i<e.length-1;i++){const n=e[i],r=e[i+1];for(let e=0;e<t.length-1;e++)o.push(I(n,t[e],r,t[e+1]))}}else o.push(I({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:c+1}));return o}function py(e,t){const i=e.stretchY||[[0,e.paddedRect.h-2]];return t&&(e.stretchX||e.stretchY)?gy(e.stretchX||[[0,e.paddedRect.w-2]])*gy(i):1}function my(e,t,i){let n=0;for(const r of e)n+=Math.max(t,Math.min(i,r[1]))-Math.max(t,Math.min(i,r[0]));return n}function _y(e,t,i){const n=[{fixed:-1,stretch:0}];for(const[t,i]of e){const e=n[n.length-1];n.push({fixed:t-e.stretch,stretch:e.stretch}),n.push({fixed:t-e.stretch,stretch:e.stretch+(i-t)})}return n.push({fixed:t+1,stretch:i}),n}function gy(e){return 2*e.length+1}function yy(e,t,i,n){return e/t*i+n}function vy(e,t,i,n){return e-t*i/n}function xy(e,t,i,n){const r=t+e.positionedLines[n].lineOffset;return 0===n?i+r/2:i+(r+(t+e.positionedLines[n-1].lineOffset))/2}function by(e,t=1,i=!1){let n=1/0,r=1/0,o=-1/0,s=-1/0;const a=e[0];for(let e=0;e<a.length;e++){const t=a[e];(!e||t.x<n)&&(n=t.x),(!e||t.y<r)&&(r=t.y),(!e||t.x>o)&&(o=t.x),(!e||t.y>s)&&(s=t.y)}const l=Math.min(o-n,s-r);let c=l/2;const u=new Nn([],wy);if(0===l)return new Se(n,r);for(let t=n;t<o;t+=l)for(let i=r;i<s;i+=l)u.push(new Ty(t+c,i+c,c,e));let h=function(e){let t=0,i=0,n=0;const r=e[0];for(let e=0,o=r.length,s=o-1;e<o;s=e++){const o=r[e],a=r[s],l=o.x*a.y-a.x*o.y;i+=(o.x+a.x)*l,n+=(o.y+a.y)*l,t+=3*l}return new Ty(i/t,n/t,0,e)}(e),d=u.length;for(;u.length;){const n=u.pop();(n.d>h.d||!h.d)&&(h=n,i&&console.log("found best %d after %d probes",Math.round(1e4*n.d)/1e4,d)),n.max-h.d<=t||(c=n.h/2,u.push(new Ty(n.p.x-c,n.p.y-c,c,e)),u.push(new Ty(n.p.x+c,n.p.y-c,c,e)),u.push(new Ty(n.p.x-c,n.p.y+c,c,e)),u.push(new Ty(n.p.x+c,n.p.y+c,c,e)),d+=4)}return i&&(console.log(`num probes: ${d}`),console.log(`best distance: ${h.d}`)),h.p}function wy(e,t){return t.max-e.max}class Ty{constructor(e,t,i,n){this.p=new Se(e,t),this.h=i,this.d=function(e,t){let i=!1,n=1/0;for(let r=0;r<t.length;r++){const o=t[r];for(let t=0,r=o.length,s=r-1;t<r;s=t++){const r=o[t],a=o[s];r.y>e.y!=a.y>e.y&&e.x<(a.x-r.x)*(e.y-r.y)/(a.y-r.y)+r.x&&(i=!i),n=Math.min(n,th(e,r,a))}}return(i?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}}const Sy=Object.keys,Ey=Number.POSITIVE_INFINITY,Iy=Math.sqrt(2);function Ay(e,t,i,n,r){const o=Ng(e)&&e.collisionPadding?e.collisionPadding:[0,0,0,0],s={top:e.top-o[1],bottom:e.bottom+o[3],left:e.left-o[0],right:e.right+o[2],scaled:!1};return void 0!==n&&function(e,t){e.top*=t,e.bottom*=t,e.left*=t,e.right*=t,e.scaled=!0}(s,n),i&&function(e,t){if(!t)return;const i=Me(t),n=new Se(e.left,e.top),r=new Se(e.right,e.top),o=new Se(e.left,e.bottom),s=new Se(e.right,e.bottom),a=new Se(0,0);n._rotateAround(i,a),r._rotateAround(i,a),o._rotateAround(i,a),s._rotateAround(i,a),e.left=Math.min(n.x,r.x,o.x,s.x),e.right=Math.max(n.x,r.x,o.x,s.x),e.top=Math.min(n.y,r.y,o.y,s.y),e.bottom=Math.max(n.y,r.y,o.y,s.y)}(s,i),r&&(s.left+=r[0],s.right+=r[0],s.top+=r[1],s.bottom+=r[1]),t?{top:Math.min(t.top,s.top),bottom:Math.max(t.bottom,s.bottom),left:Math.min(t.left,s.left),right:Math.max(t.right,s.right),scaled:t.scaled||s.scaled}:s}function My(e,[t,i]){let n=0,r=0;if(i===Ey){t<0&&(t=0);const i=t/Iy;switch(e){case"top-right":case"top-left":r=i-7;break;case"bottom-right":case"bottom-left":r=7-i;break;case"bottom":r=7-t;break;case"top":r=t-7}switch(e){case"top-right":case"bottom-right":n=-i;break;case"top-left":case"bottom-left":n=i;break;case"left":n=t;break;case"right":n=-t}}else{switch(t=Math.abs(t),i=Math.abs(i),e){case"top-right":case"top-left":case"top":r=i-7;break;case"bottom-right":case"bottom-left":case"bottom":r=7-i}switch(e){case"top-right":case"bottom-right":case"right":n=-t;break;case"top-left":case"bottom-left":case"left":n=t}}return[n,r]}function Cy(e,t,i,n,r,o,s,a,l,c,u,h,d,f){const p=e.layers[0],m=p.appearances;if(0===m.length)return{iconBBox:null,iconVerticalBBox:null,textBBox:null,textVerticalBBox:null};const _={iconBBox:null,iconVerticalBBox:null},g={textBBox:null,textVerticalBBox:null},{baseIconRotate:y,baseTextRotate:v,iconScaleFactor:x}=function(e,t,i){const n=e.get("icon-rotate").evaluate(t,{}
2,i),r=e.get("text-rotate").evaluate(t,{},i),[o,s]=e.get("icon-size-scale-range");return{baseIconRotate:n,baseTextRotate:r,iconScaleFactor:ze(1,o,s)}}(n,r,o);t&&(_.iconBBox=Ay(t,_.iconBBox,y,s),i)&&(_.iconVerticalBBox=Ay(i,_.iconVerticalBBox,y+90,s));const b=Hy(h.horizontal);b&&(g.textBBox=Ay(b,g.textBBox,v,1,f)),h.vertical&&(g.textVerticalBBox=Ay(h.vertical,g.textVerticalBBox,v+90,1,f));for(const i of m)i.hasIconProperties()&&Py(_,e,p,i,r,o,a,y,s,l,t,c,x,u),i.hasTextProperties()&&Dy(g,p,i,r,o,f,v,d,b,h.vertical);return{iconBBox:_.iconBBox,iconVerticalBBox:_.iconVerticalBBox,textBBox:g.textBBox,textVerticalBBox:g.textVerticalBBox}}function Py(e,t,i,n,r,o,s,a,l,c,u,h,d,f){const{appearanceIconOffset:p,appearanceIconRotate:m,appearanceIconSize:_}=function(e,t,i,n,r,o,s,a){const l=e.hasProperty("icon-offset")?t.getAppearanceValueAndResolveTokens(e,"icon-offset",i,n,[]):null,c=l&&Array.isArray(l)?l:r,u=e.hasProperty("icon-rotate")?t.getAppearanceValueAndResolveTokens(e,"icon-rotate",i,n,[]):null,h="number"==typeof u?u:o,d=e.hasProperty("icon-size")?t.getAppearanceValueAndResolveTokens(e,"icon-size",i,n,[]):null;return{appearanceIconOffset:c,appearanceIconRotate:h,appearanceIconSize:"number"==typeof d?d*a.iconScaleFactor:s}}(n,i,r,o,s,a,l,c);let g=null,y=null,v=null;n.hasProperty("icon-image")?v=function(e,t,i,n,r,o,s){let a=null;const l=t.getAppearanceValueAndResolveTokens(i,"icon-image",n,r,[]);if(l){const t=e.getResolvedImageFromTokens(l),c=i.getUnevaluatedProperty("icon-size"),u=zy(t,$g(e.zoom,c,e.worldview),c,r,e.zoom,n,e.pixelRatio,s,e.worldview);a=o.get(u.iconPrimary.toString())}return a}(t,i,n,r,o,h,d):u&&(v=u.imagePrimary),v&&(g=Vg(v,null,p,f),t.allowVerticalPlacement&&(y=Vg(v,null,p,f))),g&&(e.iconBBox=Ay(g,e.iconBBox,m,_)),y&&(e.iconVerticalBBox=Ay(y,e.iconVerticalBBox,m+90,_))}function Dy(e,t,i,n,r,o,s,a,l,c){const{appearanceTextOffset:u,appearanceTextRotate:h,appearanceTextSize:d}=function(e,t,i,n,r,o,s){const a=e.hasProperty("text-offset")?t.getAppearanceValueAndResolveTokens(e,"text-offset",i,n,[]):null,l=a&&Array.isArray(a)?[a[0]*ng,a[1]*ng]:r,c=e.hasProperty("text-rotate")?t.getAppearanceValueAndResolveTokens(e,"text-rotate",i,n,[]):null,u="number"==typeof c?c:o,h=e.hasProperty("text-size")?t.getAppearanceValueAndResolveTokens(e,"text-size",i,n,[]):null;return{appearanceTextOffset:l,appearanceTextRotate:u,appearanceTextSize:"number"==typeof h?h:s}}(i,t,n,r,o,s,a),f=d/a;l&&(e.textBBox=Ay(l,e.textBBox,h,f,u)),c&&(e.textVerticalBBox=Ay(c,e.textVerticalBBox,h+90,f,u))}function Ry(e,t,i,n,r,o,s,a,l){if(!t||!t.usvg)return;const c=qg(n),u=qg(r),h="both"!==o&&"width"!==o||!jg(n)?1:u.width/c.width,d="both"!==o&&"height"!==o||!Gg(n)?1:u.height/c.height;i.scaleSelf(h,d);const f=i.toString();s.set(f,i),a.set(f,t);const{imagePosition:p}=oy(f,t,1);l.set(f,p)}function Ly(e,t,i,n,r,o,s,a,l){if(!e)return;const c=function(e,t,i,n,r,o){if("camera"===e.kind)return e.maxSize;if("composite"===e.kind){const n=t.possiblyEvaluate(new ga(e.maxZoom,{worldview:o}),i).evaluate(r,{},i),s=t.possiblyEvaluate(new ga(e.minZoom,{worldview:o}),i).evaluate(r,{},i);return Math.max(n,s)}return t.possiblyEvaluate(new ga(n,{worldview:o})).evaluate(r,{},i)}(t,i,n,r,o,l);return e.scaleSelf(c*a*s)}function zy(e,t,i,n,r,o,s,a,l){return{iconPrimary:Ly(e.getPrimary(),t,i,n,r,o,s,a,l),iconSecondary:Ly(e.getSecondary(),t,i,n,r,o,s,a,l)}}function Oy(e,t,i){if(!t)return;const n=i.get(e.toString()),r=i.get(t.toString());n&&r&&(n.paddedRect.w===r.paddedRect.w&&n.paddedRect.h===r.paddedRect.h||We(`Mismatch in icon variant sizes: ${e.toString()} and ${t.toString()}`),n.usvg!==r.usvg&&We(`Mismatch in icon variant image types: ${e.id} and ${t.id}`))}function Fy(e,t,i,n){if(!e)return;const r=t.get(i.toString());if(e.imagePrimary=r,n){const i=t.get(n.toString());e.imageSecondary=i}}function ky(e,t){for(const i in e.horizontal)By(e.horizontal[i],t);By(e.vertical,t)}function By(e,t){if(e)for(const i of e.positionedLines)for(const e of i.positionedGlyphs)if(null!==e.image){const i=e.image.toString();e.rect=t.get(i).paddedRect}}function Ny(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Vy(e,t,i,n,r,o,s,a,l){const c=Hy(o.horizontal)||o.vertical,u=i.get("icon-text-fit-padding").evaluate(n,{},r);let h,d=t;
2return t&&"none"!==l&&(e.allowVerticalPlacement&&o.vertical&&(h=Ug(t,o.vertical,l,u,a,s)),c&&(d=Ug(t,c,l,u,a,s))),{defaultShapedIcon:d,verticallyShapedIcon:h}}function Uy(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v,x,b,w,T){let S=s.textMaxSize.evaluate(t,{},d);void 0===S?S=a*s.textScaleFactor:S*=s.textScaleFactor;const E=e.layers[0].layout,I=a*s.textScaleFactor/24,A=Hy(i.horizontal)||i.vertical;if("none"!==_&&e.appearanceFeatureData&&t.index<e.appearanceFeatureData.length){const i=e.appearanceFeatureData[t.index];i&&(i.textShaping=A,i.iconTextFitPadding=E.get("icon-text-fit-padding").evaluate(t,{},d),i.fontScale=I)}const M="globe"===f.name,C=e.tilePixelRatio*S/24,P=(F=e.overscaling,e.zoom>18&&F>2&&(F>>=1),Math.max(Vn/(512*F),1)*E.get("symbol-spacing")),D=E.get("text-padding")*e.tilePixelRatio,R=E.get("icon-padding")*e.tilePixelRatio,L=Me(E.get("text-max-angle")),z="map"===E.get("icon-rotation-alignment")&&"point"!==v,O=P/2;var F;!1===e.hasAnyIconTextFit&&"none"!==_&&(e.hasAnyIconTextFit=!0);const k=t.properties?+t.properties[Eu]:null,B=k&&e.elevationFeatureIdToIndex?e.elevationFeatureIdToIndex.get(k):65535,N=(a,l,v)=>{if(l.x<0||l.x>=Vn||l.y<0||l.y>=Vn)return;let T=null;if(M){const{x:e,y:t,z:i}=f.projectTilePoint(l.x,l.y,v);T={anchor:new Xg(e,t,i,0,void 0),up:f.upVector(v,l.x,l.y)}}!function(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v,x,b,w,T,S,E,I,A,M,C,P,D){const R=e.addToLineVertexArray(t,n);let L,z,O,F,k,B,N,V=0,U=0,j=0,G=0,q=-1,H=-1;const $={};let W=Jt("");const Z=i?i.anchor:t,X="none"!==A;let Y=0,K=0;if(void 0===l._unevaluatedLayout.getValue("text-radial-offset")){const e=l.layout.get("text-offset").evaluate(x,{},S);Y=e[0]*ng,K=e[1]*ng}else Y=l.layout.get("text-radial-offset").evaluate(x,{},S)*ng,K=Ey;if(e.allowVerticalPlacement&&r.vertical){const e=r.vertical;if(p)B=Wy(e),a&&(N=Wy(a));else{const i=l.layout.get("text-rotate").evaluate(x,{},S)+90;O=$y(c,Z,t,u,h,d,e,f,i,m,D),a&&(F=$y(c,Z,t,u,h,d,a,g,i,null,P))}}if(o){const n=e.iconSizeData,r=l.layout.get("icon-rotate").evaluate(x,{},S),s=fy(o,r,w,X,b.iconScaleFactor),f=a?fy(a,r,w,X,b.iconScaleFactor):void 0;z=$y(c,Z,t,u,h,d,o,g,r,null,C);const p=function(e,t,i,n,r,o,s,a){const l=e.layers[0],c=l.appearances;let u=t.length;if(i&&(u=Math.max(u,i.length)),0===c.length)return u;const[h,d]=n.get("icon-size-scale-range"),f=ze(1,h,d);for(const t of c){const i=t.getUnevaluatedProperties();if(void 0!==i._values["icon-image"].value){const n=l.getAppearanceValueAndResolveTokens(t,"icon-image",r,o,[]);if(n){const t=e.getResolvedImageFromTokens(n);if(t){const n=i._values["icon-size"],l=zy(t,$g(e.zoom,n,e.worldview),n,o,e.zoom,r,e.pixelRatio,f,e.worldview),c=s.get(l.iconPrimary.toString());u=Math.max(u,py(c,a))}}}}return u}(e,s,f,l.layout,x,S,e.iconAtlasPositions,X);V=4*p;let m=null;"source"===n.kind?(m=[Hg*l.layout.get("icon-size").evaluate(x,{},S)*b.iconScaleFactor],m[0]>Gy&&We(`${e.layerIds[0]}: Value for "icon-size" is >= ${jy}. Reduce your "icon-size".`)):"composite"===n.kind&&(m=[Hg*b.compositeIconSizes[0].evaluate(x,{},S)*b.iconScaleFactor,Hg*b.compositeIconSizes[1].evaluate(x,{},S)*b.iconScaleFactor],(m[0]>Gy||m[1]>Gy)&&We(`${e.layerIds[0]}: Value for "icon-size" is >= ${jy}. Reduce your "icon-size".`)),e.addSymbols(e.icon,s,m,v,y,x,void 0,i,t,R.lineStartIndex,R.lineLength,-1,T,S,E,I,e.symbolInstances.length,p),q=e.icon.placedSymbolArray.length-1,f&&(U=4*p,e.addSymbols(e.icon,f,m,v,y,x,Ig.vertical,i,t,R.lineStartIndex,R.lineLength,-1,T,S,E,I,e.symbolInstances.length,p),H=e.icon.placedSymbolArray.length-1)}for(const n in r.horizontal){const o=n,a=r.horizontal[o];L||(W=Jt(a.text),p?k=Wy(a):L=$y(c,Z,t,u,h,d,a,f,l.layout.get("text-rotate").evaluate(x,{},S),m,D));const _=1===a.positionedLines.length;if(j+=qy(e,i,t,a,s,l,p,x,m,R,r.vertical?Ig.horizontal:Ig.horizontalOnly,_?Sy(r.horizontal):[o],$,q,b,T,S,e.symbolInstances.length,E),_)break}r.vertical&&(G+=qy(e,i,t,r.vertical,s,l,p,x,m,R,Ig.vertical,["vertical"],$,H,b,T,S,e.symbolInstances.length,E));let J=-1;const Q=(e,t)=>e?Math.max(e,t):t;J=Q(k,J),J=Q(B,J),J=Q(N,J);const ee=J>-1?1:0;e.glyphOffsetArray.length>=65535&&We("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==x.sortKey&&e.addToSortKey
vendor: 4,420 bytes, line 2
2Ranges(e.symbolInstances.length,x.sortKey),e.symbolInstances.emplaceBack(t.x,t.y,Z.x,Z.y,Z.z,$.right>=0?$.right:-1,$.center>=0?$.center:-1,$.left>=0?$.left:-1,$.vertical>=0?$.vertical:-1,q,H,W,void 0!==L?L:e.collisionBoxArray.length,void 0!==L?L+1:e.collisionBoxArray.length,void 0!==O?O:e.collisionBoxArray.length,void 0!==O?O+1:e.collisionBoxArray.length,void 0!==z?z:e.collisionBoxArray.length,void 0!==z?z+1:e.collisionBoxArray.length,F||e.collisionBoxArray.length,F?F+1:e.collisionBoxArray.length,u,j,G,V,U,ee,0,Y,K,J,0,X?1:0,M)}(e,l,T,a,i,n,o,r,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,D,y,c,0,R,z,g,t,s,u,h,d,p,m,_,B,x,b,w)};if("line"===v)for(const r of bp(t.geometry,0,0,Vn,Vn)){const t=ty(r,P,L,i.vertical||A,n,24,C,e.overscaling,Vn);for(const i of t)A&&Zy(e,A.text,O,i)||N(r,i,d)}else if("line-center"===v){for(const e of t.geometry)if(e.length>1){const t=ey(e,L,i.vertical||A,n,24,C);t&&N(e,t,d)}}else if("Polygon"===t.type)for(const e of qd(t.geometry,0)){const t=by(e,16);N(e[0],new Xg(t.x,t.y,0,0,void 0),d)}else if("LineString"===t.type)for(const e of t.geometry)N(e,new Xg(e[0].x,e[0].y,0,0,void 0),d);else if("Point"===t.type)for(const e of t.geometry)for(const t of e)N([t],new Xg(t.x,t.y,0,0,void 0),d)}const jy=255,Gy=jy*Hg;function qy(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y){const v=function(e,t,i,n,r,o,s,a){const l=[];if(0===t.positionedLines.length)return l;const c=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=function(e){const t=e[0],i=e[1],n=t*i;return n>0?[t,-i]:n<0?[-t,i]:0===t?[i,t]:[i,-t]}(i);let h=Math.abs(t.top-t.bottom);for(const e of t.positionedLines)h-=e.lineOffset;const d=t.positionedLines.length,f=h/d;let p=t.top-i[1];for(let e=0;e<d;++e){const n=t.positionedLines[e];p=xy(t,f,p,e);for(const e of n.positionedGlyphs){if(!e.rect)continue;const n=e.rect||{};let o=4,h=!0,d=1,f=0;if(e.image){const t=s.get(e.image.toString());if(!t)continue;if(t.sdf){We("SDF images are not supported in formatted text and will be ignored.");continue}h=!1,d=t.pixelRatio,o=1/d}const m=(r||a)&&e.vertical,_=e.metrics.advance*e.scale/2,g=e.metrics,y=e.rect;if(null===y)continue;a&&t.verticalizable&&(f=e.image?_-e.metrics.width*e.scale/2:0);const v=r?[e.x+_,e.y]:[0,0];let x=[0,0],b=[0,0],w=!1;r||(m?(b=[e.x+_+u[0],e.y+u[1]-f],w=!0):x=[e.x+_+i[0],e.y+i[1]-f]);const T=y.w*e.scale/(d*(e.localGlyph?2:1)),S=y.h*e.scale/(d*(e.localGlyph?2:1));let E,I,A,M;if(m){const t=e.y-p,i=new Se(-_,_-t),n=-Math.PI/2,r=new Se(...b);E=new Se(-_+x[0],x[1]),E._rotateAround(n,i)._add(r),E.x+=-t+_,E.y-=(g.left-o)*e.scale;const s=e.image?g.advance*e.scale:ng*e.scale,a=String.fromCodePoint(e.glyph);sg(a)?E.x+=(1-o)*e.scale:ag(a)?E.x+=s-g.height*e.scale+(-o-1)*e.scale:E.x+=e.image||g.width+2*o===y.w&&g.height+2*o===y.h?(s-S)/2:(s-(g.height+2*o)*e.scale)/2,I=new Se(E.x,E.y-T),A=new Se(E.x+S,E.y),M=new Se(E.x+S,E.y-T)}else{const t=(g.left-o)*e.scale-_+x[0],i=(-g.top-o)*e.scale+x[1],n=t+T,r=i+S;E=new Se(t,i),I=new Se(n,i),A=new Se(t,r),M=new Se(n,r)}if(c){let e;e=r?new Se(0,0):w?new Se(u[0],u[1]):new Se(i[0],i[1]),E._rotateAround(c,e),I._rotateAround(c,e),A._rotateAround(c,e),M._rotateAround(c,e)}const C=new Se(0,0),P=new Se(0,0);l.push({tl:E,tr:I,bl:A,br:M,texPrimary:n,texSecondary:void 0,writingMode:t.writingMode,glyphOffset:v,sectionIndex:e.sectionIndex,isSDF:h,pixelOffsetTL:C,pixelOffsetBR:P,minFontScaleX:0,minFontScaleY:0})}}return l}(0,n,l,o,s,a,r,e.allowVerticalPlacement),x=e.textSizeData;let b=null;"source"===x.kind?(b=[Hg*o.layout.get("text-size").evaluate(a,{},_)*p.textScaleFactor],b[0]>Gy&&We(`${e.layerIds[0]}: Value for "text-size" is >= ${jy}. Reduce your "text-size".`)):"composite"===x.kind&&(b=[Hg*p.compositeTextSizes[0].evaluate(a,{},_)*p.textScaleFactor,Hg*p.compositeTextSizes[1].evaluate(a,{},_)*p.textScaleFactor],(b[0]>Gy||b[1]>Gy)&&We(`${e.layerIds[0]}: Value for "text-size" is >= ${jy}. Reduce your "text-size".`)),e.addSymbols(e.text,v,b,l,s,a,u,t,i,c.lineStartIndex,c.lineLength,f,m,_,y,!1,g,v.length);for(const t of h)d[t]=e.text.placedSymbolArray.length-1;return 4*v.length}function Hy(e){for(const t in e)return e[t];return null}function $y(e,t,i,n,r,o,s,a,l,c,u){let h,d,f,p;if(h=u?u.top:s.top,d=u?u.bottom:s.bottom,f=u?u.left:s.left,p=u?u.right:s.right,Ng(s)&&s.collisionPadding){const e=s.collisionPadding;f-=e[0],h-=e[1],p+=e[2],d+=e[3]}if(l){const e=new Se(f,h),t=new Se(p,h),i=new Se(f,d),n=new Se(p,d),r=Me(l);let o=new Se(0,0);
vendor: 4,044 bytes, line 2
2c&&(o=new Se(c[0],c[1])),e._rotateAround(r,o),t._rotateAround(r,o),i._rotateAround(r,o),n._rotateAround(r,o),f=Math.min(e.x,t.x,i.x,n.x),p=Math.max(e.x,t.x,i.x,n.x),h=Math.min(e.y,t.y,i.y,n.y),d=Math.max(e.y,t.y,i.y,n.y)}return e.emplaceBack(t.x,t.y,t.z,i.x,i.y,f,h,p,d,a,n,r,o),e.length-1}function Wy(e){Ng(e)&&e.collisionPadding&&(e.top-=e.collisionPadding[1],e.bottom+=e.collisionPadding[3]);const t=e.bottom-e.top;return t>0?Math.max(10,t):null}function Zy(e,t,i,n){const r=e.compareText;if(t in r){const e=r[t];for(let t=e.length-1;t>=0;t--)if(n.dist(e[t])<i)return!0}else r[t]=[];return r[t].push(n),!1}function Xy(e,t){const i=e.fovAboveCenter,n=e.elevation?e.elevation.getMinElevationBelowMSL()*t:0,r=(e._camera.position[2]*e.worldSize-n)/Math.cos(e._pitch),o=Math.sin(i)*r/Math.sin(Math.max(Math.PI/2-e._pitch-i,.01));let s=Math.sin(e._pitch)*o+r;const a=r*(1/e._horizonShift);if(!e.elevation||0===e.elevation.exaggeration()){let t=Math.max(e.zoom-17,0);e.isOrthographic&&(t/=10),s*=1+t}return Math.min(1.01*s,a)}function Yy(e,t){if(!t.isReprojectedInTileSpace)return{scale:1<<e.z,x:e.x,y:e.y,x2:e.x+1,y2:e.y+1,projection:t};const i=Math.pow(2,-e.z),n=e.x*i,r=(e.x+1)*i,o=e.y*i,s=(e.y+1)*i,a=eu(n),l=eu(r),c=tu(o),u=tu(s),h=t.project(a,c),d=t.project(l,c),f=t.project(l,u),p=t.project(a,u);let m=Math.min(h.x,d.x,f.x,p.x),_=Math.min(h.y,d.y,f.y,p.y),g=Math.max(h.x,d.x,f.x,p.x),y=Math.max(h.y,d.y,f.y,p.y);const v=i/16;function x(e,i,n,r,o,s){const a=(n+o)/2,l=(r+s)/2,c=t.project(eu(a),tu(l)),u=Math.max(0,m-c.x,_-c.y,c.x-g,c.y-y);m=Math.min(m,c.x),g=Math.max(g,c.x),_=Math.min(_,c.y),y=Math.max(y,c.y),u>v&&(x(e,c,n,r,a,l),x(c,i,a,l,o,s))}x(h,d,n,o,r,o),x(d,f,r,o,r,s),x(f,p,r,s,n,s),x(p,h,n,s,n,o),m-=v,_-=v,g+=v,y+=v;const b=1/Math.max(g-m,y-_);return{scale:b,x:m*b,y:_*b,x2:g*b,y2:y*b,projection:t}}function Ky(e,{x:t,y:i},n=0){return new Se(((t-n)*e.scale-e.x)*Vn,(i*e.scale-e.y)*Vn)}const Jy=c(new Float32Array(16));class Qy{constructor(e){this.spec=e,this.name=e.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(e,t){return{x:0,y:0,z:0}}unproject(e,t){return new Zc(0,0)}projectTilePoint(e,t,i){return{x:e,y:t,z:0}}locationPoint(e,t,i,n=!0){return e._coordinatePoint(e.locationCoordinate(t,i),n)}pixelsPerMeter(e,t){return Qc(1,e)*t}pixelSpaceConversion(e,t,i){return 1}farthestPixelDistance(e){return Xy(e,e.pixelsPerMeter)}pointCoordinate(e,t,i,n){const r=e.horizonLineFromTop(!1),o=new Se(t,Math.max(r,i));return e.rayIntersectionCoordinate(e.pointRayIntersection(o,n))}pointCoordinate3D(e,t,i){const n=new Se(t,i);if(e.elevation)return e.elevation.pointCoordinate(n);{const t=this.pointCoordinate(e,n.x,n.y,0);return[t.x,t.y,t.z]}}isPointAboveHorizon(e,t){if(e.elevation&&e.elevation.visibleDemTiles.length)return!this.pointCoordinate3D(e,t.x,t.y);const i=e.horizonLineFromTop();return t.y<i}createInversionMatrix(e,t){return Jy}createTileMatrix(e,t,i){let n,r,o;const s=i.canonical,a=c(new Float64Array(16));if(this.isReprojectedInTileSpace){const l=Yy(s,this);n=1,r=l.x+i.wrap*l.scale,o=l.y,f(a,a,[n/l.scale,n/l.scale,e.pixelsPerMeter/t])}else n=t/e.zoomScale(s.z),r=(s.x+Math.pow(2,s.z)*i.wrap)*n,o=s.y*n;return d(a,a,[r,o,0]),f(a,a,[n/Vn,n/Vn,1]),a}upVector(e,t,i){return[0,0,1]}upVectorScale(e,t,i){return{metersToTile:1}}}class ev extends Qy{constructor(e){super(e),this.range=[4,7],this.center=e.center||[-96,37.5];const[t,i]=this.parallels=e.parallels||[29.5,45.5],n=Math.sin(Me(t));this.n=(n+Math.sin(Me(i)))/2,this.c=1+n*(2*this.n-n),this.r0=Math.sqrt(this.c)/this.n}project(e,t){const{n:i,c:n,r0:r}=this,o=Me(e-this.center[0]),s=Me(t),a=Math.sqrt(n-2*i*Math.sin(s))/i;return{x:a*Math.sin(o*i),y:a*Math.cos(o*i)-r,z:0}}unproject(e,t){const{n:i,c:n,r0:r}=this,o=r+t;let s=Math.atan2(e,Math.abs(o))*Math.sign(o);o*i<0&&(s-=Math.PI*Math.sign(e)*Math.sign(o));const a=Me(this.center[0])*i;
vendor: 4,851 bytes, line 2
2s=Fe(s,-Math.PI-a,Math.PI-a);const l=ze(Ce(s/i)+this.center[0],-180,180),c=Math.asin(ze((n-(e*e+o*o)*i*i)/(2*i),-1,1)),u=ze(Ce(c),-nu,nu);return new Zc(l,u)}}const tv=1.340264,iv=-.081106,nv=893e-6,rv=.003796,ov=Math.sqrt(3)/2;class sv extends Qy{project(e,t){t=t/180*Math.PI,e=e/180*Math.PI;const i=Math.asin(ov*Math.sin(t)),n=i*i,r=n*n*n;return{x:.5*(e*Math.cos(i)/(ov*(tv+3*iv*n+r*(7*nv+9*rv*n)))/Math.PI+.5),y:1-.5*(i*(tv+iv*n+r*(nv+rv*n))/Math.PI+1),z:0}}unproject(e,t){e=(2*e-.5)*Math.PI;let i=t=(2*(1-t)-1)*Math.PI,n=i*i,r=n*n*n;for(let e,o,s,a=0;a<12&&(o=i*(tv+iv*n+r*(nv+rv*n))-t,s=tv+3*iv*n+r*(7*nv+9*rv*n),e=o/s,i=ze(i-e,-Math.PI/3,Math.PI/3),n=i*i,r=n*n*n,!(Math.abs(e)<1e-12));++a);const o=ov*e*(tv+3*iv*n+r*(7*nv+9*rv*n))/Math.cos(i),s=Math.asin(Math.sin(i)/ov),a=ze(180*o/Math.PI,-180,180),l=ze(180*s/Math.PI,-nu,nu);return new Zc(a,l)}}class av extends Qy{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0}project(e,t){return{x:.5+e/360,y:.5-t/360,z:0}}unproject(e,t){const i=360*(e-.5),n=ze(360*(.5-t),-nu,nu);return new Zc(i,n)}}const lv=Math.PI/2;function cv(e){return Math.tan((lv+e)/2)}class uv extends Qy{constructor(e){super(e),this.center=e.center||[0,30];const[t,i]=this.parallels=e.parallels||[30,30];let n=Me(t),r=Me(i);this.southernCenter=n+r<0,this.southernCenter&&(n=-n,r=-r);const o=Math.cos(n),s=cv(n);this.n=n===r?Math.sin(n):Math.log(o/Math.cos(r))/Math.log(cv(r)/s),this.f=o*Math.pow(cv(n),this.n)/this.n}project(e,t){t=Me(t),this.southernCenter&&(t=-t),e=Me(e-this.center[0]);const i=1e-6,{n:n,f:r}=this;r>0?t<-lv+i&&(t=-lv+i):t>lv-i&&(t=lv-i);const o=r/Math.pow(cv(t),n);let s=o*Math.sin(n*e),a=r-o*Math.cos(n*e);return s=.5*(s/Math.PI+.5),a=.5*(a/Math.PI+.5),{x:s,y:this.southernCenter?a:1-a,z:0}}unproject(e,t){e=(2*e-.5)*Math.PI,this.southernCenter&&(t=1-t),t=(2*(1-t)-.5)*Math.PI;const{n:i,f:n}=this,r=n-t,o=Math.sign(r),s=Math.sign(i)*Math.sqrt(e*e+r*r);let a=Math.atan2(e,Math.abs(r))*o;r*i<0&&(a-=Math.PI*Math.sign(e)*o);const l=ze(Ce(a/i)+this.center[0],-180,180),c=ze(Ce(2*Math.atan(Math.pow(n/s,1/i))-lv),-nu,nu);return new Zc(l,this.southernCenter?-c:c)}}class hv extends Qy{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(e,t){return{x:Kc(e),y:Jc(t),z:0}}unproject(e,t){const i=eu(e),n=tu(t);return new Zc(i,n)}}const dv=Me(nu);class fv extends Qy{project(e,t){const i=(t=Me(t))*t,n=i*i;return{x:.5*((e=Me(e))*(.8707-.131979*i+n*(n*(.003971*i-.001529*n)-.013791))/Math.PI+.5),y:1-.5*(t*(1.007226+i*(.015085+n*(.028874*i-.044475-.005916*n)))/Math.PI+1),z:0}}unproject(e,t){e=(2*e-.5)*Math.PI;let i=t=(2*(1-t)-1)*Math.PI,n=25,r=0,o=i*i;do{o=i*i;const e=o*o;r=(i*(1.007226+o*(.015085+e*(.028874*o-.044475-.005916*e)))-t)/(1.007226+o*(.045255+e*(.259866*o-.311325-.005916*11*e))),i=ze(i-r,-dv,dv)}while(Math.abs(r)>1e-6&&--n>0);o=i*i;const s=ze(Ce(e/(.8707+o*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979))),-180,180),a=Ce(i);return new Zc(s,a)}}const pv=Me(nu);class mv extends Qy{project(e,t){t=Me(t),e=Me(e);const i=Math.cos(t),n=2/Math.PI,r=Math.acos(i*Math.cos(e/2)),o=Math.sin(r)/r,s=.5*(e*n+2*i*Math.sin(e/2)/o)||0,a=.5*(t+Math.sin(t)/o)||0;return{x:.5*(s/Math.PI+.5),y:1-.5*(a/Math.PI+1),z:0}}unproject(e,t){let i=e=(2*e-.5)*Math.PI,n=t=(2*(1-t)-1)*Math.PI,r=25;const o=1e-6;let s=0,a=0;do{const r=Math.cos(n),o=Math.sin(n),l=2*o*r,c=o*o,u=r*r,h=Math.cos(i/2),d=Math.sin(i/2),f=2*h*d,p=d*d,m=1-u*h*h,_=m?1/m:0,g=m?Math.acos(r*h)*Math.sqrt(1/m):0,y=.5*(2*g*r*d+2*i/Math.PI)-e,v=.5*(g*o+n)-t,x=.5*_*(u*p+g*r*h*c)+1/Math.PI,b=_*(f*l/4-g*o*d),w=.125*_*(l*d-g*o*u*f),T=.5*_*(c*h+g*p*r)+.5,S=b*w-T*x;s=(v*b-y*T)/S,a=(y*w-v*x)/S,i=ze(i-s,-Math.PI,Math.PI),n=ze(n-a,-pv,pv)}while((Math.abs(s)>o||Math.abs(a)>o)&&--r>0);return new Zc(Ce(i),Ce(n))}}class _v extends Qy{constructor(e){super(e),this.center=e.center||[0,0],this.parallels=e.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(Me(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(e,t){const{scale:i,cosPhi:n}=this;return{x:Me(e)*n*i+.5,y:-Math.sin(Me(t))/n*i+.5,z:0}}unproject(e,t){const{scale:i,cosPhi:n}=this,r=-(t-.5)/i,o=ze(Ce((e-.5)/i)/n,-180,180),s=Math.asin(ze(r*n,-1,1)),a=ze(Ce(s),-nu,nu);return new Zc(o,a)}}class gv extends hv{constructor(e){super(e),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(e,t,i){const n=Oh(e,t,i);return j(n,n,Bh(Ch(i))),{x:n[0],y:n[1],z:n[2]}}locationPoint(e,t,i){const n=Hc(t.lat,t.lng),r=B([],n),o=i?e._centerAltitude+i:e.elevation?e.elevation.getAtPointOrZero(e.locationCoordinate(t),e._centerAltitude):e._centerAltitude;
vendor: 6,013 bytes, line 2
2L(n,n,r,Qc(1,0)*Vn*o);const s=c(new Float64Array(16));return h(s,e.pixelMatrix,e.globeMatrix),j(n,n,s),new Se(n[0],n[1])}pixelsPerMeter(e,t){return Qc(1,0)*t}pixelSpaceConversion(e,t,i){const n=Qc(1,e)*t,r=di(Qc(1,45)*t,n,i);return this.pixelsPerMeter(e,t)/r}createTileMatrix(e,t,i){const n=Nh(Ch(i.canonical));return h(new Float64Array(16),e.globeMatrix,n)}createInversionMatrix(e,t){const{center:i}=e,n=Bh(Ch(t));return m(n,n,Me(i.lng)),p(n,n,Me(i.lat)),f(n,n,[e._pixelsPerMercatorPixel,e._pixelsPerMercatorPixel,1]),Float32Array.from(n)}pointCoordinate(e,t,i,n){return Ih(e,t,i,!0)||new lu(0,0)}pointCoordinate3D(e,t,i){const n=this.pointCoordinate(e,t,i,0);return[n.x,n.y,n.z]}isPointAboveHorizon(e,t){return!Ih(e,t.x,t.y,!1)}farthestPixelDistance(e){const t=function(e,t){const i=e.cameraToCenterDistance,n=e._centerAltitude*t,r=e._camera,o=e._camera.forward(),s=A([],R([],o,-i),[0,0,n]),a=e.worldSize/(2*Math.PI),l=[0,0,-a],c=e.width/e.height,u=Math.tan(e.fovAboveCenter),h=R([],r.up(),u),d=R([],r.right(),u*c),f=B([],A([],A([],o,h),d)),p=[];let m;if(new Lu(s,f).closestPointOnSphere(l,a,p)){const t=A([],p,l),i=W([],t,s);m=Math.cos(e.fovAboveCenter)*S(i)}else{const e=W([],s,l),t=W([],l,s);B(t,t);const i=S(e)-a;m=Math.sqrt(i*(i+2*a));const n=Math.acos(m/(a+i))-Math.acos(N(o,t));m*=Math.cos(n)}return 1.01*m}(e,this.pixelsPerMeter(e.center.lat,e.worldSize)),i=Gh(e.zoom);if(i>0){const n=Xy(e,Qc(1,e.center.lat)*e.worldSize),r=e.worldSize/(2*Math.PI),o=Math.max(e.width,e.height)/e.worldSize*Math.PI;return di(t,n+r*(1-Math.cos(o)),Math.pow(i,10))}return t}upVector(e,t,i){return Oh(t,i,e,1)}upVectorScale(e){return{metersToTile:Sh(Fh(Ch(e)))}}}function yv(e){const t=e.parallels,i=!!t&&Math.abs(t[0]+t[1])<.01;switch(e.name){case"mercator":return new hv(e);case"equirectangular":return new av(e);case"naturalEarth":return new fv(e);case"equalEarth":return new sv(e);case"winkelTripel":return new mv(e);case"albers":return i?new _v(e):new ev(e);case"lambertConformalConic":return i?new _v(e):new uv(e);case"globe":return new gv(e)}throw new Error(`Invalid projection name: ${e.name}`)}const vv=yu.types,xv=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function bv(e,t,i,n,r,o,s,a,l,c,u,h,d){const f=a?Math.min(Gy,Math.round(a[0])):0,p=a?Math.min(Gy,Math.round(a[1])):0;e.emplaceBack(t,i,Math.round(32*n),Math.round(32*r),o,s,(f<<1)+(l?1:0),0+(p<<1),16*c,16*u,256*h,256*d)}function wv(e,t,i){e.emplaceBack(t,i)}function Tv(e,t,i,n,r,o,s){e.emplaceBack(t,i,n,r,o,s)}const Sv=(e,t,i,n)=>{for(let r=0;r<t;r++)e.emplaceBack(i[0],i[1],i[2],n[0],n[1],n[2])};function Ev(e,t,i,n,r){e.emplaceBack(t,i,n,r),e.emplaceBack(t,i,n,r),e.emplaceBack(t,i,n,r),e.emplaceBack(t,i,n,r)}function Iv(e){for(const t of e.sections)if(sa(t.text))return!0;return!1}class Av{constructor(e){this.layoutVertexArray=new yl,this.indexArray=new Al,this.programConfigurations=e,this.segments=new rc,this.dynamicLayoutVertexArray=new xl,this.opacityVertexArray=new bl,this.placedSymbolArray=new Hl,this.iconTransitioningVertexArray=new wl,this.globeExtVertexArray=new vl,this.zOffsetVertexArray=new cl,this.orientationVertexArray=new Pl,this.symbolInstanceIndices=[]}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length&&0===this.iconTransitioningVertexArray.length}getIconVertexData(e,t){const i=[],n=this.layoutVertexArray.uint16;for(let r=0;r<t;++r){const t=12*(e+r);i.push(...n.slice(t,t+12))}return i}updateIconVertexData(e,t,i,n,r,o,s,a,l,c,u,h,d){const f=this.layoutVertexArray.uint16,p=12*e;f[p]=t,f[p+1]=i,f[p+2]=n,f[p+3]=r,f[p+4]=o,f[p+5]=s,f[p+6]=a,f[p+7]=l,f[p+8]=c,f[p+9]=u,f[p+10]=h,f[p+11]=d}upload(e,t,i,n,r,o){this.isEmpty()||(i&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,W_.members,!!o),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,X_.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,xv,!0),this.iconTransitioningVertexArray.length>0&&(this.iconTransitioningVertexBuffer=e.createVertexBuffer(this.iconTransitioningVertexArray,J_.members,!0)),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,Z_.members,!0)),!this.zOffsetVertexBuffer&&(this.zOffsetVertexArray.length>0||r)&&(this.zOffsetVertexBuffer=e.createVertexBuffer(this.zOffsetVertexArray,Y_.members,!0)),!this.orientationVertexBuffer&&this.orientationVertexArray&&this.orientationVertexArray.length>0&&(this.orientationVertexBuffer=e.createVertexBuffer(this.orientationVertexArray,K_.members,!0)),this.opacityVertexBuffer.itemSize=1),(i||n)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.iconTransitioningVertexBuffer&&this.iconTransitioningVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy(),this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy(),this.orientationVertexBuffer&&this.orientationVertexBuffer.destroy())}}Jo(Av,"SymbolBuffers");class Mv{constructor(e,t,i){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new i,this.segments=new rc,this.collisionVertexArray=new Il,this.collisionVertexArrayExt=new xl}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Q_.members,!0),this.collisionVertexBufferExt=e.createVertexBuffer(this.collisionVertexArrayExt,eg.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.de
vendor: 5,562 bytes, line 2
2stroy())}}Jo(Mv,"CollisionBuffers");class Cv{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.hasAnyIconTextFit=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=c([]),this.placementViewportMatrix=c([]);const t=this.layers[0]._unevaluatedLayout._values;this.worldview=e.worldview,this.localizable=e.localizable,this.textSizeData=$g(this.zoom,t["text-size"],this.worldview),this.iconSizeData=$g(this.zoom,t["icon-size"],this.worldview);const i=this.layers[0].layout,n=i.get("symbol-sort-key"),r=i.get("symbol-z-order");this.lut=e.lut,this.canOverlap=i.get("text-allow-overlap")||i.get("icon-allow-overlap")||i.get("text-ignore-placement")||i.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==r&&void 0!==n.constantOr(1),this.sortFeaturesByY=("viewport-y"===r||"auto"===r&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=i.get("text-writing-mode").map(e=>Ig[e]),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.sourceID=e.sourceID,this.projection=e.projection,this.hasAnyZOffset=!1,this.zOffsetSortDirty=!1,this.zOffsetBuffersNeedUpload=!1,this.elevationType="none",this.elevationStateComplete=!1,this.activeReplacements=[],this.replacementUpdateTime=0,this.hasAnySecondaryIcon=!1,this.hasAppearances=null,this.lastActiveApperance=null,this.featureToAppearanceIndex={}}hasAnyAppearanceProperty(e){const t=this.layers[0].getAppearances();return!(!t||0===t.length)&&t.some(t=>null!=t.getProperty(e))}createArrays(){this.text=new Av(new Lc(this.layers,{zoom:this.zoom,lut:this.lut},e=>e.startsWith("text")||e.startsWith("symbol"))),this.icon=new Av(new Lc(this.layers,{zoom:this.zoom,lut:this.lut},e=>e.startsWith("icon")||e.startsWith("symbol"))),this.glyphOffsetArray=new Zl,this.lineVertexArray=new Xl,this.symbolInstances=new Wl}calculateGlyphDependencies(e,t,i,n,r){for(const i of e){const e=i.codePointAt(0);if(void 0===e)break;if(t[e]=!0,n&&r&&e<=65535){const e=og[i];e&&(t[e.charCodeAt(0)]=!0)}}}calculateEffectiveAppearanceIconSize(e,t,i,n,r,o){let s=1;const a=e.getUnevaluatedProperties()._values["icon-size"],l=$g(this.zoom,a,this.worldview),c=Zg(l,t);if("constant"!==l.kind&&"camera"!==l.kind||(s=c.uSize),"composite"===l.kind){const{minZoom:e,maxZoom:t}=l,o=a.possiblyEvaluate(new ga(e,{worldview:this.worldview}),n),u=a.possiblyEvaluate(new ga(t,{worldview:this.worldview}),n),h=o.evaluate(i,{},n,r);s=h+(u.evaluate(i,{},n,r)-h)*c.uSizeT}return"source"===l.kind&&(s=a.possiblyEvaluate(new ga(this.zoom,{worldview:this.worldview}),n).evaluate(i,{},n,r)),s*o}updateFootprints(e,t){}updateReplacement(e,t){if(t.updateTime===this.replacementUpdateTime)return!1;this.replacementUpdateTime=t.updateTime;const i=t.getReplacementRegionsForTile(e.toUnwrapped(),!0);return!Df(this.activeReplacements,i)&&(this.activeReplacements=i,!0)}getResolvedImageFromTokens(e){return"string"==typeof e?Bi.build(e):e}populate(e,t,i,n){const r=this.layers[0],o=r.layout,s="globe"===this.projection.name,a=o.get("text-font"),l=o.get("text-field"),c=o.get("icon-image"),[u,h]=o.get("icon-size-scale-range"),d=ze(t.scaleFactor||1,u,h),f=("constant"!==l.value.kind||l.value.value instanceof Fi&&!l.value.value.isEmpty()||l.value.value.toString().length>0)&&("constant"!==a.value.kind||a.value.value.length>0),p="constant"!==c.value.kind||!!c.value.value||Object.keys(c.parameters).length>0,m=this.hasAnyAppearanceProperty("icon-image"),_=o.get("symbol-sort-key");if(this.features=[],this.appearanceFeatureData=[],!f&&!p&&!m)return;const g=t.iconDependencies,y=t.glyphDependencies,v=t.availableImages,x=new ga(this.zoom,{worldview:this.worldview,activeFloors:t.activeFloors}),b=e=>{const t=e.id.toString();g.has(t)?g.get(t).push(e):g.set(t,[e])};for(const t of e){const{feature:e,id:l,index:c,sourceLayerIndex:u}=t,h=r._featureFilter.needGeometry,w=gu(e,h);if(!r._featureFilter.filter(x,w,i))continue;if(h||(w.geometry=_u(e,i,n)),s&&1!==e.type&&i.z<=5){const e=w.geometry,t=.98078528056,n=(e,n)=>N(Oh(e.x,e.y,i,1),Oh(n.x,n.y,i,1))<t;for(let t=0;t<e.length;t++)e[t]=du(e[t],n)}let T,S;if(f){const e=r.getValueAndResolveTokens("text-field",w,i,v),t=Fi.factory(e);Iv(t)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===pa()||this.hasRTLText&&_a.isParsed())&&(T=rg(t,r,w))}if(p){const e=r.getValueAndResolveTokens("icon-image",w,i,v);S=this.getResolvedImageFromTokens(e)}const E=this.layers[0];let I=!1;if(!S&&m){const e=E.getAppearances();for(const t of e)if(t.getProperty("icon-image")){const e=E.getAppearanceValueAndResolveTokens(t,"icon-image",w,i,v);if(e){S=this.getResolvedImageFromTokens(e),I=!0;break}}}if(!T&&!S)continue;const A=this.sortFeaturesByKey?_.evaluate(w,{},i):void 0,M={id:l,text:T,icon:S,index:c,sourceLayerIndex:u,geometry:w.geometry,properties:e.properties,type:vv[e.type],sortKey:A};if(this.features.push(M),this.featureToAppearanceIndex[c]=this.appearanceFeatureData.length,this.appearanceFeatureData.push({id:l,properties:e.properties,usesAppearanceIconAsPlaceholder:I,isUsingAppearanceVertexData:!1,layoutBasedVertexData:[],activeAppearance:null}),S){const e=E._unevaluatedLayout._values,{iconPrimary:t,iconSecondary:n}=zy(S,this.iconSizeData,e["icon-size"],i,this.zoom,M,this.pixelRatio,d,this.worldview);b(t),n&&(this.hasAnySecondaryIcon=!0,b(n))}const C=E.getAppearances();
2if(0!==C.length&&C.forEach(e=>{if(!e.getProperty("icon-image"))return;const t=this.getCombinedIconPrimary(e,E,w,i,v,M,d);t&&b(t)}),T){const e=a.evaluate(w,{},i).join(","),t="map"===o.get("text-rotation-alignment")&&"point"!==o.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Ig.vertical)>=0;for(const i of T.sections)if(i.image){const e=i.image.getPrimary().scaleSelf(this.pixelRatio),t=e.id.toString(),n=g.get(t)||[];n.push(e),g.set(t,n)}else{const n=Js(T.toString()),r=i.fontStack||e,o=y[r]=y[r]||{};this.calculateGlyphDependencies(i.text,o,t,this.allowVerticalPlacement,n)}}}if("line"===o.get("symbol-placement")&&(this.features=function(e){const t={},i={},n=[];let r=0;function o(t){n.push(e[t]),r++}function s(e,t,r){const o=i[e];return delete i[e],i[t]=o,n[o].geometry[0].pop(),n[o].geometry[0]=n[o].geometry[0].concat(r[0]),o}function a(e,i,r){const o=t[i];return delete t[i],t[e]=o,n[o].geometry[0].shift(),n[o].geometry[0]=r[0].concat(n[o].geometry[0]),o}function l(e,t,i){const n=i?t[0][t[0].length-1]:t[0][0];return`${e}:${n.x}:${n.y}`}for(let c=0;c<e.length;c++){const u=e[c],h=u.geometry,d=u.text?u.text.toString():null;if(!d){o(c);continue}const f=l(d,h),p=l(d,h,!0);if(f in i&&p in t&&i[f]!==t[p]){const e=a(f,p,h),r=s(f,p,n[e].geometry);delete t[f],delete i[p],i[l(d,n[r].geometry,!0)]=r,n[e].geometry=null}else f in i?s(f,p,h):p in t?a(f,p,h):(o(c),t[f]=r-1,i[p]=r-1)}return n.filter(e=>e.geometry)}(this.features)),"hd-road-markup"===o.get("symbol-elevation-reference")){if(this.elevationType="road",t.elevationFeatures){!this.elevationFeatures&&t.elevationFeatures.length>0&&(this.elevationFeatures=[],this.elevationFeatureIdToIndex=new Map);for(const e of t.elevationFeatures)this.elevationFeatureIdToIndex.set(e.id,this.elevationFeatures.length),this.elevationFeatures.push(e)}}else o.get("symbol-z-elevate")&&(this.elevationType="offset");"none"!==this.elevationType&&(this.zOffsetBuffersNeedUpload=!0),this.sortFeaturesByKey&&this.features.sort((e,t)=>
2e.sortKey-t.sortKey)}getCombinedIconPrimary(e,t,i,n,r,o,s){let a,l;const c=e.getUnevaluatedProperties();if(void 0!==c._values["icon-image"].value){const o=t.getAppearanceValueAndResolveTokens(e,"icon-image",i,n,r);a=this.getResolvedImageFromTokens(o)}else{const e=t.getValueAndResolveTokens("icon-image",i,n,r);a=this.getResolvedImageFromTokens(e)}if(a){const e=c._values["icon-size"]||t._unevaluatedLayout._values["icon-size"];l=zy(a,$g(this.zoom,e,this.worldview),e,n,this.zoom,o,this.pixelRatio,s,this.worldview).iconPrimary}return l}updateAppearanceBasedIconTextures(e,t,i,n){if(!this.appearanceFeatureData)return!1;if(!this.icon.layoutVertexArray||0===this.icon.layoutVertexArray.length)return!1;const r=this.layers[0];let o=!1,s=0;const a=r.layout,[l,c]=a.get("icon-size-scale-range"),u=ze(1,l,c);for(let a=0;a<this.symbolInstances.length;a++){const l=this.symbolInstances.get(a),c=this.featureToAppearanceIndex[l.featureIndex],h=void 0!==c?this.appearanceFeatureData[c]:void 0;if(h&&l.placedIconSymbolIndex>=0){const a=h.id,c=t&&void 0!==a?t[String(a)]:void 0,d={type:"Point",id:h.id,properties:h.properties,geometry:[]},f=this.layers[0].appearances&&this.layers[0].appearances.find(t=>t.isActive({globals:n,feature:d,canonical:e,featureState:c}));if(h.activeAppearance===f){s+=l.numIconVertices;continue}if(f){h.activeAppearance=f;const t=this.getCombinedIconPrimary(f,r,d,e,i,{sortKey:void 0,text:void 0,icon:null,index:l.featureIndex,sourceLayerIndex:l.featureIndex,geometry:[],properties:h.properties,type:"Point",id:h.id},u);if(!t)continue;const a=t.toString(),c=this.iconAtlasPositions&&this.iconAtlasPositions.get(a);if(c){const t=r.getAppearanceValueAndResolveTokens(f,"icon-offset",d,e,i),a=t&&Array.isArray(t)?t:[0,0];let p=Vg(c,void 0,a,r.layout.get("icon-anchor").evaluate(d,{},e));const m=r.getAppearanceValueAndResolveTokens(f,"icon-rotate",d,e,i),_="number"==typeof m?m:0,g=c.sdf,y=r.layout.get("icon-text-fit").constantOr("none");"none"!==y&&h.textShaping&&h.iconTextFitPadding&&h.fontScale&&(p=Ug(p,h.textShaping,y,h.iconTextFitPadding,a,h.fontScale));const v=this.calculateEffectiveAppearanceIconSize(f,n.zoom,d,e,i,u),x=0,b=1+(Math.min(Gy,Math.round(v*Hg))<<1),w=fy(p,_,g,"none"!==y,u);h.isUsingAppearanceVertexData||(h.isUsingAppearanceVertexData=!0,h.layoutBasedVertexData=this.icon.getIconVertexData(s,l.numIconVertices));for(let e=0;e<w.length;++e){const t=w[e],i=h.layoutBasedVertexData[0]||l.tileAnchorX,n=h.layoutBasedVertexData[1]||l.tileAnchorY,r=16*t.pixelOffsetTL.x,o=16*t.pixelOffsetTL.y,a=16*t.pixelOffsetBR.x,c=16*t.pixelOffsetBR.y,u=16*t.minFontScaleX,d=16*t.minFontScaleY;this.icon.updateIconVertexData(s,i,n,Math.round(32*t.tl.x),Math.round(32*t.tl.y),t.texPrimary.x,t.texPrimary.y,x,b,r,o,u,d),this.icon.updateIconVertexData(s+1,i,n,Math.round(32*t.tr.x),Math.round(32*t.tr.y),t.texPrimary.x+t.texPrimary.w,t.texPrimary.y,x,b,a,o,u,d),this.icon.updateIconVertexData(s+2,i,n,Math.round(32*t.bl.x),Math.round(32*t.bl.y),t.texPrimary.x,t.texPrimary.y+t.texPrimary.h,x,b,r,c,u,d),this.icon.updateIconVertexData(s+3,i,n,Math.round(32*t.br.x),Math.round(32*t.br.y),t.texPrimary.x+t.texPrimary.w,t.texPrimary.y+t.texPrimary.h,x,b,a,c,u,d),s+=4}const T=l.numIconVertices-4*w.length;for(let e=0;e<T;++e)this.icon.updateIconVertexData(s+e,0,0,0,0,0,0,0,0,0,0,0,0);o=!0}else s+=l.numIconVertices}else if(h.usesAppearanceIconAsPlaceholder)this.layers[0].appearances&&this.layers[0].appearances.length>0&&(this.icon.updateIconVertexData(s,0,0,0,0,0,0,0,0,0,0,0,0),this.icon.updateIconVertexData(s+1,0,0,0,0,0,0,0,0,0,0,0,0),this.icon.updateIconVertexData(s+2,0,0,0,0,0,0,0,0,0,0,0,0),this.icon.updateIconVertexData(s+3,0,0,0,0,0,0,0,0,0,0,0,0),o=!0),s+=l.numIconVertices,h.activeAppearance=null;else if(h.isUsingAppearanceVertexData){const e=12,t=h.layoutBasedVertexData.length/e;for(let i=0;i<t;++i){const t=i*e;this.icon.updateIconVertexData(s+i,h.layoutBasedVertexData[t+0],h.layoutBasedVertexData[t+1],h.layoutBasedVertexData[t+2],h.layoutBasedVertexData[t+3],h.layoutBasedVertexData[t+4],h.layoutBasedVertexData[t+5],h.layoutBasedVertexData[t+6],h.layoutBasedVertexData[t+7],h.layoutBasedVertexData[t+8],h.layoutBasedVertexData[t+9],h.layoutBasedVertexData[t+10],h.layoutBasedVertexData[t+11])}s+=t,h.isUsingAppearanceVertexData=!1,h.activeAppearance=null,o=!0}else s+=l.numIconVertices,h.activeAppearance=null}}return o}update(e,t,i,n,r,o,s){this.text.programConfigurations.updatePaintArrays(e,t,r,i,n,o,s,this.worldview),this.icon.programConfigurations.updatePaintArrays(e,t,r,i,n,o,s,this.worldview)}updateRoadElevation(e){if("road"!==this.elevationType||!this.elevationFeatures)return;if(this.elevationStateComplete)return;this.elevationStateComplete=!0,this.hasAnyZOffset=!1;let t=!1;const i=au(e),n=1/i;let r=!1,o=!1;for(let e=0;e<this.symbolInstances.length;e++){const s=this.symbolInstances.get(e),a=E(1,0,0),l=E(0,1,0),{numHorizontalGlyphVertices:c,numVerticalGlyphVertices:u,numIconVertices:h,numVerticalIconVertices:d}=s,f=c>0||u>0,p=h>0,m=this.elevationFeatures[s.elevationFeatureIndex];if(m){const e=new Se(s.tileAnchorX,s.tileAnchorY),c=.075+m.pointElevation(e);s.zOffset!==c&&(t=!0,s.zOffset=c),0!==c&&(this.hasAnyZOffset=!0);const u=m.computeSlopeNormal(e,n),h=le(ee(),E(0,0,1),u);q(a,a,h),q(l,l,h),a[2]*=i,l[2]*=i,1===a[0]&&0===a[1]&&0===a[2]&&0===l[0]&&1===l[1]&&0===l[2]||(r=r||f,o=o||p)}if(f&&(Sv(this.text.orientationVertexArray,c,a,l),Sv(this.text.orientationVertexArray,u,a,l)),p){const{placedIconSymbolIndex:e,verticalPlacedIconSymbolIndex:t}=s;e>=0&&Sv(this.icon.orientationVertexArray,h,a,l),t>=0&&Sv(this.icon.orientationVertexArray,d,a,l)}}r||(this.text.orientationVertexArray=void 0),o||(this.icon.orientationVertexArray=void 0),t&&(this.zOffsetBuffersNeedUpload=!0,this.zOffsetSortDirty=!0)}
vendor: 9,678 bytes, line 2
2updateZOffset(){const e=(e,t,n)=>{i+=t,i>e.length&&e.resize(i);for(let r=-t;r<0;r++)e.emplace(r+i,n)},t=(e,t,i)=>{n+=t,n>e.length&&e.resize(n);for(let r=-t;r<0;r++)e.emplace(r+n,i)};if(!this.zOffsetBuffersNeedUpload)return;this.zOffsetBuffersNeedUpload=!1;let i=0,n=0;for(let i=0;i<this.symbolInstances.length;i++){const n=this.symbolInstances.get(i),{numHorizontalGlyphVertices:r,numVerticalGlyphVertices:o,numIconVertices:s}=n,a=n.zOffset,l=s>0;if((r>0||o>0)&&(e(this.text.zOffsetVertexArray,r,a),e(this.text.zOffsetVertexArray,o,a)),l){const{placedIconSymbolIndex:e,verticalPlacedIconSymbolIndex:i}=n;e>=0&&t(this.icon.zOffsetVertexArray,s,a),i>=0&&t(this.icon.zOffsetVertexArray,n.numVerticalIconVertices,a)}}this.text.zOffsetVertexBuffer&&this.text.zOffsetVertexBuffer.updateData(this.text.zOffsetVertexArray),this.icon.zOffsetVertexBuffer&&this.icon.zOffsetVertexBuffer.updateData(this.icon.zOffsetVertexArray)}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e,t,i,n,r){!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.zOffsetBuffersNeedUpload,!1),null===this.hasAppearances&&(this.hasAppearances=this.layers.some(e=>e.appearances&&e.appearances.length>0)),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload,this.hasAppearances),this.uploaded=!0}updateAppearances(e,t,i,n){return!!(e&&t&&i)&&!(!this.icon.layoutVertexArray||0===this.icon.layoutVertexArray.length)&&!!this.icon.layoutVertexArray.arrayBuffer&&void(this.updateAppearanceBasedIconTextures(e,t,i,n)&&this.icon.layoutVertexBuffer&&null!==this.icon.layoutVertexArray.arrayBuffer&&this.icon.layoutVertexArray.length===this.icon.layoutVertexBuffer.length&&this.icon.layoutVertexBuffer.updateData(this.icon.layoutVertexArray))}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=yv(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){const i=this.lineVertexArray.length;if(void 0!==e.segment)for(const{x:e,y:i}of t)this.lineVertexArray.emplaceBack(e,i);return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}}addSymbols(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g){const y=e.indexArray,v=e.layoutVertexArray,x=e.globeExtVertexArray,b=e.segments.prepareSegment(4*g,v,y,this.canOverlap?o.sortKey:void 0),w=this.glyphOffsetArray.length,T=b.vertexLength,S=this.allowVerticalPlacement&&s===Ig.vertical?Math.PI/2:0,E=o.text&&o.text.sections;for(let n=0;n<t.length;n++){const{tl:r,tr:s,bl:c,br:u,texPrimary:h,texSecondary:_,pixelOffsetTL:g,pixelOffsetBR:w,minFontScaleX:T,minFontScaleY:I,glyphOffset:A,isSDF:M,sectionIndex:C}=t[n],P=b.vertexLength,D=A[1];if(bv(v,l.x,l.y,r.x,D+r.y,h.x,h.y,i,M,g.x,g.y,T,I),bv(v,l.x,l.y,s.x,D+s.y,h.x+h.w,h.y,i,M,w.x,g.y,T,I),bv(v,l.x,l.y,c.x,D+c.y,h.x,h.y+h.h,i,M,g.x,w.y,T,I),bv(v,l.x,l.y,u.x,D+u.y,h.x+h.w,h.y+h.h,i,M,w.x,w.y,T,I),a){const{x:t,y:i,z:n}=a.anchor,[r,o,s]=a.up;Tv(x,t,i,n,r,o,s),Tv(x,t,i,n,r,o,s),Tv(x,t,i,n,r,o,s),Tv(x,t,i,n,r,o,s),Ev(e.dynamicLayoutVertexArray,t,i,n,S)}else Ev(e.dynamicLayoutVertexArray,l.x,l.y,l.z,S);if(m){const t=_||h;wv(e.iconTransitioningVertexArray,t.x,t.y),wv(e.iconTransitioningVertexArray,t.x+t.w,t.y),wv(e.iconTransitioningVertexArray,t.x,t.y+t.h),wv(e.iconTransitioningVertexArray,t.x+t.w,t.y+t.h)}y.emplaceBack(P,P+1,P+2),y.emplaceBack(P+1,P+2,P+3),b.vertexLength+=4,b.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(A[0]),n!==t.length-1&&C===t[n+1].sectionIndex||e.programConfigurations.populatePaintArrays(v.length,o,o.index,{},d,f,p,E&&E[C],this.worldview)}const I=g-t.length;0!==I&&this._addNullVertices(I,v,i,a,x,e,m,b,y);const A=a?a.anchor:l;e.placedSymbolArray.emplaceBack(A.x,A.y,A.z,l.x,l.y,w,this.glyphOffsetArray.length-w,T,c,u,l.segment,i?i[0]:0,i?i[1]:0,n[0],n[1],s,0,0,0,h,0),e.symbolInstanceIndices.push(_)}_addNullVertices(e,t,i,n,r,o,s,a,l){for(let c=0;c<e;c++){for(let e=0;e<4;e++)bv(t,0,0,0,0,0,0,i,!1,0,0,0,0),n?(Tv(r,0,0,0,0,0,0),Ev(o.dynamicLayoutVertexArray,0,0,0,0)):Ev(o.dynamicLayoutVertexArray,0,0,0,0),s&&wv(o.iconTransitioningVertexArray,0,0);const e=a.vertexLength;l.emplaceBack(e,e+1,e+2),l.emplaceBack(e+1,e+2,e+3),a.vertexLength+=4,a.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(0)}}_commitLayoutVertex(e,t,i,n,r,o,s){e.emplaceBack(t,i,n,r,o,Math.round(s.x),Math.round(s.y))}_addCollisionDebugVertices(e,t,i,n,r,o,s){const a=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),l=a.vertexLength,c=s.tileAnchorX,u=s.tileAnchorY;for(let e=0;e<4;e++)i.collisionVertexArray.emplaceBack(0,0,0,0,0,0);this._commitDebugCollisionVertexUpdate(i.collisionVertexArrayExt,t,e.padding,s.zOffset),this._commitLayoutVertex(i.layoutVertexArray,n,r,o,c,u,new Se(e.x1,e.y1)),this._commitLayoutVertex(i.layoutVertexArray,n,r,o,c,u,new Se(e.x2,e.y1)),this._commitLayoutVertex(i.layoutVertexArray,n,r,o,c,u,new Se(e.x2,e.y2)),this._commitLayoutVertex(i.layoutVertexArray,n,r,o,c,u,new Se(e.x1,e.y2)),a.vertexLength+=4;const h=i.indexArray;h.emplaceBack(l,l+1),h.emplaceBack(l+1,l+2),h.emplaceBack(l+2,l+3),h.emplaceBack(l+3,l),a.primitiveLength+=4}_addTextDebugCollisionBoxes(e,t,i,n,r,o){for(let s=n;s<r;s++){const n=i.get(s),r=this.getSymbolInstanceTextSize(e,o,t,s);this._addCollisionDebugVertices(n,r,this.textCollisionBox,n.projectedAnchorX,n.projectedAnchorY,n.projectedAnchorZ,o)}}_addIconDebugCollisionBoxes(e,t,i,n,r,o){for(let s=n;s<r;s++){const n=i.get(s),r=this.getSymbolInstanceIconSize(e,t,o.placedIconSymbolIndex);this._addCollisionDebugVertices(n,r,this.iconCollisionBox,n.projectedAnchorX,n.projectedAnchorY,n.projectedAnchorZ,o)}}generateCollisionDebugBuffers(e,t,i){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Mv(Sl,tg.members,wl),this.iconCollisionBox=new Mv(Sl,tg.members,wl);const n=Zg(this.iconSizeData,e),r=Zg(this.textSizeData,e,i);for(let i=0;i<this.symbolInstances.length;i++){const o=this.symbolInstances.get(i);this._addTextDebugCollisionBoxes(r,e,t,o.textBoxStartIndex,o.textBoxEndIndex,o),this._addTextDebugCollisionBoxes(r,e,t,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o),this._addIconDebugCollisionBoxes(n,e,t,o.iconBoxStartIndex,o.iconBoxEndIndex,o),this._addIconDebugCollisionBoxes(n,e,t,o.verticalIconBoxStartIndex,o.verticalIconBoxEndIndex,o)}}getSymbolInstanceTextSize(e,t,i,n){const r=this.text.placedSymbolArray.get(t.rightJustifiedTextSymbolIndex>=0?t.rightJustifiedTextSymbolIndex:t.centerJustifiedTextSymbolIndex>=0?t.centerJustifiedTextSymbolIndex:t.leftJustifiedTextSymbolIndex>=0?t.leftJustifiedTextSymbolIndex:t.verticalPlacedTextSymbolIndex>=0?t.verticalPlacedTextSymbolIndex:n),o=Wg(this.textSizeData,e,r)/ng;return this.tilePixelRatio*o}getSymbolInstanceIconSize(e,t,i){const n=this.icon.placedSymbolArray.get(i),r=Wg(this.iconSizeData,e,n);return this.tilePixelRatio*r}_commitDebugCollisionVertexUpdate(e,t,i,n){e.emplaceBack(t,-i,-i,n),e.emplaceBack(t,i,-i,n),e.emplaceBack(t,i,i,n),e.emplaceBack(t,-i,i,n)}_updateTextDebugCollisionBoxes(e,t,i,n,r,o,s){for(let s=n;s<r;s++){const n=i.get(s),r=this.getSymbolInstanceTextSize(e,o,t,s);this._commitDebugCollisionVertexUpdate(this.textCollisionBox.collisionVertexArrayExt,r,n.padding,o.zOffset)}}_updateIconDebugCollisionBoxes(e,t,i,n,r,o,s){for(let s=n;s<r;s++){const n=i.get(s),r=this.getSymbolInstanceIconSize(e,t,o.placedIconSymbolIndex);this._commitDebugCollisionVertexUpdate(this.iconCollisionBox.collisionVertexArrayExt,r,n.padding,o.zOffset)}}updateCollisionDebugBuffers(e,t,i,n){if(!this.hasDebugData())return;this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexArrayExt.clear(),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexArrayExt.clear();const r=Zg(this.iconSizeData,e,n),o=Zg(this.textSizeData,e,i);for(let s=0;s<this.symbolInstances.length;s++){const a=this.symbolInstances.get(s);this._updateTextDebugCollisionBoxes(o,e,t,a.textBoxStartIndex,a.textBoxEndIndex,a,i),this._updateTextDebugCollisionBoxes(o,e,t,a.verticalTextBoxStartIndex,a.verticalTextBoxEndIndex,a,i),this._updateIconDebugCollisionBoxes(r,e,t,a.iconBoxStartIndex,a.iconBoxEndIndex,a,n),this._updateIconDebugCollisionBoxes(r,e,t,a.verticalIconBoxStartIndex,a.verticalIconBoxEndIndex,a,n)}this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexBufferExt&&this.textCollisionBox.collisionVertexBufferExt.updateData(this.textCollisionBox.collisionVertexArrayExt),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexBufferExt&&this.iconCollisionBox.collisionVertexBufferExt.updateData(this.iconCollisionBox.collisionVertexArrayExt)}_deserializeCollisionBoxesForSymbol(e,t,i,n,r,o,s,a,l){const c={};if(t<i){const{x1:i,y1:n,x2:r,y2:o,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d,featureIndex:f}=e.get(t);c.textBox={x1:i,y1:n,x2:r,y2:o,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d},c.textFeatureIndex=f}if(n<r){const{x1:t,y1:i,x2:r,y2:o,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d,featureIndex:f}=e.get(n);c.verticalTextBox={x1:t,y1:i,x2:r,y2:o,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d},c.verticalTextFeatureIndex=f}
vendor: 10,401 bytes, line 2
2if(o<s){const{x1:t,y1:i,x2:n,y2:r,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d,featureIndex:f}=e.get(o);c.iconBox={x1:t,y1:i,x2:n,y2:r,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d},c.iconFeatureIndex=f}if(a<l){const{x1:t,y1:i,x2:n,y2:r,padding:o,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d,featureIndex:f}=e.get(a);c.verticalIconBox={x1:t,y1:i,x2:n,y2:r,padding:o,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d},c.verticalIconFeatureIndex=f}return c}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let t=0;t<this.symbolInstances.length;t++){const i=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,i.textBoxStartIndex,i.textBoxEndIndex,i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i.iconBoxStartIndex,i.iconBoxEndIndex,i.verticalIconBoxStartIndex,i.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}hasIconTextFit(){return this.hasAnyIconTextFit}addIndicesForPlacedSymbol(e,t){const i=e.placedSymbolArray.get(t),n=i.vertexStartIndex+4*i.numGlyphs;for(let t=i.vertexStartIndex;t<n;t+=4)e.indexArray.emplaceBack(t,t+1,t+2),e.indexArray.emplaceBack(t+1,t+2,t+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const t=Math.sin(e),i=Math.cos(e),n=[],r=[],o=[];for(let e=0;e<this.symbolInstances.length;++e){o.push(e);const s=this.symbolInstances.get(e);n.push(0|Math.round(t*s.tileAnchorX+i*s.tileAnchorY)),r.push(s.featureIndex)}return o.sort((e,t)=>n[e]-n[t]||r[t]-r[e]),o}getSortedIndexesByZOffset(){if(!this.zOffsetSortDirty)return this.symbolInstanceIndexesSortedZOffset;if(!this.symbolInstanceIndexesSortedZOffset){this.symbolInstanceIndexesSortedZOffset=[];for(let e=0;e<this.symbolInstances.length;++e)this.symbolInstanceIndexesSortedZOffset.push(e)}return this.zOffsetSortDirty=!1,this.symbolInstanceIndexesSortedZOffset.sort((e,t)=>this.symbolInstances.get(t).zOffset-this.symbolInstances.get(e).zOffset)}addToSortKeyRanges(e,t){const i=this.sortKeyRanges[this.sortKeyRanges.length-1];i&&i.sortKey===t?i.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const e of this.symbolInstanceIndexes){const t=this.symbolInstances.get(e);this.featureSortOrder.push(t.featureIndex);const{rightJustifiedTextSymbolIndex:i,centerJustifiedTextSymbolIndex:n,leftJustifiedTextSymbolIndex:r,verticalPlacedTextSymbolIndex:o,placedIconSymbolIndex:s,verticalPlacedIconSymbolIndex:a}=t;i>=0&&this.addIndicesForPlacedSymbol(this.text,i),n>=0&&n!==i&&this.addIndicesForPlacedSymbol(this.text,n),r>=0&&r!==n&&r!==i&&this.addIndicesForPlacedSymbol(this.text,r),o>=0&&this.addIndicesForPlacedSymbol(this.text,o),s>=0&&this.addIndicesForPlacedSymbol(this.icon,s),a>=0&&this.addIndicesForPlacedSymbol(this.icon,a)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}getElevationFeatureForText(e){const t=this.symbolInstances.get(this.text.symbolInstanceIndices[e]).elevationFeatureIndex;let i;return this.elevationFeatures&&t<this.elevationFeatures.length&&(i=this.elevationFeatures[t]),i}}function Pv(e,t){return t.replace(/{([^{}]+)}/g,(t,i)=>i in e?String(e[i]):"")}let Dv,Rv,Lv;Jo(Cv,"SymbolBucket",{omit:["layers","collisionBoxArray","compareText","features"]}),Cv.addDynamicAttributes=Ev;class zv{constructor(e){this.type=e.property.overrides?e.property.overrides.runtimeType:gi,this.defaultValue=e}evaluate(e){if(e.formattedSection){const t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Jo(zv,"FormatSectionOverride",{omit:["defaultValue"]});const Ov=()=>Lv||(Lv={layout:Dv||(Dv=new Ca({"symbol-placement":new Ia(Pa.layout_symbol["symbol-placement"]),"symbol-spacing":new Ia(Pa.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ia(Pa.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Aa(Pa.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ia(Pa.layout_symbol["symbol-z-order"]),"symbol-z-elevate":new Ia(Pa.layout_symbol["symbol-z-elevate"]),"symbol-elevation-reference":new Ia(Pa.layout_symbol["symbol-elevation-reference"]),"icon-allow-overlap":new Ia(Pa.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Ia(Pa.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ia(Pa.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ia(Pa.layout_symbol["icon-rotation-alignment"]),"icon-size":new Aa(Pa.layout_symbol["icon-size"]),"icon-size-scale-range":new Ia(Pa.layout_symbol["icon-size-scale-range"]),"icon-text-fit":new Aa(Pa.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Aa(Pa.layout_symbol["icon-text-fit-padding"]),"icon-image":new Aa(Pa.layout_symbol["icon-image"]),"icon-image-use-theme":new Ia({type:"string",default:"default","property-type":"data-constant"}),"icon-rotate":new Aa(Pa.layout_symbol["icon-rotate"]),"icon-padding":new Ia(Pa.layout_symbol["icon-padding"]),"icon-keep-upright":new Ia(Pa.layout_symbol["icon-keep-upright"]),"icon-offset":new Aa(Pa.layout_symbol["icon-offset"]),"icon-anchor":new Aa(Pa.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ia(Pa.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ia(Pa.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ia(Pa.layout_symbol["text-rotation-alignment"]),"text-field":new Aa(Pa.layout_symbol["text-field"]),"text-font":new Aa(Pa.layout_symbol["text-font"]),"text-size":new Aa(Pa.layout_symbol["text-size"]),"text-size-scale-range":new Ia(Pa.layout_symbol["text-size-scale-range"]),"text-max-width":new Aa(Pa.layout_symbol["text-max-width"]),"text-line-height":new Aa(Pa.layout_symbol["text-line-height"]),"text-letter-spacing":new Aa(Pa.layout_symbol["text-letter-spacing"]),"text-justify":new Aa(Pa.layout_symbol["text-justify"]),"text-radial-offset":new Aa(Pa.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ia(Pa.layout_symbol["text-variable-anchor"]),"text-anchor":new Aa(Pa.layout_symbol["text-anchor"]),"text-max-angle":new Ia(Pa.layout_symbol["text-max-angle"]),"text-writing-mode":new Ia(Pa.layout_symbol["text-writing-mode"]),"text-rotate":new Aa(Pa.layout_symbol["text-rotate"]),"text-padding":new Ia(Pa.layout_symbol["text-padding"]),"text-keep-upright":new Ia(Pa.layout_symbol["text-keep-upright"]),"text-transform":new Aa(Pa.layout_symbol["text-transform"]),"text-offset":new Aa(Pa.layout_symbol["text-offset"]),"text-allow-overlap":new Ia(Pa.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Ia(Pa.layout_symbol["text-ignore-placement"]),"text-optional":new Ia(Pa.layout_symbol["text-optional"]),visibility:new Ia(Pa.layout_symbol.visibility)})),paint:Rv||(Rv=new Ca({"icon-opacity":new Aa(Pa.paint_symbol["icon-opacity"]),"icon-occlusion-opacity":new Aa(Pa.paint_symbol["icon-occlusion-opacity"]),"icon-emissive-strength":new Aa(Pa.paint_symbol["icon-emissive-strength"]),"text-emissive-strength":new Aa(Pa.paint_symbol["text-emissive-strength"]),"icon-color":new Aa(Pa.paint_symbol["icon-color"]),"icon-halo-color":new Aa(Pa.paint_symbol["icon-halo-color"]),"icon-halo-width":new Aa(Pa.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Aa(Pa.paint_symbol["icon-halo-blur"]),"icon-translate":new Ia(Pa.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ia(Pa.paint_symbol["icon-translate-anchor"]),"icon-image-cross-fade":new Ia(Pa.paint_symbol["icon-image-cross-fade"]),"text-opacity":new Aa(Pa.paint_symbol["text-opacity"]),"text-occlusion-opacity":new Aa(Pa.paint_symbol["text-occlusion-opacity"]),"text-color":new Aa(Pa.paint_symbol["text-color"],{runtimeType:bi,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new Aa(Pa.paint_symbol["text-halo-color"]),"text-halo-width":new Aa(Pa.paint_symbol["text-halo-width"]),"text-halo-blur":new Aa(Pa.paint_symbol["text-halo-blur"]),"text-translate":new Ia(Pa.paint_symbol["text-translate"]),"text-translate-anchor":new Ia(Pa.paint_symbol["text-translate-anchor"]),"icon-color-saturation":new Ia(Pa.paint_symbol["icon-color-saturation"]),"icon-color-contrast":new Ia(Pa.paint_symbol["icon-color-contrast"]),"icon-color-brightness-min":new Ia(Pa.paint_symbol["icon-color-brightness-min"]),"icon-color-brightness-max":new Ia(Pa.paint_symbol["icon-color-brightness-max"]),"symbol-z-offset":new Aa(Pa.paint_symbol["symbol-z-offset"]),"icon-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"}),"icon-halo-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"}),"text-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"}),"text-halo-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"})}))},Lv);class Fv extends Qa{constructor(e,t,i,n){super(e,Ov(),t,i,n,e.layout?e.layout["icon-image-use-theme"]:null),this._colorAdjustmentMatrix=c([]),this.hasOcclusionOpacityProperties=void 0!==e.paint&&("icon-occlusion-opacity"in e.paint||"text-occlusion-opacity"in e.paint)}_handleSpecialPaintPropertyUpdate(e){"icon-occlusion-opacity"!==e&&"text-occlusion-opacity"!==e||(this.hasOcclusionOpacityProperties=!0)}recalculate(e,t){super.recalculate(e,t),this.appearances&&this.appearances.forEac
vendor: 11,758 bytes, line 2
2h(i=>{i.recalculate(e,t,this.iconImageUseTheme)}),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const i=this.layout.get("text-writing-mode");if(i){const e=[];for(const t of i)e.indexOf(t)<0&&e.push(t);this.layout._values["text-writing-mode"]=e}else this.layout._values["text-writing-mode"]="point"===this.layout.get("symbol-placement")?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getColorAdjustmentMatrix(e,t,i,n){return this._saturation===e&&this._contrast===t&&this._brightnessMin===i&&this._brightnessMax===n||(this._colorAdjustmentMatrix=function(e,t,i,n){e=rt(e),t=nt(t);const r=a(),o=e/3,s=1-2*o,l=[s,o,o,0,o,s,o,0,o,o,s,0,0,0,0,1],c=.5-.5*t,u=n-i;return h(r,[u,0,0,0,0,u,0,0,0,0,u,0,i,i,i,1],[t,0,0,0,0,t,0,0,0,0,t,0,c,c,c,1]),h(r,r,l),r}(e,t,i,n),this._saturation=e,this._contrast=t,this._brightnessMin=i,this._brightnessMax=n),this._colorAdjustmentMatrix}getValueAndResolveTokens(e,t,i,n){const r=this.layout.get(e).evaluate(t,{},i,n),o=this._unevaluatedLayout._values[e];return o.isDataDriven()||Vo(o.value)||!r?r:Pv(t.properties,r)}getAppearanceValueAndResolveTokens(e,t,i,n,r){const o=e.getProperty(t);if(!o)return;const s=o.evaluate(i,{},n,r),a=e.getUnevaluatedProperties()._values[t];return a.isDataDriven()||Vo(a.value)||!s||"string"!=typeof s?s:Pv(i.properties,s)}createBucket(e){return new Cv(e)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const e of Ov().paint.overridableProperties){if(!Fv.hasPaintOverride(this.layout,e))continue;const t=this.paint.get(e),i=new zv(t),n=new No(i,t.property.specification,this.scope,this.options,this.layout.get("icon-image-use-theme"));let r=null;r="constant"===t.value.kind||"source"===t.value.kind?new jo("source",n):new Go("composite",n,t.value.zoomStops,t.value.interpolationType),this.paint._values[e]=new Sa(t.property,r,t.parameters)}}_handleOverridablePaintPropertyUpdate(e,t,i){return!(!this.layout||t.isDataDriven()||i.isDataDriven())&&Fv.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,t){const i=e.get("text-field"),n=Ov().paint.properties[t];let r=!1;const o=e=>{for(const t of e)if(n.overrides&&n.overrides.hasOverride(t))return void(r=!0)};if("constant"===i.value.kind&&i.value.value instanceof Fi)o(i.value.value.sections);else if("source"===i.value.kind){const e=t=>{r||(t instanceof Gi&&Ui(t.value)===Ei?o(t.value.sections):t instanceof Wi?o(t.sections):t.eachChild(e))},t=i.value;t._styleExpression&&e(t._styleExpression.expression)}return r}getProgramIds(){return["symbol"]}getDefaultProgramParams(e,t,i){return{config:new Rc(this,{zoom:t,lut:i}),overrideFog:!1}}hasElevation(){return this.layout&&"hd-road-markup"===this.layout.get("symbol-elevation-reference")}}let kv,Bv,Nv,Vv;var Uv=rl([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);function jv(e,t,i,n,r,a,l,c){const u=[e,t,1,i,n,1,r,a,1],h=[l,c,1],d=o([],u),[f,p,m]=G(h,h,d);return s(u,u,[f,0,0,0,p,0,0,0,m])}function Gv(e,t,i,n,r,a,l,c){const u=function(e,t,i,n,r,a,l,c){const u=jv(0,0,1,0,1,1,0,1),h=jv(e,t,i,n,r,a,l,c);return s(h,h,o([],u))}(e,t,i,n,r,a,l,c);return[u[2]/u[8]/Vn,u[5]/u[8]/Vn]}function qv(e){return[e[0],Math.min(Math.max(e[1],-nu),nu)]}class Hv extends ni{constructor(e,t,i,n){super(),this.id=e,this.dispatcher=i,this.coordinates=t.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.onNorthPole=!1,this.onSouthPole=!1,this.setEventedParent(n),this.options=t,this._dirty=!1}load(e,t){if(this._loaded=t||!1,this.fire(new Qt("dataloading",{dataType:"source"})),this.url=this.options.url,!this.url)return e&&(this.coordinates=e),this._loaded=!0,void this._finishLoading();this._imageRequest=qt(this.map._requestManager.transformRequest(this.url,Ot.Image),(t,i)=>{this._imageRequest=null,this._loaded=!0,t?this.fire(new ei(t)):i&&(this.image=i instanceof HTMLImageElement?_t.getImageData(i):i,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,e&&(this.coordinates=e),this._finishLoading())})}loaded(){return this._loaded}updateImage(e){return e.url?(this._imageRequest&&e.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=e.url,this.load(e.coordinates,this._loaded),this):this}setTexture(e){if(!(e.handle instanceof WebGLTexture))throw new Error("The provided handle is not a WebGLTexture instance");return this.texture=new gm(this.map.painter.context,e.handle),this.width=e.dimensions[0],this.height=e.dimensions[1],this._dirty=!1,this._loaded=!0,this._finishLoading(),this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new Qt("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(e){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),!this.texture||this.texture instanceof gm||this.texture.destroy(),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy())}setCoordinates(e){if(this.coordinates=e,this._boundsArray=void 0,this._unsupportedCoords=!1,!e.length)return this;this.onNorthPole=!1,this.onSouthPole=!1;let t=e[0][1],i=e[0][1];for(const n of e)n[1]>i&&(i=n[1]),n[1]<t&&(t=n[1]);const n=(i+t)/2;if(n>nu?this.onNorthPole=!0:n<-nu&&(this.onSouthPole=!0),!this.onNorthPole&&!this.onSouthPole){const t=e.map(lu.fromLngLat);this.tileID=function(e){let t=1/0,i=1/0,n=-1/0,r=-1/0;for(const o of e)t=Math.min(t,o.x),i=Math.min(i,o.y),n=Math.max(n,o.x),r=Math.max(r,o.y);const o=Math.max(n-t,r-i),s=Math.max(0,Math.floor(-Math.log2(o))),a=Math.pow(2,s);let l=Math.floor((t+n)/2*a);return l>1&&(l-=1),new mh(s,l,Math.floor((i+r)/2*a))}(t),this.minzoom=this.maxzoom=this.tileID.z}return this.fire(new Qt("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){!this.texture||this.texture instanceof gm||(this.texture.destroy(),this._dirty=!0),this.texture=null,this._boundsArray=void 0,this._unsupportedCoords=!1}_prepareData(e){for(const e in this.tiles){const t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture)}if(this._boundsArray||this.onNorthPole||this.onSouthPole||this._unsupportedCoords)return;const t=Yy(new mh(0,0,0),this.map.transform.projection),i=[t.projection.project(this.coordinates[0][0],this.coordinates[0][1]),t.projection.project(this.coordinates[1][0],this.coordinates[1][1]),t.projection.project(this.coordinates[2][0],this.coordinates[2][1]),t.projection.project(this.coordinates[3][0],this.coordinates[3][1])];if(!function(e){const t=e[1].x-e[0].x,i=e[1].y-e[0].y,n=e[2].x-e[1].x,r=e[2].y-e[1].y,o=e[3].x-e[2].x,s=e[3].y-e[2].y,a=e[0].x-e[3].x,l=e[0].y-e[3].y,c=t*r-n*i,u=n*s-o*r,h=o*l-a*s,d=a*i-t*l;return c>0&&u>0&&h>0&&d>0||c<0&&u<0&&h<0&&d<0}(i))return console.warn("Image source coordinates are defining non-convex area in the Mercator projection"),void(this._unsupportedCoords=!0);const n=Yy(this.tileID,this.map.transform.projection),[r,a,l,c]=this.coordinates.map(e=>{const t=n.projection.project(e[0],e[1]);return Ky(n,t)._round()});this.perspectiveTransform=Gv(r.x,r.y,a.x,a.y,l.x,l.y,c.x,c.y);const u=this._boundsArray=new ll;u.emplaceBack(r.x,r.y,0,0),u.emplaceBack(a.x,a.y,Vn,0),u.emplaceBack(c.x,c.y,0,Vn),u.emplaceBack(l.x,l.y,Vn,Vn),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy()),this.boundsBuffer=e.createVertexBuffer(u,Uv.members),this.boundsSegments=rc.simpleSegment(0,0,4,2);const h=[],d=[qv((f=this.coordinates)[0]),qv(f[1]),qv(f[2]),qv(f[3])];var f;const[p,m,_,g]=function(e){let t=e[0][0],i=t,n=e[0][1],r=n;for(let o=1;o<e.length;o++)e[o][0]<t?t=e[o][0]:e[o][0]>i&&(i=e[o][0]),e[o][1]<n?n=e[o][1]:e[o][1]>r&&(r=e[o][1]);return[t,n,i-t,r-n]}(d);{const n=new ll,[r,a,l,c]=function(e){let t=e[0].x,i=t,n=e[0].y,r=n;for(let o=1;o<e.length;o++)e[o].x<t?t=e[o].x:e[o].x>i&&(i=e[o].x),e[o].y<n?n=e[o].y:e[o].y>r&&(r=e[o].y);return[t,n,i-t,r-n]}(i),u=e=>[(e.x-r)/l,(e.y-a)/c],[d,f,y,v]=i.map(u),x=function(e,t,i,n,r,a,l,c){const u=jv(0,0,1,0,1,1,0,1);return s(u,u,o([],jv(e,t,i,n,r,a,l,c)))}(d[0],d[1],f[0],f[1],y[0],y[1],v[0],v[1]);this.elevatedGlobePerspectiveTransform=Gv(d[0],d[1],f[0],f[1],y[0],y[1],v[0],v[1]);const b=(e,t)=>{h.push(e.lng);const i=Math.round((e.lng-p)/_*Vn),r=Math.round((e.lat-m)/g*Vn),o=u(t),s=G([],[o[0],o[1],1],x),a=Math.round(s[0]/s[2]*Vn),l=Math.round(s[1]/s[2]*Vn);n.emplaceBack(i,r,a,l)},w=i[3].x-i[0].x,T=i[3].y-i[0].y,S=i[2].x-i[1].x,E=i[2].y-i[1].y;for(let e=0;e<65;e++){const n=e/64,r=[i[0].x+n*w,i[0].y+n*T],o=[i[1].x+n*S,i[1].y+n*E],s=o[0]-r[0],a=o[1]-r[1];for(let e=0;e<65;e++){const i=e/64,n={x:r[0]+s*i,y:r[1]+a*i};b(t.projection.unproject(n.x,n.y),n)}}this.elevatedGlobeVertexBuffer=e.createVertexBuffer(n,Uv.members)}{this.maxLongitudeTriangleSize=0;let t=[],i=new Al;const n=(e,n,r)=>{i.emplaceBack(e,n,r);const o=h[e],s=h[n],a=h[r],l=Math.min(Math.min(o,s),a),c=Math.max(Math.max(o,s),a)-l;c>this.maxLongitudeTriangleSize&&(this.maxLongitudeTriangleSize=c),t.push(l+c/2)};for(let e=0;e<64;e++)for(let t=0;t<64;t++){const i=65*e+t,r=i+1,o=i+65,s=o+1;n(i,o,r),n(r,o,s)}[t,i]=function(e,t){const i=Array.from({length:e.length},(e,t)=>t);i.sort((t,i)=>e[t]-e[i]);const n=[],r=new Al;for(let o=0;o<i.length;o++){const s=i[o];n.push(e[s]);const a=3*s,l=a+1;r.emplaceBack(t.uint16[a],t.uint16[l],t.uint16[l+1])}return[n,r]}(t,i),this.elevatedGlobeTrianglesCenterLongitudes=t,this.elevatedGlobeIndexBuffer=e.createIndexBuffer(i)}this.elevatedGlobeSegments=rc.simpleSegment(0,0,4225,8192),this.elevatedGlobeGridMatrix=new Float32Array([0,_/Vn,0,g/Vn,0,0,m,p,0])}prepare(){const e=0!==Object.keys(this.tiles).length;if(this.tileID&&!e)return;const t=this.map.painter.context,i=t.gl;!this._dirty||this.texture instanceof gm||(this.texture?this.texture.update(this.image):(this.texture=new _m(t,this.image,i.RGBA8),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this._dirty=!1),e&&this._prepareData(t)}loadTile(e,t){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={},t(null)):(e.state="errored",t(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}getSegmentsForLongitude(e){const t=this.elevatedGlobeSegments;if(!this.elevatedGlobeTrianglesCenterLongitudes||!t)return null;const i=this.elevatedGlobeTrianglesCenterLongitudes;let n=(r=e+180)+360*Math.round((i[0]-r)/360);var r;const o=new rc,s=(e,i)=>{o.segments.push({vertexOffset:0,primitiveOffset:e,vertexLength:t.segments[0].vertexLength,primitiveLength:i,sortKey:void 0,vaos:{}})},a=.51*this.maxLongitudeTriangleSize;if(Math.abs(i[0]-n)<=a){const e=it(i,0,i.length,n+a);return e===i.length||s(e,tt(i,e+1,i.length,n+360-a)-e),o}n<i[0]&&(n+=360);const l=tt(i,0,i.length,n-a);if(l===i.length)return s(0,i.length),o;s(0,l-0);const c=it(i,l+1,i.length,n+a);return c!==i.length&&s(c,i.length-c),o}}const $v=(Math.pow(256,2)-1)/16907520;class Wv extends Qa{constructor(e,t,i,n){super(e,{layout:Nv||(Nv=new Ca({visibility:new Ia(Pa.layout_raster.visibility)}
2)),paint:Vv||(Vv=new Ca({"raster-opacity":new Ia(Pa.paint_raster["raster-opacity"]),"raster-color":new Ma(Pa.paint_raster["raster-color"]),"raster-color-mix":new Ia(Pa.paint_raster["raster-color-mix"]),"raster-color-range":new Ia(Pa.paint_raster["raster-color-range"]),"raster-hue-rotate":new Ia(Pa.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ia(Pa.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ia(Pa.paint_raster["raster-brightness-max"]),"raster-saturation":new Ia(Pa.paint_raster["raster-saturation"]),"raster-contrast":new Ia(Pa.paint_raster["raster-contrast"]),"raster-resampling":new Ia(Pa.paint_raster["raster-resampling"]),"raster-fade-duration":new Ia(Pa.paint_raster["raster-fade-duration"]),"raster-emissive-strength":new Ia(Pa.paint_raster["raster-emissive-strength"]),"raster-array-band":new Ia(Pa.paint_raster["raster-array-band"]),"raster-elevation":new Ia(Pa.paint_raster["raster-elevation"]),"raster-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n),this.updateColorRamp(),this._curRampRange=[NaN,NaN]}getProgramIds(){return["raster"]}hasColorMap(){return!!this._transitionablePaint._values["raster-color"].value.value}tileCoverLift(){return this.paint.get("raster-elevation")}isDraped(e){return!(e&&e._source instanceof Hv&&(e._source.onNorthPole||e._source.onSouthPole))&&0===this.paint.get("raster-elevation")}_handleSpecialPaintPropertyUpdate(e){"raster-color"!==e&&"raster-color-range"!==e||(this._curRampRange=[NaN,NaN],this.updateColorRamp())}_clear(){this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}updateColorRamp(e){if(!this.hasColorMap())return;if(!this._curRampRange)return;const t=this._transitionablePaint._values["raster-color"].value.expression,[i,n]=e||this._transitionablePaint._values["raster-color-range"].value.expression.evaluate({zoom:0})||[NaN,NaN];isNaN(i)&&isNaN(n)||i===this._curRampRange[0]&&n===this._curRampRange[1]||(this.colorRamp=fd({expression:t,evaluationKey:"rasterValue",image:this.colorRamp,clips:[{start:i,end:n}],resolution:256}),this.colorRampTexture=null,this._curRampRange=[i,n])}}let Zv,Xv,Yv,Kv,Jv;class Qv extends Qa{constructor(e,t,i,n){super(e,{layout:Zv||(Zv=new Ca({visibility:new Ia(Pa["layout_raster-particle"].visibility)})),paint:Xv||(Xv=new Ca({"raster-particle-array-band":new Ia(Pa["paint_raster-particle"]["raster-particle-array-band"]),"raster-particle-count":new Ia(Pa["paint_raster-particle"]["raster-particle-count"]),"raster-particle-color":new Ma(Pa["paint_raster-particle"]["raster-particle-color"]),"raster-particle-max-speed":new Ia(Pa["paint_raster-particle"]["raster-particle-max-speed"]),"raster-particle-speed-factor":new Ia(Pa["paint_raster-particle"]["raster-particle-speed-factor"]),"raster-particle-fade-opacity-factor":new Ia(Pa["paint_raster-particle"]["raster-particle-fade-opacity-factor"]),"raster-particle-reset-rate-factor":new Ia(Pa["paint_raster-particle"]["raster-particle-reset-rate-factor"]),"raster-particle-elevation":new Ia(Pa["paint_raster-particle"]["raster-particle-elevation"]),"raster-particle-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n),this._updateColorRamp(),this.lastInvalidatedAt=_t.now()}_clear(){this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null),this.tileFramebuffer&&(this.tileFramebuffer.destroy(),this.tileFramebuffer=null),this.particleFramebuffer&&(this.particleFramebuffer.destroy(),this.particleFramebuffer=null)}onRemove(e){this.colorRampTexture&&this.colorRampTexture.destroy(),this.tileFramebuffer&&this.tileFramebuffer.destroy(),this.particleFramebuffer&&this.particleFramebuffer.destroy()}hasColorMap(){return!!this._transitionablePaint._values["raster-particle-color"].value.value}getProgramIds(){return["rasterParticle"]}hasOffscreenPass(){return"none"!==this.visibility}isDraped(e){return!1}_handleSpecialPaintPropertyUpdate(e){"raster-particle-color"!==e&&"raster-particle-max-speed"!==e||(this._updateColorRamp(),this._invalidateAnimationState()),"raster-particle-count"===e&&this._invalidateAnimationState()}_updateColorRamp(){if(!this.hasColorMap())return;const e=this._transitionablePaint._values["raster-particle-color"].value.expression,t=this._transitionablePaint._values["raster-particle-max-speed"].value.expression.evaluate({zoom:0});this.colorRamp=fd({expression:e,evaluationKey:"rasterParticleSpeed",image:this.colorRamp,clips:[{start:0,end:t}],resolution:256}),this.colorRampTexture=null}
vendor: 11,534 bytes, line 2
2_invalidateAnimationState(){this.lastInvalidatedAt=_t.now()}tileCoverLift(){return this.paint.get("raster-particle-elevation")}}class ex extends Qa{constructor(e,t){super(e,{},t,null),this.implementation=e,e.slot&&(this.slot=e.slot)}is3D(e){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}isDraped(e){return void 0!==this.implementation.renderToTile}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(e){this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)}onRemove(e){this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)}}function tx(e,t,i){const n=[0,0,1],r=te([]);return ne(r,r,i?-Me(e)+Math.PI:Me(e)),ie(r,r,-Me(t)),q(n,n,r),B(n,n)}const ix={None:0,Model:1,Symbol:2,FillExtrusion:4};class nx{constructor(e,t,i,n){this.message=(e?`${e}: `:"")+i,n&&(this.identifier=n),null!=t&&t.__line__&&(this.line=t.__line__)}}function rx(e,t){const i=-1===e.indexOf("://");try{return new URL(e,i&&t?"http://example.com":void 0),!0}catch(e){return!1}}class ox{constructor(e,t){this.feature=e,this.instancedDataOffset=t,this.instancedDataCount=0,this.rotation=[0,0,0],this.scale=[1,1,1],this.translation=[0,0,0]}}class sx{constructor(){this.maxScale=1,this.maxXYTranslationDistance=0,this.instancedDataArray=new Bl,this.instancesEvaluatedElevation=[],this.features=[],this.idToFeaturesIndex={}}colorForInstance(e){const t=16*e,i=this.instancedDataArray.float32;let n=Math.floor(i[t+2]);const r=1.05*(i[t+2]-n);return n/=100,[i[t]%1*1.05,i[t+1]%1*1.05,r,n]}tileCoordinatesForInstance(e){const t=16*e,i=this.instancedDataArray.float32;let n=i[t+0];return n=n>Vn?n-Vn:n,new Se(Math.trunc(n),Math.trunc(i[t+1]))}translationForInstance(e){const t=16*e,i=this.instancedDataArray.float32;return[i[t+4],i[t+5],i[t+6]]}rotationScaleForInstance(e){const t=16*e,i=this.instancedDataArray.float32;return[i[t+7],i[t+8],i[t+9],i[t+10],i[t+11],i[t+12],i[t+13],i[t+14],i[t+15]]}transformForInstance(e){const t=16*e,i=this.instancedDataArray.float32;return[i[t+7],i[t+8],i[t+9],i[t+4],i[t+10],i[t+11],i[t+12],i[t+5],i[t+13],i[t+14],i[t+15],i[t+6],0,0,0,1]}}class ax{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaledZ=this.canonical.z+Math.log2(e.overscaling),this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.projection=e.projection,this.index=e.index,this.worldview=e.worldview,this.hasZoomDependentProperties=this.layers[0].isZoomDependent(),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.hasPattern=!1,this.instancesPerModel={},this.validForExaggeration=0,this.maxVerticalOffset=0,this.maxScale=0,this.maxHeight=0,this.lookupDim=this.zoom>this.canonical.z+1?0:this.zoom>this.canonical.z?256:this.zoom>15?75:100,this.instanceCount=0,this.terrainElevationMin=0,this.terrainElevationMax=0,this.validForDEMTile={id:null,timestamp:0},this.modelUris=[],this.modelsRequested=!1,this.activeReplacements=[],this.replacementUpdateTime=0,this.styleDefinedModelURLs=e.styleDefinedModelURLs,this.hasAppearances=null}updateFootprints(e,t){}updateAppearances(e,t,i,n){}populate(e,t,i,n){this.tileToMeter=au(i);const r=this.layers[0]._featureFilter.needGeometry;this.lookup=new Uint8Array(this.lookupDim*this.lookupDim);for(const{feature:o,id:s,index:a,sourceLayerIndex:l}of e){const e=null!=s?s:o.properties&&o.properties.hasOwnProperty("id")?o.properties.id:void 0,c=gu(o,r);if(!this.layers[0]._featureFilter.filter(new ga(this.zoom,{worldview:this.worldview,activeFloors:t.activeFloors}),c,i))continue;const u={id:e,sourceLayerIndex:l,index:a,geometry:r?c.geometry:_u(o,i,n),properties:o.properties,type:o.type,patterns:{}},h=this.addFeature(u,u.geometry,c);h&&t.featureIndex.insert(o,u.geometry,a,l,this.index,this.instancesPerModel[h].instancedDataArray.length,256)}this.lookup=null}evaluateQueryRenderedFeaturePadding(){const e=this.layers[0].modelManager,t=this.layers[0].scope;let i=0;for(const n of this.modelUris){const r=e.getModel(n,t);if(!r)continue;const o=this.instancesPerModel[n];if(o){const e=.5*z(r.aabb.max,r.aabb.min)*o.maxScale+o.maxXYTranslationDistance,t=Math.min(Vn,Math.max(e/this.tileToMeter,256));i=Math.max(t,i)}}return i}update(e,t,i,n){for(const t in this.instancesPerModel){const i=this.instancesPerModel[t];for(const t in e)i.idToFeaturesIndex.hasOwnProperty(t)&&(this.evaluate(i.features[i.idToFeaturesIndex[t]],e[t],i,!0),this.uploaded=!1)}this.maxHeight=0}updateZoomBasedPaintProperties(){if(!this.hasZoomDependentProperties)return!1;let e=!1;for(const t in this.instancesPerModel){const i=this.instancesPerModel[t];for(const t of i.features){const n=this.layers[0],r=t.feature,o=this.canonical,s=n.paint.get("model-rotation").evaluate(r,{},o),a=n.paint.get("model-scale").evaluate(r,{},o),l=n.paint.get("model-translation").evaluate(r,{},o);$(t.rotation,s)&&$(t.scale,a)&&$(t.translation,l)||(this.evaluate(t,t.featureStates,i,!0),e=!0)}}return e}updateReplacement(e,t,i,n){if(t.updateTime===this.replacementUpdateTime)return!1;this.replacementUpdateTime=t.updateTime;const r=t.getReplacementRegionsForTile(e.toUnwrapped(),!0);if(Df(this.activeReplacements,r))return!1;this.activeReplacements=r;let o=!1;for(const t in this.instancesPerModel){const r=this.instancesPerModel[t],s=r.instancedDataArray;for(const t of r.features){const r=t.instancedDataOffset,a=t.instancedDataCount;for(let t=0;t<a;t++){const a=16*(t+r);let l=s.float32[a+0];const c=l>Vn;l=c?l-Vn:l;const u=Math.floor(l),h=Math.floor(s.float32[a+1]);let d=!1;for(const t of this.activeReplacements)if(!Af(t,i,ix.Model,n)&&!(t.min.x>u||u>t.max.x||t.min.y>h||h>t.max.y)&&(d=kf(Ff(u,h,e.canonical,t.footprintTileId.canonical),t.footprint),d))break;s.float32[a]=d?l+Vn:l,o=o||d!==c}}}return o}isEmpty(){for(const e in this.instancesPerModel)if(0!==this.instancesPerModel[e].instancedDataArray.length)return!1;return!0}uploadPending(){return!this.uploaded}upload(e){if(!this.uploaded)for(const t in this.instancesPerModel){const i=this.instancesPerModel[t];i.instancedDataArray.length<0||0===i.instancedDataArray.length||(i.instancedDataBuffer?i.instancedDataBuffer.updateData(i.instancedDataArray):i.instancedDataBuffer=e.createVertexBuffer(i.instancedDataArray,Tm.members,!0,void 0,this.instanceCount))}this.uploaded=!0}destroy(e){for(const e in this.instancesPerModel){const t=this.instancesPerModel[e];0!==t.instancedDataArray.length&&t.instancedDataBuffer&&t.instancedDataBuffer.destroy()}const t=this.layers[0].modelManager;if(e&&t&&this.modelUris&&this.modelsRequested)for(const e of this.modelUris)t.removeModel(e,"",!0)}addFeature(e,t,i){const n=this.layers[0],r=n.layout.get("model-id").evaluate(i,{},this.canonical);if(!r)return We(`modelId is not evaluated for layer ${n.id} and it is not going to get rendered.`),r;(rx(r,!1)||void 0!==this.styleDefinedModelURLs[r])&&(this.modelUris.includes(r)||this.modelUris.push(r)),this.instancesPerModel[r]||(this.instancesPerModel[r]=new sx);const o=this.instancesPerModel[r],s=o.instancedDataArray,a=new ox(i,s.length);for(const e of t)for(const t of e){if(t.x<0||t.x>=Vn||t.y<0||t.y>=Vn)continue;if(0!==this.lookupDim){const e=(this.lookupDim-1)/Vn,i=this.lookupDim*(t.y*e|0)+t.x*e|0;if(this.lookup){if(0!==this.lookup[i])continue;this.lookup[i]=1}}this.instanceCount++;const e=s.length;s.resize(e+1),o.instancesEvaluatedElevation.push(0),s.float32[16*e]=t.x,s.float32[16*e+1]=t.y}return a.instancedDataCount=o.instancedDataArray.length-a.instancedDataOffset,a.instancedDataCount>0&&(e.id&&(o.idToFeaturesIndex[e.id]=o.features.length),o.features.push(a),this.evaluate(a,{},o,!1)),r}getModelUris(){return this.modelUris}evaluate(e,t,i,n){const r=this.layers[0],o=e.feature,s=this.canonical,a=e.rotation=r.paint.get("model-rotation").evaluate(o,t,s),l=e.scale=r.paint.get("model-scale").evaluate(o,t,s),c=e.translation=r.paint.get("model-translation").evaluate(o,t,s),u=Object.assign({},r.paint.get("model-color").evaluate(o,t,s));u.a=r.paint.get("model-color-mix-intensity").evaluate(o,t,s);const h=[];this.maxVerticalOffset<c[2]&&(this.maxVerticalOffset=c[2]);const d=c[0]*c[0]+c[1]*c[1],f=d>0?Math.sqrt(d):0;i.maxScale=Math.max(Math.max(i.maxScale,l[0]),Math.max(l[1],l[2])),i.maxXYTranslationDistance=Math.max(i.maxXYTranslationDistance,f),this.maxScale=Math.max(Math.max(this.maxScale,l[0]),Math.max(l[1],l[2])),Dm(h,a,l);const p=Math.round(100*u.a)+u.b/1.05;for(let t=0;t<e.instancedDataCount;++t){const r=e.instancedDataOffset+t,o=16*r,a=i.instancedDataArray.float32;let l=0;n&&(l=a[o+6]-i.instancesEvaluatedElevation[r]);const d=0|a[o+1];a[o]=(0|a[o])+u.r/1.05,a[o+1]=d+u.g/1.05,a[o+2]=p,a[o+3]=1/(s.z>10?this.tileToMeter:au(s,d)),a[o+4]=c[0],a[o+5]=c[1],a[o+6]=c[2]+l,a[o+7]=h[0],a[o+8]=h[1],a[o+9]=h[2],a[o+10]=h[4],a[o+11]=h[5],a[o+12]=h[6],a[o+13]=h[8],a[o+14]=h[9],a[o+15]=h[10],i.instancesEvaluatedElevation[r]=c[2]}}}let lx,cx;Jo(ax,"ModelBucket",{omit:["layers"]}),Jo(sx,"PerModelAttributes"),Jo(ox,"ModelFeature");class ux{constructor(e,t,i){this._demTile=e,this._dem=this._demTile.dem,this._scale=t,this._offset=i}static create(e,t,i){const n=i||e.findDEMTileFor(t);if(!n||!n.dem)return;const r=n.dem,o=n.tileID,s=1<<t.canonical.z-o.canonical.z;return new ux(n,r.dim/Vn/s,[(t.canonical.x/s-o.canonical.x)*r.dim,(t.canonical.y/s-o.canonical.y)*r.dim])}tileCoordToPixel(e,t){const i=t*this._scale+this._offset[1];return new Se(Math.floor(e*this._scale+this._offset[0]),Math.floor(i))}getElevationAt(e,t,i,n){const r=e*this._scale+this._offset[0],o=t*this._scale+this._offset[1],s=Math.floor(r),a=Math.floor(o),l=this._dem;return n=!!n,i?di(di(l.get(s,a,n),l.get(s,a+1,n),o-a),di(l.get(s+1,a,n),l.get(s+1,a+1,n),o-a),r-s):l.get(s,a,n)}getElevationAtPixel(e,t,i){return this._dem.get(e,t,!!i)}getMeterToDEM(e){return(1<<this._demTile.tileID.canonical.z)*Qc(1,e)*this._dem.stride}}const hx=new Float32Array(262144),dx=new Uint8Array(262144);function fx(e){let t=0;if(e.meshes)for(const i of e.meshes)t=Math.max(t,i.aabb.max[2]);if(e.children)for(const i of e.children)t=Math.max(t,fx(i));return t}function px(e,t,i){if(e.meshes)for(const n of e.meshes){if(n.aabb.min[0]===1/0)continue;const r=Vu.applyTransform(n.aabb,e.globalMatrix);i.insert(t,r.min[0],r.min[1],r.max[0],r.max[1])}if(e.children)for(const n of e.children)px(n,t,i)}const mx=["","wall","door","roof","window","lamp","logo"];class _x{constructor(e){this.node=e,this.evaluatedRMEA=[[1,0,0,1],[1,0,0,1],[1,0,0,1],[1,0,0,1],[.4,1,0,1],[1,0,0,1],[1,0,0,1]],this.hiddenByReplacement=!1,this.evaluatedTranslation=[0,0,0],this.evaluatedScale=[1,1,1],this.evaluatedColor=[],this.emissionHeightBasedParams=[],this.cameraCollisionOpacity=1,this.feature={type:"Point",id:e.id,geometry:[],properties:{height:fx(e)}},this.aabb=this._getLocalBounds(),this.state=null}_getLocalBounds(){if(!this.node.meshes)return new Vu([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);if(!this.aabb){let e=0;const t=new Vu([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);for(const i of this.node.meshes)this.node.lightMeshIndex!==e&&(i.transformedAabb=Vu.applyTransformFast(i.aabb,this.node.globalMatrix),t.encapsulate(i.transformedAabb)),e++;this.aabb=t}return this.aabb}}class gx{constructor(e,t,i,n,r,o,s,a){this.id=i,this.layers=e,this.layerIds=this.layers.map(e=>e.fqid),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.modelTraits|=Fm.CoordinateSpaceTile,this.uploaded=!1,this.hasPattern=!1,n&&(this.modelTraits|=Fm.HasMapbox
2MeshFeatures),r&&(this.modelTraits|=Fm.HasMeshoptCompression),this.zoom=-1,this.terrainExaggeration=1,this.projection={name:"mercator"},this.replacementUpdateTime=0,this.elevationReadFromZ=255,this.brightness=o,this.worldview=a,this.dirty=!0,this.needsUpload=!1,this.filter=null,this.nodesInfo=[];for(const e of t)this.nodesInfo.push(new _x(e)),px(e,s.featureIndexArray.length,s.grid),s.featureIndexArray.emplaceBack(this.nodesInfo.length-1,0,s.bucketLayerIDs.length-1,0);this.states={},this.hasAppearances=null}updateFootprints(e,t){for(const i of this.getNodesInfo()){const n=i.node;n.footprint&&t.push({footprint:n.footprint,id:e})}}updateAppearances(e,t,i,n){}update(e){const t=0!==Object.keys(e).length;if(t&&!this.stateDependentLayers.length)return;const i=t?this.stateDependentLayers:this.layers;if(!Ee(e,this.states))for(const t of i)this.evaluate(t,e);this.states=structuredClone(e)}populate(){console.log("populate 3D model bucket")}uploadPending(){return!this.uploaded||this.needsUpload}upload(e){if(!this.needsUpload)return;const t=this.getNodesInfo();for(const i of t){const t=i.node;this.uploaded?this.updatePbrBuffer(t):Um(t,e,!0)}for(const e of t)jm(e.node);this.uploaded=!0,this.needsUpload=!1}updatePbrBuffer(e){let t=!1;if(!e.meshes)return t;for(const i of e.meshes)i.pbrBuffer&&(i.pbrBuffer.updateData(i.featureArray),t=!0);return t}needsReEvaluation(e,t,i){const n=e.transform.projectionOptions,r=e.style.getBrightness(),o=this.brightness!==r;if(!this.uploaded||this.dirty||n.name!==this.projection.name||yx(i.paint.get("model-color").value,o)||yx(i.paint.get("model-color-mix-intensity").value,o)||yx(i.paint.get("model-roughness").value,o)||yx(i.paint.get("model-emissive-strength").value,o)||yx(i.paint.get("model-height-based-emissive-strength-multiplier").value,o)){this.projection=n,this.brightness=r;const e=this.getNodesInfo();for(const t of e)t.state=null;return!0}return!1}evaluateTransform(e,t){if(e.transform.zoom===this.zoom)return;this.zoom=e.transform.zoom;const i=this.getNodesInfo(),n=this.id.canonical;for(const e of i){const i=e.feature;e.evaluatedTranslation=t.paint.get("model-translation").evaluate(i,{},n),e.evaluatedScale=t.paint.get("model-scale").evaluate(i,{},n)}}evaluate(e,t){const i=this.getNodesInfo();for(const n of i){if(!n.node.meshes)continue;const i=n.feature,r=t&&t[i.id];if(Ee(r,n.state))continue;n.state=structuredClone(r);const o=n.node.meshes&&n.node.meshes[0].featureData,s=n.evaluatedColor[2],a=n.evaluatedRMEA[2],l=this.id.canonical;if(n.hasTranslucentParts=!1,o){for(let t=0;t<mx.length;t++){const o=mx[t];o.length&&(i.properties.part=o);const s=e.paint.get("model-color").evaluate(i,r,l).toPremultipliedRenderColor(null),a=e.paint.get("model-color-mix-intensity").evaluate(i,r,l);n.evaluatedColor[t]=[s.r,s.g,s.b,a],n.evaluatedRMEA[t][0]=e.paint.get("model-roughness").evaluate(i,r,l),n.evaluatedRMEA[t][2]=e.paint.get("model-emissive-strength").evaluate(i,r,l),n.evaluatedRMEA[t][3]=s.a,n.emissionHeightBasedParams[t]=e.paint.get("model-height-based-emissive-strength-multiplier").evaluate(i,r,l),!n.hasTranslucentParts&&s.a<1&&(n.hasTranslucentParts=!0)}delete i.properties.part,xx(n,s!==n.evaluatedColor[2]||a!==n.evaluatedRMEA[2],this.modelTraits)}else n.evaluatedRMEA[0][2]=e.paint.get("model-emissive-strength").evaluate(i,r,l);n.evaluatedTranslation=e.paint.get("model-translation").evaluate(i,r,l),n.evaluatedScale=e.paint.get("model-scale").evaluate(i,r,l),this.updatePbrBuffer(n.node)||(this.needsUpload=!0)}this.dirty=!1}elevationUpdate(e,t,i,n){const r=e.findDEMTileFor(i);if(r&&(r.tileID.canonical!==this.terrainTile||t!==this.terrainExaggeration)){if(r.dem&&r.tileID.overscaledZ!==this.elevationReadFromZ){this.elevationReadFromZ=r.tileID.overscaledZ;const t=ux.create(e,i,r);if(!t)return;this.modelTraits&Fm.HasMapboxMeshFeatures&&this.updateDEM(e,t,i,n);for(const e of this.getNodesInfo()){const i=e.node;if(!i.footprint||!i.footprint.vertices||!i.footprint.vertices.length)continue;const n=i.footprint.vertices;let r=t.getElevationAt(n[0].x,n[0].y,!0,!0);for(let e=1;e<n.length;e++)r=Math.min(r,t.getElevationAt(n[e].x,n[e].y,!0,!0));i.elevation=r}}this.terrainTile=r.tileID.canonical,this.terrainExaggeration=t}}updateDEM(e,t,i,n){let r=t._dem._modifiedForSources[n];if(void 0===r&&(t._dem._modifiedForSources[n]=[],r=t._dem._modifiedForSources[n]),r.includes(i.canonical))return;const o=t._dem.dim;r.push(i.canonical);let s=!1;for(const e of this.getNodesInfo()){const i=e.node;if(!i.footprint||!i.footprint.grid)continue;const n=i.footprint.grid,r=t.tileCoordToPixel(n.min.x,n.min.y),a=t.tileCoordToPixel(n.max.x,n.max.y),l=Math.min(Math.min(o-a.y,r.x),Math.min(r.y,o-a.x));if(l<0)continue;const c=ze(l,2,5);let u=Math.max(0,r.x-c),h=Math.max(0,r.y-c),d=Math.min(a.x+c,o-1),f=Math.min(a.y+c,o-1);for(let e=h;e<=f;++e)for(let t=u;t<=d;++t)dx[e*o+t]=255;let p=0,m=0;for(let e=0;e<n.cellsY;++e)for(let i=0;i<n.cellsX;
2++i){if(!n.cells[e*n.cellsX+i])continue;const r=t.tileCoordToPixel(n.min.x+i/n.xScale,n.min.y+e/n.yScale),s=t.tileCoordToPixel(n.min.x+(i+1)/n.xScale,n.min.y+(e+1)/n.yScale);for(let e=r.y;e<=Math.min(s.y+1,o-1);++e)for(let i=r.x;i<=Math.min(s.x+1,o-1);++i)255===dx[e*o+i]&&(dx[e*o+i]=0,p+=t.getElevationAtPixel(i,e),m++)}const _=p/m;u=Math.max(1,r.x-c),h=Math.max(1,r.y-c),d=Math.min(a.x+c,o-2),f=Math.min(a.y+c,o-2),s=!0;for(let e=h;e<=f;++e)for(let i=u;i<=d;++i)0===dx[e*o+i]&&(hx[e*o+i]=t._dem.set(i,e,_));for(let e=1;e<c;++e){u=Math.max(1,r.x-e),h=Math.max(1,r.y-e),d=Math.min(a.x+e,o-2),f=Math.min(a.y+e,o-2);for(let i=h;i<=f;++i)for(let n=u;n<=d;++n){const r=i*o+n;if(255===dx[r]){let s=0,a=0,l=-1,u=-1;for(let t=-1;t<=1;++t)for(let r=-1;r<=1;++r){const c=(i+t)*o+n+r;if(dx[c]>=e)continue;const h=hx[c],d=Math.abs(h);d>a&&(s=h,a=d,l=r,u=t)}if(a>.1){const o=1-(e+.5*Math.abs(l*u))/c;let a=t._dem.get(n,i)+s*o;const h=t._dem.get(n+l,i+u),d=t._dem.get(n-l,i-u,!0);(a-h)*(a-d)>0&&(a=(h+d)/2),hx[r]=t._dem.set(n,i,a),dx[r]=e}}}}}s&&(t._demTile.needsDEMTextureUpload=!0,t._dem._timestamp=_t.now())}setFilter(e){this.filter=e?za(e):null}getNodesInfo(){return this.filter?this.nodesInfo.filter(e=>this.filter.filter(new ga(this.id.overscaledZ,{worldview:this.worldview}),e.feature,this.id.canonical)):this.nodesInfo}destroy(){const e=this.getNodesInfo();for(const t of e)jm(t.node),Gm(t.node)}isEmpty(){return!this.nodesInfo.length}updateReplacement(e,t){if(t.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=t.updateTime;const i=t.getReplacementRegionsForTile(e.toUnwrapped());for(const e of this.getNodesInfo()){const t=e.node.footprint;e.hiddenByReplacement=!!t&&!i.find(e=>e.footprint===t)}}getHeightAtTileCoord(e,t){const i=[],n=[0,0,0],r=c([]);for(const o of this.getNodesInfo()){const s=o.node.meshes[0],a=s.transformedAabb;if(e<a.min[0]||t<a.min[1]||e>a.max[0]||t>a.max[1])continue;if(!0===o.node.hidden)return{height:1/0,maxHeight:o.feature.properties.height,hidden:!1,verticalScale:o.evaluatedScale[2]};u(r,o.node.globalMatrix),n[0]=e,n[1]=t,j(n,n,r);const l=(n[0]-s.aabb.min[0])/(s.aabb.max[0]-s.aabb.min[0])*Om|0,c=Math.min(63,(n[1]-s.aabb.min[1])/(s.aabb.max[1]-s.aabb.min[1])*Om|0)*Om+Math.min(63,l),h=s.heightmap[c];if(!(h<0&&o.node.footprint)){if(o.hiddenByReplacement)return;return{height:h,maxHeight:o.feature.properties.height,hidden:!1,verticalScale:o.evaluatedScale[2]}}if(o.node.footprint.grid.query(new Se(e,t),new Se(e,t),i),i.length>0)return{height:void 0,maxHeight:o.feature.properties.height,hidden:o.hiddenByReplacement,verticalScale:o.evaluatedScale[2]}}}}function yx(e,t){return e instanceof jo&&!e.isLightConstant&&t}function vx(e,t,i,n,r,o,s,a){let l=(61440&t|(61440&t)>>4)>>8,c=(3840&t|(3840&t)>>4)>>4,u=240&t|(240&t)>>4;i[3]>0&&(l=di(l,255*i[0],i[3]),c=di(c,255*i[1],i[3]),u=di(u,255*i[2],i[3]));const h=l<<8|c,d=u<<8|Math.floor(255*n[3]),f=function(e){const t=ze(e,0,2);return Math.min(Math.round(.5*t*255),255)}(n[2])<<8|15*n[0]<<4|15*n[1],p=ze(r[0],0,1),m=ze(r[1],0,1),_=ze(r[2],0,1),g=ze(r[3],0,1);let y,v,x,b;if(p!==m&&s!==o&&m!==p){const e=s-o;v=1/(e*(m-p)),x=-(o+e*p)/(e*(m-p));const t=ze(r[4],-1,1);b=Math.pow(10,t),y=255*_<<8|255*g}else y=65535,v=0,x=1,b=1;if(e.emplaceBack(h,d,f,y,v,x,b),a){const e=a.length;a.clear();for(let t=0;t<e;t++)a.emplaceBack(h,d,f,y,v,x,b)}}function xx(e,t,i){const n=e.node;let r=0;const o=i&Fm.HasMeshoptCompression;for(const i of n.meshes){if(n.lights&&n.lightMeshIndex===r)continue;if(!i.featureData)continue;i.featureArray=new Nl,i.featureArray.reserve(i.featureData.length);let s=t;for(const t of i.featureData){const r=o?65535&t:t>>16&65535,a=o?t>>16&65535:65535&t,l=(15&a)<8?15&a:0,c=e.evaluatedRMEA[l],u=e.evaluatedColor[l],h=e.emissionHeightBasedParams[l];let d;if(s&&2===l&&n.lights&&(d=new Nl,d.resize(10*n.lights.length)),vx(i.featureArray,r,u,c,h,i.aabb.min[2],i.aabb.max[2],d),d&&s){s=!1;const e=n.meshes[n.lightMeshIndex];e.featureArray=d,e.featureArray._trim()}}i.featureArray._trim(),r++}}Jo(gx,"Tiled3dModelBucket",{omit:["layers"]}),Jo(_x,"Tiled3dModelFeature");const bx=["id","tile","layer","source","sourceLayer","state"];class wx{constructor(e,t,i,n,r){this.type="Feature",this._vectorTileFeature=e,this._z=t,this._x=i,this._y=n,this.properties=e?e.properties:{},this.id=r}clone(){const e=new wx(this._vectorTileFeature,this._z,this._x,this._y,this.id);return this.state&&(e.state=Object.assign({},this.state)),this.layer&&(e.layer=Object.assign({},this.layer)),this.source&&(e.source=this.source),this.sourceLayer&&(e.sourceLayer=this.sourceLayer),e}get geometry(){return void 0===this._geometry&&this._vectorTileFeature&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._x,this._y,this._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={type:"Feature",state:void 0,geometry:this.geometry,properties:this.properties};for(const t of bx)void 0!==this[t]&&(e[t]=this[t]);return e}}class Tx extends ni{constructor(e,t,i,n){super(),this.id=e,this.type="model",this.models=[],this._loaded=!1,this._options=t,this._modelsInfo=new Map}load(){const e=[];for(const t in this._options.models){const i=this._options.models[t],n=this._modelsInfo.get(t);if(n){const e=n.model;e.position=null!=i.position?new Zc(i.position[0],i.position[1]):new Zc(0,0),e.orientation=null!=i.orientation?i.orientation:[0,0,0],n.modelSpec=i,Tx.applyModelSpecification(e,i),e.computeBoundsAndApplyParent(),this.models.push(e)}else{const n=fm(this.map._requestManager.transformRequest(i.uri,Ot.Model).url).then(e=>{if(!e)return;const n=Km(e),r=new Bm(t,i.uri,i.position,i.orientation,n);Tx.applyModelSpecification(r,i),r.computeBoundsAndApplyParent(),this.models.push(r),this._modelsInfo.set(t,{modelSpec:i,model:r})}).catch(e=>{this.fire(new ei(new Error(`Could not load model ${t} from ${i.uri}: ${e.message}`)))});e.push(n)}}Promise.allSettled(e).then(()=>{this._loaded=!0,this.fire(new Qt("data",{dataType:"source",sourceDataType:"metadata"}))}).catch(e=>{this._loaded=!0,this.fire(new ei(new Error(`Could not load models: ${e.message}`)))})}static applyModelSpecification(e,t){t.nodeOverrides&&Tx.convertNodeOverrides(e,t.n
2odeOverrides),t.materialOverrides&&Tx.convertMaterialOverrides(e,t.materialOverrides),t.nodeOverrideNames&&(e.nodeOverrideNames=[...t.nodeOverrideNames]),t.materialOverrideNames&&(e.materialOverrideNames=[...t.materialOverrideNames]),t.featureProperties&&(e.featureProperties=t.featureProperties)}static convertNodeOverrides(e,t){if(Array.isArray(t)&&t.every(e=>"string"==typeof e)){e.nodeOverrideNames=[];for(const i of t)e.nodeOverrideNames.push(i)}else Object.entries(t).forEach(([t,i])=>{const n={orientation:[0,0,0]};if(i.hasOwnProperty("orientation")){const e=i.orientation;e&&(n.orientation=e)}e.nodeOverrides.set(t,n)})}static convertMaterialOverrides(e,t){if(Array.isArray(t)&&t.every(e=>"string"==typeof e)){e.materialOverrideNames=[];for(const i of t)e.materialOverrideNames.push(i)}else Object.entries(t).forEach(([t,i])=>{const n={color:new li(1,1,1),colorMix:0,emissionStrength:0,opacity:1},r=i["model-color"];void 0!==r&&(n.color.r=r[0],n.color.g=r[1],n.color.b=r[2]);const o=i["model-color-mix-intensity"];void 0!==o&&(n.colorMix=o);const s=i["model-emissive-strength"];void 0!==s&&(n.emissionStrength=s);const a=i["model-opacity"];
vendor: 5,436 bytes, line 2
2void 0!==a&&(n.opacity=a),e.materialOverrides.set(t,n)})}onAdd(e){this.map=e,this.load()}hasTransition(){return!1}loaded(){return this._loaded}getModels(){return this.models}loadTile(e,t){}serialize(){return this._options}setProperty(e,t){return!1}reload(){const e=Wa(this.id,this.scope);this.map.style.clearSource(e),this.models=[],this._modelsInfo.clear(),this._loaded=!1,this.load()}setModels(e){this.models=[];const t=new Map;for(const i in e){const n=e[i];if(this._modelsInfo.has(i)){const e=this._modelsInfo.get(i);e&&e.modelSpec.uri===n.uri&&t.set(i,e)}}this._modelsInfo=t,this._options.models=e,this._loaded=!1,this.load()}}function Sx(e,t,i,n){const r=1<<e.z;t.lat=tu((n/Vn+e.y)/r),t.lng=eu((i/Vn+e.x)/r)}function Ex(e,t,i,n){const r=e.getNodesInfo()[t];if(!r||r.hiddenByReplacement||!r.node.meshes)return;let o=Number.MAX_VALUE;const s=r.node,a=i.tile,l=n.calculatePosMatrix(a.tileID.toUnwrapped(),n.worldSize),c=r.evaluatedScale;let u=0;n.elevation&&s.elevation&&(u=s.elevation*n.elevation.exaggeration()),d(l,l,[(s.anchor?s.anchor[0]:0)*(c[0]-1),(s.anchor?s.anchor[1]:0)*(c[1]-1),u]),f(l,l,c);const p=i.queryGeometry,m=p.isPointQuery()?p.screenBounds:p.screenGeometry,_=function(e){const t=h([],l,e.globalMatrix);h(t,n.expandedFarZProjMatrix,t);for(let i=0;i<e.meshes.length;++i){const r=e.meshes[i];if(i===e.lightMeshIndex)continue;const s=zm(m,n,t,r.aabb);null!=s&&(o=Math.min(s,o))}if(e.children)for(const t of e.children)_(t)};if(_(s),o===Number.MAX_VALUE)return;const g=new Zc(0,0);return Sx(a.tileID.canonical,g,r.node.anchor[0],r.node.anchor[1]),{intersectionZ:o,position:g,feature:r.feature}}const Ix={circle:class extends Qa{constructor(e,t,i,n){super(e,{layout:dh||(dh=new Ca({"circle-sort-key":new Aa(Pa.layout_circle["circle-sort-key"]),"circle-elevation-reference":new Ia(Pa.layout_circle["circle-elevation-reference"]),visibility:new Ia(Pa.layout_circle.visibility)})),paint:fh||(fh=new Ca({"circle-radius":new Aa(Pa.paint_circle["circle-radius"]),"circle-color":new Aa(Pa.paint_circle["circle-color"]),"circle-blur":new Aa(Pa.paint_circle["circle-blur"]),"circle-opacity":new Aa(Pa.paint_circle["circle-opacity"]),"circle-translate":new Ia(Pa.paint_circle["circle-translate"]),"circle-translate-anchor":new Ia(Pa.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Ia(Pa.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Ia(Pa.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Aa(Pa.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Aa(Pa.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Aa(Pa.paint_circle["circle-stroke-opacity"]),"circle-emissive-strength":new Ia(Pa.paint_circle["circle-emissive-strength"]),"circle-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"}),"circle-stroke-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n)}createBucket(e){return new Hu(e)}queryRadius(e){const t=e;return lh("circle-radius",this,t)+lh("circle-stroke-width",this,t)+ch(this.paint.get("circle-translate"))}queryIntersectsFeature(e,t,i,n,r,o,s,a){const l=hh(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),c=this.paint.get("circle-radius").evaluate(t,i)+this.paint.get("circle-stroke-width").evaluate(t,i);return Kh(e,n,o,s,a,"map"===this.paint.get("circle-pitch-alignment"),"map"===this.paint.get("circle-pitch-scale"),l,c)}getProgramIds(){return["circle"]}getDefaultProgramParams(e,t,i){const n=Yh(this);return{config:new Rc(this,{zoom:t,lut:i}),defines:n,overrideFog:!1}}is3D(e){return!e&&!!this.layout&&"none"!==this.layout.get("circle-elevation-reference")}hasElevation(){return this.layout&&"none"!==this.layout.get("circle-elevation-reference")}},heatmap:class extends Qa{createBucket(e){return new id(e)}constructor(e,t,i,n){super(e,{layout:nd||(nd=new Ca({visibility:new Ia(Pa.layout_heatmap.visibility)})),paint:rd||(rd=new Ca({"heatmap-radius":new Aa(Pa.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Aa(Pa.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ia(Pa.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Ma(Pa.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ia(Pa.paint_heatmap["heatmap-opacity"]),"heatmap-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"heatmap-color"===e&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=fd({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)}_clear(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}queryRadius(e){return lh("heatmap-radius",this,e)}queryIntersectsFeature(e,t,i,n,r,o,s,a){const l=this.paint.get("heatmap-radius").evaluate(t,i);return Kh(e,n,o,s,a,!0,!0,new Se(0,0),l)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}getProgramIds(){return["heatmap","heatmapTexture"]}getDefaultProgramParams(e,t,i){return"heatmap"===e?{config:new Rc(this,{zoom:t,lut:i}),overrideFog:!1}:{}}},hillshade:class extends Qa{constructor(e,t,i,n){super(e,{layout:o
vendor: 17,103 bytes, line 2
2d||(od=new Ca({visibility:new Ia(Pa.layout_hillshade.visibility)})),paint:sd||(sd=new Ca({"hillshade-illumination-direction":new Ia(Pa.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Ia(Pa.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Ia(Pa.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Ia(Pa.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Ia(Pa.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Ia(Pa.paint_hillshade["hillshade-accent-color"]),"hillshade-emissive-strength":new Ia(Pa.paint_hillshade["hillshade-emissive-strength"]),"hillshade-shadow-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"}),"hillshade-highlight-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"}),"hillshade-accent-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n)}shouldRedrape(){return this.hasOffscreenPass()&&"viewport"===this.paint.get("hillshade-illumination-anchor")}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}getProgramIds(){return["hillshade","hillshadePrepare"]}getDefaultProgramParams(e,t,i){return{overrideFog:!1}}},fill:class extends Qa{constructor(e,t,i,n){super(e,{layout:uf||(uf=new Ca({"fill-sort-key":new Aa(Pa.layout_fill["fill-sort-key"]),visibility:new Ia(Pa.layout_fill.visibility),"fill-elevation-reference":new Ia(Pa.layout_fill["fill-elevation-reference"]),"fill-construct-bridge-guard-rail":new Aa(Pa.layout_fill["fill-construct-bridge-guard-rail"])})),paint:hf||(hf=new Ca({"fill-antialias":new Ia(Pa.paint_fill["fill-antialias"]),"fill-opacity":new Aa(Pa.paint_fill["fill-opacity"]),"fill-color":new Aa(Pa.paint_fill["fill-color"]),"fill-outline-color":new Aa(Pa.paint_fill["fill-outline-color"]),"fill-translate":new Ia(Pa.paint_fill["fill-translate"]),"fill-translate-anchor":new Ia(Pa.paint_fill["fill-translate-anchor"]),"fill-pattern":new Aa(Pa.paint_fill["fill-pattern"]),"fill-pattern-cross-fade":new Ia(Pa.paint_fill["fill-pattern-cross-fade"]),"fill-emissive-strength":new Ia(Pa.paint_fill["fill-emissive-strength"]),"fill-z-offset":new Aa(Pa.paint_fill["fill-z-offset"]),"fill-bridge-guard-rail-color":new Aa(Pa.paint_fill["fill-bridge-guard-rail-color"]),"fill-tunnel-structure-color":new Aa(Pa.paint_fill["fill-tunnel-structure-color"]),"fill-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"}),"fill-outline-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"}),"fill-bridge-guard-rail-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"}),"fill-tunnel-structure-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n)}getProgramIds(){const e=this.paint.get("fill-pattern"),t=e&&e.constantOr(1),i=[t?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&i.push(t&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),i}getDefaultProgramParams(e,t,i){return{config:new Rc(this,{zoom:t,lut:i}),overrideFog:!1}}recalculate(e,t){super.recalculate(e,t);const i=this.paint._values["fill-outline-color"];"constant"===i.value.kind&&void 0===i.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new cf(e)}queryRadius(){return ch(this.paint.get("fill-translate"))}queryIntersectsFeature(e,t,i,n,r,o){return!e.queryGeometry.isAboveHorizon&&Zu(uh(e.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),n)}isTileClipped(){return 0===this.paint.get("fill-z-offset").constantOr(1)}is3D(e){if(0!==this.paint.get("fill-z-offset").constantOr(1))return!0;const t=this.layout&&"none"!==this.layout.get("fill-elevation-reference");return null!=e?t&&!e:t}hasElevation(){return this.layout&&"none"!==this.layout.get("fill-elevation-reference")}hasShadowPass(){return this.layout&&"none"!==this.layout.get("fill-elevation-reference")}},"fill-extrusion":class extends Qa{constructor(e,t,i,n){super(e,{layout:mp||(mp=new Ca({visibility:new Ia(Pa["layout_fill-extrusion"].visibility),"fill-extrusion-edge-radius":new Ia(Pa["layout_fill-extrusion"]["fill-extrusion-edge-radius"])})),paint:_p||(_p=new Ca({"fill-extrusion-opacity":new Ia(Pa["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Aa(Pa["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ia(Pa["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ia(Pa["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Aa(Pa["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-pattern-cross-fade":new Ia(Pa["paint_fill-extrusion"]["fill-extrusion-pattern-cross-fade"]),"fill-extrusion-height":new Aa(Pa["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Aa(Pa["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-height-alignment":new Ia(Pa["paint_fill-extrusion"]["fill-extrusion-height-alignment"]),"fill-extrusion-base-alignment":new Ia(Pa["paint_fill-extrusion"]["fill-extrusion-base-alignment"]),"fill-extrusion-vertical-gradient":new Ia(Pa["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new Ia(Pa["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new Ia(Pa["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-ambient-occlusion-wall-radius":new Ia(Pa["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-wall-radius"]),"fill-extrusion-ambient-occlusion-ground-radius":new Ia(Pa["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-radius"]),"fill-extrusion-ambient-occlusion-ground-attenuation":new Ia(Pa["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-attenuation"]),"fill-extrusion-flood-light-color":new Ia(Pa["paint_fill-extrusion"]["fill-extrusion-flood-light-color"]),"fill-extrusion-flood-light-intensity":new Ia(Pa["paint_fill-extrusion"]["fill-extrusion-flood-light-intensity"]),"fill-extrusion-flood-light-wall-radius":new Aa(Pa["paint_fill-extrusion"]["fill-extrusion-flood-light-wall-radius"]),"fill-extrusion-flood-light-ground-radius":new Aa(Pa["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-radius"]),"fill-extrusion-flood-light-ground-attenuation":new Ia(Pa["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-attenuation"]),"fill-extrusion-vertical-scale":new Ia(Pa["paint_fill-extrusion"]["fill-extrusion-vertical-scale"]),"fill-extrusion-rounded-roof":new Ia(Pa["paint_fill-extrusion"]["fill-extrusion-rounded-roof"]),"fill-extrusion-cutoff-fade-range":new Ia(Pa["paint_fill-extrusion"]["fill-extrusion-cutoff-fade-range"]),"fill-extrusion-emissive-strength":new Aa(Pa["paint_fill-extrusion"]["fill-extrusion-emissive-strength"]),"fill-extrusion-line-width":new Aa(Pa["paint_fill-extrusion"]["fill-extrusion-line-width"]),"fill-extrusion-cast-shadows":new Ia(Pa["paint_fill-extrusion"]["fill-extrusion-cast-shadows"]),"fill-extrusion-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"}),"fill-extrusion-flood-light-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}createBucket(e){return new rp(e)}queryRadius(){return ch(this.paint.get("fill-extrusion-translate"))}is3D(e){return!0}hasShadowPass(){return this.paint.get("fill-extrusion-cast-shadows")}cutoffRange(){return this.paint.get("fill-extrusion-cutoff-fade-range")}canCastShadows(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}queryIntersectsFeature(e,t,i,n,r,o,s,a,l){const c=hh(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),u=this.paint.get("fill-extrusion-height").evaluate(t,i),h=this.paint.get("fill-extrusion-base").evaluate(t,i),d=[0,0],f=a&&o.elevation,p=o.elevation?o.elevation.exaggeration():1,m=e.tile.getBucket(this);if(f&&m instanceof rp){const e=m.centroidVertexArray,t=l+1;t<e.length&&(d[0]=e.geta_centroid_pos0(t),d[1]=e.geta_centroid_pos1(t))}if(0===d[0]&&1===d[1])return!1;"globe"===o.projection.name&&(n=fp([n],[new Se(0,0),new Se(Vn,Vn)],e.tileID.canonical).map(e=>e.polygon).flat());const _=f?a:null,[g,y]=Ap(o,n,h,u,c,s,_,d,p,o.center.lat,e.tileID.canonical),v=e.queryGeometry;return Ip(g,y,v.isPointQuery()?v.screenBounds:v.screenGeometry)}},building:class extends Qa{constructor(e,t,i,n){super(e,{layout:v_||(v_=new Ca({visibility:new Ia(Pa.layout_building.visibility),"building-facade":new Aa(Pa.layout_building["building-facade"]),"building-facade-floors":new Aa(Pa.layout_building["building-facade-floors"]),"building-facade-unit-width":new Aa(Pa.layout_building["building-facade-unit-width"]),"building-facade-window":new Aa(Pa.layout_building["building-facade-window"]),"building-roof-shape":new Aa(Pa.layout_building["building-roof-shape"]),"building-height":new Aa(Pa.layout_building["building-height"]),"building-base":new Aa(Pa.layout_building["building-base"]),"building-flood-light-wall-radius":new Aa(Pa.layout_building["building-flood-light-wall-radius"]),"building-flood-light-ground-radius":new Aa(Pa.layout_building["building-flood-light-ground-radius"]),"building-flip-roof-orientation":new Aa(Pa.layout_building["building-flip-roof-orientation"])})),paint:x_||(x_=new Ca({"building-opacity":new Ia(Pa.paint_building["building-opacity"]),"building-ambient-occlusion-intensity":new Ia(Pa.paint_building["building-ambient-occlusion-intensity"]),"building-ambient-occlusion-ground-intensity":new Ia(Pa.paint_building["building-ambient-occlusion-ground-intensity"]),"building-ambient-occlusion-ground-radius":new Ia(Pa.paint_building["building-ambient-occlusion-ground-radius"]),"building-ambient-occlusion-ground-attenuation":new Ia(Pa.paint_building["building-ambient-occlusion-ground-attenuation"]),"building-vertical-scale":new Ia(Pa.paint_building["building-vertical-scale"]),"building-cast-shadows":new Ia(Pa.paint_building["building-cast-shadows"]),"building-color":new Aa(Pa.paint_building["building-color"]),"building-emissive-strength":new Aa(Pa.paint_building["building-emissive-strength"]),"building-facade-emissive-chance":new Ia(Pa.paint_building["building-facade-emissive-chance"]),"building-cutoff-fade-range":new Ia(Pa.paint_building["building-cutoff-fade-range"]),"building-flood-light-color":new Ia(Pa.paint_building["building-flood-light-color"]),"building-flood-light-intensity":new Ia(Pa.paint_building["building-flood-light-intensity"]),"building-flood-light-ground-attenuation":new Ia(Pa.paint_building["building-flood-light-ground-attenuation"]),"building-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"}),"building-flood-light-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}createBucket(e){return new __(e)}cutoffRange(){return this.paint.get("building-cutoff-fade-range")}hasShadowPass(){return this.paint.get("building-cast-shadows")}hasLightBeamPass(){return!0}canCastShadows(){return!0}is3D(e){return!0}queryRadius(e){return 0}queryIntersectsFeature(e,t,i,n,r,o,s,a,l){let c=this.layout.get("building-height").evaluate(t,i);const u=this.layout.get("building-base").evaluate(t,i),h=e.tile.getBucket(this).getFootprint(t);if(h){if(0!==h.hiddenFlags)return!1;c=h.height}const[d,f]=Ap(o,n,u,c,new Se(0,0),s,null,[0,0],1,o.center.lat,e.tileID.canonical),p=e.queryGeometry;return Ip(d,f,p.isPointQuery()?p.screenBounds:p.screenGeometry)}},line:class extends Qa{constructor(e,t,i,n){const r=G_();super(e,r,t,i,n),r.layout&&(this.layout=new Ea(r.layout)),this.gradientVersion=0,this.hasElevatedBuckets=!1,this.hasNonElevatedBuckets=!1}_handleSpecialPaintPropertyUpdate(e){if("line-gradient"===e){const e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=e._styleExpression&&e._styleExpression.expression instanceof Ir,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}widthExpression(){return this._transitionablePaint._values["line-width"].value.expression}emissiveStrengthExpression(){return this._transitionablePaint._values["line-emissive-strength"].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values["line-floorwidth"]=(()=>{if(H_)return H_;const e=G_();return H_=new q_(e.paint.properties["line-width"].specification),H_.useIntegerZoom=!0,H_})().possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new R_(e)}getProgramIds(){return[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"]}getDefaultProgramParams(e,t,i){const n=V_(this);return{config:new Rc(this,{zoom:t,lut:i}),defines:n,overrideFog:!1}}queryRadius(e){const t=e,i=$_(lh("line-width",this,t),lh("line-gap-width",this,t)),n=lh("line-offset",this,t);return i/2+Math.abs(n)+ch(this.paint.get("line-translate"))}queryIntersectsFeature(e,t,i,n,r,o){if(e.queryGeometry.isAboveHorizon)return!1;const s=uh(e.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),a=e.pixelToTileUnitsFactor/2*$_(this.paint.get("line-width").evaluate(t,i),this.paint.get("line-gap-width").evaluate(t,i)),l=this.paint.get("line-offset").evaluate(t,i);return l&&(n=function(e,t){const i=[],n=new Se(0,0);for(let r=0;r<e.length;r++){const o=e[r],s=[];for(let e=0;e<o.length;e++){const i=o[e],r=o[e+1],a=0===e?n:i.sub(o[e-1])._unit()._perp(),l=e===o.length-1?n:r.sub(i)._unit()._perp(),c=a._add(l)._unit();c._mult(1/(c.x*l.x+c.y*l.y)),s.push(c._mult(t)._add(i))}i.push(s)}return i}(n,l*e.pixelToTileUnitsFactor)),function(e,t,i){for(let n=0;n<t.length;n++){const r=t[n];if(e.length>=3)for(let t=0;t<r.length;t++)if(nh(e,r[t]))return!0;if(Xu(e,r,i))return!0}return!1}(s,n,a)}isTileClipped(){return this.hasNonElevatedBuckets}isDraped(e){return!this.hasElevatedBuckets||this.layout&&"hd-road-markup"===this.layout.get("line-elevation-reference")}hasElevation(){return this.layout&&"none"!==this.layout.get("line-elevation-reference")}},symbol:Fv,background:class extends Qa{constructor(e,t,i,n){super(e,{layout:kv||(kv=new Ca({visibility:new Ia(Pa.layout_background.visibility)})),paint:Bv||(Bv=new Ca({"background-pitch-alignment":new Ia(Pa.paint_background["background-pitch-alignment"]),"background-color":new Ia(Pa.paint_background["background-color"]),"background-pattern":new Ia(Pa.paint_background["background-pattern"]),"background-opacity":new Ia(Pa.paint_background["background-opacity"]),"background-emissive-strength":new Ia(Pa.paint_background["background-emissive-strength"]),"background-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n)}getProgramIds(){return[this.paint.get("background-pattern")?"backgroundPattern":"background"]}getDefaultProgramParams(e,t,i){return{overrideFog:!1}}is3D(e){return"viewport"===this.paint.get("background-pitch-alignment")}},raster:Wv,"raster-particle":Qv,sky:class extends Qa{constructor(e,t,i,n){super(e,{layout:Yv||(Yv=new Ca({visibility:new Ia(Pa.layout_sky.visibility)})),paint:Kv||(Kv=new Ca({"sky-type":new Ia(Pa.paint_sky["sky-type"]),"sky-atmosphere-sun":new Ia(Pa.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new Ia(Pa.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new Ia(Pa.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new Ia(Pa.paint_sky["sky-gradient-radius"]),"sky-gradient":new Ma(Pa.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new Ia(Pa.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new Ia(Pa.paint_sky["sky-atmosphere-color"]),"sky-opacity":new Ia(Pa.paint_sky["sky-opacity"]),"sky-gradient-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"}),"sky-atmosphere-halo-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"}),"sky-atmosphere-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n),this._updateColorRamp()}_clear(){this.skyboxFbo&&(this.skyboxFbo.destroy(),this.skyboxFbo=null),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null),this._skyboxInvalidated=!0}_handleSpecialPaintPropertyUpdate(e){"sky-gradient"===e?this._updateColorRamp():"sky-atmosphere-sun"!==e&&"sky-atmosphere-halo-color"!==e&&"sky-atmosphere-color"!==e&&"sky-atmosphere-sun-intensity"!==e||(this._skyboxInvali
2dated=!0)}_updateColorRamp(){this.colorRamp=fd({expression:this._transitionablePaint._values["sky-gradient"].value.expression,evaluationKey:"skyRadialProgress"}),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}needsSkyboxCapture(e){if(this._skyboxInvalidated||!this.skyboxTexture||!this.skyboxGeometry)return!0;if(!this.paint.get("sky-atmosphere-sun")){const t=e.style.light.properties.get("position");return this._lightPosition.azimuthal!==t.azimuthal||this._lightPosition.polar!==t.polar}return!1}getCenter(e,t){if("atmosphere"===this.paint.get("sky-type")){const i=this.paint.get("sky-atmosphere-sun"),n=!i,r=e.style.light,o=r.properties.get("position");return n&&"viewport"===r.properties.get("anchor")&&We("The sun direction is attached to a light with viewport anchor, lighting may behave unexpectedly."),n?tx(o.azimuthal,90-o.polar,t):tx(i[0],90-i[1],t)}const i=this.paint.get("sky-gradient-center");return tx(i[0],90-i[1],t)}isSky(){return!0}markSkyboxValid(e){this._skyboxInvalidated=!1,this._lightPosition=e.style.light.properties.get("position")}hasOffscreenPass(){return!0}getProgramIds(){const e=this.paint.get("sky-type");return"atmosphere"===e?["skyboxCapture","skybox"]:"gradient"===e?["skyboxGradient"]:null}},slot:class extends Qa{constructor(e,t,i,n){super(e,{paint:Jv||(Jv=new Ca({}))},t,null)}},model:class extends Qa{constructor(e,t,i,n){super(e,{layout:lx||(lx=new Ca({visibility:new Ia(Pa.layout_model.visibility),"model-id":new Aa(Pa.layout_model["model-id"])})),paint:cx||(cx=new Ca({"model-opacity":new Aa(Pa.paint_model["model-opacity"]),"model-rotation":new Aa(Pa.paint_model["model-rotation"]),"model-scale":new Aa(Pa.paint_model["model-scale"]),"model-translation":new Aa(Pa.paint_model["model-translation"]),"model-color":new Aa(Pa.paint_model["model-color"]),"model-color-mix-intensity":new Aa(Pa.paint_model["model-color-mix-intensity"]),"model-type":new Ia(Pa.paint_model["model-type"]),"model-cast-shadows":new Ia(Pa.paint_model["model-cast-shadows"]),"model-receive-shadows":new Ia(Pa.paint_model["model-receive-shadows"]),"model-ambient-occlusion-intensity":new Ia(Pa.paint_model["model-ambient-occlusion-intensity"]),"model-emissive-strength":new Aa(Pa.paint_model["model-emissive-strength"]),"model-roughness":new Aa(Pa.paint_model["model-roughness"]),"model-height-based-emissive-strength-multiplier":new Aa(Pa.paint_model["model-height-based-emissive-strength-multiplier"]),"model-cutoff-fade-range":new Ia(Pa.paint_model["model-cutoff-fade-range"]),"model-front-cutoff":new Ia(Pa.paint_model["model-front-cutoff"]),"model-elevation-reference":new Ia(Pa.paint_model["model-elevation-reference"]),"model-color-use-theme":new Aa({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n),this.layer=e,this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}createBucket(e){return new ax(e)}getProgramIds(){return["model"]}is3D(e){return!0}hasShadowPass(){return!0}canCastShadows(){return!0}hasLightBeamPass(){return!0}cutoffRange(){return this.paint.get("model-cutoff-fade-range")}queryRadius(e){return e instanceof gx?8191:0}queryRenderedFeatures(e,t,i){const n=t.getSource();if(!(n&&n instanceof Tx))return{};const r=n,o={};o[this.id]=[];const s=o[this.id];let a=0;for(const n of r.models){const r=t.getFeatureState(this.sourceLayer,n.id),o={type:"Unknown",id:n.id,properties:n.featureProperties},l=this.paint.get("model-rotation").evaluate(o,r),c=this.paint.get("model-scale").evaluate(o,r),u=this.paint.get("model-translation").evaluate(o,r),d=this.paint.get("model-elevation-reference");let f=[];km(f,n,i,n.position,l,c,u,"ground"===d,"ground"===d,!1),"globe"===i.projection.name&&(f=Lm(f,i));const p=h([],i.projMatrix,f),m=zm(e.isPointQuery()?e.screenBounds:e.screenGeometry,i,p,n.aabb);if(null!=m){const e=new wx(void 0,0,0,0,n.id);e.layer=this.layer,e.properties=structuredClone(n.featureProperties),e.properties.layer=this.id,e.properties.uri=n.uri,e.properties.orientation=n.orientation,e.sourceLayer=this.sourceLayer,e.geometry={type:"Point",coordinates:[n.position.lng,n.position.lat]},e.state=r,e.source=this.source,s.push({featureIndex:a,feature:e,intersectionZ:m})}++a}return o}queryIntersectsFeature(e,t,i,n,r,o){if(!this.modelManager)return!1;const s=this.modelManager,a=e.tile.getBucket(this);
2if(!(a&&a instanceof ax))return!1;for(const i in a.instancesPerModel){const n=a.instancesPerModel[i],r=void 0!==t.id?t.id:t.properties&&t.properties.hasOwnProperty("id")?t.properties.id:void 0;if(n.idToFeaturesIndex.hasOwnProperty(r)){const t=n.features[n.idToFeaturesIndex[r]],l=s.getModel(i,this.scope);if(!l)return!1;let c=[];const u=new Zc(0,0),d=a.canonical;let f=Number.MAX_VALUE;for(let i=0;i<t.instancedDataCount;++i){const r=16*(t.instancedDataOffset+i),s=n.instancedDataArray.float32,a=[s[r+4],s[r+5],s[r+6]];Sx(d,u,Math.floor(s[r]),Math.floor(s[r+1])),km(c,l,o,u,t.rotation,t.scale,a,!1,!1,!1),"globe"===o.projection.name&&(c=Lm(c,o));const p=h([],o.projMatrix,c),m=e.queryGeometry,_=zm(m.isPointQuery()?m.screenBounds:m.screenGeometry,o,p,l.aabb);null!=_&&(f=Math.min(_,f))}return f!==Number.MAX_VALUE&&f}}return!1}_handleOverridablePaintPropertyUpdate(e,t,i){return!(!this.layout||t.isDataDriven()||i.isDataDriven()||"model-color"!==e&&"model-color-mix-intensity"!==e&&"model-rotation"!==e&&"model-scale"!==e&&"model-translation"!==e&&"model-emissive-strength"!==e)}_isPropertyZoomDependent(e){const t=this._transitionablePaint._values[e];return null!=t&&null!=t.value&&null!=t.value.expression&&t.value.expression instanceof Go}isZoomDependent(){return this._isPropertyZoomDependent("model-scale")||this._isPropertyZoomDependent("model-rotation")||this._isPropertyZoomDependent("model-translation")}},clip:class extends Qa{constructor(e,t,i,n){super(e,{layout:df||(df=new Ca({"clip-layer-types":new Ia(Pa.layout_clip["clip-layer-types"]),"clip-layer-scope":new Ia(Pa.layout_clip["clip-layer-scope"])})),paint:ff||(ff=new Ca({}))},t,i,n)}recalculate(e,t){super.recalculate(e,t)}createBucket(e){return new _f(e)}is3D(e){return!0}}},Ax=new li(0,0,0),Mx=1,Cx=2,Px=1,Dx=2,Rx=3,Lx=1,zx=2,Ox=3,Fx=4,kx=1,Bx=1,Nx=2,Vx=3,Ux=4,jx=5,Gx=1;function qx(e,t,i){1===e&&t.icons.push(function(e,t){return function(e){if(e.usvg_tree.height||(e.usvg_tree.height=e.usvg_tree.width),!e.metadata)return e;const{metadata:t}=e;if(t.content_area){const{content_area:i}=t;null==i.left&&(i.left=0),null==i.top&&(i.top=i.left),null==i.width&&(i.width=e.usvg_tree.width),null==i.height&&(i.height=i.width)}if(t.text_placeholder){const{text_placeholder:e}=t;null==e.top&&(e.top=e.left),null==e.height&&(e.height=e.width)}return t.stretch_x&&t.stretch_x.length&&Hx(t,"x"),t.stretch_y&&t.stretch_y.length&&Hx(t,"y"),e}(e.readFields($x,{name:void 0},t))}(i,i.readVarint()+i.pos))}function Hx(e,t){const i=[],n=e[`stretch_${t}`];let r=null;for(let e=0;e<n.length;e++)null===r?r=0===i.length?n[0]:i[i.length-1][1]+n[e]:(i.push([r,r+n[e]]),r=null);e[`stretch_${t}_areas`]=i}function $x(e,t,i){1===e?t.name=i.readString():2===e?t.metadata=function(e,t){return e.readFields(Wx,{stretch_x:null,stretch_y:null,stretch_x_areas:null,stretch_y_areas:null,variables:[]},t)}(i,i.readVarint()+i.pos):3===e&&(t.usvg_tree=function(e,t){return e.readFields(Kx,{width:20,children:[],linear_gradients:[],radial_gradients:[],clip_paths:[],masks:[]},t)}(i,i.readVarint()+i.pos),t.data="usvg_tree")}function Wx(e,t,i){1===e?t.stretch_x=i.readPackedVarint():2===e?t.stretch_y=i.readPackedVarint():3===e?t.content_area=Zx(i,i.readVarint()+i.pos):4===e?t.variables.push(function(e,t){return e.readFields(Yx,{name:void 0},t)}(i,i.readVarint()+i.pos)):5===e&&(t.text_placeholder=Zx(i,i.readVarint()+i.pos))}function Zx(e,t){return e.readFields(Xx,{},t)}function Xx(e,t,i){1===e?t.left=i.readVarint():2===e?t.width=i.readVarint():3===e?t.top=i.readVarint():4===e&&(t.height=i.readVarint())}function Yx(e,t,i){1===e?t.name=i.readString():2===e&&(t.rgb_color=ob(i.readVarint()),t.value="rgb_color")}function Kx(e,t,i){1===e?t.width=t.height=i.readVarint():2===e?t.height=i.readVarint():3===e?t.children.push(Jx(i,i.readVarint()+i.pos)):4===e?t.linear_gradients.push(function(e,t){return e.readFields(ab,{spread_method:1,stops:[],x1:0,y1:0,x2:1,y2:0},t)}(i,i.readVarint()+i.pos)):5===e?t.radial_gradients.push(function(e,t){return e.readFields(ub,{spread_method:1,stops:[],cx:.5,cy:.5,r:.5,fx:.5,fy:.5,fr:0},t)}(i,i.readVarint()+i.pos)):7===e?t.clip_paths.push(function(e,t){return e.readFields(hb,{children:[]},t)}(i,i.readVarint()+i.pos)):8===e&&t.masks.push(function(e,t){const i=e.readFields(db,{left:0,width:20,mask_type:Gx,children:[]},t);return null==i.height&&(i.height=i.width),null==i.top&&(i.top=i.left),i}(i,i.readVarint()+i.pos))}function Jx(e,t){return e.readFields(Qx,{},t)}function Qx(e,t,i){1===e?(t.group=function(e,t){return e.readFields(eb,{opacity:255,children:[]},t)}(i,i.readVarint()+i.pos),t.node="group"):2===e&&(t.path=function(e,t){return e.readFields(nb,{paint_order:1,commands:[],step:1,diffs:[],rule:Mx},t)}(i,i.readVarint()+i.pos),t.node="path")}function eb(e,t,i){1===e?t.transform=tb(i,i.readVarint()+i.pos):2===e?t.opacity=i.readVarint():5===e?t.clip_path_idx=i.readVarint():6===e?t.mask_idx=i.readVarint():7===e&&t.children.push(Jx(i,i.readVarint()+i.pos))}function tb(e,t){return e.readFields(ib,{sx:1,ky:0,kx:0,sy:1,tx:0,ty:0},t)}function ib(e,t,i){1===e?t.sx=i.readFloat():2===e?t.ky=i.readFloat():3===e?t.kx=i.readFloat():4===e?t.sy=i.readFloat():5===e?t.tx=i.readFloat():6===e&&(t.ty=i.readFloat())}function nb(e,t,i){1===e?t.fill=function(e,t){return e.readFields(rb,{rgb_color:Ax,paint:"rgb_color",opacity:255},t)}(i,i.readVarint()+i.pos):2===e?t.stroke=function(e,t){return e.readFields(sb,{rgb_color:Ax,paint:"rgb_color",dasharray:[],dashoffset:0,miterlimit:4,opacity:255,width:1,linecap:1,linejoin:1},t)}(i,i.readVarint()+i.pos):3===e?t.paint_order=i.readVarint():5===e?i.readPackedVarint(t.commands):6===e?t.step=i.readFloat():7===e?i.readPackedSVarint(t.diffs):8===e&&(t.rule=i.readVarint())}function rb(e,t,i){1===e?(t.rgb_color=ob(i.readVarint()),t.paint="rgb_color"):2===e?(t.linear_gradient_idx=i.readVarint(),t.paint="linear_gradient_idx"):3===e?(t.radial_gradient_idx=i.readVarint(),t.paint="radial_gradient_idx"):5===e&&(t.opacity=i.readVarint())}function ob(e){return new li((e>>16&255)/255,(e>>8&255)/255,(255&e)/255,1)}
2function sb(e,t,i){1===e?(t.rgb_color=ob(i.readVarint()),t.paint="rgb_color"):2===e?(t.linear_gradient_idx=i.readVarint(),t.paint="linear_gradient_idx"):3===e?(t.radial_gradient_idx=i.readVarint(),t.paint="radial_gradient_idx"):5===e?i.readPackedFloat(t.dasharray):6===e?t.dashoffset=i.readFloat():7===e?t.miterlimit=i.readFloat():8===e?t.opacity=i.readVarint():9===e?t.width=i.readFloat():10===e?t.linecap=i.readVarint():11===e&&(t.linejoin=i.readVarint())}function ab(e,t,i){1===e?t.transform=tb(i,i.readVarint()+i.pos):2===e?t.spread_method=i.readVarint():3===e?t.stops.push(lb(i,i.readVarint()+i.pos)):4===e?t.x1=i.readFloat():5===e?t.y1=i.readFloat():6===e?t.x2=i.readFloat():7===e&&(t.y2=i.readFloat())}function lb(e,t){return e.readFields(cb,{offset:0,opacity:255,rgb_color:Ax},t)}function cb(e,t,i){1===e?t.offset=i.readFloat():2===e?t.opacity=i.readVarint():3===e&&(t.rgb_color=ob(i.readVarint()))}function ub(e,t,i){1===e?t.transform=tb(i,i.readVarint()+i.pos):2===e?t.spread_method=i.readVarint():3===e?t.stops.push(lb(i,i.readVarint()+i.pos)):4===e?t.cx=i.readFloat():5===e?t.cy=i.readFloat():6===e?t.r=i.readFloat():7===e?t.fx=i.readFloat():8===e?t.fy=i.readFloat():9===e&&(t.fr=i.readFloat())}function hb(e,t,i){1===e?t.transform=tb(i,i.readVarint()+i.pos):2===e?t.clip_path_idx=i.readVarint():3===e&&t.children.push(Jx(i,i.readVarint()+i.pos))}function db(e,t,i){1===e?t.left=t.top=i.readFloat():2===e?t.width=t.height=i.readFloat():3===e?t.top=i.readFloat():4===e?t.height=i.readFloat():5===e?t.mask_type=i.readVarint():6===e?t.mask_idx=i.readVarint():7===e&&t.children.push(Jx(i,i.readVarint()+i.pos))}class fb{static calculate(e={},t=[]){const i=new Map,n=new Map;if(0===Object.keys(e).length)return i;t.forEach(e=>{n.set(e.name,e.rgb_color||new li(0,0,0))});for(const[t,r]of Object.entries(e))n.has(t)?i.set(n.get(t).toString(),r):console.warn(`Ignoring unknown image variable "${t}"`);return i}}
vendor: 22,481 bytes, line 2
2function pb(e,t=255,i){const n=t/255,r=e.toString(),o=i.has(r)?i.get(r).clone():e.clone();return o.a*=n,o.toString()}function mb(e,t){if(!mt()){const i=document.createElement("canvas");return i.width=e,i.height=t,i}return new OffscreenCanvas(e,t)}let _b,gb=null;function yb(e,t,i,n,r){for(const o of n.children)vb(e,t,i,o,r)}function vb(e,t,i,n,r){n.group?(e.save(),function(e,t,i,n,r){const o=null!=n.mask_idx?i.masks[n.mask_idx]:null,s=null!=n.clip_path_idx?i.clip_paths[n.clip_path_idx]:null;if(n.transform&&(t=Mb(n.transform).preMultiplySelf(t)),!function(e,t,i){return 255!==e.opacity||t||i}(n,null!=s,null!=o))return void yb(e,t,i,n,r);const a=mb(e.canvas.width,e.canvas.height),l=a.getContext("2d");yb(l,t,i,n,r),s&&Ib(l,t,i,s),o&&Ab(l,t,i,o,r),e.globalAlpha=n.opacity/255,e.drawImage(a,0,0)}(e,t,i,n.group,r),e.restore()):n.path&&(e.save(),function(e,t,i,n,r){e.setTransform(t),n.paint_order===kx?(xb(e,i,n,r),wb(e,i,n,r)):(wb(e,i,n,r),xb(e,i,n,r))}(e,t,i,n.path,r),e.restore())}function xb(e,t,i,n){const r=i.fill;if(!r)return;const o=r.opacity/255;switch(e.save(),e.beginPath(),Cb(i,e),r.paint){case"rgb_color":e.fillStyle=pb(r.rgb_color,r.opacity,n);break;case"linear_gradient_idx":{const i=t.linear_gradients[r.linear_gradient_idx];i.transform&&e.setTransform(Mb(i.transform).preMultiplySelf(e.getTransform())),e.fillStyle=Tb(e,i,o,n);break}case"radial_gradient_idx":{const i=t.radial_gradients[r.radial_gradient_idx];i.transform&&e.setTransform(Mb(i.transform).preMultiplySelf(e.getTransform())),e.fillStyle=Sb(e,i,o,n)}}e.fill(bb(i)),e.restore()}function bb(e){return e.rule===Mx?"nonzero":e.rule===Cx?"evenodd":void 0}function wb(e,t,i,n){const r=i.stroke;if(!r)return;const o=Pb(i);e.lineWidth=r.width,e.miterLimit=r.miterlimit,e.setLineDash(r.dasharray),e.lineDashOffset=r.dashoffset;const s=r.opacity/255;switch(r.paint){case"rgb_color":e.strokeStyle=pb(r.rgb_color,r.opacity,n);break;case"linear_gradient_idx":e.strokeStyle=Tb(e,t.linear_gradients[r.linear_gradient_idx],s,n,!0);break;case"radial_gradient_idx":e.strokeStyle=Sb(e,t.radial_gradients[r.radial_gradient_idx],s,n,!0)}switch(r.linejoin){case zx:case Lx:e.lineJoin="miter";break;case Ox:e.lineJoin="round";break;case Fx:e.lineJoin="bevel"}switch(r.linecap){case Px:e.lineCap="butt";break;case Dx:e.lineCap="round";break;case Rx:e.lineCap="square"}e.stroke(o)}function Tb(e,t,i,n,r=!1){if(1===t.stops.length){const e=t.stops[0];return pb(e.rgb_color,e.opacity*i,n)}const{x1:o,y1:s,x2:a,y2:l}=t;let c=new DOMPoint(o,s),u=new DOMPoint(a,l);if(r){const e=Mb(t.transform);c=e.transformPoint(c),u=e.transformPoint(u)}const h=e.createLinearGradient(c.x,c.y,u.x,u.y);for(const e of t.stops)h.addColorStop(e.offset,pb(e.rgb_color,e.opacity*i,n));return h}function Sb(e,t,i,n,r=!1){if(1===t.stops.length){const e=t.stops[0];return pb(e.rgb_color,e.opacity*i,n)}const o=Mb(t.transform),{fx:s,fy:a,fr:l,cx:c,cy:u,r:h}=t;let d=new DOMPoint(s,a),f=new DOMPoint(c,u),p=l,m=h;if(r){d=o.transformPoint(d),f=o.transformPoint(f);const e=(o.a+o.d)/2;p=l*e,m=t.r*e}const _=e.createRadialGradient(d.x,d.y,p,f.x,f.y,m);for(const e of t.stops)_.addColorStop(e.offset,pb(e.rgb_color,e.opacity*i,n));return _}function Eb(e,t,i,n){const r=n.transform?Mb(n.transform).preMultiplySelf(t):t,o=mb(e.canvas.width,e.canvas.height),s=o.getContext("2d");for(const e of n.children)if(e.group)Eb(s,r,i,e.group);else if(e.path){const t=e.path,i=new Path2D;i.addPath(Pb(t),r),s.fill(i,bb(t))}const a=null!=n.clip_path_idx?i.clip_paths[n.clip_path_idx]:null;a&&Ib(s,r,i,a),e.globalCompositeOperation="source-over",e.drawImage(o,0,0)}function Ib(e,t,i,n){const r=mb(e.canvas.width,e.canvas.height);Eb(r.getContext("2d"),t,i,n),e.globalCompositeOperation="destination-in",e.drawImage(r,0,0)}function Ab(e,t,i,n,r){if(0===n.children.length)return;const o=null!=n.mask_idx?i.masks[n.mask_idx]:null;o&&Ab(e,t,i,o,r);const s=e.canvas.width,a=e.canvas.height,l=mb(s,a),c=l.getContext("2d"),u=n.width,h=n.height,d=n.left,f=n.top,p=new Path2D,m=new Path2D;m.rect(d,f,u,h),p.addPath(m,t),c.clip(p);for(const e of n.children)vb(c,t,i,e,r);const _=c.getImageData(0,0,s,a),g=_.data;if(n.mask_type===Gx)for(let e=0;e<g.length;e+=4)g[e+3]=g[e+3]/255*(.2126*g[e]+.7152*g[e+1]+.0722*g[e+2]);c.putImageData(_,0,0),e.globalCompositeOperation="destination-in",e.drawImage(l,0,0)}function Mb(e){return e?new DOMMatrix([e.sx,e.ky,e.kx,e.sy,e.tx,e.ty]):new DOMMatrix}function Cb(e,t){const i=e.step;let n=e.diffs[0]*i,r=e.diffs[1]*i;t.moveTo(n,r);for(let o=0,s=2;o<e.commands.length;o++)switch(e.commands[o]){case Bx:n+=e.diffs[s++]*i,r+=e.diffs[s++]*i,t.moveTo(n,r);break;case Nx:n+=e.diffs[s++]*i,r+=e.diffs[s++]*i,t.lineTo(n,r);break;case Vx:{const o=n+e.diffs[s++]*i,a=r+e.diffs[s++]*i;n=o+e.diffs[s++]*i,r=a+e.diffs[s++]*i,t.quadraticCurveTo(o,a,n,r);break}case Ux:{const o=n+e.diffs[s++]*i,a=r+e.diffs[s++]*i,l=o+e.diffs[s++]*i,c=a+e.diffs[s++]*i;n=l+e.diffs[s++]*i,r=c+e.diffs[s++]*i,t.bezierCurveTo(o,a,l,c,n,r);break}case jx:t.closePath()}return t}function Pb(e){return Cb(e,new Path2D)}class Db{constructor(e){this.capacity=e,this.cache=new Map}get(e){if(!this.cache.has(e))return;const t=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,t),t}put(e,t){this.cache.has(e)?this.cache.delete(e):this.cache.size===this.capacity&&this.cache.delete(this.cache.keys().next().value),this.cache.set(e,t)}delete(e){this.cache.delete(e)}}Jo(Db,"LRUCache");class Rb{constructor(){this.cacheMap=new Map,this.cacheDependenciesMap=new Map}static _getImage(e){return new hd(e,e.data)}getFromCache(e,t,i){return this.cacheMap.has(i)||this.cacheMap.set(i,new Db(150)),this.cacheMap.get(i).get(Wa(e.toString(),t))}setInCache(e,t,i,n){this.cacheDependenciesMap.has(n)||this.cacheDependenciesMap.set(n,new Map),this.cacheMap.has(n)||this.cacheMap.set(n,new Db(150));const r=this.cacheDependenciesMap.get(n),o=Wa(e.id.toString(),i);r.get(o)||r.set(o,new Set);const s=this.cacheMap.get(n),a=e.toString();r.get(o).add(a),s.put(Wa(e.toString(),i),t)}removeImagesFromCacheByIds(e,t,i=0){if(!this.cacheMap.has(i)||!this.cacheDependenciesMap.has(i))return;const n=this.cacheMap.get(i),r=this.cacheDependenciesMap.get(i);for(const i of e){const e=Wa(i.toString(),t);if(r.has(e)){for(const t of r.get(e))n.delete(t);r.delete(e)}}}rasterize(e,t,i,n){const r=this.getFromCache(e,i,n);if(r)return r.clone();const o=function(e,t){const i=fb.calculate(t.params,e.metadata?e.metadata.variables:[]),n=e.usvg_tree,r=n.width,o=n.height,s=Math.max(1,Math.round(r*t.sx)),a=Math.max(1,Math.round(o*t.sy)),l=new DOMMatrix([s/r,0,0,a/o,0,0]);return null===gb&&(gb=mb(10,10),_b=gb.getContext("2d",{willReadFrequently:!0})),gb.width=s,gb.height=a,yb(_b,l,n,n,i),_b.getImageData(0,0,s,a)}(t.icon,e),s=Rb._getImage(o);return this.setInCache(e,s,i,n),s.clone()}}class Lb{constructor(e){this.size=e,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(e,t){const i=this.toIdx(e,t);return{min:this.minimums[i],max:this.maximums[i]}}isLeaf(e,t){return this.leaves[this.toIdx(e,t)]}toIdx(e,t){return t*this.size+e}}function zb(e,t,i,n){let r=0,o=Number.MAX_VALUE;for(let s=0;s<3;s++)if(Math.abs(n[s])<1e-15){if(i[s]<e[s]||i[s]>t[s])return null}else{const a=1/n[s];let l=(e[s]-i[s])*a,c=(t[s]-i[s])*a;if(l>c){const e=l;l=c,c=e}if(l>r&&(r=l),c<o&&(o=c),r>o)return null}return r}function Ob(e,t,i,n,r,o,s,a,l,c,u){const h=n-e,d=r-t,f=o-i,p=s-e,m=a-t,_=l-i,g=u[1]*_-u[2]*m,y=u[2]*p-u[0]*_,v=u[0]*m-u[1]*p,x=h*g+d*y+f*v;if(Math.abs(x)<1e-15)return null;const b=1/x,w=c[0]-e,T=c[1]-t,S=c[2]-i,E=(w*g+T*y+S*v)*b;if(E<0||E>1)return null;const I=T*f-S*d,A=S*h-w*f,M=w*d-T*h,C=(u[0]*I+u[1]*A+u[2]*M)*b;return C<0||E+C>1?null:(p*I+m*A+_*M)*b}function Fb(e,t,i){return(e-t)/(i-t)}function kb(e,t,i,n,r,o,s,a,l){const c=1<<i,u=o-n,h=s-r,d=(e+1)/c*u+n,f=(t+0)/c*h+r,p=(t+1)/c*h+r;a[0]=(e+0)/c*u+n,a[1]=f,l[0]=d,l[1]=p}class Bb{constructor(e){if(this.maximums=[],this.minimums=[],this.leaves=[],this.childOffsets=[],this.nodeCount=0,this.dem=e,this._siblingOffset=[[0,0],[1,0],[0,1],[1,1]],!this.dem)return;const t=function(e){const t=Math.ceil(Math.log2(e.dim/8)),i=[];let n=Math.ceil(Math.pow(2,t));const r=1/n,o=(e,t,i,n,r)=>{const o=n?1:0,s=(e+1)*i-o,a=t*i,l=(t+1)*i-o;r[0]=e*i,r[1]=a,r[2]=s,r[3]=l};let s=new Lb(n);const a=[];for(let t=0;t<n*n;t++){o(t%n,Math.floor(t/n),r,!1,a);const i=Vb(a[0],a[1],e),l=Vb(a[2],a[1],e),c=Vb(a[2],a[3],e),u=Vb(a[0],a[3],e);s.minimums.push(Math.min(i,l,c,u)),s.maximums.push(Math.max(i,l,c,u)),s.leaves.push(1)}for(i.push(s),n/=2;n>=1;n/=2){const e=i[i.length-1];s=new Lb(n);for(let t=0;t<n*n;t++){o(t%n,Math.floor(t/n),2,!0,a);const i=e.getElevation(a[0],a[1]),r=e.getElevation(a[2],a[1]),l=e.getElevation(a[2],a[3]),c=e.getElevation(a[0],a[3]),u=e.isLeaf(a[0],a[1]),h=e.isLeaf(a[2],a[1]),d=e.isLeaf(a[2],a[3]),f=e.isLeaf(a[0],a[3]),p=Math.min(i.min,r.min,l.min,c.min),m=Math.max(i.max,r.max,l.max,c.max),_=u&&h&&d&&f;s.maximums.push(m),s.minimums.push(p),s.leaves.push(m-p<=5&&_?1:0)}i.push(s)}return i}(this.dem),i=t.length-1,n=t[i];this._addNode(n.minimums[0],n.maximums[0],n.leaves[0]),this._construct(t,0,0,i,0)}raycastRoot(e,t,i,n,r,o,s=1){return zb([e,t,-100],[i,n,this.maximums[0]*s],r,o)}raycast(e,t,i,n,r,o,s=1){if(!this.nodeCount)return null;const a=this.raycastRoot(e,t,i,n,r,o,s);if(null==a)return null;const l=[],c=[],u=[],h=[],d=[{idx:0,t:a,nodex:0,nodey:0,depth:0}];for(;d.length>0;){const{idx:a,t:f,nodex:p,nodey:m,depth:_}=d.pop();if(this.leaves[a]){kb(p,m,_,e,t,i,n,u,h);const a=1<<_,l=(p+0)/a,c=(p+1)/a,d=(m+0)/a,g=(m+1)/a,y=Vb(l,d,this.dem)*s,v=Vb(c,d,this.dem)*s,x=Vb(c,g,this.dem)*s,b=Vb(l,g,this.dem)*s,w=Ob(u[0],u[1],y,h[0],u[1],v,h[0],h[1],x,r,o),T=Ob(h[0],h[1],x,u[0],h[1],b,u[0],u[1],y,r,o),S=Math.min(null!==w?w:Number.MAX_VALUE,null!==T?T:Number.MAX_VALUE);if(S!==Number.MAX_VALUE)return S;{const e=L([],r,o,f);if(Nb(y,v,b,x,Fb(e[0],u[0],h[0]),Fb(e[1],u[1],h[1]))>=e[2])return f}continue}let g=0;for(let d=0;d<this._siblingOffset.length;d++){kb((p<<1)+this._siblingOffset[d][0],(m<<1)+this._siblingOffset[d][1],_+1,e,t,i,n,u,h),u[2]=-100,h[2]=this.maximums[this.childOffsets[a]+d]*s;const f=zb(u,h,r,o);if(null!=f){const e=f;l[d]=e;let t=!1;for(let i=0;i<g&&!t;i++)e>=l[c[i]]&&(c.splice(i,0,d),t=!0);t||(c[g]=d),g++}}for(let e=0;e<g;e++){const t=c[e];d.push({idx:this.childOffsets[a]+t,t:l[t],nodex:(p<<1)+this._siblingOffset[t][0],nodey:(m<<1)+this._siblingOffset[t][1],depth:_+1})}}return null}_addNode(e,t,i){return this.minimums.push(e),this.maximums.push(t),this.leaves.push(i),this.childOffsets.push(0),this.nodeCount++}_construct(e,t,i,n,r){if(1===e[n].isLeaf(t,i))return;this.childOffsets[r]||(this.childOffsets[r]=this.nodeCount);const o=n-1,s=e[o];let a=0,l=0;for(let e=0;e<this._siblingOffset.length;e++){const n=2*t+this._siblingOffset[e][0],r=2*i+this._siblingOffset[e][1],o=s.getElevation(n,r),c=s.isLeaf(n,r),u=this._addNode(o.min,o.max,c);c&&(a|=1<<e),l||(l=u)}for(let n=0;n<this._siblingOffset.length;n++)a&1<<n||this._construct(e,2*t+this._siblingOffset[n][0],2*i+this._siblingOffset[n][1],o,l+n)}}function Nb(e,t,i,n,r,o){return di(di(e,i,o),di(t,n,o),r)}function Vb(e,t,i){const n=i.dim,r=ze(e*n-.5,0,n-1),o=ze(t*n-.5,0,n-1),s=Math.floor(r),a=Math.floor(o),l=Math.min(s+1,n-1),c=Math.min(a+1,n-1);return Nb(i.get(s,a),i.get(l,a),i.get(s,c),i.get(l,c),r-s,o-a)}const Ub={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};function jb(e,t,i){return(256*e*256+256*t+i)/10-1e4}function Gb(e,t,i){return 256*e+t+i/256-32768}class qb{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(e,t,i,n=!1){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(i&&"mapbox"!==i&&"terrarium"!==i)return void We(`"${i}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=t.height;const r=this.dim=t.height-2,o=new Uint32Array(t.data.buffer);if(this.pixels=new Uint8Array(t.data.buffer),this.floatView=new Float32Array(t.data.buffer),this.borderReady=n,this._modifiedForSources={},!n){for(let e=0;e<r;e++)o[this._idx(-1,e)]=o[this._idx(0,e)],o[this._idx(r,e)]=o[this._idx(r-1,e)],o[this._idx(e,-1)]=o[this._idx(e,0)],o[this._idx(e,r)]=o[this._idx(e,r-1)];o[this._idx(-1,-1)]=o[this._idx(0,0)],o[this._idx(r,-1)]=o[this._idx(r-1,0)],o[this._idx(-1,r)]=o[this._idx(0,r-1)],o[this._idx(r,r)]=o[this._idx(r-1,r-1)]}const s="terrarium"===i?Gb:jb;for(let e=0;e<o.length;++e){const t=4*e;this.floatView[e]=s(this.pixels[t],this.pixels[t+1],this.pixels[t+2])}this._timestamp=_t.now()}_buildQuadTree(){this._tree=new Bb(this)}get(e,t,i=!1){i&&(e=ze(e,-1,this.dim),t=ze(t,-1,this.dim));const n=this._idx(e,t);return this.floatView[n]}set(e,t,i){const n=this._idx(e,t),r=this.floatView[n];return this.floatView[n]=i,i-r}static getUnpackVector(e){return Ub[e]}_idx(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)}static pack(e,t){const i=[0,0,0,0],n=qb.getUnpackVector(t);let r=Math.floor((e+n[3])/n[2]);return i[2]=r%256,r=Math.floor(r/256),i[1]=r%256,r=Math.floor(r/256),i[0]=r,i}getPixels(){return new dd({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,t,i){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let n=t*this.dim,r=t*this.dim+this.dim,o=i*this.dim,s=i*this.dim+this.dim;switch(t){case-1:n=r-1;break;case 1:r=n+1}switch(i){case-1:o=s-1;break;case 1:s=o+1}const a=-t*this.dim,l=-i*this.dim;for(let t=o;t<s;t++)for(let i=n;i<r;i++){const n=4*this._idx(i,t),r=4*this._idx(i+a,t+l);this.pixels[n+0]=e.pixels[r+0],this.pixels[n+1]=e.pixels[r+1],this.pixels[n+2]=e.pixels[r+2],this.pixels[n+3]=e.pixels[r+3]}}onDeserialize(){this._tree&&(this._tree.dem=this)}}function Hb(e,t,i){1===e?t.headerLength=i.readFixed32():2===e?t.x=i.readVarint():3===e?t.y=i.readVarint():4===e?t.z=i.readVarint():5===e&&t.layers.push(function(e,t){return e.readFields(Yb,{version:0,name:"",units:"",tileSize:0,buffer:0,pixelFormat:0,dataIndex:[]},t)}(i,i.readVarint()+i.pos))}function $b(e,t,i){1===e?(t.delta_filter=function(e,t){return e.readFields(Wb,{blockSize:0},t)}(i,i.readVarint()+i.pos),t.filter="delta_filter"):2===e?(i.readVarint(),t.filter="zigzag_filter"):3===e?(i.readVarint(),t.filter="bitshuffle_filter"):4===e&&(i.readVarint(),t.filter="byteshuffle_filter")}function Wb(e,t,i){1===e&&(t.blockSize=i.readVarint())}function Zb(e,t,i){1===e?(i.readVarint(),t.codec="gzip_data"):2===e?(i.readVarint(),t.codec="jpeg_image"):3===e?(i.readVarint(),t.codec="webp_image"):4===e&&(i.readVarint(),t.codec="png_image")}function Xb(e,t,i){let n=0,r=0;1===e?t.firstByte=i.readFixed64():2===e?t.lastByte=i.readFixed64():3===e?t.filters.push(function(e,t){return e.readFields($b,{},t)}(i,i.readVarint()+i.pos)):4===e?t.codec=function(e,t){return e.readFields(Zb,{},t)}(i,i.readVarint()+i.pos):5===e?r=i.readFloat():6===e?n=i.readFloat():7===e?t.bands.push(i.readString()):8===e?t.offset=i.readDouble():9===e&&(t.scale=i.readDouble()),0===t.offset&&(t.offset=r),0===t.scale&&(t.scale=n)}function Yb(e,t,i){1===e?t.version=i.readVarint():2===e?t.name=i.readString():3===e?t.units=i.readString():4===e?t.tileSize=i.readVarint():5===e?t.buffer=i.readVarint():6===e?t.pixelFormat=i.readVarint():7===e&&t.dataIndex.push(function(e,t){return e.readFields(Xb,{firstByte:0,lastByte:0,filters:[],codec:null,offset:0,scale:0,bands:[]},t)}(i,i.readVarint()+i.pos))}function Kb(e,t,i){if(2===e)!function(e,t,i){e.readFields(Jb,i,t)}(i,i.readVarint()+i.pos,t);else if(3===e)throw new Error("Not implemented")}function Jb(e,t,i){if(1===e){let e=0;const n=i.readVarint()+i.pos;for(;i.pos<n;)t[e++]=i.readVarint()}}function Qb(e,t){if(4!==t.length)throw new Error(`Expected data of dimension 4 but got ${t.length}.`);let i=t[3];for(let n=2;n>=1;n--){const r=1===n?1:0,o=2===n?1:0;for(let n=0;n<t[0];n++){const s=t[1]*n;for(let n=r;n<t[1];n++){const r=t[2]*(n+s);for(let n=o;n<t[2];n++){const o=t[3]*(n+r);for(let n=0;n<t[3];n++){const t=o+n;e[t]+=e[t-i]}}}}i*=t[n]}return e}function ew(e){for(let t=0,i=e.length;t<i;t++)e[t]=e[t]>>>1^-(1&e[t]);return e}function tw(e,t){switch(t){case"uint32":return e;case"uint16":for(let t=0;t<e.length;t+=2){const i=e[t],n=e[t+1];e[t]=(240&i)>>4|(61440&i)>>8|(240&n)<<4|61440&n,e[t+1]=15&i|(3840&i)>>4|(15&n)<<8|(3840&n)<<4}return e;case"uint8":for(let t=0;t<e.length;t+=4){const i=e[t],n=e[t+1],r=e[t+2],o=e[t+3];e[t+0]=(192&i)>>6|(192&n)>>4|(192&r)>>2|192&o,e[t+1]=(48&i)>>4|(48&n)>>2|48&r|(48&o)<<2,e[t+2]=(12&i)>>2|12&n|(12&r)<<2|(12&o)<<4,e[t+3]=3&i|(3&n)<<2|(3&r)<<4|(3&o)<<6}return e;default:throw new Error(`Invalid pixel format, "${t}"`)}}Jo(qb,"DEMData"),Jo(Bb,"DemMinMaxQuadTree",{omit:["dem"]});var iw=Uint8Array,nw=Uint16Array,rw=Int32Array,ow=new iw([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),sw=new iw([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),aw=new iw([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),lw=function(e,t){for(var i=new nw(31),n=0;n<31;++n)i[n]=t+=1<<e[n-1];var r=new rw(i[30]);for(n=1;n<30;++n)for(var o=i[n];o<i[n+1];++o)r[o]=o-i[n]<<5|n;return{b:i,r:r}},cw=lw(ow,2),uw=cw.b,hw=cw.r;uw[28]=258,hw[258]=28;for(var dw=lw(sw,0).b,fw=new nw(32768),pw=0;pw<32768;++pw){var mw=(43690&pw)>>1|(21845&pw)<<1;fw[pw]=((65280&(mw=(61680&(mw=(52428&mw)>>2|(13107&mw)<<2))>>4|(3855&mw)<<4))>>8|(255&mw)<<8)>>1}var _w=function(e,t,i){for(var n=e.length,r=0,o=new nw(t);r<n;++r)e[r]&&++o[e[r]-1];var s,a=new nw(t);for(r=1;r<t;++r)a[r]=a[r-1]+o[r-1]<<1;s=new nw(1<<t);var l=15-t;for(r=0;r<n;++r)if(e[r])for(var c=r<<4|e[r],u=t-e[r],h=a[e[r]-1]++<<u,d=h|(1<<u)-1;h<=d;++h)s[fw[h]>>l]=c;return s},gw=new iw(288);for(pw=0;pw<144;++pw)gw[pw]=8;for(pw=144;pw<256;++pw)gw[pw]=9;for(pw=256;pw<280;++pw)gw[pw]=7;for(pw=280;pw<288;++pw)gw[pw]=8;var yw=new iw(32);for(pw=0;pw<32;++pw)yw[pw]=5;var vw=_w(gw,9),xw=_w(yw,5),bw=function(e){for(var t=e[0],i=1;i<e.length;++i)e[i]>t&&(t=e[i]);return t},ww=function(e,t,i){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(7&t)&i},Tw=function(e,t){var i=t/8|0;return(e[i]|e[i+1]<<8|e[i+2]<<16)>>(7&t)},Sw=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ew=function(e,t,i){var n=new Error(t||Sw[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,Ew),!i)throw n;return n},Iw=new iw(0),Aw="undefined"!=typeof TextDecoder&&new TextDecoder;try{Aw.decode(Iw,{stream:!0})}catch(e){}const Mw={gzip_data:"gzip"};class Cw extends Error{constructor(e){super(e),this.name="MRTError"}}const Pw={0:"uint32",1:"uint32",2:"uint16",3:"uint8"},Dw={uint32:1,uint16:2,uint8:4},Rw={uint32:Uint32Array,uint16:Uint16Array,uint8:Uint8Array};let Lw;class zw{constructor(e=5){this.x=NaN,this.y=NaN,this.z=NaN,this.layers={},this._cacheSize=e}getLayer(e){const t=this.layers[e];if(!t)throw new Cw(`Layer '${e}' not found`);return t}getHeaderLength(e){const t=new Uint8Array(e),i=new DataView(e);if(13!==t[0])throw new Cw("File is not a valid MRT.");return i.getUint32(1,!0)}parseHeader(e){const t=new Uint8Array(e),i=this.getHeaderLength(e);if(t.length<i)throw new Cw(`Expected header with length >= ${i} but got buffer of length ${t.length}`);const n=new Lw(t.subarray(0,i)).readFields(Hb,{headerLength:0,x:0,y:0,z:0,layers:[]},void 0);if(!isNaN(this.x)&&(this.x!==n.x||this.y!==n.y||this.z!==n.z))throw new Cw(`Invalid attempt to parse header ${n.z}/${n.x}/${n.y} for tile ${this.z}/${this.x}/${this.y}`);this.x=n.x,this.y=n.y,this.z=n.z;for(const e of n.layers)this.layers[e.name]=new Ow(e,{cacheSize:this._cacheSize});return this}createDecodingTask(e){const t=[],i=this.getLayer(e.layerName);for(let n of e.blockIndices){const r=i.dataIndex[n],o=r.firstByte-e.firstByte,s=r.lastByte-e.firstByte;if(i._blocksInProgress.has(n))continue;const a={layerName:i.name,firstByte:o,lastByte:s,pixelFormat:i.pixelFormat,blockIndex:n,blockShape:[r.bands.length].concat(i.bandShape),buffer:i.buffer,codec:r.codec.codec,filters:r.filters.map(e=>e.filter)};i._blocksInProgress.add(n),t.push(a)}return new Fw(t,()=>{t.forEach(e=>i._blocksInProgress.delete(e.blockIndex))},(e,n)=>{if(t.forEach(e=>i._blocksInProgress.delete(e.blockIndex)),e)throw e;n.forEach(e=>{this.getLayer(e.layerName).processDecodedData(e)})})}}class Ow{constructor({version:e,name:t,units:i,tileSize:n,pixelFormat:r,buffer:o,dataIndex:s},a){if(this.version=e,1!==this.version)throw new Cw(`Cannot parse raster layer encoded with MRT version ${e}`);this.name=t,this.units=i,this.tileSize=n,this.buffer=o,this.pixelFormat=Pw[r],this.dataIndex=s,this.bandShape=[n+2*o,n+2*o,Dw[this.pixelFormat]],this._decodedBlocks=new Db(a?a.cacheSize:5),this._blocksInProgress=new Set}get dimension(){return Dw[this.pixelFormat]}get cacheSize(){return this._decodedBlocks.capacity}getBandList(){return this.dataIndex.map(({bands:e})=>e).flat()}processDecodedData(e){const t=e.blockIndex.toString();this._decodedBlocks.get(t)||this._decodedBlocks.put(t,e.data)}getBlockForBand(e){let t=0;switch(typeof e){case"string":for(const[i,n]of this.dataIndex.entries()){for(const[r,o]of n.bands.entries())if(o===e)return{bandIndex:t+r,blockIndex:i,blockBandIndex:r};t+=n.bands.length}break;case"number":for(const[i,n]of this.dataIndex.entries()){if(e>=t&&e<t+n.bands.length)return{bandIndex:e,blockIndex:i,blockBandIndex:e-t};t+=n.bands.length}break;default:throw new Cw(`Invalid band \`${JSON.stringify(e)}\`. Expected string or integer.`)}return{blockIndex:-1,blockBandIndex:-1}}getDataRange(e){let t=1/0,i=-1/0;const n=[],r=new Set;for(const o of e){const{blockIndex:e}=this.getBlockForBand(o);if(e<0)throw new Cw(`Invalid band: ${JSON.stringify(o)}`);const s=this.dataIndex[e];n.includes(e)||n.push(e),r.add(e),t=Math.min(t,s.firstByte),i=Math.max(i,s.lastByte)}if(r.size>this.cacheSize)throw new Cw(`Number of blocks to decode (${r.size}) exceeds cache size (${this.cacheSize}).`);return{layerName:this.name,firstByte:t,lastByte:i,blockIndices:n}}hasBand(e){const{blockIndex:t}=this.getBlockForBand(e);return t>=0}hasDataForBand(e){const{blockIndex:t}=this.getBlockForBand(e);return t>=0&&!!this._decodedBlocks.get(t.toString())}getBandView(e){const{blockIndex:t,blockBandIndex:i}=this.getBlockForBand(e);if(t<0)throw new Cw(`Band not found: ${JSON.stringify(e)}`);const n=this._decodedBlocks.get(t.toString());if(!n)throw new Cw(`Data for band ${JSON.stringify(e)} of layer "${this.name}" not decoded.`);const r=this.dataIndex[t],o=this.bandShape.reduce((e,t)=>
vendor: 4,466 bytes, line 2
2e*t,1),s=i*o,a=n.subarray(s,s+o);return{data:a,bytes:new Uint8Array(a.buffer).subarray(a.byteOffset,a.byteOffset+a.byteLength),tileSize:this.tileSize,buffer:this.buffer,pixelFormat:this.pixelFormat,dimension:this.dimension,offset:r.offset,scale:r.scale}}}zw.setPbf=function(e){Lw=e};class Fw{constructor(e,t,i){this.tasks=e,this._onCancel=t,this._onComplete=i,this._finalized=!1}cancel(){this._finalized||(this._onCancel(),this._finalized=!0)}complete(e,t){this._finalized||(this._onComplete(e,t),this._finalized=!0)}}zw.performDecoding=function(e,t){const i=new Uint8Array(e);return Promise.all(t.tasks.map(e=>{const{layerName:t,firstByte:n,lastByte:r,pixelFormat:o,blockShape:s,blockIndex:a,filters:l,codec:c}=e,u=i.subarray(n,r+1),h=new Uint32Array(s[0]*s[1]*s[2]);let d;if("gzip_data"!==c)throw new Cw(`Unhandled codec: ${c}`);return d=function(e,t){if(!globalThis.DecompressionStream&&"gzip_data"===t)return Promise.resolve(((o=function(e){31==e[0]&&139==e[1]&&8==e[2]||Ew(6,"invalid gzip data");var t=e[3],i=10;4&t&&(i+=2+(e[10]|e[11]<<8));for(var n=(t>>3&1)+(t>>4&1);n>0;n-=!e[i++]);return i+(2&t)}(r=e))+8>r.length&&Ew(6,"invalid gzip data"),function(e,t,i){var n=e.length;if(!n||t.f&&!t.l)return i||new iw(0);var r=!i,o=r||2!=t.i,s=t.i;r&&(i=new iw(3*n));var a,l,c=function(e){var t=i.length;if(e>t){var n=new iw(Math.max(2*t,e));n.set(i),i=n}},u=t.f||0,h=t.p||0,d=t.b||0,f=t.l,p=t.d,m=t.m,_=t.n,g=8*n;do{if(!f){u=ww(e,h,1);var y=ww(e,h+1,3);if(h+=3,!y){var v=e[(P=4+((h+7)/8|0))-4]|e[P-3]<<8,x=P+v;if(x>n){s&&Ew(0);break}o&&c(d+v),i.set(e.subarray(P,x),d),t.b=d+=v,t.p=h=8*x,t.f=u;continue}if(1==y)f=vw,p=xw,m=9,_=5;else if(2==y){var b=ww(e,h,31)+257,w=ww(e,h+10,15)+4,T=b+ww(e,h+5,31)+1;h+=14;for(var S=new iw(T),E=new iw(19),I=0;I<w;++I)E[aw[I]]=ww(e,h+3*I,7);h+=3*w;var A=bw(E),M=(1<<A)-1,C=_w(E,A);for(I=0;I<T;){var P,D=C[ww(e,h,M)];if(h+=15&D,(P=D>>4)<16)S[I++]=P;else{var R=0,L=0;for(16==P?(L=3+ww(e,h,3),h+=2,R=S[I-1]):17==P?(L=3+ww(e,h,7),h+=3):18==P&&(L=11+ww(e,h,127),h+=7);L--;)S[I++]=R}}var z=S.subarray(0,b),O=S.subarray(b);m=bw(z),_=bw(O),f=_w(z,m),p=_w(O,_)}else Ew(1);if(h>g){s&&Ew(0);break}}o&&c(d+131072);for(var F=(1<<m)-1,k=(1<<_)-1,B=h;;B=h){var N=(R=f[Tw(e,h)&F])>>4;if((h+=15&R)>g){s&&Ew(0);break}if(R||Ew(2),N<256)i[d++]=N;else{if(256==N){B=h,f=null;break}var V=N-254;N>264&&(V=ww(e,h,(1<<(G=ow[I=N-257]))-1)+uw[I],h+=G);var U=p[Tw(e,h)&k],j=U>>4;if(U||Ew(3),h+=15&U,O=dw[j],j>3){var G=sw[j];O+=Tw(e,h)&(1<<G)-1,h+=G}if(h>g){s&&Ew(0);break}o&&c(d+131072);var q=d+V;if(d<O){var H=0-O,$=Math.min(O,q);for(H+d<0&&Ew(3);d<$;++d)i[d]=(void 0)[H+d]}for(;d<q;++d)i[d]=i[d-O]}}t.l=f,t.p=B,t.b=d,t.f=u,f&&(u=1,t.m=m,t.d=p,t.n=_)}while(!u);return d!=i.length&&r?(a=i,(null==(l=d)||l>a.length)&&(l=a.length),new iw(a.subarray(0,l))):i.subarray(0,d)}(r.subarray(o,-8),{i:2},new iw(((i=r)[(n=i.length)-4]|i[n-3]<<8|i[n-2]<<16|i[n-1]<<24)>>>0))));var i,n,r,o;const s=Mw[t];if(!s)throw new Error(`Unhandled codec: ${t}`);const a=new globalThis.DecompressionStream(s);return new Response(new Blob([e]).stream().pipeThrough(a)).arrayBuffer().then(e=>new Uint8Array(e))}(u,c).then(e=>(function(e,t){e.readFields(Kb,t)}(new Lw(e),h),new(0,Rw[o])(h.buffer))),d.then(e=>{for(let t=l.length-1;t>=0;t--)switch(l[t]){case"delta_filter":Qb(e,s);break;case"zigzag_filter":ew(e);break;case"bitshuffle_filter":tw(e,o);break;default:throw new Cw(`Unhandled filter "${l[t]}"`)}return{layerName:t,blockIndex:a,data:e}}).catch(e=>{throw e})}))},Jo(Fw,"MRTDecodingBatch",{omit:["_onCancel","_onComplete"]}),Jo(zw,"MapboxRasterTile"),Jo(Ow,"MapboxRasterLayer",{omit:["_blocksInProgress"]});class kw{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t<e.length;t++){const i=e[t];this._stringToNumber[i]=t,this._numberToString[t]=i}}encode(e){return this._stringToNumber[e]}decode(e){return this._numberToString[e]}}class Bw{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Yo(Vn,16,0),this.featureIndexArray=new Kl,this.promoteId=t,this.is3DTile=!1,this.serializedLayersCache=new Map}insert(e,t,i,n,r,o=0,s=0){const a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,n,r,o);const l=this.grid;for(let e=0;e<t.length;e++){const i=t[e],n=[1/0,1/0,-1/0,-1/0];for(let e=0;e<i.length;e++){const t=i[e];n[0]=Math.min(n[0],t.x),n[1]=Math.min(n[1],t.y),n[2]=Math.max(n[2],t.x),n[3]=Math.max(n[3],t.y)}0!==s&&(n[0]-=s,n[1]-=s,n[2]+=s,n[3]+=s),n[0]<Vn&&n[1]<Vn&&n[2]>=0&&n[3]>
vendor: 4,171 bytes, line 2
2=0&&l.insert(a,n[0],n[1],n[2],n[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new Tu(new hg(this.rawTileData)).layers,this.sourceLayerCoder=new kw(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const e in this.vtLayers)this.vtFeatures[e]=[]}return this.vtLayers}query(e,t){const{tilespaceGeometry:i,transform:n,tileTransform:r,pixelPosMatrix:o,availableImages:s,worldview:a}=t;this.loadVTLayers(),this.serializedLayersCache.clear();const l=t.queryRadius?t.queryRadius:0,c=i.bufferedTilespaceBounds,u=this.grid.query(c.min.x,c.min.y,c.max.x,c.max.y,(e,t,n,r)=>rh(i.bufferedTilespaceGeometry,e-l,t-l,n+l,r+l));u.sort(Vw);let h=null;n.elevation&&u.length>0&&(h=ux.create(n.elevation,this.tileID));const d={};let f;for(let t=0;t<u.length;t++){const l=u[t];if(l===f)continue;f=l;const c=this.featureIndexArray.get(l);let p=null;this.is3DTile?this.loadMatchingModelFeature(d,c,e,i,n,a):this.loadMatchingFeature(d,c,e,s,a,(e,t,s,a=0)=>(p||(p=_u(e,this.tileID.canonical,r)),t.queryIntersectsFeature(i,e,s,p,this.z,n,o,h,a)))}return d}loadMatchingFeature(e,t,i,n,r,o){const{featureIndex:s,bucketIndex:a,sourceLayerIndex:l,layoutVertexArrayOffset:c}=t,u=this.bucketLayerIDs[a],h=i.layers,d=Object.keys(h);if(d.length&&!He(d,u))return;const f=i.sourceCache,p=this.sourceLayerCoder.decode(l),m=this.vtLayers[p].feature(s),_=this.getId(m,p);for(let t=0;t<u.length;t++){const i=u[t];if(!h[i])continue;const{styleLayer:a,targets:l}=h[i];let d={};void 0!==_&&(d=f.getFeatureState(a.sourceLayer,_));const p=!o||o(m,a,d,c);if(!p)continue;const g=new wx(m,this.z,this.x,this.y,_);g.tile=this.tileID.canonical,g.state=d;let y=this.serializedLayersCache.get(i);y||(y=a.serialize(),y.id=i,this.serializedLayersCache.set(i,y)),g.source=y.source,g.sourceLayer=y["source-layer"],g.layer=Object.assign({},y),g.layer.paint=Nw(y.paint,a.paint,m,d,n),g.layer.layout=Nw(y.layout,a.layout,m,d,n);let v=!1;for(const e of l){this.updateFeatureProperties(g,e);const{filter:t}=e;if(t)if(m.properties=g.properties,t.needGeometry){const e=gu(m,!0);if(!t.filter(new ga(this.tileID.overscaledZ,{worldview:r}),e,this.tileID.canonical))continue}else if(!t.filter(new ga(this.tileID.overscaledZ,{worldview:r}),m))continue;v=!0,e.targetId&&this.addFeatureVariant(g,e)}v&&this.appendToResult(e,i,s,g,p)}}loadMatchingModelFeature(e,t,i,n,r,o){const{featureIndex:s,bucketIndex:a}=t,l=this.bucketLayerIDs[a],c=i.layers,u=Object.keys(c);if(!u.length||He(u,l))for(let t=0;t<l.length;t++){const a=l[t],{styleLayer:u,targets:h}=c[a];if("model"!==u.type)continue;const d=n.tile,f=d.getBucket(u);if(!(f&&f instanceof gx))continue;const p=Ex(f,s,n,r);if(!p)continue;const{z:m,x:_,y:g}=d.tileID.canonical,{feature:y,intersectionZ:v,position:x}=p;let b={};void 0!==y.id&&(b=i.sourceCache.getFeatureState(u.sourceLayer,y.id));const w=new wx({},m,_,g,y.id);w.tile=this.tileID.canonical,w.state=b,w.properties=y.properties,w.geometry={type:"Point",coordinates:[x.lng,x.lat]};let T=this.serializedLayersCache.get(a);T||(T=u.serialize(),T.id=a,this.serializedLayersCache.set(a,T)),w.source=T.source,w.sourceLayer=T["source-layer"],w.layer=Object.assign({},T);let S=!1;for(const e of h){this.updateFeatureProperties(w,e);const{filter:t}=e;if(t)if(y.properties=w.properties,t.needGeometry){if(!t.filter(new ga(this.tileID.overscaledZ,{worldview:o}),y,this.tileID.canonical))continue}else if(!t.filter(new ga(this.tileID.overscaledZ,{worldview:o}),y))continue;S=!0,e.targetId&&this.addFeatureVariant(w,e)}S&&this.appendToResult(e,a,s,w,v)}}updateFeatureProperties(e,t,i){if(t.properties){const n={};for(const r in t.properties){const o=t.properties[r].evaluate({zoom:this.z},e._vectorTileFeature,e.state,e.tile,i);null!=o&&(n[r]=o)}e.properties=n}}addFeatureVariant(e,t,i){const n={target:t.target,namespace:t.namespace,uniqueFeatureID:t.uniqueFeatureID};t.properties&&(n.properties=e.properties),e.variants=e.variants||{},e.variants[t.targetId]=e.variants[t.targetId]||[],e.variants[t.targetId].push(n)}appendToResult(e,t,i,n,r){let o=e[t];void 0===o&&(o=e[t]=[]),o.push({featureIndex:i,feature:n,intersectionZ:r})}lookupSymbolFeatures(e,t,i,n,r,o){const s={};this.loadVTLayers();
2for(const a of e)this.loadMatchingFeature(s,{bucketIndex:t,sourceLayerIndex:i,featureIndex:a,layoutVertexArrayOffset:0},n,r,o);return s}loadFeature(e){const{featureIndex:t,sourceLayerIndex:i}=e;this.loadVTLayers();const n=this.sourceLayerCoder.decode(i),r=this.vtFeatures[n];if(r[t])return r[t];const o=this.vtLayers[n].feature(t);return r[t]=o,o}hasLayer(e){for(const t of this.bucketLayerIDs)for(const i of t)if(e===i)return!0;return!1}getId(e,t){let i=e.id;if(this.promoteId){const n=Array.isArray(this.promoteId)||"object"!=typeof this.promoteId?this.promoteId:this.promoteId[t];if(null!=n)if(Array.isArray(n)){if(!this.promoteIdExpression){const e=Uo(n);if("success"!==e.result)return void We(`Failed to create expression for promoteId: ${e.value.map(e=>`${e.key}: ${e.message}`).join(", ")}`);this.promoteIdExpression=e.value}i=this.promoteIdExpression.evaluate({zoom:0},e)}else i=e.properties[n];"boolean"==typeof i&&(i=Number(i))}return i}}function Nw(e,t,i,n,r){return je(e,(e,o)=>{const s=t instanceof Ea?t.get(o):null;return s&&s.evaluate?s.evaluate(i,n,void 0,r):s})}function Vw(e,t){return t-e}Jo(Bw,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});const Uw=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class jw{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[t,i]=new Uint8Array(e,0,2);if(219!==t)throw new Error("Data does not appear to be in a KDBush format.");const n=i>>4;if(1!==n)throw new Error(`Got v${n} data when expected v1.`);const r=Uw[15&i];if(!r)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(e,2,1),[s]=new Uint32Array(e,4,1);return new jw(s,o,r,e)}constructor(e,t=64,i=Float64Array,n){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=i,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const r=Uw.indexOf(this.ArrayType),o=2*e*this.ArrayType.BYTES_PER_ELEMENT,s=e*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-s%8)%8;if(r<0)throw new Error(`Unexpected typed array class: ${i}.`);n&&n instanceof ArrayBuffer?(this.data=n,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+s+a,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+o+s+a),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+s+a,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+r]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){const i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=e,this.coords[this._pos++]=t,i}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Gw(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,i,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:o,nodeSize:s}=this,a=[0,r.length-1,0],l=[];for(;a.length;){const c=a.pop()||0,u=a.pop()||0,h=a.pop()||0;if(u-h<=s){for(let s=h;s<=u;s++){const a=o[2*s],c=o[2*s+1];a>=e&&a<=i&&c>=t&&c<=n&&l.push(r[s])}continue}const d=h+u>>1,f=o[2*d],p=o[2*d+1];f>=e&&f<=i&&p>=t&&p<=n&&l.push(r[d]),(0===c?e<=f:t<=p)&&(a.push(h),a.push(d-1),a.push(1-c)),(0===c?i>=f:n>=p)&&(a.push(d+1),a.push(u),a.push(1-c))}return l}within(e,t,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:n,coords:r,nodeSize:o}=this,s=[0,n.length-1,0],a=[],l=i*i;for(;s.length;){const c=s.pop()||0,u=s.pop()||0,h=s.pop()||0;if(u-h<=o){for(let i=h;i<=u;i++)Ww(r[2*i],r[2*i+1],e,t)<=l&&a.push(n[i]);continue}const d=h+u>>1,f=r[2*d],p=r[2*d+1];Ww(f,p,e,t)<=l&&a.push(n[d]),(0===c?e-i<=f:t-i<=p)&&(s.push(h),s.push(d-1),s.push(1-c)),(0===c?e+i>=f:t+i>=p)&&(s.push(d+1),s.push(u),s.push(1-c))}return a}}function Gw(e,t,i,n,r,o){if(r-n<=i)return;const s=n+r>>1;qw(e,t,s,n,r,o),Gw(e,t,i,n,s-1,1-o),Gw(e,t,i,s+1,r,1-o)}function qw(e,t,i,n,r,o){for(;r>n;){if(r-n>600){const s=r-n+1,a=i-n+1,l=Math.log(s),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(s-c)/s)*(a-s/2<0?-1:1);qw(e,t,i,Math.max(n,Math.floor(i-a*c/s+u)),Math.min(r,Math.floor(i+(s-a)*c/s+u)),o)}const s=t[2*i+o];let a=n,l=r;
2for(Hw(e,t,n,i),t[2*r+o]>s&&Hw(e,t,n,r);a<l;){for(Hw(e,t,a,l),a++,l--;t[2*a+o]<s;)a++;for(;t[2*l+o]>s;)l--}t[2*n+o]===s?Hw(e,t,n,l):(l++,Hw(e,t,l,r)),l<=i&&(n=l+1),i<=l&&(r=l-1)}}function Hw(e,t,i,n){$w(e,i,n),$w(t,2*i,2*n),$w(t,2*i+1,2*n+1)}function $w(e,t,i){const n=e[t];e[t]=e[i],e[i]=n}function Ww(e,t,i,n){const r=e-i,o=t-n;return r*r+o*o}e.$=Qi,e.A=ki,e.B=Wa,e.C=2,e.D=Op,e.E=ni,e.F=ry,e.G=ny,e.H=Yi,e.I=ri,e.J=Da,e.K=Xi,e.L=Ji,e.M=Po,e.N=Ao,e.O=Co,e.P=Se,e.Q=Vo,e.R=Ot,e.S=Ra,e.T=_m,e.U=Uo,e.V=nx,e.W=qo,e.X=gr,e.Y=mr,e.Z=_r,e._=on,e.a=function(e){return st.API_CDN_URL_REGEX.test(e)},e.a$=tu,e.a0=Ki,e.a1=ai,e.a2=La,e.a3=class extends nx{},e.a4=Do,e.a5=Mo,e.a6=Pa,e.a7=function(e){const t=e.value;return t?Ki(t)?rx(t,!0)?[]:[new nx(e.key,t,`invalid url "${t}"`)]:[new nx(e.key,t,`string expected, "${Xi(t)}" found`)]:[]},e.a8=xa,e.a9=Ca,e.aA=ze,e.aB=h,e.aC=Q,e.aD=Nc,e.aE=nh,e.aF=Kc,e.aG=uu,e.aH=function(e,t){const i={};for(let n=0;n<t.length;n++){const r=t[n];r in e&&(i[r]=e[r])}return i},e.aI=Xc,e.aJ=Jc,e.aK=class{constructor(e){this.entries={},this.scheduler=e}request(e,t,i,n){const r=this.entries[e]=this.entries[e]||{callbacks:[]};if(r.result){const[e,i]=r.result;return this.scheduler?this.scheduler.add(()=>{n(e,i)},t):n(e,i),()=>{}}return r.callbacks.push(n),r.cancel||(r.cancel=i((i,n)=>{r.result=[i,n];for(const e of r.callbacks)this.scheduler?this.scheduler.add(()=>{e(i,n)},t):e(i,n);setTimeout(()=>delete this.entries[e],3e3)})),()=>{r.result||(r.callbacks=r.callbacks.filter(e=>e!==n),r.callbacks.length||(r.cancel(),delete this.entries[e]))}}},e.aL=function(e,t,i){const n=JSON.stringify(e.request);return e.data&&(this.deduped.entries[n]={result:[null,e.data]}),this.deduped.request(n,{type:"parseTile",isSymbolTile:e.isSymbolTile,zoom:e.tileZoom},t=>{const n=Nt(e.request,(e,n,r)=>{e?t(e):n&&t(null,{rawData:n,vectorTile:i?void 0:new Tu(new hg(n)),responseHeaders:new Map(r.entries())})});return()=>{n.cancel(),t()}},t)}
vendor: 5,576 bytes, line 2
2,e.aM=function(e){return e?{cacheControl:e.get("Cache-Control"),expires:e.get("Expires")}:{cacheControl:void 0,expires:void 0}},e.aN=Ft,e.aO=function(e){At++,At>bt&&(e.getActor().send("enforceCacheSizeLimit",xt),At=0)},e.aP=function(e){return e<=1?1:Math.pow(2,Math.floor(Math.log2(e)))},e.aQ=gh,e.aR=Wv,e.aS=Qv,e.aT=Zc,e.aU=Hv,e.aV=function(e,t){const i=document.createElement("video");i.muted=!0,i.onloadstart=function(){t(null,i)};for(let t=0;t<e.length;t++){const n=document.createElement("source");Vt(e[t])||(i.crossOrigin="Anonymous"),n.src=e[t],i.appendChild(n)}return{cancel:()=>{}}},e.aW=gm,e.aX=Tx,e.aY=Ue,e.aZ=Yy,e.a_=eu,e.aa=Ia,e.ab=class{constructor(e){this.specification=e}possiblyEvaluate(e,t){return Ye(e.expression.evaluate(t))}interpolate(e,t,i){return{x:di(e.x,t.x,i),y:di(e.y,t.y,i),z:di(e.z,t.z,i),azimuthal:di(e.azimuthal,t.azimuthal,i),polar:di(e.polar,t.polar,i)}}},e.ac=ga,e.ad=Go,e.ae=lu,e.af=j,e.ag=S,e.ah=Oe,e.ai=Ea,e.aj=Gh,e.ak=di,e.al=Vn,e.am=fi,e.an=Me,e.ao=li,e.ap=class{constructor(e){this.specification=e}possiblyEvaluate(e,t){return function([e,t]){const i=Ye([1,e,t]);return{x:i.x,y:i.y,z:i.z}}(e.expression.evaluate(t))}interpolate(e,t,i){return{x:di(e.x,t.x,i),y:di(e.y,t.y,i),z:di(e.z,t.z,i)}}},e.aq=function(e,t,i=0,n=!0){const r=new Se(i,i),o=e.sub(r),s=t.add(r),a=[o,new Se(s.x,o.y),s,new Se(o.x,s.y)];return n&&a.push(o.clone()),a},e.ar=function(e,t){const i=[];for(let n=0;n<e.length;n++){const r=Fe(n-1,-1,e.length-1),o=Fe(n+1,-1,e.length-1),s=e[n],a=e[o],l=e[r].sub(s).unit(),c=a.sub(s).unit(),u=c.angleWithSep(l.x,l.y),h=l.add(c).unit().mult(-1*t/Math.sin(u/2));i.push(s.add(h))}return i},e.as=Ky,e.at=rh,e.au=function(e,t,i=0){return E(((t.x-i)*e.scale-e.x)*Vn,(t.y*e.scale-e.y)*Vn,iu(t.z,t.y))},e.av=W,e.aw=B,e.ax=Lu,e.ay=F_,e.az=function(e){let t=1/0,i=1/0,n=-1/0,r=-1/0;for(const o of e)t=Math.min(t,o.x),i=Math.min(i,o.y),n=Math.max(n,o.x),r=Math.max(r,o.y);return{min:new Se(t,i),max:new Se(n,r)}},e.b=function(e){return st.API_FONTS_REGEX.test(e)},e.b$=Ff,e.b0=Al,e.b1=ll,e.b2=Ne,e.b3=Gl,e.b4=Cv,e.b5=function(){_a.isLoading()||_a.isLoaded()||"deferred"!==pa()||ma()},e.b6=za,e.b7=gu,e.b8=wx,e.b9=Je,e.bA=c,e.bB=_,e.bC=a,e.bD=function(e,t){const{x:i,y:n}=e.point,r=jh(i,n,e.worldSize/e._pixelsPerMercatorPixel,0,0);return h(r,r,Nh(Ch(t)))},e.bE=n,e.bF=H,e.bG=z,e.bH=L,e.bI=V,e.bJ=N,e.bK=Zg,e.bL=Ig,e.bM=Wg,e.bN=function(e,t,i,n,r){const o=5*t+2;e.float32[o+0]=i,e.float32[o+1]=n,e.float32[o+2]=r},e.bO=Ev,e.bP=ue,e.bQ=pe,e.bR=de,e.bS=xe,e.bT=Fe,e.bU=function(e,t,n,r){var o=new i(4);return o[0]=e,o[1]=t,o[2]=n,o[3]=r,o},e.bV=class{isDataAvailableAtPoint(e){const t=this._source();if(this.isUsingMockSource()||!t||e.y<0||e.y>1)return!1;const i=t.getSource().maxzoom,n=1<<i,r=Math.floor(e.x),o=Math.floor((e.x-r)*n),s=Math.floor(e.y*n),a=this.findDEMTileFor(new gh(i,r,i,o,s));return!(!a||!a.dem)}getAtPointOrZero(e,t=0){return this.getAtPoint(e,t)||0}getAtPoint(e,t,i=!0){if(this.isUsingMockSource())return null;null==t&&(t=null);const n=this._source();if(!n)return t;if(e.y<0||e.y>1)return t;const r=n.getSource().maxzoom,o=1<<r,s=Math.floor(e.x),a=e.x-s,l=new gh(r,s,r,Math.floor(a*o),Math.floor(e.y*o)),c=this.findDEMTileFor(l);if(!c||!c.dem)return t;const u=c.dem,h=1<<c.tileID.canonical.z,d=(a*h-c.tileID.canonical.x)*u.dim,f=(e.y*h-c.tileID.canonical.y)*u.dim,p=Math.floor(d),m=Math.floor(f);return(i?this.exaggeration():1)*di(di(u.get(p,m),u.get(p,m+1),f-m),di(u.get(p+1,m),u.get(p+1,m+1),f-m),d-p)}static getAtTileOffset(e,t,i,n){const r=1<<e.canonical.z;return n?n.pointElevation(t):i?i.getAtPointOrZero(new lu(e.wrap+(e.canonical.x+t.x/Vn)/r,(e.canonical.y+t.y/Vn)/r)):0}static getAtTileOffsetFunc(e,t,i,n){return(r,o,s)=>{const a=this.getAtTileOffset(e,r,o,s),l=n.upVector(e.canonical,r.x,r.y);return R(l,l,a*n.upVectorScale(e.canonical,t,i).metersToTile),l}}getForTilePoints(e,t,i,n){if(this.isUsingMockSource())return!1;const r=ux.create(this,e,n);return!!r&&(t.forEach(e=>{e[2]=this.exaggeration()*r.getElevationAt(e[0],e[1],i)}),!0)}getMinMaxForTile(e){if(this.isUsingMockSource())return null;const t=this.findDEMTileFor(e);if(!t||!t.dem)return null;const i=t.dem.tree,n=t.tileID,r=1<<e.canonical.z-n.canonical.z;let o=e.canonical.x/r-n.canonical.x,s=e.canonical.y/r-n.canonical.y,a=0;for(let t=0;t<e.canonical.z-n.canonical.z&&!i.leaves[a];t++){o*=2,s*=2;const e=2*Math.floor(s)+Math.floor(o);a=i.childOffsets[a]+e,o%=1,s%=1}return{min:this.exaggeration()*i.minimums[a],max:this.exaggeration()*i.maximums[a]}}getMinElevationBelowMSL(){throw new Error("Pure virtual method called.")}raycast(e,t,i){throw new Error("Pure virtual method called.")}pointCoordinate(e){throw new Error("Pure virtual method called.")}_source(){throw new Error("Pure virtual method called.")}isUsingMockSource(){throw new Error("Pure virtual method called.")}exaggeration(){throw new Error("Pure virtual method called.")}findDEMTileFor(e){throw new Error("Pure virtual method called.")}get visibleDemTiles(){throw new Error("Getter must be implemented in subclass.")}getMinMaxForVisibleTiles(){const e=this.visibleDemTiles;if(0===e.length)return null;let t=!1,i=Number.MAX_VALUE,n=Number.MIN_VALUE;for(const r of e){const e=this.getMinMaxForTile(r.tileID);e&&(i=Math.min(i,e.min),n=Math.max(n,e.max),t=!0)}return t?{min:i,max:n}:null}},e.bW=bp,e.bX=$u,e.bY=ng,e.bZ=Af,e.b_=ix,e.ba=R_,e.bb=cf,e.bc=_u,e.bd=sl,e.be=kl,e.bf=Th,e.bg=rc,e.bh=yd,e.bi=Uv,e.bj=function(e,t){const i=Gh(t.zoom);if(0===i)return Ch(e);const n=Lh(e),r=zh(n),o=Kc(n.getWest())*t.worldSize,s=Kc(n.getEast())*t.worldSize,a=Jc(n.getNorth())*t.worldSize,l=Jc(n.get
2South())*t.worldSize,c=[o,a,0],h=[s,a,0],d=[o,l,0],f=[s,l,0],p=u([],t.globeMatrix);return j(c,c,p),j(h,h,p),j(d,d,p),j(f,f,p),r[0]=Ph(r[0],d,i),r[1]=Ph(r[1],f,i),r[2]=Ph(r[2],h,i),r[3]=Ph(r[3],c,i),Vu.fromPoints(r)},e.bk=Bh,e.bl=u,e.bm=Oh,e.bn=Ph,e.bo=al,e.bp=wh,e.bq=g,e.br=d,e.bs=zw,e.bt=hg,e.bu=Nt,e.bv=function(e,t){const i=[];for(const n in e)n in t||i.push(n);return i},e.bw=ke,e.bx=["type","source","source-layer","minzoom","maxzoom","filter","layout"],e.by=Ee,e.bz=l,e.c=lt,e.c$=function(e,t,i){let n=0;for(let i=0;i<2;++i){const r=0;e[i]>r&&(n+=(e[i]-r)*(e[i]-r)),t[i]<r&&(n+=(r-t[i])*(r-t[i]))}return n},e.c0=kf,e.c1=kg,e.c2=My,e.c3=Ny,e.c4=jw,e.c5=R,e.c6=X,e.c7=te,e.c8=function(e,t,i){i*=.5;var n=t[0],r=t[1],o=t[2],s=t[3],a=Math.sin(i),l=Math.cos(i);return e[0]=n*l+r*a,e[1]=r*l-n*a,e[2]=o*l+s*a,e[3]=s*l-o*a,e},e.c9=ie,e.cA=w,e.cB=Nu,e.cC=Im,e.cD=mh,e.cE=Rh,e.cF=function(e,t,i,n,r,o,s,a,l){if("globe"===l.name)return Rh(e,t,new mh(i,n,r),!1);const c=Yy({z:i,x:n,y:r},l);return new Vu([(o+c.x/c.scale)*t,t*(c.y/c.scale),s],[(o+c.x2/c.scale)*t,t*(c.y2/c.scale),a])},e.cG=function(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e[2]=Math.min(t[2],i[2]),e[3]=Math.min(t[3],i[3]),e},e.cH=function(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e[2]=Math.max(t[2],i[2]),e[3]=Math.max(t[3],i[3]),e},e.cI=function(e){const t=Math.round((e+45+360)%360/90)%4;return Pe[t]},e.cJ=nu,e.cK=K,e.cL=6,e.cM=function(e){const t=c(new Float64Array(16));h(t,e.pixelMatrix,e.globeMatrix);const i=[0,jc,0],n=[0,Gc,0];return j(i,i,t),j(n,n,t),[i[0]>0&&i[0]<=e.width&&i[1]>0&&i[1]<=e.height&&!Hh(e,new Zc(e.center.lat,90)),n[0]>0&&n[0]<=e.width&&n[1]>0&&n[1]<=e.height&&!Hh(e,new Zc(e.center.lat,-90))]},e.cN=function(e,t){const{scale:i}=e.tileTransform,n=i*Vn/(e.tileSize*Math.pow(2,t.zoom-e.tileID.overscaledZ+e.tileID.canonical.z));return function(e,t,i){var n=t[1],r=t[2],o=t[3],s=i[0],a=i[1];return e[0]=t[0]*s,e[1]=n*s,e[2]=r*a,e[3]=o*a,e}(new Float32Array(4),t.inverseAdjustmentMatrix,[n,n])},e.cO=Am,e.cP=b,e.cQ=Em,e.cR=function(e){const t=Em(e,!0);return n([],[t[0],t[1],t[4],t[5]])},e.cS=f,e.cT=zu,e.cU=p,e.cV=function(e){const{x:t,y:i}=e.point,{lng:n,lat:r}=e._center;return jh(t,i,e.worldSize,n,r)},e.cW=C,e.cX=Ce,e.cY=yh,e.cZ=oh,e.c_=5,e.ca=et,e.cb=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},e.cc=x,e.cd=function(e,t,i,n,r){var o=1/Math.tan(t/2);if(e[0]=o/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=r&&r!==1/0){var s=1/(n-r);e[10]=(r+n)*s,e[14]=2*r*n*s}else e[10]=-1,e[14]=-2*n;return e},e.ce=function(e,t,i,n,r,o,s){var a=1/(t-i),l=1/(n-r),c=1/(o-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+i)*a,e[13]=(r+n)*l,e[14]=(s+o)*c,e[15]=1,e},e.cf=Qc,e.cg=function(e,t,i){e[4*t+0]=i[0],e[4*t+1]=i[1],e[4*t+2]=i[2],e[4*t+3]=i[3]},e.ch=pc,e.ci=gc,e.cj=mc,e.ck=_c,e.cl=bc,e.cm=yv,e.cn=function(){var e=new i(4);return i!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},e.co=function(e,t,i){var n=t[0],r=t[1],o=t[2],s=t[3],a=Math.sin(i),l=Math.cos(i);return e[0]=n*l+o*a,e[1]=r*l+s*a,e[2]=n*-a+o*l,e[3]=r*-a+s*l,e},e.cp=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},e.cq=$,e.cr=function(e){var t=e[0],i=e[1],n=e[2],r=e[3];return Math.sqrt(t*t+i*i+n*n+r*r)},e.cs=ae,e.ct=q,e.cu=_h,e.cv=3,e.cw=2,e.cx=7,e.cy=6,e.cz=U,e.d=function(e){return st.API_TILEJSON_REGEX.test(e)},e.d$=class{constructor(e,t,i,n){this.context=e,this.format=n,this.size=i,this.texture=e.gl.createTexture();const[r,o,s]=this.size,{gl:a}=e;a.bindTexture(a.TEXTURE_3D,this.texture),e.pixelStoreUnpackFlipY.set(!1),e.pixelStoreUnpack.set(1),e.pixelStoreUnpackPremultiplyAlpha.set(!1),"data"in t&&t.data&&a.texImage3D(a.TEXTURE_3D,0,this.format,r,o,s,0,pm(this.format),mm(this.format),t.data)}bind(e,t){const{context:i}=this,{gl:n}=i;n.bindTexture(n.TEXTURE_3D,this.texture),e!==this.minFilter&&(n.texParameteri(n.TEXTURE_3D,n.TEXTURE_MAG_FILTER,e),n.texParameteri(n.TEXTURE_3D,n.TEXTURE_MIN_FILTER,e),this.minFilter=e),t!==this.wrapS&&(n.texParameteri(n.TEXTURE_3D,n.TEXTURE_WRAP_S,t),n.texParameteri(n.TEXTURE_3D,n.TEXTURE_WRAP_T,t),this.wrapS=t)}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}},e.d0=function(e){return e*e*e*e*e},e.d1=Yc,e.d2=45,e.d3=yc,e.d4=function(e,t,i){const n=Math.sqrt(e*e+t*t+i*i),r=n>0?Math.acos(i/n)*Ae:0;let o=0!==e||0!==t?Math.atan2(-t,-e)*Ae+90:0;return o<0&&(o+=360),[n,o,r]}
2,e.d5=E,e.d6=Ye,e.d7=au,e.d8=A,e.d9=Vu,e.dA=function(e){return e({pluginStatus:ca,pluginURL:ua}),fa.on("pluginStateChange",e),e},e.dB=vc,e.dC=class extends fc{constructor(e){super(e),this.current=wc}set(e,t,i){if(this.fetchUniformLocation(e,t))for(let e=0;e<9;e++)if(i[e]!==this.current[e]){this.current=i,this.gl.uniformMatrix3fv(this.location,!1,i);break}}},e.dD=De,e.dE=function(e,t,i){const n=Gh(i.zoom),r=e.style.map._antialias,o=e.terrain&&e.terrain.exaggeration()>0;return 0===n&&!r&&!o},e.dF=function(e){const t=e.pixelsPerMeter,i=t/Qc(1,e.center.lat),n=c(new Float64Array(16));return d(n,n,[e.point.x,e.point.y,0]),f(n,n,[i,i,t]),Float32Array.from(n)},e.dG=Lh,e.dH=function(e){const t=nu-5;e=ze(e,-t,t)/t*90;const i=Math.pow(Math.abs(Math.sin(Me(e))),3);return Math.round(i*(Uc.length-1))},e.dI=function(e,t,i,n){const r=t.getNorth(),o=t.getSouth(),a=t.getWest(),l=t.getEast(),c=1<<e.z,u=l-a,h=r-o,d=u/Vc,f=-h/Uc[i],p=[0,d,0,f,0,0,r,a,0];if(e.z>0){const e=180/n;s(p,p,[e/u+1,0,0,0,e/h+1,0,-.5*e/d,.5*e/f,1])}return p[2]=c,p[5]=e.x,p[8]=e.y,p},e.dJ=Ch,e.dK=function(e,t,i){const n=c(new Float64Array(16)),r=(t/(1<<e)-.5)*Math.PI*2;return m(n,i.globeMatrix,r),Float32Array.from(n)},e.dL=dd,e.dM=Sh,e.dN=function(e,t){return[Math.pow(e[0],2.2)*t,Math.pow(e[1],2.2)*t,Math.pow(e[2],2.2)*t]},e.dO=r,e.dP=function(e,t){var i=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=i,e[2]=0,e[3]=-i,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},e.dQ=G,e.dR=Uh,e.dS=nt,e.dT=rt,e.dU=256,e.dV=function(e,t){const i=[0,0,0];return j(i,i,Bh(Ch(t.canonical))),j(i,i,e),i},e.dW=e=>({u_matrix:new bc(e),u_texsize:new _c(e),u_pixels_to_tile_units:new Sc(e),u_device_pixel_ratio:new mc(e),u_width_scale:new mc(e),u_floor_width_scale:new mc(e),u_image:new pc(e),u_units_to_pixels:new _c(e),u_tile_units_to_pixels:new mc(e),u_alpha_discard_threshold:new mc(e),u_trim_offset:new _c(e),u_trim_fade_range:new _c(e),u_trim_color:new yc(e),u_zbias_factor:new mc(e),u_tile_to_meter:new mc(e),u_ground_shadow_factor:new gc(e),u_pattern_transition:new mc(e)}),e.dX=e=>({u_matrix:new bc(e),u_pixels_to_tile_units:new Sc(e),u_device_pixel_ratio:new mc(e),u_width_scale:new mc(e),u_floor_width_scale:new mc(e),u_units_to_pixels:new _c(e),u_dash_image:new pc(e),u_gradient_image:new pc(e),u_image_height:new mc(e),u_texsize:new _c(e),u_tile_units_to_pixels:new mc(e),u_alpha_discard_threshold:new mc(e),u_trim_offset:new _c(e),u_trim_fade_range:new _c(e),u_trim_color:new yc(e),u_zbias_factor:new mc(e),u_tile_to_meter:new mc(e),u_ground_shadow_factor:new gc(e)}),e.dY=e=>({u_camera_to_center_distance:new mc(e),u_extrude_scale:new Sc(e),u_device_pixel_ratio:new mc(e),u_matrix:new bc(e),u_inv_rot_matrix:new bc(e),u_merc_center:new _c(e),u_tile_id:new gc(e),u_zoom_transition:new mc(e),u_up_dir:new gc(e),u_emissive_strength:new mc(e)}),e.dZ=El,e.d_=ig,e.da=M,e.db=function(e){return[Math.pow(e[0],1/2.2),Math.pow(e[1],1/2.2),Math.pow(e[2],1/2.2)]},e.dc=fm,e.dd=Km,e.de=Bm,e.df=rx,e.dg=function(e,t){return e.readFields(qx,{icons:[]},t)},e.dh=Bp,e.di=hy,e.dj=uy,e.dk=kt,e.dl=ha,e.dm=yt,e.dn=Jt,e.dp=qe,e.dq=function(e){const t=e.indexOf($a);return t>=0?e.slice(0,t):e},e.dr=function(e){return e.indexOf($a)>=0},e.ds=function(e){const t=e.lastIndexOf($a);return t>=0?e.slice(t+1):""},e.dt=function(e){const t=[],i=e.id;return void 0===i&&t.push({message:`layers.${i}: missing required property "id"`}),void 0===e.render&&t.push({message:`layers.${i}: missing required method "render"`}),e.renderingMode&&"2d"!==e.renderingMode&&"3d"!==e.renderingMode&&t.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),t},e.du=function(e,t,i,n){return"custom"===e.type?new ex(e,t):new Ix[e.type](e,t,i,n)},e.dv=Ge,e.dw=function(e){const t=e.indexOf($a);return t>=0?e.slice(t+1):""},e.dx=class extends wx{constructor(e,t){super(e._vectorTileFeature,e._z,e._x,e._y,e.id),e.state&&(this.state=Object.assign({},e.state)),this.target=t.target,this.namespace=t.namespace,t.properties&&(this.properties=t.properties),this.target&&("featuresetId"in this.target&&!this.target.importId||"layerId"in this.target)&&(this.source=e.source,this.sourceLayer=e.sourceLayer,this.layer=e.layer)}toJSON(){const e=super.toJSON();return e.target=this.target,e.namespace=this.namespace,e}},e.dy=fa,e.dz=Bt,e.e=st,e.e$=I,e.e0=Yh,e.e1=(e,t,i,n,r,o)=>{const s=e.transform,a="globe"===s.projection.name;let l;if("map"===o.paint.get("circle-pitch-alignment"))if(a){const e=Uh(s.zoom,t.canonical)*s._pixelsPerMercatorPixel;l=Float32Array.from([e,0,0,e])}else l=s.calculatePixelsToTileUnitsMatrix(i);else l=new Float32Array([s.pixelsToGLUnits[0],0,0,s.pixelsToGLUnits[1]]);const c={u_camera_to_center_distance:e.transform.getCameraToCenterDistance(s.projection),u_matrix:e.translatePosMatrix(t.projMatrix,i,o.paint.get("circle-translate"),o.paint.get("circle-translate-anchor")),u_device_pixel_ratio:_t.devicePixelRatio,u_extrude_scale:l,u_inv_rot_matrix:Xh,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0],u_emissive_strength:o.paint.get("circle-emissive-strength")};if(a){c.u_inv_rot_matrix=n,c.u_merc_center=r,c.u_tile_id=[t.canonical.x,t.canonical.y,1<<t.canonical.z],c.u_zoom_transition=Gh(s.zoom);const e=r[0]*Vn,i=r[1]*Vn;c.u_up_dir=s.projection.upVector(new mh(0,0,0),e,i)}return c},e.e2=V_,e.e3=Bi,e.e4=(e,t,i,n,r,o,s,a,l,c)=>{const u=e.transform,h=u.pitch<15?k_(.07,.7,ze((14-u.zoom)/5,0,1)):.07,d="none"===i.paint.get("line-trim-color-use-theme").
vendor: 4,874 bytes, line 2
2constantOr("default");return{u_matrix:N_(e,t,i,n),u_texsize:t.imageAtlasTexture?t.imageAtlasTexture.size:[0,0],u_pixels_to_tile_units:u.calculatePixelsToTileUnitsMatrix(t),u_device_pixel_ratio:r,u_width_scale:o,u_floor_width_scale:s,u_image:0,u_tile_units_to_pixels:B_(t,u),u_units_to_pixels:[1/u.pixelsToGLUnits[0],1/u.pixelsToGLUnits[1]],u_alpha_discard_threshold:0,u_trim_offset:a,u_trim_fade_range:i.paint.get("line-trim-fade-range"),u_trim_color:i.paint.get("line-trim-color").toPremultipliedRenderColor(d?null:i.lut).toArray01(),u_zbias_factor:h,u_tile_to_meter:au(t.tileID.canonical,0),u_ground_shadow_factor:l,u_pattern_transition:c}},e.e5=(e,t,i,n,r,o,s,a,l,c)=>{const u=e.transform,h=u.calculatePixelsToTileUnitsMatrix(t),d="none"===i.paint.get("line-trim-color-use-theme").constantOr("default"),f=u.pitch<15?k_(.07,.7,ze((14-u.zoom)/5,0,1)):.07;return{u_matrix:N_(e,t,i,n),u_pixels_to_tile_units:h,u_device_pixel_ratio:o,u_width_scale:s,u_floor_width_scale:a,u_units_to_pixels:[1/u.pixelsToGLUnits[0],1/u.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:r,u_texsize:U_(i)&&t.lineAtlasTexture?t.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:B_(t,e.transform),u_alpha_discard_threshold:0,u_trim_offset:l,u_trim_fade_range:i.paint.get("line-trim-fade-range"),u_trim_color:i.paint.get("line-trim-color").toPremultipliedRenderColor(d?null:i.lut).toArray01(),u_zbias_factor:f,u_tile_to_meter:au(t.tileID.canonical,0),u_ground_shadow_factor:c}},e.e6=Ve,e.e7=fd,e.e8=iu,e.e9=vh,e.eA=function(e,i){var n=2*Math.acos(i[3]),r=Math.sin(n/2);return r>t?(e[0]=i[0]/r,e[1]=i[1]/r,e[2]=i[2]/r):(e[0]=1,e[1]=0,e[2]=0),n},e.eB=Sx,e.eC=km,e.eD=Lm,e.eE=[1,1,1],e.eF=ux,e.eG=Y,e.eH=function(e,t,i,n){var r=t[0],o=t[1],s=t[2],a=t[3];return e[0]=r+n*(i[0]-r),e[1]=o+n*(i[1]-o),e[2]=s+n*(i[2]-s),e[3]=a+n*(i[3]-a),e},e.eI=Fm,e.eJ=wl,e.eK=Ol,e.eL=function(e,t,n,r,o,s,a,l,c,u,h,d,f,p,m,_){var g=new i(16);return g[0]=e,g[1]=t,g[2]=n,g[3]=r,g[4]=o,g[5]=s,g[6]=a,g[7]=l,g[8]=c,g[9]=u,g[10]=h,g[11]=d,g[12]=f,g[13]=p,g[14]=m,g[15]=_,g},e.eM=$c,e.eN=zl,e.eO=Ll,e.eP=class{constructor(){this._updateTime=0,this._sourceIds=[],this._activeRegions=[],this._prevRegions=[],this._globalClipBounds={min:new Se(1/0,1/0),max:new Se(-1/0,-1/0)}}clear(){this._activeRegions.length>0&&++this._updateTime,this._activeRegions=[],this._prevRegions=[]}get updateTime(){return this._updateTime}getReplacementRegionsForTile(e,t=!1){const i=Rf(new Se(0,0),new Se(Vn,Vn),e),n=[];if(t&&!Pf(i,this._globalClipBounds))return n;for(const t of this._activeRegions){if(t.hiddenByOverlap)continue;if(!Pf(i,t))continue;const r=Lf(t.min,t.max,e);n.push({min:r.min,max:r.max,sourceId:this._sourceIds[t.priority],footprint:t.footprint,footprintTileId:t.tileId,order:t.order,clipMask:t.clipMask,clipScope:t.clipScope})}return n}setSources(e){this._setSources(e.map(e=>({getSourceId:()=>e.cache.id,getFootprints:()=>{const t=[];for(const i of e.cache.getVisibleCoordinates()){const n=e.cache.getTile(i).buckets[e.layer];n&&n.updateFootprints(i.toUnwrapped(),t)}return t},getOrder:()=>e.order,getClipMask:()=>e.clipMask,getClipScope:()=>e.clipScope})))}_addSource(e){const t=e.getFootprints();if(0===t.length)return;const i=e.getOrder(),n=e.getClipMask(),r=e.getClipScope();for(const e of t){if(!e.footprint)continue;const t=Rf(e.footprint.min,e.footprint.max,e.id);this._activeRegions.push({min:t.min,max:t.max,hiddenByOverlap:!1,priority:this._sourceIds.length,tileId:e.id,footprint:e.footprint,order:i,clipMask:n,clipScope:r})}this._sourceIds.push(e.getSourceId())}_computeReplacement(){this._activeRegions.sort((e,t)=>e.priority-t.priority||Mf(e.min,t.min)||Mf(e.max,t.max)||e.order-t.order||e.clipMask-t.clipMask||function(e,t){const i=(e,t)=>e+t;return e.length-t.length||e.reduce(i,"").localeCompare(t.reduce(i,""))}(e.clipScope,t.clipScope));let e=this._activeRegions.length!==this._prevRegions.length;if(!e){let t=0;for(;!e&&t!==this._activeRegions.length;){const i=this._activeRegions[t],n=this._prevRegions[t];e=i.priority!==n.priority||!Cf(i,n)||i.order!==n.order||i.clipMask!==n.clipMask||!Ee(i.clipScope,n.clipScope),this._activeRegions[t].hiddenByOverlap=n.hiddenByOverlap,++t}}if(e){++this._updateTime;for(const e of this._activeRegions)e.order!==Ef&&(this._globalClipBounds.min.x=Math.min(this._globalClipBounds.min.x,e.min.x),this._globalClipBounds.min.y=Math.min(this._globalClipBounds.min.y,e.min.y),this._globalClipBounds.max.x=Math.max(this._globalClipBounds.max.x,e.max.x),this._globalClipBounds.max.y=Math.max(this._globalClipBounds.max.y,e.max.y));const e=e=>{const t=this._activeRegions;if(e>=t.length)return e;const i=t[e].priority;for(;e<t.length&&t[e].priority===i;)++e;return e};if(this._sourceIds.length>1){let t=0,i=e(t);for(;t!==i;){let n=t;const r=t;for(;n!==i;){const e=this._activeRegions[n];e.hiddenByOverlap=!1;for(let t=0;t<r;t++){const i=this._activeRegions[t];
vendor: 4,514 bytes, line 2
2if(!i.hiddenByOverlap&&e.order===Ef&&Pf(e,i)&&(e.hiddenByOverlap=Of(e.footprint,e.tileId,i.footprint,i.tileId),e.hiddenByOverlap))break}++n}t=i,i=e(t)}}}}_setSources(e){[this._prevRegions,this._activeRegions]=[this._activeRegions,[]],this._sourceIds=[];for(let t=e.length-1;t>=0;t--)this._addSource(e[t]);this._computeReplacement()}},e.eQ=Ef,e.eR=class{constructor(e){this._createGrid(e),this._createPoles(e)}destroy(){this._poleIndexBuffer.destroy(),this._gridBuffer.destroy(),this._gridIndexBuffer.destroy(),this._poleNorthVertexBuffer.destroy(),this._poleSouthVertexBuffer.destroy();for(const e of this._poleSegments)e.destroy();for(const e of this._gridSegments)e.withSkirts.destroy(),e.withoutSkirts.destroy()}_fillGridMeshWithLods(e,t){const i=new sl,n=new Al,r=[],o=e+1+2,s=t[0]+1,a=t[0]+1+(1+t.length),l=(e,t,i)=>{let n=e===o-1?e-2:0===e?e:e-1;return n+=i?24575:0,[n,t]};for(let e=0;e<o;++e)i.emplaceBack(...l(e,0,!0));for(let e=0;e<s;++e)for(let t=0;t<o;++t)i.emplaceBack(...l(t,e,(0===t||t===o-1)&&!0));for(let e=0;e<t.length;++e){const n=t[e];for(let e=0;e<o;++e)i.emplaceBack(...l(e,n,!0))}for(let e=0;e<t.length;++e){const s=n.length,l=t[e]+1+2,c=new Al;for(let i=0;i<l-1;i++){const r=i===l-2,s=r?o*(a-t.length+e-i):o;for(let e=0;e<o-1;e++){const t=i*o+e;0===i||r||0===e||e===o-2?(c.emplaceBack(t+1,t,t+s),c.emplaceBack(t+s,t+s+1,t+1)):(n.emplaceBack(t+1,t,t+s),n.emplaceBack(t+s,t+s+1,t+1))}}const u=rc.simpleSegment(0,s,i.length,n.length-s);for(let e=0;e<c.uint16.length;e+=3)n.emplaceBack(c.uint16[e],c.uint16[e+1],c.uint16[e+2]);const h=rc.simpleSegment(0,s,i.length,n.length-s);r.push({withoutSkirts:u,withSkirts:h})}return{vertices:i,indices:n,segments:r}}_createGrid(e){const t=this._fillGridMeshWithLods(Vc,Uc);this._gridSegments=t.segments,this._gridBuffer=e.createVertexBuffer(t.vertices,Th.members),this._gridIndexBuffer=e.createIndexBuffer(t.indices,!0)}_createPoles(e){const t=new Al;for(let e=0;e<=Vc;e++)t.emplaceBack(0,e+1,e+2);this._poleIndexBuffer=e.createIndexBuffer(t,!0);const i=new Dl,n=new Dl,r=new Dl,o=new Dl;this._poleSegments=[];for(let e=0,t=0;e<5;e++){const s=360/(1<<e);i.emplaceBack(0,-Nc,0,.5,0),n.emplaceBack(0,-Nc,0,.5,1),r.emplaceBack(0,-Nc,0,.5,.5),o.emplaceBack(0,-Nc,0,.5,.5);for(let e=0;e<=Vc;e++){let t=e/Vc,a=0;const l=di(0,s,t),[c,u,h]=qc(Wh,Zh,l,Nc);i.emplaceBack(c,u,h,t,a),n.emplaceBack(c,u,h,t,1-a);const d=Me(l);t=.5+.5*Math.sin(d),a=.5+.5*Math.cos(d),r.emplaceBack(c,u,h,t,a),o.emplaceBack(c,u,h,t,1-a)}this._poleSegments.push(rc.simpleSegment(t,0,66,64)),t+=66}this._poleNorthVertexBuffer=e.createVertexBuffer(i,bh,!1),this._poleSouthVertexBuffer=e.createVertexBuffer(n,bh,!1),this._texturedPoleNorthVertexBuffer=e.createVertexBuffer(r,bh,!1),this._texturedPoleSouthVertexBuffer=e.createVertexBuffer(o,bh,!1)}getGridBuffers(e,t){return[this._gridBuffer,this._gridIndexBuffer,t?this._gridSegments[e].withSkirts:this._gridSegments[e].withoutSkirts]}getPoleBuffers(e,t){return[t?this._texturedPoleNorthVertexBuffer:this._poleNorthVertexBuffer,t?this._texturedPoleSouthVertexBuffer:this._poleSouthVertexBuffer,this._poleIndexBuffer,this._poleSegments[e]]}},e.eS=If,e.eT=Re,e.eU=function(){return!!document.fullscreenElement||!!document.webkitFullscreenElement},e.eV=Le,e.eW=su,e.eX=function(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e[2]=t[2]/i[2],e},e.eY=Z,e.eZ=Hc,e.e_=F,e.ea=rp,e.eb=dp,e.ec=$f,e.ed=450,e.ee=7,e.ef=ou,e.eg=function(e,t){if(e===t){var i=t[1],n=t[2],r=t[3],o=t[6],s=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=i,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[11]=t[14],e[12]=r,e[13]=s,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e},e.eh=$v,e.ei=rl,e.ej=Vl,e.ek=256,e.el=Nh,e.em=pl,e.en=m,e.eo=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},e.ep=Dl,e.eq=mo,e.er=Rl,e.es=function(e,t,i,n,r){return ze((e-t)/(i-t)*(r-n)+n,n,r)},e.et=ne,e.eu=function(e,t){var i=t[0],n=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=u*s-a*c,d=-u*o+a*l,f=c*o-s*l,p=i*h+n*d+r*f;return p?(e[0]=h*(p=1/p),e[1]=(-u*n+r*c)*p,e[2]=(a*n-r*s)*p,e[3]=d*p,e[4]=(u*i-r*l)*p,e[5]=(-a*i+r*o)*p,e[6]=f*p,e[7]=(-c*i+n*l)*p,e[8]=(s*i-n*o)*p,e):null},e.ev=2,e.ew=k,e.ex=ee,e.ey=v,e.ez=function(e,t){var n=new i(3);v(n,t);var r=1/n[0],o=1/n[1],s=1/n[2],a=t[0]*r,l=t[1]*o,c=t[2]*s,u=t[4]*r,h=t[5]*o,d=t[6]*s,f=t[8]*r,p=t[9]*o,m=t[10]*s,_=a+h+m,g=0;return _>
20?(g=2*Math.sqrt(_+1),e[3]=.25*g,e[0]=(d-p)/g,e[1]=(f-c)/g,e[2]=(l-u)/g):a>h&&a>m?(g=2*Math.sqrt(1+a-h-m),e[3]=(d-p)/g,e[0]=.25*g,e[1]=(l+u)/g,e[2]=(f+c)/g):h>m?(g=2*Math.sqrt(1+h-a-m),e[3]=(f-c)/g,e[0]=(l+u)/g,e[1]=.25*g,e[2]=(d+p)/g):(g=2*Math.sqrt(1+m-a-h),e[3]=(l-u)/g,e[0]=(f+c)/g,e[1]=(d+p)/g,e[2]=.25*g),e},e.f=function(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(Number("0x"+t))))},e.f0=function([e,t,i]){const n=Math.hypot(e,t,i),r=Math.atan2(e,i),o=.5*Math.PI-Math.acos(-t/n);return new Zc(Ce(r),Ce(o))},e.f1=J,e.f2=Cm,e.f3=function(e){const t=e.navigator?e.navigator.userAgent:null;return!!function(e){if(null==Qe){const t=e.navigator?e.navigator.userAgent:null;Qe=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return Qe}(e)&&!(!t||!(t.match("Version/15.4")||t.match("Version/15.5")||t.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/)))},e.f4=function(e,t){xt=e,bt=t},e.f5=Hh,e.f6=qh,e.f7=function(e){const t=[0,0,0],i=c(new Float64Array(16));return h(i,e.pixelMatrix,e.globeMatrix),j(t,t,i),new Se(t[0],t[1])},e.f8=function(){const e=Fp;e&&(e.isPreloaded()&&1===e.numActive()?(e.release(Lp),Fp=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()"))},e.f9=function(){Bp().acquire(Lp)},e.fA=qb,e.fB=yu,e.fC=function(e){let t=0;if(new Uint32Array(e,0,1)[0]!==sm){const i=new Uint32Array(e,0,7),[,,n,r,o,s]=i;t=i.byteLength+r+o+s+o,(n!==e.byteLength||t>=e.byteLength)&&We("Invalid b3dm header information.")}return dm(e,t)},e.fD=function(e,t){const i=Km(e);for(const e of i){for(const t of e.meshes)Jm(t);e.lights&&(e.lightMeshIndex=e.meshes.length,e.meshes.push(e_(e.lights,t)))}return i},e.fE=gx,e.fF=Ke,e.fG=Dp,e.fH=_a,e.fI=aa,e.fJ=function(e){It(),null!=Tt&&Tt.then(t=>{t.keys().then(i=>{for(let n=0;n<i.length-e;n++)t.delete(i[n]).catch(e=>We(e.message))}).catch(e=>We(e.message))}).catch(e=>We(e.message))},e.fa=pa,e.fb=function(e,t,i=!1){if(ca===aa.deferred||ca===aa.loading||ca===aa.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");ua=_t.resolveURL(e),ca=aa.deferred,la=t,da(),i||ma()},e.fc=function(e){qp=_t.resolveURL(e),$p||($p=new Op(Bp(),new ni)),$p.broadcast("setMeshoptUrl",qp)},e.fd=Kp,e.fe=function(e){jp=_t.resolveURL(e),$p||($p=new Op(Bp(),new ni)),$p.broadcast("setDracoUrl",jp)},e.ff=Yp,e.fg=Rp,e.fh=function(e){const t=Et();if(!t)return;const i=t.delete(vt);e&&i.then(()=>e()).catch(e)},e.fi=zp,e.fj=Jo,e.fk=ud,e.fl=2,e.fm=kw,e.fn=Bw,e.fo=M_,e.fp=Eu,e.fq="hd_road_elevation",e.fr=Gu,e.fs=je,e.ft=Yd,e.fu=oy,e.fv=1,e.fw=function(e,t,i,n,r,o,s,a=1,l,c,u){e.createArrays(),e.tilePixelRatio=Vn/(512*e.overscaling),e.compareText={},e.iconsNeedLinear=!1;const h=e.layers[0].layout,d=e.layers[0]._unevaluatedLayout._values,f={};f.scaleFactor=a,f.textSizeScaleRange=h.get("text-size-scale-range"),f.iconSizeScaleRange=h.get("icon-size-scale-range");const[p,m]=f.textSizeScaleRange,[_,g]=f.iconSizeScaleRange;f.textScaleFactor=ze(f.scaleFactor,p,m),f.iconScaleFactor=ze(f.scaleFactor,_,g);const y=d["text-size"],v=d["icon-size"];if("composite"===e.textSizeData.kind){const{minZoom:t,maxZoom:i}=e.textSizeData;f.compositeTextSizes=[y.possiblyEvaluate(new ga(t,{worldview:u}),o),y.possiblyEvaluate(new ga(i,{worldview:u}),o)]}if("composite"===e.iconSizeData.kind){const{minZoom:t,maxZoom:i}=e.iconSizeData;f.compositeIconSizes=[v.possiblyEvaluate(new ga(t,{worldview:u}),o),v.possiblyEvaluate(new ga(i,{worldview:u}),o)]}f.layoutTextSize=y.possiblyEvaluate(new ga(s+1,{worldview:u}),o),f.layoutIconSize=v.possiblyEvaluate(new ga(s+1,{worldview:u}),o),f.textMaxSize=y.possiblyEvaluate(new ga(18,{worldview:u}),o);const x=h.get("symbol-placement"),b="map"===h.get("text-rotation-alignment")&&"point"!==x,w=h.get("text-size");let T=!1;const S=[];for(const s of e.features){const a=h.get("text-font").evaluate(s,{},o).join(","),p=w.evaluate(s,{},o)*f.textScaleFactor,m=f.layoutTextSize.evaluate(s,{},o)*f.textScaleFactor,_=f.layoutIconSize.evaluate(s,{},o)*f.iconScaleFactor,g={horizontal:{},vertical:void 0},y=s.text;let v,E=[0,0];if(y){const n=y.toString(),c=h.get("text-letter-spacing").evaluate(s,{},o)*ng,u=h.get("text-line-height").evaluate(s,{},o)*ng,d=Qs(n)?c:0,f=h.get("text-anchor").evaluate(s,{},o),_=h.get("text-variable-anchor");if(!_){const e=h.get("text-radial-offset").evaluate(s,{},o);
2if(e)E=My(f,[e*ng,Ey]);else{const e=h.get("text-offset").evaluate(s,{},o);E=[e[0]*ng,e[1]*ng]}}let v=b?"center":h.get("text-justify").evaluate(s,{},o);const w="point"===x,T=w?h.get("text-max-width").evaluate(s,{},o)*ng:1/0,S=o=>{e.allowVerticalPlacement&&Js(n)&&(g.vertical=Cg(y,t,i,r,a,T,u,f,o,d,E,Ig.vertical,!0,m,p,l))};if(!b&&_){const e="auto"===v?_.map(e=>Ny(e)):[v];let n=!1;for(let o=0;o<e.length;o++){const s=e[o];if(!g.horizontal[s])if(n)g.horizontal[s]=g.horizontal[0];else{const e=Cg(y,t,i,r,a,T,u,"center",s,d,E,Ig.horizontal,!1,m,p,l);e&&(g.horizontal[s]=e,n=1===e.positionedLines.length)}}S("left")}else{if("auto"===v&&(v=Ny(f)),w||h.get("text-writing-mode").indexOf("horizontal")>=0||!Js(n)){const e=Cg(y,t,i,r,a,T,u,f,v,d,E,Ig.horizontal,!1,m,p,l);e&&(g.horizontal[v]=e)}S(w?"left":v)}}let I,A,M,C,P,D,R=!1;const L=h.get("icon-text-fit").evaluate(s,{},o);if(s.icon&&s.icon.hasPrimary()){const t=zy(s.icon,e.iconSizeData,d["icon-size"],o,e.zoom,s,l,f.iconScaleFactor,u);I=t.iconPrimary,M=t.iconSecondary;const i=I.toString();if(A=n.get(i),A&&(P=h.get("icon-offset").evaluate(s,{},o),D=h.get("icon-anchor").evaluate(s,{},o),v=Vg(r.get(i),M?r.get(M.toString()):void 0,P,D),R=A.sdf,void 0===e.sdfIcons?e.sdfIcons=A.sdf:e.sdfIcons!==A.sdf&&We("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(A.pixelRatio!==e.pixelRatio||0!==h.get("icon-rotate").constantOr(1))&&(e.iconsNeedLinear=!0)),M){const e=M.toString();C=n.get(e)}}T=T||!(!s.icon||!s.icon.hasSecondary());const z=Hy(g.horizontal)||g.vertical;e.iconsInText||(e.iconsInText=!!z&&z.iconsInText);const O=m*f.textScaleFactor/ng,{defaultShapedIcon:F,verticallyShapedIcon:k}=Vy(e,v,h,s,o,g,O,P,L);"none"!==L&&v&&(jg(v)||Gg(v))&&(Ry(0,A,I,v,F,L,c,n,r),Ry(0,C,M,v,F,L,c,n,r),k&&(Ry(0,A,I,v,k,L,c,n,r),Ry(0,C,M,v,k,L,c,n,r))),v=F;const{iconBBox:B,iconVerticalBBox:N,textBBox:V,textVerticalBBox:U}=Cy(e,v,k,h,s,o,_,P,f,r,D,g,m,E);S.push({feature:s,shapedTextOrientations:g,shapedText:z,shapedIcon:v,iconPrimary:I,iconSecondary:M,iconOffset:P,iconAnchor:D,verticallyShapedIcon:k,layoutTextSize:m,layoutIconSize:_,textOffset:E,isSDFIcon:R,iconTextFit:L,iconCollisionBounds:B,iconVerticalCollisionBounds:N,textCollisionBounds:V,textVerticalCollisionBounds:U})}return{featureData:S,sizes:f,hasAnySecondaryIcon:T,textAlongLine:b,symbolPlacement:x}},e.fx=sy,e.fy=function(e,t,i,n,r,o,s,a,l,c){e.iconAtlasPositions=c.iconPositions;const{featureData:u,hasAnySecondaryIcon:h,sizes:d,textAlongLine:f,symbolPlacement:p}=t;for(const t of u){const{shapedIcon:i,verticallyShapedIcon:o,feature:u,shapedTextOrientations:m,shapedText:_,layoutTextSize:g,textOffset:y,isSDFIcon:v,iconPrimary:x,iconSecondary:b,iconTextFit:w,iconOffset:T,iconCollisionBounds:S,iconVerticalCollisionBounds:E,textCollisionBounds:I}=t;Fy(i,c.iconPositions,x,b),Fy(o,c.iconPositions,x,b),ky(m,c.iconPositions),Oy(x,b,c.iconPositions),(_||i)&&Uy(e,u,m,i,o,l,d,g,0,y,v,n,r,s,a,h,w,T,f,p,S,E,I)}i&&e.generateCollisionDebugBuffers(o,e.collisionBoxArray,d.textScaleFactor)},e.fz=Tu,e.g=function(e,t){return Bt(Object.assign(e,{method:"GET"}),t)},e.h=function(e){return 0===e.indexOf("mapbox:")},e.i=function(e){return st.API_STYLE_REGEX.test(e)&&!lt(e)},e.j=at,e.k=Mt,e.l=function(e){return decodeURIComponent(atob(e).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join(""))},e.m=function(e,t){return Bt(Object.assign(e,{type:"json"}),t)},e.n=qt,e.o=_t,e.p=function(e,t){return Bt(Object.assign(e,{method:"POST"}),t)},e.q=hd,e.r=mt,e.s=function(e){try{const t=self[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch(e){return!1}},e.t=function(){return kp||(kp=new zp("ImageRasterizer")),kp},e.u=function(){return function e(t){return t?(t^Math.random()*(16>>t/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()},e.v=function(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)},e.w=We,e.x=Rb,e.y=ei,e.z=Qt}),n(0,function(e){function t(e){const t=e?e.url.toString():void 0;return t?performance.getEntriesByName(t):[]}function i(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e||null==e)return JSON.stringify(e);if(Array.isArray(e)){let t="[";for(const n of e)t+=`${i(n)},`;return`${t}]`}let t="{";for(const n of Object.keys(e).sort())t+=`${n}:${i(e[n])},`;return`${t}}`}function n(t){let n="";for(const r of e.bx)n+=`/${i(t[r])}`;return n}
2class r{constructor(e){this.keyCache={},this._layers={},this._layerConfigs={},e&&this.replace(e)}replace(e,t){this._layerConfigs={},this._layers={},this.update(e,[],t)}update(t,r,o){this._options=o;for(const i of t)this._layerConfigs[i.id]=i,(this._layers[i.id]=e.du(i,this.scope,null,this._options)).compileFilter(o),this.keyCache[i.id]&&delete this.keyCache[i.id];for(const e of r)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource={};const s=function(e,t){const r={};for(let o=0;o<e.length;o++){const s=e[o];let a=t&&t[s.id];a||("symbol"===s.type?a=s.id:(a=n(s),"line"===s.type&&s.paint&&function e(t){return"string"==typeof t&&"line-progress"===t||(Array.isArray(t)?t.some(e):!(!t||"object"!=typeof t)&&Object.values(t).some(e))}(s.paint["line-width"])&&(a+=`/${i(s.paint["line-width"])}`))),t&&(t[s.id]=a);let l=r[a];l||(l=r[a]=[]),l.push(s)}const o=[];for(const e in r)o.push(r[e]);return o}(Object.values(this._layerConfigs),this.keyCache);for(const e of s){const t=e.map(e=>this._layers[e.id]),i=t[0];if("none"===i.visibility)continue;const n=i.source||"";let r=this.familiesBySource[n];r||(r=this.familiesBySource[n]={});const o=i.sourceLayer||"_geojsonTileLayer";let s=r[o];s||(s=r[o]=[]),s.push(t)}}}const o=1*e.fl;class s{constructor(t){const i={},n=[];for(const e in t){const r=t[e],s=i[e]={};for(const e in r.glyphs){const t=r.glyphs[+e];if(!t||0===t.bitmap.width||0===t.bitmap.height)continue;const i=t.metrics.localGlyph?o:1,a={x:0,y:0,w:t.bitmap.width+2*i,h:t.bitmap.height+2*i};n.push(a),s[e]=a}}const{w:r,h:s}=e.G(n),a=new e.fk({width:r||1,height:s||1});for(const n in t){const r=t[n];for(const t in r.glyphs){const s=r.glyphs[+t];if(!s||0===s.bitmap.width||0===s.bitmap.height)continue;const l=i[n][t],c=s.metrics.localGlyph?o:1;e.fk.copy(s.bitmap,a,{x:0,y:0},{x:l.x+c,y:l.y+c},s.bitmap)}}this.image=a,this.positions=i}}function a(e,t,i){e[t]?i&&(e[t].center=i):e[t]={floorIds:new Set,center:i||[0,0],floors:{}}}function l(e,t,i,n){for(const r of t)a(e,r),e[r].floors[i]=n,e[r].floorIds.add(i)}function c(e){return{id:e.properties.id.toString(),center:e.properties.center.toString().split(";").map(Number)}}function u(e){return{id:e.properties.id.toString(),isDefault:!!e.properties.is_default&&e.properties.is_default,connections:e.properties.connected_floor_ids?new Set(e.properties.connected_floor_ids.toString().split(";")):new Set,conflicts:e.properties.conflicted_floor_ids?new Set(e.properties.conflicted_floor_ids.toString().split(";")):new Set,buildings:e.properties.building_ids?new Set(e.properties.building_ids.toString().split(";")):new Set,name:e.properties.name.toString(),zIndex:e.properties.z_index}}function h(e,t){return t.every(t=>e.properties&&null!=e.properties[t])}function d(e){return h(e,["type","id","name"])&&"building"===e.properties.type}function f(e){return h(e,["type","id","name","z_index"])&&"floor"===e.properties.type}e.fj(s,"GlyphAtlas");class p{constructor(t){this.tileID=new e.aQ(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.tileZoom=t.tileZoom,this.uid=t.uid,this.zoom=t.zoom,this.lut=t.lut,this.canonical=t.tileID.canonical,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.scope=t.scope,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.request&&t.request.collectResourceTiming,this.promoteId=t.promoteId,this.isSymbolTile=t.isSymbolTile,this.tileTransform=e.aZ(t.tileID.canonical,t.projection),this.projection=t.projection,this.worldview=t.worldview,this.localizableLayerIds=t.localizableLayerIds,this.brightness=t.brightness,this.extraShadowCaster=!!t.extraShadowCaster,this.tessellationStep=t.tessellationStep,this.scaleFactor=t.scaleFactor,this.worldview=t.worldview,this.indoor=t.indoor}parse(t,i,n,r,o,h){this.status="parsing",this.data=t,this.collisionBoxArray=new e.b3;const p=new e.fm(Object.keys(t.layers).sort()),_=new e.fn(this.tileID,this.promoteId);_.bucketLayerIDs=[];const g={},y=new e.fo(256,256),v={featureIndex:_,iconDependencies:new Map,patternDependencies:new Map,glyphDependencies:{},lineAtlas:y,availableImages:n,brightness:this.brightness,scaleFactor:this.scaleFactor,elevationFeatures:void 0,activeFloors:void 0};if(this.indoor){const i=this.indoor.indoorState.activeFloorsVisible,n=function(t,i,n){const r=function(t,i){if(!t)return e.w("No source layers defined in indoor specification"),i;if(0===t.size)return i;const n=t.difference(i);for(const t of n)e.w(`Missing source layer required in indoor specification: ${t}`);return i.intersection(i)}(i.sourceLayers,new Set(Object.keys(t.layers))),o=i.indoorState,s=function(t,i,n,r){const o=new Set,s=new Set,h=new Set,p=new Map,m={},_=e=>{const t=p.get(e)||new Set;for(const i of o)if((p.get(i)||new Set).has(e)||t.has(i))return!0;return!1};for(const n of i){const i=t.layers[n];if(i)for(let e=0;e<i.length;e++){const t=i.feature(e);
2if(d(t)){const{id:e,center:i}=c(t);a(m,e,i),o.add(e)}else if(f(t)){const{id:e,isDefault:i,connections:n,conflicts:a,buildings:c,name:d,zIndex:f}=u(t);l(m,c,e,{name:d,zIndex:f}),p.set(e,a),(e===r||n.has(r))&&o.add(e),s.add(e),i&&h.add(e)}}else e.w(`indoor source layer not found: ${n}`)}if(n)for(const e of n)s.has(e)&&(_(e)||o.add(e));for(const e of h)o.has(e)||_(e)||o.add(e);return{buildings:m,activeFloors:o}}(t,r,o.lastActiveFloors,o.selectedFloorId);return n.send("setIndoorData",s),s}(t,this.indoor,o);v.activeFloors=i?n.activeFloors:void 0}const x=[],b=i.familiesBySource[this.source];for(const i in b){const o=t.layers[i];if(!o)continue;let s=!1,a=!1,l=!1;for(const e of b[i])"symbol"===e[0].type?s=!0:a=!0,e[0].is3D()&&"model"!==e[0].type&&(l=!0);if(this.extraShadowCaster&&!l)continue;if(!0===this.isSymbolTile&&!s)continue;if(!1===this.isSymbolTile&&!a)continue;1===o.version&&e.w(`Vector tile source "${this.source}" layer "${i}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const c=p.encode(i),u=[],h=this.localizableLayerIds&&this.localizableLayerIds.has(i);let d=!1;for(let t=0,n=0;t<o.length;t++){const r=o.feature(t),s=_.getId(r,i),a=r.properties?r.properties.worldview:null;if(h&&this.worldview&&"string"==typeof a)if("all"===a)r.properties.$localized=!0;else{if(!a.split(",").includes(this.worldview))continue;r.properties.$localized=!0,r.properties.worldview=this.worldview}!d&&r.properties&&r.properties.hasOwnProperty(e.fp)&&(d=!0),u.push({feature:r,id:s,index:n,sourceLayerIndex:c}),n++}d&&!v.elevationFeatures&&t.layers.hasOwnProperty(e.fq)&&(v.elevationFeatures=e.fr.parseFrom(t.layers[e.fq],this.canonical));for(const t of b[i]){const i=t[0];if(this.extraShadowCaster&&(!i.is3D()||"model"===i.type))continue;if(void 0!==this.isSymbolTile&&"symbol"===i.type!==this.isSymbolTile)continue;if(i.minzoom&&this.zoom<Math.floor(i.minzoom))continue;if(i.maxzoom&&this.zoom>=i.maxzoom)continue;if("none"===i.visibility)continue;m(t,this.zoom,v.brightness,n,this.worldview);const o=g[i.id]=i.createBucket({index:_.bucketLayerIDs.length,layers:t,zoom:this.zoom,lut:this.lut,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:c,sourceID:this.source,projection:this.projection.spec,tessellationStep:this.tessellationStep,styleDefinedModelURLs:r,worldview:this.worldview,localizable:h});_.bucketLayerIDs.push(t.map(t=>e.B(t.id,t.scope)));let s=o.prepare?o.prepare():null;null!=s?(s=s.then(()=>o.populate(u,v,this.tileID.canonical,this.tileTransform)),x.push(s)):o.populate(u,v,this.tileID.canonical,this.tileTransform)}}const w=()=>{let i,r,a,l,c,u;y.trim();const d={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},f=()=>{if(i)return this.status="done",h(i);if(this.extraShadowCaster)this.status="done",h(null,{buckets:Object.values(g).filter(e=>!e.isEmpty()),featureIndex:_,collisionBoxArray:null,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:v.brightness,glyphMap:null,iconMap:null,glyphPositions:null});else if(r&&a&&l){const t=new s(r),i=new Map;for(const[t,n]of a.entries()){const{imagePosition:r}=e.fu(t,n,e.fv);i.set(t,r)}const h={};for(const o in g){const s=g[o];s instanceof e.b4&&(m(s.layers,this.zoom,v.brightness,n,this.worldview),h[o]=e.fw(s,r,t.positions,a,i,this.tileID.canonical,this.tileZoom,this.scaleFactor,this.pixelRatio,c,this.worldview))}const d={iconsPending:!0,patternsPending:!0};this.rasterizeIfNeeded(o,a,c,()=>{d.iconsPending=!1,x(h,t,d)}),this.rasterizeIfNeeded(o,l,u,()=>{d.patternsPending=!1,x(h,t,d)})}},x=(t,i,r,o)=>{if(r.iconsPending||r.patternsPending)return;const s=new e.fx(a,l,this.lut);for(const i in g){const r=g[i];if(i in t)e.fy(r,t[i],this.showCollisionBoxes,n,this.tileID.canonical,this.tileZoom,this.projection,this.brightness,a,s);else if(r.hasPattern&&(r instanceof e.ba||r instanceof e.bb||r instanceof e.ea)){m(r.layers,this.zoom,v.brightness,n,this.worldview);const e=Object.fromEntries(s.patternPositions);r.addFeatures(v,this.tileID.canonical,e,n,this.tileTransform,this.brightness)}}this.status="done",h(null,{buckets:Object.values(g).filter(e=>!e.isEmpty()),featureIndex:_,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:i.image,lineAtlas:y,imageAtlas:s,brightness:v.brightness})};if(!this.extraShadowCaster){const t=e.fs(v.glyphDependencies,e=>Object.keys(e).map(Number));Object.keys(t).length?o.send("getGlyphs",{uid:this.uid,stacks:t},(e,t)=>
2{i||(i=e,r=t,f())},void 0,!1,d):r={};const n=Array.from(v.iconDependencies.keys()).map(t=>e.I.parse(t));n.length?o.send("getImages",{images:n,source:this.source,scope:this.scope,tileID:this.tileID,type:"icons"},(e,t)=>{i||(i=e,a=new Map,c=this.updateImageMapAndGetImageTaskQueue(a,t,v.iconDependencies),f())},void 0,!1,d):(a=new Map,c=new Map);const s=Array.from(v.patternDependencies.keys()).map(t=>e.I.parse(t));s.length?o.send("getImages",{images:s,source:this.source,scope:this.scope,tileID:this.tileID,type:"patterns"},(e,t)=>{i||(i=e,l=new Map,u=this.updateImageMapAndGetImageTaskQueue(l,t,v.patternDependencies),f())},void 0,!1,d):(l=new Map,u=new Map)}if(v.elevationFeatures&&v.elevationFeatures.length>0){const i=[];for(const t of Object.values(g))if(t instanceof e.bb){const e=t.getUnevaluatedPortalGraph();e&&i.push(e)}const n=e.ft.evaluate(i);for(const i of Object.values(g))if(i instanceof e.bb){const e=t.layers[p.decode(i.sourceLayerIndex)];i.setEvaluatedPortalGraph(n,e,this.tileID.canonical,v.availableImages,v.brightness)}}f()};x.length>0?Promise.allSettled(x).then(w).catch(h):w()}updateParameters(t){this.scaleFactor=t.scaleFactor,this.showCollisionBoxes=t.showCollisionBoxes,this.projection=t.projection,this.brightness=t.brightness,this.tileTransform=e.aZ(t.tileID.canonical,t.projection),this.extraShadowCaster=t.extraShadowCaster,this.lut=t.lut,this.worldview=t.worldview,this.indoor=t.indoor}rasterizeIfNeeded(e,t,i,n){Array.from(t.values()).some(e=>e.usvg)?this.rasterize(e,t,i,n):n()}updateImageMapAndGetImageTaskQueue(e,t,i){const n=new Map;for(const r of t.keys()){const o=i.get(r)||[];for(const i of o){const r=i.toString(),o=t.get(i.id.toString());o.usvg?n.has(r)||(n.set(r,i),e.set(r,Object.assign({},o))):e.set(r,o)}}return n}rasterize(e,t,i,n){this.rasterizeTask=e.send("rasterizeImages",{scope:this.scope,tasks:i},(e,i)=>{if(!e)for(const[e,n]of i.entries()){const i=Object.assign(t.get(e),{data:n});t.set(e,i)}n()})}cancelRasterize(){this.rasterizeTask&&this.rasterizeTask.cancel()}}function m(t,i,n,r,o){const s=new e.ac(i,{brightness:n,worldview:o});for(const e of t)e.recalculate(s,r)}class _ extends e.E{constructor(t,i,n,r,o,s,a){super(),this.actor=t,this.layerIndex=i,this.availableImages=n,this.availableModels=r,this.loadVectorData=s||e.aL,this.loading={},this.loaded={},this.deduped=new e.aK(t.scheduler),this.isSpriteLoaded=o,this.scheduler=t.scheduler,this.brightness=a}loadTile(i,n){const r=i.uid,o=i&&i.request,s=o&&o.collectResourceTiming,a=this.loading[r]=new p(i);a.abort=this.loadVectorData(i,(l,c)=>{const u=!this.loading[r];if(delete this.loading[r],a.cancelRasterize(),u||l||!c)return a.status="done",u||(this.loaded[r]=a),n(l);const h=c.rawData,d={},f=e.aM(c.responseHeaders);f&&f.expires&&(d.expires=f.expires),f&&f.cacheControl&&(d.cacheControl=f.cacheControl),a.vectorTile=c.vectorTile||new e.fz(new e.bt(h));const p=()=>{a.parse(a.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,(e,i)=>{if(e||!i)return n(e);const r={};if(s){const e=t(o);e.length>0&&(r.resourceTiming=JSON.parse(JSON.stringify(e)))}n(null,Object.assign({rawTileData:h.slice(0),responseHeaders:c.responseHeaders},i,d,r))})};this.isSpriteLoaded?p():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(p,{type:"parseTile",isSymbolTile:i.isSymbolTile,zoom:i.tileZoom}):p()}),this.loaded=this.loaded||{},this.loaded[r]=a})}reloadTile(e,t){const i=this.loaded,n=e.uid;if(i&&i[n]){const r=i[n];r.updateParameters(e);const o=(e,i)=>{const n=r.reloadCallback;n&&(delete r.reloadCallback,r.parse(r.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,n)),t(e,i)};"parsing"===r.status?r.reloadCallback=o:"done"===r.status&&(r.vectorTile?r.parse(r.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,o):o())}else t(null,void 0)}abortTile(e,t){const i=e.uid,n=this.loading[i];n&&(n.abort&&n.abort(),delete this.loading[i]),t()}removeTile(e,t){const i=this.loaded,n=e.uid;i&&i[n]&&delete i[n],t()}}class g{loadTile(t,i){const{uid:n,encoding:r,rawImageData:o,padding:s}=t,a=ImageBitmap&&o instanceof ImageBitmap?this.getImageData(o,s):o;i(null,new e.fA(n,a,r,s<1))}reloadTile(e,t){t(null,null)}abortTile(e,t){t()}removeTile(e,t){t()}getImageData(e,t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);const i=this.offscreenCanvasContext.getImageData(-t,-t,e.width+2*t,e.height+2*t);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),i}}e.bs.setPbf(e.bt);class y{constructor(t){this._mrt=new e.bs(t.partial?30:1/0),this._isHeaderLoaded=!1,this.uid=t.uid,this.tileID=t.tileID,this.source=t.source}
2parse(t,i){const n=this._mrt;this.status="parsing",this._entireBuffer=t;try{n.parseHeader(t),this._isHeaderLoaded=!0;const r=[];for(const i in n.layers){const o=n.getLayer(i),s=o.getDataRange(o.getBandList()),a=n.createDecodingTask(s),l=t.slice(s.firstByte,s.lastByte+1),c=e.bs.performDecoding(l,a).then(e=>a.complete(null,e)).catch(e=>a.complete(e,null));r.push(c)}Promise.allSettled(r).then(()=>i(null,n)).catch(e=>i(e))}catch(e){i(e)}}}class v{constructor(e){this.actor=e,this.loading={},this.loaded={}}loadTile(t,i){const n=t.uid,r=t.request,o=this.loading[n]=new y(t),{cancel:s}=e.bu(r,(e,t,r)=>{const s=!this.loading[n];if(delete this.loading[n],s||e||!t)return o.status="done",s||(this.loaded[n]=o),i(e);o.parse(t,(e,t)=>{if(e||!t)return i(e);i(null,t,r)}),this.loaded[n]=o});o.abort=s}reloadTile(e,t){t(null,void 0)}abortTile(e,t){const i=e.uid,n=this.loading[i];n&&(n.abort&&n.abort(),delete this.loading[i]),t()}removeTile(e,t){const i=e.uid;this.loaded[i]&&delete this.loaded[i],t()}decodeRasterArray(t,i){e.bs.performDecoding(t.buffer,t.task).then(e=>i(null,e)).catch(e=>i(e))}}const x=e.fB.prototype.toGeoJSON;class b{constructor(t){this._feature=t,this.extent=e.al,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))}loadGeometry(){if(1===this._feature.type){const t=[];for(const i of this._feature.geometry)t.push([new e.P(i[0],i[1])]);return t}{const t=[];for(const i of this._feature.geometry){const n=[];for(const t of i)n.push(new e.P(t[0],t[1]));t.push(n)}return t}}toGeoJSON(e,t,i){return x.call(this,e,t,i)}}class w{constructor(t,i){this.name=t,this.extent=e.al,this.length=i.length,this._jsonFeatures=i}feature(e){return new b(this._jsonFeatures[e])}}class T{constructor(t){this.layers={},this.extent=e.al;for(const e of Object.keys(t))this.layers[e]=new w(e,t[e])}}const S=64/4096;class E{constructor(){this.features=new Map}clear(){this.features.clear()}load(e=[],t){for(const i of e){const e=i.id;if(null==e)continue;let n=this.features.get(e);n&&this.updateCache(n,t),i.geometry?(n=A(i),this.updateCache(n,t),this.features.set(e,n)):this.features.delete(e),this.updateCache(n,t)}}updateCache(e,t){for(const{canonical:i,uid:n}of Object.values(t)){const{z:r,x:o,y:s}=i;I(e,Math.pow(2,r),o,s)&&delete t[n]}}getTile(e,t,i){const n=Math.pow(2,e),r=[];for(const e of this.features.values())I(e,n,t,i)&&r.push(D(e,n,t,i));return{features:r}}getFeatures(){return[...this.features.values()]}}function I({minX:e,minY:t,maxX:i,maxY:n},r,o,s){return e<(o+1+S)/r&&t<(s+1+S)/r&&i>(o-S)/r&&n>(s-S)/r}function A(e){const{id:t,geometry:i,properties:n}=e;if(!i)return;if("GeometryCollection"===i.type)throw new Error("GeometryCollection not supported in dynamic mode.");const{type:r,coordinates:o}=i,s={id:t,type:1,geometry:[],tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},a=s.geometry;if("Point"===r)M(o,a,s);else if("MultiPoint"===r)for(const e of o)M(e,a,s);else if("LineString"===r)s.type=2,C(o,a,s);else if("MultiLineString"===r)s.type=2,P(o,a,s);else if("Polygon"===r)s.type=3,P(o,a,s,!0);else{if("MultiPolygon"!==r)throw new Error("Input data is not a valid GeoJSON object.");s.type=3;for(const e of o)P(e,a,s,!0)}return s}function M([t,i],n,r){const o=e.aF(t);let s=e.aJ(i);s=s<0?0:s>1?1:s,n.push(o,s),r.minX=Math.min(r.minX,o),r.minY=Math.min(r.minY,s),r.maxX=Math.max(r.maxX,o),r.maxY=Math.max(r.maxY,s)}function C(e,t,i,n=!1,r=!1){const o=[];for(const t of e)M(t,o,i);t.push(o),n&&function(e,t){let i=0;for(let t=0,n=e.length,r=n-2;t<n;r=t,t+=2)i+=(e[t]-e[r])*(e[t+1]+e[r+1]);if(i>0===t)for(let t=0,i=e.length;t<i/2;t+=2){const n=e[t],r=e[t+1];e[t]=e[i-2-t],e[t+1]=e[i-1-t],e[i-2-t]=n,e[i-1-t]=r}}(o,r)}function P(e,t,i,n=!1){for(let r=0;r<e.length;r++)C(e[r],t,i,n,0===r)}function D(t,i,n,r){const{id:o,type:s,geometry:a,tags:l}=t,c=[];if(1===s)!function(t,i,n,r,o){for(let s=0;s<t.length;s+=2){const a=Math.round(e.al*(t[s+0]*i-n)),l=Math.round(e.al*(t[s+1]*i-r));o.push([a,l])}}(a,i,n,r,c);else if(2===s)for(const e of a)R(e,i,n,r,c);else if(3===s)for(const e of a)L(e,i,n,r,c);return{id:o,type:s,geometry:c,tags:l}}function R(t,i,n,r,o){const s=-128,a=e.al+128;let l;for(let c=0;c<t.length-2;c+=2){let u=Math.round(e.al*(t[c+0]*i-n)),h=Math.round(e.al*(t[c+1]*i-r)),d=Math.round(e.al*(t[c+2]*i-n)),f=Math.round(e.al*(t[c+3]*i-r));const p=d-u,m=f-h;u<s&&d<s||(u<s?(h+=Math.round(m*((s-u)/p)),u=s):d<s&&(f=h+Math.round(m*((s-u)/p)),d=s),h<s&&f<s||(h<s?(u+=Math.round(p*((s-h)/m)),h=s):f<s&&(d=u+Math.round(p*((s-h)/m)),f=s),u>=a&&d>=a||(u>=a?(h+=Math.round(m*((a-u)/p)),u=a):d>=a&&(f=h+Math.round(m*((a-u)/p)),d=a),h>=a&&f>=a||(h>=a?(u+=Math.round(p*((a-h)/m)),h=a):f>=a&&(d=u+Math.round(p*((a-h)/m)),f=a),l&&u===l[l.length-1][0]&&h===l[l.length-1][1]||(l=[[u,h]],o.push(l)),l.push([d,f])))))}}function L(t,i,n,r,o){const s=(n-S)/i,a=(r-S)/i,l=(n+1+S)/i,c=(r+1+S)/i;function u(e,t){let i=0;return e<s?i|=1:e>l&&(i|=2),t<a?i|=4:t>c&&(i|=8),i}let h=[];for(let e=1;e<=8;e*=2){let i=t[t.length-2],n=t[t.length-1],r=!(u(i,n)&e);for(let o=0;o<t.length;o+=2){const d=t[o],f=t[o+1],p=!(u(d,f)&e);p!==r&&(8&e?h.push(i+(d-i)*(c-n)/(f-n),c):4&e?h.push(i+(d-i)*(a-n)/(f-n),a):2&e?h.push(l,n+(f-n)*(l-i)/(d-i)):1&e&&h.push(s,n+(f-n)*(s-i)/(d-i))),p&&h.push(d,f),i=d,n=f,r=p}if(!(t=h).length||8===e)break;h=[]}const d=[];for(let t=0;t<h.length;t+=2)d.push([Math.round(e.al*(h[t]*i-n)),Math.round(e.al*(h[t+1]*i-r))]);o.push(d)}function z({name:t,features:i},n){n.writeStringField(1,t),n.writeVarintField(5,e.al);const r=new Map,o=new Map,s={keys:r,values:o,feature:null};for(const e of i)s.feature=e,n.writeMessage(2,O,s);for(const e of r.keys())n.writeStringField(3,e);for(const e of o.keys())n.writeMessage(4,V,e)}function O(e,t){const i=e.feature;void 0!==i.id&&Number.isSafeInteger(+i.id)&&t.writeVarintField(1,+i.id),i.tags&&t.writeMessage(2,F,e),t.writeVarintField(3,i.type),t.writeMessage(4,N,i)}function F({keys:e,values:t,feature:i},n){for(const r of Object.keys(i.tags)){let o=i.tags[r];if(null===o)continue;let s=e.get(r);void 0===s&&(s=e.size,e.set(r,s)),n.writeVarint(s);const a=typeof o;"string"!==a&&"boolean"!==a&&"number"!==a&&(o=JSON.stringify(o));let l=t.get(o);void 0===l&&(l=t.size,t.set(o,l)),n.writeVarint(l)}}function k(e,t){return(t<<3)+(7&e)}function B(e){return e<<1^e>>31}function N(e,t){const{geometry:i,type:n}=e;let r=0,o=0;if(1===n){t.writeVarint(k(1,i.length));for(const e of i){const i=e[0]-r,n=e[1]-o;t.writeVarint(B(i)),t.writeVarint(B(n)),r+=i,o+=n}}else for(const e of i){t.writeVarint(k(1,1));const i=e.length-(3===n?1:0);for(let n=0;n<i;n++){1===n&&t.writeVarint(k(2,i-1));const s=e[n][0]-r,a=e[n][1]-o;t.writeVarint(B(s)),t.writeVarint(B(a)),r+=s,o+=a}3===n&&t.writeVarint(k(7,1))}}function V(e,t){const i=typeof e;"string"===i?t.writeStringField(1,e):"boolean"===i?t.writeBooleanField(7,e):"number"===i&&(e%1!=0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e))}const U={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},j=Math.fround||(G=new Float32Array(1),e=>(G[0]=+e,G[0]));var G;class q{constructor(e){this.options=Object.assign(Object.create(U),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:t,minZoom:i,maxZoom:n}=this.options;t&&console.time("total time");const r=`prepare ${e.length} points`;t&&console.time(r),this.points=e;const o=[];for(let t=0;t<e.length;t++){const i=e[t];if(!i.geometry)continue;const[n,r]=i.geometry.coordinates,s=j(W(n)),a=j(Z(r));o.push(s,a,1/0,t,-1,1),this.options.reduce&&o.push(0)}let s=this.trees[n+1]=this._createTree(o);t&&console.timeEnd(r);for(let e=n;e>=i;e--){const i=+Date.now();s=this.trees[e]=this._createTree(this._cluster(s,e)),t&&console.log("z%d: %d clusters in %dms",e,s.numItems,+Date.now()-i)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let i=((e[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,e[1]));let r=180===e[2]?180:((e[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)i=-180,r=180;else if(i>r){const e=this.getClusters([i,n,180,o],t),s=this.getClusters([-180,n,r,o],t);return e.concat(s)}const s=this.trees[this._limitZoom(t)],a=s.range(W(i),Z(o),W(r),Z(n)),l=s.data,c=[];for(const e of a){const t=this.stride*e;c.push(l[t+5]>1?H(l,t,this.clusterProps):this.points[l[t+3]])}return c}getChildren(e){const t=this._getOriginId(e),i=this._getOriginZoom(e),n="No cluster with the specified id.",r=this.trees[i];if(!r)throw new Error(n);const o=r.data;if(t*this.stride>=o.length)throw new Error(n);const s=this.options.radius/(this.options.extent*Math.pow(2,i-1)),a=r.within(o[t*this.stride],o[t*this.stride+1],s),l=[];for(const t of a){const i=t*this.stride;o[i+4]===e&&l.push(o[i+5]>1?H(o,i,this.clusterProps):this.points[o[i+3]])}if(0===l.length)throw new Error(n);return l}getLeaves(e,t,i){const n=[];return this._appendLeaves(n,e,t=t||10,i=i||0,0),n}getTile(e,t,i){const n=this.trees[this._limitZoom(e)],r=Math.pow(2,e),{extent:o,radius:s}=this.options,a=s/o,l=(i-a)/r,c=(i+1+a)/r,u={features:[]};return this._addTileFeatures(n.range((t-a)/r,l,(t+1+a)/r,c),n.data,t,i,r,u),0===t&&this._addTileFeatures(n.range(1-a/r,l,1,c),n.data,r,i,r,u),t===r-1&&this._addTileFeatures(n.range(0,l,a/r,c),n.data,-1,i,r,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const i=this.getChildren(e);if(t++,1!==i.length)break;e=i[0].properties.cluster_id}return t}_appendLeaves(e,t,i,n,r){const o=this.getChildren(t);for(const t of o){const o=t.properties;if(o&&o.cluster?r+o.point_count<=n?r+=o.point_count:r=this._appendLeaves(e,o.cluster_id,i,n,r):r<n?r++:e.push(t),e.length===i)break}return r}_createTree(t){const i=new e.c4(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let e=0;e<t.length;e+=this.stride)i.add(t[e],t[e+1]);return i.finish(),i.data=t,i}_addTileFeatures(e,t,i,n,r,o){for(const s of e){const e=s*this.stride,a=t[e+5]>1;let l,c,u;if(a)l=$(t,e,this.clusterProps),c=t[e],u=t[e+1];else{const i=this.points[t[e+3]];l=i.properties;const[n,r]=i.geometry.coordinates;c=W(n),u=Z(r)}const h={type:1,geometry:[[Math.round(this.options.extent*(c*r-i)),Math.round(this.options.extent*(u*r-n))]],tags:l};let d;d=a||this.options.generateId?t[e+3]:this.points[t[e+3]].id,void 0!==d&&(h.id=d),o.features.push(h)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const{radius:i,extent:n,reduce:r,minPoints:o}=this.options,s=i/(n*Math.pow(2,t)),a=e.data,l=[],c=this.stride;for(let i=0;i<a.length;i+=c){if(a[i+2]<=t)continue;a[i+2]=t;const n=a[i],u=a[i+1],h=e.within(a[i],a[i+1],s),d=a[i+5];let f=d;for(const e of h){const i=e*c;a[i+2]>t&&(f+=a[i+5])}if(f>d&&f>=o){let e,o=n*d,s=u*d,p=-1;const m=(i/c<<5)+(t+1)+this.points.length;for(const n of h){const l=n*c;if(a[l+2]<=t)continue;a[l+2]=t;const u=a[l+5];o+=a[l]*u,s+=a[l+1]*u,a[l+4]=m,r&&(e||(e=this._map(a,i,!0),p=this.clusterProps.length,this.clusterProps.push(e)),r(e,this._map(a,l)))}a[i+4]=m,l.push(o/f,s/f,1/0,m,-1,f),r&&l.push(p)}else{for(let e=0;e<c;e++)l.push(a[i+e]);if(f>1)for(const e of h){const i=e*c;if(!(a[i+2]<=t)){a[i+2]=t;for(let e=0;e<c;e++)l.push(a[i+e])}}}}return l}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,i){if(e[t+5]>1){const n=this.clusterProps[e[t+6]];return i?Object.assign({},n):n}const n=this.points[e[t+3]].properties,r=this.options.map(n);return i&&r===n?Object.assign({},r):r}}function H(e,t,i){return{type:"Feature",id:e[t+3],properties:$(e,t,i),geometry:{type:"Point",coordinates:[(n=e[t],360*(n-.5)),X(e[t+1])]}};var n}function $(e,t,i){const n=e[t+5],r=n>=1e4?`${Math.round(n/1e3)}
2k`:n>=1e3?Math.round(n/100)/10+"k":n,o=e[t+6],s=-1===o?{}:Object.assign({},i[o]);return Object.assign(s,{cluster:!0,cluster_id:e[t+3],point_count:n,point_count_abbreviated:r})}function W(e){return e/360+.5}function Z(e){const t=Math.sin(e*Math.PI/180),i=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return i<0?0:i>1?1:i}function X(e){const t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function Y(e,t,i,n){let r=n;const o=t+(i-t>>1);let s,a=i-t;const l=e[t],c=e[t+1],u=e[i],h=e[i+1];for(let n=t+3;n<i;n+=3){const t=K(e[n],e[n+1],l,c,u,h);if(t>r)s=n,r=t;else if(t===r){const e=Math.abs(n-o);e<a&&(s=n,a=e)}}r>n&&(s-t>3&&Y(e,t,s,n),e[s+2]=r,i-s>3&&Y(e,s,i,n))}function K(e,t,i,n,r,o){let s=r-i,a=o-n;if(0!==s||0!==a){const l=((e-i)*s+(t-n)*a)/(s*s+a*a);l>1?(i=r,n=o):l>0&&(i+=s*l,n+=a*l)}return s=e-i,a=t-n,s*s+a*a}function J(e,t,i,n){const r={id:e??null,type:t,geometry:i,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===t||"MultiPoint"===t||"LineString"===t)Q(r,i);else if("Polygon"===t)Q(r,i[0]);else if("MultiLineString"===t)for(const e of i)Q(r,e);else if("MultiPolygon"===t)for(const e of i)Q(r,e[0]);return r}function Q(e,t){for(let i=0;i<t.length;i+=3)e.minX=Math.min(e.minX,t[i]),e.minY=Math.min(e.minY,t[i+1]),e.maxX=Math.max(e.maxX,t[i]),e.maxY=Math.max(e.maxY,t[i+1])}function ee(e,t,i,n){if(!t.geometry)return;const r=t.geometry.coordinates;if(r&&0===r.length)return;const o=t.geometry.type,s=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2);let a=[],l=t.id;if(i.promoteId?l=t.properties[i.promoteId]:i.generateId&&(l=n||0),"Point"===o)te(r,a);else if("MultiPoint"===o)for(const e of r)te(e,a);else if("LineString"===o)ie(r,a,s,!1);else if("MultiLineString"===o){if(i.lineMetrics){for(const i of r)a=[],ie(i,a,s,!1),e.push(J(l,"LineString",a,t.properties));return}ne(r,a,s,!1)}else if("Polygon"===o)ne(r,a,s,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(const r of t.geometry.geometries)ee(e,{id:l,geometry:r,properties:t.properties},i,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const e of r){const t=[];ne(e,t,s,!0),a.push(t)}}e.push(J(l,o,a,t.properties))}function te(e,t){t.push(re(e[0]),oe(e[1]),0)}function ie(e,t,i,n){let r,o,s=0;for(let i=0;i<e.length;i++){const a=re(e[i][0]),l=oe(e[i][1]);t.push(a,l,0),i>0&&(s+=n?(r*l-a*o)/2:Math.sqrt(Math.pow(a-r,2)+Math.pow(l-o,2))),r=a,o=l}const a=t.length-3;t[2]=1,Y(t,0,a,i),t[a+2]=1,t.size=Math.abs(s),t.start=0,t.end=t.size}function ne(e,t,i,n){for(let r=0;r<e.length;r++){const o=[];ie(e[r],o,i,n),t.push(o)}}function re(e){return e/360+.5}function oe(e){const t=Math.sin(e*Math.PI/180),i=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return i<0?0:i>1?1:i}function se(e,t,i,n,r,o,s,a){if(n/=t,o>=(i/=t)&&s<n)return e;if(s<i||o>=n)return null;const l=[];for(const t of e){const e=t.geometry;let o=t.type;const s=0===r?t.minX:t.minY,c=0===r?t.maxX:t.maxY;if(s>=i&&c<n){l.push(t);continue}if(c<i||s>=n)continue;let u=[];if("Point"===o||"MultiPoint"===o)ae(e,u,i,n,r);else if("LineString"===o)le(e,u,i,n,r,!1,a.lineMetrics);else if("MultiLineString"===o)ue(e,u,i,n,r,!1);else if("Polygon"===o)ue(e,u,i,n,r,!0);else if("MultiPolygon"===o)for(const t of e){const e=[];ue(t,e,i,n,r,!0),e.length&&u.push(e)}if(u.length){if(a.lineMetrics&&"LineString"===o){for(const e of u)l.push(J(t.id,o,e,t.tags));continue}"LineString"!==o&&"MultiLineString"!==o||(1===u.length?(o="LineString",u=u[0]):o="MultiLineString"),"Point"!==o&&"MultiPoint"!==o||(o=3===u.length?"Point":"MultiPoint"),l.push(J(t.id,o,u,t.tags))}}return l.length?l:null}function ae(e,t,i,n,r){for(let o=0;o<e.length;o+=3){const s=e[o+r];s>=i&&s<=n&&he(t,e[o],e[o+1],e[o+2])}}function le(e,t,i,n,r,o,s){let a=ce(e);const l=0===r?de:fe;let c,u,h=e.start;for(let d=0;d<e.length-3;d+=3){const f=e[d],p=e[d+1],m=e[d+2],_=e[d+3],g=e[d+4],y=0===r?f:p,v=0===r?_:g;let x=!1;s&&(c=Math.sqrt(Math.pow(f-_,2)+Math.pow(p-g,2))),y<i?v>i&&(u=l(a,f,p,_,g,i),s&&(a.start=h+c*u)):y>n?v<n&&(u=l(a,f,p,_,g,n),s&&(a.start=h+c*u)):he(a,f,p,m),v<i&&y>=i&&(u=l(a,f,p,_,g,i),x=!0),v>
vendor: 5,807 bytes, line 2
2n&&y<=n&&(u=l(a,f,p,_,g,n),x=!0),!o&&x&&(s&&(a.end=h+c*u),t.push(a),a=ce(e)),s&&(h+=c)}let d=e.length-3;const f=e[d],p=e[d+1],m=0===r?f:p;m>=i&&m<=n&&he(a,f,p,e[d+2]),d=a.length-3,o&&d>=3&&(a[d]!==a[0]||a[d+1]!==a[1])&&he(a,a[0],a[1],a[2]),a.length&&t.push(a)}function ce(e){const t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function ue(e,t,i,n,r,o){for(const s of e)le(s,t,i,n,r,o,!1)}function he(e,t,i,n){e.push(t,i,n)}function de(e,t,i,n,r,o){const s=(o-t)/(n-t);return he(e,o,i+(r-i)*s,1),s}function fe(e,t,i,n,r,o){const s=(o-i)/(r-i);return he(e,t+(n-t)*s,o,1),s}function pe(e,t){const i=[];for(let n=0;n<e.length;n++){const r=e[n],o=r.type;let s;if("Point"===o||"MultiPoint"===o||"LineString"===o)s=me(r.geometry,t);else if("MultiLineString"===o||"Polygon"===o){s=[];for(const e of r.geometry)s.push(me(e,t))}else if("MultiPolygon"===o){s=[];for(const e of r.geometry){const i=[];for(const n of e)i.push(me(n,t));s.push(i)}}i.push(J(r.id,o,s,r.tags))}return i}function me(e,t){const i=[];i.size=e.size,void 0!==e.start&&(i.start=e.start,i.end=e.end);for(let n=0;n<e.length;n+=3)i.push(e[n]+t,e[n+1],e[n+2]);return i}function _e(e,t){if(e.transformed)return e;const i=1<<e.z,n=e.x,r=e.y;for(const o of e.features){const e=o.geometry,s=o.type;if(o.geometry=[],1===s)for(let s=0;s<e.length;s+=2)o.geometry.push(ge(e[s],e[s+1],t,i,n,r));else for(let s=0;s<e.length;s++){const a=[];for(let o=0;o<e[s].length;o+=2)a.push(ge(e[s][o],e[s][o+1],t,i,n,r));o.geometry.push(a)}}return e.transformed=!0,e}function ge(e,t,i,n,r,o){return[Math.round(i*(e*n-r)),Math.round(i*(t*n-o))]}function ye(e,t,i,n,r){const o=t===r.maxZoom?0:r.tolerance/((1<<t)*r.extent),s={features:[],numPoints:0,numSimplified:0,numFeatures:e.length,source:null,x:i,y:n,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const t of e)ve(s,t,o,r);return s}function ve(e,t,i,n){const r=t.geometry,o=t.type,s=[];if(e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),"Point"===o||"MultiPoint"===o)for(let t=0;t<r.length;t+=3)s.push(r[t],r[t+1]),e.numPoints++,e.numSimplified++;else if("LineString"===o)xe(s,r,e,i,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(let t=0;t<r.length;t++)xe(s,r[t],e,i,"Polygon"===o,0===t);else if("MultiPolygon"===o)for(let t=0;t<r.length;t++){const n=r[t];for(let t=0;t<n.length;t++)xe(s,n[t],e,i,!0,0===t)}if(s.length){let i=t.tags||null;if("LineString"===o&&n.lineMetrics){i={};for(const e in t.tags)i[e]=t.tags[e];i.mapbox_clip_start=r.start/r.size,i.mapbox_clip_end=r.end/r.size}const a={geometry:s,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:i};null!==t.id&&(a.id=t.id),e.features.push(a)}}function xe(e,t,i,n,r,o){const s=n*n;if(n>0&&t.size<(r?s:n))return void(i.numPoints+=t.length/3);const a=[];for(let e=0;e<t.length;e+=3)(0===n||t[e+2]>s)&&(i.numSimplified++,a.push(t[e],t[e+1])),i.numPoints++;r&&function(e,t){let i=0;for(let t=0,n=e.length,r=n-2;t<n;r=t,t+=2)i+=(e[t]-e[r])*(e[t+1]+e[r+1]);if(i>0===t)for(let t=0,i=e.length;t<i/2;t+=2){const n=e[t],r=e[t+1];e[t]=e[i-2-t],e[t+1]=e[i-1-t],e[i-2-t]=n,e[i-1-t]=r}}(a,o),e.push(a)}const be={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class we{constructor(e,t){const i=(t=this.options=function(e,t){for(const i in t)e[i]=t[i];return e}(Object.create(be),t)).debug;if(i&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");let n=function(e,t){const i=[];if("FeatureCollection"===e.type)for(let n=0;n<e.features.length;n++)ee(i,e.features[n],t,n);else ee(i,"Feature"===e.type?e:{geometry:e},t);return i}(e,t);this.tiles={},this.tileCoords=[],i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),n=function(e,t){const i=t.buffer/t.extent;let n=e;const r=se(e,1,-1-i,i,0,-1,2,t),o=se(e,1,1-i,2+i,0,-1,2,t);return(r||o)&&(n=se(e,1,-i,1+i,0,-1,2,t)||[],r&&(n=pe(r,1).concat(n)),o&&(n=n.concat(pe(o,-1)))),n}(n,t),n.length&&this.splitTile(n,0,0,0),i&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(e,t,i,n,r,o,s){const a=[e,t,i,n],l=this.options,c=l.debug;for(;a.length;){n=a.pop(),i=a.pop(),t=a.pop(),e=a.pop();const u=1<<t,h=Te(t,i,n);let d=this.tiles[h];if(!d&&(c>1&&console.time("creation"),d=this.tiles[h]=ye(e,t,i,n,l),this.tileCoords.push({z:t,x:i,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,i,n,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));const e=`z${t}`;this.stats[e]=(this.stats[e]||0)+1,this.total++}if(d.source=e,null==r){if(t===l.indexMaxZoom||d.numPoints<=l.indexMaxPoints)continue}else{if(t===l.maxZoom||t===r)continue;if(null!=r){const e=r-t;if(i!==o>>e||n!==s>>e)continue}}if(d.source=null,0===e.length)continue;c>1&&console.time("clipping");const f=.5*l.buffer/l.extent,p=.5-f,m=.5+f,_=1+f;let g=null,y=null,v=null,x=null,b=se(e,u,i-f,i+m,0,d.minX,d.maxX,l),w=se(e,u,i+p,i+_,0,d.minX,d.maxX,l);e=null,b&&(g=se(b,u,n-f,n+m,1,d.minY,d.maxY,l),y=se(b,u,n+p,n+_,1,d.minY,d.maxY,l),b=null),w&&(v=se(w,u,n-f,n+m,1,d.minY,d.maxY,l),x=se(w,u,n+p,n+_,1,d.minY,d.maxY,l),w=null),c>1&&console.timeEnd("clipping"),a.push(g||[],t+1,2*i,2*n),a.push(y||[],t+1,2*i,2*n+1),a.push(v||[],t+1,2*i+1,2*n),a.push(x||[],t+1,2*i+1,2*n+1)}}getTile(e,t,i){e=+e,t=+t,i=+i;const n=this.options,{extent:r,debug:o}=n;
2if(e<0||e>24)return null;const s=1<<e,a=Te(e,t=t+s&s-1,i);if(this.tiles[a])return _e(this.tiles[a],r);o>1&&console.log("drilling down to z%d-%d-%d",e,t,i);let l,c=e,u=t,h=i;for(;!l&&c>0;)c--,u>>=1,h>>=1,l=this.tiles[Te(c,u,h)];return l&&l.source?(o>1&&(console.log("found parent tile z%d-%d-%d",c,u,h),console.time("drilling down")),this.splitTile(l.source,c,u,h,e,t,i),o>1&&console.timeEnd("drilling down"),this.tiles[a]?_e(this.tiles[a],r):null):null}}function Te(e,t,i){return 32*((1<<e)*i+t)+e}function Se(t,i){const n=t.tileID.canonical;if(!this._geoJSONIndex)return void i(null,null);const r=this._geoJSONIndex.getTile(n.z,n.x,n.y);if(!r)return void i(null,null);const o=e=>e.tags&&"3d_elevation_id"in e.tags&&"source"in e.tags&&"elevation"===e.tags.source,s=r.features.filter(e=>o(e));let a={_geojsonTileLayer:r.features};s.length>0&&(a={_geojsonTileLayer:r.features.filter(e=>!o(e)),hd_road_elevation:s});const l=new T(a),c=function(t){const i=new e.bt;for(const e of Object.keys(t))i.writeMessage(3,z,{name:e,features:t[e]});return i.finish()}(a).buffer;i(null,{vectorTile:l,rawData:c})}class Ee extends _{constructor(e,t,i,n,r,o,s){super(e,t,i,n,r,Se,s),o&&(this.loadGeoJSON=o),this._dynamicIndex=new E}loadData(i,n){const r=i&&i.request,o=r&&r.collectResourceTiming;this._geoJSONIndex=null,this.loadGeoJSON(i,(s,a)=>{if(s||!a)return n(s);if("object"!=typeof a)return n(new Error(`Input data given to '${i.source}' is not a valid GeoJSON object.`));{try{if(i.filter){const t=e.U(i.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===t.result)throw new Error(t.value.map(e=>`${e.key}: ${e.message}`).join(", "));a.features=a.features.filter(e=>t.value.evaluate({zoom:0},e))}i.dynamic?("Feature"===a.type&&(a={type:"FeatureCollection",features:[a]}),i.append||(this._dynamicIndex.clear(),this.loaded={}),this._dynamicIndex.load(a.features,this.loaded),i.cluster&&(a.features=this._dynamicIndex.getFeatures())):this.loaded={},this._geoJSONIndex=i.cluster?new q(function({superclusterOptions:t,clusterProperties:i}){if(!i||!t)return t;const n={},r={},o={accumulated:null,zoom:0},s={properties:null},a=Object.keys(i);for(const t of a){const[o,s]=i[t],a=e.U(s),l=e.U("string"==typeof o?[o,["accumulated"],["get",t]]:o);n[t]=a.value,r[t]=l.value}return t.map=e=>{s.properties=e;const t={};for(const e of a)t[e]=n[e].evaluate(o,s);return t},t.reduce=(e,t)=>{s.properties=t;for(const t of a)o.accumulated=e[t],e[t]=r[t].evaluate(o,s)},t}(i)).load(a.features):i.dynamic?this._dynamicIndex:function(e,t){return new we(e,t)}(a,i.geojsonVtOptions)}catch(e){return n(e)}const s={};if(o){const e=t(r);e&&(s.resourceTiming={},s.resourceTiming[i.source]=JSON.parse(JSON.stringify(e)))}n(null,s)}})}reloadTile(e,t){const i=this.loaded;return i&&i[e.uid]?e.partial?t(null,void 0):super.reloadTile(e,t):this.loadTile(e,t)}loadGeoJSON(t,i){if(t.request)e.m(t.request,i);else{if("string"!=typeof t.data)return i(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`));setTimeout(()=>{try{return i(null,JSON.parse(t.data))}catch(e){return i(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`))}},0)}}getClusterExpansionZoom(e,t){try{t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId))}catch(e){t(e)}}getClusterChildren(e,t){try{t(null,this._geoJSONIndex.getChildren(e.clusterId))}catch(e){t(e)}}getClusterLeaves(e,t){try{t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset))}catch(e){t(e)}}}class Ie{constructor(t,i,n){this.tileID=new e.aQ(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.tileZoom=t.tileZoom,this.uid=t.uid,this.zoom=t.zoom,this.canonical=t.tileID.canonical,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.projection=t.projection,this.brightness=i,this.worldview=n}parse(t,i,n,r){this.status="parsing";const o=new e.aQ(n.tileID.overscaledZ,n.tileID.wrap,n.tileID.canonical.z,n.tileID.canonical.x,n.tileID.canonical.y),s=[],a=i.familiesBySource[n.source],l=new e.fn(o,n.promoteId);l.bucketLayerIDs=[],l.is3DTile=!0,e.fC(t).then(t=>{if(!t)return r(new Error("Could not parse tile"));const i=t.json.extensionsUsed&&t.json.extensionsUsed.includes("MAPBOX_mesh_features")||t.json.asset.extras&&t.json.asset.extras.MAPBOX_mesh_features,c=t.json.extensionsUsed&&t.json.extensionsUsed.includes("EXT_meshopt_compression"),u=new e.ac(this.zoom,{brightness:this.brightness,worldview:this.worldview});for(const r in a)for(const h of a[r]){const r=h[0];
2l.bucketLayerIDs.push(h.map(t=>e.B(t.id,t.scope))),r.recalculate(u,[]);const a=e.fD(t,1/e.d7(n.tileID.canonical)),d=new e.fE(h,a,o,i,c,this.brightness,l,this.worldview);i||(d.needsUpload=!0),s.push(d),d.evaluate(r)}this.status="done",r(null,{buckets:s,featureIndex:l,collisionBoxArray:null,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:null})}).catch(e=>r(new Error(e.message)))}}class Ae{constructor(e,t,i,n,r,o,s,a){this.actor=e,this.layerIndex=t,this.availableImages=i,this.availableModels=n,this.brightness=s,this.loading={},this.loaded={},this.worldview=a}loadTile(t,i){const n=t.uid,r=this.loading[n]=new Ie(t,this.brightness,this.worldview);e.bu(t.request,(e,o)=>{const s=!this.loading[n];return delete this.loading[n],s||e?(r.status="done",s||(this.loaded[n]=r),i(e)):o&&0!==o.byteLength?void r.parse(o,this.layerIndex,t,(e,t)=>{r.status="done",this.loaded=this.loaded||{},this.loaded[n]=r,e||!t?i(e):i(null,t)}):(r.status="done",this.loaded[n]=r,i())})}reloadTile(e,t){const i=this.loaded,n=e.uid;if(i&&i[n]){const r=i[n];r.projection=e.projection,r.brightness=e.brightness;const o=(i,n)=>{r.reloadCallback&&(delete r.reloadCallback,this.loadTile(e,t)),t(i,n)};"parsing"===r.status?r.reloadCallback=o:"done"===r.status&&this.loadTile(e,t)}}abortTile(e,t){const i=e.uid;this.loading[i]&&delete this.loading[i],t()}removeTile(e,t){const i=this.loaded,n=e.uid;i&&i[n]&&delete i[n],t()}}class Me{constructor(t){this.self=t,this.actor=new e.fG(t,this),this.layerIndexes={},this.availableImages={},this.availableModels={},this.isSpriteLoaded={},this.imageRasterizer=new e.x,this.rtlPluginParsingListeners=[],this.projections={},this.defaultProjection=e.cm({name:"mercator"}),this.workerSourceTypes={vector:_,geojson:Ee,"raster-dem":g,"raster-array":v,"batched-model":Ae},this.workerSources={},this.self.registerWorkerSource=(e,t)=>{if(this.workerSourceTypes[e])throw new Error(`Worker source with name "${e}" already registered.`);this.workerSourceTypes[e]=t},this.self.registerRTLTextPlugin=t=>{if(e.fH.isParsed())throw new Error("RTL text plugin already registered.");e.fH.setState({pluginStatus:e.fI.parsed,pluginURL:e.fH.getPluginURL()}),e.fH.applyArabicShaping=t.applyArabicShaping,e.fH.processBidirectionalText=t.processBidirectionalText,e.fH.processStyledBidirectionalText=t.processStyledBidirectionalText;for(const e of this.rtlPluginParsingListeners)e(null,!0);this.rtlPluginParsingListeners=[]}}clearCaches(e,t,i){delete this.layerIndexes[e],delete this.availableImages[e],delete this.availableModels[e],delete this.workerSources[e],i()}checkIfReady(e,t,i){i()}setReferrer(e,t){this.referrer=t}spriteLoaded(t,i){this.isSpriteLoaded[t]||(this.isSpriteLoaded[t]={});const{scope:n,isLoaded:r}=i;if(this.isSpriteLoaded[t][n]=r,this.workerSources[t]&&this.workerSources[t][n])for(const i in this.workerSources[t][n]){const o=this.workerSources[t][n][i];for(const t in o){const i=o[t];i instanceof _&&(i.isSpriteLoaded=r,i.fire(new e.z("isSpriteLoaded")))}}}setImages(e,t,i){this.availableImages[e]||(this.availableImages[e]={});const{scope:n,images:r}=t;if(this.availableImages[e][n]=r,this.workerSources[e]&&this.workerSources[e][n]){for(const t in this.workerSources[e][n]){const i=this.workerSources[e][n][t];for(const e in i)i[e].availableImages=r}i()}else i()}setModels(e,{scope:t,models:i},n){if(this.availableModels[e]||(this.availableModels[e]={}),this.availableModels[e][t]=i,this.workerSources[e]&&this.workerSources[e][t]){for(const n in this.workerSources[e][t]){const r=this.workerSources[e][t][n];for(const e in r)r[e].availableModels=i}n()}else n()}setProjection(t,i){this.projections[t]=e.cm(i)}setBrightness(e,t,i){this.brightness=t,i()}setWorldview(e,t,i){this.worldview=t,i()}setLayers(e,t,i){this.getLayerIndex(e,t.scope).replace(t.layers,t.options),i()}updateLayers(e,t,i){this.getLayerIndex(e,t.scope).update(t.layers,t.removedIds,t.options),i()}loadTile(e,t,i){t.projection=this.projections[e]||this.defaultProjection,this.getWorkerSource(e,t.type,t.source,t.scope).loadTile(t,i)}decodeRasterArray(e,t,i){this.getWorkerSource(e,t.type,t.source,t.scope).decodeRasterArray(t,i)}reloadTile(e,t,i){t.projection=this.projections[e]||this.defaultProjection,this.getWorkerSource(e,t.type,t.source,t.scope).reloadTile(t,i)}abortTile(e,t,i){this.getWorkerSource(e,t.type,t.source,t.scope).abortTile(t,i)}removeTile(e,t,i){this.getWorkerSource(e,t.type,t.source,t.scope).removeTile(t,i)}removeSource(e,t,i){if(!(this.workerSources[e]&&this.workerSources[e][t.scope]&&this.workerSources[e][t.scope][t.type]&&this.workerSources[e][t.scope][t.type][t.source]))return;const n=this.workerSources[e][t.scope][t.type][t.source];delete this.workerSources[e][t.scope][t.type][t.source],void 0!==n.removeSource?n.removeSource(t,i):i()}loadWorkerSource(e,t,i){try{this.self.importScripts(t.url),i()}catch(e){i(e)}}syncRTLPluginState(t,i,n){if(e.fH.isParsed())n(null,!0);else if(e.fH.isParsing())this.rtlPluginParsingListeners.push(n);else try{e.fH.setState(i);const t=e.fH.getPluginURL();!e.fH.isLoaded()||e.fH.isParsed()||e.fH.isParsing()||null==t||(e.fH.setState({pluginStatus:e.fI.parsing,pluginURL:e.fH.getPluginURL()}),this.self.importScripts(t),e.fH.isParsed()?n(null,!0):this.rtlPluginParsingListeners.push(n))}catch(e){n(e)}}setDracoUrl(e,t){this.dracoUrl=t}getAvailableImages(e,t){this.availableImages[e]||(this.availableImages[e]={});let i=this.availableImages[e][t];
2return i||(i=[]),i}getAvailableModels(e,t){this.availableModels[e]||(this.availableModels[e]={});let i=this.availableModels[e][t];return i||(i={}),i}getLayerIndex(e,t){this.layerIndexes[e]||(this.layerIndexes[e]={});let i=this.layerIndexes[e][t];return i||(i=this.layerIndexes[e][t]=new r,i.scope=t),i}getWorkerSource(e,t,i,n){const r=this.workerSources;return r[e]||(r[e]={}),r[e][n]||(r[e][n]={}),r[e][n][t]||(r[e][n][t]={}),this.isSpriteLoaded[e]||(this.isSpriteLoaded[e]={}),r[e][n][t][i]||(r[e][n][t][i]=new this.workerSourceTypes[t]({send:(t,i,n,r,o,s)=>this.actor.send(t,i,n,e,o,s),scheduler:this.actor.scheduler},this.getLayerIndex(e,n),this.getAvailableImages(e,n),this.getAvailableModels(e,n),this.isSpriteLoaded[e][n],void 0,this.brightness,this.worldview)),r[e][n][t][i]}rasterizeImagesWorker(e,t,i){const n=new Map;for(const[i,{image:r,imageVariant:o}]of t.tasks.entries()){const s=this.imageRasterizer.rasterize(o,r,t.scope,e);n.set(i,s)}i(void 0,n)}removeRasterizedImages(e,t,i){this.imageRasterizer.removeImagesFromCacheByIds(t.imageIds,t.scope,e),i()}enforceCacheSizeLimit(t,i){e.fJ(i)}getWorkerPerformanceMetrics(e,t,i){i(void 0,void 0)}}return e.fF(self)&&(self.worker=new Me(self)),Me}),n(0,function(e){var t="3.17.0";const i={create:"create",load:"load",fullLoad:"fullLoad"},n={mark(e){performance.mark(e)},measure(e,t,i){performance.measure(e,t,i)}};function r(t){const i=t.name.split("?")[0];return e.a(i)&&i.includes("mapbox-gl.js")?"javascript":e.a(i)&&i.includes("mapbox-gl.css")?"css":e.b(i)?"fontRange":e.c(i)?"sprite":e.i(i)?"style":e.d(i)?"tilejson":"other"}var o,s={},a=function(){if(o)return s;function e(e){return!t(e)}function t(t){return"undefined"==typeof window||"undefined"==typeof document?"not a browser":function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var e,t,i=new Blob([""],{type:"text/javascript"}),n=URL.createObjectURL(i);try{t=new Worker(n),e=!0}catch(t){e=!1}return t&&t.terminate(),URL.revokeObjectURL(n),e}()?function(){var e=document.createElement("canvas");e.width=e.height=1;var t=e.getContext("2d");if(!t)return!1;var i=t.getImageData(0,0,1,1);return i&&i.width===e.width}()?(void 0===i[n=t&&t.failIfMajorPerformanceCaveat]&&(i[n]=function(t){var i,n=function(t){var i=document.createElement("canvas"),n=Object.create(e.webGLContextAttributes);return n.failIfMajorPerformanceCaveat=t,i.getContext("webgl2",n)}(t);if(!n)return!1;try{i=n.createShader(n.VERTEX_SHADER)}catch(e){return!1}return!(!i||n.isContextLost())&&(n.shaderSource(i,"void main() {}"),n.compileShader(i),!0===n.getShaderParameter(i,n.COMPILE_STATUS))}(n)),i[n]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL2 support"):"insufficient Canvas/getImageData support":"insufficient worker support";var n}o=1,s.supported=e,s.notSupportedReason=t;var i={};return e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0},s}();function l(e,t,i){const n=document.createElement(e);return null!=t&&(n.className=t),i&&i.appendChild(n),n}function c(e,t,i){const n=document.createElementNS("http://www.w3.org/2000/svg",e);for(const e of Object.keys(t))n.setAttributeNS(null,e,String(t[e]));return i&&i.appendChild(n),n}const u="undefined"!=typeof document?document.documentElement&&document.documentElement.style:null,h=u&&void 0!==u.userSelect?"userSelect":"WebkitUserSelect";let d;function f(){u&&h&&(d=u[h],u[h]="none")}function p(){u&&h&&(u[h]=d)}function m(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",m,!0)}function _(){window.addEventListener("click",m,!0),window.setTimeout(()=>{window.removeEventListener("click",m,!0)},0)}function g(e,t){const i=e.getBoundingClientRect();return x(e,i,t)}function y(e,t){const i=e.getBoundingClientRect(),n=[];for(let r=0;r<t.length;r++)n.push(x(e,i,t[r]));return n}function v(e){return/firefox/i.test(navigator.userAgent)&&/macintosh/i.test(navigator.userAgent)&&2===e.button&&e.ctrlKey?0:e.button}function x(t,i,n){const r=t.offsetWidth===i.width?1:t.offsetWidth/i.width;return new e.P((n.clientX-i.left)*r,(n.clientY-i.top)*r)}const b="01",w="NO_ACCESS_TOKEN";class T{constructor(e,t,i){this._transformRequestFn=e,this._customAccessToken=t,this._silenceAuthErrors=!!i,this._createSkuToken()}_createSkuToken(){const e=function(){let e="";for(let t=0;t<10;t++)e+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",b,e].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt}_isSkuTokenExpired(){return Date.now()>this._skuTokenExpiresAt}transformRequest(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}normalizeStyleURL(i,n){if(!e.h(i))return i;const r=E(i);return r.params.push(`sdk=js-${t}`),r.path=`/styles/v1${r.path}`,this._makeAPIURL(r,this._customAccessToken||n)}normalizeGlyphsURL(t,i){if(!e.h(t))return t;const n=E(t);return n.path=`/fonts/v1${n.path}`,this._makeAPIURL(n,this._customAccessToken||i)}normalizeModelURL(t,i){if(!e.h(t))return t;const n=E(t);return n.path=`/models/v1${n.path}`,this._makeAPIURL(n,this._customAccessToken||i)}normalizeSourceURL(t,i,n,r){if(!e.h(t))return t;const o=E(t);return o.path=`/v4/${o.authority}.json`,o.params.push("secure"),n&&o.params.push(`language=${n}`),r&&o.params.push(`worldview=${r}`),this._makeAPIURL(o,this._customAccessToken||i)}normalizeIconsetURL(t,i){const n=E(t);return e.h(t)?(n.path=`/styles/v1${n.path}/iconset.pbf`,this._makeAPIURL(n,this._customAccessToken||i)):I(n)}normalizeSpriteURL(t,i,n,r){const o=E(t);return e.h(t)?(o.path=`/styles/v1${o.path}/sprite${i}${n}`,this._makeAPIURL(o,this._customAccessToken||r)):(o.path+=`${i}${n}`,I(o))}normalizeTileURL(t,i,n){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!e.h(t))return t;const r=E(t);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${i||n&&"raster"!==r.authority&&512===n?"@2x":""}${e.k.supported?".webp":"$1"}`),"raster"===r.authority?r.path=`/${e.e.RASTER_URL_PREFIX}${r.path}`:"rasterarrays"===r.authority?r.path=`/${e.e.RASTERARRAYS_URL_PREFIX}${r.path}`:"3dtiles"===r.authority?r.path=`/${e.e.TILES3D_URL_PREFIX}${r.path}`:(r.path=r.path.replace(/^.+\/v4\//,"/"),r.path=`/${e.e.TILE_URL_VERSION}${r.path}`);const o=this._customAccessToken||function(e){for(const t of e){const e=t.match(/^access_token=(.*)$/);if(e)return e[1]}return null}(r.params)||e.e.ACCESS_TOKEN;return e.e.REQUIRE_ACCESS_TOKEN&&o&&this._skuToken&&r.params.push(`sku=${this._skuToken}`),this._makeAPIURL(r,o)}canonicalizeTileURL(t,i){const n=E(t);if(!n.path.match(/^(\/v4\/|\/(raster|rasterarrays)\/v1\/)/)||!n.path.match(/\.[\w]+$/))return t;let r="mapbox://";n.path.match(/^\/raster\/v1\//)?r+=`raster/${n.path.replace(`/${e.e.RASTER_URL_PREFIX}/`,"")}`:n.path.match(/^\/rasterarrays\/v1\//)?r+=`rasterarrays/${n.path.replace(`/${e.e.RASTERARRAYS_URL_PREFIX}/`,"")}`:r+=`tiles/${n.path.replace(`/${e.e.TILE_URL_VERSION}/`,"")}`;let o=n.params;return i&&(o=o.filter(e=>!e.match(/^access_token=/))),o.length&&(r+=`?${o.join("&")}`),r}canonicalizeTileset(t,i){const n=!!i&&e.h(i),r=[];for(const i of t.tiles||[])e.j(i)?r.push(this.canonicalizeTileURL(i,n)):r.push(i);return r}_makeAPIURL(t,i){const n="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",r=E(e.e.API_URL);if(t.protocol=r.protocol,t.authority=r.authority,"http"===t.protocol){const e=t.params.indexOf("secure");e>=0&&t.params.splice(e,1)}if("/"!==r.path&&(t.path=`${r.path}${t.path}`),!e.e.REQUIRE_ACCESS_TOKEN)return I(t);if(i=i||e.e.ACCESS_TOKEN,!this._silenceAuthErrors){if(!i)throw new Error(`An API access token is required to use Mapbox GL. ${n}`);if("s"===i[0])throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${n}`)}return t.params=t.params.filter(e=>-1===e.indexOf("access_token")),t.params.push(`access_token=${i||""}`),I(t)}}const S=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function E(e){const t=e.match(S);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function I(e){const t=e.params.length?`?${e.params.join("&")}`:"";return`${e.protocol}://${e.authority}${e.path}${t}`}const A="mapbox.eventData";function M(t){if(!t)return null;const i=t.split(".");if(!i||3!==i.length)return null;try{return JSON.parse(e.l(i[1]))}catch(e){return null}}class C{constructor(e){this.type=e,this.anonId=null,this.anonIdTimestamp=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(t){const i=M(e.e.ACCESS_TOKEN);let n="";return n=i&&i.u?e.f(i.u):e.e.ACCESS_TOKEN||"",t?`${A}.${t}:${n}`:`${A}:${n}`}fetchEventData(){const t=e.s("localStorage"),i=this.getStorageKey(),n=this.getStorageKey("uuid"),r=this.getStorageKey("uuidTimestamp");if(t)try{const e=localStorage.getItem(i);e&&(this.eventData=JSON.parse(e));const t=localStorage.getItem(n);t&&(this.anonId=t);const o=localStorage.getItem(r);o&&(this.anonIdTimestamp=Number(o));const s=Date.now()-864e5;(!this.anonIdTimestamp||this.anonIdTimestamp<s)&&this.refreshUUID()}catch(t){e.w("Unable to read from LocalStorage")}}refreshUUID(){this.anonId=e.u(),this.anonIdTimestamp=Date.now()}saveEventData(){const t=e.s("localStorage"),i=this.getStorageKey(),n=this.getStorageKey("uuid"),r=this.getStorageKey("uuidTimestamp"),o=this.anonId,s=this.anonIdTimestamp;if(t&&o)try{localStorage.setItem(n,o),Object.keys(this.eventData).length>=1&&localStorage.setItem(i,JSON.stringify(this.eventData)),s&&localStorage.setItem(r,s.toString())}catch(t){e.w("Unable to write to LocalStorage")}}processRequests(e){}postEvent(t,i,n,r){if(!e.e.EVENTS_URL)return;const o=E(e.e.EVENTS_URL);o.params.push(`access_token=${r||e.e.ACCESS_TOKEN||""}`);const s={event:this.type,created:new Date(t).toISOString()},a=i?Object.assign(s,i):s,l={url:I(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([a])};this.pendingRequest=e.p(l,e=>{this.pendingRequest=null,n(e),this.saveEventData(),this.processRequests(r)})}queueRequest(e,t){this.queue.push(e),this.processRequests(t)}}class P extends C{constructor(e){super("metrics"),e&&(this.data=e)}postMetricsEvent(t){if(!e.e.EVENTS_URL||!t&&!e.e.ACCESS_TOKEN)return;this.anonId||this.fetchEventData(),e.v(this.anonId)||this.refreshUUID();const i=Object.assign({},this.data,{sessionId:this.anonId});this.queueRequest({timestamp:Date.now(),payload:i},t)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:t,payload:i}=this.queue.shift();this.postEvent(t,i,()=>{},e)}}const D=new class extends C{constructor(e){super("appUserTurnstile"),this._customAccessToken=e}postTurnstileEvent(t,i){e.e.EVENTS_URL&&e.e.ACCESS_TOKEN&&Array.isArray(t)&&t.some(t=>e.h(t)||e.j(t))&&this.queueRequest(Date.now(),i)}processRequests(i){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.anonIdTimestamp&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const n=M(e.e.ACCESS_TOKEN),r=n?n.u:e.e.ACCESS_TOKEN;let o=r!==this.eventData.tokenU;e.v(this.anonId)||(this.refreshUUID(),o=!0);const s=this.queue.shift();if(this.eventData.lastSuccess){const e=new Date(this.eventData.lastSuccess),t=new Date(s),i=(s-this.eventData.lastSuccess)/864e5;o=o||i>=1||i<-1||e.getDate()!==t.getDate()}else o=!0;o?this.postEvent(s,{sdkIdentifier:"mapbox-gl-js",sdkVersion:t,skuId:b,"enabled.telemetry":!1,userId:this.anonId},e=>{e||(this.eventData.lastSuccess=s,this.eventData.tokenU=r)},i):this.processRequests()}},R=D.postTurnstileEvent.bind(D),L=new class extends C{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(t,i,n,r){this.skuToken=i,this.errorCb=r,e.e.EVENTS_URL&&(n||e.e.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},n):this.errorCb(new Error(w)))}processRequests(i){if(this.pendingRequest||0===this.queue.length)return;const{id:n,timestamp:r}=this.queue.shift();n&&this.success[n]||(this.anonId&&this.anonIdTimestamp||this.fetchEventData(),e.v(this.anonId)||this.refreshUUID(),this.postEvent(r,{sdkIdentifier:"mapbox-gl-js",sdkVersion:t,skuId:b,skuToken:this.skuToken,userId:this.anonId},e=>{e?this.errorCb(e):n&&(this.success[n]=!0)},i))}remove(){this.errorCb=null}},z=L.postMapLoadEvent.bind(L),O=new class extends C{constructor(){super("style.load"),this.eventIdPerMapInstanceMap=new Map,this.mapInstanceIdMap=new WeakMap}getMapInstanceId(t){let i=this.mapInstanceIdMap.get(t);
2return i||(i=e.u(),this.mapInstanceIdMap.set(t,i)),i}getEventId(e){const t=this.eventIdPerMapInstanceMap.get(e)||0;return this.eventIdPerMapInstanceMap.set(e,t+1),t}postStyleLoadEvent(t,i){const{map:n,style:r,importedStyles:o}=i;if(!e.e.EVENTS_URL||!t&&!e.e.ACCESS_TOKEN)return;const s=this.getMapInstanceId(n),a={mapInstanceId:s,eventId:this.getEventId(s),style:r};o.length&&(a.importedStyles=o),this.queueRequest({timestamp:Date.now(),payload:a},t)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:t,payload:i}=this.queue.shift();this.postEvent(t,i,()=>{},e)}},F=O.postStyleLoadEvent.bind(O),k=new P({attributes:[{name:"maps/js/layer-animations/style-with-appearances"}]}),B=k.postMetricsEvent.bind(k),N=new P({attributes:[{name:"maps/js/layer-animations/runtime-appearances"}]}),V=N.postMetricsEvent.bind(N),U=new class extends C{constructor(){super("gljs.performance")}postPerformanceEvent(t,i){e.e.EVENTS_URL&&(t||e.e.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:i},t)}processRequests(n){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:o,performanceData:s}=this.queue.shift(),a=function(n){const o=performance.getEntriesByType("resource"),s=performance.getEntriesByType("mark"),a=function(e){const t={};if(e)for(const i in e)if("other"!==i)for(const n of e[i]){const e=`${i}ResolveRangeMin`,r=`${i}ResolveRangeMax`,o=`${i}RequestCount`,s=`${i}RequestCachedCount`;t[e]=Math.min(t[e]||1/0,n.startTime),t[r]=Math.max(t[r]||-1/0,n.responseEnd);const a=e=>{void 0===t[e]&&(t[e]=0),++t[e]};void 0!==n.transferSize&&0===n.transferSize&&a(s),a(o)}return t}(function(e,t){const i={};if(e)for(const n of e){const e=t(n);void 0===i[e]&&(i[e]=[]),i[e].push(n)}return i}(o,r)),l=window.devicePixelRatio,c=navigator.connection||navigator.mozConnection||navigator.webkitConnection,u=c?c.effectiveType:void 0,h={counters:[],metadata:[],attributes:[]},d=(e,t,i)=>{null!=i&&e.push({name:t,value:i.toString()})};for(const e in a)d(h.counters,e,a[e]);if(n.interactionRange[0]!==1/0&&n.interactionRange[1]!==-1/0&&(d(h.counters,"interactionRangeMin",n.interactionRange[0]),d(h.counters,"interactionRangeMax",n.interactionRange[1])),s)for(const e of Object.values(i)){const t=s.find(t=>t.name===e);t&&d(h.counters,e,t.startTime)}return d(h.counters,"visibilityHidden",n.visibilityHidden),d(h.attributes,"style",function(t){if(t)for(const i of t){const t=i.name.split("?")[0];if(e.i(t)){const e=t.split("/").slice(-2);if(2===e.length)return`mapbox://styles/${e[0]}/${e[1]}`}}}(o)),d(h.attributes,"terrainEnabled",n.terrainEnabled?"true":"false"),d(h.attributes,"fogEnabled",n.fogEnabled?"true":"false"),d(h.attributes,"projection",n.projection),d(h.attributes,"zoom",n.zoom),d(h.metadata,"devicePixelRatio",l),d(h.metadata,"connectionEffectiveType",u),d(h.metadata,"navigatorUserAgent",navigator.userAgent),d(h.metadata,"screenWidth",window.screen.width),d(h.metadata,"screenHeight",window.screen.height),d(h.metadata,"windowWidth",window.innerWidth),d(h.metadata,"windowHeight",window.innerHeight),d(h.metadata,"mapWidth",n.width/l),d(h.metadata,"mapHeight",n.height/l),d(h.metadata,"webglRenderer",n.renderer),d(h.metadata,"webglVendor",n.vendor),d(h.metadata,"sdkVersion",t),d(h.metadata,"sdkIdentifier","mapbox-gl-js"),h}(s);for(const e of a.metadata);for(const e of a.counters);for(const e of a.attributes);this.postEvent(o,a,()=>{},n)}},j=U.postPerformanceEvent.bind(U),G=new class extends C{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(t,i,n,r){if(!e.e.API_URL||!e.e.SESSION_PATH)return;const o=E(e.e.API_URL+e.e.SESSION_PATH);o.params.push(`sku=${i||""}`),o.params.push(`access_token=${r||e.e.ACCESS_TOKEN||""}`);const s={url:I(o),headers:{"Content-Type":"text/plain"}};this.pendingRequest=e.g(s,e=>{this.pendingRequest=null,n(e),this.saveEventData(),this.processRequests(r)})}getSessionAPI(t,i,n,r){this.skuToken=i,this.errorCb=r,e.e.SESSION_PATH&&e.e.API_URL&&(n||e.e.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},n):this.errorCb(new Error(w)))}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{id:t,timestamp:i}=this.queue.shift();
2t&&this.success[t]||this.getSession(i,this.skuToken,e=>{e?this.errorCb(e):t&&(this.success[t]=!0)},e)}remove(){this.errorCb=null}},q=G.getSessionAPI.bind(G),H=new Set;function $(e,t){t?H.add(e):H.delete(e)}class W{constructor(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps=new Set,this._updatedImages={}}isDirty(){return this._changed}setDirty(){this._changed=!0}getUpdatedSourceCaches(){return this._updatedSourceCaches}updateSourceCache(e,t){this._updatedSourceCaches[e]=t,this.setDirty()}discardSourceCacheUpdate(e){delete this._updatedSourceCaches[e]}updateLayer(e){const t=e.scope;this._updatedLayers[t]=this._updatedLayers[t]||new Set,this._updatedLayers[t].add(e.id),this.setDirty()}removeLayer(e){const t=e.scope;this._removedLayers[t]=this._removedLayers[t]||{},this._updatedLayers[t]=this._updatedLayers[t]||new Set,this._removedLayers[t][e.id]=e,this._updatedLayers[t].delete(e.id),this._updatedPaintProps.delete(e.fqid),this.setDirty()}getRemovedLayer(e){return this._removedLayers[e.scope]?this._removedLayers[e.scope][e.id]:null}discardLayerRemoval(e){this._removedLayers[e.scope]&&delete this._removedLayers[e.scope][e.id]}getLayerUpdatesByScope(){const e={};for(const t in this._updatedLayers)e[t]=e[t]||{},e[t].updatedIds=Array.from(this._updatedLayers[t].values());for(const t in this._removedLayers)e[t]=e[t]||{},e[t].removedIds=Object.keys(this._removedLayers[t]);return e}getUpdatedPaintProperties(){return this._updatedPaintProps}updatePaintProperties(e){this._updatedPaintProps.add(e.fqid),this.setDirty()}getUpdatedImages(e){return this._updatedImages[e]?Array.from(this._updatedImages[e].values()):[]}updateImage(t,i){this._updatedImages[i]=this._updatedImages[i]||new Set,this._updatedImages[i].add(e.I.toString(t)),this.setDirty()}resetUpdatedImages(e){this._updatedImages[e]&&this._updatedImages[e].clear()}reset(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps.clear(),this._updatedImages={}}}function Z(e){const{userImage:t}=e;return!!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}class X extends e.E{constructor(t){super(),this.imageProviders=new Map,this.images=new Map,this.updatedImages=new Map,this.callbackDispatchedThisFrame=new Map,this.loaded=new Map,this.requestors=[],this.patterns=new Map,this.patternsInFlight=new Set,this.atlasImage=new Map,this.atlasTexture=new Map,this.dirty=!0,this.spriteFormat=t,"raster"!==t&&e.r()&&(this.imageRasterizerDispatcher=new e.D(e.t(),this,"Image Rasterizer Worker",1))}addScope(t){this.loaded.set(t,!1),this.imageProviders.set(t,new Map),this.images.set(t,new Map),this.updatedImages.set(t,new Set),this.callbackDispatchedThisFrame.set(t,new Set),this.patterns.set(t,new Map),this.atlasImage.set(t,new e.q({width:1,height:1}))}removeScope(e){this.loaded.delete(e),this.imageProviders.delete(e),this.images.delete(e),this.updatedImages.delete(e),this.callbackDispatchedThisFrame.delete(e),this.patterns.delete(e),this.atlasImage.delete(e);const t=this.atlasTexture.get(e);t&&(t.destroy(),this.atlasTexture.delete(e))}addImageProvider(e,t){this.imageProviders.has(t)||this.imageProviders.set(t,new Map),this.imageProviders.get(t).set(e.id,e)}removeImageProvider(e,t){this.imageProviders.has(t)&&this.imageProviders.get(t).delete(e)}getPendingImageProviders(){const e=[];for(const t of this.imageProviders.values())for(const i of t.values())i.hasPendingRequests()&&e.push(i);return e}get imageRasterizer(){return this._imageRasterizer||(this._imageRasterizer=new e.x),this._imageRasterizer}isLoaded(){for(const e of this.loaded.keys())if(!this.loaded.get(e))return!1;return!0}setLoaded(e,t){if(this.loaded.get(t)!==e&&(this.loaded.set(t,e),e)){for(const{ids:e,callback:i}of this.requestors)this._notify(e,t,i);this.requestors=[]}}hasImage(e,t){return!!this.getImage(e,t)}getImage(e,t){return this.images.get(t).get(e.toString())}addImage(e,t,i){this._validate(e,i)&&this.images.get(t).set(e.toString(),i)}_validate(t,i){let n=!0;return this._validateStretch(i.stretchX,i.data&&i.data.width)||(this.fire(new e.y(new Error(`Image "${t.name}
2" has invalid "stretchX" value`))),n=!1),this._validateStretch(i.stretchY,i.data&&i.data.height)||(this.fire(new e.y(new Error(`Image "${t.name}" has invalid "stretchY" value`))),n=!1),this._validateContent(i.content,i)||(this.fire(new e.y(new Error(`Image "${t.name}" has invalid "content" value`))),n=!1),n}_validateStretch(e,t){if(!e)return!0;let i=0;for(const n of e){if(n[0]<i||n[1]<n[0]||t<n[1])return!1;i=n[1]}return!0}_validateContent(e,t){if(!e)return!0;if(4!==e.length)return!1;if(!t.usvg){if(e[0]<0||t.data.width<e[0])return!1;if(e[1]<0||t.data.height<e[1])return!1;if(e[2]<0||t.data.width<e[2])return!1;if(e[3]<0||t.data.height<e[3])return!1}return!(e[2]<e[0]||e[3]<e[1])}updateImage(e,t,i){const n=this.images.get(t).get(e.toString());i.version=n.version+1,this.images.get(t).set(e.toString(),i),this.updatedImages.get(t).add(e),this.removeFromImageRasterizerCache(e,t)}clearUpdatedImages(e){this.updatedImages.get(e).clear()}removeFromImageRasterizerCache(t,i){"raster"!==this.spriteFormat&&(e.r()?this.imageRasterizerDispatcher.getActor().send("removeRasterizedImages",{imageIds:[t],scope:i}):this.imageRasterizer.removeImagesFromCacheByIds([t],i))}removeImage(e,t){const i=this.images.get(t),n=i.get(e.toString());i.delete(e.toString()),this.patterns.get(t).delete(e.toString()),this.removeFromImageRasterizerCache(e,t),n.userImage&&n.userImage.onRemove&&n.userImage.onRemove()}listImages(t){return Array.from(this.images.get(t).keys()).map(t=>e.I.from(t))}getImages(e,t,i){const n=[],r=[],o=this.imageProviders.get(t);for(const i of e){if(!i.iconsetId){n.push(i);continue}const e=o.get(i.iconsetId);e&&(this.getImage(i,t)?r.push(i):e.addPendingRequest(i))}if(0===n.length)return void this._notify(r,t,i);let s=!0;const a=!!this.loaded.get(t),l=this.images.get(t);if(!a)for(const e of n)l.has(e.toString())||(s=!1);a||s?this._notify(n,t,i):this.requestors.push({ids:n,scope:t,callback:i})}rasterizeImages(e,t){const i=new Map,{tasks:n,scope:r}=e;for(const[e,t]of n.entries()){const n=this.getImage(t.id,r);n&&i.set(e,{image:n,imageVariant:t})}this._rasterizeImages(r,i,t)}_rasterizeImages(t,i,n){if(e.r())this.imageRasterizerDispatcher.getActor().send("rasterizeImagesWorker",{tasks:i,scope:t},n);else{const e=new Map;for(const[n,{image:r,imageVariant:o}]of i.entries())e.set(n,this.imageRasterizer.rasterize(o,r,t,0));n(void 0,e)}}getUpdatedImages(e){return this.updatedImages.get(e)||new Set}_notify(t,i,n){const r=this.images.get(i),o=new Map;for(const i of t){if(!r.get(i.toString())){if(i.iconsetId)continue;this.fire(new e.z("styleimagemissing",{id:i.name}))}const t=r.get(i.toString());if(!t){e.w(`Image "${i.name}" 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.`);continue}const n={data:t.usvg?null:t.data.clone(),pixelRatio:t.pixelRatio,sdf:t.sdf,usvg:t.usvg,version:t.version,stretchX:t.stretchX,stretchY:t.stretchY,content:t.content,hasRenderCallback:Boolean(t.userImage&&t.userImage.render)};t.usvg&&Object.assign(n,{width:t.icon.usvg_tree.width,height:t.icon.usvg_tree.height}),o.set(e.I.toString(i),n)}n(null,o)}getPixelSize(e){const{width:t,height:i}=this.atlasImage.get(e);return{width:t,height:i}}getPattern(t,i,n){const r=t.toString(),o=this.patterns.get(i),s=o.get(r),a=this.getImage(t,i);if(!a)return null;if(s){if(s.position.version===a.version)return s.position;s.position.version=a.version}else{if(a.usvg&&!a.data){const o=this.getPatternInFlightId(r,i);if(this.patternsInFlight.has(o))return null;this.patternsInFlight.add(o);const s=new e.A(t).scaleSelf(e.o.devicePixelRatio),l=new Map([[s.toString(),{image:a,imageVariant:s}]]);return this._rasterizeImages(i,l,(e,t)=>this.storePatternImage(s,i,a,n,t)),null}this.storePattern(t,i,a)}return this._updatePatternAtlas(i,n),o.get(r).position}getPatternInFlightId(t,i){return e.B(t,i)}hasPatternsInFlight(){return 0!==this.patternsInFlight.size}storePatternImage(e,t,i,n,r){const o=e.toString(),s=r?r.get(o):void 0;s&&(i.data=s,this.storePattern(e.id,t,i),this._updatePatternAtlas(t,n),this.patternsInFlight.delete(this.getPatternInFlightId(e.id.toString(),t)))}storePattern(t,i,n){const r={w:n.data.width+2*e.C,h:n.data.height+2*e.C,x:0,y:0},o=new e.F(r,n,e.C);this.patterns.get(i).set(t.toString(),{bin:r,position:o})}destroyAtlasTextures(){for(const e of this.atlasTexture.values())e&&e.destroy();this.atlasTexture.clear()}bind(t,i){const n=t.gl;let r=this.atlasTexture.get(i);r?this.dirty&&(r.update(this.atlasImage.get(i)),this.dirty=!1):(r=new e.T(t,this.atlasImage.get(i),n.RGBA8),this.atlasTexture.set(i,r)),r.bind(n.LINEAR,n.CLAMP_TO_EDGE)}_updatePatternAtlas(t,i){const n=this.patterns.get(t),r=Array.from(n.values()).map(({bin:e})=>e),{w:o,h:s}=e.G(r),a=this.atlasImage.get(t);a.resize({width:o||1,height:s||1});const l=this.images.get(t);for(const[t,{bin:r,position:o}]of n.entries()){let n=o.padding;const s=r.x+n,c=r.y+n,u=l.get(t).data,h=u.width,d=u.height;n=n>
21?n-1:n,e.q.copy(u,a,{x:0,y:0},{x:s,y:c},{width:h,height:d},i),e.q.copy(u,a,{x:0,y:d-n},{x:s,y:c-n},{width:h,height:n},i),e.q.copy(u,a,{x:0,y:0},{x:s,y:c+d},{width:h,height:n},i),e.q.copy(u,a,{x:h-n,y:0},{x:s-n,y:c},{width:n,height:d},i),e.q.copy(u,a,{x:0,y:0},{x:s+h,y:c},{width:n,height:d},i),e.q.copy(u,a,{x:h-n,y:d-n},{x:s-n,y:c-n},{width:n,height:n},i),e.q.copy(u,a,{x:0,y:d-n},{x:s+h,y:c-n},{width:n,height:n},i),e.q.copy(u,a,{x:0,y:0},{x:s+h,y:c+d},{width:n,height:n},i),e.q.copy(u,a,{x:h-n,y:0},{x:s-n,y:c+d},{width:n,height:n},i)}this.dirty=!0}beginFrame(){for(const e of this.images.keys())this.callbackDispatchedThisFrame.set(e,new Set)}dispatchRenderCallbacks(e,t){const i=this.images.get(t);for(const n of e){if(this.callbackDispatchedThisFrame.get(t).has(n.toString()))continue;this.callbackDispatchedThisFrame.get(t).add(n.toString());const e=i.get(n.toString());Z(e)&&this.updateImage(n,t,e)}}destroy(){this.imageRasterizerDispatcher&&this.imageRasterizerDispatcher.remove()}}function Y(t){const i=t.value,n=t.valueSpec,r=t.style,o=t.styleSpec,s=t.key,a=t.arrayElementValidator||ye;if(!Array.isArray(i))return[new e.V(s,i,`array expected, ${e.K(i)} found`)];if(n.length&&i.length!==n.length)return[new e.V(s,i,`array length ${n.length} expected, length ${i.length} found`)];if(n["min-length"]&&i.length<n["min-length"])return[new e.V(s,i,`array length at least ${n["min-length"]} expected, length ${i.length} found`)];let l={type:n.value,values:n.values,minimum:n.minimum,maximum:n.maximum,function:void 0};o.$version<7&&(l.function=n.function),e.H(n.value)&&(l=n.value);let c=[];for(let e=0;e<i.length;e++)c=c.concat(a({array:i,arrayIndex:e,value:i[e],valueSpec:l,style:r,styleSpec:o,key:`${s}[${e}]`},!0));return c}function K(t){const i=t.key,n=t.value,r=t.valueSpec;if(!e.L(n))return[new e.V(i,n,`number expected, ${e.K(n)} found`)];if(n!=n)return[new e.V(i,n,"number expected, NaN found")];if("minimum"in r){let o=r.minimum;if(Array.isArray(r.minimum)&&(o=r.minimum[t.arrayIndex]),n<o)return[new e.V(i,n,`${n} is less than the minimum value ${o}`)]}if("maximum"in r){let o=r.maximum;if(Array.isArray(r.maximum)&&(o=r.maximum[t.arrayIndex]),n>o)return[new e.V(i,n,`${n} is greater than the maximum value ${o}`)]}return[]}function J(t){const i=t.key,n=t.value;if(!e.H(n))return[new e.V(i,n,`object expected, ${e.K(n)} found`)];const r=t.valueSpec,o=e.J(n.type);let s,a,l,c={};const u="categorical"!==o&&void 0===n.property,h=!u,d=function(t){const i=t.stops;return Array.isArray(i)&&Array.isArray(i[0])&&e.H(i[0][0])}(n),f=ve({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new e.V(t.key,t.value,'identity function may not have a "stops" property')];let i=[];const n=t.value;return i=i.concat(Y({key:t.key,value:n,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:p})),Array.isArray(n)&&0===n.length&&i.push(new e.V(t.key,n,"array must have at least one stop")),i},default:function(e){return ye({key:e.key,value:e.value,valueSpec:r,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===o&&u&&f.push(new e.V(t.key,t.value,'missing required property "property"')),"identity"===o||n.stops||f.push(new e.V(t.key,t.value,'missing required property "stops"')),"exponential"===o&&r.expression&&!e.M(r)&&f.push(new e.V(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(h&&!e.N(r)?f.push(new e.V(t.key,t.value,"property functions not supported")):u&&!e.O(r)&&f.push(new e.V(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!d||void 0!==n.property||f.push(new e.V(t.key,t.value,'"property" property is required')),f;function p(t){let i=[];const n=t.value,o=t.key;if(!Array.isArray(n))return[new e.V(o,n,`array expected, ${e.K(n)} found`)];if(2!==n.length)return[new e.V(o,n,`array length 2 expected, length ${n.length} found`)];if(d){if(!e.H(n[0]))return[new e.V(o,n,`object expected, ${e.K(n[0])} found`)];const r=n[0];if(void 0===r.zoom)return[new e.V(o,n,"object stop key must have zoom")];if(void 0===r.value)return[new e.V(o,n,"object stop key must have value")];const s=e.J(r.zoom);if("number"!=typeof s)return[new e.V(o,r.zoom,"stop zoom values must be numbers")];if(l&&l>s)return[new e.V(o,r.zoom,"stop zoom values must appear in ascending order")];s!==l&&(l=s,a=void 0,c={}),i=i.concat(ve({key:`${o}[0]`,value:n[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:K,value:m}}))}else i=i.concat(m({key:`${o}[0]`,value:n[0],style:t.style,styleSpec:t.styleSpec},n));return e.Q(e.S(n[1]))?i.concat([new e.V(`${o}[1]`,n[1],"expressions are not allowed in function stops.")]):i.concat(ye({key:`${o}[1]`,value:n[1],valueSpec:r,style:t.style,styleSpec:t.styleSpec}))}function m(t,i){const n=e.K(t.value),l=e.J(t.value),u=null!==t.value?t.value:i;if(s){if(n!==s)return[new e.V(t.key,u,`${n} stop domain type must match previous stop domain type ${s}`)]}else s=n;if("number"!==n&&"string"!==n&&"boolean"!==n&&"number"!=typeof l&&"string"!=typeof l&&"boolean"!=typeof l)return[new e.V(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==n&&"categorical"!==o){let i=`number expected, ${n} found`;return e.N(r)&&void 0===o&&(i+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new e.V(t.key,u,i)]}return"categorical"!==o||"number"!==n||"number"==typeof l&&isFinite(l)&&Math.floor(l)===l?"categorical"!==o&&"number"===n&&"number"==typeof l&&"number"==typeof a&&void 0!==a&&l<a?[new e.V(t.key,u,"stop domain values must appear in ascending order")]:(a=l,"categorical"===o&&l in c?[new e.V(t.key,u,"stop domain values must be unique")]:(c[l]=!0,[])):[new e.V(t.key,u,`integer expected, found ${String(l)}
2`)]}}function Q(t){const i=("property"===t.expressionContext?e.W:e.U)(e.S(t.value),t.valueSpec);if("error"===i.result)return i.value.map(i=>new e.V(`${t.key}${i.key}`,t.value,i.message));const n=i.value.expression||i.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!n.outputDefined())return[new e.V(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===t.expressionContext&&"layout"===t.propertyType&&!e.Z(n))return[new e.V(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext)return ee(n,t);if("appearance"===t.expressionContext)return te(n,t);if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!e.X(n,["zoom","feature-state"]))return[new e.V(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!e.Y(n))return[new e.V(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function ee(t,i){const n=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(i.valueSpec&&i.valueSpec.expression)for(const e of i.valueSpec.expression.parameters)n.delete(e);if(0===n.size)return[];const r=[];return t instanceof e._&&n.has(t.name)?[new e.V(i.key,i.value,`["${t.name}"] expression is not supported in a filter for a ${i.object.type} layer with id: ${i.object.id}`)]:(t.eachChild(e=>{r.push(...ee(e,i))}),r)}function te(t,i){const n=new Set;if(i.valueSpec&&i.valueSpec.expression)for(const e of i.valueSpec.expression.parameters)n.add(e);if(0===n.size)return[];const r=[];return t instanceof e._&&!n.has(t.name)?[new e.V(i.key,i.value,`["${t.name}"] is not an allowed parameter`)]:(t.eachChild(e=>{r.push(...te(e,i))}),r)}function ie(t){const i=t.key,n=t.value,r=t.valueSpec,o=[];return Array.isArray(r.values)?-1===r.values.indexOf(e.J(n))&&o.push(new e.V(i,n,`expected one of [${r.values.join(", ")}], ${JSON.stringify(n)} found`)):-1===Object.keys(r.values).indexOf(e.J(n))&&o.push(new e.V(i,n,`expected one of [${Object.keys(r.values).join(", ")}], ${JSON.stringify(n)} found`)),o}function ne(t){return e.a2(e.S(t.value))?Q(Object.assign({},t,{expressionContext:"filter",valueSpec:t.styleSpec[`filter_${t.layerType||"fill"}`]})):re(t)}function re(t){const i=t.value,n=t.key;if(!Array.isArray(i))return[new e.V(n,i,`array expected, ${e.K(i)} found`)];if(i.length<1)return[new e.V(n,i,"filter array must have at least 1 element")];const r=t.styleSpec;let o=ie({key:`${n}[0]`,value:i[0],valueSpec:r.filter_operator});const s=()=>{i.length>=2&&(e.a0(i[1])||o.push(new e.V(`${n}[1]`,i[1],`string expected, ${e.K(i[1])} found`)));for(let t=2;t<i.length;t++)"$type"===e.J(i[1])?o=o.concat(ie({key:`${n}[${t}]`,value:i[t],valueSpec:r.geometry_type})):e.a0(i[t])||e.L(i[t])||e.$(i[t])||o.push(new e.V(`${n}[${t}]`,i[t],`string, number, or boolean expected, ${e.K(i[t])} found.`))};switch(e.J(i[0])){case"<":case"<=":case">":case">=":i.length>=2&&"$type"===e.J(i[1])&&o.push(new e.V(n,i,`"$type" cannot be use with operator "${i[0]}"`)),3!==i.length&&o.push(new e.V(n,i,`filter array for operator "${i[0]}" must have 3 elements`)),s();break;case"==":case"!=":3!==i.length&&o.push(new e.V(n,i,`filter array for operator "${i[0]}" must have 3 elements`)),s();break;case"in":case"!in":s();break;case"any":case"all":case"none":for(let e=1;e<i.length;e++)o=o.concat(re({key:`${n}[${e}]`,value:i[e],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":2!==i.length?o.push(new e.V(n,i,`filter array for "${i[0]}" operator must have 2 elements`)):e.a0(i[1])||o.push(new e.V(`${n}[1]`,i[1],`string expected, ${e.K(i[1])} found`))}return o}function oe(t,i){const n=t.key,r=t.style,o=t.layer,s=t.styleSpec,a=t.value,l=t.objectKey,c=s[`${i}_${t.layerType}`];if(!c)return[];const u=l.match(/^(.*)-use-theme$/);if(u&&c[u[1]])return e.Q(e.S(a))?[].concat(ye({key:n,value:a,valueSpec:{type:"string",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},style:r,styleSpec:s,expressionContext:"property",propertyType:i,propertyKey:l})):ye({key:n,value:a,valueSpec:{type:"string"},style:r,styleSpec:s}
2);const h=l.match(/^(.*)-transition$/);if("paint"===i&&h&&c[h[1]]&&c[h[1]].transition)return ye({key:n,value:a,valueSpec:s.transition,style:r,styleSpec:s});const d=t.valueSpec||c[l];if(!d)return[new e.a3(n,a,`unknown property "${l}"`)];let f;if(e.a0(a)&&e.N(d)&&!d.tokens&&(f=/^{([^}]+)}$/.exec(a))){const t=`\`{ "type": "identity", "property": ${f?JSON.stringify(f[1]):'"_"'} }\``;return[new e.V(n,a,`"${l}" does not support interpolation syntax\nUse an identity property function instead: ${t}.`)]}const p=[];if("symbol"===t.layerType)"text-field"!==l||!r||r.glyphs||r.imports||p.push(new e.V(n,a,'use of "text-field" requires a style "glyphs" property')),"text-font"===l&&e.a4(e.S(a))&&"identity"===e.J(a.type)&&p.push(new e.V(n,a,'"text-font" does not support identity functions'));else if("model"===t.layerType&&"paint"===i&&o&&o.layout&&o.layout.hasOwnProperty("model-id")&&e.N(d)&&(e.a5(d)||e.O(d))){const t=e.W(e.S(a),d).value,i="expression"in t&&t.expression||"_styleExpression"in t&&t._styleExpression&&t._styleExpression.expression;i&&!e.X(i,["measure-light"])&&("model-emissive-strength"===l&&e.Y(i)&&e.Z(i)||p.push(new e.V(n,a,`${l} does not support measure-light expressions when the model layer source is vector tile or GeoJSON.`)))}return p.concat(ye({key:t.key,value:a,valueSpec:d,style:r,styleSpec:s,expressionContext:"property",propertyType:i,propertyKey:l}))}function se(e){return oe(e,"paint")}function ae(e){return oe(e,"layout")}function le(t){let i=[];const n=t.value,r=t.key,o=t.style,s=t.styleSpec;if(!e.H(n))return[new e.V(r,n,"object expected")];n.type||n.ref||i.push(new e.V(r,n,'either "type" or "ref" is required'));let a=e.J(n.type);const l=e.J(n.ref);if(n.id){const s=e.J(n.id);for(let a=0;a<t.arrayIndex;a++){const t=o.layers[a];e.J(t.id)===s&&i.push(new e.V(r,n.id,`duplicate layer id "${s}", previously used at line ${t.id.__line__}`))}}if("ref"in n){let t;["type","source","source-layer","filter","layout"].forEach(t=>{t in n&&i.push(new e.V(r,n[t],`"${t}" is prohibited for ref layers`))}),o.layers.forEach(i=>{e.J(i.id)===l&&(t=i)}),t?t.ref?i.push(new e.V(r,n.ref,"ref cannot reference another ref layer")):a=e.J(t.type):"string"==typeof l&&i.push(new e.V(r,n.ref,`ref layer "${l}" not found`))}else if("background"!==a&&"sky"!==a&&"slot"!==a)if(n.source)if(e.a0(n.source)){const t=o.sources&&o.sources[n.source],s=t&&e.J(t.type);t?"vector"===s&&"raster"===a?i.push(new e.V(r,n.source,`layer "${n.id}" requires a raster source`)):"raster"===s&&"raster"!==a?i.push(new e.V(r,n.source,`layer "${n.id}" requires a vector source`)):"vector"!==s||n["source-layer"]?"raster-dem"===s&&"hillshade"!==a?i.push(new e.V(r,n.source,"raster-dem source can only be used with layer type 'hillshade'.")):"raster-array"!==s||["raster","raster-particle"].includes(a)?"line"===a&&n.paint&&(n.paint["line-gradient"]||n.paint["line-trim-offset"])&&"geojson"===s&&!t.lineMetrics?i.push(new e.V(r,n,`layer "${n.id}" specifies a line-gradient, which requires the GeoJSON source to have \`lineMetrics\` enabled.`)):"raster-particle"===a&&"raster-array"!==s&&i.push(new e.V(r,n.source,`layer "${n.id}" requires a 'raster-array' source.`)):i.push(new e.V(r,n.source,"raster-array source can only be used with layer type 'raster'.")):i.push(new e.V(r,n,`layer "${n.id}" must specify a "source-layer"`)):i.push(new e.V(r,n.source,`source "${n.source}" not found`))}else i.push(new e.V(`${r}.source`,n.source,'"source" must be a string'));else i.push(new e.V(r,n,'missing required property "source"'));return i=i.concat(ve({key:r,value:n,valueSpec:s.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":()=>[],type:()=>ye({key:`${r}.type`,value:n.type,valueSpec:s.layer.type,style:t.style,styleSpec:t.styleSpec,object:n,objectKey:"type"}),filter:e=>ne(Object.assign({layerType:a},e)),layout:e=>ve({layer:n,key:e.key,value:e.value,valueSpec:{},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":e=>ae(Object.assign({layerType:a},e))}}),paint:e=>ve({layer:n,key:e.key,value:e.value,valueSpec:{},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":e=>se(Object.assign({layerType:a,layer:n},e))}}),appearances(t){const i=Y({key:t.key,value:t.value,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:t=>function(t){const{key:i,layer:n,layerType:r}=t,o=e.J(t.value),s=e.J(o.name),a=e.J(o.condition),l=ve({key:i,value:o,valueSpec:t.styleSpec.appearance,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{condition:t=>function(t){const i=[];return i.push(...Q({key:t.key,value:t.object.condition,valueSpec:e.a6.appearance.condition,expressionContext:"appearance"})),i}(Object.assign({layer:n,layerType:r},t)),properties:t=>function(t){const i=[],{styleSpec:n,layer:r,layerType:o}=t,s=n[`paint_${o}`],a=n[`layout_${o}`],l=t.object[t.objectKey];for(const n in l){const c=n in s?"paint":n in a?"layout":void 0;if(!c){i.push(new e.V(t.key,n,`unknown property "${n}" for layer type "${o}"`));continue}const u=Object.assign({},t,{key:`${t.key}.${n}`,object:l,objectKey:n,layer:r,layerType:o,value:l[n],valueSpec:"paint"===c?s[n]:a[n]});i.push(...oe(u,c))}return i}(Object.assign({layer:n,layerType:r},t))}});return"hidden"!==s&&void 0===a&&l.push(new e.V(t.key,"name",'Appearance with name different than "hidden" must have a condition')),l}(Object.assign({layerType:a,layer:n},t))}),r=Array.isArray(t.value)?t.value:[],o=new Set;return r.forEach((r,s)=>{const a=e.J(r.name);if(a)if(o.has(a)){const r=e.J(n.id);i.push(new e.V(t.key,a,`Duplicated appearance name "${a}" for layer "${r}"`))}else o.add(a)}),i}}})),i}function ce({key:t,value:i}
2){return e.a0(i)?[]:[new e.V(t,i,`string expected, ${e.K(i)} found`)]}const ue={promoteId:function t({key:i,value:n}){if(e.a0(n))return ce({key:i,value:n});if(Array.isArray(n)){const t=[],r=e.S(n),o=e.U(r);return"error"===o.result&&o.value.forEach(n=>{t.push(new e.V(`${i}${n.key}`,null,`${n.message}`))}),e.X(o.value.expression,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])||t.push(new e.V(`${i}`,null,"promoteId expression should be only feature dependent")),t}if(!e.H(n))return[new e.V(i,n,`string, expression or object expected, "${e.K(n)}" found`)];const r=[];for(const e in n)r.push(...t({key:`${i}.${e}`,value:n[e]}));return r}};function he(t){const i=t.value,n=t.key,r=t.styleSpec,o=t.style;if(!e.H(i))return[new e.V(n,i,`object expected, ${e.K(i)} found`)];if(!("type"in i))return[new e.V(n,i,'"type" is required')];const s=e.J(i.type);let a=[];switch(["vector","raster","raster-dem","raster-array"].includes(s)&&("url"in i||"tiles"in i||a.push(new e.a3(n,i,'Either "url" or "tiles" is required.'))),s){case"vector":case"raster":case"raster-dem":case"raster-array":return a=a.concat(ve({key:n,value:i,valueSpec:r[`source_${s.replace("-","_")}`],style:t.style,styleSpec:r,objectElementValidators:ue})),a;case"geojson":if(a=ve({key:n,value:i,valueSpec:r.source_geojson,style:o,styleSpec:r,objectElementValidators:ue}),"cluster"in i&&"clusterProperties"in i){if(!e.H(i.clusterProperties))return[new e.V(`${n}.clusterProperties`,i,`object expected, ${e.K(i)} found`)];for(const t in i.clusterProperties){const r=i.clusterProperties[t];if(!Array.isArray(r))return[new e.V(`${n}.clusterProperties.${t}`,r,"array expected")];const[o,s]=r,l="string"==typeof o?[o,["accumulated"],["get",t]]:o;a.push(...Q({key:`${n}.${t}.map`,value:s,expressionContext:"cluster-map"})),a.push(...Q({key:`${n}.${t}.reduce`,value:l,expressionContext:"cluster-reduce"}))}}return a;case"video":return ve({key:n,value:i,valueSpec:r.source_video,style:o,styleSpec:r});case"image":return ve({key:n,value:i,valueSpec:r.source_image,style:o,styleSpec:r});case"canvas":return[new e.V(n,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return ie({key:`${n}.type`,value:i.type,valueSpec:{values:de(r)}})}}function de(e){return e.source.reduce((t,i)=>{const n=e[i];return"enum"===n.type.type&&(t=t.concat(Object.keys(n.type.values||{}))),t},[])}function fe(t){const i=t.value,n=t.styleSpec,r=n.light,o=t.style;if(void 0===i)return[];if(!e.H(i))return[new e.V("light",i,`object expected, ${e.K(i)} found`)];let s=[];for(const t in i){const a=t.match(/^(.*)-transition$/),l=t.match(/^(.*)-use-theme$/);s=s.concat(l&&r[l[1]]?ye({key:t,value:i[t],valueSpec:{type:"string"},style:o,styleSpec:n}):a&&r[a[1]]&&r[a[1]].transition?ye({key:t,value:i[t],valueSpec:n.transition,style:o,styleSpec:n}):r[t]?ye({key:t,value:i[t],valueSpec:r[t],style:o,styleSpec:n}):[new e.V(t,i[t],`unknown property "${t}"`)])}return s}function pe(t){const i=t.value;if(!i)return[];const n=t.key;if(!e.H(i))return[new e.V(n,i,`object expected, ${e.K(i)} found`)];let r=[];const o=t.styleSpec,s=o["light-3d"],a=t.style,l=t.style.lights;for(const t of["type","id"])if(!(t in i))return r=r.concat([new e.V(n,i,`missing property "${t}"`)]),r;if(!e.a0(i.type))return r=r.concat([new e.V(`${n}.type`,i.type,"string expected")]),r;if(l)for(let o=0;o<t.arrayIndex;o++){const t=e.J(i.type),s=l[o];e.J(s.type)===t&&r.push(new e.V(n,i.id,`duplicate light type "${i.type}", previously defined at line ${s.id.__line__}`))}const c=`properties_light_${i.type}`;if(!(c in o))return r=r.concat([new e.V(`${n}.type`,i,`Invalid light type ${i.type}`)]),r;const u=o[c];for(const n in i)if("properties"===n){const s=i[n];if(!e.H(s))return r=r.concat([new e.V("properties",s,`object expected, ${e.K(s)} found`)]),r;for(const l in s){const c=l.match(/^(.*)-transition$/),h=l.match(/^(.*)-use-theme$/);r=r.concat(h&&u[h[1]]?ye({key:n,value:s[l],valueSpec:{type:"string"},style:a,styleSpec:o}):c&&u[c[1]]&&u[c[1]].transition?ye({key:n,value:i[n],valueSpec:o.transition,style:a,styleSpec:o}):u[l]?ye({key:l,value:s[l],valueSpec:u[l],style:a,styleSpec:o}):[new e.a3(t.key,s[l],`unknown property "${l}"`)])}}else r=r.concat(s[n]?ye({key:n,value:i[n],valueSpec:s[n],style:a,styleSpec:o}):[new e.a3(n,i[n],`unknown property "${n}"`)]);return r}function me(t){const i=t.value,n=t.key,r=t.style,o=t.styleSpec,s=o.terrain;if(null==i)return[];if(!e.H(i))return[new e.V("terrain",i,`object expected, ${e.K(i)} found`)];let a=[];for(const t in i){const n=t.match(/^(.*)-transition$/),l=t.match(/^(.*)-use-theme$/);a=a.concat(l&&s[l[1]]?ye({key:t,value:i[t],valueSpec:{type:"string"},style:r,styleSpec:o}):n&&s[n[1]]&&s[n[1]].transition?ye({key:t,value:i[t],valueSpec:o.transition,style:r,styleSpec:o}):s[t]?ye({key:t,value:i[t],valueSpec:s[t],style:r,styleSpec:o}):[new e.a3(t,i[t],`unknown property "${t}"`)])}if(i.source)if(e.a0(i.source)){const t=r.sources&&r.sources[i.source],o=t&&e.J(t.type);t?"raster-dem"!==o&&a.push(new e.V(`${n}.source`,i.source,`terrain cannot be used with a source of type ${o}, it only be used with a "raster-dem" source type`)):a.push(new e.V(`${n}.source`,i.source,`source "${i.source}" not found`))}else a.push(new e.V(`${n}.source`,i.source,"source must be a string"));else a.push(new e.V(n,i,'terrain is missing required property "source"'));return a}function _e(t){const i=t.value,n=t.style,r=t.styleSpec,o=r.fog;if(void 0===i)return[];if(!e.H(i))return[new e.V("fog",i,`object expected, ${e.K(i)} found`)];let s=[];for(const t in i){const a=t.match(/^(.*)-transition$/),l=t.match(/^(.*)-use-theme$/);s=s.concat(l&&o[l[1]]?ye({key:t,value:i[t],valueSpec:{type:"string"},style:n,styleSpec:r}):a&&o[a[1]]&&o[a[1]].transition?ye({key:t,value:i[t],valueSpec:r.transition,style:n,styleSpec:r}):o[t]?ye({key:t,value:i[t],valueSpec:o[t],style:n,styleSpec:r}):[new e.a3(t,i[t],`unknown property "${t}"`)])}return s}const ge={"*":()=>[],array:Y,boolean:function(t){const i=t.value,n=t.key;return e.$(i)?[]:[new e.V(n,i,`boolean expected, ${e.K(i)} found`)]},number:K,color:function({key:t,value:i}){return e.a0(i)?null===e.a1.parseCSSColor(i)?[new e.V(t,i,`color expected, "${i}" found`)]:[]:[new e.V(t,i,`color expected, ${e.K(i)} found`)]},enum:ie,filter:ne,function:J,layer:le,object:ve,source:he,model:e.a7,light:fe,"light-3d":pe,terrain:me,fog:_e,string:ce,formatted:function(e){return 0===ce(e).length?[]:Q(e)},resolvedImage:function(e){return 0===ce(e).length?[]:Q(e)},projection:function(t){const i=t.value,n=t.styleSpec,r=n.projection,o=t.style;if(e.H(i)){let e=[];for(const t in i)e=e.concat(ye({key:t,value:i[t],valueSpec:r[t],style:o,styleSpec:n}));return e}return e.a0(i)?[]:[new e.V("projection",i,`object or string expected, ${e.K(i)} found`)]},import:function(t){const i=t.key,{value:n,styleSpec:r}=t;if(!e.H(n))return[new e.V(i,n,"import must be an object")];const{data:o,...s}=n;Object.defineProperty(s,"__line__",{value:n.__line__,enumerable:!1});let a=ve(Object.assign({},t,{value:s,valueSpec:r.import}));return""===e.J(s.id)&&a.push(new e.V(`${t.key}.id`,s,"import id can't be an empty string")),o&&(a=a.concat(be(o,r,{key:`${t.key}.data`}))),a},iconset:function(t){const i=t.value,n=t.key,r=t.styleSpec,o=t.style;if(!e.H(i))return[new e.V(n,i,"object expected")];if(!i.type)return[new e.V(n,i,'"type" is required')];const s=e.J(i.type);let a=[];if(a=a.concat(ve({key:n,value:i,valueSpec:r[`iconset_${s}`],style:o,styleSpec:r})),function(e,t){return!("source"!==e||!t.source)}(s,i)){const t=o.sources&&o.sources[i.source],r=t&&e.J(t.type);t?"raster-array"!==r&&a.push(new e.V(n,i.source,`iconset cannot be used with a source of type ${String(r)}, it only be used with a "raster-array" source type`)):a.push(new e.V(n,i.source,`source "${i.source}" not found`))}return a}};function ye(t,i=!1){const n=t.value,r=t.valueSpec,o=t.styleSpec;if(r.expression){if(e.a4(e.J(n)))return J(t);if(e.Q(e.S(n)))return Q(t)}if(r.type&&ge[r.type]){const e=ge[r.type](t);return!0===i&&e.length>0&&Array.isArray(t.value)?Q(t):e}return ve(Object.assign({},t,{valueSpec:r.type?o[r.type]:r}))}function ve(t){const i=t.key,n=t.value,r=t.valueSpec||{},o=t.objectElementValidators||{},s=t.style,a=t.styleSpec;if(!e.H(n))return[new e.V(i,n,`object expected, ${e.K(n)} found`)];let l=[];for(const t in n){const c=t.split(".")[0];let u;o[c]?u=o[c]:r[c]?u=ye:o["*"]?u=o["*"]:r["*"]&&(u=ye),u?l=l.concat(u({key:(i?`${i}.`:i)+t,value:n[t],valueSpec:r[c]||r["*"],style:s,styleSpec:a,object:n,objectKey:t},n)):l.push(new e.a3(i,n[t],`unknown property "${t}"`))}for(const t in r){if(o[t])continue;const s=r[t];s.required&&void 0===s.default&&void 0===n[t]&&l.push(new e.V(i,n,`missing required property "${t}"`))}return l}function xe({key:t,value:i}){const n=ce({key:t,value:i});if(n.length)return n;const r=i;return-1===r.indexOf("{fontstack}")&&n.push(new e.V(t,i,'"glyphs" url must include a "{fontstack}" token')),-1===r.indexOf("{range}")&&n.push(new e.V(t,i,'"glyphs" url must include a "{range}" token')),n}function be(t,i=e.a6,n={}){return ve({key:n.key||"",value:t,valueSpec:Object.assign(i.$root,{"*":{type:"*"}}),styleSpec:i,style:t,objectElementValidators:{glyphs:xe}})}function we(t,i=e.a6){return Oe(be(t,i))}const Te=e=>Oe(he(e)),Se=e=>Oe(fe(e)),Ee=e=>Oe(pe(e)),Ie=e=>Oe(me(e)),Ae=e=>Oe(_e(e)),Me=t=>Oe(function(t){const i=t.value,n=t.style,r=t.styleSpec,o=r.snow;if(void 0===i)return[];if(!e.H(i))return[new e.V("snow",i,`object expected, ${e.K(i)} found`)];let s=[];for(const t in i){const a=t.match(/^(.*)-transition$/);s=s.concat(a&&o[a[1]]&&o[a[1]].transition?ye({key:t,value:i[t],valueSpec:r.transition,style:n,styleSpec:r}):o[t]?ye({key:t,value:i[t],valueSpec:o[t],style:n,styleSpec:r}):[new e.a3(t,i[t],`unknown property "${t}"`)])}return s}(t)),Ce=t=>Oe(function(t){const i=t.value,n=t.style,r=t.styleSpec,o=r.rain;if(void 0===i)return[];if(!e.H(i))return[new e.V("rain",i,`object expected, ${e.K(i)} found`)];let s=[];for(const t in i){const a=t.match(/^(.*)-transition$/);s=s.concat(a&&o[a[1]]&&o[a[1]].transition?ye({key:t,value:i[t],valueSpec:r.transition,style:n,styleSpec:r}):o[t]?ye({key:t,value:i[t],valueSpec:o[t],style:n,styleSpec:r}):[new e.a3(t,i[t],`unknown property "${t}"`)])}return s}(t)),Pe=e=>Oe(le(e)),De=e=>Oe(ne(e)),Re=e=>Oe(se(e)),Le=e=>Oe(ae(e)),ze=t=>Oe(e.a7(t));function Oe(e){return e.slice().sort((e,t)=>
2e.line&&t.line?e.line-t.line:0)}function Fe(t,i){let n=!1;if(i&&i.length)for(const r of i)r instanceof e.a3?e.w(r.message):(t.fire(new e.y(new Error(r.message))),n=!0);return n}const ke=e.a6.light;let Be;class Ne extends e.E{constructor(t,i="flat"){super(),this._transitionable=new e.a8(Be||(Be=new e.a9({anchor:new e.aa(ke.anchor),position:new e.ab(ke.position),color:new e.aa(ke.color),intensity:new e.aa(ke.intensity)}))),this.setLight(t,i),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(e,t,i={}){this._validate(Se,e,i)||(this._transitionable.setTransitionOrValue(e),this.id=t)}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,i,n){return(!n||!1!==n.validate)&&Fe(this,t.call(we,Object.assign({value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.a6})))}}const Ve=e.a6.terrain;let Ue=class extends e.E{constructor(t,i,n,r,o){super(),this.scope=n,this._transitionable=new e.a8(new e.a9({source:new e.aa(Ve.source),exaggeration:new e.aa(Ve.exaggeration)}),n,r),this._transitionable.setTransitionOrValue(t,r),this._transitioning=this._transitionable.untransitioned(),this.drapeRenderMode=i,this.worldview=o}get(){return this._transitionable.serialize()}set(e,t){this._transitionable.setTransitionOrValue(e,t)}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}getExaggeration(t){return this._transitioning.possiblyEvaluate(new e.ac(t,{worldview:this.worldview})).get("exaggeration")}getAttenuationRange(){if(!this.isZoomDependent())return null;const t=this._transitionable._values.exaggeration;if(!t)return null;const i=t.value.expression;if(!i)return null;let n=-1,r=-1,o=1;for(const t of i.zoomStops)o=i.evaluate(new e.ac(t,{worldview:this.worldview})),o>.01?(n=t,r=-1):r=t;return o<.01&&n>0&&r>n?[n,r]:null}isZoomDependent(){const t=this._transitionable._values.exaggeration;return null!=t&&null!=t.value&&null!=t.value.expression&&t.value.expression instanceof e.ad}};const je=.05;function Ge(t,i,n,r){const o=e.ah(45,65,n),[s,a]=qe(t,r);let l=1-Math.min(1,Math.exp((i-s)/(a-s)*-6));return l*=l*l,l=Math.min(1,1.00747*l),l*o*t.alpha}function qe(e,t){const i=.5/Math.tan(.5*t);return[e.range[0]+i,e.range[1]+i]}
2function He(t,i,n,r,o){const s=e.af([],[i,n,r],o.mercatorFogMatrix);return Ge(t,e.ag(s),o.pitch,o._fov)}function $e(t,i,n,r,o,s,a){const l=[[n,r,0],[o,r,0],[o,s,0],[n,s,0]];let c=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(const t of l){const n=e.af([],t,i),r=e.ag(n);c=Math.min(c,r),u=Math.max(u,r)}return[Ge(t,c,a.pitch,a._fov),Ge(t,u,a.pitch,a._fov)]}const We=e.a6.fog;class Ze extends e.E{constructor(t,i,n,r){super();const o=new e.a9({range:new e.aa(We.range),color:new e.aa(We.color),"color-use-theme":new e.aa({type:"string","property-type":"data-constant",default:"default"}),"high-color":new e.aa(We["high-color"]),"high-color-use-theme":new e.aa({type:"string","property-type":"data-constant",default:"default"}),"space-color":new e.aa(We["space-color"]),"space-color-use-theme":new e.aa({type:"string","property-type":"data-constant",default:"default"}),"horizon-blend":new e.aa(We["horizon-blend"]),"star-intensity":new e.aa(We["star-intensity"]),"vertical-range":new e.aa(We["vertical-range"])});this._transitionable=new e.a8(o,n,new Map(r)),this.set(t,r),this._transitioning=this._transitionable.untransitioned(),this._transform=i,this.properties=new e.ai(o),this.scope=n}get state(){const t=this._transform,i="globe"===t.projection.name,n=e.aj(t.zoom),r=this.properties.get("range"),o=[.5,3];return{range:i?[e.ak(o[0],r[0],n),e.ak(o[1],r[1],n)]:r,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(e,t,i={}){if(this._validate(Ae,e,i))return;const n=Object.assign({},e);for(const e of Object.keys(We))void 0===n[e]&&(n[e]=We[e].default);this._options=n,this._transitionable.setTransitionOrValue(this._options,t)}getOpacity(t){if(!this._transform.projection.supportsFog)return 0;const i=this.properties&&this.properties.get("color")||1;return("globe"===this._transform.projection.name?1:e.ah(45,65,t))*i.a}getOpacityAtLatLng(t,i){return this._transform.projection.supportsFog?function(t,i,n){const r=e.ae.fromLngLat(i),o=n.elevation?n.elevation.getAtPointOrZero(r):0;return He(t,r.x,r.y,o,n)}(this.state,t,i):0}getOpacityForTile(t){if(!this._transform.projection.supportsFog)return[1,1];const i=this._transform.calculateFogTileMatrix(t.toUnwrapped());return $e(this.state,i,0,0,e.al,e.al,this._transform)}getOpacityForBounds(e,t,i,n,r){return this._transform.projection.supportsFog?$e(this.state,e,t,i,n,r,this._transform):[1,1]}getFovAdjustedRange(e){return this._transform.projection.supportsFog?qe(this.state,e):[0,1]}isVisibleOnFrustum(t){if(!this._transform.projection.supportsFog)return!1;const i=[4,5,6,7];for(const n of i){const i=t.points[n];let r;if(i[2]>=0)r=i;else{const o=t.points[n-4];r=e.am(o,i,o[2]/(o[2]-i[2]))}if(He(this.state,r[0],r[1],0,this._transform)>=je)return!0}return!1}updateConfig(e){this._transitionable.setTransitionOrValue(this._options,new Map(e))}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,i,n){return(!n||!1!==n.validate)&&Fe(this,t.call(we,Object.assign({value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.a6})))}}let Xe,Ye,Ke,Je,Qe=class extends e.E{constructor(t,i,n,r){super();const o=Xe||(Xe=new e.a9({density:new e.aa(e.a6.snow.density),intensity:new e.aa(e.a6.snow.intensity),color:new e.aa(e.a6.snow.color),opacity:new e.aa(e.a6.snow.opacity),vignette:new e.aa(e.a6.snow.vignette),"vignette-color":new e.aa(e.a6.snow["vignette-color"]),"center-thinning":new e.aa(e.a6.snow["center-thinning"]),direction:new e.aa(e.a6.snow.direction),"flake-size":new e.aa(e.a6.snow["flake-size"])}));this._transitionable=new e.a8(o,n,new Map(r)),this.set(t,r),this._transitioning=this._transitionable.untransitioned(),this.properties=new e.ai(o),this.scope=n}get state(){const t=this.properties.get("opacity"),i=this.properties.get("color"),n=this.properties.get("direction"),r=e.an(n[0]),o=-Math.max(e.an(n[1]),.01),s=[Math.cos(r)*Math.cos(o),Math.sin(r)*Math.cos(o),Math.sin(o)],a=this.properties.get("vignette"),l=this.properties.get("vignette-color");return l.a=a,{density:this.properties.get("density"),intensity:this.properties.get("intensity"),color:new e.ao(i.r,i.g,i.b,i.a*t),direction:s,centerThinning:this.properties.get("center-thinning"),flakeSize:this.properties.get("flake-size"),vignetteColor:l}}get(){return this._transitionable.serialize()}set(t,i,n={}
2){if(this._validate(Me,t,n))return;const r=Object.assign({},t),o=e.a6.snow;for(const e of Object.keys(o))void 0===r[e]&&(r[e]=o[e].default);this._options=r,this._transitionable.setTransitionOrValue(this._options,i)}updateConfig(e){this._transitionable.setTransitionOrValue(this._options,new Map(e))}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,i,n){return(!n||!1!==n.validate)&&Fe(this,t.call(we,Object.assign({value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.a6})))}},et=class extends e.E{constructor(t,i,n,r){super();const o=Ye||(Ye=new e.a9({density:new e.aa(e.a6.rain.density),intensity:new e.aa(e.a6.rain.intensity),color:new e.aa(e.a6.rain.color),opacity:new e.aa(e.a6.rain.opacity),vignette:new e.aa(e.a6.rain.vignette),"vignette-color":new e.aa(e.a6.rain["vignette-color"]),"center-thinning":new e.aa(e.a6.rain["center-thinning"]),direction:new e.aa(e.a6.rain.direction),"droplet-size":new e.aa(e.a6.rain["droplet-size"]),"distortion-strength":new e.aa(e.a6.rain["distortion-strength"])}));this._transitionable=new e.a8(o,n,new Map(r)),this.set(t,r),this._transitioning=this._transitionable.untransitioned(),this.properties=new e.ai(o),this.scope=n}get state(){const t=this.properties.get("opacity"),i=this.properties.get("color"),n=this.properties.get("direction"),r=e.an(n[0]),o=-Math.max(e.an(n[1]),.01),s=[Math.cos(r)*Math.cos(o),Math.sin(r)*Math.cos(o),Math.sin(o)],a=this.properties.get("vignette-color");return a.a=this.properties.get("vignette"),{density:this.properties.get("density"),intensity:this.properties.get("intensity"),color:new e.ao(i.r,i.g,i.b,i.a*t),direction:s,centerThinning:this.properties.get("center-thinning"),dropletSize:this.properties.get("droplet-size"),distortionStrength:this.properties.get("distortion-strength"),vignetteColor:a}}get(){return this._transitionable.serialize()}set(t,i,n={}){if(this._validate(Ce,t,n))return;const r=Object.assign({},t),o=e.a6.rain;for(const e of Object.keys(o))void 0===r[e]&&(r[e]=o[e].default);this._options=r,this._transitionable.setTransitionOrValue(this._options,i)}updateConfig(e){this._transitionable.setTransitionOrValue(this._options,new Map(e))}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,i,n){return(!n||!1!==n.validate)&&Fe(this,t.call(we,Object.assign({value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.a6})))}};class tt extends e.E{constructor(t,i,n,r){super(),this.scope=n,this._options=t,this.properties=new e.ai(i),this._transitionable=new e.a8(i,n,new Map(r)),this._transitionable.setTransitionOrValue(t.properties),this._transitioning=this._transitionable.untransitioned()}updateConfig(e){this._transitionable.setTransitionOrValue(this._options.properties,new Map(e))}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}get(){return this._options.properties=this._transitionable.serialize(),this._options}set(e,t){this._options=e,this._transitionable.setTransitionOrValue(e.properties,t)}shadowsEnabled(){return!!this.properties&&!0===this.properties.get("cast-shadows")}}class it{constructor(e,t,i){this.screenBounds=e,this.cameraPoint=i.getCameraPoint(),this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=t,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,i)}static createFromScreenPoints(t,i){let n,r;if(t instanceof e.P||"number"==typeof t[0]){const o=e.P.convert(t);n=[o],r=i.isPointAboveHorizon(o)}else{const o=e.P.convert(t[0]),s=e.P.convert(t[1]),a=o.add(s)._div(2);n=[o,s],r=e.aq(o,s).every(e=>i.isPointAboveHorizon(e))&&i.isPointAboveHorizon(a)}return new it(n,r,i)}isPointQuery(){return 1===this.screenBounds.length}bufferedScreenGeometry(t){return e.aq(this.screenBounds[0],1===this.screenBounds.length?this.screenBounds[0]:this.screenBounds[1],t)}bufferedCameraGeometry(t){const i=this.screenBounds[0],n=1===this.screenBounds.length?this.screenBounds[0].add(new e.P(1,1)):this.screenBounds[1],r=e.aq(i,n,0,!1);return this.cameraPoint.y>n.y&&(this.cameraPoint.x>i.x&&this.cameraPoint.x<n.x?r.splice(3,0,this.cameraPoint):this.cameraPoint.x>=n.x?r[2]=this.cameraPoint:this.cameraPoint.x<=i.x&&(r[3]=this.cameraPoint)),e.ar(r,t)}bufferedCameraGeometryGlobe(t){const i=this.screenBounds[0],n=1===this.screenBounds.length?this.screenBounds[0].add(new e.P(1,1)):this.screenBounds[1],r=e.aq(i,n,t),o=this.cameraPoint.clone();switch(3*((o.y>i.y)+(o.y>n.y))+((o.x>i.x)+(o.x>n.x))){case 0:r[0]=o,r[4]=o.clone();break;case 1:r.splice(1,0,o);break;case 2:r[1]=o;break;case 3:r.splice(4,0,o);break;case 5:r.splice(2,0,o);break;case 6:r[3]=o;break;case 7:r.splice(3,0,o);break;case 8:r[2]=o}return r}containsTile(t,i,n,r=0){const o=Math.max(t.queryPadding,t.evaluateQueryRenderedFeaturePadding())/i._pixelsPerMercatorPixel+1,s=n?this._bufferedCameraMercator(o,i):this._bufferedScreenMercator(o,i);let a=t.tileID.wrap+(s.unwrapped?r:0);const l=s.polygon.map(i=>e.as(t.tileTransform,i,a));if(!e.at(l,0,0,e.al,e.al))return;a=t.tileID.wrap+(this.screenGeometryMercator.unwrapped?r:0);const c=this.screenGeometryMercator.polygon.map(i=>e.au(t.tileTransform,i,a)),u=c.map(t=>new e.P(t[0],t[1])),h=i.getFreeCameraOptions().position||new e.ae(0,0,0),d=e.au(t.tileTransform,h,a),f=c.map(t=>{const i=e.av(t,t,d);return e.aw(i,i),new e.ax(d,i)}),p=e.ay(t,1,i.zoom)*i._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:u,tilespaceRays:f,bufferedTilespaceGeometry:l,bufferedTilespaceBounds:(m=e.az(l),m.min.x=e.aA(m.min.x,0,e.al),m.min.y=e.aA(m.min.y,0,e.al),m.max.x=e.aA(m.max.x,0,e.al),m.max.y=e.aA(m.max.y,0,e.al),m),tile:t,t
2ileID:t.tileID,pixelToTileUnitsFactor:p};var m}_bufferedScreenMercator(e,t){const i=ot(e);if(this._screenRaycastCache[i])return this._screenRaycastCache[i];{let n;return n="globe"===t.projection.name?this._projectAndResample(this.bufferedScreenGeometry(e),t):{polygon:this.bufferedScreenGeometry(e).map(e=>t.pointCoordinate3D(e)),unwrapped:!0},this._screenRaycastCache[i]=n,n}}_bufferedCameraMercator(e,t){const i=ot(e);if(this._cameraRaycastCache[i])return this._cameraRaycastCache[i];{let n;return n="globe"===t.projection.name?this._projectAndResample(this.bufferedCameraGeometryGlobe(e),t):{polygon:this.bufferedCameraGeometry(e).map(e=>t.pointCoordinate3D(e)),unwrapped:!0},this._cameraRaycastCache[i]=n,n}}_projectAndResample(t,i){const n=function(t,i){const n=e.aB([],i.pixelMatrix,i.globeMatrix),r=[0,-e.aD,0,1],o=[0,e.aD,0,1],s=[0,0,0,1];e.aC(r,r,n),e.aC(o,o,n),e.aC(s,s,n);const a=new e.P(r[0]/r[3],r[1]/r[3]),l=new e.P(o[0]/o[3],o[1]/o[3]),c=e.aE(t,a)&&r[3]<s[3],u=e.aE(t,l)&&o[3]<s[3];if(!c&&!u)return null;const h=function(e,t,i){for(let n=1;n<e.length;n++){const r=rt(t.pointCoordinate3D(e[n-1]).x),o=rt(t.pointCoordinate3D(e[n]).x);if(i<0){if(r<o)return{idx:n,t:-r/(o-1-r)}}else if(o<r)return{idx:n,t:(1-r)/(o+1-r)}}return null}(t,i,c?-1:1);if(!h)return null;const{idx:d,t:f}=h;let p=d>1?nt(t.slice(0,d),i):[],m=d<t.length?nt(t.slice(d),i):[];p=p.map(t=>new e.P(rt(t.x),t.y)),m=m.map(t=>new e.P(rt(t.x),t.y));const _=[...p];0===_.length&&_.push(m[m.length-1]);const g=e.ak(_[_.length-1].y,(0===m.length?p[0]:m[0]).y,f);let y;return y=c?[new e.P(0,g),new e.P(0,0),new e.P(1,0),new e.P(1,g)]:[new e.P(1,g),new e.P(1,1),new e.P(0,1),new e.P(0,g)],_.push(...y),0===m.length?_.push(p[0]):_.push(...m),{polygon:_.map(t=>new e.ae(t.x,t.y)),unwrapped:!1}}(t,i);if(n)return n;const r=function(t,i){let n=!1,r=-1/0,o=0;for(let e=0;e<t.length-1;e++)t[e].x>r&&(r=t[e].x,o=e);for(let e=0;e<t.length-1;e++){const i=(o+e)%(t.length-1),r=t[i],s=t[i+1];Math.abs(r.x-s.x)>.5&&(r.x<s.x?(r.x+=1,0===i&&(t[t.length-1].x+=1)):(s.x+=1,i+1===t.length-1&&(t[0].x+=1)),n=!0)}const s=e.aF(i.center.lng);return n&&s<Math.abs(s-1)&&t.forEach(e=>{e.x-=1}),{polygon:t,unwrapped:n}}(nt(t,i).map(t=>new e.P(rt(t.x),t.y)),i);return{polygon:r.polygon.map(t=>new e.ae(t.x,t.y)),unwrapped:r.unwrapped}}}function nt(t,i){return e.aG(t,e=>{const t=i.pointCoordinate3D(e);e.x=t.x,e.y=t.y},1/256)}function rt(e){return e<0?1+e%1:e%1}function ot(e){return 100*e|0}function st(t,i,n,r,o){const s=function(n,r){if(n)return o(n);if(r){if(t.url&&r.tiles&&t.tiles&&delete t.tiles,r.variants){if(!Array.isArray(r.variants)
2)return o(new Error("variants must be an array"));for(const e of r.variants){if(null==e||"object"!=typeof e||e.constructor!==Object)return o(new Error("variant must be an object"));if(!Array.isArray(e.capabilities))return o(new Error("capabilities must be an array"));if(1===e.capabilities.length&&"meshopt"===e.capabilities[0]){r=Object.assign(r,e);break}}}const n=e.aH(Object.assign({},r,t),["tilejson","tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","extra_bounds","scheme","tileSize","encoding","vector_layers","raster_layers","worldview_options","worldview_default","worldview"]);n.tiles=i.canonicalizeTileset(n,t.url),o(null,n)}},a=function(e,t,i){if(!e)return null;if(!t&&!i)return e;i=i||e.worldview_default;const n=Object.values(e.language||{});if(0===n.length)return null;const r=Object.values(e.worldview||{});if(0===r.length)return null;const o=n.every(e=>e===t),s=r.every(e=>e===i);return o&&s?e:t in(e.language_options||{})||i in(e.worldview_options||{})?null:e.language_options&&e.worldview_options?e:null}(t.data,n,r);return a?e.o.frame(()=>s(null,a)):t.url?e.m(i.transformRequest(i.normalizeSourceURL(t.url,null,n,r),e.R.Source),s):e.o.frame(()=>{const{data:e,...i}=t;s(null,i)})}function at(t,i){const n=Math.pow(2,i.z),r=Math.floor(e.aF(t.getWest())*n),o=Math.floor(e.aJ(t.getNorth())*n),s=Math.ceil(e.aF(t.getEast())*n),a=Math.ceil(e.aJ(t.getSouth())*n);return i.x>=r&&i.x<s&&i.y>=o&&i.y<a}class lt{constructor(t,i,n){this.bounds=t?e.aI.convert(this.validateBounds(t)):null,this.minzoom=i||0,this.maxzoom=n||24}validateBounds(e){return Array.isArray(e)&&4===e.length?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}addExtraBounds(t){if(t){this.extraBounds||(this.extraBounds=[]);for(const i of t)this.extraBounds.push(e.aI.convert(this.validateBounds(i)))}}contains(e){if(e.z>this.maxzoom||e.z<this.minzoom)return!1;if(this.bounds&&!at(this.bounds,e))return!1;if(!this.extraBounds)return!0;for(const t of this.extraBounds)if(at(t,e))return!0;return!1}static fromTileJSON(e){if(!e.bounds&&!e.extra_bounds)return null;const t=new lt(e.bounds,e.minzoom,e.maxzoom);return t.addExtraBounds(e.extra_bounds),t}}class ct extends e.E{constructor(t,i,n,r){if(super(),this.id=t,this.dispatcher=n,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,Object.assign(this,e.aH(i,["url","scheme","tileSize","promoteId"])),this._options=Object.assign({type:"vector"},i),this._collectResourceTiming=!!i.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(r),this._tileWorkers={},this._deduped=new e.aK}load(t){this._loaded=!1,this.fire(new e.z("dataloading",{dataType:"source"}));const i=Array.isArray(this.map._language)?this.map._language.join():this.map._language,n=this.map.getWorldview();this._tileJSONRequest=st(this._options,this.map._requestManager,i,n,(r,o)=>{if(this._tileJSONRequest=null,this._loaded=!0,r)i&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${i}`),n&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${n}`),this.fire(new e.y(r));else if(o){if(Object.assign(this,o),this.hasWorldviews=!!o.worldview_options,o.worldview_default&&(this.worldviewDefault=o.worldview_default),o.vector_layers){this.vectorLayers=o.vector_layers,this.vectorLayerIds=[],this.localizableLayerIds=new Set;for(const e of o.vector_layers)this.vectorLayerIds.push(e.id),o.worldview&&o.worldview[e.source]&&this.localizableLayerIds.add(e.id)}this.tileBounds=lt.fromTileJSON(o),R(o.tiles,this.map._requestManager._customAccessToken),this.fire(new e.z("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.z("data",{dataType:"source",sourceDataType:"content"}))}t&&t(r)})}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}reload(){this.cancelTileJSONRequest();const t=e.B(this.id,this.scope);this.load(()=>this.map.style.clearSource(t))}setTiles(e){return this._options.tiles=e,this.reload(),this}setUrl(e){return this.url=e,this._options.url=e,this.reload(),this}onRemove(e){this.cancelTileJSONRequest()}serialize(){return Object.assign({},this._options)}loadTile(t,i){const n=t.tileID.canonical.url(this.tiles,this.scheme),r=this.map._requestManager.normalizeTileURL(n),o=this.map._requestManager.transformRequest(r,e.R.Tile),s=this.map.style?this.map.style.getLut(this.scope):null,a=s?{image:s.image.clone()}:null,l={request:o,data:void 0,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,lut:a,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.t
2ype,source:this.id,scope:this.scope,pixelRatio:e.o.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:t.isSymbolTile,brightness:this.map.style&&this.map.style.getBrightness()||0,extraShadowCaster:t.isExtraShadowCaster,tessellationStep:this.map._tessellationStep,scaleFactor:this.map.getScaleFactor(),worldview:this.map.getWorldview()||this.worldviewDefault,indoor:this.map.indoor?this.map.indoor.getIndoorTileOptions(this.id,this.scope):null};if(this.hasWorldviews&&e.h(n)&&(l.localizableLayerIds=this.localizableLayerIds),l.request.collectResourceTiming=this._collectResourceTiming,t.actor&&"expired"!==t.state)"loading"===t.state?t.reloadCallback=i:t.request=t.actor.send("reloadTile",l,c.bind(this));else if(t.actor=this._tileWorkers[r]=this._tileWorkers[r]||this.dispatcher.getActor(),this.dispatcher.ready)t.request=t.actor.send("loadTile",l,c.bind(this),void 0,!0);else{const i=e.aL.call({deduped:this._deduped},l,(i,n)=>{if(i||!n)c.call(this,i);else{const i=e.aM(n.responseHeaders);l.data={rawData:n.rawData.slice(0),expires:i.expires,cacheControl:i.cacheControl},t.actor&&t.actor.send("loadTile",l,c.bind(this),void 0,!0)}},!0);t.request={cancel:i}}function c(n,r){return delete t.request,t.aborted?i(null):n&&n instanceof e.aN&&404!==n.status?i(n):(r&&r.resourceTiming&&(t.resourceTiming=r.resourceTiming),this.map._refreshExpiredTiles&&r&&t.setExpiryData(r),t.loadVectorData(r,this.map.painter),e.aO(this.dispatcher),i(null,r),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.actor&&e.actor.send("abortTile",{uid:e.uid,type:this.t
2ype,source:this.id,scope:this.scope})}unloadTile(e,t){e.actor&&e.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id,scope:this.scope}),e.destroy()}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class ut extends e.E{constructor(t,i,n,r){super(),this.id=t,this.dispatcher=n,this.setEventedParent(r),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=Object.assign({type:"raster"},i),Object.assign(this,e.aH(i,["url","scheme","tileSize"]))}load(t){this._loaded=!1,this.fire(new e.z("dataloading",{dataType:"source"}));const i=this.map.getWorldview();this._tileJSONRequest=st(this._options,this.map._requestManager,null,i,(i,n)=>{this._tileJSONRequest=null,this._loaded=!0,i?this.fire(new e.y(i)):n&&(Object.assign(this,n),n.raster_layers&&(this.rasterLayers=n.raster_layers,this.rasterLayerIds=this.rasterLayers.map(e=>e.id)),this.tileBounds=lt.fromTileJSON(n),R(n.tiles),this.fire(new e.z("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.z("data",{dataType:"source",sourceDataType:"content"}))),t&&t(i)})}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}reload(){this.cancelTileJSONRequest();const t=e.B(this.id,this.scope);this.load(()=>this.map.style.clearSource(t))}setTiles(e){return this._options.tiles=e,this.reload(),this}setUrl(e){return this.url=e,this._options.url=e,this.reload(),this}onRemove(e){this.cancelTileJSONRequest()}serialize(){return Object.assign({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(t,i){const n=e.o.devicePixelRatio>=2,r=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),n,this.tileSize);t.request=e.n(this.map._requestManager.transformRequest(r,e.R.Tile),(n,r,o)=>{if(delete t.request,t.aborted)return t.state="unloaded",i(null);if(n)return t.state="errored",i(n);if(!r)return i(null);const s=e.aM(o);this.map._refreshExpiredTiles&&t.setExpiryData(s),t.setTexture(r,this.map.painter),t.state="loaded",e.aO(this.dispatcher),i(null)})}abortTile(e,t){e.request&&(e.request.cancel(),delete e.request),t&&t()}unloadTile(t,i){t.texture&&t.texture instanceof e.T?(t.destroy(!1),t.texture&&t.texture instanceof e.T&&this.map.painter.saveTileTexture(t.texture)):t.destroy(),i&&i()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}function ht([t,i],n,r,{scaled:o=!0}={}){const{tileSize:s,buffer:a}=r,{x:l,y:c,z:u}=n;if(!isFinite(l)||!isFinite(c)||!isFinite(u))throw new Error("Invalid MRT header");const h=2**u,d=h*e.aF(t),f=h*e.aJ(i);return function([e,t],i,{scaled:n=!0}={}){if(!i)throw new Error("bandView is undefined");const{data:r,tileSize:o,buffer:s,offset:a,scale:l,dimension:c}=i;if(e<-s||e>o+s||t<-s||t>o+s)throw new Error(`Point (${e}, ${t}) out of bounds for tileSize=${o}, buffer=${s}`);const u=(t+s)*(o+2*s)+(e+s);if(4294967295===new Uint32Array(r.buffer)[u])return null;let h=[];h=n?[]:new(0,i.data.constructor)(c);for(let e=0;e<c;e++)h[e]=Math.round(1e12*(r[c*u+e]*l+a))/1e12;return h}([Math.min(Math.max(-a,Math.floor((d-l)*s)),s-1+a),Math.min(Math.max(-a,Math.floor((f-c)*s)),s-1+a)],r,{scaled:o})}class dt extends ut{constructor(e,t,i,n){super(e,t,i,n),this.type="raster-array",this.maxzoom=22,this.partial=!0,this._loadTilePending={},this._loadTileLoaded={},this._options=Object.assign({type:"raster-array"},t)}triggerRepaint(e){const t=this.map.painter._terrain,i=this.map.style.getSourceCache(this.id);t&&t.enabled&&i&&t._clearRenderCacheForTile(i.id,e.tileID),this.map.triggerRepaint()}loadTile(t,i){const n=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize),r=this.map._requestManager.transformRequest(n,e.R.Tile),o={request:r,uid:t.uid,tileID:t.tileID,type:this.t
2ype,source:this.id,scope:this.scope,partial:this.partial};t.source=this.id,t.scope=this.scope,t.requestParams=r,t.actor||(t.actor=this.dispatcher.getActor());const s=(n,r,o)=>{if(delete t.request,t.aborted)return t.state="unloaded",i(null);if(n){if("AbortError"===n.name)return;return t.state="errored",i(n)}if(this.map._refreshExpiredTiles&&r){const i=e.aM(o);t.setExpiryData(i)}if(this.partial&&"expired"!==t.state)t.state="empty";else if(!this.partial){if(!r)return i(null);t.state="loaded",t._isHeaderLoaded=!0,t._mrt=r}i(null)};t.request=this.partial?t.fetchHeader(void 0,s.bind(this)):t.actor.send("loadTile",o,s.bind(this),void 0,!0)}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.actor&&e.actor.send("abortTile",{uid:e.uid,type:this.type,source:this.id,scope:this.scope})}unloadTile(e,t){const i=e.texturePerLayer;if(e.flushAllQueues(),i.size){e.destroy(!1);for(const e of i.values())this.map.painter.saveTileTexture(e)}else e.destroy()}prepareTile(t,i,n,r){t._isHeaderLoaded&&("empty"!==t.state&&(t.state="reloading"),t.fetchBandForRender(i,n,r,(i,r)=>{if(i)return t.state="errored",this.fire(new e.y(i)),void this.triggerRepaint(t);r&&(t._isHeaderLoaded=!0,t.setTexturePerLayer(n,r,this.map.painter),t.state="loaded",this.triggerRepaint(t))}))}getInitialBand(e){if(!this.rasterLayers)return 0;const t=this.rasterLayers.find(({id:t})=>t===e),i=t&&t.fields,n=i&&i.bands&&i.bands;return n?n[0]:0}getTextureDescriptor(t,i,n){if(!t)return;const r=i.sourceLayer||this.rasterLayerIds&&this.rasterLayerIds[0];if(!r)return;let o=null;i instanceof e.aR?o=i.paint.get("raster-array-band"):i instanceof e.aS&&(o=i.paint.get("raster-particle-array-band"));const s=o||this.getInitialBand(r);if(null==s)return;if(!t.textureDescriptorPerLayer.get(i.id))return void this.prepareTile(t,r,i.id,s);if(t.updateNeeded(i.id,s)&&!n)return;const a=t.textureDescriptorPerLayer.get(i.id);return Object.assign({},a,{texture:t.texturePerLayer.get(i.id)})}getImages(t,i){const n=new Map;for(const r of t)for(const t of i){const[i,o]=t.split("/"),s=r.getLayer(i);if(!s)continue;if(!s.hasBand(o)||!s.hasDataForBand(o))continue;const{bytes:a,tileSize:l,buffer:c}=s.getBandView(o),u=l+2*c,h={data:new e.q({width:u,height:u},a),pixelRatio:2,sdf:!1,usvg:!1,version:0};n.set(t,h)}return n}queryRasterArrayValueByBandId(t,i,n){const r=i._mrt;return new Promise(o=>{const s={},a=new Set;for(const[l,c]of Object.entries(r.layers)){if(n.layerName&&l!==n.layerName)continue;const u={};s[l]=u;for(const{bands:h}of c.dataIndex)for(const d of h)n.bands&&!n.bands.includes(d)||(a.add(e.B(l,d)),i.fetchBand(l,null,d,i=>{e.o.frame(()=>{u[d]=i?null:ht([t.lng,t.lat],r,c.getBandView(d)),a.delete(e.B(l,d)),0===a.size&&o(s)})},!1))}0===a.size&&o(s)})}_loadTileForQuery(t,i){if(this._loadTileLoaded[t.uid])return void i(null,t._mrt);if(this._loadTilePending[t.uid])return void this._loadTilePending[t.uid].push(i);this._loadTilePending[t.uid]=[i];const n=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize),r=this.map._requestManager.transformRequest(n,e.R.Tile);t.actor.send("loadTile",{request:r,uid:t.uid,tileID:t.tileID,type:this.t
2ype,source:this.id,scope:this.scope,partial:!1},(i,n,r)=>{if(i)return this._loadTilePending[t.uid].forEach(e=>e(i,null)),void delete this._loadTilePending[t.uid];if(!n)return this._loadTilePending[t.uid].forEach(e=>e(null,null)),void delete this._loadTilePending[t.uid];if(this.map._refreshExpiredTiles&&n){const i=e.aM(r);t.setExpiryData(i)}t._mrt=n,t._isHeaderLoaded=!0,t.state="loaded",this._loadTilePending[t.uid].forEach(e=>e(null,n)),this._loadTileLoaded[t.uid]=!0,delete this._loadTilePending[t.uid]},void 0,!0)}queryRasterArrayValueByAllBands(e,t,i){return new Promise((n,r)=>{this._loadTileForQuery(t,(o,s)=>{o?r(o):n(s?this.queryRasterArrayValueByBandId(e,t,i):null)})})}queryRasterArrayValue(t,i){const n=e.aT.convert(t),r=this.findLoadedParent(n);return r&&r._mrt?i.bands||!this.partial?this.queryRasterArrayValueByBandId(n,r,i):this.queryRasterArrayValueByAllBands(n,r,i):Promise.resolve(null)}findLoadedParent(t){const i=e.ae.fromLngLat(t,this.map.transform.tileSize),n=this.maxzoom+1,r=1<<n,o=Math.floor(i.x),s=Math.floor((i.x-o)*r),a=Math.floor(i.y*r),l=this.map.style.getSourceCache(this.id),c=new e.aQ(n,o,n,s,a);return l.findLoadedParent(c,this.minzoom)}}const ft={vector:ct,raster:ut,"raster-dem":class extends ut{constructor(e,t,i,n){super(e,t,i,n),this.type="raster-dem",this.maxzoom=22,this._options=Object.assign({type:"raster-dem"},t),this.encoding=t.encoding||"mapbox"}loadTile(t,i){const n=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function r(e,n){e&&(t.state="errored",i(e)),n&&(t.dem=n,t.dem.onDeserialize(),t.needsHillshadePrepare=!0,t.needsDEMTextureUpload=!0,t.state="loaded",i(null))}t.request=e.n(this.map._requestManager.transformRequest(n,e.R.Tile),function(n,o,s){if(delete t.request,t.aborted)t.state="unloaded",i(null);else if(n)t.state="errored",i(n);else if(o){const i=e.aM(s);this.map._refreshExpiredTiles&&t.setExpiryData(i);const n=ImageBitmap&&o instanceof ImageBitmap&&e.r(),a=1-(o.width-e.aP(o.width))/2;a<1||t.neighboringTiles||(t.neighboringTiles=this._getNeighboringTiles(t.tileID));const l=n?o:e.o.getImageData(o,a),c={uid:t.uid,tileID:t.tileID,source:this.id,type:this.t
2ype,scope:this.scope,rawImageData:l,encoding:this.encoding,padding:a};t.actor&&"expired"!==t.state||(t.actor=this.dispatcher.getActor(),t.actor.send("loadTile",c,r.bind(this),void 0,!0))}}.bind(this))}_getNeighboringTiles(t){const i=t.canonical,n=Math.pow(2,i.z),r=(i.x-1+n)%n,o=0===i.x?t.wrap-1:t.wrap,s=(i.x+1+n)%n,a=i.x+1===n?t.wrap+1:t.wrap,l={};return l[new e.aQ(t.overscaledZ,o,i.z,r,i.y).key]={backfilled:!1},l[new e.aQ(t.overscaledZ,a,i.z,s,i.y).key]={backfilled:!1},i.y>0&&(l[new e.aQ(t.overscaledZ,o,i.z,r,i.y-1).key]={backfilled:!1},l[new e.aQ(t.overscaledZ,t.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},l[new e.aQ(t.overscaledZ,a,i.z,s,i.y-1).key]={backfilled:!1}),i.y+1<n&&(l[new e.aQ(t.overscaledZ,o,i.z,r,i.y+1).key]={backfilled:!1},l[new e.aQ(t.overscaledZ,t.wrap,i.z,i.x,i.y+1).key]={backfilled:!1},l[new e.aQ(t.overscaledZ,a,i.z,s,i.y+1).key]={backfilled:!1}),l}},"raster-array":dt,geojson:class extends e.E{constructor(t,i,n,r){super(),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._loaded=!1,this.actor=n.getActor(),this.setEventedParent(r),this._data=i.data,this._options=Object.assign({},i),this._collectResourceTiming=i.collectResourceTiming,void 0!==i.maxzoom&&(this.maxzoom=i.maxzoom),void 0!==i.minzoom&&(this.minzoom=i.minzoom),i.type&&(this.type=i.type),i.attribution&&(this.attribution=i.attribution),this.promoteId=i.promoteId;const o=e.al/this.tileSize;this.workerOptions=Object.assign({source:this.id,scope:this.scope,cluster:i.cluster||!1,geojsonVtOptions:{buffer:(void 0!==i.buffer?i.buffer:128)*o,tolerance:(void 0!==i.tolerance?i.tolerance:.375)*o,extent:e.al,maxZoom:this.maxzoom,lineMetrics:i.lineMetrics||!1,generateId:i.generateId||!1},superclusterOptions:{maxZoom:void 0!==i.clusterMaxZoom?i.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,i.clusterMinPoints||2),extent:e.al,radius:(void 0!==i.clusterRadius?i.clusterRadius:50)*o,log:!1,generateId:i.generateId||!1},clusterProperties:i.clusterProperties,filter:i.filter,dynamic:i.dynamic},i.workerOptions)}onAdd(e){this.map=e,this.setData(this._data)}setData(e){return this._data=e,this._updateWorkerData(),this}updateData(t){if(!this._options.dynamic)return this.fire(new e.y(new Error("Can't call updateData on a GeoJSON source with dynamic set to false.")));if("string"!=typeof t&&("Feature"===t.type&&(t={type:"FeatureCollection",features:[t]}),"FeatureCollection"!==t.type))return this.fire(new e.y(new Error("Data to update should be a feature or a feature collection.")));if(this._coalesce&&"string"!=typeof t&&"string"!=typeof this._data&&"FeatureCollection"===this._data.type){const e=new Map;
2for(const t of this._data.features)e.set(t.id,t);for(const i of t.features)e.set(i.id,i);this._data.features=[...e.values()]}else this._data=t;return this._updateWorkerData(!0),this}getClusterExpansionZoom(e,t){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:e,source:this.id,scope:this.scope},t),this}getClusterChildren(e,t){return this.actor.send("geojson.getClusterChildren",{clusterId:e,source:this.id,scope:this.scope},t),this}getClusterLeaves(e,t,i,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,scope:this.scope,clusterId:e,limit:t,offset:i},n),this}_updateWorkerData(t=!1){if(this._pendingLoad)return void(this._coalesce=!0);this.fire(new e.z("dataloading",{dataType:"source"})),this._loaded=!1;const i=Object.assign({append:t},this.workerOptions);i.scope=this.scope;const n=this._data;"string"==typeof n?(i.request=this.map._requestManager.transformRequest(e.o.resolveURL(n),e.R.Source),i.request.collectResourceTiming=this._collectResourceTiming):i.data=JSON.stringify(n),this._pendingLoad=this.actor.send(`${this.type}.loadData`,i,(i,n)=>{if(this._loaded=!0,this._pendingLoad=null,i)this.fire(new e.y(i));else{const i={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&n&&n.resourceTiming&&n.resourceTiming[this.id]&&(i.resourceTiming=n.resourceTiming[this.id]),t&&(this._partialReload=!0),this.fire(new e.z("data",i)),this._partialReload=!1,this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(t),this._coalesce=!1)})}loaded(){return this._loaded}reload(){const t=e.B(this.id,this.scope);this.map.style.clearSource(t),this._updateWorkerData()}loadTile(t,i){const n=t.actor?"reloadTile":"loadTile";t.actor=this.actor;const r=this.map.style?this.map.style.getLut(this.scope):null,o=r?{image:r.image.clone()}:null,s=this._partialReload,a={type:this.type,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,lut:o,scope:this.scope,pixelRatio:e.o.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,brightness:this.map.style&&this.map.style.getBrightness()||0,extraShadowCaster:t.isExtraShadowCaster,scaleFactor:this.map.getScaleFactor(),partial:s,worldview:this.map.getWorldview(),indoor:this.map.indoor?this.map.indoor.getIndoorTileOptions(this.id,this.scope):null};t.request=this.actor.send(n,a,(e,r)=>s&&!r?(t.state="loaded",i(null)):(delete t.request,t.destroy(!1),t.aborted?i(null):e?i(e):(t.loadVectorData(r,this.map.painter,"reloadTile"===n),i(null))),void 0,"loadTile"===n)}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.aborted=!0}unloadTile(e,t){this.actor.send("removeTile",{uid:e.uid,type:this.t
2ype,source:this.id,scope:this.scope}),e.destroy()}onRemove(e){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return Object.assign({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends e.aU{constructor(e,t,i,n){super(e,t,i,n),this.roundZoom=!0,this.type="video",this.options=t}load(){this._loaded=!1;const t=this.options;this.urls=[];for(const i of t.urls)this.urls.push(this.map._requestManager.transformRequest(i,e.R.Source).url);e.aV(this.urls,(t,i)=>{this._loaded=!0,t?this.fire(new e.y(t)):i&&(this.video=i,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const i=this.video.seekable;t<i.start(0)||t>i.end(0)?this.fire(new e.y(new e.V(`sources.${this.id}`,null,`Playback for this video can be set only between the ${i.start(0)} and ${i.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const t=this.map.painter.context,i=t.gl;this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new e.T(t,this.video,i.RGBA8),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(t)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:e.aU,model:e.aX,"batched-model":class extends e.E{constructor(e,t,i,n){super(),this.type="batched-model",this.id=e,this.tileSize=512,this._options=t,this.tiles=this._options.tiles,this.maxzoom=t.maxzoom||19,this.minzoom=t.minzoom||0,this.roundZoom=!0,this.usedInConflation=!0,this.dispatcher=i,this.reparseOverscaled=!1,this.scheme="xyz",this._loaded=!1,this.setEventedParent(n)}onAdd(e){this.map=e,this.load()}reload(){this.cancelTileJSONRequest();const t=e.B(this.id,this.scope);this.load(()=>this.map.style.clearSource(t))}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}load(t){this._loaded=!1,this.fire(new e.z("dataloading",{dataType:"source"}));const i=Array.isArray(this.map._language)?this.map._language.join():this.map._language,n=this.map.getWorldview();this._tileJSONRequest=st(this._options,this.map._requestManager,i,n,(r,o)=>{this._tileJSONRequest=null,this._loaded=!0,r?(i&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${i}`),n&&2!==n.length&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${n}`),this.fire(new e.y(r))):o&&(Object.assign(this,o),o.bounds&&(this.tileBounds=new lt(o.bounds,this.minzoom,this.maxzoom)),R(o.tiles,this.map._requestManager._customAccessToken),this.fire(new e.z("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.z("data",{dataType:"source",sourceDataType:"content"}))),t&&t(r)})}hasTransition(){return!1}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loaded(){return this._loaded}loadTile(t,i){const n=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme)),r={request:this.map._requestManager.transformRequest(n,e.R.Tile),data:void 0,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.t
2ype,source:this.id,scope:this.scope,showCollisionBoxes:this.map.showCollisionBoxes,isSymbolTile:t.isSymbolTile,brightness:this.map.style&&this.map.style.getBrightness()||0,pixelRatio:e.o.devicePixelRatio,promoteId:this.promoteId};if(t.actor&&"expired"!==t.state)if("loading"===t.state)t.reloadCallback=i;else{if(t.buckets){const e=Object.values(t.buckets);for(const t of e)t.dirty=!0;return void(t.state="loaded")}t.request=t.actor.send("reloadTile",r,o.bind(this))}else t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",r,o.bind(this),void 0,!0);function o(e,n){return t.aborted?i(null):e&&404!==e.status?i(e):(this.map._refreshExpiredTiles&&n&&t.setExpiryData(n),t.loadModelData(n,this.map.painter),t.state="loaded",void i(null))}}serialize(){return Object.assign({},this._options)}},canvas:class extends e.aU{constructor(t,i,n,r){super(t,i,n,r),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.coordinates.some(e=>!Array.isArray(e)||2!==e.length||e.some(e=>"number"!=typeof e))||this.fire(new e.y(new e.V(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.y(new e.V(`sources.${t}`,null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new e.y(new e.V(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof HTMLCanvasElement||this.fire(new e.y(new e.V(`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 e.y(new e.V(`sources.${t}`,null,'missing required property "canvas"'))),this.options=i,this.animate=void 0===i.animate||i.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 e.y(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(e){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())return;if(0===Object.keys(this.tiles).length)return;const i=this.map.painter.context;this.texture?!t&&!this._playing||this.texture instanceof e.aW||this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.T(i,this.canvas,i.gl.RGBA8,{premultiply:!0}),this._prepareData(i)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}},custom:class extends e.E{constructor(t,i,n,r){super(),this.id=t,this.type="custom",this._dataType="raster",this._dispatcher=n,this._implementation=i,this.setEventedParent(r),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new e.y(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new e.y(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new lt(this._implementation.bounds,this.minzoom,this.maxzoom)),i.update=this._update.bind(this),i.clearTiles=this._clearTiles.bind(this),i.coveringTiles=this._coveringTiles.bind(this),Object.assign(this,e.aH(i,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return e.aH(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new e.z("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.z("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(t){this.map=t,this._loaded=!1,this.fire(new e.z("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(t),this.load()}onRemove(e){this._implementation.onRemove&&this._implementation.onRemove(e)}hasTile(e){if(this._implementation.hasTile){const{x:t,y:i,z:n}=e.canonical;return this._implementation.hasTile({x:t,y:i,z:n})}return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e,t){const{x:i,y:n,z:r}=e.tileID.canonical,o=new AbortController;e.request=Promise.resolve(this._implementation.loadTile({x:i,y:n,z:r},{signal:o.signal})).then(function(i){return delete e.request,e.aborted?(e.state="unloaded",t(null)):void 0===i?(e.state="errored",t(null)):null===i?(this.loadTileData(e,{width:this.tileSize,height:this.tileSize,data:null}),e.state="loaded",t(null)):function(e){return e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof ImageBitmap||e instanceof HTMLImageElement}(i)?(this.loadTileData(e,i),e.state="loaded",void t(null)):(e.state="errored",t(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}.bind(this)).catch(i=>{"AbortError"!==i.name&&(e.state="errored",t(i))}),e.request.cancel=()=>o.abort()}loadTileData(e,t){e.setTexture(t,this.map.painter)}
vendor: 19,084 bytes, line 2
2unloadTile(t,i){if(t.texture&&t.texture instanceof e.T?(t.destroy(!1),t.texture&&t.texture instanceof e.T&&this.map.painter.saveTileTexture(t.texture)):t.destroy(),this._implementation.unloadTile){const{x:e,y:i,z:n}=t.tileID.canonical;this._implementation.unloadTile({x:e,y:i,z:n})}i&&i()}abortTile(e,t){e.request&&e.request.cancel&&(e.request.cancel(),delete e.request),t&&t()}hasTransition(){return!1}_coveringTiles(){return this.map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map(e=>({x:e.canonical.x,y:e.canonical.y,z:e.canonical.z}))}_clearTiles(){const t=e.B(this.id,this.scope);this.map.style.clearSource(t)}_update(){this.fire(new e.z("data",{dataType:"source",sourceDataType:"content"}))}}},pt=function(t,i,n,r){const o=new ft[i.type](t,i,n,r);if(o.id!==t)throw new Error(`Expected Source id to be ${t} instead of ${o.id}`);return e.aY(["load","abort","unload","serialize","prepare"],o),o};function mt(e,t,i=""){return`${i}:${t.id||""}:${t.layer.id}:${function(e){if("layerId"in e)return`layer:${e.layerId}`;{const{featuresetId:t,importId:i}=e;return`featureset:${t}${i?`:import:${i}`:""}`}}(e.target)}`}function _t(e,t,i,n=""){if(e.uniqueFeatureID){const r=mt(e,t,n);if(i.has(r))return!0;i.add(r)}return!1}function gt(e,t,i,n,r=!1){const o=t.sourceCache.transform,s=t.sourceCache.tilesIn(e,t.has3DLayers,r);s.sort(xt);const a=[];for(const e of s){const s=e.tile.queryRenderedFeatures(t,e,i,n,o,r);Object.keys(s).length&&a.push({wrappedTileID:e.tile.tileID.wrapped().key,queryResults:s})}for(const i in t.layers){const r=t.layers[i];if(r.styleLayer){const i=r.styleLayer.queryRenderedFeatures(e,t.sourceCache,n);Object.keys(i).length&&a.push({wrappedTileID:0,queryResults:i})}}return 0===a.length?{}:function(e){const t={},i={};for(const n of e){const e=n.queryResults,r=n.wrappedTileID,o=i[r]=i[r]||{};for(const i in e){const n=e[i],r=o[i]=o[i]||{},s=t[i]=t[i]||[];for(const e of n)r[e.featureIndex]||(r[e.featureIndex]=!0,s.push(e))}}return t}(a)}function yt(e,t,i,n,r,o){const s={},a=n.queryRenderedSymbols(e),l=[];for(const e of Object.keys(a).map(Number))l.push(r[e]);l.sort(xt);for(const e of l){const n=e.featureIndex.lookupSymbolFeatures(a[e.bucketInstanceId],e.bucketIndex,e.sourceLayerIndex,t,i,o);for(const t in n){const i=s[t]=s[t]||[],r=n[t];r.sort((t,i)=>{const n=e.featureSortOrder;if(n){const e=n.indexOf(t.featureIndex);return n.indexOf(i.featureIndex)-e}return i.featureIndex-t.featureIndex});for(const e of r)i.push(e)}}return s}function vt(e,t){const i=e.getRenderableIds().map(t=>e.getTileByID(t)),n=[],r={};for(let e=0;e<i.length;e++){const o=i[e],s=o.tileID.canonical.key;r[s]||(r[s]=!0,o.querySourceFeatures(n,t))}return n}function xt(e,t){const i=e.tileID,n=t.tileID;return i.overscaledZ-n.overscaledZ||i.canonical.y-n.canonical.y||i.wrap-n.wrap||i.canonical.x-n.canonical.x}function bt(e,t){const i={};if(!t)return i;for(const n of e){const e=n.layerIds.map(e=>t.getLayer(e)).filter(Boolean);if(0!==e.length){n.layers=e,n.stateDependentLayerIds&&(n.stateDependentLayers=n.stateDependentLayerIds.map(t=>e.filter(e=>e.id===t)[0]));for(const t of e)i[t.fqid]=n}}return i}const wt=32,Tt=33,St=new Uint16Array(8184);for(let e=0;e<2046;e++){let t=e+2,i=0,n=0,r=0,o=0,s=0,a=0;for(1&t?r=o=s=wt:i=n=a=wt;(t>>=1)>1;){const e=i+r>>1,l=n+o>>1;1&t?(r=i,o=n,i=s,n=a):(i=r,n=o,r=s,o=a),s=e,a=l}const l=4*e;St[l+0]=i,St[l+1]=n,St[l+2]=r,St[l+3]=o}const Et=new Uint16Array(2178),It=new Uint8Array(1089),At=new Uint16Array(1089);function Mt(e){return 0===e?-.03125:32===e?.03125:0}const Ct={type:2,extent:e.al,loadGeometry:()=>[[new e.P(0,0),new e.P(e.al+1,0),new e.P(e.al+1,e.al+1),new e.P(0,e.al+1),new e.P(0,0)]]};class Pt{constructor(t,i,n,r,o,s){this.tileID=t,this.uid=e.b2(),this.uses=0,this.tileSize=i,this.tileZoom=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=o,r&&r.style&&(this._lastUpdatedBrightness=r.style.getBrightness()),this.expiredRequestCount=0,this.state="loading",r&&r.transform&&(this.projection=r.transform.projection),this.worldview=s,this._hasAppearances=null}registerFadeDuration(t){const i=t+this.timeAdded;i<e.o.now()||this.fadeEndTime&&i<this.fadeEndTime||(this.fadeEndTime=i)}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}get tileTransform(){return this._tileTransform||(this._tileTransform=e.aZ(this.tileID.canonical,this.projection)),this._tileTransform}loadVectorData(t,i,n){if(this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=bt(t.buckets,i.style),this.hasSymbolBuckets=!1;for(const t in this.buckets){const i=this.buckets[t];if(i instanceof e.b4){if(this.hasSymbolBuckets=!0,!n)break;i.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const t in this.buckets){const i=this.buckets[t];if(i instanceof e.b4&&i.hasRTLText){this.hasRTLText=!0,e.b5();break}}this.queryPadding=0;for(const e in this.buckets){const t=this.buckets[e],n=i.style.getOwnLayer(e);if(!n)continue;const r=n.queryRadius(t);this.queryPadding=Math.max(this.queryPadding,r)}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),t.lineAtlas&&(this.lineAtlas=t.lineAtlas),this._lastUpdatedBrightness=t.brightness}else this.collisionBoxArray=new e.b3}unloadVectorData(){if(this.hasData()){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}loadModelData(e,t,i){e&&(e.resourceTiming&&(this.resourceTiming=e.resourceTiming),this.buckets=Object.assign({},this.buckets,bt(e.buckets,t.style)),e.featureIndex&&(this.latestFeatureIndex=e.featureIndex))}getBucket(e){return this.buckets[e.fqid]}upload(t,i){for(const e in this.buckets){const n=this.buckets[e];if(n.uploadPending()){let e={},r=[],o={zoom:0,pitch:0,brightness:0,worldview:""};if(i){if(i.style){r=i.style.listImages();const t=n.layers[0],o=t.sourceLayer||"_geojsonTileLayer",s=i.style.getLayerSourceCache(t);s&&(e=s._state.getState(o,void 0))}o={zoom:i.transform.zoom||0,pitch:i.transform.pitch||0,brightness:i.style.getBrightness()||0,worldview:i.worldview||""}}n.upload(t,this.tileID.canonical,e,r,o)}}const n=t.gl,r=this.imageAtlas;r&&!r.uploaded&&(this.imageAtlasTexture=new e.T(t,r.image,n.RGBA8,{useMipmap:!!r.patternPositions.size}),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new e.T(t,this.glyphAtlasImage,n.R8),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new e.T(t,this.lineAtlas.image,n.R8),this.lineAtlas.uploaded=!0)}prepare(e,t,i){if(this.imageAtlas&&this.imageAtlasTexture&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture,i),!t||!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData)return;const n=t.style.getBrightness();null===this._hasAppearances&&(this._hasAppearances=this.hasAppearances(t)),(this._lastUpdatedBrightness||n||this._hasAppearances)&&(!this._hasAppearances&&this._lastUpdatedBrightness&&n&&Math.abs(this._lastUpdatedBrightness-n)<.001||(this.updateBuckets(t,this._lastUpdatedBrightness!==n),this._lastUpdatedBrightness=n))}evaluateQueryRenderedFeaturePadding(){let e=0;for(const t in this.buckets){const i=this.buckets[t];i.evaluateQueryRenderedFeaturePadding&&(e=Math.max(e,i.evaluateQueryRenderedFeaturePadding()))}return e}queryRenderedFeatures(t,i,n,r,o,s){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData&&!this.latestFeatureIndex.is3DTile)return{};const a=this.evaluateQueryRenderedFeaturePadding(),l=function(t,i){const n=e.bq([],[.5*t.width,.5*-t.height,1]);return e.br(n,n,[1,-1,0]),e.aB(n,n,t.calculateProjMatrix(i.toUnwrapped())),Float32Array.from(n)}(o,this.tileID);return this.latestFeatureIndex.query(t,{tilespaceGeometry:i,pixelPosMatrix:l,transform:r,availableImages:n,tileTransform:this.tileTransform,worldview:this.worldview,queryRadius:a})}querySourceFeatures(t,i){const n=this.latestFeatureIndex;if(!n||!n.rawTileData)return;const r=n.loadVTLayers(),o=i?i.sourceLayer:"",s=r._geojsonTileLayer||r[o];if(!s)return;const a=e.b6(i&&i.filter),{z:l,x:c,y:u}=this.tileID.canonical,h={z:l,x:c,y:u};for(let i=0;i<s.length;i++){const r=s.feature(i);if(a.needGeometry){const t=e.b7(r,!0);if(!a.filter(new e.ac(this.tileID.overscaledZ,{worldview:this.worldview}),t,this.tileID.canonical))continue}else if(!a.filter(new e.ac(this.tileID.overscaledZ,{worldview:this.worldview}),r))continue;const d=n.getId(r,o),f=new e.b8(r,l,c,u,d);f.tile=h,t.push(f)}}loaded(){return"loaded"===this.state||"errored"===this.state}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return!!this.imageAtlas&&!!this.imageAtlas.patternPositions.size}setExpiryData(t){const i=this.expirationTime;if(t.cacheControl){const i=e.b9(t.cacheControl);i["max-age"]&&(this.expirationTime=Date.now()+1e3*i["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const e=Date.now();let t=!1;if(this.expirationTime>e)t=!1;else if(i)if(this.expirationTime<i)t=!0;else{const n=this.expirationTime-i;n?this.expirationTime=e+Math.max(n,3e4):t=!0}else t=!0;t?(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)}refreshFeatureState(e){this.latestFeatureIndex&&(this.latestFeatureIndex.rawTileData||this.latestFeatureIndex.is3DTile)&&e&&this.updateBuckets(e)}hasAppearances(e){for(const t in this.buckets)if(e.style.hasLayer(t)&&this.buckets[t].layers.some(e=>e.appearances&&e.appearances.length>0))return!0;return!1}updateBuckets(t,i){if(!this.latestFeatureIndex)return;if(!t.style)return;const n=t.style.listImages(),r=t.style.getBrightness();for(const o in this.buckets){if(!t.style.hasLayer(o))continue;const s=this.buckets[o],a=s.layers[0],l=a.sourceLayer||"_geojsonTileLayer",c=t.style.getLayerSourceCache(a);let u={};c&&(u=c._state.getState(l,void 0));const h=this.imageAtlas?Object.fromEntries(this.imageAtlas.patternPositions):{},d=Object.keys(u).length>0&&!i;s.hasAppearances=s.layers.some(e=>e.appearances&&e.appearances.length>0);const f=d?s.stateDependentLayers:s.layers;if(d&&0!==s.stateDependentLayers.length||i){const e=this.latestFeatureIndex.loadVTLayers();s.update(u,e[l],n,h,f,i,r)}if(d&&0!==s.stateDependentLayers.length||i||s.hasAppearances){const e={zoom:t.transform.zoom,pitch:t.transform.pitch,brightness:t.style.getBrightness()||0,worldview:t.worldview};s.updateAppearances(this.tileID.canonical,u,n,e)}(s instanceof e.ba||s instanceof e.bb)&&t._terrain&&t._terrain.enabled&&c&&s.uploadPending()&&t._terrain._clearRenderCacheForTile(c.id,this.tileID);const p=t&&t.style&&t.style.getOwnLayer(o);p&&(this.queryPadding=Math.max(this.queryPadding,p.queryRadius(s)))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<e.o.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(t){this.symbolFadeHoldUntil=e.o.now()+t}setTexture(t,i){const n=i.context,r=n.gl;this.texture=this.texture||i.getTileTexture(t.width),this.texture&&this.texture instanceof e.T?this.texture.update(t):(this.texture=new e.T(n,t,r.RGBA8,{useMipmap:!0}),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE))}setDependencies(e,t){const i={};for(const e of t)i[e]=!0;this.dependencies[e]=i}hasDependency(e,t){for(const i of e){const e=this.dependencies[i];if(e)for(const i of t)if(e[i])return!0}return!1}clearQueryDebugViz(){}_makeDebugTileBoundsBuffers(t,i){if(!i||"mercator"===i.name||this._tileDebugBuffer)return;const n=e.bc(Ct,this.tileID.canonical,this.tileTransform)[0],r=new e.bd,o=new e.be;for(let e=0;e<n.length;e++){const{x:t,y:i}=n[e];r.emplaceBack(t,i),o.emplaceBack(e)}o.emplaceBack(0),this._tileDebugIndexBuffer=t.createIndexBuffer(o),this._tileDebugBuffer=t.createVertexBuffer(r,e.bf.members),this._tileDebugSegments=e.bg.simpleSegment(0,0,r.length,o.length)}_makeTileBoundsBuffers(t,i){if(this._tileBoundsBuffer||!i||"mercator"===i.name)return;const n=e.bc(Ct,this.tileID.canonical,this.tileTransform)[0];let r,o;if(this.isRaster){const t=function(t,i){const n=e.aZ(t,i),r=Math.pow(2,t.z);for(let o=0;o<Tt;o++)for(let s=0;s<Tt;s++){const a=e.a_((t.x+(s+Mt(s))/wt)/r),l=e.a$((t.y+(o+Mt(o))/wt)/r),c=i.project(a,l),u=o*Tt+s;Et[2*u+0]=Math.round((c.x*n.scale-n.x)*e.al),Et[2*u+1]=Math.round((c.y*n.scale-n.y)*e.al)}It.fill(0),At.fill(0);for(let e=2045;e>=0;e--){const t=4*e,i=St[t+0],n=St[t+1],r=St[t+2],o=St[t+3],s=i+r>>1,a=n+o>>1,l=s+a-n,c=a+i-s,u=n*Tt+i,h=o*Tt+r,d=a*Tt+s,f=Math.hypot((Et[2*u+0]+Et[2*h+0])/2-Et[2*d+0],(Et[2*u+1]+Et[2*h+1])/2-Et[2*d+1])>=16;It[d]=It[d]||(f?1:0),e<1022&&(It[d]=It[d]||It[(n+c>>1)*Tt+(i+l>>1)]||It[(o+c>>1)*Tt+(r+l>>1)])}const o=new e.b1,s=new e.b0;let a=0;function l(t,i){const n=i*Tt+t;return 0===At[n]&&(o.emplaceBack(Et[2*n+0],Et[2*n+1],t*e.al/wt,i*e.al/wt),At[n]=++a),At[n]-1}function c(e,t,i,n,r,o){const a=e+i>>1,u=t+n>>1;if(Math.abs(e-r)+Math.abs(t-o)>1&&It[u*Tt+a])c(r,o,e,t,a,u),c(i,n,r,o,a,u);else{const a=l(e,t),c=l(i,n),u=l(r,o);s.emplaceBack(a,c,u)}}return c(0,0,wt,wt,wt,0),c(wt,wt,0,0,0,wt),{vertices:o,indices:s}}(this.tileID.canonical,i);r=t.vertices,o=t.indices}else{r=new e.b1,o=new e.b0;for(const{x:e,y:t}of n)r.emplaceBack(e,t,0,0);const t=e.bh(r.int16.subarray(0,4*r.length),void 0,4);for(let e=0;e<t.length;e+=3)o.emplaceBack(t[e],t[e+1],t[e+2])}this._tileBoundsBuffer=t.createVertexBuffer(r,e.bi.members),this._tileBoundsIndexBuffer=t.createIndexBuffer(o),this._tileBoundsSegments=e.bg.simpleSegment(0,0,r.length,o.length)}_makeGlobeTileDebugBuffers(t,i){const n=i.projection;if(!n||"globe"!==n.name||i.freezeTileCoverage)return;const r=this.tileID.canonical,o=e.bj(r,i),s=e.bk(o),a=e.aj(i.zoom);let l;a>0&&(l=e.bl(new Float64Array(16),i.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(t,r,i,s,l,a),this._makeGlobeTileDebugTextBuffer(t,r,i,s,l,a)}_globePoint(t,i,n,r,o,s,a){let l=e.bm(t,i,n);if(s){const o=1<<n.z,c=e.aF(r.center.lng),u=e.aJ(r.center.lat),h=(n.x+.5)/o-c;let d=0;h>.5?d=-1:h<-.5&&(d=1);let f=(t/e.al+n.x)/o+d,p=(i/e.al+n.y)/o;f=(f-c)*r._pixelsPerMercatorPixel+c,p=(p-u)*r._pixelsPerMercatorPixel+u;const m=[f*r.worldSize,p*r.worldSize,0];e.af(m,m,s),l=e.bn(l,m,a)}return e.af(l,l,o)}_makeGlobeTileDebugBorderBuffer(t,i,n,r,o,s){const a=new e.bd,l=new e.be,c=new e.bo,u=(e,t,u,h,d)=>{const f=(u-e)/(d-1),p=(h-t)/(d-1),m=a.length;for(let u=0;u<d;u++){const h=e+u*f,d=t+u*p;a.emplaceBack(h,d);const _=this._globePoint(h,d,i,n,r,o,s);c.emplaceBack(_[0],_[1],_[2]),l.emplaceBack(m+u)}},h=e.al;u(0,0,h,0,16),u(h,0,h,h,16),u(h,h,0,h,16),u(0,h,0,0,16),this._tileDebugIndexBuffer=t.createIndexBuffer(l),this._tileDebugBuffer=t.createVertexBuffer(a,e.bf.members),this._globeTileDebugBorderBuffer=t.createVertexBuffer(c,e.bp.members),this._tileDebugSegments=e.bg.simpleSegment(0,0,a.length,l.length)}_makeGlobeTileDebugTextBuffer(t,i,n,r,o,s){const a=e.al/4,l=new e.bd,c=new e.b0,u=new e.bo,h=25;c.reserve(32),l.reserve(h),u.reserve(h);const d=(e,t)=>h*e+t;for(let e=0;e<h;e++){const t=e*a;for(let e=0;e<h;e++){const c=e*a;l.emplaceBack(c,t);const h=this._globePoint(c,t,i,n,r,o,s);u.emplaceBack(h[0],h[1],h[2])}}for(let e=0;e<4;e++)for(let t=0;t<4;t++){const i=d(e,t),n=d(e,t+1),r=d(e+1,t),o=d(e+1,t+1);c.emplaceBack(i,n,r),c.emplaceBack(r,n,o)}this._tileDebugTextIndexBuffer=t.createIndexBuffer(c),this._tileDebugTextBuffer=t.createVertexBuffer(l,e.bf.members),this._globeTileDebugTextBuffer=t.createVertexBuffer(u,e.bp.members),this._tileDebugTextSegments=e.bg.simpleSegment(0,0,h,32)}destroy(t=!0){for(const e in this.buckets)this.buckets[e].destroy(t);this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&(this.imageAtlasTexture.destroy(),delete this.imageAtlasTexture),this.glyphAtlasTexture&&(this.glyphAtlasTexture.destroy(),delete this.glyphAtlasTexture),this.lineAtlasTexture&&(this.lineAtlasTexture.destroy(),delete this.lineAtlasTexture),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),t&&this.texture&&this.texture instanceof e.T&&(this.texture.destroy(),delete this.texture),this.emissiveTexture&&this.emissiveTexture instanceof e.T&&(this.emissiveTexture.destroy(),delete this.emissiveTexture),this.hillshadeFBO&&(this.hillshadeFBO.destroy(),delete this.hillshadeFBO),this.dem&&delete this.dem,this.neighboringTiles&&delete this.neighboringTiles,this.demTexture&&(this.demTexture.destroy(),delete this.demTexture),this.rasterParticleState&&(this.rasterParticleState.destroy(),delete this.rasterParticleState),this.latestFeatureIndex=null,this.state="unloaded"}}e.bs.setPbf(e.bt);class Dt extends Pt{constructor(e,t,i,n,r){super(e,t,i,n,r),this._workQueuePerLayer=new Map,this._fetchQueuePerLayer=new Map,this._taskQueue=new Map,this._isHeaderLoaded=!1,this.textureDescriptorPerLayer=new Map,this.texturePerLayer=new Map}
2getLayers(){return this._mrt?Object.values(this._mrt.layers):[]}getLayer(e){return this._mrt&&this._mrt.getLayer(e)}setTexturePerLayer(t,i,n){const r=n.context,o=r.gl;let s=this.texturePerLayer.get(t)||n.getTileTexture(i.width);s&&s instanceof e.T?s.update(i,{premultiply:!1}):s=new e.T(r,i,o.RGBA8,{premultiply:!1}),this.texturePerLayer.has(t)||this.texturePerLayer.set(t,s)}flushQueues(e){const t=this._workQueuePerLayer.get(e)||[],i=this._fetchQueuePerLayer.get(e)||[];for(;t.length;)t.pop()();for(;i.length;)i.pop()()}flushAllQueues(){for(const e of this._workQueuePerLayer.keys()){const t=this._workQueuePerLayer.get(e)||[];for(;t.length;)t.pop()()}for(const e of this._fetchQueuePerLayer.keys()){const t=this._fetchQueuePerLayer.get(e)||[];for(;t.length;)t.pop()()}}fetchHeader(t=16384,i){const n=this._mrt=new e.bs(30),r=Object.assign({},this.requestParams,{headers:{Range:"bytes=0-"+(t-1)}});return this.entireBuffer=null,this.request=e.bu(r,(e,r,o)=>{if(e)i(e);else try{const e=n.getHeaderLength(r);if(e>t)return void(this.request=this.fetchHeader(e,i));n.parseHeader(r),this._isHeaderLoaded=!0;let s=0;for(const e of Object.values(n.layers))s=Math.max(s,e.dataIndex[e.dataIndex.length-1].lastByte);r.byteLength>=s&&(this.entireBuffer=r),i(null,this.entireBuffer||r,o)}catch(e){i(e)}}),this.request}fetchBandForRender(e,t,i,n){this.fetchBand(e,t,i,r=>{if(r)return void n(r);this.updateTextureDescriptor(e,t,i);const o=this.textureDescriptorPerLayer.get(t);n(null,o?o.img:null)})}fetchBand(t,i,n,r,o=!0){const s=this._mrt;if(!this._isHeaderLoaded||!s)return void r(new Error("Tile header is not ready"));const a=this.actor;if(!a)return void r(new Error("Can't fetch tile band without an actor"));let l;const c=e.B(String(n),e.B(this.tileID.key,t));let u=this._taskQueue.get(c);u?u.add(r):(u=new Set,u.add(r),this._taskQueue.set(c,u));const h=(e,t)=>{l.complete(e,t),e?r(e):(u.forEach(e=>e(null,t)),this._taskQueue.delete(c))},d=(e,t)=>{if(e)return r(e);const n=a.send("decodeRasterArray",{type:"raster-array",source:this.source,scope:this.scope,tileID:this.tileID,uid:this.uid,buffer:t,task:l},h,void 0,!0);if(null!==i){const e=this._workQueuePerLayer.get(i)||[];e.push(()=>{n&&n.cancel(),l.cancel()}),this._workQueuePerLayer.has(i)||this._workQueuePerLayer.set(i,e)}};let f;try{f=s.getLayer(t)}catch(e){if("reloading"===this.state)return;throw e}if(!f)return void r(new Error(`Unknown sourceLayer "${t}"`));if(f.hasDataForBand(n))return u.forEach(e=>e(null,null)),void this._taskQueue.delete(c);const p=f.getDataRange([n]);if(l=s.createDecodingTask(p),!l||l.tasks.length)if(null!==i&&this.flushQueues(i),this.entireBuffer)d(null,this.entireBuffer.slice(p.firstByte,p.lastByte+1));else{const t=Object.assign({},this.requestParams,{headers:{Range:`bytes=${p.firstByte}-${p.lastByte}`}}),n=e.bu(t,d);if(null!==i){const e=this._fetchQueuePerLayer.get(i)||[];e.push(()=>{n.cancel(),l.cancel()}),this._fetchQueuePerLayer.has(i)||this._fetchQueuePerLayer.set(i,e)}}}updateNeeded(e,t){return(!this.textureDescriptorPerLayer.get(e)||this.textureDescriptorPerLayer.get(e).band!==t||this.refreshedUponExpiration)&&"errored"!==this.state}updateTextureDescriptor(t,i,n){if(!this._mrt)return;const r=this._mrt.getLayer(t);if(!r||!r.hasBand(n)||!r.hasDataForBand(n))return;const{bytes:o,tileSize:s,buffer:a,offset:l,scale:c}=r.getBandView(n),u=s+2*a,h=new e.q({width:u,height:u},o),d=this.texturePerLayer.get(i);d&&d instanceof e.T&&d.update(h,{premultiply:!1}),this.textureDescriptorPerLayer.set(i,{layer:t,band:n,img:h,buffer:a,offset:l,tileSize:s,format:r.pixelFormat,mix:[c,256*c,65536*c,16777216*c]})}destroy(t=!1){if(super.destroy(t),delete this._mrt,!t)for(const t of this.texturePerLayer.values())t&&t instanceof e.T&&t.destroy();this.texturePerLayer.clear(),this.textureDescriptorPerLayer.clear(),this.fbo&&(this.fbo.destroy(),delete this.fbo),delete this.request,delete this.requestParams,this._isHeaderLoaded=!1}}class Rt{constructor(e,t){this.max=e,this.onRemove=t,this.reset()}reset(){for(const e in this.data)for(const t of this.data[e])t.timeout&&clearTimeout(t.timeout),this.onRemove(t.value);return this.data={},this.order=[],this}add(e,t,i){const n=e.wrapped().key;void 0===this.data[n]&&(this.data[n]=[]);const r={value:t,timeout:void 0};if(void 0!==i&&(r.timeout=setTimeout(()=>{this.remove(e,r)},i)),this.data[n].push(r),this.order.push(n),this.order.length>this.max){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value}getByKey(e){const t=this.data[e];return t?t[0].value:null}
2get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,t){if(!this.has(e))return this;const i=e.wrapped().key,n=void 0===t?0:this.data[i].indexOf(t),r=this.data[i][n];return this.data[i].splice(n,1),r.timeout&&clearTimeout(r.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(r.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(e){const t=[];for(const i in this.data)for(const n of this.data[i])e(n.value)||t.push(n);for(const e of t)this.remove(e.value.tileID,e)}}class Lt{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,t,i){const n=String(t);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][n]=this.stateChanges[e][n]||{},Object.assign(this.stateChanges[e][n],i),null===this.deletedStates[e]){this.deletedStates[e]={};for(const t in this.state[e])t!==n&&(this.deletedStates[e][t]=null)}else if(this.deletedStates[e]&&null===this.deletedStates[e][n]){this.deletedStates[e][n]={};for(const t in this.state[e][n])i[t]||(this.deletedStates[e][n][t]=null)}else for(const t in i)this.deletedStates[e]&&this.deletedStates[e][n]&&null===this.deletedStates[e][n][t]&&delete this.deletedStates[e][n][t]}removeFeatureState(e,t,i){if(null===this.deletedStates[e])return;const n=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},i&&void 0!==t)null!==this.deletedStates[e][n]&&(this.deletedStates[e][n]=this.deletedStates[e][n]||{},this.deletedStates[e][n][i]=null);else if(void 0!==t)if(this.stateChanges[e]&&this.stateChanges[e][n])for(i in this.deletedStates[e][n]={},this.stateChanges[e][n])this.deletedStates[e][n][i]=null;else this.deletedStates[e][n]=null;else this.deletedStates[e]=null}getState(e,t){const i=this.state[e]||{},n=this.stateChanges[e]||{},r=this.deletedStates[e];if(null===r)return{};if(void 0!==t){const e=String(t),o=Object.assign({},i[e],n[e]);if(r){const e=r[t];if(null===e)return{};for(const t in e)delete o[t]}return o}const o=Object.assign({},i,n);if(r)for(const e in r)delete o[e];return o}initializeTileState(e,t){e.refreshFeatureState(t)}coalesceChanges(e,t){const i={};for(const e in this.stateChanges){this.state[e]=this.state[e]||{};const t={};for(const i in this.stateChanges[e])this.state[e][i]||(this.state[e][i]={}),Object.assign(this.state[e][i],this.stateChanges[e][i]),t[i]=this.state[e][i];i[e]=t}for(const e in this.deletedStates){this.state[e]=this.state[e]||{};const t={};if(null===this.deletedStates[e])for(const i in this.state[e])t[i]={},this.state[e][i]={};else for(const i in this.deletedStates[e]){if(null===this.deletedStates[e][i])this.state[e][i]={};else if(this.state[e][i])for(const t of Object.keys(this.deletedStates[e][i]))delete this.state[e][i][t];t[i]=this.state[e][i]}i[e]=i[e]||{},Object.assign(i[e],t)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(i).length)for(const i in e)e[i].refreshFeatureState(t)}}class zt extends e.E{constructor(e,t,i){super(),this.id=e,this._onlySymbols=i,t.on("data",e=>{"source"===e.dataType&&"metadata"===e.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===e.dataType&&"content"===e.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform))}),t.on("error",()=>{this._sourceErrored=!0}),this._source=t,this._tiles={},this._cache=new Rt(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=t.minTileCacheSize,this._maxTileCacheSize=t.maxTileCacheSize,this._loadedParentTiles={},this.castsShadows=!1,this.tileCoverLift=0,this._coveredTiles={},this._shadowCasterTiles={},this._state=new Lt,this._isRaster="raster"===this._source.type||"raster-dem"===this._source.type||"raster-array"===this._source.type||"custom"===this._source.type&&"raster"===this._source._dataType}onAdd(e){this.map=e,this._minTileCacheSize=void 0===this._minTileCacheSize&&e?e._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=void 0===this._maxTileCacheSize&&e?e._maxTileC
vendor: 4,853 bytes, line 2
2acheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(const e in this._tiles)if(!this._tiles[e].loaded())return!1;return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(e,t){return e.isSymbolTile=this._onlySymbols,e.isExtraShadowCaster=this._shadowCasterTiles[e.tileID.key],this._source.loadTile(e,t)}_unloadTile(e){if(this._source.unloadTile)return this._source.unloadTile(e)}_abortTile(e){if(this._source.abortTile)return this._source.abortTile(e)}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const t in this._tiles){const i=this._tiles[t];i.upload(e,this.map?this.map.painter:void 0),i.prepare(this.map.style.imageManager,this.map?this.map.painter:null,this._source.scope)}}getIds(){return Object.values(this._tiles).map(e=>e.tileID).sort(Ot).map(e=>e.key)}getRenderableIds(t,i){const n=[];for(const e in this._tiles)this._isIdRenderable(+e,t,i)&&n.push(this._tiles[e]);return t?n.sort((t,i)=>{const n=t.tileID,r=i.tileID,o=new e.P(n.canonical.x,n.canonical.y)._rotate(this.transform.angle),s=new e.P(r.canonical.x,r.canonical.y)._rotate(this.transform.angle);return n.overscaledZ-r.overscaledZ||s.y-o.y||s.x-o.x}).map(e=>e.tileID.key):n.map(e=>e.tileID).sort(Ot).map(e=>e.key)}hasRenderableParent(e){const t=this.findLoadedParent(e,0);return!!t&&this._isIdRenderable(t.tileID.key)}_isIdRenderable(e,t,i){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(t||!this._tiles[e].holdingForFade())&&(i||!this._shadowCasterTiles[e])}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)"errored"!==this._tiles[e].state&&this._reloadTile(+e,"reloading")}}_reloadTile(e,t){const i=this._tiles[e];i&&("loading"!==i.state&&(i.state=t),this._loadTile(i,this._tileLoaded.bind(this,i,e,t)))}_tileLoaded(t,i,n,r,o){if(r){if(t.state="errored",404!==r.status)this._source.fire(new e.y(r,{tile:t}));else{if(this._source.fire(new e.z("data",{dataType:"source",sourceDataType:"error",sourceId:this._source.id,tile:t})),!(t.tileID.key in this._loadedParentTiles))return;if("raster-dem"===this._source.type&&this.usedForTerrain&&this.map.painter.terrain){const e=this.map.painter.terrain;this.update(this.transform,e.getScaledDemTileSize(),!0),e.resetTileLookupCache(this.id)}else this.update(this.transform)}return}t.timeAdded=e.o.now(),"expired"===n&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(i,t),"raster-dem"===this._source.type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null);let s=new Map;o&&o.responseHeaders&&(s=o.responseHeaders),this._source.fire(new e.z("data",{dataType:"source",tile:t,coord:t.tileID,sourceCacheId:this.id,responseHeaders:s}))}_backfillDEM(e){const t=this.getRenderableIds();for(let n=0;n<t.length;n++){const r=t[n];if(e.neighboringTiles&&e.neighboringTiles[r]){const t=this.getTileByID(r);i(e,t),i(t,e)}}function i(e,t){if(!e.dem||e.dem.borderReady)return;e.needsHillshadePrepare=!0,e.needsDEMTextureUpload=!0;let i=t.tileID.canonical.x-e.tileID.canonical.x;const n=t.tileID.canonical.y-e.tileID.canonical.y,r=Math.pow(2,e.tileID.canonical.z),o=t.tileID.key;0===i&&0===n||Math.abs(n)>1||(Math.abs(i)>1&&(1===Math.abs(i+r)?i+=r:1===Math.abs(i-r)&&(i-=r)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,i,n),e.neighboringTiles&&e.neighboringTiles[o]&&(e.neighboringTiles[o].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,t,i,n){for(const r in this._tiles){let o=this._tiles[r];if(n[r]||!o.hasData()||o.tileID.overscaledZ<=t||o.tileID.overscaledZ>i)continue;let s=o.tileID;for(;o&&o.tileID.overscaledZ>t+1;){const e=o.tileID.scaledTo(o.tileID.overscaledZ-1);o=this._tiles[e.key],o&&o.hasData()&&(s=e)}let a=s;for(;a.overscaledZ>t;)if(a=a.scaledTo(a.overscaledZ-1),e[a.key]){n[s.key]=s;break}}}findLoadedParent(e,t){if(e.key in this._loadedParentTiles){const i=this._loadedParentTiles[e.key];return i&&i.tileID.overscaledZ>=t?i:null}for(let i=e.overscaledZ-1;i>=t;i--){const t=e.scaledTo(i),n=this._getLoadedTile(t);if(n)return n}}_getLoadedTile(e){const t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(this._source.reparseOverscaled?e.wrapped().key:e.canonical.key)}updateCacheSize(e,t){t=t||this._source.tileSize;const i=Math.ceil(e.width/t)+1,n=Math.ceil(e.height/t)+1,r=Math.floor(i*n*5),o="number"==typeof this._minTileCacheSize?Math.max(this._minTileCacheSize,r):r,s="number"==typeof this._maxTileC
2acheSize?Math.min(this._maxTileCacheSize,o):o;this._cache.setMaxSize(s)}handleWrapJump(e){const t=Math.round((e-(void 0===this._prevLng?e:this._prevLng))/360);if(this._prevLng=e,t){const e={};for(const i in this._tiles){const n=this._tiles[i];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+t),e[n.tileID.key]=n}this._tiles=e;for(const e in this._timers)clearTimeout(this._timers[e]),delete this._timers[e];for(const e in this._tiles)this._setTileReloadTimer(+e,this._tiles[e])}}update(t,i,n,r,o){if(this.transform=t,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage)return;if(this.usedForTerrain&&!n)return;this.updateCacheSize(t,i),"globe"!==this.transform.projection.name&&this.handleWrapJump(this.transform.center.lng),this._shadowCasterTiles={},this._coveredTiles={};const s="batched-model"===this._source.type;let a,l=this._source.maxzoom;const c=this.map&&this.map.painter?this.map.painter._terrain:null;if(c&&c.sourceCache===this&&c.attenuationRange()){const e=c.attenuationRange()[0],t=Math.floor(e)-Math.log2(c.getDemUpscale());l>t&&(l=t)}if(this.used||this.usedForTerrain){if(this._source.tileID)a=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(t=>new e.aQ(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y));else if(0!==this.tileCoverLift){const r=t.clone();r.tileCoverLift=this.tileCoverLift,a=r.coveringTiles({tileSize:i||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:l,roundZoom:this._source.roundZoom&&!n,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:s}),this._source.minzoom<=1&&"globe"===t.projection.name&&(a.push(new e.aQ(1,0,1,0,0)),a.push(new e.aQ(1,0,1,1,0)),a.push(new e.aQ(1,0,1,0,1)),a.push(new e.aQ(1,0,1,1,1)))}else if(a=t.coveringTiles({tileSize:i||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:l,roundZoom:this._source.roundZoom&&!n,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:s}),this._source.hasTile){const e=this._source.hasTile.bind(this._source);a=a.filter(t=>e(t))}}else a=[];if(a.length>0&&"globe"!==this.transform.projection.name&&!this.usedForTerrain&&!Ft(this._source.type)){const e=t.coveringZoomLevel({tileSize:i||this._source.tileSize,roundZoom:this._source.roundZoom&&!n}),l=Math.min(e,this._source.maxzoom);if(s){const e=t.extendTileCover(a,l);for(const t of e)a.push(t)}else if(o){const e=t.extendTileCoverToNearPlane(a,this.transform.getFrustum(l),l);for(const t of e)a.push(t)}else if(this.castsShadows&&r){const e=t.extendTileCover(a,l,r,16);for(const t of e)this._shadowCasterTiles[t.key]=!0,a.push(t)}}const u=this._updateRetainedTiles(a);if(Ft(this._source.type)&&0!==a.length){const t={},i={},n=Object.keys(u);for(const r of n){const n=u[r],o=this._tiles[r];if(!o||o.fadeEndTime&&o.fadeEndTime<=e.o.now())continue;const s=this.findLoadedParent(n,Math.max(n.overscaledZ-zt.maxOverzooming,this._source.minzoom));s&&(this._addTile(s.tileID),t[s.tileID.key]=s.tileID),i[r]=n}const r=a[a.length-1].overscaledZ;for(const e in this._tiles){const t=this._tiles[e];if(u[e]||!t.hasData())continue;let n=t.tileID;for(;n.overscaledZ>r;){n=n.scaledTo(n.overscaledZ-1);const r=this._tiles[n.key];if(r&&r.hasData()&&i[n.key]){u[e]=t.tileID;break}}}for(const e in t)u[e]||(this._coveredTiles[e]=!0,u[e]=t[e])}for(const e in u)this._tiles[e].clearFadeHold();const h=e.bv(this._tiles,u);for(const e of h){const t=this._tiles[e];t.hasSymbolBuckets&&!t.holdingForFade()?t.setHoldDuration(this.map._fadeDuration):t.hasSymbolBuckets&&!t.symbolFadeFinished()||this._removeTile(+e)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(+e)}_updateRetainedTiles(e){const t={};if(0===e.length)return t;const i={},n=e.reduce((e,t)=>Math.min(e,t.overscaledZ),1/0),r=e[0].overscaledZ,o=Math.max(r-zt.maxOverzooming,this._source.minzoom),s=Math.max(r+zt.maxUnderzooming,this._source.minzoom),a={};for(const i of e){const e=this._addTile(i);t[i.key]=i,e.hasData()||n<this._source.maxzoom&&(a[i.key]=i)}this._retainLoadedChildren(a,n,s,t);for(const n of e){let e=this._tiles[n.key];if(e.hasData())continue;if(n.canonical.z>=this._source.maxzoom){const e=n.children(this._source.maxzoom)[0],i=this.getTile(e);
vendor: 4,263 bytes, line 2
2if(i&&i.hasData()){t[e.key]=e;continue}}else{const e=n.children(this._source.maxzoom);if(t[e[0].key]&&t[e[1].key]&&t[e[2].key]&&t[e[3].key])continue}let r=e.wasRequested();for(let s=n.overscaledZ-1;s>=o;--s){const o=n.scaledTo(s);if(i[o.key])break;if(i[o.key]=!0,e=this.getTile(o),!e&&r&&(e=this._addTile(o)),e&&(t[o.key]=o,r=e.wasRequested(),e.hasData()))break}}return t}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const t=[];let i,n=this._tiles[e].tileID;for(;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){i=this._loadedParentTiles[n.key];break}t.push(n.key);const e=n.scaledTo(n.overscaledZ-1);if(i=this._getLoadedTile(e),i)break;n=e}for(const e of t)this._loadedParentTiles[e]=i}}_addTile(t){let i=this._tiles[t.key];if(i)return!0!==i.isExtraShadowCaster||!!this._shadowCasterTiles[t.key]||this._reloadTile(t.key,"reloading"),i;i=this._cache.getAndRemove(t),i&&(this._setTileReloadTimer(t.key,i),i.tileID=t,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,i)));const n=Boolean(i);if(!n){const e=this.map?this.map.painter:null,n=this._source.tileSize*t.overscaleFactor();i="raster-array"===this._source.type?new Dt(t,n,this.transform.tileZoom,e,this._isRaster):new Pt(t,n,this.transform.tileZoom,e,this._isRaster,this._source.worldview),this._loadTile(i,this._tileLoaded.bind(this,i,t.key,i.state))}return i.uses++,this._tiles[t.key]=i,n||this._source.fire(new e.z("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i}_setTileReloadTimer(e,t){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const i=t.getExpiryTimeout();i&&(this._timers[e]=setTimeout(()=>{this._reloadTile(e,"expired"),delete this._timers[e]},i))}_removeTile(e){const t=this._tiles[e];t&&(t.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),t.uses>0||(t.hasData()&&"reloading"!==t.state||"empty"===t.state?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(+e);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(t,i,n){const r=[],o=this.transform;if(!o)return r;const s="globe"===o.projection.name,a=e.aF(o.center.lng);for(const l in this._tiles){const c=this._tiles[l];if(n&&c.clearQueryDebugViz(),c.holdingForFade())continue;let u;if(s){const t=c.tileID.canonical;if(0===t.z){const i=[Math.abs(e.aA(a,...kt(t,-1))-a),Math.abs(e.aA(a,...kt(t,1))-a)];u=[0,2*i.indexOf(Math.min(...i))-1]}else{const i=[Math.abs(e.aA(a,...kt(t,-1))-a),Math.abs(e.aA(a,...kt(t,0))-a),Math.abs(e.aA(a,...kt(t,1))-a)];u=[i.indexOf(Math.min(...i))-1]}}else u=[0];for(const e of u){const n=t.containsTile(c,o,i,e);n&&r.push(n)}}return r}getShadowCasterCoordinates(){return this._getRenderableCoordinates(!1,!0)}getVisibleCoordinates(e){return this._getRenderableCoordinates(e)}_getRenderableCoordinates(e,t){const i=this.getRenderableIds(e,t).map(e=>this._tiles[e].tileID),n="globe"===this.transform.projection.name;for(const e of i)e.projMatrix=this.transform.calculateProjMatrix(e.toUnwrapped()),e.expandedProjMatrix=n?this.transform.calculateProjMatrix(e.toUnwrapped(),!1,!0):e.projMatrix;return i}sortCoordinatesByDistance(e){const t=e.slice(),i=this.transform._camera.position,n=this.transform._camera.forward(),r={};for(const e of t){const t=1/(1<<e.canonical.z);r[e.key]=((e.canonical.x+.5)*t+e.wrap-i[0])*n[0]+((e.canonical.y+.5)*t-i[1])*n[1]-i[2]*n[2]}return t.sort((e,t)=>r[e.key]-r[t.key]),t}hasTransition(){if(this._source.hasTransition())return!0;if(Ft(this._source.type))for(const t in this._tiles){const i=this._tiles[t];if(void 0!==i.fadeEndTime&&i.fadeEndTime>=e.o.now())return!0}return!1}setFeatureState(e,t,i){this._state.updateState(e=e||"_geojsonTileLayer",t,i)}removeFeatureState(e,t,i){this._state.removeFeatureState(e=e||"_geojsonTileLayer",t,i)}getFeatureState(e,t){return this._state.getState(e=e||"_geojsonTileLayer",t)}
vendor: 4,501 bytes, line 2
2setDependencies(e,t,i){const n=this._tiles[e];n&&n.setDependencies(t,i)}reloadTilesForDependencies(e,t){for(const i in this._tiles)this._tiles[i].hasDependency(e,t)&&this._reloadTile(+i,"reloading");this._cache.filter(i=>!i.hasDependency(e,t))}_preloadTiles(t,i){if(!this._sourceLoaded){const e=()=>{this._sourceLoaded&&(this._source.off("data",e),this._preloadTiles(t,i))};return void this._source.on("data",e)}const n=new Map,r=Array.isArray(t)?t:[t],o=this.map.painter.terrain,s=this.usedForTerrain&&o?o.getScaledDemTileSize():this._source.tileSize;for(const e of r){const t=e.coveringTiles({tileSize:s,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const e of t)n.set(e.key,e);this.usedForTerrain&&e.updateElevation(!1)}const a=Array.from(n.values());e.bw(a,(e,t)=>{const i=new Pt(e,this._source.tileSize*e.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster,this._source.worldview);this._loadTile(i,e=>{"raster-dem"===this._source.type&&i.dem&&this._backfillDEM(i),t(e,i)})},i)}}function Ot(e,t){const i=Math.abs(2*e.wrap)-+(e.wrap<0),n=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||n-i||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function Ft(e){return"raster"===e||"image"===e||"video"===e||"custom"===e}function kt(e,t){const i=1<<e.z;return[e.x/i+t,(e.x+1)/i+t]}zt.maxOverzooming=10,zt.maxUnderzooming=3;class Bt{constructor(e){this.style=e,this.layersGotHidden=!1,this.layers=[]}processLayersChanged(){this.layers=[];const e=!1,t=!1;for(const i in this.style._mergedLayers){const n=this.style._mergedLayers[i];if("fill-extrusion"===n.type||"building"===n.type)this.layers.push({layer:n,visible:e,visibilityChanged:t});else if("model"===n.type){const i=this.style.getLayerSource(n);i&&"batched-model"===i.type&&this.layers.push({layer:n,visible:e,visibilityChanged:t})}}}onNewFrame(e){this.layersGotHidden=!1;for(const t of this.layers){const i=t.layer;let n=!1;"fill-extrusion"===i.type?n=!i.isHidden(e)&&i.paint.get("fill-extrusion-opacity")>0:"building"===i.type?n=!i.isHidden(e)&&i.paint.get("building-opacity")>0:"model"===i.type&&(n=!i.isHidden(e)&&i.paint.get("model-opacity").constantOr(1)>0),this.layersGotHidden=this.layersGotHidden||!n&&t.visible,t.visible=n}}updateZOffset(e,t){this.currentBuildingBuckets=[];for(const e of this.layers){const i=e.layer,n=this.style.getLayerSourceCache(i);let r=1;"fill-extrusion"===i.type?r=e.visible?i.paint.get("fill-extrusion-vertical-scale"):0:"building"===i.type&&(r=e.visible?i.paint.get("building-vertical-scale"):0);let o=n?n.getTile(t):null;if(!o&&n)for(const e in n._tiles){const i=n._tiles[e];if(t.canonical.isChildOf(i.tileID.canonical)){o=i;break}}this.currentBuildingBuckets.push({bucket:o?o.getBucket(i):null,tileID:o?o.tileID:t,verticalScale:r})}e.hasAnyZOffset=!1;let i=!1;for(let n=0;n<e.symbolInstances.length;n++){const r=e.symbolInstances.get(n),o=r.zOffset,s=this._getHeightAtTileOffset(t,r.tileAnchorX,r.tileAnchorY);r.zOffset=s!==Number.NEGATIVE_INFINITY?s:o,i||o===r.zOffset||(i=!0),e.hasAnyZOffset||0===r.zOffset||(e.hasAnyZOffset=!0)}i&&(e.zOffsetBuffersNeedUpload=!0,e.zOffsetSortDirty=!0)}_mapCoordToOverlappingTile(t,i,n,r){let o=i,s=n;if(t.canonical.z!==r.canonical.z){const a=r.canonical,l=1/(1<<t.canonical.z-a.z);o=(i+t.canonical.x*e.al)*l-a.x*e.al|0,s=(n+t.canonical.y*e.al)*l-a.y*e.al|0}return{tileX:o,tileY:s}}_getHeightAtTileOffset(e,t,i){let n,r;for(let o=0;o<this.layers.length;++o){const s=this.layers[o].layer;if("fill-extrusion"!==s.type&&"building"!==s.type)continue;const{bucket:a,tileID:l,verticalScale:c}=this.currentBuildingBuckets[o];if(!a)continue;const{tileX:u,tileY:h}=this._mapCoordToOverlappingTile(e,t,i,l),d=a.getHeightAtTileCoord(u,h);d&&void 0!==d.height&&(d.hidden?n=d.height:r=Math.max(d.height*c,r||0))}if(void 0!==r)return r;for(let r=0;r<this.layers.length;++r){const o=this.layers[r];if("model"!==o.layer.type||!o.visible)continue;const{bucket:s,tileID:a}=this.currentBuildingBuckets[r];if(!s)continue;const{tileX:l,tileY:c}=this._mapCoordToOverlappingTile(e,t,i,a),u=s.getHeightAtTileCoord(l,c);if(u&&!u.hidden)return void 0===u.height&&void 0!==n?Math.min(u.maxHeight,n)*u.verticalScale:u.height?u.height*u.verticalScale:Number.NEGATIVE_INFINITY}return this.layersGotHidden?0:Number.NEGATIVE_INFINITY}}function Nt(t,i){const n={};for(const e in t)"ref"!==e&&(n[e]=t[e]);
vendor: 4,602 bytes, line 2
2return e.bx.forEach(e=>{e in i&&(n[e]=i[e])}),n}function Vt(e){e=e.slice();const t=Object.create(null);for(let i=0;i<e.length;i++)t[e[i].id]=e[i];for(let i=0;i<e.length;i++)"ref"in e[i]&&(e[i]=Nt(e[i],t[e[i].ref]));return e}const Ut={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setSlot:"setSlot",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight",setTerrain:"setTerrain",setFog:"setFog",setSnow:"setSnow",setRain:"setRain",setCamera:"setCamera",setLights:"setLights",setProjection:"setProjection",addImport:"addImport",removeImport:"removeImport",updateImport:"updateImport",addIconset:"addIconset",removeIconset:"removeIconset"};function jt(e,t,i){i.push({command:Ut.addSource,args:[e,t[e]]})}function Gt(e,t,i){t.push({command:Ut.removeSource,args:[e]}),i[e]=!0}function qt(e,t,i,n){Gt(e,i,n),jt(e,t,i)}function Ht(t,i,n){let r;for(r in t[n])if(t[n].hasOwnProperty(r)&&"data"!==r&&!e.by(t[n][r],i[n][r]))return!1;for(r in i[n])if(i[n].hasOwnProperty(r)&&"data"!==r&&!e.by(t[n][r],i[n][r]))return!1;return!0}function $t(t,i,n,r,o,s){let a;for(a in i=i||{},t=t||{})t.hasOwnProperty(a)&&(e.by(t[a],i[a])||n.push({command:s,args:[r,a,i[a],o]}));for(a in i)i.hasOwnProperty(a)&&!t.hasOwnProperty(a)&&(e.by(t[a],i[a])||n.push({command:s,args:[r,a,i[a],o]}))}function Wt(e){return e.id}function Zt(e,t){return e[t.id]=t,e}function Xt(t,i,n){const r=i.createTileMatrix(t,t.worldSize,n.toUnwrapped());return e.aB(new Float32Array(16),t.projMatrix,r)}function Yt(e,t,i){if(t.projection.name===i.projection.name)return e.projMatrix;const n=i.clone();return n.setProjection(t.projection),Xt(n,t.getProjection(),e)}function Kt(e,t,i){return t.name===i.projection.name?e.projMatrix:Xt(i,t,e)}class Jt{constructor(e,t){this.reset(e,t)}reset(e,t){this.points=e||[],this._distances=[0];for(let e=1;e<this.points.length;e++)this._distances[e]=this._distances[e-1]+this.points[e].dist(this.points[e-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(t||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(1===this.points.length)return this.points[0];t=e.aA(t,0,1);let i=1,n=this._distances[i];const r=t*this.paddedLength+this.padding;for(;n<r&&i<this._distances.length;)n=this._distances[++i];const o=i-1,s=this._distances[o],a=n-s,l=a>0?(r-s)/a:0;return this.points[o].mult(1-l).add(this.points[i].mult(l))}}class Qt{constructor(e,t,i){const n=this.boxCells=[],r=this.circleCells=[];this.xCellCount=Math.ceil(e/i),this.yCellCount=Math.ceil(t/i);for(let e=0;e<this.xCellCount*this.yCellCount;e++)n.push([]),r.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=t,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/t,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(e,t,i,n,r){this._forEachCell(t,i,n,r,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(r)}insertCircle(e,t,i,n){this._forEachCell(t-n,i-n,t+n,i+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(i),this.circles.push(n)}_insertBoxCell(e,t,i,n,r,o){this.boxCells[r].push(o)}_insertCircleCell(e,t,i,n,r,o){this.circleCells[r].push(o)}_query(e,t,i,n,r,o){if(i<0||e>this.width||n<0||t>this.height)return!r&&[];const s=[];if(e<=0&&t<=0&&this.width<=i&&this.height<=n){if(r)return!0;for(let e=0;e<this.boxKeys.length;e++)s.push({key:this.boxKeys[e],x1:this.bboxes[4*e],y1:this.bboxes[4*e+1],x2:this.bboxes[4*e+2],y2:this.bboxes[4*e+3]});for(let e=0;e<this.circleKeys.length;e++){const t=this.circles[3*e],i=this.circles[3*e+1],n=this.circles[3*e+2];s.push({key:this.circleKeys[e],x1:t-n,y1:i-n,x2:t+n,y2:i+n})}return o?s.filter(o):s}return this._forEachCell(e,t,i,n,this._queryCell,s,{hitTest:r,seenUids:{box:{},circle:{}}},o),r?s.length>0:s}_queryCircle(e,t,i,n,r){const o=e-i,s=e+i,a=t-i,l=t+i;if(s<0||o>this.width||l<0||a>this.height)return!n&&[];const c=[];return this._forEachCell(o,a,s,l,this._queryCellCircle,c,{hitTest:n,circle:{x:e,y:t,radius:i},seenUids:{box:{},circle:{}}},r),n?c.length>0:c}query(e,t,i,n,r){return this._query(e,t,i,n,!1,r)}
2hitTest(e,t,i,n,r){return this._query(e,t,i,n,!0,r)}hitTestCircle(e,t,i,n){return this._queryCircle(e,t,i,!0,n)}_queryCell(e,t,i,n,r,o,s,a){const l=s.seenUids,c=this.boxCells[r];if(null!==c){const r=this.bboxes;for(const u of c)if(!l.box[u]){l.box[u]=!0;const c=4*u;if(e<=r[c+2]&&t<=r[c+3]&&i>=r[c+0]&&n>=r[c+1]&&(!a||a(this.boxKeys[u]))){if(s.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[u],x1:r[c],y1:r[c+1],x2:r[c+2],y2:r[c+3]})}}}const u=this.circleCells[r];if(null!==u){const r=this.circles;for(const c of u)if(!l.circle[c]){l.circle[c]=!0;const u=3*c;if(this._circleAndRectCollide(r[u],r[u+1],r[u+2],e,t,i,n)&&(!a||a(this.circleKeys[c]))){if(s.hitTest)return o.push(!0),!0;{const e=r[u],t=r[u+1],i=r[u+2];o.push({key:this.circleKeys[c],x1:e-i,y1:t-i,x2:e+i,y2:t+i})}}}}}_queryCellCircle(e,t,i,n,r,o,s,a){const l=s.circle,c=s.seenUids,u=this.boxCells[r];if(null!==u){const e=this.bboxes;for(const t of u)if(!c.box[t]){c.box[t]=!0;const i=4*t;if(this._circleAndRectCollide(l.x,l.y,l.radius,e[i+0],e[i+1],e[i+2],e[i+3])&&(!a||a(this.boxKeys[t])))return o.push(!0),!0}}const h=this.circleCells[r];if(null!==h){const e=this.circles;for(const t of h)if(!c.circle[t]){c.circle[t]=!0;const i=3*t;if(this._circlesCollide(e[i],e[i+1],e[i+2],l.x,l.y,l.radius)&&(!a||a(this.circleKeys[t])))return o.push(!0),!0}}}_forEachCell(e,t,i,n,r,o,s,a){const l=this._convertToXCellCoord(e),c=this._convertToYCellCoord(t),u=this._convertToXCellCoord(i),h=this._convertToYCellCoord(n);for(let d=l;d<=u;d++)for(let l=c;l<=h;l++)if(r.call(this,e,t,i,n,this.xCellCount*l+d,o,s,a))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,t,i,n,r,o){const s=n-e,a=r-t,l=i+o;return l*l>s*s+a*a}_circleAndRectCollide(e,t,i,n,r,o,s){const a=(o-n)/2,l=Math.abs(e-(n+a));if(l>a+i)return!1;const c=(s-r)/2,u=Math.abs(t-(r+c));if(u>c+i)return!1;if(l<=a||u<=c)return!0;const h=l-a,d=u-c;return h*h+d*d<=i*i}}const ei=0,ti=1,ii=2,ni=Math.tan(85*Math.PI/180);function ri(t,i,n,r,o,s,a){const l=e.bC();if(n)if("globe"===s.name){const t=e.bD(o,i);e.aB(l,l,t)}else{const t=e.bE([],a);l[0]=t[0],l[1]=t[1],l[4]=t[2],l[5]=t[3],r||e.bB(l,l,o.angle)}else e.aB(l,o.labelPlaneMatrix,t);return l}function oi(e,t,i,n,r,o,s){const a=ri(e,t,i,n,r,o,s);return"globe"===o.name&&i||(a[2]=a[6]=a[10]=a[14]=0),a}function si(t,i,n,r,o,s,a){if(n){if("globe"===s.name){const l=ri(t,i,n,r,o,s,a);return e.bl(l,l),e.aB(l,t,l),l}{const i=e.bz(t),n=e.bA([]);return n[0]=a[0],n[1]=a[1],n[4]=a[2],n[5]=a[3],e.aB(i,i,n),r||e.bB(i,i,-o.angle),i}}return o.glCoordMatrix}function ai(t,i,n,r){const o=[t,i,n,1];n?e.aC(o,o,r):yi(o,o,r);const s=o[3];return o[0]/=s,o[1]/=s,o[2]/=s,o}function li(e,t){return Math.min(.5+e/t*.5,1.5)}function ci(e,t){const i=e[0]/e[3],n=e[1]/e[3];return i>=-t[0]&&i<=t[0]&&n>=-t[1]&&n<=t[1]}function ui(t,i,n,r,o,s,a,l,c,u,h=1){const d=n.transform,f=r?t.textSizeData:t.iconSizeData,p=e.bK(f,n.transform.zoom,h),m="globe"===d.projection.name,_=[256/n.width*2+1,256/n.height*2+1],g=r?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;g.clear();let y=null;m&&(y=r?t.text.globeExtVertexArray:t.icon.globeExtVertexArray);const v=t.lineVertexArray,x=r?t.text.placedSymbolArray:t.icon.placedSymbolArray,b=n.transform.width/n.transform.height;let w,T=!1;for(let r=0;r<x.length;r++){const h=x.get(r),{numGlyphs:m,writingMode:S}=h;if(S!==e.bL.vertical||T||w===e.bL.horizontal||(T=!0),w=S,(h.hidden||S===e.bL.vertical)&&!T){gi(m,g);continue}T=!1;const E=new e.P(h.tileAnchorX,h.tileAnchorY),I="road"===t.elevationType,A=!!d.elevation||I;let{x:M,y:C,z:P}=d.projection.projectTilePoint(E.x,E.y,u.canonical),D=null;if(A){const e=I?t.getElevationFeatureForText(r):null;D={getElevation:c,elevation:d.elevation,elevationFeature:e};const[i,n,o]=c(E,d.elevation,e);M+=i,C+=n,P+=o}const R=[M,C,P,1];if(e.aC(R,R,i),!ci(R,_)){gi(m,g);continue}const L=R[3],z=li(n.transform.getCameraToCenterDistance(d.projection),L),O=e.bM(f,p,h),F=a?O/z:O*z,k=ai(M,C,P,o);if(k[3]<=0){gi(m,g);continue}let B={};const N=e.an(t.layers[0].layout.get("text-max-angle")),V=Math.cos(N),U=a?null:D,j=fi(h,F,!1,l,i,o,s,t.glyphOffsetArray,v,g,y,k,E,B,b,U,d.projection,u,a,V);T=j.useVertical,U&&j.needsFlipping&&(B={}),(j.notEnoughRoom||T||j.needsFlipping&&fi(h,F,!0,l,i,o,s,t.glyphOffsetArray,v,g,y,k,E,B,b,U,d.projection,u,a,V).notEnoughRoom)&&gi(m,g)}r?(t.text.dynamicLayoutVertexBuffer.updateData(g),y&&t.text.globeExtVertexBuffer&&t.text.globeExtVertexBuffer.updateData(y)):(t.icon.dynamicLayoutVertexBuffer.updateData(g),y&&t.icon.globeExtVertexBuffer&&t.icon.globeExtVertexBuffer.updateData(y))}function hi(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_){const{lineStartIndex:g,glyphStartIndex:y,segment:v}=a,x=y+a.numGlyphs,b=g+a.lineLength,w=t.getoffsetX(y),T=t.getoffsetX(x-1),S=_i(e*w,i,n,r,o,s,v,g,b,l,c,u,h,d,!0,f,p,m,_);if(!S)return null;const E=_i(e*T,i,n,r,o,s,v,g,b,l,c,u,h,d,!0,f,p,m,_);return E?{first:S,last:E}:null}function di(t,i,n,r){return t===e.bL.horizontal&&Math.abs(r)>Math.abs(n)?{useVertical:!0}:t===e.bL.vertical?r>0?{needsFlipping:!0}:null:i!==ei&&function(e,t){return 0===e||Math.abs(t/e)>ni}(n,r)?i===ti?{needsFlipping:!0}:null:n<0?{needsFlipping:!0}:null}function fi(t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v,x){const b=i/24,w=t.lineOffsetX*b,T=t.lineOffsetY*b,{lineStartIndex:S,glyphStartIndex:E,numGlyphs:I,segment:A,writingMode:M,flipState:C}=t,P=S+t.lineLength,D=t=>{if(h){const[i,n,r]=t.up,o=u.length;e.bN(h,o+0,i,n,r),e.bN(h,o+1,i,n,r),e.bN(h,o+2,i,n,r),e.bN(h,o+3,i,n,r)}const[i,n,r]=t.point;e.bO(u,i,n,r,t.angle)};if(I>1){const e=hi(b,l,w,T,n,d,f,t,c,s,p,_,!1,g,y,v,x);if(!e)return{notEnoughRoom:!0};if(r&&!n){let[i,n,r]=e.first.point,[o,s,l]=e.last.point;[i,n]=ai(i,n,r,a),[o,s]=ai(o,s,l,a);const c=di(M,C,(o-i)*m,s-n);if(t.flipState=c&&c.needsFlipping?ti:ii,c)return c}D(e.first);for(let e=E+1;e<E+I-1;e++){const t=_i(b*l.getoffsetX(e),w,T,n,d,f,A,S,P,c,s,p,_,!1,!1,g,y,v,x);if(!t)return u.length-=4*(e-E),{notEnoughRoom:!0};D(t)}D(e.last)}else{if(r&&!n){const i=ai(f.x,f.y,0,o),n=S+A+1,r=new e.P(c.getx(n),c.gety(n)),s=ai(r.x,r.y,0,o),a=s[3]>
20?s:mi(f,r,i,1,o,void 0,g,y.canonical),l=di(M,C,(a[0]-i[0])*m,a[1]-i[1]);if(t.flipState=l&&l.needsFlipping?ti:ii,l)return l}const i=_i(b*l.getoffsetX(E),w,T,n,d,f,A,S,P,c,s,p,_,!1,!1,g,y,v,x);if(!i)return{notEnoughRoom:!0};D(i)}return{}}function pi(e,t,i,n,r){const{x:o,y:s,z:a}=n.projectTilePoint(e.x,e.y,t);if(!r)return ai(o,s,a,i);const[l,c,u]=r.getElevation(e,r.elevation,r.elevationFeature);return ai(o+l,s+c,a+u,i)}function mi(t,i,n,r,o,s,a,l){const c=pi(t.sub(i)._unit()._add(t),l,o,a,s);return e.av(c,n,c),e.aw(c,c),e.bH(c,n,c,r)}function _i(t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v){const x=r?t-i:t+i;let b=x>0?1:-1,w=0;r&&(b*=-1,w=Math.PI),b<0&&(w+=Math.PI);let T=l+a+(b>0?0:1)|0,S=o,E=o,I=0,A=0;const M=Math.abs(x),C=[],P=[];let D=s,R=D,L=e.bF([]);const z=()=>mi(R,D,E,M-I+1,h,f,_,g.canonical);for(;I+A<=M;){if(T+=b,T<l||T>=c)return null;if(E=S,R=D,C.push(E),p&&P.push(R),D=new e.P(u.getx(T),u.gety(T)),S=d[T],!S){const e=pi(D,g.canonical,h,_,f);S=e[3]>0?d[T]=e:z()}I+=A;const t=e.av([],S,E),i=e.bG(E,S);if(n&&i>0&&A>0&&e.bJ(L,t)/(A*i)<v)return null;A=i,L=t}m&&f&&(d[T]&&(S=z(),A=e.bG(E,S),L=e.av([],S,E)),d[T]=S);const O=(M-I)/A,F=D.sub(R)._mult(O)._add(R),k=e.bH([],E,L,O);let B=[0,0,1],N=L[0],V=L[1];if(y&&(B=_.upVector(g.canonical,F.x,F.y),0!==B[0]||0!==B[1]||1!==B[2])){const t=[B[2],0,-B[0]],i=e.bI([],B,t);e.aw(t,t),e.aw(i,i),N=e.bJ(L,t),V=e.bJ(L,i)}if(n){const t=e.bI([],B,L);e.aw(t,t),e.bH(k,k,t,n*b)}const U=w+Math.atan2(V,N);return C.push(k),p&&P.push(F),{point:k,angle:U,path:C,tilePath:P,up:B}}function gi(e,t){const i=t.length,n=i+4*e;t.resize(n),t.float32.fill(-1/0,4*i,4*n)}function yi(e,t,i){const n=t[0],r=t[1];return e[0]=i[0]*n+i[4]*r+i[12],e[1]=i[1]*n+i[5]*r+i[13],e[3]=i[3]*n+i[7]*r+i[15],e}const vi=100;class xi{constructor(e,t,i=new Qt(e.width+200,e.height+200,25),n=new Qt(e.width+200,e.height+200,25)){this.transform=e,this.grid=i,this.ignoredGrid=n,this.pitchfactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+vi,this.screenBottomBoundary=e.height+vi,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.fogState=t}placeCollisionBox(t,i,n,r,o,s,a,l,c,u,h){let d=n.projectedAnchorX,f=n.projectedAnchorY,p=n.projectedAnchorZ;const m=n.tileAnchorX,_=n.tileAnchorY,g=n.elevation,y=n.tileID,v=t.getProjection();if(g&&y){const[e,t,i]=v.upVector(y.canonical,n.tileAnchorX,n.tileAnchorY),r=v.upVectorScale(y.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;d+=e*g*r,f+=t*g*r,p+=i*g*r}const x="globe"===t.projection.name,b="globe"===t.projection.name?e.aj(this.transform.zoom):0;if(y&&x&&b<1&&!s){const t=1<<y.canonical.z,i=e.bP(m,_);e.bQ(i,i,1/e.al),e.bR(i,i,e.bP(y.canonical.x,y.canonical.y)),e.bQ(i,i,1/t),e.bS(i,i,e.bP(r[0],r[1])),i[0]=e.bT(i[0],-.5,.5),e.bQ(i,i,e.al);const n=e.bU(i[0],i[1],e.al/(2*Math.PI),1);e.aC(n,n,o),d=e.ak(d,n[0],b),f=e.ak(f,n[1],b),p=e.ak(p,n[2],b)}const w=this.projectAndGetPerspectiveRatio(u,d,f,p,n.tileID,"globe"===v.name||!!g||this.transform.pitch>0,v),T=c*w.perspectiveRatio,S=(n.x1*i+a.x-n.padding)*T+w.point.x,E=(n.y1*i+a.y-n.padding)*T+w.point.y,I=(n.x2*i+a.x+n.padding)*T+w.point.x,A=(n.y2*i+a.y+n.padding)*T+w.point.y,M=w.perspectiveRatio<=.55||w.occluded;return!this.isInsideGrid(S,E,I,A)||!l&&this.grid.hitTest(S,E,I,A,h)||M?{box:[],offscreen:!1,occluded:w.occluded}:{box:[S,E,I,A],offscreen:this.isOffscreen(S,E,I,A),occluded:!1}}placeCollisionCircles(t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_){const g=[],y=this.transform.elevation,v=t.getProjection(),x="road"===t.elevationType,b=!!y||x,w=e.bV.getAtTileOffsetFunc(_,this.transform.center.lat,this.transform.worldSize,v),T=new e.P(n.tileAnchorX,n.tileAnchorY),S=new e.P(n.tileAnchorX,n.tileAnchorY);let{x:E,y:I,z:A}=v.projectTilePoint(S.x,S.y,_.canonical),M=null;if(b){const e=x?t.getElevationFeatureForText(r):null;M={getElevation:w,elevation:y,elevationFeature:e};const[i,n,o]=w(T,y,e);E+=i,I+=n,A+=o}const C="globe"===v.name,P=this.projectAndGetPerspectiveRatio(l,E,I,A,_,C||!!y||this.transform.pitch>0,v),{perspectiveRatio:D}=P,R=(d?a/D:a*D)/e.bY,L=ai(E,I,A,c),z=n.lineOffsetX*R,O=n.lineOffsetY*R,F=e.an(t.layers[0].layout.get("text-max-angle")),k=Math.cos(F),B=P.signedDistanceFromCamera>0?hi(R,s,z,O,x&&1===n.flipState,L,S,n,o,c,{},b&&!d?M:null,d&&b,v,_,d,k):null;let N=!1,V=!1,U=!0;if(B&&!P.occluded){const t=.5*p*D+m,n=new e.P(-100,-100),r=new e.P(this.screenRightBoundary,this.screenBottomBoundary),o=new Jt,{first:s,last:a}=B,l=s.path.length;let c=[];for(let e=l-1;e>=1;e--)c.push(s.path[e]);for(let e=1;e<a.path.length;e++)c.push(a.path[e]);const d=2.5*t;u&&(c=c.map(([e,t,i],n)=>(b&&!C&&(i=w(n<l-1?s.tilePath[l-1-n]:a.tilePath[n-l+2],y,M.elevationFeature)[2]),ai(e,t,i,u))),c.some(e=>e[3]<=0)&&(c=[]));let _=[];
vendor: 4,610 bytes, line 2
2if(c.length>0){let t=1/0,i=-1/0,o=1/0,s=-1/0;for(const e of c)t=Math.min(t,e[0]),o=Math.min(o,e[1]),i=Math.max(i,e[0]),s=Math.max(s,e[1]);i>=n.x&&t<=r.x&&s>=n.y&&o<=r.y&&(_=[c.map(t=>new e.P(t[0],t[1]))],(t<n.x||i>r.x||o<n.y||s>r.y)&&(_=e.bW(_,n.x,n.y,r.x,r.y)))}for(const e of _){o.reset(e,.25*t);let n=0;n=o.length<=.5*t?1:Math.ceil(o.paddedLength/d)+1;for(let e=0;e<n;e++){const r=e/Math.max(n-1,1),s=o.lerp(r),a=s.x+vi,l=s.y+vi;g.push(a,l,t,0);const c=a-t,u=l-t,d=a+t,p=l+t;if(U=U&&this.isOffscreen(c,u,d,p),V=V||this.isInsideGrid(c,u,d,p),!i&&this.grid.hitTestCircle(a,l,t,f)&&(N=!0,!h))return{circles:[],offscreen:!1,collisionDetected:N,occluded:!1}}}}return{circles:!h&&N||!V?[]:g,offscreen:U,collisionDetected:N,occluded:P.occluded}}queryRenderedSymbols(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const i=[];let n=1/0,r=1/0,o=-1/0,s=-1/0;for(const a of t){const t=new e.P(a.x+vi,a.y+vi);n=Math.min(n,t.x),r=Math.min(r,t.y),o=Math.max(o,t.x),s=Math.max(s,t.y),i.push(t)}const a=this.grid.query(n,r,o,s).concat(this.ignoredGrid.query(n,r,o,s)),l={},c={};for(const t of a){const n=t.key;if(void 0===l[n.bucketInstanceId]&&(l[n.bucketInstanceId]={}),l[n.bucketInstanceId][n.featureIndex])continue;const r=[new e.P(t.x1,t.y1),new e.P(t.x2,t.y1),new e.P(t.x2,t.y2),new e.P(t.x1,t.y2)];e.bX(i,r)&&(l[n.bucketInstanceId][n.featureIndex]=!0,void 0===c[n.bucketInstanceId]&&(c[n.bucketInstanceId]=[]),c[n.bucketInstanceId].push(n.featureIndex))}return c}insertCollisionBox(e,t,i,n,r){(t?this.ignoredGrid:this.grid).insert({bucketInstanceId:i,featureIndex:n,collisionGroupID:r},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,t,i,n,r){const o=t?this.ignoredGrid:this.grid,s={bucketInstanceId:i,featureIndex:n,collisionGroupID:r};for(let t=0;t<e.length;t+=4)o.insertCircle(s,e[t],e[t+1],e[t+2])}projectAndGetPerspectiveRatio(t,i,n,r,o,s,a){const l=[i,n,r,1];let c=!1;if(r||this.transform.pitch>0){if(e.aC(l,l,t),this.fogState&&o&&"globe"!==a.name){const t=function(t,i,n,r,o,s){const a=s.calculateFogTileMatrix(o),l=[i,n,r];return e.af(l,l,a),Ge(t,e.ag(l),s.pitch,s._fov)}(this.fogState,i,n,r,o.toUnwrapped(),this.transform);c=t>.9}}else yi(l,l,t);const u=l[3];return{point:new e.P((l[0]/u+1)/2*this.transform.width+vi,(-l[1]/u+1)/2*this.transform.height+vi),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(a)/u*.5,1.5),signedDistanceFromCamera:u,occluded:s&&l[2]>u||c}}isOffscreen(e,t,i,n){return i<vi||e>=this.screenRightBoundary||n<vi||t>this.screenBottomBoundary}isInsideGrid(e,t,i,n){return i>=0&&e<this.gridRightBoundary&&n>=0&&t<this.gridBottomBoundary}getViewportMatrix(){const t=e.bA([]);return e.br(t,t,[-100,-100,0]),t}}class bi{constructor(e,t,i,n){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):n&&i?1:0,this.placed=i}isHidden(){return 0===this.opacity&&!this.placed}}class wi{constructor(e,t,i,n,r,o=!1){this.text=new bi(e?e.text:null,t,i,r),this.icon=new bi(e?e.icon:null,t,n,r),this.clipped=o}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Ti{constructor(e,t,i,n=!1){this.text=e,this.icon=t,this.skipFade=i,this.clipped=n}}class Si{constructor(){this.invProjMatrix=e.bC(),this.viewportMatrix=e.bC(),this.circles=[]}}class Ei{constructor(e,t,i,n,r){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=i,this.bucketIndex=n,this.tileID=r}}class Ii{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){const t=++this.maxGroupID;this.collisionGroups[e]={ID:t,predicate:e=>e.collisionGroupID===t}}return this.collisionGroups[e]}}function Ai(t,i,n,r,o){const{horizontalAlign:s,verticalAlign:a}=e.c1(t),l=-(s-.5)*i,c=-(a-.5)*n,u=e.c2(t,r);return new e.P(l+u[0]*o,c+u[1]*o)}function Mi(t,i,n,r,o){const s=new e.P(t,i);return n&&s._rotate(r?o:-o),s}class Ci{constructor(e,t,i,n,r,o){this.transform=e.clone(),this.projection=e.projection.name,this.collisionIndex=new xi(this.transform,r),this.buildingIndex=o,this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=t,this.retainedQueryData={},this.collisionGroups=new Ii(i),this.collisionCircleArrays={},this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={},this.lastReplacementSourceUpdateTime=0}getBucketParts(t,i,n,r,o=1){const s=n.getBucket(i),a=n.latestFeatureIndex;if(!s||!a||i.fqid!==s.layerIds[0])return;const l=s.layers[0].layout,c=s.layers[0].paint,u=n.collisionBoxArray,h=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ
2),d=n.tileSize/e.al,f=n.tileID.toUnwrapped();this.transform.setProjection(s.projection);const p=(m=n.tileID,_=s.getProjection(),g=this.transform,_.name===this.projection?g.calculateProjMatrix(m.toUnwrapped()):Xt(g,_,m));var m,_,g;const y="map"===l.get("text-pitch-alignment"),v="map"===l.get("text-rotation-alignment");i.compileFilter(i.options);const x=i.dynamicFilter(),b=i.dynamicFilterNeedsFeature(),w=this.transform.calculatePixelsToTileUnitsMatrix(n),T=oi(p,n.tileID.canonical,y,v,this.transform,s.getProjection(),w);let S=null;const E=s.getProjection().createInversionMatrix(this.transform,n.tileID.canonical);if(y){const t=si(p,n.tileID.canonical,y,v,this.transform,s.getProjection(),w);S=e.aB([],this.transform.labelPlaneMatrix,t)}let I=null;x&&n.latestFeatureIndex&&(I={unwrappedTileID:f,dynamicFilter:x,dynamicFilterNeedsFeature:b}),this.retainedQueryData[s.bucketInstanceId]=new Ei(s.bucketInstanceId,a,s.sourceLayerIndex,s.index,n.tileID);const[A,M]=s.layers[0].layout.get("text-size-scale-range"),C=e.aA(o,A,M),[P,D]=l.get("icon-size-scale-range"),R=e.aA(o,P,D),L={bucket:s,layout:l,paint:c,posMatrix:p,invMatrix:E,mercatorCenter:[e.aF(this.transform.center.lng),e.aJ(this.transform.center.lat)],textLabelPlaneMatrix:T,labelToScreenMatrix:S,clippingData:I,scale:h,textPixelRatio:d,holdingForFade:n.holdingForFade(),collisionBoxArray:u,partiallyEvaluatedTextSize:e.bK(s.textSizeData,this.transform.zoom,C),partiallyEvaluatedIconSize:e.bK(s.iconSizeData,this.transform.zoom,R),collisionGroup:this.collisionGroups.get(s.sourceID),latestFeatureIndex:n.latestFeatureIndex};if(r)for(const e of s.sortKeyRanges){const{sortKey:i,symbolInstanceStart:n,symbolInstanceEnd:r}=e;t.push({sortKey:i,symbolInstanceStart:n,symbolInstanceEnd:r,parameters:L})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:s.symbolInstances.length,parameters:L})}attemptAnchorPlacement(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v,x){const{textOffset0:b,textOffset1:w,crossTileID:T}=p,S=[b,w],E=Ai(e,o,s,S,a),I=this.collisionIndex.placeCollisionBox(_,a,t,i,n,r,Mi(E.x,E.y,l,c,this.transform.angle),f,u,h,d.predicate);if(y){const e=_.getSymbolInstanceIconSize(x,this.transform.zoom,p.placedIconSymbolIndex);if(0===this.collisionIndex.placeCollisionBox(_,e,y,i,n,r,Mi(E.x,E.y,l,c,this.transform.angle),f,u,h,d.predicate).box.length)return}if(I.box.length>0){let t;return this.prevPlacement&&this.prevPlacement.variableOffsets[T]&&this.prevPlacement.placements[T]&&this.prevPlacement.placements[T].text&&(t=this.prevPlacement.variableOffsets[T].anchor),this.variableOffsets[T]={textOffset:S,width:o,height:s,anchor:e,textScale:a,prevAnchor:t},this.markUsedJustification(_,e,p,g),_.allowVerticalPlacement&&(this.markUsedOrientation(_,g,p),this.placedOrientations[T]=g),{shift:E,placedGlyphBoxes:I}}}placeLayerBucketPart(t,i,n,r,o=1){const{bucket:s,layout:a,paint:l,posMatrix:c,textLabelPlaneMatrix:u,labelToScreenMatrix:h,clippingData:d,textPixelRatio:f,mercatorCenter:p,invMatrix:m,holdingForFade:_,collisionBoxArray:g,partiallyEvaluatedTextSize:y,partiallyEvaluatedIconSize:v,collisionGroup:x,latestFeatureIndex:b}=t.parameters,w=a.get("text-optional"),T=a.get("icon-optional"),S=a.get("text-allow-overlap"),E=a.get("icon-allow-overlap"),I="map"===a.get("text-rotation-alignment"),A="map"===a.get("icon-rotation-alignment"),M="map"===a.get("text-pitch-alignment"),C=l.get("symbol-z-offset"),P="sea"===a.get("symbol-elevation-reference"),D=a.get("symbol-placement"),[R,L]=a.get("text-size-scale-range"),[z,O]=a.get("icon-size-scale-range"),F=e.aA(o,R,L),k=e.aA(o,z,O),B=a.get("text-variable-anchor"),N=I&&"point"!==D,V=A&&"point"!==D,U=B&&s.hasTextData(),j=s.hasIconTextFit()&&U&&s.hasIconData();this.transform.setProjection(s.projection);const G=U||N,q=V||j;let H=S&&(E||!s.hasIconData()||T),$=E&&(S||!s.hasTextData()||w);const W=!C.isConstant();!s.collisionArrays&&g&&s.deserializeCollisionBoxes(g),n&&r&&s.updateCollisionDebugBuffers(this.transform.zoom,g,F,k);const Z=(t,r,o)=>{const{crossTileID:l,numVerticalGlyphVertices:g}=t;let A=null;if(d&&d.dynamicFilterNeedsFeature||W){const e=this.retainedQueryData[s.bucketInstanceId];A=b.loadFeature({featureIndex:t.featureIndex,bucketIndex:e.bucketIndex,sourceLayerIndex:e.s
vendor: 4,895 bytes, line 2
2ourceLayerIndex,layoutVertexArrayOffset:0});const i=A.properties?A.properties.worldview:null;if(s.localizable&&s.worldview&&"string"==typeof i)if("all"===i)A.properties.$localized=!0;else{if(!i.split(",").includes(s.worldview))return;A.properties.$localized=!0,A.properties.worldview=s.worldview}}if(d&&!(0,d.dynamicFilter)({zoom:this.transform.zoom,pitch:this.transform.pitch,worldview:s.worldview},A,this.retainedQueryData[s.bucketInstanceId].tileID.canonical,new e.P(t.tileAnchorX,t.tileAnchorY),this.transform.calculateDistanceTileData(d.unwrappedTileID)))return this.placements[l]=new Ti(!1,!1,!1,!0),void i.add(l);const D=C.evaluate(A,{});if(i.has(l))return;if(_)return void(this.placements[l]=new Ti(!1,!1,!1));let R=!1,L=!1,z=!0,O=!1,F=!1,k=null,N={box:null,offscreen:null,occluded:null},V={box:null},U=null,j=null,Z=null,X=0,Y=0,K=0;o.textFeatureIndex?X=o.textFeatureIndex:t.useRuntimeCollisionCircles&&(X=t.featureIndex),o.verticalTextFeatureIndex&&(Y=o.verticalTextFeatureIndex);const J=s.elevationFeatures?s.elevationFeatures[t.elevationFeatureIndex]:void 0,Q=i=>{i.tileID=this.retainedQueryData[s.bucketInstanceId].tileID;const n=this.transform.elevation;i.elevation=P?D:D+e.bV.getAtTileOffset(i.tileID,new e.P(i.tileAnchorX,i.tileAnchorY),n,J),i.elevation+=t.zOffset},ee=o.textBox;if(ee){Q(ee);const i=i=>{let n=e.bL.horizontal;if(s.allowVerticalPlacement&&!i&&this.prevPlacement){const e=this.prevPlacement.placedOrientations[l];e&&(this.placedOrientations[l]=e,n=e,this.markUsedOrientation(s,n,t))}return n},n=(t,i)=>{if(s.allowVerticalPlacement&&g>0&&o.verticalTextBox){for(const n of s.writingModes)if(n===e.bL.vertical?(N=i(),V=N):N=t(),N&&N.box&&N.box.length)break}else N=t()};if(B){let a=B;if(this.prevPlacement&&this.prevPlacement.variableOffsets[l]){const e=this.prevPlacement.variableOffsets[l];a.indexOf(e.anchor)>0&&(a=a.filter(t=>t!==e.anchor),a.unshift(e.anchor))}const u=(e,i,n)=>{const o=s.getSymbolInstanceTextSize(y,t,this.transform.zoom,r),l=(e.x2-e.x1)*o+2*e.padding,u=(e.y2-e.y1)*o+2*e.padding,h=t.hasIconTextFit&&!E?i:null;h&&Q(h);let d={box:[],offscreen:!1,occluded:!1};const _=S?2*a.length:a.length;for(let i=0;i<_;++i){const _=this.attemptAnchorPlacement(a[i%a.length],e,p,m,G,l,u,o,I,M,f,c,x,i>=a.length,t,r,s,n,h,y,v);if(_&&(d=_.placedGlyphBoxes,d&&d.box&&d.box.length)){R=!0,k=_.shift;break}}return d};n(()=>u(ee,o.iconBox,e.bL.horizontal),()=>{const t=o.verticalTextBox;return t&&Q(t),s.allowVerticalPlacement&&!(N&&N.box&&N.box.length)&&g>0&&t?u(t,o.verticalIconBox,e.bL.vertical):{box:null,offscreen:null,occluded:null}}),N&&(R=N.box,z=N.offscreen,O=N.occluded);const h=i(!(!N||!N.box));if(!R&&this.prevPlacement){const e=this.prevPlacement.variableOffsets[l];e&&(this.variableOffsets[l]=e,this.markUsedJustification(s,e.anchor,t,h))}}else{const a=(i,n)=>{const o=s.getSymbolInstanceTextSize(y,t,this.transform.zoom,r),a=this.collisionIndex.placeCollisionBox(s,o,i,p,m,G,new e.P(0,0),S,f,c,x.predicate);return a&&a.box&&a.box.length&&(this.markUsedOrientation(s,n,t),this.placedOrientations[l]=n),a};n(()=>a(ee,e.bL.horizontal),()=>{const t=o.verticalTextBox;return s.allowVerticalPlacement&&g>0&&t?(Q(t),a(t,e.bL.vertical)):{box:null,offscreen:null,occluded:null}}),i(!!(N&&N.box&&N.box.length))}}if(U=N,R=U&&U.box&&U.box.length>0,z=U&&U.offscreen,O=U&&U.occluded,t.useRuntimeCollisionCircles){const i=t.centerJustifiedTextSymbolIndex>=0?t.centerJustifiedTextSymbolIndex:t.verticalPlacedTextSymbolIndex,r=s.text.placedSymbolArray.get(i),o=e.bM(s.textSizeData,y,r),l=a.get("text-padding");j=this.collisionIndex.placeCollisionCircles(s,S,r,i,s.lineVertexArray,s.glyphOffsetArray,o,c,u,h,n,M,x.predicate,t.collisionCircleDiameter*o/e.bY,l,this.retainedQueryData[s.bucketInstanceId].tileID),R=S||j.circles.length>0&&!j.collisionDetected,z=z&&j.offscreen,O=j.occluded}if(o.iconFeatureIndex&&(K=o.iconFeatureIndex),o.iconBox){const i=i=>{Q(i);const n=t.hasIconTextFit&&k?Mi(k.x,k.y,I,M,this.transform.angle):new e.P(0,0),r=s.getSymbolInstanceIconSize(v,this.transform.zoom,t.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(s,r,i,p,m,q,n,E,f,c,x.predicate)};V&&V.box&&V.box.length&&o.verticalIconBox?(Z=i(o.verticalIconBox),L=Z.box.length>0):(Z=i(o.iconBox),L=Z.box.length>0),z=z&&Z.offscreen,F=Z.occluded}const te=w||0===t.numHorizontalGlyphVertices&&0===g,ie=T||0===t.numIconVertices;if(te||ie?ie?te||(L=L&&R):R=L&&R:L=R=L&&R,R&&U&&U.box&&this.collisionIndex.insertCollisionBox(U.box,a.get("text-ignore-placement"),s.bucketInstanceId,V&&V.box&&Y?Y:X,x.ID),L&&Z&&this.collisionIndex.insertCollisionBox(Z.box,a.get("icon-ignore-placement"),s.bucketInstanceId,K,x.ID),j&&(R&&this.collisionIndex.insertCollisionCircles(j.circles,a.get("text-ignore-placement"),s.bucketInstanceId,X,x.ID),n)){const e=s.bucketInstanceId;let t=this.collisionCircleArrays[e];void 0===t&&(t=this.collisionCircleArrays[e]=new Si);for(let e=0;e<j.circles.length;
vendor: 14,563 bytes, line 2
2e+=4)t.circles.push(j.circles[e+0]),t.circles.push(j.circles[e+1]),t.circles.push(j.circles[e+2]),t.circles.push(j.collisionDetected?1:0)}const ne="globe"!==s.projection.name;H=H&&(ne||!O),$=$&&(ne||!F),this.placements[l]=new Ti(R||H,L||$,z||s.justReloaded),i.add(l)},X=this.retainedQueryData[s.bucketInstanceId].tileID;if("offset"===s.elevationType&&this.buildingIndex&&this.buildingIndex.updateZOffset(s,X),"road"===s.elevationType&&s.updateRoadElevation(X.canonical),s.updateZOffset(),s.sortFeaturesByY){const t=s.getSortedSymbolIndexes(this.transform.angle);for(let e=t.length-1;e>=0;--e){const i=t[e];Z(s.symbolInstances.get(i),i,s.collisionArrays[i])}s.hasAnyZOffset&&e.w(`${s.layerIds[0]} layer symbol-z-elevate: symbols are not sorted by elevation if symbol-z-order is evaluated to viewport-y`)}else if(s.hasAnyZOffset){const e=s.getSortedIndexesByZOffset();for(let t=0;t<e.length;++t){const i=e[t];Z(s.symbolInstances.get(i),i,s.collisionArrays[i])}}else for(let e=t.symbolInstanceStart;e<t.symbolInstanceEnd;e++)Z(s.symbolInstances.get(e),e,s.collisionArrays[e]);if(n&&s.bucketInstanceId in this.collisionCircleArrays){const t=this.collisionCircleArrays[s.bucketInstanceId];e.bl(t.invProjMatrix,c),t.viewportMatrix=this.collisionIndex.getViewportMatrix()}s.justReloaded=!1}markUsedJustification(t,i,n,r){const{leftJustifiedTextSymbolIndex:o,centerJustifiedTextSymbolIndex:s,rightJustifiedTextSymbolIndex:a,verticalPlacedTextSymbolIndex:l,crossTileID:c}=n,u=e.c3(i),h=r===e.bL.vertical?l:"left"===u?o:"center"===u?s:"right"===u?a:-1;o>=0&&(t.text.placedSymbolArray.get(o).crossTileID=h>=0&&o!==h?0:c),s>=0&&(t.text.placedSymbolArray.get(s).crossTileID=h>=0&&s!==h?0:c),a>=0&&(t.text.placedSymbolArray.get(a).crossTileID=h>=0&&a!==h?0:c),l>=0&&(t.text.placedSymbolArray.get(l).crossTileID=h>=0&&l!==h?0:c)}markUsedOrientation(t,i,n){const r=i===e.bL.horizontal||i===e.bL.horizontalOnly?i:0,o=i===e.bL.vertical?i:0,{leftJustifiedTextSymbolIndex:s,centerJustifiedTextSymbolIndex:a,rightJustifiedTextSymbolIndex:l,verticalPlacedTextSymbolIndex:c}=n,u=t.text.placedSymbolArray;s>=0&&(u.get(s).placedOrientation=r),a>=0&&(u.get(a).placedOrientation=r),l>=0&&(u.get(l).placedOrientation=r),c>=0&&(u.get(c).placedOrientation=o)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;const t=this.prevPlacement;let i=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;const n=t?t.symbolFadeChange(e):1,r=t?t.opacities:{},o=t?t.variableOffsets:{},s=t?t.placedOrientations:{};for(const e in this.placements){const t=this.placements[e],o=r[e];o?(this.opacities[e]=new wi(o,n,t.text,t.icon,null,t.clipped),i=i||t.text!==o.text.placed||t.icon!==o.icon.placed):(this.opacities[e]=new wi(null,n,t.text,t.icon,t.skipFade,t.clipped),i=i||t.text||t.icon)}for(const e in r){const t=r[e];if(!this.opacities[e]){const r=new wi(t,n,!1,!1);r.isHidden()||(this.opacities[e]=r,i=i||t.text.placed||t.icon.placed)}}for(const e in o)this.variableOffsets[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.variableOffsets[e]=o[e]);for(const e in s)this.placedOrientations[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.placedOrientations[e]=s[e]);i?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}updateLayerOpacities(e,t,i,n){n&&(this.lastReplacementSourceUpdateTime=n.updateTime);const r=new Set;for(const o of t){const t=o.getBucket(e);t&&o.latestFeatureIndex&&e.fqid===t.layerIds[0]&&(this.updateBucketOpacities(t,r,o,o.collisionBoxArray,i,n,o.tileID,e.scope),"offset"===t.elevationType&&this.buildingIndex&&this.buildingIndex.updateZOffset(t,o.tileID),"road"===t.elevationType&&t.updateRoadElevation(o.tileID.canonical),t.updateZOffset())}}updateBucketOpacities(t,i,n,r,o,s,a,l){t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const c=t.layers[0].layout,u=t.layers[0].paint,h=!!t.layers[0].dynamicFilter(),d=new wi(null,0,!1,!1,!0),f=c.get("text-allow-overlap"),p=c.get("icon-allow-overlap"),m=c.get("text-variable-anchor"),_="map"===c.get("text-rotation-alignment"),g="map"===c.get("text-pitch-alignment"),y=u.get("symbol-z-offset"),v="sea"===c.get("symbol-elevation-reference"),x=!y.isConstant(),b=new wi(null,0,f&&(p||!t.hasIconData()||c.get("icon-optional")),p&&(f||!t.hasTextData()||c.get("text-optional")),!0);!t.collisionArrays&&r&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(r);const w=(e,t,i)=>{for(let n=0;n<t/4;n++)e.opacityVertexArray.emplaceBack(i)};let T=0;s&&t.updateReplacement(a,s);for(let r=0;r<t.symbolInstances.length;r++){const c=t.symbolInstances.get(r),{numHorizontalGlyphVertices:u,numVerticalGlyphVertices:f,crossTileID:p,numIconVertices:S,tileAnchorX:E,tileAnchorY:I}=c;let A=null;const M=this.retainedQueryData[t.bucketInstanceId];x&&c&&M&&(A=n.latestFeatureIndex.loadFeature({featureIndex:c.featureIndex,bucketIndex:M.bucketIndex,sourceLayerIndex:M.sourceLayerIndex,layoutVertexArrayOffset:0}));const C=y.evaluate(A,{}),P=i.has(p);let D=this.opacities[p];P?D=d:D||(D=b,this.opacities[p]=D),i.add(p);const R=u>0||f>0,L=S>0,z=this.placedOrientations[p],O=z===e.bL.vertical,F=z===e.bL.horizontal||z===e.bL.horizontalOnly;!R&&!L||D.isHidden()||T++;let k=!1;if((R||L)&&s)for(const i of t.activeReplacements){if(e.bZ(i,o,e.b_.Symbol,l))continue;if(i.min.x>E||E>i.max.x||i.min.y>I||I>i.max.y)continue;const t=e.b$(E,I,a.canonical,i.footprintTileId.canonical);if(k=e.c0(t,i.footprint),k)break}if(R){const e=k?Ni:Bi(D.text);w(t.text,u,O?Ni:e),w(t.text,f,F?Ni:e);const i=D.text.isHidden(),{leftJustifiedTextSymbolIndex:n,centerJustifiedTextSymbolIndex:r,rightJustifiedTextSymbolIndex:o,verticalPlacedTextSymbolIndex:s}=c,a=t.text.placedSymbolArray,l=i||O?1:0;n>=0&&(a.get(n).hidden=l),r>=0&&(a.get(r).hidden=l),o>=0&&(a.get(o).hidden=l),s>=0&&(a.get(s).hidden=i||F?1:0);const h=this.variableOffsets[p];h&&this.markUsedJustification(t,h.anchor,c,z);const d=this.placedOrientations[p];d&&(this.markUsedJustification(t,"left",c,d),this.markUsedOrientation(t,d,c))}if(L){const e=k?Ni:Bi(D.icon),{placedIconSymbolIndex:i,verticalPlacedIconSymbolIndex:n}=c,r=t.icon.placedSymbolArray,o=D.icon.isHidden()?1:0;i>=0&&(w(t.icon,S,O?Ni:e),r.get(i).hidden=o),n>=0&&(w(t.icon,c.numVerticalIconVertices,F?Ni:e),r.get(n).hidden=o)}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const i=t.collisionArrays[r];if(i){let n=new e.P(0,0),r=!0;if(i.textBox||i.verticalTextBox){if(m){const e=this.variableOffsets[p];e?(n=Ai(e.anchor,e.width,e.height,e.textOffset,e.textScale),_&&n._rotate(g?this.transform.angle:-this.transform.angle)):r=!1}h&&(r=!D.clipped),i.textBox&&Pi(t.textCollisionBox.collisionVertexArray,D.text.placed,!r||O,C,v,n.x,n.y),i.verticalTextBox&&Pi(t.textCollisionBox.collisionVertexArray,D.text.placed,!r||F,C,v,n.x,n.y)}const o=r&&Boolean(!F&&i.verticalIconBox);i.iconBox&&Pi(t.iconCollisionBox.collisionVertexArray,D.icon.placed,o,C,v,c.hasIconTextFit?n.x:0,c.hasIconTextFit?n.y:0),i.verticalIconBox&&Pi(t.iconCollisionBox.collisionVertexArray,D.icon.placed,!o,C,v,c.hasIconTextFit?n.x:0,c.hasIconTextFit?n.y:0)}}}if(t.fullyClipped=0===T,t.sortFeatures(this.transform.angle),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.bucketInstanceId in this.collisionCircleArrays){const e=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=e.invProjMatrix,t.placementViewportMatrix=e.viewportMatrix,t.collisionCircleArray=e.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(e){return 0===this.fadeDuration?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,t){const i=this.zoomAtLastRecencyCheck===t?1-this.zoomAdjustment(t):1;return this.zoomAtLastRecencyCheck=t,this.commitTime+this.fadeDuration*i>e}isStale(){return this.stale}setStale(){this.stale=!0}}function Pi(e,t,i,n,r,o,s){e.emplaceBack(t?1:0,i?1:0,o||0,s||0,n,r?1:0),e.emplaceBack(t?1:0,i?1:0,o||0,s||0,n,r?1:0),e.emplaceBack(t?1:0,i?1:0,o||0,s||0,n,r?1:0),e.emplaceBack(t?1:0,i?1:0,o||0,s||0,n,r?1:0)}const Di=Math.pow(2,25),Ri=Math.pow(2,24),Li=Math.pow(2,17),zi=Math.pow(2,16),Oi=Math.pow(2,9),Fi=Math.pow(2,8),ki=Math.pow(2,1);function Bi(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;const t=e.placed?1:0,i=Math.floor(127*e.opacity);return i*Di+t*Ri+i*Li+t*zi+i*Oi+t*Fi+i*ki+t}const Ni=0;class Vi{constructor(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&void 0!==e.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(e,t,i,n,r,o){const s=this._bucketParts;for(;this._currentTileIndex<e.length;)if(t.getBucketParts(s,n,e[this._currentTileIndex],this._sortAcrossTiles,o),this._currentTileIndex++,r())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,s.sort((e,t)=>e.sortKey-t.sortKey));this._currentPartIndex<s.length;){const e=s[this._currentPartIndex];if(t.placeLayerBucketPart(e,this._seenCrossTileIDs,i,0===e.symbolInstanceStart,o),this._currentPartIndex++,r())return!0}return!1}}class Ui{constructor(e,t,i,n,r,o,s,a,l){this.placement=new Ci(e,r,o,s,a,l),this._currentPlacementIndex=t.length-1,this._forceFullPlacement=i,this._showCollisionBoxes=n,this._done=!1}isDone(){return this._done}continuePlacement(t,i,n,r,o){const s=e.o.now(),a=()=>{const t=e.o.now()-s;return!this._forceFullPlacement&&t>2};for(;this._currentPlacementIndex>=0;){const s=i[t[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&"none"!==s.visibility&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){const t=s,i=t.layout.get("symbol-z-elevate"),l=void 0!==t.layout.get("symbol-sort-key").constantOr(1),c=t.layout.get("symbol-z-order"),u="viewport-y"===c||"auto"===c&&!("viewport-y"!==c&&l),h=t.layout.get("text-allow-overlap")||t.layout.get("icon-allow-overlap")||t.layout.get("text-ignore-placement")||t.layout.get("icon-ignore-placement"),d=u&&h,f=this._inProgressLayer=this._inProgressLayer||new Vi(t),p=e.B(s.source,s.scope);if(f.continuePlacement(i||d?r[p]:n[p],this.placement,this._showCollisionBoxes,s,a,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}const ji=512/e.al/2;class Gi{constructor(t,i,n){this.tileID=t,this.bucketInstanceId=n,this.index=new e.c4(i.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const r=t.canonical.x*e.al,o=t.canonical.y*e.al;for(let e=0;e<i.length;e++){const{key:t,crossTileID:n,tileAnchorX:s,tileAnchorY:a}=i.get(e),l=Math.floor((r+s)*ji),c=Math.floor((o+a)*ji);this.index.add(l,c),this.keys.push(t),this.crossTileIDs.push(n)}this.index.finish()}findMatches(t,i,n){const r=this.tileID.canonical.z<i.canonical.z?1:Math.pow(2,this.tileID.canonical.z-i.canonical.z),o=ji/Math.pow(2,i.canonical.z-this.tileID.canonical.z),s=i.canonical.x*e.al,a=i.canonical.y*e.al;for(let e=0;e<t.length;e++){const i=t.get(e);if(i.crossTileID)continue;const{key:l,tileAnchorX:c,tileAnchorY:u}=i,h=Math.floor((s+c)*o),d=Math.floor((a+u)*o),f=this.index.range(h-r,d-r,h+r,d+r).sort((e,t)=>e-t);for(const e of f){const t=this.crossTileIDs[e];if(this.keys[e]===l&&!n.has(t)){n.add(t),i.crossTileID=t;break}}}}}class qi{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Hi{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){const t=Math.round((e-this.lng)/360);if(0!==t)for(const e in this.indexes){const i=this.indexes[e],n={};for(const e in i){const r=i[e];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+t),n[r.tileID.key]=r}this.indexes[e]=n}this.lng=e}addBucket(e,t,i){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===t.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let e=0;e<t.symbolInstances.length;e++)t.symbolInstances.get(e).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]=new Set);const n=this.usedCrossTileIDs[e.overscaledZ];for(const i in this.indexes){const r=this.indexes[i];if(Number(i)>e.overscaledZ)for(const i in r){const o=r[i];o.tileID.isChildOf(e)&&o.findMatches(t.symbolInstances,e,n)}else{const o=r[e.scaledTo(Number(i)).key];o&&o.findMatches(t.symbolInstances,e,n)}}for(let e=0;e<t.symbolInstances.length;e++){const r=t.symbolInstances.get(e);r.crossTileID||(r.crossTileID=i.generate(),n.add(r.crossTileID))}return void 0===this.indexes[e.overscaledZ]&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new Gi(e,t.symbolInstances,t.bucketInstanceId),!0}removeBucketCrossTileIDs(e,t){for(const i of t.crossTileIDs)this.usedCrossTileIDs[e].delete(i)}removeStaleBuckets(e){let t=!1;for(const i in this.indexes){const n=this.indexes[i];for(const r in n)e[n[r].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,n[r]),delete n[r],t=!0)}return t}}class $i{constructor(){this.layerIndexes={},this.crossTileIDs=new qi,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,t,i,n){let r=this.layerIndexes[e.fqid];void 0===r&&(r=this.layerIndexes[e.fqid]=new Hi);let o=!1;const s={};"globe"!==n.name&&r.handleWrapJump(i);for(const i of t){const t=i.getBucket(e);t&&e.fqid===t.layerIds[0]&&(t.bucketInstanceId||(t.bucketInstanceId=++this.maxBucketInstanceId),r.addBucket(i.tileID,t,this.crossTileIDs)&&(o=!0),s[t.bucketInstanceId]=!0)}return r.removeStaleBuckets(s)&&(o=!0),o}pruneUnusedLayers(e){const t={};
2e.forEach(e=>{t[e]=!0});for(const e in this.layerIndexes)t[e]||delete this.layerIndexes[e]}}const Wi=771;class Zi{constructor(e,t,i,n){this.blendFunction=e,this.blendColor=t.toNonPremultipliedRenderColor(null),this.mask=i,this.blendEquation=n}}Zi.Replace=[1,0,1,0],Zi.disabled=new Zi(Zi.Replace,e.ao.transparent,[!1,!1,!1,!1]),Zi.unblended=new Zi(Zi.Replace,e.ao.transparent,[!0,!0,!0,!0]),Zi.alphaBlended=new Zi([1,Wi,1,Wi],e.ao.transparent,[!0,!0,!0,!0]),Zi.alphaBlendedNonPremultiplied=new Zi([770,Wi,770,Wi],e.ao.transparent,[!0,!0,!0,!0]),Zi.multiply=new Zi([774,0,774,0],e.ao.transparent,[!0,!0,!0,!0]),Zi.additive=new Zi([1,1,1,1],e.ao.transparent,[!0,!0,!0,!0]);class Xi{constructor(e,t,i){this.func=e,this.mask=t,this.range=i}}Xi.ReadOnly=!1,Xi.ReadWrite=!0,Xi.disabled=new Xi(519,Xi.ReadOnly,[0,1]);const Yi=7680;class Ki{constructor(e,t,i,n,r,o){this.test=e,this.ref=t,this.mask=i,this.fail=n,this.depthFail=r,this.pass=o}}Ki.disabled=new Ki({func:519,mask:0},0,0,Yi,Yi,Yi);const Ji=1029,Qi=2305;class en{constructor(e,t,i){this.enable=e,this.mode=t,this.frontFace=i}}function tn(t,i){const n=e.ca(t,3);e.cc(t,i),e.cg(t,3,n)}function nn(t,i){const n=e.c7([]);return e.c8(n,n,-i),e.c9(n,n,-t),n}function rn(t,i){const n=[t[0],t[1],0],r=[i[0],i[1],0];if(e.ag(n)>=1e-15){const t=e.aw([],n);e.c5(r,t,e.bJ(r,t)),i[0]=r[0],i[1]=r[1]}const o=e.bI([],i,t);if(e.c6(o)<1e-15)return null;const s=Math.atan2(-o[1],o[0]);return nn(Math.atan2(Math.sqrt(t[0]*t[0]+t[1]*t[1]),-t[2]),s)}en.disabled=new en(!1,Ji,Qi),en.backCCW=new en(!0,Ji,Qi),en.backCW=new en(!0,Ji,2304),en.frontCW=new en(!0,1028,2304),en.frontCCW=new en(!0,1028,Qi);class on{constructor(e,t){this.position=e,this.orientation=t}get position(){return this._position}set position(t){if(t){const i=t instanceof e.ae?t:new e.ae(t[0],t[1],t[2]);
vendor: 4,299 bytes, line 2
2this._renderWorldCopies&&(i.x=e.bT(i.x,0,1)),this._position=i}else this._position=null}lookAtPoint(t,i,n){if(this.orientation=null,!this.position)return;const r=this.position,o=n||(this._elevation?this._elevation.getAtPointOrZero(e.ae.fromLngLat(t)):0),s=e.ae.fromLngLat(t,o),a=[s.x-r.x,s.y-r.y,s.z-r.z];i||(i=[0,0,1]),i[2]=Math.abs(i[2]),this.orientation=rn(a,i)}setPitchBearing(t,i){this.orientation=nn(e.an(t),e.an(-i))}}class sn{constructor(t,i){this._transform=e.bA([]),this.orientation=i,this.position=t}get mercatorPosition(){const t=this.position;return new e.ae(t[0],t[1],t[2])}get position(){const t=e.ca(this._transform,3);return[t[0],t[1],t[2]]}set position(t){var i;t&&e.cg(this._transform,3,[(i=t)[0],i[1],i[2],1])}get orientation(){return this._orientation}set orientation(t){this._orientation=t||e.c7([]),t&&tn(this._transform,this._orientation)}getPitchBearing(){const e=this.forward(),t=this.right();return{bearing:Math.atan2(-t[1],t[0]),pitch:Math.atan2(Math.sqrt(e[0]*e[0]+e[1]*e[1]),-e[2])}}setPitchBearing(e,t){this._orientation=nn(e,t),tn(this._transform,this._orientation)}forward(){const t=e.ca(this._transform,2);return[-t[0],-t[1],-t[2]]}up(){const t=e.ca(this._transform,1);return[-t[0],-t[1],-t[2]]}right(){const t=e.ca(this._transform,0);return[t[0],t[1],t[2]]}getCameraToWorld(t,i){const n=new Float64Array(16);return e.bl(n,this.getWorldToCamera(t,i)),n}getCameraToWorldMercator(){return this._transform}getWorldToCameraPosition(t,i,n){const r=this.position;e.c5(r,r,-t);const o=new Float64Array(16);return e.bq(o,[n,n,n]),e.br(o,o,r),o[10]*=i,o}getWorldToCamera(t,i){const n=new Float64Array(16),r=new Float64Array(4),o=this.position;return e.cb(r,this._orientation),e.c5(o,o,-t),e.cc(n,r),e.br(n,n,o),n[1]*=-1,n[5]*=-1,n[9]*=-1,n[13]*=-1,n[8]*=i,n[9]*=i,n[10]*=i,n[11]*=i,n}getCameraToClipPerspective(t,i,n,r){const o=new Float64Array(16);return e.cd(o,t,i,n,r),o}getCameraToClipOrthographic(t,i,n,r,o,s){const a=new Float64Array(16);return e.ce(a,t,i,n,r,o,s),a}getDistanceToElevation(t,i=!1){const n=0===t?0:e.cf(t,i?e.a$(this.position[1]):this.position[1]),r=this.forward();return(n-this.position[2])/r[2]}clone(){return new sn([...this.position],[...this.orientation])}}const an=5,ln=6,cn=7,un=8,hn=9,dn=10,fn=11;class pn{constructor(e=0,t=0,i=0,n=0){if(isNaN(e)||e<0||isNaN(t)||t<0||isNaN(i)||i<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=i,this.right=n}interpolate(t,i,n){return null!=i.top&&null!=t.top&&(this.top=e.ak(t.top,i.top,n)),null!=i.bottom&&null!=t.bottom&&(this.bottom=e.ak(t.bottom,i.bottom,n)),null!=i.left&&null!=t.left&&(this.left=e.ak(t.left,i.left,n)),null!=i.right&&null!=t.right&&(this.right=e.ak(t.right,i.right,n)),this}getCenter(t,i){const n=e.aA((this.left+t-this.right)/2,0,t),r=e.aA((this.top+i-this.bottom)/2,0,i);return new e.P(n,r)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new pn(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const mn=15;class _n{constructor(t,i,n,r,o,s,a){this.tileSize=512,this._renderWorldCopies=void 0===o||o,this._minZoom=t||0,this._maxZoom=i||22,this._minPitch=n??0,this._maxPitch=r??60,this.setProjection(s),this.setMaxBounds(a),this.width=0,this.height=0,this._center=new e.aT(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new pn,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._expandedProjMatrixCache={},this._distanceTileDataCache={},this._camera=new sn,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._tileCoverLift=0,this.freezeTileCoverage=!1,this._horizonShift=.1,this._orthographicProjectionAtLowPitch=!1,this._allowWorldUnderZoom=!1}clone(){const e=new _n(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection(),this.maxBounds);return e._elevation=this._elevation,e._centerAltitude=this._centerAltitude,e._centerAltitudeValidForE
vendor: 5,178 bytes, line 2
2xaggeration=this._centerAltitudeValidForExaggeration,e.tileSize=this.tileSize,e.mercatorFromTransition=this.mercatorFromTransition,e.width=this.width,e.height=this.height,e.cameraElevationReference=this.cameraElevationReference,e._center=this._center,e._setZoom(this.zoom),e._seaLevelZoom=this._seaLevelZoom,e.angle=this.angle,e._fov=this._fov,e._pitch=this._pitch,e._nearZ=this._nearZ,e._farZ=this._farZ,e._averageElevation=this._averageElevation,e._orthographicProjectionAtLowPitch=this._orthographicProjectionAtLowPitch,e._unmodified=this._unmodified,e._edgeInsets=this._edgeInsets.clone(),e._camera=this._camera.clone(),e._calcMatrices(),e.freezeTileCoverage=this.freezeTileCoverage,e.frustumCorners=this.frustumCorners,e._allowWorldUnderZoom=this._allowWorldUnderZoom,e}get isOrthographic(){return"globe"!==this.projection.name&&this._orthographicProjectionAtLowPitch&&this.pitch<mn}get elevation(){return this._elevation}set elevation(e){this._elevation!==e&&(this._elevation=e,this._updateCameraOnTerrain(),this._calcMatrices())}get depthOcclusionForSymbolsAndCircles(){return"globe"!==this.projection.name&&!this.isOrthographic}updateElevation(e,t=!1){const i=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(null==this._seaLevelZoom||i)&&this._updateCameraOnTerrain(),(e||i)&&this._constrainCamera(t),this._calcMatrices()}getProjection(){return e.aH(this.projection,["name","center","parallels"])}setProjection(t){this.projectionOptions=t||{name:"mercator"};const i=this.projection?this.getProjection():void 0;this.projection=e.cm(this.projectionOptions);const n=this.getProjection(),r=!e.by(i,n);return r&&this._calcMatrices(),this.mercatorFromTransition=!1,r}setOrthographicProjectionAtLowPitch(e){return this._orthographicProjectionAtLowPitch!==e&&(this._orthographicProjectionAtLowPitch=e,this._calcMatrices(),!0)}setMercatorFromTransition(){const t=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=e.cm({name:"mercator"});const i=t!==this.projection.name;return i&&this._calcMatrices(),i}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies&&!0===this.projection.supportsWorldCopies}set renderWorldCopies(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const e=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(e))}get cameraWorldSize(){const e=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(e))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return e.cf(1,this.center.lat)*this.cameraWorldSizeForFog}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.P(this.width,this.height)}get bearing(){return e.bT(this.rotation,-180,180)}set bearing(e){this.rotation=e}get rotation(){return-this.angle/Math.PI*180}set rotation(t){const i=-t*Math.PI/180;this.angle!==i&&(this._unmodified=!1,this.angle=i,this._calcMatrices(),this.rotationMatrix=e.cn(),e.co(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const i=e.aA(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==i&&(this._unmodified=!1,this._pitch=i,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=e.an(t),this._calcMatrices())}get fovX(){return this._fov}get fovY(){const e=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/e)}get averageElevation(){return this._averageElevation}set averageElevation(e){this._averageElevation=e,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(e){const t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._setZoom(t),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(e){this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom}get tileCoverLift(){return this._tileCoverLift}set tileCoverLift(e){this._tileCoverLift!==e&&(this._tileCoverLift=e)}_updateCameraOnTerrain(){const e=this.elevation?this.elevation.getAtPoint(this.locationCoordinate(this.center),Number.NEGATIVE_INFINITY):Number.NEGATIVE_INFINITY,t=this.elevation&&e===Number.NEGATIVE_INFINITY&&this.elevation.visibleDemTiles.length>0&&this.elevation.exaggeration()>
20&&this._centerAltitudeValidForExaggeration;if(!this._elevation||e===Number.NEGATIVE_INFINITY&&(!t||!this._centerAltitude))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const i=this._elevation;t||this._centerAltitude&&this._centerAltitudeValidForExaggeration&&i.exaggeration()&&this._centerAltitudeValidForExaggeration!==i.exaggeration()?(this._centerAltitude=this._centerAltitude/this._centerAltitudeValidForExaggeration*i.exaggeration(),this._centerAltitudeValidForExaggeration=i.exaggeration()):(this._centerAltitude=e||0,this._centerAltitudeValidForExaggeration=i.exaggeration()),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){if(void 0===this._centerAltitudeValidForExaggeration)return;const e=Math.max(0,(this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize);this._seaLevelZoom=this._zoomFromMercatorZ(e)}sampleAverageElevation(){if(!this._elevation)return 0;const t=this._elevation,i=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],n=this.horizonLineFromTop();let r=0,o=0;for(let s=0;s<i.length;s++){const a=new e.P(i[s][0]*this.width,n+i[s][1]*(this.height-n)),l=t.pointCoordinate(a);if(!l)continue;const c=1/Math.hypot(l[0]-this._camera.position[0],l[1]-this._camera.position[1]);r+=l[3]*c,o+=c}return 0===o?NaN:r/o}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._terrainEnabled()&&("ground"===this.cameraElevationReference?this._updateCameraOnTerrain():this._updateZoomFromElevation()),this._constrain(),this._calcMatrices())}_updateZoomFromElevation(){if(null==this._seaLevelZoom||!this._elevation)return;const e=this._seaLevelZoom,t=this._elevation.getAtPointOrZero(this.locationCoordinate(this.center)),i=this.pixelsPerMeter/this.worldSize*t,n=this._mercatorZfromZoom(e),r=this._mercatorZfromZoom(this._maxZoom),o=Math.max(n-i,r);this._setZoom(this._zoomFromMercatorZ(o))}get padding(){return this._edgeInsets.toJSON()}set padding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}equals(e){const t=this.elevation,i=e.elevation,n=null!=t!=(null!=i)||t&&i&&t.exaggeration()!==i.exaggeration();return this.width===e.width&&this.height===e.height&&this.center.lng===e.center.lng&&this.center.lat===e.center.lat&&this.zoom===e.zoom&&this.bearing===e.bearing&&this.pitch===e.pitch&&this.fov===e.fov&&this.projection.name===e.projection.name&&this._edgeInsets.equals(e.padding)&&!n}computeZoomRelativeTo(t){const i=this.rayIntersectionCoordinate(this.pointRayIntersection(this.centerPoint,t.toAltitude()));let n;n=t.z<this._camera.position[2]?[i.x,i.y,i.z]:[t.x,t.y,t.z];const r=e.ag(e.av([],this._camera.position,n));return e.aA(this._zoomFromMercatorZ(r),this._minZoom,this._maxZoom)}setFreeCameraOptions(t){if(!this.height)return;if(!t.position&&!t.orientation)return;this._updateCameraState();let i=!1;if(t.orientation&&!e.cp(t.orientation,this._camera.orientation)&&(i=this._setCameraOrientation(t.orientation)),t.position){const n=[t.position.x,t.position.y,t.position.z];e.cq(n,this._camera.position)||(this._setCameraPosition(n),i=!0)}i&&(this._updateStateFromCamera(),this.recenterOnTerrain())}getFreeCameraOptions(){this._updateCameraState();const t=this._camera.position,i=new on;return i.position=new e.ae(t[0],t[1],t[2]),i.orientation=this._camera.orientation,i._elevation=this.elevation,i._renderWorldCopies=this.renderWorldCopies,i}_setCameraOrientation(t){if(!e.cr(t))return!1;e.cs(t,t);const i=e.ct([],[0,0,-1],t),n=e.ct([],[0,-1,0],t);if(n[2]<0)return!1;const r=rn(i,n);return!!r&&(this._camera.orientation=r,!0)}_setCameraPosition(t){const i=this.zoomScale(this.minZoom)*this.tileSize,n=this.zoomScale(this.maxZoom)*this.tileSize,r=this.cameraToCenterDistance;t[2]=e.aA(t[2],r/n,r/i),this._camera.position=t}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}get fovAboveCenter(){return this._fov*(.5+this.centerOffset.y/this.height)}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,t,i){this._unmodified=!1,this._edgeInsets.interpolate(e,t,i),this._constrain(),this._calcMatrices()}coveringZoomLevel(e){const t=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,t)}getVisibleUnwrappedCoordinates(t){const i=[new e.cu(0,t)];if(this.renderWorldCopies){const n=this.pointCoordinate(new e.P(0,0)),r=this.pointCoordinate(new e.P(this.width,0)),o=this.pointCoordinate(new e.P(this.width,this.height)),s=this.pointCoordinate(new e.P(0,this.height)),a=Math.floor(Math.min(n.x,r.x,o.x,s.x)),l=Math.floor(Math.max(n.x,r.x,o.x,s.x)),c=1;for(let n=a-c;n<=l+c;n++)0!==n&&i.push(new e.cu(n,t))}return i}isLODDisabled(e){return(!e||this.pitch<=60)&&this._edgeInsets.top<=this._edgeInsets.bottom&&!this._elevation&&!this.projection.isReprojectedInTileSpace}
2extendTileCover(t,i,n,r){let o=[];const s=null!=n,a=!s;if(a&&this.zoom<i)return o;if(s&&0===n[0]&&0===n[1])return o;const l=new Set,c=(t,i,n,r,s)=>{const a=e.cY(i,t,n,r,s);l.has(a)||(o.push(new e.aQ(t,i,n,r,s)),l.add(a))};for(let e=0;e<t.length;e++){const o=t[e];if(a&&o.canonical.z!==i)continue;if(s&&void 0!==r&&r>o.canonical.z)continue;const l=o.canonical,u=o.overscaledZ,h=o.wrap,d=1<<l.z,f=l.x+1<d,p=l.x>0,m=l.y+1<d,_=l.y>0,g=o.wrap-(p?0:1),y=o.wrap+(f?0:1),v=p?l.x-1:d-1,x=f?l.x+1:0;if(s)n[0]<0?(c(u,y,l.z,x,l.y),n[1]<0&&m&&(c(u,h,l.z,l.x,l.y+1),c(u,y,l.z,x,l.y+1)),n[1]>0&&_&&(c(u,h,l.z,l.x,l.y-1),c(u,y,l.z,x,l.y-1))):n[0]>0?(c(u,g,l.z,v,l.y),n[1]<0&&m&&(c(u,h,l.z,l.x,l.y+1),c(u,g,l.z,v,l.y+1)),n[1]>0&&_&&(c(u,h,l.z,l.x,l.y-1),c(u,g,l.z,v,l.y-1))):n[1]<0&&m?c(u,h,l.z,l.x,l.y+1):_&&c(u,h,l.z,l.x,l.y-1);else{const e=o.visibleQuadrants;1&e&&(c(u,g,l.z,v,l.y),_&&(c(u,h,l.z,l.x,l.y-1),c(u,g,l.z,v,l.y-1))),2&e&&(c(u,y,l.z,x,l.y),_&&(c(u,h,l.z,l.x,l.y-1),c(u,y,l.z,x,l.y-1))),4&e&&(c(u,g,l.z,v,l.y),m&&(c(u,h,l.z,l.x,l.y+1),c(u,g,l.z,v,l.y+1))),8&e&&(c(u,y,l.z,x,l.y),m&&(c(u,h,l.z,l.x,l.y+1),c(u,y,l.z,x,l.y+1)))}}const u=[];for(const e of o)o.some(t=>e.isChildOf(t))||u.push(e);if(o=u.filter(e=>!t.some(t=>!!(e.overscaledZ<i&&t.isChildOf(e))||e.equals(t)||e.isChildOf(t))),a){const e=1<<i,t="globe"===this.projection.name?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),n=[e*t.x,e*t.y],r=4,s=r*r;o=o.filter(e=>{const t=e.canonical.x+.5-n[0],i=e.canonical.y+.5-n[1];return t*t+i*i<s})}return o}extendTileCoverToNearPlane(t,i,n){const r=[],o=new Set;for(const e of t)o.add(e.key);const s=(t,i,n,s,a)=>{const l=e.cY(i,t,n,s,a);o.has(l)||(r.push(new e.aQ(t,i,n,s,a)),o.add(l))},a=t.reduce((e,t)=>Math.max(e,t.overscaledZ),n),l=1<<n,c=[new e.P(0,0),new e.P(e.al,0),new e.P(e.al,e.al),new e.P(0,e.al)],u=new e.P(0,0),h=new e.P(0,0),d=(t,i)=>{const r=Math.floor(t[0]),o=Math.floor(t[1]),d=(t[0]-r)*e.al,f=(t[1]-o)*e.al,p=Math.floor(i[0]),m=Math.floor(i[1]),_=(i[0]-p)*e.al,g=(i[1]-m)*e.al;for(let t=-1;t<=1;t++){const i=r+t;if(!(i<0||i>=l)){u.x=d-t*e.al,h.x=_-(i-p)*e.al;for(let t=-1;t<=1;t++){const r=o+t;u.y=f-t*e.al,h.y=g-(r-m)*e.al,e.cZ(u,h,c)&&s(a,0,n,i,r)}}}},f=i.points,p=f[e.cv],m=f[e.cw],_=this._projectToGround(p,f[e.cx]),g=this._projectToGround(m,f[e.cy]);return d(p,_),d(m,g),r}_projectToGround(t,i){return e.cz(e.cA(),t,i,t[2]/(t[2]-i[2]))}coveringTiles(t){let i=this.coveringZoomLevel(t);const n=i,r=this.elevation&&this.elevation.exaggeration(),o=r&&!t.isTerrainDEM,s="mercator"===this.projection.name;if(void 0!==t.minzoom&&i<t.minzoom)return[];void 0!==t.maxzoom&&i>t.maxzoom&&(i=t.maxzoom);const a=this.locationCoordinate(this.center),l=this.center.lat,c=1<<i,u=[c*a.x,c*a.y,0],h="globe"===this.projection.name,d=!h,f=e.cB.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,i,d),p=h?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),m=c*e.cf(1,this.center.lat),_=this._camera.position[2]/e.cf(1,this.center.lat),g=[c*p.x,c*p.y,_*(d?1:m)],y=h||r,v=this.cameraToCenterDistance/t.tileSize*(t.roundZoom?1:.502),x=this.isLODDisabled(!0)?i:0;let b;if(this._elevation&&t.isTerrainDEM)b=1e4*this._elevation.exaggeration();else if(this._elevation){const e=this._elevation.getMinMaxForVisibleTiles();b=e?e.max:this._centerAltitude}else b=this._centerAltitude;const w=t.isTerrainDEM?-b:this._elevation?this._elevation.getMinElevationBelowMSL():0,T=this.projection.isReprojectedInTileSpace?e.cC(this):1,S=t=>{const i=1/4e4,n=new e.ae(t.x+i,t.y,t.z),r=new e.ae(t.x,t.y+i,t.z),o=t.toLngLat(),s=n.toLngLat(),a=r.toLngLat(),l=this.locationCoordinate(o),c=this.locationCoordinate(s),u=this.locationCoordinate(a),h=Math.hypot(c.x-l.x,c.y-l.y),d=Math.hypot(u.x-l.x,u.y-l.y);return Math.sqrt(h*d)*T/i},E=t=>{const i=b,n=w;return{aabb:e.cF(this,c,0,0,0,t,n,i,this.projection),zoom:0,x:0,y:0,minZ:n,maxZ:i,wrap:t,fullyVisible:!1}},I=[];let A=[];const M=i,C=t.reparseOverscaled?n:i,P=(_-this._centerAltitude)*m,D=e=>{if(!this._elevation||!e.tileID||!s)return;const t=this._elevation.getMinMaxForTile(e.tileID),i=e.aabb;t?(i.min[2]=t.min,i.max[2]=t.max,i.center[2]=(i.min[2]+i.max[2])/2):(e.shouldSplit=L(e),e.shouldSplit||(i.min[2]=i.max[2]=i.center[2]=this._centerAltitude))},R=(e,t)=>{if(.707*t<e)return 1;const i=t/e;return i/(1.4144271570014144+(Math.pow(1.1,i-1.4144271570014144+1)-1)/(1.1-1)-1)},L=t=>{if(t.zoom<x)return!0;
2if(t.zoom===M)return!1;if(null!=t.shouldSplit)return t.shouldSplit;const i=t.aabb.distanceX(g),r=t.aabb.distanceY(g);let a=P,c=1;if(h){a=t.aabb.distanceZ(g);const i=Math.pow(2,t.zoom),n=e.a$((t.y+1)/i),r=e.a$(t.y/i),o=Math.min(Math.max(l,n),r),s=e.d1(o)/e.d1(l);if(c=o===l?1/Math.max(1,this._mercatorScaleRatio-.3):Math.min(1,s/this._mercatorScaleRatio),this.zoom<=e.c_&&t.zoom===M-1&&s>=.9)return!0}else if(o&&(a=t.aabb.distanceZ(g)*m),this.projection.isReprojectedInTileSpace&&n<=5){const i=Math.pow(2,t.zoom),n=S(new e.ae((t.x+.5)/i,(t.y+.5)/i));c=n>.85?1:n}if(!s&&!h){const e=Math.sqrt(i*i+r*r+a*a);let n=(1<<M-t.zoom)*v*c;return n*=R(Math.max(a,P),e),e<n}let d=Number.MAX_VALUE,f=0;const p=t.aabb.getCorners(),_=[];for(const t of p){e.av(_,t,g),h||(o?_[2]*=m:_[2]=P);const i=e.bJ(_,this._camera.forward());i<d&&(d=i,f=Math.abs(_[2]))}let y=(1<<M-t.zoom)*v*c;if(y*=R(Math.max(f,P),d),d<y)return!0;const b=t.aabb.closestPoint(u);return b[0]===u[0]&&b[1]===u[1]};if(this.renderWorldCopies)for(let e=1;e<=3;e++)I.push(E(-e)),I.push(E(e));for(I.push(E(0));I.length>0;){const n=I.pop(),r=n.x,a=n.y;let l=n.fullyVisible;const d=()=>"globe"===this.projection.name&&(0===n.y||n.y===(1<<n.zoom)-1);if(!l){let t=y?n.aabb.intersects(f):n.aabb.intersectsFlat(f);if(0===t&&d()){const i=new e.cD(n.zoom,r,a);t=e.cE(this,c,i,!0).intersects(f)}if(0===t)continue;l=2===t}if(n.zoom!==M&&L(n))for(let t=0;t<4;t++){const i=(r<<1)+t%2,u=(a<<1)+(t>>1),d={aabb:s?n.aabb.quadrant(t):e.cF(this,c,n.zoom+1,i,u,n.wrap,n.minZ,n.maxZ,this.projection),zoom:n.zoom+1,x:i,y:u,wrap:n.wrap,fullyVisible:l,tileID:void 0,shouldSplit:void 0,minZ:n.minZ,maxZ:n.maxZ};o&&!h&&(d.tileID=new e.aQ(n.zoom+1===M?C:n.zoom+1,n.wrap,n.zoom+1,i,u),D(d)),I.push(d)}else{const o=n.zoom===M?C:n.zoom;if(t.minzoom&&t.minzoom>o)continue;let s=0;if(!l){let i=y?n.aabb.intersectsPrecise(f):n.aabb.intersectsPreciseFlat(f);if(0===i&&d()){const t=new e.cD(n.zoom,r,a);i=e.cE(this,c,t,!0).intersectsPrecise(f)}if(0===i)continue;if(t.calculateQuadrantVisibility)if(f.containsPoint(n.aabb.center))s=15;else for(let e=0;e<4;e++)0!==n.aabb.quadrant(e).intersects(f)&&(s|=1<<e)}const h=u[0]-(.5+r+(n.wrap<<n.zoom))*(1<<i-n.zoom),p=u[1]-.5-a,m=n.tileID?n.tileID:new e.aQ(o,n.wrap,n.zoom,r,a);t.calculateQuadrantVisibility&&(m.visibleQuadrants=s),A.push({tileID:m,distanceSq:h*h+p*p})}}if(this.fogCullDistSq){const i=this.fogCullDistSq,n=this.horizonLineFromTop();A=A.filter(r=>{const o=[0,0,0,1],s=[e.al,e.al,0,1],a=this.calculateFogTileMatrix(r.tileID.toUnwrapped());e.aC(o,o,a),e.aC(s,s,a);const l=e.cG([],o,s),c=e.cH([],o,s),u=e.c$(l,c);if(0===u)return!0;let h=!1;const d=this._elevation;if(d&&u>i&&0!==n){const i=this.calculateProjMatrix(r.tileID.toUnwrapped());let o;t.isTerrainDEM||(o=d.getMinMaxForTile(r.tileID)),o||(o={min:w,max:b});const s=e.cI(this.rotation),a=[s[0]*e.al,s[1]*e.al,o.max];e.af(a,a,i),h=(1-a[1])*this.height*.5<n}return u<i||h}
2)}return A.sort((e,t)=>e.distanceSq-t.distanceSq).map(e=>e.tileID)}resize(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log2(e)}project(t){const i=e.aA(t.lat,-e.cJ,e.cJ),n=this.projection.project(t.lng,i);return new e.P(n.x*this.worldSize,n.y*this.worldSize)}unproject(e){return this.projection.unproject(e.x/this.worldSize,e.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/e.cf(1,this.center.lat)/this.worldSize}setLocationAtPoint(t,i){let n,r;const o=this.centerPoint;if("globe"===this.projection.name){const e=this.worldSize;n=(i.x-o.x)/e,r=(i.y-o.y)/e}else{const e=this.pointCoordinate(i),t=this.pointCoordinate(o);n=e.x-t.x,r=e.y-t.y}const s=this.locationCoordinate(t);this.setLocation(new e.ae(s.x-n,s.y-r))}setLocation(e){this.center=this.coordinateLocation(e),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(e,t){return this.projection.locationPoint(this,e,t)}locationPoint3D(e,t){return this.projection.locationPoint(this,e,t,!0)}pointLocation(e){return this.coordinateLocation(this.pointCoordinate(e))}pointLocation3D(e,t){return this.coordinateLocation(this.pointCoordinate3D(e,t))}locationCoordinate(t,i){const n=i?e.cf(i,t.lat):void 0,r=this.projection.project(t.lng,t.lat);return new e.ae(r.x,r.y,n)}coordinateLocation(e){return this.projection.unproject(e.x,e.y)}pointRayIntersection(t,i){const n=null!=i?i:this._centerAltitude,r=[t.x,t.y,0,1],o=[t.x,t.y,1,1];e.aC(r,r,this.pixelMatrixInverse),e.aC(o,o,this.pixelMatrixInverse);const s=o[3];e.cK(r,r,1/r[3]),e.cK(o,o,1/s);const a=r[2],l=o[2];return{p0:r,p1:o,t:a===l?0:(n-a)/(l-a)}}screenPointToMercatorRay(t){const i=[t.x,t.y,0,1],n=[t.x,t.y,1,1];return e.aC(i,i,this.pixelMatrixInverse),e.aC(n,n,this.pixelMatrixInverse),e.cK(i,i,1/i[3]),e.cK(n,n,1/n[3]),i[2]=e.cf(i[2],this._center.lat)*this.worldSize,n[2]=e.cf(n[2],this._center.lat)*this.worldSize,e.cK(i,i,1/this.worldSize),e.cK(n,n,1/this.worldSize),new e.ax([i[0],i[1],i[2]],e.aw([],e.av([],n,i)))}rayIntersectionCoordinate(t){const{p0:i,p1:n,t:r}=t,o=e.cf(i[2],this._center.lat),s=e.cf(n[2],this._center.lat);return new e.ae(e.ak(i[0],n[0],r)/this.worldSize,e.ak(i[1],n[1],r)/this.worldSize,e.ak(o,s,r))}pointCoordinate(e,t=this._centerAltitude){return this.projection.pointCoordinate(this,e.x,e.y,t)}pointCoordinate3D(t,i){if(!this.elevation)return this.pointCoordinate(t,i);let n=this.projection.pointCoordinate3D(this,t.x,t.y);if(n)return new e.ae(n[0],n[1],n[2]);let r=0,o=this.horizonLineFromTop();if(t.y>o)return this.pointCoordinate(t,i);const s=.02*o,a=t.clone();for(let t=0;t<10&&o-r>s;t++){a.y=e.ak(r,o,.66);const t=this.projection.pointCoordinate3D(this,a.x,a.y);t?(o=a.y,n=t):r=a.y}return n?new e.ae(n[0],n[1],n[2]):this.pointCoordinate(t)}isPointAboveHorizon(e){return this.projection.isPointAboveHorizon(this,e)}isPointOnSurface(t){if(t.y<0||t.y>this.height||t.x<0||t.x>this.width)return!1;if(this.elevation||this.zoom>=e.cL)return!this.isPointAboveHorizon(t);const i=this.pointCoordinate(t);return i.y>=0&&i.y<=1}_coordinatePoint(t,i){const n=i&&this.elevation?this.elevation.getAtPointOrZero(t,this._centerAltitude):this._centerAltitude,r=[t.x*this.worldSize,t.y*this.worldSize,n+t.toAltitude(),1];return e.aC(r,r,this.pixelMatrix),r[3]>0?new e.P(r[0]/r[3],r[1]/r[3]):new e.P(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:t,left:i}=this._edgeInsets,n=this.height-this._edgeInsets.bottom,r=this.width-this._edgeInsets.right,o=this.pointLocation3D(new e.P(i,t)),s=this.pointLocation3D(new e.P(r,t)),a=this.pointLocation3D(new e.P(r,n)),l=this.pointLocation3D(new e.P(i,n));let c=Math.min(o.lng,s.lng,a.lng,l.lng),u=Math.max(o.lng,s.lng,a.lng,l.lng),h=Math.min(o.lat,s.lat,a.lat,l.lat),d=Math.max(o.lat,s.lat,a.lat,l.lat);const f=Math.pow(2,-this.zoom)/16*270,p="globe"===this.projection.name?1:4,m=(t,i,n,r,o)=>{const s=(t+n)/2,a=(i+r)/2,l=new e.P(s,a),{lng:_,lat:g}=this.pointLocation3D(l),y=Math.max(0,c-_,h-g,_-u,g-d);c=Math.min(c,_),u=Math.max(u,_),h=Math.min(h,g),d=Math.max(d,g),
2(o<p||y>f)&&(m(t,i,s,a,o+1),m(s,a,n,r,o+1))};if(m(i,t,r,t,1),m(r,t,r,n,1),m(r,n,i,n,1),m(i,n,i,t,1),"globe"===this.projection.name){const[t,i]=e.cM(this);t?(d=90,u=180,c=-180):i&&(h=-90,u=180,c=-180)}return new e.aI(new e.aT(c,h),new e.aT(u,d))}_getBoundsRectangular(t,i){const{top:n,left:r}=this._edgeInsets,o=this.height-this._edgeInsets.bottom,s=this.width-this._edgeInsets.right,a=new e.P(r,n),l=new e.P(s,n),c=new e.P(s,o),u=new e.P(r,o);let h=this.pointCoordinate(a,t),d=this.pointCoordinate(l,t);const f=this.pointCoordinate(c,i),p=this.pointCoordinate(u,i),m=(e,t)=>(t.y-e.y)/(t.x-e.x);return h.y>1&&d.y>=0?h=new e.ae((1-p.y)/m(p,h)+p.x,1):h.y<0&&d.y<=1&&(h=new e.ae(-p.y/m(p,h)+p.x,0)),d.y>1&&h.y>=0?d=new e.ae((1-f.y)/m(f,d)+f.x,1):d.y<0&&h.y<=1&&(d=new e.ae(-f.y/m(f,d)+f.x,0)),(new e.aI).extend(this.coordinateLocation(h)).extend(this.coordinateLocation(d)).extend(this.coordinateLocation(p)).extend(this.coordinateLocation(f))}_getBoundsRectangularTerrain(){const e=this.elevation;if(!e.visibleDemTiles.length||e.isUsingMockSource())return this._getBoundsRectangular(0,0);const t=e.visibleDemTiles.reduce((e,t)=>{if(t.dem){const i=t.dem.tree;e.min=Math.min(e.min,i.minimums[0]),e.max=Math.max(e.max,i.maximums[0])}return e},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(t.min*e.exaggeration(),t.max*e.exaggeration())}getBounds(){return"mercator"===this.projection.name||"equirectangular"===this.projection.name?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(e=!0){const t=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))-this.centerOffset.y,i=this.height/2-t*(1-this._horizonShift);return e?Math.max(0,i):i}getMaxBounds(){return this.maxBounds}setMaxBounds(t){this.maxBounds=t,this.minLat=-e.cJ,this.maxLat=e.cJ,this.minLng=-180,this.maxLng=180,t&&(this.minLat=t.getSouth(),this.maxLat=t.getNorth(),this.minLng=t.getWest(),this.maxLng=t.getEast(),this.maxLng<this.minLng&&(this.maxLng+=360)),this.worldMinX=e.aF(this.minLng)*this.tileSize,this.worldMaxX=e.aF(this.maxLng)*this.tileSize,this.worldMinY=e.aJ(this.maxLat)*this.tileSize,this.worldMaxY=e.aJ(this.minLat)*this.tileSize,this._constrain()}calculatePosMatrix(e,t){return this.projection.createTileMatrix(this,t,e)}calculateDistanceTileData(t){const i=t.key,n=this._distanceTileDataCache;if(n[i])return n[i];const r=t.canonical,o=1/this.height,s=this.cameraWorldSize,a=s/this.zoomScale(r.z),l=(r.x+Math.pow(2,r.z)*t.wrap)*a,c=r.y*a,u=this.point;u.x*=s/this.worldSize,u.y*=s/this.worldSize;const h=this.angle,d=Math.sin(-h),f=-Math.cos(-h);return n[i]={bearing:[d,f],center:[(u.x-l)*o,(u.y-c)*o],scale:a/e.al*o},n[i]}calculateFogTileMatrix(t){const i=t.key,n=this._fogTileMatrixCache;if(n[i])return n[i];const r=this.projection.createTileMatrix(this,this.cameraWorldSizeForFog,t);return e.aB(r,this.worldToFogMatrix,r),n[i]=new Float32Array(r),n[i]}calculateProjMatrix(t,i=!1,n=!1){const r=t.key;let o;if(o=n?this._expandedProjMatrixCache:i?this._alignedProjMatrixCache:this._projMatrixCache,o[r])return o[r];const s=this.calculatePosMatrix(t,this.worldSize);let a;return a=this.projection.isReprojectedInTileSpace?this.mercatorMatrix:n?this.expandedFarZProjMatrix:i?this.alignedProjMatrix:this.projMatrix,e.aB(s,a,s),o[r]=new Float32Array(s),o[r]}calculatePixelsToTileUnitsMatrix(t){const i=t.tileID.key,n=this._pixelsToTileUnitsCache;if(n[i])return n[i];const r=e.cN(t,this);return n[i]=r,n[i]}customLayerMatrix(){return this.mercatorMatrix.slice()}globeToMercatorMatrix(){if("globe"===this.projection.name){const t=1/this.worldSize,i=e.bq([],[t,t,t]);return e.aB(i,i,this.globeMatrix),i}}recenterOnTerrain(){if(!this._elevation||"globe"===this.projection.name)return;const t=this._elevation;this._updateCameraState();const i=e.cf(1,this._center.lat)*this.worldSize,n=this._computeCameraPosition(i),r=this._camera.forward(),o=e.cf(1,this._center.lat);n[2]/=o,r[2]/=o,e.aw(r,r);const s=t.raycast(n,r,t.exaggeration());if(s){const t=e.bH([],n,r,s),i=new e.ae(t[0],t[1],e.cf(t[2],e.a$(t[1]))),a=(i.z+e.ag([i.x-n[0],i.y-n[1],i.z-n[2]*o]))*this._pixelsPerMercatorPixel;this._seaLevelZoom=this._zoomFromMercatorZ(a),this._centerAltitude=i.toAltitude(),this._center=this.coordinateLocation(i),this._updateZoomFromElevation(),this._constrain(),this._calcMatrices()}}_constrainCamera(t=!1){if(!this._elevation)return;const i=this._elevation,n=e.cf(1,this._center.lat)*this.worldSize,r=this._computeCameraPosition(n),o=i.getAtPointOrZero(new e.ae(...r)),s=this.pixelsPerMeter/this.worldSize*o,a=this._minimumHeightOverTerrain(),l=r[2]-s;if(l<=a)if(l<0||t){const t=this.locationCoordinate(this._center,this._centerAltitude),i=[r[0],r[1],t.z-r[2]],n=e.ag(i);i[2]-=(a-l)/this._pixelsPerMercatorPixel;const o=e.ag(i);if(0===o)return;e.c5(i,i,n/o*this._pixelsPerMercatorPixel),this._camera.position=[r[0],r[1],t.z*this._pixelsPerMercatorPixel-i[2]],this._updateStateFromCamera()}else this._isCameraConstrained=!0}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const t="globe"===this.projection.name||this.mercatorFromTransition;if(this.projection.isReprojectedInTileSpace||t){const i=this.center;return i.lat=e.aA(i.lat,this.minLat,this.maxLat),(this.maxBounds||!this.renderWorldCopies&&!t)&&(i.lng=e.aA(i.lng,this.minLng,this.maxLng)),this.center=i,void(this._constraining=!1)}const i=this._unmodified,{x:n,y:r}=this.point;let o=0,s=n,a=r;const l=this.width/2,c=this.height/2,u=this.worldMinY*this.scale,h=this.worldMaxY*this.scale;if(r-c<u&&(a=u+c),r+c>h&&(a=h-c),h-u<this.height&&(o=Math.max(o,this.height/(h-u)),a=(h+u)/2),this.maxBounds||!this._renderWorldCopies||!this.projection.wrap){const e=this.worldMinX*this.scale,t=this.worldMaxX*this.scale,i=this.worldSize/2-(e+t)/2;s=(n+i+this.worldSize)%this.worldSize-i,s-l<e&&(s=e+l),s+l>t&&(s=t-l),t-e<this.width&&(o=Math.max(o,this.width/(t-e)),s=(t+e)/2)}s===n&&a===r||this._allowWorldUnderZoom||(this.center=this.unproject(new e.P(s,a))),o&&!this._allowWorldUnderZoom&&(this.zoom+=this.scaleZoom(o)),this._constrainCamera(),this._unmodified=i,this._constraining=!1}_minZoomForBounds(){let e=Math.max(0,this.scaleZoom(Math.max(0,this.height)/(this.worldMaxY-this.worldMinY)));return this.maxBounds&&(e=Math.max(e,this.scaleZoom(this.width/(this.worldMaxX-this.worldMinX)))),e}_maxCameraBoundsDistance(){return this._mercatorZfromZoom(this._minZoomForBounds())}
2_calcMatrices(){if(!this.height)return;const t=this.centerOffset,i="globe"===this.projection.name,n=this.pixelsPerMeter;"globe"===this.projection.name&&(this._mercatorScaleRatio=e.cf(1,this.center.lat)/e.cf(1,e.d2));const r=e.cO(this.projection,this.zoom,this.width,this.height,1024);this._pixelsPerMercatorPixel=this.projection.pixelSpaceConversion(this.center.lat,this.worldSize,r),this.cameraToCenterDistance=.5/Math.tan(.5*this._fov)*this.height*this._pixelsPerMercatorPixel,this._updateCameraState(),this._farZ=this.projection.farthestPixelDistance(this),this._nearZ=this.height/50;const o="meters"===this.projection.zAxisUnit?n:1,s=this._camera.getWorldToCamera(this.worldSize,o);let a;const l=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,this._farZ);if(l[8]=2*-t.x/this.width,l[9]=2*t.y/this.height,this.isOrthographic){let i=.5*this.height/Math.tan(this._fov/2)*1*Math.tan(.5*this._fov),n=i*this.aspect,r=-n,o=-i;n-=t.x,r-=t.x,i+=t.y,o+=t.y,a=this._camera.getCameraToClipOrthographic(r,n,o,i,this._nearZ,this._farZ),((t,i,n,r)=>{for(let o=0;o<16;o++)t[o]=e.ak(i[o],n[o],r)})(a,a,l,e.d0(this.pitch>=mn?1:this.pitch/mn))}else a=l;const c=e.cP([],l,s);let u=e.cP([],a,s);if(this.projection.isReprojectedInTileSpace){const t=this.locationCoordinate(this.center),i=e.bA([]);e.br(i,i,[t.x*this.worldSize,t.y*this.worldSize,0]),e.aB(i,i,e.cQ(this)),e.br(i,i,[-t.x*this.worldSize,-t.y*this.worldSize,0]),e.aB(u,u,i),e.aB(c,c,i),this.inverseAdjustmentMatrix=e.cR(this)}else this.inverseAdjustmentMatrix=[1,0,0,1];if(this.mercatorMatrix=e.cS([],u,[this.worldSize,this.worldSize,this.worldSize/o,1]),this.projMatrix=u,this.invProjMatrix=e.bl(new Float64Array(16),this.projMatrix),i){const i=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,1/0);i[8]=2*-t.x/this.width,i[9]=2*t.y/this.height,this.expandedFarZProjMatrix=e.cP([],i,s)}else this.expandedFarZProjMatrix=this.projMatrix;const h=e.bl([],a);this.frustumCorners=e.cT.fromInvProjectionMatrix(h,this.horizonLineFromTop(),this.height),this.cameraFrustum=e.cB.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,0,!i);const d=new Float32Array(16);e.bA(d),e.cS(d,d,[1,-1,1]),e.cU(d,d,this._pitch),e.bB(d,d,this.angle);const f=e.cd(new Float32Array(16),this._fov,this.width/this.height,this._nearZ,this._farZ);this.starsProjMatrix=e.bz(f);const p=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;f[8]=2*-t.x/this.width,f[9]=2*(t.y+p)/this.height,this.skyboxMatrix=e.aB(d,f,d);const m=this.point,_=m.x,g=m.y,y=this.width%2/2,v=this.height%2/2,x=Math.cos(this.angle),b=Math.sin(this.angle),w=_-Math.round(_)+x*y+b*v,T=g-Math.round(g)+x*v+b*y,S=new Float64Array(u);if(e.br(S,S,[w>.5?w-1:w,T>.5?T-1:T,0]),this.alignedProjMatrix=S,u=e.bC(),e.cS(u,u,[this.width/2,-this.height/2,1]),e.br(u,u,[1,-1,0]),this.labelPlaneMatrix=u,u=e.bC(),e.cS(u,u,[1,-1,1]),e.br(u,u,[-1,-1,0]),e.cS(u,u,[2/this.width,2/this.height,1]),this.glCoordMatrix=u,this.pixelMatrix=e.aB(new Float64Array(16),this.labelPlaneMatrix,c),this._calcFogMatrices(),this._distanceTileDataCache={},u=e.bl(new Float64Array(16),this.pixelMatrix),!u)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=u,"globe"===this.projection.name||this.mercatorFromTransition){this.globeMatrix=e.cV(this);const t=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=e.af(t,t,s),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=u;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={},this._expandedProjMatrixCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const t=this.cameraWorldSizeForFog,i=this.cameraPixelsPerMeter,n=this._camera.position,r=1/this.height/this._pixelsPerMercatorPixel,o=[t,t,i];e.c5(o,o,r),e.c5(n,n,-1),e.cW(n,n,o);const s=e.bC();e.br(s,s,n),e.cS(s,s,o),this.mercatorFogMatrix=s,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(t,i,r)}_computeCameraPosition(e){const t=(e=e||this.pixelsPerMeter)/this.pixelsPerMeter,i=this._camera.forward(),n=this.point,r=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*t-e/this.worldSize*this._centerAltitude;return[n.x/this.worldSize-i[0]*r,n.y/this.worldSize-i[1]*r,e/this.worldSize*this._centerAltitude-i[2]*r]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(t){const i=this._maxCameraBoundsDistance()*Math.cos(this._pitch),n=this._camera.position[2],r=t[2];let o=1;this.projection.wrap&&(this.center=this.center.wrap()),r>0&&(o=Math.min((i-n)/r,1)),this._camera.position=e.bH([],this._camera.position,t,o),this._updateStateFromCamera()}_updateStateFromCamera(){const t=this._camera.position,i=this._camera.forward(),{pitch:n,bearing:r}=this._camera.getPitchBearing(),o=e.cf(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,s=this._mercatorZfromZoom(this._maxZoom)*Math.cos(e.an(this._maxPitch)),a=Math.max((t[2]-o)/Math.cos(n),s),l=this._zoomFromMercatorZ(a);e.bH(t,t,i,a),this._pitch=e.aA(n,e.an(this.minPitch),e.an(this.maxPitch)),this.angle=e.bT(r,-Math.PI,Math.PI),this._setZoom(e.aA(l,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new e.ae(t[0],t[1],t[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(e){return Math.pow(2,e)*this.tileSize}_mercatorZfromZoom(e){return this.cameraToCenterDistance/this._worldSizeFromZoom(e)}_minimumHeightOverTerrain(){const e=Math.min(null!=this._seaLevelZoom?this._seaLevelZoom:this._zoom,this._maxZoom)+4;return this._mercatorZfromZoom(e)}_zoomFromMercatorZ(e){return this.scaleZoom(this.cameraToCenterDistance/(Math.max(0,e)*this.tileSize))}zoomFromMercatorZAdjusted(t){let i=0,n=e.cL,r=0,o=1/0;for(;n-i>1e-6&&n>i;){const e=i+.5*(n-i),s=this.tileSize*Math.pow(2,e),a=this.getCameraToCenterDistance(this.projection,e,s),l=this.scaleZoom(a/(Math.max(0,t)*this.tileSize)),c=Math.abs(e-l);c<o&&(o=c,r=e),e<l?i=e:n=e}return r}_terrainEnabled(){return!(!this._elevation||!this.projection.supportsTerrain&&(e.w("Terrain is not yet supported with alternate projections. Use mercator or globe to enable terrain."),1))}anyCornerOffEdge(t,i){const n=Math.min(t.x,i.x),r=Math.max(t.x,i.x),o=Math.min(t.y,i.y),s=Math.max(t.y,i.y);if(o<this.horizonLineFromTop(!1))return!0;
2if("mercator"!==this.projection.name)return!1;const a=[new e.P(n,o),new e.P(r,s),new e.P(n,s),new e.P(r,o)],l=this.renderWorldCopies?-3:0,c=this.renderWorldCopies?4:1;for(const e of a){const t=this.pointRayIntersection(e);if(t.t<0)return!0;const i=this.rayIntersectionCoordinate(t);if(i.x<l||i.y<0||i.x>c||i.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+e.cX(this.fovAboveCenter)>88||this.anyCornerOffEdge(new e.P(0,0),new e.P(this.width,this.height))}zoomDeltaToMovement(t,i){const n=e.ag(e.av([],this._camera.position,t)),r=this._zoomFromMercatorZ(n)+i;return n-this._mercatorZfromZoom(r)}getCameraPoint(){if("globe"===this.projection.name){const t=function([t,i,n],r){const o=[t,i,n,1];e.aC(o,o,r);const s=o[3]=Math.max(o[3],1e-6);return o[0]/=s,o[1]/=s,o[2]/=s,o}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new e.P(t[0],t[1])}{const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.P(0,t))}}getCameraToCenterDistance(t,i=this.zoom,n=this.worldSize){const r=e.cO(t,i,this.width,this.height,1024),o=t.pixelSpaceConversion(this.center.lat,n,r);let s=.5/Math.tan(.5*this._fov)*this.height*o;return this.isOrthographic&&(s=e.ak(1,s,e.d0(this.pitch>=mn?1:this.pitch/mn))),s}getWorldToCameraMatrix(){const t=this._camera.getWorldToCamera(this.worldSize,"meters"===this.projection.zAxisUnit?this.pixelsPerMeter:1);return"globe"===this.projection.name&&e.aB(t,t,this.globeMatrix),t}getFrustum(t){return e.cB.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,t,"meters"===this.projection.zAxisUnit)}}const gn=(t,i)=>{if(i>0&&t.terrain&&e.w("Cutoff is currently disabled on terrain"),i<=0||t.terrain)return{shouldRenderCutoff:!1,uniformValues:{u_cutoff_params:[0,0,0,1]}};const n=t.transform,r=Math.max(Math.abs(n._zoom-(t.minCutoffZoom-1)),1),o=n.isLODDisabled(!1)?e.ah(60,45,n.pitch):e.ah(30,15,n.pitch),s=n._farZ-n._nearZ,a=i*n.height,l=((1-(c=o))*n.cameraToCenterDistance+c*(n._farZ+a))*r;var c;return{shouldRenderCutoff:o<1,uniformValues:{u_cutoff_params:[n._nearZ,n._farZ,(l-n._nearZ)/s,(l-a-n._nearZ)/s]}}},yn=2048;class vn{constructor(e,t){this.aabb=e,this.lastCascade=t}}class xn{add(e,t){const i=this.receivers[e.key];void 0!==i?(i.aabb.min[0]=Math.min(i.aabb.min[0],t.min[0]),i.aabb.min[1]=Math.min(i.aabb.min[1],t.min[1]),i.aabb.min[2]=Math.min(i.aabb.min[2],t.min[2]),i.aabb.max[0]=Math.max(i.aabb.max[0],t.max[0]),i.aabb.max[1]=Math.max(i.aabb.max[1],t.max[1]),i.aabb.max[2]=Math.max(i.aabb.max[2],t.max[2])):this.receivers[e.key]=new vn(t,null)}clear(){this.receivers={}}get(e){return this.receivers[e.key]}computeRequiredCascades(t,i,n){const r=e.d9.fromPoints(t.points);let o=0;for(const t in this.receivers){const s=this.receivers[t];if(!s)continue;if(!r.intersectsAabb(s.aabb))continue;s.aabb.min=r.closestPoint(s.aabb.min),s.aabb.max=r.closestPoint(s.aabb.max);const a=s.aabb.getCorners();for(let t=0;t<n.length;t++){let r=!0;for(const o of a){const s=[o[0]*i,o[1]*i,o[2]];if(e.af(s,s,n[t].matrix),s[0]<-1||s[0]>1||s[1]<-1||s[1]>1){r=!1;break}}if(s.lastCascade=t,o=Math.max(o,t),r)break}}return o+1}}class bn{constructor(e){this.painter=e,this._enabled=!1,this._shadowLayerCount=0,this._numCascadesToRender=0,this._cascades=[],this._groundShadowTiles=[],this._receivers=new xn,this._depthMode=new Xi(e.context.gl.LEQUAL,Xi.ReadWrite,[0,1]),this._uniformValues={u_light_matrix_0:new Float32Array(16),u_light_matrix_1:new Float32Array(16),u_shadow_intensity:0,u_fade_range:[0,0],u_shadow_normal_offset:[1,1,1],u_shadow_texel_size:1,u_shadow_map_resolution:1,u_shadow_direction:[0,0,1],u_shadow_bias:[36e-5,.0012,.012],u_shadowmap_0:0,u_shadowmap_1:0},this._forceDisable=!1,this.useNormalOffset=!1}destroy(){for(const e of this._cascades)e.texture.destroy(),e.framebuffer.destroy();this._cascades=[]}updateShadowParameters(t,i){const n=this.painter;if(this._enabled=!1,this._shadowLayerCount=0,this._receivers.clear(),!i||!i.properties)return;const r=i.properties.get("shadow-intensity");if(!i.shadowsEnabled()||r<=0)return;if(this._shadowLayerCount=n.style.order.reduce((e,i)=>{const r=n.style._mergedLayers[i];return e+(r.hasShadowPass()&&!r.isHidden(t.zoom)?1:0)},0),this._enabled=this._shadowLayerCount>0,!this.enabled)return;const o=n.context,s=yn,a=yn;if(0===this._cascades.length||yn!==this._cascades[0].texture.size[0]){this._cascades=[];for(let t=0;t<2;++t){const t=n._shadowMapDebug,i=o.gl,r=o.createFramebuffer(s,a,t?1:0,"texture"),l=new e.T(o,{width:s,height:a,data:null},i.DEPTH_COMPONENT16);if(r.depthAttachment.set(l.texture),t){const t=new e.T(o,{width:s,height:a,data:null},i.RGBA8);r.colorAttachment0.set(t.texture)}this._cascades.push({framebuffer:r,texture:l,matrix:[],far:0,boundingSphereRadius:0,frustum:new e.cB,scale:0})}}this.shadowDirection=Tn(i);let l=0;if(t.elevation){const e=t.elevation,i=[1e4,-1e4];e.visibleDemTiles.filter(e=>
2e.dem).forEach(e=>{const t=e.dem.tree;i[0]=Math.min(i[0],t.minimums[0]),i[1]=Math.max(i[1],t.maximums[0])}),1e4!==i[0]&&(l=(i[1]-i[0])*e.exaggeration())}const c=1.5*t.cameraToCenterDistance,u=3*c,h=new Float64Array(16);for(let i=0;i<this._cascades.length;++i){const n=this._cascades[i];let r=t.height/50,o=1;0===i?o=c:(r=c,o=u);const[s,a]=En(t,this.shadowDirection,r,o,yn,l);n.scale=t.scale,n.matrix=s,n.boundingSphereRadius=a,e.bl(h,n.matrix),n.frustum=e.cB.fromInvProjectionMatrix(h,1,0,!0),n.far=o}const d=this._cascades.length-1;this._uniformValues.u_fade_range=[.75*this._cascades[d].far,this._cascades[d].far],this._uniformValues.u_shadow_intensity=r,this._uniformValues.u_shadow_direction=[this.shadowDirection[0],this.shadowDirection[1],this.shadowDirection[2]],this._uniformValues.u_shadow_texel_size=.00048828125,this._uniformValues.u_shadow_map_resolution=yn,this._uniformValues.u_shadowmap_0=fn,this._uniformValues.u_shadowmap_1=fn+1,this._groundShadowTiles=n.transform.coveringTiles({tileSize:512,renderWorldCopies:!0});const f=n.transform.elevation;for(const e of this._groundShadowTiles){let t={min:0,max:0};if(f){const i=f.getMinMaxForTile(e);i&&(t=i)}this.addShadowReceiver(e.toUnwrapped(),t.min,t.max)}}get enabled(){return this._enabled&&!this._forceDisable}set enabled(e){this._enabled=e}drawShadowPass(t,i){if(!this.enabled)return;const n=this.painter,r=n.context;this._numCascadesToRender=this._receivers.computeRequiredCascades(n.transform.getFrustum(0),n.transform.worldSize,this._cascades),r.viewport.set([0,0,yn,yn]);for(let o=0;o<this._numCascadesToRender;++o){n.currentShadowCascade=o,r.bindFramebuffer.set(this._cascades[o].framebuffer.framebuffer),r.clear({color:e.ao.white,depth:1});for(const e of t.order){const r=t._mergedLayers[e];if(!r.hasShadowPass()||r.isHidden(n.transform.zoom))continue;const o=t.getLayerSourceCache(r),s=o?i[o.id]:void 0;("model"===r.type||s&&s.length)&&n.renderLayer(n,o,r,s)}}n.currentShadowCascade=0}drawGroundShadows(){if(!this.enabled)return;const e=this.painter,t=e.style,i=e.context,n=i.gl,r=t.directionalLight,o=t.ambientLight;if(!r||!o)return;const s=[],a=gn(e,e.longestCutoffRange);a.shouldRenderCutoff&&s.push("RENDER_CUTOFF"),s.push("RENDER_SHADOWS","DEPTH_TEXTURE"),this.useNormalOffset&&s.push("NORMAL_OFFSET");const l=Sn(t,r,o),c=new Xi(n.LEQUAL,Xi.ReadOnly,e.depthRangeFor3D),u=new Ki({func:n.EQUAL,mask:255},0,255,n.KEEP,n.KEEP,n.KEEP);for(const t of this._groundShadowTiles){const r=t.toUnwrapped(),o=e.isTileAffectedByFog(t),h=e.getOrCreateProgram("groundShadow",{defines:s,overrideFog:o});this.setupShadows(r,h),e.uploadCommonUniforms(i,h,r,null,a);const d={u_matrix:e.transform.calculateProjMatrix(r),u_ground_shadow_factor:l};h.draw(e,n.TRIANGLES,c,u,Zi.multiply,en.disabled,d,"ground_shadow",e.tileExtentBuffer,e.quadTriangleIndexBuffer,e.tileExtentSegments,null,e.transform.zoom,null,null)}}getShadowPassColorMode(){return this.painter._shadowMapDebug?Zi.unblended:Zi.disabled}getShadowPassDepthMode(){return this._depthMode}getShadowCastingLayerCount(){return this._shadowLayerCount}calculateShadowPassMatrixFromTile(t){const i=this.painter.transform,n=i.calculatePosMatrix(t,i.worldSize);return e.aB(n,this._cascades[this.painter.currentShadowCascade].matrix,n),Float32Array.from(n)}calculateShadowPassMatrixFromMatrix(t){const i=e.bz(t);return e.aB(i,this._cascades[this.painter.currentShadowCascade].matrix,t),i}setupShadows(t,i,n){if(!this.enabled)return;const r=this.painter.transform,o=this.painter.context,s=o.gl,a=this._uniformValues,l=new Float64Array(16),c=r.calculatePosMatrix(t,r.worldSize);for(let t=0;t<this._cascades.length;t++)e.aB(l,this._cascades[t].matrix,c),a[0===t?"u_light_matrix_0":"u_light_matrix_1"]=Float32Array.from(l),o.activeTexture.set(s.TEXTURE0+fn+t),this._cascades[t].texture.bindExtraParam(s.LINEAR,s.LINEAR,s.CLAMP_TO_EDGE,s.CLAMP_TO_EDGE,s.GREATER);if(this.useNormalOffset=!!n,this.useNormalOffset){const i=e.d7(t.canonical),o=2/r.tileSize*e.al/yn,s=o*this._cascades[0].boundingSphereRadius,l=o*this._cascades[this._cascades.length-1].boundingSphereRadius,c=("vector-tile"===n?1:3)*function(t){const i=e.aA((t-22)/-22,0,1
2);return.125*(1-i)+4*i}(r.zoom);a.u_shadow_normal_offset=[i,s*c,l*c],a.u_shadow_bias=[1e-4,.0012,.012]}else a.u_shadow_bias=[36e-5,.0012,.012];i.setShadowUniformValues(o,a)}setupShadowsFromMatrix(t,i,n=!1){if(!this.enabled)return;const r=this.painter.context,o=r.gl,s=this._uniformValues,a=new Float64Array(16);for(let i=0;i<2;i++)e.aB(a,this._cascades[i].matrix,t),s[0===i?"u_light_matrix_0":"u_light_matrix_1"]=Float32Array.from(a),r.activeTexture.set(o.TEXTURE0+fn+i),this._cascades[i].texture.bindExtraParam(o.LINEAR,o.LINEAR,o.CLAMP_TO_EDGE,o.CLAMP_TO_EDGE,o.GREATER);this.useNormalOffset=n,n?(s.u_shadow_normal_offset=[1,3,3],s.u_shadow_bias=[6e-5,.0012,.012]):s.u_shadow_bias=[36e-5,.0012,.012],i.setShadowUniformValues(r,s)}getShadowUniformValues(){return this._uniformValues}getCurrentCascadeFrustum(){return this._cascades[this.painter.currentShadowCascade].frustum}computeSimplifiedTileShadowVolume(t,i,n,r){if(r[2]>=0)return{};const o=function(t,i,n){const r=n/(1<<t.canonical.z);return new e.d9([t.canonical.x*r+t.wrap*n,t.canonical.y*r+t.wrap*n,0],[(t.canonical.x+1)*r+t.wrap*n,(t.canonical.y+1)*r+t.wrap*n,i])}(t,i,n).getCorners(),s=i/-r[2];r[0]<0?(e.d8(o[0],o[0],[r[0]*s,0,0]),e.d8(o[3],o[3],[r[0]*s,0,0])):r[0]>0&&(e.d8(o[1],o[1],[r[0]*s,0,0]),e.d8(o[2],o[2],[r[0]*s,0,0])),r[1]<0?(e.d8(o[0],o[0],[0,r[1]*s,0]),e.d8(o[1],o[1],[0,r[1]*s,0])):r[1]>0&&(e.d8(o[2],o[2],[0,r[1]*s,0]),e.d8(o[3],o[3],[0,r[1]*s,0]));const a={};return a.vertices=o,a.planes=[wn(o[1],o[0],o[4]),wn(o[2],o[1],o[5]),wn(o[3],o[2],o[6]),wn(o[0],o[3],o[7])],a}addShadowReceiver(t,i,n){this._receivers.add(t,e.d9.fromTileIdAndHeight(t,i,n))}getMaxCascadeForTile(e){const t=this._receivers.get(e);return t&&t.lastCascade?t.lastCascade:0}}function wn(t,i,n){const r=e.av([],n,i),o=e.av([],t,i),s=e.bI([],r,o),a=e.ag(s);return 0===a?[0,0,1,0]:(e.c5(s,s,1/a),[s[0],s[1],s[2],-e.bJ(s,i)])}function Tn(t){const i=t.properties.get("direction"),n=e.d4(i.x,i.y,i.z);n[2]=e.aA(n[2],0,75);const r=e.d6([n[0],n[1],n[2]]);return e.d5(r.x,r.y,r.z)}function Sn(t,i,n){const r="none"===i.properties.get("color-use-theme"),o=i.properties.get("color"),s=i.properties.get("intensity"),a=i.properties.get("direction"),l=[a.x,a.y,a.z],c="none"===n.properties.get("color-use-theme"),u=n.properties.get("color"),h=n.properties.get("intensity"),d=Math.max(e.bJ([0,0,1],l),0),f=[0,0,0];e.c5(f,u.toPremultipliedRenderColor(c?null:t.getLut(i.scope)).toArray01Linear().slice(0,3),h);const p=[0,0,0];return e.c5(p,o.toPremultipliedRenderColor(r?null:t.getLut(n.scope)).toArray01Linear().slice(0,3),d*s),e.db([f[0]>0?f[0]/(f[0]+p[0]):0,f[1]>0?f[1]/(f[1]+p[1]):0,f[2]>0?f[2]/(f[2]+p[2]):0])}function En(t,i,n,r,o,s){const a=t.zoom,l=t.scale,c=t.worldSize,u=1/c,h=t.aspect,d=Math.sqrt(1+h*h)*Math.tan(.5*t.fovX),f=d*d,p=r-n,m=r+n;let _,g;f>p/m?(_=r,g=r*d):(_=.5*m*(1+f),g=.5*Math.sqrt(p*p+2*(r*r+n*n)*f+m*m*f*f));const y=t.projection.pixelsPerMeter(t.center.lat,c),v=t._camera.getCameraToWorldMercator(),x=[0,0,-_*u];e.af(x,x,v);let b=g*u;const w=t._edgeInsets;if(!(0===w.left&&0===w.top&&0===w.right&&0===w.bottom||w.left===w.right&&w.top===w.bottom)){const i=t._camera.getWorldToCamera(t.worldSize,"meters"===t.projection.zAxisUnit?y:1),o=t._camera.getCameraToClipPerspective(t._fov,t.width/t.height,n,r);o[8]=2*-t.centerOffset.x/t.width,o[9]=2*t.centerOffset.y/t.height;const s=new Float64Array(16);e.cP(s,o,i);const u=new Float64Array(16);e.bl(u,s);const h=e.cB.fromInvProjectionMatrix(u,c,a,!0);for(const i of h.points){const n=((T=i)[0]/=l,T[1]/=l,T[2]=e.cf(T[2],t._center.lat),T);b=Math.max(b,e.c6(e.da([],x,n)))}}var T;b*=o/(o-1);const S=Math.acos(i[2]),E=Math.atan2(-i[0],-i[1]),I=new sn;I.position=x,I.setPitchBearing(S,E);const A=I.getWorldToCamera(c,y),M=b*c,C=Math.min(t._mercatorZfromZoom(17)*c*-2,-2*M),P=I.getCameraToClipOrthographic(-M,M,-M,M,C,(M+s*y)/i[2]),D=new Float64Array(16);e.aB(D,P,A);const R=e.d5(Math.floor(1e6*x[0])/1e6*c,Math.floor(1e6*x[1])/1e6*c,0),L=.5*o,z=[0,0,0];e.af(z,R,D),e.c5(z,z,L);const O=[Math.floor(z[0]),Math.floor(z[1]),Math.floor(z[2])],F=[0,0,0];e.av(F,z,O),e.c5(F,F,-1/L);const k=new Float64Array(16);return e.bA(k),e.br(k,k,F),e.aB(D,k,D),[D,M]}class In extends e.E{constructor(e){super(),this.requestManager=e,this.models={"":{}},this.modelUris={"":{}},this.modelByURL={},this.numModelsLoading={}}loadModel(t,i){return e.dc(this.requestManager.transformRequest(i,e.R.Model).url).then(n=>{if(!n)return;const r=e.dd(n),o=new e.de(t,i,void 0,void 0,r);return o.computeBoundsAndApplyParent(),o}
2).catch(n=>{if(n&&404===n.status)return null;this.fire(new e.y(new Error(`Could not load model ${t} from ${i}: ${n.message}`)))})}load(t,i,n={forceReload:!1}){this.models[i]||(this.models[i]={});const r=Object.keys(t),o=[],s=[];for(const e of r){const r=t[e];this.hasURLBeenRequested(r)&&!n.forceReload||(this.modelByURL[r]={modelId:e,scope:i},o.push(this.loadModel(e,r)),s.push(e)),this.models[i][e]||(this.models[i][e]={model:null,numReferences:1})}this.numModelsLoading[i]=(this.numModelsLoading[i]||0)+s.length,Promise.allSettled(o).then(t=>{for(let e=0;e<t.length;e++){const{status:n}=t[e];if("rejected"===n)continue;const{value:r}=t[e];this.models[i][s[e]]||(this.models[i][s[e]]={model:null,numReferences:1}),this.models[i][s[e]].model=r}this.numModelsLoading[i]-=s.length,this.fire(new e.z("data",{dataType:"style"}))}).catch(t=>{this.fire(new e.y(new Error(`Could not load models: ${t.message}`)))})}isLoaded(){for(const e in this.numModelsLoading)if(this.numModelsLoading[e]>0)return!1;return!0}hasModel(e,t,i={exactIdMatch:!1}){return!!(i.exactIdMatch?this.getModel(e,t):this.getModelByURL(this.modelUris[t][e]))}getModel(e,t){return this.models[t]||(this.models[t]={}),this.models[t][e]?this.models[t][e].model:void 0}getModelByURL(e){if(!e)return null;const t=this.modelByURL[e];return t?this.models[t.scope][t.modelId].model:null}hasModelBeenAdded(e,t){return this.models[t]&&void 0!==this.models[t][e]}getModelURIs(e){return this.modelUris[e]||{}}addModel(e,t,i){this.models[i]||(this.models[i]={}),this.modelUris[i]||(this.modelUris[i]={});const n=this.requestManager.normalizeModelURL(t);if((this.hasModel(e,i,{exactIdMatch:!0})||this.hasModelBeenAdded(e,i))&&this.modelUris[i][e]===n)this.models[i][e].numReferences++;else if(this.hasURLBeenRequested(n)){const{scope:e,modelId:t}=this.modelByURL[n];this.models[e][t].numReferences++}else this.modelUris[i][e]=n,this.load({[e]:this.modelUris[i][e]},i)}addModelURLs(e,t){this.models[t]||(this.models[t]={}),this.modelUris[t]||(this.modelUris[t]={});const i=this.modelUris[t];for(const t in e)i[t]=this.requestManager.normalizeModelURL(e[t])}reloadModels(e){this.load(this.modelUris[e],e,{forceReload:!0})}addModelsFromBucket(t,i){this.models[i]||(this.models[i]={}),this.modelUris[i]||(this.modelUris[i]={});const n={};for(const r of t)this.hasModel(r,i,{exactIdMatch:!0})||this.hasURLBeenRequested(r)?this.models[i][r].numReferences++:this.modelUris[i][r]&&!this.hasURLBeenRequested(r)?n[r]=this.modelUris[i][r]:!this.hasURLBeenRequested(r)&&e.df(r,!1)&&(this.modelUris[i][r]=this.requestManager.normalizeModelURL(r),n[r]=this.modelUris[i][r]);this.load(n,i)}hasURLBeenRequested(e){return void 0!==this.modelByURL[e]}removeModel(e,t,i=!1,n=!1){if(this.models[t]&&this.models[t][e]&&(this.models[t][e].numReferences--,0===this.models[t][e].numReferences||n)){const n=this.modelUris[t][e];i||delete this.modelUris[t][e],delete this.modelByURL[n];const r=this.models[t][e].model;if(!r)return;delete this.models[t][e],r.destroy()}}destroy(){for(const e of Object.keys(this.models))for(const t of Object.keys(this.models[e])){const i=this.models[e][t].model;delete this.models[e][t],i&&i.destroy()}this.models={"":{}},this.modelUris={"":{}},this.modelByURL={},this.numModelsLoading={}}listModels(e){return this.models[e]||(this.models[e]={}),Object.keys(this.models[e])}upload(e,t){this.models[t]||(this.models[t]={});for(const i in this.models[t])this.models[t][i].model&&this.models[t][i].model.upload(e.context)}}const An=e.a6.colorTheme,Mn=new e.a9({data:new e.aa(An.data)});function Cn(t){if(!t.metadata||!t.metadata.content_area)return;const i=e.o.devicePixelRatio,{left:n,top:r,width:o,height:s}=t.metadata.content_area,a=n*i,l=r*i;return[a,l,a+o*i,l+s*i]}function Pn(t){if(t)return t.map(([t,i])=>[t*e.o.devicePixelRatio,i*e.o.devicePixelRatio])}class Dn{constructor(e,t,i){this.id=e,this.scope=t,this.sourceCache=i,this.pendingRequests=new Set,this.missingRequests=new Set}addPendingRequest(e){this.missingRequests.has(e.name)||this.pendingRequests.has(e.name)||this.pendingRequests.add(e.name)}hasPendingRequests(){return this.pendingRequests.size>0}resolvePendingRequests(){const t=new Map;if(!this.sourceCache.loaded())return t;const i=this.sourceCache.getVisibleCoordinates();if(0===i.length)return t;const n=this.sourceCache.getSource();if(!(n instanceof dt))return t;const r=i.map(e=>this.sourceCache.getTile(e)),o=n.getImages(r,Array.from(this.pendingRequests));for(const[i,n]of o)t.set(e.I.from({name:i,iconsetId:this.id}),n),this.pendingRequests.delete(i);for(const e of this.pendingRequests)this.missingRequests.add(e);return this.pendingRequests.clear(),t}}const Rn=(e,t)=>Fe(e,t&&t.filter(e=>"source.canvas"!==e.identifier)),Ln=e.aH(Ut,["addLayer","removeLayer","setLights","setPaintProperty","setLayoutProperty","setLayerProperty","setSlot","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setSnow","setRain","setProjection","setCamera","addImport","removeImport","updateImport","addIconset","removeIconset"]),zn=e.aH(Ut,["setCenter","setZoom","setBearing","setP
2itch"]),On=new Set(["background","sky","slot","custom"]),Fn={version:8,layers:[],sources:{}},kn={duration:300,delay:0};class Bn extends e.E{constructor(t,i={}){super(),this.map=t,this.scope=i.scope||"",this.globalId=null,this.fragments=[],this.importDepth=i.importDepth||0,this.importsCache=i.importsCache||new Map,this.resolvedImports=i.resolvedImports||new Set,this.transition=Object.assign({},kn),this._buildingIndex=new Bt(this),this.crossTileSymbolIndex=new $i,this._mergedOrder=[],this._drapedFirstOrder=[],this._mergedLayers={},this._mergedIndoor={},this._mergedSourceCaches={},this._mergedOtherSourceCaches={},this._mergedSymbolSourceCaches={},this._clipLayerPresent=!1,this._hasAppearances=!1,this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this._importedAsBasemap=!1,this._changes=i.styleChanges||new W,this._hasDataDrivenEmissive=!1,this.dispatcher=i.dispatcher?i.dispatcher:new e.D(e.dh(),this),i.imageManager?this.imageManager=i.imageManager:(this.imageManager=new X(this.map._spriteFormat),this.imageManager.setEventedParent(this)),this.imageManager.addScope(this.scope),this.glyphManager=i.glyphManager?i.glyphManager:new e.di(t._requestManager,i.localFontFamily?e.dj.all:i.localIdeographFontFamily?e.dj.ideographs:e.dj.none,i.localFontFamily||i.localIdeographFontFamily),i.modelManager?this.modelManager=i.modelManager:(this.modelManager=new In(t._requestManager),this.modelManager.setEventedParent(this)),this._layers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._precompileDone=!1,this._shouldPrecompile=!1,this._availableImages=[],this._availableModels={},this._order=[],this._markersNeedUpdate=!1,this.options=i.configOptions?i.configOptions:new Map,this._configDependentLayers=i.configDependentLayers?i.configDependentLayers:new Set,this._indoorDependentLayers=i.indoorDependentLayers?i.indoorDependentLayers:new Set,this._config=i.config,this._styleColorTheme={lut:null,lutLoading:!1,lutLoadingCorrelationID:0,colorTheme:null,colorThemeOverride:i.colorThemeOverride},this._styleColorThemeForScope={},this._initialConfig=i.initialConfig,this.dispatcher.broadcast("setReferrer",e.dk());const n=this;this._rtlTextPluginCallback=Bn.registerForPluginStateChange(t=>{n.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:t.pluginStatus,pluginURL:t.pluginURL},(t,i)=>{if(e.dl(t),i&&i.every(e=>e))for(const e in n._sourceCaches){const t=n._sourceCaches[e],i=t.getSource().type;"vector"!==i&&"geojson"!==i||t.reload()}})}),this.on("data",e=>{if("source"!==e.dataType||"metadata"!==e.sourceDataType)return;const t=this.getOwnSource(e.sourceId);if(t&&t.vectorLayerIds)for(const e in this._layers){const i=this._layers[e];i.source===t.id&&this._validateLayer(i)}})}load(e){return e?("string"==typeof e?this.loadURL(e):this.loadJSON(e),this):this}_getGlobalId(t){if(!t)return null;if("string"==typeof t){if(e.h(t))return t;const i=e.dm(t);if(!i.startsWith("http"))try{return new URL(i,location.href).toString()}catch(e){return i}return i}return`json://${e.dn(JSON.stringify(t))}`}_diffStyle(t,i,n){this.globalId=this._getGlobalId(t);const r=(e,t)=>{try{t(null,this.setState(e,n))}catch(e){t(e,!1)}};if("string"==typeof t){const n=this.map._requestManager.normalizeStyleURL(t),o=this.map._requestManager.transformRequest(n,e.R.Style);e.m(o,(t,n)=>{t?this.fire(new e.y(t)):n&&r(n,i)})}else"object"==typeof t&&r(t,i)}loadURL(t,i={}){this.fire(new e.z("dataloading",{dataType:"style"}));const n="boolean"==typeof i.validate?i.validate:!e.h(t);this.globalId=this._getGlobalId(t),t=this.map._requestManager.normalizeStyleURL(t,i.accessToken),this.resolvedImports.add(t);const r=this.importsCache.get(t);if(r)return this._load(r,n);const o=this.map._requestManager.transformRequest(t,e.R.Style);this._request=e.m(o,(i,r)=>{if(this._request=null,i)this.fire(new e.y(i));else if(r)return this.importsCache.set(t,r),this._load(r,n)})}loadJSON(t,i={}){this.fire(new e.z("dataloading",{dataType:"style"})),this.globalId=this._getGlobalId(t),this._request=e.o.frame(()=>{this._request=null,this._load(t,!1!==i.validate)})}loadEmpty(){this.fire(new e.z("dataloading",{dataType:"style"})),this._load(Fn,!1)}_loadImports(t,i,n){if(this.importDepth>=4)return e.w("Style doesn't support nesting deeper than 5"),Promise.resolve();const r=[];for(const e of t){const t=this._createFragmentStyle(e),o=new Promise(e=>{t.once("style.import.load",e),t.once("error",e)}).then(()=>this.mergeAll());if(r.push(o),this.resolvedImports.has(e.url)){t.loadEmpty();continue}const s=e.data||this.importsCache.get(e.url);s?(t.loadJSON(s,{validate:i}),this._isInternalStyle(s)&&(t.globalId=null)):e.url?t.loadURL(e.url,{validate:i}):t.loadEmpty();const a={style:t,id:e.id,config:e.config};if(n){const e=this.fragments.findIndex(({id:e})=>e===n);this.fragments=this.fragments.slice(0,e).concat(a).concat(this.fragments.slice(e))}else this.fragments.push(a)}return Promise.allSettled(r)}getImportGlobalIds(e=this,t=new Set){for(const i of e.fragments)i.style.globalId&&t.add(i.style.globalId),this.getImportGlobalIds(i.style,t);return[...t.values()]}_createFragmentStyle(t){const i=this.scope?e.B(t.id,this.scope):t.id;let n;const r=this._initialConfig&&this._initialConfig[i];(t.config||r)&&(n=Object.assign({},t.config,r));const o=new Bn(this.map,{scope:i,styleChanges:this._changes,importDepth:this.importDepth+1,importsCache:this.importsCache,resolvedImports:new Set(this.resolvedImports),dispatcher:this.dispatcher,imageManager:this.imageManager,glyphManager:this.glyphManager,modelManager:this.modelManager,config:n,configOptions:this.options,colorThemeOverride:t["color-theme"],configDependentLayers:this._configDependentLayers,indoorDependentLayers:this._indo
2orDependentLayers});return o.setEventedParent(this.map,{style:o}),o}_reloadImports(){this.mergeAll(),this._updateMapProjection(),this.updateConfigDependencies(),this._updateLayers(this._indoorDependentLayers),this.map._triggerCameraUpdate(this.camera),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),this._shouldPrecompile=this.map._precompilePrograms&&this.isRootStyle()}_isInternalStyle(e){return this.isRootStyle()&&(e.fragment||!!e.schema&&!1!==e.fragment)}_load(t,i){if(this._isInternalStyle(t)){const e=Object.assign({},Fn,{imports:[{id:"basemap",data:t,url:""}]},t.center?{center:t.center}:{},t.bearing?{bearing:t.bearing}:{},t.pitch?{pitch:t.pitch}:{},t.zoom?{zoom:t.zoom}:{},t.light?{light:t.light}:{});return this._importedAsBasemap=!0,void this._load(e,i)}if(this.updateConfig(this._config,t.schema),i&&Rn(this,we(t)))return;this._loaded=!0,this.stylesheet=e.dp(t);const n=()=>{for(const e in t.sources)this.addSource(e,t.sources[e],{validate:!1,isInitialLoad:!0});if(t.iconsets)for(const e in t.iconsets)this.addIconset(e,t.iconsets[e]);t.sprite?this._loadIconset(t.sprite):(this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0})),!this.glyphManager.url&&t.glyphs&&this.glyphManager.setURL(t.glyphs);const n=Vt(this.stylesheet.layers);if(this._order=n.map(e=>e.id),this.stylesheet.light&&e.w("The `light` root property is deprecated, prefer using `lights` with `flat` light type instead."),this.stylesheet.lights)if(1===this.stylesheet.lights.length&&"flat"===this.stylesheet.lights[0].type){const e=this.stylesheet.lights[0];this.light=new Ne(e.properties,e.id)}else this.setLights(this.stylesheet.lights);this.light||(this.light=new Ne(this.stylesheet.light)),this._layers={};for(const t of n){const i=e.du(t,this.scope,this._styleColorTheme.lut,this.options);0!==i.expressionDependencies.configDependencies.size&&this._configDependentLayers.add(i.fqid),i.expressionDependencies.isIndoorDependent&&this._indoorDependentLayers.add(i.fqid),this._hasAppearances=this._hasAppearances||0!==i.getAppearances().length,i.setEventedParent(this,{layer:{id:i.id}}),this._layers[i.id]=i;const n=this.getOwnLayerSourceCache(i),r=!!this.directionalLight&&this.directionalLight.shadowsEnabled();n&&i.canCastShadows()&&r&&(n.castsShadows=!0)}this.stylesheet.featuresets&&this.setFeaturesetSelectors(this.stylesheet.featuresets),this.stylesheet.models&&this.addModelURLs(this.stylesheet.models);const r=this.stylesheet.terrain;r&&(this.checkCanvasFingerprintNoise(),this.disableElevatedTerrain||this.terrainSetForDrapingOnly()||this._createTerrain(r,1)),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this.stylesheet.snow&&this._createSnow(this.stylesheet.snow),this.stylesheet.rain&&this._createRain(this.stylesheet.rain),this.stylesheet.transition&&this.setTransition(this.stylesheet.transition),this.fire(new e.z("data",{dataType:"style"}));const o=this.isRootStyle();t.imports?this._loadImports(t.imports,i).then(()=>{this._reloadImports(),this.fire(new e.z(o?"style.load":"style.import.load"))}).catch(t=>{this.fire(new e.y(new Error("Failed to load imports",t))),this.fire(new e.z(o?"style.load":"style.import.load"))}):(this._reloadImports(),this.fire(new e.z(o?"style.load":"style.import.load")))};this._styleColorTheme.colorTheme=this.stylesheet["color-theme"];const r=this._styleColorTheme.colorThemeOverride?this._styleColorTheme.colorThemeOverride:this._styleColorTheme.colorTheme;if(r){const t=this._evaluateColorThemeData(r);this._loadColorTheme(t).then(()=>{n()}).catch(t=>{e.w(`Couldn't load color theme from the stylesheet: ${t}`),n()})}else this._styleColorTheme.lut=null,n()}isRootStyle(){return 0===this.importDepth}hasAppearances(){return this._hasAppearances||this.fragments.some(e=>e.style.hasAppearances())}mergeAll(){let e,t,i,n,r,o,s,a,l,c;const u={};this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle(h=>{if(h.stylesheet){if(null!=h.light&&(e=h.light),h.stylesheet.lights)for(const e of h.stylesheet.lights)"ambient"===e.type&&null!=h.ambientLight&&(t=h.ambientLight),"directional"===e.type&&null!=h.directionalLight&&(i=h.directionalLight);n=this._prioritizeTerrain(n,h.terrain,h.stylesheet.terrain),h.stylesheet.fog&&null!=h.fog&&(r=h.fog),h.stylesheet.snow&&null!=h.snow&&(o=h.snow),h.stylesheet.rain&&null!=h.rain&&(s=h.rain),null!=h.stylesheet.camera&&(c=h.stylesheet.camera),null!=h.stylesheet.projection&&(a=h.stylesheet.projection),null!=h.stylesheet.transition&&(l=h.stylesheet.transition),u[h.scope]=h._styleColorTheme}}),this.light=e,this.ambientLight=t,this.directionalLight=i,this.fog=r,this.snow=o,this.rain=s,this._styleColorThemeForScope=u,null===n?delete this.terrain:this.terrain=n,this.camera=c||{"camera-projection":"perspective"},this.projection=a||{name:"mercator"},this.transition=Object.assign({},kn,l),this.mergeSources(),this.mergeLayers(),this.mergeIndoor()}forEachFragmentStyle(e){const t=i=>{for(const e of i.fragments)t(e.style);e(i)};t(this)}_prioritizeTerrain(e,t,i){const n=e&&0===e.drapeRenderMode;return null===i?t&&0===t.drapeRenderMode?t:n?e:null:null!=t&&(!e||n||t&&1===t.drapeRenderMode)?t:e}mergeTerrain(){let e;this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle(t=>{e=this._prioritizeTerrain(e,t.terrain,t.stylesheet.terrain)}),null===e?delete this.terrain:this.terrain=e}mergeProjection(){let e;this.forEachFragmentStyle(t=>{null!=t.stylesheet.projection&&(e=t.stylesheet.projection)}),this.projection=e||{name:"mercator"}}mergeSources(){const t={},i={},n={};this.forEachFragmentStyle(r=>{for(const i in r._sourceCaches){const n=e.B(i,r.scope);t[n]=r._sourceCaches[i]}for(const t in r._otherSourceCaches){const n=e.B(t,r.scope);i[n]=r._otherSourceCaches[t]}for(const t in r._symbolSourceCaches){const i=e.B(t,r.scope);n[i]=r._symbolSourceCaches[t]}}),this._mergedSourceCaches=t,this._mergedOtherSourceCaches=i,this._mergedSymbolSourceCaches=n}mergeIndoor(){this.forEachFragmentStyle(t=>{if(t.stylesheet&&t.stylesheet.indoor)for(const i of Object.values(t.stylesheet.indoor)){const n=i,r=e.B(n.sourceId,t.scope);this._mergedIndoor[r]=new Set(n.sourceLayers||[])}})}mergeLayers(){const t={},i=[],n={};this._mergedSlots=[],this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this.forEachFragmentStyle(n=>{for(const r of n._order){const o=n._layers[r];if("slot"===o.type){const i=e.dq(r);if(t[i])continue;t[i]=[]}o.slot&&t[o.slot]?t[o.slot].push(o):i.push(o)}}),this._mergedOrder=[];let r=-1;const o=(i=[])=>{for(const s of i)if("slot"===s.type){const i=e.dq(s.id);t[i]&&o(t[i]),this._mergedSlots.push(i)}else{const t=e.B(s.id,s.scope);this._mergedOrder.push(t),n[t]=s,s.is3D(!!this.terrain)&&(this._has3DLayers=!0,r=this._mergedOrder.length-1),"circle"===s.type&&(this._hasCircleLayers=!0),"symbol"===s.type&&(this._hasSymbolLayers=!0),"clip"===s.type&&(this._clipLayerPresent=!0)}};if(o(i),this._has3DLayers){const e={};for(let t=0;t<this._mergedOrder.length;++t){const i=this._mergedOrder[t];e[i]=t===r?1:t<r?n[i].hasOcclusionOpacityProperties?2:0:4}this._mergedOrder.sort((t,i)=>e[t]-e[i])}this._mergedLayers=n,this.updateDrapeFirstLayers(),this._buildingIndex.processLayersChanged(),this._updateDataDrivenEmissiveStrength()}terrainSetForDrapingOnly(){return!!this.terrain&&0===this.terrain.drapeRenderMode}getCamera(){return this.stylesheet.camera}setCamera(e){return this.stylesheet.camera=Object.assign({},this.stylesheet.camera,e),this.camera=this.stylesheet.camera,this}_evaluateColorThemeData(t){return t.data?function(t,i,n){const r=Object.assign({},i);for(const e of Object.keys(An))void 0===r[e]&&(r[e]=An[e].default);const o=new e.a8(Mn,t,new Map(n));return o.setTransitionOrValue(r,n),o.untransitioned().possiblyEvaluate(new e.ac(0,{worldview:void 0}))}(this.scope,t,this.options).get("data"):null}_loadColorTheme(t){this._styleColorTheme.lutLoading=!0,this._styleColorTheme.lutLoadingCorrelationID+=1;const i=this._styleColorTheme.lutLoadingCorrelationID;return new Promise((n,r)=>{const o="data:image/png;base64,";if(!t||0===t.length)return this._styleColorTheme.lut=null,this._styleColorTheme.lutLoading=!1,void n();let s=t;s.startsWith(o)||(s=o+s);const a=e.I.from("mapbox-reserved-lut"),l=new Image;l.src=s,l.onerror=()=>{this._styleColorTheme.lutLoading=!1,r(new Error("Failed to load image data"))},l.onload=()=>
2{if(this._styleColorTheme.lutLoadingCorrelationID!==i)return void n();this._styleColorTheme.lutLoading=!1;const{width:o,height:s,data:c}=e.o.getImageData(l);if(s>32)return void r(new Error("The height of the image must be less than or equal to 32 pixels."));if(o!==s*s)return void r(new Error("The width of the image must be equal to the height squared."));this.getImage(a)&&this.removeImage(a),this.addImage(a,{data:new e.q({width:o,height:s},c),pixelRatio:1,sdf:!1,usvg:!1,version:0});const u=this.imageManager.getImage(a,this.scope);u?(this._styleColorTheme.lut={image:u.data,data:t},n()):r(new Error("Missing LUT image."))}})}getLut(e){const t=this._styleColorThemeForScope[e];return t?t.lut:null}setProjection(e){e?this.stylesheet.projection=e:delete this.stylesheet.projection,this.mergeProjection(),this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?(this.getTerrain()||this.stylesheet.terrain)&&!this.disableElevatedTerrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null,0))}_updateMapProjection(){this.isRootStyle()&&(this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.projection))}_loadSprite(t){this._spriteRequest=function(t,i,n){let r,o,s;const a=e.o.devicePixelRatio>1?"@2x":"";let l=e.m(i.transformRequest(i.normalizeSpriteURL(t,a,".json"),e.R.SpriteJSON),(e,t)=>{l=null,s||(s=e,r=t,u())}),c=e.n(i.transformRequest(i.normalizeSpriteURL(t,a,".png"),e.R.SpriteImage),(e,t)=>{c=null,s||(s=e,o=t,u())});function u(){if(s)n(s);else if(r&&o){const t=e.o.getImageData(o),i={};for(const n in r){const{width:o,height:s,x:a,y:l,sdf:c,pixelRatio:u,stretchX:h,stretchY:d,content:f}=r[n],p=new e.q({width:o,height:s});e.q.copy(t,p,{x:a,y:l},{x:0,y:0},{width:o,height:s},null),i[n]={data:p,pixelRatio:void 0!==u?u:1,sdf:void 0!==c&&c,stretchX:h,stretchY:d,content:f,usvg:!1,version:0}}n(null,i)}}return{cancel(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(t,this.map._requestManager,(t,i)=>{if(this._spriteRequest=null,t)this.fire(new e.y(t));else if(i){const t=new Map;for(const n in i)t.set(e.I.from(n),i[n]);this.addImages(t)}this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0}),this.fire(new e.z("data",{dataType:"style"}))})}addIconset(t,i){if("sprite"===i.type)return void this._loadSprite(i.url);const n=this.getOwnSourceCache(i.source);if(!n)return void this.fire(new e.y(new Error(`Source "${i.source}" as specified by iconset "${t}" does not exist and cannot be used as an iconset source`)));const r=n.getSource();if("raster-array"!==r.type)return void this.fire(new e.y(new Error(`Source "${i.source}" as specified by iconset "${t}" is not a "raster-array" source and cannot be used as an iconset source`)));r.partial=!1;const o=new Dn(t,this.scope,n);this.imageManager.addImageProvider(o,this.scope)}removeIconset(e){this.imageManager.removeImageProvider(e,this.scope)}_loadIconset(t){if(!e.h(t)&&"icon_set"!==this.map._spriteFormat||"raster"===this.map._spriteFormat)return void this._loadSprite(t);const i="auto"===this.map._spriteFormat;var n,r;this._spriteRequest=(r=(n,r)=>{if(this._spriteRequest=null,n)i?this._loadSprite(t):this.fire(new e.y(n));else if(r){const t=new Map;for(const i in r)t.set(e.I.from(i),r[i]);this.addImages(t)}this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0}),this.fire(new e.z("data",{dataType:"style"}))},e.bu((n=this.map._requestManager).transformRequest(n.normalizeIconsetURL(t),e.R.Iconset),(t,i)=>{if(t)return void r(t);const n={},o=e.dg(new e.bt(i));for(const t of o.icons){const i={version:1,pixelRatio:e.o.devicePixelRatio,content:Cn(t),stretchX:t.metadata?Pn(t.metadata.stretch_x_areas):void 0,stretchY:t.metadata?Pn(t.metadata.stretch_y_areas):void 0,sdf:!1,usvg:!0,icon:t};n[t.name]=i}r(null,n)}))}_validateLayer(t){const i=this.getOwnSource(t.source);if(!i)return;const n=t.sourceLayer;
2n&&("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new e.y(new Error(`Source layer "${n}" does not exist on source "${i.id}" as specified by style layer "${t.id}"`)))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._changes.getUpdatedSourceCaches()).length)return!1;for(const e in this._sourceCaches)if(!this._sourceCaches[e].loaded())return!1;if(!this.imageManager.isLoaded())return!1;if(this.imageManager.hasPatternsInFlight())return!1;if(!this.modelManager.isLoaded())return!1;if(this._styleColorTheme.lutLoading)return!1;for(const{style:e}of this.fragments)if(!e.loaded())return!1;return!0}_serializeImports(){if(this.stylesheet.imports)return this.stylesheet.imports.map((e,t)=>{const i=this.fragments[t];return i&&i.style&&(e.data=i.style.serialize()),e})}_serializeSources(){const e={};for(const t in this._sourceCaches){const i=this._sourceCaches[t].getSource();e[i.id]||(e[i.id]=i.serialize())}return e}_serializeLayers(e){const t=[];for(const i of e){const e=this._layers[i];e&&"custom"!==e.type&&t.push(e.serialize())}return t}hasLightTransitions(){return!(!this.light||!this.light.hasTransition())||!(!this.ambientLight||!this.ambientLight.hasTransition())||!(!this.directionalLight||!this.directionalLight.hasTransition())}hasFogTransition(){return!!this.fog&&this.fog.hasTransition()}hasSnowTransition(){return!!this.snow&&this.snow.hasTransition()}hasRainTransition(){return!!this.rain&&this.rain.hasTransition()}hasTransitions(){if(this.hasLightTransitions())return!0;if(this.hasFogTransition())return!0;if(this.hasSnowTransition())return!0;if(this.hasRainTransition())return!0;for(const e in this._sourceCaches)if(this._sourceCaches[e].hasTransition())return!0;for(const e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}_updateDataDrivenEmissiveStrength(){for(const e in this._mergedLayers){const t=this._mergedLayers[e];if(t._transitionablePaint&&t._transitionablePaint._values){const e=t._transitionablePaint._values["line-emissive-strength"];if(e&&e.value&&e.value.isDataDriven())return void(this._hasDataDrivenEmissive=!0)}}this._hasDataDrivenEmissive=!1}hasDataDrivenEmissiveStrength(){return this._hasDataDrivenEmissive}get order(){return this.terrain?this._drapedFirstOrder:this._mergedOrder}_getOrder(e){return e?this.order:this._mergedOrder}isLayerDraped(e){return!!this.terrain&&e.isDraped(this.getLayerSourceCache(e))}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}_checkLayer(t){const i=this.getOwnLayer(t);if(i)return i;this.fire(new e.y(new Error(`The layer '${t}' does not exist in the map's style.`)))}_checkSource(t){const i=this.getOwnSource(t);if(i)return i;this.fire(new e.y(new Error(`The source '${t}' does not exist in the map's style.`)))}precompilePrograms(e,t){const i=this.map.painter;if(i)for(let n=e.minzoom||0;n<(e.maxzoom||25.5);n++){const n=e.getProgramIds();if(n)for(const r of n){const n=e.getDefaultProgramParams(r,t.zoom,this._styleColorTheme.lut);n&&(i.style=this,this.fog&&(i._fogVisible=!0,n.overrideFog=!0,i.getOrCreateProgram(r,n)),i._fogVisible=!1,n.overrideFog=!1,i.getOrCreateProgram(r,n),(this.stylesheet.terrain||this.stylesheet.projection&&"globe"===this.stylesheet.projection.name)&&(n.overrideRtt=!0,i.getOrCreateProgram(r,n)))}}}update(t){if(!this._loaded)return;this.ambientLight&&this.ambientLight.recalculate(t),this.directionalLight&&this.directionalLight.recalculate(t);const i=this.calculateLightsBrightness();t.brightness=i||0,i!==this._brightness&&(this._brightness=i,this.dispatcher.broadcast("setBrightness",i)),t.worldview!==this._worldview&&(this._worldview=t.worldview,this.dispatcher.broadcast("setWorldview",this._worldview));const n=this._changes.isDirty();let r=!1;if(this._changes.isDirty()){const e=this._changes.getLayerUpdatesByScope();for(const t in e){const{updatedIds:i,removedIds:n}=e[t];(i||n)&&(this._updateWorkerLayers(t,i,n),r=!0)}this.updateSourceCaches(),this._updateTilesForChangedImages(),this.updateLayers(t),this.light&&this.light.updateTransitions(t),this.ambientLight&&this.ambientLight.updateTransitions(t),this.directionalLight&&this.directionalLight.updateTransitions(t),this.fog&&this.fog.updateTransitions(t),this.snow&&this.snow.updateTransitions(t),this.rain&&this.rain.updateTransitions(t),this._changes.reset()}const o={};for(const e in this._mergedSourceCaches){const t=this._mergedSourceCaches[e];o[e]=t.used,t.used=!1,t.tileCoverLift=0}for(const e of this._mergedOrder){const i=this._mergedLayers[e];if("none"!==i.visibility&&i.recalculate(t,this._availableImages),!i.isHidden(t.zoom)){const e=this.getLayerSourceCache(i);e&&(e.used=!0,e.tileCoverLift=Math.max(e.tileCoverLift,i.tileCoverLift()))}!this._precompileDone&&this._shouldPrecompile&&("requestIdleCallback"in window?requestIdleCallback(()=>
2{this.precompilePrograms(i,t)}):this.precompilePrograms(i,t))}this._shouldPrecompile&&(this._precompileDone=!0),this.terrain&&r&&this.mergeLayers();const s=this.imageManager.getPendingImageProviders();for(const e of s)e.sourceCache.used=!0;for(const t in o){const i=this._mergedSourceCaches[t];o[t]!==i.used&&i.getSource().fire(new e.z("data",{sourceDataType:"visibility",dataType:"source",sourceId:i.getSource().id}))}this.light&&this.light.recalculate(t),this.terrain&&this.terrain.recalculate(t),this.fog&&this.fog.recalculate(t),this.snow&&this.snow.recalculate(t),this.rain&&this.rain.recalculate(t),this.z=t.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),this.imageManager.clearUpdatedImages(this.scope),n&&this.fire(new e.z("data",{dataType:"style"}))}updateImageProviders(){const e=this.imageManager.getPendingImageProviders();for(const t of e){const e=t.resolvePendingRequests(),i=this.getFragmentStyle(t.scope);i&&i.addImages(e)}}_updateTilesForChangedImages(){const e={};for(const t in this._mergedSourceCaches){const i=this._mergedSourceCaches[t].getSource().scope;e[i]=e[i]||this._changes.getUpdatedImages(i),0!==e[i].length&&this._mergedSourceCaches[t].reloadTilesForDependencies(["icons","patterns"],e[i])}for(const t in e)this._changes.resetUpdatedImages(t)}_updateWorkerLayers(e,t,i){const n=this.getFragmentStyle(e);n&&this.dispatcher.broadcast("updateLayers",{layers:t?n._serializeLayers(t):[],scope:e,removedIds:i||[],options:n.options})}setState(t,i){if(this._checkLoaded(),Rn(this,we(t)))return!1;(t=e.dp(t)).layers=Vt(t.layers);const n=function(t,i){if(!t)return[{command:Ut.setStyle,args:[i]}];let n=[];try{if(!e.by(t.version,i.version))return[{command:Ut.setStyle,args:[i]}];if(e.by(t.center,i.center)||n.push({command:Ut.setCenter,args:[i.center]}),e.by(t.zoom,i.zoom)||n.push({command:Ut.setZoom,args:[i.zoom]}),e.by(t.bearing,i.bearing)||n.push({command:Ut.setBearing,args:[i.bearing]}),e.by(t.pitch,i.pitch)||n.push({command:Ut.setPitch,args:[i.pitch]}),e.by(t.sprite,i.sprite)||n.push({command:Ut.setSprite,args:[i.sprite]}),e.by(t.glyphs,i.glyphs)||n.push({command:Ut.setGlyphs,args:[i.glyphs]}),e.by(t.imports,i.imports)||function(t=[],i=[],n){i=i||[];const r=(t=t||[]).map(Wt),o=i.map(Wt),s=t.reduce(Zt,{}),a=i.reduce(Zt,{}),l=r.slice();let c,u,h,d;for(c=0,u=0;c<r.length;c++)h=r[c],a.hasOwnProperty(h)?u++:(n.push({command:Ut.removeImport,args:[h]}),l.splice(l.indexOf(h,u),1));for(c=0,u=0;c<o.length;c++)h=o[o.length-1-c],l[l.length-1-c]!==h&&(s.hasOwnProperty(h)?(n.push({command:Ut.removeImport,args:[h]}),l.splice(l.lastIndexOf(h,l.length-u),1)):u++,d=l[l.length-c],n.push({command:Ut.addImport,args:[a[h],d]}),l.splice(l.length-c,0,h));for(const t of i){const i=s[t.id];i&&(delete i.data,e.by(i,t)||n.push({command:Ut.updateImport,args:[t.id,t]}))}}(t.imports,i.imports,n),e.by(t.transition,i.transition)||n.push({command:Ut.setTransition,args:[i.transition]}),e.by(t.light,i.light)||n.push({command:Ut.setLight,args:[i.light]}),e.by(t.fog,i.fog)||n.push({command:Ut.setFog,args:[i.fog]}),e.by(t.snow,i.snow)||n.push({command:Ut.setSnow,args:[i.snow]}),e.by(t.rain,i.rain)||n.push({command:Ut.setRain,args:[i.rain]}),e.by(t.projection,i.projection)||n.push({command:Ut.setProjection,args:[i.projection]}),e.by(t.lights,i.lights)||n.push({command:Ut.setLights,args:[i.lights]}),e.by(t.camera,i.camera)||n.push({command:Ut.setCamera,args:[i.camera]}),e.by(t.iconsets,i.iconsets)||function(t,i,n){let r;for(r in i=i||{},t=t||{})t.hasOwnProperty(r)&&(i.hasOwnProperty(r)||n.push({command:Ut.removeIconset,args:[r]}));for(r in i){if(!i.hasOwnProperty(r))continue;const o=i[r];t.hasOwnProperty(r)?e.by(t[r],o)||(n.push({command:Ut.removeIconset,args:[r]}),n.push({command:Ut.addIconset,args:[r,o]})):n.push({command:Ut.addIconset,args:[r,o]})}}(t.iconsets,i.iconsets,n),!e.by(t["color-theme"],i["color-theme"]))return[{command:Ut.setStyle,args:[i]}];const r={},o=[];!function(t,i,n,r){let o;for(o in i=i||{},t=t||{})t.hasOwnProperty(o)&&(i.hasOwnProperty(o)||Gt(o,n,r));for(o in i){if(!i.hasOwnProperty(o))continue;const s=i[o];t.hasOwnProperty(o)?e.by(t[o],s)||("geojson"===t[o].type&&"geojson"===s.type&&Ht(t,i,o)?n.push({command:Ut.setGeoJSONSourceData,args:[o,s.data]}):qt(o,i,n,r)):jt(o,i,n)}}(t.sources,i.sources,o,r);const s=[];
2t.layers&&t.layers.forEach(e=>{e.source&&r[e.source]?n.push({command:Ut.removeLayer,args:[e.id]}):s.push(e)});let a=t.terrain;a&&r[a.source]&&(n.push({command:Ut.setTerrain,args:[void 0]}),a=void 0),n=n.concat(o),e.by(a,i.terrain)||n.push({command:Ut.setTerrain,args:[i.terrain]}),function(t,i,n){i=i||[];const r=(t=t||[]).map(Wt),o=i.map(Wt),s=t.reduce(Zt,{}),a=i.reduce(Zt,{}),l=r.slice(),c=Object.create(null);let u,h,d,f,p,m,_;for(u=0,h=0;u<r.length;u++)d=r[u],a.hasOwnProperty(d)?h++:(n.push({command:Ut.removeLayer,args:[d]}),l.splice(l.indexOf(d,h),1));for(u=0,h=0;u<o.length;u++)d=o[o.length-1-u],l[l.length-1-u]!==d&&(s.hasOwnProperty(d)?(n.push({command:Ut.removeLayer,args:[d]}),l.splice(l.lastIndexOf(d,l.length-h),1)):h++,m=l[l.length-u],n.push({command:Ut.addLayer,args:[a[d],m]}),l.splice(l.length-u,0,d),c[d]=!0);for(u=0;u<o.length;u++)if(d=o[u],f=s[d],p=a[d],!c[d]&&!e.by(f,p))if(e.by(f.source,p.source)&&e.by(f["source-layer"],p["source-layer"])&&e.by(f.type,p.type)){for(_ in $t(f.layout,p.layout,n,d,null,Ut.setLayoutProperty),$t(f.paint,p.paint,n,d,null,Ut.setPaintProperty),e.by(f.slot,p.slot)||n.push({command:Ut.setSlot,args:[d,p.slot]}),e.by(f.filter,p.filter)||n.push({command:Ut.setFilter,args:[d,p.filter]}),e.by(f.minzoom,p.minzoom)&&e.by(f.maxzoom,p.maxzoom)||n.push({command:Ut.setLayerZoomRange,args:[d,p.minzoom,p.maxzoom]}),f)f.hasOwnProperty(_)&&"layout"!==_&&"paint"!==_&&"filter"!==_&&"metadata"!==_&&"minzoom"!==_&&"maxzoom"!==_&&"slot"!==_&&(0===_.indexOf("paint.")?$t(f[_],p[_],n,d,_.slice(6),Ut.setPaintProperty):e.by(f[_],p[_])||n.push({command:Ut.setLayerProperty,args:[d,_,p[_]]}));for(_ in p)p.hasOwnProperty(_)&&!f.hasOwnProperty(_)&&"layout"!==_&&"paint"!==_&&"filter"!==_&&"metadata"!==_&&"minzoom"!==_&&"maxzoom"!==_&&"slot"!==_&&(0===_.indexOf("paint.")?$t(f[_],p[_],n,d,_.slice(6),Ut.setPaintProperty):e.by(f[_],p[_])||n.push({command:Ut.setLayerProperty,args:[d,_,p[_]]}))}else n.push({command:Ut.removeLayer,args:[d]}),m=l[l.lastIndexOf(d)+1],n.push({command:Ut.addLayer,args:[p,m]})}(s,i.layers,n)}catch(e){console.warn("Unable to compute style diff:",e),n=[{command:Ut.setStyle,args:[i]}]}return n}(this.serialize(),t).filter(e=>!(e.command in zn));if(0===n.length)return!1;const r=n.filter(e=>!(e.command in Ln));if(r.length>0)throw new Error(`Unimplemented: ${r.map(e=>e.command).join(", ")}.`);const o=[];return n.forEach(e=>{o.push(this[e.command](...e.args))}),i&&Promise.all(o).then(i).catch(i),this.stylesheet=t,this.mergeAll(),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),!0}_updateWorkerImages(){this._availableImages=this.imageManager.listImages(this.scope),this.dispatcher.broadcast("setImages",{scope:this.scope,images:this._availableImages})}_updateWorkerModels(){this._availableModels=this.modelManager.getModelURIs(this.scope),this.dispatcher.broadcast("setModels",{scope:this.scope,models:this._availableModels})}addImages(t){if(0===t.size)return this;for(const[i,n]of t.entries()){if(this.getImage(i))return this.fire(new e.y(new Error(`An image with the name "${i.name}" already exists.`)));this.imageManager.addImage(i,this.scope,n),this._changes.updateImage(i,this.scope)}return this._updateWorkerImages(),this.fire(new e.z("data",{dataType:"style"})),this}addImage(t,i){return this.getImage(t)?this.fire(new e.y(new Error(`An image with the name "${t.name}" already exists.`))):(this.imageManager.addImage(t,this.scope,i),this._changes.updateImage(t,this.scope),this._updateWorkerImages(),this.fire(new e.z("data",{dataType:"style"})),this)}updateImage(t,i,n=!1){this.imageManager.updateImage(t,this.scope,i),n&&(this._changes.updateImage(t,this.scope),this._updateWorkerImages(),this.fire(new e.z("data",{dataType:"style"})))}getImage(e){return this.imageManager.getImage(e,this.scope)}removeImage(t){return this.getImage(t)?(this.imageManager.removeImage(t,this.scope),this._changes.updateImage(t,this.scope),this._updateWorkerImages(),this.fire(new e.z("data",{dataType:"style"})),this):this.fire(new e.y(new Error("No image with this name exists.")))}listImages(){return this._checkLoaded(),this._availableImages.slice()}getActualScope(){return this._importedAsBasemap?"basemap":this.scope}addModelURLs(t){return this.modelManager.addModelURLs(t,this.getActualScope()),this._updateWorkerModels(),this.fire(new e.z("data",{dataType:"style"})),this}addModel(t,i,n={}
2){return this._checkLoaded(),this._validate(ze,`models.${t}`,i,null,n)||(this.modelManager.addModel(t,i,this.getActualScope()),this.fire(new e.z("data",{dataType:"style"}))),this}hasModel(e){return this.modelManager.hasModel(e,this.getActualScope())}removeModel(t){return this.hasModel(t)?(this.modelManager.removeModel(t,this.getActualScope(),!1,!0),this.fire(new e.z("data",{dataType:"style"})),this):this.fire(new e.y(new Error("No model with this ID exists.")))}listModels(){return this._checkLoaded(),this.modelManager.listModels(this.getActualScope())}addSource(t,i,n={}){if(this._checkLoaded(),void 0!==this.getOwnSource(t))throw new Error(`There is already a source with ID "${t}".`);if(!i.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(i).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(i.type)>=0&&this._validate(Te,`sources.${t}`,i,null,n))return;this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);const r=pt(t,i,this.dispatcher,this);r.scope=this.scope,r.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(r.id),source:r.serialize(),sourceId:r.id}));const o=t=>{const i=(t?"symbol:":"other:")+r.id,n=e.B(i,this.scope),o=this._sourceCaches[i]=new zt(n,r,t);(t?this._symbolSourceCaches:this._otherSourceCaches)[r.id]=o,o.onAdd(this.map)};o(!1),"vector"!==i.type&&"geojson"!==i.type||o(!0),r.onAdd&&r.onAdd(this.map),n.isInitialLoad||(this.mergeSources(),this._changes.setDirty())}removeSource(t){this._checkLoaded();const i=this.getOwnSource(t);if(!i)throw new Error("There is no source with this ID");for(const i in this._layers)if(this._layers[i].source===t)return this.fire(new e.y(new Error(`Source "${t}" cannot be removed while layer "${i}" is using it.`)));if(this.terrain&&this.terrain.scope===this.scope&&this.terrain.get().source===t)return this.fire(new e.y(new Error(`Source "${t}" cannot be removed while terrain is using it.`)));if(this.stylesheet.iconsets){const i=Object.entries(this.stylesheet.iconsets).find(([e,i])=>"source"===i.type&&i.source===t);if(i)return this.fire(new e.y(new Error(`Source "${t}" cannot be removed while iconset "${i[0]}" is using it.`)))}const n=this.getOwnSourceCaches(t);for(const t of n){const i=e.dq(t.id);delete this._sourceCaches[i],this._changes.discardSourceCacheUpdate(t.id),t.fire(new e.z("data",{sourceDataType:"metadata",dataType:"source",sourceId:t.getSource().id})),t.setEventedParent(null),t.clearTiles()}return delete this._otherSourceCaches[t],delete this._symbolSourceCaches[t],this.mergeSources(),i.setEventedParent(null),i.onRemove&&i.onRemove(this.map),this._changes.setDirty(),this}setGeoJSONSourceData(e,t){this._checkLoaded(),this.getOwnSource(e).setData(t),this._changes.setDirty()}getOwnSource(e){const t=this.getOwnSourceCache(e);return t&&t.getSource()}getOwnSources(){const e=[];for(const t in this._otherSourceCaches){const i=this.getOwnSourceCache(t);i&&e.push(i.getSource())}return e}areTilesLoaded(){const e=this._mergedSourceCaches;for(const t in e){const i=e[t]._tiles;for(const e in i){const t=i[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}}return!0}setLights(t){if(this._checkLoaded(),!t)return delete this.ambientLight,void delete this.directionalLight;const i=this._getTransitionParameters();for(const n of t){if(this._validate(Ee,"lights",n))return;switch(n.type){case"ambient":if(this.ambientLight){const e=this.ambientLight;e.set(n),e.updateTransitions(i)}else this.ambientLight=new tt(n,Ke||(Ke=new e.a9({color:new e.aa(e.a6.properties_light_ambient.color),"color-use-theme":new e.aa({type:"string",default:"default","property-type":"data-constant"}),intensity:new e.aa(e.a6.properties_light_ambient.intensity)})),this.scope,this.options);break;case"directional":if(this.directionalLight){const e=this.directionalLight;e.set(n),e.updateTransitions(i)}else this.directionalLight=new tt(n,Je||(Je=new e.a9({direction:new e.ap(e.a6.properties_light_directional.direction),color:new e.aa(e.a6.properties_light_directional.color),"color-use-theme":new e.aa({type:"string",default:"default","property-type":"data-constant"}),intensity:new e.aa(e.a6.properties_light_directional.intensity),"cast-shadows":new e.aa(e.a6.properties_light_directional["cast-shadows"]),"shadow-quality":new e.aa(e.a6.properties_light_directional["shadow-quality"]),"shadow-intensity":new e.aa(e.a6.properties_light_directional["shadow-intensity"])})),this.scope,this.options)}}const n=Object.assign(i,{worldview:this.map.getWorldview()}
vendor: 4,190 bytes, line 2
2),r=new e.ac(this.z||0,n);this.ambientLight&&this.ambientLight.recalculate(r),this.directionalLight&&this.directionalLight.recalculate(r),this._brightness=this.calculateLightsBrightness(),this.dispatcher.broadcast("setBrightness",this._brightness)}calculateLightsBrightness(){const t=this.directionalLight,i=this.ambientLight;if(!t||!i)return;const n=e=>.2126*(e[0]<=.03928?e[0]/12.92:Math.pow((e[0]+.055)/1.055,2.4))+.7152*(e[1]<=.03928?e[1]/12.92:Math.pow((e[1]+.055)/1.055,2.4))+.0722*(e[2]<=.03928?e[2]/12.92:Math.pow((e[2]+.055)/1.055,2.4)),r=t.properties.get("color").toNonPremultipliedRenderColor(null).toArray01(),o=t.properties.get("intensity"),s=t.properties.get("direction"),a=1-e.d4(s.x,s.y,s.z)[2]/90,l=n(r)*o*a,c=i.properties.get("color").toNonPremultipliedRenderColor(null).toArray01(),u=i.properties.get("intensity"),h=n(c)*u;return Number(((l+h)/2).toFixed(6))}getBrightness(){return this._brightness}getLights(){if(!this.enable3dLights())return null;const e=[];return this.directionalLight&&e.push(this.directionalLight.get()),this.ambientLight&&e.push(this.ambientLight.get()),e}enable3dLights(){return!!this.ambientLight&&!!this.directionalLight}getFragmentStyle(t){if(null==t||""===t&&this.isRootStyle())return this;if(e.dr(t)){const i=e.ds(t),n=this.fragments.find(({id:e})=>e===i);if(!n)return;const r=e.dq(t);return n.style.getFragmentStyle(r)}{const e=this.fragments.find(({id:e})=>e===t);return e?e.style:void 0}}setFeaturesetSelectors(t){if(!t)return;const i={},n=(e,t="")=>`${e}::${t}`;this._featuresetSelectors={};for(const r in t){const o=this._featuresetSelectors[r]=[];for(const s of t[r].selectors){if(s.featureNamespace){const t=this.getOwnLayer(s.layer);if(!t){e.w(`Layer is undefined for selector: ${s.layer}`);continue}const o=n(t.source,t.sourceLayer);if(o in i&&i[o]!==s.featureNamespace){e.w(`"featureNamespace ${s.featureNamespace} of featureset ${r}'s selector is not associated to the same source, skip this selector`);continue}i[o]=s.featureNamespace}let t;if(s.properties)for(const i in s.properties){const n=e.U(s.properties[i]);"success"===n.result&&(t=t||{},t[i]=n.value)}o.push({layerId:s.layer,namespace:s.featureNamespace,properties:t,uniqueFeatureID:s._uniqueFeatureID})}}}getFeaturesetDescriptors(e){const t=this.getFragmentStyle(e);if(!t||!t.stylesheet.featuresets)return[];const i=[];for(const e in t.stylesheet.featuresets)i.push({featuresetId:e,importId:t.scope?t.scope:void 0});return i}getFeaturesetLayers(t,i){const n=this.getFragmentStyle(i),r=n.stylesheet.featuresets;if(!r||!r[t])return this.fire(new e.y(new Error(`The featureset '${t}' does not exist in the map's style and cannot be queried.`))),[];const o=[];for(const e of r[t].selectors){const t=n.getOwnLayer(e.layer);t&&o.push(t)}return o}getConfigProperty(t,i){const n=this.getFragmentStyle(t);if(!n)return null;const r=e.B(i,n.scope),o=n.options.get(r),s=o?o.value||o.default:null;return s?s.serialize():null}isIndoorEnabled(){return Object.keys(this._mergedIndoor).length>0}getIndoorSourceLayers(t,i){const n=e.B(t,i);return this._mergedIndoor[n]}setIndoorData(e,t){this.map.indoor.setIndoorData(t)}updateIndoorDependentLayers(){this._updateLayers(this._indoorDependentLayers),this.map._styleDirty=!0,this.map.triggerRepaint()}setConfigProperty(t,i,n){const r=this.getFragmentStyle(t);if(!r)return;const o=r.stylesheet.schema;if(!o||!o[i])return;const s=e.U(n);if("success"!==s.result)return void Rn(this,s.value);const a=s.value.expression,l=e.B(i,r.scope),c=r.options.get(l);if(!c)return;let u;const{minValue:h,maxValue:d,stepValue:f,type:p,values:m}=o[i],_=e.U(o[i].default);"success"===_.result&&(u=_.value.expression),u?(this.options.set(l,Object.assign({},c,{value:a,default:u,minValue:h,maxValue:d,stepValue:f,type:p,values:m})),this.updateConfigDependencies(i)):this.fire(new e.y(new Error(`No schema defined for the config option "${i}" in the "${t}" fragment.`)))}getConfig(t){const i=this.getFragmentStyle(t);if(!i)return null;const n=i.stylesheet.schema;if(!n)return null;const r={};for(const t in n){const n=e.B(t,i.scope),o=i.options.get(n),s=o?o.value||o.default:null;r[t]=s?s.serialize():null}return r}setConfig(e,t){const i=this.getFragmentStyle(e);
2i&&(i.updateConfig(t,i.stylesheet.schema),this.updateConfigDependencies())}getSchema(e){const t=this.getFragmentStyle(e);return t?t.stylesheet.schema:null}setSchema(e,t){const i=this.getFragmentStyle(e);i&&(i.stylesheet.schema=t,i.updateConfig(i._config,t),this.updateConfigDependencies())}updateConfig(t,i){if(this._config=t,t||i)if(i)for(const n in i){let r,o;const s=e.U(i[n].default);if("success"===s.result&&(r=s.value.expression),t&&void 0!==t[n]){const i=e.U(t[n]);"success"===i.result&&(o=i.value.expression)}const{minValue:a,maxValue:l,stepValue:c,type:u,values:h}=i[n];if(r){const t=e.B(n,this.scope);this.options.set(t,{default:r,value:o,minValue:a,maxValue:l,stepValue:c,type:u,values:h})}else this.fire(new e.y(new Error(`No schema defined for config option "${n}".`)))}else this.fire(new e.y(new Error("Attempting to set config for a style without schema.")))}_updateLayers(e,t=()=>!0){for(const i of e){const e=this.getLayer(i);e&&t(e)&&(e.possiblyEvaluateVisibility(),this._updateLayer(e),this._changes.setDirty())}}updateConfigDependencies(e){this._updateLayers(this._configDependentLayers,t=>!e||t.expressionDependencies.configDependencies.has(e)),this.ambientLight&&this.ambientLight.updateConfig(this.options),this.directionalLight&&this.directionalLight.updateConfig(this.options),this.fog&&this.fog.updateConfig(this.options),this.snow&&this.snow.updateConfig(this.options),this.rain&&this.rain.updateConfig(this.options),this.forEachFragmentStyle(e=>{const t=e._styleColorTheme.colorThemeOverride?e._styleColorTheme.colorThemeOverride:e._styleColorTheme.colorTheme;if(t){const i=e._evaluateColorThemeData(t);(!e._styleColorTheme.lut&&""!==i||e._styleColorTheme.lut&&i!==e._styleColorTheme.lut.data)&&e.setColorTheme(t)}}),this._changes.setDirty()}addLayer(t,i,n={}){this._checkLoaded();const r=t.id;if(this._layers[r])return void this.fire(new e.y(new Error(`Layer with i
2d "${r}" already exists on this map`)));let o;if("custom"===t.type){if(Rn(this,e.dt(t)))return;o=e.du(t,this.scope,this._styleColorTheme.lut,this.options)}else{if("object"==typeof t.source&&(this.addSource(r,t.source),t=e.dp(t),t=Object.assign(t,{source:r})),this._validate(Pe,`layers.${r}`,t,{arrayIndex:-1},n))return;o=e.du(t,this.scope,this._styleColorTheme.lut,this.options),this._validateLayer(o),o.setEventedParent(this,{layer:{id:r}})}const s=e.B(o.source,o.scope);0!==o.expressionDependencies.configDependencies.size&&this._configDependentLayers.add(s),o.expressionDependencies.isIndoorDependent&&this._indoorDependentLayers.add(s);let a=this._order.length;if(i){const t=this._order.indexOf(i);if(-1===t)return void this.fire(new e.y(new Error(`Layer with id "${i}" does not exist on this map.`)));o.slot===this._layers[i].slot?a=t:e.w(`Layer with id "${i}" has a different slot. Layers can only be rearranged within the same slot.`)}this._order.splice(a,0,r),this._layerOrderChanged=!0,this._layers[r]=o;const l=this.getOwnLayerSourceCache(o),c=!!this.directionalLight&&this.directionalLight.shadowsEnabled();l&&o.canCastShadows()&&c&&(l.castsShadows=!0);const u=this._changes.getRemovedLayer(o);if(u&&o.source&&l&&"custom"!==o.type){this._changes.discardLayerRemoval(o);const t=e.B(o.source,o.scope);u.type!==o.type?this._changes.updateSourceCache(t,"clear"):(this._changes.updateSourceCache(t,"reload"),l.pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map),o.scope=this.scope,this.mergeLayers()}moveLayer(t,i){this._checkLoaded();const n=this._checkLayer(t);if(!n)return;if(t===i)return;const r=this._order.indexOf(t);this._order.splice(r,1);let o=this._order.length;if(i){const t=this._order.indexOf(i);
2if(-1===t)return void this.fire(new e.y(new Error(`Layer with id "${i}" does not exist on this map.`)));n.slot===this._layers[i].slot?o=t:e.w(`Layer with id "${i}" has a different slot. Layers can only be rearranged within the same slot.`)}this._order.splice(o,0,t),this._changes.setDirty(),this._layerOrderChanged=!0,this.mergeLayers()}removeLayer(e){this._checkLoaded();const t=this._checkLayer(e);if(!t)return;t.setEventedParent(null);const i=this._order.indexOf(e);this._order.splice(i,1),delete this._layers[e],this._changes.setDirty(),this._layerOrderChanged=!0,this._configDependentLayers.delete(t.fqid),this._indoorDependentLayers.delete(t.fqid),this._changes.removeLayer(t);const n=this.getOwnLayerSourceCache(t);if(n&&n.castsShadows){let e=!1;for(const i in this._layers)if(this._layers[i].source===t.source&&this._layers[i].canCastShadows()){e=!0;break}n.castsShadows=e}t.onRemove&&t.onRemove(this.map),this.mergeLayers()}getOwnLayer(e){return this._layers[e]}hasLayer(e){return e in this._mergedLayers}hasLayerType(e){for(const t in this._layers)if(this._layers[t].type===e)return!0;return!1}setLayerZoomRange(e,t,i){this._checkLoaded();const n=this._checkLayer(e);n&&(n.minzoom===t&&n.maxzoom===i||(null!=t&&(n.minzoom=t),null!=i&&(n.maxzoom=i),this._updateLayer(n)))}getSlots(){return this._checkLoaded(),this._mergedSlots}setSlot(e,t){this._checkLoaded();const i=this._checkLayer(e);i&&i.slot!==t&&(i.slot=t,this._updateLayer(i))}setFilter(t,i,n={}){this._checkLoaded();const r=this._checkLayer(t);if(r&&!e.by(r.filter,i))return null==i?(r.filter=void 0,void this._updateLayer(r)):void(this._validate(De,`layers.${r.id}.filter`,i,{layerType:r.type},n)||(r.filter=e.dp(i),this._updateLayer(r)))}getFilter(t){const i=this._checkLayer(t);if(i)return e.dp(i.filter)}setLayoutProperty(t,i,n,r={}){this._checkLoaded();const o=this._checkLayer(t);if(o&&!e.by(o.getLayoutProperty(i),n)){if(null!=n&&(!r||!1!==r.validate)&&Rn(o,Le.call(we,{key:`layers.${t}.layout.${i}`,layerType:o.type,objectKey:i,value:n,styleSpec:e.a6,style:{glyphs:!0,sprite:!0}})))return;o.setLayoutProperty(i,n),0!==o.expressionDependencies.configDependencies.size&&this._configDependentLayers.add(o.fqid),o.expressionDependencies.isIndoorDependent&&this._indoorDependentLayers.add(o.fqid),this._updateLayer(o)}}setLayerProperty(e,t,i,n={}){this._checkLoaded();const r=this._checkLayer(e);r&&("appearances"===t?(r.setAppearances(i),this._changes.setDirty()):r.isPaintProperty(t)?this.setPaintProperty(e,t,i,n):this.setLayoutProperty(e,t,i,n))}getLayoutProperty(e,t){const i=this._checkLayer(e);if(i)return i.getLayoutProperty(t)}setPaintProperty(t,i,n,r={}){this._checkLoaded();const o=this._checkLayer(t);if(!o)return;if(e.by(o.getPaintProperty(i),n))return;if(null!=n&&(!r||!1!==r.validate)&&Rn(o,Re.call(we,{key:`layers.${t}.paint.${i}`,layerType:o.type,objectKey:i,value:n,styleSpec:e.a6})))return;const s=o.setPaintProperty(i,n);0!==o.expressionDependencies.configDependencies.size&&this._configDependentLayers.add(o.fqid),o.expressionDependencies.isIndoorDependent&&this._indoorDependentLayers.add(o.fqid),s&&this._updateLayer(o),this._changes.updatePaintProperties(o)}getPaintProperty(e,t){const i=this._checkLayer(e);if(i)return i.getPaintProperty(t)}setFeatureState(t,i){if(this._checkLoaded(),"target"in t){if("featuresetId"in t.target){const{featuresetId:e,importId:n}=t.target,r=this.getFragmentStyle(n),o=r.getFeaturesetLayers(e);for(const{source:e,sourceLayer:n}of o)r.setFeatureState({id:t.id,source:e,sourceLayer:n},i)}else if("layerId"in t.target){const{layerId:e}=t.target,n=this.getLayer(e);this.setFeatureState({id:t.id,source:n.source,sourceLayer:n.sourceLayer},i)}return}const n=t.source,r=t.sourceLayer,o=this._checkSource(n);if(!o)return;const s=o.type;if("geojson"===s&&r)return void this.fire(new e.y(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===s&&!r)return void this.fire(new e.y(new Error("The sourceLayer parameter must be provided for vector source types.")));void 0===t.id&&this.fire(new e.y(new Error("The feature id parameter must be provided.")));const a=this.getOwnSourceCaches(n);for(const e of a)e.setFeatureState(r,t.id,i)}removeFeatureState(t,i){if(this._checkLoaded(),"target"in t){if("featuresetId"in t.target){const{featuresetId:e,importId:n}=t.target,r=this.getFragmentStyle(n),o=r.getFeaturesetLayers(e);for(const{source:e,sourceLayer:n}of o)r.removeFeatureState({id:t.id,source:e,sourceLayer:n},i)}else if("layerId"in t.target){const{layerId:e}=t.target,n=this.getLayer(e);this.removeFeatureState({id:t.id,source:n.source,sourceLayer:n.sourceLayer},i)}return}const n=t.source,r=this._checkSource(n);if(!r)return;
2const o=r.type,s="vector"===o?t.sourceLayer:void 0;if("vector"===o&&!s)return void this.fire(new e.y(new Error("The sourceLayer parameter must be provided for vector source types.")));if(i&&"string"!=typeof t.id&&"number"!=typeof t.id)return void this.fire(new e.y(new Error("A feature id is required to remove its specific state property.")));const a=this.getOwnSourceCaches(n);for(const e of a)e.removeFeatureState(s,t.id,i)}getFeatureState(t){if(this._checkLoaded(),"target"in t){let i;if("featuresetId"in t.target){const{featuresetId:n,importId:r}=t.target,o=this.getFragmentStyle(r),s=o.getFeaturesetLayers(n);for(const{source:n,sourceLayer:r}of s){const s=o.getFeatureState({id:t.id,source:n,sourceLayer:r});if(s&&!i)i=s;else if(!e.by(i,s))return void this.fire(new e.y(new Error("The same feature id exists in multiple sources in the featureset, but their feature states are not consistent through the sources.")))}}else if("layerId"in t.target){const{layerId:e}=t.target,n=this.getLayer(e);i=this.getFeatureState({id:t.id,source:n.source,sourceLayer:n.sourceLayer})}return i}const i=t.source,n=t.sourceLayer,r=this._checkSource(i);if(r){if("vector"!==r.type||n)return void 0===t.id&&this.fire(new e.y(new Error("The feature id parameter must be provided."))),this.getOwnSourceCaches(i)[0].getFeatureState(n,t.id);this.fire(new e.y(new Error("The sourceLayer parameter must be provided for vector source types.")))}}setTransition(e){return this.stylesheet.transition=Object.assign({},this.stylesheet.transition,e),this.transition=this.stylesheet.transition,this}getTransition(){return Object.assign({},this.stylesheet.transition)}serialize(){this._checkLoaded();const t=this.getTerrain(),i=t&&this.terrain&&this.terrain.scope===this.scope?t:this.stylesheet.terrain;return e.dv({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,fragment:this.stylesheet.fragment,iconsets:this.stylesheet.iconsets,imports:this._serializeImports(),schema:this.stylesheet.schema,camera:this.stylesheet.camera,light:this.stylesheet.light,lights:this.stylesheet.lights,terrain:i,fog:this.stylesheet.fog,snow:this.stylesheet.snow,rain:this.stylesheet.rain,center:this.stylesheet.center,"color-theme":this.stylesheet["color-theme"],zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:this._serializeSources(),layers:this._serializeLayers(this._order)},e=>void 0!==e)}_updateFilteredLayers(e){for(const t of Object.values(this._mergedLayers))e(t)&&this._updateLayer(t)}_updateLayer(t){this._changes.updateLayer(t);const i=this.getLayerSourceCache(t),n=e.B(t.source,t.scope),r=this._changes.getUpdatedSourceCaches();t.source&&!r[n]&&i&&"raster"!==i.getSource().type&&(this._changes.updateSourceCache(n,"reload"),i.pause()),t.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(e){const t=e=>this._mergedLayers[e].is3D(!!this.terrain),i=this.order,n={},r=[];for(let o=i.length-1;o>=0;o--){const s=i[o];if(t(s)){n[s]=o;for(const t of e){const e=t[s];if(e)for(const t of e)r.push(t)}}}r.sort((e,t)=>t.intersectionZ-e.intersectionZ);const o=[];for(let s=i.length-1;s>=0;s--){const a=i[s];if(t(a))for(let e=r.length-1;e>=0;e--){const t=r[e].feature;if(t.layer&&n[t.layer.id]<s)break;o.push(t),r.pop()}else for(const t of e){const e=t[a];if(e)for(const t of e)o.push(t.feature)}}return o}queryRasterValue(t,i,n){const r=this.getOwnSource(t);return r?"raster-array"!==r.type?(this.fire(new e.y(new Error('queryRasterValue support only "raster-array" sources.'))),Promise.resolve(null)):r.queryRasterArrayValue(i,n):(this.fire(new e.y(new Error(`Source with id "${t}" does not exist in the style.`))),Promise.resolve(null))}queryRenderedFeatures(t,i,n){let r;i&&!Array.isArray(i)&&i.filter&&(this._validate(De,"queryRenderedFeatures.filter",i.filter,null,i),r=e.b6(i.filter));const o={},s=e=>{if(On.has(e.type))return;const t=this.getOwnLayerSourceCache(e),i=o[t.id]=o[t.id]||{sourceCache:t,layers:{},has3DLayers:!1};e.is3D(!!this.terrain)&&(i.has3DLayers=!0),i.layers[e.fqid]=i.layers[e.fqid]||{styleLayer:e,targets:[]}
2,i.layers[e.fqid].targets.push({filter:r})};if(i&&i.layers){if(!Array.isArray(i.layers))return this.fire(new e.y(new Error("parameters.layers must be an Array."))),[];for(const t of i.layers){const i=this._layers[t];if(!i)return this.fire(new e.y(new Error(`The layer '${t}' does not exist in the map's style and cannot be queried for features.`))),[];s(i)}}else for(const e in this._layers)s(this._layers[e]);const a=this._queryRenderedFeatures(t,o,n),l=this._flattenAndSortRenderedFeatures(a),c=[];for(const t of l)e.dw(t.layer.id)===this.scope&&c.push(t);return c}queryRenderedFeatureset(t,i,n){let r;i&&!Array.isArray(i)&&i.filter&&(this._validate(De,"queryRenderedFeatures.filter",i.filter,null,i),r=e.b6(i.filter));const o="mock",s=[];if(i&&i.target)s.push(Object.assign({},i,{targetId:o,filter:r}));else{const e=this.getFeaturesetDescriptors();for(const t of e)s.push({targetId:o,filter:r,target:t});for(const{style:e}of this.fragments){const t=e.getFeaturesetDescriptors();for(const e of t)s.push({targetId:o,filter:r,target:e})}}const a=this.queryRenderedTargets(t,s,n),l=[],c=new Set;for(const t of a)for(const i of t.variants[o])_t(i,t,c)||l.push(new e.dx(t,i));return l}queryRenderedTargets(t,i,n){const r={},o=(e,t,i,n)=>{const o=r[t.id]=r[t.id]||{sourceCache:t,layers:{},has3DLayers:!1};if(o.layers[e.fqid]=o.layers[e.fqid]||{styleLayer:e,targets:[]},e.is3D(!!this.terrain)&&(o.has3DLayers=!0),!n)return i.uniqueFeatureID=!1,void o.layers[e.fqid].targets.push(i);o.layers[e.fqid].targets.push(Object.assign({},i,{namespace:n.namespace,properties:n.properties,uniqueFeatureID:n.uniqueFeatureID}))};for(const t of i)if("featuresetId"in t.target){const{featuresetId:i,importId:n}=t.target,r=this.getFragmentStyle(n);if(!r||!r._featuresetSelectors)continue;const s=r._featuresetSelectors[i];if(!s){this.fire(new e.y(new Error(`The featureset '${i}' does not exist in the map's style and cannot be queried for features.`)));continue}for(const e of s){const i=r.getOwnLayer(e.layerId);i&&!On.has(i.type)&&o(i,r.getOwnLayerSourceCache(i),t,e)}}else if("layerId"in t.target){const{layerId:e}=t.target,i=this.getLayer(e);if(!i||On.has(i.type))continue;o(i,this.getLayerSourceCache(i),t)}const s=this._queryRenderedFeatures(t,r,n);return this._flattenAndSortRenderedFeatures(s)}_queryRenderedFeatures(e,t,i){const n=[],r=!!this.map._showQueryGeometry,o=it.createFromScreenPoints(e,i);for(const e in t){const s=gt(o,t[e],this._availableImages,i,r);Object.keys(s).length&&n.push(s)}if(this.placement)for(const e in t){if(!t[e].sourceCache._onlySymbols)continue;const i=yt(o.screenGeometry,t[e],this._availableImages,this.placement.collisionIndex,this.placement.retainedQueryData,this.map.getWorldview());Object.keys(i).length&&n.push(i)}return n}querySourceFeatures(e,t){const i=t&&t.filter;i&&this._validate(De,"querySourceFeatures.filter",i,null,t);let n=[];const r=this.getOwnSourceCaches(e);for(const e of r)n=n.concat(vt(e,t));return n}addSourceType(e,t,i){return Bn.getSourceType(e)?i(new Error(`A source type called "${e}" already exists.`)):(Bn.setSourceType(e,t),t.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:e,url:t.workerSourceURL},i):i(null,null))}getFlatLight(){return this.light.getLight()}setFlatLight(t,i,n={}){this._checkLoaded();const r=this.light.getLight();let o=!1;for(const i in t)if(!e.by(t[i],r[i])){o=!0;break}if(!o)return;const s=this._getTransitionParameters();this.light.setLight(t,i,n),this.light.updateTransitions(s)}getTerrain(){return this.terrain&&1===this.terrain.drapeRenderMode?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}checkCanvasFingerprintNoise(){void 0===this.disableElevatedTerrain&&(this.disableElevatedTerrain=e.o.hasCanvasFingerprintNoise(),this.disableElevatedTerrain&&e.w("Terrain and hillshade are disabled because of Canvas2D limitations when fingerprinting protection is enabled (e.g. in private browsing mode)."))}setTerrain(t,i=1){if(this._checkLoaded(),!t)return this.terrainSetForDrapingOnly()||(delete this.terrain,this.map.transform.projection.requiresDraping&&this.setTerrainForDraping()),0===i&&delete this.terrain,null===t?this.stylesheet.terrain=null:delete this.stylesheet.terrain,this._force3DLayerUpdate(),void(this._markersNeedU
2pdate=!0);this.checkCanvasFingerprintNoise();let n=t;const r=!("source"in t)||null==t.source;if(1===i){if(this.disableElevatedTerrain)return;if("source"in n&&"object"==typeof n.source){const t="terrain-dem-src";this.addSource(t,n.source),n=e.dp(n),n=Object.assign(n,{source:t})}const t=Object.assign({},n),i={};if(this.terrain&&r){t.source=this.terrain.get().source;const e=this.terrain?this.getFragmentStyle(this.terrain.scope):null;e&&(i.style=e.serialize())}if(this._validate(Ie,"terrain",t,i))return}if(!this.terrain||this.terrain.scope!==this.scope&&!r||this.terrain&&i!==this.terrain.drapeRenderMode){if(!n)return;this._createTerrain(n,i),this.fire(new e.z("data",{dataType:"style"}))}else{const i=this.terrain,r=i.get();for(const t of Object.keys(e.a6.terrain))!n.hasOwnProperty(t)&&e.a6.terrain[t].default&&(n[t]=e.a6.terrain[t].default);for(const n in t)if(!e.by(t[n],r[n])){i.set(t,this.options),this.stylesheet.terrain=t;const n=this._getTransitionParameters({duration:0});i.updateTransitions(n),this.fire(new e.z("data",{dataType:"style"}));break}}this.mergeTerrain(),this.updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(e){const t=this.fog=new Ze(e,this.map.transform,this.scope,this.options);this.stylesheet.fog=t.get();const i=this._getTransitionParameters({duration:0});t.updateTransitions(i)}_createSnow(e){const t=this.snow=new Qe(e,this.map.transform,this.scope,this.options);this.stylesheet.snow=t.get();const i=this._getTransitionParameters({duration:0});t.updateTransitions(i)}_createRain(e){const t=this.rain=new et(e,this.map.transform,this.scope,this.options);this.stylesheet.rain=t.get();const i=this._getTransitionParameters({duration:0});t.updateTransitions(i)}_updateMarkersOpacity(){0!==this.map._markers.length&&this.map._requestDomTask(()=>{for(const e of this.map._markers)e._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(t){if(this._checkLoaded(),!t)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const i=this.fog;if(!e.by(i.get(),t)){i.set(t,this.options),this.stylesheet.fog=i.get();const e=this._getTransitionParameters({duration:0});i.updateTransitions(e)}}else this._createFog(t);this._markersNeedUpdate=!0}getSnow(){return this.snow?this.snow.get():null}setSnow(t){if(this._checkLoaded(),!t)return delete this.snow,void delete this.stylesheet.snow;if(this.snow){const i=this.snow;if(!e.by(i.get(),t)){i.set(t,this.options),this.stylesheet.snow=i.get();const e=this._getTransitionParameters({duration:0});i.updateTransitions(e)}}else this._createSnow(t);this._markersNeedUpdate=!0}getRain(){return this.rain?this.rain.get():null}setRain(t){if(this._checkLoaded(),!t)return delete this.rain,void delete this.stylesheet.rain;if(this.rain){const i=this.rain;if(!e.by(i.get(),t)){i.set(t,this.options),this.stylesheet.rain=i.get();const e=this._getTransitionParameters({duration:0});i.updateTransitions(e)}}else this._createRain(t);this._markersNeedUpdate=!0}_reloadColorTheme(){const t=()=>{for(const e in this._layers)this._layers[e].lut=this._styleColorTheme.lut;for(const e in this._sourceCaches)this._sourceCaches[e].clearTiles()},i=this._styleColorTheme.colorThemeOverride?this._styleColorTheme.colorThemeOverride:this._styleColorTheme.colorTheme;if(!i)return this._styleColorTheme.lut=null,void t();const n=this._evaluateColorThemeData(i);this._loadColorTheme(n).then(()=>{this.fire(new e.z("colorthemeset")),t()}).catch(t=>{e.w(`Couldn't set color theme: ${t}`)})}setColorTheme(t){this._checkLoaded(),this._styleColorTheme.colorThemeOverride&&e.w("Note: setColorTheme is called on a style with a color-theme override, the passed color-theme won't be visible."),this._styleColorTheme.colorTheme=t,this._reloadColorTheme()}setImportColorTheme(e,t){const i=this.getFragmentStyle(e);i&&(i._styleColorTheme.colorThemeOverride=t,i._reloadColorTheme())}_getTransitionParameters(t){return{now:e.o.now(),transition:Object.assign(this.transition,t)}}updateDrapeFirstLayers(){if(!this.terrain)return;const e=[],t=[];for(const i of this._mergedOrder)this.isLayerDraped(this._mergedLayers[i])?e.push(i):t.push(i);this._drapedFirstOrder=[],this._drapedFirstOrder.push(...e),this._drapedFirstOrder.push(...t)}_createTerrain(e,t){const i=this.terrain=new Ue(e,t,this.scope,this.options,this.map.getWorldview());1===t&&(this.stylesheet.terrain=e),this.mergeTerrain(),this.updateDrapeFirstLayers(),this._force3DLayerUpdate();const n=this._getTransitionParameters({duration:0});i.updateTransitions(n)}_force3DLayerUpdate(){for(const e in this._layers){const t=this._layers[e];"fill-extrusion"===t.type&&this._updateLayer(t)}}
2_forceSymbolLayerUpdate(){for(const e in this._layers){const t=this._layers[e];"symbol"===t.type&&this._updateLayer(t)}}_validate(t,i,n,r,o={}){if(o&&!1===o.validate)return!1;const s=Object.assign({},this.serialize());return Rn(this,t.call(we,Object.assign({key:i,style:s,value:n,styleSpec:e.a6},r)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),e.dy.off("pluginStateChange",this._rtlTextPluginCallback);for(const e in this._mergedLayers)this._mergedLayers[e].setEventedParent(null);for(const e in this._mergedSourceCaches)this._mergedSourceCaches[e].clearTiles(),this._mergedSourceCaches[e].setEventedParent(null);this.imageManager.removeScope(this.scope),this.setEventedParent(null),delete this.fog,delete this.snow,delete this.rain,delete this.terrain,delete this.ambientLight,delete this.directionalLight,this.isRootStyle()&&(this.imageManager.setEventedParent(null),this.imageManager.destroy(),this.modelManager.setEventedParent(null),this.modelManager.destroy(),this.dispatcher.remove())}clearSource(e){const t=this.getSourceCaches(e);for(const e of t)e.clearTiles()}clearSources(){for(const e in this._mergedSourceCaches)this._mergedSourceCaches[e].clearTiles()}clearLayers(){for(const e in this._mergedLayers){const t=this._mergedLayers[e];t._clear&&t._clear()}}reloadSource(e){const t=this.getSourceCaches(e);for(const e of t)e.resume(),e.reload()}reloadSources(){for(const e of this.getSources())e.reload&&e.reload()}reloadModels(){this.modelManager.reloadModels(""),this.forEachFragmentStyle(e=>{e.modelManager.reloadModels(e.scope)})}updateSources(e){let t;this.directionalLight&&(t=Tn(this.directionalLight));const i=new Set,n=new Set;for(const e in this._mergedLayers){const t=this._mergedLayers[e];
2"building"===t.type&&i.add(t.source),t.hasElevation()&&!n.has(t.source)&&n.add(t.source)}for(const r in this._mergedSourceCaches){const o=this._mergedSourceCaches[r],s=n.has(o._source.id);i.has(o._source.id)&&(o._source.reparseOverscaled=!1),o.update(e,void 0,void 0,t,s)}}_generateCollisionBoxes(){for(const e in this._sourceCaches){const t=this._sourceCaches[e];t.resume(),t.reload()}}_updatePlacement(t,i,n,r,o,s,a=!1){let l=!1,c=!1;const u={},h={};for(const t of this._mergedOrder){const n=this._mergedLayers[t];if("symbol"!==n.type)continue;const r=e.B(n.source,n.scope);let o=u[r];if(!o){const e=this.getLayerSourceCache(n);if(!e)continue;const t=e.getRenderableIds(!0).map(t=>e.getTileByID(t));h[r]=t.slice(),o=u[r]=t.sort((e,t)=>t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1))}const s=this.crossTileSymbolIndex.addLayer(n,o,i.center.lng,i.projection);l=l||s}this.crossTileSymbolIndex.pruneUnusedLayers(this._mergedOrder),a=a||this._layerOrderChanged,this._layerOrderChanged&&this.fire(new e.z("neworder"));const d=Boolean(this.placement&&!i.equals(this.placement.transform)),f=Boolean(this.placement&&(0!==this.placement.lastReplacementSourceUpdateTime&&!s||this.placement.lastReplacementSourceUpdateTime!==s.updateTime)),p=(d||f||l||this.placement&&this.placement.isStale())&&0===r;if((a||!this.pauseablePlacement||p||0!==r&&this.pauseablePlacement.isDone()&&!this.placement.stillRecent(e.o.now(),i.zoom))&&(this.pauseablePlacement=new Ui(i,this._mergedOrder,a||0===r,n,r,o,this.placement,this.fog&&i.projection.supportsFog?this.fog.state:null,this._buildingIndex),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._mergedOrder,this._mergedLayers,u,h,this.map.painter.scaleFactor),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(e.o.now()),c=!0),l&&this.pauseablePlacement.placement.setStale()),c||l){this._buildingIndex.onNewFrame(i.zoom);for(let t=0;t<this._mergedOrder.length;t++){const i=this._mergedLayers[this._mergedOrder[t]];if("symbol"!==i.type)continue;if("none"===i.visibility)continue;const n=this.isLayerClipped(i);this.placement.updateLayerOpacities(i,u[e.B(i.source,i.scope)],t,n?s:null)}}return{needsRerender:!this.pauseablePlacement.isDone()||this.placement.hasTransitions(e.o.now())}}_releaseSymbolFadeTiles(){for(const e in this._sourceCaches)this._sourceCaches[e].releaseSymbolFadeTiles()}addImport(t,i){this._checkLoaded();const n=this.stylesheet.imports=this.stylesheet.imports||[];if(-1!==n.findIndex(({id:e})=>e===t.id))return void this.fire(new e.y(new Error(`Import with id '${t.id}' already exists in the map's style.`)));if(!i)return n.push(t),this._loadImports([t],!0);const r=n.findIndex(({id:e})=>e===i);return-1===r&&this.fire(new e.y(new Error(`Import with id "${i}" does not exist on this map.`))),this.stylesheet.imports=n.slice(0,r).concat(t).concat(n.slice(r)),this._loadImports([t],!0,i)}updateImport(t,i){this._checkLoaded();const n=this.stylesheet.imports||[],r=this.getImportIndex(t);return-1===r?this:"string"==typeof i?(this.setImportUrl(t,i),this):(i.url&&i.url!==n[r].url&&this.setImportUrl(t,i.url),e.by(i.config,n[r].config)||this.setImportConfig(t,i.config,i.data.schema),e.by(i.data,n[r].data)||this.setImportData(t,i.data),this)}moveImport(e,t){this._checkLoaded();let i=this.stylesheet.imports||[];const n=this.getImportIndex(e);if(-1===n)return this;const r=this.getImportIndex(t);if(-1===r)return this;const o=i[n],s=this.fragments[n];return i=i.filter(({id:t})=>t!==e),this.fragments=this.fragments.filter(({id:t})=>t!==e),this.stylesheet.imports=i.slice(0,r).concat(o).concat(i.slice(r)),this.fragments=this.fragments.slice(0,r).concat(s).concat(this.fragments.slice(r)),this.mergeLayers(),this}setImportUrl(e,t){this._checkLoaded();const i=this.stylesheet.imports||[],n=this.getImportIndex(e);if(-1===n)return this;i[n].url=t;const r=this.fragments[n];return r.style=this._createFragmentStyle(i[n]),r.style.on("style.import.load",()=>this.mergeAll()),r.style.loadURL(t),this}setImportData(e,t){this._checkLoaded();const i=this.getImportIndex(e),n=this.stylesheet.imports||[];return-1===i?this:t?(this.fragments[i].style.setState(t),this._reloadImports(),this):(delete n[i].data,this.setImportUrl(e,n[i].url))}setImportConfig(e,t,i){this._checkLoaded();const n=this.getImportIndex(e),r=this.stylesheet.imports||[];if(-1===n)return this;t?r[n].config=t:delete r[n].config;const o=this.fragments[n];i&&o.style.stylesheet&&(o.style.stylesheet.schema=i);const s=o.style.stylesheet&&o.style.stylesheet.schema;return o.config=t,o.style.updateConfig(t,s),this.updateConfigDependencies(),this}removeImport(e){this._checkLoaded();const t=this.stylesheet.imports||[],i=this.getImportIndex(e);-1!==i&&(t.splice(i,1),this.fragments[i].style._remove(),this.fragments.splice(i,1),this._reloadImports())}getImportIndex(t){const i=(this.stylesheet.imports||[]).findIndex(e=>e.id===t);return-1===i&&this.fire(new e.y(new Error(`Import '${t}' does not exist in the map's style and cannot be updated.`))),i}getLayer(e){return this._mergedLayers[e]}getSources(){const e=[];for(const t in this._mergedOtherSourceCaches){const i=this._mergedOtherSourceCaches[t];
2i&&e.push(i.getSource())}return e}getSource(e,t){const i=this.getSourceCache(e,t);return i&&i.getSource()}getLayerSource(e){const t=this.getLayerSourceCache(e);return t&&t.getSource()}getSourceCache(t,i){const n=e.B(t,i);return this._mergedOtherSourceCaches[n]}getLayerSourceCache(t){const i=e.B(t.source,t.scope);return"symbol"===t.type?this._mergedSymbolSourceCaches[i]:this._mergedOtherSourceCaches[i]}getSourceCaches(e){if(null==e)return Object.values(this._mergedSourceCaches);const t=[];return this._mergedOtherSourceCaches[e]&&t.push(this._mergedOtherSourceCaches[e]),this._mergedSymbolSourceCaches[e]&&t.push(this._mergedSymbolSourceCaches[e]),t}updateSourceCaches(){const e=this._changes.getUpdatedSourceCaches();for(const t in e){const i=e[t];"reload"===i?this.reloadSource(t):"clear"===i&&this.clearSource(t)}}updateLayers(e){const t=this._changes.getUpdatedPaintProperties();for(const i of t){const t=this.getLayer(i);t&&t.updateTransitions(e)}}getGlyphsUrl(){return this.stylesheet.glyphs}setGlyphsUrl(e){this.stylesheet.glyphs=e,this.glyphManager.setURL(e)}getImages(t,i,n){this.imageManager.getImages(i.images,i.scope,n),this._updateTilesForChangedImages();const r=t=>{if(t){const n=i.images.map(t=>e.I.toString(t));t.setDependencies(i.tileID.key,i.type,n)}},o=e.B(i.source,i.scope);r(this._mergedOtherSourceCaches[o]),r(this._mergedSymbolSourceCaches[o]),i.images.some(e=>e.iconsetId)&&this.fire(new e.z("data",{dataType:"style"}))}rasterizeImages(e,t,i){this.imageManager.rasterizeImages(t,i)}getGlyphs(e,t,i){this.glyphManager.getGlyphs(t.stacks,i)}getResource(t,i,n){return e.dz(i,n)}getOwnSourceCache(e){return this._otherSourceCaches[e]}getOwnLayerSourceCache(e){return"symbol"===e.type?this._symbolSourceCaches[e.source]:this._otherSourceCaches[e.source]}getOwnSourceCaches(e){const t=[];return this._otherSourceCaches[e]&&t.push(this._otherSourceCaches[e]),this._symbolSourceCaches[e]&&t.push(this._symbolSourceCaches[e]),t}_isSourceCacheLoaded(t){const i=this.getOwnSourceCaches(t);return 0===i.length?(this.fire(new e.y(new Error(`There is no source with ID '${t}'`))),!1):i.every(e=>e.loaded())}has3DLayers(){return this._has3DLayers}hasSymbolLayers(){return this._hasSymbolLayers}hasCircleLayers(){return this._hasCircleLayers}isLayerClipped(e,t){if(!this._clipLayerPresent&&"fill-extrusion"!==e.type&&"building"!==e.type)return!1;const i="fill-extrusion"===e.type&&("building"===e.sourceLayer||"procedural_buildings"===e.sourceLayer),n="building"===e.type;if(e.is3D(!!this.terrain)){if(i||n||t&&"batched-model"===t.type)return!0;if("model"===e.type)return!0}else if("symbol"===e.type)return!0;return!1}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.fragments.forEach(e=>{e.style._remove()}),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}Bn.getSourceType=function(e){return ft[e]},Bn.setSourceType=function(e,t){ft[e]=t},Bn.registerForPluginStateChange=e.dA;class Nn extends e.E{constructor(t){super(),this._style=t,this._buildings={},this._activeFloors=new Set,this._activeFloorsVisible=!0,this._indoorState={selectedFloorId:null,lastActiveFloors:null,activeFloorsVisible:!0},e.aY(["_updateUI"],this)}destroy(){this._buildings={},this._activeFloors=new Set,this._indoorState=null}selectFloor(e){e===this._selectedFloorId&&this._activeFloorsVisible||(this._selectedFloorId=e,this._activeFloorsVisible=!0,this._updateActiveFloors())}setActiveFloorsVisibility(e){this._activeFloorsVisible=e,this._updateActiveFloors(),this._updateIndoorSelector()}setIndoorData(e){for(const[t,i]of Object.entries(e.buildings))if(this._buildings[t])for(const e of i.floorIds)this._buildings[t].floors[e]||(this._buildings[t].floors[e]=i.floors[e]);else this._buildings[t]=i;for(const t of e.activeFloors)this._activeFloors.add(t);this._updateIndoorSelector()}getIndoorTileOptions(e,t){const i=this._style.getIndoorSourceLayers(e,t);return i&&this._indoorState?{sourceLayers:i,indoorState:this._indoorState}:null}_updateUI(t,i,n){const r=function(t,i,n,r){let o=null,s=Number.MAX_SAFE_INTEGER;if(r<16)return null;for(const[r,a]of Object.entries(t)){const t=a.center;if(t){const a=i.distanceTo(e.aT.convert(t));a<s&&n.contains(t)&&(s=a,o=r)}}return o}(this._buildings,i,n,t);r!==this._closestBuildingId&&(this._closestBuildingId=r,this._updateIndoorSelector())}_updateIndoorSelector(){const t=this._buildings,i=this._closestBuildingId,n=i&&t?t[i]:void 0;if(!n)return void this.fire(new e.z("selector-update",{selectedFloorId:null,activeFloorsVisible:this._activeFloorsVisible,floors:[]}));let r=null;for(const e of n.floorIds)if(this._activeFloors&&this._activeFloors.has(e)){r=e;break}const o=Array.from(n.floorIds).map(e=>({id:e,name:n.floors[e].name,zIndex:n.floors[e].zIndex})).sort((e,t)=>
2t.zIndex-e.zIndex);this.fire(new e.z("selector-update",{selectedFloorId:r,activeFloorsVisible:this._activeFloorsVisible,floors:o}))}_updateActiveFloors(){const e=this._activeFloors;this._activeFloors=new Set,this._indoorState={selectedFloorId:this._selectedFloorId,lastActiveFloors:e,activeFloorsVisible:this._activeFloorsVisible},this._style.updateIndoorDependentLayers()}}var Vn="\n#define EPSILON 0.0000001\n#define PI 3.141592653589793\n#ifdef RENDER_CUTOFF\nfloat cutoff_opacity(vec4 cutoff_params,float depth) {float near=cutoff_params.x;float far=cutoff_params.y;float cutoffStart=cutoff_params.z;float cutoffEnd=cutoff_params.w;float linearDepth=(depth-near)/(far-near);return clamp((linearDepth-cutoffStart)/(cutoffEnd-cutoffStart),0.0,1.0);}\n#endif",Un="\n#ifdef DUAL_SOURCE_BLENDING\nlayout(location=0,index=0) out vec4 glFragColor;layout(location=0,index=1) out vec4 glFragColorSrc1;\n#else\nlayout(location=0) out vec4 glFragColor;\n#endif\n#ifdef USE_MRT1\nlayout(location=1) out vec4 out_Target1;\n#endif\nhighp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}\n#ifdef INDICATOR_CUTOUT\nuniform vec3 u_indicator_cutout_centers;uniform vec4 u_indicator_cutout_params;\n#endif\nvec4 applyCutout(vec4 color,float height) {\n#ifdef INDICATOR_CUTOUT\nfloat verticalFadeRange=u_indicator_cutout_centers.z*0.25;float holeMinOpacity=mix(1.0,u_indicator_cutout_params.x,smoothstep(u_indicator_cutout_centers.z,u_indicator_cutout_centers.z+verticalFadeRange,height));float holeRadius=max(u_indicator_cutout_params.y,0.0);float holeAspectRatio=u_indicator_cutout_params.z;float fadeStart=u_indicator_cutout_params.w;float distA=distance(vec2(gl_FragCoord.x,gl_FragCoord.y*holeAspectRatio),vec2(u_indicator_cutout_centers[0],u_indicator_cutout_centers[1]*holeAspectRatio));return color*min(smoothstep(fadeStart,holeRadius,distA)+holeMinOpacity,1.0);\n#else\nreturn color;\n#endif\n}\n#ifdef DEBUG_WIREFRAME\n#define HANDLE_WIREFRAME_DEBUG \\\nglFragColor=vec4(0.7,0.0,0.0,0.7); \\\ngl_FragDepth=gl_FragCoord.z-0.0001;\n#else\n#define HANDLE_WIREFRAME_DEBUG\n#endif\n#ifdef RENDER_CUTOFF\nuniform highp vec4 u_cutoff_params;in float v_cutoff_opacity;\n#endif\nvec4 textureLodCustom(sampler2D image,highp vec2 pos,highp vec2 lod_coord) {highp vec2 size=vec2(textureSize(image,0));highp vec2 dx=dFdx(lod_coord.xy*size);highp vec2 dy=dFdy(lod_coord.xy*size);highp float delta_max_sqr=max(dot(dx,dx),dot(dy,dy));highp float lod=0.5*log2(delta_max_sqr);return textureLod(image,pos,lod);}vec4 applyLUT(highp sampler3D lut,vec4 col) {vec3 size=vec3(textureSize(lut,0));vec3 uvw=(col.rbg*float(size-1.0)+0.5)/size;return vec4(texture(lut,uvw).rgb*col.a,col.a);}vec3 applyLUT(highp sampler3D lut,vec3 col) {return applyLUT(lut,vec4(col,1.0)).rgb;}",jn="\n#define EXTENT 8192.0\n#define RAD_TO_DEG 180.0/PI\n#define DEG_TO_RAD PI/180.0\n#define GLOBE_RADIUS EXTENT/PI/2.0\nfloat wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;}\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) {\n#ifndef PROJECTED_POS_ON_VIEWPORT\nfloat tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz;\n#else\nreturn vec3(0.0);\n#endif\n}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);}\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(\nunpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const vec2 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);
2return (units_to_pixels*pos+offset)/pattern_size;}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) {return get_pattern_pos(pixel_coord_upper,pixel_coord_lower,pattern_size,vec2(tile_units_to_pixels),pos);}float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(PI/4.0+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}\n#ifdef RENDER_CUTOFF\nuniform vec4 u_cutoff_params;out float v_cutoff_opacity;\n#endif\nconst vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt)\n{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);}\n#ifndef HAS_SHADER_STORAGE_BLOCK_material_buffer\n#define GET_ATTRIBUTE_float(attrib,matInfo,attrib_id) attrib\n#define GET_ATTRIBUTE_vec4(attrib,matInfo,attrib_id) attrib\n#define GET_ATTRIBUTE_vec2(attrib,matInfo,attrib_id) attrib\n#define DECLARE_MATERIAL_TABLE_INFO\n#endif",Gn="in highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;out highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",qn="\n#define ELEVATION_SCALE 7.0\n#define ELEVATION_OFFSET 450.0\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix(\nmix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;}\n#else\nvec3 elevationVector(vec2 pos) { return vec3(0,0,1); }\n#endif\n#ifdef TERRAIN\nuniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float currentElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem,pos).r;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(dd,0)).r;float bl=texture(u_dem,pos+vec2(0,dd)).r;float br=texture(u_dem,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}float prevElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem_prev,pos).r;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem_prev,pos).r;float tr=texture(u_dem_prev,pos+vec2(dd,0)).r;float bl=texture(u_dem_prev,pos+vec2(0,dd)).r;float br=texture(u_dem_prev,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}\n#ifdef TERRAIN_VERTEX_MORPHING\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nfloat nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);}
2\n#else\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nreturn currentElevation(apos);}\n#endif\nvec4 fourSample(vec2 pos,vec2 off) {float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(off.x,0.0)).r;float bl=texture(u_dem,pos+vec2(0.0,off.y)).r;float br=texture(u_dem,pos+off).r;return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);}\n#else\nfloat elevation(vec2 pos) { return 0.0; }\n#endif\n#ifdef DEPTH_OCCLUSION\nuniform highp sampler2D u_depth;uniform highp vec2 u_depth_size_inv;uniform highp vec2 u_depth_range_unpack;uniform highp float u_occluder_half_size;uniform highp float u_occlusion_depth_offset;\n#ifdef DEPTH_D24\nfloat unpack_depth(float depth) {return depth*u_depth_range_unpack.x+u_depth_range_unpack.y;}vec4 unpack_depth4(vec4 depth) {return depth*u_depth_range_unpack.x+vec4(u_depth_range_unpack.y);}\n#else\nhighp float unpack_depth_rgba(vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}\n#endif\nbool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;\n#ifdef CLIP_ZERO_TO_ONE\ncoord.z=-1.0+2.0*coord.z; \n#endif\n#ifdef DEPTH_D24\nfloat depth=unpack_depth(texture(u_depth,(coord.xy+1.0)*0.5).r);\n#else\nfloat depth=unpack_depth_rgba(texture(u_depth,(coord.xy+1.0)*0.5));\n#endif\nreturn coord.z+u_occlusion_depth_offset > depth;}highp vec4 getCornerDepths(vec2 coord) {highp vec3 df=vec3(u_occluder_half_size*u_depth_
2size_inv,0.0);highp vec2 uv=0.5*coord.xy+0.5;\n#ifdef DEPTH_D24\nhighp vec4 depth=vec4(\ntexture(u_depth,uv-df.xz).r,texture(u_depth,uv+df.xz).r,texture(u_depth,uv-df.zy).r,texture(u_depth,uv+df.zy).r\n);depth=unpack_depth4(depth);\n#else\nhighp vec4 depth=vec4(\nunpack_depth_rgba(texture(u_depth,uv-df.xz)),unpack_depth_rgba(texture(u_depth,uv+df.xz)),unpack_depth_rgba(texture(u_depth,uv-df.zy)),unpack_depth_rgba(texture(u_depth,uv+df.zy))\n);\n#endif\nreturn depth;}highp float occlusionFadeMultiSample(vec4 frag) {highp vec3 coord=frag.xyz/frag.w;highp vec2 uv=0.5*coord.xy+0.5;\n#ifdef CLIP_ZERO_TO_ONE\ncoord.z=-1.0+2.0*coord.z; \n#endif\nint NX=3;int NY=4;highp vec2 df=u_occluder_half_size*u_depth_size_inv;highp vec2 oneStep=2.0*u_occluder_half_size*u_depth_size_inv/vec2(NX-1,NY-1);highp float res=0.0;for (int y=0; y < NY;++y) {for (int x=0; x < NX;++x) {\n#ifdef DEPTH_D24\nhighp float depth=unpack_depth(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y)).r);\n#else\nhighp float depth=unpack_depth_rgba(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y)));\n#endif\nres+=1.0-clamp(300.0*(coord.z+u_occlusion_depth_offset-depth),0.0,1.0);}}res=clamp(2.0*res/float(NX*NY)-0.5,0.0,1.0);return res;}highp float occlusionFade(vec4 frag) {highp vec3 coord=frag.xyz/frag.w;\n#ifdef CLIP_ZERO_TO_ONE\ncoord.z=-1.0+2.0*coord.z; \n#endif\nhighp vec4 depth=getCornerDepths(coord.xy);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z+u_occlusion_depth_offset)-depth),0.0,1.0));}\n#else\nbool isOccluded(vec4 frag) { return false; }highp float occlusionFade(vec4 frag) { return 1.0; }highp float occlusionFadeMultiSample(vec4 frag) { return 1.0; }\n#endif",Hn="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;out vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);}\n#endif",$n="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump vec2 u_fog_vertical_limit;uniform mediump float u_fog_temporal_offset;in vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;\n#ifdef FLIP_Y\nuv.y=1.0-uv.y;\n#endif\nhighp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos,float opacity_limit) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,min(opacity,opacity_limit));}vec3 fog_apply(vec3 color,vec3 pos) {return fog_apply(color,pos,1.0);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}
2vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec4 fog_apply_premultiplied(vec4 color,vec3 pos,float heightMeters) {float verticalProgress=(u_fog_vertical_limit.x > 0.0 || u_fog_vertical_limit.y > 0.0) ? smoothstep(u_fog_vertical_limit.x,u_fog_vertical_limit.y,heightMeters) : 0.0;float opacityLimit=1.0-smoothstep(0.9,1.0,fog_opacity(pos));return mix(fog_apply_premultiplied(color,pos),color,min(verticalProgress,opacityLimit));}vec3 fog_dither(vec3 color) {return color;}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}\n#endif",Wn="#ifdef RASTER_ARRAY\nuniform highp sampler2D u_image0;uniform sampler2D u_image1;const vec4 NODATA=vec4(1);ivec4 _raTexLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}vec2 _raTexLinearMix(highp vec2 fxy,highp vec4 colorMix,highp float colorOffset,highp vec4 t00,highp vec4 t10,highp vec4 t01,highp vec4 t11) {vec2 c00=t00==NODATA ? vec2(0) : vec2(colorOffset+dot(t00,colorMix),1);vec2 c10=t10==NODATA ? vec2(0) : vec2(colorOffset+dot(t10,colorMix),1);vec2 c01=t01==NODATA ? vec2(0) : vec2(colorOffset+dot(t01,colorMix),1);vec2 c11=t11==NODATA ? vec2(0) : vec2(colorOffset+dot(t11,colorMix),1);return mix(mix(c01,c11,fxy.x),mix(c00,c10,fxy.x),fxy.y);}vec2 raTexture2D_image0_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image0,c.yz,0),texelFetch(u_image0,c.xz,0),texelFetch(u_image0,c.yw,0),texelFetch(u_image0,c.xw,0)\n);}vec2 raTexture2D_image1_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image1,c.yz,0),texelFetch(u_image1,c.xz,0),texelFetch(u_image1,c.yw,0),texelFetch(u_image1,c.xw,0)\n);}vec2 raTexture2D_image0_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image0,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}vec2 raTexture2D_image1_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image1,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}\n#endif",Zn="#ifdef RASTER_ARRAY\nuniform sampler2D u_velocity;uniform mediump vec2 u_velocity_res;uniform mediump float u_max_speed;const vec4 NO_DATA=vec4(1);const vec2 INVALID_VELOCITY=vec2(-1);uniform highp vec2 u_uv_offset;uniform highp float u_data_offset;uniform highp vec2 u_data_scale;ivec4 rasterArrayLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}highp vec2 lookup_velocity(highp vec2 uv) {uv=u_uv_offset.x+u_uv_offset.y*uv;highp vec2 fxy;ivec4 c=rasterArrayLinearCoord(uv,u_velocity_res,fxy);highp vec4 tl=texelFetch(u_velocity,c.yz,0);highp vec4 tr=texelFetch(u_velocity,c.xz,0);highp vec4 bl=texelFetch(u_velocity,c.yw,0);highp vec4 br=texelFetch(u_velocity,c.xw,0);if (tl==NO_DATA) {return INVALID_VELOCITY;}if (tr==NO_DATA) {return INVALID_VELOCITY;}if (bl==NO_DATA) {return INVALID_VELOCITY;}if (br==NO_DATA) {return INVALID_VELOCITY;}highp vec4 t=mix(mix(bl,br,fxy.x),mix(tl,tr,fxy.x),fxy.y);highp vec2 velocity=u_data_offset+vec2(dot(t.rg,u_data_scale),dot(t.ba,u_data_scale));velocity.y=-velocity.y;velocity/=max(u_max_speed,length(velocity));return velocity;}\n#endif\nuniform highp float u_particle_pos_scale;uniform highp vec2 u_particle_pos_offset;highp vec4 pack_pos_to_rgba(highp vec2 p) {highp vec2 v=(p+u_particle_pos_offset)/u_particle_pos_scale;highp vec4 r=vec4(v.x,fract(v.x*255.0),v.y,fract(v.y*255.0));return vec4(r.x-r.y/255.0,r.y,r.z-r.w/255.0,r.w);}highp vec2 unpack_pos_from_rgba(highp vec4 v) {v=floor(v*255.0+0.5)/255.0;highp vec2 p=vec2(v.x+(v.y/255.0),v.z+(v.w/255.0));return u_particle_pos_scale*p-u_particle_pos_offset;}",Xn="#ifdef RENDER_SHADOWS\nuniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_normal_offset;vec3 shadow_normal_offset(vec3 normal) {float tileInMeters=u_shadow_normal_offset[0];vec3 n=vec3(-normal.xy,tileInMeters*normal.z);float dotScale=min(1.0-dot(normal,u_shadow_direction),1.0)*0.5+0.5;return n*dotScale;}vec3 shadow_normal_offset_model(vec3 normal) {vec3 transformed_normal=vec3(-normal.xy,normal.z);float NDotL=dot(normalize(transformed_normal),u_shadow_direction);float dotScale=min(1.0-NDotL,1.0)*0.5+0.5;return normal*dotScale;}float shadow_normal_offset_multiplier0() {return u_shadow_normal_offset[1];}float shadow_normal_offset_multiplier1() {return u_shadow_normal_offset[2];}\n#endif",Yn="#ifdef RENDER_SHADOWS\nprecision highp sampler2DShadow;uniform sampler2DShadow u_shadowmap_0;uniform sampler2DShadow u_shadowmap_1;uniform float u_shadow_intensity;uniform float u_shadow_map_resolution;uniform float u_shadow_texel_size;uniform highp vec3 u_shadow_normal_offset;uniform vec2 u_fade_range;uniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_bias;float shadow_sample(sampler2DShadow shadowmap,highp vec3 pos,high
2p float bias) {\n#ifdef CLIP_ZERO_TO_ONE\nhighp vec3 coord=vec3(pos.xy*0.5+0.5,pos.z-bias);\n#else\nhighp vec3 coord=vec3(pos.xy*0.5+0.5,pos.z*0.5+0.5-bias);\n#endif\nreturn texture(shadowmap,coord);}float shadow_occlusion(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,highp float bias) {light_view_pos0.xyz/=light_view_pos0.w;\n#ifdef SHADOWS_SINGLE_CASCADE\nvec2 abs_bounds=abs(light_view_pos0.xy);if (abs_bounds.x >=1.0 || abs_bounds.y >=1.0) {return 0.0;}return shadow_sample(u_shadowmap_0,light_view_pos0.xyz,bias);\n#else\nlight_view_pos1.xyz/=light_view_pos1.w;vec4 abs_bounds=abs(vec4(light_view_pos0.xy,light_view_pos1.xy));if (abs_bounds.x < 1.0 && abs_bounds.y < 1.0) {return shadow_sample(u_shadowmap_0,light_view_pos0.xyz,bias);}if (abs_bounds.z >=1.0 || abs_bounds.w >=1.0) {return 0.0;}float occlusion1=shadow_sample(u_shadowmap_1,light_view_pos1.xyz,bias);return clamp(mix(occlusion1,0.0,smoothstep(u_fade_range.x,u_fade_range.y,view_depth)),0.0,1.0);\n#endif\n}highp float calculate_shadow_bias(float NDotL) {\n#ifdef NORMAL_OFFSET\nreturn 0.5*u_shadow_bias.x;\n#else\nreturn 0.5*(u_shadow_bias.x+clamp(u_shadow_bias.y*tan(acos(NDotL)),0.0,u_shadow_bias.z));\n#endif\n}float shadowed_light_factor_normal(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_opacity(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,float shadow_opacity) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias)*shadow_opacity;return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_unbiased(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}highp vec2 compute_receiver_plane_depth_bias(highp vec3 pos_dx,highp vec3 pos_dy)\n{highp vec2 biasUV=vec2(\npos_dy.y*pos_dx.z-pos_dx.y*pos_dy.z,pos_dx.x*pos_dy.z-pos_dy.x*pos_dx.z);biasUV*=1.0/((pos_dx.x*pos_dy.y)-(pos_dx.y*pos_dy.x));return biasUV;}float shadowed_light_factor_plane_bias(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {highp vec3 light_view_pos0_xyz=light_view_pos0.xyz/light_view_pos0.w*0.5+0.5;highp vec3 light_view_pos0_ddx=dFdx(light_view_pos0_xyz);highp vec3 light_view_pos0_ddy=dFdy(light_view_pos0_xyz);highp vec2 plane_depth_bias=compute_receiver_plane_depth_bias(light_view_pos0_ddx,light_view_pos0_ddy);highp float bias=dot(vec2(u_shadow_texel_size,u_shadow_texel_size),plane_depth_bias)+0.0001;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadowed_light_factor(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadow_occlusion(float ndotl,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=calculate_shadow_bias(ndotl);return shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);}\n#endif";const Kn=/#include\s+"([^"]+)"/g,Jn=/#pragma mapbox: ([\w\-]+) ([\w]+) ([\w]+) ([\w]+)/g,Qn=/\b[A-Za-z_][A-Za-z0-9_]*\b/g,er=new Set(["ifdef","ifndef","elif","if","defined"]),tr=new Set;cr(Vn,tr),cr(jn,tr),cr(Un,tr);const ir={"_prelude_fog.vertex.glsl":Hn,"_prelude_terrain.vertex.glsl":qn,"_prelude_shadow.vertex.glsl":Xn,"_prelude_material_table.vertex.glsl":"#ifdef HAS_SHADER_STORAGE_BLOCK_material_buffer\n#define MATERIAL_TABLE_DEBUG 0\nuniform int u_material_offset;uniform int u_vertex_offset;layout(std140,binding=0)readonly buffer material_buffer{uvec4 material_data[];};struct MaterialInfo{uint dataOffset;\n#if MATERIAL_TABLE_DEBUG\nvec4 colorDebug;\n#endif\n};uint read_buf_no_offset(uint iDword) {return material_data[iDword/4u][iDword % 4u];}uint read_buf(uint iDword) {iDword+=uint(u_material_offset/4);return read_buf_no_offset(iDword);}
2float read_buf_float(uint iDword){return uintBitsToFloat(read_buf(iDword));}uint read_buf_uint8(uint iDword,uint iUint8){uint dwordOffset=iDword+(iUint8/4u);uint byteOffset=iUint8 & 3u;uint bitOffset=8u*byteOffset;uint mask=0xffu << bitOffset;uint dwordVal=read_buf(dwordOffset);return (dwordVal & mask) >> bitOffset;}uint read_buf_uint16(uint iDword,uint iUint16){uint dwordOffset=iDword+(iUint16 >> 1u);uint bitOffset=(iUint16 & 1u)*16u;uint mask=0xffffu << bitOffset;uint dwordVal=read_buf(dwordOffset);return (dwordVal & mask) >> bitOffset;}uint nrDwordsForVertexIdEntries(uint nrMaterialLookupEntries) {return nrMaterialLookupEntries;}uint nrDwordsForMaterialIdEntries(uint nrMaterialLookupEntries) {return (nrMaterialLookupEntries*2u+3u)/4u;}uint findRangeBinarySearch(uint vertexId,uint numRanges,uint dwordOffset) {uint left=0u;uint right=numRanges-1u;for (uint i=0u; i < 16u; i++) { \nif (left > right) {break;}uint mid=(left+right)/2u;uint start=read_buf(dwordOffset+mid);uint nextStart=(mid+1u < numRanges) ? read_buf(dwordOffset+mid+1u) : 0xffffffffu;if (vertexId >=start && vertexId < nextStart) {return mid;} else if (vertexId < start) {if (mid==0u) {break;}right=mid-1u;} else {left=mid+1u;}}return 0u; \n}uint readVertexId(uint dwordOffset,uint iMaterialLookupEntry) {return read_buf(dwordOffset+iMaterialLookupEntry);}uint findRange(uint vertexId,uint numRanges,uint dwordOffset) {uint iRange;if(numRanges <=64u){uint vertexBegin;for(iRange=0u; iRange < numRanges;++iRange) {vertexBegin=readVertexId(dwordOffset,iRange);if(vertexBegin > vertexId) {break;}}iRange=iRange==0u? 0u : iRange-1u;} else { \niRange=findRangeBinarySearch(vertexId,numRanges,dwordOffset);}return iRange;}MaterialInfo read_material_info(uint vertex_id) {MaterialInfo info;\n#if MATERIAL_TABLE_DEBUG\nconst vec4 red=vec4(1.0,0.0,0.0,1.0);const vec4 orange=vec4(1.0,0.5,0.0,1.0);const vec4 yellow=vec4(1.0,1.0,0.0,1.0);const vec4 green=vec4(0.0,1.0,0.0,1.0);const vec4 indigo=vec4(0.294,0.0,0.510,1.0);const vec4 blue=vec4(0.0,0.0,1.0,1.0);const vec4 purple=vec4(0.5,0.0,0.5,1.0);const vec4 pink=vec4(1.0,0.0,1.0,1.0);info.colorDebug=green;\n#endif\nuint offset=0u;\n#if MATERIAL_TABLE_DEBUG\nbool keepFinding=true;uint magic=read_buf(offset);if(magic !=0xCAFEBABEu) {info.colorDebug=red;keepFinding=false;return info;}\n#endif\noffset++;\n#if MATERIAL_TABLE_DEBUG\nuint nrMaterials=read_buf(offset);uint nrVertices=read_buf(offset+1u);if(keepFinding && vertex_id >=nrVertices) {info.colorDebug=red;keepFinding=false;}\n#endif\noffset+=2u;uint nrMaterialLookupEntries=read_buf(offset++);uint perMaterialEntrySizeDwords=read_buf(offset++);\n#if MATERIAL_TABLE_DEBUG\nif(keepFinding && perMaterialEntrySizeDwords !=1u) {info.colorDebug=red;keepFinding=false;}\n#endif\nuint iMaterialLookup=findRange(vertex_id,nrMaterialLookupEntries,offset);\n#if MATERIAL_TABLE_DEBUG\nif(keepFinding)\n{uint vertexBeginCheck=readVertexId(offset,iMaterialLookup);if(vertexBeginCheck > vertex_id) {info.colorDebug=red;keepFinding=false;}if(iMaterialLookup < nrMaterialLookupEntries-1u) {uint vertexEndCheck=readVertexId(offset,iMaterialLookup+1u);if(vertexEndCheck <=vertex_id) {info.colorDebug=red;keepFinding=false;}}}\n#endif\noffset+=nrDwordsForVertexIdEntries(nrMaterialLookupEntries);uint materialId=iMaterialLookup;\n#if MATERIAL_TABLE_DEBUG\nif(keepFinding) {if(materialId >=nrMaterialLookupEntries) {info.colorDebug=red;}}\n#endif\ninfo.dataOffset=offset+materialId*perMaterialEntrySizeDwords;return info;}uint get_data_location(const MaterialInfo matInfo,uint attribOffsetBytes)\n{uint attribFieldOffsetDwords=attribOffsetBytes/4u;return matInfo.dataOffset+attribFieldOffsetDwords;}vec4 read_material_vec4(const MaterialInfo matInfo,uint attribOffsetBytes){uint loc=get_data_location(matInfo,attribOffsetBytes);return vec4(read_buf_float(loc),read_buf_float(loc+1u),read_buf_float(loc+2u),read_buf_float(loc+3u));}vec2 read_material_vec2(const MaterialInfo matInfo,uint attribOffsetBytes){uint loc=get_data_location(matInfo,attribOffsetBytes);return vec2(read_buf_float(loc),read_buf_float(loc+1u));}float read_material_float(const MaterialInfo matInfo,uint attribOffsetBytes){uint loc=get_data_location(matInfo,attribOffsetBytes);return read_buf_float(loc);}\n#define GET_ATTRIBUTE_float(attrib,matInfo,attrib_offset) read_material_float(matInfo,attrib_offset)\n#define GET_ATTRIBUTE_vec4(attrib,matInfo,attrib_offset) read_material_vec4(matInfo,attrib_offset)\n#define GET_ATTRIBUTE_vec2(attrib,matInfo,attrib_offset) read_material_vec2(matInfo,attrib_offset)\n#define DECLARE_MATERIAL_TABLE_INFO MaterialInfo materialInfo=read_material_info(uint(gl_VertexID));\n#define DECLARE_MATERIAL_TABLE_INFO_DEBUG(dbgColor) MaterialInfo materialInfo=read_material_info(uint(gl_VertexID)); dbgColor=materialInfo.colorDebug;\n#endif","_prelude_fog.fragment.glsl":$n,"_prelude_shadow.fragment.glsl":Yn,"_prelude_lighting.glsl":"\n#ifdef LIGHTING_3D_MODE\nuniform mediump vec3 u_lighting_ambient_color;uniform mediump vec3 u_lighting_directional_dir;uniform mediump vec3 u_lighting_directional_color;uniform mediump vec3 u_ground_radiance;float calculate_ambient_directional_factor(vec3 normal) {float NdotL=dot(normal,u_lighting_directional_dir);const float factor_reduction_max=0.3;float dir_luminance=dot(u_lighting_directional_color,vec3(0.2126,0.7152,0.0722));float directional_factor_min=1.0-factor_reduction_max*min(dir_luminance,1.0);float ambient_directional_factor=mix(directional_factor_min,1.0,min((NdotL+1.0),1.0
2));const float vertical_factor_min=0.92;float vertical_factor=mix(vertical_factor_min,1.0,normal.z*0.5+0.5);return vertical_factor*ambient_directional_factor;}vec3 linearProduct(vec3 srgbIn,vec3 k) {return srgbIn*pow(k,vec3(1./2.2));}vec3 apply_lighting(vec3 color,vec3 normal,float dir_factor) {float ambient_directional_factor=calculate_ambient_directional_factor(normal);vec3 ambient_contrib=ambient_directional_factor*u_lighting_ambient_color;vec3 directional_contrib=u_lighting_directional_color*dir_factor;return linearProduct(color,ambient_contrib+directional_contrib);}vec4 apply_lighting(vec4 color,vec3 normal,float dir_factor) {return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting(vec3 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return apply_lighting(color.rgb,normal,dir_factor);}vec4 apply_lighting(vec4 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting_ground(vec3 color) {return color*u_ground_radiance;}vec4 apply_lighting_ground(vec4 color) {return vec4(apply_lighting_ground(color.rgb),color.a);}float calculate_NdotL(vec3 normal) {const float ext=0.70710678118;return (clamp(dot(normal,u_lighting_directional_dir),-ext,1.0)+ext)/(1.0+ext);}vec4 apply_lighting_with_emission_ground(vec4 color,float emissive_strength) {return mix(apply_lighting_ground(color),color,emissive_strength);}vec3 compute_flood_lighting(vec3 flood_light_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=flood_light_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);float occlusion_ramp=smoothstep(0.0,0.2,1.0-occlusion);return mix(fully_occluded_color,flood_light_color,occlusion_ramp);}vec3 compute_emissive_draped(vec3 unlit_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=unlit_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);return mix(fully_occluded_color,unlit_color,1.0-occlusion);}\n#endif","_prelude_raster_array.glsl":Wn,"_prelude_raster_particle.glsl":Zn},nr={};ur("",qn),ur($n,Hn),ur(Yn,Xn),ur(Wn,""),ur(Zn,"");const rr=ur(Un,jn),or=Vn,sr=["\n#if defined(GL_EXT_blend_func_extended) && defined(DUAL_SOURCE_BLENDING)\n#extension GL_EXT_blend_func_extended : require\n#endif","precision mediump float;",or,rr.fragmentSource].join("\n"),ar=["precision highp float;",or,rr.vertexSource].join("\n");var lr={background:ur('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec4 u_color;uniform float u_opacity;uniform mediump float u_emissive_strength;\n#ifdef LIGHTING_3D_MODE\nin vec4 v_color;\n#endif\nvoid main() {vec4 out_color;\n#ifdef LIGHTING_3D_MODE\nout_color=v_color;\n#else\nout_color=u_color;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*u_opacity;\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_lighting.glsl"\nin vec2 a_pos;uniform mat4 u_matrix;uniform mediump float u_emissive_strength;\n#ifdef LIGHTING_3D_MODE\nuniform mediump vec4 u_color;out vec4 v_color;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting_with_emission_ground(u_color,u_emissive_strength);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),backgroundPattern:ur('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform float u_emissive_strength;uniform sampler2D u_image;in highp vec2 v_pos;void main() {highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=textureLodCustom(u_image,pos,v_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*u_opacity;\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
2\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec2 u_pattern_units_to_pixels;in vec2 a_pos;out highp vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_pattern_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),building:ur('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nconst float window_depth=0.5;const float ao_radius=0.2;in vec4 v_color;in highp vec3 v_normal;in highp vec3 v_pos;\n#ifdef BUILDING_FAUX_FACADE\nin lowp float v_faux_facade;in highp float v_faux_facade_ed;in highp vec2 v_faux_facade_window;in highp vec2 v_faux_facade_floor;in highp vec2 v_faux_facade_range;in highp float v_aspect;in highp vec3 v_tbn_0;in highp vec3 v_tbn_1;in highp vec3 v_tbn_2;in highp vec4 v_faux_color_emissive;uniform float u_faux_facade_ao_intensity;\n#endif\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;\n#endif\n#ifdef FLOOD_LIGHT\nin highp float v_flood_radius;in float v_has_flood_light;\n#endif\nuniform lowp float u_opacity;uniform vec3 u_camera_pos;uniform highp float u_tile_to_meter;uniform float u_facade_emissive_chance;uniform vec3 u_flood_light_color;uniform float u_flood_light_intensity;vec3 linearTosRGB(in vec3 color) {return pow(color,vec3(1./2.2));}\n#ifdef BUILDING_FAUX_FACADE\nfloat hash12(in vec2 p) {vec3 p3 =fract(vec3(p.xyx)*0.1031);p3+=dot(p3,p3.yzx+33.33);return fract((p3.x+p3.y)*p3.z);}float min3(in vec3 v) {return min(min(v.x,v.y),v.z);}vec2 get_uv_mask_id(in vec2 q,out float mask,out vec2 id) {vec2 p=q;mask=step(v_faux_facade_range.x,p.y)*step(p.y,v_faux_facade_range.y);p.y=p.y-v_faux_facade_range.x;vec2 uv=modf(p/v_faux_facade_floor,id);vec4 d=(v_faux_facade_floor.xyxy+vec4(-v_faux_facade_window,v_faux_facade_window))*0.5;vec4 edge=d/v_faux_facade_floor.xyxy;vec2 m=step(edge.xy,uv)*step(uv,edge.zw);mask*=m.x*m.y;uv-=vec2(0.5);uv*=vec2(0.5)/(vec2(0.5)-edge.xy);uv+=vec2(0.5);return uv;}float ray_unit_box(in vec3 ray_o,in vec3 ray_d,in vec3 bmin,in vec3 bmax) {vec3 planes=mix(bmin,bmax,step(0.0,ray_d));vec3 t=(planes-ray_o)/ray_d;return min3(t);}float get_emissive(in vec2 id) {if (u_facade_emissive_chance > 0.0) {return (step(hash12(id),u_facade_emissive_chance)+0.05)*v_faux_color_emissive.a;}return 0.0;}vec3 get_shade_info(in vec3 v,in vec3 v_normalized,in vec3 color,in vec2 id,in mat3 tbn,inout vec3 out_normal,inout float out_emissive) {vec3 out_color=color;vec3 abs_v=abs(v_normalized);bool x_major=abs_v.x >=abs_v.y && abs_v.x >=abs_v.z;bool y_major=abs_v.y >=abs_v.x && abs_v.y >=abs_v.z;bool z_major=abs_v.z >=abs_v.x && abs_v.z >=abs_v.y;\n#if 0\nif (x_major) {out_color=v.x > 0.0 ? vec3(1.0,0.0,0.0) : vec3(0.0,1.0,1.0);} else if (y_major) {out_color=v.y > 0.0 ? vec3(0.0,1.0,0.0) : vec3(1.0,0.0,1.0);} else if (z_major) {out_color=v.z > 0.0 ? vec3(0.0,0.0,1.0) : vec3(1.0,1.0,0.0);}out_emissive=1.0;\n#else\nif (x_major) {out_normal=sign(v.x)*tbn[0];} else if (y_major) {out_normal=vec3(0.0,0.0,-sign(v.y));} else if (z_major) {out_color=v_faux_color_emissive.rgb;out_emissive=v.z <=0.0 ? get_emissive(id) : out_emissive;}float ao=1.0;if (u_faux_facade_ao_intensity > 0.0) {vec4 ao_range=v_faux_facade_window.xxyy*0.5-vec4(0,ao_radius,0,ao_radius);vec2 ao_range_z=vec2(window_depth*0.5)-vec2(0.0,ao_radius);if (x_major || y_major) {ao*=smoothstep(-ao_range_z.x,-ao_range_z.y,v.z);} else if (z_major) {ao*=smoothstep(-ao_range.x,-ao_range.y,v.x)*(1.0-smoothstep(ao_range.y,ao_range.x,v.x));ao*=smoothstep(-ao_range.z,-ao_range.w,v.y)*(1.0-smoothstep(ao_range.w,ao_range.z,v.y));}ao=mix(1.0,min(1.0,ao+0.25),u_faux_facade_ao_intensity);}out_color*=ao;\n#endif\nreturn out_color;}\n#endif\nvec3 apply_lighting_linear(in vec3 color,in vec3 normal,in float dir_factor) {float ambient_directional_factor=calculate_ambient_directional_factor(normal);vec3 ambient_contrib=ambient_directional_factor*u_lighting_ambient_color;vec3 directional_contrib=u_lighting_directional_color*dir_factor;return color*(ambient_contrib+directional_contrib);}void main() {vec3 normal=normalize(v_normal);vec3 base_color=v_color.rgb;float emissive=v_color.a;\n#ifdef BUILDING_FAUX_FACADE\nif (v_faux_facade > 0.0) {mat3 tbn=mat3(v_tbn_0,v_tbn_1,v_tbn_2);vec3 v=vec3(v_pos.xy,v_pos.z/u_tile_to_meter)-u_camera_pos;vec3 view_tangent=transpose(tbn)*v;vec2 q=vec2(v_faux_facade_ed,v_pos.z);float mask=0.0;vec2 id=vec2(0.0);vec2 uv=get_uv_mask_id(q,mask,id);uv*=v_faux_facade_window;vec3 bmin=vec3(0.0,0.0,-window_depth);vec3 bmax=bmin+vec3(v_faux_facade_window,window_depth);vec3 ray_o=vec3(uv,0.0);vec3 ray_d=normalize(view_tangent);float t_min=ray_unit_box(ray_o,ray_d,bmin,bmax);vec3 hit=ray_o+t_min*ray_d;vec3 r=vec3(v_faux_facade_window,-window_depth);hit-=r*0.5;vec3 normalized=hit/r;vec3 out_normal=normal;float out_emissive=emissive;vec3 room_color=get_shade_info(hit,normalized,base_color,id,tbn,out_normal,out_emissive);base_color=mix(base_color,room_color,mask);normal=mix(normal,out_normal,mask);emissive=mix(emissive,out_emissive,mask);}\n#endif\nvec4 color=vec4(base_color,1.0);vec3 xy_flipped_normal=vec3(-normal.xy,normal.z);float shadowed_lighting_factor=0.0;\n#ifdef RENDER_SHADOWS\n#ifdef RENDER_CUTOFF\nshadowed_lighting_factor=shadowed_light_factor_normal_opacity(xy_flipped_normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,v_cutoff_opacity);if (v_cutoff_opacity==0.0) {discard;}\n#else\nshadowed_lighting_factor=shadowed_light_factor_normal(xy_flipped_normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);\n#endif\n#else\nshadowed_lighting_factor=dot(xy_flipped_normal,u_lighting_directional_dir);\n#endif\ncolor.rgb=apply_lighting_linear(color.rgb,xy_flipped_normal,shadowed_lighting_factor);color.rgb=linearTosRGB(color.rgb);\n#ifdef FLOOD_LIGHT\nfloat flood_radiance=(1.0-min(v_pos.z/v_flood_radiu
2s,1.0))*u_flood_light_intensity*v_has_flood_light;color.rgb=mix(color.rgb,u_flood_light_color,flood_radiance);\n#endif\ncolor.rgb=mix(color.rgb,linearTosRGB(base_color.rgb),emissive);\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos,v_pos.z));\n#endif\ncolor*=u_opacity;\n#ifdef INDICATOR_CUTOUT\ncolor=applyCutout(color,v_pos.z);\n#endif\n#ifdef FEATURE_CUTOUT\ncolor=apply_feature_cutout(color,gl_FragCoord);\n#endif\nglFragColor=color; \n#ifdef DEBUG_SHOW_NORMALS\ncolor.rgb=xy_flipped_normal*0.5+vec3(0.5,0.5,0.5);color.a=1.0;glFragColor=color;\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec3 a_pos_3f;in vec3 a_normal_3;in vec3 a_centroid_3;in float a_flood_light_wall_radius_1i16;in vec4 a_faux_facade_data;in vec2 a_faux_facade_vertical_range;uniform mat4 u_matrix;uniform mat4 u_normal_matrix;uniform highp float u_tile_to_meter;out vec4 v_color;out vec3 v_normal;out highp vec3 v_pos;\n#ifdef BUILDING_FAUX_FACADE\nout lowp float v_faux_facade;out highp float v_faux_facade_ed;out highp vec2 v_faux_facade_window;out highp vec2 v_faux_facade_floor;out highp vec2 v_faux_facade_range;out highp float v_aspect;out highp vec3 v_tbn_0;out highp vec3 v_tbn_1;out highp vec3 v_tbn_2;out highp vec4 v_faux_color_emissive;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;\n#endif\n#ifdef FLOOD_LIGHT\nout highp float v_flood_radius;out float v_has_flood_light;\n#endif\nconst float MAX_UINT_16=65535.0;const float MAX_INT_16=32767.0;const float MAX_UINT_8=255.0;const float TWO_POW_8=256.0;const float FLOOD_LIGHT_MAX_RADIUS_METER=2048.0;vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}\n#ifdef BUILDING_FAUX_FACADE\nmat3 get_tbn(in vec3 normal) {const vec3 bitangent=vec3(0.0,0.0,1.0);vec3 tangent=normalize(vec3(normal.y,-normal.x,0.0));return mat3(tangent,bitangent,normal);}\n#endif\n#pragma mapbox: define-attribute-vertex-shader-only highp vec2 part_color_emissive\n#pragma mapbox: define-attribute-vertex-shader-only highp vec2 faux_facade_color_emissive\nvoid main() {\n#pragma mapbox: initialize-attribute-custom highp vec2 part_color_emissive\n#pragma mapbox: initialize-attribute-custom highp vec2 faux_facade_color_emissive\n#ifdef FLOOD_LIGHT\nv_flood_radius=(a_flood_light_wall_radius_1i16/MAX_INT_16*FLOOD_LIGHT_MAX_RADIUS_METER);v_has_flood_light=step(0.0,v_flood_radius);\n#endif\nvec4 color_emissive=decode_color(part_color_emissive);v_color=vec4(sRGBToLinear(color_emissive.rgb),color_emissive.a);vec3 a_normal_3f=a_normal_3/MAX_INT_16;v_normal=vec3(u_normal_matrix*vec4(a_normal_3f,0.0));float hidden=0.0;float depth_offset=0.0;\n#ifdef BUILDING_FAUX_FACADE\nv_faux_facade=a_faux_facade_data.x;if (v_faux_facade > 0.0) {v_faux_facade_ed=a_faux_facade_data.x *u_tile_to_meter;float window_x_perc=floor(a_faux_facade_data.y/TWO_POW_8);float window_y_perc=a_faux_facade_data.y-TWO_POW_8*window_x_perc;vec2 window_perc=vec2(window_x_perc,window_y_perc)/MAX_UINT_8;v_faux_facade_floor=(a_faux_facade_data.zw/MAX_UINT_16*EXTENT)*u_tile_to_meter;v_faux_facade_window=window_perc*v_faux_facade_floor;v_faux_facade_range=(a_faux_facade_vertical_range/MAX_UINT_16*EXTENT)*u_tile_to_meter;v_aspect=v_faux_facade_window.x/v_faux_facade_window.y;mat3 tbn=get_tbn(normalize(v_normal));v_tbn_0=tbn[0];v_tbn_1=tbn[1];v_tbn_2=tbn[2];v_faux_color_emissive=decode_color(faux_facade_color_emissive);v_faux_color_emissive.rgb=sRGBToLinear(v_faux_color_emissive.rgb);float height=a_centroid_3.z;depth_offset=min(1000.0,height)*0.0000002;}\n#endif\nv_pos=a_pos_3f;\n#ifdef RENDER_CUTOFF\nvec4 ground=u_matrix*vec4(a_centroid_3,1.0);v_cutoff_opacity=cutoff_opacity(u_cutoff_params,ground.z);hidden=float(v_cutoff_opacity==0.0);v_pos.z*=v_cutoff_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nvec3 shadow_pos=v_pos;\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset_model(v_normal);shadow_pos+=offset*shadow_normal_offset_multiplier0();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shadow_pos,1.0);v_pos_light_view_1=u_light_matrix_1*vec4(shadow_pos,1.0);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(v_pos);\n#endif\ngl_Position=mix(u_matrix*vec4(v_pos,1),AWAY,hidden);gl_Position.z-=depth_offset*gl_Position.w;}'),buildingBloom:ur("in vec4 v_color_emissive;\n#pragma mapbox: define-attribute highp vec4 bloom_attenuation\n#pragma mapbox: initialize-attribute highp vec4 bloom_attenuation\nfloat saturate(float val) {return clamp(val,0.0,1.0);}void main() {float emission=v_color_emissive.a;float opacity=1.0;\n#ifdef HAS_ATTRIBUTE_a_bloom_attenuation\nfloat distance=length(vec2(1.3*max(0.0,abs(bloom_attenuation.x)-bloom_attenuation.z),bloom_attenuation.y));distance+= mix(0.5,0.0,clamp(emission-1.0,0.0,1.0));
2opacity*=saturate(1.0-distance*distance);\n#endif\n#ifdef RENDER_CUTOFF\nopacity*=v_cutoff_opacity;\n#endif\nglFragColor=vec4(v_color_emissive.rgb,1.0)*opacity;}","in vec3 a_pos_3f;\n#pragma mapbox: define-attribute-vertex-shader-only highp vec2 part_color_emissive\n#pragma mapbox: define-attribute highp vec4 bloom_attenuation\nout vec4 v_color_emissive;uniform mat4 u_matrix;vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}void main() {\n#pragma mapbox: initialize-attribute-custom highp vec2 part_color_emissive\n#pragma mapbox: initialize-attribute highp vec4 bloom_attenuation\n#ifdef HAS_ATTRIBUTE_a_part_color_emissive\nvec4 color_emissive=decode_color(part_color_emissive);float part_emissive=color_emissive.a*5.0;v_color_emissive=vec4(sRGBToLinear(color_emissive.rgb),part_emissive);\n#else\nv_color_emissive=vec4(1.0);\n#endif\ngl_Position=u_matrix*vec4(a_pos_3f,1.0);\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n}"),buildingDepth:ur("in highp float v_depth;void main() {\n#ifndef DEPTH_TEXTURE\nglFragColor=pack_depth(v_depth);\n#endif\n}","in vec3 a_pos_3f;uniform mat4 u_matrix;out highp float v_depth;void main() {gl_Position=u_matrix*vec4(a_pos_3f,1.0);v_depth=gl_Position.z/gl_Position.w;}"),circle:ur('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin vec3 v_data;in float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nuniform float u_emissive_strength;void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float blur_positive=blur < 0.0 ? 0.0 : 1.0;lowp float antialiasblur=v_data.z;float extrude_length=length(extrude)+antialiasblur*(1.0-blur_positive);float antialiased_blur=-max(abs(blur),antialiasblur);float antialiase_blur_opacity=smoothstep(0.0,antialiasblur,extrude_length-1.0);float opacity_t=blur_positive==1.0 ? \nsmoothstep(0.0,-antialiased_blur,1.0-extrude_length) : \nsmoothstep(antialiased_blur,0.0,extrude_length-1.0)-antialiase_blur_opacity;float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\n);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_apply_premultiplied(out_color,v_fog_pos);\n#endif\nglFragColor=out_color*(v_visibility*opacity_t);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define NUM_VISIBILITY_RINGS 2\n#define INV_SQRT2 0.70710678\n#define ELEVATION_BIAS 0.0001\n#define NUM_SAMPLES_PER_RING 16\nuniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;in vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\n#ifdef ELEVATED_ROADS\nin float a_circle_z_offset;\n#endif\nout vec3 v_data;out float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*v
2iew_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) {\n#if defined(TERRAIN)\nreturn elevation(pos)+ELEVATION_BIAS;\n#else\nreturn 0.0;\n#endif\n}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale);\n#ifdef PITCH_WITH_MAP\n#ifdef PROJECTION_GLOBE_VIEW\nreturn u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) );\n#else\nreturn u_matrix*( world_center+vec4(sample_offset,0,0) );\n#endif\n#else\nreturn projected_center+vec4(sample_offset,0,0);\n#endif\n}float get_sample_step() {\n#ifdef PITCH_WITH_MAP\nreturn 2.0*PI/float(NUM_SAMPLES_PER_RING);\n#else\nreturn PI/float(NUM_SAMPLES_PER_RING);\n#endif\n}void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1);\n#else \nsurface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1);\n#endif\n#ifdef ELEVATED_ROADS\nworld_center.z+=a_circle_z_offset+ELEVATION_BIAS;\n#endif\nvec4 projected_center=u_matrix*world_center;float view_scale=0.0;\n#ifdef PITCH_WITH_MAP\n#ifdef SCALE_WITH_MAP\nview_scale=1.0;\n#else\nview_scale=projected_center.w/u_camera_to_center_distance;\n#endif\n#else\n#ifdef SCALE_WITH_MAP\nview_scale=u_camera_to_center_distance;\n#else\nview_scale=projected_center.w;\n#endif\n#endif\ngl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0;\n#ifdef TERRAIN\nfloat step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center;\n#ifdef PITCH_WITH_MAP\nfloat cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center;\n#else\nocclusion_world_center=world_center;occlusion_projected_center=projected_center;\n#endif\nfor(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);\n#else\nvisibility=1.0;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nvisibility=1.0;\n#endif\nv_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);\n#ifdef FOG\nv_fog_pos=fog_position(world_center.xyz);\n#endif\n}'),clippingMask:ur("void main() {glFragColor=vec4(1.0);}","in vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:ur('#include "_prelude_fog.fragment.glsl"\nuniform highp float u_intensity;in vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);glFragColor=vec4(val,1.0,1.0,1.0);\n#ifdef FOG\nif (u_is_globe==0) {glFragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
2\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;in vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nout vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 tilePos=floor(a_pos*0.5);vec3 pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#else\npos=vec3(tilePos+extrude,elevation(tilePos));\n#endif\ngl_Position=u_matrix*vec4(pos,1);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),heatmapTexture:ur("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));glFragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(0.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}","in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:ur("in float v_placed;in float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);glFragColor =mix(red,blue,step(0.5,v_placed))*0.5;glFragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",'#include "_prelude_terrain.vertex.glsl"\nin vec3 a_pos;in vec2 a_anchor_pos;in vec2 a_extrude;in vec2 a_placed;in vec2 a_shift;in vec2 a_elevation_from_sea;in float a_size_scale;in vec2 a_padding;in float a_auto_z_offset;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform float u_zoom_transition;\n#endif\nout float v_placed;out float v_notUsed;void main() {float feature_elevation=a_elevation_from_sea.x+a_auto_z_offset;float terrain_elevation=(a_elevation_from_sea.y==1.0 ? 0.0 : elevation(a_anchor_pos));vec3 proj_pos=a_pos+elevationVector(a_anchor_pos)*(feature_elevation+terrain_elevation);\n#ifdef PROJECTION_GLOBE_VIEW\n#ifndef PROJECTED_POS_ON_VIEWPORT\nvec3 globe_pos=proj_pos;vec3 mercator_pos=mercator_tile_position(u_inv_rot_matrix,a_anchor_pos,u_tile_id,u_merc_center);proj_pos=mix_globe_mercator(globe_pos,mercator_pos,u_zoom_transition);\n#endif\n#endif\nvec4 projectedPoint=u_matrix*vec4(proj_pos,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}'),collisionCircle:ur("in float v_radius;in vec2 v_extrude;in float v_perspective_ratio;in 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);glFragColor=color*alpha*opacity_t;}","in vec2 a_pos_2f;in float a_radius;in vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;out float v_radius;out vec2 v_extrude;out float v_perspective_ratio;out float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd  =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz  /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos_2f;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(\nmix(-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(\n0.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:ur("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);glFragColor=mix(u_color,overlay_color,overlay_color.a);}",'#include "_prelude_terrain.vertex.glsl"\nin vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;\n#endif\nout vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\ngl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1
2);\n#else\ngl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1);\n#endif\n}'),elevatedStructuresDepth:ur("void main() {\n#ifndef DEPTH_TEXTURE\nglFragColor=vec4(0.);\n#endif\n}","in vec2 a_pos;in float a_height;uniform mat4 u_matrix;uniform float u_depth_bias;void main() {gl_Position=u_matrix*vec4(a_pos,a_height,1);gl_Position.z=gl_Position.z+u_depth_bias;}"),elevatedStructuresDepthReconstruct:ur("#ifdef DEPTH_RECONSTRUCTION\nin float v_height;\n#endif\nvoid main() {\n#ifdef DEPTH_RECONSTRUCTION\nif (v_height >=0.0)\ndiscard;\n#else\n#ifdef FEATURE_CUTOUT\napply_feature_cutout(vec4(0.0,0.0,0.0,1.0),gl_FragCoord);\n#endif\n#endif\nglFragColor=vec4(1.0,0.0,0.0,1.0);}","in vec2 a_pos;in float a_height;uniform mat4 u_matrix;uniform vec3 u_camera_pos;uniform highp float u_depth_bias;uniform lowp float u_height_scale;uniform lowp float u_reset_depth;\n#ifdef DEPTH_RECONSTRUCTION\nout float v_height;\n#endif\nvoid main() {vec3 vpos=vec3(a_pos,a_height*u_height_scale);\n#ifdef DEPTH_RECONSTRUCTION\nif (u_camera_pos.z > vpos.z) {vpos-=(u_camera_pos-vpos)*(vpos.z/(u_camera_pos.z-vpos.z));}v_height=a_height;\n#endif\ngl_Position=u_matrix*vec4(vpos,1);gl_Position.z=u_reset_depth==1.0 ? gl_Position.w : gl_Position.z+u_depth_bias;}"),elevatedStructures:ur('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nin vec3 v_normal;in float v_height;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth;\n#endif\nvec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}
2vec3 compute_view_dependent_emissive_color(float ndotl,float emissive_strength,vec3 color)\n{color=sRGBToLinear(color);color=color*(ndotl+(1.0-min(ndotl*57.29,1.0))*emissive_strength);color=linearTosRGB(color.rgb);return color;}uniform float u_emissive_strength;\n#pragma mapbox: define highp vec4 structure_color\nvoid main() {\n#pragma mapbox: initialize highp vec4 structure_color\nvec3 color=structure_color.xyz;\n#ifdef LIGHTING_3D_MODE\nvec3 normal=normalize(v_normal);vec3 transformed_normal=vec3(-normal.xy,normal.z);float ndotl=calculate_NdotL(transformed_normal);float emissive_strength=u_emissive_strength;emissive_strength=0.0;vec3 emissive_color=compute_view_dependent_emissive_color(ndotl,emissive_strength,color.xyz);\n#ifdef RENDER_SHADOWS\nfloat shadowed_lighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth);color.rgb=apply_lighting(color.rgb,transformed_normal,shadowed_lighting_factor);\n#else\ncolor=apply_lighting(color,transformed_normal);\n#endif\ncolor=mix(color,emissive_color,emissive_strength);if (v_height < 0.0) {float penetration=max(v_height+7.5,0.0);float occlusion=1.0-1.0/PI*acos(1.0-penetration/4.0);color=color*(1.0-pow(occlusion,2.0)*0.3);}\n#endif\n#ifdef FOG\ncolor=fog_apply(color,v_fog_pos);\n#endif\nvec4 out_color=vec4(color,1.0);\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,v_height);\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord);\n#endif\nglFragColor=out_color;HANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec2 a_pos;in float a_height;in vec3 a_pos_normal_3;uniform mat4 u_matrix;out vec3 v_normal;out float v_height;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth;\n#endif\n#pragma mapbox: define highp vec4 structure_color\nvoid main() {\n#pragma mapbox: initialize highp vec4 structure_color\nv_normal=a_pos_normal_3/16384.0;v_height=a_height;vec3 pos=vec3(a_pos,a_height);gl_Position=u_matrix*vec4(pos,1);\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=pos;vec3 shd_pos1=pos;\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(-v_normal.xy,v_normal.z));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fill:ur('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nuniform float u_emissive_strength;\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#endif\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nvec4 out_color=color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nout_color*=opacity;\n#ifdef INDICATOR_CUTOUT\nif (v_z_offset >=0.0) {out_color=applyCutout(out_color,v_z_offset);}\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord);\n#endif\nglFragColor=out_color;\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;out highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#endif\nuniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp float z_offset\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;v_road_z_offset=z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=z_offset;\n#endif\n}'),fillOutline:ur('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nin highp vec2 v_pos;uniform float u_emissive_strength;\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord);\n#endif\nglFragColor=out_color*(alpha*opacity);\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
2\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\nuniform mat4 u_matrix;uniform vec2 u_world;out highp vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp float z_offset\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);\n#ifdef FLIP_Y\nv_pos=(vec2(gl_Position.x,-gl_Position.y)/gl_Position.w+1.0)/2.0*u_world;\n#else\nv_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#endif\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillOutlinePattern:ur('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FILL_PATTERN_TRANSITION\nuniform float u_pattern_transition;\n#endif\nuniform float u_emissive_strength;\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\nin highp vec2 v_pos;in highp vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: define mediump vec4 pattern_b\n#endif\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump vec4 pattern_b\n#endif\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef APPLY_LUT_ON_GPU\nout_color=applyLUT(u_lutTexture,out_color);\n#endif\n#ifdef FILL_PATTERN_TRANSITION\nvec2 pattern_b_tl=pattern_b.xy;vec2 pattern_b_br=pattern_b.zw;highp vec2 pos_b=mix(pattern_b_tl/u_texsize,pattern_b_br/u_texsize,imagecoord);vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);out_color=out_color*(1.0-u_pattern_transition)+color_b*u_pattern_transition;\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*(alpha*opacity);\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\nout highp vec2 v_pos;out highp vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: define mediump vec4 pattern_b\n#endif\n#pragma mapbox: define lowp float pixel_ratio\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump vec4 pattern_b\n#endif\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize highp float z_offset\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);\n#ifdef FLIP_Y\nv_pos_world=(vec2(gl_Position.x,-gl_Position.y)/gl_Position.w+1.0)/2.0*u_world;\n#else\nv_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#endif\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillPattern:ur('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FILL_PATTERN_TRANSITION\nuniform float u_pattern_transition;\n#endif\nin highp vec2 v_pos;uniform float u_emissive_strength;\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: define mediump vec4 pattern_b\n#endif\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump vec4 pattern_b\n#endif\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef APPLY_LUT_ON_GPU\nout_color=applyLUT(u_lutTexture,out_color);\n#endif\n#ifdef FILL_PATTERN_TRANSITION\nvec2 pattern_b_tl=pattern_b.xy;vec2 pattern_b_br=pattern_b.zw;highp vec2 pos_b=mix(pattern_b_tl/u_texsize,pattern_b_br/u_texsize,imagecoord);vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);out_color=out_color*(1.0-u_pattern_transition)+color_b*u_pattern_transition;\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#ifdef ELEVATED_ROADS\nout_color.rgb*=mix(v_road_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#else\nout_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*opacity;\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
2\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;out highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\nout highp vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: define mediump vec4 pattern_b\n#endif\n#pragma mapbox: define lowp float pixel_ratio\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize highp float z_offset\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump vec4 pattern_b\n#endif\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;v_road_z_offset=z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillExtrusion:ur('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin vec4 v_color;in vec4 v_flat;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;\n#endif\nuniform lowp float u_opacity;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;in vec2 v_ao;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nin vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nin highp vec3 v_normal;\n#endif\nuniform vec3 u_flood_light_color;uniform highp float u_vertical_scale;uniform float u_flood_light_intensity;uniform vec3 u_ground_shadow_factor;\n#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)\nin float v_flood_radius;in float v_has_floodlight;\n#endif\nin float v_height;\n#pragma mapbox: define highp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp float emissive_strength\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nvec3 normal=normalize(v_normal);\n#endif\nfloat z;vec4 color=v_color;\n#ifdef ZERO_ROOF_RADIUS\nz=float(normal.z > 0.00001);\n#ifdef LIGHTING_3D_MODE\nnormal=mix(normal,vec3(0.0,0.0,1.0),z);\n#else\ncolor=mix(v_color,v_roof_color,z);\n#endif\n#endif\nfloat h=max(0.0,v_height);float ao_shade=1.0;\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h_floors=h/(u_ao[1]*u_vertical_scale);float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);ao_shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;\n#ifdef ZERO_ROOF_RADIUS\nconcave*=(1.0-z);\n#endif\nfloat x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);ao_shade*=mix(1.0,x_shade*x_shade*x_shade,concave);\n#ifdef LIGHTING_3D_MODE\n#ifdef FLOOD_LIGHT\ncolor.rgb*=mix(ao_shade,1.0,v_has_floodlight);\n#else\ncolor.rgb*=ao_shade;\n#endif\n#else\ncolor.rgb*=ao_shade;\n#endif\n#endif\n#ifdef LIGHTING_3D_MODE\nfloat flood_radiance=0.0;
2\n#ifdef FLOOD_LIGHT\nflood_radiance=(1.0-min(h/v_flood_radius,1.0))*u_flood_light_intensity*v_has_floodlight;\n#endif\n#ifdef RENDER_SHADOWS\n#ifdef FLOOD_LIGHT\nfloat ndotl_unclamped=dot(normal,u_shadow_direction);float ndotl=max(0.0,ndotl_unclamped);float occlusion=ndotl_unclamped < 0.0 ? 1.0 : shadow_occlusion(ndotl,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 litColor=apply_lighting(color.rgb,normal,(1.0-u_shadow_intensity*occlusion)*ndotl);vec3 floodLitColor=compute_flood_lighting(u_flood_light_color*u_opacity,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=mix(litColor,floodLitColor,flood_radiance);\n#else\nfloat shadowed_lighting_factor;\n#ifdef RENDER_CUTOFF\nshadowed_lighting_factor=shadowed_light_factor_normal_opacity(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,v_cutoff_opacity);if (v_cutoff_opacity==0.0) {discard;}\n#else\nshadowed_lighting_factor=shadowed_light_factor_normal(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);\n#endif\ncolor.rgb=apply_lighting(color.rgb,normal,shadowed_lighting_factor);\n#endif\n#else\ncolor.rgb=apply_lighting(color.rgb,normal);\n#ifdef FLOOD_LIGHT\ncolor.rgb=mix(color.rgb,u_flood_light_color*u_opacity,flood_radiance);\n#endif\n#endif\ncolor.rgb=mix(color.rgb,v_flat.rgb,emissive_strength);color*=u_opacity;\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos,h));\n#endif\n#ifdef INDICATOR_CUTOUT\ncolor=applyCutout(color,h);\n#endif\n#ifdef FEATURE_CUTOUT\ncolor=apply_feature_cutout(color,gl_FragCoord);\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_material_table.vertex.glsl"\nuniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_edge_radius;uniform float u_width_scale;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#ifdef RENDER_WALL_MODE\nin vec3 a_join_normal_inside;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\n#ifdef TERRAIN\nuniform int u_height_type;uniform int u_base_type;\n#endif\nuniform highp float u_vertical_scale;out vec4 v_color;out vec4 v_flat;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nout vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nout highp vec3 v_normal;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;out vec2 v_ao;\n#endif\n#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)\nout float v_flood_radius;out float v_has_floodlight;\n#endif\nout float v_height;vec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define highp float flood_light_wall_radius\n#pragma mapbox: define highp float line_width\n#pragma mapbox: define highp float emissive_strength\nvoid main() {DECLARE_MATERIAL_TABLE_INFO\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize highp float flood_light_wall_radius\n#pragma mapbox: initialize highp float line_width\n#pragma mapbox: initialize highp float emissive_strength\nbase*=u_vertical_scale;height*=u_vertical_scale;vec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nv_normal=normal;\n#endif\nbase=max(0.0,base);float attr_height=height;height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=0.0;float c_ele=0.0;vec3 pos;\n#ifdef TERRAIN\nbool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;ele=elevation(pos_nx.xy);c_ele=is_flat_height || is_flat_base ? (centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;
2float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);h=t > 0.0 ? max(h_base,h_height) : h_base;pos=vec3(pos_nx.xy,h);\n#else\nh=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat cutoff=1.0;vec3 scaled_pos=pos;\n#ifdef RENDER_CUTOFF\nvec3 centroid_random=vec3(centroid_pos.xy,centroid_pos.x+centroid_pos.y+1.0);vec3 ground_pos=centroid_pos.x==0.0 ? pos.xyz : (centroid_random/8.0);vec4 ground=u_matrix*vec4(ground_pos.xy,ele,1.0);\n#ifdef CLIP_ZERO_TO_ONE\ncutoff=cutoff_opacity(u_cutoff_params,ground.z*2.0-ground.w);\n#else\ncutoff=cutoff_opacity(u_cutoff_params,ground.z);\n#endif\nif (centroid_pos.y !=0.0 && centroid_pos.x !=0.0) {vec3 g=floor(ground_pos);vec3 mod_=centroid_random-g*8.0;float seed=min(1.0,0.1*(min(3.5,max(mod_.x+mod_.y,0.2*attr_height))*0.35+mod_.z));if (cutoff < 0.8-seed) {cutoff=0.0;}}float cutoff_scale=cutoff;v_cutoff_opacity=cutoff;scaled_pos.z=mix(c_ele,h,cutoff_scale);\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (cutoff==0.0 && centroid_pos.x !=0.0) || (color.a==0.0));\n#ifdef RENDER_WALL_MODE\nvec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);scaled_pos.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;scaled_pos.xy-=a_join_normal_inside.z*wall_offset*0.5;\n#endif\ngl_Position=mix(u_matrix*vec4(scaled_pos,1),AWAY,hidden);h=h-ele;v_height=h;\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=pos;vec3 shd_pos1=pos;\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(normal);shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);\n#endif\nfloat NdotL=0.0;float colorvalue=0.0;\n#ifndef LIGHTING_3D_MODE\ncolorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL);if (normal.y !=0.0) {float r=0.84;r=mix(0.7,0.98,1.0-u_lightintensity);NdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#endif\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(ce
2ntroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec2(mix(concave,-concave,start),y_ground);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\n#ifdef FLOOD_LIGHT\nfloat is_wall=1.0-float(t > 0.0 && top_up_ny.y > 0.0);v_has_floodlight=float(flood_light_wall_radius > 0.0 && is_wall > 0.0);v_flood_radius=flood_light_wall_radius*u_vertical_scale;\n#endif\nv_color=vec4(color.rgb,1.0);float ndotl=calculate_NdotL(normal);v_flat.rgb=sRGBToLinear(color.rgb);v_flat.rgb=v_flat.rgb*(ndotl+(1.0-min(ndotl*57.29,1.0))*emissive_strength);v_flat=vec4(linearTosRGB(v_flat.rgb),1.0);\n#else\nv_color=vec4(0.0,0.0,0.0,1.0);v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_color*=u_opacity;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nfloat roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color=vec4(0.0,0.0,0.0,1.0);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_roof_color*=u_opacity;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),fillExtrusionDepth:ur("in highp float v_depth;void main() {\n#ifndef DEPTH_TEXTURE\nglFragColor=pack_depth(v_depth);\n#endif\n}",'#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_material_table.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_edge_radius;uniform float u_width_scale;uniform float u_vertical_scale;\n#ifdef TERRAIN\nuniform int u_height_type;uniform int u_base_type;\n#endif\nin vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#ifdef RENDER_WALL_MODE\nin vec3 a_join_normal_inside;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp float line_width\n#pragma mapbox: define highp vec4 color\nout highp float v_depth;void main() {DECLARE_MATERIAL_TABLE_INFO\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp float line_width\n#pragma mapbox: initialize highp vec4 color\nbase*=u_vertical_scale;height*=u_vertical_scale;vec3 pos_nx=floor(a_pos_normal_ed.xyz*0.5);mediump vec3 top_up_ny=a_pos_normal_ed.xyz-2.0*pos_nx;base=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nvec3 pos;\n#ifdef TERRAIN\nbool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;float ele=elevation(pos_nx.xy);float c_ele=is_flat_height || is_flat_base ? (centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);float h=t > 0.0 ? max(h_base,h_height) : h_base;pos=vec3(pos_nx.xy,h);\n#else\npos=vec3(pos_nx.xy,t > 0.0 ? height : base);\n#endif\n#ifdef RENDER_WALL_MODE\nvec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);pos.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;pos.xy-=a_join_normal_inside.z*wall_offset*0.5;\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (color.a==0.0));gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);v_depth=gl_Position.z/gl_Position.w;}'),fillExtrusionPattern:ur('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\nuniform float u_pattern_transition;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;in vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nin vec3 v_normal;\n#endif\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\nin highp vec2 v_pos;in vec4 v_lighting;uniform lowp float u_opacity;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define mediump vec4 pattern\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\n#pragma mapbox: define mediump vec4 pattern_b\n#endif\n#pragma mapbox: define highp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump vec4 pattern_b\n#endif\n#pragma mapbox: initialize highp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef APPLY_LUT_ON_GPU\nout_color=applyLUT(u_lutTexture,out_color);\n#endif\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\nvec2 pattern_b_tl=pattern_b.xy;vec2 pattern_b_br=pattern_b.zw;highp vec2 pos_b=mix(pattern_b_tl/u_texsize,pattern_b_br/u_texsize,imagecoord);vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);out_color=out_color*(1.0-u_pattern_transition)+color_b*u_pattern_transition;\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color,normalize(v_normal))*u_opacity;\n#else\nout_color=out_color*v_lighting;\n#endif\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0
2),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,height);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_material_table.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_width_scale;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#ifdef RENDER_WALL_MODE\nin vec3 a_join_normal_inside;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\n#ifdef TERRAIN\nuniform int u_height_type;uniform int u_base_type;\n#endif\nout highp vec2 v_pos;out vec4 v_lighting;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;out vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nout vec3 v_normal;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump vec4 pattern\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\n#pragma mapbox: define mediump vec4 pattern_b\n#endif\n#pragma mapbox: define highp float pixel_ratio\n#pragma mapbox: define highp float line_width\nvoid main() {DECLARE_MATERIAL_TABLE_INFO\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump vec4 pattern\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump vec4 pattern_b\n#endif\n#pragma mapbox: initialize highp float pixel_ratio\n#pragma mapbox: initialize highp float line_width\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=z;vec3 p;float c_ele;\n#ifdef TERRAIN\nbool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;ele=elevation(pos_nx.xy);c_ele=is_flat_height || is_flat_base ? (centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);h=t > 0.0 ? max(h_base,h_height) : h_base;p=vec3(pos_nx.xy,h);\n#else\np=vec3(pos_nx.xy,z);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\n#ifdef RENDER_WALL_MODE\nvec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);p.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;p.xy-=a_join_normal_inside.z*wall_offset*0.5;\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (color.a==0.0));gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0\n? pos_nx.xy\n: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0;\n#ifdef LIGHTING_3D_MODE\nNdotL=calculate_NdotL(normal);\n#else\nNdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL);\n#endif\nif (normal.y !=0.0) {float r=0.84;\n#ifndef LIGHTING_3D_MODE\nr=mix(0.7,0.98,1.0-u_lightintensity);
2\n#endif\nNdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_normal=normal;\n#else\nv_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(p);\n#endif\n}'),groundShadow:ur('#include "_prelude_shadow.fragment.glsl"\nprecision highp float;uniform vec3 u_ground_shadow_factor;in vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;\n#ifdef FOG\nin float v_fog_opacity;\n#endif\nvoid main() {float light=shadowed_light_factor_plane_bias(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 shadow=mix(u_ground_shadow_factor,vec3(1.0),light);\n#ifdef RENDER_CUTOFF\nshadow=mix(vec3(1.0),shadow,cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w));\n#endif\n#ifdef FOG\nshadow=mix(shadow,vec3(1.0),v_fog_opacity);\n#endif\n#ifdef INDICATOR_CUTOUT\nshadow=mix(shadow,vec3(1.0),1.0-applyCutout(vec4(1.0),0.0).r);\n#endif\nglFragColor=vec4(shadow,1.0);}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;in vec2 a_pos;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;\n#ifdef FOG\nout float v_fog_opacity;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0.0,1.0);v_pos_light_view_0=u_light_matrix_0*vec4(a_pos,0.0,1.0);v_pos_light_view_1=u_light_matrix_1*vec4(a_pos,0.0,1.0);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);v_fog_opacity=fog(v_fog_pos);\n#endif\n}'),fillExtrusionGroundEffect:ur("uniform highp float u_ao_pass;uniform highp float u_opacity;uniform highp float u_flood_light_intensity;uniform highp vec3 u_flood_light_color;uniform highp float u_attenuation;uniform sampler2D u_fb;uniform float u_fb_size;\n#ifdef SDF_SUBPASS\nin highp vec2 v_pos;in highp vec4 v_line_segment;in highp float v_flood_light_radius_tile;in highp vec2 v_ao;float line_df(highp vec2 a,highp vec2 b,highp vec2 p) {highp vec2 ba=b-a;highp vec2 pa=p-a;highp float r=clamp(dot(pa,ba)/dot(ba,ba),0.0,1.0);return length(pa-r*ba);}\n#ifdef FOG\nin highp float v_fog;\n#endif\n#endif\nvoid main() {\n#ifdef CLEAR_SUBPASS\nvec4 color=vec4(1.0);\n#ifdef CLEAR_FROM_TEXTURE\ncolor=texture(u_fb,gl_FragCoord.xy/vec2(u_fb_size));\n#endif\nglFragColor=color;\n#else\n#ifdef SDF_SUBPASS\nhighp float d=line_df(v_line_segment.xy,v_line_segment.zw,v_pos);highp float effect_radius=mix(v_flood_light_radius_tile,v_ao.y,u_ao_pass);d/=effect_radius;d=min(d,1.0);d=1.0-pow(1.0-d,u_attenuation);highp float effect_intensity=mix(u_flood_light_intensity,v_ao.x,u_ao_pass);highp float fog=1.0;\n#ifdef FOG\nfog=v_fog;\n#endif\n#ifdef RENDER_CUTOFF\nfog*=v_cutoff_opacity;\n#endif\nglFragColor=vec4(vec3(0.0),mix(1.0,d,effect_intensity*u_opacity*fog));\n#else\n#ifdef USE_MRT1\nout_Target1=vec4(1.0-texture(u_fb,gl_FragCoord.xy/vec2(u_fb_size)).a,0.0,0.0,0.0);\n#else\nvec4 color=mix(vec4(u_flood_light_color,1.0),vec4(vec3(0.0),1.0),u_ao_pass);\n#ifdef OVERDRAW_INSPECTOR\ncolor=vec4(1.0);\n#endif\nglFragColor=color;\n#endif\n#endif\nHANDLE_WIREFRAME_DEBUG;\n#endif\n}",'#include "_prelude_fog.vertex.glsl"\nin highp vec4 a_pos_end;in highp float a_angular_offset_factor;in highp float a_hidden_by_landmark;\n#ifdef SDF_SUBPASS\nout highp vec2 v_pos;out highp vec4 v_line_segment;out highp float v_flood_light_radius_tile;out highp vec2 v_ao;\n#ifdef FOG\nout highp float v_fog;\n#endif\n#endif\nuniform highp float u_flood_light_intensity;uniform highp mat4 u_matrix;uniform highp float u_ao_pass;uniform highp float u_meter_to_tile;uniform highp float u_edge_radius;uniform highp float u_dynamic_offset;uniform highp vec2 u_ao;
2\n#pragma mapbox: define highp float flood_light_ground_radius\nconst float TANGENT_CUTOFF=4.0;const float NORM=32767.0;void main() {\n#pragma mapbox: initialize highp float flood_light_ground_radius\nvec2 p=a_pos_end.xy;vec2 q=floor(a_pos_end.zw*0.5);vec2 start_bottom=a_pos_end.zw-q*2.0;float fl_ground_radius=flood_light_ground_radius;fl_ground_radius=abs(flood_light_ground_radius);float direction=flood_light_ground_radius < 0.0 ?-1.0 : 1.0;float flood_radius_tile=fl_ground_radius*u_meter_to_tile;vec2 v=normalize(q-p);float ao_radius=u_ao.y/3.5;float effect_radius=mix(flood_radius_tile,ao_radius,u_ao_pass)+u_edge_radius;float angular_offset_factor=a_angular_offset_factor/NORM*TANGENT_CUTOFF;float angular_offset=direction*angular_offset_factor*effect_radius;float top=1.0-start_bottom.y;float side=(0.5-start_bottom.x)*2.0;vec2 extrusion_parallel=v*side*mix(u_dynamic_offset,angular_offset,top);vec2 perp=vec2(v.y,-v.x);vec2 extrusion_perp=direction*perp*effect_radius*top;vec3 pos=vec3(mix(q,p,start_bottom.x),0.0);pos.xy+=extrusion_parallel+extrusion_perp;\n#ifdef SDF_SUBPASS\nv_pos=pos.xy;v_line_segment=vec4(p,q)+perp.xyxy*u_edge_radius;v_flood_light_radius_tile=flood_radius_tile;v_ao=vec2(u_ao.x,ao_radius);\n#ifdef FOG\nv_fog_pos=fog_position(pos);v_fog=1.0-fog(v_fog_pos);\n#endif\n#endif\nfloat hidden_by_landmark=0.0;\n#ifdef HAS_CENTROID\nhidden_by_landmark=a_hidden_by_landmark;\n#endif\nfloat isFloodlit=float(fl_ground_radius > 0.0 && u_flood_light_intensity > 0.0);float hidden=mix(1.0-isFloodlit,isFloodlit,u_ao_pass);hidden+=hidden_by_landmark;gl_Position=mix(u_matrix*vec4(pos,1.0),AWAY,float(hidden > 0.0));\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n}'),hillshadePrepare:ur("precision highp float;uniform highp sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;float getElevation(vec2 coord) {return texture(u_image,coord).r/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2(\n(c+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c)\n)/pow(2.0,exaggeration+(19.2562-u_zoom));glFragColor=clamp(vec4(\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);}","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:ur('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;uniform float u_emissive_strength;void main() {vec4 pixel=texture(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);glFragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef LIGHTING_3D_MODE\nglFragColor=apply_lighting_with_emission_ground(glFragColor,u_emissive_strength);\n#endif\n#ifdef FOG\nglFragColor=fog_dither(fog_apply_premultiplied(glFragColor,v_fog_pos));\n#endif\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
2\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),line:ur('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nuniform lowp float u_device_pixel_ratio;uniform highp float u_width_scale;uniform highp float u_floor_width_scale;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;uniform highp vec2 u_trim_fade_range;uniform lowp vec4 u_trim_color;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec3 v_uv;\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef RENDER_LINE_DASH\nuniform sampler2D u_dash_image;in vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform sampler2D u_gradient_image;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\nfloat luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;}\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float side_z_offset\n#pragma mapbox: define lowp float border_width\n#pragma mapbox: define lowp vec4 border_color\n#pragma mapbox: define lowp float emissive_strength\nfloat linearstep(float edge0,float edge1,float x) {return  clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float side_z_offset\n#pragma mapbox: initialize lowp float border_width\n#pragma mapbox: initialize lowp vec4 border_color\n#pragma mapbox: initialize lowp float emissive_strength\nfloat dist=length(v_normal)*v_width2.s;float blur2=(u_width_scale*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);alpha=side_z_offset > 0.0 ? 1.0-alpha : alpha;\n#ifdef RENDER_LINE_DASH\nfloat sdfdist=texture(u_dash_image,v_tex).r;
2float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;float scaled_floorwidth=(floorwidth*u_floor_width_scale);alpha*=linearstep(0.5-sdfgamma/scaled_floorwidth,0.5+sdfgamma/scaled_floorwidth,sdfdist);\n#endif\nhighp vec4 out_color;\n#ifdef RENDER_LINE_GRADIENT\nout_color=texture(u_gradient_image,v_uv.xy);\n#ifdef MULTIPLY_LINE_GRADIENT_COLOR\nout_color*=color;\n#endif\n#else\nout_color=color;\n#endif\nfloat trim_alpha=1.0;\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=v_uv[2];if (trim_end > trim_start) {highp float start_transition=max(0.0,min(1.0,(line_progress-trim_start)/max(u_trim_fade_range[0],1.0e-9)));highp float end_transition=max(0.0,min(1.0,(trim_end-line_progress)/max(u_trim_fade_range[1],1.0e-9)));highp float transition_factor=min(start_transition,end_transition);out_color=mix(out_color,u_trim_color,transition_factor);trim_alpha=1.0-transition_factor;}\n#endif\nif (u_alpha_discard_threshold !=0.0) {if (alpha < u_alpha_discard_threshold) {discard;}}\n#ifdef RENDER_LINE_BORDER\nfloat edgeBlur=((border_width*u_width_scale)+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2);if (border_color.a==0.0) {float Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);}} else {out_color=mix(border_color*trim_alpha,out_color,smoothAlpha);}}\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#ifdef ELEVATED_ROADS\nout_color.rgb*=mix(v_road_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#else\nout_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nout_color*=(alpha*opacity);\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,v_z_offset);\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord);\n#endif\nglFragColor=out_color;\n#ifdef DUAL_SOURCE_BLENDING\nglFragColorSrc1=vec4(vec3(0.0),emissive_strength);\n#else\n#ifdef USE_MRT1\nout_Target1=vec4(emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define EXTRUDE_SCALE 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS) || defined(VARIABLE_LINE_WIDTH)\nin vec3 a_z_offset_width;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nin highp vec3 a_packed;\n#endif\n#ifdef RENDER_LINE_DASH\nin float a_linesofar;\n#endif\nuniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;uniform float u_width_scale;uniform highp float u_floor_width_scale;\n#ifdef ELEVATED\nuniform lowp float u_zbias_factor;uniform lowp float u_tile_to_meter;float sample_elevation(vec2 apos) {\n#ifdef ELEVATION_REFERENCE_SEA\nreturn 0.0;\n#else\nreturn elevation(apos);\n#endif\n}\n#endif\nout vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec3 v_uv;\n#ifdef ELEVATED_ROADS\nout highp float v_road_z_offset;\n#endif\n#ifdef RENDER_LINE_DASH\nuniform vec2 u_texsize;uniform float u_tile_units_to_pixels;out vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform float u_image_height;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define mediump float side_z_offset\n#pragma mapbox: define lowp float border_width\n#pragma mapbox: define lowp vec4 border_color\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize mediump float side_z_offset\n#pragma mapbox: initialize lowp float border_width\n#pragma mapbox: initialize lowp vec4 border_color\n#pragma mapbox: initialize lowp float emissive_strength\nfloat a_z_offset;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\na_z_offset=a_z_offset_width.x;\n#endif\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;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;\n#ifdef VARIABLE_LINE_WIDTH\nbool left=normal.y==1.0;halfwidth=(u_width_scale*(left ? a_z_offset_width.y : a_z_offset_width.z))/2.0;a_z_offset+=left ? side_z_offset : 0.0;v_normal=side_z_offset > 0.0 && left ? vec2(0.0) : v_normal;\n#else\nhalfwidth=(u_width_scale*width)/2.0;\n#endif\noffset=-1.0*offset*u_width_scale;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);float hidden=float(opacity==0.0);vec2 extrude=dist*u_pixels_to_tile_units;
2vec4 projected_extrude=u_matrix*vec4(extrude,0.0,0.0);vec2 projected_extrude_xy=projected_extrude.xy;\n#ifdef ELEVATED_ROADS\nv_road_z_offset=a_z_offset;gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,a_z_offset,1.0)+projected_extrude;\n#else\n#ifdef ELEVATED\nvec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 offset_pos=pos+offsetTile;float ele=0.0;\n#ifdef CROSS_SLOPE_VERTICAL\nfloat top=a_pos_normal.y-2.0*floor(a_pos_normal.y*0.5);float line_height=2.0*u_tile_to_meter*outset*top*u_pixels_to_tile_units[1][1]+a_z_offset;ele=sample_elevation(offset_pos)+line_height;projected_extrude=vec4(0);\n#else\n#ifdef CROSS_SLOPE_HORIZONTAL\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,max(ele1,ele2));ele=ele_max+a_z_offset;\n#else\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,0.5*(ele1+ele2));ele=ele_max-ele0+ele1+a_z_offset;\n#endif\n#endif\ngl_Position=u_matrix*vec4(offset_pos,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);gl_Position=mix(gl_Position,AWAY,hidden);\n#else\ngl_Position=mix(u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude,AWAY,hidden);\n#endif\n#endif\n#ifdef ELEVATED_ROADS\n#ifdef RENDER_SHADOWS\nvec3 shd_pos=vec3(pos+(offset2+dist)*u_pixels_to_tile_units,a_z_offset);vec3 shd_pos0=shd_pos;vec3 shd_pos1=shd_pos;\n#ifdef NORMAL_OFFSET\nvec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#endif\n#ifndef RENDER_TO_TEXTURE\nfloat epsilon=0.0001;float extrude_length_without_perspective=max(length(dist),epsilon);float extrude_length_with_perspective=max(length(projected_extrude_xy/gl_Position.w*u_units_to_pixels),epsilon);v_gamma_scale=mix(extrude_length_without_perspective/extrude_length_with_perspective,1.0,step(0.01,blur));\n#else\nv_gamma_scale=1.0;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nhighp float a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float line_progress=a_packed[2];\n#ifdef RENDER_LINE_GRADIENT\nhighp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec3(a_uv_x,a_split_index*texel_height-half_texel_height,line_progress);\n#else\nv_uv=vec3(a_uv_x,0.0,line_progress);\n#endif\n#endif\n#ifdef RENDER_LINE_DASH\nfloat scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/(floorwidth*u_floor_width_scale),(-normal.y*height+dash.x+0.5)/u_texsize.y);\n#endif\nv_width2=vec2(outset,inset);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=a_z_offset;\n#endif\n}'),linePattern:ur('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nuniform highp float u_device_pixel_ratio;uniform highp float u_width_scale;uniform highp float u_alpha_discard_threshold;uniform highp vec2 u_texsize;uniform highp float u_tile_units_to_pixels;uniform highp vec2 u_trim_offset;uniform highp vec2 u_trim_fade_range;uniform lowp vec4 u_trim_color;uniform sampler2D u_image;\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#ifdef LINE_PATTERN_TRANSITION\nuniform float u_pattern_transition;\n#endif\nin vec2 v_normal;in vec2 v_width2;in highp float v_linesofar;in float v_gamma_scale;in float v_width;\n#ifdef RENDER_LINE_TRIM_OFFSET\nin highp vec3 v_uv;\n#endif\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef LINE_JOIN_NONE\nin vec2 v_pattern_data;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#pragma mapbox: define mediump vec4 pattern\n#ifdef LINE_PATTERN_TRANSITION\n#pragma mapbox: define mediump vec4 pattern_b\n#endif\n#pragma mapbox: define mediump float pixel_ratio\n#pragma mapbox: define mediump float blur\n#pragma mapbox: define mediump float opacity\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern\n#ifdef LINE_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump vec4 pattern_b\n#endif\n#pragma mapbox: initialize mediump float pixel_ratio\n#pragma mapbox: initialize mediump float blur\n#pragma mapbox: initialize mediump float opacity\n#pragma mapbox: initialize lowp float emissive_strength\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;highp float pattern_size=display_size.x/u_tile_units_to_pixels;float aspect=display_size.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(u_width_scale*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);highp float pattern_x=v_linesofar/pattern_size*aspect;highp float x=mod(pattern_x,1.0);highp float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;highp vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));highp vec2 lod_pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(pattern_x,y));vec4 color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef APPLY_LUT_ON_GPU\ncolor=applyLUT(u_lutTexture,color);\n#endif\n#ifdef LINE_PATTERN_TRANSITION\nvec2 pattern_b_tl=pattern_b.xy;vec2 pattern_b_br=pattern_b.zw;highp vec2 pos_b=mix(pattern_b_tl*texel_size-texel_size,pattern_b_br*texel_size+texel_size,vec2(x,y));vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);color=color*(1.0-u_pattern_transition)+color_b*u_pattern_transition;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=v_uv[2];if (trim_end > trim_start) {highp float start_transition=max(0.0,min(1.0,(line_progress-trim_start)/max(u_trim_fade_range[0],1.0e-9)));highp float end_transition=max(0.0,min(1.0,(trim_end-line_progress)/max(u_trim_fade_range[1],1.0e-9)));highp float transition_factor=min(start_transition,end_transition);color=mix(color,color.a*u_trim_color,transition_factor);}\n#endif\n#ifdef LINE_JOIN_NONE\nhighp float pattern_len=pattern_size/aspect;highp float segment_phase=pattern_len-mod(v_linesofar-v_pattern_data.x+pattern_len,pattern_len);highp float visible_start=segment_phase-step(pattern_len*0.5,segment_phase)*pattern_len;highp float visible_end=floor((v_pattern_data.y-segment_phase)/pattern_len)*pattern_len+segment_phase;visible_end+=step(pattern_len*0.5,v_pattern_data.y-visible_end)*pattern_len;if (v_pattern_data.x < visible_start || v_pattern_data.x >=visible_end) {color=vec4(0.0);}\n#endif\n#ifdef LIGHTING_3D_MODE\ncolor=apply_lighting_with_emission_ground(color,emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#ifdef ELEVATED_ROADS\ncolor.rgb*=mix(v_road_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#else\ncolor.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ncolor*=(alpha*opacity);if (u_alpha_discard_threshold !=0.0) {if (color.a < u_alpha_discard_threshold) {discard;}}\n#ifdef INDICATOR_CUTOUT\ncolor=applyCutout(color,v_z_offset);\n#endif\nglFragColor=color;\n#ifdef DUAL_SOURCE_BLENDING\nglFragColorSrc1=vec4(vec3(0.0),emissive_strength);\n#else\n#ifdef USE_MRT1\nout_Target1=vec4(emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
2\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define scale 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\nin vec3 a_z_offset_width;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nin highp vec3 a_packed;\n#endif\nin highp float a_linesofar;\n#ifdef LINE_JOIN_NONE\nin highp vec3 a_pattern_data;out vec2 v_pattern_data;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#endif\nuniform mat4 u_matrix;uniform float u_tile_units_to_pixels;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform float u_device_pixel_ratio;uniform float u_width_scale;uniform float u_floor_width_scale;\n#ifdef ELEVATED\nuniform lowp float u_zbias_factor;uniform lowp float u_tile_to_meter;float sample_elevation(vec2 apos) {\n#ifdef ELEVATION_REFERENCE_SEA\nreturn 0.0;\n#else\nreturn elevation(apos);\n#endif\n}\n#endif\nout vec2 v_normal;out vec2 v_width2;out highp float v_linesofar;out float v_gamma_scale;out float v_width;\n#ifdef RENDER_LINE_TRIM_OFFSET\nout highp vec3 v_uv;\n#endif\n#ifdef ELEVATED_ROADS\nout highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#pragma mapbox: define mediump float blur\n#pragma mapbox: define mediump float opacity\n#pragma mapbox: define mediump float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define mediump float floorwidth\n#pragma mapbox: define mediump vec4 pattern\n#ifdef LINE_PATTERN_TRANSITION\n#pragma mapbox: define mediump vec4 pattern_b\n#endif\n#pragma mapbox: define mediump float pixel_ratio\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize mediump float blur\n#pragma mapbox: initialize mediump float opacity\n#pragma mapbox: initialize mediump float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize mediump float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern\n#ifdef LINE_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump vec4 pattern_b\n#endif\n#pragma mapbox: initialize mediump float pixel_ratio\n#pragma mapbox: initialize lowp float emissive_strength\nfloat a_z_offset;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\na_z_offset=a_z_offset_width.x;\n#endif\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);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=(u_width_scale*width)/2.0;offset=-1.0*offset*u_width_scale;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);vec2 dist=outset*a_extrude*scale;float u=0.5*a_direction;float t=1.0-abs(u);vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float hidden=float(opacity==0.0);vec2 extrude=dist*u_pixels_to_tile_units;vec4 projected_extrude=u_matrix*vec4(extrude,0.0,0.0);vec2 projected_extrude_xy=projected_extrude.xy;\n#ifdef ELEVATED_ROADS\nv_road_z_offset=a_z_offset;gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,a_z_offset,1.0)+projected_extrude;\n#else\n#ifdef ELEVATED\nvec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 offset_pos=pos+offsetTile;float ele=0.0;\n#ifdef CROSS_SLOPE_VERTICAL\nfloat top=a_pos_normal.y-2.0*floor(a_pos_normal.y*0.5);float line_height=2.0*u_tile_to_meter*outset*top*u_pixels_to_tile_units[1][1]+a_z_offset;ele=sample_elevation(offset_pos)+line_height;projected_extrude=vec4(0);\n#else\n#ifdef CROSS_SLOPE_HORIZONTAL\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,max(ele1,ele2));ele=ele_max+a_z_offset;\n#else\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,0.5*(ele1+ele2));ele=ele_max-ele0+ele1+a_z_offset;\n#endif\n#endif\ngl_Position=u_matrix*vec4(offset_pos,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);gl_Position=mix(gl_Position,AWAY,hidden);\n#else\ngl_Position=mix(u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude,AWAY,hidden);\n#endif\n#endif\n#ifdef ELEVATED_ROADS\n#ifdef RENDER_SHADOWS\nvec3 shd_pos=vec3(pos+(offset2+dist)*u_pixels_to_tile_units,a_z_offset);vec3 shd_pos0=shd_pos;vec3 shd_pos1=shd_pos;\n#ifdef NORMAL_OFFSET\nvec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#endif\n#ifndef RENDER_TO_TEXTURE\nfloat 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=mix(extrude_length_without_perspective/extrude_length_with_perspective,1.0,step(0.01,blur));\n#else\nv_gamma_scale=1.0;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float a_uv_x=a_packed[0];highp float line_progress=a_packed[2];v_uv=vec3(a_uv_x,0.0,line_progress);\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=(floorwidth*u_floor_width_scale);\n#ifdef LINE_JOIN_NONE\nv_width=(floorwidth*u_floor_width_scale)+ANTIALIASING;mediump float pixels_to_tile_units=1.0/u_tile_units_to_pixels;mediump float pixel_ratio_inverse=1.0/pixel_ratio;mediump float aspect=v_width/((pattern.w-pattern.y)*pixel_ratio_inverse);highp float subt_multiple=(pattern.z-pattern.x)*pixel_ratio_inverse*pixels_to_tile_units*aspect*32.0;highp float subt=floor(a_pattern_data.z/subt_multiple)*subt_multiple;float offset_sign=(fract(a_pattern_data.x)-0.5)*4.0;float line_progress_offset=offset_sign*v_width*0.5*pixels_to_tile_units;v_linesofar=(a_pattern_data.z-subt)+a_linesofar+line_progress_offset;v_pattern_data=vec2(a_pattern_data.x+line_progress_offset,a_pattern_data.y);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=a_z_offset;\n#endif\n}'),raster:ur('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_raster_array.glsl"\nuniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;uniform highp float u_zoom_transition;in vec2 v_pos0;in vec2 v_pos1;in float v_depth;\n#ifdef PROJECTION_GLOBE_VIEW\nin float v_split_fade;\n#endif\nuniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;uniform float u_emissive_strength;\n#ifndef RASTER_ARRAY\nuniform highp sampler2D u_image0;uniform sampler2D u_image1;\n#endif\n#ifdef RASTER_COLOR\nuniform sampler2D u_color_ramp;uniform highp vec4 u_colorization_mix;uniform highp float u_colorization_offset;uniform vec2 u_texture_res;\n#endif\nvoid main() {vec4 color0,color1,color;vec2 value;\n#ifdef RASTER_COLOR\n#ifdef RASTER_ARRAY\n#ifdef RASTER_ARRAY_LINEAR\nvalue=mix(\nraTexture2D_image0_linear(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_linear(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t\n);\n#else\nvalue=mix(\nraTexture2D_image0_nearest(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_nearest(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t\n);\n#endif\nif (value.y > 0.0) value.x/=value.y;\n#else\ncolor=mix(texture(u_image0,v_pos0),texture(u_image1,v_pos1),u_fade_t);value=vec2(u_colorization_offset+dot(color.rgb,u_colorization_mix.rgb),color.a);\n#endif\ncolor=texture(u_color_ramp,vec2(value.x,0.5));if (color.a > 0.0) color.rgb/=color.a;color.a*=value.y;\n#else\ncolor0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);\n#endif\ncolor.a*=u_opacity;\n#ifdef GLOBE_POLES\ncolor.a*=1.0-smoothstep(0.0,0.05,u_zoom_transition);\n#endif\nvec3 rgb=color.rgb;rgb=vec3(\ndot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);vec3 out_color=mix(u_high_vec,u_low_vec,rgb);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),u_emissive_strength).rgb;\n#endif\n#ifdef FOG\nhighp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit));\n#endif\nglFragColor=vec4(out_color*color.a,color.a);\n#ifdef PROJECTION_GLOBE_VIEW\nglFragColor*=mix(1.0,1.0-smoothstep(0.0,0.05,u_zoom_transition),smoothstep(0.8,0.9,v_split_fade));\n#endif\n#ifdef RENDER_CUTOFF\nglFragColor=glFragColor*cutoff_opacity(u_cutoff_params,v_depth);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);
2\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;uniform vec2 u_texture_offset;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center;\n#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8\n#ifdef GLOBE_POLES\nin vec3 a_globe_pos;in vec2 a_uv;\n#else\nin vec2 a_pos;in vec2 a_texture_pos;\n#endif\nout vec2 v_pos0;out vec2 v_pos1;out float v_depth;\n#ifdef PROJECTION_GLOBE_VIEW\nout float v_split_fade;\n#endif\nvoid main() {vec2 uv;\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;gl_Position=u_matrix*u_globe_matrix*vec4(globe_pos   ,1.0);uv=a_uv;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(a_globe_pos,1.0)).xyz);\n#endif\n#else\nfloat w=1.0+dot(a_texture_pos,u_perspective_transform);uv=a_texture_pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]);    \nv_split_fade=0.0;if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,u_raster_elevation,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;float opposite_merc_center=mod(u_merc_center.x+0.5,1.0);float dist_from_poles=(abs(mercatorY-0.5)*2.0);float range=0.1;v_split_fade=abs(opposite_merc_center-mercatorX);v_split_fade=clamp(1.0-v_split_fade,0.0,1.0);v_split_fade=max(smoothstep(1.0-range,1.0,dist_from_poles),max(smoothstep(1.0-range,1.0,v_split_fade),smoothstep(1.0-range,1.0,1.0-v_split_fade)));}float tiles=u_grid_matrix[0][2];
2if (tiles > 0.0) {float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvY=mercatorY*tiles-idy;float uvX=mercatorX*tiles-idx;uv=vec2(uvX,uvY);}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition)*w,w);gl_Position=u_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n#else\ngl_Position=u_matrix*vec4(a_pos*w,u_raster_elevation*w,w);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n#endif\n#endif\nv_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;v_pos0=u_texture_offset.x+u_texture_offset.y*v_pos0;v_pos1=u_texture_offset.x+u_texture_offset.y*v_pos1;\n#ifdef RENDER_CUTOFF\nv_depth=gl_Position.z;\n#endif\n}'),rasterParticle:ur('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;in vec2 v_pos0;in vec2 v_pos1;uniform sampler2D u_image0;uniform sampler2D u_image1;void main() {vec4 color0,color1,color;color0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 out_color=color.rgb;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),1.0).rgb;\n#endif\n#ifdef FOG\nhighp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit));\n#endif\nglFragColor=vec4(out_color*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center;\n#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8\nin vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {float w=1.0;vec2 uv;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]);float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvX=mercatorX*tiles-idx;float uvY=mercatorY*tiles-idy;uv=vec2(uvX,uvY);vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,u_raster_elevation,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition)*w,w);gl_Position=u_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n#else\nuv=a_texture_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*w,u_raster_elevation*w,w);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n#endif\nv_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}'),rasterParticleDraw:ur("uniform sampler2D u_color_ramp;in float v_particle_speed;void main() {glFragColor=texture(u_color_ramp,vec2(v_particle_speed,0.5));}",'#include "_prelude_raster_particle.glsl"\nin float a_index;uniform sampler2D u_particle_texture;uniform float u_particle_texture_side_len;uniform vec2 u_tile_offset;out float v_particle_speed;void main() {ivec2 pixel_coord=ivec2(\nmod(a_index,u_particle_texture_side_len),a_index/u_particle_texture_side_len);vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);vec2 pos=unpack_pos_from_rgba(pixel)+u_tile_offset;vec2 tex_coord=fract(pos);vec2 velocity=lookup_velocity(tex_coord);if (velocity==INVALID_VELOCITY) {gl_Position=AWAY;v_particle_speed=0.0;} else {gl_Position=vec4(2.0*pos-1.0,0,1);v_particle_speed=length(velocity);}gl_PointSize=1.0;}'),rasterParticleTexture:ur("uniform sampler2D u_texture;uniform float u_opacity;in vec2 v_tex_pos;void main() {vec4 color=texture(u_texture,v_tex_pos);glFragColor=vec4(floor(255.0*color*u_opacity)/255.0);}","in vec2 a_pos;out vec2 v_tex_pos;void main() {vec2 uv=0.5*a_pos+vec2(0.5);v_tex_pos=uv;gl_Position=vec4(a_pos,0.0,1.0);}"),rasterParticleUpdate:ur('#include "_prelude_raster_particle.glsl"\nuniform sampler2D u_particle_texture;uniform mediump float u_particle_texture_side_len;uniform mediump float u_speed_factor;uniform highp float u_reset_rate;uniform highp float u_rand_seed;in highp vec2 v_tex_coord;
2vec2 linearstep(vec2 edge0,vec2 edge1,vec2 x) {return  clamp((x-edge0)/(edge1-edge0),vec2(0),vec2(1));}const highp vec3 rand_constants=vec3(12.9898,78.233,4375.85453);highp float rand(const highp vec2 co) {highp float t=dot(rand_constants.xy,co);return fract(sin(t)*(rand_constants.z+t));}void main() {ivec2 pixel_coord=ivec2(v_tex_coord*u_particle_texture_side_len);highp vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);highp vec2 pos=unpack_pos_from_rgba(pixel);highp vec2 velocity=lookup_velocity(clamp(pos,0.0,1.0));highp vec2 dp=velocity==INVALID_VELOCITY ? vec2(0) : velocity*u_speed_factor;pos=pos+dp;highp vec2 seed=(pos+v_tex_coord)*u_rand_seed;highp vec2 random_pos=vec2(rand(seed+1.3),rand(seed+2.1));highp vec2 persist_rate=pow(\nlinearstep(vec2(-u_particle_pos_offset),vec2(0),pos)*linearstep(vec2(1.0+u_particle_pos_offset),vec2(1),pos),vec2(4)\n);highp vec2 per_frame_persist=pow(persist_rate,abs(dp)/u_particle_pos_offset);highp float drop_rate=1.0-per_frame_persist.x*per_frame_persist.y;drop_rate=any(greaterThanEqual(abs(pos-0.5),vec2(0.5+u_particle_pos_offset))) ? 1.0 : drop_rate;highp float drop=step(1.0-drop_rate-u_reset_rate,rand(seed));highp vec2 next_pos=mix(pos,random_pos,drop);glFragColor=pack_pos_to_rgba(next_pos);}',"in vec2 a_pos;out vec2 v_tex_coord;void main() {v_tex_coord=0.5*(a_pos+vec2(1.0));gl_Position=vec4(a_pos,0.0,1.0);}"),symbol:ur('#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;uniform bool u_is_halo;uniform lowp float u_scale_factor;\n#ifdef ICON_TRANSITION\nuniform float u_icon_transition;\n#endif\n#ifdef COLOR_ADJUSTMENT\nuniform mat4 u_color_adj_mat;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#else\n#ifdef RENDER_SHADOWS\nin highp float v_z_offset;\n#endif\n#endif\nin vec2 v_tex_a;\n#ifdef ICON_TRANSITION\nin vec2 v_tex_b;\n#endif\nin float v_draw_halo;in vec3 v_gamma_scale_size_fade_opacity;\n#ifdef RENDER_TEXT_AND_SYMBOL\nin float is_sdf;in vec2 v_tex_a_icon;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\n#pragma mapbox: initialize lowp float emissive_strength\nvec4 out_color;float fade_opacity=v_gamma_scale_size_fade_opacity[2];\n#ifdef RENDER_TEXT_AND_SYMBOL\nif (is_sdf==ICON) {vec2 tex_icon=v_tex_a_icon;lowp float alpha=opacity*fade_opacity;glFragColor=texture(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nreturn;}\n#endif\n#ifdef RENDER_SDF\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_gamma_scale_size_fade_opacity.x;float size=v_gamma_scale_size_fade_opacity.y;float fontScale=u_is_text ? size/24.0 : size;out_color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;bool draw_halo=v_draw_halo > 0.0;if (draw_halo) {out_color=halo_color;gamma=(halo_blur*u_scale_factor*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width*u_scale_factor/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,v_tex_a).r;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);out_color*=alpha;\n#else\n#ifdef ICON_TRANSITION\nvec4 a=texture(u_texture,v_tex_a)*(1.0-u_icon_transition);vec4 b=texture(u_texture,v_tex_b)*u_icon_transition;out_color=(a+b);\n#else\nout_color=texture(u_texture,v_tex_a);\n#endif\n#ifdef APPLY_LUT_ON_GPU\nout_color=applyLUT(u_lutTexture,out_color);\n#endif\n#ifdef COLOR_ADJUSTMENT\nout_color=u_color_adj_mat*out_color;\n#endif\n#endif\nout_color*=opacity*fade_opacity;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#ifdef TERRAIN\nout_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#else\nout_color.rgb*=mix(v_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,v_z_offset);\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
2\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#define APPEARANCE_ICON 1.0\nin vec4 a_pos_offset;in vec4 a_tex_size;in vec4 a_pixeloffset;in vec4 a_projected_pos;in float a_fade_opacity;\n#ifdef Z_OFFSET\nin float a_auto_z_offset;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_globe_anchor;in vec3 a_globe_normal;\n#endif\n#ifdef ICON_TRANSITION\nin vec2 a_texb;\n#endif\n#ifdef OCCLUSION_QUERIES\nin float a_occlusion_query_opacity;\n#endif\n#ifdef ELEVATED_ROADS\nin vec3 a_x_axis;in vec3 a_y_axis;uniform float u_normal_scale;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#else\n#ifdef RENDER_SHADOWS\nout highp float v_z_offset;\n#endif\n#endif\nuniform 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_inv_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_elevation_from_sea;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;uniform vec2 u_texsize_icon;uniform bool u_is_halo;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nout vec2 v_tex_a;\n#ifdef ICON_TRANSITION\nout vec2 v_tex_b;\n#endif\nout float v_draw_halo;out vec3 v_gamma_scale_size_fade_opacity;\n#ifdef RENDER_TEXT_AND_SYMBOL\nout float is_sdf;out vec2 v_tex_a_icon;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n#pragma mapbox: define lowp float emissive_strength\n#pragma mapbox: define lowp float occlusion_opacity\n#pragma mapbox: define lowp float z_offset\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\n#pragma mapbox: initialize lowp float emissive_strength\n#pragma mapbox: initialize lowp float occlusion_opacity\n#pragma mapbox: initialize lowp float z_offset\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);float a_size_max= floor(a_size[1]*0.5);float a_apperance_icon=a_size[1]-2.0*a_size_max;vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];float size;if (a_apperance_icon==APPEARANCE_ICON) {size=a_size_max/128.0;} else if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size_max,u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;float e=u_elevation_from_sea ? z_offset : z_offset+elevation(tile_anchor);\n#ifdef Z_OFFSET\ne+=a_auto_z_offset;\n#endif\nvec3 h=elevationVector(tile_anchor)*e;float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;vec3 world_pos_globe;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos_globe=a_globe_anchor+h;world_pos=mix_globe_mercator(world_pos_globe,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point;vec2 a;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1);vec4 projected_point_globe=u_matrix*vec4(world_pos_globe,1);a=projected_point_globe.xy/projected_point_globe.w;\n#else\noffsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);a=projected_point.xy/projected_point.w;\n#endif\nvec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\n#ifdef PROJECTED_POS_ON_VIEWPORT\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xyz+h,1.0);\n#else\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz,mercator_pos,u_zoom_transition)+h;projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);    \n#endif\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\n#ifdef Z_OFFSET\nz+=u_pitch_with_map ? a_auto_z_offset+z_offset : 0.0;\n#else\nz+=u_pitch_with_map ? z_offset : 0.0;\n#endif\nfloat occlusion_fade=globe_occlusion_fade;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float out_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));\n#ifdef DEPTH_OCCLUSION\nfloat depth_occlusion=occlusionFadeMultiSample(projected_point);float depth_occlusion_multplier=mix(occlusion_opacity,1.0,depth_occlusion);out_fade_opacity*=depth_occlusion_multplier;\n#endif\n#ifdef OCCLUSION_QUERIES\nfloat occludedFadeMultiplier=mix(occlusion_opacity,1.0,a_occlusion_query_opacity);out_fade_opacity*=occludedFadeMultiplier;\n#endif\n#ifdef Z_TEST_OCCLUSION\nout_fade_opacity*=occlusion_opacity;\n#endif\nfloat alpha=opacity*out_fade_opacity;float hidden=float(alpha==0.0 || projected_point.w <=0.0 || occlusion_fade==0.0);vec3 pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);pos=projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y;\n#else\n#ifdef ELEVATED_ROADS\nvec3 xAxis=vec3(a_x_axis.xy,a_x_axis.z*u_normal_scale);vec3 yAxis=vec3(a_y_axis.xy,a_y_axis.z*u_normal_scale);pos=projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y;\n#else\npos=vec3(projected_pos.xy/projected_pos.w+offset,z);\n#endif\n#endif\ngl_Position=mix(u_coord_matrix*vec4(pos,1.0),AWAY,hidden);float gamma_scale=gl_Position.w;v_draw_halo=(u_is_halo && float(gl_InstanceID)==0.0) ? 1.0 : 0.0;v_gamma_scale_size_fade_opacity=vec3(gamma_scale,size,out_fade_opacity);v_tex_a=a_tex/u_texsize;\n#ifdef RENDER_TEXT_AND_SYMBOL\nis_sdf=a_size[0]-2.0*a_size_min;v_tex_a_icon=a_tex/u_texsize_icon;\n#endif\n#ifdef ICON_TRANSITION\nv_tex_b=a_texb/u_texsize;\n#endif\n#ifdef RENDER_SHADOWS\nvec4 shd_pos=u_inv_matrix*vec4(pos,1.0);vec3 shd_pos0=shd_pos.xyz;vec3 shd_pos1=shd_pos.xyz;\n#ifdef NORMAL_OFFSET\nvec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=e;\n#else\n#ifdef RENDER_SHADOWS\nv_z_offset=e;\n#endif\n#endif\n}'),terrainRaster:ur('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image0;\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nuniform sampler2D u_image1;uniform float u_emissive_texture_available;\n#endif\nin vec2 v_pos0;\n#ifdef FOG\nin float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nin vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;\n#endif\nuniform vec3 u_ground_shadow_factor;void main() {vec4 image_color=texture(u_image0,v_pos0);vec4 color;\n#ifdef LIGHTING_3D_MODE\nconst vec3 normal=vec3(0.0,0.0,1.0);\n#ifdef RENDER_SHADOWS\nfloat cutoffOpacity=1.0;\n#ifdef RENDER_CUTOFF\ncutoffOpacity=cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w);\n#endif\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nfloat emissive_strength=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0).r : image_color.a;vec3 unlit_base=image_color.rgb*(1.0-emissive_strength);vec3 emissive_base=image_color.rgb*emissive_strength;float ndotl=u_shadow_direction.z;float occlusion=ndotl < 0.0 ? 1.0 : shadow_occlusion(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,0.0);ndotl=max(0.0,ndotl);vec3 lit=apply_lighting(unlit_base,normal,mix(1.0,(1.0-(u_shadow_intensity*occlusion))*ndotl,cutoffOpacity));vec3 emissive=compute_emissive_draped(emissive_base,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=lit+emissive;color.a=1.0;\n#else\nfloat lighting_factor=shadowed_light_factor_normal_unbiased(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);color=apply_lighting(image_color,normal,mix(1.0,lighting_factor,cutoffOpacity));\n#endif\n#else\nfloat lighting_factor=u_lighting_directional_dir.z;color=apply_lighting(image_color,normal,lighting_factor);\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nfloat emissive_strength=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0).r : image_color.a;color.rgb=mix(color.rgb,image_color.rgb,emissive_strength);color.a=1.0;\n#endif\n#endif\n#else\ncolor=image_color;\n#endif\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#else\ncolor=fog_dither(fog_apply_from_vert(color,v_fog_opacity));\n#endif\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
2\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_skirt_height;in vec2 a_pos;out vec2 v_pos0;\n#ifdef FOG\nout float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;\n#endif\nvoid main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height;v_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0);\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\nv_fog_pos=fog_position(decodedPos);\n#else\nv_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);\n#endif\n}'),terrainDepth:ur("precision highp float;in float v_depth;void main() {glFragColor=pack_depth(v_depth);}",'#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;in vec2 a_pos;out float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}'),skybox:ur('#include "_prelude_fog.fragment.glsl"\nin lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep(\ncos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(e
2nd-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=texture(u_cubemap,uv).rgb;\n#ifdef FOG\nsky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);\n#endif\nsky_color+=0.1*sun_disk(v_uv,u_sun_direction);glFragColor=vec4(sky_color*u_opacity,u_opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}',Gn),skyboxGradient:ur('#include "_prelude_fog.fragment.glsl"\nin highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture(u_color_ramp,vec2(progress,0.5));\n#ifdef FOG\ncolor.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;\n#endif\ncolor*=u_opacity;glFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}',Gn),skyboxCapture:ur
vendor: 3,689 bytes, line 2
2("\nin highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;precision highp float;\n#define BETA_R                  vec3(5.5e-6,13.0e-6,22.4e-6)\n#define BETA_M                  vec3(21e-6,21e-6,21e-6)\n#define MIE_G                   0.76\n#define DENSITY_HEIGHT_SCALE_R  8000.0\n#define DENSITY_HEIGHT_SCALE_M  1200.0\n#define PLANET_RADIUS           6360e3\n#define ATMOSPHERE_RADIUS       6420e3\n#define SAMPLE_STEPS            10\n#define DENSITY_STEPS           4\nfloat ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;glFragColor=vec4(color,1.0);}","in highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;out highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;
2v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:ur('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image0;\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nuniform sampler2D u_image1;uniform float u_emissive_texture_available;\n#endif\nuniform float u_far_z_cutoff;in vec2 v_pos0;\n#ifndef FOG\nuniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport;\n#endif\nvoid main() {vec4 color;\n#ifdef CUSTOM_ANTIALIASING\nhighp vec2 uv=gl_FragCoord.xy/u_viewport;\n#ifdef FLIP_Y\nuv.y=1.0-uv.y;\n#endif\nhighp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;highp float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);highp float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture(u_image0,v_pos0);\n#ifdef LIGHTING_3D_MODE\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nfloat emissive_strength=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0).r : raster.a;raster=apply_lighting_with_emission_ground(raster,emissive_strength);color=vec4(clamp(raster.rgb,vec3(0),vec3(1))*antialias,antialias);\n#else\nraster=apply_lighting_ground(raster);color=vec4(raster.rgb*antialias,raster.a*antialias);\n#endif\n#else\ncolor=vec4(raster.rgb*antialias,raster.a*antialias);\n#endif\n#else\ncolor=texture(u_image0,v_pos0);\n#ifdef LIGHTING_3D_MODE\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nfloat emissive_strength=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0).r : color.a;color=apply_lighting_with_emission_ground(color,emissive_strength);color.a=1.0;\n#else\ncolor=apply_lighting_ground(color);\n#endif\n#endif\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ncolor*=1.0-step(u_far_z_cutoff,1.0/gl_FragCoord.w);glFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height;\n#ifdef GLOBE_POLES\nin vec3 a_globe_pos;in vec2 a_uv;\n#else\nin vec2 a_pos;\n#endif\nout vec2 v_pos0;void main() {\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;vec2 uv=a_uv;\n#else\nfloat tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY);\n#endif\nv_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale;\n#ifdef GLOBE_POLES\nvec3 up_vector=globe_derived_up_vector;\n#else\nvec3 up_vector=elevationVector(tile_pos);\n#endif\nfloat height=elevation(tile_pos);globe_pos+=up_vector*height;\n#ifndef GLOBE_POLES\nglobe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z;\n#endif\n#ifdef GLOBE_POLES\nvec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0);\n#else\nvec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0);\n#endif\ngl_Position=u_proj_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n}'),globeAtmosphere:ur('#include "_prelude_fog.fragment.glsl"\nuniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec4 u_atmosphere_fog_color;uniform vec4 u_high_color;uniform vec4 u_space_color;uniform float u_horizon_angle;in highp vec3 v_ray_dir;in highp vec3 v_horizon_dir;void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir;\n#ifdef PROJECTION_GLOBE_VIEW\nglobe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {\n#ifdef ALPHA_PASS\nglFragColor=vec4(0,0,0,0);return;\n#else\n#ifdef NATIVE\nglFragColor=vec4(1,1,1,1);\n#else\nglFragColor=vec4(0,0,0,1);\n#endif\nreturn;\n#endif\n}\n#endif\nhighp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ?\n0.0 : max(acos(clamp(dot(dir,horizon_dir),-1.0,1.0)),0.0);float horizon_angle;\n#ifdef PROJECTION_GLOBE_VIEW\nhighp vec3 closest_point=globe_pos_dot_dir*dir;highp float closest_point_to_center=length(closest_point-u_globe_pos);highp float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ?\nPI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t);\n#else\nhorizon_angle=horizon_angle_mercator;\n#endif\nhorizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_atmosphere_fog_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_atmosphere_fog_color.rgb;vec3 color_stop_1=u_high_color.rgb;
2vec3 color_stop_2=u_space_color.rgb;\n#ifdef ALPHA_PASS\nfloat a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);glFragColor=vec4(1.0,1.0,1.0,a);\n#else\nvec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c=c2;glFragColor=vec4(c*t,t);\n#endif\n}',"in vec3 a_pos;in vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;out highp vec3 v_ray_dir;out highp vec3 v_horizon_dir;void main() {v_ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix(\nmix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}"),model:ur('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform float u_opacity;uniform vec3 u_lightcolor;uniform vec3 u_lightpos;uniform float u_lightintensity;uniform vec4 u_baseColorFactor;uniform vec4 u_emissiveFactor;uniform float u_metallicFactor;uniform float u_roughnessFactor;uniform float u_emissive_strength;in highp vec4 v_position_height;in lowp vec4 v_color_mix;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth_shadows;\n#endif\n#ifdef OCCLUSION_TEXTURE_TRANSFORM\nuniform vec4 u_occlusionTextureTransform;\n#endif\n#pragma mapbox: define-attribute highp vec3 normal_3f\n#pragma mapbox: define-attribute highp vec3 color_3f\n#pragma mapbox: define-attribute highp vec4 color_4f\n#pragma mapbox: define-attribute highp vec2 uv_2f\n#pragma mapbox: initialize-attribute highp vec3 normal_3f\n#pragma mapbox: initialize-attribute highp vec3 color_3f\n#pragma mapbox: initialize-attribute highp vec4 color_4f\n#pragma mapbox: initialize-attribute highp vec2 uv_2f\n#ifdef HAS_ATTRIBUTE_a_pbr\nin lowp vec4 v_roughness_metallic_emissive_alpha;in mediump vec4 v_height_based_emission_params;\n#endif\n#ifdef HAS_TEXTURE_u_baseColorTexture\nuniform sampler2D u_baseColorTexture;uniform bool u_baseTextureIsAlpha;uniform bool u_alphaMask;uniform float u_alphaCutoff;\n#endif\n#ifdef HAS_TEXTURE_u_metallicRoughnessTexture\nuniform sampler2D u_metallicRoughnessTexture;\n#endif\n#ifdef HAS_TEXTURE_u_occlusionTexture\nuniform sampler2D u_occlusionTexture;uniform float u_aoIntensity;\n#endif\n#ifdef HAS_TEXTURE_u_normalTexture\nuniform sampler2D u_normalTexture;\n#endif\n#ifdef HAS_TEXTURE_u_emissionTexture\nuniform sampler2D u_emissionTexture;\n#endif\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nin highp float v_depth;uniform highp sampler2D u_depthTexture;uniform highp vec2 u_inv_depth_size;uniform highp vec2 u_depth_range_unpack;\n#ifdef DEPTH_D24\nhighp float unpack_depth(highp float depth) {return  depth*u_depth_range_unpack.x+u_depth_range_unpack.y;}\n#else\nhighp float unpack_depth_rgba(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}\n#endif\nbool isOccluded() {highp vec2 coord=gl_FragCoord.xy*u_inv_depth_size;\n#ifdef FLIP_Y\ncoord.y=1.0-coord.y;\n#endif\n#ifdef DEPTH_D24\nhighp float depth=unpack_depth(texture(u_depthTexture,coord).r);\n#else\nhighp float depth=unpack_depth_rgba(texture(u_depthTexture,coord));\n#endif\nreturn v_depth > depth+0.0005;}\n#endif\n#define saturate(_x) clamp(_x,0.,1.)\nvec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}float calculate_NdotL(vec3 normal,vec3 lightDir) {const float ext=0.70710678118;return (clamp(dot(normal,lightDir),-ext,1.0)+ext)/(1.0+ext);}vec3 getDiffuseShadedColor(vec3 albedo,vec3 normal,vec3 lightDir,vec3 lightColor)\n{\n#ifdef LIGHTING_3D_MODE\nvec3 transformed_normal=vec3(-normal.xy,normal.z);float lighting_factor;\n#ifdef RENDER_SHADOWS\nlighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);\n#else\nlighting_factor=saturate(dot(transformed_normal,u_lighting_directional_dir));\n#endif\nreturn apply_lighting(albedo,transformed_normal,lighting_factor);\n#else\nvec3 n=normal;float colorvalue=((albedo.x*0.2126)+(albedo.y*0.7152))+(albedo.z*0.0722);vec3 c=vec3(0.03,0.03,0.03);float directional=clamp(dot(n,vec3(lightDir)),0.0,1.0);directional=mix(1.0-u_lightintensity,max((1.0-colorvalue)+u_lightintensity,1.0),directional);vec3 c3=c+clamp((albedo*directional)*lightColor,mix(vec3(0.0),vec3(0.3),vec3(1.0)-light
2Color),vec3(1.0));return c3;\n#endif\n}vec4 getBaseColor() {vec4 albedo=u_baseColorFactor;\n#ifdef HAS_ATTRIBUTE_a_color_3f\nalbedo*=vec4(color_3f,1.0);\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\n#else\n#ifdef HAS_ATTRIBUTE_a_color_4f\nalbedo*=color_4f;\n#endif\n#endif\n#if defined (HAS_TEXTURE_u_baseColorTexture) && defined (HAS_ATTRIBUTE_a_uv_2f)\nvec4 texColor=texture(u_baseColorTexture,uv_2f);if(u_alphaMask) {if (texColor.w < u_alphaCutoff) {discard;}}\n#ifdef UNPREMULT_TEXTURE_IN_SHADER\nif(texColor.w > 0.0) {texColor.rgb/=texColor.w;}texColor.w=1.0;\n#endif\nif(u_baseTextureIsAlpha) {if (texColor.r < 0.5) {discard;}} else {texColor.rgb=sRGBToLinear(texColor.rgb);albedo*=texColor;}\n#endif\nvec4 color=vec4(mix(albedo.rgb,v_color_mix.rgb,v_color_mix.a),albedo.a);\n#ifdef APPLY_LUT_ON_GPU\ncolor=applyLUT(u_lutTexture,color);\n#endif\nreturn color;}highp mat3 cotangentFrame(highp vec3 N,highp vec3 p,highp vec2 uv ) {\n#ifdef HAS_TEXTURE_u_normalTexture\nhighp vec3 dp1=vec3(dFdx(p.x),dFdx(p.y),dFdx(p.z));highp vec3 dp2=vec3(dFdy(p.x),dFdy(p.y),dFdy(p.z));highp vec2 duv1=vec2(dFdx(uv.x),dFdx(uv.y));highp vec2 duv2=vec2(dFdy(uv.x),dFdy(uv.y));highp vec3 dp2perp=cross( dp2,N );highp vec3 dp1perp=cross( N,dp1 );highp vec3 T=dp2perp*duv1.x+dp1perp*duv2.x;highp vec3 B=dp2perp*duv1.y+dp1perp*duv2.y;\n#ifdef FLIP_Y\nT=-T;B=-B;\n#endif\nhighp float lengthT=dot(T,T);highp float lengthB=dot(B,B);highp float maxLength=max(lengthT,lengthB);highp float invmax=inversesqrt( maxLength );highp mat3 res=mat3( T*invmax,B*invmax,N );return res;\n#else\nreturn mat3(1.0);\n#endif\n}highp vec3 getNormal(){highp vec3 n;\n#ifdef HAS_ATTRIBUTE_a_normal_3f\nn=normalize(normal_3f);\n#else\nhighp vec3 fdx=vec3(dFdx(v_position_height.x),dFdx(v_position_height.y),dFdx(v_position_height.z));highp vec3 fdy=vec3(dFdy(v_position_height.x),dFdy(v_position_height.y),dFdy(v_position_height.z));\n#ifdef FLIP_Y\nn=normalize(cross(fdx,fdy));\n#else\nn=normalize(cross(fdx,fdy))*-1.0;\n#endif\n#endif\n#if defined(HAS_TEXTURE_u_normalTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nvec3 nMap=texture( u_normalTexture,uv_2f).xyz;nMap=normalize(2.0*nMap-vec3(1.0));highp vec3 v=normalize(-v_position_height.xyz);highp mat3 TBN=cotangentFrame(n,v,uv_2f);n=normalize(TBN*nMap);\n#endif\nreturn n;}struct Material {float perceptualRoughness;float alphaRoughness;float metallic;vec3 f90;vec4 baseColor;vec3 diffuseColor;vec3 specularColor;highp vec3 normal;};Material getPBRMaterial() {Material mat;mat.baseColor=getBaseColor();mat.perceptualRoughness=u_roughnessFactor;mat.metallic=u_metallicFactor;\n#ifdef HAS_ATTRIBUTE_a_pbr\nmat.perceptualRoughness=v_roughness_metallic_emissive_alpha.x;mat.metallic=v_roughness_metallic_emissive_alpha.y;mat.baseColor.w*=v_roughness_metallic_emissive_alpha.w;\n#endif\n#if defined(HAS_TEXTURE_u_metallicRoughnessTexture) && defined(HAS_ATTRIBUTE_a_uv_2f) \nvec4 mrSample=texture(u_metallicRoughnessTexture,uv_2f);mat.perceptualRoughness*=mrSample.g;mat.metallic*=mrSample.b;\n#endif\nconst float c_minRoughness=0.04;mat.perceptualRoughness=clamp(mat.perceptualRoughness,c_minRoughness,1.0);mat.metallic=saturate(mat.metallic);mat.alphaRoughness=mat.perceptualRoughness*mat.perceptualRoughness;const vec3 f0=vec3(0.04);mat.diffuseColor=mat.baseColor.rgb*(vec3(1.0)-f0);mat.diffuseColor*=1.0-mat.metallic;mat.specularColor=mix(f0,mat.baseColor.rgb,mat.metallic);highp float reflectance=max(max(mat.specularColor.r,mat.specularColor.g),mat.specularColor.b);highp float reflectance90=saturate(reflectance*25.0);mat.f90=vec3(reflectance90);mat.normal=getNormal();return mat;}float V_GGX(float NdotL,float NdotV,float roughness)\n{float a2=roughness*roughness;float GGXV=NdotL*sqrt(NdotV*NdotV*(1.0-a2)+a2);float GGXL=NdotV*sqrt(NdotL*NdotL*(1.0-a2)+a2);return 0.5/(GGXV+GGXL);}float V_GGXFast(float NdotL,float NdotV,float roughness) {float a=roughness;float GGXV=NdotL*(NdotV*(1.0-a)+a);float GGXL=NdotV*(NdotL*(1.0-a)+a);return 0.5/(GGXV+GGXL);}vec3 F_Schlick(vec3 specularColor,vec3 f90,float VdotH)\n{return specularColor+(f90-specularColor)*pow(clamp(1.0-VdotH,0.0,1.0),5.0);}vec3 F_SchlickFast(vec3 specularColor,float VdotH)\n{float x=1.0-VdotH;float x4=x*x*x*x;return specularColor+(1.0-specularColor)*x4*x;}float D_GGX(highp float NdotH,float alphaRoughness)\n{highp float a4=alphaRoughness*alphaRoughness;highp float f=(NdotH*a4-NdotH)*NdotH+1.0;return a4/(PI*f*f);}vec3 diffuseBurley(Material mat,float LdotH,float NdotL,float NdotV)\n{float f90=2.0*LdotH*LdotH*mat.alphaRoughness-0.5;return (mat.diffuseColor/PI)*(1.0+f90*pow((1.0-NdotL),5.0))*(1.0+f90*pow((1.0-NdotV),5.0));}vec3 diffuseLambertian(Material mat)\n{\n#ifdef LIGHTING_3D_MODE\nreturn mat.diffuseColor;\n#else\nreturn mat.diffuseColor/PI;\n#endif\n}vec3 EnvBRDFApprox(vec3 specularColor,float roughness,highp float NdotV)\n{vec4 c0=vec4(-1,-0.0275,-0.572,0.022);vec4 c1=vec4(1,0.0425,1.04,-0.04);highp vec4 r=roughness*c0+c1;highp float a004=min(r.x*r.x,exp2(-9.28*NdotV))*r.x+r.y;vec2 AB=vec2(-1.04,1.04)*a004+r.zw;return specularColor*AB.x+AB.y;}vec3 computeIndirectLightContribution(Material mat,float NdotV,vec3 normal)\n{vec3 env_light=vec3(0.65,0.65,0.65);\n#ifdef LIGHTING_3D_MODE\nfloat ambient_factor=calculate_ambient_directional_factor(normal);env_light=u_lighting_ambient_color*ambient_factor;\n#endif\nvec3 envBRDF=EnvBRDFApprox(mat.specularColor,mat.perceptualRoughness,NdotV);vec3 indirectSpecular= envBRDF*env_light;vec3 indirectDiffuse=mat.diffuseColor*env_light;return indirectSpecular+indirectDiffuse;}vec3 computeLightContribution(Material mat,vec3 lightPosition,vec3 lightColor)\n{highp vec3 n=mat.normal;highp vec3 v=normalize(-v_position_height.xyz);highp vec3 l=normalize(lightPosition);highp vec3 h=normalize(v+l);float NdotV=clamp(abs(dot(n,v)),0.001,1.0);float NdotL=saturate(dot(n,l));highp float NdotH=saturate(dot(n,h));float VdotH=saturate(dot(v,h));vec3 f=F_SchlickFast(mat.specularColor,VdotH);float g=V_GGXFast(NdotL,NdotV,mat.alphaRoughness);float d=D_GGX(NdotH,mat.alphaRoughness);vec3 diffuseTerm=(1.0-f)*diffuseLambertian(mat);vec3 specularTerm=f*g*d;vec3 transformed_normal=vec3(-n.xy,n.z);float lighting_factor;\n#ifdef RENDER_SHADOWS\nlighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);\n#else\nlighting_factor=NdotL;\n#endif\nvec3 directLightColor=(specularTerm+diffuseTerm)*lighting_factor*light
2Color;vec3 indirectLightColor=computeIndirectLightContribution(mat,NdotV,transformed_normal);vec3 color=(saturate(directLightColor)+indirectLightColor);float intensityFactor=1.0;\n#if !defined(LIGHTING_3D_MODE)\nconst vec3 luminosityFactor=vec3(0.2126,0.7152,0.0722);float luminance=dot(diffuseTerm,luminosityFactor);intensityFactor=mix((1.0-u_lightintensity),max((1.0-luminance+u_lightintensity),1.0),NdotL);\n#endif\ncolor*=intensityFactor;return color;}void main() {\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nif (isOccluded()) {discard;}\n#endif\nvec3 lightDir=u_lightpos;vec3 lightColor=u_lightcolor;\n#ifdef LIGHTING_3D_MODE\nlightDir=u_lighting_directional_dir;lightDir.xy=-lightDir.xy;lightColor=u_lighting_directional_color;\n#endif\nvec4 finalColor;\n#ifdef DIFFUSE_SHADED\nvec3 N=getNormal();vec3 baseColor=getBaseColor().rgb;vec3 diffuse=getDiffuseShadedColor(baseColor,N,lightDir,lightColor);\n#ifdef HAS_TEXTURE_u_occlusionTexture\nfloat ao=(texture(u_occlusionTexture,uv_2f).r-1.0)*u_aoIntensity+1.0;diffuse*=ao;\n#endif\nfinalColor=vec4(mix(diffuse,baseColor,u_emissive_strength),1.0)*u_opacity;\n#else\nMaterial mat=getPBRMaterial();vec3 color=computeLightContribution(mat,lightDir,lightColor);float ao=1.0;\n#if defined (HAS_TEXTURE_u_occlusionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\n#ifdef OCCLUSION_TEXTURE_TRANSFORM\nvec2 uv=uv_2f.xy*u_occlusionTextureTransform.zw+u_occlusionTextureTransform.xy;\n#else\nvec2 uv=uv_2f;\n#endif\nao=(texture(u_occlusionTexture,uv).x-1.0)*u_aoIntensity+1.0;color*=ao;\n#endif\nvec4 emissive=u_emissiveFactor;\n#if defined(HAS_TEXTURE_u_emissionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nemissive.rgb*=sRGBToLinear(texture(u_emissionTexture,uv_2f).rgb);\n#endif\n#ifdef APPLY_LUT_ON_GPU\nfloat emissiveFactorLength=max(length(u_emissiveFactor.rgb),0.001);emissive.rgb=sRGBToLinear(applyLUT(u_lutTexture,linearTosRGB(emissive.rgb/emissiveFactorLength).rbg))*emissiveFactorLength;\n#endif\ncolor+=emissive.rgb;float opacity=mat.baseColor.w*u_opacity;\n#ifdef HAS_ATTRIBUTE_a_pbr\nfloat resEmission=v_roughness_metallic_emissive_alpha.z;resEmission*=v_height_based_emission_params.z+v_height_based_emission_params.w*pow(clamp(v_height_based_emission_params.x,0.0,1.0),v_height_based_emission_params.y);vec3 color_mix=v_color_mix.rgb;\n#ifdef APPLY_LUT_ON_GPU\ncolor_mix=applyLUT(u_lutTexture,color_mix);\n#endif\ncolor=mix(color,color_mix,min(1.0,resEmission));\n#ifdef HAS_ATTRIBUTE_a_color_4f\nfloat distance=length(vec2(1.3*max(0.0,abs(color_4f.x)-color_4f.z),color_4f.
2y));distance+= mix(0.5,0.0,clamp(resEmission-1.0,0.0,1.0));opacity*=v_roughness_metallic_emissive_alpha.w*saturate(1.0-distance*distance);\n#endif\n#endif\nvec3 unlitColor=mat.baseColor.rgb*ao+emissive.rgb;color=mix(color,unlitColor,u_emissive_strength);color=linearTosRGB(color);color*=opacity;finalColor=vec4(color,opacity);\n#endif\n#ifdef FOG\nfinalColor=fog_dither(fog_apply_premultiplied(finalColor,v_fog_pos,v_position_height.w));\n#endif\n#ifdef RENDER_CUTOFF\nfinalColor*=v_cutoff_opacity;\n#endif\n#ifdef INDICATOR_CUTOUT\nfinalColor=applyCutout(finalColor,v_position_height.w);\n#endif\n#ifdef FEATURE_CUTOUT\nfinalColor=apply_feature_cutout(finalColor,gl_FragCoord);\n#endif\nglFragColor=finalColor;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec3 a_pos_3f;\n#pragma mapbox: define-attribute highp vec3 normal_3f\n#pragma mapbox: define-attribute highp vec2 uv_2f\n#pragma mapbox: define-attribute highp vec3 color_3f\n#pragma mapbox: define-attribute highp vec4 color_4f\n#pragma mapbox: define-attribute-vertex-shader-only highp vec4 pbr\n#pragma mapbox: define-attribute-vertex-shader-only highp vec3 heightBasedEmissiveStrength\nuniform mat4 u_matrix;uniform mat4 u_node_matrix;uniform mat4 u_lighting_matrix;uniform vec3 u_camera_pos;uniform vec4 u_color_mix;\n#ifdef INSTANCED_ARRAYS\nin vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;\n#else\nuniform highp mat4 u_normal_matrix;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth_shadows;\n#endif\nout vec4 v_position_height;out lowp vec4 v_color_mix;\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nout highp float v_depth;\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\nout lowp vec4 v_roughness_metallic_emissive_alpha;out mediump vec4 v_height_based_emission_params;\n#endif\nvec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}void main() {\n#pragma mapbox: initialize-attribute highp vec3 normal_3f\n#pragma mapbox: initialize-attribute highp vec2 uv_2f\n#pragma mapbox: initialize-attribute highp vec3 color_3f\n#pragma mapbox: initialize-attribute highp vec4 color_4f\n#pragma mapbox: initialize-attribute-custom highp vec4 pbr\n#pragma mapbox: initialize-attribute-custom highp vec3 heightBasedEmissiveStrength\nhighp mat4 normal_matrix;\n#ifdef INSTANCED_ARRAYS\nnormal_matrix=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);\n#else\nnormal_matrix=u_normal_matrix;\n#endif\nvec3 local_pos;mat3 rs;\n#ifdef MODEL_POSITION_ON_GPU\nvec3 pos_color=normal_matrix[0].xyz;vec4 translate=normal_matrix[1];vec3 pos_a=floor(pos_color);vec3 rgb=1.05*(pos_color-pos_a);float hidden=float(pos_a.x > EXTENT);float color_mix=pos_a.z/100.0;v_color_mix=vec4(sRGBToLinear(rgb),color_mix);float meter_to_tile=normal_matrix[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);rs[0].x=normal_matrix[1].w;rs[0].yz=normal_matrix[2].xy;rs[1].xy=normal_matrix[2].zw;rs[1].z=normal_matrix[3].x;rs[2].xyz=normal_matrix[3].yzw;vec4 pos_node=u_lighting_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;local_pos=pos.xyz;gl_Position=mix(u_matrix*pos,AWAY,hidden);pos.z*=meter_to_tile;v_position_height.xyz=pos.xyz-u_camera_pos;\n#else\nlocal_pos=a_pos_3f;gl_Position=u_matrix*vec4(a_pos_3f,1);v_position_height.xyz=vec3(u_lighting_matrix*vec4(a_pos_3f,1));v_color_mix=vec4(sRGBToLinear(u_color_mix.rgb),u_color_mix.a);\n#endif\nv_position_height.w=a_pos_3f.z;\n#ifdef HAS_ATTRIBUTE_a_pbr\nvec4 albedo_c=decode_color(pbr.xy);vec2 e_r_m=unpack_float(pbr.z);vec2 r_m= unpack_float(e_r_m.y*16.0);r_m.r=r_m.r*16.0;v_color_mix=vec4(albedo_c.rgb,1.0);v_roughness_metallic_emissive_alpha=vec4(vec3(r_m,e_r_m.x)/255.0,albedo_c.a);v_roughness_metallic_emissive_alpha.z*=2.0;float heightBasedRelativeIntepolation=a_pos_3f.z*heightBasedEmissiveStrength.x+heightBasedEmissiveStrength.y;v_height_based_emission_params.x=heightBasedRelativeIntepolation;v_height_based_emission_params.y=heightBasedEmissiveStrength.z;vec2 emissionMultiplierValues=unpack_float(pbr.w)/256.0;v_height_based_emission_params.z=emissionMultiplierValues.x;v_height_based_emission_params.w=emissionMultiplierValues.y-emissionMultiplierValues.x;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(local_pos);\n#endif\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nv_depth=gl_Position.z/gl_Position.w;\n#ifdef CLIP_ZERO_TO_ONE\nv_depth=-1.0+2.0*v_depth; \n#endif\n#endif\n#ifdef HAS_ATTRIBUTE_a_normal_3f\n#ifdef MODEL_POSITION_ON_GPU\nfloat x_squared_scale=dot(rs[0],rs[0]);float y_squared_scale=dot(rs[1],rs[1]);float z_squared_scale=dot(rs[2],rs[2]);vec3 squared_scale=vec3(x_squared_scale,y_squared_scale,z_squared_scale);normal_3f=rs*((u_lighting_matrix*vec4(normal_3f,0.0)).xyz/squared_scale);normal_3f=normalize(normal_3f);
2\n#else\nnormal_3f=vec3(normal_matrix*vec4(normal_3f,0));\n#endif\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\n#ifdef HAS_ATTRIBUTE_a_color_4f\nv_roughness_metallic_emissive_alpha.w=clamp(color_4f.a*v_roughness_metallic_emissive_alpha.w*(v_roughness_metallic_emissive_alpha.z-1.0),0.0,1.0);\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec4 shadow_pos=u_node_matrix*vec4(local_pos,1.0);\n#ifdef NORMAL_OFFSET\n#ifdef HAS_ATTRIBUTE_a_normal_3f\n#ifdef MODEL_POSITION_ON_GPU\nvec3 offset=shadow_normal_offset(vec3(-normal_3f.xy,normal_3f.z));shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0();\n#else\nvec3 offset=shadow_normal_offset_model(normal_3f);shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0();\n#endif\n#endif\n#endif\nv_pos_light_view_0=u_light_matrix_0*shadow_pos;v_pos_light_view_1=u_light_matrix_1*shadow_pos;v_depth_shadows=gl_Position.w;\n#endif\n}'),modelDepth:ur("in highp float v_depth;void main() {\n#ifndef DEPTH_TEXTURE\nglFragColor=pack_depth(v_depth);\n#endif\n}","in vec3 a_pos_3f;uniform mat4 u_matrix;out highp float v_depth;\n#ifdef MODEL_POSITION_ON_GPU\n#ifdef INSTANCED_ARRAYS\nin vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;\n#else\nuniform highp mat4 u_instance;\n#endif\nuniform highp mat4 u_node_matrix;\n#endif\nvoid main() {\n#ifdef MODEL_POSITION_ON_GPU\nhighp mat4 instance;\n#ifdef INSTANCED_ARRAYS\ninstance=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);\n#else\ninstance=u_instance;\n#endif\nvec3 pos_color=instance[0].xyz;vec4 translate=instance[1];vec3 pos_a=floor(pos_color);float hidden=float(pos_a.x > EXTENT);float meter_to_tile=instance[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);mat3 rs;rs[0].x=instance[1].w;rs[0].yz=instance[2].xy;
2rs[1].xy=instance[2].zw;rs[1].z=instance[3].x;rs[2].xyz=instance[3].yzw;vec4 pos_node=u_node_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;gl_Position=mix(u_matrix*pos,AWAY,hidden);\n#else\ngl_Position=u_matrix*vec4(a_pos_3f,1);\n#endif\nv_depth=gl_Position.z/gl_Position.w;}"),stars:ur("in highp vec2 v_uv;in mediump float v_intensity;float shapeCircle(in vec2 uv)\n{float beginFade=0.6;float lengthFromCenter=length(v_uv);return 1.0-clamp((lengthFromCenter-beginFade)/(1.0-beginFade),0.0,1.0);}void main() {float alpha=shapeCircle(v_uv);vec3 color=vec3(1.0,1.0,1.0);alpha*=v_intensity;glFragColor=vec4(color*alpha,alpha);HANDLE_WIREFRAME_DEBUG;}","\nin vec3 a_pos_3f;in vec2 a_uv;in float a_size_scale;in float a_fade_opacity;uniform mat4 u_matrix;uniform vec3 u_up;uniform vec3 u_right;uniform float u_intensity_multiplier;out highp vec2 v_uv;out mediump float v_intensity;void main() {v_uv=a_uv;v_intensity=a_fade_opacity*u_intensity_multiplier;vec3 pos=a_pos_3f;pos+=a_uv.x*u_right*a_size_scale;pos+=a_uv.y*u_up*a_size_scale;gl_Position=u_matrix*vec4(pos,1.0);}"),snowParticle:ur("in highp vec2 uv;in highp float alphaMultiplier;uniform vec4 u_particleColor;uniform vec2 u_simpleShapeParameters;void main() {float t=clamp((length(uv)-u_simpleShapeParameters.x)/(1.0-u_simpleShapeParameters.x),0.0,1.0);float alpha=1.0-pow(t,pow(10.0,u_simpleShapeParameters.y));alpha*=alphaMultiplier;alpha*=u_particleColor.a;vec3 color=u_particleColor.rgb*alpha;glFragColor=vec4(color,alpha) ;HANDLE_WIREFRAME_DEBUG;}","\nin highp vec3 a_pos_3f;in highp vec2 a_uv;in highp vec4 a_snowParticleData;in highp vec4 a_snowParticleDataHorizontalOscillation;uniform mat4 u_modelview;uniform mat4 u_projection;uniform vec3 u_cam_pos;uniform vec2 u_screenSize;uniform float u_time;uniform float u_boxSize;uniform float u_velocityConeAperture; \nuniform float u_velocity;uniform vec3 u_direction;uniform float u_horizontalOscillationRadius; \nuniform float u_horizontalOscillationRate; \nuniform float u_billboardSize;uniform vec2 u_thinningCenterPos;uniform vec3 u_thinningShape;uniform float u_thinningAffectedRatio;uniform float u_thinningParticleOffset;out highp vec2 uv;out highp float alphaMultiplier;void main() {vec3 pos=a_pos_3f;float halfBoxSize=0.5*u_boxSize;pos.xyz*=halfBoxSize;pos+=u_cam_pos;float velocityConeApertureRad=radians(u_velocityConeAperture*0.5);float coneAnglePichRad=velocityConeApertureRad*a_snowParticleData.z;float coneAngleHeadingRad=a_snowParticleData.w*radians(360.0);vec3 localZ=normalize(u_direction);vec3 localX=normalize(cross(localZ,vec3(1,0,0)));vec3 localY=normalize(cross(localZ,localX));vec3 direction;direction.x=cos(coneAngleHeadingRad)*sin(coneAnglePichRad);direction.y=sin(coneAngleHeadingRad)*sin(coneAnglePichRad);direction.z=cos(coneAnglePichRad);direction=normalize(direction);vec3 simPosLocal=vec3(0,0,0);float velocityScale=(1.0+3.0*a_snowParticleData.y)*u_velocity;simPosLocal+=direction*velocityScale*u_time;float horizontalOscillationRadius=u_horizontalOscillationRadius*a_snowParticleDataHorizontalOscillation.x;float horizontalOscillationAngle=u_horizontalOscillationRate*u_time*(-1.0+2.0*a_snowParticleDataHorizontalOscillation.y);simPosLocal.xy+=horizontalOscillationRadius*vec2(cos(horizontalOscillationAngle),sin(horizontalOscillationAngle));vec3 simPos=localX*simPosLocal.x+\nlocalY*simPosLocal.y+localZ*simPosLocal.z;pos+=simPos;pos=fract((pos+vec3(halfBoxSize))/vec3(u_boxSize))*u_boxSize-vec3(halfBoxSize);float clipZ=-u_cam_pos.z+pos.z;vec4 posView=u_modelview*vec4(pos,1.0);float size=u_billboardSize;alphaMultiplier=1.0;vec4 posScreen=u_projection*posView;posScreen/=posScreen.w;posScreen.xy=vec2(0.5)+posScreen.xy*0.5;posScreen.xy*=u_screenSize;vec2 thinningCenterPos=u_thinningCenterPos.xy;thinningCenterPos.y=u_screenSize.y-thinningCenterPos.y;float screenDist=length((thinningCenterPos-posScreen.xy)/(0.5*u_screenSize));screenDist+=a_snowParticleData.x*u_thinningParticleOffset;float scaleFactorMode=0.0;float thinningShapeDist=u_thinningShape.x+u_thinningShape.y;if (screenDist < thinningShapeDist) {float thinningFadeRatio=clamp((screenDist-u_thinningShape.x)/u_thinningShape.y,0.0,1.0);thinningFadeRatio=pow(thinningFadeRatio,u_thinningShape.z);if (a_snowParticleData.x < u_thinningAffectedRatio) {scaleFactorMode=1.0-thinningFadeRatio;alphaMultiplier=thinningFadeRatio;}}vec4 posScreen1=u_projection*vec4(posView.x-size,posView.yzw);posScreen1/=posScreen1.w;vec4 posScreen2=u_projection*vec4(posView.x+size,posView.yzw);posScreen2/=posScreen2.w;posScreen1.xy=vec2(0.5)+posScreen1.xy*0.5;posScreen1.xy*=u_screenSize;posScreen2.xy=vec2(0.5)+posScreen2.xy*0.5;posScreen2.xy*=u_screenSize;float screenLength=length(posScreen1.xy-posScreen2.xy);float screenEpsilon=3.0;float scaleFactor=1.0;if (screenLength < screenEpsilon) {scaleFactor=screenEpsilon/max(screenLength,0.01);scaleFactor=mix(scaleFactor,1.0,scaleFactorMode);}float screenEpsilon2=15.0;if (screenLength > screenEpsilon2) {scaleFactor=screenEpsilon2/max(screenLength,0.01);}size*=scaleFactor;vec2 right=size*vec2(1,0);vec2 up=size*vec2(0,1);posView.xy+=right*a_uv.x;posView.xy+=up*a_uv.y;uv=a_uv;gl_Position=u_projection*posView;}"),rainParticle:ur("in highp vec2 uv;in highp float particleRandomValue;uniform sampler2D u_texScreen;uniform float u_distortionStrength;uniform vec4 u_color;uniform vec2 u_thinningCenterPos;uniform vec3 u_thinningShape;uniform float u_thinningAffectedRatio;uniform float u_thinningParticleOffset;uniform float u_shapeDirectionalPower;uniform float u_mode;void main() {vec2 st=uv*0.5+vec2(0.5);vec2 uvm=uv;uvm.y=-1.0+2.0*pow(st.y,u_shapeDirectionalPower);float shape=clamp(1.0-length(uvm),0.0,1.0);float alpha=abs(shape)*u_color.a;vec2 screenSize=vec2(textureSize(u_texScreen,0));vec2 thinningCenterPos=u_thinningCenterPos.xy;thinningCenterPos.y=screenSize.y-thinningCenterPos.y;float screenDist=length((thinningCenterPos-gl_FragCoord.xy)/(0.5*screenSize));screenDist+=(0.5+0.5*particleRandomValue)*u_thinningParticleOffset;float thinningShapeDist=u_thinningShape.x+u_thinningShape.y;float thinningAlpha=1.0;if (screenDist < thinningShapeDist) {float thinningFadeRatio=clamp((screenDist-u_thinningShape.x)/u_thinningShape.y,0.0,1.0);thinningFadeRatio=pow(thinningFadeRatio,u_thinningShape.z);thinningAlpha*=thinningFadeRatio;}vec2 offsetXY=normalize(uvm)*abs(shape);vec2 stScreen=(gl_FragCoord.xy+offsetXY*u_distortionStrength*thinningAlpha)/screenSize;vec3 colorScreen=texture(u_texScreen,stScreen).rgb;alpha*=thinningAlpha;glFragColor=mix(vec4(colorScreen,1.0),vec4(u_color.rgb*alpha,alpha),u_mode);HANDLE_WIREFRAME_DEBUG;}","\nin highp vec3 a_pos_3f;in highp vec2 a_uv;in highp vec4 a_rainParticleData;uniform mat4 u_modelview;uniform mat4 u_projection;uniform vec3 u_cam_pos;uniform float u_time;uniform float u_boxSize;uniform float u_velocityConeAperture; \nuniform float u_velocity; \nuniform vec2 u_rainDropletSize;uniform vec3 u_rainDirection;out highp vec2 uv;out highp float particleRandomValue;void main() {vec3 pos=a_pos_3f;float halfBoxSize=0.5*u_boxSize;
2pos*=halfBoxSize; \npos+=u_cam_pos;float velocityConeApertureRad=radians(u_velocityConeAperture*0.5);float coneAnglePichRad=velocityConeApertureRad*a_rainParticleData.z;float coneAngleHeadingRad=a_rainParticleData.w*radians(360.0);vec3 localZ=normalize(u_rainDirection);vec3 localX=normalize(cross(localZ,vec3(1,0,0)));vec3 localY=normalize(cross(localZ,localX));vec3 directionLocal;directionLocal.x=cos(coneAngleHeadingRad)*sin(coneAnglePichRad);directionLocal.y=sin(coneAngleHeadingRad)*sin(coneAnglePichRad);directionLocal.z=cos(coneAnglePichRad);directionLocal=normalize(directionLocal);vec3 directionWorld=localX*directionLocal.x+localY*directionLocal.y+localZ*directionLocal.z;float velocityScale=(1.0+3.0*a_rainParticleData.y)*u_velocity;vec3 simPosLocal=vec3(0,0,0);simPosLocal+=directionLocal*velocityScale*u_time;vec3 simPos=localX*simPosLocal.x+\nlocalY*simPosLocal.y+localZ*simPosLocal.z;pos+=simPos;pos=fract((pos+vec3(halfBoxSize))/vec3(u_boxSize))*u_boxSize-vec3(halfBoxSize);vec4 posView=u_modelview*vec4(pos,1.0);vec3 directionView=normalize((u_modelview*vec4(directionWorld,0.0)).xyz);vec3 side=cross(directionView,normalize(posView.xyz));posView.xyz+=side*a_uv.x*u_rainDropletSize.x;posView.xyz+=directionView*a_uv.y*u_rainDropletSize.y;uv=a_uv;particleRandomValue=a_rainParticleData.x;gl_Position=u_projection*posView;}"),vignette:ur("uniform vec3 u_vignetteShape;uniform vec4 u_vignetteColor;in vec2 st;void main() {float screenDist=length(st);float alpha=clamp((screenDist-u_vignetteShape.x)/u_vignetteShape.y,0.0,1.0);alpha=pow(alpha,u_vignetteShape.z)*u_vignetteColor.a;vec3 color=u_vignetteColor.rgb;glFragColor=vec4(color*alpha,alpha) ;}","in vec2 a_pos_2f;out vec2 st;void main() {st=a_pos_2f;gl_Position=vec4(a_pos_2f,0,1);}"),occlusion:ur("uniform vec4 u_color;void main() {glFragColor=u_color;}",'#include "_prelude_terrain.vertex.glsl"\nin highp vec2 a_offset_xy;uniform highp vec3 u_anchorPos;uniform mat4 u_matrix;uniform vec2 u_screenSizePx;uniform vec2 u_occluderSizePx;void main() {vec3 world_pos=u_anchorPos;\n#ifdef TERRAIN\nfloat e=elevation(world_pos.xy);world_pos.z+=e;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1.0);projected_point.xy+=projected_point.w*a_offset_xy*0.5*u_occluderSizePx/u_screenSizePx;gl_Position=projected_point;}')};function cr(e,t){const i=e.split("\n");for(let e of i){if(e=e.trimStart(),"#"!==e[0])continue;if(!e.includes("if"))continue;if(e.startsWith("#endif"))continue;const i=e.match(Qn);if(i)for(const e of i)er.has(e)||t.add(e)}}function ur(e,t){const i=new Set,n=[],r=[];e=e.replace(Kn,(e,t)=>(r.push(t),"")),t=t.replace(Kn,(e,t)=>(n.push(t),""));let o=new Set(tr);cr(e,o),cr(t,o);for(const e of[...n,...r])nr[e]||(nr[e]=new Set,cr(ir[e],nr[e])),o=new Set([...o,...nr[e]]);return{fragmentSource:e=e.replace(Jn,(e,t,n,r,o)=>(i.add(o),"define"===t?`\n#ifndef HAS_UNIFORM_u_${o}\nin ${n} ${r} ${o};\n#else\nuniform ${n} ${r} u_${o};\n#endif\n`:"initialize"===t?`\n#ifdef HAS_UNIFORM_u_${o}\n    ${n} ${r} ${o} = u_${o};\n#endif\n`:"define-attribute"===t?`\n#ifdef HAS_ATTRIBUTE_a_${o}\n    in ${n} ${r} ${o};\n#endif\n`:"initialize-attribute"===t?"":void 0)),vertexSource:t=t.replace(Jn,(e,t,n,r,o)=>{const s=`MATERIAL_ATTRIBUTE_OFFSET_${o}`,a="float"===r?"vec2":r,l=`GET_ATTRIBUTE_${a}(a_${o}, materialInfo, ${s})`,c=o.match(/color/)?"color":a;return"define-attribute-vertex-shader-only"===t?`\n#ifdef HAS_ATTRIBUTE_a_${o}\nin ${n} ${r} a_${o};\n#endif\n`:i.has(o)?"define"===t?`\n#ifndef HAS_UNIFORM_u_${o}\nuniform lowp float u_${o}_t;\n    #if !defined(${s})\n        in ${n} ${a} a_${o};\n    #endif\nout ${n} ${r} ${o};\n#else\nuniform ${n} ${r} u_${o};\n#endif\n`:"initialize"===t?"vec4"===c?`\n#ifndef HAS_UNIFORM_u_${o}\n    ${o} = a_${o};\n#else\n    ${n} ${r} ${o} = u_${o};\n#endif\n`:`\n#if !defined(HAS_UNIFORM_u_${o})\n    #ifdef ${s}\n        ${o} = unpack_mix_${c}(${l}, u_${o}_t);\n    #else\n        ${o} = unpack_mix_${c}(a_${o}, u_${o}_t);\n    #endif\n#else\n    ${n} ${r} ${o} = u_${o};\n#endif\n`:"define-attribute"===t?`\n#ifdef HAS_ATTRIBUTE_a_${o}\n    in ${n} ${r} a_${o};\n    out ${n} ${r} ${o};\n#endif\n`:"initialize-attribute"===t?`\n#ifdef HAS_ATTRIBUTE_a_${o}\n    ${o} = a_${o};\n#endif\n`:void 0:"define"===t?`\n#ifndef HAS_UNIFORM_u_${o}\nuniform lowp float u_${o}_t;\n    #if !defined(${s})\n        in ${n} ${a} a_${o};\n    #endif\n#else\nuniform ${n} ${r} u_${o};\n#endif\n`:"define-instanced"===t?"mat4"===c?`\n#ifdef INSTANCED_ARRAYS\nin vec4 a_${o}0;\nin vec4 a_${o}1;\nin vec4 a_${o}2;\nin vec4 a_${o}3;\n#else\nuniform ${n} ${r} u_${o};\n#endif\n`:`\n#ifdef INSTANCED_ARRAYS\nin ${n} ${a} a_${o};\n#else\nuniform ${n} ${r} u_${o};\n#endif\n`:"initialize-attribute-custom"===t?`\n#ifdef HAS_ATTRIBUTE_a_${o}\n    ${n} ${r} ${o} = a_${o};\n#endif\n`:"vec4"===c?`\n#ifndef HAS_UNIFORM_u_${o}\n    #ifdef ${s}\n        ${n} ${r} ${o} = ${l};\n    #else\n        ${n} ${r} ${o} = a_${o};\n    #endif\n#else\n    ${n} ${r} ${o} = u_${o};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${o}\n    #ifdef ${s}\n        ${n} ${r} ${o} = unpack_mix_${c}(${l}, u_${o}_t);\n    #else\n        ${n} ${r} ${o} = unpack_mix_${c}(a_${o}, u_${o}_t);\n    #endif\n#else\n    ${n} ${r} ${o} = u_${o};\n#endif\n`}),usedDefines:o,vertexIncludes:n,fragmentIncludes:r}}class hr{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(e,t,i,n,r,o,s,a){this.context=e;let l=this.boundPaintVertexBuffers.length!==n.length;for(let e=0;!l&&e<n.length;e++)this.boundPaintVertexBuffers[e]!==n[e]&&(l=!0);let c=this.boundDynamicVertexBuffers.length!==s.length;for(let e=0;!c&&e<s.length;e++)this.boundDynamicVertexBuffers[e]!==s[e]&&(c=!0);if(!this.vao||this.boundProgram!==t||this.boundLayoutVertexBuffer!==i||l||c||this.boundIndexBuffer!==r||this.boundVertexOffset!==o)this.freshBind(t,i,n,r,o,s,a);else{e.bindVertexArrayOES.set(this.vao);for(const i of s)i&&(i.bind(),a&&i.instanceCount&&i.setVertexAttribDivisor(e.gl,t,a));r&&r.dynamicDraw&&r.bind()}}freshBind(e,t,i,n,r,o,s){const a=this.context,l=a.gl;this.vao&&this.destroy(),this.vao=a.gl.createVertexArray(),a.bindVertexArrayOES.set(this.vao),this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=n,this.boundVertexOffset=r,this.boundDynamicVertexBuffers=o,t.enableAttributes(l,e),t.bind(),t.setVertexAttribPointers(l,e,r);for(const t of i)t.enableAttributes(l,e),t.bind(),t.setVertexAttribPointers(l,e,r);for(const t of o)t&&(t.enableAttributes(l,e),t.bind(),t.setVertexAttribPointers(l,e,r),s&&t.instanceCount&&t.setVertexAttribDivisor(l,e,s));n&&n.bind()}destroy(){this.vao&&(this.context.gl.deleteVertexArray(this.vao),this.vao=null)}}function dr(t,i){const n=Math.pow(2,i.canonical.z),r=i.canonical.y;return[new e.ae(0,r/n).toLngLat().lat,new e.ae(0,(r+1)/n).toLngLat().lat]}function fr(t,i,n,r,o,s,a){const l=t.context,c=l.gl,u=n.hillshadeFBO;if(!u)return;t.prepareDrawTile();const h=t.isTileAffectedByFog(i),d=[];t.terrain&&t.terrain.renderingToTexture&&"mrt-fallback"===t.emissiveMode&&d.push("USE_MRT1");const f=t.getOrCreateProgram("hillshade",{overrideFog:h,defines:d});l.activeTexture.set(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,u.colorAttachment0.get());const p=((t,i,n,r)=>{const o=n.paint.get("hillshade-shadow-color"),s="none"===n.paint.get("hillshade-shadow-color-use-theme").
vendor: 5,660 bytes, line 2
2constantOr("default"),a=n.paint.get("hillshade-highlight-color"),l="none"===n.paint.get("hillshade-highlight-color-use-theme").constantOr("default"),c=n.paint.get("hillshade-accent-color"),u="none"===n.paint.get("hillshade-accent-color-use-theme").constantOr("default"),h=n.paint.get("hillshade-emissive-strength");let d=e.an(n.paint.get("hillshade-illumination-direction"));if("viewport"===n.paint.get("hillshade-illumination-anchor"))d-=t.transform.angle;else if(t.style&&t.style.enable3dLights()&&t.style.directionalLight){const i=t.style.directionalLight.properties.get("direction"),n=e.d4(i.x,i.y,i.z);d=e.an(n[1])}const f=!t.options.moving;return{u_matrix:r||t.transform.calculateProjMatrix(i.tileID.toUnwrapped(),f),u_image:0,u_latrange:dr(0,i.tileID),u_light:[n.paint.get("hillshade-exaggeration"),d],u_shadow:o.toPremultipliedRenderColor(s?null:n.lut),u_highlight:a.toPremultipliedRenderColor(l?null:n.lut),u_emissive_strength:h,u_accent:c.toPremultipliedRenderColor(u?null:n.lut)}})(t,n,r,t.terrain?i.projMatrix:null);t.uploadCommonUniforms(l,f,i.toUnwrapped());const{tileBoundsBuffer:m,tileBoundsIndexBuffer:_,tileBoundsSegments:g}=t.getTileBoundsBuffers(n);f.draw(t,c.TRIANGLES,o,s,a,en.disabled,p,r.id,m,_,g)}function pr(t,i,n){if(!i.needsDEMTextureUpload)return;const r=t.context,o=r.gl;r.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture=i.demTexture||t.getTileTexture(n.stride);const s=n.getPixels();i.demTexture?i.demTexture.update(s,{premultiply:!1}):i.demTexture=new e.T(r,s,o.R32F,{premultiply:!1}),i.needsDEMTextureUpload=!1}function mr(t,i,n){const r=t.context,o=r.gl;if(!i.dem)return;const s=i.dem;if(r.activeTexture.set(o.TEXTURE1),pr(t,i,s),!i.demTexture)return;i.demTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE);const a=s.dim;r.activeTexture.set(o.TEXTURE0);let l=i.hillshadeFBO;if(!l){const t=new e.T(r,{width:a,height:a,data:null},o.RGBA8);t.bind(o.LINEAR,o.CLAMP_TO_EDGE),l=i.hillshadeFBO=r.createFramebuffer(a,a,1,"renderbuffer"),l.colorAttachment0.set(t.texture)}r.bindFramebuffer.set(l.framebuffer),r.viewport.set([0,0,a,a]);const{tileBoundsBuffer:c,tileBoundsIndexBuffer:u,tileBoundsSegments:h}=t.getMercatorTileBoundsBuffers(),d=[];t.linearFloatFilteringSupported()&&d.push("TERRAIN_DEM_FLOAT_FORMAT"),t.terrain&&t.terrain.renderingToTexture&&"mrt-fallback"===t.emissiveMode&&d.push("USE_MRT1"),t.getOrCreateProgram("hillshadePrepare",{defines:d}).draw(t,o.TRIANGLES,Xi.disabled,Ki.disabled,Zi.unblended,en.disabled,((t,i)=>{const n=i.stride,r=e.bC();return e.ce(r,0,e.al,-e.al,0,0,1),e.br(r,r,[0,-e.al,0]),{u_matrix:r,u_image:1,u_dimension:[n,n],u_zoom:t.overscaledZ}})(i.tileID,s),n.id,c,u,h),i.needsHillshadePrepare=!1}class _r{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class gr extends _r{getDefault(){return e.ao.transparent.toNonPremultipliedRenderColor(null)}set(e){const t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class yr extends _r{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class vr extends _r{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class xr extends _r{getDefault(){return[!0,!0,!0,!0]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class br extends _r{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class wr extends _r{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class Tr extends _r{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){const t=this.current;(e.func!==t.func||e.ref!==t.ref||e.mask!==t.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class Sr extends _r{getDefault(){const e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class Er extends _r{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.current=e,this.dirty=!1}}class Ir extends _r{getDefault(){return[0,1]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class Ar extends _r{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.current=e,this.dirty=!1}}class Mr extends _r{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class Cr extends _r{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.BLEND):t.disable(t.BLEND),this.current=e,this.dirty=!1}}class Pr extends _r{getDefault(){const e=this.gl;return[e.ONE,e.ZERO,e.ONE,e.ZERO]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.blendFuncSeparate(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class Dr extends _r{getDefault(){return e.ao.transparent.toNonPremultipliedRenderColor(null)}set(e){const t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.blendColor
vendor: 5,030 bytes, line 2
2(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class Rr extends _r{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquationSeparate(e,e),this.current=e,this.dirty=!1)}}class Lr extends _r{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),this.current=e,this.dirty=!1}}class zr extends _r{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class Or extends _r{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}let Fr=class extends _r{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}};class kr extends _r{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class Br extends _r{getDefault(){const e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class Nr extends _r{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class Vr extends _r{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Ur extends _r{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class jr extends _r{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class Gr extends _r{getDefault(){return null}set(e){const t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class qr extends _r{getDefault(){return null}set(e){this.gl&&(e!==this.current||this.dirty)&&(this.gl.bindVertexArray(e),this.current=e,this.dirty=!1)}}class Hr extends _r{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class $r extends _r{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class Wr extends _r{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class Zr extends _r{constructor(e,t){super(e),this.context=e,this.parent=t}getDefault(){return null}}class Xr extends Zr{constructor(e,t,i=0){super(e,t),this.attachmentPoint=e.gl.COLOR_ATTACHMENT0+i}setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,this.attachmentPoint,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class Yr extends Zr{attachment(){return this.gl.DEPTH_ATTACHMENT}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,this.attachment(),t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Kr extends Zr{attachment(){return this.gl.DEPTH_ATTACHMENT}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,this.attachment(),t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class Jr extends Yr{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}const Qr=(e,t,i,n)=>({u_matrix:e,u_image0:0,u_image1:1,u_skirt_height:t,u_ground_shadow_factor:i,u_emissive_texture_available:n}),eo=(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_)=>({u_proj_matrix:Float32Array.from(e),u_globe_matrix:t,u_normalize_matrix:Float32Array.from(n),u_merc_matrix:i,u_zoom_transition:r,u_merc_center:o,u_image0:0,u_image1:1,u_frustum_tl:s,u_frustum_tr:a,u_frustum_br:l,u_frustum_bl:c,u_globe_pos:u,u_globe_radius:h,u_viewport:d,u_grid_matrix:_?Float32Array.from(_):new Float32Array(9),u_skirt_height:f,u_far_z_cutoff:p,u_emissive_texture_available:m});function to(e,t){return null!=e&&null!=t&&!(!e.hasData()||!t.hasData())&&null!=e.demTexture&&null!=t.demTexture&&e.tileID.key!==t.tileID.key}const io=new class{constructor(){this.operations={}}newMorphing(e,t,i,n,r){if(e in this.operations){const t=this.operations[e];t.to.tileID.key!==i.tileID.key&&(t.queued=i)}else this.operations[e]={startTime:n,phase:0,duration:r,from:t,to:i,queued:null}}getMorphValuesForProxy(e){if(!(e in this.operations))return null;const t=this.operations[e];return{from:t.from,to:t.to,phase:t.phase}}update(e){for(const t in this.operations){const i=this.operations[t];for(i.phase=(e-i.startTime)/i.duration;i.phase>
vendor: 6,609 bytes, line 2
2=1||!this._validOp(i);)if(!this._nextOp(i,e)){delete this.operations[t];break}}}_nextOp(e,t){return!!e.queued&&(e.from=e.to,e.to=e.queued,e.queued=null,e.phase=0,e.startTime=t,!0)}_validOp(e){return e.from.hasData()&&e.to.hasData()}},no={0:null,1:"TERRAIN_VERTEX_MORPHING"};function ro(e,t,i){if(0===t)return 0;const n=t<1&&514===i?.25/t:1;return 6*Math.pow(1.5,22-e)*Math.max(t,1)*n}function oo(e,t){const i=1<<e.z;return!t&&(0===e.x||e.x===i-1)||0===e.y||e.y===i-1}function so(e,t){if(!e.style||!e.style.enable3dLights())return;const i=e.context,n=i.gl;i.activeTexture.set(n.TEXTURE1),t?t.bind(n.LINEAR,n.CLAMP_TO_EDGE):e.emptyTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}const ao=e=>({u_matrix:e});function lo(t,i,n,r,o){if(o>0){const s=e.o.now(),a=(s-t.timeAdded)/o,l=i?(s-i.timeAdded)/o:-1,c=n.getSource(),u=r.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),h=!i||Math.abs(i.tileID.overscaledZ-u)>Math.abs(t.tileID.overscaledZ-u),d=h&&t.refreshedUponExpiration?1:e.aA(h?a:1-l,0,1);return i?{opacity:1,mix:1-d,isFading:a<1}:{opacity:d,mix:0,isFading:a<1}}return{opacity:1,mix:0,isFading:!1}}class co extends zt{constructor(e){const t=pt("mock-dem",{type:"raster-dem",maxzoom:e.transform.maxZoom},e.style.dispatcher,e.style);super("mock-dem",t,!1),t.setEventedParent(this),this._sourceLoaded=!0}_loadTile(e,t){e.state="loaded",t(null)}}class uo extends zt{constructor(e){const t=pt("proxy",{type:"geojson",maxzoom:e.transform.maxZoom},e.style.dispatcher,e.style);super("proxy",t,!1),t.setEventedParent(this),this.map=this.getSource().map=e,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(e,t,i){if(e.freezeTileCoverage)return;this.transform=e;const n=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((t,i)=>{if(t[i.key]="",!this._tiles[i.key]){const t=new Pt(i,this._source.tileSize*i.overscaleFactor(),e.tileZoom,void 0,void 0,this._source.worldview);t.state="loaded",this._tiles[i.key]=t}return t},{});for(const e in this._tiles)e in n||(this.freeFBO(e),this._tiles[e].unloadVectorData(),delete this._tiles[e])}freeFBO(e){const t=this.proxyCachedFBO[e];if(void 0!==t){const i=Object.values(t);this.renderCachePool.push(...i),delete this.proxyCachedFBO[e]}}deallocRenderCache(){this.renderCache.forEach(e=>e.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class ho extends e.aQ{constructor(e,t,i){super(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y),this.proxyTileKey=t,this.projMatrix=i}}class fo extends e.bV{constructor(t,i){super(),this._debugParams={sortTilesHiZFirst:!0,disableRenderCache:!1},this.painter=t,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[n,r,o]=function(){const t=new e.bd,i=new e.b0,n=131;t.reserve(17161),i.reserve(33800);const r=e.al/128,o=e.al+r/2,s=o+r;for(let i=-r;i<s;i+=r)for(let n=-r;n<s;n+=r){const r=n<0||n>o||i<0||i>o?24575:0,s=e.aA(Math.round(n),0,e.al),a=e.aA(Math.round(i),0,e.al);t.emplaceBack(s+r,a)}const a=(e,t)=>{const r=t*n+e;i.emplaceBack(r+1,r,r+n),i.emplaceBack(r+n,r+n+1,r+1)};for(let e=1;e<129;e++)for(let t=1;t<129;t++)a(t,e);return[0,129].forEach(e=>{for(let t=0;t<130;t++)a(t,e),a(e,t)}),[t,i,32768]}(),s=t.context;this.gridBuffer=s.createVertexBuffer(n,e.bf.members),this.gridIndexBuffer=s.createIndexBuffer(r),this.gridSegments=e.bg.simpleSegment(0,0,n.length,r.length),this.gridNoSkirtSegments=e.bg.simpleSegment(0,0,n.length,o),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new uo(i.map),this.orthoMatrix=e.bC(),e.ce(this.orthoMatrix,"globe"===this.painter.transform.projection.name?.015:0,e.al,0,e.al,0,1);const a=s.gl;this._overlapStencilMode=new Ki({func:a.GEQUAL,mask:255},0,255,a.KEEP,a.KEEP,a.REPLACE),this._previousZoom=t.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=i,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new co(i.map),this._pendingGroundEffectLayers=[],this._emissiveTexture=!1}set style(e){e.on("data",this._onStyleDataEvent.bind(this)),this._style=e,this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(t,i,n){if(t&&t.terrain){this._style!==t&&(this.style=t,this._evaluationZoom=void 0);const r=t.terrain.properties,o=0===t.terrain.drapeRenderMode,s=t.terrain.isZoomDependent();this._previousUpdateTimestamp=this.enabled?this._updateTimestamp:void 0,this._updateTimestamp=e.o.now();const a=t.terrain&&t.terrain.scope,l=r.get("source"),c=o?this._mockSourceCache:t.getSourceCache(l,a);if(!c)return void e.w(`Couldn't find terrain source "${l}".`);if(this.sourceCache=c,this._attenuationRange=t.terrain.getAttenuationRange(),this._exaggeration=s?this.calculateExaggeration(i):r.get("exaggeration"),!i.projection.requiresDraping&&s&&0===this._exaggeration)return void this._disable();this.enabled=!0;const u=()=>{this.sourceCache.used&&e.w(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source.\nThis leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const t=this.getScaledDemTileSize();this.sourceCache.update(i,t,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,u(),this._initializing=!0),u(),i.updateElevation(!0,n),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(i),this._emptyDEMTextureDirty=!0,this._previousZoom=i.zoom}else this._disable()}calculateExaggeration(t){if(this._attenuationRange&&t.zoom>=Math.ceil(this._attenuationRange[1]))return this._style.terrain.getExaggeration(t.zoom);const i=this._previousCameraAltitude,n=t.getFreeCameraOptions().position.z/t.pixelsPerMeter*t.worldSize;this._previousCameraAltitude=n;const r=null!=i?n-i:Number.MAX_VALUE;if(Math.abs(r)<2)return this._exaggeration;const o=t.zoom,s=this._style.terrain;if(!this._previousUpdateTimestamp)return s.getExaggeration(o);let a=o-this._previousZoom;const l=this._previousUpdateTimestamp;let c=o;null!=this._evaluationZoom&&(c=this._evaluationZoom,Math.abs(o-c)>.5&&(a=.5*(o-c+a)),a*r<0&&(c+=a)),this._evaluationZoom=c;const u=s.getExaggeration(c),h=u===s.getExaggeration(Math.max(0,c-.1));if(h&&Math.abs(u-this._exaggeration)<.01)return u;let d=Math.min(.1,.00375*(this._updateTimestamp-l));
vendor: 18,392 bytes, line 2
2return(h||u<.1||Math.abs(a)<1e-4)&&(d=Math.min(.2,4*d)),e.ak(this._exaggeration,u,d)}resetTileLookupCache(e){this._findCoveringTileCache[e]={}}attenuationRange(){return this._attenuationRange}getDemUpscale(){return this.proxySourceCache.getSource().tileSize/128}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_onStyleDataEvent(e){"source"===e.dataType&&e.coord?this._clearRenderCacheForTile(e.sourceCacheId,e.coord):"style"===e.dataType&&(this.invalidateRenderCache=!0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this._previousCameraAltitude=void 0)}_disable(){if(this.enabled&&(this.enabled=!1,this._emptyDEMTextureDirty=!0,this._sharedDepthStencil=void 0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const e in this._style._mergedSourceCaches)this._style._mergedSourceCaches[e].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this.pool.forEach(e=>e.fb.destroy()),this.pool=[],this.framebufferCopyTexture&&this.framebufferCopyTexture.destroy()}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this.enabled?this._exaggeration:0}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const e=2*this.proxySourceCache.getSource().tileSize;return[e,e]}set useVertexMorphing(e){this._useVertexMorphing=e}updateTileBinding(t){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const i=this.proxySourceCache,n=this.painter.transform;this._initializing&&(this._initializing=0===n._centerAltitude&&-1===this.getAtPointOrZero(e.ae.fromLngLat(n.center),-1),this._emptyDEMTextureDirty=!this._initializing);const r=this.proxyCoords=i.getIds().map(e=>{const t=i.getTileByID(e).tileID;return t.projMatrix=n.calculateProjMatrix(t.toUnwrapped()),t});!function(t,i){const n=i.transform.pointCoordinate(i.transform.getCameraPoint()),r=new e.P(n.x,n.y);t.sort((t,i)=>{if(i.overscaledZ-t.overscaledZ)return i.overscaledZ-t.overscaledZ;const n=new e.P(t.canonical.x+(1<<t.canonical.z)*t.wrap,t.canonical.y),o=new e.P(i.canonical.x+(1<<i.canonical.z)*i.wrap,i.canonical.y),s=r.mult(1<<t.canonical.z);return s.x-=.5,s.y-=.5,s.distSqr(n)-s.distSqr(o)})}(r,this.painter);const o=this.proxyToSource||{};this.proxyToSource={},r.forEach(e=>{this.proxyToSource[e.key]={}}),this.terrainTileForTile={};const s=this._style._mergedSourceCaches;for(const e in s){const i=s[e];if(!i.used)continue;if(i!==this.sourceCache&&this.resetTileLookupCache(i.id),this._setupProxiedCoordsForOrtho(i,t[e],o),i.usedForTerrain)continue;const n=t[e];i.getSource().reparseOverscaled&&this._assignTerrainTiles(n)}this.proxiedCoords[i.id]=r.map(e=>new ho(e,e.key,this.orthoMatrix)),this._assignTerrainTiles(r),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(o),this.renderingToTexture=!1;const a={};this._visibleDemTiles=[];for(const e of this.proxyCoords){const t=this.terrainTileForTile[e.key];if(!t)continue;const i=t.tileID.key;i in a||(this._visibleDemTiles.push(t),a[i]=i)}}_assignTerrainTiles(e){this._initializing||e.forEach(e=>{if(this.terrainTileForTile[e.key])return;const t=this._findTileCoveringTileID(e,this.sourceCache);t&&(this.terrainTileForTile[e.key]=t)})}_prepareDEMTextures(){const e=this.painter.context,t=e.gl;for(const i in this.terrainTileForTile){const n=this.terrainTileForTile[i],r=n.dem;!r||n.demTexture&&!n.needsDEMTextureUpload||(e.activeTexture.set(t.TEXTURE1),pr(this.painter,n,r))}}_prepareDemTileUniforms(e,t,i,n){if(!t||null==t.demTexture)return!1;const r=e.tileID.canonical,o=Math.pow(2,t.tileID.canonical.z-r.z),s=n||"";return i[`u_dem_tl${s}`]=[r.x*o%1,r.y*o%1],i[`u_dem_scale${s}`]=o,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}_getLoadedAreaMinimum(){if(!this.enabled)return 0;let e=0;const t=this._visibleDemTiles.reduce((t,i)=>{if(!i.dem)return t;const n=i.dem.tree.minimums[0];return n>0&&e++,t+n},0);return e?t/e:0}_updateEmptyDEMTexture(){const t=this.painter.context,i=t.gl;t.activeTexture.set(i.TEXTURE2);const n=this._getLoadedAreaMinimum(),r=new e.dL({width:1,height:1},new Float32Array([n]));this._emptyDEMTextureDirty=!1;let o=this._emptyDEMTexture;return o?o.update(r,{premultiply:!1}):o=this._emptyDEMTexture=new e.T(t,r,i.R32F,{premultiply:!1}),o}setupElevationDraw(t,i,n){const r=this.painter.context,o=r.gl,s={u_dem:2,u_dem_prev:4,u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0};s.u_exaggeration=this.exaggeration();let a=null,l=null,c=1;if(n&&n.morphing&&this._useVertexMorphing){const e=n.morphing.srcDemTile,i=n.morphing.dstDemTile;c=n.morphing.phase,e&&i&&(this._prepareDemTileUniforms(t,e,s,"_prev")&&(l=e),this._prepareDemTileUniforms(t,i,s)&&(a=i))}const u=e=>e&&e.demTexture&&this.painter.linearFloatFilteringSupported()?o.LINEAR:o.NEAREST;let h=null;var d;if(this.enabled?l&&a?(h=a.demTexture,r.activeTexture.set(o.TEXTURE4),l.demTexture.bind(u(l),o.CLAMP_TO_EDGE),s.u_dem_lerp=c):(a=this.terrainTileForTile[t.tileID.key],h=this._prepareDemTileUniforms(t,a,s)?a.demTexture:this.emptyDEMTexture):h=this.emptyDEMTexture,r.activeTexture.set(o.TEXTURE2),h&&(s.u_dem_size=1===(d=h).size[0]?1:d.size[0]-2,h.bind(u(a),o.CLAMP_TO_EDGE)),this.painter.setupDepthForOcclusion(n&&n.useDepthForOcclusion,i,s),n&&n.useMeterToDem&&a){const t=(1<<a.tileID.canonical.z)*e.cf(1,this.painter.transform.center.lat)*this.sourceCache.getSource().tileSize;s.u_meter_to_dem=t}if(n&&n.labelPlaneMatrixInv&&(s.u_label_plane_matrix_inv=n.labelPlaneMatrixInv),i.setTerrainUniformValues(r,s),"globe"===this.painter.transform.projection.name){const e=this.globeUniformValues(this.painter.transform,t.tileID.canonical,n&&n.useDenormalizedUpVectorScale);i.setGlobeUniformValues(r,e)}}globeUniformValues(t,i,n){const r=t.projection;return{u_tile_tl_up:r.upVector(i,0,0),u_tile_tr_up:r.upVector(i,e.al,0),u_tile_br_up:r.upVector(i,e.al,e.al),u_tile_bl_up:r.upVector(i,0,e.al),u_tile_up_scale:n?e.dM(1):r.upVectorScale(i,t.center.lat,t.worldSize).metersToTile}}renderToBackBuffer(t){const i=this.painter,n=this.painter.context;0!==t.length&&(n.bindFramebuffer.set(null),n.viewport.set([0,0,i.width,i.height]),i.gpuTimingDeferredRenderStart(),this.renderingToTexture=!1,function(t,i,n,r,o){if("globe"===t.transform.projection.name)!function(t,i,n,r,o){const s=t.context,a=s.gl;let l,c;const u=t.transform,h=e.dE(t,s,u),d=(e,i)=>{if(c===i)return;const n=[no[i],"PROJECTION_GLOBE_VIEW"];h&&n.push("CUSTOM_ANTIALIASING");const r=t.isTileAffectedByFog(e);l=t.getOrCreateProgram("globeRaster",{defines:n,overrideFog:r}),c=i},f=t.colorModeForRenderPass(),p=new Xi(a.LEQUAL,Xi.ReadWrite,t.depthRangeFor3D);io.update(o);const m=e.dF(u),_=[e.aF(u.center.lng),e.aJ(u.center.lat)],g=t.globeSharedBuffers,y=[u.width*e.o.devicePixelRatio,u.height*e.o.devicePixelRatio],v=Float32Array.from(u.globeMatrix),x={useDenormalizedUpVectorScale:!0};{const u=t.transform,h=ro(u.zoom,i.exaggeration(),i.sourceCache._source.tileSize);c=-1;const b=a.TRIANGLES;for(const c of r){const r=n.getTile(c),w=Ki.disabled,T=i.prevTerrainTileForTile[c.key],S=i.terrainTileForTile[c.key];to(T,S)&&io.newMorphing(c.key,T,S,o,250),so(t,r.emissiveTexture),s.activeTexture.set(a.TEXTURE0),r.texture&&r.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE);const E=io.getMorphValuesForProxy(c.key),I=E?1:0;E&&Object.assign(x,{morphing:{srcDemTile:E.from,dstDemTile:E.to,phase:e.dD(E.phase)}});const A=e.dG(c.canonical),M=e.dH(A.getCenter().lat),C=e.dI(c.canonical,A,M,u.worldSize/u._pixelsPerMercatorPixel),P=e.bk(e.dJ(c.canonical)),D="mrt-fallback"===t.emissiveMode?1:0,R=eo(u.expandedFarZProjMatrix,v,m,P,e.aj(u.zoom),_,u.frustumCorners.TL,u.frustumCorners.TR,u.frustumCorners.BR,u.frustumCorners.BL,u.globeCenterInViewSpace,u.globeRadius,y,h,u._farZ,D,C);if(d(c,I),l&&(i.setupElevationDraw(r,l,x),t.uploadCommonUniforms(s,l,c.toUnwrapped()),g)){const[e,i,n]=g.getGridBuffers(M,0!==h);l.draw(t,b,p,w,f,en.backCCW,R,"globe_raster",e,i,n)}}}if(g&&(t.renderDefaultNorthPole||t.renderDefaultSouthPole)){const o=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];h&&o.push("CUSTOM_ANTIALIASING"),l=t.getOrCreateProgram("globeRaster",{defines:o});for(const o of r){const{x:r,y:c,z:h}=o.canonical,d=0===c,m=c===(1<<h)-1,[v,b,w,T]=g.getPoleBuffers(h,!1);if(T&&(d||m)){const c=n.getTile(o);so(t,c.emissiveTexture),s.activeTexture.set(a.TEXTURE0),c.texture&&c.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE);let g=e.dK(h,r,u);const S=e.bk(e.dJ(o.canonical)),E="mrt-fallback"===t.emissiveMode?1:0,I=(e,i)=>e.draw(t,a.TRIANGLES,p,Ki.disabled,f,en.disabled,eo(u.expandedFarZProjMatrix,g,g,S,0,_,u.frustumCorners.TL,u.frustumCorners.TR,u.frustumCorners.BR,u.frustumCorners.BL,u.globeCenterInViewSpace,u.globeRadius,y,0,u._farZ,E),"globe_pole_raster",i,w,T);i.setupElevationDraw(c,l,x),t.uploadCommonUniforms(s,l,o.toUnwrapped()),d&&t.renderDefaultNorthPole&&I(l,v),m&&t.renderDefaultSouthPole&&(g=e.cS(e.bC(),g,[1,-1,1]),I(l,b))}}}}(t,i,n,r,o);else{const s=t.context,a=s.gl;let l,c;const u=t.shadowRenderer,h=gn(t,t.longestCutoffRange),d=e=>{if(c===e)return;const i=[];i.push(no[e]),h.shouldRenderCutoff&&i.push("RENDER_CUTOFF"),u&&(i.push("RENDER_SHADOWS","DEPTH_TEXTURE"),u.useNormalOffset&&i.push("NORMAL_OFFSET")),l=t.getOrCreateProgram("terrainRaster",{defines:i}),c=e},f=t.colorModeForRenderPass(),p=new Xi(a.LEQUAL,Xi.ReadWrite,t.depthRangeFor3D);io.update(o);const m=t.transform,_=ro(m.zoom,i.exaggeration(),i.sourceCache._source.tileSize);let g=[0,0,0];if(u){const e=t.style.directionalLight,i=t.style.ambientLight;e&&i&&(g=Sn(t.style,e,i))}{c=-1;const y=a.TRIANGLES,[v,x]=[i.gridIndexBuffer,i.gridSegments];for(const c of r){const r=n.getTile(c),b=Ki.disabled,w=i.prevTerrainTileForTile[c.key],T=i.terrainTileForTile[c.key];to(w,T)&&io.newMorphing(c.key,w,T,o,250),so(t,r.emissiveTexture),s.activeTexture.set(a.TEXTURE0),r.texture&&r.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE);const S=io.getMorphValuesForProxy(c.key),E=S?1:0;let I;S&&(I={morphing:{srcDemTile:S.from,dstDemTile:S.to,phase:e.dD(S.phase)}});const A="mrt-fallback"===t.emissiveMode?1:0,M=Qr(c.projMatrix,oo(c.canonical,m.renderWorldCopies)?_/10:_,g,A);if(d(E),!l)continue;i.setupElevationDraw(r,l,I);const C=c.toUnwrapped();u&&u.setupShadows(C,l),t.uploadCommonUniforms(s,l,C,null,h),l.draw(t,y,p,b,f,en.backCCW,M,"terrain_raster",i.gridBuffer,v,x)}}}}(i,this,this.proxySourceCache,t,this._updateTimestamp),this.renderingToTexture=!0,i.gpuTimingDeferredRenderEnd(),t.splice(0,t.length))}renderBatch(t){if(0===this._drapedRenderBatches.length)return t+1;this.renderingToTexture=!0;const i=this.painter,n=this.painter.context,r=this.proxySourceCache,o=this.proxiedCoords[r.id],s=this._drapedRenderBatches.shift(),a=i.style.order,l=[];this._updateFBOs("mrt-fallback"===i.emissiveMode);let c=0;for(const u of o){const o=r.getTileByID(u.proxyTileKey),h=r.proxyCachedFBO[u.key]?r.proxyCachedFBO[u.key][t]:void 0,d=void 0!==h?r.renderCache[h]:this.pool[c++],f=void 0!==h;if(o.texture=d.tex,o.emissiveTexture=d.emissiveTex,f&&!d.dirty){l.push(o.tileID);continue}n.bindFramebuffer.set(d.fb.framebuffer);const p=n.gl;let m;p.drawBuffers("mrt-fallback"===i.emissiveMode?[p.COLOR_ATTACHMENT0,p.COLOR_ATTACHMENT1]:[p.COLOR_ATTACHMENT0]),this.renderedToTile=!1,d.dirty&&(n.clear({color:e.ao.transparent,stencil:0}),d.dirty=!1);for(let e=s.start;e<=s.end;++e){const t=i.style._mergedLayers[a[e]];if(t.isHidden(i.transform.zoom))continue;const r=i.style.getLayerSourceCache(t),o=r?this.proxyToSource[u.key][r.id]:[u];if(!o)continue;const s=o;n.viewport.set([0,0,d.fb.width,d.fb.height]),m!==(r?r.id:null)&&(this._setupStencil(d,o,t,r),m=r?r.id:null),i.renderLayer(i,r,t,s)}if(p.drawBuffers([p.COLOR_ATTACHMENT0]),0===this._drapedRenderBatches.length)for(const e of this._pendingGroundEffectLayers){const t=i.style._mergedLayers[a[e]];if(t.isHidden(i.transform.zoom))continue;const r=i.style.getLayerSourceCache(t),o=r?this.proxyToSource[u.key][r.id]:[u];if(!o)continue;const s=o;n.viewport.set([0,0,d.fb.width,d.fb.height]),m!==(r?r.id:null)&&(this._setupStencil(d,o,t,r),m=r?r.id:null),i.renderLayer(i,r,t,s)}this.renderedToTile?(d.dirty=!0,l.push(o.tileID)):f||--c,5===c&&(c=0,this.renderToBackBuffer(l))}return this.renderToBackBuffer(l),this.renderingToTexture=!1,n.bindFramebuffer.set(null),n.viewport.set([0,0,i.width,i.height]),s.end+1}postRender(){}isLayerOrderingCorrect(e){const t=e.order.length;let i=-1,n=t;for(let r=0;r<t;++r)this._style.isLayerDraped(e._mergedLayers[e.order[r]])?i=Math.max(i,r):n=Math.min(n,r);return n>i}getMinElevationBelowMSL(){let e=0;return this._visibleDemTiles.filter(e=>e.dem).forEach(t=>{e=Math.min(e,t.dem.tree.minimums[0])}),0===e?e:(e-30)*this._exaggeration}raycast(e,t,i){if(!this._visibleDemTiles)return null;const n=this._visibleDemTiles.filter(e=>e.dem).map(n=>{const r=n.tileID,o=1<<r.overscaledZ,{x:s,y:a}=r.canonical,l=s/o,c=(s+1)/o,u=a/o,h=(a+1)/o;return{minx:l,miny:u,maxx:c,maxy:h,t:n.dem.tree.raycastRoot(l,u,c,h,e,t,i),tile:n}});n.sort((e,t)=>(null!==e.t?e.t:Number.MAX_VALUE)-(null!==t.t?t.t:Number.MAX_VALUE));for(const r of n){if(null==r.t)return null;const n=r.tile.dem.tree.raycast(r.minx,r.miny,r.maxx,r.maxy,e,t,i);if(null!=n)return n}return null}_createFBO(){const t=this.painter.context,i=t.gl,n=this.drapeBufferSize;t.activeTexture.set(i.TEXTURE0);const r=new e.T(t,{width:n[0],height:n[1],data:null},i.RGBA8);r.bind(i.LINEAR,i.CLAMP_TO_EDGE);const o=t.createFramebuffer(n[0],n[1],1,null);let s;return o.colorAttachment0.set(r.texture),this._emissiveTexture&&(s=new e.T(t,{width:n[0],height:n[1],data:null},i.R8),s.bind(i.LINEAR,i.CLAMP_TO_EDGE),o.createColorAttachment(t,1),o.colorAttachment1.set(s.texture)),o.depthAttachment=new Jr(t,o.framebuffer),void 0===this._sharedDepthStencil?(this._sharedDepthStencil=t.createRenderbuffer(t.gl.DEPTH_STENCIL,n[0],n[1]),this._stencilRef=0,o.depthAttachment.set(this._sharedDepthStencil),t.clear({stencil:0})):o.depthAttachment.set(this._sharedDepthStencil),t.extTextureFilterAnisotropic&&i.texParameterf(i.TEXTURE_2D,t.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.extTextureFilterAnisotropicMax),{fb:o,tex:r,emissiveTex:s,dirty:!1}}_updateFBOs(e){if(this._emissiveTexture!==e){for(const t of this.pool)this._updateFBO(t,e);for(const t of this.proxySourceCache.renderCache)this._updateFBO(t,e);this._emissiveTexture=e}}_updateFBO(t,i){const n=t.fb,r=this.painter.context,o=r.gl,s=this.drapeBufferSize;if(i){const i=new e.T(r,{width:s[0],height:s[1],data:null},o.R8);i.bind(o.LINEAR,o.CLAMP_TO_EDGE),t.emissiveTex=i,n.createColorAttachment(r,1),n.colorAttachment1.set(i.texture)}else t.emissiveTex=void 0,n.removeColorAttachment(r,1);t.dirty=!0}_initFBOPool(){for(;this.pool.length<Math.min(5,this.proxyCoords.length);)this.pool.push(this._createFBO())}_shouldDisableRenderCache(){if(this._debugParams.disableRenderCache)return!0;if(this._style.hasLightTransitions())return!0;for(const e in this._style._mergedSourceCaches)if(this._style._mergedSourceCaches[e].hasTransition())return!0;return this._style.order.some(e=>{const t=this._style._mergedLayers[e],i=t.isHidden(this.painter.transform.zoom);return"hillshade"===t.type||"custom"===t.type?!i&&t.shouldRedrape():!i&&t.hasTransition()})}_clearLineLayersFromRenderCache(){let t=!1;for(const e of this._style.getSources())if(e instanceof ct){t=!0;break}if(!t)return;const i={};for(let t=0;t<this._style.order.length;++t){const n=this._style._mergedLayers[this._style.order[t]],r=this._style.getLayerSourceCache(n);if(!r||i[r.id])continue;if(n.isHidden(this.painter.transform.zoom)||"line"!==n.type)continue;const o=n.widthExpression(),s=n.emissiveStrengthExpression();if(o instanceof e.ad||s instanceof e.ad){i[r.id]=!0;for(const e of this.proxyCoords){const t=this.proxyToSource[e.key][r.id];if(t)for(const e of t)this._clearRenderCacheForTile(r.id,e)}}}}_clearRasterLayersFromRenderCache(){let e=!1;for(const t in this._style._mergedSourceCaches)if(this._style._mergedSourceCaches[t]._source instanceof ut){e=!0;break}if(!e)return;const t={};for(let e=0;e<this._style.order.length;++e){const i=this._style._mergedLayers[this._style.order[e]],n=this._style.getLayerSourceCache(i);if(!n||t[n.id])continue;if(i.isHidden(this.painter.transform.zoom)||"raster"!==i.type)continue;const r=i.paint.get("raster-fade-duration");for(const e of this.proxyCoords){const t=this.proxyToSource[e.key][n.id];if(t)for(const e of t){const t=lo(n.getTile(e),n.findLoadedParent(e,0),n,this.painter.transform,r);(1!==t.opacity||0!==t.mix)&&this._clearRenderCacheForTile(n.id,e)}}}}_setupDrapedRenderBatches(){this._style.updateDrapeFirstLayers();const t=this._style.order,i=t.length;if(0===i)return;const n=[];this._pendingGroundEffectLayers=[];let r,o=0,s=this._style._mergedLayers[t[o]];for(;!this._style.isLayerDraped(s)&&s.isHidden(this.painter.transform.zoom)&&++o<i;)s=this._style._mergedLayers[t[o]];for(;o<i;++o){const e=this._style._mergedLayers[t[o]];e.isHidden(this.painter.transform.zoom)||(this._style.isLayerDraped(e)?void 0===r&&(r=o):("fill-extrusion"===e.type&&this._pendingGroundEffectLayers.push(o),void 0!==r&&(n.push({start:r,end:o-1}),r=void 0)))}if(void 0!==r&&n.push({start:r,end:o-1}),0!==n.length){const t=n[n.length-1];this._pendingGroundEffectLayers.every(e=>e>t.end)||e.w("fill-extrusion with flood lighting and/or ground ambient occlusion should be moved to be on top of all draped layers.")}this._drapedRenderBatches=n}_setupRenderCache(e){const t=this.proxySourceCache;if(this._shouldDisableRenderCache()||this.invalidateRenderCache){if(this.invalidateRenderCache=!1,t.renderCache.length>t.renderCachePool.length){const e=Object.values(t.proxyCachedFBO);t.proxyCachedFBO={};for(let i=0;i<e.length;++i){const n=Object.values(e[i]);t.renderCachePool.push(...n)}}return}this._clearRasterLayersFromRenderCache();const i=this.proxyCoords,n=this._tilesDirty;for(let r=i.length-1;r>=0;r--){const o=i[r];if(t.getTileByID(o.key),void 0!==t.proxyCachedFBO[o.key]){const i=e[o.key],r=this.proxyToSource[o.key];let s=0;for(const e in r){const t=r[e],o=i[e];if(!o||o.length!==t.length||t.some((t,i)=>
vendor: 5,319 bytes, line 2
2t!==o[i]||n[e]&&n[e].hasOwnProperty(t.key))){s=-1;break}++s}for(const e in t.proxyCachedFBO[o.key])t.renderCache[t.proxyCachedFBO[o.key][e]].dirty=s<0||s!==Object.values(i).length}}const r=[...this._drapedRenderBatches];r.sort((e,t)=>t.end-t.start-(e.end-e.start));for(const e of r)for(const n of i){if(t.proxyCachedFBO[n.key])continue;let i=t.renderCachePool.pop();void 0===i&&t.renderCache.length<50&&(i=t.renderCache.length,t.renderCache.push(this._createFBO())),void 0!==i&&(t.proxyCachedFBO[n.key]={},t.proxyCachedFBO[n.key][e.start]=i,t.renderCache[i].dirty=!0)}this._tilesDirty={}}_setupStencil(e,t,i,n){if(!n||!this._sourceTilesOverlap[n.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const r=this.painter.context,o=r.gl;if(t.length<=1)return void(this._overlapStencilType=!1);let s;if(i.isTileClipped())s=t.length,this._overlapStencilMode.test={func:o.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(t[0].overscaledZ>t[t.length-1].overscaledZ))return void(this._overlapStencilType=!1);s=1,this._overlapStencilMode.test={func:o.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+s>255&&(r.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=s,this._overlapStencilMode.ref=this._stencilRef,i.isTileClipped()&&this._renderTileClippingMasks(t,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return"Clip"===this._overlapStencilType||"Mask"===this._overlapStencilType}stencilModeForRTTOverlap(e){return this.renderingToTexture&&this._overlapStencilType?("Clip"===this._overlapStencilType&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[e.key]),this._overlapStencilMode):Ki.disabled}_renderTileClippingMasks(e,t){const i=this.painter,n=this.painter.context,r=n.gl;i._tileClippingMaskIDs={},n.setColorMode(Zi.disabled),n.setDepthMode(Xi.disabled);const o=i.getOrCreateProgram("clippingMask");for(const n of e){const e=i._tileClippingMaskIDs[n.key]=--t;o.draw(i,r.TRIANGLES,Xi.disabled,new Ki({func:r.ALWAYS,mask:0},e,255,r.KEEP,r.KEEP,r.REPLACE),Zi.disabled,en.disabled,ao(n.projMatrix),"$clipping",i.tileExtentBuffer,i.quadTriangleIndexBuffer,i.tileExtentSegments)}}pointCoordinate(t){const i=this.painter.transform;if(t.x<0||t.x>i.width||t.y<0||t.y>i.height)return null;const n=[t.x,t.y,1,1];e.aC(n,n,i.pixelMatrixInverse),e.cK(n,n,1/n[3]),n[0]/=i.worldSize,n[1]/=i.worldSize;const r=i._camera.position,o=e.cf(1,i.center.lat),s=[r[0],r[1],r[2]/o,0],a=e.da([],n.slice(0,3),s);e.aw(a,a);const l=this.raycast(s,a,this._exaggeration);return null!==l&&l?(e.bH(s,s,a,l),s[3]=s[2],s[2]*=o,s):null}_setupProxiedCoordsForOrtho(t,i,n){if(t.getSource()instanceof e.aU)return this._setupProxiedCoordsForImageSource(t,i,n);this._findCoveringTileCache[t.id]=this._findCoveringTileCache[t.id]||{};const r=this.proxiedCoords[t.id]=[],o=this.proxyCoords;for(let e=0;e<o.length;e++){const i=o[e],s=this._findTileCoveringTileID(i,t);if(s){const e=this._createProxiedId(i,s,n[i.key]&&n[i.key][t.id]);r.push(e),this.proxyToSource[i.key][t.id]=[e]}}let s=!1;const a=new Set;for(let e=0;e<i.length;e++){const o=t.getTile(i[e]);if(!o||!o.hasData())continue;const l=this._findTileCoveringTileID(o.tileID,this.proxySourceCache);if(l&&l.tileID.canonical.z!==o.tileID.canonical.z){const e=this.proxyToSource[l.tileID.key][t.id],i=this._createProxiedId(l.tileID,o,n[l.tileID.key]&&n[l.tileID.key][t.id]);e?e.splice(e.length-1,0,i):this.proxyToSource[l.tileID.key][t.id]=[i];const c=this.proxyToSource[l.tileID.key][t.id];a.has(c)||a.add(c),r.push(i),s=!0}}if(this._sourceTilesOverlap[t.id]=s,s&&this._debugParams.sortTilesHiZFirst)for(const e of a)e.sort((e,t)=>t.overscaledZ-e.overscaledZ)}_setupProxiedCoordsForImageSource(t,i,n){if(!t.getSource().loaded())return;const r=this.proxiedCoords[t.id]=[],o=this.proxyCoords,s=t.getSource(),a=s.tileID;if(!a)return;const l=new e.P(a.x,a.y)._div(1<<a.z),c=s.coordinates.map(e.ae.fromLngLat).reduce((e,t)=>(e.min.x=Math.min(e.min.x,t.x-l.x),e.min.y=Math.min(e.min.y,t.y-l.y),e.max.x=Math.max(e.max.x,t.x-l.x),e.max.y=Math.max(e.max.y,t.y-l.y),e),{min:new e.P(Number.MAX_VALUE,Number.MAX_VALUE),max:new e.P(-Number.MAX_VALUE,-Number.MAX_VALUE)}),u=(t,i)=>{const n=t.wrap+t.canonical.x/(1<<t.canonical.z),r=t.canonical.y/(1<<t.canonical.z),o=e.al/(1<<t.canonical.z),s=i.wrap+i.canonical.x/(1<<i.canonical.z),a=i.canonical.y/(1<<i.canonical.z);return n+o<s+c.min.x||n>s+c.max.x||r+o<a+c.min.y||r>a+c.max.y};for(let e=0;e<o.length;e++){const s=o[e];for(let e=0;e<i.length;e++){const o=t.getTile(i[e]);if(!o||!o.hasData())continue;if(u(s,o.tileID))continue;const a=this._createProxiedId(s,o,n[s.key]&&n[s.key][t.id]),l=this.proxyToSource[s.key][t.id];l?l.push(a):this.proxyToSource[s.key][t.id]=[a],r.push(a)}}}_createProxiedId(t,i,n){let r=this.orthoMatrix;if(n){const e=n.find(e=>e.key===i.tileID.key);if(e)return e}if(i.tileID.key!==t.key){const n=t.canonical.z-i.tileID.canonical.z;let o,s,a;r=e.bC();const l=i.tileID.wrap-t.wrap<<t.overscaledZ;n>0?(o=e.al>>n,s=o*((i.tileID.canonical.x<<n)-t.canonical.x+l),a=o*((i.tileID.canonical.y<<n)-t.canonical.y)):(o=e.al<<-n,s=e.al*(i.tileID.canonical.x-(t.canonical.x+l<<-n)),a=e.al*(i.tileID.canonical.y-(t.canonical.y<<-n))),e.ce(r,0,o,0,o,0,1),e.br(r,r,[s,a,0])}return new ho(i.tileID,t.key,r)}_findTileCoveringTileID(t,i){let n=i.getTile(t);if(n&&n.hasData())return n;
2const r=this._findCoveringTileCache[i.id],o=r[t.key];if(n=o?i.getTileByID(o):null,n&&n.hasData()||null===o)return n;let s=n?n.tileID:t,a=s.overscaledZ;const l=i.getSource().minzoom,c=[];if(!o){const r=i.getSource().maxzoom;if(t.canonical.z>=r){const n=t.canonical.z-r;i.getSource().reparseOverscaled?(a=Math.max(t.canonical.z+2,i.transform.tileZoom),s=new e.aQ(a,t.wrap,r,t.canonical.x>>n,t.canonical.y>>n)):0!==n&&(a=r,s=new e.aQ(a,t.wrap,r,t.canonical.x>>n,t.canonical.y>>n))}s.key!==t.key&&(c.push(s.key),n=i.getTile(s))}const u=e=>{c.forEach(t=>{r[t]=e}),c.length=0};for(a-=1;a>=l&&(!n||!n.hasData());a--){n&&u(n.tileID.key);const e=s.calculateScaledKey(a);if(n=i.getTileByID(e),n&&n.hasData())break;const t=r[e];if(null===t)break;void 0===t?c.push(e):n=i.getTileByID(t)}return u(n?n.tileID.key:null),n&&n.hasData()?n:null}findDEMTileFor(e){return this.enabled?this._findTileCoveringTileID(e,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(e,t){let i=this._tilesDirty[e];i||(i=this._tilesDirty[e]={}),i[t.key]=!0}}function po(t,i,n){const r=function(t,i,n){const r=e.bJ(i,t),o=e.bJ(n,[.2126,.7152,.0722]),s=(e,t,i)=>(1-i)*e+i*t,a=s(1-.3*Math.min(o,1),1,Math.min(r+1,1));return s(.92,1,Math.asin(e.aA(i[2],-1,1))/Math.PI+.5)*a}(t,[0,0,1],i),o=[0,0,0];e.c5(o,n.slice(0,3),r);const s=[0,0,0];e.c5(s,i.slice(0,3),t[2]);const a=[0,0,0];return e.d8(a,o,s),e.db(a)}const mo=["fill","fillOutline","fillPattern","line","linePattern","background","backgroundPattern","hillshade","raster"],_o=["stars","rainParticle","snowParticle","fillExtrusion","fillExtrusionGroundEffect","building","buildingBloom","elevatedStructures","model","symbol"];class go{static cacheKey(e,t,i,n){const r=[t];n&&r.push(n.cacheKey);for(const t of i)e.usedDefines.has(t)&&r.push(t);return r.join("/")}constructor(t,i,n,r,o,s){const a=t.gl;this.program=a.createProgram(),this.configuration=r,this.name=i,this.fixedDefines=[...s];const l=`#version 300 es\n${(r?r.defines():[]).concat(s.map(e=>`#define ${e}`)).join("\n")}`,c=[l,sr];for(const e of n.fragmentIncludes)c.push(ir[e]);c.push(n.fragmentSource);const u=c.join("\n"),h=[l,ar];for(const e of n.vertexIncludes)h.push(ir[e]);this.forceManualRenderingForInstanceIDShaders=t.forceManualRenderingForInstanceIDShaders&&n.vertexSource.includes("gl_InstanceID"),this.forceManualRenderingForInstanceIDShaders&&h.push("uniform int u_instanceID;"),h.push(n.vertexSource);let d=h.join("\n");this.forceManualRenderingForInstanceIDShaders&&(d=d.replaceAll("gl_InstanceID","u_instanceID"));const f=a.createShader(a.FRAGMENT_SHADER);if(a.isContextLost())return void(this.failedToCreate=!0);a.shaderSource(f,u),a.compileShader(f),a.attachShader(this.program,f);const p=a.createShader(a.VERTEX_SHADER);a.isContextLost()?this.failedToCreate=!0:(a.shaderSource(p,d),a.compileShader(p),a.attachShader(this.program,p),this.attributes={},a.linkProgram(this.program),a.deleteShader(p),a.deleteShader(f),this.fixedUniforms=o(t),this.fixedUniformsEntries=Object.entries(this.fixedUniforms),this.binderUniforms=r?r.getUniforms(t):[],this.forceManualRenderingForInstanceIDShaders&&(this.instancingUniforms=(t=>({u_instanceID:new e.ch(t)}))(t)),(s.includes("TERRAIN")||i.includes("symbol")||i.includes("circle"))&&(this.terrainUniforms=(t=>({u_dem:new e.ch(t),u_dem_prev:new e.ch(t),u_dem_tl:new e.ck(t),u_dem_scale:new e.cj(t),u_dem_tl_prev:new e.ck(t),u_dem_scale_prev:new e.cj(t),u_dem_size:new e.cj(t),u_dem_lerp:new e.cj(t),u_exaggeration:new e.cj(t),u_depth:new e.ch(t),u_depth_size_inv:new e.ck(t),u_depth_range_unpack:new e.ck(t),u_occluder_half_size:new e.cj(t),u_occlusion_depth_offset:new e.cj(t),u_meter_to_dem:new e.cj(t),u_label_plane_matrix_inv:new e.cl(t)}))(t)),s.includes("GLOBE")&&(this.globeUniforms=(t=>({u_tile_tl_up:new e.ci(t),u_tile_tr_up:new e.ci(t),u_tile_br_up:new e.ci(t),u_tile_bl_up:new e.ci(t),u_tile_up_scale:new e.cj(t)}))(t)),s.includes("FOG")&&(this.fogUniforms=(t=>({u_fog_matrix:new e.cl(t),u_fog_range:new e.ck(t),u_fog_color:new e.d3(t),u_fog_horizon_blend:new e.cj(t),u_fog_vertical_limit:new e.ck(t),u_fog_temporal_offset:new e.cj(t),u_frustum_tl:new e.ci(t),u_frustum_tr:new e.ci(t),u_frustum_br:new e.ci(t),u_frustum_bl:new e.ci(t),u_globe_pos:new e.ci(t),u_globe_radius:new e.cj(t),u_globe_transition:new e.cj(t),u_is_globe:new e.ch(t),u_viewport:new e.ck(t)}))(t)),s.includes("RENDER_CUTOFF")&&(this.cutoffUniforms=(t=>({u_cutoff_params:new e.d3(t)}))(t)),s.includes("LIGHTING_3D_MODE")&&(this.lightsUniforms=(t=>({u_lighting_ambient_color:new e.ci(t),u_lighting_directional_dir:new e.ci(t),u_lighting_directional_color:new e.ci(t),u_ground_radiance:new e.ci(t)}))(t)),s.includes("RENDER_SHADOWS")&&(this.shadowUniforms=(t=>({u_light_matrix_0:new e.cl(t),u_light_matrix_1:new e.cl(t),u_fade_range:new e.ck(t),u_shadow_normal_offset:new e.ci(t),u_shadow_intensity:new e.cj(t),u_shadow_texel_size:new e.cj(t),u_shadow_map_resolution:new e.cj(t),u_shadow_direction:new e.ci(t),u_shadow_bias:new e.ci(t),u_shadowmap_0:new e.ch(t),u_shadowmap_1:new e.ch(t)}))(t)))}getAttributeLocation(e,t){let i=this.attributes[t];return void 0===i&&(i=this.attributes[t]=e.getAttribLocation(this.program,t)),i}setTerrainUniformValues(e,t){if(!this.terrainUniforms)return;const i=this.terrainUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)i[e]&&i[e].set(this.program,e,t[e])}}setGlobeUniformValues(e,t){if(!this.globeUniforms)return;const i=this.globeUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)i[e]&&i[e].set(this.program,e,t[e])}}setFogUniformValues(e,t){if(!this.fogUniforms)return;const i=this.fogUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)i[e].set(this.program,e,t[e])}}setCutoffUniformValues(e,t){if(!this.cutoffUniforms)return;const i=this.cutoffUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)i[e].set(this.program,e,t[e])}}setLightsUniformValues(e,t){if(!this.lightsUniforms)return;const i=this.lightsUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)i[e].set(this.program,e,t[e])}}setShadowUniformValues(e,t){if(this.failedToCreate||!this.shadowUniforms)return;const i=this.shadowUniforms;e.program.set(this.program);for(const e in t)i[e].set(this.program,e,t[e])}_drawDebugWireframe(t,i,n,r,o,s,a,l,c,u){const h=t.options.wireframe;if(!1===h.terrain&&!1===h.layers2D&&!1===h.layers3D)return;const d=t.context;if(!(()=>!(!h.terrain||"terrainRaster"!==this.name&&"globeRaster"!==this.name)||!(!h.layers2D||t._terrain&&t._terrain.renderingToTexture||!mo.includes(this.name))||!(!h.layers3D||!_o.includes(this.name)))())return;const f=d.gl,p=t.wireframeDebugCache.getLinesFromTrianglesBuffer(t.frameCounter,o,d);if(!p)return;
2const m=[...this.fixedDefines,"DEBUG_WIREFRAME"],_=t.getOrCreateProgram(this.name,{config:this.configuration,defines:m});d.program.set(_.program);const g=(e,t,i)=>{if(t[e]&&i[e])for(const n in t[e])i[e][n]&&i[e][n].set(i.program,n,t[e][n].current)};c&&c.setUniforms(_.program,d,_.binderUniforms,a,{zoom:l}),g("fixedUniforms",this,_),g("terrainUniforms",this,_),g("globeUniforms",this,_),g("fogUniforms",this,_),g("lightsUniforms",this,_),g("shadowUniforms",this,_),p.bind(),d.setColorMode(new Zi([f.ONE,f.ONE_MINUS_SRC_ALPHA,f.ZERO,f.ONE],e.ao.transparent,[!0,!0,!0,!1])),d.setDepthMode(new Xi(i.func===f.LESS?f.LEQUAL:i.func,Xi.ReadOnly,i.range)),d.setStencilMode(Ki.disabled);const y=3*s.primitiveLength*2,v=3*s.primitiveOffset*2*2;if(this.forceManualRenderingForInstanceIDShaders){const e=u||1;for(let t=0;t<e;++t)_.instancingUniforms.u_instanceID.set(this.program,"u_instanceID",t),f.drawElements(f.LINES,y,f.UNSIGNED_SHORT,v)}else u&&u>1?f.drawElementsInstanced(f.LINES,y,f.UNSIGNED_SHORT,v,u):f.drawElements(f.LINES,y,f.UNSIGNED_SHORT,v);o.bind(),d.program.set(this.program),d.setDepthMode(i),d.setStencilMode(n),d.setColorMode(r)}checkUniforms(e,t,i){if(this.fixedDefines.includes(t))for(const n of Object.keys(i))if(!i[n].initialized)throw new Error(`Program '${this.name}', from draw '${e}': uniform ${n} not set but required by ${t} being defined`)}draw(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m){const _=e.context,g=_.gl;if(this.failedToCreate)return;_.program.set(this.program),_.setDepthMode(i),_.setStencilMode(n),_.setColorMode(r),_.setCullFace(o);for(const[e,t]of this.fixedUniformsEntries)t.set(this.program,e,s[e]);f&&f.setUniforms(this.program,_,this.binderUniforms,h,{zoom:d});const y={[g.POINTS]:1,[g.LINES]:2,[g.TRIANGLES]:3,[g.LINE_STRIP]:1}[t];this.checkUniforms(a,"RENDER_SHADOWS",this.shadowUniforms);const v=p||[],x=f?f.getPaintVertexBuffers():[],b=t===g.TRIANGLES&&c,w=m&&m>0?1:void 0;for(const o of u.get()){const s=o.vaos||(o.vaos={});if((s[a]||(s[a]=new hr)).bind(_,this,l,x,c,o.vertexOffset,v,w),this.forceManualRenderingForInstanceIDShaders){const e=m||1;for(let i=0;i<e;++i)this.instancingUniforms.u_instanceID.set(this.program,"u_instanceID",i),c?g.drawElements(t,o.primitiveLength*y,g.UNSIGNED_SHORT,o.primitiveOffset*y*2):g.drawArrays(t,o.vertexOffset,o.vertexLength)}else m&&m>1?g.drawElementsInstanced(t,o.primitiveLength*y,g.UNSIGNED_SHORT,o.primitiveOffset*y*2,m):c?g.drawElements(t,o.primitiveLength*y,g.UNSIGNED_SHORT,o.primitiveOffset*y*2):g.drawArrays(t,o.vertexOffset,o.vertexLength);b&&this._drawDebugWireframe(e,i,n,r,c,o,h,d,f,m)}}}function yo(t,i,n=0){const r=Math.pow(2,i.tileID.overscaledZ),o=i.tileSize*Math.pow(2,t.transform.tileZoom)/r,s=o*(i.tileID.canonical.x+i.tileID.wrap*r),a=o*i.tileID.canonical.y;return{u_image:0,u_texsize:i.imageAtlasTexture?i.imageAtlasTexture.size:[0,0],u_tile_units_to_pixels:1/e.ay(i,1,t.transform.tileZoom),u_pixel_coord_upper:[s>>16,a>>16],u_pixel_coord_lower:[65535&s,65535&a],u_pattern_transition:n}}const vo={terrain:0,flat:1},xo=e.bC(),bo=(t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y)=>{const v=i.style.light,x=v.properties.get("position"),b=[x.x,x.y,x.z],w=e.dO();"viewport"===v.properties.get("anchor")&&(e.dP(w,-i.transform.angle),e.dQ(b,b,w));const T=v.properties.get("color").toPremultipliedRenderColor(null),S=i.transform,E={u_matrix:t,u_lightpos:b,u_lightintensity:v.properties.get("intensity"),u_lightcolor:[T.r,T.g,T.b],u_vertical_gradient:+n,u_opacity:r,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:xo,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_height_type:vo[u],u_base_type:vo[h],u_ao:o,u_edge_radius:s,u_width_scale:a,u_flood_light_color:m,u_vertical_scale:_,u_flood_light_intensity:g,u_ground_shadow_factor:y};return"globe"===S.projection.name&&(E.u_tile_id=[l.canonical.x,l.canonical.y,1<<l.canonical.z],E.u_zoom_transition=d,E.u_inv_rot_matrix=p,E.u_merc_center=f,E.u_up_dir=S.projection.upVector(new e.cD(0,0,0),f[0]*e.al,f[1]*e.al),E.u_height_lift=c),E},wo=(e,t,i,n,r,o)=>({u_matrix:e,u_edge_radius:t,u_width_scale:i,u_vertical_scale:n,u_height_type:vo[r],u_base_type:vo[o]}),To=(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g)=>
vendor: 5,241 bytes, line 2
2{const y=bo(e,t,i,n,r,o,s,a,c,u,h,d,f,p,m,_,1,[0,0,0]),v={u_height_factor:-Math.pow(2,a.overscaledZ)/l.tileSize/8};return Object.assign(y,yo(t,l,g),v)},So=(e,t,i)=>({u_matrix:e,u_emissive_strength:t,u_ground_shadow_factor:i}),Eo=(e,t,i,n,r,o=0)=>Object.assign(So(e,t,r),yo(i,n,o)),Io=(e,t,i,n)=>({u_matrix:e,u_world:i,u_emissive_strength:t,u_ground_shadow_factor:n}),Ao=(e,t,i,n,r,o,s=0)=>Object.assign(Eo(e,t,i,n,o,s),{u_world:r}),Mo=(e,t)=>({u_matrix:e,u_ground_shadow_factor:t}),Co=(e,t,i,n,r)=>({u_matrix:e,u_camera_pos:[t[0],t[1],t[2]],u_depth_bias:i,u_height_scale:n,u_reset_depth:r}),Po=(e,t,i,n,r,o,s,a,l)=>({u_matrix:e,u_normal_matrix:t,u_opacity:i,u_faux_facade_ao_intensity:n,u_camera_pos:r,u_tile_to_meter:o,u_facade_emissive_chance:s,u_flood_light_color:a,u_flood_light_intensity:l}),Do=e=>({u_matrix:e}),Ro=e=>({u_matrix:e}),Lo=(t,i,n,r,o,s,a,l)=>{const c=e.al/s.tileSize;return{u_matrix:t,u_inv_rot_matrix:i,u_camera_to_center_distance:n.getCameraToCenterDistance(l),u_extrude_scale:[n.pixelsToGLUnits[0]/c,n.pixelsToGLUnits[1]/c],u_zoom_transition:r,u_tile_id:a,u_merc_center:o}},zo=(e,t,i=1)=>({u_matrix:e,u_color:t,u_overlay:0,u_overlay_scale:i}),Oo=e.bC(),Fo=(t,i,n,r,o,s,a)=>{const l=t.transform,c="globe"===l.projection.name,u=c?e.dR(l.zoom,i.canonical)*l._pixelsPerMercatorPixel:e.ay(n,1,s),h={u_matrix:i.projMatrix,u_extrude_scale:u,u_intensity:a,u_inv_rot_matrix:Oo,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(c){h.u_inv_rot_matrix=r,h.u_merc_center=o,h.u_tile_id=[i.canonical.x,i.canonical.y,1<<i.canonical.z],h.u_zoom_transition=e.aj(l.zoom);const t=o[0]*e.al,n=o[1]*e.al;h.u_up_dir=l.projection.upVector(new e.cD(0,0,0),t,n)}return h};function ko(e,[t,i,n,r],[o,s]){if(o===s)return[0,0,0,0];const a=255*(e-1)/(e*(s-o));return[t*a,i*a,n*a,r*a]}function Bo(e,t,[i,n]){return i===n?0:.5/e+(t-i)*(e-1)/(e*(n-i))}const No=(t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v,x,b)=>({u_matrix:t,u_normalize_matrix:i,u_globe_matrix:n,u_merc_matrix:r,u_grid_matrix:o,u_tl_parent:s,u_scale_parent:u,u_fade_t:h.mix,u_opacity:h.opacity*d.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:d.paint.get("raster-brightness-min"),u_brightness_high:d.paint.get("raster-brightness-max"),u_saturation_factor:e.dT(d.paint.get("raster-saturation")),u_contrast_factor:e.dS(d.paint.get("raster-contrast")),u_spin_weights:Vo(d.paint.get("raster-hue-rotate")),u_perspective_transform:f,u_raster_elevation:p,u_zoom_transition:a,u_merc_center:l,u_cutoff_params:c,u_colorization_mix:ko(e.dU,_,y),u_colorization_offset:Bo(e.dU,g,y),u_color_ramp:m,u_texture_offset:[x/(v+2*x),v/(v+2*x)],u_texture_res:[v+2*x,v+2*x],u_emissive_strength:b});function Vo(e){e*=Math.PI/180;const t=Math.sin(e),i=Math.cos(e);return[(2*i+1)/3,(-Math.sqrt(3)*t-i+1)/3,(Math.sqrt(3)*t-i+1)/3]}const Uo=.05,jo=(e,t,i,n,r,o,s,a,l,c,u,h)=>({u_matrix:e,u_normalize_matrix:t,u_globe_matrix:i,u_merc_matrix:n,u_grid_matrix:r,u_tl_parent:o,u_scale_parent:c,u_fade_t:u.mix,u_opacity:u.opacity,u_image0:0,u_image1:1,u_raster_elevation:h,u_zoom_transition:s,u_merc_center:a,u_cutoff_params:l}),Go=(e,t,i,n,r,o,s,a,l,c)=>({u_particle_texture:e,u_particle_texture_side_len:t,u_tile_offset:i,u_velocity:n,u_color_ramp:o,u_velocity_res:r,u_max_speed:s,u_uv_offset:a,u_data_scale:[255*l[0],255*l[1]],u_data_offset:c,u_particle_pos_scale:1.1,u_particle_pos_offset:[Uo,Uo]}),qo=(e,t,i,n,r,o,s,a,l,c)=>({u_particle_texture:e,u_particle_texture_side_len:t,u_velocity:i,u_velocity_res:n,u_max_speed:r,u_speed_factor:o,u_reset_rate:s,u_rand_seed:Math.random(),u_uv_offset:a,u_data_scale:[255*l[0],255*l[1]],u_data_offset:c,u_particle_pos_scale:1.1,u_particle_pos_offset:[Uo,Uo]}),Ho=e.bC(),$o=(t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v,x,b,w,T,S)=>{const E=o.transform,I={u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:i?i.uSizeT:0,u_size:i?i.uSize:0,u_camera_to_center_distance:E.getCameraToCenterDistance(v),u_rotate_symbol:+n,u_aspect_ratio:E.width/E.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_matrix:s,u_label_plane_matrix:a,u_coord_matrix:l,u_is_text:+u,u_elevation_from_sea:c?1:0,u_pitch_with_map:+r,u_texsize:h,u_texsize_icon:d,u_texture:0,u_texture_icon:1,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Ho,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:Ho,u_up_vector:[0,-1,0],u_color_adj_mat:w,u_icon_transition:T||0,u_gamma_scale:r?o.transform.getCameraToCenterDistance(v)*Math.cos(o.terrain?0:o.transform._pitch):1,u_device_pixel_ratio:e.o.devicePixelRatio,u_is_halo:1,u_scale_factor:S||1,u_ground_shadow_factor:x,u_inv_matrix:e.bl(e.bC(),a),u_normal_scale:b,u_lutTexture:dn};return"globe"===v.name&&(I.u_tile_id=[p.canonical.x,p.canonical.y,1<<p.canonical.z],I.u_zoom_transition=m,I.u_inv_rot_matrix=g,I.u_merc_center=_,I.u_camera_forward=E._camera.forward(),I.u_ecef_origin=e.dV(E.globeMatrix,p.toUnwrapped()),I.u_tile_matrix=Float32Array.from(E.globeMatrix),I.u_up_vector=y),I},Wo=(e,t,i,n)=>({u_matrix:e,u_emissive_strength:t,u_opacity:i,u_color:n}),Zo=(t,i,n,r,o,s,a,l,c)=>Object.assign(function(t,i,n,r,o,s){const{width:a,height:l}=r.imageManager.getPixelSize(i),c=Math.pow(2,s.tileID.overscaledZ
2),u=s.tileSize*Math.pow(2,r.transform.tileZoom)/c,h=u*(s.tileID.canonical.x+s.tileID.wrap*c),d=u*s.tileID.canonical.y;return{u_image:0,u_pattern_tl:n.tl,u_pattern_br:n.br,u_texsize:[a,l],u_pattern_size:n.displaySize,u_pattern_units_to_pixels:o?[r.transform.width,-1*r.transform.height]:[1/e.ay(s,1,r.transform.tileZoom),1/e.ay(s,1,r.transform.tileZoom)],u_pixel_coord_upper:[h>>16,d>>16],u_pixel_coord_lower:[65535&h,65535&d]}}(0,s,a,r,l,c),{u_matrix:t,u_emissive_strength:i,u_opacity:n}),Xo=new Float32Array(e.bA([])),Yo=(t,i,n,r,o,s,a,l,c,u,h,d,f,p=[0,0,0],m,_,g)=>{const y=o.style.light,v=y.properties.get("position"),x=[-v.x,-v.y,v.z],b=e.dO();"viewport"===y.properties.get("anchor")&&(e.dP(b,-o.transform.angle),e.dQ(x,x,b));const w="MASK"===h.alphaMode,T=y.properties.get("color").toNonPremultipliedRenderColor(null),S=f.paint.get("model-ambient-occlusion-intensity"),E=f.paint.get("model-color").constantOr(e.ao.white).toNonPremultipliedRenderColor(null);return E.a=f.paint.get("model-color-mix-intensity").constantOr(0),g&&(E.r=g[0],E.g=g[1],E.b=g[2],E.a=g[3]),_&&(E.r=_.color.r,E.g=_.color.g,E.b=_.color.b,E.a=_.colorMix,d=_.emissionStrength,s*=_.opacity),{u_matrix:t,u_lighting_matrix:i,u_normal_matrix:n,u_node_matrix:r||Xo,u_lightpos:x,u_lightintensity:y.properties.get("intensity"),u_lightcolor:[T.r,T.g,T.b],u_camera_pos:p,u_opacity:s,u_baseTextureIsAlpha:0,u_alphaMask:+w,u_alphaCutoff:h.alphaCutoff,u_baseColorFactor:a.toNonPremultipliedRenderColor(null).toArray01(),u_emissiveFactor:l.toNonPremultipliedRenderColor(null).toArray01(),u_metallicFactor:c,u_roughnessFactor:u,u_baseColorTexture:an,u_metallicRoughnessTexture:ln,u_normalTexture:cn,u_occlusionTexture:un,u_emissionTexture:hn,u_lutTexture:dn,u_color_mix:E.toArray01(),u_aoIntensity:S,u_emissive_strength:d,u_occlusionTextureTransform:m||[0,0,0,0]}},Ko=(e,t=Xo,i=Xo)=>({u_matrix:e,u_instance:t,u_node_matrix:i}),Jo={fillExtrusion:t=>({u_matrix:new e.cl(t),u_lightpos:new e.ci(t),u_lightintensity:new e.cj(t),u_lightcolor:new e.ci(t),u_vertical_gradient:new e.cj(t),u_opacity:new e.cj(t),u_edge_radius:new e.cj(t),u_width_scale:new e.cj(t),u_ao:new e.ck(t),u_height_type:new e.ch(t),u_base_type:new e.ch(t),u_tile_id:new e.ci(t),u_zoom_transition:new e.cj(t),u_inv_rot_matrix:new e.cl(t),u_merc_center:new e.ck(t),u_up_dir:new e.ci(t),u_height_lift:new e.cj(t),u_flood_light_color:new e.ci(t),u_vertical_scale:new e.cj(t),u_flood_light_intensity:new e.cj(t),u_ground_shadow_factor:new e.ci(t)}),fillExtrusionDepth:t=>({u_matrix:new e.cl(t),u_edge_radius:new e.cj(t),u_width_scale:new e.cj(t),u_vertical_scale:new e.cj(t),u_height_type:new e.ch(t),u_base_type:new e.ch(t)}),fillExtrusionPattern:t=>({u_matrix:new e.cl(t),u_lightpos:new e.ci(t),u_lightintensity:new e.cj(t),u_lightcolor:new e.ci(t),u_vertical_gradient:new e.cj(t),u_height_factor:new e.cj(t),u_edge_radius:new e.cj(t),u_width_scale:new e.cj(t),u_ao:new e.ck(t),u_height_type:new e.ch(t),u_base_type:new e.ch(t),u_tile_id:new e.ci(t),u_zoom_transition:new e.cj(t),u_inv_rot_matrix:new e.cl(t),u_merc_center:new e.ck(t),u_up_dir:new e.ci(t),u_height_lift:new e.cj(t),u_image:new e.ch(t),u_texsize:new e.ck(t),u_pixel_coord_upper:new e.ck(t),u_pixel_coord_lower:new e.ck(t),u_tile_units_to_pixels:new e.cj(t),u_opacity:new e.cj(t),u_pattern_transition:new e.cj(t)}),fillExtrusionGroundEffect:t=>({u_matrix:new e.cl(t),u_opacity:new e.cj(t),u_ao_pass:new e.cj(t),u_meter_to_tile:new e.cj(t),u_ao:new e.ck(t),u_flood_light_intensity:new e.cj(t),u_flood_light_color:new e.ci(t),u_attenuation:new e.cj(t),u_edge_radius:new e.cj(t),u_fb:new e.ch(t),u_fb_size:new e.cj(t),u_dynamic_offset:new e.cj(t)}),fill:t=>({u_matrix:new e.cl(t),u_emissive_strength:new e.cj(t),u_ground_shadow_factor:new e.ci(t)}),fillPattern:t=>({u_matrix:new e.cl(t),u_emissive_strength:new e.cj(t),u_image:new e.ch(t),u_texsize:new e.ck(t),u_pixel_coord_upper:new e.ck(t),u_pixel_coord_lower:new e.ck(t),u_tile_units_to_pixels:new e.cj(t),u_ground_shadow_factor:new e.ci(t),u_pattern_transition:new e.cj(t)}),fillOutline:t=>({u_matrix:new e.cl(t),u_emissive_strength:new e.cj(t),u_world:new e.ck(t),u_ground_shadow_factor:new e.ci(t)}),fillOutlinePattern:t=>({u_matrix:new e.cl(t),u_emissive_strength:new e.cj(t),u_world:new e.ck(t),u_image:new e.ch(t),u_texsize:new e.ck(t),u_pixel_coord_upper:new e.ck(t),u_pixel_coord_lower:new e.ck(t),u_tile_units_to_pixels:new e.cj(t),u_ground_shadow_factor:new e.ci(t),u_pattern_transition:new e.cj(t)}),building:t=>({u_matrix:new e.cl(t),u_normal_matrix:new e.cl(t),u_opacity:new e.cj(t),u_faux_facade_ao_intensity:new e.cj(t),u_camera_pos:new e.ci(t),u_tile_to_meter:new e.cj(t),u_facade_emissive_chance:new e.cj(t),u_flood_light_color:new e.ci(t),u_flood_light_intensity:new e.cj(t)}),buildingBloom:t=>({u_matrix:new e.cl(t)}),buildingDepth:t=>({u_matrix:new e.cl(t)}),elevatedStructuresDepth:t=>({u_matrix:new e.cl(t),u_depth_bias:new e.cj(t)}),elevatedStructures:t=>({u_matrix:new e.cl(t),u_ground_shadow_factor:new e.ci(t)}),elevatedStructuresDepthReconstruct:t=>({u_matrix:new e.cl(t),u_camera_pos:new e.ci(t),u_depth_bias:new e.cj(t),u_height_scale:new e.cj(t),u_reset_depth:new e.cj(t)}),circle:e.dY,collisionBox:t=>({u_matrix:new e.cl(t),u_inv_rot_matrix:new e.cl(t),u_camera_to_center_distance:new e.cj(t),u_extrude_scale:new e.ck(t),u_zoom_transition:new e.cj(t),u_merc_center:new e.ck(t),u_tile_id:new e.ci(t)}),collisionCircle:t=>({u_matrix:new e.cl(t),u_inv_matrix:new e.cl(t),u_camera_to_center_distance:new e.cj(t),u_viewport_size:new e.ck(t)}),debug:t=>
vendor: 9,432 bytes, line 2
2({u_color:new e.dB(t),u_matrix:new e.cl(t),u_overlay:new e.ch(t),u_overlay_scale:new e.cj(t)}),clippingMask:t=>({u_matrix:new e.cl(t)}),heatmap:t=>({u_extrude_scale:new e.cj(t),u_intensity:new e.cj(t),u_matrix:new e.cl(t),u_inv_rot_matrix:new e.cl(t),u_merc_center:new e.ck(t),u_tile_id:new e.ci(t),u_zoom_transition:new e.cj(t),u_up_dir:new e.ci(t)}),heatmapTexture:t=>({u_image:new e.ch(t),u_color_ramp:new e.ch(t),u_opacity:new e.cj(t)}),hillshade:t=>({u_matrix:new e.cl(t),u_image:new e.ch(t),u_latrange:new e.ck(t),u_light:new e.ck(t),u_shadow:new e.dB(t),u_highlight:new e.dB(t),u_emissive_strength:new e.cj(t),u_accent:new e.dB(t)}),hillshadePrepare:t=>({u_matrix:new e.cl(t),u_image:new e.ch(t),u_dimension:new e.ck(t),u_zoom:new e.cj(t)}),line:e.dX,linePattern:e.dW,raster:t=>({u_matrix:new e.cl(t),u_normalize_matrix:new e.cl(t),u_globe_matrix:new e.cl(t),u_merc_matrix:new e.cl(t),u_grid_matrix:new e.dC(t),u_tl_parent:new e.ck(t),u_scale_parent:new e.cj(t),u_fade_t:new e.cj(t),u_opacity:new e.cj(t),u_image0:new e.ch(t),u_image1:new e.ch(t),u_brightness_low:new e.cj(t),u_brightness_high:new e.cj(t),u_saturation_factor:new e.cj(t),u_contrast_factor:new e.cj(t),u_spin_weights:new e.ci(t),u_perspective_transform:new e.ck(t),u_raster_elevation:new e.cj(t),u_zoom_transition:new e.cj(t),u_merc_center:new e.ck(t),u_cutoff_params:new e.d3(t),u_colorization_mix:new e.d3(t),u_colorization_offset:new e.cj(t),u_color_ramp:new e.ch(t),u_texture_offset:new e.ck(t),u_texture_res:new e.ck(t),u_emissive_strength:new e.cj(t)}),rasterParticle:t=>({u_matrix:new e.cl(t),u_normalize_matrix:new e.cl(t),u_globe_matrix:new e.cl(t),u_merc_matrix:new e.cl(t),u_grid_matrix:new e.dC(t),u_tl_parent:new e.ck(t),u_scale_parent:new e.cj(t),u_fade_t:new e.cj(t),u_opacity:new e.cj(t),u_image0:new e.ch(t),u_image1:new e.ch(t),u_raster_elevation:new e.cj(t),u_zoom_transition:new e.cj(t),u_merc_center:new e.ck(t),u_cutoff_params:new e.d3(t)}),rasterParticleTexture:t=>({u_texture:new e.ch(t),u_opacity:new e.cj(t)}),rasterParticleDraw:t=>({u_particle_texture:new e.ch(t),u_particle_texture_side_len:new e.cj(t),u_tile_offset:new e.ck(t),u_velocity:new e.ch(t),u_color_ramp:new e.ch(t),u_velocity_res:new e.ck(t),u_max_speed:new e.cj(t),u_uv_offset:new e.ck(t),u_data_scale:new e.ck(t),u_data_offset:new e.cj(t),u_particle_pos_scale:new e.cj(t),u_particle_pos_offset:new e.ck(t)}),rasterParticleUpdate:t=>({u_particle_texture:new e.ch(t),u_particle_texture_side_len:new e.cj(t),u_velocity:new e.ch(t),u_velocity_res:new e.ck(t),u_max_speed:new e.cj(t),u_speed_factor:new e.cj(t),u_reset_rate:new e.cj(t),u_rand_seed:new e.cj(t),u_uv_offset:new e.ck(t),u_data_scale:new e.ck(t),u_data_offset:new e.cj(t),u_particle_pos_scale:new e.cj(t),u_particle_pos_offset:new e.ck(t)}),symbol:t=>({u_is_size_zoom_constant:new e.ch(t),u_is_size_feature_constant:new e.ch(t),u_size_t:new e.cj(t),u_size:new e.cj(t),u_camera_to_center_distance:new e.cj(t),u_rotate_symbol:new e.ch(t),u_aspect_ratio:new e.cj(t),u_fade_change:new e.cj(t),u_matrix:new e.cl(t),u_label_plane_matrix:new e.cl(t),u_coord_matrix:new e.cl(t),u_is_text:new e.ch(t),u_elevation_from_sea:new e.ch(t),u_pitch_with_map:new e.ch(t),u_texsize:new e.ck(t),u_texsize_icon:new e.ck(t),u_texture:new e.ch(t),u_texture_icon:new e.ch(t),u_gamma_scale:new e.cj(t),u_device_pixel_ratio:new e.cj(t),u_tile_id:new e.ci(t),u_zoom_transition:new e.cj(t),u_inv_rot_matrix:new e.cl(t),u_merc_center:new e.ck(t),u_camera_forward:new e.ci(t),u_tile_matrix:new e.cl(t),u_up_vector:new e.ci(t),u_ecef_origin:new e.ci(t),u_is_halo:new e.ch(t),u_icon_transition:new e.cj(t),u_color_adj_mat:new e.cl(t),u_scale_factor:new e.cj(t),u_ground_shadow_factor:new e.ci(t),u_inv_matrix:new e.cl(t),u_normal_scale:new e.cj(t),u_lutTexture:new e.ch(t)}),background:t=>({u_matrix:new e.cl(t),u_emissive_strength:new e.cj(t),u_opacity:new e.cj(t),u_color:new e.dB(t)}),backgroundPattern:t=>({u_matrix:new e.cl(t),u_emissive_strength:new e.cj(t),u_opacity:new e.cj(t),u_image:new e.ch(t),u_pattern_tl:new e.ck(t),u_pattern_br:new e.ck(t),u_texsize:new e.ck(t),u_pattern_size:new e.ck(t),u_pixel_coord_upper:new e.ck(t),u_pixel_coord_lower:new e.ck(t),u_pattern_units_to_pixels:new e.ck(t)}),terrainRaster:t=>({u_matrix:new e.cl(t),u_image0:new e.ch(t),u_image1:new e.ch(t),u_skirt_height:new e.cj(t),u_ground_shadow_factor:new e.ci(t),u_emissive_texture_available:new e.cj(t)}),skybox:t=>({u_matrix:new e.cl(t),u_sun_direction:new e.ci(t),u_cubemap:new e.ch(t),u_opacity:new e.cj(t),u_temporal_offset:new e.cj(t)}),skyboxGradient:t=>({u_matrix:new e.cl(t),u_color_ramp:new e.ch(t),u_center_direction:new e.ci(t),u_radius:new e.cj(t),u_opacity:new e.cj(t),u_temporal_offset:new e.cj(t)}),skyboxCapture:t=>({u_matrix_3f:new e.dC(t),u_sun_direction:new e.ci(t),u_sun_intensity:new e.cj(t),u_color_tint_r:new e.d3(t),u_color_tint_m:new e.d3(t),u_luminance:new e.cj(t)}),globeRaster:t=>({u_proj_matrix:new e.cl(t),u_globe_matrix:new e.cl(t),u_normalize_matrix:new e.cl(t),u_merc_matrix:new e.cl(t),u_zoom_transition:new e.cj(t),u_merc_center:new e.ck(t),u_image0:new e.ch(t),u_image1:new e.ch(t),u_grid_matrix:new e.dC(t),u_skirt_height:new e.cj(t),u_far_z_cutoff:new e.cj(t),u_frustum_tl:new e.ci(t),u_frustum_tr:new e.ci(t),u_frustum_br:new e.ci(t),u_frustum_bl:new e.ci(t),u_globe_pos:new e.ci(t),u_globe_radius:new e.cj(t),u_viewport:new e.ck(t),u_emissive_texture_available:new e.cj(t)}),globeAtmosphere:t=>({u_frustum_tl:new e.ci(t),u_frustum_tr:new e.ci(t),u_frustum_br:new e.ci(t),u_frustum_bl:new e.ci(t),u_horizon:new e.cj(t),u_transition:new e.cj(t),u_fadeout_range:new e.cj(t),u_atmosphere_fog_color:new e.d3(t),u_high_color:new e.d3(t),u_space_color:new e.d3(t),u_temporal_offset:new e.cj(t),u_horizon_angle:new e.cj(t)}),model:t=>({u_matrix:new e.cl(t),u_lighting_matrix:new e.cl(t),u_normal_matrix:new e.cl(t),u_node_matrix:new e.cl(t),u_lightpos:new e.ci(t),u_lightintensity:new e.cj(t),u_lightcolor:new e.ci(t),u_camera_pos:new e.ci(t),u_opacity:new e.cj(t),u_baseColorFactor:new e.d3(t),u_emissiveFactor:new e.d3(t),u_metallicFactor:new e.cj(t),u_roughnessFactor:new e.cj(t),u_baseTextureIsAlpha:new e.ch(t),u_alphaMask:new e.ch(t),u_alphaCutoff:new e.cj(t),u_baseColorTexture:new e.ch(t),u_metallicRoughnessTexture:new e.ch(t),u_normalTexture:new e.ch(t),u_occlusionTexture:new e.ch(t),u_emissionTexture:new e.ch(t),u_lutTexture:new e.ch(t),u_color_mix:new e.d3(t),u_aoIntensity:new e.cj(t),u_emissive_strength:new e.cj(t),u_occlusionTextureTransform:new e.d3(t)}),modelDepth:t=>({u_matrix:new e.cl(t),u_instance:new e.cl(t),u_node_matrix:new e.cl(t)}),groundShadow:t=>({u_matrix:new e.cl(t),u_ground_shadow_factor:new e.ci(t)}),stars:t=>({u_matrix:new e.cl(t),u_up:new e.ci(t),u_right:new e.ci(t),u_intensity_multiplier:new e.cj(t)}),snowParticle:t=>({u_modelview:new e.cl(t),u_projection:new e.cl(t),u_time:new e.cj(t),u_cam_pos:new e.ci(t),u_velocityConeAperture:new e.cj(t),u_velocity:new e.cj(t),u_horizontalOscillationRadius:new e.cj(t),u_horizontalOscillationRate:new e.cj(t),u_boxSize:new e.cj(t),u_billboardSize:new e.cj(t),u_simpleShapeParameters:new e.ck(t),u_screenSize:new e.ck(t),u_thinningCenterPos:new e.ck(t),u_thinningShape:new e.ci(t),u_thinningAffectedRatio:new e.cj(t),u_thinningParticleOffset:new e.cj(t),u_particleColor:new e.d3(t),u_direction:new e.ci(t)}),rainParticle:t=>({u_modelview:new e.cl(t),u_projection:new e.cl(t),u_time:new e.cj(t),u_cam_pos:new e.ci(t),u_texScreen:new e.ch(t),u_velocityConeAperture:new e.cj(t),u_velocity:new e.cj(t),u_boxSize:new e.cj(t),u_rainDropletSize:new e.ck(t),u_distortionStrength:new e.cj(t),u_rainDirection:new e.ci(t),u_color:new e.d3(t),u_screenSize:new e.ck(t),u_thinningCenterPos:new e.ck(t),u_thinningShape:new e.ci(t),u_thinningAffectedRatio:new e.cj(t),u_thinningParticleOffset:new e.cj(t),u_shapeDirectionalPower:new e.cj(t),u_shapeNormalPower:new e.cj(t),u_mode:new e.cj(t)}),vignette:t=>({u_vignetteShape:new e.ci(t),u_vignetteColor:new e.d3(t)}),occlusion:t=>({u_matrix:new e.cl(t),u_anchorPos:new e.ci(t),u_screenSizePx:new e.ck(t),u_occluderSizePx:new e.ck(t),u_color:new e.d3(t)})};class Qo{constructor(e,t,i,n){this.id=Qo.uniqueIdxCounter,Qo.uniqueIdxCounter++,this.context=e;const r=e.gl;this.buffer=r.createBuffer(),this.dynamicDraw=Boolean(i),this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||n||t.destroy()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){this.id=Qo.uniqueIdxCounter,Qo.uniqueIdxCounter++;const t=this.context.gl;this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}Qo.uniqueIdxCounter=0;const es={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class ts{constructor(e,t,i,n,r,o){this.length=t.length,this.attributes=i,this.itemSize=t.bytesPerElement,this.dynamicDraw=n,this.instanceCount=o,this.context=e;const s=e.gl;this.buffer=s.createBuffer(),e.bindVertexBuffer.set(this.buffer),s.bufferData(s.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?s.DYNAMIC_DRAW:s.STATIC_DRAW),this.dynamicDraw||r||t.destroy()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){const t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)}
vendor: 8,241 bytes, line 2
2enableAttributes(e,t){for(let i=0;i<this.attributes.length;i++){const n=t.getAttributeLocation(e,this.attributes[i].name);-1!==n&&e.enableVertexAttribArray(n)}}setVertexAttribPointers(e,t,i){for(let n=0;n<this.attributes.length;n++){const r=this.attributes[n],o=t.getAttributeLocation(e,r.name);-1!==o&&e.vertexAttribPointer(o,r.components,e[es[r.type]],!1,this.itemSize,r.offset+this.itemSize*(i||0))}}setVertexAttribDivisor(e,t,i){for(let n=0;n<this.attributes.length;n++){const r=t.getAttributeLocation(e,this.attributes[n].name);-1!==r&&this.instanceCount&&this.instanceCount>0&&e.vertexAttribDivisor(r,i)}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class is{constructor(e,t,i,n,r){this.context=e,this.width=t,this.height=i;const o=this.framebuffer=e.gl.createFramebuffer();n>0&&(this.colorAttachment0=new Xr(e,o,0)),n>1&&(this.colorAttachment1=new Xr(e,o,1)),r&&(this.depthAttachmentType=r,this.depthAttachment="renderbuffer"===r?new Yr(e,o):new Kr(e,o))}createColorAttachment(e,t){0===t?this.colorAttachment0=new Xr(e,this.framebuffer,0):1===t&&(this.colorAttachment1=new Xr(e,this.framebuffer,1))}removeColorAttachment(e,t){const i=this.context.gl;let n;0===t?(n=this.colorAttachment0.get(),this.colorAttachment0=void 0):1===t&&(n=this.colorAttachment1.get(),this.colorAttachment1=void 0),n&&i.deleteTexture(n)}destroy(){const e=this.context.gl;if(this.colorAttachment0){const t=this.colorAttachment0.get();t&&e.deleteTexture(t)}if(this.colorAttachment1){const t=this.colorAttachment1.get();t&&e.deleteTexture(t)}if(this.depthAttachment&&this.depthAttachmentType)if("renderbuffer"===this.depthAttachmentType){const t=this.depthAttachment.get();t&&e.deleteRenderbuffer(t)}else{const t=this.depthAttachment.get();t&&e.deleteTexture(t)}e.deleteFramebuffer(this.framebuffer)}}class ns{constructor(e,t){this.gl=e,this.clearColor=new gr(this),this.clearDepth=new yr(this),this.clearStencil=new vr(this),this.colorMask=new xr(this),this.depthMask=new br(this),this.stencilMask=new wr(this),this.stencilFunc=new Tr(this),this.stencilOp=new Sr(this),this.stencilTest=new Er(this),this.depthRange=new Ir(this),this.depthTest=new Ar(this),this.depthFunc=new Mr(this),this.blend=new Cr(this),this.blendFunc=new Pr(this),this.blendColor=new Dr(this),this.blendEquation=new Rr(this),this.cullFace=new Lr(this),this.cullFaceSide=new zr(this),this.frontFace=new Or(this),this.program=new Fr(this),this.activeTexture=new kr(this),this.viewport=new Br(this),this.bindFramebuffer=new Nr(this),this.bindRenderbuffer=new Vr(this),this.bindTexture=new Ur(this),this.bindVertexBuffer=new jr(this),this.bindElementBuffer=new Gr(this),this.bindVertexArrayOES=new qr(this),this.pixelStoreUnpack=new Hr(this),this.pixelStoreUnpackPremultiplyAlpha=new $r(this),this.pixelStoreUnpackFlipY=new Wr(this),this.options=t?Object.assign({},t):{},this.options.extTextureFilterAnisotropicForceOff||(this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT))),this.extDebugRendererInfo=e.getExtension("WEBGL_debug_renderer_info"),this.extDebugRendererInfo&&(this.renderer=e.getParameter(this.extDebugRendererInfo.UNMASKED_RENDERER_WEBGL),this.vendor=e.getParameter(this.extDebugRendererInfo.UNMASKED_VENDOR_WEBGL)),this.forceManualRenderingForInstanceIDShaders=t&&!!t.forceManualRenderingForInstanceIDShaders||this.renderer&&-1!==this.renderer.indexOf("PowerVR"),this.options.extTextureFloatLinearForceOff||(this.extTextureFloatLinear=e.getExtension("OES_texture_float_linear")),this.extRenderToTextureHalfFloat=e.getExtension("EXT_color_buffer_half_float"),this.extTimerQuery=e.getExtension("EXT_disjoint_timer_query_webgl2"),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this.extBlendFuncExtended=e.getExtension("WEBGL_blend_func_extended")}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.bindVertexArrayOES.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(e,t,i){return new Qo(this,e,t,i)}createVertexBuffer(e,t,i,n,r){return new ts(this,e,t,i,n,r)}createRenderbuffer(e,t,i){const n=this.gl,r=n.createRenderbuffer();return this.bindRenderbuffer.set(r),n.renderbufferStorage(n.RENDERBUFFER,e,t,i),this.bindRenderbuffer.set(null),r}createFramebuffer(e,t,i,n){return new is(this,e,t,i,n)}clear({color:e,depth:t,stencil:i,colorMask:n}){const r=this.gl;let o=0;e&&(o|=r.COLOR_BUFFER_BIT,this.clearColor.set(e.toNonPremultipliedRenderColor(null)),this.colorMask.set(n||[!0,!0,!0,!0])),void 0!==t&&(o|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(t),this.depthMask.set(!0)),void 0!==i&&(o|=r.STENCIL_BUFFER_BIT,this.clearStencil.set(i),this.stencilMask.set(255)),r.clear(o)}setCullFace(e){!1===e.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(t){e.by(t.blendFunction,Zi.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor),t.blendEquation?this.blendEquation.set(t.blendEquation):this.blendEquation.setDefault()),this.colorMask.set(t.mask)}unbindVAO(){this.bindVertexArrayOES.set(null)}}let rs;function os(t,i,n,r,o,s,a){const l=t.context,c=l.gl,u=t.transform,h=[e.aF(u.center.lng),e.aJ(u.center.lat)],d=n.layout.get("symbol-placement"),f=n.layout.get("text-variable-anchor"),p="map"===n.layout.get("icon-rotation-alignment"),m="map"===n.layout.get("text-rotation-alignment"),_="point"!==d,g=[];let y=0,v=0;for(let l=0;l<r.length;l++){const d=r[l],x=i.getTile(d),b=x.getBucket(n);if(!b)continue;const w=b.getProjection().createInversionMatrix(u,d.canonical),T=[],S=Yt(d,b,u),E=!a&&p&&_,I=a&&m&&_,A=f&&b.hasTextData(),M=b.hasIconTextFit()&&A&&b.hasIconData(),C=E||I||a&&A||M,P="globe"===b.projection.name,D=P?e.aj(u.zoom):0;P&&(T.push("PROJECTION_GLOBE_VIEW"),C&&T.push("PROJECTED_POS_ON_VIEWPORT"));const R=t.getOrCreateProgram("collisionBox",{defines:T});let L=S;0===o[0]&&0===o[1]||(L=t.translatePosMatrix(S,x,o,s));const z=a?b.textCollisionBox:b.iconCollisionBox,O=b.collisionCircleArray;
2if(O.length>0){const t=e.bC(),i=L;e.cP(t,b.placementInvProjMatrix,u.glCoordMatrix),e.cP(t,t,b.placementViewportMatrix),g.push({circleArray:O,circleOffset:v,transform:i,invTransform:t,projection:b.getProjection()}),y+=O.length/4,v=y}if(!z)continue;t.terrain&&t.terrain.setupElevationDraw(x,R);const F=P?[d.canonical.x,d.canonical.y,1<<d.canonical.z]:[0,0,0];R.draw(t,c.LINES,Xi.disabled,Ki.disabled,t.colorModeForRenderPass(),en.disabled,Lo(L,w,u,D,h,x,F,b.getProjection()),n.id,z.layoutVertexBuffer,z.indexBuffer,z.segments,null,u.zoom,null,[z.collisionVertexBuffer,z.collisionVertexBufferExt])}if(!a||!g.length)return;const x=t.getOrCreateProgram("collisionCircle"),b=new e.dZ;b.resize(4*y),b._trim();let w=0;for(const e of g)for(let t=0;t<e.circleArray.length/4;t++){const i=4*t,n=e.circleArray[i+0],r=e.circleArray[i+1],o=e.circleArray[i+2],s=e.circleArray[i+3];b.emplace(w++,n,r,o,s,0),b.emplace(w++,n,r,o,s,1),b.emplace(w++,n,r,o,s,2),b.emplace(w++,n,r,o,s,3)}(!rs||rs.length<2*y)&&(rs=function(t){const i=2*t,n=new e.b0;n.resize(i),n._trim();for(let e=0;e<i;e++){const t=6*e;n.uint16[t+0]=4*e+0,n.uint16[t+1]=4*e+1,n.uint16[t+2]=4*e+2,n.uint16[t+3]=4*e+2,n.uint16[t+4]=4*e+3,n.uint16[t+5]=4*e+0}return n}(y));const T=l.createIndexBuffer(rs,!0),S=l.createVertexBuffer(b,e.d_.members,!0);for(const i of g){const r={u_matrix:i.transform,u_inv_matrix:i.invTransform,u_camera_to_center_distance:(E=u).getCameraToCenterDistance(i.projection),u_viewport_size:[E.width,E.height]};x.draw(t,c.TRIANGLES,Xi.disabled,Ki.disabled,t.colorModeForRenderPass(),en.disabled,r,n.id,S,T,e.bg.simpleSegment(0,2*i.circleOffset,i.circleArray.length,i.circleArray.length/2),null,u.zoom)}var E;S.destroy(),T.destroy()}const ss=e.bC();function as(t){const i=t._camera.getWorldToCamera(t.worldSize,1),n=e.aB([],i,t.globeMatrix);e.bl(n,n);const r=[0,0,0],o=[0,1,0,0];return e.aC(o,o,n),r[0]=o[0],r[1]=o[1],r[2]=o[2],e.aw(r,r),r}function ls({width:t,height:i,anchor:n,textOffset:r,textScale:o},s){const{horizontalAlign:a,verticalAlign:l}=e.c1(n),c=-(a-.5)*t,u=-(l-.5)*i,h=e.c2(n,r);return new e.P((c/o+h[0])*s,(u/o+h[1])*s)}function cs(t,i,n,r,o,s,a,l,c,u){const h=t.text.placedSymbolArray,d=t.text.dynamicLayoutVertexArray,f=t.icon.dynamicLayoutVertexArray,p={},m=t.getProjection(),_=Kt(a,m,o),g=o.elevation,y=m.upVectorScale(a.canonical,o.center.lat,o.worldSize).metersToTile;d.clear();for(let f=0;f<h.length;f++){const v=h.get(f),{tileAnchorX:x,tileAnchorY:b,numGlyphs:w}=v,T=v.hidden||!v.crossTileID||t.allowVerticalPlacement&&!v.placedOrientation?null:r[v.crossTileID];if(T){let r=0,h=0,S=0;const E="road"===t.elevationType;if(g||E){const i=E?t.getElevationFeatureForText(f):null,n=e.bV.getAtTileOffset(a,new e.P(x,b),g,i),[o,s,l]=m.upVector(a.canonical,x,b);r=n*o*y,h=n*s*y,S=n*l*y}let[I,A,M,C]=ai(v.projectedAnchorX+r,v.projectedAnchorY+h,v.projectedAnchorZ+S,n?_:s);const P=li(o.getCameraToCenterDistance(m),C);let D=e.bM(t.textSizeData,c,v)*P/e.bY;n&&(D*=t.tilePixelRatio/l);const R=ls(T,D);n?(({x:I,y:A,z:M}=m.projectTilePoint(x+R.x,b+R.y,a.canonical)),[I,A,M]=ai(I+r,A+h,M+S,s)):(i&&R._rotate(-o.angle),I+=R.x,A+=R.y,M=0);const L=t.allowVerticalPlacement&&v.placedOrientation===e.bL.vertical?Math.PI/2:0;for(let t=0;t<w;t++)e.bO(d,I,A,M,L);u&&v.associatedIconIndex>=0&&(p[v.associatedIconIndex]={x:I,y:A,z:M,angle:L})}else gi(w,d)}if(u){f.clear();const i=t.icon.placedSymbolArray;for(let t=0;t<i.length;t++){const n=i.get(t),{numGlyphs:r}=n,o=p[t];if(n.hidden||!o)gi(r,f);else{const{x:t,y:i,z:n,angle:s}=o;for(let o=0;o<r;o++)e.bO(f,t,i,n,s)}}t.icon.dynamicLayoutVertexBuffer.updateData(f)}t.text.dynamicLayoutVertexBuffer.updateData(d)}function us(t,i,n,r,o,s,a={}){const l=n.paint.get("icon-translate"),c=n.paint.get("text-translate"),u=n.paint.get("icon-translate-anchor"),h=n.paint.get("text-translate-anchor"),d=n.layout.get("icon-rotation-alignment"),f=n.layout.get("text-rotation-alignment"),p=n.layout.get("icon-pitch-alignment"),m=n.layout.get("text-pitch-alignment"),_=n.layout.get("icon-keep-upright"),g=n.layout.get("text-keep-upright"),y=n.paint.get("icon-color-saturation"),v=n.paint.get("icon-color-contrast"),x=n.paint.get("icon-color-brightness-min"),b=n.paint.get("icon-color-brightness-max"),w="sea"===n.layout.get("symbol-elevation-reference"),T="none"===n.layout.get("icon-image-use-theme"),S=t.context,E=S.gl,I=t.transform,A="map"===d,M="map"===f,C="map"===p,P="map"===m,D=void 0!==n.layout.get("symbol-sort-key").constantOr(1);let R=!1;const L=t.depthModeForSublayer(0,Xi.ReadOnly),z=new Xi(t.context.gl.LEQUAL,Xi.ReadOnly,t.depthRangeFor3D),O=[e.aF(I.center.lng),e.aJ(I.center.lat)],F=n.layout.get("text-variable-anchor"),k="globe"===I.projection.name,B=[],N=[0,-1,0];for(const o of r){const r=i.getTile(o),s=r.getBucket(n);if(!s)continue;if("mercator"===s.projection.name&&k)continue;if(s.fullyClipped)continue;const d="globe"===s.projection.name,f=d?e.aj(I.zoom):0,p=Kt(o,s.getProjection(),I),m=I.calculatePixelsToTileUnitsMatrix(r),V=F&&s.hasTextData(),U=s.hasIconTextFit()&&V&&s.hasIconData(),j=s.getProjection().createInversionMatrix(I,o.canonical),G=(1<<r.tileID.canonical.z)*e.al/t.transform.worldSize,q=e=>{let i=[0,0,0];if(e){const e=t.style.directionalLight,n=t.style.ambientLight;e&&n&&(i=Sn(t.style,e,n))}return i},H=e=>{I.depthOcclusionForSymbolsAndCircles&&(n.hasOcclusionOpacityProperties||t.terrain)&&(e.push("DEPTH_D24"),e.push("DEPTH_OCCLUSION"))},$=i=>{n.lut&&!T&&(n.lut.texture||(n.lut.texture=new e.d$(t.context,n.lut.image,[n.lut.image.height,n.lut.image.height,n.lut.image.height],S.gl.RGBA8)),S.activeTexture.set(S.gl.TEXTURE0+dn),n.lut.texture&&n.lut.texture.bind(S.gl.LINEAR,S.gl.CLAMP_TO_EDGE),i.push("APPLY_LUT_ON_GPU"))},W=()=>{const i=A&&"point"!==n.layout.get("symbol-placement"),a=[];H(a),$(a);const c=i||U,h="road"===s.elevationType,g=t.shadowRenderer,T=h&&C&&!!g&&g.enabled,S=q(T),M=h&&C&&!t.terrain?z:L,P=n.paint.get("icon-image-cross-fade");t.terrainRenderModeElevated()&&C&&a.push("PITCH_WITH_MAP_TERRAIN"),d&&(a.push("PROJECTION_GLOBE_VIEW"),c&&a.push("PROJECTED_POS_ON_VIEWPORT")),P>0&&s.hasAnySecondaryIcon&&a.push("ICON_TRANSITION"),!s.icon.zOffsetVertexBuffer||h&&t.terrain||a.push("Z_OFFSET"),0===y&&0===v&&0===x&&1===b||a.push("COLOR_ADJUSTMENT"),s.sdfIcons&&a.push("RENDER_SDF"),T&&a.push("RENDER_SHADOWS","DEPTH_TEXTURE","NORMAL_OFFSET"),h&&C&&!t.terrain&&s.icon.orientationVertexBuffer&&a.push("ELEVATED_ROADS");const D=s.icon.programConfigurations.get(n.id),R=t.getOrCreateProgram("symbol",{c
vendor: 3,943 bytes, line 2
2onfig:D,defines:a}),F=r.imageAtlasTexture?r.imageAtlasTexture.size:[0,0],B=s.iconSizeData,V=e.bK(B,I.zoom),W=C||!I.isOrthographic,Z=ri(p,r.tileID.canonical,C,A,I,s.getProjection(),m),X=si(p,r.tileID.canonical,C,A,I,s.getProjection(),m),Y=t.translatePosMatrix(X,r,l,u,!0),K=t.translatePosMatrix(p,r,l,u),J=c?ss:Z,Q=A&&!C&&!i;let ee=N;!k&&!I.mercatorFromTransition||A||(ee=as(I));const te=d?ee:N,ie=n.getColorAdjustmentMatrix(y,v,x,b),ne=$o(B.kind,V,Q,C,t,K,J,Y,w,!1,F,[0,0],0,o,f,O,j,te,s.getProjection(),S,G,ie,P,null),re=r.imageAtlasTexture?r.imageAtlasTexture:null,oe=1!==n.layout.get("icon-size").constantOr(0)||s.iconsNeedLinear,se=s.sdfIcons||t.options.rotating||t.options.zooming||oe||W?E.LINEAR:E.NEAREST,ae=s.sdfIcons&&0!==n.paint.get("icon-halo-width").constantOr(1),le=t.terrain&&C&&i?e.bl(e.bC(),Z):ss;if(i&&s.icon){const i=e.bV.getAtTileOffsetFunc(o,I.center.lat,I.worldSize,s.getProjection()),a=oi(p,r.tileID.canonical,C,A,I,s.getProjection(),m),l=n.layout.get("icon-size-scale-range"),c=e.aA(t.scaleFactor,l[0],l[1]);ui(s,p,t,!1,a,X,C,_,i,o,c)}return{program:R,buffers:s.icon,uniformValues:ne,atlasTexture:re,atlasTextureIcon:null,atlasInterpolation:se,atlasInterpolationIcon:null,isSDF:s.sdfIcons,hasHalo:ae,depthMode:M,tile:r,renderWithShadows:T,labelPlaneMatrixInv:le}},Z=()=>{const i=M&&"point"!==n.layout.get("symbol-placement"),a=[],l=i||F||U,u="road"===s.elevationType,_=t.shadowRenderer,y=u&&P&&!!_&&_.enabled,v=q(y),x=u&&P&&!t.terrain?z:L;t.terrainRenderModeElevated()&&P&&a.push("PITCH_WITH_MAP_TERRAIN"),d&&(a.push("PROJECTION_GLOBE_VIEW"),l&&a.push("PROJECTED_POS_ON_VIEWPORT")),!s.text.zOffsetVertexBuffer||u&&t.terrain||a.push("Z_OFFSET"),s.iconsInText&&a.push("RENDER_TEXT_AND_SYMBOL"),a.push("RENDER_SDF"),y&&a.push("RENDER_SHADOWS","DEPTH_TEXTURE","NORMAL_OFFSET"),u&&P&&!t.terrain&&s.text.orientationVertexBuffer&&a.push("ELEVATED_ROADS"),H(a);const b=s.text.programConfigurations.get(n.id),T=t.getOrCreateProgram("symbol",{config:b,defines:a});let S,A=[0,0],C=null;const D=s.textSizeData;s.iconsInText&&(A=r.imageAtlasTexture?r.imageAtlasTexture.size:[0,0],C=r.imageAtlasTexture?r.imageAtlasTexture:null,S=P||!I.isOrthographic||t.options.rotating||t.options.zooming||"composite"===D.kind||"camera"===D.kind?E.LINEAR:E.NEAREST);const R=r.glyphAtlasTexture?r.glyphAtlasTexture.size:[0,0],B=n.layout.get("text-size-scale-range"),V=e.aA(t.scaleFactor,B[0],B[1]),$=e.bK(D,I.zoom,V),W=ri(p,r.tileID.canonical,P,M,I,s.getProjection(),m),Z=si(p,r.tileID.canonical,P,M,I,s.getProjection(),m),X=t.translatePosMatrix(Z,r,c,h,!0),Y=t.translatePosMatrix(p,r,c,h),K=l?ss:W,J=M&&!P&&!i;let Q=N;!k&&!I.mercatorFromTransition||M||(Q=as(I));const ee=$o(D.kind,$,J,P,t,Y,K,X,w,!0,R,A,0,o,f,O,j,d?Q:N,s.getProjection(),v,G,null,null,V),te=r.glyphAtlasTexture?r.glyphAtlasTexture:null,ie=E.LINEAR,ne=0!==n.paint.get("text-halo-width").constantOr(1),re=t.terrain&&P&&i?e.bl(e.bC(),W):ss;if(i&&s.text){const i=e.bV.getAtTileOffsetFunc(o,I.center.lat,I.worldSize,s.getProjection()),n=oi(p,r.tileID.canonical,P,M,I,s.getProjection(),m);ui(s,p,t,!0,n,Z,P,g,i,o,V)}return{program:T,buffers:s.text,uniformValues:ee,atlasTexture:te,atlasTextureIcon:C,atlasInterpolation:ie,atlasInterpolationIcon:S,isSDF:!0,hasHalo:ne,depthMode:x,tile:r,renderWithShadows:y,labelPlaneMatrixInv:re}},X=s.icon.segments.get().length,Y=s.text.segments.get().length,K=X&&!a.onlyText?W():null,J=Y&&!a.onlyIcons?Z():null,Q=n.paint.get("icon-opacity").constantOr(1),ee=n.paint.get("text-opacity").constantOr(1);if(D&&s.canOverlap){R=!0;const t=Q&&!a.onlyText?s.icon.segments.get():[],i=ee&&!a.onlyIcons?s.text.segments.get():[];for(const i of t)B.push({segments:new e.bg([i]),sortKey:i.sortKey,state:K});for(const t of i)B.push({segments:new e.bg([t]),sortKey:t.sortKey,state:J})}else a.onlyText||B.push({segments:Q?s.icon.segments:new e.bg([]),sortKey:0,state:K}),a.onlyIcons||B.push({segments:ee?s.text.segments:new e.bg([]),sortKey:0,state:J})}R&&B.sort((e,t)=>
2e.sortKey-t.sortKey);for(const e of B){const i=e.state;if(i)if(t.terrain?t.terrain.setupElevationDraw(i.tile,i.program,{useDepthForOcclusion:I.depthOcclusionForSymbolsAndCircles,labelPlaneMatrixInv:i.labelPlaneMatrixInv}):t.setupDepthForOcclusion(I.depthOcclusionForSymbolsAndCircles,i.program),S.activeTexture.set(E.TEXTURE0),i.atlasTexture&&i.atlasTexture.bind(i.atlasInterpolation,E.CLAMP_TO_EDGE,!0),i.atlasTextureIcon&&(S.activeTexture.set(E.TEXTURE1),i.atlasTextureIcon&&i.atlasTextureIcon.bind(i.atlasInterpolationIcon,E.CLAMP_TO_EDGE,!0)),i.renderWithShadows&&t.shadowRenderer.setupShadows(i.tile.tileID.toUnwrapped(),i.program,"vector-tile"),t.uploadCommonLightUniforms(t.context,i.program),i.hasHalo){const r=i.uniformValues;r.u_is_halo=1,hs(i.buffers,e.segments,n,t,i.program,i.depthMode,o,s,r,2),r.u_is_halo=0}else{if(i.isSDF){const r=i.uniformValues;i.hasHalo&&(r.u_is_halo=1,hs(i.buffers,e.segments,n,t,i.program,i.depthMode,o,s,r,1)),r.u_is_halo=0}hs(i.buffers,e.segments,n,t,i.program,i.depthMode,o,s,i.uniformValues,1)}}}function hs(e,t,i,n,r,o,s,a,l,c){const u=[e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer,e.iconTransitioningVertexBuffer,e.globeExtVertexBuffer,e.zOffsetVertexBuffer,e.orientationVertexBuffer];r.draw(n,n.context.gl.TRIANGLES,o,s,a,en.disabled,l,i.id,e.layoutVertexBuffer,e.indexBuffer,t,i.paint,n.transform.zoom,e.programConfigurations.get(i.id),u,c)}function ds(t,i){const n=1<<t.canonical.z,r=(i.x*n-t.canonical.x-t.wrap*n)*e.al,o=(i.y*n-t.canonical.y)*e.al,s=e.e8(i.z,i.y);return e.d5(r,o,s)}function fs(t,i,n,r,o){if(!n.layout||"none"===n.layout.get("fill-elevation-reference")||0===n.paint.get("fill-opacity").constantOr(1))return;const s=t.context.gl,a=new Xi(t.context.gl.LEQUAL,Xi.ReadWrite,t.depthRangeFor3D),l=new Xi(t.context.gl.GREATER,Xi.ReadWrite,t.depthRangeFor3D),c=function(t){let i=.01;return t.isOrthographic&&(i=e.ak(1e-4,i,e.d0(t.pitch>=mn?1:t.pitch/mn))),2*i}(t.transform),u=t.transform.getFreeCameraOptions().position,h="elevatedStructuresDepthReconstruct",d=t.getOrCreateProgram(h,{defines:["DEPTH_RECONSTRUCTION"]}),f=t.getOrCreateProgram(h);for(const e of r){const r=i.getTile(e),h=r.getBucket(n);if(!h)continue;const p=h.elevatedStructures;if(!p)continue;const m=h.elevationBufferData.heightRange,_=ds(e.toUnwrapped(),u),g=t.translatePosMatrix(e.projMatrix,r,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));let y,v,x,b;if("initialize"===o){if(!m||m.min>=1||0===p.depthSegments.segments[0].primitiveLength)continue;y=Co(g,_,c,1,0),v=a,x=p.depthSegments,b=d}else if("reset"===o){if(!m||m.min>=0||0===p.maskSegments.segments[0].primitiveLength)continue;y=Co(g,_,0,0,1),v=l,x=p.maskSegments,b=d}else if("geometry"===o){if(0===p.depthSegments.segments[0].primitiveLength)continue;y=Co(g,_,c,1,0),v=a,x=p.depthSegments,b=f}b.draw(t,s.TRIANGLES,v,Ki.disabled,Zi.disabled,en.disabled,y,n.id,p.vertexBuffer,p.indexBuffer,x,n.paint,t.transform.zoom)}}function ps(t,i,n,r){const{painter:o,sourceCache:s,layer:a,coords:l,colorMode:c,elevationType:u,terrainEnabled:h,pass:d}=t,f=o.context.gl,p=a.paint.get("fill-pattern"),m=a.paint.get("fill-pattern-cross-fade"),_=p.constantOr(null);let g=u;"road"!==u||i&&!h||(g="none");const y="road"===g,v=t.painter.shadowRenderer,x=y&&!!v&&v.enabled,b=new Xi(o.context.gl.LEQUAL,Xi.ReadOnly,o.depthRangeFor3D);let w=[0,0,0];if(x){const e=o.style.directionalLight,t=o.style.ambientLight;e&&t&&(w=Sn(o.style,e,t))}const T=p&&p.constantOr(1),S=o.terrain&&o.terrain.renderingToTexture,E=(t,d)=>{let p,g,E,I,A;d?(p=T&&!a.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",E=f.LINES):(p=T?"fillPattern":"fill",E=f.TRIANGLES);for(const M of l){const l=s.getTile(M);if(T&&!l.patternsLoaded())continue;const C=l.getBucket(a);if(!C)continue;const P=i?C.elevationBufferData:C.bufferData;if(P.isEmpty())continue;o.prepareDrawTile();const D=P.programConfigurations.get(a.id),R=o.isTileAffectedByFog(M),L=[],z=[];y&&(L.push("ELEVATED_ROADS"),z.push(P.elevatedLayoutVertexBuffer)),x&&L.push("RENDER_SHADOWS","DEPTH_TEXTURE","NORMAL_OFFSET"),S&&n&&L.push("USE_MRT1"),T&&(o.context.activeTexture.set(f.TEXTURE0),l.imageAtlasTexture&&l.imageAtlasTexture.bind(f.LINEAR,f.CLAMP_TO_EDGE),D.updatePaintBuffers());let O=!1;if(_&&l.imageAtlas){const t=l.imageAtlas,i=e.e3.from(_),n=i.getPrimary().scaleSelf(e.o.devicePixelRatio).toString(),r=i.getSecondary(),o=t.patternPositions.get(n),s=r?t.patternPositions.get(r.scaleSelf(e.o.devicePixelRatio).toString()):null;O=!!o&&!!s,o&&D.setConstantPatternPositions(o,s)}m>0&&(O||D.getPatternTransitionVertexBuffer("fill-pattern"))&&L.push("FILL_PATTERN_TRANSITION");const F=o.getOrCreateProgram(p,{config:D,overrideFog:R,defines:L}),k=o.translatePosMatrix(M.projMatrix,l,a.paint.get("fill-translate"),a.paint.get("fill-translate-anchor"));x&&v.setupShadows(l.tileID.toUnwrapped(),F,"vector-tile");const B=a.paint.get("fill-emissive-strength");if(d){I=P.lineIndexBuffer,A=P.lineSegments;const e=o.terrain&&o.terrain.renderingToTexture?o.terrain.drapeBufferSize:[f.drawingBufferWidth,f.drawingBufferHeight];g="fillOutlinePattern"===p&&T?Ao(k,B,o,l,e,w,m):Io(k,B,e,w)}else I=P.indexBuffer,A=P.triangleSegments,g=T?Eo(k,B,o,l,w,m):So(k,B,w);o.uploadCommonUniforms(o.context,F,M.toUnwrapped());let N=t;("road"===u&&!h||"offset"===u)&&(N=b),F.draw(o,E,N,r||o.stencilModeForClipping(M),c,en.disabled,g,a.id,P.layoutVertexBuffer,I,A,a.paint,o.transform.zoom,D,z)}};o.renderPass===d&&E(o.depthModeForSublayer(1,"opaque"===o.renderPass?Xi.ReadWrite:Xi.ReadOnly),!1),"none"===g&&"translucent"===o.renderPass&&a.paint.get("fill-antialias")&&E(o.depthModeForSublayer(a.getPaintProperty("fill-outline-color")?2:0,Xi.ReadOnly),!0)}function ms(t,i,n,r,o,s,a,l){n.resetLayerRenderingStats(t);const c=t.context,u=c.gl,h=t.transform,d=n.paint.get("fill-extrusion-pattern"),f=n.paint.get("fill-extrusion-pattern-cross-fade"),p=d.constantOr(null),m=d.constantOr(1),_=n.paint.get("fill-extrusion-opacity"),g=t.style.enable3dLights(),y=n.paint.get(g&&!m?"fill-extrusion-ambient-occlusion-wall-radius":"fill-extrusion-ambient-occlusion-radius"),v=[n.paint.get("fill-extrusion-ambient-occlusion-intensity"),y],x=n.layout.get("fill-extrusion-edge-radius"),b=x>0&&!n.paint.get("fill-extrusion-rounded-roof"),w=b?0:x,T="globe"===h.projection.name?e.eb():0,S="globe"===h.projection.name,E=S?e.aj(h.zoom):0,I=[e.aF(h.center.lng),e.aJ(h.center.lat)],A="none"===n.paint.get("fill-extrusion-flood-light-color-use-theme").
vendor: 4,173 bytes, line 2
2constantOr("default"),M=n.paint.get("fill-extrusion-flood-light-color").toNonPremultipliedRenderColor(A?null:n.lut).toArray01().slice(0,3),C=n.paint.get("fill-extrusion-flood-light-intensity"),P=n.paint.get("fill-extrusion-vertical-scale"),D=0!==n.paint.get("fill-extrusion-line-width").constantOr(1),R=n.paint.get("fill-extrusion-height-alignment"),L=n.paint.get("fill-extrusion-base-alignment"),z=gn(t,n.paint.get("fill-extrusion-cutoff-fade-range")),O=[];let F;S&&O.push("PROJECTION_GLOBE_VIEW"),v[0]>0&&O.push("FAUX_AO"),b&&O.push("ZERO_ROOF_RADIUS"),l&&O.push("HAS_CENTROID"),C>0&&O.push("FLOOD_LIGHT"),z.shouldRenderCutoff&&O.push("RENDER_CUTOFF"),D&&O.push("RENDER_WALL_MODE");const k="shadow"===t.renderPass,B=t.shadowRenderer,N=k&&!!B,V=k?en.disabled:en.backCCW;t.shadowRenderer&&(t.shadowRenderer.useNormalOffset=!0);let U=[0,0,0];if(B){const e=t.style.directionalLight,i=t.style.ambientLight;e&&i&&(U=Sn(t.style,e,i)),k||(O.push("RENDER_SHADOWS","DEPTH_TEXTURE"),B.useNormalOffset&&O.push("NORMAL_OFFSET")),F=O.concat(["SHADOWS_SINGLE_CASCADE"])}const j=N?"fillExtrusionDepth":m?"fillExtrusionPattern":"fillExtrusion",G=n.getLayerRenderingStats();for(const d of r){const r=i.getTile(d),g=r.getBucket(n);if(!g||g.projection.name!==h.projection.name)continue;let y=!1;B&&(y=0===B.getMaxCascadeForTile(d.toUnwrapped()));const x=t.isTileAffectedByFog(d),b=g.programConfigurations.get(n.id);let A=!1;if(p&&r.imageAtlas){const t=r.imageAtlas,i=e.e3.from(p),n=i.getPrimary().scaleSelf(e.o.devicePixelRatio).toString(),o=i.getSecondary(),s=t.patternPositions.get(n),a=o?t.patternPositions.get(o.scaleSelf(e.o.devicePixelRatio).toString()):null;A=!!s&&!!a,s&&b.setConstantPatternPositions(s,a)}f>0&&(A||b.getPatternTransitionVertexBuffer("fill-extrusion-pattern"))&&O.push("FILL_EXTRUSION_PATTERN_TRANSITION");const N=t.getOrCreateProgram(j,{config:b,defines:y?F:O,overrideFog:x});if(t.terrain&&t.terrain.setupElevationDraw(r,N,{useMeterToDem:!0}),!g.centroidVertexBuffer){const e=N.getAttributeLocation(u,"a_centroid_pos");-1!==e&&u.vertexAttrib2f(e,0,0)}!k&&B&&B.setupShadows(r.tileID.toUnwrapped(),N,"vector-tile"),m&&(t.context.activeTexture.set(u.TEXTURE0),r.imageAtlasTexture&&r.imageAtlasTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),b.updatePaintBuffers());const q=n.paint.get("fill-extrusion-vertical-gradient"),H=1/g.tileToMeter;let $;if(k&&B){if(ws(r.tileID,g.maxHeight,t))continue;const e=B.calculateShadowPassMatrixFromTile(r.tileID.toUnwrapped());$=wo(e,w,H,P,R,L)}else{const e=t.translatePosMatrix(d.expandedProjMatrix,r,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),i=h.projection.createInversionMatrix(h,d.canonical);$=m?To(e,t,q,_,v,w,H,d,r,T,R,L,E,I,i,M,P,f):bo(e,t,q,_,v,w,H,d,T,R,L,E,I,i,M,P,C,U)}t.uploadCommonUniforms(c,N,d.toUnwrapped(),null,z);let W=g.segments;if("mercator"===h.projection.name&&!k&&(W=g.getVisibleSegments(r.tileID,t.terrain,t.transform.getFrustum(0)),!W.get().length))continue;if(G)if(k)for(const e of W.get())G.numRenderedVerticesInShadowPass+=e.primitiveLength;else for(const e of W.get())G.numRenderedVerticesInTransparentPass+=e.primitiveLength;const Z=[];(t.terrain||l)&&Z.push(g.centroidVertexBuffer),S&&Z.push(g.layoutVertexExtBuffer),D&&Z.push(g.wallVertexBuffer),N.draw(t,c.gl.TRIANGLES,o,s,a,V,$,n.id,g.layoutVertexBuffer,g.indexBuffer,W,n.paint,t.transform.zoom,b,Z)}t.shadowRenderer&&(t.shadowRenderer.useNormalOffset=!1)}class _s{constructor(){this.translate=[0,0],this.translateAnchor="map",this.edgeRadius=0,this.cutoffFadeRange=0}}function gs(t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v,x){const b=i.context,w=b.gl,T=i.transform,S=i.transform.zoom,E=[],I=t.translate,A=t.translateAnchor,M=t.edgeRadius,C=gn(i,t.cutoffFadeRange);"clear"===h?(E.push("CLEAR_SUBPASS"),x&&(E.push("CLEAR_FROM_TEXTURE"),b.activeTexture.set(w.TEXTURE0),x.bind(w.LINEAR,w.CLAMP_TO_EDGE))):"sdf"===h?E.push("SDF_SUBPASS"):"emissive"===h&&(E.push("USE_MRT1"),b.activeTexture.set(w.TEXTURE0),x.bind(w.LINEAR,w.CLAMP_TO_EDGE)),y&&E.push("HAS_CENTROID"),C.shouldRenderCutoff&&E.push("RENDER_CUTOFF");const P=(e,t,n,o,h)=>{let v=E;null!=t.groundRadiusBuffer&&(v=E.concat("HAS_ATTRIBUTE_a_flood_light_ground_radiu
2s"));const w=t.programConfigurations.get(r.id),T=i.isTileAffectedByFog(e),I=i.getOrCreateProgram("fillExtrusionGroundEffect",{config:w,defines:v,overrideFog:T}),A=((e,t,i,n,r,o,s,a,l,c,u)=>({u_matrix:t,u_opacity:i,u_ao_pass:n?1:0,u_meter_to_tile:r,u_ao:o,u_flood_light_intensity:s,u_flood_light_color:a,u_attenuation:l,u_edge_radius:c,u_fb:0,u_fb_size:u,u_dynamic_offset:1}))(0,o,d,u,h,[f,p*h],m,_,g,S>=17?0:M*h,x?x.size[0]:0),P=[];y&&P.push(t.hiddenByLandmarkVertexBuffer),null!=t.groundRadiusBuffer&&P.push(t.groundRadiusBuffer),i.uploadCommonUniforms(b,I,e.toUnwrapped(),null,C),I.draw(i,b.gl.TRIANGLES,s,a,l,c,A,r.id,t.vertexBuffer,t.indexBuffer,n,r.paint,S,w,P)};for(const t of o){const o=n.getTile(t),s=o.getBucket(r);if(!s||s.projection.name!==T.projection.name||!s.groundEffect||s.groundEffect&&!s.groundEffect.hasData())continue;const a=s.groundEffect,l=1/s.tileToMeter;{const e=i.translatePosMatrix(t.projMatrix,o,I,A),n=a.getDefaultSegment();P(t,a,n,e,l)}if(v)for(let s=0;s<4;s++){const a=e.e9[s](t),c=n.getTile(a);if(!c)continue;const u=c.getBucket(r);if(!u||u.projection.name!==T.projection.name||!u.groundEffect||u.groundEffect&&!u.groundEffect.hasData())continue;const h=u.groundEffect;let d,f;0===s?(d=[-e.al,0,0],f=1):1===s?(d=[e.al,0,0],f=0):2===s?(d=[0,-e.al,0],f=3):(d=[0,e.al,0],f=2);const p=h.regionSegments[f];if(!p)continue;const m=new Float32Array(16);e.br(m,t.projMatrix,d),P(t,h,p,i.translatePosMatrix(m,o,I,A),l)}}}function ys(t,i,n,r,o,s,a){0===r.centroidVertexArray.length&&r.createCentroidsBuffer();const l=s?s.findDEMTileFor(n):null;if(!(l&&l.dem||a))return;s&&l&&l.dem&&r.selfDEMTileTimestamp!==l.dem._timestamp&&(r.borderDoneWithNeighborZ=[-1,-1,-1,-1],r.selfDEMTileTimestamp=l.dem._timestamp);const c=t=>new e.P(Math.ceil((t+e.ed)*e.ee),0),u=e=>{const t=i.getSource().minzoom,n=e=>{const t=i.getTileByID(e);if(t&&t.hasData())return t.getBucket(o)},r=[0,-1,1];for(const i of r){if(e.overscaledZ+i<t)continue;const r=n(e.calculateScaledKey(e.overscaledZ+i));if(r)return r}},h=[0,0,0],d=(t,i)=>(h[0]=Math.min(t.min.y,i.min.y),h[1]=Math.max(t.max.y,i.max.y),h[2]=e.al-i.min.x>t.max.x?i.min.x-e.al:t.max.x,h),f=(t,i)=>(h[0]=Math.min(t.min.x,i.min.x),h[1]=Math.max(t.max.x,i.max.x),h[2]=e.al-i.min.y>t.max.y?i.min.y-e.al:t.max.y,h),p=[(e,t)=>d(e,t),(e,t)=>d(t,e),(e,t)=>f(e,t),(e,t)=>f(t,e)],m=(t,i,r,o,a,c,u)=>{if(!s)return 0;const h=[[c?r:t,c?t:r,0],[c?r:i,c?i:r,0]],d=u<0?e.al+u:u,f=[c?d:(t+i)/2,c?(t+i)/2:d,0];return 0===r&&u<0||0!==r&&u>0?s.getForTilePoints(a,[f],!0,o):h.push(f),s.getForTilePoints(n,h,!0,l),Math.max(h[0][2],h[1][2],f[2])/s.exaggeration()};for(let t=0;t<4;t++){const i=r.borderFeatureIndices[t];if(0===i.length)continue;const o=e.e9[t](n),l=u(o);if(!(l&&l instanceof e.ea))continue;const h=s?s.findDEMTileFor(o):null;if(!(h&&h.dem||a))continue;if(s&&h&&h.dem&&r.borderDEMTileTimestamp[t]!==h.dem._timestamp&&(r.borderDoneWithNeighborZ[t]=-1,r.borderDEMTileTimestamp[t]=h.dem._timestamp),r.borderDoneWithNeighborZ[t]===l.canonical.z)continue;0===l.centroidVertexArray.length&&l.createCentroidsBuffer();const d=(t<2?1:5)-t,f=l.borderDoneWithNeighborZ[d]!==r.canonical.z,y=l.borderFeatureIndices[d];let v=0;if(r.canonical.z!==l.canonical.z){for(const e of i)r.showCentroid(r.featuresOnBorder[e]);if(f)for(const e of y)l.showCentroid(l.featuresOnBorder[e]);r.borderDoneWithNeighborZ[t]=l.canonical.z,l.borderDoneWithNeighborZ[d]=r.canonical.z}for(const n of i){const i=r.featuresOnBorder[n],s=r.centroidData[i.centroidDataIndex],u=i.borders[t];let f;for(;v<y.length;){f=l.featuresOnBorder[y[v]];const e=f.borders[d];if(e[1]>u[0]+3||e[0]>u[0]-3)break;l.showCentroid(f),v++}if(f&&v<y.length){const n=v;let x=0;for(;!(f.borders[d][0]>u[1]-3)&&(x++,++v!==y.length);)f=l.featuresOnBorder[y[v]];f=l.featuresOnBorder[y[n]];let b=!1;if(x>=1){const e=f.borders[d];Math.abs(u[0]-e[0])<3&&Math.abs(u[1]-e[1])<3&&(x=1,b=!0,v=n+1)}else if(0===x){r.showCentroid(i);continue}const w=l.centroidData[f.centroidDataIndex];a&&b&&(((_=s).flags|(g=w).flags)&e.ec?(_.flags|=e.ec,g.flags|=e.ec):(_.flags&=~e.ec,g.flags&=~e.ec));const T=i.intersectsCount()>1||f.intersectsCount()>1;
2if(x>1)v=n,s.centroidXY=w.centroidXY=new e.P(0,0);else if(h&&h.dem&&!T){const i=p[t](s,w),n=t%2?e.al-1:0,r=m(i[0],Math.min(e.al-1,i[1]),n,h,o,t<2,i[2]);s.centroidXY=w.centroidXY=c(r)}else T?s.centroidXY=w.centroidXY=new e.P(0,0):(s.centroidXY=r.encodeBorderCentroid(i),w.centroidXY=l.encodeBorderCentroid(f));r.writeCentroidToBuffer(s),l.writeCentroidToBuffer(w)}else r.showCentroid(i)}r.borderDoneWithNeighborZ[t]=l.canonical.z,l.borderDoneWithNeighborZ[d]=r.canonical.z}var _,g;(r.needsCentroidUpdate||!r.centroidVertexBuffer&&0!==r.centroidVertexArray.length)&&r.uploadCentroid(t)}const vs=[1,0,0],xs=[0,1,0],bs=[0,0,1];function ws(t,i,n){const r=n.transform,o=n.shadowRenderer;if(!o)return!0;const s=t.toUnwrapped(),a=r.tileSize*o._cascades[n.currentShadowCascade].scale;let l=i;if(r.elevation){const e=r.elevation.getMinMaxForTile(t);e&&(l+=e.max)}const c=[...o.shadowDirection];c[2]=-c[2];const u=o.computeSimplifiedTileShadowVolume(s,l,a,c);if(!u)return!1;const h=[vs,xs,bs,c,[c[0],0,c[2]],[0,c[1],c[2]]],d="globe"===r.projection.name,f=r.scaleZoom(a),p=e.cB.fromInvProjectionMatrix(r.invProjMatrix,r.worldSize,f,!d),m=o.getCurrentCascadeFrustum();return 0===p.intersectsPrecise(u.vertices,u.planes,h)||0===m.intersectsPrecise(u.vertices,u.planes,h)}function Ts(t){const{painter:i,source:n,layer:r,coords:o}=t;let s=t.defines;const a=i.context,l="shadow"===i.renderPass,c="light-beam"===i.renderPass,u=i.shadowRenderer,h=e.ef(i.transform.center.lat,i.transform.zoom),d=gn(i,r.paint.get("building-cutoff-fade-range"));d.shouldRenderCutoff&&(s=s.concat("RENDER_CUTOFF")),t.floodLightIntensity>0&&(s=s.concat("FLOOD_LIGHT"));for(const f of o){const o=n.getTile(f),p=o.getBucket(r);if(!p)continue;u&&0===u.getMaxCascadeForTile(f.toUnwrapped())&&(s=s.concat("SHADOWS_SINGLE_CASCADE"));const m=p.programConfigurations.get(r.id);let _,g,y,v=i.translatePosMatrix(f.expandedProjMatrix,o,[0,0],"map");if(v=e.cS(e.bC(),v,[1,1,t.verticalScale]),l&&u){if(ws(o.tileID,p.maxHeight*h,i))continue;let n=u.calculateShadowPassMatrixFromTile(o.tileID.toUnwrapped());n=e.cS(e.bC(),n,[1,1,t.verticalScale]),y=Ro(n),_=g=i.getOrCreateProgram("buildingDepth",{config:m,defines:s,overrideFog:!1})}else if(c)_=g=i.getOrCreateProgram("buildingBloom",{config:m,defines:s,overrideFog:!1}),y=Do(v);else{const n=i.transform.calculatePosMatrix(f.toUnwrapped(),i.transform.worldSize);e.cS(n,n,[1,1,t.verticalScale]);const r=e.bC();e.cS(r,n,[1,-1,1/h]),e.bl(r,r),e.eg(r,r);const o=i.transform.getFreeCameraOptions().position,a=1<<f.canonical.z;if(y=Po(v,r,t.opacity,t.facadeAOIntensity,[((o.x-f.wrap)*a-f.canonical.x)*e.al,(o.y*a-f.canonical.y)*e.al,o.z*a*e.al],p.tileToMeter,t.facadeEmissiveChance,t.floodLightColor,t.floodLightIntensity),g=i.getOrCreateProgram("building",{config:m,defines:s,overrideFog:!1}),!0===t.depthOnly)_=g;else{const e=s.concat(["BUILDING_FAUX_FACADE","HAS_ATTRIBUTE_a_faux_facade_color_emissive"]);_=i.getOrCreateProgram("building",{config:m,defines:e,overrideFog:!1})}u&&(u.setupShadowsFromMatrix(n,g,!0),_!==g&&u.setupShadowsFromMatrix(n,_,!0))}const x=(e,n)=>{if(c){const o=e.entranceBloom;n.draw(i,a.gl.TRIANGLES,t.depthMode,Ki.disabled,t.blendMode,en.disabled,y,r.id,o.layoutVertexBuffer,o.indexBuffer,o.segmentsBucket,r.paint,i.transform.zoom,m,[o.layoutAttenuationBuffer,o.layoutColorBuffer])}else{const o=e.segmentsBucket;let s=[e.layoutNormalBuffer,e.layoutCentroidBuffer,e.layoutColorBuffer,e.layoutFloodLightDataBuffer];e.layoutFacadePaintBuffer&&(s=s.concat([e.layoutFacadeDataBuffer,e.layoutFacadeVerticalRangeBuffer,e.layoutFacadePaintBuffer])),n.draw(i,a.gl.TRIANGLES,t.depthMode,Ki.disabled,t.blendMode,l?en.disabled:en.backCW,y,r.id,e.layoutVertexBuffer,e.indexBuffer,o,r.paint,i.transform.zoom,m,s)}};i.uploadCommonUniforms(a,g,f.toUnwrapped(),null,d),p.buildingWithoutFacade&&x(p.buildingWithoutFacade,g),p.buildingWithFacade&&(_!==g&&i.uploadCommonUniforms(a,_,f.toUnwrapped(),null,d),x(p.buildingWithFacade,_))}}function Ss(t,i,n,r,o,s,a,l,c,u,h,d,f){const p=t.context.gl,m=t.depthModeForSublayer(1,Xi.ReadOnly,p.LEQUAL,!0),_=.1*(1-(g=h))+3*g;var g;const y=t._showOverdrawInspector,v=d,x=new _s;y||gs(x,t,i,n,r,m,new Ki({func:p.ALWAYS,mask:255},255,255,p.KEEP,p.KEEP,p.REPLACE),new Zi([p.ONE,p.ONE,p.ONE,p.ONE],e.ao.transparent,[!1,!1,!1,!0],p.MIN),en.disabled,o,"sdf",s,a,l,c,u,_,v,!1);{const h=y?Ki.disabled:new Ki({func:p.EQUAL,mask:255},255,255,p.KEEP,p.DECR,p.DECR),d=y?t.colorModeForRenderPass():new Zi([p.ONE_MINUS_DST_ALPHA,p.DST_ALPHA,p.ONE,p.ONE],e.ao.transparent,[!0,!0,!0,!0]);gs(x,t,i,n,r,m,h,d,en.disabled,o,"color",s,a,l,c,u,_,v,!1)}}function Es(t){return[t[0]*e.eh,t[1]*e.eh,t[2]*e.eh,0]}function Is(t,i,n,r,o,s,a,l,c){const u=r.getSource(),h=n.globeSharedBuffers;if(!h)return;let d,f,p;if(i&&(d=r.getTile(i)),u instanceof e.aU?(f=u.texture,p=e.dK(0,0,n.transform)):d&&i&&(f=d.texture,p=e.dK(i.canonical.z,i.canonical.x,n.transform)),!f||!p)return;t||(p=e.cS(e.bC(),p,[1,-1,1]));const m=n.context,_=m.gl,g="nearest"===o.paint.get("raster-resampling")?_.NEAREST:_.LINEAR,y=n.colorModeForDrapableLayerRenderPass(s),v=a.defines;v.push("GLOBE_POLES");const x=new Xi(_.LEQUAL,Xi.ReadWrite,n.depthRangeFor3D),b=Float32Array.from(n.transform.expandedFarZProjMatrix),w=Float32Array.from(e.bk(e.dJ(new e.cD(0,0,0))));n.terrain&&n.terrain.prepareDrawTile(),m.activeTexture.set(_.TEXTURE0),f.bind(g,_.CLAMP_TO_EDGE),m.activeTexture.set(_.TEXTURE1),f.bind(g,_.CLAMP_TO_EDGE),"useMipmap"in f&&m.extTextureFilterAnisotropic&&n.transform.pitch>20&&_.texParameterf(_.TEXTURE_2D,m.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,m.extTextureFilterAnisotropicMax);const[T,S,E,I]=i?h.getPoleBuffers(i.canonical.z,!1):h.getPoleBuffers(0,!0),A=o.paint.get("raster-elevation");let M;t?(M=T,n.renderDefaultNorthPole=0!==A):(M=S,n.renderDefaultSouthPole=0!==A);const C=Es(a.mix),P=((e,t,i,n,r,o,s,a,l,c,u,h,d)=>No(e,t,i,new Float32Array(16),new Float32Array(9),[0,0],n,[0,0],[0,0,0,0],1,{opacity:1,mix:0},o,[0,0]||0,a,2,c,u,h,1,0,d))(b,w,p,e.aj(n.transform.zoom),0,o,0,A,0,C,a.offset,a.range,s),D=n.getOrCreateProgram("raster",{defines:v});n.uploadCommonUniforms(m,D,null),D.draw(n,_.TRIANGLES,x,c,y,l,P,o.id,M,E,I)}function As(e){const t=e._nearZ,i=e.projection.farthestPixelDistance(e),n=i-t,r=.2*e.height,o=t+r;return[t,i,(o-r-t)/n,(o-t)/n]}function Ms(e,t,i,n){if(e)return t instanceof dt&&e instanceof Dt?t.getTextureDescriptor(e,i,!0):{texture:e.texture,mix:Es(n.mix),offset:n.offset,buffer:0,tileSize:1}}var Cs=e.ei([{name:"a_index",type:"Int16",components:1}]);class Ps{constructor(t,i,n,r){const o={width:n[0],height:n[1],data:null},s=t.gl;this.targetColorTexture=new e.T(t,o,s.RGBA8,{useMipmap:!1}),this.backgroundColorTexture=new e.T(t,o,s.RGBA8,{useMipmap:!1}),this.context=t,this.updateParticleTexture(i,r),this.lastInvalidatedAt=0}updateParticleTexture(t,i){if(this.particleTextureDimension===i.width)return;(this.particleTexture0||this.particleTexture1||this.particleIndexBuffer||this.particleSegment)&&(this.particleTexture0.destroy(),this.particleTexture1.destroy(),this.particleIndexBuffer.destroy(),this.particleSegment.destroy());const n=this.context.gl,r=i.width*i.height;this.particleTexture0=new e.T(this.context,i,n.RGBA8,{premultiply:!1,useMipmap:!1}),this.particleTexture1=new e.T(this.context,i,n.RGBA8,{premultiply:!1,useMipmap:!1});const o=new e.ej;o.reserve(r);for(let e=0;e<r;e++)o.emplaceBack(e);this.particleIndexBuffer=this.context.createVertexBuffer(o,Cs.members,!0),this.particleSegment=e.bg.simpleSegment(0,0,this.particleIndexBuffer.length,0),this.particleTextureDimension=i.width}update(t){return!(this.lastInvalidatedAt<t&&(this.lastInvalidatedAt=e.o.now(),1))}destroy(){this.targetColorTexture.destroy(),this.backgroundColorTexture.destroy(),this.particleIndexBuffer.destroy(),this.particleTexture0.destroy(),this.particleTexture1.destroy(),this.particleSegment.destroy()}}function Ds(t,i,n){if(!t)return null;const r=i.getTextureDescriptor(t,n,!0);if(!r)return null;let{texture:o,mix:s,offset:a,tileSize:l,buffer:c,format:u}=r;if(!o||!u)return null;let h=!1;return"uint32"===u&&(h=!0,s[3]=0,s=ko(e.ek,s,[0,n.paint.get("raster-particle-max-speed")]),a=Bo(e.ek,a,[0,n.paint.get("raster-particle-max-speed")])),{texture:o,textureOffset:[c/(l+2*c),l/(l+2*c)],tileSize:l,scalarData:h,scale:s,offset:a,defines:["RASTER_ARRAY",{uint8:"DATA_FORMAT_UINT8",uint16:"DATA_FORMAT_UINT16",uint32:"DATA_FORMAT_UINT32"}[u]]}}function Rs(e){const t=e._nearZ,i=e.projection.farthestPixelDistance(e),n=i-t,r=.2*e.height,o=t+r;return[t,i,(o-r-t)/n,(o-t)/n]}const Ls=new e.ao(1,0,0,1),zs=new e.ao(0,1,0,1),Os=new e.ao(0,0,1,1),Fs=new e.ao(1,0,1,1),ks=new e.ao(0,1,1,1);function Bs(t,i,n,r,o,s){for(let a=0;a<n.length;a++)if(o){const o=1,l=.8,c=new e.ao(r.r*l,r.g*l,r.b*l,1);Ns(t,i,n[a],r,-o,-o,s),Ns(t,i,n[a],r,-o,o,s),Ns(t,i,n[a],r,o,o,s),Ns(t,i,n[a],r,o,-o,s),Ns(t,i,n[a],c,0,0,s)}else Ns(t,i,n[a],r,0,0,s)}function Ns(t,i,n,r,o,s,a){const l=t.context,c=t.transform,u=l.gl,h="globe"===c.projection.name,d=h?["PROJECTION_GLOBE_VIEW"]:[];let f=e.bz(n.projMatrix);if(h&&e.aj(c.zoom)>0){const t=e.bj(n.canonical,c),i=e.el(t);f=e.aB(new Float32Array(16),c.globeMatrix,i),e.aB(f,c.projMatrix,f)}const p=e.bC();p[12]+=2*o/(e.o.devicePixelRatio*c.width),p[13]+=2*s/(e.o.devicePixelRatio*c.height),e.aB(f,p,f);const m=t.getOrCreateProgram("debug",{defines:d}),_=i.getTileByID(n.key);t.terrain&&t.terrain.setupElevationDraw(_,m);const g=Xi.disabled,y=Ki.disabled,v=t.colorModeForRenderPass(),x="$debug";l.activeTexture.set(u.TEXTURE0),t.emptyTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),h?_._makeGlobeTileDebugBuffers(t.context,c):_._makeDebugTileBoundsBuffers(t.context,c.projection);const b=_._tileDebugBuffer||t.debugBuffer,w=_._tileDebugIndexBuffer||t.debugIndexBuffer,T=_._tileDebugSegments||t.debugSegments;if(m.draw(t,u.LINE_STRIP,g,y,v,en.disabled,zo(f,r.toPremultipliedRenderColor(null)),x,b,w,T,
vendor: 7,720 bytes, line 2
2null,null,null,[_._globeTileDebugBorderBuffer]),a){const e=_.latestRawTileData,i=Math.floor((e&&e.byteLength||0)/1024);let r=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(r+=` => ${n.overscaledZ}`),r+=` ${_.state}`,r+=` ${i}kb`,function(e,t){e.initDebugOverlayCanvas();const i=e.debugOverlayCanvas,n=e.context.gl,r=e.debugOverlayCanvas.getContext("2d");r.clearRect(0,0,i.width,i.height),r.shadowColor="white",r.shadowBlur=2,r.lineWidth=1.5,r.strokeStyle="white",r.textBaseline="top",r.font="bold 36px Open Sans, sans-serif",r.fillText(t,5,5),r.strokeText(t,5,5),e.debugOverlayTexture.update(i),e.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(t,r)}const S=i.getTile(n).tileSize,E=512/Math.min(S,512)*(n.overscaledZ/c.zoom)*.5,I=_._tileDebugTextBuffer||t.debugBuffer,A=_._tileDebugTextIndexBuffer||t.quadTriangleIndexBuffer,M=_._tileDebugTextSegments||t.debugSegments;m.draw(t,u.TRIANGLES,g,y,Zi.alphaBlended,en.disabled,zo(f,e.ao.transparent.toPremultipliedRenderColor(null),E),x,I,A,M,null,null,null,[_._globeTileDebugTextBuffer])}function Vs(e,t,i,n){js(e,0,t+i/2,e.transform.width,i,n)}function Us(e,t,i,n){js(e,t-i/2,0,i,e.transform.height,n)}function js(t,i,n,r,o,s){const a=t.context,l=a.gl;l.enable(l.SCISSOR_TEST),l.scissor(i*e.o.devicePixelRatio,n*e.o.devicePixelRatio,r*e.o.devicePixelRatio,o*e.o.devicePixelRatio),a.clear({color:s}),l.disable(l.SCISSOR_TEST)}const Gs=e.ei([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:qs}=Gs;function Hs(e,t,i,n){e.emplaceBack(t,i,n)}class $s{constructor(t){this.vertexArray=new e.em,this.indices=new e.b0,Hs(this.vertexArray,-1,-1,1),Hs(this.vertexArray,1,-1,1),Hs(this.vertexArray,-1,1,1),Hs(this.vertexArray,1,1,1),Hs(this.vertexArray,-1,-1,-1),Hs(this.vertexArray,1,-1,-1),Hs(this.vertexArray,-1,1,-1),Hs(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=t.createVertexBuffer(this.vertexArray,qs),this.indexBuffer=t.createIndexBuffer(this.indices),this.segment=e.bg.simpleSegment(0,0,36,12)}}function Ws(t,i,n,r,o,s){const a=t.context.gl,l=i.paint.get("sky-atmosphere-color"),c=i.paint.get("sky-atmosphere-halo-color"),u=i.paint.get("sky-atmosphere-sun-intensity"),h=((e,t,i,n,r)=>({u_matrix_3f:e,u_sun_direction:t,u_sun_intensity:i,u_color_tint_r:[n.r,n.g,n.b,n.a],u_color_tint_m:[r.r,r.g,r.b,r.a],u_luminance:5e-5}))(e.eo(e.dO(),r),o,u,l.toPremultipliedRenderColor(null),c.toPremultipliedRenderColor(null));a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+s,i.skyboxTexture,0),n.draw(t,a.TRIANGLES,Xi.disabled,Ki.disabled,Zi.unblended,en.frontCW,h,"skyboxCapture",i.skyboxGeometry.vertexBuffer,i.skyboxGeometry.indexBuffer,i.skyboxGeometry.segment)}const Zs=e.ei([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class Xs{constructor(t){const i=new e.ep;i.emplaceBack(-1,1,1,0,0),i.emplaceBack(1,1,1,1,0),i.emplaceBack(1,-1,1,1,1),i.emplaceBack(-1,-1,1,0,1);const n=new e.b0;n.emplaceBack(0,1,2),n.emplaceBack(2,3,0),this.vertexBuffer=t.createVertexBuffer(i,Zs.members),this.indexBuffer=t.createIndexBuffer(n),this.segments=e.bg.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const Ys=e.ei([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_size_scale",components:1},{type:"Float32",name:"a_fade_opacity",components:1}]);class Ks{constructor(){this.starsCount=16e3,this.sizeMultiplier=.15,this.sizeRange=100,this.intensityRange=200}}class Js{constructor(t){this.colorModeAlphaBlendedWriteRGB=new Zi([1,Wi,1,Wi],e.ao.transparent,[!0,!0,!0,!1]),this.colorModeWriteAlpha=new Zi([1,0,1,0],e.ao.transparent,[!1,!1,!1,!0]),this.params=new Ks,this.updateNeeded=!0}update(t){const i=t.context;if(!this.atmosphereBuffer||this.updateNeeded){this.updateNeeded=!1,this.atmosphereBuffer=new Xs(i);const t=this.params.sizeRange,n=this.params.intensityRange,r=function(t){const i=e.eq(30),n=[];for(let r=0;r<t;++r){const t=2*Math.PI*i(),r=Math.acos(1-2*i())-.5*Math.PI;n.push(e.d5(Math.cos(r)*Math.cos(t),Math.cos(r)*Math.sin(t),Math.sin(r)))}return n}(this.params.starsCount),o=e.eq(300),s=new e.er,a=new e.b0;let l=0;for(let i=0;i<r.length;++i){const c=e.c5([],r[i],200),u=Math.max(0,1+.01*t*(1*o()-.5)),h=Math.max(0,1+.01*n*(1*o()-.5));s.emplaceBack(c[0],c[1],c[2],-1,-1,u,h),s.emplaceBack(c[0],c[1],c[2],1,-1,u,h),s.emplaceBack(c[0],c[1],c[2],1,1,u,h),s.emplaceBack(c[0],c[1],c[2],-1,1,u,h),a.emplaceBack(l+0,l+1,l+2),a.emplaceBack(l+0,l+2,l+3),l+=4}this.starsVx=i.createVertexBuffer(s,Ys.members),this.starsIdx=i.createIndexBuffer(a),this.starsSegments=e.bg.simpleSegment(0,0,s.length,a.length)}}destroy(){this.atmosphereBuffer&&this.atmosphereBuffer.destroy(),this.starsVx&&this.starsVx.destroy(),this.starsIdx&&this.starsIdx.destroy()}drawAtmosphereGlow(t,i){const n=t.context,r=n.gl,o=t.transform,s=new Xi(r.LEQUAL,Xi.ReadOnly,[0,1]),a=e.aj(o.zoom),l=t.style.getLut(i.scope),c="none"===i.properties.get("color-use-theme"),u=i.properties.get("color").toNonPremultipliedRenderColor(c?null:l),h="none"===i.properties.get("high-color-use-theme"),d=i.properties.get("high-color").toNonPremultipliedRenderColor(h?null:l),f="none"===i.properties.get("space-color-use-theme"),p=i.properties.get("space-color").toNonPremultipliedRenderColor(f?null:l),m=5e-4,_=e.es(i.properties.get("horizon-blend"),0,1,m,.25),g=e.dE(t,n,o)&&_===m?o.worldSize/(2*Math.PI*1.025)-1:o.globeRadius,y=t.frameCounter/1e3%1,v=e.ag(o.globeCenterInViewSpace),x=Math.sqrt(Math.pow(v,2)-Math.pow(g,2)),b=Math.acos(x/v),w=e=>{const i="globe"===o.projection.name?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"];e&&i.push("ALPHA_PASS");const l=t.getOrCreateProgram("globeAtmosphere",{defines:i}),c=((e,t,i,n,r,o,s,a,l,c,u,h)=>({u_frustum_tl:e,u_frustum_tr:t,u_frustum_br:i,u_frustum_bl:n,u_horizon:r,u_transition:o,u_fadeout_range:s,u_atmosphere_fog_color:a.toArray01(),u_high_color:l.toArray01(),u_space_color:c.toArray01(),u_temporal_offset:u,u_horizon_angle:h}))(o.frustumCorners.TL,o.frustumCorners.TR,o.frustumCorners.BR,o.frustumCorners.BL,o.frustumCorners.horizon,a,_,u,d,p,y,b);t.uploadCommonUniforms(n,l);const h=this.atmosphereBuffer;h&&l.draw(t,r.TRIANGLES,s,Ki.disabled,e?this.colorModeWriteAlpha:this.colorModeAlphaBlendedWriteRGB,en.backCW,c,e?"atmosphere_glow_alpha":"atmosphere_glow",h.vertexBuffer,h.indexBuffer,h.segments)};w(!1),w(!0)}drawStars(t,i){const n=e.aA(i.properties.get("star-intensity"),0,1);if(0===n)return;const r=t.context,o=r.gl,s=t.transform,a=t.getOrCreateProgram("stars"),l=e.c7([]);e.c9(l,l,-s._pitch),e.c8(l,l,-s.angle),e.c9(l,l,e.an(s._center.lat)),e.et(l,l,-e.an(s._center.lng));const c=e.cc(new Float32Array(16),l),u=e.aB([],s.starsProjMatrix,c),h=e.eo([],c),d=e.eu([],h),f=[0,1,0];e.dQ(f,f,d),e.c5(f,f,this.params.sizeMultiplier);const p=[1,0,0];e.dQ(p,p,d),e.c5(p,p,this.params.sizeMultiplier);const m=(_=f,g=p,y=n,{u_matrix:Float32Array.from(u),u_up:_,u_right:g,u_intensity_multiplier:y});var _,g,y;t.uploadCommonUniforms(r,a),this.starsVx&&this.starsIdx&&a.draw(t,o.TRIANGLES,Xi.disabled,Ki.disabled,this.colorModeAlphaBlendedWriteRGB,en.disabled,m,"atmosphere_stars",this.starsVx,this.starsIdx,this.starsSegments)}}class Qs{constructor(){this.visibleTiles=[]}updateBorders(t,i){const n=[],r=[],o=t._getRenderableCoordinates(!1,!0);for(const e of o){const o=t.getTile(e);
2if(!o.hasData())continue;const s=o.getBucket(i);s&&(s.isEmpty()||(n.push(e.key),r.push({bucket:s,tileID:e.canonical})))}let s=n.length!==this.visibleTiles.length;if(!s){n.sort();for(let e=0;e<n.length;e++)if(n[e]!==this.visibleTiles[e]){s=!0;break}}if(!s)return;const a=new Set;this.visibleTiles=n,r.sort((e,t)=>e.tileID.z-t.tileID.z||e.tileID.x-t.tileID.x||e.tileID.y-t.tileID.y);for(const t of r){const i=new Array,n=new Array,r=t.bucket;for(const e of r.featuresOnBorder)a.has(e.featureId)?n.push(e.footprintIndex):(a.add(e.featureId),i.push(e.footprintIndex));r.updateFootprintHiddenFlags(i,e.ev,!1),r.updateFootprintHiddenFlags(n,e.ev,!0)}}}function ea(t,i){const n=[...t],r=i.cameraWorldSizeForFog/i.worldSize,o=e.bA([]);return e.cS(o,o,[r,r,1]),e.aB(n,o,n),e.aB(n,i.worldToFogMatrix,n),n}function ta(t,i,n,r,o){const s=n.material,a=r.context,{baseColorTexture:l,metallicRoughnessTexture:c}=s.pbrMetallicRoughness,{normalTexture:u,occlusionTexture:h,emissionTexture:d}=s;function f(e,i,n){if(e&&(t.push(i),a.activeTexture.set(a.gl.TEXTURE0+n),e.gfxTexture)){const{minFilter:t,magFilter:i,wrapS:n,wrapT:r}=e.sampler;e.gfxTexture.bindExtraParam(t,i,n,r)}}f(l,"HAS_TEXTURE_u_baseColorTexture",an),f(c,"HAS_TEXTURE_u_metallicRoughnessTexture",ln),f(u,"HAS_TEXTURE_u_normalTexture",cn),f(h,"HAS_TEXTURE_u_occlusionTexture",un),f(d,"HAS_TEXTURE_u_emissionTexture",hn),o&&(o.texture||(o.texture=new e.d$(r.context,o.image,[o.image.height,o.image.height,o.image.height],a.gl.RGBA8)),a.activeTexture.set(a.gl.TEXTURE0+dn),o.texture&&o.texture.bind(a.gl.LINEAR,a.gl.CLAMP_TO_EDGE),t.push("APPLY_LUT_ON_GPU")),n.texcoordBuffer&&(t.push("HAS_ATTRIBUTE_a_uv_2f"),i.push(n.texcoordBuffer)),n.colorBuffer&&(t.push(12===n.colorBuffer.itemSize?"HAS_ATTRIBUTE_a_color_3f":"HAS_ATTRIBUTE_a_color_4f"),i.push(n.colorBuffer)),n.normalBuffer&&(t.push("HAS_ATTRIBUTE_a_normal_3f"),i.push(n.normalBuffer)),n.pbrBuffer&&(t.push("HAS_ATTRIBUTE_a_pbr"),t.push("HAS_ATTRIBUTE_a_heightBasedEmissiveStrength"),i.push(n.pbrBuffer)),"OPAQUE"!==s.alphaMode&&"MASK"!==s.alphaMode||t.push("UNPREMULT_TEXTURE_IN_SHADER"),s.defined||t.push("DIFFUSE_SHADED");const p=r.shadowRenderer;p&&(t.push("RENDER_SHADOWS","DEPTH_TEXTURE"),p.useNormalOffset&&t.push("NORMAL_OFFSET"))}function ia(t,i,n,r,o,s){const a=t.modelOpacity,l=i.context,c=new Xi(i.context.gl.LEQUAL,t.isLightMesh?Xi.ReadOnly:Xi.ReadWrite,i.depthRangeFor3D),u=i.transform,h=t.mesh,d=h.material,f=d.pbrMetallicRoughness,p=i.style.fog;let m;m="pixels"===i.transform.projection.zAxisUnit?[...t.nodeModelMatrix]:e.aB([],r.zScaleMatrix,t.nodeModelMatrix),e.aB(m,r.negCameraPosMatrix,m);const _=e.bl([],m);e.eg(_,_);const g="none"===n.paint.get("model-color-use-theme").constantOr("default"),y=n.paint.get("model-emissive-strength").constantOr(0),v=Yo(new Float32Array(t.worldViewProjection),new Float32Array(m),new Float32Array(_),null,i,a,f.baseColorFactor,d.emissiveFactor,f.metallicFactor,f.roughnessFactor,d,y,n,void 0,void 0,t.materialOverride,t.modelColor),x={defines:[]},b=[],w=i.shadowRenderer;w&&(w.useNormalOffset=!1),ta(x.defines,b,h,i,g?null:n.lut);let T=null;if(p){const e=ea(t.nodeModelMatrix,i.transform);if(T=new Float32Array(e),"globe"!==u.projection.name){const t=h.aabb.min,i=h.aabb.max,[n,r]=p.getOpacityForBounds(e,t[0],t[1],i[0],i[1]);x.overrideFog=n>=je||r>=je}}const S=gn(i,n.paint.get("model-cutoff-fade-range"));S.shouldRenderCutoff&&x.defines.push("RENDER_CUTOFF");const E=i.getOrCreateProgram("model",x);i.uploadCommonUniforms(l,E,null,T,S),"shadow"!==i.renderPass&&w&&w.setupShadowsFromMatrix(t.nodeModelMatrix,E),E.draw(i,l.gl.TRIANGLES,c,o,s,h.material.doubleSided?en.disabled:en.backCCW,v,n.id,h.vertexBuffer,h.indexBuffer,h.segments,n.paint,i.transform.zoom,void 0,b)}function na(e,t){return e.style._importedAsBasemap?"basemap":t.scope}function ra(t,i,n,r,o,s,a,l,c,u){const h=t.transform,d=!!i.isGeometryBloom&&i.isGeometryBloom;if(d&&"shadow"===t.renderPass)return;const f="globe"===h.projection.name?e.eD(n,h):[...n];e.aB(f,f,i.globalMatrix);const p=e.aB([],r,f);if(i.meshes)for(const t of i.meshes){const i=l.get(t.material.name);if(i&&i.opacity<=0)continue;if("BLEND"!==t.material.alphaMode){a.push({mesh:t,depth:0,modelIndex:o,worldViewProjection:p,nodeModelMatrix:f,isLightMesh:d,materialOverride:i,modelOpacity:c,modelColor:u});continue}const n=e.af([],t.centroid,p);!h.isOrthographic&&n[2]<=0||s.push({mesh:t,depth:n[2],modelIndex:o,worldViewProjection:p,nodeModelMatrix:f,isLightMesh:d,materialOverride:i,modelOpacity:c,modelColor:u})}if(i.children)for(const e of i.children)ra(t,e,n,r,o,s,a,l,c,u)}function oa(e,t,i,n){const r=i.shadowRenderer;if(!r)return;const o=r.getShadowPassDepthMode(),s=r.getShadowPassColorMode(),a=r.calculateShadowPassMatrixFromMatr
vendor: 5,095 bytes, line 2
2ix(t),l=Ko(a);i.getOrCreateProgram("modelDepth",{defines:i._shadowMapDebug?[]:["DEPTH_TEXTURE"]}).draw(i,i.context.gl.TRIANGLES,o,Ki.disabled,s,en.disabled,l,n.id,e.vertexBuffer,e.indexBuffer,e.segments,n.paint,i.transform.zoom,void 0,void 0)}function sa(e,t,i,n,r,o){for(const s of r){const r=Object.assign({},n);r.part=s;const a={type:"Unknown",id:t,properties:r},l={orientation:e.paint.get("model-rotation").evaluate(a,i)};o.set(s,l)}}function aa(e,t,i,n,r,o){for(const s of r){const r=Object.assign({},n);r.part=s;const a={type:"Unknown",id:t,properties:r},l={color:e.paint.get("model-color").evaluate(a,i),colorMix:e.paint.get("model-color-mix-intensity").evaluate(a,i),opacity:e.paint.get("model-opacity").evaluate(a,i),emissionStrength:e.paint.get("model-emissive-strength").evaluate(a,i)};o.set(s,l)}}function la(e,t,i,n,r){let o=!1;for(const i of n)1!==i.modelOpacity&&(ia(i,e,t,r[i.modelIndex],Ki.disabled,Zi.disabled),o=!0);for(const i of n)ia(i,e,t,r[i.modelIndex],1!==i.modelOpacity?e.stencilModeFor3D():Ki.disabled,e.colorModeForRenderPass());o&&e.resetStencilClippingMasks();const s=Zi.additive;for(const n of i)ia(n,e,t,r[n.modelIndex],Ki.disabled,n.isLightMesh?s:e.colorModeForRenderPass())}function ca(t,i,n){const r=i.updateZoomBasedPaintProperties(),o=function(t,i,n){let r,o,s,a=t.terrain?t.terrain.exaggeration():0;if(t.terrain&&a>0){const i=t.terrain,o=i.findDEMTileFor(n);o&&o.dem?r=e.eF.create(i,n,o):a=0}if(0===a&&(i.terrainElevationMin=0,i.terrainElevationMax=0),a===i.validForExaggeration&&(0===a||r&&r._demTile&&r._demTile.tileID===i.validForDEMTile.id&&r._dem._timestamp===i.validForDEMTile.timestamp))return!1;for(const e in i.instancesPerModel){const t=i.instancesPerModel[e];for(let e=0;e<t.instancedDataArray.length;++e){const n=(r?a*r.getElevationAt(0|t.instancedDataArray.float32[16*e],0|t.instancedDataArray.float32[16*e+1],!0,!0):0)+t.instancesEvaluatedElevation[e];t.instancedDataArray.float32[16*e+6]=n,o=o?Math.min(i.terrainElevationMin,n):n,s=s?Math.max(i.terrainElevationMax,n):n}}return i.terrainElevationMin=o||0,i.terrainElevationMax=s||0,i.validForExaggeration=a,i.validForDEMTile=r&&r._demTile?{id:r._demTile.tileID,timestamp:r._dem._timestamp}:{id:void 0,timestamp:0},!0}(t,i,n);(r||o)&&(i.uploaded=!1,i.upload(t.context))}const ua={shadowUniformsInitialized:!1,useSingleShadowCascade:!1,tileMatrix:new Float64Array(16),shadowTileMatrix:new Float32Array(16),aabb:new e.d9([0,0,0],[e.al,e.al,0])};function ha(t,i){const n=1<<t.canonical.z,r=i.getFreeCameraOptions().position,o=i.elevation,s=t.canonical.x/n,a=(t.canonical.x+1)/n,l=t.canonical.y/n,c=(t.canonical.y+1)/n;let u=i._centerAltitude;if(o){const e=o.getMinMaxForTile(t);e&&e.max>u&&(u=e.max)}const h=e.aA(r.x,s,a)-r.x,d=e.aA(r.y,l,c)-r.y,f=e.cf(u,i.center.lat)-r.z;return i._zoomFromMercatorZ(Math.sqrt(h*h+d*d+f*f))}function da(e,t,i,n,r,o,s){const a=e.context,l="shadow"===e.renderPass,c=e.shadowRenderer,u=l&&c?c.getShadowPassDepthMode():new Xi(a.gl.LEQUAL,Xi.ReadWrite,e.depthRangeFor3D),h=e.isTileAffectedByFog(o),d="globe"===e.transform.projection.name;if(i.meshes)for(const f of i.meshes){const p=d?[]:["MODEL_POSITION_ON_GPU"],m=[];let _,g,y;const v=!d&&n.instancedDataArray.length>20;v&&p.push("INSTANCED_ARRAYS");const x=gn(e,t.paint.get("model-cutoff-fade-range"));if(x.shouldRenderCutoff&&p.push("RENDER_CUTOFF"),l&&c)_=e.getOrCreateProgram("modelDepth",{defines:p}),g=Ko(s.shadowTileMatrix,s.shadowTileMatrix,Float32Array.from(i.globalMatrix)),y=c.getShadowPassColorMode();else{ta(p,m,f,e,"none"===t.paint.get("model-color-use-theme").constantOr("default")?null:t.lut),_=e.getOrCreateProgram("model",{defines:p,overrideFog:h});const n=f.material,l=n.pbrMetallicRoughness,u=t.paint.get("model-opacity").constantOr(1),d=t.paint.get("model-emissive-strength").constantOr(0);g=Yo(o.expandedProjMatrix,Float32Array.from(i.globalMatrix),new Float32Array(16),null,e,u,l.baseColorFactor,n.emissiveFactor,l.metallicFactor,l.roughnessFactor,n,d,t,r),c&&(s.shadowUniformsInitialized?_.setShadowUniformValues(a,c.getShadowUniformValues()):(c.setupShadows(o.toUnwrapped(),_,"model-tile"),s.shadowUniformsInitialized=!0)),y=x.shouldRenderCutoff||u<1||"OPAQUE"!==n.alphaMode?Zi.alphaBlended:Zi.unblended}e.uploadCommonUniforms(a,_,o.toUnwrapped(),null,x);const b=f.material.doubleSided?en.disabled:en.backCCW;if(v)m.push(n.instancedDataBuffer),_.draw(e,a.gl.TRIANGLES,u,Ki.disabled,y,b,g,t.id,f.vertexBuffer,f.indexBuffer,f.segments,t.paint,e.transform.zoom,void 0,m,n.instancedDataArray.length);else{const i=l?"u_instance":"u_normal_matrix";for(let r=0;r<n.instancedDataArray.length;++r)g[i]=new Float32Array(n.instancedDataArray.arrayBuffer,64*r,16),_.draw(e,a.gl.TRIANGLES,u,Ki.disabled,y,b,g,t.id,f.vertexBuffer,f.indexBuffer,f.segments,t.paint,e.transform.zoom,void 0,m)}}if(i.children)for(const a of i.children)da(e,t,a,n,r,o,s)}const fa=[1,-1,1];function pa(t,i,n,r){if(!n.modelManager)return!0;const o=n.modelManager;if(!n.shadowRenderer)return!0;const s=n.shadowRenderer,a=i.aabb;let l=!0,c=t.maxHeight;if(0===c){let e=0;for(const i in t.instancesPerModel){const t=o.getModel(i,r);
2t?e=Math.max(e,Math.max(Math.max(t.aabb.max[0],t.aabb.max[1]),t.aabb.max[2])):l=!1}c=t.maxScale*e*1.41+t.maxVerticalOffset,l&&(t.maxHeight=c)}a.max[2]=c,a.min[2]+=t.terrainElevationMin,a.max[2]+=t.terrainElevationMax,e.af(a.min,a.min,i.tileMatrix),e.af(a.max,a.max,i.tileMatrix);const u=a.intersects(s.getCurrentCascadeFrustum());return 0===n.currentShadowCascade&&(t.isInsideFirstShadowMapFrustum=2===u),0===u}function ma(t,i){const n=t.uniformValues.u_cutoff_params[0],r=t.uniformValues.u_cutoff_params[1],o=t.uniformValues.u_cutoff_params[2],s=t.uniformValues.u_cutoff_params[3];return r===n||s===o?1:e.aA(((i-n)/(r-n)-o)/(s-o),0,1)}function _a(t,i,n,r){if(i.pitch<20)return 1;const o=i.getWorldToCameraMatrix();e.aB(o,o,t);const s=e.bU(n.min[0],n.min[1],n.min[2],1);let a=e.aC(e.eG(),s,o),l=a,c=a;s[1]=n.max[1],a=e.aC(e.eG(),s,o),l=a[1]<l[1]?a:l,c=a[1]>c[1]?a:c,s[0]=n.max[0],a=e.aC(e.eG(),s,o),l=a[1]<l[1]?a:l,c=a[1]>c[1]?a:c,s[1]=n.min[1],a=e.aC(e.eG(),s,o),l=a[1]<l[1]?a:l,c=a[1]>c[1]?a:c;const u=e.aA(r[0],0,1),h=100*i.pixelsPerMeter*e.aA(r[1],0,1),d=e.aA(r[2],0,1),f=e.eH(e.eG(),l,c,u),p=Math.tan(.5*i.fovX),m=-f[2]*p;if(0===h)return f[1]<-Math.abs(m)?d:1;const _=(-Math.abs(m)-f[1])/h,g=(e,t,i)=>(1-i)*e+i*t,y=e.aA(g(1,d,_),d,1);return g(1,y,e.aA((i.pitch-20)/20,0,1))}class ga{}class ya{constructor(){this._storage=new Map}getLinesFromTrianglesBuffer(t,i,n){{const e=this._storage.get(i.id);if(e)return e.lastUsedFrameIdx=t,e.buf}const r=n.gl,o=r.getBufferParameter(r.ELEMENT_ARRAY_BUFFER,r.BUFFER_SIZE),s=new ArrayBuffer(o),a=new Int16Array(s);r.getBufferSubData(r.ELEMENT_ARRAY_BUFFER,0,new Int16Array(s));const l=new e.eJ;for(let e=0;e<o/2;e+=3){const t=a[e],i=a[e+1],n=a[e+2];l.emplaceBack(t,i),l.emplaceBack(i,n),l.emplaceBack(n,t)}const c=n.bindVertexArrayOES.current,u=new ga;return u.buf=new Qo(n,l),u.lastUsedFrameIdx=t,this._storage.set(i.id,u),n.bindVertexArrayOES.set(c),u.buf}update(e){for(const[t,i]of this._storage)e-i.lastUsedFrameIdx>30&&(i.buf.destroy(),this._storage.delete(t))}destroy(){for(const[e,t]of this._storage)t.buf.destroy(),this._storage.delete(e)}}class va{constructor(){this.occluderSize=30,this.depthOffset=-1e-4}}const xa=e.ei([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_rainParticleData",components:4}]);class ba{constructor(e){this.revealStart=11,this.revealRange=2}}const wa=e.ei([{type:"Float32",name:"a_pos_2f",components:2}]);class Ta{destroy(){this.vignetteVx&&this.vignetteVx.destroy(),this.vignetteIdx&&this.vignetteIdx.destroy()}draw(t,i){const n=t.getOrCreateProgram("vignette");if(!this.vignetteVx||!this.vignetteIdx){const i=new e.eK,n=new e.b0;i.emplaceBack(-1,-1),i.emplaceBack(1,-1),i.emplaceBack(1,1),i.emplaceBack(-1,1),n.emplaceBack(0,1,2),n.emplaceBack(0,2,3),this.vignetteVx=t.context.createVertexBuffer(i,wa.members),this.vignetteIdx=t.context.createIndexBuffer(n)}const r=e.bg.simpleSegment(0,0,4,6);if(this.vignetteVx&&this.vignetteIdx){t.uploadCommonUniforms(t.context,n);const e={u_vignetteShape:(o={vignetteShape:[i.start,i.range,Math.pow(10,i.fadePower)],vignetteColor:[i.color.r,i.color.g,i.color.b,i.color.a*i.strength]}).vignetteShape,u_vignetteColor:o.vignetteColor};n.draw(t,t.context.gl.TRIANGLES,Xi.disabled,Ki.disabled,Zi.alphaBlended,en.disabled,e,"vignette",this.vignetteVx,this.vignetteIdx,r)}var o}}class Sa{constructor(){this._accumulatedOffsetX=0,this._accumulatedOffsetY=0,this._accumulatedElevation=0}update(t,i){const n=t.getFreeCameraOptions().position,r=n.toAltitude(),o=n.toLngLat(),s=e.an(o.lng),a=e.an(o.lat),l=t.pixelsPerMeter/i,c=s*e.eM,u=e.eM*Math.log(Math.tan(Math.PI/4+a/2));if(void 0===this._offsetXPrev)this._offsetXPrev=0,this._offsetYPrev=0,this._elevationPrev=0,this._accumulatedOffsetX=0,this._accumulatedOffsetY=0,this._accumulatedElevation=0;else{const e=-this._offsetYPrev+u,t=-this._elevationPrev+r;this._accumulatedOffsetX+=(-this._offsetXPrev+c)*l,this._accumulatedOffsetY+=e*l,this._accumulatedElevation+=t*l,this._offsetXPrev=c,this._offsetYPrev=u,this._elevationPrev=r}}getPosition(){return[this._accumulatedOffsetX,this._accumulatedOffsetY,this._accumulatedElevation]}}function Ea(e,t){return[-(e[0]-Math.floor(e[0]/t)*t),-(e[1]-Math.floor(e[1]/t)*t),-(e[2]-Math.floor(e[2]/t)*t)]}function Ia(t){const i=e.eq(1323123451230),n=[];for(let r=0;r<t;++r){const t=2*i()-1,r=2*i()-1,o=2*i()-1;n.push(e.d5(t,r,o))}return n}function Aa(t,i,n,r,o){const s=e.aA((o-n)/(r-n),0,1);return(1-s)*t+s*i}class Ma{constructor(e){this._movement=new Sa,this._accumulatedTimeFromStart=0,this._prevTime=Date.now()/1e3,this._vignette=new Ta,this._ppmScaleFactor=e}destroy(){this.particlesVx&&this.particlesVx.destroy(),this.particlesIdx&&this.particlesIdx.destroy(),this._vignette&&this._vignette.destroy()}updateOnRender(t,i){const n=t.transform;this._movement.update(n,this._ppmScaleFactor);const r=n.starsProjMatrix,o=e.c7([]);e.c9(o,o,e.an(90)-n._pitch),e.c8(o,o,-n.angle);const s=e.cc(new Float32Array(16),o),a=e.eL(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1),l=e.eg([],a),c=e.aB([],l,s),u=Date.now()/1e3;return this._accumulatedTimeFromStart+=(u-this._prevTime)*i,this._prevTime=u,{projectionMatrix:r,modelviewMatrix:c}}}class Ca extends Ma{constructor(e){super(4.25),this._params={overrideStyleParameters:!1,intensity:.5,timeFactor:1,velocityConeAperture:0,velocity:300,boxSize:2500,droplet
2SizeX:1,dropletSizeYScale:10,distortionStrength:70,screenThinning:{intensity:.57,start:.46,range:1.17,fadePower:.17,affectedRatio:1,particleOffset:-.2},color:{r:.66,g:.68,b:.74,a:.7},direction:{x:-50,y:-35},shapeDirPower:2,shapeNormalPower:1},this._revealParams=new ba("Precipitation > Rain"),this._vignetteParams={strength:1,start:.7,range:1,fadePower:.4,color:{r:.27,g:.27,b:.27,a:1}},this.particlesCount=16e3}update(t){const i=t.context;if(!this.particlesVx){const t=Ia(this.particlesCount),n=new e.eN,r=new e.b0;let o=0;const s=e.eq(1323123451230);for(let e=0;e<t.length;++e){const i=t[e],a=[2*s()-1,s(),s(),s()];n.emplaceBack(i[0],i[1],i[2],-1,-1,...a),n.emplaceBack(i[0],i[1],i[2],1,-1,...a),n.emplaceBack(i[0],i[1],i[2],1,1,...a),n.emplaceBack(i[0],i[1],i[2],-1,1,...a),r.emplaceBack(o+0,o+1,o+2),r.emplaceBack(o+0,o+2,o+3),o+=4}this.particlesVx=i.createVertexBuffer(n,xa.members),this.particlesIdx=i.createIndexBuffer(r)}}draw(t){if(!this._params.overrideStyleParameters&&!t.style.rain)return;const i=this._params.overrideStyleParameters?this._revealParams:{revealStart:0,revealRange:.01},n=t.transform.zoom;if(i.revealStart>n)return;const r=Aa(0,1,i.revealStart,i.revealStart+i.revealRange,n);if(!this.particlesVx||!this.particlesIdx)return;const o=structuredClone(this._params);let s=[-o.direction.x,o.direction.y,-100];e.aw(s,s);const a=structuredClone(this._vignetteParams);a.strength*=r,o.overrideStyleParameters||(o.intensity=t.style.rain.state.density,o.timeFactor=t.style.rain.state.intensity,o.color=structuredClone(t.style.rain.state.color),s=structuredClone(t.style.rain.state.direction),o.screenThinning.intensity=t.style.rain.state.centerThinning,o.dropletSizeX=t.style.rain.state.dropletSize[0],o.droplet
2SizeYScale=t.style.rain.state.dropletSize[1]/t.style.rain.state.dropletSize[0],o.distortionStrength=100*t.style.rain.state.distortionStrength,a.strength=1,a.color=structuredClone(t.style.rain.state.vignetteColor));const l=this.updateOnRender(t,o.timeFactor),c=t.context,u=c.gl,h=t.transform;this.screenTexture&&this.screenTexture.size[0]===t.width&&this.screenTexture.size[1]===t.height||(this.screenTexture=new e.T(c,{width:t.width,height:t.height,data:null},u.RGBA8)),o.distortionStrength>0&&(c.activeTexture.set(u.TEXTURE0),this.screenTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),u.copyTexSubImage2D(u.TEXTURE_2D,0,0,0,0,0,t.width,t.height));const d=t.getOrCreateProgram("rainParticle");t.uploadCommonUniforms(c,d),c.activeTexture.set(u.TEXTURE0),this.screenTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE);const f=[o.color.r,o.color.g,o.color.b,o.color.a],p=(i,n)=>{const r=Ea(this._movement.getPosition(),i),a=o.dropletSizeX,c=o.dropletSizeX*o.dropletSizeYScale,p=t.width/2,m=t.height/2,_=Aa(0,o.screenThinning.start,0,1,o.screenThinning.intensity),g=Aa(.001,o.screenThinning.range,0,1,o.screenThinning.intensity),y=Aa(0,o.screenThinning.particleOffset,0,1,o.screenThinning.intensity),v=(x={modelview:l.modelviewMatrix,projection:l.projectionMatrix,time:this._accumulatedTimeFromStart,camPos:r,velocityConeAperture:o.velocityConeAperture,velocity:o.velocity,boxSize:i,rainDropletSize:[a,c],distortionStrength:o.distortionStrength,rainDirection:s,color:f,screenSize:[h.width,h.height],thinningCenterPos:[p,m],thinningShape:[_,g,Math.pow(10,o.screenThinning.fadePower)],thinningAffectedRatio:o.screenThinning.affectedRatio,thinningParticleOffset:y,shapeDirectionalPower:o.shapeDirPower,shapeNormalPower:o.shapeNormalPower,mode:n?0:1},{u_modelview:Float32Array.from(x.modelview),u_projection:Float32Array.from(x.projection),u_time:x.time,u_cam_pos:x.camPos,u_texScreen:0,u_velocityConeAperture:x.velocityConeAperture,u_velocity:x.velocity,u_boxSize:x.boxSize,u_rainDropletSize:x.rainDropletSize,u_distortionStrength:x.distortionStrength,u_rainDirection:x.rainDirection,u_color:x.color,u_screenSize:x.screenSize,u_thinningCenterPos:x.thinningCenterPos,u_thinningShape:x.thinningShape,u_thinningAffectedRatio:x.thinningAffectedRatio,u_thinningParticleOffset:x.thinningParticleOffset,u_shapeDirectionalPower:x.shapeDirectionalPower,u_shapeNormalPower:x.shapeNormalPower,u_mode:x.mode});var x;const b=Math.round(o.intensity*this.particlesCount),w=e.bg.simpleSegment(0,0,4*b,2*b);d.draw(t,u.TRIANGLES,Xi.disabled,Ki.disabled,Zi.alphaBlended,en.disabled,v,"rain_particles",this.particlesVx,this.particlesIdx,w)};o.distortionStrength>0&&p(o.boxSize,!0),p(o.boxSize,!1),this._vignette.draw(t,a)}}const Pa=e.ei([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_snowParticleData",components:4},{type:"Float32",name:"a_snowParticleDataHorizontalOscillation",components:2}]);class Da extends Ma{constructor(e){super(2.25),this._params={overrideStyleParameters:!1,intensity:.85,timeFactor:.75,velocityConeAperture:70,velocity:40,horizontalOscillationRadius:4,horizontalOscillationRate:1.5,boxSize:2e3,billboardSize:2,shapeFadeStart:.27,shapeFadePower:.21,screenThinning:{intensity:.4,start:.15,range:1.4,fadePower:.24,affectedRatio:1,particleOffset:-.2},color:{r:1,g:1,b:1,a:1},direction:{x:-50,y:-35}},this._revealParams=new ba("Precipitation > Snow"),this._vignetteParams={strength:.3,start:.78,range:.46,fadePower:.2,color:{r:1,g:1,b:1,a:1}},this.particlesCount=16e3}update(t){const i=t.context;if(!this.particlesVx){const t=Ia(this.particlesCount),n=new e.eO,r=new e.b0;let o=0;const s=e.eq(1323123451230);for(let e=0;e<t.length;++e){const i=t[e],a=s(),l=s(),c=s(),u=[e/t.length,a,l,c],h=[s(),s()];n.emplaceBack(i[0],i[1],i[2],-1,-1,...u,...h),n.emplaceBack(i[0],i[1],i[2],1,-1,...u,...h),n.emplaceBack(i[0],i[1],i[2],1,1,...u,...h),n.emplaceBack(i[0],i[1],i[2],-1,1,...u,...h),r.emplaceBack(o+0,o+1,o+2),r.emplaceBack(o+0,o+2,o+3),o+=4}this.particlesVx=i.createVertexBuffer(n,Pa.members),this.particlesIdx=i.createIndexBuffer(r)}}draw(t){if(!this._params.overrideStyleParameters&&!t.style.snow)return;const i=structuredClone(this._params);let n=[-i.direction.x,i.direction.y,-100];e.aw(n,n);
2const r=structuredClone(this._vignetteParams),o=i.overrideStyleParameters?this._revealParams:{revealStart:0,revealRange:.01},s=t.transform.zoom;if(o.revealStart>s)return;const a=Aa(0,1,o.revealStart,o.revealStart+o.revealRange,s);r.strength*=a,i.overrideStyleParameters||(i.intensity=t.style.snow.state.density,i.timeFactor=t.style.snow.state.intensity,i.color=structuredClone(t.style.snow.state.color),n=structuredClone(t.style.snow.state.direction),i.screenThinning.intensity=t.style.snow.state.centerThinning,i.billboardSize=2.79*t.style.snow.state.flakeSize,r.strength=1,r.color=structuredClone(t.style.snow.state.vignetteColor));const l=this.updateOnRender(t,i.timeFactor);if(!this.particlesVx||!this.particlesIdx)return;const c=t.context,u=c.gl,h=t.transform,d=t.getOrCreateProgram("snowParticle");t.uploadCommonUniforms(c,d),((i,r,o)=>{const s=Ea(this._movement.getPosition(),i),a=h.width/2,c=h.height/2,f=Aa(0,o.screenThinning.start,0,1,o.screenThinning.intensity),p=Aa(.001,o.screenThinning.range,0,1,o.screenThinning.intensity),m=Aa(0,o.screenThinning.particleOffset,0,1,o.screenThinning.intensity),_=(g={modelview:l.modelviewMatrix,projection:l.projectionMatrix,time:this._accumulatedTimeFromStart,camPos:s,velocityConeAperture:o.velocityConeAperture,velocity:o.velocity,horizontalOscillationRadius:o.horizontalOscillationRadius,horizontalOscillationRate:o.horizontalOscillationRate,boxSize:i,billboardSize:1*o.billboardSize,simpleShapeParameters:[o.shapeFadeStart,o.shapeFadePower],screenSize:[h.width,h.height],thinningCenterPos:[a,c],thinningShape:[f,p,Math.pow(10,o.screenThinning.fadePower)],thinningAffectedRatio:o.screenThinning.affectedRatio,thinningParticleOffset:m,color:[o.color.r,o.color.g,o.color.b,o.color.a],direction:n},{u_modelview:Float32Array.from(g.modelview),u_projection:Float32Array.from(g.projection),u_time:g.time,u_cam_pos:g.camPos,u_velocityConeAperture:g.velocityConeAperture,u_velocity:g.velocity,u_horizontalOscillationRadius:g.horizontalOscillationRadius,u_horizontalOscillationRate:g.horizontalOscillationRate,u_boxSize:g.boxSize,u_billboardSize:g.billboardSize,u_simpleShapeParameters:g.simpleShapeParameters,u_screenSize:g.screenSize,u_thinningCenterPos:g.thinningCenterPos,u_thinningShape:g.thinningShape,u_thinningAffectedRatio:g.thinningAffectedRatio,u_thinningParticleOffset:g.thinningParticleOffset,u_particleColor:g.color,u_direction:g.direction});var g;const y=Math.round(o.intensity*this.particlesCount),v=e.bg.simpleSegment(0,0,4*y,2*y);this.particlesVx&&this.particlesIdx&&d.draw(t,u.TRIANGLES,Xi.disabled,Ki.disabled,Zi.alphaBlended,en.disabled,_,"snow_particles",this.particlesVx,this.particlesIdx,v)})(i.boxSize,0,i),this._vignette.draw(t,r)}}const Ra={symbol:function(t,i,n,r,o){if("translucent"!==t.renderPass)return;const s=Ki.disabled,a=t.colorModeForRenderPass(),l=n.layout.get("text-variable-anchor"),c=n.layout.get("text-size-scale-range"),u=e.aA(t.scaleFactor,c[0],c[1]);l&&function(t,i,n,r,o,s,a,l){const c=i.transform,u="map"===o,h="map"===s;for(const i of t){const t=r.getTile(i),o=t.getBucket(n);if(!o||!o.text||!o.text.segments.get().length)continue;const s=e.bK(o.textSizeData,c.zoom,l),d=Kt(i,o.getProjection(),c),f=c.calculatePixelsToTileUnitsMatrix(t),p=ri(d,t.tileID.canonical,h,u,c,o.getProjection(),f),m=o.hasIconTextFit()&&o.hasIconData();s&&cs(o,u,h,a,c,p,i,Math.pow(2,c.zoom-t.tileID.overscaledZ),s,m)}}(r,t,n,i,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),o,u);const h=0!==n.paint.get("icon-opacity").constantOr(1),d=0!==n.paint.get("text-opacity").constantOr(1);void 0!==n.layout.get("symbol-sort-key").constantOr(1)&&(h||d)?us(t,i,n,r,s,a):(h&&us(t,i,n,r,s,a,{onlyIcons:!0}),d&&us(t,i,n,r,s,a,{onlyText:!0})),i.map.showCollisionBoxes&&(os(t,i,n,r,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),os(t,i,n,r,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))},circle:function(t,i,n,r){if("translucent"!==t.renderPass)return;const o=n.paint.get("circle-opacity"),s=n.paint.get("circle-stroke-width"),a=n.paint.get("circle-stroke-opacity"),l=void 0!==n.layout.get("
2circle-sort-key").constantOr(1),c=n.paint.get("circle-emissive-strength");if(0===o.constantOr(1)&&(0===s.constantOr(1)||0===a.constantOr(1)))return;const u=t.context,h=u.gl,d=t.transform,f=!(!t.terrain||!t.terrain.enabled),p=n.layout.get("circle-elevation-reference"),m=t.depthModeForSublayer(0,Xi.ReadOnly),_=new Xi(t.context.gl.LEQUAL,Xi.ReadOnly,t.depthRangeFor3D),g="none"===p||f?m:_,y=Ki.disabled,v=t.colorModeForDrapableLayerRenderPass(c),x="globe"===d.projection.name,b=[e.aF(d.center.lng),e.aJ(d.center.lat)],w=[];for(let o=0;o<r.length;o++){const s=r[o],a=i.getTile(s),c=a.getBucket(n);if(!c||c.projection.name!==d.projection.name)continue;const u=c.programConfigurations.get(n.id),h=c.layoutVertexBuffer,f=c.globeExtVertexBuffer,p=c.indexBuffer,m=e.e0(n),_=[f],g=t.isTileAffectedByFog(s);x&&m.push("PROJECTION_GLOBE_VIEW"),m.push("DEPTH_D24"),t.terrain&&d.depthOcclusionForSymbolsAndCircles&&m.push("DEPTH_OCCLUSION"),c.hasElevation&&!t.terrain&&(m.push("ELEVATED_ROADS"),_.push(c.elevatedLayoutVertexBuffer));const y=t.getOrCreateProgram("circle",{config:u,defines:m,overrideFog:g}),v=d.projection.createInversionMatrix(d,s.canonical),T={programConfiguration:u,program:y,layoutVertexBuffer:h,dynamicBuffers:_,indexBuffer:p,uniformValues:e.e1(t,s,a,v,b,n),tile:a};if(l){const t=c.segments.get();for(const i of t)w.push({segments:new e.bg([i]),sortKey:i.sortKey,state:T})}else w.push({segments:c.segments,sortKey:0,state:T})}l&&w.sort((e,t)=>
2e.sortKey-t.sortKey);const T={useDepthForOcclusion:d.depthOcclusionForSymbolsAndCircles};for(const e of w){const{programConfiguration:i,program:r,layoutVertexBuffer:o,dynamicBuffers:s,indexBuffer:a,uniformValues:l,tile:c}=e.state,f=e.segments;t.terrain&&t.terrain.setupElevationDraw(c,r,T),t.uploadCommonUniforms(u,r,c.tileID.toUnwrapped()),r.draw(t,h.TRIANGLES,g,y,v,en.disabled,l,n.id,o,a,f,n.paint,d.zoom,i,s)}},heatmap:function(t,i,n,r){if(0!==n.paint.get("heatmap-opacity"))if("offscreen"===t.renderPass){const o=t.context,s=o.gl,a=Ki.disabled,l=new Zi([s.ONE,s.ONE,s.ONE,s.ONE],e.ao.transparent,[!0,!0,!0,!0]);!function(e,t,i,n){const r=e.gl,o=t.width*n,s=t.height*n;e.activeTexture.set(r.TEXTURE1),e.viewport.set([0,0,o,s]);let a=i.heatmapFbo;if(!a||a&&(a.width!==o||a.height!==s)){a&&a.destroy();const t=r.createTexture();r.bindTexture(r.TEXTURE_2D,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),a=i.heatmapFbo=e.createFramebuffer(o,s,1,null),function(e,t,i,n,r,o){const s=e.gl;s.texImage2D(s.TEXTURE_2D,0,e.extRenderToTextureHalfFloat?s.RGBA16F:s.RGBA,r,o,0,s.RGBA,e.extRenderToTextureHalfFloat?s.HALF_FLOAT:s.UNSIGNED_BYTE,null),n.colorAttachment0.set(i)}(e,0,t,a,o,s)}else r.bindTexture(r.TEXTURE_2D,a.colorAttachment0.get()),e.bindFramebuffer.set(a.framebuffer)}(o,t,n,"globe"===t.transform.projection.name?.5:.25),o.clear({color:e.ao.transparent});const c=t.transform,u="globe"===c.projection.name,h=u?["PROJECTION_GLOBE_VIEW"]:[],d=u?en.frontCCW:en.disabled,f=[e.aF(c.center.lng),e.aJ(c.center.lat)];for(let e=0;e<r.length;e++){const p=r[e];if(i.hasRenderableParent(p))continue;const m=i.getTile(p),_=m.getBucket(n);if(!_||_.projection.name!==c.projection.name)continue;const g=t.isTileAffectedByFog(p),y=_.programConfigurations.get(n.id),v=t.getOrCreateProgram("heatmap",{config:y,defines:h,overrideFog:g}),{zoom:x}=t.transform;t.terrain&&t.terrain.setupElevationDraw(m,v),t.uploadCommonUniforms(o,v,p.toUnwrapped());const b=c.projection.createInversionMatrix(c,p.canonical);v.draw(t,s.TRIANGLES,Xi.disabled,a,l,d,Fo(t,p,m,b,f,x,n.paint.get("heatmap-intensity")),n.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,n.paint,t.transform.zoom,y,u?[_.globeExtVertexBuffer]:null)}o.viewport.set([0,0,t.width,t.height])}else"translucent"===t.renderPass&&(t.context.setColorMode(t.colorModeForRenderPass()),function(t,i){const n=t.context,r=n.gl,o=i.heatmapFbo;if(!o)return;n.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,o.colorAttachment0.get()),n.activeTexture.set(r.TEXTURE1);let s=i.colorRampTexture;s||(s=i.colorRampTexture=new e.T(n,i.colorRamp,r.RGBA8)),s.bind(r.LINEAR,r.CLAMP_TO_EDGE),t.getOrCreateProgram("heatmapTexture").draw(t,r.TRIANGLES,Xi.disabled,Ki.disabled,t.colorModeForRenderPass(),en.disabled,((e,t)=>({u_image:0,u_color_ramp:1,u_opacity:t.paint.get("heatmap-opacity")}))(0,i),i.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,i.paint,t.transform.zoom)}(t,n))},line:function(t,i,n,r){if("translucent"!==t.renderPass)return;const o=n.paint.get("line-opacity"),s=n.paint.get("line-width");if(0===o.constantOr(1)||0===s.constantOr(1))return;const a=n.paint.get("line-emissive-strength").isConstant(),l=n.paint.get("line-emissive-strength").constantOr(0),c=n.paint.get("line-occlusion-opacity"),u=n.layout.get("line-elevation-reference"),h="meters"===n.layout.get("line-width-unit"),d="sea"===u,f=!(!t.terrain||!t.terrain.enabled),p=t.context,m=p.gl;if(n.hasElevatedBuckets&&"globe"===t.transform.projection.name)return;const _=n.layout.get("line-cross-slope"),g=void 0!==_,y=_<1,v=t.colorModeForDrapableLayerRenderPass(a?l:null),x=t.terrain&&t.terrain.renderingToTexture,b=x?1:e.o.devicePixelRatio,w=n.paint.get("line-dasharray"),T=w.constantOr(1),S=n.layout.get("line-cap"),E=w.constantOr(null),I=S.constantOr(null),A=n.paint.get("line-pattern"),M=A.constantOr(1),C=n.paint.get("line-pattern-cross-fade"),P=A.constantOr(null),D=n.paint.get("line-opacity").constantOr(1);let R=!M&&1!==D||t.depthOcclusion&&c>0&&c<1;const L=n.paint.get("line-gradient"),z=M?"linePattern":"line",O=e.e2(n);let F;if(x&&t.terrain&&t.terrain.clipOrMaskOverlapStencilType()&&(R=!1),0!==c&&t.depthOcclusion){const t=n.paint._values["line-opacity"];t&&t.value&&"constant"===t.value.kind?F=t.value:e.w(`Occlusion opacity for layer ${n.id} is supported only when line-opacity isn't data-driven.`)}"constant"!==s.value.kind&&!1===s.value.isLineProgressConstant&&O.push("VARIABLE_LINE_WIDTH"),x&&("dual-source-blending"!==t.emissiveMode||a?"mrt-fallback"===t.emissiveMode&&O.push("USE_MRT1"):O.push("DUAL_SOURCE_BLENDING"));const k=(r,o,s,a,l,u)=>{for(const f of r){const r=i.getTile(f);if(M&&!r.patternsLoaded())continue;const _=r.getBucket(n);if(!_)continue;if("none"!==_.elevationType&&!l||"none"===_.elevationType&&l)continue;t.prepareDrawTile();const g=[...o],y=t.shadowRenderer,w="road"===_.elevationType&&!!y&&y.enabled;let S=[0,0,0];if(w){const e=t.style.directionalLight,i=t.style.ambientLight;e&&i&&(S=Sn(t.style,e,i)),g.push("RENDER_SHADOWS","DEPTH_TEXTURE","NORMAL_OFFSET")}const A=_.programConfigurations.get(n.id);let O=!1;if(P&&r.imageAtlas){const t=e.e3.from(P),i=t.getPrimary().scaleSelf(b).toString(),n=r.imageAtlas.patternPositions.get(i),o=t.getSecondary(),s=o?r.imageAtlas.patternPositions.get(o.scaleSelf(b).toString()):null;O=!!n&&!!s,n&&A.setConstantPatternPositions(n,s)}C>0&&(O||A.getPatternTransitionVertexBuffer("line-pattern"))&&g.push("LINE_PATTERN_TRANSITION");const k=t.isTileAffectedByFog(f),B=t.getOrCreateProgram(z,{config:A,defines:g,overrideFog:k});if(!M&&E&&I&&r.lineAtlas){const e=r.lineAtlas.getDash(E,I);e&&A.setConstantPatternPositions(e)}w&&y.setupShadows(r.tileID.toUnwrapped(),B,"vector-tile");let[N,V]=n.paint.get("line-trim-offset");if("round"===I||"square"===I){const e=1;N!==V&&(0===N&&(N-=e),1===V&&(V+=e))}const U=x?f.projMatrix:null,j=h?1/_.tileToMeter/e.ay(r,1,t.transform.zoom):1,G=h?1/_.tileToMeter/e.ay(r,1,Math.floor(t.transform.zoom)):1,q=M?e.e4(t,r,n,U,b,j,G,[N,V],S,C):e.e5(t,r,n,U,_.lineClipsArray.length,b,j,G,[N,V],S);if(L){const r=_.gradients[n.id];let o=r.texture;if(n.gradientVersion!==r.version){let s=256;if(n.stepInterpolant){const n=i.getSource().maxzoom,r=f.canonical.z===n?Math.ceil(1<<t.transform.maxZoom-f.canonical.z):1;s=e.aA(e.e6(_.maxLineLength/e.al*1024*r),256,p.maxTextureSize)}r.gradient=e.e7({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:s,image:r.gradient||void 0,clips:_.lineClipsArray}),r.texture?r.texture.update(r.gradient):r.texture=new e.T(p,r.gradient,m.RGBA8),r.version=n.gradientVersion,o=r.texture}
2p.activeTexture.set(m.TEXTURE1),o.bind(n.stepInterpolant?m.NEAREST:m.LINEAR,m.CLAMP_TO_EDGE)}T&&(p.activeTexture.set(m.TEXTURE0),r.lineAtlasTexture&&r.lineAtlasTexture.bind(m.LINEAR,m.REPEAT),A.updatePaintBuffers()),M&&(p.activeTexture.set(m.TEXTURE0),r.imageAtlasTexture&&r.imageAtlasTexture.bind(m.LINEAR,m.CLAMP_TO_EDGE),A.updatePaintBuffers()),l&&!d&&t.terrain.setupElevationDraw(r,B),t.uploadCommonUniforms(p,B,f.toUnwrapped());const H=e=>{null!=F&&(F.value=D*c),B.draw(t,m.TRIANGLES,s,e,v,en.disabled,q,n.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,n.paint,t.transform.zoom,A,[_.layoutVertexBuffer2,_.patternVertexBuffer,_.zOffsetVertexBuffer]),null!=F&&(F.value=D)};if(R&&!l){const e=t.stencilModeForClipping(f).ref;0===e&&x&&p.clear({stencil:0});const i={func:m.EQUAL,mask:255};q.u_alpha_discard_threshold=.8,H(new Ki(i,e,255,m.KEEP,m.KEEP,m.INVERT)),q.u_alpha_discard_threshold=0,H(new Ki(i,e,255,m.KEEP,m.KEEP,m.KEEP))}else q.u_alpha_discard_threshold=R&&l&&u?.8:0,H(l?a:t.stencilModeForClipping(f))}};let B=t.depthModeForSublayer(0,Xi.ReadOnly);const N=new Xi(t.depthOcclusion?m.GREATER:m.LEQUAL,Xi.ReadOnly,t.depthRangeFor3D);if(n.hasNonElevatedBuckets){const i=!x&&t.terrain;0!==c&&i?e.w(`Occlusion opacity for layer ${n.id} is supported on terrain only if the layer has line-z-offset enabled.`):i?e.w(`Cannot render non-elevated lines in immediate mode when terrain is enabled. Layer: ${n.id}.`):k(r,O,B,Ki.disabled,!1,!0)}if(n.hasElevatedBuckets){"hd-road-markup"===u?f||(B=N,O.push("ELEVATED_ROADS")):(O.push("ELEVATED"),B=N,g&&O.push(y?"CROSS_SLOPE_HORIZONTAL":"CROSS_SLOPE_VERTICAL"),d&&O.push("ELEVATION_REFERENCE_SEA"));const e=R?t.stencilModeFor3D():Ki.disabled;t.forceTerrainMode=!0,k(r,O,B,e,!0,!0),R&&k(r,O,B,e,!0,!1),t.forceTerrainMode=!1}R&&(t.resetStencilClippingMasks(),x&&p.clear({stencil:0})),0===c||t.depthOcclusion||x||t.layersWithOcclusionOpacity.push(t.currentLayer)},fill:function(t,i,n,r){const o=n.paint.get("fill-color"),s=n.paint.get("fill-opacity");if(0===s.constantOr(1))return;const a=n.paint.get("fill-emissive-strength"),l=t.colorModeForDrapableLayerRenderPass(a),c=n.paint.get("fill-pattern"),u=t.opaquePassEnabledForLayer()&&!c.constantOr(1)&&1===o.constantOr(e.ao.transparent).a&&1===s.constantOr(0)?"opaque":"translucent";let h="none";"none"!==n.layout.get("fill-elevation-reference")?h="road":0!==n.paint.get("fill-z-offset").constantOr(1)&&(h="offset");const d=!(!t.terrain||!t.terrain.enabled),f={painter:t,sourceCache:i,layer:n,coords:r,colorMode:l,elevationType:h,terrainEnabled:d,pass:u};if("shadow"===t.renderPass)return void(t.shadowRenderer&&"road"===h&&!d&&function(e){const{painter:t,sourceCache:i,layer:n,coords:r}=e,o=t.context.gl,s=e.painter.shadowRenderer;for(const e of r){const r=i.getTile(e),a=r.getBucket(n);if(!a)continue;const l=a.elevatedStructures;if(!l)continue;if(!l.shadowCasterSegments||0===l.shadowCasterSegments.segments[0].primitiveLength)continue;t.prepareDrawTile();const c=a.bufferData.programConfigurations.get(n.id),u=t.isTileAffectedByFog(e),h=t.getOrCreateProgram("elevatedStructuresDepth",{config:c,overrideFog:u}),d=s.calculateShadowPassMatrixFromTile(r.tileID.toUnwrapped());t.uploadCommonUniforms(t.context,h,e.toUnwrapped());const f={u_matrix:d,u_depth_bias:0};h.draw(t,o.TRIANGLES,s.getShadowPassDepthMode(),Ki.disabled,s.getShadowPassColorMode(),en.disabled,f,n.id,l.vertexBuffer,l.indexBuffer,l.shadowCasterSegments,n.paint,t.transform.zoom,c)}}(f));const p="mrt-fallback"===t.emissiveMode;if("offset"!==h){if(ps(f,!1,p),"road"===h){const e=!d&&"translucent"===t.renderPass;e&&fs(t,i,n,r,"geometry"),ps(f,!0,p,Ki.disabled),e&&function(e){const{painter:t,sourceCache:i,layer:n,coords:r,colorMode:o}=e,s=t.context.gl,a=e.painter.shadowRenderer,l=!!a&&a.enabled,c=new Xi(t.context.gl.LEQUAL,Xi.ReadOnly,t.depthRangeFor3D);let u=[0,0,0];if(l){const e=t.style.directionalLight,i=t.style.ambientLight;e&&i&&(u=Sn(t.style,e,i))}const h=e=>{for(const h of r){const r=i.getTile(h),d=r.getBucket(n);if(!d)continue;const f=d.elevatedStructures;if(!f)continue;let p,m;if(e?(p=f.renderableBridgeSegments,m=f.bridgeProgramConfigurations.get(n.id)):(p=f.renderableTunnelSegments,m=f.tunnelProgramConfigurations.get(n.id)),!p||0===p.segments[0].primitiveLength)continue;m.updatePaintBuffers(),t.prepareDrawTile();const _=t.isTileAffectedByFog(h),g=[];
2l&&g.push("RENDER_SHADOWS","DEPTH_TEXTURE","NORMAL_OFFSET");const y=t.getOrCreateProgram("elevatedStructures",{config:m,overrideFog:_,defines:g}),v=t.translatePosMatrix(h.projMatrix,r,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));l&&a.setupShadows(r.tileID.toUnwrapped(),y,"vector-tile");const x=Mo(v,u);t.uploadCommonUniforms(t.context,y,h.toUnwrapped()),y.draw(t,s.TRIANGLES,c,Ki.disabled,o,en.backCCW,x,n.id,f.vertexBuffer,f.indexBuffer,p,n.paint,t.transform.zoom,m,[f.vertexBufferNormal])}};h(!0),h(!1)}(f)}}else ps(f,!1,p,t.stencilModeFor3D())},"fill-extrusion":function(t,i,n,r){const o=n.paint.get("fill-extrusion-opacity"),s=t.context,a=s.gl,l=t.terrain,c=l&&l.renderingToTexture;if(0===o)return;const u="mrt-fallback"===t.emissiveMode,h=t.conflationActive&&t.style.isLayerClipped(n,i.getSource()),d=t.style.order.indexOf(n.fqid);if(h&&function(e,t,i,n,r){for(const o of n){const n=t.getTile(o).getBucket(i);n&&(n.updateReplacement(o,e.replacementSource,r),n.uploadCentroid(e.context))}}(t,i,n,r,d),l||h)for(const e of r){const r=i.getTile(e).getBucket(n);r&&ys(t.context,i,e,r,n,l,h)}if("shadow"===t.renderPass&&t.shadowRenderer){const s=t.shadowRenderer;if(l&&o<.65&&n._transitionablePaint._values["fill-extrusion-opacity"].value.expression instanceof e.ad)return;const a=s.getShadowPassDepthMode(),c=s.getShadowPassColorMode();ms(t,i,n,r,a,Ki.disabled,c,h)}else if("translucent"===t.renderPass){const d=!n.paint.get("fill-extrusion-pattern").constantOr(1),f=n.paint.get("fill-extrusion-color").constantOr(e.ao.white);if(!c&&0!==f.a){const e=new Xi(t.context.gl.LEQUAL,Xi.ReadWrite,t.depthRangeFor3D);1===o&&d?ms(t,i,n,r,e,Ki.disabled,Zi.unblended,h):(ms(t,i,n,r,e,Ki.disabled,Zi.disabled,h),ms(t,i,n,r,e,t.stencilModeFor3D(),t.colorModeForRenderPass(),h),t.resetStencilClippingMasks())}if(t.style.enable3dLights()&&d&&(!l&&"globe"!==t.transform.projection.name||c)){const o=n.paint.get("fill-extrusion-opacity"),d=n.paint.get("fill-extrusion-ambient-occlusion-intensity"),f=n.paint.get("fill-extrusion-ambient-occlusion-ground-radius"),p=n.paint.get("fill-extrusion-flood-light-intensity"),m="none"===n.paint.get("fill-extrusion-flood-light-color-use-theme").constantOr("default"),_=n.paint.get("fill-extrusion-flood-light-color").toNonPremultipliedRenderColor(m?null:n.lut).toArray01().slice(0,3),g=d>0&&f>0,y=p>0,v=(e,t,i)=>(1-i)*e+i*t,x=new _s;x.translate=n.paint.get("fill-extrusion-translate"),x.translateAnchor=n.paint.get("fill-extrusion-translate-anchor"),x.edgeRadius=n.layout.get("fill-extrusion-edge-radius"),x.cutoffFadeRange=n.paint.get("fill-extrusion-cutoff-fade-range");const b=s=>{const l=t.depthModeForSublayer(1,Xi.ReadOnly,a.LEQUAL,!0),c=n.paint.get(s?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),u=v(.1,3,c),m=t._showOverdrawInspector;if(!m){const c=new Ki({func:a.ALWAYS,mask:255},255,255,a.KEEP,a.KEEP,a.REPLACE),m=new Zi([a.ONE,a.ONE,a.ONE,a.ONE],e.ao.transparent,[!1,!1,!1,!0],a.MIN);gs(x,t,i,n,r,l,c,m,en.disabled,s,"sdf",o,d,f,p,_,u,h,!1)}{const c=m?Ki.disabled:new Ki({func:a.EQUAL,mask:255},255,255,a.KEEP,a.DECR,a.DECR),g=m?t.colorModeForRenderPass():new Zi([a.ONE_MINUS_DST_ALPHA,a.DST_ALPHA,a.ONE,a.ONE],e.ao.transparent,[!0,!0,!0,!0]);gs(x,t,i,n,r,l,c,g,en.disabled,s,"color",o,d,f,p,_,u,h,!1)}};if(c){const c=()=>{const t=l.drapeBufferSize[0],i=l.drapeBufferSize[1];let n=l.framebufferCopyTexture;return n&&(!n||n.size[0]===t&&n.size[1]===i)||(n&&n.destroy(),n=l.framebufferCopyTexture=new e.T(s,new e.q({width:t,height:i}),a.RGBA8)),n.bind(a.LINEAR,a.CLAMP_TO_EDGE),a.copyTexSubImage2D(a.TEXTURE_2D,0,0,0,0,0,t,i),n},m=(s,l,m)=>{const g=t.depthModeForSublayer(1,Xi.ReadOnly,a.LEQUAL,!1),y=n.paint.get(s?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),b=v(.1,3,y);{const c=new Zi([a.ONE,a.ONE,a.ONE,a.ONE],e.ao.transparent,[!1,!1,!1,!0]);gs(x,t,i,n,r,g,Ki.disabled,c,en.disabled,s,"clear",o,d,f,p,_,b,h,l)}{const c=new Ki({func:a.ALWAYS,mask:255},255,255,a.KEEP,a.KEEP,a.REPLACE),u=new Zi([a.ONE,a.ONE,a.ONE,a.ONE],e.ao.transparent,[!1,!1,!1,!0],a.MIN);gs(x,t,i,n,r,g,c,u,en.disabled,s,"sdf",o,d,f,p,_,b,h,l)}u&&!s&&(m=c());
vendor: 4,777 bytes, line 2
2{const c=s?a.ZERO:a.ONE_MINUS_DST_ALPHA,u=new Ki({func:a.EQUAL,mask:255},255,255,a.KEEP,a.DECR,a.DECR),m=new Zi([c,a.DST_ALPHA,a.ONE_MINUS_DST_ALPHA,a.ZERO],e.ao.transparent,[!0,!0,!0,!0]);gs(x,t,i,n,r,g,u,m,en.disabled,s,"color",o,d,f,p,_,b,h,l)}if(!u||s){const c=new Zi([a.ONE,a.ONE,a.ONE,s?a.ZERO:a.ONE],e.ao.transparent,[!1,!1,!1,!0],s?a.FUNC_ADD:a.MAX);gs(x,t,i,n,r,g,Ki.disabled,c,en.disabled,s,"clear",o,d,f,p,_,b,h,l,m)}else{a.drawBuffers([a.NONE,a.COLOR_ATTACHMENT1]);const c=new Ki({func:a.EQUAL,mask:255},254,255,a.KEEP,a.DECR,a.DECR),u=new Zi([a.ONE,a.ONE,a.ONE,a.ONE],e.ao.transparent,[!0,!1,!1,!1],a.MAX);gs(x,t,i,n,r,g,c,u,en.disabled,s,"emissive",o,d,f,p,_,b,h,l,m),a.drawBuffers([a.COLOR_ATTACHMENT0])}};if(g||y){let e;t.prepareDrawTile(),u&&!g||(e=c()),g&&m(!0,!1,e),y&&m(!1,!0,e)}}else g&&b(!0),y&&b(!1),(g||y)&&t.resetStencilClippingMasks()}}},building:function(e,t,i,n){e.currentLayer<e.firstLightBeamLayer&&(e.firstLightBeamLayer=e.currentLayer);const r=i.paint.get("building-ambient-occlusion-ground-intensity"),o=i.paint.get("building-ambient-occlusion-ground-radius"),s=i.paint.get("building-ambient-occlusion-ground-attenuation"),a=i.paint.get("building-opacity");if(a<=0)return;let l=r>0&&o>0,c=!0;const u=i.paint.get("building-vertical-scale");if(u<=0)return;e.shadowRenderer||(c=!1);const h=e.conflationActive&&e.style.isLayerClipped(i,t.getSource()),d=e.style.order.indexOf(i.fqid);if(function(e,t,i,n,r,o){for(const s of o){const o=t.getTile(s).getBucket(i);o&&(r&&o.updateReplacement(s,e.replacementSource,n),o.uploadUpdatedIndexBuffer(e.context))}}(e,t,i,d,h,n),function(e,t,i,n){for(const r of n){const n=t.getTile(r).getBucket(i);n&&n.needsEvaluation()&&n.uploadUpdatedColorBuffer(e.context)}}(e,t,i,n),i.resetLayerRenderingStats(e),e.shadowRenderer&&(e.shadowRenderer.useNormalOffset=!0),"shadow"===e.renderPass&&e.shadowRenderer){const r=e.shadowRenderer,o=[],s=r.getShadowPassDepthMode();Ts({painter:e,source:t,layer:i,coords:n,defines:o,blendMode:r.getShadowPassColorMode(),depthMode:s,opacity:a,verticalScale:u,facadeEmissiveChance:0,facadeAOIntensity:0,floodLightIntensity:0,floodLightColor:[0,0,0]})}else if("translucent"===e.renderPass){let d=["HAS_ATTRIBUTE_a_part_color_emissive","LIGHTING_3D_MODE"];c&&(d=d.concat("RENDER_SHADOWS","DEPTH_TEXTURE")),e.shadowRenderer&&e.shadowRenderer.useNormalOffset&&(d=d.concat("NORMAL_OFFSET"));const f=i.paint.get("building-facade-emissive-chance"),p=i.paint.get("building-ambient-occlusion-intensity"),m=i.paint.get("building-flood-light-intensity"),_="none"===i.paint.get("building-flood-light-color-use-theme").constantOr("default"),g=i.paint.get("building-flood-light-color").toNonPremultipliedRenderColor(_?null:i.lut).toArray01().slice(0,3),y=i.paint.get("building-flood-light-ground-attenuation"),v=m>0,x=new Xi(e.context.gl.LEQUAL,Xi.ReadWrite,e.depthRangeFor3D);a<1&&Ts({painter:e,source:t,layer:i,coords:n,defines:d,blendMode:Zi.disabled,depthMode:x,opacity:a,verticalScale:u,facadeEmissiveChance:f,facadeAOIntensity:p,floodLightIntensity:m,floodLightColor:g,depthOnly:!0});const b=e.colorModeForRenderPass();Ts({painter:e,source:t,layer:i,coords:n,defines:d,blendMode:b,depthMode:x,opacity:a,verticalScale:u,facadeEmissiveChance:f,facadeAOIntensity:p,floodLightIntensity:m,floodLightColor:g}),l&&Ss(e,t,i,n,!0,a,r,o,m,g,s,h),v&&Ss(e,t,i,n,!1,a,r,o,m,g,y,h)}else if("light-beam"===e.renderPass){const r=["HAS_ATTRIBUTE_a_part_color_emissive","HAS_ATTRIBUTE_a_bloom_attenuation"],o=new Xi(e.context.gl.LEQUAL,Xi.ReadOnly,e.depthRangeFor3D);Ts({painter:e,source:t,layer:i,coords:n,defines:r,blendMode:Zi.alphaBlended,depthMode:o,opacity:a,verticalScale:u,facadeEmissiveChance:0,facadeAOIntensity:0,floodLightIntensity:0,floodLightColor:[0,0,0]})}e.shadowRenderer&&(e.shadowRenderer.useNormalOffset=!1),e.resetStencilClippingMasks()},hillshade:function(e,t,i,n){if("offscreen"!==e.renderPass&&"translucent"!==e.renderPass)return;if(e.style.disableElevatedTerrain)return;const r=e.context,o=e.terrain&&e.terrain.renderingToTexture,[s,a]="translucent"!==e.renderPass||o?[{},n]:e.stencilConfigForOverlap(n);for(const n of a){const r=t.getTile(n);if(r.needsHillshadePrepare&&"offscreen"===e.renderPass)mr(e,r,i);else if("translucent"===e.renderPass){const t=e.depthModeForSublayer(0,Xi.ReadOnly),a=i.paint.get("hillshade-emissive-strength"),l=e.colorModeForDrapableLayerRenderPass(a),c=o&&e.terrain?e.terrain.stencilModeForRTTOverlap(n):s[n.overscaledZ];fr(e,n,r,i,t,c,l)}}r.viewport.set([0,0,e.width,e.height]),e.resetStencilClippingMasks()},raster:function(t,i,n,r,o,s){if("translucent"!==t.renderPass)return;if(0===n.paint.get("raster-opacity"))return;const a="globe"===t.transform.projection.name,l=0!==n.paint.get("raster-elevation"),c=l&&a;if(t.renderElevatedRasterBackface&&!c)return;
2const u=t.context,h=u.gl,d=i.getSource(),f=function(t,i,n,r,o){const s=i.paint.get("raster-color"),a="raster-array"===t.type,l=[],c=i.paint.get("raster-resampling"),u=i.paint.get("raster-color-mix");let h=i.paint.get("raster-color-range");const d=[u[0],u[1],u[2],0],f=u[3];let p="nearest"===c?r.NEAREST:r.LINEAR;if(a&&(l.push("RASTER_ARRAY"),s||l.push("RASTER_COLOR"),"linear"===c&&l.push("RASTER_ARRAY_LINEAR"),p=r.NEAREST,!h&&t.rasterLayers)){const e=t.rasterLayers.find(({id:e})=>e===i.sourceLayer);e&&e.fields&&e.fields.range&&(h=e.fields.range)}if(h=h||[0,1],s){l.push("RASTER_COLOR"),n.activeTexture.set(r.TEXTURE2),i.updateColorRamp(h);let t=i.colorRampTexture;t||(t=i.colorRampTexture=new e.T(n,i.colorRamp,r.RGBA8)),t.bind(r.LINEAR,r.CLAMP_TO_EDGE)}return o&&l.push("USE_MRT1"),{mix:d,range:h,offset:f,defines:l,resampling:p}}(d,n,u,h,t.terrain&&t.terrain.renderingToTexture&&"mrt-fallback"===t.emissiveMode);if(d instanceof e.aU&&!r.length&&!a)return;const p=n.paint.get("raster-emissive-strength"),m=t.colorModeForDrapableLayerRenderPass(p),_=t.terrain&&t.terrain.renderingToTexture,g=!t.options.moving,y="nearest"===n.paint.get("raster-resampling")?h.NEAREST:h.LINEAR;if(d instanceof e.aU&&!r.length&&(d.onNorthPole||d.onSouthPole)){const e=l?t.stencilModeFor3D():Ki.disabled;return void Is(!!d.onNorthPole,null,t,i,n,p,f,en.disabled,e)}if(!r.length)return;const[v,x]=d instanceof e.aU||_?[{},r]:t.stencilConfigForOverlap(r),b=x[x.length-1].overscaledZ;c&&f.defines.push("PROJECTION_GLOBE_VIEW"),l&&f.defines.push("RENDER_CUTOFF");const w=(r,o,x)=>{for(const w of r){const r=w.toUnwrapped(),T=i.getTile(w);if(_&&(!T||!T.hasData()))continue;u.activeTexture.set(h.TEXTURE0);const S=Ms(T,d,n,f);if(!S||!S.texture)continue;const{texture:E,mix:I,offset:A,tileSize:M,buffer:C}=S;let P,D;_?(P=Xi.disabled,D=w.projMatrix):l?(P=new Xi(h.LEQUAL,Xi.ReadWrite,t.depthRangeFor3D),D=a?Float32Array.from(t.transform.expandedFarZProjMatrix):t.transform.calculateProjMatrix(r,g)):(P=t.depthModeForSublayer(w.overscaledZ-b,1===n.paint.get("raster-opacity")?Xi.ReadWrite:Xi.ReadOnly,h.LESS),D=t.transform.calculateProjMatrix(r,g));const R=t.terrain&&_?t.terrain.stencilModeForRTTOverlap(w):v[w.overscaledZ],L=s?0:n.paint.get("raster-fade-duration");T.registerFadeDuration(L);const z=i.findLoadedParent(w,0),O=lo(T,z,i,t.transform,L);let F,k;!O.isFading&&T.refreshedUponExpiration&&(T.refreshedUponExpiration=!1),t.terrain&&t.terrain.prepareDrawTile(),u.activeTexture.set(h.TEXTURE0),E.bind(y,h.CLAMP_TO_EDGE),u.activeTexture.set(h.TEXTURE1),z?(z.texture&&z.texture.bind(y,h.CLAMP_TO_EDGE),F=Math.pow(2,z.tileID.overscaledZ-T.tileID.overscaledZ),k=[T.tileID.canonical.x*F%1,T.tileID.canonical.y*F%1]):E.bind(y,h.CLAMP_TO_EDGE),"useMipmap"in E&&u.extTextureFilterAnisotropic&&t.transform.pitch>20&&h.texParameterf(h.TEXTURE_2D,u.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,u.extTextureFilterAnisotropicMax);const B=t.transform;let N;const V=l?As(B):[0,0,0,0];let U,j,G,q,H,$=0;if(c&&d instanceof e.aU&&d.coordinates.length>3)U=Float32Array.from(e.bk(e.dJ(new e.cD(0,0,0)))),j=Float32Array.from(B.globeMatrix),G=Float32Array.from(e.dF(B)),q=[e.aF(B.center.lng),e.aJ(B.center.lat)],N=d.elevatedGlobePerspectiveTransform,H=d.elevatedGlobeGridMatrix||new Float32Array(9);else if(c){const t=e.dG(w.canonical);$=e.dH(t.getCenter().lat),U=Float32Array.from(e.bk(e.dJ(w.canonical))),j=Float32Array.from(B.globeMatrix),G=Float32Array.from(e.dF(B)),q=[e.aF(B.center.lng),e.aJ(B.center.lat)],N=[0,0],H=Float32Array.from(e.dI(w.canonical,t,$,B.worldSize/B._pixelsPerMercatorPixel))}else N=d instanceof e.aU?d.perspectiveTransform:[0,0],U=new Float32Array(16),j=new Float32Array(9),G=new Float32Array(16),q=[0,0],H=new Float32Array(9);const W=No(D,U,j,G,H,k||[0,0],e.aj(t.transform.zoom),q,V,F||1,O,n,N,l?n.paint.get("raster-elevation"):0,2,I,A,f.range,M,C,p),Z=t.isTileAffectedByFog(w),X=t.getOrCreateProgram("raster",{defines:f.defines,overrideFog:Z});if(t.uploadCommonUniforms(u,X,r),d instanceof e.aU){const i=d.elevatedGlobeVertexBuffer,r=d.elevatedGlobeIndexBuffer;if(_||!a)d.boundsBuffer&&d.boundsSegments&&X.draw(t,h.TRIANGLES,P,Ki.disabled,m,en.disabled,W,n.id,d.boundsBuffer,t.quadTriangleIndexBuffer,d.boundsSegments);else if(i&&r){const s=B.zoom<=e.c_?d.elevatedGlobeSegments:d.getSegmentsForLongitude(
2B.center.lng);s&&X.draw(t,h.TRIANGLES,P,Ki.disabled,m,o,W,n.id,i,r,s)}}else if(c){P=new Xi(h.LEQUAL,Xi.ReadOnly,t.depthRangeFor3D);const e=t.globeSharedBuffers;if(e){const[i,r,s]=e.getGridBuffers($,!1);X.draw(t,h.TRIANGLES,P,x||R,t.colorModeForRenderPass(),o,W,n.id,i,r,s)}}else{const{tileBoundsBuffer:e,tileBoundsIndexBuffer:i,tileBoundsSegments:r}=t.getTileBoundsBuffers(T);X.draw(t,h.TRIANGLES,P,R,m,en.disabled,W,n.id,e,i,r)}}if(!(d instanceof e.aU)&&c)for(const e of r){const r=e.canonical.y===(1<<e.canonical.z)-1;0===e.canonical.y&&Is(!0,e,t,i,n,p,f,o,x||Ki.disabled),r&&Is(!1,e,t,i,n,p,f,o===en.frontCW?en.backCW:en.frontCW,x||Ki.disabled)}};c?w(x,t.renderElevatedRasterBackface?en.backCW:en.frontCW,t.stencilModeFor3D()):w(x,en.disabled,void 0),t.resetStencilClippingMasks()},"raster-particle":function(t,i,n,r,o,s){"offscreen"===t.renderPass&&function(t,i,n,r){if(!r.length)return;const o=t.context,s=o.gl,a=i.getSource();if(!(a instanceof dt))return;const l=Math.ceil(Math.sqrt(n.paint.get("raster-particle-count")));let c=n.particlePositionRGBAImage;if(!c||c.width!==l){const t=function(e){const t=e*e,i=new Uint8Array(4*t),n=function(e){return e|=0,e=Math.imul(2747636419^e,2654435769),e=Math.imul(e^e>>>16,2654435769),((e=Math.imul(e^e>>>16,2654435769))>>>0)/4294967296},r=1/1.1;for(let e=0;e<t;e++){const t=r*(n(2*e+0)+Uo),o=r*(n(2*e+1)+Uo),s=255*t%1,a=255*o%1,l=s,c=o-a/255,u=a;i[4*e+0]=255*(t-s/255),i[4*e+1]=255*l,i[4*e+2]=255*c,i[4*e+3]=255*u}return i}(l);c=n.particlePositionRGBAImage=new e.q({width:l,height:l},t)}let u=n.particleFramebuffer;u?u.width!==l&&(u.destroy(),u=n.particleFramebuffer=o.createFramebuffer(l,l,1,null)):u=n.particleFramebuffer=o.createFramebuffer(l,l,1,null);const h=[];for(const e of r){const t=i.getTile(e);if(!(t instanceof Dt))continue;const r=Ds(t,a,n);if(!r)continue;const s=[t.tileSize,t.tileSize];let u=n.tileFramebuffer;u||(u=n.tileFramebuffer=o.createFramebuffer(s[0],s[1],1,null));let d=t.rasterParticleState;d||(d=t.rasterParticleState=new Ps(o,e,s,c));const f=d.update(n.lastInvalidatedAt);d.particleTextureDimension!==l&&d.updateParticleTexture(e,c);const p=d.targetColorTexture;d.targetColorTexture=d.backgroundColorTexture,d.backgroundColorTexture=p;const m=d.particleTexture0;d.particleTexture0=d.particleTexture1,d.particleTexture1=m,h.push([e,r,d,f])}if(0===h.length)return;const d=e.o.now(),f=n.previousDrawTimestamp?.001*(d-n.previousDrawTimestamp):.0167;if(n.previousDrawTimestamp=d,n.hasColorMap()){o.activeTexture.set(s.TEXTURE0+2);let t=n.colorRampTexture;t||(t=n.colorRampTexture=new e.T(o,n.colorRamp,s.RGBA8)),t.bind(s.LINEAR,s.CLAMP_TO_EDGE)}o.bindFramebuffer.set(n.tileFramebuffer.framebuffer),function(t,i,n){const r=t.context,o=r.gl,s=i.tileFramebuffer;r.activeTexture.set(o.TEXTURE0);const a={u_texture:0,u_opacity:1.05*(c=i.paint.get("raster-particle-fade-opacity-factor"))/(c+.05)},l=t.getOrCreateProgram("rasterParticleTexture",{defines:[],overrideFog:!1});var c;for(const c of n){const[,,n,u]=c;s.colorAttachment0.set(n.targetColorTexture.texture),r.viewport.set([0,0,s.width,s.height]),r.clear({color:e.ao.transparent}),u&&(n.backgroundColorTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE),l.draw(t,o.TRIANGLES,Xi.disabled,Ki.disabled,Zi.alphaBlended,en.disabled,a,i.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments))}}(t,n,h),function(t,i,n,r){const o=t.context,s=o.gl,a=n.tileFramebuffer,l="globe"===t.transform.projection.name,c=n.paint.get("raster-particle-max-speed");for(const u of r){const[r,h,d]=u;o.activeTexture.set(s.TEXTURE0+0),h.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE),a.colorAttachment0.set(d.targetColorTexture.texture);const f=t.getOrCreateProgram("rasterParticleDraw",{defines:h.defines,overrideFog:!1});o.activeTexture.set(s.TEXTURE0+1);const p=h.scalarData?[]:[0,1,2,3].map(t=>e.e9[t](r));p.push(r);const m=r.canonical.x,_=r.canonical.y;for(const e of p){const o=i.getTile(l?e.wrapped():e);if(!o)continue;const a=o.rasterParticleState;if(!a)continue;const u=e.canonical.x+(1<<e.canonical.z)*(e.wrap-r.wrap),d=e.canonical.y;a.particleTexture0.bind(s.NEAREST,s.CLAMP_TO_EDGE);const p=Go(1,a.particleTexture0.size[0],[u-m,d-_],0,h.texture.size,2,c,h.textureOffset,h.scale,h.offset);f.draw(t,s.POINTS,Xi.disabled,Ki.disabled,Zi.alphaBlended,en.disabled,p,n.id,a.particleIndexBuffer,void 0,a.particleSegment)}}}(t,i,n,h),o.bindFramebuffer.set(n.particleFramebuffer.framebuffer),function(t,i,n,r){const o=t.context,s=o.gl,a=i.paint.get("raster-particle-max-speed"),l=r*i.paint.get("raster-particle-speed-factor")*.15,c=function(e){return Math.pow(e,6)}(.01+1*i.paint.get("raster-particle-reset-rate-factor")),u=i.particleFramebuffer;o.viewport.set([0,0,u.width,u.height]);for(const r of n){const[,n,h]=r;o.activeTexture.set(s.TEXTURE0+0),n.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE),o.activeTexture.set(s.TEXTURE0+1);const d=h.particleTexture0;d.bind(s.NEAREST,s.CLAMP_TO_EDGE);const f=qo(1,d.size[0],0,n.texture.size,a,l,c,n.textureOffset,n.scale,n.offset);u.colorAttachment0.set(h.particleTexture1.texture),o.clear({color:e.ao.transparent}),t.getOrCreateProgram("rasterParticleUpdate",{defines:n.defines}).draw(t,s.TRIANGLES,Xi.disabled,Ki.disabled,Zi.unblended,en.disabled,f,i.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments)}}(t,n,h,f)}(t,i,n,r),"translucent"===t.renderPass&&(function(t,i,n,r){const o=t.context,s=o.gl,a=i.get
vendor: 8,836 bytes, line 2
2Source().tileSize,l=5*(1-e.ah(e.cL,e.cL+1,t.transform.zoom))*a+n.paint.get("raster-particle-elevation"),c=!t.options.moving,u="globe"===t.transform.projection.name;if(!r.length)return;const[h,d]=t.stencilConfigForOverlap(r),f=[];u&&f.push("PROJECTION_GLOBE_VIEW");const p=t.stencilModeFor3D();for(const r of d){const a=r.toUnwrapped(),d=i.getTile(r);if(!d.rasterParticleState)continue;const m=d.rasterParticleState,_=100;d.registerFadeDuration(_);const g=i.findLoadedParent(r,0),y=lo(d,g,i,t.transform,_);let v,x;t.terrain&&t.terrain.prepareDrawTile(),o.activeTexture.set(s.TEXTURE0),m.targetColorTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE),o.activeTexture.set(s.TEXTURE1),g&&g.rasterParticleState?(g.rasterParticleState.targetColorTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE),v=Math.pow(2,g.tileID.overscaledZ-d.tileID.overscaledZ),x=[d.tileID.canonical.x*v%1,d.tileID.canonical.y*v%1]):m.targetColorTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE);const b=u?Float32Array.from(t.transform.expandedFarZProjMatrix):t.transform.calculateProjMatrix(a,c),w=t.transform,T=Rs(w),S=e.dG(r.canonical),E=e.dH(S.getCenter().lat);let I,A,M,C,P;u?(I=Float32Array.from(e.bk(e.dJ(r.canonical))),A=Float32Array.from(w.globeMatrix),M=Float32Array.from(e.dF(w)),C=[e.aF(w.center.lng),e.aJ(w.center.lat)],P=Float32Array.from(e.dI(r.canonical,S,E,w.worldSize/w._pixelsPerMercatorPixel))):(I=new Float32Array(16),A=new Float32Array(9),M=new Float32Array(16),C=[0,0],P=new Float32Array(9));const D=jo(b,I,A,M,P,x||[0,0],e.aj(t.transform.zoom),C,T,v||1,y,l),R=t.isTileAffectedByFog(r),L=t.getOrCreateProgram("rasterParticle",{defines:f,overrideFog:R});if(t.uploadCommonUniforms(o,L,a),u){const e=new Xi(s.LEQUAL,Xi.ReadOnly,t.depthRangeFor3D),i=0,r=t.globeSharedBuffers;if(r){const[o,a,l]=r.getGridBuffers(E,0!==i);L.draw(t,s.TRIANGLES,e,p,Zi.alphaBlended,t.renderElevatedRasterBackface?en.frontCCW:en.backCCW,D,n.id,o,a,l)}}else{const e=t.depthModeForSublayer(0,Xi.ReadOnly),i=h[r.overscaledZ],{tileBoundsBuffer:o,tileBoundsIndexBuffer:a,tileBoundsSegments:l}=t.getTileBoundsBuffers(d);L.draw(t,s.TRIANGLES,e,i,Zi.alphaBlended,en.disabled,D,n.id,o,a,l)}}t.resetStencilClippingMasks()}(t,i,n,r),t.style.map.triggerRepaint())},background:function(t,i,n,r){const o=n.paint.get("background-color"),s="none"===n.paint.get("background-color-use-theme").constantOr("default"),a=n.paint.get("background-opacity"),l=n.paint.get("background-emissive-strength"),c="viewport"===n.paint.get("background-pitch-alignment");if(0===a)return;const u=t.context,h=u.gl,d=t.transform,f=d.tileSize,p=n.paint.get("background-pattern");let m;if(void 0!==p){if(null===p)return;if(m=t.imageManager.getPattern(e.I.from(p.toString()),n.scope,t.style.getLut(n.scope)),!m)return}const _=!p&&1===o.a&&1===a&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass!==_)return;const g=Ki.disabled,y=t.depthModeForSublayer(0,"opaque"===_?Xi.ReadWrite:Xi.ReadOnly),v=t.colorModeForDrapableLayerRenderPass(l),x=p?"backgroundPattern":"background";let b,w=r;w||(b=t.getBackgroundTiles(),w=Object.values(b).map(e=>e.tileID)),p&&(u.activeTexture.set(h.TEXTURE0),t.imageManager.bind(t.context,n.scope));const T=[];if(t.terrain&&t.terrain.renderingToTexture&&"mrt-fallback"===t.emissiveMode&&T.push("USE_MRT1"),c){const i=t.getOrCreateProgram(x,{overrideFog:!1,overrideRtt:!0,defines:T}),r=new Float32Array(e.bA([])),u=new e.aQ(0,0,0,0,0),d=p?Zo(r,l,a,t,0,n.scope,m,c,{tileID:u,tileSize:f}):Wo(r,l,a,o.toPremultipliedRenderColor(s?null:n.lut));i.draw(t,h.TRIANGLES,y,g,v,en.disabled,d,n.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments)}else for(const e of w){const _=t.isTileAffectedByFog(e),w=t.getOrCreateProgram(x,{overrideFog:_,defines:T}),S=e.toUnwrapped(),E=r?e.projMatrix:t.transform.calculateProjMatrix(S);t.prepareDrawTile();const I=i?i.getTile(e):b?b[e.key]:new Pt(e,f,d.zoom,t),A=p?Zo(E,l,a,t,0,n.scope,m,c,{tileID:e,tileSize:f}):Wo(E,l,a,o.toPremultipliedRenderColor(s?null:n.lut));t.uploadCommonUniforms(u,w,S);const{tileBoundsBuffer:M,tileBoundsIndexBuffer:C,tileBoundsSegments:P}=t.getTileBoundsBuffers(I);w.draw(t,h.TRIANGLES,y,g,v,en.disabled,A,n.id,M,C,P)}},sky:function(t,i,n){const r=t._atmosphere?e.aj(t.transform.zoom):1,o=n.paint.get("sky-opacity")*r;if(0===o)return;const s=t.context,a=n.paint.get("sky-type"),l=new Xi(s.gl.LEQUAL,Xi.ReadOnly,[0,1]),c=t.frameCounter/1e3%1;"atmosphere"===a?"offscreen"===t.renderPass?n.needsSkyboxCapture(t)&&(function(t,i){const n=t.context,r=n.gl;let o=i.skyboxFbo;if(!o){o=i.skyboxFbo=n.createFramebuffer(32,32,1,null),i.skyboxGeometry=new $s(n),i.skyboxTexture=n.gl.createTexture(),r.bindTexture(r.TEXTURE_CUBE_MAP,i.skyboxTexture),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_MAG_FILTER,r.LINEAR);for(let e=0;e<6;++e)r.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,r.RGBA,32,32,0,r.RGBA,r.UNSIGNED_BYTE,null)}n.bindFramebuffer.set(o.framebuffer),n.viewport.set([0,0,32,32]);const s=i.getCenter(t,!0),a=t.getOrCreateProgram("skyboxCapture"),l=new Float64Array(16);e.bA(l),e.en(l,l,.5*-Math.PI),Ws(t,i,a,l,s,0),e.bA(l),e.en(l,l,.5*Math.PI),Ws(t,i,a,l,s,1),e.bA(l),e.cU(l,l,.5*-Math.PI),Ws(t,i,a,l,s,2),e.bA(l),e.cU(l,l,.5*Math.PI),Ws(t,i,a,l,s,3),e.bA(l),Ws(t,i,a,l,s,4),e.bA(l),e.en(l,l,Math.PI),Ws(t,i,a,l,s,5),n.viewport.set([0,0,t.width,t.height])}(t,n),n.markSkyboxValid(t)):"sky"===t.renderPass&&function(e,t,i,n,r){const o=e.context,s=o.gl,a=e.transform,l=e.getOrCreateProgram("skybox");o.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_CUBE_MAP,t.skyboxTexture);const c=((e,t,i,n,r)=>({u_matrix:e,u_sun_direction:t,u_cubemap:0,u_opacity:n,u_temporal_offset:r}))(a.skyboxMatrix,t.getCenter(e,!1),0,n,r);e.uploadCommonUniforms(o,l),l.draw(e,s.TRIANGLES,i,Ki.disabled,e.colorModeForRenderPass(),en.backCW,c,"skybox",t.skyboxGeometry.vertexBuffer,t.skyboxGeometry.indexBuffer,t.skyboxGeometry.segment)}(t,n,l,o,c):"gradient"===a&&"sky"===t.renderPass&&function(t,i,n,r,o){const s=t.context,a=s.gl,l=t.transform,c=t.getOrCreateProgram("skyboxGradient");i.skyboxGeometry||(i.skyboxGeometry=new $s(s)),s.activeTexture.set(a.TEXTURE0);let u=i.colorRampTexture;u||(u=i.colorRampTexture=new e.T(s,i.colorRamp,a.RGBA8)),u.bind(a.LINEAR,a.CLAMP_TO_EDGE);const h=((t,i,n,r,o)=>({u_matrix:t,u_color_ramp:0,u_center_direction:i,u_radius:e.an(n),u_opacity:r,u_temporal_offset:o}))(l.skyboxMatrix,i.getCenter(t,!1),i.paint.get("sky-gradient-radius"),r,o);t.uploadCommonUniforms(s,c),c.draw(t,a.TRIANGLES,n,Ki.disabled,t.colorModeForRenderPass(),en.backCW,h,"skyboxGradient",i.skyboxGeometry.vertexBuffer,i.skyboxGeometry.indexBuffer,i.skyboxGeometry.segment)}(t,n,l,o,c)},custom:function(t,i,n,r){const o=t.context,s=n.implementation;if(!t.transform.projection.unsupportedLayers||!t.transform.projection.unsupportedLayers.includes("custom")||t.terrain&&(t.terrain.renderingToTexture||"offscreen"===t.renderPass)&&n.isDraped(i)){if("offscreen"===t.renderPass){const i=s.prerender;if(i){if(t.setCustomLayerDefaults(),o.setColorMode(t.colorModeForRenderPass()),"globe"===t.transform.projection.name){const n=t.transform.pointMerc;i.call(s,o.gl,t.transform.customLayerMatrix(),t.transform.getProjection(),t.transform.globeToMercatorMatrix(),e.aj(t.transform.zoom),[n.x,n.y],t.transform.pixelsPerMeterRatio)}else i.call(s,o.gl,t.transform.customLayerMatrix());o.setDirty(),t.setBaseState()}}else if("translucent"===t.renderPass){if(t.terrain&&t.terrain.renderingToTexture){const e=s.renderToTile;if(e){const i=r[0].canonical,n={x:i.x+r[0].wrap*(s.wrapTileId?0:1<<i.z),y:i.y,z:i.z};o.setDepthMode(Xi.disabled),o.setStencilMode(Ki.disabled),o.setColorMode(t.colorModeForRenderPass()),t.setCustomLayerDefaults(),e.call(s,o.gl,n),o.setDirty(),t.setBaseState()}return}t.setCustomLayerDefaults(),o.setColorMode(t.colorModeForRenderPass()),o.setStencilMode(Ki.disabled);const i="3d"===s.renderingMode?new Xi(t.context.gl.LEQUAL,Xi.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,Xi.ReadOnly);if(o.setDepthMode(i),"globe"===t.transform.projection.name){const i=t.transform.pointMerc;s.render(o.gl,t.transform.customLayerMatrix(),t.transform.getProjection(),t.transform.globeToMercatorMatrix(),e.aj(t.transform.zoom),[i.x,i.y],t.transform.pixelsPerMeterRatio)}else s.render(o.gl,t.transform.customLayerMatrix());o.setDirty(),t.setBaseState(),o.bindFramebuffer.set(null)}}else e.w("Custom layers are not yet supported with this projection. Use mercator or globe to enable usage of custom layers.")},model:function(t,i,n,r){if("opaque"===t.renderPass)return;const o=n.paint.get("model-opacity").constantOr(1),s=n.paint.get("model-elevation-reference"),a="ground"===s,l="ground"===s;if(0===o)return;const c=n.paint.get("model-cast-shadows");
2if("shadow"===t.renderPass){if(!c)return;if(t.terrain&&o<.65&&n._transitionablePaint._values["model-opacity"].value.expression instanceof e.ad)return}const u=t.shadowRenderer,h=n.paint.get("model-receive-shadows");u&&(u.useNormalOffset=!0,h||(u.enabled=!1));const d=()=>{u&&(u.useNormalOffset=!0,h||(u.enabled=!0))},f=i.getSource();if("light-beam"===t.renderPass&&"batched-model"!==f.type)return;if("vector"===f.type||"geojson"===f.type)return function(t,i,n,r,o){const s=t.transform,a="globe"===s.projection.name,l=s.getFreeCameraOptions().position;if(!t.modelManager)return;const c=t.modelManager;n.modelManager=c;const u=t.shadowRenderer;if(!n._unevaluatedLayout._values.hasOwnProperty("model-id"))return;const h=n._unevaluatedLayout._values["model-id"],d=Object.assign({},n.layout.get("model-id").parameters),f=t.style.order.indexOf(n.fqid),p=n.paint.get("model-opacity").constantOr(1);for(const m of r){const r=i.getTile(m).getBucket(n);if(!r||r.projection.name!==s.projection.name)continue;const _=r.getModelUris();if(_&&!r.modelsRequested&&(c.addModelsFromBucket(_,o),r.modelsRequested=!0),a)d.zoom=m.overscaledZ;else{const e=ha(m,s);d.zoom=e}const g=h.possiblyEvaluate(d);if(ca(t,r,m),ua.shadowUniformsInitialized=!1,ua.useSingleShadowCascade=!!u&&0===u.getMaxCascadeForTile(m.toUnwrapped()),"shadow"===t.renderPass&&u){if(1===t.currentShadowCascade&&r.isInsideFirstShadowMapFrustum)continue;const i=s.calculatePosMatrix(m.toUnwrapped(),s.worldSize);if(ua.tileMatrix.set(i),ua.shadowTileMatrix=Float32Array.from(u.calculateShadowPassMatrixFromMatrix(i)),ua.aabb.min=[0,0,0],ua.aabb.max[0]=ua.aabb.max[1]=e.al,ua.aabb.max[2]=0,pa(r,ua,t,n.scope))continue}const y=1<<m.canonical.z,v=[((l.x-m.wrap)*y-m.canonical.x)*e.al,(l.y*y-m.canonical.y)*e.al,l.z*y*e.al];t.conflationActive&&Object.keys(r.instancesPerModel).length>0&&t.style.isLayerClipped(n,i.getSource())&&r.updateReplacement(m,t.replacementSource,f,n.scope)&&(r.uploaded=!1,r.upload(t.context));let x=0;const b=new Array,w=new Array,T=new Array;for(let i in r.instancesPerModel){const s=r.instancesPerModel[i];s.features.length>0&&!a&&(i=g.evaluate(s.features[0].feature,{}));const u=c.getModel(i,o);if(u||c.hasURLBeenRequested(i)||r.modelUris.includes(i)||(r.modelUris.push(i),r.modelsRequested=!1),u&&u.uploaded)if(a){const i=e.c5([],[l.x,l.y,l.z],t.transform.worldSize);e.ew(i,i);for(let n=0;n<s.instancedDataArray.length;++n){const o=[0,0,0],a=[1,1,1],l=e.ex(),c=s.tileCoordinatesForInstance(n),h=s.transformForInstance(n);e.ey(a,h),e.ez(l,h),e.eA(o,l);const d=s.translationForInstance(n),f=new e.aT(0,0);e.eB(r.canonical,f,c.x,c.y);const m=e.bC();e.eC(m,u,t.transform,f,o,a,d,!0,!1,!1);const _=s.colorForInstance(n),g=e.bA([]),y=e.ef(f.lat,t.transform.zoom),v=e.bq([],[1,1,1/y]);e.br(g,g,i),T.push({zScaleMatrix:v,negCameraPosMatrix:g});for(const e of u.nodes)ra(t,e,m,t.transform.expandedFarZProjMatrix,x,b,w,u.materialOverrides,p,_);++x}}else for(const e of u.nodes)da(t,n,e,s,v,m,ua)}if(a)if("shadow"===t.renderPass){for(const e of w)oa(e.mesh,e.nodeModelMatrix,t,n);for(const e of b)oa(e.mesh,e.nodeModelMatrix,t,n)}else la(t,n,b,w,T)}}(t,i,n,r,na(t,n)),void d();if(!f.loaded())return;if("batched-model"===f.type)return function(t,i,n,r){n.resetLayerRenderingStats(t);const o=t.context,s=t.transform,a=t.style.fog,l=t.shadowRenderer;if("mercator"!==s.projection.name)return void e.w(`Drawing 3D landmark models for ${s.projection.name} projection is not yet implemented`);const c=t.transform.getFreeCameraOptions().position,u=e.c5([],[c.x,c.y,c.z],t.transform.worldSize),h=e.ew([],u),d=e.bA([]),f=e.ef(s.center.lat,s.zoom),p=e.bq([],[1,1,1/f]);e.br(d,d,h);const m=n.paint.get("model-opacity").constantOr(1),_=new Xi(o.gl.LEQUAL,Xi.ReadWrite,t.depthRangeFor3D),g=new Xi(o.gl.LEQUAL,Xi.ReadOnly,t.depthRangeFor3D),y=new e.d9([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),v="shadow"===t.renderPass,x=v&&l?l.getCurrentCascadeFrustum():s.getFrustum(s.scaleZoom(s.worldSize)),b=n.paint.get("model-front-cutoff"),w=b[2]<1,T=gn(t,n.paint.get("model-cutoff-fade-range")),S=n.getLayerRenderingStats();(function(e,t,i,n){const r=e.terrain?e.terrain.exaggeration():0,o=e.transform.zoom;for(const s of n){const n=t.getTile(s).getBucket(i);n&&(n.setFilter(i.filter),e.conflationActive&&n.updateReplacement(s,e.replacementSource),n.evaluateTransform(e,i),e.terrain&&r>0&&n.elevationUpdate(e.terrain,r,s,i.source),n.needsReEvaluation(e,o,i)&&n.evaluate(i))}})(t,i,n,r),function(){let c,h,E;w?(c=r.length-1,h=-1,E=-1):(c=0,h=r.length,E=1);const I=new Float64Array(16),A=e.cA(),M=new e.P(0,0);for(let C=c;C!==h;C+=E){const c=r[C],h=i.getTile(c).getBucket(n);if(!h||!h.uploaded)continue;let E=!1;l&&(E=0===l.getMaxCascadeForTile(c.toUnwrapped()));const P=s.calculatePosMatrix(c.toUnwrapped(),s.worldSize),D=h.modelTraits;!v&&w&&(e.bl(I,P),e.af(A,u,I),M.x=A[0],M.y=A[1]);const R=[];h.setFilter(n.filter);
2for(const i of h.getNodesInfo()){if(i.hiddenByReplacement)continue;if(!i.node.meshes)continue;const n=i.node;let r=0;t.terrain&&n.elevation&&(r=n.elevation*t.terrain.exaggeration());const o=(()=>{const t=i.aabb;return y.min=[...t.min],y.max=[...t.max],y.min[2]+=r,y.max[2]+=r,e.af(y.min,y.min,P),e.af(y.max,y.max,P),y})(),a=i.evaluatedScale;if(a[0]<=1&&a[1]<=1&&a[2]<=1&&0===o.intersects(x))continue;if(!v&&w){const t=1/6;i.cameraCollisionOpacity=u[0]>o.min[0]&&u[0]<o.max[0]&&u[1]>o.min[1]&&u[1]<o.max[1]&&u[2]*f<o.max[2]&&n.footprint&&e.c0(M,n.footprint)?Math.max(i.cameraCollisionOpacity-t,0):Math.min(1,i.cameraCollisionOpacity+t)}const l=[...P],h=1/e.d7(c.canonical),d=n.anchor?n.anchor[0]:0,p=n.anchor?n.anchor[1]:0;e.br(l,l,[d*(a[0]-1)+i.evaluatedTranslation[0]*h,p*(a[1]-1)+i.evaluatedTranslation[1]*h,r+i.evaluatedTranslation[2]]),e.cq(a,e.eE)||e.cS(l,l,a);const _=e.aB([],l,n.globalMatrix),g=e.aB([],s.expandedFarZProjMatrix,_),S=e.aB([],s.expandedFarZProjMatrix,l),E=e.aC([],[d,p,r,1],g)[2];n.hidden=!1;let I=m;v||(w&&(I*=i.cameraCollisionOpacity,I*=_a(l,s,i.aabb,b)),I*=ma(T,E)),0!==I?R.push({nodeInfo:i,depth:E,opacity:I,wvpForNode:g,wvpForTile:S,nodeModelMatrix:_,tileModelMatrix:l}):n.hidden=!0}v||R.sort((e,t)=>!w||1===e.opacity&&1===t.opacity?e.depth<t.depth?-1:1:1===e.opacity?-1:1===t.opacity?1:e.depth>t.depth?-1:1);for(const i of R){const r=i.nodeInfo,c=r.node;let u=e.aB([],p,i.tileModelMatrix);e.aB(u,d,u);const h=e.bl([],u);e.eg(h,h),e.cS(h,h,fa),u=e.aB(u,u,c.globalMatrix);const f="light-beam"===t.renderPass,m="none"===n.paint.get("model-color-use-theme").constantOr("default"),y=D&e.eI.HasMapboxMeshFeatures,x=y?0:r.evaluatedRMEA[0][2];for(let e=0;e<c.meshes.length;++e){const d=c.meshes[e],p=e===c.lightMeshIndex;let b=i.wvpForNode;if(p){if(!f&&!t.terrain&&t.shadowRenderer){t.currentLayer<t.firstLightBeamLayer&&(t.firstLightBeamLayer=t.currentLayer);continue}b=i.wvpForTile}else if(f)continue;const w={defines:[]},T=[];if(!v&&l&&(l.useNormalOffset=!!d.normalBuffer),ta(w.defines,T,d,t,m?null:n.lut),y||w.defines.push("DIFFUSE_SHADED"),E&&w.defines.push("SHADOWS_SINGLE_CASCADE"),S&&(v?S.numRenderedVerticesInShadowPass+=d.vertexArray.length:S.numRenderedVerticesInTransparentPass+=d.vertexArray.length),v){oa(d,i.nodeModelMatrix,t,n);continue}let I=null;if(a){const e=ea(i.nodeModelMatrix,t.transform);if(I=new Float32Array(e),"globe"!==s.projection.name){const t=d.aabb.min,i=d.aabb.max,[n,r]=a.getOpacityForBounds(e,t[0],t[1],i[0],i[1]);w.overrideFog=n>=je||r>=je}}const A=d.material;let M;A.occlusionTexture&&A.occlusionTexture.offsetScale&&(M=A.occlusionTexture.offsetScale,w.defines.push("OCCLUSION_TEXTURE_TRANSFORM"));const C=t.getOrCreateProgram("model",w);!v&&l&&l.setupShadowsFromMatrix(i.tileModelMatrix,C,l.useNormalOffset),t.uploadCommonUniforms(o,C,null,I);const P=A.pbrMetallicRoughness;P.metallicFactor=.9,P.roughnessFactor=.5;const D=Yo(new Float32Array(b),new Float32Array(u),new Float32Array(h),new Float32Array(c.globalMatrix),t,i.opacity,P.baseColorFactor,A.emissiveFactor,P.metallicFactor,P.roughnessFactor,A,x,n,[0,0,0],M);!p&&(r.hasTranslucentParts||i.opacity<1)&&C.draw(t,o.gl.TRIANGLES,_,Ki.disabled,Zi.disabled,en.backCCW,D,n.id,d.vertexBuffer,d.indexBuffer,d.segments,n.paint,t.transform.zoom,void 0,T),C.draw(t,o.gl.TRIANGLES,p?g:_,Ki.disabled,p||i.opacity<1||r.hasTranslucentParts?Zi.alphaBlended:Zi.unblended,en.backCCW,D,n.id,d.vertexBuffer,d.indexBuffer,d.segments,n.paint,t.transform.zoom,void 0,T)}}}}()}(t,i,n,r),void d();if("model"!==f.type)return;const p=f.getModels(),m=[],_=t.transform.getFreeCameraOptions().position,g=e.c5([],[_.x,_.y,_.z],t.transform.worldSize);e.ew(g,g);const y=[],v=[];let x=0;for(const r of p){const o=i.getFeatureState("",r.id),s={type:"Unknown",id:r.id,properties:r.featureProperties},c=n.paint.get("model-rotation").evaluate(s,o),u=n.paint.get("model-scale").evaluate(s,o),h=n.paint.get("model-translation").evaluate(s,o),d=n.paint.get("model-opacity").evaluate(s,o);sa(n,r.id,o,r.featureProperties,r.nodeOverrideNames,r.nodeOverrides),aa(n,r.id,o,r.featureProperties,r.materialOverrideNames,r.materialOverrides),r.nodeOverrides.size>0&&r.computeBoundsAndApplyParent(),r.computeModelMatrix(t,c,u,h,l,a,!1);const f=e.bA([]),p=e.ef(r.position.lat,t.transform.zoom),_=e.bq([],[1,1,1/p]);e.br(f,f,g),m.push({zScaleMatrix:_,negCameraPosMatrix:f});for(const e of r.nodes)ra(t,e,r.matrix,t.transform.expandedFarZProjMatrix,x,y,v,r.materialOverrides,d);x++}if(y.sort((e,t)=>
2t.depth-e.depth),"shadow"!==t.renderPass)la(t,n,y,v,m),d();else{for(const e of v)oa(e.mesh,e.nodeModelMatrix,t,n);for(const e of y)oa(e.mesh,e.nodeModelMatrix,t,n);d()}}},La={line:function(e,t,i){if(e.hasElevatedBuckets=!1,e.hasNonElevatedBuckets=!1,void 0!==e._unevaluatedLayout.getValue("line-elevation-reference")||void 0!==e._unevaluatedLayout.getValue("line-z-offset")){if(t){const i=t.getVisibleCoordinates();for(const n of i){const i=t.getTile(n).getBucket(e);if(i&&("none"!==i.elevationType?e.hasElevatedBuckets=!0:e.hasNonElevatedBuckets=!0,e.hasElevatedBuckets&&e.hasNonElevatedBuckets))break}}}else e.hasNonElevatedBuckets=!0},model:function(e,t,i){const n=t.getSource();if(!n.loaded())return;if("vector"===n.type||"geojson"===n.type)return void(i.modelManager&&i.modelManager.upload(i,na(i,e)));if("batched-model"===n.type)return;if("model"!==n.type)return;const r=n.getModels();for(const e of r)e.upload(i.context)},raster:function(e,t,i){const n=t.getSource();if(!(n instanceof dt&&n.loaded()))return;const r=e.sourceLayer||n.rasterLayerIds&&n.rasterLayerIds[0];if(!r)return;const o=e.paint.get("raster-array-band")||n.getInitialBand(r);if(null==o)return;const s=t.getIds().map(e=>t.getTileByID(e));for(const t of s)t.updateNeeded(e.id,o)&&n.prepareTile(t,r,e.id,o)},"raster-particle":function(e,t,i){const n=t.getSource();if(!(n instanceof dt&&n.loaded()))return;const r=e.sourceLayer||n.rasterLayerIds&&n.rasterLayerIds[0];if(!r)return;const o=e.paint.get("raster-particle-array-band")||n.getInitialBand(r);if(null==o)return;const s=t.getIds().map(e=>t.getTileByID(e));for(const t of s)t.updateNeeded(e.id,o)&&n.prepareTile(t,r,e.id,o)}},za={fill:fs},Oa={fill:function(e,t,i,n){if(!i.layout||"none"===i.layout.get("fill-elevation-reference")||0===i.paint.get("fill-opacity").constantOr(1))return;const r=e.context.gl,o=new Xi(r.LEQUAL,Xi.ReadOnly,e.depthRangeFor3D),s=new Ki({func:r.ALWAYS,mask:255},255,255,r.KEEP,r.KEEP,r.REPLACE),a=e.transform.getFreeCameraOptions().position,l=e.getOrCreateProgram("elevatedStructuresDepthReconstruct");for(const c of n){const n=t.getTile(c),u=n.getBucket(i);if(!u)continue;const h=u.elevatedStructures;if(!h||0===h.depthSegments.segments[0].primitiveLength)continue;const d=ds(c.toUnwrapped(),a),f=e.translatePosMatrix(c.projMatrix,n,i.paint.get("fill-translate"),i.paint.get("fill-translate-anchor")),p=Co(f,d,0,1,0);l.draw(e,r.TRIANGLES,o,s,Zi.disabled,en.disabled,p,i.id,h.vertexBuffer,h.indexBuffer,h.depthSegments,i.paint,e.transform.zoom)}}};class Fa{constructor(t,i,n,r,o){this.context=new ns(t,i),this.transform=n,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this._timeStamp=e.o.now(),this._averageFPS=0,this._fpsHistory=[],this._dt=0,this._debugParams={forceEnablePrecipitation:!1,showTerrainProxyTiles:!1,fpsWindow:30,continousRedraw:!1,enabledLayers:{}};const s=["fill","line","symbol","circle","heatmap","fill-extrusion","building","raster","raster-particle","hillshade","model","background","sky"];for(const e of s)this._debugParams.enabledLayers[e]=!0;for(const e of s);this.occlusionParams=new va,this.setup(),this.numSublayers=zt.maxUnderzooming+zt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this._backgroundTiles={},this.conflationActive=!1,this.replacementSource=new e.eP,this.longestCutoffRange=0,this.minCutoffZoom=0,this._fogVisible=!1,this._cachedTileFogOpacities={},this._shadowRenderer=new bn(this),this._wireframeDebugCache=new ya,this.renderDefaultNorthPole=!0,this.renderDefaultSouthPole=!0,this.layersWithOcclusionOpacity=[];const a=new e.q({width:1,height:1},Uint8Array.of(0,0,0,0));this.emptyDepthTexture=new e.T(this.context,a,t.RGBA8),this._clippingActiveLastFrame=!1,this.scaleFactor=r,this.worldview=o,this._forceEmissiveMode=!1,this.emissiveMode="constant"}updateTerrain(e,t){const i=!!e&&!!e.terrain&&this.transform.projection.supportsTerrain;if(!(i||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new fo(this,e));const n=this._terrain;this.transform.elevation=i?n:null,n.update(e,this.transform,t),this.transform.elevation&&!n.enabled&&(this.transform.elevation=null)}_updateFog(e){const t=e.fog;if(!t||"globe"===this.transform.projection.name||t.getOpacity(this.transform.pitch)<1||t.properties.get("horizon-blend")<.03)return void(this.transform.fogCullDistSq=null);const[i,n]=t.getFovAdjustedRange(this.transform._fov);if(i>n)return void(this.transform.fogCullDistSq=null);const r=i+.78*(n-i);this.transform.fogCullDistSq=r*r}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled||this._forceTerrainMode?this._terrain:null}get forceTerrainMode(){return this._forceTerrainMode}set forceTerrainMode(e){e&&!this._terrain&&(this._terrain=new fo(this,this.style)),this._forceTerrainMode=e}get shadowRenderer(){return this._shadowRenderer&&this._shadowRenderer.enabled?this._shadowRenderer:null}get wireframeDebugCache(){return this._wireframeDebugCache}resize(t,i){if(this.width=t*e.o.devicePixelRatio,this.height=i*e.o.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const e of this.style.order)this.style._mergedLayers[e].resize()}setup(){const t=this.context,i=new e.bd;i.emplaceBack(0,0),i.emplaceBack(e.al,0),i.emplaceBack(0,e.al),i.emplaceBack(e.al,e.al),this.tileExtentBuffer=t.createVertexBuffer(i,e.bf.members),this.tileExtentSegments=e.bg.simpleSegment(0,0,4,2);const n=new e.bd;
2n.emplaceBack(0,0),n.emplaceBack(e.al,0),n.emplaceBack(0,e.al),n.emplaceBack(e.al,e.al),this.debugBuffer=t.createVertexBuffer(n,e.bf.members),this.debugSegments=e.bg.simpleSegment(0,0,4,5);const r=new e.bd;r.emplaceBack(-1,-1),r.emplaceBack(1,-1),r.emplaceBack(-1,1),r.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(r,e.bf.members),this.viewportSegments=e.bg.simpleSegment(0,0,4,2);const o=new e.b1;o.emplaceBack(0,0,0,0),o.emplaceBack(e.al,0,e.al,0),o.emplaceBack(0,e.al,0,e.al),o.emplaceBack(e.al,e.al,e.al,e.al),this.mercatorBoundsBuffer=t.createVertexBuffer(o,e.bi.members),this.mercatorBoundsSegments=e.bg.simpleSegment(0,0,4,2);const s=new e.b0;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(s);const a=new e.be;for(const e of[0,1,3,2,0])a.emplaceBack(e);this.debugIndexBuffer=t.createIndexBuffer(a),this.emptyTexture=new e.T(t,new e.q({width:1,height:1},Uint8Array.of(0,0,0,0)),t.gl.RGBA8),this.identityMat=e.bC();const l=this.context.gl;this.stencilClearMode=new Ki({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO),this.loadTimeStamps.push(performance.now())}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(e){return e._makeTileBoundsBuffers(this.context,this.transform.projection),e._tileBoundsBuffer?{tileBoundsBuffer:e._tileBoundsBuffer,tileBoundsIndexBuffer:e._tileBoundsIndexBuffer,tileBoundsSegments:e._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const e=this.context.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.getOrCreateProgram("clippingMask").draw(this,e.TRIANGLES,Xi.disabled,this.stencilClearMode,Zi.disabled,en.disabled,ao(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(e,t,i){if(!t||this.currentStencilSource===t.id||!e.isTileClipped()||!i||0===i.length)return;if(this._tileClippingMaskIDs&&!this.terrain){let e=!1;for(const t of i)if(void 0===this._tileClippingMaskIDs[t.key]){e=!0;break}if(!e)return}this.currentStencilSource=t.id;const n=this.context,r=n.gl;this.nextStencilID+i.length>256&&this.clearStencil(),n.setColorMode(Zi.disabled),n.setDepthMode(Xi.disabled);const o=this.getOrCreateProgram("clippingMask");this._tileClippingMaskIDs={};for(const e of i){const i=t.getTile(e),n=this._tileClippingMaskIDs[e.key]=this.nextStencilID++,{tileBoundsBuffer:s,tileBoundsIndexBuffer:a,tileBoundsSegments:l}=this.getTileBoundsBuffers(i);o.draw(this,r.TRIANGLES,Xi.disabled,new Ki({func:r.ALWAYS,mask:0},n,255,r.KEEP,r.KEEP,r.REPLACE),Zi.disabled,en.disabled,ao(e.projMatrix),"$clipping",s,a,l)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const e=this.nextStencilID++,t=this.context.gl;return new Ki({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)}stencilModeForClipping(e){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(e);const t=this.context.gl;return new Ki({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)}stencilConfigForOverlap(e){const t=this.context.gl,i=e.sort((e,t)=>t.overscaledZ-e.overscaledZ),n=i[i.length-1].overscaledZ,r=i[0].overscaledZ-n+1;if(r>1){this.currentStencilSource=void 0,this.nextStencilID+r>256&&this.clearStencil();const e={};for(let i=0;i<r;i++)e[i+n]=new Ki({func:t.GEQUAL,mask:255},i+this.nextStencilID,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID+=r,[e,i]}return[{[n]:Ki.disabled},i]}colorModeForRenderPass(){const t=this.context.gl;if(this._showOverdrawInspector){const i=1/8;return new Zi([t.CONSTANT_COLOR,t.ONE,t.CONSTANT_COLOR,t.ONE],new e.ao(i,i,i,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?Zi.unblended:Zi.alphaBlended}colorModeForDrapableLayerRenderPass(t){const i=this.context.gl;return(()=>this.style&&this.style.enable3dLights()&&this.terrain&&this.terrain.renderingToTexture)()&&"translucent"===this.renderPass?null!=t&&"mrt-fallback"!==this.emissiveMode||"constant"===this.emissiveMode?new Zi([i.ONE,i.ONE_MINUS_SRC_ALPHA,i.CONSTANT_ALPHA,i.ONE_MINUS_SRC_ALPHA],new e.ao(0,0,0,null!=t?t:0),[!0,!0,!0,!0]):"dual-source-blending"===this.emissiveMode?new Zi([i.ONE,i.ONE_MINUS_SRC_ALPHA,this.context.extBlendFuncExtended.SRC1_ALPHA_WEBGL,i.ONE_MINUS_SRC_ALPHA],e.ao.transparent,[!0,!0,!0,!0]):this.colorModeForRenderPass():this.colorModeForRenderPass()}depthModeForSublayer(e,t,i,n=!1){if(this.depthOcclusion)return new Xi(this.context.gl.GREATER,Xi.ReadOnly,this.depthRangeFor3D);if(!this.opaquePassEnabledForLayer()&&!n)return Xi.disabled;const r=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new Xi(i||this.context.gl.LEQUAL,t,[r,r])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}blitDepth(){const t=this.context.gl,i=Math.ceil(this.width),n=Math.ceil(this.height),r=this.context.bindFramebuffer.get(),o=t.getParameter(t.TEXTURE_BINDING_2D);this.depthFBO&&this.depthFBO.width===i&&this.depthFBO.height===n||(this.depthFBO&&(this.depthFBO.destroy(),this.depthFBO=void 0,this.depthTexture=void 0),0!==i&&0!==n&&(this.depthFBO=new is(this.context,i,n,0,"texture"),this.depthTexture=new e.T(this.context,{width:i,height:n,data:null},t.DEPTH24_STENCIL8),this.depthFBO.depthAttachment.set(this.depthTexture.texture))),this.context.bindFramebuffer.set(r),t.bindTexture(t.TEXTURE_2D,o),this.depthFBO&&(t.bindFramebuffer(t.READ_FRAMEBUFFER,null),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,this.depthFBO.framebuffer),t.blitFramebuffer(0,0,i,n,0,0,i,n,t.DEPTH_BUFFER_BIT,t.NEAREST),t.bindFramebuffer(t.FRAMEBUFFER,this.context.bindFramebuffer.current))}updateAverageFPS(){this._fpsHistory.push(0===this._dt?0:1e3/this._dt),this._fpsHistory.length>this._debugParams.fpsWindow&&this._fpsHistory.splice(0,this._fpsHistory.length-this._debugParams.fpsWindow),this._averageFPS=Math.round(this._fpsHistory.reduce((e,t)=>
2e+t/this._fpsHistory.length,0))}render(t,i){const n=e.o.now();this._dt=n-this._timeStamp,this._timeStamp=n,this._wireframeDebugCache.update(this.frameCounter),this._debugParams.continousRedraw=t.map.repaint,this.style=t,this.options=i;const r=this.style._mergedLayers,o=!(!this.terrain||!this.terrain.enabled),s=()=>this.style._getOrder(o).filter(e=>{const t=r[e];return!(t.type in this._debugParams.enabledLayers)||this._debugParams.enabledLayers[t.type]});let a=s(),l=!1,c=!1,u=null,h=0,d=!1;for(const e of a){const t=r[e];"none"!==t.visibility&&("circle"===t.type?l=!0:"building"===t.type?(u=t,++h):"symbol"===t.type&&(t.hasOcclusionOpacityProperties?c=!0:l=!0))}this.updateEmissiveMode();let f=a.map(e=>r[e]);const p=this.style._mergedSourceCaches;this.imageManager=t.imageManager,this.modelManager=t.modelManager,this.symbolFadeChange=t.placement.symbolFadeChange(e.o.now()),this.imageManager.beginFrame();for(const e in p){const t=p[e];t.used&&(t.prepare(this.context),t.getSource().usedInConflation&&++h)}let m=!1;for(const e of f)e.isHidden(this.transform.zoom)||("clip"===e.type&&(m=!0),this.prepareLayer(e));const _={},g={},y={},v={},x={};for(const e in p){const t=p[e];_[e]=t.getVisibleCoordinates(),g[e]=_[e].slice().reverse(),y[e]=t.getVisibleCoordinates(!0).reverse(),v[e]=t.getShadowCasterCoordinates(),x[e]=t.sortCoordinatesByDistance(_[e])}const b=e=>{const t=this.style.getLayerSourceCache(e);return t&&t.used?t.getSource():null};if(h||m||this._clippingActiveLastFrame){const t=[],i=[];let n=0;for(const e of f)this.isSourceForClippingOrConflation(e,b(e))&&(t.push(e),i.push(n)),n++;if(t&&(m||t.length>1)||this._clippingActiveLastFrame){m=!1;const n=[];for(let r=0;r<t.length;r++){const o=t[r],s=i[r],a=this.style.getLayerSourceCache(o);if(!a||!a.used||!a.getSource().usedInConflation&&"clip"!==o.type&&"building"!==o.type)continue;let l=e.eQ,c=e.b_.None;const u=[];let h=!0;if("building"===o.type)l=e.eS;else if("clip"===o.type){l=s;for(const t of o.layout.get("clip-layer-types"))c|="model"===t?e.b_.Model:"symbol"===t?e.b_.Symbol:e.b_.FillExtrusion;for(const e of o.layout.get("clip-layer-scope"))u.push(e);o.isHidden(this.transform.zoom)?h=!1:m=!0}h&&n.push({layer:o.fqid,cache:a,order:l,clipMask:c,clipScope:u})}this.replacementSource.setSources(n),d=!0}}this._clippingActiveLastFrame=m,d||this.replacementSource.clear(),this.conflationActive=d,this.minCutoffZoom=0,this.longestCutoffRange=0,this.opaquePassCutoff=1/0,this._lastOcclusionLayer=-1,this.layersWithOcclusionOpacity=[];for(let e=0;e<f.length;e++){const t=f[e];if("none"===t.visibility)continue;const i=t.cutoffRange();if(this.longestCutoffRange=Math.max(i,this.longestCutoffRange),i>0){const e=b(t);e&&(this.minCutoffZoom=Math.max(e.minzoom,this.minCutoffZoom)),t.minzoom&&(this.minCutoffZoom=Math.max(t.minzoom,this.minCutoffZoom))}t.is3D(o)&&(this.opaquePassCutoff===1/0&&(this.opaquePassCutoff=e),this._lastOcclusionLayer=e)}const w=this.style&&this.style.fog;w?(this._fogVisible=0!==w.getOpacity(this.transform.pitch),this._fogVisible&&"globe"!==this.transform.projection.name&&(this._fogVisible=w.isVisibleOnFrustum(this.transform.cameraFrustum))):this._fogVisible=!1,this._cachedTileFogOpacities={},this.terrain&&(this.terrain.updateTileBinding(y),this.opaquePassCutoff=0,a=s(),f=a.map(e=>r[e]));const T=this._shadowRenderer;if(T){T.updateShadowParameters(this.transform,this.style.directionalLight);for(const e in p)for(const t of _[e]){let e={min:0,max:0};this.terrain&&(e=this.terrain.getMinMaxForTile(t)||e),T.addShadowReceiver(t.toUnwrapped(),e.min,e.max)}}"globe"!==this.transform.projection.name||this.globeSharedBuffers||(this.globeSharedBuffers=new e.eR(this.context)),this.style.fog&&this.transform.projection.supportsFog?(this._atmosphere||(this._atmosphere=new Js(this)),this._atmosphere.update(this)):this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=void 0);const S=this._debugParams.forceEnablePrecipitation||!(!this.style||!this.style.snow),E=this._debugParams.forceEnablePrecipitation||!(!this.style||!this.style.rain);if(S&&!this._snow&&(this._snow=new Da(this)),!S&&this._snow&&(this._snow.destroy(),delete this._snow),E&&!this._rain&&(this._rain=new Ca(this)),!E&&this._rain&&(this._rain.destroy(),delete this._rain),this._snow&&this._snow.update(this),this._rain&&this._rain.update(this),u){this.buildingTileBorderManager||(this.buildingTileBorderManager=new Qs);const e=this.style.getLayerSourceCache(u);this.buildingTileBorderManager.updateBorders(e,u)}if(!H.has(this.context.gl))return;this.renderPass="offscreen";for(const e of f){const i=t.getLayerSourceCache(e);if(!e.hasOffscreenPass()||e.isHidden(this.transform.zoom))continue;const n=i?g[i.id]:void 0;("custom"===e.type||"raster"===e.type||"raster-particle"===e.type||e.isSky()||n&&n.length)&&this.renderLayer(this,i,e,n)}this.depthRangeFor3D=[0,1-(f.length+2)*this.numSublayers*this.depthEpsilon],this._shadowRenderer&&(this.renderPass="shadow",this._shadowRenderer.drawShadowPass(this.style,v)),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]);const I="globe"===this.transform.projection.name||this.transform.isH
vendor: 4,703 bytes, line 2
2orizonVisible(),A=(()=>{if(i.showOverdrawInspector)return e.ao.black;const t=this.style.fog;if(t&&this.transform.projection.supportsFog){const i=this.style.getLut(t.scope);if(!I){const n="none"===t.properties.get("color-use-theme"),r=t.properties.get("color").toNonPremultipliedRenderColor(n?null:i).toArray01();return new e.ao(...r)}if(I){const n="none"===t.properties.get("space-color-use-theme"),r=t.properties.get("space-color").toNonPremultipliedRenderColor(n?null:i).toArray01();return new e.ao(...r)}}return e.ao.transparent})();if(this.context.clear({color:A,depth:1}),this.clearStencil(),this._showOverdrawInspector=i.showOverdrawInspector,this.renderPass="opaque",this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&I&&this._atmosphere.drawStars(this,this.style.fog),!this.terrain)for(this.currentLayer=a.length-1;this.currentLayer>=0;this.currentLayer--){const e=f[this.currentLayer],i=t.getLayerSourceCache(e);if(e.isSky())continue;const n=i?(e.is3D(o)?x:g)[i.id]:void 0;this._renderTileClippingMasks(e,i,n),this.renderLayer(this,i,e,n)}if(this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&I&&this._atmosphere.drawAtmosphereGlow(this,this.style.fog),this.renderPass="sky",(!this._atmosphere||e.aj(this.transform.zoom)>0)&&("globe"===this.transform.projection.name||this.transform.isHorizonVisible()))for(this.currentLayer=0;this.currentLayer<a.length;this.currentLayer++){const e=f[this.currentLayer],i=t.getLayerSourceCache(e);e.isSky()&&this.renderLayer(this,i,e,i?g[i.id]:void 0)}function M(e,t){let i;return t&&(i=("symbol"===e.type?y:e.is3D(o)?x:g)[t.id]),i}if(this.renderPass="translucent","globe"===this.transform.projection.name){for(this.renderElevatedRasterBackface=!0,this.currentLayer=0;this.currentLayer<a.length;){const e=f[this.currentLayer];if("raster"===e.type||"raster-particle"===e.type){const i=t.getLayerSourceCache(e);this.renderLayer(this,i,e,M(e,i))}++this.currentLayer}this.renderElevatedRasterBackface=!1}this.currentLayer=0,this.firstLightBeamLayer=Number.MAX_SAFE_INTEGER;let C=0;T&&(C=T.getShadowCastingLayerCount());let P=!1,D=-1;for(let e=0;e<a.length;++e){const t=f[e];t.isHidden(this.transform.zoom)||t.is3D(o)&&(D=e)}c&&-1===D&&(l=!0);let R=!1;for(;this.currentLayer<a.length;){const e=f[this.currentLayer],i=t.getLayerSourceCache(e);if(e.isSky())++this.currentLayer;else if(this.terrain&&this.style.isLayerDraped(e)){if(e.isHidden(this.transform.zoom)){++this.currentLayer;continue}this.currentLayer=this.terrain.renderBatch(this.currentLayer),this._lastOcclusionLayer=Math.max(this.currentLayer,this._lastOcclusionLayer)}else{if(!R&&e.is3D(o)&&!o){const e=this.currentLayer,t=e=>{for(this.currentLayer=0;this.currentLayer<f.length;this.currentLayer++){const t=f[this.currentLayer];if(za[t.type]){const i=this.style.getLayerSourceCache(t);za[t.type](this,i,t,M(t,i),e)}}};t("initialize"),t("reset"),this.currentLayer=e,R=!0}if(l&&!P&&this.terrain&&!this.transform.isOrthographic&&(P=!0,this.blitDepth()),c&&-1!==D&&this.currentLayer===D+1&&!this.transform.isOrthographic&&this.blitDepth(),this.terrain||this._renderTileClippingMasks(e,i,i?_[i.id]:void 0),this.renderLayer(this,i,e,M(e,i)),!this.terrain&&T&&C>0&&e.hasShadowPass()&&0==--C){{this.clearStencil(),this.resetStencilClippingMasks();const e=this.currentLayer;for(this.currentLayer=0;this.currentLayer<f.length;this.currentLayer++){const e=f[this.currentLayer];if(Oa[e.type]){const t=this.style.getLayerSourceCache(e);Oa[e.type](this,t,e,M(e,t))}}this.currentLayer=e}if(T.drawGroundShadows(),this.firstLightBeamLayer<=this.currentLayer){const e=this.currentLayer;for(this.renderPass="light-beam",this.currentLayer=this.firstLightBeamLayer;this.currentLayer<=e;this.currentLayer++){const e=f[this.currentLayer];if(!e.hasLightBeamPass())continue;const i=t.getLayerSourceCache(e);this.renderLayer(this,i,e,i?g[i.id]:void 0)}this.currentLayer=e,this.renderPass="translucent"}}if(this.currentLayer>=this._lastOcclusionLayer&&this.layersWithOcclusionOpacity.length>0){const e=this.currentLayer;this.depthOcclusion=!0;for(const e of this.layersWithOcclusionOpacity){this.currentLayer=e;const i=f[this.currentLayer],n=t.getLayerSourceCache(i),r=n?g[n.id]:void 0;this.terrain||this._renderTileClippingMasks(i,n,n?_[n.id]:void 0),this.renderLayer(this,n,i,r)}this.depthOcclusion=!1,this.currentLayer=e,this.renderPass="translucent",this.layersWithOcclusionOpacity=[]}++this.currentLayer}}if(this.terrain&&this.terrain.postRender(),this._snow&&this._snow.draw(this),this._rain&&this._rain.draw(this),this.options.showTileBoundaries||this.options.showQueryGeometry||this.options.showTileAABBs){let i=null;
2f.forEach(e=>{const n=t.getLayerSourceCache(e);n&&!e.isHidden(this.transform.zoom)&&n.getVisibleCoordinates().length&&(!i||i.getSource().maxzoom<n.getSource().maxzoom)&&(i=n)}),i&&this.options.showTileBoundaries&&Bs(this,i,i.getVisibleCoordinates(),e.ao.red,!1,this.options.showParseStatus)}this.terrain&&this._debugParams.showTerrainProxyTiles&&Bs(this,this.terrain.proxySourceCache,this.terrain.proxyCoords,new e.ao(1,.8,.1,1),!0,this.options.showParseStatus),this.options.showPadding&&function(e){const t=e.transform.padding;Vs(e,e.transform.height-(t.top||0),3,Ls),Vs(e,t.bottom||0,3,zs),Us(e,t.left||0,3,Os),Us(e,e.transform.width-(t.right||0),3,Fs);const i=e.transform.centerPoint;!function(e,t,i,n){js(e,t-1,i-10,2,20,n),js(e,t-10,i-1,20,2,n)}(e,i.x,e.transform.height-i.y,ks)}(this),this.context.setDefault(),this.frameCounter=(this.frameCounter+1)%Number.MAX_SAFE_INTEGER,this.tileLoaded&&this.options.speedIndexTiming&&(this.loadTimeStamps.push(performance.now()),this.saveCanvasCopy()),d||(this.conflationActive=!1)}prepareLayer(e){this.gpuTimingStart(e);const{unsupportedLayers:t}=this.transform.projection,i=!t||!t.includes(e.type);if(La[e.type]&&(i||this.terrain&&"custom"===e.type)){const t=this.style.getLayerSourceCache(e);La[e.type](e,t,this)}this.gpuTimingEnd()}renderLayer(e,t,i,n){i.isHidden(this.transform.zoom)||("background"===i.type||"sky"===i.type||"custom"===i.type||"model"===i.type||"raster"===i.type||"raster-particle"===i.type||n&&n.length)&&(this.id=i.id,this.gpuTimingStart(i),e.transform.projection.unsupportedLayers&&e.transform.projection.unsupportedLayers.includes(i.type)&&(!e.terrain||"custom"!==i.type)||"clip"===i.type||Ra[i.type](e,t,i,n,this.style.placement.variableOffsets,this.options.isInitialLoad),this.gpuTimingEnd())}gpuTimingStart(e){if(!this.options.gpuTiming)return;const t=this.context.extTimerQuery,i=this.context.gl;let n=this.gpuTimers[e.id];n||(n=this.gpuTimers[e.id]={calls:0,cpuTime:0,query:i.createQuery()}),n.calls++,i.beginQuery(t.TIME_ELAPSED_EXT,n.query)}gpuTimingDeferredRenderStart(){if(this.options.gpuTimingDeferredRender){const e=this.context.extTimerQuery,t=this.context.gl,i=t.createQuery();this.deferredRenderGpuTimeQueries.push(i),t.beginQuery(e.TIME_ELAPSED_EXT,i)}}gpuTimingDeferredRenderEnd(){this.options.gpuTimingDeferredRender&&this.context.gl.endQuery(this.context.extTimerQuery.TIME_ELAPSED_EXT)}gpuTimingEnd(){this.options.gpuTiming&&this.context.gl.endQuery(this.context.extTimerQuery.TIME_ELAPSED_EXT)}collectGpuTimers(){const e=this.gpuTimers;return this.gpuTimers={},e}collectDeferredRenderGpuQueries(){const e=this.deferredRenderGpuTimeQueries;return this.deferredRenderGpuTimeQueries=[],e}queryGpuTimers(e){const t={};for(const i in e){const n=e[i],r=this.context.extTimerQuery,o=r.getQueryParameter(n.query,this.context.gl.QUERY_RESULT)/1e6;r.deleteQueryEXT(n.query),t[i]=o}return t}queryGpuTimeDeferredRender(e){if(!this.options.gpuTimingDeferredRender)return 0;const t=this.context.gl;let i=0;for(const n of e)i+=t.getQueryParameter(n,t.QUERY_RESULT)/1e6,t.deleteQuery(n);return i}translatePosMatrix(t,i,n,r,o){if(!n[0]&&!n[1])return t;const s=o?"map"===r?this.transform.angle:0:"viewport"===r?-this.transform.angle:0;if(s){const e=Math.sin(s),t=Math.cos(s);n=[n[0]*t-n[1]*e,n[0]*e+n[1]*t]}const a=[o?n[0]:e.ay(i,n[0],this.transform.zoom),o?n[1]:e.ay(i,n[1],this.transform.zoom),0],l=new Float32Array(16);return e.br(l,t,a),l}saveTileTexture(e){if(e.context!==this.context)return;const t=e.size[0],i=this._tileTextures[t];i?i.push(e):this._tileTextures[t]=[e]}getTileTexture(e){const t=this._tileTextures[e];return t&&t.length>0?t.pop():null}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture||this.forceTerrainMode}linearFloatFilteringSupported(){return null!=this.context.extTextureFloatLinear}currentGlobalDefines(e,t,i){const n=void 0===i?this.terrain&&this.terrain.renderingToTexture:i,r=[];return this.style&&this.style.enable3dLights()&&("globeRaster"===e||"terrainRaster"===e?(r.push("LIGHTING_3D_MODE"),r.push("LIGHTING_3D_ALPHA_EMISSIVENESS")):n||r.push("LIGHTING_3D_MODE")),"shadow"===this.renderPass&&(this._shadowMapDebug||r.push("DEPTH_TEXTURE")),this.terrainRenderModeElevated()&&(r.push("TERRAIN"),this.linearFloatFilteringSupported()&&r.push("TERRAIN_DEM_FLOAT_FORMAT")),"globe"===this.transform.projection.name&&r.push("GLOBE"),!this._fogVisible||n||void 0!==t&&!t||r.push("FOG","FOG_DITHERING"),n&&r.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&r.push("OVERDRAW_INSPECTOR"),r}getOrCreateProgram(e,t){this.cache=this.cache||{};const i=t&&t.defines||[],n=t&&t.config,r=this.currentGlobalDefines(e,t&&t.overrideFog,t&&t.overrideRtt).concat(i),o=go.cacheKey(lr[e],e,r,n);return this.cache[o]||(this.cache[o]=new go(this.context,e,lr[e],n,Jo[e],r)),this.cache[o]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new e.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA8))}destroy(){this._terrain&&this._terrain.destroy(),this._atmosphere&&(this._atmosphere.de
vendor: 4,596 bytes, line 2
2stroy(),this._atmosphere=void 0),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this._wireframeDebugCache.destroy(),this.depthFBO&&(this.depthFBO.destroy(),this.depthFBO=void 0,this.depthTexture=void 0),this.emptyDepthTexture&&this.emptyDepthTexture.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}uploadCommonLightUniforms(t,i){if(this.style.enable3dLights()){const n=this.style.directionalLight,r=this.style.ambientLight;if(n&&r){const o=((t,i,n)=>{const r=t.properties.get("direction"),o="none"===t.properties.get("color-use-theme"),s=t.properties.get("color").toNonPremultipliedRenderColor(o?null:n.getLut(t.scope)).toArray01(),a=t.properties.get("intensity"),l="none"===i.properties.get("color-use-theme"),c=i.properties.get("color").toNonPremultipliedRenderColor(l?null:n.getLut(i.scope)).toArray01(),u=i.properties.get("intensity"),h=[r.x,r.y,r.z],d=e.dN(c,u),f=e.dN(s,a);return{u_lighting_ambient_color:d,u_lighting_directional_dir:h,u_lighting_directional_color:f,u_ground_radiance:po(h,f,d)}})(n,r,this.style);i.setLightsUniformValues(t,o)}}}uploadCommonUniforms(t,i,n,r,o){if(this.uploadCommonLightUniforms(t,i),this.terrain&&this.terrain.renderingToTexture)return;const s=this.style.fog;if(s){const o=s.getOpacity(this.transform.pitch),a=((t,i,n,r,o,s,a,l,c,u,h,d)=>{const f=t.transform,p="none"===i.properties.get("color-use-theme"),m=i.properties.get("color").toNonPremultipliedRenderColor(p?null:t.style.getLut(i.scope)).toArray01();m[3]=r;const _=t.frameCounter/1e3%1,[g,y]=i.properties.get("vertical-range");return{u_fog_matrix:n?f.calculateFogTileMatrix(n):d||t.identityMat,u_fog_range:i.getFovAdjustedRange(f._fov),u_fog_color:m,u_fog_horizon_blend:i.properties.get("horizon-blend"),u_fog_vertical_limit:[Math.min(g,y),y],u_fog_temporal_offset:_,u_frustum_tl:o,u_frustum_tr:s,u_frustum_br:a,u_frustum_bl:l,u_globe_pos:c,u_globe_radius:u,u_viewport:h,u_globe_transition:e.aj(f.zoom),u_is_globe:+("globe"===f.projection.name)}})(this,s,n,o,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*e.o.devicePixelRatio,this.transform.height*e.o.devicePixelRatio],r);i.setFogUniformValues(t,a)}o&&i.setCutoffUniformValues(t,o.uniformValues)}setTileLoadedFlag(e){this.tileLoaded=e}saveCanvasCopy(){const e=this.canvasCopy();e&&(this.frameCopies.push(e),this.tileLoaded=!1)}canvasCopy(){const e=this.context.gl,t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.copyTexImage2D(e.TEXTURE_2D,0,e.RGBA,0,0,e.drawingBufferWidth,e.drawingBufferHeight,0),t}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const e=this.style&&this.style.fog;return!!e&&0!==e.getOpacity(this.transform.pitch)}getBackgroundTiles(){const e=this._backgroundTiles,t=this._backgroundTiles={},i=this.transform.coveringTiles({tileSize:512});for(const n of i)t[n.key]=e[n.key]||new Pt(n,512,this.transform.tileZoom,this,void 0,this.worldview);return t}clearBackgroundTiles(){this._backgroundTiles={}}isSourceForClippingOrConflation(e,t){return!(!e.is3D(!(!this.terrain||!this.terrain.enabled))||"clip"!==e.type&&"building"!==e.type&&(e.minzoom&&e.minzoom>this.transform.zoom||(this.style._clipLayerPresent||"building"!==e.sourceLayer&&"procedural_buildings"!==e.sourceLayer)&&(!t||"batched-model"!==t.type)))}isTileAffectedByFog(e){if(!this.style||!this.style.fog)return!1;if("globe"===this.transform.projection.name)return!0;let t=this._cachedTileFogOpacities[e.key];return t||(this._cachedTileFogOpacities[e.key]=t=this.style.fog.getOpacityForTile(e)),t[0]>=je||t[1]>=je}setupDepthForOcclusion(e,t,i){const n=this.context,r=n.gl,o=!!i;var s;i||(i={u_dem:2,u_dem_prev:4,u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0}),n.activeTexture.set(r.TEXTURE3),e&&this.depthFBO&&this.depthTexture?(this.depthTexture.bind(r.NEAREST,r.CLAMP_TO_EDGE),i.u_depth_size_inv=[1/this.depthFBO.width,1/this.depthFBO.height],i.u_depth_range_unpack=[2/((s=this.depthRangeFor3D)[1]-s[0]),-1-2*s[0]/(s[1]-s[0])],i.u_occluder_half_size=.5*this.occlusionParams.occluderSize,i.u_occlusion_depth_offset=this.occlusionParams.depthOffset):this.empty
vendor: 8,047 bytes, line 2
2DepthTexture.bind(r.NEAREST,r.CLAMP_TO_EDGE),n.activeTexture.set(r.TEXTURE0),o||t.setTerrainUniformValues(n,i)}updateEmissiveMode(){if(this._forceEmissiveMode)return;const e=this.style.hasDataDrivenEmissiveStrength();this.emissiveMode=e?this.context.extBlendFuncExtended?"dual-source-blending":"mrt-fallback":"constant"}}function ka(e,t){let i=!1,n=null;const r=()=>{n=null,i&&(e(),n=setTimeout(r,t),i=!1)};return()=>(i=!0,n||r(),n)}class Ba{constructor(t){this._hashName=t&&encodeURIComponent(t),e.aY(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=ka(this._updateHashUnthrottled.bind(this),300)}addTo(e){return this._map=e,window.addEventListener("hashchange",this._onHashChange,!1),e.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const e=this._map;if(!e)return"";const t=Na(e);if(this._hashName){const e=this._hashName;let i=!1;const n=location.hash.slice(1).split("&").map(n=>{const r=n.split("=")[0];return r===e?(i=!0,`${r}=${t}`):n}).filter(e=>e);return i||n.push(`${e}=${t}`),`#${n.join("&")}`}return`#${t}`}_getCurrentHash(){const e=location.hash.replace("#","");if(this._hashName){let t;return e.split("&").map(e=>e.split("=")).forEach(e=>{e[0]===this._hashName&&(t=e)}),(t&&t[1]||"").split("/")}return e.split("/")}_onHashChange(){const e=this._map;if(!e)return!1;const t=this._getCurrentHash();if(t.length>=3&&!t.some(e=>isNaN(Number(e)))){const i=e.dragRotate.isEnabled()&&e.touchZoomRotate.isEnabled()?+(t[3]||0):e.getBearing();return e.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:i,pitch:+(t[4]||0)}),!0}return!1}_updateHashUnthrottled(){history.replaceState(history.state,"",location.href.replace(/(#.+)?$/,this.getHashString()))}}function Na(e,t){const i=e.getCenter(),n=Math.round(100*e.getZoom())/100,r=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.pow(10,r),s=Math.round(i.lng*o)/o,a=Math.round(i.lat*o)/o,l=e.getBearing(),c=e.getPitch();let u=t?`/${s}/${a}/${n}`:`${n}/${a}/${s}`;return(l||c)&&(u+="/"+Math.round(10*l)/10),c&&(u+=`/${Math.round(c)}`),u}const Va={linearity:.3,easing:e.eT(0,0,.3,1)},Ua=Object.assign({deceleration:2500,maxSpeed:1400},Va),ja=Object.assign({deceleration:20,maxSpeed:1400},Va),Ga=Object.assign({deceleration:1e3,maxSpeed:360},Va),qa=Object.assign({deceleration:1e3,maxSpeed:90},Va);class Ha{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.o.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,i=e.o.now();for(;t.length>0&&i-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._map._prefersReducedMotion())return;if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const i={zoom:0,bearing:0,pitch:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:e}of this._inertiaBuffer)i.zoom+=e.zoomDelta||0,i.bearing+=e.bearingDelta||0,i.pitch+=e.pitchDelta||0,e.panDelta&&i.pan._add(e.panDelta),e.around&&(i.around=e.around),e.pinchAround&&(i.pinchAround=e.pinchAround);const n=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,r={};if(i.pan.mag()){const e=Wa(i.pan.mag(),n,Object.assign({},Ua,t||{}));r.offset=i.pan.mult(e.amount/i.pan.mag()),r.center=this._map.transform.center,$a(r,e)}if(i.zoom){const e=Wa(i.zoom,n,ja);r.zoom=this._map.transform.zoom+e.amount,$a(r,e)}if(i.bearing){const t=Wa(i.bearing,n,Ga);r.bearing=this._map.transform.bearing+e.aA(t.amount,-179,179),$a(r,t)}if(i.pitch){const e=Wa(i.pitch,n,qa);r.pitch=this._map.transform.pitch+e.amount,$a(r,e)}if(r.zoom||r.bearing){const e=void 0===i.pinchAround?i.around:i.pinchAround;r.around=e?this._map.unproject(e):this._map.getCenter()}return this.clear(),r.noMoveStart=!0,r}}function $a(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function Wa(t,i,n){const{maxSpeed:r,linearity:o,deceleration:s}=n,a=e.aA(t*o/(i/1e3),-r,r),l=Math.abs(a)/(s*o);return{easing:n.easing,duration:1e3*l,amount:a*(l/2)}}class Za extends e.z{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,i,n={}){const r=g(t.getCanvasContainer(),i),o=t.unproject(r);super(e,Object.assign({point:r,lngLat:o,originalEvent:i},n)),this._defaultPrevented=!1,this.target=t}}class Xa extends e.z{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,n){const r="touchend"===t?n.changedTouches:n.touches,o=y(i.getCanvasContainer(),r),s=o.map(e=>i.unproject(e)),a=o.reduce((e,t,i,n)=>e.add(t.div(n.length)),new e.P(0,0));super(t,{points:o,point:a,lngLats:s,lngLat:i.unproject(a),originalEvent:n}),this._defaultPrevented=!1}}class Ya extends e.z{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t){super("wheel",{originalEvent:t}),this._defaultPrevented=!1}}class Ka{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){this._mousedownPos=void 0}wheel(e){return this._firePreventable(new Ya(this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new Za(e.type,this._map,e))}mouseup(e){this._map.fire(new Za(e.type,this._map,e))}preclick(e){const t=new MouseEvent("preclick",e);this._map.fire(new Za(t.type,this._map,t))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||(this.preclick(e),this._map.fire(new Za(e.type,this._map,e)))}dblclick(e){return this._firePreventable(new Za(e.type,this._map,e))}mouseover(e){this._map.fire(new Za(e.type,this._map,e))}mouseout(e){this._map.fire(new Za(e.type,this._map,e))}touchstart(e){return this._firePreventable(new Xa(e.type,this._map,e))}touchmove(e){this._map.fire(new Xa(e.type,this._map,e))}touchend(e){this._map.fire(new Xa(e.type,this._map,e))}touchcancel(e){this._map.fire(new Xa(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ja{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(e){this._map.fire(new Za(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Za("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._map.fire(new Za(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Qa{constructor(e,t){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,t){this.isEnabled()&&e.shiftKey&&0===e.button&&(f(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active)return;const i=t,n=this._startPos,r=this._lastPos;if(!n||!r||r.equals(i)||!this._box&&i.dist(n)<this._clickTolerance)return;this._lastPos=i,this._box||(this._box=l("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",e));const o=Math.min(n.x,i.x),s=Math.max(n.x,i.x),a=Math.min(n.y,i.y),c=Math.max(n.y,i.y);this._map._requestDomTask(()=>{this._box&&(this._box.style.transform=`translate(${o}px,${a}px)`,this._box.style.width=s-o+"px",this._box.style.height=c-a+"px")})}mouseupWindow(t,i){if(!this._active)return;const n=this._startPos,r=i;if(n&&0===t.button){if(this.reset(),_(),n.x!==r.x||n.y!==r.y)return this._map.fire(new e.z("boxzoomend",{originalEvent:t})),{cameraAnimation:e=>e.fitScreenCoordinates(n,r,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",t)}}
vendor: 5,085 bytes, line 2
2keydown(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),p(),delete this._startPos,delete this._lastPos}_fireEvent(t,i){return this._map.fire(new e.z(t,{originalEvent:i}))}}function el(e,t){const i={};for(let n=0;n<e.length;n++)i[e[n].identifier]=t[n];return i}class tl{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){this.centroid=void 0,this.startTime=0,this.touches={},this.aborted=!1}touchstart(t,i,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(0===this.startTime&&(this.startTime=t.timeStamp),n.length===this.numTouches&&(this.centroid=function(t){const i=new e.P(0,0);for(const e of t)i._add(e);return i.div(t.length)}(i),this.touches=el(n,i)))}touchmove(e,t,i){if(this.aborted||!this.centroid)return;const n=el(i,t);for(const e in this.touches){const t=n[e];(!t||t.dist(this.touches[e])>30)&&(this.aborted=!0)}}touchend(e,t,i){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){const e=!this.aborted&&this.centroid;if(this.reset(),e)return e}}}class il{constructor(e){this.singleTap=new tl(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(e,t,i){this.singleTap.touchstart(e,t,i)}touchmove(e,t,i){this.singleTap.touchmove(e,t,i)}touchend(e,t,i){const n=this.singleTap.touchend(e,t,i);if(n){const t=e.timeStamp-this.lastTime<500,i=!this.lastTap||this.lastTap.dist(n)<30;if(t&&i||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}}}class nl{constructor(){this._zoomIn=new il({numTouches:1,numTaps:2}),this._zoomOut=new il({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,i){this._zoomIn.touchstart(e,t,i),this._zoomOut.touchstart(e,t,i)}touchmove(e,t,i){this._zoomIn.touchmove(e,t,i),this._zoomOut.touchmove(e,t,i)}touchend(e,t,i){const n=this._zoomIn.touchend(e,t,i),r=this._zoomOut.touchend(e,t,i);return n?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:t.getZoom()+1,around:t.unproject(n)},{originalEvent:e})}):r?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:t.getZoom()-1,around:t.unproject(r)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const rl={0:1,2:2},ol={Control:"ctrlKey",Alt:"altKey",Shift:"shiftKey",Meta:"metaKey"};class sl{constructor(e){this.reset(),this._clickTolerance=e.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(e,t){return!1}_move(e,t){return{}}mousedown(e,t){if(this._lastPoint)return;const i=v(e);this._correctButton(e,i)&&(this._lastPoint=t,this._eventButton=i)}mousemoveWindow(e,t){const i=this._lastPoint;if(i)if(e.preventDefault(),null!=this._eventButton&&function(e,t){const i=rl[t];return void 0===e.buttons||(e.buttons&i)!==i}(e,this._eventButton))this.reset();else if(this._moved||!(t.dist(i)<this._clickTolerance))return this._moved=!0,this._lastPoint=t,this._move(i,t)}mouseupWindow(e){this._lastPoint&&v(e)===this._eventButton&&(this._moved&&_(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class al extends sl{mousedown(e,t){super.mousedown(e,t),this._lastPoint&&(this._active=!0)}_correctButton(e,t){return 0===t&&!e.ctrlKey}_move(e,t){return{around:t,panDelta:t.sub(e)}}}class ll extends sl{constructor(e){super(e),this._pitchRotateKey=e.pitchRotateKey?ol[e.pitchRotateKey]:void 0}_correctButton(e,t){return this._pitchRotateKey?0===t&&e[this._pitchRotateKey]:0===t&&e.ctrlKey||2===t}_move(e,t){const i=.8*(t.x-e.x);if(i)return this._active=!0,{bearingDelta:i}}contextmenu(e){this._pitchRotateKey||e.preventDefault()}}class cl extends sl{constructor(e){super(e),this._pitchRotateKey=e.pitchRotateKey?ol[e.pitchRotateKey]:void 0}_correctButton(e,t){return this._pitchRotateKey?0===t&&e[this._pitchRotateKey]:0===t&&e.ctrlKey||2===t}_move(e,t){const i=-.5*(t.y-e.y);if(i)return this._active=!0,{pitchDelta:i}}contextmenu(e){this._pitchRotateKey||e.preventDefault()}}class ul{constructor(t,i){this._map=t,this._el=t.getCanvasContainer(),this._minTouches=1,this._clickTolerance=i.clickTolerance||1,this.reset(),e.aY(["_addTouchPanBlocker","_showTouchPanBlockerAlert"],this)}reset(){this._active=!1,this._touches={},this._sum=new e.P(0,0)}touchstart(e,t,i){return this._calculateTransform(e,t,i)}touchmove(t,i,n){if(this._active&&!(n.length<this._minTouches)){if(this._map._cooperativeGestures&&!this._map.isMoving()){if(1===n.length&&!e.eU())return void this._showTouchPanBlockerAlert();
vendor: 4,238 bytes, line 2
2"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}return t.cancelable&&t.preventDefault(),this._calculateTransform(t,i,n)}}touchend(e,t,i){this._calculateTransform(e,t,i),this._active&&i.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,i,n){n.length>0&&(this._active=!0);const r=el(n,i),o=new e.P(0,0),s=new e.P(0,0);let a=0;for(const e in r){const t=r[e],i=this._touches[e];i&&(o._add(t),s._add(t.sub(i)),a++,r[e]=t)}if(this._touches=r,a<this._minTouches||!s.mag())return;const l=s.div(a);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:o.div(a),panDelta:l}}enable(){this._enabled=!0,this._map._cooperativeGestures&&(this._addTouchPanBlocker(),this._el.classList.add("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page"))}disable(){this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove(),this._el.classList.remove("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page")),this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}_addTouchPanBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=l("div","mapboxgl-touch-pan-blocker",this._map._container),this._alertContainer.textContent=this._map._getUIString("TouchPanBlocker.Message"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showTouchPanBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=window.setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.removeAttribute("role")},500)}}class hl{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(e){}_move(e,t,i){return{}}touchstart(e,t,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([t[0],t[1]]))}touchmove(e,t,i){const n=this._firstTwoTouches;if(!n)return;e.preventDefault();const[r,o]=n,s=dl(i,t,r),a=dl(i,t,o);if(!s||!a)return;const l=this._aroundCenter?null:s.add(a).div(2);return this._move([s,a],l,e)}touchend(e,t,i){if(!this._firstTwoTouches)return;const[n,r]=this._firstTwoTouches,o=dl(i,t,n),s=dl(i,t,r);o&&s||(this._active&&_(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function dl(e,t,i){for(let n=0;n<e.length;n++)if(e[n].identifier===i)return t[n]}function fl(e,t){return Math.log2(e/t)}class pl extends hl{reset(){super.reset(),this._distance=0,this._startDistance=0}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,t){const i=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(fl(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:fl(this._distance,i),pinchAround:t}}}function ml(e,t){return 180*e.angleWith(t)/Math.PI}class _l extends hl{reset(){super.reset(),this._minDiameter=0,this._startVector=void 0,this._vector=void 0}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,t){const i=this._vector;if(this._vector=e[0].sub(e[1]),i&&(this._active||!this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:ml(this._vector,i),pinchAround:t}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());const t=25/(Math.PI*this._minDiameter)*360,i=this._startVector;if(!i)return!1;const n=ml(e,i);return Math.abs(n)<t}}function gl(e){return Math.abs(e.y)>Math.abs(e.x)}class yl extends hl{constructor(e){super(),this._map=e}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(e){this._lastPoints=e,gl(e[0].sub(e[1]))&&(this._valid=!1)}_move(t,i,n){const r=this._lastPoints;if(!r)return;const o=t[0].sub(r[0]),s=t[1].sub(r[1]);return this._map._cooperativeGestures&&!e.eU()&&n.touches.length<3||(this._val
vendor: 5,086 bytes, line 2
2id=this.gestureBeginsVertically(o,s,n.timeStamp),!this._valid)?void 0:(this._lastPoints=t,this._active=!0,{pitchDelta:(o.y+s.y)/2*-.5})}gestureBeginsVertically(e,t,i){if(void 0!==this._valid)return this._valid;const n=e.mag()>=2,r=t.mag()>=2;if(!n&&!r)return;if(!n||!r)return null==this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;const o=e.y>0==t.y>0;return gl(e)&&gl(t)&&o}}const vl={panStep:100,bearingStep:15,pitchStep:10};class xl{constructor(){const e=vl;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=0,i=0,n=0,r=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?i=-1:(e.preventDefault(),r=-1);break;case 39:e.shiftKey?i=1:(e.preventDefault(),r=1);break;case 38:e.shiftKey?n=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?n=-1:(e.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(i=0,n=0),{cameraAnimation:s=>{const a=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:bl,zoom:t?Math.round(a)+t*(e.shiftKey?2:1):a,bearing:s.getBearing()+i*this._bearingStep,pitch:s.getPitch()+n*this._pitchStep,offset:[-r*this._panStep,-o*this._panStep],center:s.getCenter()},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function bl(e){return e*(2-e)}const wl=4.000244140625,Tl=1/450;class Sl{constructor(t,i){this._map=t,this._el=t.getCanvasContainer(),this._handler=i,this._delta=0,this._lastDelta=0,this._defaultZoomRate=.01,this._wheelZoomRate=Tl,e.aY(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around,this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(t){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(t.ctrlKey||t.metaKey||this.isZooming()||e.eU()))return void this._showBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let i=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const n=e.o.now(),r=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==i&&i%wl==0?this._type="wheel":0!==i&&Math.abs(i)<4?this._type="trackpad":r>400?(this._type=null,this._lastValue=i,this._timeout=window.setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(r*i)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,i+=this._lastValue)),t.shiftKey&&i&&(i/=4),this._type&&(this._lastWheelEvent=t,this._delta-=i,this._active||this._start(t)),t.preventDefault()}_onTimeout(e){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const t=g(this._el,e);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:t,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const t=this._map.transform;"wheel"===this._type&&t.projection.wrap&&(t._center.lng>=180||t._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const i=()=>t._terrainEnabled()&&this._aroundCoord?t.computeZoomRelativeTo(this._aroundCoord):t.zoom;if(0!==this._delta){const e="wheel"===this._type&&Math.abs(this._delta)>wl?this._wheelZoomRate:this._defaultZoomRate;let n=2/(1+Math.exp(-Math.abs(this._delta*e)));this._delta<0&&0!==n&&(n=1/n);const r=i(),o=Math.pow(2,r),s="number"==typeof this._targetZoom?t.zoomScale(this._targetZoom):o;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(s*n))),"wheel"===this._type&&(this._startZoom=r,this._easing=this._smoothOutEasing(200)),this._lastDelta=this._delta,this._delta=0}const n="number"==typeof this._targetZoom?this._targetZoom:i(),r=this._startZoom,o=this._easing;let s,a=!1;if("wheel"===this._type&&r&&o){const t=Math.min((e.o.now()-this._lastWheelEventTime)/200,1),i=o(t);s=e.ak(r,n,i),t<1?this._frameId||(this._frameId=!0):a=!0}else s=n,a=!0;this._active=!0,a&&(this._active=!1,this._finishTimeout=window.setTimeout(()=>
vendor: 8,970 bytes, line 2
2{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200));let l=s-i();return l*this._lastDelta<0&&(l=0),{noInertia:!0,needsRenderFrame:!a,zoomDelta:l,around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let i=e.eV;if(this._prevEase){const t=this._prevEase,n=(e.o.now()-t.start)/t.duration,r=t.easing(n+.01)-t.easing(n),o=.27/Math.sqrt(r*r+1e-4)*.01,s=Math.sqrt(.0729-o*o);i=e.eT(o,s,.25,1)}return this._prevEase={start:e.o.now(),duration:t,easing:i},i}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=l("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=window.setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.removeAttribute("role")},200)}}class El{constructor(e,t){this._clickZoom=e,this._tapZoom=t}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 Il{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(e,t){return e.preventDefault(),{cameraAnimation:i=>{i.easeTo({duration:300,zoom:i.getZoom()+(e.shiftKey?-1:1),around:i.unproject(t)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Al{constructor(){this._tap=new il({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(e,t,i){this._swipePoint||(this._tapTime&&e.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?i.length>0&&(this._swipePoint=t[0],this._swipeTouch=i[0].identifier):this._tap.touchstart(e,t,i))}touchmove(e,t,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;const n=t[0],r=n.y-this._swipePoint.y;return this._swipePoint=n,e.preventDefault(),this._active=!0,{zoomDelta:r/128}}}else this._tap.touchmove(e,t,i)}touchend(e,t,i){this._tapTime?this._swipePoint&&0===i.length&&this.reset():this._tap.touchend(e,t,i)&&(this._tapTime=e.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ml{constructor(e,t,i){this._el=e,this._mousePan=t,this._touchPan=i}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Cl{constructor(e,t,i){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=i}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 Pl{constructor(e,t,i,n){this._el=e,this._touchZoom=t,this._touchRotate=i,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const Dl=e=>e.zoom||e.drag||e.pitch||e.rotate;class Rl extends e.z{}class Ll{constructor(){this.constants=[1,1,.01],this.radius=0}setup(t,i){const n=e.av([],i,t);this.radius=e.ag(n[2]<0?e.eX([],n,this.constants):[n[0],n[1],0])}projectRay(t){e.eX(t,t,this.constants),e.aw(t,t),e.eY(t,t,this.constants);const i=e.c5([],t,this.radius);if(i[2]>0){const t=e.c5([],[0,0,1],e.bJ(i,[0,0,1])),n=e.c5([],e.aw([],[i[0],i[1],0]),this.radius),r=e.d8([],i,e.c5([],e.av([],e.d8([],n,t),i),2));i[0]=r[0],i[1]=r[1]}return i}}function zl(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}class Ol{constructor(t,i){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ha(t),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new Ll,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(i),e.aY(["handleEvent","handleWindowEvent"],this);const n=this._el;this._listeners=[[n,"touchstart",{passive:!0}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[window,"blur",void 0]];for(const[e,t,i]of this._listeners){const n=e===document?this.handleWindowEvent:this.handleEvent;e.addEventListener(t,n,i)}}destroy(){for(const[e,t,i]of this._listeners){const n=e===document?this.handleWindowEvent:this.handleEvent;e.removeEventListener(t,n,i)}}_addDefaultHandlers(e){const t=this._map,i=t.getCanvasContainer();this._add("mapEvent",new Ka(t,e));const n=t.boxZoom=new Qa(t,e);this._add("boxZoom",n);const r=new nl,o=new Il;t.doubleClickZoom=new El(o,r),this._add("tapZoom",r),this._add("clickZoom",o);const s=new Al;this._add("tapDragZoom",s);const a=t.touchPitch=new yl(t);this._add("touchPitch",a);const l=new ll(e),c=new cl(e);t.dragRotate=new Cl(e,l,c),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",c,["mouseRotate"]);const u=new al(e),h=new ul(t,e);t.dragPan=new Ml(i,u,h),this._add("mousePan",u),this._add("touchPan",h,["touchZoom","touchRotate"]);const d=new _l,f=new pl;t.touchZoomRotate=new Pl(i,f,d,s),this._add("touchRotate",d,["touchPan","touchZoom"]),this._add("touchZoom",f,["touchPan","touchRotate"]),this._add("blockableMapEvent",new Ja(t));const p=t.scrollZoom=new Sl(t,this);this._add("scrollZoom",p,["mousePan"]);const m=t.keyboard=new xl;this._add("keyboard",m);for(const i of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])e.interactive&&e[i]&&t[i].enable(e[i])}_add(e,t,i){this._handlers.push({handlerName:e,handler:t,allowed:i}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(const{handler:e}of this._handlers)e.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[],this._originalZoom=void 0}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Dl(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(e,t,i){for(const n in e)if(n!==i&&(!t||t.indexOf(n)<0))return!0;return!1}handleWindowEvent(e){this.handleEvent(e,`${e.type}Window`)}_getMapTouches(e){const t=[];for(const i of e)this._el.contains(i.target)&&t.push(i);return t}handleEvent(e,t){this._updatingCamera=!0;const i="renderFrame"===e.type,n=i?void 0:e,r={needsRenderFrame:!1},o={},s={},a=e.touches?this._getMapTouches(e.touches):void 0,l=a?y(this._el,a):i?void 0:g(this._el,e);for(const{handlerName:i,handler:c,allowed:u}of this._handlers){if(!c.isEnabled())continue;let h;this._blockedByActive(s,u,i)?c.reset():c[t||e.type]&&(h=c[t||e.type](e,l,a),this.mergeHandlerResult(r,o,h,i,n),h&&h.needsRenderFrame&&this._triggerRe
vendor: 4,116 bytes, line 2
2nderFrame()),(h||c.isActive())&&(s[i]=c)}const c={};for(const e in this._previousActiveHandlers)s[e]||(c[e]=n);this._previousActiveHandlers=s,(Object.keys(c).length||zl(r))&&(this._changes.push([r,o,c]),this._triggerRenderFrame()),(Object.keys(s).length||zl(r))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:u}=r;u&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],u(this._map))}mergeHandlerResult(e,t,i,n,r){if(!i)return;Object.assign(e,i);const o={handlerName:n,originalEvent:i.originalEvent||r};void 0!==i.zoomDelta&&(t.zoom=o),void 0!==i.panDelta&&(t.drag=o),void 0!==i.pitchDelta&&(t.pitch=o),void 0!==i.bearingDelta&&(t.rotate=o)}_applyChanges(){const t={},i={},n={};for(const[r,o,s]of this._changes)r.panDelta&&(t.panDelta=(t.panDelta||new e.P(0,0))._add(r.panDelta)),r.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+r.zoomDelta),r.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+r.bearingDelta),r.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+r.pitchDelta),void 0!==r.around&&(t.around=r.around),void 0!==r.aroundCoord&&(t.aroundCoord=r.aroundCoord),void 0!==r.pinchAround&&(t.pinchAround=r.pinchAround),r.noInertia&&(t.noInertia=r.noInertia),Object.assign(i,o),Object.assign(n,s);this._updateMapTransform(t,i,n),this._changes=[]}_updateMapTransform(t,i,n){const r=this._map,o=r.transform,s=e=>[e.x,e.y,e.z];if((()=>{const e=this._eventsInProgress.drag;return e&&!this._handlersById[e.handlerName].isActive()})()&&!zl(t)){const e=o.zoom;o.cameraElevationReference="sea",null!=this._originalZoom&&o._orthographicProjectionAtLowPitch&&"globe"!==o.projection.name&&0===o.pitch?(o.cameraElevationReference="ground",o.zoom=this._originalZoom):(o.recenterOnTerrain(),o.cameraElevationReference="ground"),e!==o.zoom&&this._map._update(!0)}if(o._isCameraConstrained&&r._stop(!0),!zl(t))return void this._fireEvents(i,n,!0);let{panDelta:a,zoomDelta:l,bearingDelta:c,pitchDelta:u,around:h,aroundCoord:d,pinchAround:f}=t;o._isCameraConstrained&&(l>0&&(l=0),o._isCameraConstrained=!1),void 0!==f&&(h=f),(l||(e=>i[e]&&!this._eventsInProgress[e])("drag"))&&h&&(this._dragOrigin=s(o.pointCoordinate3D(h)),this._originalZoom=o.zoom,this._trackingEllipsoid.setup(o._camera.position,this._dragOrigin)),o.cameraElevationReference="sea",r._stop(!0),h=h||r.transform.centerPoint,c&&(o.bearing+=c),u&&(o.pitch+=u),o._updateCameraState();const p=[0,0,0];if(a)if("mercator"===o.projection.name){const e=this._trackingEllipsoid.projectRay(o.screenPointToMercatorRay(h).dir),t=this._trackingEllipsoid.projectRay(o.screenPointToMercatorRay(h.sub(a)).dir);p[0]=t[0]-e[0],p[1]=t[1]-e[1]}else{const t=o.pointCoordinate(h);if("globe"===o.projection.name){a=a.rotate(-o.angle);const i=o._pixelsPerMercatorPixel/o.worldSize;p[0]=-a.x*e.eW(e.a$(t.y))*i,p[1]=-a.y*e.eW(o.center.lat)*i}else{const e=o.pointCoordinate(h.sub(a));t&&e&&(p[0]=e.x-t.x,p[1]=e.y-t.y)}}const m=o.zoom,_=[0,0,0];if(l){const t=s(d||o.pointCoordinate3D(h)),i={dir:e.aw([],e.av([],t,o._camera.position))};if(i.dir[2]<0){const n=o.zoomDeltaToMovement(t,l);e.c5(_,i.dir,n)}}const g=e.d8(p,p,_);o._translateCameraConstrained(g),l&&Math.abs(o.zoom-m)>1e-4&&o.recenterOnTerrain(),o.cameraElevationReference="ground",this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(i,n,!0)}_fireEvents(t,i,n){const r=Dl(this._eventsInProgress),o=Dl(t),s={};for(const e in t){const{originalEvent:i}=t[e];this._eventsInProgress[e]||(s[`${e}start`]=i),this._eventsInProgress[e]=t[e]}!r&&o&&this._fireEvent("movestart",o.originalEvent);for(const e in s)this._fireEvent(e,s[e]);o&&this._fireEvent("move",o.originalEvent);for(const e in t){const{originalEvent:i}=t[e];this._fireEvent(e,i)}const a={};let l;for(const e in this._eventsInProgress){const{handlerName:t,originalEvent:n}=this._eventsInProgress[e];this._handlersById[t].isActive()||(delete this._eventsInProgress[e],l=i[t]||n,a[`${e}end`]=l)}for(const e in a)this._fireEvent(e,a[e]);const c=Dl(this._eventsInProgress);if(n&&(r||o)&&!c){this._updatingCamera=!0;const t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),i=e=>0!==e&&-this._bearingSnap<e&&e<this._bearingSnap;
vendor: 11,444 bytes, line 2
2t?(i(t.bearing||this._map.getBearing())&&(t.bearing=0),this._map.easeTo(t,{originalEvent:l})):(this._map.fire(new e.z("moveend",{originalEvent:l})),i(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(t,i){this._map.fire(new e.z(t,i?{originalEvent:i}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(e=>{this._frameId=void 0,this.handleEvent(new Rl("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}const Fl="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class kl extends e.E{constructor(t,i){super(),this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=i.bearingSnap,this._respectPrefersReducedMotion=!1!==i.respectPrefersReducedMotion,e.aY(["_renderFrameCallback"],this)}getCenter(){return new e.aT(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}panBy(t,i,n){return t=e.P.convert(t).mult(-1),this.panTo(this.transform.center,Object.assign({offset:t},i),n)}panTo(e,t,i){return this.easeTo(Object.assign({center:e},t),i)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(e,t,i){return this.easeTo(Object.assign({zoom:e},t),i)}zoomIn(e,t){return this.zoomTo(this.getZoom()+1,e,t),this}zoomOut(e,t){return this.zoomTo(this.getZoom()-1,e,t),this}getBearing(){return this.transform.bearing}setBearing(e,t){return this.jumpTo({bearing:e},t),this}getPadding(){return this.transform.padding}setPadding(e,t){return this.jumpTo({padding:e},t),this}rotateTo(e,t,i){return this.easeTo(Object.assign({bearing:e},t),i)}resetNorth(e,t){return this.rotateTo(0,Object.assign({duration:1e3},e),t),this}resetNorthPitch(e,t){return this.easeTo(Object.assign({bearing:0,pitch:0,duration:1e3},e),t),this}snapToNorth(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this}getPitch(){return this.transform.pitch}setPitch(e,t){return this.jumpTo({pitch:e},t),this}cameraForBounds(t,i){t=e.aI.convert(t);const n=i&&i.bearing||0,r=i&&i.pitch||0,o=t.getNorthWest(),s=t.getSouthEast();return this._cameraForBounds(this.transform,o,s,n,r,i)}_extendPadding(e){const t={top:0,right:0,bottom:0,left:0};return null==e?Object.assign({},t,this.transform.padding):"number"==typeof e?{top:e,bottom:e,right:e,left:e}:Object.assign({},t,e)}_extendCameraOptions(e){return(e=Object.assign({offset:[0,0],maxZoom:this.transform.maxZoom},e)).padding=this._extendPadding(e.padding),e}_minimumAABBFrustumDistance(e,t){const i=t.max[0]-t.min[0],n=t.max[1]-t.min[1];return i/n>e.aspect?i/(2*Math.tan(.5*e.fovX)*e.aspect):n/(2*Math.tan(.5*e.fovY)*e.aspect)}_cameraForBoundsOnGlobe(t,i,n,r,o,s){const a=t.clone(),l=this._extendCameraOptions(s);a.bearing=r,a.pitch=o;const c=e.aT.convert(i),u=e.aT.convert(n),h=.5*(c.lat+u.lat),d=.5*(c.lng+u.lng),f=e.eZ(h,d),p=e.aw([],f),m=e.aw([],e.bI([],p,[0,1,0])),_=e.bI([],m,p),g=[m[0],m[1],m[2],0,_[0],_[1],_[2],0,p[0],p[1],p[2],0,0,0,0,1],y=[f,e.eZ(c.lat,c.lng),e.eZ(u.lat,c.lng),e.eZ(u.lat,u.lng),e.eZ(c.lat,u.lng),e.eZ(h,c.lng),e.eZ(h,u.lng),e.eZ(c.lat,d),e.eZ(u.lat,d)];let v=e.d9.fromPoints(y.map(t=>[e.bJ(m,t),e.bJ(_,t),e.bJ(p,t)]));const x=e.af([],v.center,g);0===e.e_(x)&&e.e$(x,0,0,1),e.aw(x,x),e.c5(x,x,e.aD),a.center=e.f0(x);const b=a.getWorldToCameraMatrix(),w=e.bl(new Float64Array(16),b);v=e.d9.applyTransform(v,e.aB([],b,g));const T=this._extendAABB(v,a,l,r);if(!T)return void e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");v=T,e.af(x,x,b);const S=.5*(v.max[2]-v.min[2]),E=this._minimumAABBFrustumDistance(a,v),I=e.c5([],[0,0,1],S),A=e.d8(I,x,I),M=E+(0===a.pitch?0:e.bG(x,A)),C=a.globeCenterInViewSpace,P=e.av([],x,[C[0],C[1],C[2]]);e.aw(P,P),e.c5(P,P,M);const D=e.d8([],x,P);e.af(D,D,w);const R=e.eM/e.aD,L=e.ag(D),z=e.cf(Math.max(L*R-e.eM,Number.EPSILON),0),O=Math.min(a.zoomFromMercatorZAdjusted(z),l.maxZoom);return O>.5*(e.c_+e.cL)?(a.setProjection({name:"mercator"}),a.zoom=O,this._cameraForBounds(a,i,n,r,o,s)):{center:a.center,zoom:O,bearing:r,pitch:o}}_extendAABB(t,i,n,r){const o=.5*((n.padding.left||0)+(n.padding.right||0)),s=.5*((n.padding.top||0)+(n.padding.bottom||0)),a=s,l=o,c=o,u=s,h=i.width-(l+c),d=i.height-(a+u),f=e.av([],t.max,t.min),p=Math.min(h/f[0],d/f[1]),m=Math.min(i.scaleZoom(i.scale*p),n.maxZoom);if(isNaN(m))return null;const _=i.scale/i.zoomScale(m),g=new e.d9([t.min[0]-l*_,t.min[1]-u*_,t.min[2]],[t.max[0]+c*_,t.max[1]+a*_,t.max[2]]),y=("number"==typeof n.offset.x&&"number"==typeof n.offset.y?new e.P(n.offset.x,n.offset.y):e.P.convert(n.offset)).rotate(-e.an(r));return g.center[0]-=y.x*_,g.center[1]+=y.y*_,g}queryTerrainElevation(t,i){const n=this.transform.elevation;return n?(i=Object.assign({},{exaggerated:!0},i),n.getAtPoint(e.ae.fromLngLat(t),null,i.exaggerated)):null}_cameraForBounds(t,i,n,r,o,s){if("globe"===t.projection.name)return this._cameraForBoundsOnGlobe(t,i,n,r,o,s);const a=t.clone(),l=this._extendCameraOptions(s);a.bearing=r,a.pitch=o;const c=e.aT.convert(i),u=e.aT.convert(n),h=new e.aT(c.lng,u.lat),d=new e.aT(u.lng,c.lat),f=a.project(c),p=a.project(u),m=this.queryTerrainElevation(c),_=this.queryTerrainElevation(u),g=this.queryTerrainElevation(h),y=this.queryTerrainElevation(d),v=[[f.x,f.y,Math.min(m||0,_||0,g||0,y||0)],[p.x,p.y,Math.max(m||0,_||0,g||0,y||0)]];let x=e.d9.fromPoints(v);const b=a.getWorldToCameraMatrix(),w=e.bl(new Float64Array(16),b);x=e.d9.applyTransform(x,b);const T=this._extendAABB(x,a,l,r);if(!T)return void e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");x=T;const S=.5*e.av([],x.max,x.min)[2],E=this._minimumAABBFrustumDistance(a,x),I=[0,0,1,0];e.aC(I,I,b),e.f1(I,I);const A=e.c5([],I,E+S),M=e.d8([],x.center,A);e.af(x.center,x.center,w),e.af(M,M,w);const C=a.unproject(new e.P(x.center[0],x.center[1])),P=e.f2(a.projection,C),D=Math.pow(2,P),R=Math.min(a._zoomFromMercatorZ(M[2]*a.pixelsPerMeter*D/a.worldSize),l.maxZoom);return a.mercatorFromTransition&&R<.5*(e.c_+e.cL)?(a.setProjection({name:"globe"}),a.zoom=R,this._cameraForBounds(a,i,n,r,o,s)):{center:C,zoom:R,bearing:r,pitch:o}}fitBounds(e,t,i){const n=this.cameraForBounds(e,t);return this._fitInternal(n,t,i)}fitScreenCoordinates(t,i,n,r,o){const s=e.P.convert(t),a=e.P.convert(i),l=new e.P(Math.min(s.x,a.x),Math.min(s.y,a.y)),c=new e.P(Math.max(s.x,a.x),Math.max(s.y,a.y));if("mercator"===this.transform.projection.name&&this.transform.anyCornerOffEdge(s,a))return this;const u=this.transform.pointLocation3D(l),h=this.transform.pointLocation3D(c),d=this.transform.pointLocation3D(new e.P(l.x,c.y)),f=this.transform.pointLocation3D(new e.P(c.x,l.y)),p=[Math.min(u.lng,h.lng,d.lng,f.lng),Math.min(u.lat,h.lat,d.lat,f.lat)],m=[Math.max(u.lng,h.lng,d.lng,f.lng),Math.max(u.lat,h.lat,d.lat,f.lat)],_=r&&r.pitch?r.pitch:this.getPitch(),g=this._cameraForBounds(this.transform,p,m,n,_,r);return this._fitInternal(g,r,o)}_fitInternal(e,t,i){return e?(t=Object.assign(e,t)).linear?this.easeTo(t,i):this.flyTo(t,i):this}jumpTo(t,i){this.stop();const n=t.preloadOnly?this.transform.clone():this.transform;let r=!1,o=!1,s=!1;"zoom"in t&&n.zoom!==+t.zoom&&(r=!0,n.zoom=+t.zoom),void 0!==t.center&&(n.center=e.aT.convert(t.center)),"bearing"in t&&n.bearing!==+t.bearing&&(o=!0,n.bearing=+t.bearing),"pitch"in t&&n.pitch!==+t.pitch&&(s=!0,n.pitch=+t.pitch);const a="number"==typeof t.padding?this._extendPadding(t.padding):t.padding;if(null!=t.padding&&!n.isPaddingEqual(a))if(!1===t.retainPadding){const e=n.clone();e.padding=a,n.setLocationAtPoint(n.center,e.centerPoint)}else n.padding=a;return t.preloadOnly?(this._preloadTiles(n),this):(this.fire(new e.z("movestart",i)).fire(new e.z("move",i)),r&&this.fire(new e.z("zoomstart",i)).fire(new e.z("zoom",i)).fire(new e.z("zoomend",i)),o&&this.fire(new e.z("rotatestart",i)).fire(new e.z("rotate",i)).fire(new e.z("rotateend",i)),s&&this.fire(new e.z("pitchstart",i)).fire(new e.z("pitch",i)).fire(new e.z("pitchend",i)),this.fire(new e.z("moveend",i)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||e.w(Fl),this.transform.getFreeCameraOptions()}setFreeCameraOptions(t,i){const n=this.transform;if(!n.projection.supportsFreeCamera)return e.w(Fl),this;this.stop();const r=n.zoom,o=n.pitch,s=n.bearing;n.setFreeCameraOptions(t);const a=r!==n.zoom,l=o!==n.pitch,c=s!==n.bearing;return this.fire(new e.z("movestart",i)).fire(new e.z("move",i)),a&&this.fire(new e.z("zoomstart",i)).fire(new e.z("zoom",i)).fire(new e.z("zoomend",i)),c&&this.fire(new e.z("rotatestart",i)).fire(new e.z("rotate",i)).fire(new e.z("rotateend",i)),l&&this.fire(new e.z("pitchstart",i)).fire(new e.z("pitch",i)).fire(new e.z("pitchend",i)),this.fire(new e.z("moveend",i)),this}easeTo(t,i){this._stop(!1,t.easeId),(!1===(t=Object.assign({offset:[0,0],duration:500,easing:e.eV},t)).animate||this._prefersReducedMotion(t))&&(t.duration=0);const n=this.transform,r=this.getZoom(),o=this.getBearing(),s=this.getPitch(),a=this.getPadding(),l="zoom"in t?+t.zoom:r,c="bearing"in t?this._normalizeBearing(t.bearing,o):o,u="pitch"in t?+t.pitch:s,h=this._extendPadding(t.padding),d=e.P.convert(t.offset);let f,p,m;if("globe"===n.projection.name){const i=e.ae.fromLngLat(n.center),r=d.rotate(-n.angle);i.x+=r.x/n.worldSize,i.y+=r.y/n.worldSize;const o=i.toLngLat(),s=e.aT.convert(t.center||o);this._normalizeCenter(s),f=n.centerPoint.add(r),p=new e.P(i.x,i.y).mult(n.worldSize),m=new e.P(e.aF(s.lng),e.aJ(s.lat)).mult(n.worldSize).sub(p)}else{f=n.centerPoint.add(d);const i=n.pointLocation(f),r=e.aT.convert(t.center||i);this._normalizeCenter(r),p=n.project(i),m=n.project(r).sub(p)}const _=n.zoomScale(l-r);let g,y;t.around&&(g=e.aT.convert(t.around),y=n.locationPoint(g));const v=this._zooming||l!==r,x=this._rotating||o!==c,b=this._pitching||u!==s,w=!n.isPaddingEqual(h),T=!1===t.retainPadding?n.clone():n,S=n=>S=>{if(v&&(n.zoom=e.ak(r,l,S)),x&&(n.bearing=e.ak(o,c,S)),b&&(n.pitch=e.ak(s,u,S)),w&&(T.interpolatePadding(a,h,S),f=T.centerPoint.add(d)),g)n.setLocationAtPoint(g,y);else{const e=n.zoomScale(n.zoom-r),t=l>r?Math.min(2,_):Math.max(.5,_),i=Math.pow(t,1-S),o=n.unproject(p.add(m.mult(S*i)).mult(e));n.setLocationAtPoint(n.renderWorldCopies?o.wrap():o,f)}return t.preloadOnly||this._fireMoveEvents(i),n};if(t.preloadOnly){const e=this._emulate(S,t.duration,n);return this._preloadTiles(e),this}const E={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=v,this._rotating=x,this._pitching=b,this._padding=w,this._easeId=t.easeId,this._prepareEase(i,t.noMoveStart,E),this._ease(S(n),e=>{"sea"===n.cameraElevationReference&&n.recenterOnTerrain(),this._afterEase(i,e)},t),this}_prepareEase(t,i,n={}){this._moving=!0,this.transform.cameraElevationReference="sea",this.transform._orthographicProjectionAtLowPitch&&0===this.transform.pitch&&"globe"!==this.transform.projection.name&&(this.transform.cameraElevationReference="ground"),i||n.moving||this.fire(new e.z("movestart",t)),this._zooming&&!n.zooming&&this.fire(new e.z("zoomstart",t)),this._rotating&&!n.rotating&&this.fire(new e.z("rotatestart",t)),this._pitching&&!n.pitching&&this.fire(new e.z("pitchstart",t))}_fireMoveEvents(t){this.fire(new e.z("move",t)),this._zooming&&this.fire(new e.z("zoom",t)),this._rotating&&this.fire(new e.z("rotate",t)),this._pitching&&this.fire(new e.z("pitch",t))}
vendor: 5,590 bytes, line 2
2_afterEase(t,i){if(this._easeId&&i&&this._easeId===i)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const n=this._zooming,r=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new e.z("zoomend",t)),r&&this.fire(new e.z("rotateend",t)),o&&this.fire(new e.z("pitchend",t)),this.fire(new e.z("moveend",t))}flyTo(t,i){if(this._prefersReducedMotion(t)){const n=e.aH(t,["center","zoom","bearing","pitch","around","padding","retainPadding"]);return this.jumpTo(n,i)}this.stop(),t=Object.assign({offset:[0,0],speed:1.2,curve:1.42,easing:e.eV},t);const n=this.transform,r=this.getZoom(),o=this.getBearing(),s=this.getPitch(),a=this.getPadding(),l="zoom"in t?e.aA(+t.zoom,n.minZoom,n.maxZoom):r,c="bearing"in t?this._normalizeBearing(t.bearing,o):o,u="pitch"in t?+t.pitch:s,h=this._extendPadding(t.padding),d=n.zoomScale(l-r),f=e.P.convert(t.offset);let p=n.centerPoint.add(f);const m=n.pointLocation(p),_=e.aT.convert(t.center||m);this._normalizeCenter(_);const g=n.project(m),y=n.project(_).sub(g);let v=t.curve;const x=Math.max(n.width,n.height),b=x/d,w=y.mag();if("minZoom"in t){const i=e.aA(Math.min(t.minZoom,r,l),n.minZoom,n.maxZoom),o=x/n.zoomScale(i-r);v=Math.sqrt(o/w*2)}const T=v*v;function S(e){const t=(b*b-x*x+(e?-1:1)*T*T*w*w)/(2*(e?b:x)*T*w);return Math.log(Math.sqrt(t*t+1)-t)}function E(e){return(Math.exp(e)-Math.exp(-e))/2}function I(e){return(Math.exp(e)+Math.exp(-e))/2}const A=S(0);let M=function(e){return I(A)/I(A+v*e)},C=function(e){return x*((I(A)*(E(t=A+v*e)/I(t))-E(A))/T)/w;var t},P=(S(1)-A)/v;if(Math.abs(w)<1e-6||!isFinite(P)){if(Math.abs(x-b)<1e-6)return this.easeTo(t,i);const e=b<x?-1:1;P=Math.abs(Math.log(b/x))/v,C=function(){return 0},M=function(t){return Math.exp(e*v*t)}}t.duration="duration"in t?+t.duration:1e3*P/("screenSpeed"in t?+t.screenSpeed/v:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0);const D=o!==c,R=u!==s,L=!n.isPaddingEqual(h),z=!1===t.retainPadding?n.clone():n,O=n=>d=>{const m=d*P,v=1/M(m);n.zoom=1===d?l:r+n.scaleZoom(v),D&&(n.bearing=e.ak(o,c,d)),R&&(n.pitch=e.ak(s,u,d)),L&&(z.interpolatePadding(a,h,d),p=z.centerPoint.add(f));const x=1===d?_:n.unproject(g.add(y.mult(C(m))).mult(v));return n.setLocationAtPoint(n.renderWorldCopies?x.wrap():x,p),n._updateCameraOnTerrain(),t.preloadOnly||this._fireMoveEvents(i),n};if(t.preloadOnly){const e=this._emulate(O,t.duration,n);return this._preloadTiles(e),this}return this._zooming=!0,this._rotating=D,this._pitching=R,this._padding=L,this._prepareEase(i,!1),this._ease(O(n),()=>this._afterEase(i),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_requestRenderFrame(e){}_cancelRenderFrame(e){}_stop(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const e=this._onEaseEnd;this._onEaseEnd=void 0,e.call(this,t)}if(!e){const e=this.handlers;e&&e.stop(!1)}return this}_ease(t,i,n){!1===n.animate||0===n.duration?(t(1),i()):(this._easeStart=e.o.now(),this._easeOptions=n,this._onEaseFrame=t,this._onEaseEnd=i,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const t=Math.min((e.o.now()-this._easeStart)/this._easeOptions.duration,1),i=this._onEaseFrame;i&&i(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(t,i){t=e.bT(t,-180,180);const n=Math.abs(t-i);return Math.abs(t-360-i)<n&&(t-=360),Math.abs(t+360-i)<n&&(t+=360),t}_normalizeCenter(e){const t=this.transform;if(t.maxBounds)return;if("globe"!==t.projection.name&&!t.renderWorldCopies)return;const i=e.lng-t.center.lng;e.lng+=i>180?-360:i<-180?360:0}_prefersReducedMotion(t){return this._respectPrefersReducedMotion&&e.o.prefersReducedMotion&&!(t&&t.essential)}_emulate(e,t,i){const n=Math.ceil(15*t/1e3),r=[],o=e(i.clone());for(let e=0;e<=n;e++){const t=o(e/n);r.push(t.clone())}return r}_preloadTiles(e,t){}}class Bl{constructor(t={}){this.options=t,e.aY(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(e){const t=this.options&&this.options.compact,i=e._getUIString("AttributionControl.ToggleAttribution");this._map=e,this._container=l("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=l("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._compactButton.setAttribute("aria-label",i);const n=l("span","mapboxgl-ctrl-icon",this._compactButton);return n.setAttribute("aria-hidden","true"),n.setAttribute("title",i),this._innerContainer=l("div","mapboxgl-ctrl-attrib-inner",this._container),t&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===t&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","fal
2se")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));const i=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.e.ACCESS_TOKEN}];if(t){const n=i.reduce((e,t,n)=>(t.value&&(e+=`${t.key}=${t.value}${n<i.length-1?"&":""}`),e),"?");t.href=`${e.e.FEEDBACK_URL}/${n}#${Na(this._map,!0)}`,t.rel="noopener nofollow"}}_updateData(e){!e||("source"!==e.dataType||"metadata"!==e.sourceDataType&&"visibility"!==e.sourceDataType)&&"style"!==e.dataType||(this._updateAttributions(),this._updateEditLink())}_updateAttributions(){if(!this._map.style)return;let e=[];if(this._map.style.stylesheet){const e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}const t=this._map.style._mergedSourceCaches;for(const i in t){const n=t[i];if(n.used){const t=n.getSource();t.attribution&&e.indexOf(t.attribution)<0&&e.push(t.attribution)}}e.sort((e,t)=>e.length-t.length),e=e.filter((t,i)=>{for(let n=i+1;n<e.length;n++)if(e[n].indexOf(t)>=0)return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=[...this.options.customAttribution,...e]:e.unshift(this.options.customAttribution));const i=e.map(e=>function(e){const t=(new DOMParser).parseFromString(e,"text/html");return Array.from(t.body.querySelectorAll("*")).forEach(e=>{const i=e.textContent||"";if("A"!==e.tagName)return void e.replaceWith(t.createTextNode(i));const n=e.getAttribute("href");if(!n||!/^(https?:|mailto:)/i.test(n))return void e.replaceWith(t.createTextNode(i));const r=t.createElement("a");r.href=n,r.textContent=i,r.rel="noopener nofollow";const o=e.getAttribute("class");o&&(r.className=o),e.replaceWith(r)}),t.body.innerHTML}(e)).join(" | ");i!==this._attribHTML&&(this._attribHTML=i,e.length?(this._innerContainer.innerHTML=i,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class Nl{constructor(){e.aY(["_updateLogo","_updateCompact"],this)}onAdd(e){this._map=e,this._container=l("div","mapboxgl-ctrl");const t=l("a","mapboxgl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://www.mapbox.com/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(e){e&&"metadata"!==e.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const e=this._map.style._sourceCaches;if(0===Object.entries(e).length)return!0;for(const t in e){const i=e[t].getSource();if(i.hasOwnProperty("mapbox_logo")&&!i.mapbox_logo)return!1}return!0}_updateCompact(){const e=this._container.children;if(e.length){const t=e[0];this._map.getCanvasContainer().offsetWidth<250?t.classList.add("mapboxgl-compact"):t.classList.remove("mapboxgl-compact")}}}class Vl{constructor(){e.aY(["_onIndoorUpdate"],this)}onAdd(e){return this._map=e,this._container=l("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._map.indoor.on("selector-update",e=>this._onIndoorUpdate(e)),this._container}_createButton(e,t){const i=l("button",e,this._container);return i.type="button",i.addEventListener("click",t),i}_createSeparator(){return l("div","mapboxgl-ctrl-separator",this._container)}_setButtonTitle(e,t){this._map&&(e.setAttribute("aria-label",t),e.textContent=t)}onRemove(){this._container&&this._container.remove(),this._map&&this._map.indoor&&(this._map.indoor.off("selector-update",this._onIndoorUpdate),this._map=null)}getDefaultPosition(){return"right"}_onIndoorUpdate(e){if(!e||!e.floors)return this._model=e,void(this._container.style.display="none");const t=this._model;this._model=e,this._container.style.display="inline-block",this._container.style.borderRadius="8px",t&&Array.from(this._container.children).forEac
2h(e=>e.remove()),e.floors.length>0&&(this.addBuildingsToggleButton(),this.addCurrentFloors(e.floors,e.activeFloorsVisible),this._updateBuildingsButtonState())}addBuildingsToggleButton(){const e=this._createButton("mapboxgl-ctrl-buildings-toggle",()=>{const e=this._map;this._model&&e&&e._setIndoorActiveFloorsVisibility(!this._model.activeFloorsVisible)});l("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden","true"),e.classList.add("mapboxgl-ctrl-level-button","mapboxgl-ctrl-buildings-toggle"),this._model&&!this._model.activeFloorsVisible&&e.classList.add("mapboxgl-ctrl-level-button-selected"),this._container.append(e),this._createSeparator()}_updateBuildingsButtonState(){const e=this._container.querySelector(".mapboxgl-ctrl-buildings-toggle");e&&this._model&&(this._model.activeFloorsVisible?e.classList.remove("mapboxgl-ctrl-level-button-selected"):e.classList.add("mapboxgl-ctrl-level-button-selected"))}addCurrentFloors(e,t){for(let i=0;i<e.length;i++){const n=e[i],r=this._createButton("mapboxgl-ctrl-level-button",()=>{this._map._selectIndoorFloor(n.id)});this._setButtonTitle(r,n.zIndex.toString()),this._model&&n.id===this._model.selectedFloorId&&t&&r.classList.add("mapboxgl-ctrl-level-button-selected"),this._container.append(r),i<e.length-1&&this._createSeparator()}}}class Ul{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){const t=this._currentlyRunning,i=t?this._queue.concat(t):this._queue;for(const t of i)if(t.id===e)return void(t.cancelled=!0)}run(e=0){const t=this._currentlyRunning=this._queue;this._queue=[];for(const i of t)if(!i.cancelled&&(i.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}class jl{constructor(e){this.jumpTo(e)}getValue(t){if(t<=this._startTime)return this._start;if(t>=this._endTime)return this._end;const i=e.dD((t-this._startTime)/(this._endTime-this._startTime));return this._start*(1-i)+this._end*i}isEasing(e){return e>=this._startTime&&e<=this._endTime}jumpTo(e){this._startTime=-1/0,this._endTime=-1/0,this._start=e,this._end=e}easeTo(e,t,i){this._start=this.getValue(t),this._end=e,this._startTime=t,this._endTime=t+i}}const Gl={"AttributionControl.ToggleAttribution":"Toggle attribution","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox homepage","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use ⌘ + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"};class ql extends e.z{constructor(e,t,i,n){const{point:r,lngLat:o,originalEvent:s,target:a}=e;super(e.type,{point:r,lngLat:o,originalEvent:s,target:a}),this.preventDefault=()=>{e.preventDefault()},this.id=t,this.interaction=i,this.feature=n}}class Hl{constructor(e){this.map=e,this.interactionsByType=new Map,this.delegatedInteractions=new Map,this.typeById=new Map,this.filters=new Map,this.handleType=this.handleType.bind(this),this.handleMove=this.handleMove.bind(this),this.handleOut=this.handleOut.bind(this),this.hoveredFeatures=new Map,this.prevHoveredFeatures=new Map}add(t,i){if(this.typeById.has(t))throw new Error(`Interaction id "${t}" already exists.`);const n=i.filter;let r=i.type;n&&this.filters.set(t,e.b6(n)),"mouseover"===r&&(r="mouseenter"),"mouseout"===r&&(r="mouseleave");const o=this.interactionsByType.get(r)||new Map;"mouseenter"===r||"mouseleave"===r?(0===this.delegatedInteractions.size&&(this.map.on("mousemove",this.handleMove),this.map.on("mouseout",this.handleOut)),this.delegatedInteractions.set(t,i)):0===o.size&&this.map.on(r,this.handleType),0===o.size&&this.interactionsByType.set(r,o),o.set(t,i),this.typeById.set(t,r)}
vendor: 5,920 bytes, line 2
2get(e){const t=this.typeById.get(e);if(!t)return;const i=this.interactionsByType.get(t);return i?i.get(e):void 0}remove(e){const t=this.typeById.get(e);if(!t)return;this.typeById.delete(e),this.filters.delete(e);const i=this.interactionsByType.get(t);i&&(i.delete(e),"mouseenter"===t||"mouseleave"===t?(this.delegatedInteractions.delete(e),0===this.delegatedInteractions.size&&(this.map.off("mousemove",this.handleMove),this.map.off("mouseout",this.handleOut))):0===i.size&&this.map.off(t,this.handleType))}queryTargets(e,t){const i=[];for(const[e,n]of t)n.target&&i.push({targetId:e,target:n.target,filter:this.filters.get(e)});return this.map.style.queryRenderedTargets(e,i,this.map.transform)}handleMove(e){this.prevHoveredFeatures=this.hoveredFeatures,this.hoveredFeatures=new Map;const t=this.queryTargets(e.point,Array.from(this.delegatedInteractions).reverse());t.length&&(e.type="mouseenter",this.handleType(e,t));const i=new Map;for(const[e,{feature:t}]of this.prevHoveredFeatures)this.hoveredFeatures.has(e)||i.set(t.id,t);i.size&&(e.type="mouseleave",this.handleType(e,Array.from(i.values())))}handleOut(e){const t=Array.from(this.hoveredFeatures.values()).map(({feature:e})=>e);t.length&&(e.type="mouseleave",this.handleType(e,t)),this.hoveredFeatures.clear()}handleType(t,i){const n="mouseenter"===t.type;if(n&&!this.interactionsByType.has(t.type))return void e.w("mouseenter interaction required for mouseleave to work.");const r=Array.from(this.interactionsByType.get(t.type)).reverse(),o=!!i;i=i||this.queryTargets(t.point,r);let s=!1;const a=new Set;for(const l of i){for(const[i,c]of r){if(!c.target)continue;const r=l.variants?l.variants[i]:null;if(r){for(const u of r){if(_t(u,l,a,i))continue;const r=new e.dx(l,u),h=mt(u,l,i);o&&void 0!==r.id&&(r.state=this.map.getFeatureState(r));const d=n?this.prevHoveredFeatures.get(h):null,f=new ql(t,i,c,r),p=d?d.stop:c.handler(f);if(n&&this.hoveredFeatures.set(h,{feature:l,stop:p}),!1!==p){s=!0;break}}if(s)break}}if(s)break}if(!s)for(const[e,i]of r){const{handler:n,target:r}=i;if(!r&&!1!==n(new ql(t,e,i,null)))break}}}function $l(t,i){if(Array.isArray(t)&&Array.isArray(i)){const e=new Set(t),n=new Set(i);return e.size===n.size&&t.every(e=>n.has(e))}return e.by(t,i)}const Wl={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,antialias:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0,collectResourceTiming:!1,testMode:!1,precompilePrograms:!0,scaleFactor:1,spriteFormat:"auto"},Zl={showCompass:!0,showZoom:!0,visualizePitch:!1};class Xl{constructor(t,i,n=!1){this._clickTolerance=10,this.element=i,this.mouseRotate=new ll({clickTolerance:t.dragRotate._mouseRotate._clickTolerance}),this.map=t,n&&(this.mousePitch=new cl({clickTolerance:t.dragRotate._mousePitch._clickTolerance})),e.aY(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),i.addEventListener("mousedown",this.mousedown),i.addEventListener("touchstart",this.touchstart,{passive:!1}),i.addEventListener("touchmove",this.touchmove),i.addEventListener("touchend",this.touchend),i.addEventListener("touchcancel",this.reset)}down(e,t){this.mouseRotate.mousedown(e,t),this.mousePitch&&this.mousePitch.mousedown(e,t),f()}move(e,t){const i=this.map,n=this.mouseRotate.mousemoveWindow(e,t),r=n&&n.bearingDelta;if(r&&i.setBearing(i.getBearing()+r),this.mousePitch){const n=this.mousePitch.mousemoveWindow(e,t),r=n&&n.pitchDelta;r&&i.setPitch(i.getPitch()+r)}}off(){const e=this.element;e.removeEventListener("mousedown",this.mousedown),e.removeEventListener("touchstart",this.touchstart),e.removeEventListener("touchmove",this.touchmove),e.removeEventListener("touchend",this.touchend),e.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){p(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup)}mousedown(e){this.down(Object.assign({},e,{ctrlKey:!0,preventDefault:()=>e.preventDefault()}),g(this.element,e)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)}mousemove(e){this.move(e,g(this.element,e))}mouseup(e){this.mouseRotate.mouseupWindow(e),this.mousePitch&&this.mousePitch.mouseupWindow(e),this.offTemp()}touchstart(e){1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=y(this.element,e.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>e.preventDefault()},this._startPos))}touchmove(e){1!==e.targetTouches.length?this.reset():(this._lastPos=y(this.element,e.targetTouches)[0],this.move({preventDefault:()=>e.preventDefault()},this._lastPos))}touchend(e){0===e.targetTouches.length&&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 Yl(t,i,n){if(t=new e.aT(t.lng,t.lat),i){const r=new e.aT(t.lng-360,t.lat),o=new e.aT(t.lng+360,t.lat),s=360*Math.ceil(Math.abs(t.lng-n.center.lng)/360),a=n.locationPoint3D(t).distSqr(i),l=i.x<0||i.y<0||i.x>n.width||i.y>n.height;n.locationPoint3D(r).distSqr(i)<a&&(l||Math.abs(r.lng-n.center.lng)<s)?t=r:n.locationPoint3D(o).distSqr(i)<a&&(l||Math.abs(o.lng-n.center.lng)<s)&&(t=o)}for(;Math.abs(t.lng-n.center.lng)>180;){const e=n.locationPoint3D(t);
2if(e.x>=0&&e.y>=0&&e.x<=n.width&&e.y<=n.height)break;t.lng>n.center.lng?t.lng-=360:t.lng+=360}return t}const Kl={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%)"},Jl={rotation:0,rotationAlignment:"auto",pitchAlignment:"auto",occludedOpacity:.2,altitude:0};class Ql extends e.E{constructor(t,i){super(),(t instanceof HTMLElement||i)&&(t=Object.assign({element:t},i)),e.aY(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this);const{anchor:n="center",color:r="#3FB1CE",scale:o=1,draggable:s=!1,clickTolerance:a=0,rotation:l=Jl.rotation,rotationAlignment:c=Jl.rotationAlignment,pitchAlignment:u=Jl.pitchAlignment,occludedOpacity:h=Jl.occludedOpacity,altitude:d=Jl.altitude}=t||{};this._anchor=n,this._color=r,this._scale=o,this._draggable=s,this._clickTolerance=a,this._rotation=l,this._rotationAlignment=c,this._pitchAlignment=u,this._occludedOpacity=h,this._altitude=d,this._state="inactive",this._isDragging=!1,this._updateMoving=()=>this._update(!0),t&&t.element?(this._element=t.element,this._offset=e.P.convert(t&&t.offset||[0,0])):(this._defaultMarker=!0,this._element=this._createDefaultMarker(),this._offset=e.P.convert(t&&t.offset||[0,-14])),this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.hasAttribute("role")||this._element.setAttribute("role","img"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",e=>{e.preventDefault()}),this._element.addEventListener("mousedown",e=>{e.preventDefault()});const f=this._element.classList;for(const e in Kl)f.remove(`mapboxgl-marker-anchor-${e}`);f.add(`mapboxgl-marker-anchor-${this._anchor}`);const p=t&&t.className?t.className.trim().split(/\s+/):[];f.add(...p),this._popup=null}_createDefaultMarker(){const e=l("div"),t=c("svg",{display:"block",height:41*this._scale+"px",width:27*this._scale+"px",viewBox:"0 0 27 41"},e);if(0===this._altitude){const e=c("radialGradient",{id:"shadowGradient"},c("defs",{},t));c("stop",{offset:"10%","stop-opacity":.4},e),c("stop",{offset:"100%","stop-opacity":.05},e),c("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},t)}return c("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},t),c("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},t),c("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},t),e}addTo(e){return e===this._map||(this.remove(),this._map=e,e.getCanvasContainer().appendChild(this._element),e.on("move",this._updateMoving),e.on("moveend",this._update),e.on("remove",this._clearFadeTimer),e._addMarker(this),this.setDraggable(this._draggable),this._update(),e.on("click",this._onMapClick)),this}remove(){const e=this._map;return e&&(e.off("click",this._onMapClick),e.off("move",this._updateMoving),e.off("moveend",this._update),e.off("mousedown",this._addDragHandler),e.off("touchstart",this._addDragHandler),e.off("mouseup",this._onUp),e.off("touchend",this._onUp),e.off("mousemove",this._onMove),e.off("touchmove",this._onMove),e.off("remove",this._clearFadeTimer),e._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.aT.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}setAltitude(e){return e===this._altitude||(this._defaultMarker&&(0===this._altitude&&0!==e||0!==this._altitude&&0===e)&&(this._element=this._createDefaultMarker()),this._altitude=e||Jl.altitude,this._update()),this}getAltitude(){return this._altitude}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){const t=38.1,i=13.5,n=Math.sqrt(Math.pow(i,2)/2);e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[
vendor: 3,227 bytes, line 2
20,-t],"bottom-left":[n,-1*(t-i+n)],"bottom-right":[-n,-1*(t-i+n)],left:[i,-1*(t-i)],right:[-i,-1*(t-i)]}:this._offset}this._popup=e,e._marker=this,e._altitude=this._altitude,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(e){const t=e.code,i=e.charCode||e.keyCode;"Space"!==t&&"Enter"!==t&&32!==i&&13!==i||this.togglePopup()}_onMapClick(e){const t=e.originalEvent.target,i=this._element;this._popup&&(t===i||i.contains(t))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const e=this._popup;return e?(e.isOpen()?(e.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(e.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const e=this._map,t=this._pos;if(!e||!t)return!1;const i=e.unproject(t,this._altitude),n=e.getFreeCameraOptions();if(!n.position)return!1;const r=n.position.toLngLat();return r.distanceTo(i)<.9*r.distanceTo(this._lngLat)}_evaluateOpacity(){const t=this._map;if(!t)return;const i=this._pos;if(!i||i.x<0||i.x>t.transform.width||i.y<0||i.y>t.transform.height)return void this._clearFadeTimer();const n=t.unproject(i,this._altitude);let r;t._showingGlobe()&&e.f5(t.transform,this._lngLat)?r=0:(r=1-t._queryFogOpacity(n),t.transform._terrainEnabled()&&t.getTerrain()&&this._behindTerrain()&&(r*=this._occludedOpacity)),this._element.style.opacity=`${r}`,this._element.style.pointerEvents=r>0?"auto":"none",this._popup&&this._popup._setOpacity(r),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const e=this._pos;if(!e||!this._map)return;const t=this._offset.mult(this._scale);this._element.style.transform=`\n            translate(${e.x}px,${e.y}px)\n            ${Kl[this._anchor]}\n            ${this._calculateXYTransform()} ${this._calculateZTransform()}\n            translate(${t.x}px,${t.y}px)\n        `}_calculateXYTransform(){const t=this._pos,i=this._map,n=this.getPitchAlignment();if(!i||!t||"map"!==n)return"";if(!i._showingGlobe()){const e=i.getPitch();return e?`rotateX(${e}deg)`:""}const r=e.cX(e.f6(i.transform,this._lngLat)),o=t.sub(e.f7(i.transform)),s=Math.abs(o.x)+Math.abs(o.y);if(0===s)return"";const a=r/s;return`rotateX(${-o.y*a}deg) rotateY(${o.x*a}deg)`}_calculateZTransform(){const t=this._pos,i=this._map;if(!i||!t)return"";let n=0;const r=this.getRotationAlignment();if("map"===r)if(i._showingGlobe()){const t=i.project(new e.aT(this._lngLat.lng,this._lngLat.lat+.001),this._altitude),r=i.project(new e.aT(this._lngLat.lng,this._lngLat.lat-.001),this._altitude).sub(t);n=e.cX(Math.atan2(r.y,r.x))-90}else n=-i.getBearing();else if("horizon"===r){const r=e.ah(4,6,i.getZoom()),o=e.f7(i.transform);o.y+=r*i.transform.height;const s=t.sub(o),a=e.cX(Math.atan2(s.y,s.x));n=(a>90?a-270:a+90)*(1-r)}return n+=this._rotation,n?`rotateZ(${n}deg)`:""}_update(e){cancelAnimationFrame(this._updateFrameId);const t=this._map;
2t&&(t.transform.renderWorldCopies&&(this._lngLat=Yl(this._lngLat,this._pos,t.transform)),this._pos=t.project(this._lngLat,this._altitude),!0===e?this._updateFrameId=requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),t._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(t._showingGlobe()||t.getTerrain()||t.getFog())&&!this._fadeTimer&&(this._fadeTimer=window.setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(t){return this._offset=e.P.convert(t),this._update(),this}addClassName(e){return this._element.classList.add(e),this}removeClassName(e){return this._element.classList.remove(e),this}toggleClassName(e){return this._element.classList.toggle(e)}_onMove(t){const i=this._map;if(!i)return;const n=this._pointerdownPos,r=this._positionDelta;if(n&&r){if(!this._isDragging){const e=this._clickTolerance||i._clickTolerance;if(t.point.dist(n)<e)return;this._isDragging=!0}this._pos=t.point.sub(r),this._lngLat=i.unproject(this._pos,this._altitude),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new e.z("dragstart"))),this.fire(new e.z("drag"))}}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1;const t=this._map;t&&(t.off("mousemove",this._onMove),t.off("touchmove",this._onMove)),"active"===this._state&&this.fire(new e.z("dragend")),this._state="inactive"}_addDragHandler(e){const t=this._map,i=this._pos;t&&i&&this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(i),this._pointerdownPos=e.point,this._state="pending",t.on("mousemove",this._onMove),t.on("touchmove",this._onMove),t.once("mouseup",this._onUp),t.once("touchend",this._onUp))}setDraggable(e){this._draggable=!!e;const t=this._map;return t&&(e?(t.on("mousedown",this._addDragHandler),t.on("touchstart",this._addDragHandler)):(t.off("mousedown",this._addDragHandler),t.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||Jl.rotation,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||Jl.rotationAlignment,this._update(),this}getRotationAlignment(){return"auto"===this._rotationAlignment||"horizon"===this._rotationAlignment&&this._map&&!this._map._showingGlobe()?"viewport":this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e||Jl.pitchAlignment,this._update(),this}getPitchAlignment(){return"auto"===this._pitchAlignment?this.getRotationAlignment():this._pitchAlignment}setOccludedOpacity(e){return this._occludedOpacity=e||Jl.occludedOpacity,this._update(),this}getOccludedOpacity(){return this._occludedOpacity}}const ec={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0,showUserHeading:!1},tc={maxWidth:100,unit:"metric"},ic={kilometer:"km",meter:"m",mile:"mi",foot:"ft","nautical-mile":"nm"},nc={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",altitude:0},rc=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function oc(t=new e.P(0,0),i="bottom"){if("number"==typeof t){const n=Math.round(Math.sqrt(.5*Math.pow(t,2)));switch(i){case"top":return new e.P(0,t);case"top-left":return new e.P(n,n);case"top-right":return new e.P(-n,n);case"bottom":return new e.P(0,-t);case"bottom-left":return new e.P(n,-n);case"bottom-right":return new e.P(-n,-n);case"left":return new e.P(t,0);case"right":return new e.P(-t,0)}return new e.P(0,0)}return t instanceof e.P||Array.isArray(t)?e.P.convert(t):e.P.convert(t[i]||[0,0])}const sc={version:t,supported:a.supported,setRTLTextPlugin:e.fb,getRTLTextPluginStatus:e.fa,Map:class extends kl{constructor(t){n.mark(i.create);const r=t;if(null!=(t=Object.assign({},Wl,t)).minZoom&&null!=t.maxZoom&&t.minZoom>t.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=t.minPitch&&null!=t.maxPitch&&t.minPitch>t.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=t.minPitch&&t.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=t.maxPitch&&t.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(t.antialias&&e.f3(window)&&(t.antialias=!1,e.w("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new _n(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies,null,null),t),this._repaint=!!t.repaint,this._interactive=t.interactive,this._minTileCacheSize=t.minTileCacheSize,this._maxTileC
2acheSize=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._isInitialLoad=!0,this._crossSourceCollisions=t.crossSourceCollisions,this._collectResourceTiming=t.collectResourceTiming,this._language=this._parseLanguage(t.language),this._worldview=t.worldview,this._renderTaskQueue=new Ul,this._domRenderTaskQueue=new Ul,this._controls=[],this._markers=[],this._popups=[],this._mapId=e.b2(),this._locale=Object.assign({},Gl,t.locale),this._clickTolerance=t.clickTolerance,this._cooperativeGestures=t.cooperativeGestures,this._performanceMetricsCollection=t.performanceMetricsCollection,this._tessellationStep=t.tessellationStep,this._containerWidth=0,this._containerHeight=0,this._showParseStatus=!0,this._precompilePrograms=t.precompilePrograms,this._scaleFactorChanged=!1,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new jl(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._frameId=0,this._scaleFactor=t.scaleFactor,this._requestManager=new T(t.transformRequest,t.accessToken,t.testMode),this._silenceAuthErrors=!!t.testMode,this._contextCreateOptions=t.contextCreateOptions?Object.assign({},t.contextCreateOptions):{},"string"==typeof t.container){const e=document.getElementById(t.container);if(!e)throw new Error(`Container '${t.container.toString()}' not found.`);this._container=e}else{if(!(t.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container}if(this._container.childNodes.length>0&&e.w("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),t.maxBounds&&this.setMaxBounds(t.maxBounds),this._spriteFormat=t.spriteFormat,e.aY(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");if(this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this._fullscreenchangeEvent="onfullscreenchange"in document?"fullscreenchange":"webkitfullscreenchange",window.addEventListener("online",this._onWindowOnline,!1),window.addEventListener("resize",this._onWindowResize,!1),window.addEventListener("orientationchange",this._onWindowResize,!1),window.addEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),window.addEventListener("visibilitychange",this._onVisibilityChange,!1),this.handlers=new Ol(this,t),this._localFontFamily=t.localFontFamily,this._localIdeographFontFamily=t.localIdeographFontFamily,(t.style||!t.testMode)&&this.setStyle(t.style||e.e.DEFAULT_STYLE,{config:t.config,localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),t.projection&&this.setProjection(t.projection),t.hash&&(this._hash=new Ba("string"==typeof t.hash&&t.hash||void 0).addTo(this)),!this._hash||!this._hash._onHashChange()){null==r.center&&null==r.zoom||(this.transform._unmodified=!1),this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch});const e=t.bounds;e&&(this.resize(),this.fitBounds(e,Object.assign({},t.fitBoundsOptions,{duration:0})))}this.resize(),t.attributionControl&&this.addControl(new Bl({customAttribution:t.customAttribution})),this._logoControl=new Nl,this.addControl(this._logoControl,t.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this._postStyleLoadEvent(),this._postStyleWithAppearanceEvent(),this._setupIndoor()}),this.on("data",t=>{this._update("style"===t.dataType),this.fire(new e.z(`${t.dataType}data`,t))}),this.on("dataloading",t=>{this.fire(new e.z(`${t.dataType}dataloading`,t))}),this._interactions=new Hl(this)}_getMapId(){return this._mapId}addControl(t,i){if(void 0===i&&(i=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.y(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=t.onAdd(this);this._controls.push(t);const r=this._controlPositions[i];return-1!==i.indexOf("bottom")?r.insertBefore(n,r.firstChild):r.appendChild(n),this}
vendor: 4,352 bytes, line 2
2removeControl(t){if(!t||!t.onRemove)return this.fire(new e.y(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const i=this._controls.indexOf(t);return i>-1&&this._controls.splice(i,1),t.onRemove(this),this}hasControl(e){return this._controls.indexOf(e)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(t){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const i=!this._moving;return i&&this.fire(new e.z("movestart",t)).fire(new e.z("move",t)),this.fire(new e.z("resize",t)),i&&this.fire(new e.z("moveend",t)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(t){return this.transform.setMaxBounds(e.aI.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.fire(new e.z("zoomstart")).fire(new e.z("zoom")).fire(new e.z("zoomend")),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.fire(new e.z("zoomstart")).fire(new e.z("zoom")).fire(new e.z("zoomend")),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.fire(new e.z("pitchstart")).fire(new e.z("pitch")).fire(new e.z("pitchend")),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(t){if((t=t??85)>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.fire(new e.z("pitchstart")).fire(new e.z("pitch")).fire(new e.z("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getScaleFactor(){return this._scaleFactor}setScaleFactor(e){return this._scaleFactor=e,this.painter.scaleFactor=e,this._scaleFactorChanged=!0,this.style._updateFilteredLayers(e=>"symbol"===e.type),this._update(!0),this}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(e){return this.transform.renderWorldCopies=e,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(e){return"auto"===e?navigator.language:Array.isArray(e)?0===e.length?void 0:e.map(e=>"auto"===e?navigator.language:e):e}setLanguage(e){const t=this._parseLanguage(e);if(!this.style||t===this._language)return this;this._language=t,this.style.reloadSources();for(const e of this._controls)e._setLanguage&&e._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(e){return this.style&&e!==this._worldview?(this._worldview=e,this._styleDirty=!0,this.style.reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return"globe"===this.transform.projection.name}setProjection(e){return this._lazyInitEmptyStyle(),e?"string"==typeof e&&(e={name:e}):e=null,this._useExplicitProjection=!!e,this._prioritizeAndUpdateProjection(e,this.style.projection)}_updateProjectionTransition(){if("globe"!==this.getProjection().name)return;const t=this.transform,i=t.projection.name;let n;"globe"===i&&t.zoom>=e.cL?(t.setMercatorFromTransition(),n=!0):"mercator"===i&&t.zoom<e.cL&&(t.setProjection({name:"globe"}),n=!0),n&&(this.style.applyProjectionUpdate(),this.style._forceSymbolLayer
vendor: 4,132 bytes, line 2
2Update(),this._update(!0))}_prioritizeAndUpdateProjection(e,t){return this._updateProjection(e||t||{name:"mercator"})}_updateProjection(t){let i;const n=this.transform.mercatorFromTransition;i="globe"===t.name&&this.transform.zoom>=e.cL?this.transform.setMercatorFromTransition():this.transform.setProjection(t),this.style.applyProjectionUpdate();const r="mercator"===this.transform.getProjection().name&&n!==this.transform.mercatorFromTransition;return(i||r)&&(this.painter.clearBackgroundTiles(),this.style.clearSources(),this._update(!0),this._forceMarkerAndPopupUpdate(!0)),this}project(t,i){return this.transform.locationPoint3D(e.aT.convert(t),i)}unproject(t,i){return this.transform.pointLocation3D(e.P.convert(t),i)}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(e,t,i){const n=e=>{let i=[];if(Array.isArray(t)){const n=t.filter(e=>this.getLayer(e));i=n.length?this.queryRenderedFeatures(e,{layers:n}):[]}else i=this.queryRenderedFeatures(e,{target:t});return i};if("mouseenter"===e||"mouseover"===e){let r=!1;const o=t=>{const o=n(t.point);o.length?r||(r=!0,i.call(this,new Za(e,this,t.originalEvent,{features:o}))):r=!1};return{listener:i,targets:t,delegates:{mousemove:o,mouseout:()=>{r=!1}}}}if("mouseleave"===e||"mouseout"===e){let r=!1;const o=t=>{n(t.point).length?r=!0:r&&(r=!1,i.call(this,new Za(e,this,t.originalEvent)))},s=t=>{r&&(r=!1,i.call(this,new Za(e,this,t.originalEvent)))};return{listener:i,targets:t,delegates:{mousemove:o,mouseout:s}}}{const r=e=>{const t=n(e.point);t.length&&(e.features=t,i.call(this,e),delete e.features)};return{listener:i,targets:t,delegates:{[e]:r}}}}on(e,t,i){if("function"==typeof t||void 0===i)return super.on(e,t);if("string"==typeof t&&(t=[t]),!this._areTargetsValid(t))return this;const n=this._createDelegatedListener(e,t,i);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(n);for(const e in n.delegates)this.on(e,n.delegates[e]);return this}once(e,t,i){if("function"==typeof t||void 0===i)return super.once(e,t);if("string"==typeof t&&(t=[t]),!this._areTargetsValid(t))return this;const n=this._createDelegatedListener(e,t,i);for(const e in n.delegates)this.once(e,n.delegates[e]);return this}off(e,t,i){if("function"==typeof t||void 0===i)return super.off(e,t);if("string"==typeof t&&(t=[t]),!this._areTargetsValid(t))return this;const n=this._delegatedListeners?this._delegatedListeners[e]:void 0;return n&&(e=>{for(let n=0;n<e.length;n++){const r=e[n];if(r.listener===i&&$l(r.targets,t)){for(const e in r.delegates)this.off(e,r.delegates[e]);return e.splice(n,1),this}}})(n),this}queryRenderedFeatures(t,i){if(!this.style)return[];if(void 0===t||t instanceof e.P||Array.isArray(t)||void 0!==i||(i=t,t=void 0),t=t||[[0,0],[this.transform.width,this.transform.height]],!i){const e=this.style.queryRenderedFeatures(t,void 0,this.transform),i=this.style.queryRenderedFeatureset(t,void 0,this.transform);return e.concat(i)}let n=!0;if(i.target&&(n=this._isTargetValid(i.target),n&&!i.layers))return this.style.queryRenderedFeatureset(t,i,this.transform);let r=!0;if(i.layers&&Array.isArray(i.layers)){for(const e of i.layers)if(!this._isValidId(e)){r=!1;break}if(r&&!i.target)return this.style.queryRenderedFeatures(t,i,this.transform)}let o=[];return r&&(o=o.concat(this.style.queryRenderedFeatures(t,i,this.transform))),n&&(o=o.concat(this.style.queryRenderedFeatureset(t,i,this.transform))),o}querySourceFeatures(e,t){return!e||"string"==typeof e&&!this._isValidId(e)?[]:this.style.querySourceFeatures(e,t)}queryRasterValue(e,t,i){return this._isValidId(e)?this.style.queryRasterValue(e,t,i):Promise.resolve(null)}isPointOnSurface(t){const{name:i}=this.transform.projection;return"globe"!==i&&"mercator"!==i&&e.w(`${i} projection does not support isPointOnSurface, this API may behave unex
2pectedly.`),this.transform.isPointOnSurface(e.P.convert(t))}addInteraction(e,t){return this._interactions.add(e,t),this}removeInteraction(e){return this._interactions.remove(e),this}getCooperativeGestures(){return this._cooperativeGestures}setCooperativeGestures(e){return this._cooperativeGestures=e,this}setStyle(t,i){return i=Object.assign({},{localIdeographFontFamily:this._localIdeographFontFamily,localFontFamily:this._localFontFamily},i),this.style&&t&&!1!==i.diff&&i.localFontFamily===this._localFontFamily&&i.localIdeographFontFamily===this._localIdeographFontFamily&&!i.config?(this.style._diffStyle(t,(n,r)=>{if(n){const r="string"==typeof n?n:n instanceof Error?n.message:n.error;e.w(`Unable to perform style diff: ${r}. Rebuilding the style from scratch.`),this._updateStyle(t,i)}else r&&this._update(!0)},()=>this._postStyleLoadEvent()),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._localFontFamily=i.localFontFamily,this._updateStyle(t,i))}_getUIString(e){const t=this._locale[e];if(null==t)throw new Error(`Missing UI string '${e}'`);return t}_updateStyle(e,t){if(this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),e){const i=Object.assign({},t);t&&t.config&&(i.initialConfig=t.config,delete i.config),this.style=new Bn(this,i).load(e),this.style.setEventedParent(this,{style:this.style})}return this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new Bn(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(e.w("There is no style added to the map."),!1)}_isValidId(t){return null==t?(this.fire(new e.y(new Error("IDs can't be empty."))),!1):!e.dr(t)||(this.fire(new e.y(new Error(`IDs can't contain special symbols: "${t}".`))),!1)}_isTargetValid(e){return"featuresetId"in e?this._isValidId("importId"in e?e.importId:e.featuresetId):"layerId"in e&&this._isValidId(e.layerId)}_areTargetsValid(e){if(Array.isArray(e)){for(const t of e)if(!this._isValidId(t))return!1;return!0}return this._isTargetValid(e)}addSource(e,t){return this._isValidId(e)?(this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)):this}isSourceLoaded(e){return!!this._isValidId(e)&&!!this.style&&this.style._isSourceCacheLoaded(e)}areTilesLoaded(){return this.style.areTilesLoaded()}addSourceType(e,t,i){this._lazyInitEmptyStyle(),this.style.addSourceType(e,t,i)}removeSource(e){return this._isValidId(e)?(this.style.removeSource(e),this._updateTerrain(),this._update(!0)):this}getSource(e){return this._isValidId(e)?this.style.getOwnSource(e):null}addImage(t,i,{pixelRatio:n=1,sdf:r=!1,stretchX:o,stretchY:s,content:a}={}){this._lazyInitEmptyStyle();const l=e.I.from(t);if(i instanceof HTMLImageElement||ImageBitmap&&i instanceof ImageBitmap){const{width:t,height:c,data:u}=e.o.getImageData(i);this.style.addImage(l,{data:new e.q({width:t,height:c},u),pixelRatio:n,stretchX:o,stretchY:s,content:a,sdf:r,version:0,usvg:!1})}else if(void 0===i.width||void 0===i.height)this.fire(new e.y(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));else{const{width:c,height:u}=i,h=i;this.style.addImage(l,{data:new e.q({width:c,height:u},new Uint8Array(h.data)),pixelRatio:n,stretchX:o,stretchY:s,content:a,sdf:r,usvg:!1,version:0,userImage:h}),h.onAdd&&h.onAdd(this,t)}}updateImage(t,i){this._lazyInitEmptyStyle();const n=e.I.from(t),r=this.style.getImage(n);if(!r)return void this.fire(new e.y(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const o=i instanceof HTMLImageElement||ImageBitmap&&i instanceof ImageBitmap?e.o.getImageData(i):i,{width:s,height:a,data:l}=o;if(void 0===s||void 0===a)return void this.fire(new e.y(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!==(r.usvg?r.icon.usvg_tree.width:r.data.width)||a!==(r.usvg?r.icon.usvg_tree.height:r.data.height))return void this.fire(new e.y(new Error(`The width and height of the updated image (${s}, ${a})\n                must be that same as the previous version of the image\n                (${r.data.width}, ${r.data.height})`)));const c=!(i instanceof HTMLImageElement||ImageBitmap&&i instanceof ImageBitmap);let u=!1;r.usvg?(r.data=new e.q({width:s,height:a},new Uint8Array(l)),r.usvg=!1,r.icon=void 0,u=!0):r.data.replace(l,c),this.style.updateImage(n,r,u)}hasImage(t){return t?!!this.style&&!!this.style.getImage(e.I.from(t)):(this.fire(new e.y(new Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(e.I.from(t))}loadImage(t,i){e.n(this._requestManager.transformRequest(t,e.R.Image),(t,n)=>{i(t,n instanceof HTMLImageElement?e.o.getImageData(n):n)})}listImages(){return this.style.listImages().map(e=>e.name)}
vendor: 4,524 bytes, line 2
2addModel(e,t){this._lazyInitEmptyStyle(),this.style.addModel(e,t)}hasModel(t){return t?this.style.hasModel(t):(this.fire(new e.y(new Error("Missing required model id"))),!1)}removeModel(e){this.style.removeModel(e)}listModels(){return this.style.listModels()}addLayer(e,t){return this._isValidId(e.id)?(this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)):this}getSlot(e){const t=this.getLayer(e);return t&&t.slot||null}setSlot(e,t){return this.style.setSlot(e,t),this.style.mergeLayers(),this._update(!0)}addImport(t,i){return this.style.addImport(t,i).catch(t=>this.fire(new e.y(new Error("Failed to add import",t)))),this}updateImport(e,t){return"string"!=typeof t&&t.id!==e?(this.removeImport(e),this.addImport(t)):(this.style.updateImport(e,t),this._update(!0))}removeImport(e){return this.style.removeImport(e),this}moveImport(e,t){return this.style.moveImport(e,t),this._update(!0)}moveLayer(e,t){return this._isValidId(e)?(this.style.moveLayer(e,t),this._update(!0)):this}removeLayer(e){return this._isValidId(e)?(this.style.removeLayer(e),this._update(!0)):this}getLayer(e){if(!this._isValidId(e))return null;const t=this.style.getOwnLayer(e);return t?"custom"===t.type?t.implementation:t.serialize():void 0}getSlots(){return this.style.getSlots()}setLayerZoomRange(e,t,i){return this._isValidId(e)?(this.style.setLayerZoomRange(e,t,i),this._update(!0)):this}setFilter(e,t,i={}){return this._isValidId(e)?(this.style.setFilter(e,t,i),this._update(!0)):this}getFilter(e){return this._isValidId(e)?this.style.getFilter(e):null}setPaintProperty(e,t,i,n={}){return this._isValidId(e)?(this.style.setPaintProperty(e,t,i,n),this._update(!0)):this}getPaintProperty(e,t){return this._isValidId(e)?this.style.getPaintProperty(e,t):null}setLayoutProperty(e,t,i,n={}){return this._isValidId(e)?(this.style.setLayoutProperty(e,t,i,n),this._update(!0)):this}getLayoutProperty(e,t){return this._isValidId(e)?this.style.getLayoutProperty(e,t):null}setLayerProperty(e,t,i,n={}){return this._isValidId(e)?("appearances"===t&&this._postAddingAppearancesToStyleEvent(),this.style.setLayerProperty(e,t,i,n),this._update(!0)):this}getGlyphsUrl(){return this.style.getGlyphsUrl()}setGlyphsUrl(e){return this.style.setGlyphsUrl(e),this._update(!0)}getSchema(e){return this.style.getSchema(e)}setSchema(e,t){return this.style.setSchema(e,t),this._update(!0)}getConfig(e){return this.style.getConfig(e)}setConfig(e,t){return this.style.setConfig(e,t),this._update(!0)}getConfigProperty(e,t){return this.style.getConfigProperty(e,t)}setConfigProperty(e,t,i){return this.style.setConfigProperty(e,t,i),this._update(!0)}getFeaturesetDescriptors(e){return this.style.getFeaturesetDescriptors(e)}setLights(e){if(this._lazyInitEmptyStyle(),e&&1===e.length&&"flat"===e[0].type){const t=e[0];t.properties?this.style.setFlatLight(t.properties,t.id,{}):this.style.setFlatLight({},"flat")}else this.style.setLights(e),this.painter.terrain&&(this.painter.terrain.invalidateRenderCache=!0);return this._update(!0)}getLights(){const e=this.style.getLights()||[];return 0===e.length&&e.push({id:this.style.light.id,type:"flat",properties:this.style.getFlatLight()}),e}setLight(e,t={}){return console.log("The `map.setLight` function is deprecated, prefer using `map.setLights` with `flat` light type instead."),this.setLights([{id:"flat",type:"flat",properties:e}])}getLight(){return console.log("The `map.getLight` function is deprecated, prefer using `map.getLights` instead."),this.style.getFlatLight()}setTerrain(e){return this._lazyInitEmptyStyle(),!e&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(e),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(e){return this._lazyInitEmptyStyle(),this.style.setFog(e),this._update(!0)}getFog(){return this.style?this.style.getFog():null}setSnow(e){return this._lazyInitEmptyStyle(),this.style.setSnow(e),this._update(!0)}getSnow(){return this.style?this.style.getSnow():null}setRain(e){return this._lazyInitEmptyStyle(),this.style.setRain(e),this._update(!0)}getRain(){return this.style?this.style.getRain():null}setColorTheme(e){return this._lazyInitEmptyStyle(),this.style.setColorTheme(e),this._update(!0)}setImportColorTheme(e,t){return this._lazyInitEmptyStyle(),this.style.setImportColorTheme(e,t),this._update(!0)}setCamera(e){return this.style.setCamera(e),this._triggerCameraUpdate(e)}_triggerCameraUpdate(e){return this._update(this.transform.setOrthogra
2phicProjectionAtLowPitch("orthographic"===e["camera-projection"]))}getCamera(){return this.style.camera}_queryFogOpacity(t){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(e.aT.convert(t),this.transform):0}setFeatureState(e,t){return e.source&&!this._isValidId(e.source)?this:(this.style.setFeatureState(e,t),this._update())}removeFeatureState(e,t){return e.source&&!this._isValidId(e.source)?this:(this.style.removeFeatureState(e,t),this._update())}getFeatureState(e){return e.source&&!this._isValidId(e.source)?null:this.style.getFeatureState(e)}_selectIndoorFloor(e){this.indoor.selectFloor(e)}_setIndoorActiveFloorsVisibility(e){this.indoor.setActiveFloorsVisibility(e)}_addIndoorControl(){this._indoorControl||(this._indoorControl=new Vl),this.addControl(this._indoorControl,"right")}_removeIndoorControl(){this._indoorControl&&this.removeControl(this._indoorControl)}_updateContainerDimensions(){if(!this._container)return;const e=this._container.getBoundingClientRect().width||400,t=this._container.getBoundingClientRect().height||300;let i,n,r,o=this._container;for(;o&&(!n||!r);){const e=window.getComputedStyle(o).transform;e&&"none"!==e&&(i=e.match(/matrix.*\((.+)\)/)[1].split(", "),i[0]&&"0"!==i[0]&&"1"!==i[0]&&(n=i[0]),i[3]&&"0"!==i[3]&&"1"!==i[3]&&(r=i[3])),o=o.parentElement}this._containerWidth=n?Math.abs(e/n):e,this._containerHeight=r?Math.abs(t/r):t}_detectMissingCSS(){"rgb(250, 128, 114)"!==window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&e.w("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupIndoor(){this.style.isIndoorEnabled()&&(this.indoor=new Nn(this.style),this.on("load",()=>{this._addIndoorControl(),this.indoor._updateUI(this.transform.zoom,this.transform.center,this.transform.getBounds()),this.on("move",()=>{this.indoor._updateUI(this.transform.zoom,this.transform.center,this.transform.getBounds())}),this.on("idle",()=>{this.indoor._updateUI(this.transform.zoom,this.transform.center,this.transform.getBounds())})}))}_setupContainer(){const e=this._container;e.classList.add("mapboxgl-map"),(this._missingCSSCanary=l("div","mapboxgl-canary",e)).style.visibility="hidden",this._detectMissingCSS();const t=this._canvasContainer=l("div","mapboxgl-canvas-container",e);this._canvas=l("canvas","mapboxgl-canvas",t),this._interactive&&(t.classList.add("mapboxgl-interactive"),this._canvas.setAttribute("tabindex","0")),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const i=this._controlContainer=l("div","mapboxgl-control-container",e),n=this._controlPositions={};["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"].forEach(e=>{n[e]=l("div",`mapboxgl-ctrl-${e}`,i)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(t,i){const n=e.o.devicePixelRatio||1;this._canvas.width=n*Math.ceil(t),this._canvas.height=n*Math.ceil(i),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${i}px`}_addMarker(e){this._markers.push(e)}_removeMarker(e){const t=this._markers.indexOf(e);-1!==t&&this._markers.splice(t,1)}_addPopup(e){this._popups.push(e)}_removePopup(e){const t=this._popups.indexOf(e);-1!==t&&this._popups.splice(t,1)}_setupPainter(){const t=Object.assign({},a.supported.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),i=this._canvas.getContext("webgl2",t);i?($(i,!0),this.painter=new Fa(i,this._contextCreateOptions,this.transform,this._scaleFactor,this._worldview),this.on("data",e=>{"source"===e.dataType&&this.painter.setTileLoadedFlag(!0)}),e.k.testSupport(i)):this.fire(new e.y(new Error("Failed to initialize WebGL")))}_contextLost(t){t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new e.z("webglcontextlost",{originalEvent:t}))}_contextRestored(t){this._setupPainter(),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight)),this._updateTerrain(),this.style&&(this.style.clearLayers(),this.style.imageManager.destroyAtlasTextures(),this.style.reloadModels(),this.style.clearSources()),this._update(),this.fire(new e.z("webglcontextrestored",{originalEvent:t}))}_onMapScroll(e){if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}idle(){return!this.isMoving()&&this.loaded()}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}frameReady(){return this.loaded()&&!this._placementDirty}_update(e){return this.style?(this._styleDirty=this._styleDirty||e,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_requestDomTask(e){!this.loaded()||this.loaded()&&!this.isMoving()?e():this._domRenderTaskQueue.add(e)}_render(t){let r;this.fire(new e.z("renderstart")),++this._frameId;const o=this.painter.context.extTimerQuery,s=e.o.now(),a=this.painter.context.gl;if(this.listens("gpu-timing-frame")&&(r=a.createQuery(),a.beginQuery(o.TIME_ELAPSED_EXT,r)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&
vendor: 12,078 bytes, line 2
2(this._interactionRange[0]=Math.min(this._interactionRange[0],performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],performance.now())),this._renderTaskQueue.run(t),this._domRenderTaskQueue.run(t),this._removed)return;this._updateProjectionTransition();const l=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const t=this.transform.zoom,i=this.transform.pitch,n=e.o.now(),r=new e.ac(t,{now:n,fadeDuration:l,pitch:i,transition:this.style.transition,worldview:this._worldview});this.style.update(r)}this.style&&this.style.hasFogTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let c=!1;this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),c=this._updateAverageElevation(s),this.style.updateSources(this.transform),this.style.updateImageProviders(),this.isMoving()||this._forceMarkerAndPopupUpdate()):c=this._updateAverageElevation(s);const u=this.style&&this.style._updatePlacement(this.painter,this.painter.transform,this.showCollisionBoxes,l,this._crossSourceCollisions,this.painter.replacementSource,this._scaleFactorChanged);if(this._scaleFactorChanged&&(this._scaleFactorChanged=!1),u&&(this._placementDirty=u.needsRerender),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showParseStatus:this.showParseStatus,wireframe:{terrain:this.showTerrainWireframe,layers2D:this.showLayers2DWireframe,layers3D:this.showLayers3DWireframe},showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:l,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new e.z("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,n.mark(i.load),this.fire(new e.z("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&(this.style.snow||this.style.rain)&&(this._styleDirty=!0),this.style&&this.style.imageManager.hasPatternsInFlight()&&(this._styleDirty=!0),this.style&&!this.style.modelManager.isLoaded()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),r){const t=e.o.now()-s;a.endQuery(o.TIME_ELAPSED_EXT),setTimeout(()=>{const i=a.getQueryParameter(r,a.QUERY_RESULT)/1e6;a.deleteQuery(r),this.fire(new e.z("gpu-timing-frame",{cpuTime:t,gpuTime:i}))},50)}if(this.listens("gpu-timing-layer")){const t=this.painter.collectGpuTimers();setTimeout(()=>{const i=this.painter.queryGpuTimers(t);this.fire(new e.z("gpu-timing-layer",{layerTimes:i}))},50)}if(this.listens("gpu-timing-deferred-render")){const t=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const i=this.painter.queryGpuTimeDeferredRender(t);this.fire(new e.z("gpu-timing-deferred-render",{gpuTime:i}))},50)}const h=this._sourcesDirty||this._styleDirty||this._placementDirty||c;if(h||this._repaint)this.triggerRepaint();else{const t=this.idle();if(t&&(c=this._updateAverageElevation(s,!0)),c)this.triggerRepaint();else if(this._triggerFrame(!1),t&&(this.fire(new e.z("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const t=this._calculateSpeedIndex();this.fire(new e.z("speedindexcompleted",{speedIndex:t})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||h||(this._fullyLoaded=!0,n.mark(i.fullLoad),this._performanceMetricsCollection&&j(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(e){for(const t of this._markers)e&&!this.getRenderWorldCopies()&&(t._lngLat=t._lngLat.wrap()),t._update();for(const t of this._popups)!e||this.getRenderWorldCopies()||t._trackPointer||(t._lngLat=t._lngLat.wrap()),t._update()}_updateAverageElevation(e,t=!1){const i=e=>(this.transform.averageElevation=e,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return 0!==this.transform.averageElevation&&i(0);const n=this.transform.elevation&&this.transform.elevation.exaggeration()!==this._averageElevationExaggeration;if(n||(t||e-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(e)){const t=this.transform.averageElevation;let r=this.transform.sampleAverageElevation();null!=this.transform.elevation&&(this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(r)?r=0:this._averageElevationLastSampledAt=e;const o=Math.abs(t-r);if(o>1){if(this._isInitialLoad||n)return this._averageElevation.jumpTo(r),i(r);this._averageElevation.easeTo(r,e,300)}else if(o>1e-4)return this._averageElevation.jumpTo(r),i(r)}return!!this._averageElevation.isEasing(e)&&i(this._averageElevation.getValue(e))}_authenticate(){q(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,t=>{if(t&&(t.message===w||401===t.status)){const t=this.painter.context.gl;$(t,!1),this._logoControl instanceof Nl&&this._logoControl._updateLogo(),t&&t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT|t.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new e.y(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),z(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_postStyleLoadEvent(){this.style.globalId&&F(this._requestManager._customAccessToken,{map:this,style:this.style.globalId,importedStyles:this.style.getImportGlobalIds()})}_postStyleWithAppearanceEvent(){this.style.globalId&&this.style.hasAppearances()&&B(this._requestManager._customAccessToken)}_postAddingAppearancesToStyleEvent(){V(this._requestManager._customAccessToken)}_updateTerrain(){const e=this._isDragging();this.painter.updateTerrain(this.style,e)}_calculateSpeedIndex(){const e=this.painter.canvasCopy(),t=this.painter.getCanvasCopiesAndTimestamps();t.timeStamps.push(performance.now());const i=this.painter.context.gl,n=i.createFramebuffer();function r(e){i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,e,0);const t=new Uint8Array(i.drawingBufferWidth*i.drawingBufferHeight*4);return i.readPixels(0,0,i.drawingBufferWidth,i.drawingBufferHeight,i.RGBA,i.UNSIGNED_BYTE,t),t}return i.bindFramebuffer(i.FRAMEBUFFER,n),this._canvasPixelComparison(r(e),t.canvasCopies.map(r),t.timeStamps)}_canvasPixelComparison(e,t,i){let n=i[1]-i[0];const r=e.length/4;for(let o=0;o<t.length;o++){const s=t[o];let a=0;for(let t=0;t<s.length;t+=4)s[t]===e[t]&&s[t+1]===e[t+1]&&s[t+2]===e[t+2]&&s[t+3]===e[t+3]&&(a+=1);n+=(i[o+2]-i[o+1])*(1-a/r)}return n}remove(){this._hash&&this._hash.remove();for(const e of this._controls)e.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this._domRenderTaskQueue.clear(),this.style&&this.style.destroy(),this.indoor&&this.indoor.destroy(),this.painter.destroy(),this.handlers&&this.handlers.destroy(),this.handlers=void 0,this.setStyle(null),window.removeEventListener("resize",this._onWindowResize,!1),window.removeEventListener("orientationchange",this._onWindowResize,!1),window.removeEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),window.removeEventListener("online",this._onWindowOnline,!1),window.removeEventListener("visibilitychange",this._onVisibilityChange,!1);const t=this.painter.context.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._missingCSSCanary.remove(),this._canvas=void 0,this._canvasContainer=void 0,this._controlContainer=void 0,this._missingCSSCanary=void 0,this._container.classList.remove("mapboxgl-map"),this._container.removeEventListener("scroll",this._onMapScroll,!1),H.delete(this.painter.context.gl),G.remove(),L.remove(),this._removed=!0,this.fire(new e.z("remove"))}triggerRepaint(){this._triggerFrame(!0)}_triggerFrame(t){this._renderNextFrame=this._renderNextFrame||t,this.style&&!this._frame&&(this._frame=e.o.frame(e=>{const t=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,t&&this._render(e)}))}_preloadTiles(t){const i=this.style?this.style.getSourceCaches():[];return e.bw(i,(e,i)=>e._preloadTiles(t,i),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(e){this._trackResize&&this.resize({originalEvent:e})._update()}_onVisibilityChange(){"hidden"===document.visibilityState&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())}get showParseStatus(){return!!this._showParseStatus}set showParseStatus(e){this._showParseStatus!==e&&(this._showParseStatus=e,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(e){this._showTerrainWireframe!==e&&(this._showTerrainWireframe=e,this._update())}get showLayers2DWireframe(){return!!this._showLayers2DWireframe}set showLayers2DWireframe(e){this._showLayers2DWireframe!==e&&(this._showLayers2DWireframe=e,this._update())}get showLayers3DWireframe(){return!!this._showLayers3DWireframe}set showLayers3DWireframe(e){this._showLayers3DWireframe!==e&&(this._showLayers3DWireframe=e,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(e){this._speedIndexTiming!==e&&(this._speedIndexTiming=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,this.style&&e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(e){this._showTileAABBs!==e&&(this._showTileAABBs=e,e&&this._update())}_setCacheLimits(t,i){e.f4(t,i)}get version(){return t}},NavigationControl:class{constructor(t={}){this.options=Object.assign({},Zl,t),this._container=l("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",e=>e.preventDefault()),this.options.showZoom&&(e.aY(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",e=>{this._map&&this._map.zoomIn({},{originalEvent:e})}),l("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",e=>{this._map&&this._map.zoomOut({},{originalEvent:e})}),l("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(e.aY(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",e=>{const t=this._map;t&&(this.options.visualizePitch?t.resetNorthPitch({},{originalEvent:e}):t.resetNorth({},{originalEvent:e}))}),this._compassIcon=l("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const e=this._map;if(!e)return;
2const t=e.getZoom(),i=t===e.getMaxZoom(),n=t===e.getMinZoom();this._zoomInButton.disabled=i,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",i.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())}_rotateCompassArrow(){const e=this._map;if(!e)return;const t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(e.transform.pitch*(Math.PI/180)),.5)}) rotateX(${e.transform.pitch}deg) rotateZ(${e.transform.angle*(180/Math.PI)}deg)`:`rotate(${e.transform.angle*(180/Math.PI)}deg)`;e._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=t)})}onAdd(e){return this._map=e,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),e.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&e.on("pitch",this._rotateCompassArrow),e.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Xl(e,this._compass,this.options.visualizePitch)),this._container}onRemove(){const e=this._map;e&&(this._container.remove(),this.options.showZoom&&e.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&e.off("pitch",this._rotateCompassArrow),e.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(e,t){const i=l("button",e,this._container);return i.type="button",i.addEventListener("click",t),i}_setButtonTitle(e,t){if(!this._map)return;const i=this._map._getUIString(`NavigationControl.${t}`);e.setAttribute("aria-label",i),e.firstElementChild&&e.firstElementChild.setAttribute("title",i)}},GeolocateControl:class extends e.E{constructor(t={}){super();const i=navigator.geolocation;this.options=Object.assign({geolocation:i},ec,t),e.aY(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=ka(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(e){return this._map=e,this._container=l("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){void 0!==this._geolocationWatchID&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(e){const t=(t=!!this.options.geolocation)=>{this._supportsGeolocation=t,e(t)};void 0!==this._supportsGeolocation?e(this._supportsGeolocation):void 0!==navigator.permissions?navigator.permissions.query({name:"geolocation"}).then(e=>t("denied"!==e.state)).catch(()=>t()):t()}_isOutOfMapMaxBounds(e){const t=this._map.getMaxBounds(),i=e.coords;return!!t&&(i.longitude<t.getWest()||i.longitude>t.getEast()||i.latitude<t.getSouth()||i.latitude>t.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(t){if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.z("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_E
2RROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._userLocationDotMarker.removeClassName("mapboxgl-user-location-dot-stale"),this.fire(new e.z("geolocate",Object.assign({coords:t.coords,timestamp:t.timestamp},t.toJSON?{toJSON:t.toJSON.bind(t)}:{}))),this._finish()}}_updateCamera(t){const i=new e.aT(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,r=this._map.getBearing(),o=Object.assign({bearing:r},this.options.fitBoundsOptions);this._map.fitBounds(i.toBounds(n),o,{geolocateSource:!0})}_updateMarker(t){if(t){const i=new e.aT(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const t=this._map.transform,i=e.cf(1,t._center.lat)*t.worldSize,n=Math.ceil(2*this._accuracy*i);this._circleElement.style.width=`${n}px`,this._circleElement.style.height=`${n}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&"number"==typeof this._heading?(this._userLocationDotMarker.setRotation(this._heading),this._userLocationDotMarker.addClassName("mapboxgl-user-location-show-heading")):(this._userLocationDotMarker.removeClassName("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(t){if(this._map){if(this.options.trackUserLocation)if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",e),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",e),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&this._noTimeout)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._userLocationDotMarker.addClassName("mapboxgl-user-location-dot-stale"),this.fire(new e.z("error",t)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(t){if(void 0!==this._map){if(this._container.addEventListener("contextmenu",e=>e.preventDefault()),this._geolocateButton=l("button","mapboxgl-ctrl-geolocate",this._container),l("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===t){e.w("Geolocation support is not available so the GeolocateControl will be disabled.");const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",t),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",t)}else{const e=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",e),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",e)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","fal
2se"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=l("div","mapboxgl-user-location"),this._dotElement.appendChild(l("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(l("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new Ql({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=l("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ql({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",t=>{t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||t.originalEvent&&"resize"===t.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new e.z("trackuserlocationend")))})}}_onDeviceOrientation(e){this._userLocationDotMarker&&(e.webkitCompassHeading?this._heading=e.webkitCompassHeading:!0===e.absolute&&(this._heading=-1*e.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return e.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 e.z("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.z("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.z("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(e={maximumAge:6e5,timeout:0},this._noTimeout=!0):(e=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,e),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=window.setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const e=()=>{"ondeviceorientationabsolute"in window?window.addEventListener("deviceorientationabsolute",this._onDeviceOrientation):window.addEventListener("deviceorientation",this._onDeviceOrientation)};"undefined"!=typeof DeviceMotionEvent&&"function"==typeof DeviceMotionEvent.requestPermission?DeviceOrientationEvent.requestPermission().then(t=>{"granted"===t&&e()}).catch(console.error):e()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),window.removeEventListener("deviceorientation",this._onDeviceOrientation),window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","fal
2se"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Bl,ScaleControl:class{constructor(t={}){this.options=Object.assign({},tc,t),e.aY(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const e=this.options.maxWidth||100,t=this._map,i=t._containerHeight/2,n=t._containerWidth/2-e/2,r=t.unproject([n,i]),o=t.unproject([n+e,i]),s=r.distanceTo(o);if("imperial"===this.options.unit){const t=3.2808*s;t>5280?this._setScale(e,t/5280,"mile"):this._setScale(e,t,"foot")}else"nautical"===this.options.unit?this._setScale(e,s/1852,"nautical-mile"):s>=1e3?this._setScale(e,s/1e3,"kilometer"):this._setScale(e,s,"meter")}_setScale(e,t,i){this._map._requestDomTask(()=>{const n=function(e){const t=Math.pow(10,`${Math.floor(e)}`.length-1);let i=e/t;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:i>=1?1:function(e){const t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}(i),t*i}(t),r=n/t;this._container.innerHTML="nautical-mile"!==i?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:i}).format(n):`${n}&nbsp;${ic[i]}`,this._container.style.width=e*r+"px"})}onAdd(e){return this._map=e,this._language=e.getLanguage(),this._container=l("div","mapboxgl-ctrl mapboxgl-ctrl-scale",e.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(e){this._language=e,this._update()}setUnit(e){this.options.unit=e,this._update()}},FullscreenControl:class{constructor(t={}){this._fullscreen=!1,t&&t.container&&(t.container instanceof HTMLElement?this._container=t.container:e.w("Full screen control 'container' must be a DOM element.")),e.aY(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=l("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.w("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!document.fullscreenEnabled&&!document.webkitFullscreenEnabled)}_setupUI(){const e=this._fullscreenButton=l("button","mapboxgl-ctrl-fullscreen",this._controlContainer);l("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden","true"),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",e)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(document.fullscreenElement||document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},IndoorControl:Vl,Popup:class extends e.E{constructor(t){super(),this.options=Object.assign(Object.create(nc),t),this._altitude=this.options.altitude,e.aY(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(t&&t.className?t.className.trim().split(/\s+/):[])}addTo(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&t.on("preclick",this._onClose),this.options.closeOnMove&&t.on("move",this._onClose),t.on("remove",this.remove),this._update(),t._addPopup(this),this._focusFirstElement(),this._trackPointer?(t.on("mousemove",this._onMouseEvent),t.on("mouseup",this._onMouseEvent),t._canvasContainer.classList.add("mapboxgl-track-pointer")):t.on("move",this._update),this.fire(new e.z("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const t=this._map;return t&&(t.off("move",this._update),t.off("move",this._onClose),t.off("preclick",this._onClose),t.off("click",this._onClose),t.off("remove",this.remove),t.off("mousemove",this._onMouseEvent),t.off("mouseup",this._onMouseEvent),t.off("drag",this._onMouseEvent),t._canvasContainer&&t._canvasContainer.classList.remove("mapboxgl-track-pointer"),t._removePopup(this),this._map=void 0),this.fire(new e.z("close")),this}getLngLat(){return this._lngLat}setLngLat(t){this._lngLat=e.aT.convert(t),this._pos=null,this._trackPointer=!1,this._update();const i=this._map;return i&&(i.on("move",this._update),i.off("mousemove",this._onMouseEvent),i._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}getAltitude(){return this._altitude}setAltitude(e){return this._altitude=e,this._update(),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const e=this._map;return e&&(e.off("move",this._update),e.on("mousemove",this._onMouseEvent),e.on("drag",this._onMouseEvent),e._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(e){return this.setDOMContent(document.createTextNode(e))}setHTML(e){const t=document.createDocumentFragment(),i=document.createElement("body");let n;for(i.innerHTML=e;n=i.firstChild,n;)t.appendChild(n);return this.setDOMContent(t)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(e){return this.options.maxWidth=e,this._update(),this}setDOMContent(e){let t=this._content;if(t)for(;t.hasChildNodes();)t.firstChild&&t.removeChild(t.firstChild);else t=this._content=l("div","mapboxgl-popup-content",this._container||void 0);if(t.appendChild(e),this.options.closeButton){const e=this._closeButton=l("button","mapboxgl-popup-close-button",t);e.type="button",e.setAttribute("aria-label","Close popup"),e.innerHTML='<span aria-hidden="true">&#215;</span>',e.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(e){return this._classList.add(e),this._updateClassList(),this}removeClassName(e){return this._classList.delete(e),this._updateClassList(),this}setOffset(e){return this.options.offset=e,this._update(),this}toggleClassName(e){let t;return this._classList.delete(e)?t=!1:(this._classList.add(e),t=!0),this._updateClassList(),t}_onMouseEvent(e){this._update(e.point)}_getAnchor(e){if(this.options.anchor)return this.options.anchor;const t=this._map,i=this._container,n=this._pos;if(!t||!i||!n)return"bottom";const r=i.offsetWidth,o=i.offsetHeight,s=n.x<r/2,a=n.x>t.transform.width-r/2;
2if(n.y+e<o)return s?"top-left":a?"top-right":"top";if(n.y>t.transform.height-o){if(s)return"bottom-left";if(a)return"bottom-right"}return s?"left":a?"right":"bottom"}_updateClassList(){const e=this._container;if(!e)return;const t=[...this._classList];t.push("mapboxgl-popup"),this._anchor&&t.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&t.push("mapboxgl-popup-track-pointer"),e.className=t.join(" ")}_update(t){const i=this._map,n=this._content;if(!i||!this._lngLat&&!this._trackPointer||!n)return;let r=this._container;if(r||(r=this._container=l("div","mapboxgl-popup",i.getContainer()),this._tip=l("div","mapboxgl-popup-tip",r),r.appendChild(n)),this.options.maxWidth&&r.style.maxWidth!==this.options.maxWidth&&(r.style.maxWidth=this.options.maxWidth),i.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Yl(this._lngLat,this._pos,i.transform)),!this._trackPointer||t){const n=this._pos=this._trackPointer&&t instanceof e.P?t:i.project(this._lngLat,this._altitude),r=oc(this.options.offset),o=this._anchor=this._getAnchor(r.y),s=oc(this.options.offset,o),a=n.add(s).round();i._requestDomTask(()=>{this._container&&o&&(this._container.style.transform=`${Kl[o]} translate(${a.x}px,${a.y}px)`)})}if(!this._marker&&i._showingGlobe()){const t=e.f5(i.transform,this._lngLat)?0:1;this._setOpacity(t)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const e=this._container.querySelector(rc);e&&e.focus()}_onClose(){this.remove()}_setOpacity(e){this._container&&(this._container.style.opacity=`${e}`),this._content&&(this._content.style.pointerEvents=e?"auto":"none")}},Marker:Ql,Style:Bn,LngLat:e.aT,LngLatBounds:e.aI,Point:e.P,MercatorCoordinate:e.ae,FreeCameraOptions:on,Evented:e.E,config:e.e,prewarm:e.f9,clearPrewarmedResources:e.f8,get accessToken(){return e.e.ACCESS_TOKEN},set accessToken(t){e.e.ACCESS_TOKEN=t},get baseApiUrl(){return e.e.API_URL},set baseApiUrl(t){e.e.API_URL=t},get workerCount(){return e.fi.workerCount},set workerCount(t){e.fi.workerCount=t},get maxParallelImageRequests(){return e.e.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){e.e.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage(t){e.fh(t)},get workerUrl(){return e.fg.workerUrl},set workerUrl(t){e.fg.workerUrl=t},get workerClass(){return e.fg.workerClass},set workerClass(t){e.fg.workerClass=t},get workerParams(){return e.fg.workerParams},set workerParams(t){e.fg.workerParams=t},get dracoUrl(){return e.ff()},set dracoUrl(t){e.fe(t)},get meshoptUrl(){return e.fd()},set meshoptUrl(t){e.fc(t)},setNow:e.o.setNow,restoreNow:e.o.restoreNow};return sc}),i}()},906:function(e){e.exports={}},923:function(e,t,i){var n=i(2127),r=i(6094),o=i(9448);e.exports=function(e,t){var i=(r.Object||{})[e]||Object[e],s={};s[e]=t(i),n(n.S+n.F*o(function(){i(1)}),"Object",s)}},935:function(e,t,i){var n=i(2127);n(n.S,"Object",{create:i(4719)})},957:function(e,t,i){"use strict";i(629)("trim",function(e){return function(){return e(this,3)}})},977:function(e){var t,i;t=this,i=function(e){let t={extend:function(e,t){return Object.assign(e,t)},modulo:function(e,t){return(e%t+t)%t},makeArray:function(e){return Array.isArray(e)?e:null==e?[]:"object"==typeof e&&"number"==typeof e.length?[...e]:[e]},removeFrom:function(e,t){let i=e.indexOf(t);-1!=i&&e.splice(i,1)},getParent:function(e,t){for(;e.parentNode&&e!=document.body;)if((e=e.parentNode).matches(t))return e},getQueryElement:function(e){return"string"==typeof e?document.querySelector(e):e},handleEvent:function(e){let t="on"+e.type;this[t]&&this[t](e)},filterFindElements:function(e,i){return(e=t.makeArray(e)).filter(e=>e instanceof HTMLElement).reduce((e,t)=>{if(!i)return e.push(t),e;t.matches(i)&&e.push(t);let n=t.querySelectorAll(i);return e.concat(...n)},[])},debounceMethod:function(e,t,i){i=i||100;let n=e.prototype[t],r=t+"Timeout";e.prototype[t]=function(){clearTimeout(this[r]);let e=arguments;this[r]=setTimeout(()=>{n.apply(this,e),delete this[r]},i)}},docReady:function(e){let t=document.readyState;"complete"==t||"interactive"==t?setTimeout(e):document.addEventListener("DOMContentLoaded",e)},toDashed:function(e){return e.replace(/(.)([A-Z])/g,function(e,t,i){return t+"-"+i}).toLowerCase()}},i=e.console;return t.htmlInit=function(n,r){t.docReady(function(){let o="data-"+t.toDashed(r),s=document.querySelectorAll(`[${o}]`),a=e.jQuery;
2[...s].forEach(e=>{let t,s=e.getAttribute(o);try{t=s&&JSON.parse(s)}catch(t){return void(i&&i.error(`Error parsing ${o} on ${e.className}: ${t}`))}let l=new n(e,t);a&&a.data(e,r,l)})})},t},e.exports?e.exports=i(t):t.fizzyUIUtils=i(t)},1060:function(e,t){t.f=Object.getOwnPropertySymbols},1104:function(e,t,i){var n=i(2127),r=i(627),o=i(4228);n(n.S,"Reflect",{getPrototypeOf:function(e){return r(o(e))}})},1124:function(e,t,i){var n=i(8535);n(n.G,{global:i(6670)})},1158:function(e,t,i){"use strict";var n=i(4228);e.exports=function(){var e=n(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},1212:function(e,t,i){var n=i(7087),r=i(3344);e.exports=function(e){return function(t,i){var o,s,a=String(r(t)),l=n(i),c=a.length;return l<0||l>=c?e?"":void 0:(o=a.charCodeAt(l))<55296||o>56319||l+1===c||(s=a.charCodeAt(l+1))<56320||s>57343?e?a.charAt(l):o:e?a.slice(l,l+2):s-56320+(o-55296<<10)+65536}}},1220:function(e,t,i){i(7209)("Int16",2,function(e){return function(t,i,n){return e(this,t,i,n)}})},1243:function(e,t,i){i(7146),e.exports=i(6094).Object.entries},1249:function(e,t,i){var n=i(5089);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},1308:function(e,t,i){var n=i(7526).document;e.exports=n&&n.documentElement},1311:function(e,t,i){var n=i(4561),r=i(6140);e.exports=Object.keys||function(e){return n(e,r)}},1318:function(e,t,i){var n=i(2127);n(n.S,"Math",{fround:i(2122)})},1331:function(e){!function(t,i){e.exports?e.exports=i():(t.Flickity=t.Flickity||{},t.Flickity.Slide=i())}("undefined"!=typeof window?window:this,function(){function e(e,t,i){this.beginMargin=e,this.endMargin=t,this.cellAlign=i,this.cells=[],this.outerWidth=0,this.height=0}let t=e.prototype;return t.addCell=function(e){this.cells.push(e),this.outerWidth+=e.size.outerWidth,this.height=Math.max(e.size.outerHeight,this.height),1===this.cells.length&&(this.x=e.x,this.firstMargin=e.size[this.beginMargin])},t.updateTarget=function(){let e=this.getLastCell(),t=e?e.size[this.endMargin]:0,i=this.outerWidth-(this.firstMargin+t);this.target=this.x+this.firstMargin+i*this.cellAlign},t.getLastCell=function(){return this.cells[this.cells.length-1]},t.select=function(){this.cells.forEach(e=>e.select())},t.unselect=function(){this.cells.forEach(e=>e.unselect())},t.getCellElements=function(){return this.cells.map(e=>e.element)},e})},1368:function(e,t,i){i(62),e.exports=i(6094).String.trimLeft},1384:function(e,t,i){var n=i(7526),r=i(2780).set,o=n.MutationObserver||n.WebKitMutationObserver,s=n.process,a=n.Promise,l="process"==i(5089)(s);e.exports=function(){var e,t,i,c=function(){var n,r;for(l&&(n=s.domain)&&n.exit();e;){r=e.fn,e=e.next;try{r()}catch(n){throw e?i():t=void 0,n}}t=void 0,n&&n.enter()};if(l)i=function(){s.nextTick(c)};else if(!o||n.navigator&&n.navigator.standalone)if(a&&a.resolve){var u=a.resolve(void 0);i=function(){u.then(c)}}else i=function(){r.call(n,c)};else{var h=!0,d=document.createTextNode("");new o(c).observe(d,{characterData:!0}),i=function(){d.data=h=!h}}return function(n){var r={fn:n,next:void 0};t&&(t.next=r),e||(e=r,i()),t=r}}},1430:function(e,t,i){var n=i(2127);n(n.S+n.F,"Object",{assign:i(8206)})},1449:function(e,t,i){"use strict";var n=i(2127),r=i(6543);n(n.P+n.F*!i(6884)([].reduce,!0),"Array",{reduce:function(e){return r(this,e,arguments.length,arguments[1],!1)}})},1464:function(e,t,i){var n=i(7221),r=i(1485),o=i(157);e.exports=function(e){return function(t,i,s){var a,l=n(t),c=r(l.length),u=o(s,c);if(e&&i!=i){for(;c>u;)if((a=l[u++])!=a)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===i)return e||u||0;return!e&&-1}}},1473:function(e){e.exports=Math.log1p||function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:Math.log(1+e)}},1485:function(e,t,i){var n=i(7087),r=Math.min;e.exports=function(e){return e>0?r(n(e),9007199254740991):0}},1508:function(e,t,i){var n=i(906),r=i(7574)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(n.Array===e||o[r]===e)}},1626:function(e,t,i){var n=i(7967),r=i(4228),o=i(1311);e.exports=i(1763)?Object.defineProperties:function(e,t){r(e);for(var i,s=o(t),a=s.length,l=0;a>l;)n.f(e,i=s[l++],t[i]);return e}},1632:function(e,t,i){"use strict";var n=i(6197),r=i(2888);e.exports=i(8933)("Set",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return n.def(r(this,"Set"),e=0===e?0:e,e)}},n)},1763:function(e,t,i){e.exports=!i(9448)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},1879:function(e,t,i){var n=i(8641),r=i(627),o=i(7917),s=i(2127),a=i(3305),l=i(4228);s(s.S,"Reflect",{get:function e(t,i){var s,c,u=arguments.length<3?t:arguments[2];return l(t)===u?t[i]:(s=n.f(t,i))?o(s,"value")?s.value:void 0!==s.get?s.get.call(u):void 0:a(c=r(t))?e(c,i,u):void 0}})},1883:function(e,t,i){var n=i(2127);n(n.S,"Reflect",{has:function(e,t){return t in e}})},1895:function(e,t,i){i(923)("getOwnPropertyNames",function(){return i(4765).f})},1933:function(e,t,i){var n=i(2127),r=i(7526).isFinite;n(n.S,"Number",{isFinite:function(e){return"number"==typeof e&&r(e)}})},1984:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},1996:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},2087:function(e,t,i){i(7209)("Uint16",2,function(e){return function(t,i,n){return e(this,t,i,n)}})},2121:function(e,t,i){!function(t,n){e.exports?e.exports=n(i(977)):(t.Flickity=t.Flickity||{},t.Flickity.animatePrototype=n(t.fizzyUIUtils))}("undefined"!=typeof window?window:this,function(e){return{startAnimation:function(){this.isAnimating||(this.isAnimating=!0,this.restingFrames=0,this.animate())},animate:function(){this.applyDragForce(),this.applySelectedAttraction();let e=this.x;this.integratePhysics(),this.positionSlider(),this.settle(e),this.isAnimating&&requestAnimationFrame(()=>this.animate())},positionSlider:function(){let t=this.x;this.isWrapping&&(t=e.modulo(t,this.slideableWidth)-this.slideableWidth,this.shiftWrapCells(t)),this.setTranslateX(t,this.isAnimating),this.dispatchScrollEvent()},setTranslateX:function(e,t){e+=this.cursorPosition,this.options.rightToLeft&&(e=-e);let i=this.getPositionValue(e);this.slider.style.transform=t?`translate3d(${i},0,0)`:`translateX(${i})`},dispatchScrollEvent:function(){let e=this.slides[0];if(!e)return;let t=-this.x-e.target,i=t/this.slidesWidth;this.dispatchEvent("scroll",null,[i,t])},positionSliderAtSelected:function(){this.cells.length&&(this.x=-this.selectedSlide.target,this.velocity=0,this.positionSlider())},getPositionValue:function(e){return this.options.percentPosition?.01*Math.round(e/this.size.innerWidth*1e4)+"%":Math.round(e)+"px"},settle:function(e){!this.isPointerDown&&Math.round(100*this.x)===Math.round(100*e)&&this.restingFrames++,this.restingFrames>2&&(this.isAnimating=!1,delete this.isFreeScrolling,this.positionSlider(),this.dispatchEvent("settle",null,[this.selectedIndex]))},shiftWrapCells:function(e){let t=this.cursorPosition+e;this._shiftCells(this.beforeShiftCells,t,-1);let i=this.size.innerWidth-(e+this.slideableWidth+this.cursorPosition);this._shiftCells(this.afterShiftCells,i,1)}
2,_shiftCells:function(e,t,i){e.forEach(e=>{let n=t>0?i:0;this._wrapShiftCell(e,n),t-=e.size.outerWidth})},_unshiftCells:function(e){e&&e.length&&e.forEach(e=>this._wrapShiftCell(e,0))},_wrapShiftCell:function(e,t){this._renderCellPosition(e,e.x+this.slideableWidth*t)},integratePhysics:function(){this.x+=this.velocity,this.velocity*=this.getFrictionFactor()},applyForce:function(e){this.velocity+=e},getFrictionFactor:function(){return 1-this.options[this.isFreeScrolling?"freeScrollFriction":"friction"]},getRestingPosition:function(){return this.x+this.velocity/(1-this.getFrictionFactor())},applyDragForce:function(){if(!this.isDraggable||!this.isPointerDown)return;let e=this.dragX-this.x-this.velocity;this.applyForce(e)},applySelectedAttraction:function(){if(this.isDraggable&&this.isPointerDown||this.isFreeScrolling||!this.slides.length)return;let e=(-1*this.selectedSlide.target-this.x)*this.options.selectedAttraction;this.applyForce(e)}}})},2122:function(e,t,i){var n=i(3733),r=Math.pow,o=r(2,-52),s=r(2,-23),a=r(2,127)*(2-s),l=r(2,-126);e.exports=Math.fround||function(e){var t,i,r=Math.abs(e),c=n(e);return r<l?c*(r/l/s+1/o-1/o)*l*s:(i=(t=(1+s/o)*r)-(t-r))>a||i!=i?c*(1/0):c*i}},2127:function(e,t,i){var n=i(7526),r=i(6094),o=i(3341),s=i(8859),a=i(5052),l="prototype",c=function(e,t,i){var u,h,d,f,p=e&c.F,m=e&c.G,_=e&c.S,g=e&c.P,y=e&c.B,v=m?n:_?n[t]||(n[t]={}):(n[t]||{})[l],x=m?r:r[t]||(r[t]={}),b=x[l]||(x[l]={});for(u in m&&(i=t),i)d=((h=!p&&v&&void 0!==v[u])?v:i)[u],f=y&&h?a(d,n):g&&"function"==typeof d?a(Function.call,d):d,v&&s(v,u,d,e&c.U),x[u]!=d&&o(x,u,f),g&&b[u]!=d&&(b[u]=d)};n.core=r,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},2137:function(e){var t,i;t="undefined"!=typeof window?window:this,i=function(){function e(){}let t=e.prototype;return t.on=function(e,t){if(!e||!t)return this;let i=this._events=this._events||{},n=i[e]=i[e]||[];return n.includes(t)||n.push(t),this},t.once=function(e,t){if(!e||!t)return this;this.on(e,t);let i=this._onceEvents=this._onceEvents||{};return(i[e]=i[e]||{})[t]=!0,this},t.off=function(e,t){let i=this._events&&this._events[e];if(!i||!i.length)return this;let n=i.indexOf(t);return-1!=n&&i.splice(n,1),this},t.emitEvent=function(e,t){let i=this._events&&this._events[e];if(!i||!i.length)return this;i=i.slice(0),t=t||[];let n=this._onceEvents&&this._onceEvents[e];for(let r of i)n&&n[r]&&(this.off(e,r),delete n[r]),r.apply(this,t);return this},t.allOff=function(){return delete this._events,delete this._onceEvents,this},e},e.exports?e.exports=i():t.EvEmitter=i()},2220:function(e,t,i){var n=i(2127),r=i(157),o=String.fromCharCode,s=String.fromCodePoint;n(n.S+n.F*(!!s&&1!=s.length),"String",{fromCodePoint:function(e){for(var t,i=[],n=arguments.length,s=0;n>s;){if(t=+arguments[s++],r(t,1114111)!==t)throw RangeError(t+" is not a valid code point");i.push(t<65536?o(t):o(55296+((t-=65536)>>10),t%1024+56320))}return i.join("")}})},2322:function(e,t,i){"use strict";var n=i(7981),r=i(3305),o=i(1485),s=i(5052),a=i(7574)("isConcatSpreadable");e.exports=function e(t,i,l,c,u,h,d,f){for(var p,m,_=u,g=0,y=!!d&&s(d,f,3);g<c;){if(g in l){if(p=y?y(l[g],g,i):l[g],m=!1,r(p)&&(m=void 0!==(m=p[a])?!!m:n(p)),m&&h>0)_=e(t,i,p,o(p.length),_,h-1)-1;else{if(_>=9007199254740991)throw TypeError();t[_]=p}_++}g++}return _}},2335:function(e,t,i){var n=i(2127),r=i(3733);n(n.S,"Math",{cbrt:function(e){return r(e=+e)*Math.pow(Math.abs(e),1/3)}})},2346:function(e,t,i){"use strict";var n=i(2127),r=i(8270),o=i(3048);n(n.P+n.F*i(9448)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function(e){var t=r(this),i=o(t);return"number"!=typeof i||isFinite(i)?t.toISOString():null}})},2392:function(e,t,i){var n=i(2127),r=Math.atanh;n(n.S+n.F*!(r&&1/r(-0)<0),"Math",{atanh:function(e){return 0==(e=+e)?e:Math.log((1+e)/(1-e))/2}})},2405:function(e,t,i){"use strict";var n=i(2127),r=i(1212)(!1);n(n.P,"String",{codePointAt:function(e){return r(this,e)}})},2419:function(e,t,i){i(9650),i(935),i(6064),i(7067),i(2642),i(3e3),i(8647),i(1895),i(8236),i(3822),i(5572),i(9318),i(5032),i(9073),i(1430),i(8451),i(8132),i(7482),i(5049),i(489),i(5502),i(571),i(6108),i(4509),i(7727),i(6701),i(4419),i(1933),i(3157),i(9497),i(4104),i(210),i(6576),i(4437),i(8050),i(6648),i(5771),i(2392),i(2335),i(4896),i(4521),i(9147),i(1318),i(4352),i(5327),i(7509),i(5909),i(9584),i(345),i(9134),i(7901),i(6592),i(2220),i(3483),i(957
vendor: 5,436 bytes, line 2
2),i(2975),i(2405),i(7224),i(8872),i(4894),i(177),i(7360),i(9011),i(4591),i(7334),i(7083),i(9213),i(8437),i(9839),i(6549),i(2818),i(8543),i(3559),i(4153),i(3292),i(2346),i(9429),i(7849),i(8951),i(7899),i(3863),i(4570),i(6511),i(5853),i(7075),i(3504),i(4913),i(9813),i(8892),i(8888),i(1449),i(7874),i(4609),i(3706),i(9620),i(7762),i(5144),i(5369),i(6209),i(5165),i(8301),i(4116),i(8604),i(9638),i(4040),i(8305),i(4701),i(341),i(6517),i(3386),i(1632),i(9397),i(8163),i(5706),i(660),i(8699),i(4702),i(333),i(1220),i(2087),i(8066),i(8537),i(7925),i(2490),i(7103),i(2586),i(2552),i(4376),i(5153),i(1879),i(2650),i(1104),i(1883),i(5433),i(5e3),i(5932),i(5443),i(6316),e.exports=i(6094)},2468:function(e,t,i){var n=i(2127),r=i(9448),o=i(3344),s=/"/g,a=function(e,t,i,n){var r=String(o(e)),a="<"+t;return""!==i&&(a+=" "+i+'="'+String(n).replace(s,"&quot;")+'"'),a+">"+r+"</"+t+">"};e.exports=function(e,t){var i={};i[e]=t(a),n(n.P+n.F*r(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}),"String",i)}},2484:function(e,t,i){e.exports=!i(8219)&&!i(1984)(function(){return 7!=Object.defineProperty(i(3802)("div"),"a",{get:function(){return 7}}).a})},2490:function(e,t,i){i(7209)("Float64",8,function(e){return function(t,i,n){return e(this,t,i,n)}})},2522:function(e,t,i){if(e.exports){const t=i(4831);i(3170),i(7824),i(7728),i(9453),i(9943),i(8385),i(179),e.exports=t}},2535:function(e,t,i){"use strict";var n=i(4848),r=RegExp.prototype.exec;e.exports=function(e,t){var i=e.exec;if("function"==typeof i){var o=i.call(e,t);if("object"!=typeof o)throw new TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==n(e))throw new TypeError("RegExp#exec called on incompatible receiver");return r.call(e,t)}},2552:function(e,t,i){var n=i(7967),r=i(2127),o=i(4228),s=i(3048);r(r.S+r.F*i(9448)(function(){Reflect.defineProperty(n.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function(e,t,i){o(e),t=s(t,!0),o(i);try{return n.f(e,t,i),!0}catch(e){return!1}}})},2586:function(e,t,i){var n=i(2127),r=i(4719),o=i(3387),s=i(4228),a=i(3305),l=i(9448),c=i(5538),u=(i(7526).Reflect||{}).construct,h=l(function(){function e(){}return!(u(function(){},[],e)instanceof e)}),d=!l(function(){u(function(){})});n(n.S+n.F*(h||d),"Reflect",{construct:function(e,t){o(e),s(t);var i=arguments.length<3?e:o(arguments[2]);if(d&&!h)return u(e,t,i);if(e==i){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return n.push.apply(n,t),new(c.apply(e,n))}var l=i.prototype,f=r(a(l)?l:Object.prototype),p=Function.apply.call(e,f,t);return a(p)?p:f}})},2642:function(e,t,i){var n=i(7221),r=i(8641).f;i(923)("getOwnPropertyDescriptor",function(){return function(e,t){return r(n(e),t)}})},2650:function(e,t,i){var n=i(8641),r=i(2127),o=i(4228);r(r.S,"Reflect",{getOwnPropertyDescriptor:function(e,t){return n.f(o(e),t)}})},2677:function(e,t,i){var n=i(8423),r=i(6260);e.exports=i(8219)?function(e,t,i){return n.f(e,t,r(1,i))}:function(e,t,i){return e[t]=i,e}},2681:function(e,t,i){i(5380),e.exports=i(6094).String.padStart},2738:function(e,t,i){var n=i(7526).parseInt,r=i(629).trim,o=i(832),s=/^[-+]?0[xX]/;e.exports=8!==n(o+"08")||22!==n(o+"0x16")?function(e,t){var i=r(String(e),3);return n(i,t>>>0||(s.test(i)?16:10))}:n},2750:function(e){e.exports=!1},2780:function(e,t,i){var n,r,o,s=i(5052),a=i(4877),l=i(1308),c=i(6034),u=i(7526),h=u.process,d=u.setImmediate,f=u.clearImmediate,p=u.MessageChannel,m=u.Dispatch,_=0,g={},y="onreadystatechange",v=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},x=function(e){v.call(e.data)};d&&f||(d=function(e){for(var t=[],i=1;arguments.length>i;)t.push(arguments[i++]);return g[++_]=function(){a("function"==typeof e?e:Function(e),t)},n(_),_},f=function(e){delete g[e]},"process"==i(5089)(h)?n=function(e){h.nextTick(s(v,e,1))}:m&&m.now?n=function(e){m.now(s(v,e,1))}:p?(o=(r=new p).port2,r.port1.onmessage=x,n=s(o.postMessage,o,1)):u.addEventListener&&"function"==typeof postMessage&&!u.importScripts?(n=function(e){u.postMessage(e+"","*")},u.addEventListener("message",x,!1)):n=y in c("script")?function(e){l.appendChild(c("script"))[y]=function(){l.removeChild(this),v.call(e)}}:function(e){setTimeout(s(v,e,1),0)}),e.exports={set:d,clear:f}},2818:function(e,t,i){"use strict";i(2468)("small",function(e){return function(){return e(this,"small","","")}})},2820:function(e,t,i){i(5392)("asyncIterator")},2888:function(e,t,i){var n=i(3305);e.exports=function(e,t){if(!n(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},2956:function(e,t,i){e.exports=!i(1763)&&!i(9448)(function(){return 7!=Object.defineProperty(i(6034)("div"),"a",{get:function(){return 7}}).a})},2975:function(e,t,i){"use strict";var n=i(1212)(!0);i(8175)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,i=this._i;return i>=t.length?{value:void 0,done:!0}:(e=n(t,i),this._i+=e.length,{value:e,done:!1})})},2988:function(e,t,i){var n=i(4415)("meta"),r=i(3305),o=i(7917),s=i(7967).f,a=0,l=Object.isExtensible||function(){return!0},c=!i(9448)(function(){return l(Object.preventExtensions({}))}),u=function(e){s(e,n,{value:{i:"O"+ ++a,w:{}}})},h=e.exports={KEY:n,NEED:!1,fastKey:function(e,t){if(!r(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;
2if(!o(e,n)){if(!l(e))return"F";if(!t)return"E";u(e)}return e[n].i},getWeak:function(e,t){if(!o(e,n)){if(!l(e))return!0;if(!t)return!1;u(e)}return e[n].w},onFreeze:function(e){return c&&h.NEED&&l(e)&&!o(e,n)&&u(e),e}}},3e3:function(e,t,i){var n=i(8270),r=i(627);i(923)("getPrototypeOf",function(){return function(e){return r(n(e))}})},3048:function(e,t,i){var n=i(3305);e.exports=function(e,t){if(!n(e))return e;var i,r;if(t&&"function"==typeof(i=e.toString)&&!n(r=i.call(e)))return r;if("function"==typeof(i=e.valueOf)&&!n(r=i.call(e)))return r;if(!t&&"function"==typeof(i=e.toString)&&!n(r=i.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},3133:function(e,t,i){var n=i(7087),r=i(1485);e.exports=function(e){if(void 0===e)return 0;var t=n(e),i=r(t);if(t!==i)throw RangeError("Wrong length!");return i}},3157:function(e,t,i){var n=i(2127);n(n.S,"Number",{isInteger:i(3842)})},3170:function(e,t,i){!function(t,n){e.exports?e.exports=n(t,i(4831),i(6377),i(977)):t.Flickity=n(t,t.Flickity,t.Unidragger,t.fizzyUIUtils)}("undefined"!=typeof window?window:this,function(e,t,i,n){Object.assign(t.defaults,{draggable:">1",dragThreshold:3});let r=t.prototype;function o(){return{x:e.pageXOffset,y:e.pageYOffset}}return Object.assign(r,i.prototype),r.touchActionValue="",t.create.drag=function(){this.on("activate",this.onActivateDrag),this.on("uiChange",this._uiChangeDrag),this.on("deactivate",this.onDeactivateDrag),this.on("cellChange",this.updateDraggable),this.on("pointerDown",this.handlePointerDown),this.on("pointerUp",this.handlePointerUp),this.on("pointerDown",this.handlePointerDone),this.on("dragStart",this.handleDragStart),this.on("dragMove",this.handleDragMove),this.on("dragEnd",this.handleDragEnd),this.on("staticClick",this.handleStaticClick)},r.onActivateDrag=function(){this.handles=[this.viewport],this.bindHandles(),this.updateDraggable()},r.onDeactivateDrag=function(){this.unbindHandles(),this.element.classList.remove("is-draggable")},r.updateDraggable=function(){">1"===this.options.draggable?this.isDraggable=this.slides.length>1:this.isDraggable=this.options.draggable,this.element.classList.toggle("is-draggable",this.isDraggable)},r._uiChangeDrag=function(){delete this.isFreeScrolling},r.handlePointerDown=function(t){if(!this.isDraggable)return void this.bindActivePointerEvents(t);let i="touchstart"===t.type,n="touch"===t.pointerType,r=t.target.matches("input, textarea, select");i||n||r||t.preventDefault(),r||this.focus(),document.activeElement!==this.element&&document.activeElement.blur(),this.dragX=this.x,this.viewport.classList.add("is-pointer-down"),this.pointerDownScroll=o(),e.addEventListener("scroll",this),this.bindActivePointerEvents(t)},r.hasDragStarted=function(e){return Math.abs(e.x)>this.options.dragThreshold},r.handlePointerUp=function(){delete this.isTouchScrolling,this.viewport.classList.remove("is-pointer-down")},r.handlePointerDone=function(){e.removeEventListener("scroll",this),delete this.pointerDownScroll},r.handleDragStart=function(){this.isDraggable&&(this.dragStartPosition=this.x,this.startAnimation(),e.removeEventListener("scroll",this))},r.handleDragMove=function(e,t,i){if(!this.isDraggable)return;e.preventDefault(),this.previousDragX=this.dragX;let n=this.options.rightToLeft?-1:1;this.isWrapping&&(i.x%=this.slideableWidth);let r=this.dragStartPosition+i.x*n;if(!this.isWrapping){let e=Math.max(-this.slides[0].target,this.dragStartPosition);r=r>e?.5*(r+e):r;let t=Math.min(-this.getLastSlide().target,this.dragStartPosition);r=r<t?.5*(r+t):r}this.dragX=r,this.dragMoveTime=new Date},r.handleDragEnd=function(){if(!this.isDraggable)return;let{freeScroll:e}=this.options;e&&(this.isFreeScrolling=!0);let t=this.dragEndRestingSelect();if(e&&!this.isWrapping){let e=this.getRestingPosition();this.isFreeScrolling=-e>this.slides[0].target&&-e<this.getLastSlide().target}else e||t!==this.selectedIndex||(t+=this.dragEndBoostSelect());delete this.previousDragX,this.isDragSelect=this.isWrapping,this.select(t),delete this.isDragSelect},r.dragEndRestingSelect=function(){let e=this.getRestingPosition(),t=Math.abs(this.getSlideDistance(-e,this.selectedIndex)),i=this._getClosestResting(e,t,1),n=this._getClosestResting(e,t,-1);return i.distance<n.distance?i.index:n.index},r._getClosestResting=function(e,t,i){let n=this.selectedIndex,r=1/0,o=this.options.contain&&!this.isWrapping?(e,t)=>e<=t:(e,t)=>
2e<t;for(;o(t,r)&&(n+=i,r=t,null!==(t=this.getSlideDistance(-e,n)));)t=Math.abs(t);return{distance:r,index:n-i}},r.getSlideDistance=function(e,t){let i=this.slides.length,r=this.options.wrapAround&&i>1,o=r?n.modulo(t,i):t,s=this.slides[o];if(!s)return null;let a=r?this.slideableWidth*Math.floor(t/i):0;return e-(s.target+a)},r.dragEndBoostSelect=function(){if(void 0===this.previousDragX||!this.dragMoveTime||new Date-this.dragMoveTime>100)return 0;let e=this.getSlideDistance(-this.dragX,this.selectedIndex),t=this.previousDragX-this.dragX;return e>0&&t>0?1:e<0&&t<0?-1:0},r.onscroll=function(){let e=o(),t=this.pointerDownScroll.x-e.x,i=this.pointerDownScroll.y-e.y;(Math.abs(t)>3||Math.abs(i)>3)&&this.pointerDone()},t})},3191:function(e,t,i){var n=i(3606);e.exports=function(e,t){return new(n(e))(t)}},3292:function(e,t,i){var n=i(2127);n(n.S,"Date",{now:function(){return(new Date).getTime()}})},3305:function(e){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},3341:function(e,t,i){var n=i(7967),r=i(1996);e.exports=i(1763)?function(e,t,i){return n.f(e,t,r(1,i))}:function(e,t,i){return e[t]=i,e}},3344:function(e){e.exports=function(e){if(null==e)throw TypeError("Can't call method on  "+e);return e}},3386:function(e,t,i){"use strict";var n=i(6197),r=i(2888),o="Map";e.exports=i(8933)(o,function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{get:function(e){var t=n.getEntry(r(this,o),e);return t&&t.v},set:function(e,t){return n.def(r(this,o),0===e?0:e,t)}},n,!0)},3387:function(e){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},3415:function(e,t,i){i(8772),i(5417),i(5890),e.exports=i(6094)},3483:function(e,t,i){var n=i(2127),r=i(7221),o=i(1485);n(n.S,"String",{raw:function(e){for(var t=r(e.raw),i=o(t.length),n=arguments.length,s=[],a=0;i>a;)s.push(String(t[a++])),a<n&&s.push(String(arguments[a]));return s.join("")}})},3504:function(e,t,i){"use strict";var n=i(2127),r=i(6179)(0),o=i(6884)([].forEach,!0);n(n.P+n.F*!o,"Array",{forEach:function(e){return r(this,e,arguments[1])}})},3559:function(e,t,i){"use strict";i(2468)("sub",function(e){return function(){return e(this,"sub","","")}})},3589:function(e,t,i){var n=i(7526).parseFloat,r=i(629).trim;e.exports=1/n(i(832)+"-0")!=-1/0?function(e){var t=r(String(e),3),i=n(t);return 0===i&&"-"==t.charAt(0)?-0:i}:n},3606:function(e,t,i){var n=i(3305),r=i(7981),o=i(7574)("species");e.exports=function(e){var t;return r(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!r(t.prototype)||(t=void 0),n(t)&&null===(t=t[o])&&(t=void 0)),void 0===t?Array:t}},3706:function(e,t,i){"use strict";var n=i(2127),r=i(7221),o=i(7087),s=i(1485),a=[].lastIndexOf,l=!!a&&1/[1].lastIndexOf(1,-0)<0;n(n.P+n.F*(l||!i(6884)(a)),"Array",{lastIndexOf:function(e){if(l)return a.apply(this,arguments)||0;var t=r(this),i=s(t.length),n=i-1;for(arguments.length>1&&(n=Math.min(n,o(arguments[1]))),n<0&&(n=i+n);n>=0;n--)if(n in t&&t[n]===e)return n||0;return-1}})},3733:function(e){e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},3802:function(e,t,i){var n=i(4401),r=i(6670).document,o=n(r)&&n(r.createElement);e.exports=function(e){return o?r.createElement(e):{}}},3822:function(e,t,i){var n=i(3305),r=i(2988).onFreeze;i(923)("seal",function(e){return function(t){return e&&n(t)?e(r(t)):t}})},3842:function(e,t,i){var n=i(3305),r=Math.floor;e.exports=function(e){return!n(e)&&isFinite(e)&&r(e)===e}},3844:function(e,t,i){var n=i(7967).f,r=i(7917),o=i(7574)("toStringTag");e.exports=function(e,t,i){e&&!r(e=i?e:e.prototype,o)&&n(e,o,{configurable:!0,value:t})}},3854:function(e,t,i){var n=i(1763),r=i(1311),o=i(7221),s=i(8449).f;e.exports=function(e){return function(t){for(var i,a=o(t),l=r(a),c=l.length,u=0,h=[];c>u;)i=l[u++],n&&!s.call(a,i)||h.push(e?[i,a[i]]:a[i]);return h}}},3863:function(e,t,i){"use strict";var n=i(5052),r=i(2127),o=i(8270),s=i(7368),a=i(1508),l=i(1485),c=i(7227),u=i(762);r(r.S+r.F*!i(8931)(function(e){Array.from(e)}),"Array",{from:function(e){var t,i,r,h,d=o(e),f="function"==typeof this?this:Array,p=arguments.length,m=p>1?arguments[1]:void 0,_=void 0!==m,g=0,y=u(d);if(_&&(m=n(m,p>2?arguments[2]:void 0,2)),null==y||f==Array&&a(y))for(i=new f(t=l(d.length));t>g;g++)c(i,g,_?m(d[g],g):d[g]);else for(h=y.call(d),i=new f;!(r=h.next()).done;g++)c(i,g,_?s(h,m,[r.value,g],!0):r.value);return i.length=g,i}})},3866:function(e){!function(t,i){e.exports?e.exports=i():t.getSize=i()}(window,function(){function e(e){let t=parseFloat(e);return-1==e.indexOf("%")&&!isNaN(t)&&t}let t=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];return t.length,function(i){if("string"==typeof i&&(i=document.querySelector(i)),!i||"object"!=typeof i||!i.nodeType)return;let n=getComputedStyle(i);if("none"==n.display)return function(){let e={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0};return t.forEach(t=>{e[t]=0}),e}();let r={};r.width=i.offsetWidth,r.height=i.offsetHeight;let o=r.isBorderBox="border-box"==n.boxSizing;
2t.forEach(e=>{let t=n[e],i=parseFloat(t);r[e]=isNaN(i)?0:i});let s=r.paddingLeft+r.paddingRight,a=r.paddingTop+r.paddingBottom,l=r.marginLeft+r.marginRight,c=r.marginTop+r.marginBottom,u=r.borderLeftWidth+r.borderRightWidth,h=r.borderTopWidth+r.borderBottomWidth,d=e(n.width);!1!==d&&(r.width=d+(o?0:s+u));let f=e(n.height);return!1!==f&&(r.height=f+(o?0:a+h)),r.innerWidth=r.width-(s+u),r.innerHeight=r.height-(a+h),r.outerWidth=r.width+l,r.outerHeight=r.height+c,r}})},4040:function(e,t,i){"use strict";var n=i(4228),r=i(1485),o=i(8828),s=i(2535);i(9228)("match",1,function(e,t,i,a){return[function(i){var n=e(this),r=null==i?void 0:i[t];return void 0!==r?r.call(i,n):new RegExp(i)[t](String(n))},function(e){var t=a(i,e,this);if(t.done)return t.value;var l=n(e),c=String(this);if(!l.global)return s(l,c);var u=l.unicode;l.lastIndex=0;for(var h,d=[],f=0;null!==(h=s(l,c));){var p=String(h[0]);d[f]=p,""===p&&(l.lastIndex=o(c,r(l.lastIndex),u)),f++}return 0===f?null:d}]})},4092:function(e,t,i){!function(t,n){e.exports?e.exports=n(i(3866)):(t.Flickity=t.Flickity||{},t.Flickity.Cell=n(t.getSize))}("undefined"!=typeof window?window:this,function(e){const t="flickity-cell";function i(e){this.element=e,this.element.classList.add(t),this.x=0,this.unselect()}let n=i.prototype;return n.destroy=function(){this.unselect(),this.element.classList.remove(t),this.element.style.transform="",this.element.removeAttribute("aria-hidden")},n.getSize=function(){this.size=e(this.element)},n.select=function(){this.element.classList.add("is-selected"),this.element.removeAttribute("aria-hidden")},n.unselect=function(){this.element.classList.remove("is-selected"),this.element.setAttribute("aria-hidden","true")},n.remove=function(){this.element.remove()},i})},4104:function(e,t,i){var n=i(2127),r=i(3842),o=Math.abs;n(n.S,"Number",{isSafeInteger:function(e){return r(e)&&o(e)<=9007199254740991}})},4116:function(e,t,i){"use strict";var n=i(9600);i(2127)({target:"RegExp",proto:!0,forced:n!==/./.exec},{exec:n})},4153:function(e,t,i){"use strict";i(2468)("sup",function(e){return function(){return e(this,"sup","","")}})},4228:function(e,t,i){var n=i(3305);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},4258:function(e,t,i){"use strict";var n=i(3387);function r(e){var t,i;this.promise=new e(function(e,n){if(void 0!==t||void 0!==i)throw TypeError("Bad Promise constructor");t=e,i=n}),this.resolve=n(t),this.reject=n(i)}e.exports.f=function(e){return new r(e)}},4352:function(e,t,i){var n=i(2127),r=Math.abs;n(n.S,"Math",{hypot:function(e,t){for(var i,n,o=0,s=0,a=arguments.length,l=0;s<a;)l<(i=r(arguments[s++]))?(o=o*(n=l/i)*n+1,l=i):o+=i>0?(n=i/l)*n:i;return l===1/0?1/0:l*Math.sqrt(o)}})},4376:function(e,t,i){var n=i(2127),r=i(8641).f,o=i(4228);n(n.S,"Reflect",{deleteProperty:function(e,t){var i=r(o(e),t);return!(i&&!i.configurable)&&delete e[t]}})},4401:function(e){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},4415:function(e){var t=0,i=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++t+i).toString(36))}},4419:function(e,t,i){var n=i(2127);n(n.S,"Number",{EPSILON:Math.pow(2,-52)})},4437:function(e,t,i){var n=i(2127),r=i(3589);n(n.S+n.F*(Number.parseFloat!=r),"Number",{parseFloat:r})},4438:function(e,t,i){"use strict";var n=i(8270),r=i(157),o=i(1485);e.exports=[].copyWithin||function(e,t){var i=n(this),s=o(i.length),a=r(e,s),l=r(t,s),c=arguments.length>2?arguments[2]:void 0,u=Math.min((void 0===c?s:r(c,s))-l,s-a),h=1;for(l<a&&a<l+u&&(h=-1,l+=u-1,a+=u-1);u-- >0;)l in i?i[a]=i[l]:delete i[a],a+=h,l+=h;return i}},4472:function(e,t,i){var n=i(1485),r=i(7926),o=i(3344);e.exports=function(e,t,i,s){var a=String(o(e)),l=a.length,c=void 0===i?" ":String(i),u=n(t);if(u<=l||""==c)return a;var h=u-l,d=r.call(c,Math.ceil(h/c.length));return d.length>h&&(d=d.slice(0,h)),s?d+a:a+d}},4509:function(e,t,i){"use strict";var n=i(7526),r=i(7917),o=i(5089),s=i(8880),a=i(3048),l=i(9448),c=i(9415).f,u=i(8641).f,h=i(7967).f,d=i(629).trim,f="Number",p=n[f],m=p,_=p.prototype,g=o(i(4719)(_))==f,y="trim"in String.prototype,v=function(e){var t=a(e,!1);if("string"==typeof t&&t.length>
vendor: 4,215 bytes, line 2
22){var i,n,r,o=(t=y?t.trim():d(t,3)).charCodeAt(0);if(43===o||45===o){if(88===(i=t.charCodeAt(2))||120===i)return NaN}else if(48===o){switch(t.charCodeAt(1)){case 66:case 98:n=2,r=49;break;case 79:case 111:n=8,r=55;break;default:return+t}for(var s,l=t.slice(2),c=0,u=l.length;c<u;c++)if((s=l.charCodeAt(c))<48||s>r)return NaN;return parseInt(l,n)}}return+t};if(!p(" 0o1")||!p("0b1")||p("+0x1")){p=function(e){var t=arguments.length<1?0:e,i=this;return i instanceof p&&(g?l(function(){_.valueOf.call(i)}):o(i)!=f)?s(new m(v(t)),i,p):v(t)};for(var x,b=i(1763)?c(m):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),w=0;b.length>w;w++)r(m,x=b[w])&&!r(p,x)&&h(p,x,u(m,x));p.prototype=_,_.constructor=p,i(8859)(n,f,p)}},4514:function(e,t,i){var n=i(7526).navigator;e.exports=n&&n.userAgent||""},4521:function(e,t,i){var n=i(2127),r=Math.exp;n(n.S,"Math",{cosh:function(e){return(r(e=+e)+r(-e))/2}})},4556:function(e,t,i){var n=i(6094),r=i(7526),o="__core-js_shared__",s=r[o]||(r[o]={});(e.exports=function(e,t){return s[e]||(s[e]=void 0!==t?t:{})})("versions",[]).push({version:n.version,mode:i(2750)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},4561:function(e,t,i){var n=i(7917),r=i(7221),o=i(1464)(!1),s=i(766)("IE_PROTO");e.exports=function(e,t){var i,a=r(e),l=0,c=[];for(i in a)i!=s&&n(a,i)&&c.push(i);for(;t.length>l;)n(a,i=t[l++])&&(~o(c,i)||c.push(i));return c}},4570:function(e,t,i){"use strict";var n=i(2127),r=i(7227);n(n.S+n.F*i(9448)(function(){function e(){}return!(Array.of.call(e)instanceof e)}),"Array",{of:function(){for(var e=0,t=arguments.length,i=new("function"==typeof this?this:Array)(t);t>e;)r(i,e,arguments[e++]);return i.length=t,i}})},4572:function(e,t,i){"use strict";i(2419),i(8128),i(5777),i(2681),i(5240),i(1368),i(6073),i(7739),i(4897),i(4925),i(1243),i(8978),i(3415),i(7452)},4591:function(e,t,i){"use strict";i(2468)("blink",function(e){return function(){return e(this,"blink","","")}})},4609:function(e,t,i){"use strict";var n=i(2127),r=i(1464)(!1),o=[].indexOf,s=!!o&&1/[1].indexOf(1,-0)<0;n(n.P+n.F*(s||!i(6884)(o)),"Array",{indexOf:function(e){return s?o.apply(this,arguments)||0:r(this,e,arguments[1])}})},4614:function(e,t,i){var n=i(2127),r=i(6222),o=i(7221),s=i(8641),a=i(7227);n(n.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,i,n=o(e),l=s.f,c=r(n),u={},h=0;c.length>h;)void 0!==(i=l(n,t=c[h++]))&&a(u,t,i);return u}})},4701:function(e,t,i){"use strict";var n=i(4228),r=i(7359),o=i(2535);i(9228)("search",1,function(e,t,i,s){return[function(i){var n=e(this),r=null==i?void 0:i[t];return void 0!==r?r.call(i,n):new RegExp(i)[t](String(n))},function(e){var t=s(i,e,this);if(t.done)return t.value;var a=n(e),l=String(this),c=a.lastIndex;r(c,0)||(a.lastIndex=0);var u=o(a,l);return r(a.lastIndex,c)||(a.lastIndex=c),null===u?-1:u.index}]})},4702:function(e,t,i){i(7209)("Uint8",1,function(e){return function(t,i,n){return e(this,t,i,n)}})},4719:function(e,t,i){var n=i(4228),r=i(1626),o=i(6140),s=i(766)("IE_PROTO"),a=function(){},l="prototype",c=function(){var e,t=i(6034)("iframe"),n=o.length;for(t.style.display="none",i(1308).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),c=e.F;n--;)delete c[l][o[n]];return c()};e.exports=Object.create||function(e,t){var i;return null!==e?(a[l]=n(e),i=new a,a[l]=null,i[s]=e):i=c(),void 0===t?i:r(i,t)}},4765:function(e,t,i){var n=i(7221),r=i(9415).f,o={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"[object Window]"==o.call(e)?function(e){try{return r(e)}catch(e){return s.slice()}}(e):r(n(e))}},4831:function(e,t,i){!function(t,n){if(e.exports)e.exports=n(t,i(2137),i(3866),i(977),i(4092),i(1331),i(2121));else{let e=t.Flickity;t.Flickity=n(t,t.EvEmitter,t.getSize,t.fizzyUIUtils,e.Cell,e.Slide,e.animatePrototype)}}("undefined"!=typeof window?window:this,function(e,t,i,n,r,o,s){const{getComputedStyle:a,console:l}=e;let{jQuery:c}=e,u=0,h={};function d(e,t){let i=n.getQueryElement(e);
vendor: 9,830 bytes, line 2
2if(i){if(this.element=i,this.element.flickityGUID){let e=h[this.element.flickityGUID];return e&&e.option(t),e}c&&(this.$element=c(this.element)),this.options={...this.constructor.defaults},this.option(t),this._create()}else l&&l.error(`Bad element for Flickity: ${i||e}`)}d.defaults={accessibility:!0,cellAlign:"center",freeScrollFriction:.075,friction:.28,namespaceJQueryEvents:!0,percentPosition:!0,resize:!0,selectedAttraction:.025,setGallerySize:!0},d.create={};let f=d.prototype;Object.assign(f,t.prototype),f._create=function(){let{resize:t,watchCSS:i,rightToLeft:n}=this.options,r=this.guid=++u;this.element.flickityGUID=r,h[r]=this,this.selectedIndex=0,this.restingFrames=0,this.x=0,this.velocity=0,this.beginMargin=n?"marginRight":"marginLeft",this.endMargin=n?"marginLeft":"marginRight",this.viewport=document.createElement("div"),this.viewport.className="flickity-viewport",this._createSlider(),this.focusableElems=[this.element],(t||i)&&e.addEventListener("resize",this);for(let e in this.options.on){let t=this.options.on[e];this.on(e,t)}for(let e in d.create)d.create[e].call(this);i?this.watchCSS():this.activate()},f.option=function(e){Object.assign(this.options,e)},f.activate=function(){if(this.isActive)return;this.isActive=!0,this.element.classList.add("flickity-enabled"),this.options.rightToLeft&&this.element.classList.add("flickity-rtl"),this.getSize();let e=this._filterFindCellElements(this.element.children);this.slider.append(...e),this.viewport.append(this.slider),this.element.append(this.viewport),this.reloadCells(),this.options.accessibility&&(this.element.tabIndex=0,this.element.addEventListener("keydown",this)),this.emitEvent("activate"),this.selectInitialIndex(),this.isInitActivated=!0,this.dispatchEvent("ready")},f._createSlider=function(){let e=document.createElement("div");e.className="flickity-slider",this.slider=e},f._filterFindCellElements=function(e){return n.filterFindElements(e,this.options.cellSelector)},f.reloadCells=function(){this.cells=this._makeCells(this.slider.children),this.positionCells(),this._updateWrapShiftCells(),this.setGallerySize()},f._makeCells=function(e){return this._filterFindCellElements(e).map(e=>new r(e))},f.getLastCell=function(){return this.cells[this.cells.length-1]},f.getLastSlide=function(){return this.slides[this.slides.length-1]},f.positionCells=function(){this._sizeCells(this.cells),this._positionCells(0)},f._positionCells=function(e){e=e||0,this.maxCellHeight=e&&this.maxCellHeight||0;let t=0;if(e>0){let i=this.cells[e-1];t=i.x+i.size.outerWidth}this.cells.slice(e).forEach(e=>{e.x=t,this._renderCellPosition(e,t),t+=e.size.outerWidth,this.maxCellHeight=Math.max(e.size.outerHeight,this.maxCellHeight)}),this.slideableWidth=t,this.updateSlides(),this._containSlides(),this.slidesWidth=this.cells.length?this.getLastSlide().target-this.slides[0].target:0},f._renderCellPosition=function(e,t){let i=t*(this.options.rightToLeft?-1:1);this.options.percentPosition&&(i*=this.size.innerWidth/e.size.width);let n=this.getPositionValue(i);e.element.style.transform=`translateX( ${n} )`},f._sizeCells=function(e){e.forEach(e=>e.getSize())},f.updateSlides=function(){if(this.slides=[],!this.cells.length)return;let{beginMargin:e,endMargin:t}=this,i=new o(e,t,this.cellAlign);this.slides.push(i);let n=this._getCanCellFit();this.cells.forEach((r,s)=>{if(!i.cells.length)return void i.addCell(r);let a=i.outerWidth-i.firstMargin+(r.size.outerWidth-r.size[t]);n(s,a)||(i.updateTarget(),i=new o(e,t,this.cellAlign),this.slides.push(i)),i.addCell(r)}),i.updateTarget(),this.updateSelectedSlide()},f._getCanCellFit=function(){let{groupCells:e}=this.options;if(!e)return()=>!1;if("number"==typeof e){let t=parseInt(e,10);return e=>e%t!==0}let t=1,i="string"==typeof e&&e.match(/^(\d+)%$/);i&&(t=parseInt(i[1],10)/100);let n=(this.size.innerWidth+1)*t;return(e,t)=>t<=n},f._init=f.reposition=function(){this.positionCells(),this.positionSliderAtSelected()},f.getSize=function(){this.size=i(this.element),this.setCellAlign(),this.cursorPosition=this.size.innerWidth*this.cellAlign};let p={left:0,center:.5,right:1};f.setCellAlign=function(){let{cellAlign:e,rightToLeft:t}=this.options,i=p[e];this.cellAlign=void 0!==i?i:e,t&&(this.cellAlign=1-this.cellAlign)},f.setGallerySize=function(){if(!this.options.setGallerySize)return;let e=this.options.adaptiveHeight&&this.selectedSlide?this.selectedSlide.height:this.maxCellHeight;this.viewport.style.height=`${e}px`},f._updateWrapShiftCells=function(){if(this.isWrapping=this.getIsWrapping(),!this.isWrapping)return;this._unshiftCells(this.beforeShiftCells),this._unshiftCells(this.afterShiftCells);let e=this.cursorPosition,t=this.cells.length-1;this.beforeShiftCells=this._getGapCells(e,t,-1);let i=this.size.innerWidth-this.cursorPosition;this.afterShiftCells=this._getGapCells(i,0,1)},f.getIsWrapping=function(){let{wrapAround:e}=this.options;if(!e||this.slides.length<2)return!1;if("fill"!==e)return!0;let t=this.slideableWidth-this.size.innerWidth;if(t>this.size.innerWidth)return!0;for(let e of this.cells)if(e.size.outerWidth>t)return!1;return!0},f._getGapCells=function(e,t,i){let n=[];for(;e>0;){let r=this.cells[t];if(!r)break;n.push(r),t+=i,e-=r.size.outerWidth}return n},f._containSlides=function(){if(!this.options.contain||this.isWrapping||!this.cells.length)return;let e=this.slideableWidth-this.getLastCell().size[this.endMargin];if(e<this.size.innerWidth)this.slides.forEach(t=>{t.target=e*this.cellAlign});else{let t=this.cursorPosition+this.cells[0].size[this.beginMargin],i=e-this.size.innerWidth*(1-this.cellAlign);this.slides.forEach(e=>{e.target=Math.max(e.target,t),e.target=Math.min(e.target,i)})}},f.dispatchEvent=function(e,t,i){let n=t?[t].concat(i):i;if(this.emitEvent(e,n),c&&this.$element){let n=e+=this.options.namespaceJQueryEvents?".flickity":"";if(t){let i=new c.Event(t);i.type=e,n=i}this.$element.trigger(n,i)}};const m=["dragStart","dragMove","dragEnd","pointerDown","pointerMove","pointerEnd","staticClick"];let _=f.emitEvent;f.emitEvent=function(e,t){if("staticClick"===e){let e=this.getParentCell(t[0].target),i=e&&e.element,n=e&&this.cells.indexOf(e);t=t.concat(i,n)}if(_.call(this,e,t),!m.includes(e)||!c||!this.$element)return;e+=this.options.namespaceJQueryEvents?".flickity":"";let i=t.shift(0),n=new c.Event(i);n.type=e,this.$element.trigger(n,t)},f.select=function(e,t,i){if(!this.isActive)return;if(e=parseInt(e,10),this._wrapSelect(e),(this.isWrapping||t)&&(e=n.modulo(e,this.slides.length)),!this.slides[e])return;let r=this.selectedIndex;this.selectedIndex=e,this.updateSelectedSlide(),i?this.positionSliderAtSelected():this.startAnimation(),this.options.adaptiveHeight&&this.setGallerySize(),this.dispatchEvent("select",null,[e]),e!==r&&this.dispatchEvent("change",null,[e])},f._wrapSelect=function(e){if(!this.isWrapping)return;const{selectedIndex:t,slideableWidth:i,slides:{length:r}}=this;if(!this.isDragSelect){let i=n.modulo(e,r),o=Math.abs(i-t),s=Math.abs(i+r-t),a=Math.abs(i-r-t);s<o?e+=r:a<o&&(e-=r)}e<0?this.x-=i:e>=r&&(this.x+=i)},f.previous=function(e,t){this.select(this.selectedIndex-1,e,t)},f.next=function(e,t){this.select(this.selectedIndex+1,e,t)},f.updateSelectedSlide=function(){let e=this.slides[this.selectedIndex];e&&(this.unselectSelectedSlide(),this.selectedSlide=e,e.select(),this.selectedCells=e.cells,this.selectedElements=e.getCellElements(),this.selectedCell=e.cells[0],this.selectedElement=this.selectedElements[0])},f.unselectSelectedSlide=function(){this.selectedSlide&&this.selectedSlide.unselect()},f.selectInitialIndex=function(){let e=this.options.initialIndex;if(this.isInitActivated)return void this.select(this.selectedIndex,!1,!0);if(e&&"string"==typeof e&&this.queryCell(e))return void this.selectCell(e,!1,!0);let t=0;e&&this.slides[e]&&(t=e),this.select(t,!1,!0)},f.selectCell=function(e,t,i){let n=this.queryCell(e);if(!n)return;let r=this.getCellSlideIndex(n);this.select(r,t,i)},f.getCellSlideIndex=function(e){let t=this.slides.find(t=>t.cells.includes(e));return this.slides.indexOf(t)},f.getCell=function(e){for(let t of this.cells)if(t.element===e)return t},f.getCells=function(e){return(e=n.makeArray(e)).map(e=>this.getCell(e)).filter(Boolean)},f.getCellElements=function(){return this.cells.map(e=>e.element)},f.getParentCell=function(e){let t=this.getCell(e);if(t)return t;let i=e.closest(".flickity-slider > *");return this.getCell(i)},f.getAdjacentCellElements=function(e,t){if(!e)return this.selectedSlide.getCellElements();t=void 0===t?this.selectedIndex:t;let i=this.slides.length;if(1+2*e>=i)return this.getCellElements();let r=[];for(let o=t-e;o<=t+e;o++){let e=this.isWrapping?n.modulo(o,i):o,t=this.slides[e];t&&(r=r.concat(t.getCellElements()))}return r},f.queryCell=function(e){return"number"==typeof e?this.cells[e]:("string"==typeof e&&!e.match(/^[#.]?[\d/]/)&&(e=this.element.querySelector(e)),this.getCell(e))},f.uiChange=function(){this.emitEvent("uiChange")},f.onresize=function(){this.watchCSS(),this.resize()},n.debounceMethod(d,"onresize",150),f.resize=function(){if(!this.isActive||this.isAnimating||this.isDragging)return;this.getSize(),this.isWrapping&&(this.x=n.modulo(this.x,this.slideableWidth)),this.positionCells(),this._updateWrapShiftCells(),this.setGallerySize(),this.emitEvent("resize");let e=this.selectedElements&&this.selectedElements[0];this.selectCell(e,!1,!0)},f.watchCSS=function(){this.options.watchCSS&&(a(this.element,":after").content.includes("flickity")?this.activate():this.deactivate())},f.onkeydown=function(e){let{activeElement:t}=document,i=d.keyboardHandlers[e.key];this.options.accessibility&&t&&i&&this.focusableElems.some(e=>t===e)&&i.call(this)},d.keyboardHandlers={ArrowLeft:function(){this.uiChange(),this[this.options.rightToLeft?"next":"previous"]()},ArrowRight:function(){this.uiChange(),this[this.options.rightToLeft?"previous":"next"]()}}
2,f.focus=function(){this.element.focus({preventScroll:!0})},f.deactivate=function(){this.isActive&&(this.element.classList.remove("flickity-enabled"),this.element.classList.remove("flickity-rtl"),this.unselectSelectedSlide(),this.cells.forEach(e=>e.destroy()),this.viewport.remove(),this.element.append(...this.slider.children),this.options.accessibility&&(this.element.removeAttribute("tabIndex"),this.element.removeEventListener("keydown",this)),this.isActive=!1,this.emitEvent("deactivate"))},f.destroy=function(){this.deactivate(),e.removeEventListener("resize",this),this.allOff(),this.emitEvent("destroy"),c&&this.$element&&c.removeData(this.element,"flickity"),delete this.element.flickityGUID,delete h[this.guid]},Object.assign(f,s),d.data=function(e){if(e=n.getQueryElement(e))return h[e.flickityGUID]},n.htmlInit(d,"flickity");let{jQueryBridget:g}=e;return c&&g&&g("flickity",d,c),d.setJQuery=function(e){c=e},d.Cell=r,d.Slide=o,d})},4848:function(e,t,i){var n=i(5089),r=i(7574)("toStringTag"),o="Arguments"==n(function(){return arguments}());e.exports=function(e){var t,i,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),r))?i:o?n(t):"Object"==(s=n(t))&&"function"==typeof t.callee?"Arguments":s}},4877:function(e){e.exports=function(e,t,i){var n=void 0===i;switch(t.length){case 0:return n?e():e.call(i);case 1:return n?e(t[0]):e.call(i,t[0]);case 2:return n?e(t[0],t[1]):e.call(i,t[0],t[1]);case 3:return n?e(t[0],t[1],t[2]):e.call(i,t[0],t[1],t[2]);case 4:return n?e(t[0],t[1],t[2],t[3]):e.call(i,t[0],t[1],t[2],t[3])}return e.apply(i,t)}},4894:function(e,t,i){var n=i(2127);n(n.P,"String",{repeat:i(7926)})},4896:function(e,t,i){var n=i(2127);n(n.S,"Math",{clz32:function(e){return(e>>>=0)?31-Math.floor(Math.log(e+.5)*Math.LOG2E):32}})},4897:function(e,t,i){i(4614),e.exports=i(6094).Object.getOwnPropertyDescriptors},4913:function(e,t,i){"use strict";var n=i(2127),r=i(6179)(1);n(n.P+n.F*!i(6884)([].map,!0),"Array",{map:function(e){return r(this,e,arguments[1])}})},4925:function(e,t,i){i(7594),e.exports=i(6094).Object.values},4970:function(e){e.exports=function(e,t){return{value:t,done:!!e}}},5e3:function(e,t,i){var n=i(2127);n(n.S,"Reflect",{ownKeys:i(6222)})},5032:function(e,t,i){var n=i(3305);i(923)("isSealed",function(e){return function(t){return!n(t)||!!e&&e(t)}})},5049:function(e,t,i){var n=i(2127);n(n.P,"Function",{bind:i(5538)})},5052:function(e,t,i){var n=i(3387);e.exports=function(e,t,i){if(n(e),void 0===t)return e;switch(i){case 1:return function(i){return e.call(t,i)};case 2:return function(i,n){return e.call(t,i,n)};case 3:return function(i,n,r){return e.call(t,i,n,r)}}return function(){return e.apply(t,arguments)}}},5089:function(e){var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},5104:function(e,t,i){i(1124),e.exports=i(6438).global},5122:function(e,t,i){var n=i(5089);e.exports=function(e,t){if("number"!=typeof e&&"Number"!=n(e))throw TypeError(t);return+e}},5144:function(e,t,i){"use strict";var n=i(2127),r=i(6179)(5),o="find",s=!0;o in[]&&Array(1)[o](function(){s=!1}),n(n.P+n.F*s,"Array",{find:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}}),i(8184)(o)},5153:function(e,t,i){"use strict";var n=i(2127),r=i(4228),o=function(e){this._t=r(e),this._i=0;var t,i=this._k=[];for(t in e)i.push(t)};i(6032)(o,"Object",function(){var e,t=this,i=t._k;do{if(t._i>=i.length)return{value:void 0,done:!0}}while(!((e=i[t._i++])in t._t));return{value:e,done:!1}}),n(n.S,"Reflect",{enumerate:function(e){return new o(e)}})},5165:function(e,t,i){"use strict";var n=i(8184),r=i(4970),o=i(906),s=i(7221);e.exports=i(8175)(Array,"Array",function(e,t){this._t=s(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,i=this._i++;return!e||i>=e.length?(this._t=void 0,r(1)):r(0,"keys"==t?i:"values"==t?e[i]:[i,e[i]])},"values"),o.Arguments=o.Array,n("keys"),n("values"),n("entries")},5170:function(e,t,i){var n=i(3305),r=i(4228),o=function(e,t){if(r(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{(n=i(5052)(Function.call,i(8641).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,i){return o(e,i),t?e.__proto__=i:n(e,i),e}}({},!1):void 0),check:o}},5203:function(e,t,i){var n=i(7574)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(i){try{return t[n]=!1,!"/./"[e](t)}catch(e){}}return!0}},5219:function(e){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},5240:function(e,t,i){i(5693),e.exports=i(6094).String.padEnd},5307:function(e,t,i){!function(t,n){e.exports?e.exports=n(i(2522),i(977)):n(t.Flickity,t.fizzyUIUtils)}("undefined"!=typeof window?window:this,function(e,t){let i=e.Slide;i.prototype.renderFadePosition=function(){}
2,i.prototype.setOpacity=function(e){this.cells.forEach(t=>{t.element.style.opacity=e})},e.create.fade=function(){this.fadeIndex=this.selectedIndex,this.prevSelectedIndex=this.selectedIndex,this.on("select",this.onSelectFade),this.on("dragEnd",this.onDragEndFade),this.on("settle",this.onSettleFade),this.on("activate",this.onActivateFade),this.on("deactivate",this.onDeactivateFade)};let n=e.prototype,r=n.updateSlides;n.updateSlides=function(){r.apply(this,arguments),this.options.fade&&this.slides.forEach((e,t)=>{let i=e.target-e.x,n=e.cells[0].x;e.cells.forEach(e=>{let t=e.x-n-i;this._renderCellPosition(e,t)});let r=t===this.selectedIndex?1:0;e.setOpacity(r)})},n.onSelectFade=function(){this.fadeIndex=Math.min(this.prevSelectedIndex,this.slides.length-1),this.prevSelectedIndex=this.selectedIndex},n.onSettleFade=function(){delete this.didDragEnd,this.options.fade&&(this.selectedSlide.setOpacity(1),this.slides[this.fadeIndex]&&this.fadeIndex!==this.selectedIndex&&this.slides[this.fadeIndex].setOpacity(0))},n.onDragEndFade=function(){this.didDragEnd=!0},n.onActivateFade=function(){this.options.fade&&this.element.classList.add("is-fade")},n.onDeactivateFade=function(){this.options.fade&&(this.element.classList.remove("is-fade"),this.slides.forEach(e=>{e.setOpacity("")}))};let o=n.positionSlider;n.positionSlider=function(){this.options.fade?(this.fadeSlides(),this.dispatchScrollEvent()):o.apply(this,arguments)};let s=n.positionSliderAtSelected;n.positionSliderAtSelected=function(){this.options.fade&&this.setTranslateX(0),s.apply(this,arguments)},n.fadeSlides=function(){if(this.slides.length<2)return;let e=this.getFadeIndexes(),t=this.slides[e.a],i=this.slides[e.b],n=this.wrapDifference(t.target,i.target),r=this.wrapDifference(t.target,-this.x);r/=n,t.setOpacity(1-r),i.setOpacity(r);let o=e.a;this.isDragging&&(o=r>.5?e.a:e.b),void 0!==this.fadeHideIndex&&this.fadeHideIndex!==o&&this.fadeHideIndex!==e.a&&this.fadeHideIndex!==e.b&&this.slides[this.fadeHideIndex].setOpacity(0),this.fadeHideIndex=o},n.getFadeIndexes=function(){return this.isDragging||this.didDragEnd?this.options.wrapAround?this.getFadeDragWrapIndexes():this.getFadeDragLimitIndexes():{a:this.fadeIndex,b:this.selectedIndex}},n.getFadeDragWrapIndexes=function(){let e=this.slides.map(function(e,t){return this.getSlideDistance(-this.x,t)},this),i=e.map(function(e){return Math.abs(e)}),n=Math.min(...i),r=i.indexOf(n),o=e[r],s=this.slides.length,a=o>=0?1:-1;return{a:r,b:t.modulo(r+a,s)}},n.getFadeDragLimitIndexes=function(){let e=0;for(let t=0;t<this.slides.length-1;t++){let i=this.slides[t];if(-this.x<i.target)break;e=t}return{a:e,b:e+1}},n.wrapDifference=function(e,t){let i=t-e;if(!this.options.wrapAround)return i;let n=i+this.slideableWidth,r=i-this.slideableWidth;return Math.abs(n)<Math.abs(i)&&(i=n),Math.abs(r)<Math.abs(i)&&(i=r),i};let a=n._updateWrapShiftCells;n._updateWrapShiftCells=function(){this.options.fade?this.isWrapping=this.getIsWrapping():a.apply(this,arguments)};let l=n.shiftWrapCells;return n.shiftWrapCells=function(){this.options.fade||l.apply(this,arguments)},e})},5327:function(e,t,i){var n=i(2127),r=Math.imul;n(n.S+n.F*i(9448)(function(){return-5!=r(4294967295,5)||2!=r.length}),"Math",{imul:function(e,t){var i=65535,n=+e,r=+t,o=i&n,s=i&r;return 0|o*s+((i&n>>>16)*s+o*(i&r>>>16)<<16>>>0)}})},5369:function(e,t,i){"use strict";var n=i(2127),r=i(6179)(6),o="findIndex",s=!0;o in[]&&Array(1)[o](function(){s=!1}),n(n.P+n.F*s,"Array",{findIndex:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}}),i(8184)(o)},5380:function(e,t,i){"use strict";var n=i(2127),r=i(4472),o=i(4514),s=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);n(n.P+n.F*s,"String",{padStart:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0,!0)}})},5385:function(e,t,i){"use strict";var n=i(9448),r=Date.prototype.getTime,o=Date.prototype.toISOString,s=function(e){return e>9?e:"0"+e};e.exports=n(function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-50000000000001))})||!n(function(){o.call(new Date(NaN))})?function(){if(!isFinite(r.call(this)))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),i=e.getUTCMilliseconds(),n=t<0?"-":t>9999?"+":"";return n+("00000"+Math.abs(t)).slice(n?-6:-4)+"-"+s(e.getUTCMonth()+1)+"-"+s(e.getUTCDate())+"T"+s(e.getUTCHours())+":"+s(e.getUTCMinutes())+":"+s(e.getUTCSeconds())+"."+(i>99?i:"0"+s(i))+"Z"}:o},5392:function(e,t,i){var n=i(7526),r=i(6094),o=i(2750),s=i(7960),a=i(7967).f;e.exports=function(e){var t=r.Symbol||(r.Symbol=o?{}:n.Symbol||{});"_"==e.charAt(0)||e in t||a(t,e,{value:s.f(e)})}},5411:function(e,t,i){var n=i(3305),r=i(5089),o=i(7574)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==r(e))}},5417:function(e,t,i){var n=i(2127),r=i(2780);n(n.G+n.B,{setImmediate:r.set,clearImmediate:r.clear})},5433:function(e,t,i){var n=i(2127),r=i(4228),o=Object.isExtensible;n(n.S,"Reflect",{isExtensible:function(e){return r(e),!o||o(e)}})},5443:function(e,t,i){var n=i(7967),r=i(8641),o=i(627),s=i(7917),a=i(2127),l=i(1996),c=i(4228),u=i(3305);a(a.S,"Reflect",{set:function e(t,i,a){var h,d,f=arguments.length<4?t:
vendor: 4,759 bytes, line 2
2arguments[3],p=r.f(c(t),i);if(!p){if(u(d=o(t)))return e(d,i,a,f);p=l(0)}if(s(p,"value")){if(!1===p.writable||!u(f))return!1;if(h=r.f(f,i)){if(h.get||h.set||!1===h.writable)return!1;h.value=a,n.f(f,i,h)}else n.f(f,i,l(0,a));return!0}return void 0!==p.set&&(p.set.call(f,a),!0)}})},5502:function(e,t,i){"use strict";var n=i(3305),r=i(627),o=i(7574)("hasInstance"),s=Function.prototype;o in s||i(7967).f(s,o,{value:function(e){if("function"!=typeof this||!n(e))return!1;if(!n(this.prototype))return e instanceof this;for(;e=r(e);)if(this.prototype===e)return!0;return!1}})},5509:function(e){var t={}.hasOwnProperty;e.exports=function(e,i){return t.call(e,i)}},5538:function(e,t,i){"use strict";var n=i(3387),r=i(3305),o=i(4877),s=[].slice,a={};e.exports=Function.bind||function(e){var t=n(this),i=s.call(arguments,1),l=function(){var n=i.concat(s.call(arguments));return this instanceof l?function(e,t,i){if(!(t in a)){for(var n=[],r=0;r<t;r++)n[r]="a["+r+"]";a[t]=Function("F,a","return new F("+n.join(",")+")")}return a[t](e,i)}(t,n.length,n):o(t,n,e)};return r(t.prototype)&&(l.prototype=t.prototype),l}},5551:function(e){var t=Math.expm1;e.exports=!t||t(10)>22025.465794806718||t(10)<22025.465794806718||-2e-17!=t(-2e-17)?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:Math.exp(e)-1}:t},5564:function(e,t,i){"use strict";var n=i(8270),r=i(157),o=i(1485);e.exports=function(e){for(var t=n(this),i=o(t.length),s=arguments.length,a=r(s>1?arguments[1]:void 0,i),l=s>2?arguments[2]:void 0,c=void 0===l?i:r(l,i);c>a;)t[a++]=e;return t}},5572:function(e,t,i){var n=i(3305),r=i(2988).onFreeze;i(923)("preventExtensions",function(e){return function(t){return e&&n(t)?e(r(t)):t}})},5693:function(e,t,i){"use strict";var n=i(2127),r=i(4472),o=i(4514),s=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);n(n.P+n.F*s,"String",{padEnd:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0,!1)}})},5706:function(e,t,i){"use strict";var n=i(2127),r=i(237),o=i(8032),s=i(4228),a=i(157),l=i(1485),c=i(3305),u=i(7526).ArrayBuffer,h=i(9190),d=o.ArrayBuffer,f=o.DataView,p=r.ABV&&u.isView,m=d.prototype.slice,_=r.VIEW,g="ArrayBuffer";n(n.G+n.W+n.F*(u!==d),{ArrayBuffer:d}),n(n.S+n.F*!r.CONSTR,g,{isView:function(e){return p&&p(e)||c(e)&&_ in e}}),n(n.P+n.U+n.F*i(9448)(function(){return!new d(2).slice(1,void 0).byteLength}),g,{slice:function(e,t){if(void 0!==m&&void 0===t)return m.call(s(this),e);for(var i=s(this).byteLength,n=a(e,i),r=a(void 0===t?i:t,i),o=new(h(this,d))(l(r-n)),c=new f(this),u=new f(o),p=0;n<r;)u.setUint8(p++,c.getUint8(n++));return o}}),i(5762)(g)},5762:function(e,t,i){"use strict";var n=i(7526),r=i(7967),o=i(1763),s=i(7574)("species");e.exports=function(e){var t=n[e];o&&t&&!t[s]&&r.f(t,s,{configurable:!0,get:function(){return this}})}},5771:function(e,t,i){var n=i(2127),r=Math.asinh;n(n.S+n.F*!(r&&1/r(0)>0),"Math",{asinh:function e(t){return isFinite(t=+t)&&0!=t?t<0?-e(-t):Math.log(t+Math.sqrt(t*t+1)):t}})},5777:function(e,t,i){i(9766),e.exports=i(6094).Array.flatMap},5853:function(e,t,i){"use strict";var n=i(2127),r=i(1308),o=i(5089),s=i(157),a=i(1485),l=[].slice;n(n.P+n.F*i(9448)(function(){r&&l.call(r)}),"Array",{slice:function(e,t){var i=a(this.length),n=o(this);if(t=void 0===t?i:t,"Array"==n)return l.call(this,e,t);for(var r=s(e,i),c=s(t,i),u=a(c-r),h=new Array(u),d=0;d<u;d++)h[d]="String"==n?this.charAt(r+d):this[r+d];return h}})},5890:function(e,t,i){for(var n=i(5165),r=i(1311),o=i(8859),s=i(7526),a=i(3341),l=i(906),c=i(7574),u=c("iterator"),h=c("toStringTag"),d=l.Array,f={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},p=r(f),m=0;m<p.length;m++){var _,g=p[m],y=f[g],v=s[g],x=v&&v.prototype;if(x&&(x[u]||a(x,u,d),x[h]||a(x,h,g),l[g]=d,y))for(_ in n)x[_]||o(x,_,n[_],!0)}},5909:function(e,t,i){var n=i(2127);n(n.S,"Math",{log1p:i(1473)})},5932:function(e,t,i){var n=i(2127),r=i(4228),o=Object.preventExtensions;n(n.S,"Reflect",{preventExtensions:function(e){r(e);try{return o&&o(e),!0}catch(e){return!1}}})},5957:function(e,t,i){var n=i(4228),r=i(3305),o=i(4258);e.exports=function(e,t){if(n(e),r(t)&&t.constructor===e)return t;var i=o.f(e);return(0,i.resolve)(t),i.promise}},5969:function(e,t,i){var n=i(1311),r=i(1060),o=i(8449);e.exports=function(e){var t=n(e),i=r.f;if(i)for(var s,a=i(e),l=o.f,c=0;a.length>c;
2)l.call(e,s=a[c++])&&t.push(s);return t}},6032:function(e,t,i){"use strict";var n=i(4719),r=i(1996),o=i(3844),s={};i(3341)(s,i(7574)("iterator"),function(){return this}),e.exports=function(e,t,i){e.prototype=n(s,{next:r(1,i)}),o(e,t+" Iterator")}},6034:function(e,t,i){var n=i(3305),r=i(7526).document,o=n(r)&&n(r.createElement);e.exports=function(e){return o?r.createElement(e):{}}},6064:function(e,t,i){var n=i(2127);n(n.S+n.F*!i(1763),"Object",{defineProperty:i(7967).f})},6065:function(e,t,i){var n=i(8859);e.exports=function(e,t,i){for(var r in t)n(e,r,t[r],i);return e}},6073:function(e,t,i){i(521),e.exports=i(6094).String.trimRight},6094:function(e){var t=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=t)},6108:function(e,t,i){var n=i(2127),r=i(3589);n(n.G+n.F*(parseFloat!=r),{parseFloat:r})},6140:function(e){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},6179:function(e,t,i){var n=i(5052),r=i(1249),o=i(8270),s=i(1485),a=i(3191);e.exports=function(e,t){var i=1==e,l=2==e,c=3==e,u=4==e,h=6==e,d=5==e||h,f=t||a;return function(t,a,p){for(var m,_,g=o(t),y=r(g),v=n(a,p,3),x=s(y.length),b=0,w=i?f(t,x):l?f(t,0):void 0;x>b;b++)if((d||b in y)&&(_=v(m=y[b],b,g),e))if(i)w[b]=_;else if(_)switch(e){case 3:return!0;case 5:return m;case 6:return b;case 2:w.push(m)}else if(u)return!1;return h?-1:c||u?u:w}}},6197:function(e,t,i){"use strict";var n=i(7967).f,r=i(4719),o=i(6065),s=i(5052),a=i(6440),l=i(8790),c=i(8175),u=i(4970),h=i(5762),d=i(1763),f=i(2988).fastKey,p=i(2888),m=d?"_s":"size",_=function(e,t){var i,n=f(t);if("F"!==n)return e._i[n];for(i=e._f;i;i=i.n)if(i.k==t)return i};e.exports={getConstructor:function(e,t,i,c){var u=e(function(e,n){a(e,u,t,"_i"),e._t=t,e._i=r(null),e._f=void 0,e._l=void 0,e[m]=0,null!=n&&l(n,i,e[c],e)});return o(u.prototype,{clear:function(){for(var e=p(this,t),i=e._i,n=e._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete i[n.i];e._f=e._l=void 0,e[m]=0},delete:function(e){var i=p(this,t),n=_(i,e);if(n){var r=n.n,o=n.p;delete i._i[n.i],n.r=!0,o&&(o.n=r),r&&(r.p=o),i._f==n&&(i._f=r),i._l==n&&(i._l=o),i[m]--}return!!n},forEach:function(e){p(this,t);for(var i,n=s(e,arguments.length>1?arguments[1]:void 0,3);i=i?i.n:this._f;)for(n(i.v,i.k,this);i&&i.r;)i=i.p},has:function(e){return!!_(p(this,t),e)}}),d&&n(u.prototype,"size",{get:function(){return p(this,t)[m]}}),u},def:function(e,t,i){var n,r,o=_(e,t);return o?o.v=i:(e._l=o={i:r=f(t,!0),k:t,v:i,p:n=e._l,n:void 0,r:!1},e._f||(e._f=o),n&&(n.n=o),e[m]++,"F"!==r&&(e._i[r]=o)),e},getEntry:_,setStrong:function(e,t,i){c(e,t,function(e,i){this._t=p(e,t),this._k=i,this._l=void 0},function(){for(var e=this,t=e._k,i=e._l;i&&i.r;)i=i.p;return e._t&&(e._l=i=i?i.n:e._t._f)?u(0,"keys"==t?i.k:"values"==t?i.v:[i.k,i.v]):(e._t=void 0,u(1))},i?"entries":"values",!i,!0),h(t)}}},6209:function(e,t,i){i(5762)("Array")},6222:function(e,t,i){var n=i(9415),r=i(1060),o=i(4228),s=i(7526).Reflect;e.exports=s&&s.ownKeys||function(e){var t=n.f(o(e)),i=r.f;return i?t.concat(i(e)):t}},6260:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},6316:function(e,t,i){var n=i(2127),r=i(5170);r&&n(n.S,"Reflect",{setPrototypeOf:function(e,t){r.check(e,t);try{return r.set(e,t),!0}catch(e){return!1}}})},6377:function(e,t,i){!function(t,n){e.exports?e.exports=n(t,i(2137)):t.Unidragger=n(t,t.EvEmitter)}("undefined"!=typeof window?window:this,function(e,t){function i(){}let n,r,o=i.prototype=Object.create(t.prototype);o.handleEvent=function(e){let t="on"+e.type;this[t]&&this[t](e)},"ontouchstart"in e?(n="touchstart",r=["touchmove","touchend","touchcancel"]):e.PointerEvent?(n="pointerdown",r=["pointermove","pointerup","pointercancel"]):(n="mousedown",r=["mousemove","mouseup"]),o.touchActionValue="none",o.bindHandles=function(){this._bindHandles("addEventListener",this.touchActionValue)},o.unbindHandles=function(){this._bindHandles("removeEventListener","")},o._bindHandles=function(t,i){this.handles.forEach(r=>{r[t](n,this),r[t]("click",this),e.PointerEvent&&(r.style.touchAction=i)})},o.bindActivePointerEvents=function(){r.forEach(t=>{e.addEventListener(t,this)})},o.unbindActivePointerEvents=function(){r.forEach(t=>{e.removeEventListener(t,this)})},o.withPointer=function(e,t){t.pointerId===this.pointerIdentifier&&this[e](t,t)},o.withTouch=function(e,t){let i;for(let e of t.changedTouches)e.identifier===this.pointerIdentifier&&(i=e);i&&this[e](t,i)},o.onmousedown=function(e){this.pointerDown(e,e)},o.ontouchstart=function(e){this.pointerDown(e,e.changedTouches[0])},o.onpointerdown=function(e){this.pointerDown(e,e)};const s=["TEXTAREA","INPUT","SELECT","OPTION"],a=["radio","checkbox","button","submit","image","file"];return o.pointerDown=function(e,t){let i=s.includes(e.target.nodeName),n=a.includes(e.target.type),r=!i||n;!this.isPointerDown&&!e.button&&r&&(this.isPointerDown=!0,this.pointerIdentifier=void 0!==t.pointerId?t.pointerId:t.identifier,this.pointerDownPointer={pageX:t.pageX,pageY:t.pageY},this.bindActivePointerEvents(),this.emitEvent("pointerDown",[e,t]))},o.onmousemove=function(e){this.pointerMove(e,e)},o.onpointermove=function(e){this.withPointer("pointerMove",e)},o.ontouchmove=function(e){this.withTouch("pointerMove",e)},o.pointerMove=function(e,t){let i={x:t.pageX-this.pointerDownPointer.pageX,y:t.pageY-this.pointerDownPointer.pageY};this.emitEvent("pointerMove",[e,t,i]),!this.isDragging&&this.hasDragStarted(i)&&this.dragStart(e,t),this.isDragging&&this.dragMove(e,t,i)},o.hasDragStarted=function(e){return Math.abs(e.x)>3||Math.abs(e.y)>3}
vendor: 9,785 bytes, line 2
2,o.dragStart=function(e,t){this.isDragging=!0,this.isPreventingClicks=!0,this.emitEvent("dragStart",[e,t])},o.dragMove=function(e,t,i){this.emitEvent("dragMove",[e,t,i])},o.onmouseup=function(e){this.pointerUp(e,e)},o.onpointerup=function(e){this.withPointer("pointerUp",e)},o.ontouchend=function(e){this.withTouch("pointerUp",e)},o.pointerUp=function(e,t){this.pointerDone(),this.emitEvent("pointerUp",[e,t]),this.isDragging?this.dragEnd(e,t):this.staticClick(e,t)},o.dragEnd=function(e,t){this.isDragging=!1,setTimeout(()=>delete this.isPreventingClicks),this.emitEvent("dragEnd",[e,t])},o.pointerDone=function(){this.isPointerDown=!1,delete this.pointerIdentifier,this.unbindActivePointerEvents(),this.emitEvent("pointerDone")},o.onpointercancel=function(e){this.withPointer("pointerCancel",e)},o.ontouchcancel=function(e){this.withTouch("pointerCancel",e)},o.pointerCancel=function(e,t){this.pointerDone(),this.emitEvent("pointerCancel",[e,t])},o.onclick=function(e){this.isPreventingClicks&&e.preventDefault()},o.staticClick=function(e,t){let i="mouseup"===e.type;i&&this.isIgnoringMouseUp||(this.emitEvent("staticClick",[e,t]),i&&(this.isIgnoringMouseUp=!0,setTimeout(()=>{delete this.isIgnoringMouseUp},400)))},i})},6438:function(e){var t=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=t)},6440:function(e){e.exports=function(e,t,i,n){if(!(e instanceof t)||void 0!==n&&n in e)throw TypeError(i+": incorrect invocation!");return e}},6511:function(e,t,i){"use strict";var n=i(2127),r=i(7221),o=[].join;n(n.P+n.F*(i(1249)!=Object||!i(6884)(o)),"Array",{join:function(e){return o.call(r(this),void 0===e?",":e)}})},6517:function(e,t,i){"use strict";var n,r,o,s,a=i(2750),l=i(7526),c=i(5052),u=i(4848),h=i(2127),d=i(3305),f=i(3387),p=i(6440),m=i(8790),_=i(9190),g=i(2780).set,y=i(1384)(),v=i(4258),x=i(128),b=i(4514),w=i(5957),T="Promise",S=l.TypeError,E=l.process,I=E&&E.versions,A=I&&I.v8||"",M=l[T],C="process"==u(E),P=function(){},D=r=v.f,R=!!function(){try{var e=M.resolve(1),t=(e.constructor={})[i(7574)("species")]=function(e){e(P,P)};return(C||"function"==typeof PromiseRejectionEvent)&&e.then(P)instanceof t&&0!==A.indexOf("6.6")&&-1===b.indexOf("Chrome/66")}catch(e){}}(),L=function(e){var t;return!(!d(e)||"function"!=typeof(t=e.then))&&t},z=function(e,t){if(!e._n){e._n=!0;var i=e._c;y(function(){for(var n=e._v,r=1==e._s,o=0,s=function(t){var i,o,s,a=r?t.ok:t.fail,l=t.resolve,c=t.reject,u=t.domain;try{a?(r||(2==e._h&&k(e),e._h=1),!0===a?i=n:(u&&u.enter(),i=a(n),u&&(u.exit(),s=!0)),i===t.promise?c(S("Promise-chain cycle")):(o=L(i))?o.call(i,l,c):l(i)):c(n)}catch(e){u&&!s&&u.exit(),c(e)}};i.length>o;)s(i[o++]);e._c=[],e._n=!1,t&&!e._h&&O(e)})}},O=function(e){g.call(l,function(){var t,i,n,r=e._v,o=F(e);if(o&&(t=x(function(){C?E.emit("unhandledRejection",r,e):(i=l.onunhandledrejection)?i({promise:e,reason:r}):(n=l.console)&&n.error&&n.error("Unhandled promise rejection",r)}),e._h=C||F(e)?2:1),e._a=void 0,o&&t.e)throw t.v})},F=function(e){return 1!==e._h&&0===(e._a||e._c).length},k=function(e){g.call(l,function(){var t;C?E.emit("rejectionHandled",e):(t=l.onrejectionhandled)&&t({promise:e,reason:e._v})})},B=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),z(t,!0))},N=function(e){var t,i=this;if(!i._d){i._d=!0,i=i._w||i;try{if(i===e)throw S("Promise can't be resolved itself");(t=L(e))?y(function(){var n={_w:i,_d:!1};try{t.call(e,c(N,n,1),c(B,n,1))}catch(e){B.call(n,e)}}):(i._v=e,i._s=1,z(i,!1))}catch(e){B.call({_w:i,_d:!1},e)}}};R||(M=function(e){p(this,M,T,"_h"),f(e),n.call(this);try{e(c(N,this,1),c(B,this,1))}catch(e){B.call(this,e)}},(n=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=i(6065)(M.prototype,{then:function(e,t){var i=D(_(this,M));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=C?E.domain:void 0,this._c.push(i),this._a&&this._a.push(i),this._s&&z(this,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new n;this.promise=e,this.resolve=c(N,e,1),this.reject=c(B,e,1)},v.f=D=function(e){return e===M||e===s?new o(e):r(e)}),h(h.G+h.W+h.F*!R,{Promise:M}),i(3844)(M,T),i(5762)(T),s=i(6094)[T],h(h.S+h.F*!R,T,{reject:function(e){var t=D(this);return(0,t.reject)(e),t.promise}}),h(h.S+h.F*(a||!R),T,{resolve:function(e){return w(a&&this===s?M:this,e)}}),h(h.S+h.F*!(R&&i(8931)(function(e){M.all(e).catch(P)})),T,{all:function(e){var t=this,i=D(t),n=i.resolve,r=i.reject,o=x(function(){var i=[],o=0,s=1;m(e,!1,function(e){var a=o++,l=!1;i.push(void 0),s++,t.resolve(e).then(function(e){l||(l=!0,i[a]=e,--s||n(i))},r)}),--s||n(i)});return o.e&&r(o.v),i.promise},race:function(e){var t=this,i=D(t),n=i.reject,r=x(function(){m(e,!1,function(e){t.resolve(e).then(i.resolve,n)})});return r.e&&n(r.v),i.promise}})},6543:function(e,t,i){var n=i(3387),r=i(8270),o=i(1249),s=i(1485);e.exports=function(e,t,i,a,l){n(t);var c=r(e),u=o(c),h=s(c.length),d=l?h-1:0,f=l?-1:1;if(i<2)for(;;){if(d in u){a=u[d],d+=f;break}if(d+=f,l?d<0:h<=d)throw TypeError("Reduce of empty array with no initial value")}for(;l?d>=0:h>d;d+=f)d in u&&(a=t(a,u[d],d,c));return a}},6549:function(e,t,i){"use strict";i(2468)("link",function(e){return function(t){return e(this,"a","href",t)}})},6576:function(e,t,i){var n=i(2127);n(n.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},6592:function(e,t,i){var n=i(2127);n(n.S,"Math",{trunc:function(e){return(e>0?Math.floor:Math.ceil)(e)}})},6648:function(e,t,i){var n=i(2127),r=i(1473),o=Math.sqrt,s=Math.acosh;n(n.S+n.F*!(s&&710==Math.floor(s(Number.MAX_VALUE))&&s(1/0)==1/0),"Math",{acosh:function(e){return(e=+e)<1?NaN:e>94906265.62425156?Math.log(e)+Math.LN2:r(e-1+o(e-1)*o(e+1))}})},6670:function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},6701:function(e,t,i){"use strict";var n=i(2127),r=i(9448),o=i(5122),s=1..toPrecision;n(n.P+n.F*(r(function(){return"1"!==s.call(1,void 0)})||!r(function(){s.call({})})),"Number",{toPrecision:function(e){var t=o(this,"Number#toPrecision: incorrect invocation!");return void 0===e?s.call(t):s.call(t,e)}})},6884:function(e,t,i){"use strict";var n=i(9448);e.exports=function(e,t){return!!e&&n(function(){t?e.call(null,function(){},1):e.call(null)})}},7067:function(e,t,i){var n=i(2127);n(n.S+n.F*!i(1763),"Object",{defineProperties:i(1626)})},7075:function(e,t,i){"use strict";var n=i(2127),r=i(3387),o=i(8270),s=i(9448),a=[].sort,l=[1,2,3];n(n.P+n.F*(s(function(){l.sort(void 0)})||!s(function(){l.sort(null)})||!i(6884)(a)),"Array",{sort:function(e){return void 0===e?a.call(o(this)):a.call(o(this),r(e))}})},7083:function(e,t,i){"use strict";i(2468)("fixed",function(e){return function(){return e(this,"tt","","")}})},7087:function(e){var t=Math.ceil,i=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?i:t)(e)}},7103:function(e,t,i){var n=i(2127),r=i(3387),o=i(4228),s=(i(7526).Reflect||{}).apply,a=Function.apply;n(n.S+n.F*!i(9448)(function(){s(function(){})}),"Reflect",{apply:function(e,t,i){var n=r(e),l=o(i);return s?s(n,t,l):a.call(n,t,l)}})},7146:function(e,t,i){var n=i(2127),r=i(3854)(!0);n(n.S,"Object",{entries:function(e){return r(e)}})},7209:function(e,t,i){"use strict";if(i(1763)){var n=i(2750),r=i(7526),o=i(9448),s=i(2127),a=i(237),l=i(8032),c=i(5052),u=i(6440),h=i(1996),d=i(3341),f=i(6065),p=i(7087),m=i(1485),_=i(3133),g=i(157),y=i(3048),v=i(7917),x=i(4848),b=i(3305),w=i(8270),T=i(1508),S=i(4719),E=i(627),I=i(9415).f,A=i(762),M=i(4415),C=i(7574),P=i(6179),D=i(1464),R=i(9190),L=i(5165),z=i(906),O=i(8931),F=i(5762),k=i(5564),B=i(4438),N=i(7967),V=i(8641),U=N.f,j=V.f,G=r.RangeError,q=r.TypeError,H=r.Uint8Array,$="ArrayBuffer",W="Shared"+$,Z="BYTES_PER_ELEMENT",X="prototype",Y=Array[X],K=l.ArrayBuffer,J=l.DataView,Q=P(0),ee=P(2),te=P(3),ie=P(4),ne=P(5),re=P(6),oe=D(!0),se=D(!1),ae=L.values,le=L.keys,ce=L.entries,ue=Y.lastIndexOf,he=Y.reduce,de=Y.reduceRight,fe=Y.join,pe=Y.sort,me=Y.slice,_e=Y.toString,ge=Y.toLocaleString,ye=C("iterator"),ve=C("toStringTag"),xe=M("typed_constructor"),be=M("def_constructor"),we=a.CONSTR,Te=a.TYPED,Se=a.VIEW,Ee="Wrong length!",Ie=P(1,function(e,t){return De(R(e,e[be]),t)}),Ae=o(function(){return 1===new H(new Uint16Array([1]).buffer)[0]}),Me=!!H&&!!H[X].set&&o(function(){new H(1).set({})}),Ce=function(e,t){var i=p(e);if(i<0||i%t)throw G("Wrong offset!");return i},Pe=function(e){if(b(e)&&Te in e)return e;throw q(e+" is not a typed array!")},De=function(e,t){if(!b(e)||!(xe in e))throw q("It is not a typed array constructor!");return new e(t)},Re=function(e,t){return Le(R(e,e[be]),t)},Le=function(e,t){for(var i=0,n=t.length,r=De(e,n);n>i;)r[i]=t[i++];return r},ze=function(e,t,i){U(e,t,{get:function(){return this._d[i]}})},Oe=function(e){var t,i,n,r,o,s,a=w(e),l=arguments.length,u=l>1?arguments[1]:void 0,h=void 0!==u,d=A(a);if(null!=d&&!T(d)){for(s=d.call(a),n=[],t=0;!(o=s.next()).done;t++)n.push(o.value);a=n}for(h&&l>2&&(u=c(u,arguments[2],2)),t=0,i=m(a.length),r=De(this,i);i>t;t++)r[t]=h?u(a[t],t):a[t];return r},Fe=function(){for(var e=0,t=arguments.length,i=De(this,t);t>e;)i[e]=arguments[e++];return i},ke=!!H&&o(function(){ge.call(new H(1))}),Be=function(){return ge.apply(ke?me.call(Pe(this)):Pe(this),arguments)},Ne={copyWithin:function(e,t){return B.call(Pe(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return ie(Pe(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return k.apply(Pe(this),arguments)},filter:function(e){return Re(this,ee(Pe(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return ne(Pe(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return re(Pe(this),e,arguments.length>1?arguments[1]:void 0)}
vendor: 1,361 bytes, line 2
2,forEach:function(e){Q(Pe(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return se(Pe(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return oe(Pe(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return fe.apply(Pe(this),arguments)},lastIndexOf:function(e){return ue.apply(Pe(this),arguments)},map:function(e){return Ie(Pe(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return he.apply(Pe(this),arguments)},reduceRight:function(e){return de.apply(Pe(this),arguments)},reverse:function(){for(var e,t=this,i=Pe(t).length,n=Math.floor(i/2),r=0;r<n;)e=t[r],t[r++]=t[--i],t[i]=e;return t},some:function(e){return te(Pe(this),e,arguments.length>1?arguments[1]:void 0)},sort:function(e){return pe.call(Pe(this),e)},subarray:function(e,t){var i=Pe(this),n=i.length,r=g(e,n);return new(R(i,i[be]))(i.buffer,i.byteOffset+r*i.BYTES_PER_ELEMENT,m((void 0===t?n:g(t,n))-r))}},Ve=function(e,t){return Re(this,me.call(Pe(this),e,t))},Ue=function(e){Pe(this);var t=Ce(arguments[1],1),i=this.length,n=w(e),r=m(n.length),o=0;if(r+t>i)throw G(Ee);for(;o<r;)this[t+o]=n[o++]},je={entries:function(){return ce.call(Pe(this))},keys:function(){return le.call(Pe(this))},values:function(){return ae.call(Pe(this))}},Ge=function(e,t){return b(e)&&e[Te]&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)}
vendor: 10,488 bytes, line 2
2,qe=function(e,t){return Ge(e,t=y(t,!0))?h(2,e[t]):j(e,t)},He=function(e,t,i){return!(Ge(e,t=y(t,!0))&&b(i)&&v(i,"value"))||v(i,"get")||v(i,"set")||i.configurable||v(i,"writable")&&!i.writable||v(i,"enumerable")&&!i.enumerable?U(e,t,i):(e[t]=i.value,e)};we||(V.f=qe,N.f=He),s(s.S+s.F*!we,"Object",{getOwnPropertyDescriptor:qe,defineProperty:He}),o(function(){_e.call({})})&&(_e=ge=function(){return fe.call(this)});var $e=f({},Ne);f($e,je),d($e,ye,je.values),f($e,{slice:Ve,set:Ue,constructor:function(){},toString:_e,toLocaleString:Be}),ze($e,"buffer","b"),ze($e,"byteOffset","o"),ze($e,"byteLength","l"),ze($e,"length","e"),U($e,ve,{get:function(){return this[Te]}}),e.exports=function(e,t,i,l){var c=e+((l=!!l)?"Clamped":"")+"Array",h="get"+e,f="set"+e,p=r[c],g=p||{},y=p&&E(p),v=!p||!a.ABV,w={},T=p&&p[X],A=function(e,i){U(e,i,{get:function(){return function(e,i){var n=e._d;return n.v[h](i*t+n.o,Ae)}(this,i)},set:function(e){return function(e,i,n){var r=e._d;l&&(n=(n=Math.round(n))<0?0:n>255?255:255&n),r.v[f](i*t+r.o,n,Ae)}(this,i,e)},enumerable:!0})};v?(p=i(function(e,i,n,r){u(e,p,c,"_d");var o,s,a,l,h=0,f=0;if(b(i)){if(!(i instanceof K||(l=x(i))==$||l==W))return Te in i?Le(p,i):Oe.call(p,i);o=i,f=Ce(n,t);var g=i.byteLength;if(void 0===r){if(g%t)throw G(Ee);if((s=g-f)<0)throw G(Ee)}else if((s=m(r)*t)+f>g)throw G(Ee);a=s/t}else a=_(i),o=new K(s=a*t);for(d(e,"_d",{b:o,o:f,l:s,e:a,v:new J(o)});h<a;)A(e,h++)}),T=p[X]=S($e),d(T,"constructor",p)):o(function(){p(1)})&&o(function(){new p(-1)})&&O(function(e){new p,new p(null),new p(1.5),new p(e)},!0)||(p=i(function(e,i,n,r){var o;return u(e,p,c),b(i)?i instanceof K||(o=x(i))==$||o==W?void 0!==r?new g(i,Ce(n,t),r):void 0!==n?new g(i,Ce(n,t)):new g(i):Te in i?Le(p,i):Oe.call(p,i):new g(_(i))}),Q(y!==Function.prototype?I(g).concat(I(y)):I(g),function(e){e in p||d(p,e,g[e])}),p[X]=T,n||(T.constructor=p));var M=T[ye],C=!!M&&("values"==M.name||null==M.name),P=je.values;d(p,xe,!0),d(T,Te,c),d(T,Se,!0),d(T,be,p),(l?new p(1)[ve]==c:ve in T)||U(T,ve,{get:function(){return c}}),w[c]=p,s(s.G+s.W+s.F*(p!=g),w),s(s.S,c,{BYTES_PER_ELEMENT:t}),s(s.S+s.F*o(function(){g.of.call(p,1)}),c,{from:Oe,of:Fe}),Z in T||d(T,Z,t),s(s.P,c,Ne),F(c),s(s.P+s.F*Me,c,{set:Ue}),s(s.P+s.F*!C,c,je),n||T.toString==_e||(T.toString=_e),s(s.P+s.F*o(function(){new p(1).slice()}),c,{slice:Ve}),s(s.P+s.F*(o(function(){return[1,2].toLocaleString()!=new p([1,2]).toLocaleString()})||!o(function(){T.toLocaleString.call([1,2])})),c,{toLocaleString:Be}),z[c]=C?M:P,n||C||d(T,ye,P)}}else e.exports=function(){}},7221:function(e,t,i){var n=i(1249),r=i(3344);e.exports=function(e){return n(r(e))}},7224:function(e,t,i){"use strict";var n=i(2127),r=i(1485),o=i(8942),s="endsWith",a=""[s];n(n.P+n.F*i(5203)(s),"String",{endsWith:function(e){var t=o(this,e,s),i=arguments.length>1?arguments[1]:void 0,n=r(t.length),l=void 0===i?n:Math.min(r(i),n),c=String(e);return a?a.call(t,c,l):t.slice(l-c.length,l)===c}})},7227:function(e,t,i){"use strict";var n=i(7967),r=i(1996);e.exports=function(e,t,i){t in e?n.f(e,t,r(0,i)):e[t]=i}},7334:function(e,t,i){"use strict";i(2468)("bold",function(e){return function(){return e(this,"b","","")}})},7359:function(e){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},7360:function(e,t,i){"use strict";i(2468)("anchor",function(e){return function(t){return e(this,"a","name",t)}})},7368:function(e,t,i){var n=i(4228);e.exports=function(e,t,i,r){try{return r?t(n(i)[0],i[1]):t(i)}catch(t){var o=e.return;throw void 0!==o&&n(o.call(e)),t}}},7452:function(e){var t=function(e){"use strict";var t,i=Object.prototype,n=i.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",s=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function l(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,i){return e[t]=i}}function c(e,t,i,n){var r=t&&t.prototype instanceof _?t:_,o=Object.create(r.prototype),s=new M(n||[]);return o._invoke=function(e,t,i){var n=h;return function(r,o){if(n===f)throw new Error("Generator is already running");if(n===p){if("throw"===r)throw o;return P()}for(i.method=r,i.arg=o;;){var s=i.delegate;if(s){var a=E(s,i);if(a){if(a===m)continue;return a}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(n===h)throw n=p,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n=f;var l=u(e,t,i);if("normal"===l.type){if(n=i.done?p:d,l.arg===m)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(n=p,i.method="throw",i.arg=l.arg)}}}(e,i,s),o}function u(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",f="executing",p="completed",m={};function _(){}function g(){}function y(){}var v={};l(v,o,function(){return this});var x=Object.getPrototypeOf,b=x&&x(x(C([])));b&&b!==i&&n.call(b,o)&&(v=b);var w=y.prototype=_.prototype=Object.create(v);function T(e){["next","throw","return"].forEach(function(t){l(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){function i(r,o,s,a){var l=u(e[r],e,o);if("throw"!==l.type){var c=l.arg,h=c.value;return h&&"object"==typeof h&&n.call(h,"__await")?t.resolve(h.__await).then(function(e){i("next",e,s,a)},function(e){i("throw",e,s,a)}):t.resolve(h).then(function(e){c.value=e,s(c)},function(e){return i("throw",e,s,a)})}a(l.arg)}var r;this._invoke=function(e,n){function o(){return new t(function(t,r){i(e,n,t,r)})}return r=r?r.then(o,o):o()}}function E(e,i){var n=e.iterator[i.method];if(n===t){if(i.delegate=null,"throw"===i.method){if(e.iterator.return&&(i.method="return",i.arg=t,E(e,i),"throw"===i.method))return m;i.method="throw",i.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var r=u(n,e.iterator,i.arg);if("throw"===r.type)return i.method="throw",i.arg=r.arg,i.delegate=null,m;var o=r.arg;return o?o.done?(i[e.resultName]=o.value,i.next=e.nextLoc,"return"!==i.method&&(i.method="next",i.arg=t),i.delegate=null,m):o:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,m)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function C(e){if(e){var i=e[o];if(i)return i.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,s=function i(){for(;++r<e.length;)if(n.call(e,r))return i.value=e[r],i.done=!1,i;return i.value=t,i.done=!0,i};return s.next=s}}return{next:P}}function P(){return{value:t,done:!0}}return g.prototype=y,l(w,"constructor",y),l(y,"constructor",g),g.displayName=l(y,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,l(e,a,"GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},T(S.prototype),l(S.prototype,s,function(){return this}),e.AsyncIterator=S,e.async=function(t,i,n,r,o){void 0===o&&(o=Promise);var s=new S(c(t,i,n,r),o);return e.isGeneratorFunction(i)?s:s.next().then(function(e){return e.done?e.value:s.next()})},T(w),l(w,a,"Generator"),l(w,o,function(){return this}),l(w,"toString",function(){return"[object Generator]"}),e.keys=function(e){var t=[];for(var i in e)t.push(i);return t.reverse(),function i(){for(;t.length;){var n=t.pop();if(n in e)return i.value=n,i.done=!1,i}return i.done=!0,i}},e.values=C,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var i in this)"t"===i.charAt(0)&&n.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var i=this;function r(n,r){return a.type="throw",a.arg=e,i.next=n,r&&(i.method="next",i.arg=t),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var l=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(l&&c){if(this.prev<s.catchLoc)return r(s.catchLoc,!0);if(this.prev<s.finallyLoc)return r(s.finallyLoc)}else if(l){if(this.prev<s.catchLoc)return r(s.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return r(s.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),A(i),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var r=n.arg;A(i)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,i,n){return this.delegate={iterator:C(e),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},7482:function(e,t,i){"use strict";var n=i(4848),r={};r[i(7574)("toStringTag")]="z",r+""!="[object z]"&&i(8859)(Object.prototype,"toString",function(){return"[object "+n(this)+"]"},!0)},7509:function(e,t,i){var n=i(2127);n(n.S,"Math",{log10:function(e){return Math.log(e)*Math.LOG10E}})},7526:function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)}
2,7574:function(e,t,i){var n=i(4556)("wks"),r=i(4415),o=i(7526).Symbol,s="function"==typeof o;(e.exports=function(e){return n[e]||(n[e]=s&&o[e]||(s?o:r)("Symbol."+e))}).store=n},7594:function(e,t,i){var n=i(2127),r=i(3854)(!1);n(n.S,"Object",{values:function(e){return r(e)}})},7727:function(e,t,i){"use strict";var n=i(2127),r=i(7087),o=i(5122),s=i(7926),a=1..toFixed,l=Math.floor,c=[0,0,0,0,0,0],u="Number.toFixed: incorrect invocation!",h="0",d=function(e,t){for(var i=-1,n=t;++i<6;)n+=e*c[i],c[i]=n%1e7,n=l(n/1e7)},f=function(e){for(var t=6,i=0;--t>=0;)i+=c[t],c[t]=l(i/e),i=i%e*1e7},p=function(){for(var e=6,t="";--e>=0;)if(""!==t||0===e||0!==c[e]){var i=String(c[e]);t=""===t?i:t+s.call(h,7-i.length)+i}return t},m=function(e,t,i){return 0===t?i:t%2==1?m(e,t-1,i*e):m(e*e,t/2,i)};n(n.P+n.F*(!!a&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!i(9448)(function(){a.call({})})),"Number",{toFixed:function(e){var t,i,n,a,l=o(this,u),c=r(e),_="",g=h;if(c<0||c>20)throw RangeError(u);if(l!=l)return"NaN";if(l<=-1e21||l>=1e21)return String(l);if(l<0&&(_="-",l=-l),l>1e-21)if(t=function(e){for(var t=0,i=e;i>=4096;)t+=12,i/=4096;for(;i>=2;)t+=1,i/=2;return t}(l*m(2,69,1))-69,i=t<0?l*m(2,-t,1):l/m(2,t,1),i*=4503599627370496,(t=52-t)>0){for(d(0,i),n=c;n>=7;)d(1e7,0),n-=7;for(d(m(10,n,1),0),n=t-1;n>=23;)f(1<<23),n-=23;f(1<<n),d(1,1),f(2),g=p()}else d(0,i),d(1<<-t,0),g=p()+s.call(h,c);return c>0?_+((a=g.length)<=c?"0."+s.call(h,c-a)+g:g.slice(0,a-c)+"."+g.slice(a-c)):_+g}})},7728:function(e,t,i){!function(t,n){e.exports?e.exports=n(i(4831),i(977)):n(t.Flickity,t.fizzyUIUtils)}("undefined"!=typeof window?window:this,function(e,t){function i(){this.holder=document.createElement("div"),this.holder.className="flickity-page-dots",this.dots=[]}i.prototype.setDots=function(e){let t=e-this.dots.length;t>0?this.addDots(t):t<0&&this.removeDots(-t)},i.prototype.addDots=function(e){let t=new Array(e).fill().map((e,t)=>{let i=document.createElement("button");i.setAttribute("type","button");let n=t+1+this.dots.length;return i.className="flickity-page-dot",i.textContent=`View slide ${n}`,i});this.holder.append(...t),this.dots=this.dots.concat(t)},i.prototype.removeDots=function(e){this.dots.splice(this.dots.length-e,e).forEach(e=>e.remove())},i.prototype.updateSelected=function(e){this.selectedDot&&(this.selectedDot.classList.remove("is-selected"),this.selectedDot.removeAttribute("aria-current")),this.dots.length&&(this.selectedDot=this.dots[e],this.selectedDot.classList.add("is-selected"),this.selectedDot.setAttribute("aria-current","step"))},e.PageDots=i,Object.assign(e.defaults,{pageDots:!0}),e.create.pageDots=function(){this.options.pageDots&&(this.pageDots=new i,this.handlePageDotsClick=this.onPageDotsClick.bind(this),this.on("activate",this.activatePageDots),this.on("select",this.updateSelectedPageDots),this.on("cellChange",this.updatePageDots),this.on("resize",this.updatePageDots),this.on("deactivate",this.deactivatePageDots))};let n=e.prototype;return n.activatePageDots=function(){this.pageDots.setDots(this.slides.length),this.focusableElems.push(...this.pageDots.dots),this.pageDots.holder.addEventListener("click",this.handlePageDotsClick),this.element.append(this.pageDots.holder)},n.onPageDotsClick=function(e){let t=this.pageDots.dots.indexOf(e.target);-1!==t&&(this.uiChange(),this.select(t))},n.updateSelectedPageDots=function(){this.pageDots.updateSelected(this.selectedIndex)},n.updatePageDots=function(){this.pageDots.dots.forEach(e=>{t.removeFrom(this.focusableElems,e)}),this.pageDots.setDots(this.slides.length),this.focusableElems.push(...this.pageDots.dots)},n.deactivatePageDots=function(){this.pageDots.holder.remove(),this.pageDots.holder.removeEventListener("click",this.handlePageDotsClick)},e.PageDots=i,e})},7739:function(e,t,i){i(2820),e.exports=i(7960).f("asyncIterator")},7762:function(e,t,i){var n=i(2127);n(n.P,"Array",{fill:i(5564)}),i(8184)("fill")},7824:function(e,t,i){!function(t,n){e.exports?e.exports=n(i(4831)):n(t.Flickity)}("undefined"!=typeof window?window:this,function(e){const t="http://www.w3.org/2000/svg";function i(e,t,i){this.increment=e,this.direction=t,this.isPrevious="previous"===e,this.isLeft="left"===t,this._create(i)}i.prototype._create=function(e){let t=this.element=document.createElement("button");t.className=`flickity-button flickity-prev-next-button ${this.increment}`;let i=this.isPrevious?"Previous":"Next";t.setAttribute("type","button"),t.setAttribute("aria-label",i),this.disable();let n=this.createSVG(i,e);t.append(n)},i.prototype.createSVG=function(e,i){let n=document.createElementNS(t,"svg");n.setAttribute("class","flickity-button-icon"),n.setAttribute("viewBox","0 0 100 100");let r=document.createElementNS(t,"title");r.append(e);let o=document.createElementNS(t,"path"),s=function(e){if("string"==typeof e)return e;let{x0:t,x1:i,x2:n,x3:r,y1:o,y2:s}=e;return`M ${t}, 50\n    L ${i}, ${o+50}\n    L ${n}, ${s+50}\n    L ${r}, 50\n    L ${n}, ${50-s}\n    L ${i}, ${50-o}\n    Z`}(i);
2return o.setAttribute("d",s),o.setAttribute("class","arrow"),this.isLeft||o.setAttribute("transform","translate(100, 100) rotate(180)"),n.append(r,o),n},i.prototype.enable=function(){this.element.removeAttribute("disabled")},i.prototype.disable=function(){this.element.setAttribute("disabled",!0)},Object.assign(e.defaults,{prevNextButtons:!0,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}}),e.create.prevNextButtons=function(){if(!this.options.prevNextButtons)return;let{rightToLeft:e,arrowShape:t}=this.options,n=e?"right":"left",r=e?"left":"right";this.prevButton=new i("previous",n,t),this.nextButton=new i("next",r,t),this.focusableElems.push(this.prevButton.element),this.focusableElems.push(this.nextButton.element),this.handlePrevButtonClick=()=>{this.uiChange(),this.previous()},this.handleNextButtonClick=()=>{this.uiChange(),this.next()},this.on("activate",this.activatePrevNextButtons),this.on("select",this.updatePrevNextButtons)};let n=e.prototype;return n.updatePrevNextButtons=function(){let e=this.slides.length?this.slides.length-1:0;this.updatePrevNextButton(this.prevButton,0),this.updatePrevNextButton(this.nextButton,e)},n.updatePrevNextButton=function(e,t){if(this.isWrapping&&this.slides.length>1)return void e.enable();let i=this.selectedIndex!==t;e[i?"enable":"disable"](),!i&&document.activeElement===e.element&&this.focus()},n.activatePrevNextButtons=function(){this.prevButton.element.addEventListener("click",this.handlePrevButtonClick),this.nextButton.element.addEventListener("click",this.handleNextButtonClick),this.element.append(this.prevButton.element,this.nextButton.element),this.on("deactivate",this.deactivatePrevNextButtons)},n.deactivatePrevNextButtons=function(){this.prevButton.element.remove(),this.nextButton.element.remove(),this.prevButton.element.removeEventListener("click",this.handlePrevButtonClick),this.nextButton.element.removeEventListener("click",this.handleNextButtonClick),this.off("deactivate",this.deactivatePrevNextButtons)},e.PrevNextButton=i,e})},7849:function(e,t,i){var n=Date.prototype,r="Invalid Date",o="toString",s=n[o],a=n.getTime;new Date(NaN)+""!=r&&i(8859)(n,o,function(){var e=a.call(this);return e==e?s.call(this):r})},7874:function(e,t,i){"use strict";var n=i(2127),r=i(6543);n(n.P+n.F*!i(6884)([].reduceRight,!0),"Array",{reduceRight:function(e){return r(this,e,arguments.length,arguments[1],!0)}})},7899:function(e,t,i){var n=i(2127);n(n.S,"Array",{isArray:i(7981)})},7901:function(e,t,i){var n=i(2127),r=i(5551),o=Math.exp;n(n.S,"Math",{tanh:function(e){var t=r(e=+e),i=r(-e);return t==1/0?1:i==1/0?-1:(t-i)/(o(e)+o(-e))}})},7917:function(e){var t={}.hasOwnProperty;e.exports=function(e,i){return t.call(e,i)}},7925:function(e,t,i){i(7209)("Float32",4,function(e){return function(t,i,n){return e(this,t,i,n)}})},7926:function(e,t,i){"use strict";var n=i(7087),r=i(3344);e.exports=function(e){var t=String(r(this)),i="",o=n(e);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(t+=t))1&o&&(i+=t);return i}},7943:function(e,t,i){!function(t,n){e.exports?e.exports=n(t,i(2137)):t.imagesLoaded=n(t,t.EvEmitter)}("undefined"!=typeof window?window:this,function(e,t){let i=e.jQuery,n=e.console;function r(e,t,o){if(!(this instanceof r))return new r(e,t,o);let s=e;var a;"string"==typeof e&&(s=document.querySelectorAll(e)),s?(this.elements=(a=s,Array.isArray(a)?a:"object"==typeof a&&"number"==typeof a.length?[...a]:[a]),this.options={},"function"==typeof t?o=t:Object.assign(this.options,t),o&&this.on("always",o),this.getImages(),i&&(this.jqDeferred=new i.Deferred),setTimeout(this.check.bind(this))):n.error(`Bad element for imagesLoaded ${s||e}`)}r.prototype=Object.create(t.prototype),r.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)};const o=[1,9,11];r.prototype.addElementImages=function(e){"IMG"===e.nodeName&&this.addImage(e),!0===this.options.background&&this.addElementBackgroundImages(e);let{nodeType:t}=e;if(!t||!o.includes(t))return;let i=e.querySelectorAll("img");for(let e of i)this.addImage(e);if("string"==typeof this.options.background){let t=e.querySelectorAll(this.options.background);
2for(let e of t)this.addElementBackgroundImages(e)}};const s=/url\((['"])?(.*?)\1\)/gi;function a(e){this.img=e}function l(e,t){this.url=e,this.element=t,this.img=new Image}return r.prototype.addElementBackgroundImages=function(e){let t=getComputedStyle(e);if(!t)return;let i=s.exec(t.backgroundImage);for(;null!==i;){let n=i&&i[2];n&&this.addBackground(n,e),i=s.exec(t.backgroundImage)}},r.prototype.addImage=function(e){let t=new a(e);this.images.push(t)},r.prototype.addBackground=function(e,t){let i=new l(e,t);this.images.push(i)},r.prototype.check=function(){if(this.progressedCount=0,this.hasAnyBroken=!1,!this.images.length)return void this.complete();let e=(e,t,i)=>{setTimeout(()=>{this.progress(e,t,i)})};this.images.forEach(function(t){t.once("progress",e),t.check()})},r.prototype.progress=function(e,t,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded,this.emitEvent("progress",[this,e,t]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,e),this.progressedCount===this.images.length&&this.complete(),this.options.debug&&n&&n.log(`progress: ${i}`,e,t)},r.prototype.complete=function(){let e=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(e,[this]),this.emitEvent("always",[this]),this.jqDeferred){let e=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[e](this)}},a.prototype=Object.create(t.prototype),a.prototype.check=function(){this.getIsImageComplete()?this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.img.crossOrigin&&(this.proxyImage.crossOrigin=this.img.crossOrigin),this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.proxyImage.src=this.img.currentSrc||this.img.src)},a.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},a.prototype.confirm=function(e,t){this.isLoaded=e;let{parentNode:i}=this.img,n="PICTURE"===i.nodeName?i:this.img;this.emitEvent("progress",[this,n,t])},a.prototype.handleEvent=function(e){let t="on"+e.type;this[t]&&this[t](e)},a.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},a.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},a.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},l.prototype=Object.create(a.prototype),l.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},l.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},l.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.element,t])},r.makeJQueryPlugin=function(t){(t=t||e.jQuery)&&(i=t,i.fn.imagesLoaded=function(e,t){return new r(this,e,t).jqDeferred.promise(i(this))})},r.makeJQueryPlugin(),r})},7960:function(e,t,i){t.f=i(7574)},7967:function(e,t,i){var n=i(4228),r=i(2956),o=i(3048),s=Object.defineProperty;t.f=i(1763)?Object.defineProperty:function(e,t,i){if(n(e),t=o(t,!0),n(i),r)try{return s(e,t,i)}catch(e){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(e[t]=i.value),e}},7981:function(e,t,i){var n=i(5089);e.exports=Array.isArray||function(e){return"Array"==n(e)}},8032:function(e,t,i){"use strict";var n=i(7526),r=i(1763),o=i(2750),s=i(237),a=i(3341),l=i(6065),c=i(9448),u=i(6440),h=i(7087),d=i(1485),f=i(3133),p=i(9415).f,m=i(7967).f,_=i(5564),g=i(3844),y="ArrayBuffer",v="DataView",x="prototype",b="Wrong index!",w=n[y],T=n[v],S=n.Math,E=n.RangeError,I=n.Infinity,A=w,M=S.abs,C=S.pow,P=S.floor,D=S.log,R=S.LN2,L="buffer",z="byteLength",O="byteOffset",F=r?"_b":L,k=r?"_l":z,B=r?"_o":O;function N(e,t,i){var n,r,o,s=new Array(i),a=8*i-t-1,l=(1<<a)-1,c=l>>1,u=23===t?C(2,-24)-C(2,-77):0,h=0,d=e<0||0===e&&1/e<0?1:0;for((e=M(e))!=e||e===I?(r=e!=e?1:0,n=l):(n=P(D(e)/R),e*(o=C(2,-n))<1&&(n--,o*=2),(e+=n+c>=1?u/o:u*C(2,1-c))*o>=2&&(n++,o/=2),n+c>=l?(r=0,n=l):n+c>=1?(r=(e*o-1)*C(2,t),n+=c):(r=e*C(2,c-1)*C(2,t),n=0));t>=8;s[h++]=255&r,r/=256,t-=8);for(n=n<<t|r,a+=t;a>0;s[h++]=255&n,n/=256,a-=8);return s[--h]|=128*d,s}function V(e,t,i){var n,r=8*i-t-1,o=(1<<r)-1,s=o>>1,a=r-7,l=i-1,c=e[l--],u=127&c;for(c>>=7;a>0;u=256*u+e[l],l--,a-=8);for(n=u&(1<<-a)-1,u>>=-a,a+=t;a>0;n=256*n+e[l],l--,a-=8);if(0===u)u=1-s;else{if(u===o)return n?NaN:c?-I:I;n+=C(2,t),u-=s}return(c?-1:1)*n*C(2,u-t)}function U(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function j(e){return[255&e]}function G(e){return[255&e,e>>8&255]}function q(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function H(e){return N(e,52,8)}function $(e){return N(e,23,4)}function W(e,t,i){m(e[x],t,{get:function(){return this[i]}})}function Z(e,t,i,n){var r=f(+i);if(r+t>e[k])throw E(b);var o=e[F]._b,s=r+e[B],a=o.slice(s,s+t);return n?a:a.reverse()}function X(e,t,i,n,r,o){var s=f(+i);if(s+t>e[k])throw E(b);for(var a=e[F]._b,l=s+e[B],c=n(+r),u=0;u<t;u++)a[l+u]=c[o?u:t-u-1]}if(s.ABV){if(!c(function(){w(1)})||!c(function(){new w(-1)})||c(function(){return new w,new w(1.5),new w(NaN),w.name!=y})){for(var Y,K=(w=function(e){return u(this,w),new A(f(e))}
vendor: 4,435 bytes, line 2
2)[x]=A[x],J=p(A),Q=0;J.length>Q;)(Y=J[Q++])in w||a(w,Y,A[Y]);o||(K.constructor=w)}var ee=new T(new w(2)),te=T[x].setInt8;ee.setInt8(0,2147483648),ee.setInt8(1,2147483649),!ee.getInt8(0)&&ee.getInt8(1)||l(T[x],{setInt8:function(e,t){te.call(this,e,t<<24>>24)},setUint8:function(e,t){te.call(this,e,t<<24>>24)}},!0)}else w=function(e){u(this,w,y);var t=f(e);this._b=_.call(new Array(t),0),this[k]=t},T=function(e,t,i){u(this,T,v),u(e,w,v);var n=e[k],r=h(t);if(r<0||r>n)throw E("Wrong offset!");if(r+(i=void 0===i?n-r:d(i))>n)throw E("Wrong length!");this[F]=e,this[B]=r,this[k]=i},r&&(W(w,z,"_l"),W(T,L,"_b"),W(T,z,"_l"),W(T,O,"_o")),l(T[x],{getInt8:function(e){return Z(this,1,e)[0]<<24>>24},getUint8:function(e){return Z(this,1,e)[0]},getInt16:function(e){var t=Z(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=Z(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return U(Z(this,4,e,arguments[1]))},getUint32:function(e){return U(Z(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return V(Z(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return V(Z(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){X(this,1,e,j,t)},setUint8:function(e,t){X(this,1,e,j,t)},setInt16:function(e,t){X(this,2,e,G,t,arguments[2])},setUint16:function(e,t){X(this,2,e,G,t,arguments[2])},setInt32:function(e,t){X(this,4,e,q,t,arguments[2])},setUint32:function(e,t){X(this,4,e,q,t,arguments[2])},setFloat32:function(e,t){X(this,4,e,$,t,arguments[2])},setFloat64:function(e,t){X(this,8,e,H,t,arguments[2])}});g(w,y),g(T,v),a(T[x],s.VIEW,!0),t[y]=w,t[v]=T},8050:function(e,t,i){var n=i(2127),r=i(2738);n(n.S+n.F*(Number.parseInt!=r),"Number",{parseInt:r})},8066:function(e,t,i){i(7209)("Int32",4,function(e){return function(t,i,n){return e(this,t,i,n)}})},8128:function(e,t,i){i(9087),e.exports=i(6094).Array.includes},8132:function(e,t,i){var n=i(2127);n(n.S,"Object",{setPrototypeOf:i(5170).set})},8163:function(e,t,i){"use strict";var n=i(9882),r=i(2888),o="WeakSet";i(8933)(o,function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return n.def(r(this,o),e,!0)}},n,!1,!0)},8175:function(e,t,i){"use strict";var n=i(2750),r=i(2127),o=i(8859),s=i(3341),a=i(906),l=i(6032),c=i(3844),u=i(627),h=i(7574)("iterator"),d=!([].keys&&"next"in[].keys()),f="keys",p="values",m=function(){return this};e.exports=function(e,t,i,_,g,y,v){l(i,t,_);var x,b,w,T=function(e){if(!d&&e in A)return A[e];switch(e){case f:case p:return function(){return new i(this,e)}}return function(){return new i(this,e)}},S=t+" Iterator",E=g==p,I=!1,A=e.prototype,M=A[h]||A["@@iterator"]||g&&A[g],C=M||T(g),P=g?E?T("entries"):C:void 0,D="Array"==t&&A.entries||M;if(D&&(w=u(D.call(new e)))!==Object.prototype&&w.next&&(c(w,S,!0),n||"function"==typeof w[h]||s(w,h,m)),E&&M&&M.name!==p&&(I=!0,C=function(){return M.call(this)}),n&&!v||!d&&!I&&A[h]||s(A,h,C),a[t]=C,a[S]=m,g)if(x={values:E?C:T(p),keys:y?C:T(f),entries:P},v)for(b in x)b in A||o(A,b,x[b]);else r(r.P+r.F*(d||I),t,x);return x}},8184:function(e,t,i){var n=i(7574)("unscopables"),r=Array.prototype;null==r[n]&&i(3341)(r,n,{}),e.exports=function(e){r[n][e]=!0}},8206:function(e,t,i){"use strict";var n=i(1763),r=i(1311),o=i(1060),s=i(8449),a=i(8270),l=i(1249),c=Object.assign;e.exports=!c||i(9448)(function(){var e={},t={},i=Symbol(),n="abcdefghijklmnopqrst";return e[i]=7,n.split("").forEach(function(e){t[e]=e}),7!=c({},e)[i]||Object.keys(c({},t)).join("")!=n})?function(e,t){for(var i=a(e),c=arguments.length,u=1,h=o.f,d=s.f;c>u;)for(var f,p=l(arguments[u++]),m=h?r(p).concat(h(p)):r(p),_=m.length,g=0;_>g;)f=m[g++],n&&!d.call(p,f)||(i[f]=p[f]);return i}:c},8219:function(e,t,i){e.exports=!i(1984)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},8236:function(e,t,i){var n=i(3305),r=i(2988).onFreeze;i(923)("freeze",function(e){return function(t){return e&&n(t)?e(r(t)):t}})},8270:function(e,t,i){var n=i(3344);e.exports=function(e){return Object(n(e))}},8301:function(e,t,i){var n=i(7526),r=i(8880),o=i(7967).f,s=i(9415).f,a=i(5411),l=i(1158),c=n.RegExp,u=c,h=c.prototype,d=/a/g,f=/a/g,p=new c(d)!==d;if(i(1763)&&(!p||i(9448)(function(){return f[i(7574)("match")]=!1,c(d)!=d||c(f)==f||"/a/i"!=c(d,"i")}))){c=function(e,t){var i=this instanceof c,n=a(e),o=void 0===t;return!i&&n&&e.constructor===c&&o?e:r(p?new u(n&&!o?e.source:e,t):u((n=e instanceof c)?e.source:e,n&&o?l.call(e):t),i?this:
2h,c)};for(var m=function(e){e in c||o(c,e,{configurable:!0,get:function(){return u[e]},set:function(t){u[e]=t}})},_=s(u),g=0;_.length>g;)m(_[g++]);h.constructor=c,c.prototype=h,i(8859)(n,"RegExp",c)}i(5762)("RegExp")},8305:function(e,t,i){"use strict";var n=i(4228),r=i(8270),o=i(1485),s=i(7087),a=i(8828),l=i(2535),c=Math.max,u=Math.min,h=Math.floor,d=/\$([$&`']|\d\d?|<[^>]*>)/g,f=/\$([$&`']|\d\d?)/g,p=function(e){return void 0===e?e:String(e)};i(9228)("replace",2,function(e,t,i,m){return[function(n,r){var o=e(this),s=null==n?void 0:n[t];return void 0!==s?s.call(n,o,r):i.call(String(o),n,r)},function(e,t){var r=m(i,e,this,t);if(r.done)return r.value;var h=n(e),d=String(this),f="function"==typeof t;f||(t=String(t));var g=h.global;if(g){var y=h.unicode;h.lastIndex=0}for(var v=[];;){var x=l(h,d);if(null===x)break;if(v.push(x),!g)break;""===String(x[0])&&(h.lastIndex=a(d,o(h.lastIndex),y))}for(var b="",w=0,T=0;T<v.length;T++){x=v[T];for(var S=String(x[0]),E=c(u(s(x.index),d.length),0),I=[],A=1;A<x.length;A++)I.push(p(x[A]));var M=x.groups;if(f){var C=[S].concat(I,E,d);void 0!==M&&C.push(M);var P=String(t.apply(void 0,C))}else P=_(S,d,E,I,M,t);E>=w&&(b+=d.slice(w,E)+P,w=E+S.length)}return b+d.slice(w)}];function _(e,t,n,o,s,a){var l=n+e.length,c=o.length,u=f;return void 0!==s&&(s=r(s),u=d),i.call(a,u,function(i,r){var a;switch(r.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(l);case"<":a=s[r.slice(1,-1)];break;default:var u=+r;if(0===u)return i;if(u>c){var d=h(u/10);return 0===d?i:d<=c?void 0===o[d-1]?r.charAt(1):o[d-1]+r.charAt(1):i}a=o[u-1]}return void 0===a?"":a})}})},8385:function(e,t,i){!function(t,n){e.exports?e.exports=n(i(4831),i(977)):n(t.Flickity,t.fizzyUIUtils)}("undefined"!=typeof window?window:this,function(e,t){const i="data-flickity-lazyload",n=`${i}-src`,r=`${i}-srcset`,o=`img[${i}], img[${n}], img[${r}], source[${r}]`;e.create.lazyLoad=function(){this.on("select",this.lazyLoad),this.handleLazyLoadComplete=this.onLazyLoadComplete.bind(this)};let s=e.prototype;function a(e){if(e.matches("img")){let t=e.getAttribute(i),o=e.getAttribute(n),s=e.getAttribute(r);if(t||o||s)return e}return[...e.querySelectorAll(o)]}function l(e,t){this.img=e,this.onComplete=t,this.load()}return s.lazyLoad=function(){let{lazyLoad:e}=this.options;if(!e)return;let t="number"==typeof e?e:0;this.getAdjacentCellElements(t).map(a).flat().forEach(e=>new l(e,this.handleLazyLoadComplete))},s.onLazyLoadComplete=function(e,t){let i=this.getParentCell(e),n=i&&i.element;this.cellSizeChange(n),this.dispatchEvent("lazyLoad",t,n)},l.prototype.handleEvent=t.handleEvent,l.prototype.load=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this);let e=this.img.getAttribute(i)||this.img.getAttribute(n),t=this.img.getAttribute(r);this.img.src=e,t&&this.img.setAttribute("srcset",t),this.img.removeAttribute(i),this.img.removeAttribute(n),this.img.removeAttribute(r)},l.prototype.onload=function(e){this.complete(e,"flickity-lazyloaded")},l.prototype.onerror=function(e){this.complete(e,"flickity-lazyerror")},l.prototype.complete=function(e,t){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this),(this.img.parentNode.matches("picture")?this.img.parentNode:this.img).classList.add(t),this.onComplete(this.img,e)},e.LazyLoader=l,e})},8423:function(e,t,i){var n=i(812),r=i(2484),o=i(752),s=Object.defineProperty;t.f=i(8219)?Object.defineProperty:function(e,t,i){if(n(e),t=o(t,!0),n(i),r)try{return s(e,t,i)}catch(e){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(e[t]=i.value),e}},8437:function(e,t,i){"use strict";i(2468)("fontsize",function(e){return function(t){return e(this,"font","size",t)}})},8449:function(e,t){t.f={}.propertyIsEnumerable},8451:function(e,t,i){var n=i(2127);n(n.S,"Object",{is:i(7359)})},8497:function(){!function(e){if(e.support.touch="ontouchend"in document,e.support.touch){var t,i=e.ui.mouse.prototype,n=i._mouseInit,r=i._mouseDestroy;i._touchStart=function(e){!t&&this._mouseCapture(e.originalEvent.changedTouches[0])&&(t=!0,this._touchMoved=!1,o(e,"mouseover"),o(e,"mousemove"),o(e,"mousedown"))},i._touchMove=function(e){t&&(this._touchMoved=!0,o(e,"mousemove"))},i._touchEnd=function(e){t&&(o(e,"mouseup"),o(e,"mouseout"),this._touchMoved||o(e,"click"),t=!1)},i._mouseInit=function(){var t=this;t.element.bind({touchstart:e.proxy(t,"_touchStart"),touchmove:e.proxy(t,"_touchMove"),touchend:e.proxy(t,"_touchEnd")}),n.call(t)},i._mouseDestroy=function(){var t=this;t.element.unbind({touchstart:e.proxy(t,"_touchStart"),touchmove:e.proxy(t,"_touchMove"),touchend:e.proxy(t,"_touchEnd")}),r.call(t)}}function o(e,t){if(!(e.originalEvent.touches.length>1)){e.preventDefault();var i=e.originalEvent.changedTouches[0],n=document.createEvent("MouseEvents");n.initMouseEvent(t,!0,!0,window,1,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(n)}}}(jQuery)},8535:function(e,t,i){var n=i(6670),r=i(6438),o=i(8852),s=i(2677),a=i(5509),l="prototype",c=function(e,t,i){var u,h,d,f=e&c.F,p=e&c.G,m=e&c.S,_=e&c.P,g=e&c.B,y=e&c.W,v=p?r:r[t]||(r[t]={}),x=v[l],b=p?n:m?n[t]:(n[t]||{})[l];for(u in p&&(i=t),i)(h=!f&&b&&void 0!==b[u])&&a(v,u)||(d=h?b[u]:i[u],v[u]=p&&"function"!=typeof b[u]?i[u]:g&&h?o(d,n):y&&b[u]==d?function(e){var t=function(t,i,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,i)}return new e(t,i,n)}return e.apply(this,arguments)};return t[l]=e[l],t}(d):_&&"function"==typeof d?o(Function.call,d):d,_&&((v.virtual||(v.virtual={}))[u]=d,e&c.R&&x&&!x[u]&&s(x,u,d)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},8537:function(e,t,i){i(7209)("Uint32",4,function(e){return function(t,i,n){return e(this,t,i,n)}})},8543:function(e,t,i){"use strict";i(2468)("strike",function(e){return function(){return e(this,"strike","","")}})},8583:function(e,t,i){"use strict";
2var n=i(2127),r=i(6094),o=i(7526),s=i(9190),a=i(5957);n(n.P+n.R,"Promise",{finally:function(e){var t=s(this,r.Promise||o.Promise),i="function"==typeof e;return this.then(i?function(i){return a(t,e()).then(function(){return i})}:e,i?function(i){return a(t,e()).then(function(){throw i})}:e)}})},8604:function(e,t,i){"use strict";i(9638);var n=i(4228),r=i(1158),o=i(1763),s="toString",a=/./[s],l=function(e){i(8859)(RegExp.prototype,s,e,!0)};i(9448)(function(){return"/a/b"!=a.call({source:"a",flags:"b"})})?l(function(){var e=n(this);return"/".concat(e.source,"/","flags"in e?e.flags:!o&&e instanceof RegExp?r.call(e):void 0)}):a.name!=s&&l(function(){return a.call(this)})},8624:function(e,t,i){"use strict";i.r(t),i.d(t,{DOMException:function(){return b},Headers:function(){return u},Request:function(){return g},Response:function(){return v},fetch:function(){return w}});var n="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==n&&n,r={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};if(r.arrayBuffer)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(e){return e&&o.indexOf(Object.prototype.toString.call(e))>-1};function a(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function c(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r.iterable&&(t[Symbol.iterator]=function(){return t}),t}function u(e){this.map={},e instanceof u?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function h(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function d(e){return new Promise(function(t,i){e.onload=function(){t(e.result)},e.onerror=function(){i(e.error)}})}function f(e){var t=new FileReader,i=d(t);return t.readAsArrayBuffer(e),i}function p(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:r.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:r.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():r.arrayBuffer&&r.blob&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=p(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||s(e))?this._bodyArrayBuffer=p(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var e=h(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(f)}),this.text=function(){var e,t,i,n=h(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,i=d(t=new FileReader),t.readAsText(e),i;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),i=new Array(t.length),n=0;n<t.length;n++)i[n]=String.fromCharCode(t[n]);return i.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(e,t){e=a(e),t=l(t);var i=this.map[e];this.map[e]=i?i+", "+t:t},u.prototype.delete=function(e){delete this.map[a(e)]},u.prototype.get=function(e){return e=a(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(a(e))},u.prototype.set=function(e,t){this.map[a(e)]=l(t)},u.prototype.forEach=function(e,t){for(var i in this.map)this.map.hasOwnProperty(i)&&e.call(t,this.map[i],i,this)},u.prototype.keys=function(){var e=[];return this.forEach(function(t,i){e.push(i)}),c(e)},u.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),c(e)},u.prototype.entries=function(){var e=[];return this.forEach(function(t,i){e.push([i,t])}),c(e)},r.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var _=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function g(e,t){if(!(this instanceof g))throw new TypeError('Please use the "new" operator, this DOM object c
2onstructor cannot be called as a function.');var i,n,r=(t=t||{}).body;if(e instanceof g){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,r||null==e._bodyInit||(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new u(t.headers)),this.method=(n=(i=t.method||this.method||"GET").toUpperCase(),_.indexOf(n)>-1?n:i),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var o=/([?&])_=[^&]*/;o.test(this.url)?this.url=this.url.replace(o,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function y(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var i=e.split("="),n=i.shift().replace(/\+/g," "),r=i.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(r))}}),t}function v(e,t){if(!(this instanceof v))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new u(t.headers),this.url=t.url||"",this._initBody(e)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},m.call(g.prototype),m.call(v.prototype),v.prototype.clone=function(){return new v(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},v.error=function(){var e=new v(null,{status:0,statusText:""});return e.type="error",e};var x=[301,302,303,307,308];v.redirect=function(e,t){if(-1===x.indexOf(t))throw new RangeError("Invalid status code");return new v(null,{status:t,headers:{location:e}})};var b=n.DOMException;try{new b}catch(e){(b=function(e,t){this.message=e,this.name=t;var i=Error(e);this.stack=i.stack}).prototype=Object.create(Error.prototype),b.prototype.constructor=b}function w(e,t){return new Promise(function(i,o){var s=new g(e,t);if(s.signal&&s.signal.aborted)return o(new b("Aborted","AbortError"));var a=new XMLHttpRequest;function c(){a.abort()}a.onload=function(){var e,t,n={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new u,e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e}).forEach(function(e){var i=e.split(":"),n=i.shift().trim();if(n){var r=i.join(":").trim();t.append(n,r)}}),t)};n.url="responseURL"in a?a.responseURL:n.headers.get("X-Request-URL");var r="response"in a?a.response:a.responseText;setTimeout(function(){i(new v(r,n))},0)},a.onerror=function(){setTimeout(function(){o(new TypeError("Network request failed"))},0)},a.ontimeout=function(){setTimeout(function(){o(new TypeError("Network request failed"))},0)},a.onabort=function(){setTimeout(function(){o(new b("Aborted","AbortError"))},0)},a.open(s.method,function(e){try{return""===e&&n.location.href?n.location.href:e}catch(t){return e}}(s.url),!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&(r.blob?a.responseType="blob":r.arrayBuffer&&s.headers.get("Content-Type")&&-1!==s.headers.get("Content-Type").indexOf("application/octet-stream")&&(a.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof u?s.headers.forEach(function(e,t){a.setRequestHeader(t,e)}):Object.getOwnPropertyNames(t.headers).forEach(function(e){a.setRequestHeader(e,l(t.headers[e]))}),s.signal&&(s.signal.addEventListener("abort",c),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",c)}),a.send(void 0===s._bodyInit?null:s._bodyInit)})}w.polyfill=!0,n.fetch||(n.fetch=w,n.Headers=u,n.Request=g,n.Response=v)},8641:function(e,t,i){var n=i(8449),r=i(1996),o=i(7221),s=i(3048),a=i(7917),l=i(2956),c=Object.getOwnPropertyDescriptor;t.f=i(1763)?c:function(e,t){if(e=o(e),t=s(t,!0),l)try{return c(e,t)}catch(e){}if(a(e,t))return r(!n.f.call(e,t),e[t])}},8647:function(e,t,i){var n=i(8270),r=i(1311);i(923)("keys",function(){return function(e){return r(n(e))}})},8699:function(e,t,i){i(7209)("Int8",1,function(e){return function(t,i,n){return e(this,t,i,n)}})},8772:function(e,t,i){var n=i(7526),r=i(2127),o=i(4514),s=[].slice,a=/MSIE .\./.test(o),l=function(e){return function(t,i){var n=arguments.length>2,r=!!n&&s.call(arguments,2);return e(n?function(){("function"==typeof t?t:Function(t)).apply(this,r)}:t,i)}};r(r.G+r.B+r.F*a,{setTimeout:l(n.setTimeout),setInterval:l(n.setInterval)})},8790:function(e,t,i){var n=i(5052),r=i(7368),o=i(1508),s=i(4228),a=i(1485),l=i(762),
vendor: 5,604 bytes, line 2
2c={},u={},h=e.exports=function(e,t,i,h,d){var f,p,m,_,g=d?function(){return e}:l(e),y=n(i,h,t?2:1),v=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(o(g)){for(f=a(e.length);f>v;v++)if((_=t?y(s(p=e[v])[0],p[1]):y(e[v]))===c||_===u)return _}else for(m=g.call(e);!(p=m.next()).done;)if((_=r(m,y,p.value,t))===c||_===u)return _};h.BREAK=c,h.RETURN=u},8828:function(e,t,i){"use strict";var n=i(1212)(!0);e.exports=function(e,t,i){return t+(i?n(e,t).length:1)}},8852:function(e,t,i){var n=i(5219);e.exports=function(e,t,i){if(n(e),void 0===t)return e;switch(i){case 1:return function(i){return e.call(t,i)};case 2:return function(i,n){return e.call(t,i,n)};case 3:return function(i,n,r){return e.call(t,i,n,r)}}return function(){return e.apply(t,arguments)}}},8859:function(e,t,i){var n=i(7526),r=i(3341),o=i(7917),s=i(4415)("src"),a=i(9461),l="toString",c=(""+a).split(l);i(6094).inspectSource=function(e){return a.call(e)},(e.exports=function(e,t,i,a){var l="function"==typeof i;l&&(o(i,"name")||r(i,"name",t)),e[t]!==i&&(l&&(o(i,s)||r(i,s,e[t]?""+e[t]:c.join(String(t)))),e===n?e[t]=i:a?e[t]?e[t]=i:r(e,t,i):(delete e[t],r(e,t,i)))})(Function.prototype,l,function(){return"function"==typeof this&&this[s]||a.call(this)})},8872:function(e,t,i){"use strict";var n=i(2127),r=i(8942),o="includes";n(n.P+n.F*i(5203)(o),"String",{includes:function(e){return!!~r(this,e,o).indexOf(e,arguments.length>1?arguments[1]:void 0)}})},8880:function(e,t,i){var n=i(3305),r=i(5170).set;e.exports=function(e,t,i){var o,s=t.constructor;return s!==i&&"function"==typeof s&&(o=s.prototype)!==i.prototype&&n(o)&&r&&r(e,o),e}},8888:function(e,t,i){"use strict";var n=i(2127),r=i(6179)(4);n(n.P+n.F*!i(6884)([].every,!0),"Array",{every:function(e){return r(this,e,arguments[1])}})},8892:function(e,t,i){"use strict";var n=i(2127),r=i(6179)(3);n(n.P+n.F*!i(6884)([].some,!0),"Array",{some:function(e){return r(this,e,arguments[1])}})},8931:function(e,t,i){var n=i(7574)("iterator"),r=!1;try{var o=[7][n]();o.return=function(){r=!0},Array.from(o,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!r)return!1;var i=!1;try{var o=[7],s=o[n]();s.next=function(){return{done:i=!0}},o[n]=function(){return s},e(o)}catch(e){}return i}},8933:function(e,t,i){"use strict";var n=i(7526),r=i(2127),o=i(8859),s=i(6065),a=i(2988),l=i(8790),c=i(6440),u=i(3305),h=i(9448),d=i(8931),f=i(3844),p=i(8880);e.exports=function(e,t,i,m,_,g){var y=n[e],v=y,x=_?"set":"add",b=v&&v.prototype,w={},T=function(e){var t=b[e];o(b,e,"delete"==e||"has"==e?function(e){return!(g&&!u(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return g&&!u(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,i){return t.call(this,0===e?0:e,i),this})};if("function"==typeof v&&(g||b.forEach&&!h(function(){(new v).entries().next()}))){var S=new v,E=S[x](g?{}:-0,1)!=S,I=h(function(){S.has(1)}),A=d(function(e){new v(e)}),M=!g&&h(function(){for(var e=new v,t=5;t--;)e[x](t,t);return!e.has(-0)});A||((v=t(function(t,i){c(t,v,e);var n=p(new y,t,v);return null!=i&&l(i,_,n[x],n),n})).prototype=b,b.constructor=v),(I||M)&&(T("delete"),T("has"),_&&T("get")),(M||E)&&T(x),g&&b.clear&&delete b.clear}else v=m.getConstructor(t,e,_,x),s(v.prototype,i),a.NEED=!0;return f(v,e),w[e]=v,r(r.G+r.W+r.F*(v!=y),w),g||m.setStrong(v,e,_),v}},8942:function(e,t,i){var n=i(5411),r=i(3344);e.exports=function(e,t,i){if(n(t))throw TypeError("String#"+i+" doesn't accept regex!");return String(r(e))}},8951:function(e,t,i){var n=i(7574)("toPrimitive"),r=Date.prototype;n in r||i(3341)(r,n,i(107))},8978:function(e,t,i){"use strict";i(6517),i(8583),e.exports=i(6094).Promise.finally},9011:function(e,t,i){"use strict";i(2468)("big",function(e){return function(){return e(this,"big","","")}})},9073:function(e,t,i){var n=i(3305);i(923)("isExtensible",function(e){return function(t){return!!n(t)&&(!e||e(t))}})},9087:function(e,t,i){"use strict";var n=i(2127),r=i(1464)(!0);n(n.P,"Array",{includes:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}}),i(8184)("includes")},9134:function(e,t,i){var n=i(2127),r=i(5551),o=Math.exp;n(n.S+n.F*i(9448)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function(e){return Math.abs(e=+e)<1?(r(e)-r(-e))/2:(o(e-1)-o(-e-1))*(Math.E/2)}})},9147:function(e,t,i){var n=i(2127),r=i(5551);n(n.S+n.F*(r!=Math.expm1),"Math",{expm1:r})},9190:function(e,t,i){var n=i(4228),r=i(3387),o=i(7574)("species");e.exports=function(e,t){var i,s=n(e).constructor;return void 0===s||null==(i=n(s)[o])?t:r(i)}},9213:function(e,t,i){"use strict";i(2468)("fontcolor",function(e){return function(t){return e(this,"font","color",t)}})},9228:function(e,t,i){"use strict";i(4116);var n=i(8859),r=i(3341),o=i(9448),s=i(3344),a=i(7574),l=i(9600),c=a("species"),u=!o(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}),h=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var i="ab".split(e);return 2===i.length&&"a"===i[0]&&"b"===i[1]}();e.exports=function(e,t,i){var d=a(e),f=!o(function(){var t={};return t[d]=function(){return 7},7!=""[e](t)}),p=f?!o(function(){var t=!1,i=/a/;return i.exec=function(){return t=!0,null},"split"===e&&(i.constructor={},i.constructor[c]=function(){return i}),i[d](""),!t}):void 0;if(!f||!p||"replace"===e&&!u||"split"===e&&!h){var m=/./[d],_=i(s,d,""[e],function(e,t,i,n,r){return t.exec===l?f&&!r?{done:!0,value:m.call(t,i,n)}:{done:!0,value:e.call(i,t,n)}:{done:!1}}),g=_[0],y=_[1];n(String.prototype,e,g),r(RegExp.prototype,d,2==t?function(e,t){return y.c
2all(e,this,t)}:function(e){return y.call(e,this)})}}},9318:function(e,t,i){var n=i(3305);i(923)("isFrozen",function(e){return function(t){return!n(t)||!!e&&e(t)}})},9397:function(e,t,i){"use strict";var n,r=i(7526),o=i(6179)(0),s=i(8859),a=i(2988),l=i(8206),c=i(9882),u=i(3305),h=i(2888),d=i(2888),f=!r.ActiveXObject&&"ActiveXObject"in r,p="WeakMap",m=a.getWeak,_=Object.isExtensible,g=c.ufstore,y=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},v={get:function(e){if(u(e)){var t=m(e);return!0===t?g(h(this,p)).get(e):t?t[this._i]:void 0}},set:function(e,t){return c.def(h(this,p),e,t)}},x=e.exports=i(8933)(p,y,v,c,!0,!0);d&&f&&(l((n=c.getConstructor(y,p)).prototype,v),a.NEED=!0,o(["delete","has","get","set"],function(e){var t=x.prototype,i=t[e];s(t,e,function(t,r){if(u(t)&&!_(t)){this._f||(this._f=new n);var o=this._f[e](t,r);return"set"==e?this:o}return i.call(this,t,r)})}))},9415:function(e,t,i){var n=i(4561),r=i(6140).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,r)}},9429:function(e,t,i){var n=i(2127),r=i(5385);n(n.P+n.F*(Date.prototype.toISOString!==r),"Date",{toISOString:r})},9448:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},9453:function(e,t,i){!function(t,n){e.exports?e.exports=n(i(4831)):n(t.Flickity)}("undefined"!=typeof window?window:this,function(e){function t(e,t){this.autoPlay=e,this.onTick=t,this.state="stopped",this.onVisibilityChange=this.visibilityChange.bind(this),this.onVisibilityPlay=this.visibilityPlay.bind(this)}t.prototype.play=function(){"playing"!==this.state&&(document.hidden?document.addEventListener("visibilitychange",this.onVisibilityPlay):(this.state="playing",document.addEventListener("visibilitychange",this.onVisibilityChange),this.tick()))},t.prototype.tick=function(){if("playing"!==this.state)return;let e="number"==typeof this.autoPlay?this.autoPlay:3e3;this.clear(),this.timeout=setTimeout(()=>{this.onTick(),this.tick()},e)},t.prototype.stop=function(){this.state="stopped",this.clear(),document.removeEventListener("visibilitychange",this.onVisibilityChange)},t.prototype.clear=function(){clearTimeout(this.timeout)},t.prototype.pause=function(){"playing"===this.state&&(this.state="paused",this.clear())},t.prototype.unpause=function(){"paused"===this.state&&this.play()},t.prototype.visibilityChange=function(){this[document.hidden?"pause":"unpause"]()},t.prototype.visibilityPlay=function(){this.play(),document.removeEventListener("visibilitychange",this.onVisibilityPlay)},Object.assign(e.defaults,{pauseAutoPlayOnHover:!0}),e.create.player=function(){this.player=new t(this.options.autoPlay,()=>{this.next(!0)}),this.on("activate",this.activatePlayer),this.on("uiChange",this.stopPlayer),this.on("pointerDown",this.stopPlayer),this.on("deactivate",this.deactivatePlayer)};let i=e.prototype;return i.activatePlayer=function(){this.options.autoPlay&&(this.player.play(),this.element.addEventListener("mouseenter",this))},i.playPlayer=function(){this.player.play()},i.stopPlayer=function(){this.player.stop()},i.pausePlayer=function(){this.player.pause()},i.unpausePlayer=function(){this.player.unpause()},i.deactivatePlayer=function(){this.player.stop(),this.element.removeEventListener("mouseenter",this)},i.onmouseenter=function(){this.options.pauseAutoPlayOnHover&&(this.player.pause(),this.element.addEventListener("mouseleave",this))},i.onmouseleave=function(){this.player.unpause(),this.element.removeEventListener("mouseleave",this)},e.Player=t,e})},9461:function(e,t,i){e.exports=i(4556)("native-function-to-string",Function.toString)},9497:function(e,t,i){var n=i(2127);n(n.S,"Number",{isNaN:function(e){return e!=e}})},9584:function(e,t,i){var n=i(2127);n(n.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}})},9600:function(e,t,i){"use strict";var n,r,o=i(1158),s=RegExp.prototype.exec,a=String.prototype.replace,l=s,c="lastIndex",u=(n=/a/,r=/b*/g,s.call(n,"a"),s.call(r,"a"),0!==n[c]||0!==r[c]),h=void 0!==/()??/.exec("")[1];(u||h)&&(l=function(e){var t,i,n,r,l=this;return h&&(i=new RegExp("^"+l.source+"$(?!\\s)",o.call(l))),u&&(t=l[c]),n=s.call(l,e),u&&n&&(l[c]=l.global?n.index+n[0].length:t),h&&n&&n.length>1&&a.call(n[0],i,function(){for(r=1;r<arguments.length-2;r++)void 0===arguments[r]&&(n[r]=void 0)}),n}),e.exports=l},9620:function(e,t,i){var n=i(2127);n(n.P,"Array",{copyWithin:i(4438)}),i(8184)("copyWithin")},9638:function(e,t,i){i(1763)&&"g"!=/./g.flags&&i(7967).f(RegExp.prototype,"flags",{configurable:!0,get:i(1158)})},9650:function(e,t,i){"use strict";var n=i(7526),r=i(7917),o=i(1763),s=i(2127),a=i(8859),l=i(2988).KEY,c=i(9448),u=i(4556),h=i(3844),d=i(4415),f=i(7574),p=i(7960),m=i(5392),_=i(5969),g=i(7981),y=i(4228),v=i(3305),x=i(8270),b=i(7221),w=i(3048),T=i(1996),S=i(4719),E=i(4765),I=i(8641),A=i(1060),M=i(7967),C=i(1311),P=I.f,D=M.f,R=E.f,L=n.Symbol,z=n.JSON,O=z&&z.stringify,F="prototype",k=f("_hidden"),B=f("toPrimitive"),N={}.propertyIsEnumerable,V=u("symbol-registry"),U=u("symbols"),j=u("op-symbol
2s"),G=Object[F],q="function"==typeof L&&!!A.f,H=n.QObject,$=!H||!H[F]||!H[F].findChild,W=o&&c(function(){return 7!=S(D({},"a",{get:function(){return D(this,"a",{value:7}).a}})).a})?function(e,t,i){var n=P(G,t);n&&delete G[t],D(e,t,i),n&&e!==G&&D(G,t,n)}:D,Z=function(e){var t=U[e]=S(L[F]);return t._k=e,t},X=q&&"symbol"==typeof L.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof L},Y=function(e,t,i){return e===G&&Y(j,t,i),y(e),t=w(t,!0),y(i),r(U,t)?(i.enumerable?(r(e,k)&&e[k][t]&&(e[k][t]=!1),i=S(i,{enumerable:T(0,!1)})):(r(e,k)||D(e,k,T(1,{})),e[k][t]=!0),W(e,t,i)):D(e,t,i)},K=function(e,t){y(e);for(var i,n=_(t=b(t)),r=0,o=n.length;o>r;)Y(e,i=n[r++],t[i]);return e},J=function(e){var t=N.call(this,e=w(e,!0));return!(this===G&&r(U,e)&&!r(j,e))&&(!(t||!r(this,e)||!r(U,e)||r(this,k)&&this[k][e])||t)},Q=function(e,t){if(e=b(e),t=w(t,!0),e!==G||!r(U,t)||r(j,t)){var i=P(e,t);return!i||!r(U,t)||r(e,k)&&e[k][t]||(i.enumerable=!0),i}},ee=function(e){for(var t,i=R(b(e)),n=[],o=0;i.length>o;)r(U,t=i[o++])||t==k||t==l||n.push(t);return n},te=function(e){for(var t,i=e===G,n=R(i?j:b(e)),o=[],s=0;n.length>s;)!r(U,t=n[s++])||i&&!r(G,t)||o.push(U[t]);return o};q||(L=function(){if(this instanceof L)throw TypeError("Symbol is not a constructor!");var e=d(arguments.length>0?arguments[0]:void 0),t=function(i){this===G&&t.call(j,i),r(this,k)&&r(this[k],e)&&(this[k][e]=!1),W(this,e,T(1,i))};return o&&$&&W(G,e,{configurable:!0,set:t}),Z(e)},a(L[F],"toString",function(){return this._k}),I.f=Q,M.f=Y,i(9415).f=E.f=ee,i(8449).f=J,A.f=te,o&&!i(2750)&&a(G,"propertyIsEnumerable",J,!0),p.f=function(e){return Z(f(e))}),s(s.G+s.W+s.F*!q,{Symbol:L});for(var ie="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ne=0;ie.length>ne;)f(ie[ne++]);for(var re=C(f.store),oe=0;re.length>oe;)m(re[oe++]);s(s.S+s.F*!q,"Symbol",{for:function(e){return r(V,e+="")?V[e]:V[e]=L(e)},keyFor:function(e){if(!X(e))throw TypeError(e+" is not a symbol!");for(var t in V)if(V[t]===e)return t},useSetter:function(){$=!0},useSimple:function(){$=!1}}),s(s.S+s.F*!q,"Object",{create:function(e,t){return void 0===t?S(e):K(S(e),t)},defineProperty:Y,defineProperties:K,getOwnPropertyDescriptor:Q,getOwnPropertyNames:ee,getOwnPropertySymbols:te});var se=c(function(){A.f(1)});s(s.S+s.F*se,"Object",{getOwnPropertySymbols:function(e){return A.f(x(e))}}),z&&s(s.S+s.F*(!q||c(function(){var e=L();return"[null]"!=O([e])||"{}"!=O({a:e})||"{}"!=O(Object(e))})),"JSON",{stringify:function(e){for(var t,i,n=[e],r=1;arguments.length>r;)n.push(arguments[r++]);if(i=t=n[1],(v(t)||void 0!==e)&&!X(e))return g(t)||(t=function(e,t){if("function"==typeof i&&(t=i.call(this,e,t)),!X(t))return t}),n[1]=t,O.apply(z,n)}}),L[F][B]||i(3341)(L[F],B,L[F].valueOf),h(L,"Symbol"),h(Math,"Math",!0),h(n.JSON,"JSON",!0)},9766:function(e,t,i){"use strict";var n=i(2127),r=i(2322),o=i(8270),s=i(1485),a=i(3387),l=i(3191);n(n.P,"Array",{flatMap:function(e){var t,i,n=o(this);return a(e),t=s(n.length),i=l(n,0),r(i,n,n,t,0,1,e,arguments[1]),i}}),i(8184)("flatMap")},9813:function(e,t,i){"use strict";var n=i(2127),r=i(6179)(2);n(n.P+n.F*!i(6884)([].filter,!0),"Array",{filter:function(e){return r(this,e,arguments[1])}})},9839:function(e,t,i){"use strict";i(2468)("italics",function(e){return function(){return e(this,"i","","")}})},9882:function(e,t,i){"use strict";var n=i(6065),r=i(2988).getWeak,o=i(4228),s=i(3305),a=i(6440),l=i(8790),c=i(6179),u=i(7917),h=i(2888),d=c(5),f=c(6),p=0,m=function(e){return e._l||(e._l=new _)},_=function(){this.a=[]},g=function(e,t){return d(e.a,function(e){return e[0]===t})};_.prototype={get:function(e){var t=g(this,e);if(t)return t[1]},has:function(e){return!!g(this,e)},set:function(e,t){var i=g(this,e);i?i[1]=t:this.a.push([e,t])},delete:function(e){var t=f(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,i,o){var c=e(function(e,n){a(e,c,t,"_i"),e._t=t,e._i=p++,e._l=void 0,null!=n&&l(n,i,e[o],e)});return n(c.prototype,{delete:function(e){if(!s(e))return!1;var i=r(e);return!0===i?m(h(this,t)).delete(e):i&&u(i,this._i)&&delete i[this._i]},has:function(e){if(!s(e))return!1;var i=r(e);return!0===i?m(h(this,t)).has(e):i&&u(i,this._i)}}),c},def:function(e,t,i){var n=r(o(t),!0);return!0===n?m(e).set(t,i):n[e._i]=i,e},ufstore:m}},9943:function(e,t,i){!function(t,n){e.exports?e.exports=n(i(4831
2),i(977)):n(t.Flickity,t.fizzyUIUtils)}("undefined"!=typeof window?window:this,function(e,t){let i=e.prototype;return i.insert=function(e,t){let i=this._makeCells(e);if(!i||!i.length)return;let n=this.cells.length;t=void 0===t?n:t;let r=function(e){let t=document.createDocumentFragment();return e.forEach(e=>t.appendChild(e.element)),t}(i),o=t===n;if(o)this.slider.appendChild(r);else{let e=this.cells[t].element;this.slider.insertBefore(r,e)}if(0===t)this.cells=i.concat(this.cells);else if(o)this.cells=this.cells.concat(i);else{let e=this.cells.splice(t,n-t);this.cells=this.cells.concat(i).concat(e)}this._sizeCells(i),this.cellChange(t),this.positionSliderAtSelected()},i.append=function(e){this.insert(e,this.cells.length)},i.prepend=function(e){this.insert(e,0)},i.remove=function(e){let i=this.getCells(e);if(!i||!i.length)return;let n=this.cells.length-1;i.forEach(e=>{e.remove();let i=this.cells.indexOf(e);n=Math.min(i,n),t.removeFrom(this.cells,e)}),this.cellChange(n),this.positionSliderAtSelected()},i.cellSizeChange=function(e){let t=this.getCell(e);if(!t)return;t.getSize();let i=this.cells.indexOf(t);this.cellChange(i)},i.cellChange=function(e){let t=this.selectedElement;this._positionCells(e),this._updateWrapShiftCells(),this.setGallerySize();let i=this.getCell(t);i&&(this.selectedIndex=this.getCellSlideIndex(i)),this.selectedIndex=Math.min(this.slides.length-1,this.selectedIndex),this.emitEvent("cellChange",[e]),this.select(this.selectedIndex)},e})}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,i),o.exports}i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){"use strict";i(4572);var e,t=(e=i(5104))&&e.__esModule?e:{default:e};t.default._babelPolyfill&&"undefined"!=typeof console&&console.warn&&console.warn("@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended and may have consequences if different versions of the polyfills are applied sequentially. If you do need to load the polyfill more than once, use @babel/polyfill/noConflict instead to bypass the warning."),t.default._babelPolyfill=!0}(),function(){"use strict";var e=i(2522),t=i.n(e);function n(e){function t(t,i){if(!t.hasClass(i)){var n=e(".".concat(i));n.removeClass(i),t.addClass(i),t.attr("aria-hidden",null),n.attr("aria-hidden","true")}}e(".hero__controls li").each(function(){e(this).on("mouseenter",function(i){var n,r,o,s;n=i.target,o=function(t){var i=e(t);return e(t).is("p")?i=e(t).parent().parent():e(t).is("a")&&(i=e(t).parent()),i}(n),s=e("#hero__".concat(o.data("prop"))),t(o,"hero__control--active"),t(s,"hero--active"),r=25*o.data("index"),e(".hero__status").css("left","".concat(r,"%"))})})}var r=i(5307),o=i.n(r);function s(e,t,i){function n(t,i){var n=e(".".concat(i));n.attr("aria-hidden","true"),n.removeClass(i),t.addClass(i),t.attr("aria-hidden",null)}!function(){if(t||0===t){var r=e(".hero-mobile__image-".concat(t));return n(e(".hero-mobile__controls-".concat(t)),"hero-mobile__controls--active"),void n(r,"hero-mobile__image--active")}i&&e(i).find(".carousel__cell").each(function(){e(this).addClass("full-height")})}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}function l(e,t,i){var n=function(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?a(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(document.querySelectorAll(t));
2n&&n.forEach(function(t){var r={on:{ready:function(){var i=o().data(t),n=e(t).find(".slide-counter .total-slide");e(t).find(".slide-counter .current-slide").text("1"),n.text(i.cells.length),t.classList.contains("hero__carousel")&&s(e,null,t);var r=e(t).find(".flickity-button-icon");e.each(r,function(t,i){e(i).attr("aria-hidden","true")})},change:function(){var i=o().data(t),r=e(t).find(".slide-counter .current-slide"),a=i.getSelectedCellIndexes();r.text(a[0]+1),t.classList.contains("hero__carousel")&&s(e,a[0]),i.selectedIndex==i.cells.length-1?e(n).toggleClass("shadow"):e(n).addClass("shadow")}},imagesLoaded:!0,contain:!0,pageDots:!1,cellAlign:"left",percentPosition:!1,cellSelector:".carousel__cell",draggable:!1,groupCells:!1,resize:!0,wrapAround:!0};if(i)for(var a in i)r[a]=i[a];!function(e,t){new(o())(e,t)}(t,r)})}function c(e){function t(t,i){var n=e("#".concat(t.attr("name"),"_state"));if(n){if(i)return void n.text("Please provide your ".concat(t.attr("name"),"."));n.text("This field is required")}}function i(i){var n=!0;return i.each(function(){var i,r,o=e(this),s=void 0!==o.attr("required"),a=void 0!==o.attr("type")?o.attr("type").toLowerCase():null,l=""!==o.val().trim();(s&&!l||"email"===a&&l&&(r=o.val(),!String(r).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)))&&((i=o).attr("aria-invalid",!0),t(i,!0),n=!1)}),n}var n=e("#leasing-inquiry");n&&function(n){var r;(function(i){i.find(".input-field").each(function(){e(this).on("keyup",function(){var i=e(this);if(""!==i.val().trim())return i.addClass("filled"),i.attr("aria-invalid",null),void t(i,!1);i.removeClass("filled")})})})(n),(r=n).on("submit",function(t){var n;t.preventDefault(),i(r.find(".input-field"))?function(t,i){var n=e(t);i.attr("disabled",!0),n.parent().addClass("loading"),e.ajax({type:"POST",url:n.attr("action"),data:n.serialize(),success:function(e){return window.location.href="https://fcr.ca/leasing-inquiries/",!1},error:function(e){i.attr("disabled",!1),n.parent().removeClass("loading"),console.log(e)}})}(this,r.find("input[type=submit]")):(n=e(this).find("[aria-invalid]"))&&n[0].focus()})}(n)}o().prototype.getSelectedCellIndexes=function(){return this.selectedCells.map(function(e){return this.cells.indexOf(e)},this)},i(328);var u=i(842),h=i.n(u);function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function f(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function p(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?f(Object(i),!0).forEach(function(t){m(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):f(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function m(e,t,i){return(t=function(e){var t=function(e){if("object"!=d(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=d(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==d(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var _=function(e){return!!e&&e.charAt(0).toUpperCase()+e.slice(1).toLowerCase().replace(/[-|_](.)/g,function(e,t){return" "+t.toUpperCase()})},g=function(e,t){var i,n="background: url(".concat(e.listing_image,") center / cover no-repeat");return'\n            <a class="map-popup" href="'.concat(e.listing_permalink,'">\n                ').concat(e.listing_image?'<div class="popup-thumb" style="'.concat(n,'"></div>'):"",'\n                <div class="popup-content">\n                    <h4>').concat(e.title,"</h4>\n                    ").concat((i=e,i.listing_market?"<div>".concat(_(i.listing_region),", ").concat(_(i.listing_market),"</div>"):"<div>".concat(_(i.listing_region),"</div>")),"\n                    ").concat(function(e){var t=function(e){return(100*Math.round(e/100)).toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}(e.listing_total_square_footage);return e.listing_total_square_footage?'<div class="fcr-map-plugin__info">'.concat(t," ").concat(e.listing_opening_date,"</div>"):'<div class="fcr-map-plugin__info">'.concat(e.listing_opening_date,"</div>")}(e),"\n                </div>\n            </a>\n        ")};function y(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?v(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}!function(e){var t=document.getElementsByTagName("html")[0].getAttribute("lang"),i=window.innerWidth<768,n=i?"bottom":"right",r=i?150:0,o=null,s=null,a=!1;h().accessToken="pk.eyJ1IjoicGxheWdyb3VuZGluYyIsImEiOiJjazNha2U4a3kwZXJwM2VtaDlpNXBwMjM2In0.J32wMlmH9gNwKIPybohhFQ";var l=function(e){var t=document.createElement("div");t.className="map-marker";var i=[e.listing_longitude,e.listing_latitude],r=g(e),o=new(h().Marker)(t);return o.setLngLat(i),u(e)||o.setPopup(new(h().Popup)({anchor:n,offset:25,closeButton:!1,closeOnClick:!0}).setHTML(r)),o},c=function(e){s.addLayer({id:"markers",type:"symbol",source:{type:"geojson",data:{type:"FeatureCollection",features:e}}}),s.on("sourcedata",function(e){e.isSourceLoaded&&e.source.data&&e.source.data.features&&(a||(function(e){for(var t=0;t<e.length;t++){var i=e[t].properties,n=l(i);n.addTo(s),d(n,i)}if(e.length>1){var r=new(h().LngLatBounds);e.forEach(function(e){r.extend(e.geometry.coordinates)}),s.fitBounds(r,{padding:{top:100,bottom:100,left:100,right:100}})}}(e.source.data.features),a=!0))}),s.on("click",function(e){var t=s.querySourceFeatures("markers").map(function(e){return e.properties}),i=t.filter(function(e,t,i){return i.findIndex(function(t){return t.listing_slug===e.listing_slug})===t}),n=function(e,t){function i(e,t){return i=e.listing_latitude-t.listing_latitude,n=e.listing_longitude-t.listing_longitude,Math.sqrt(i*i+n*n);var i,n}return Object.values(t).reduce(function(t,n){return i(e,t)<i(e,n)?t:n})}({listing_longitude:e.lngLat.lng,listing_latitude:e.lngLat.lat},i),o=Number(n.listing_latitude),a=Number(n.listing_longitude);if(n){var l=s.getZoom()<17&&!u(n)?r:0;s.flyTo({center:[a,o],offset:[0,l]})}})},u=function(e){return e.listing_longitude===o.listing_longitude&&e.listing_latitude===o.listing_latitude},d=function(e,t){var i=e._element;u(t)&&i.classList.add("active")},f=function(e){o=e.data("post"),e.data("block"),fetch("fr-FR"==t?"/fr/wp-json/listings/all":"/wp-json/listings/all").then(function(e){return e.json()}
2).then(function(e){var t,i,n,r,a=o.nearby_radius||2,l=(t={lat:o.listing_latitude,lng:o.listing_longitude},i=a,n=e,Object.values(n).filter(function(e){var n=40075/360,r=Math.cos(Math.PI*t.lat/180)*n,o=Math.abs(t.lng-e.listing_longitude)*r,s=Math.abs(t.lat-e.listing_latitude)*n;return Math.sqrt(o*o+s*s)<=i}).filter(function(e){return!e.listing_has_children}));r=l.map(function(e){return{type:"Feature",geometry:{type:"Point",coordinates:[(t=e).listing_longitude,t.listing_latitude]},properties:p({},t),state:{hover:!1}};var t}),(s=new(h().Map)({container:"map-container",style:"mapbox://styles/mapbox/light-v10?optimize=true",center:[o.listing_longitude,Number(o.listing_latitude)],zoom:o.listing_zoom?o.listing_zoom:17,pitch:60,bearing:0,minZoom:3,maxZoom:19,keyboard:!0})).addControl(new(h().NavigationControl)),s.dragRotate.disable(),s.on("load",function(){c(r)})})};e(document).ready(function(){var t=e(".fcr-mini-map");t&&e(t).each(function(){f(e(this))})}),window.acf&&window.acf.addAction("render_block_preview/type=testimonial",f)}(jQuery);var x,b,w,T,S,E=(x=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'],b=function(){function e(t){var i=t.targetModal,n=t.triggers,r=void 0===n?[]:n,o=t.onShow,s=void 0===o?function(){}:o,a=t.onClose,l=void 0===a?function(){}:a,c=t.openTrigger,u=void 0===c?"data-micromodal-trigger":c,h=t.closeTrigger,d=void 0===h?"data-micromodal-close":h,f=t.openClass,p=void 0===f?"is-open":f,m=t.disableScroll,_=void 0!==m&&m,g=t.disableFocus,v=void 0!==g&&g,x=t.awaitCloseAnimation,b=void 0!==x&&x,w=t.awaitOpenAnimation,T=void 0!==w&&w,S=t.debugMode,E=void 0!==S&&S;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.modal="string"==typeof i?document.getElementById(i):i,this.config={debugMode:E,disableScroll:_,openTrigger:u,closeTrigger:d,openClass:p,onShow:s,onClose:l,awaitCloseAnimation:b,awaitOpenAnimation:T,disableFocus:v},r.length>0&&this.registerTriggers.apply(this,y(r)),this.onClick=this.onClick.bind(this),this.onKeydown=this.onKeydown.bind(this)}var t;return(t=[{key:"registerTriggers",value:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];i.filter(Boolean).forEach(function(t){t.addEventListener("click",function(t){return e.showModal(t)})})}},{key:"showModal",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.activeElement=document.activeElement,this.modal.setAttribute("aria-hidden","false"),this.modal.classList.add(this.config.openClass),this.scrollBehaviour("disable"),this.addEventListeners(),this.config.awaitOpenAnimation?this.modal.addEventListener("animationend",function t(){e.modal.removeEventListener("animationend",t,!1),e.setFocusToFirstNode()},!1):this.setFocusToFirstNode(),this.config.onShow(this.modal,this.activeElement,t)}},{key:"closeModal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.modal;if(this.modal.setAttribute("aria-hidden","true"),this.removeEventListeners(),this.scrollBehaviour("enable"),this.activeElement&&this.activeElement.focus&&this.activeElement.focus(),this.config.onClose(this.modal,this.activeElement,e),this.config.awaitCloseAnimation){var i=this.config.openClass;this.modal.addEventListener("animationend",function e(){t.classList.remove(i),t.removeEventListener("animationend",e,!1)},!1)}else t.classList.remove(this.config.openClass)}},{key:"closeModalByIdOrElement",value:function(e){this.modal="string"==typeof e?document.getElementById(e):e,this.modal&&this.closeModal()}},{key:"scrollBehaviour",value:function(e){if(this.config.disableScroll){var t=document.querySelector("body");switch(e){case"enable":Object.assign(t.style,{overflow:""});break;case"disable":Object.assign(t.style,{overflow:"hidden"})}}}},{key:"addEventListeners",value:function(){this.modal.addEventListener("touchstart",this.onClick),this.modal.addEventListener("click",this.onClick),document.addEventListener("keydown",this.onKeydown)}},{key:"removeEventListeners",value:function(){this.modal.removeEventListener("touchstart",this.onClick),this.modal.removeEventListener("click",this.onClick),document.removeEventListener("keydown",this.onKeydown)}},{key:"onClick",value:function(e){(e.target.hasAttribute(this.config.closeTrigger)||e.target.parentNode.hasAttribute(this.config.closeTrigger))&&(e.preventDefault(),e.stopPropagation(),this.closeModal(e))}}
2,{key:"onKeydown",value:function(e){27===e.keyCode&&this.closeModal(e),9===e.keyCode&&this.retainFocus(e)}},{key:"getFocusableNodes",value:function(){var e=this.modal.querySelectorAll(x);return Array.apply(void 0,y(e))}},{key:"setFocusToFirstNode",value:function(){var e=this;if(!this.config.disableFocus){var t=this.getFocusableNodes();if(0!==t.length){var i=t.filter(function(t){return!t.hasAttribute(e.config.closeTrigger)});i.length>0&&i[0].focus(),0===i.length&&t[0].focus()}}}},{key:"retainFocus",value:function(e){var t=this.getFocusableNodes();if(0!==t.length)if(t=t.filter(function(e){return null!==e.offsetParent}),this.modal.contains(document.activeElement)){var i=t.indexOf(document.activeElement);e.shiftKey&&0===i&&(t[t.length-1].focus(),e.preventDefault()),!e.shiftKey&&t.length>0&&i===t.length-1&&(t[0].focus(),e.preventDefault())}else t[0].focus()}}])&&function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}(),w=null,T=function(e){if("string"==typeof id?!document.getElementById(e):!e)return console.warn("MicroModal: ❗Seems like you have missed %c'".concat(e,"'"),"background-color: #f8f9fa;color: #50596c;font-weight: bold;","ID somewhere in your code. Refer example below to resolve it."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",'<div class="modal" id="'.concat(e,'"></div>')),!1},S=function(e,t){if(function(e){e.length<=0&&(console.warn("MicroModal: ❗Please specify at least one %c'micromodal-trigger'","background-color: #f8f9fa;color: #50596c;font-weight: bold;","data attribute."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",'<a href="#" data-micromodal-trigger="my-modal"></a>'))}(e),!t)return!0;for(var i in t)T(i);return!0},{init:function(e){var t=Object.assign({},{openTrigger:"data-micromodal-trigger"},e),i=y(document.querySelectorAll("[".concat(t.openTrigger,"]"))),n=function(e,t){var i=[];return e.forEach(function(e){var n=e.attributes[t].value;void 0===i[n]&&(i[n]=[]),i[n].push(e)}),i}(i,t.openTrigger);if(!0!==t.debugMode||!1!==S(i,n))for(var r in n){var o=n[r];t.targetModal=r,t.triggers=y(o),w=new b(t)}},show:function(e,t){var i=t||{};i.targetModal=e,!0===i.debugMode&&!1===T(e)||(w&&w.removeEventListeners(),(w=new b(i)).showModal())},close:function(e){e?w.closeModalByIdOrElement(e):w.closeModal()}});"undefined"!=typeof window&&(window.MicroModal=E);var I=E;function A(e){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A(e)}function M(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,C(n.key),n)}}function C(e){var t=function(e){if("object"!=A(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=A(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==A(t)?t:t+""}i(8497);var P=document.getElementsByTagName("html")[0].getAttribute("lang"),D=3e4,R=function(){return function(e,t){return t&&M(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._el=t,this._minField=t.find("#min-amount"),this._maxField=t.find("#max-amount"),this._range=t.find(".slider-range"),this._min=0,this._max=D,this._handleMin=null,this._handleMax=null,this._init()},[{key:"min",get:function(){return this._min}},{key:"max",get:function(){return this._max}},{key:"resetMinMax",value:function(){this._min=0,this._max=D,this._range.slider("option","values",[this._min,this._max]),this._updateFields(this._min,this._max)}},{key:"setMinMax",value:function(e,t){this._min=e,this._max=t,this._range.slider("option","values",[this._min,this._max]),this._updateFields(this._min,this._max)}},{key:"_updateFields",value:function(e,t){this._minField.text(this._formatNumber(e)+this._formatCopy(e)),this._maxField.text(this._formatNumber(t)+this._formatCopy(t)),this._el.find(".ui-slider-handle:first-of-type").attr("aria-valuenow",e),this._el.find(".ui-slider-handle:last-of-type").attr("aria-valuenow",t)}}
2,{key:"_formatNumber",value:function(e){return e==1/0&&(e=D),e.toString().replace(/,/g,"").replace(/\B(?=(\d{3})+(?!\d))/g,",")}},{key:"_formatCopy",value:function(e){var t=e==D||e==1/0?"+ ":"";return"fr-FR"==P?t+" pi. ca.":t+" sf"}},{key:"_init",value:function(){var e=this;this._range.slider({range:!0,min:0,max:D,values:[0,D],slide:function(t,i){e._updateFields(i.values[0],i.values[1])},change:function(t,i){e._min=i.values[0],e._max=i.values[1]==D?Number.POSITIVE_INFINITY:i.values[1]}}),this._handleMin=this._el.find(".ui-slider-handle:first-of-type"),this._handleMin.attr("id","ui-slider-handle-min"),this._handleMin.attr("aria-valuemin",0),this._handleMin.attr("aria-valuemax",D),this._handleMin.attr("role","slider"),this._handleMin.attr("aria-labelledby","#min-amount"),this._handleMin.attr("data-tabindex",1),this._handleMax=this._el.find(".ui-slider-handle:last-of-type"),this._handleMax.attr("id","ui-slider-handle-max"),this._handleMax.attr("aria-valuemin",0),this._handleMax.attr("aria-valuemax",D),this._handleMax.attr("role","slider"),this._handleMax.attr("aria-labelledby","#max-amount"),this._handleMax.attr("data-tabindex",2),this._updateFields(this._range.slider("values",0),this._range.slider("values",1))}}])}(),L=R;function z(e){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},z(e)}function O(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,F(n.key),n)}}function F(e){var t=function(e){if("object"!=z(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=z(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==z(t)?t:t+""}function k(e){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k(e)}function B(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function N(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?B(Object(i),!0).forEach(function(t){V(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):B(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function V(e,t,i){return(t=j(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function U(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,j(n.key),n)}}function j(e){var t=function(e){if("object"!=k(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=k(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==k(t)?t:t+""}function G(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(G=function(){return!!e})()}function q(e){return q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},q(e)}function H(e,t){return H=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},H(e,t)}function $(){var e=document.getElementById("fcr-filter-region");if(e){var t=wp.element.Component,i="fcr-map-plugin/store",n=wp.data.select(i),r=function(e){function t(e){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=function(e,t,i){return t=q(t),function(e,t){if(t&&("object"==k(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,G()?Reflect.construct(t,i||[],q(e).constructor):t.apply(e,i))}(this,t,[e])).state={listings:null,selected:n.getFilterByRegion(),provinces:[]},i.copy={Ontario:"L'Ontario","All Ontario":"Ensemble de l’Ontario","Toronto & Area":"Région de Toronto","Southwest Ontario":"Sud-Ouest de l’Ontario","All Quebec":"Ensemble du Québec",Quebec:"Le Québec","Montreal & Area":"Région de Montréal","Montréal":"Montréal","All Alberta":"Ensemble de l’Alberta",Alberta:"L’Alberta","All British Columbia":"Ensemble de la Colombie-Britannique","British Columbia":"Colombie-Britannique","Oakville & Burlington Area":"Région de Burlington","Vancouver & Area":"Région de Vancouver"},i.lang=document.getElementsByTagName("html")[0].getAttribute("lang"),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&H(e,t)}(t,e),function(e,t){return t&&U(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"_getOptions",value:function(e){e||console.warn("Make sure LISTINGS is set before attempting to filter!");var t=Object.values(e).map(function(e){return e.listing_province}),i=this._cleanArray(t),n={};
2return i.forEach(function(t){var i=Object.values(e).filter(function(e){return e.listing_slug==t})[0];i||console.error("No data for ".concat(t," was found. Check in the admin that the listing title is in English and matches the slug!")),n[t]={title:i.title,regions:Object.values(e).filter(function(e){return e.listing_province==t&&e.listing_has_children})}}),n}},{key:"_cleanArray",value:function(e){return e.filter(function(t,i){return t&&t.length>0&&e.indexOf(t)===i})}},{key:"_handleChange",value:function(e,t){var n=t||e.target.value;this.setState({selected:n}),t||(wp.data.dispatch(i).setFilterByRegion(n),wp.data.dispatch(i).setFilterByMarket("all"))}},{key:"_handleSubscribe",value:function(){var e=this.state,t=e.listings,i=e.provinces,r=e.selected;if(t&&0!==Object.entries(t).length)0==i.length&&this.setState({provinces:N({},this._getOptions(t))});else{var o=n.getListings();this.setState({listings:N({},o),provinces:this._getOptions(o)})}var s=n.getFilterByRegion();r!==s&&this._handleChange(null,s)}},{key:"componentDidMount",value:function(){var e=this;wp.data.subscribe(function(){e._handleSubscribe()}),this._handleSubscribe()}},{key:"getTranslation",value:function(e){return"fr-FR"==this.lang&&this.copy[e]?this.copy[e]:e}},{key:"render",value:function(){var e=this,t=this.state,i=t.provinces,n=t.selected;return wp.element.createElement("div",null,wp.element.createElement("select",{value:n,onChange:this._handleChange.bind(this)},wp.element.createElement("option",{value:"all"},"fr-FR"==this.lang?"Tous les marchés":"All Markets"),Object.keys(i).map(function(t){return wp.element.createElement("optgroup",{label:e.getTranslation(i[t].title)},wp.element.createElement("option",{value:t},e.getTranslation("All "+i[t].title)),Object.keys(i[t].regions).map(function(n){var r=i[t].regions[n];return wp.element.createElement("option",{value:r.listing_slug},e.getTranslation(r.title))}))})),wp.element.createElement("span",{className:"arrow"},wp.element.createElement("svg",{width:"11px",height:"14px",viewBox:"0 0 11 14",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},wp.element.createElement("defs",null,wp.element.createElement("rect",{id:"path-1",x:"0",y:"0",width:"11",height:"16"})),wp.element.createElement("g",{id:"Design-System",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"Filter/Tag",transform:"translate(-157.000000, -17.000000)"},wp.element.createElement("g",{id:"Tag"},wp.element.createElement("g",{id:"Icon",transform:"translate(157.000000, 16.000000)"},wp.element.createElement("mask",{id:"mask-2",fill:"white"},wp.element.createElement("use",{xlinkHref:"#path-1"})),wp.element.createElement("g",{id:"Container"}),wp.element.createElement("path",{d:"M5.48151878,1.9375 C5.75000423,1.9375 5.96765469,2.15515046 5.96765469,2.42363591 L5.96753887,13.3235 L9.91968518,9.3733005 C10.1000491,9.1929366 10.3924767,9.1929366 10.5728406,9.3733005 C10.7532045,9.55366439 10.7532045,9.84609205 10.5728406,10.0264559 L6.05257379,14.5467228 C5.71761227,14.8816843 5.18939794,14.9056101 4.82682888,14.6185002 L4.71191834,14.5123782 L4.71191834,14.5123782 L0.517924785,10.3183847 C0.328076903,10.1285368 0.328076903,9.82073255 0.517924785,9.63088466 C0.707772668,9.44103678 1.0155769,9.44103678 1.20542479,9.63088466 L4.99453887,13.4205 L4.99538287,2.42363591 C4.99538287,2.15515046 5.21303333,1.9375 5.48151878,1.9375 Z",id:"Path",fill:"#002745",mask:"url(#mask-2)"}))))))))}}])}(t);wp.element.render(wp.element.createElement(r,null),e)}}function W(e){return W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W(e)}function Z(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,X(n.key),n)}}function X(e){var t=function(e){if("object"!=W(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=W(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==W(t)?t:t+""}function Y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Y=function(){return!!e})()}
2function K(e){return K=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},K(e)}function J(e,t){return J=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},J(e,t)}function Q(){var e=document.getElementById("fcr-filter-market");if(e){var t=wp.element.Component,i="fcr-map-plugin/store",n=wp.data.select(i),r=function(e){function t(e){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=function(e,t,i){return t=K(t),function(e,t){if(t&&("object"==W(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Y()?Reflect.construct(t,i||[],K(e).constructor):t.apply(e,i))}(this,t,[e])).state={listings:n.getListings(),selectedRegion:n.getFilterByRegion(),selectedMarket:n.getFilterByMarket(),filtered:[]},i.lang=document.getElementsByTagName("html")[0].getAttribute("lang"),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&J(e,t)}(t,e),function(e,t){return t&&Z(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"_getOptions",value:function(e,t){return e||console.warn("Make sure LISTINGS is set before attempting to filter!"),Object.values(e).filter(function(e){return e.listing_has_children&&e.listing_region==t})}},{key:"_handleRegionChange",value:function(e){var t=this._getOptions(e);this.setState({selectedMarket:"all",selectedRegion:e,filtered:t})}},{key:"_handleMarketChange",value:function(e,t){var n=t||(e.target.value.length>0?e.target.value:"all");this.setState({selectedMarket:n}),t||wp.data.dispatch(i).setFilterByMarket(n)}},{key:"_isVisible",value:function(){var e=this.state.filtered;return window.innerWidth<1200||e.length>0}},{key:"_handleSubscribe",value:function(){var e=this.state,t=e.listings,i=e.filtered,r=e.selectedRegion,o=e.selectedMarket;if(t&&0!==Object.entries(t).length){if(0==i.length){var s=this._getOptions(t,r);this.setState({filtered:s})}var a=n.getFilterByRegion();r!==a&&this._handleRegionChange(a);var l=n.getFilterByMarket();o!==l&&this._handleMarketChange(null,l)}else{var c=n.getListings();this.setState({listings:c,filtered:this._getOptions(c,r)})}}},{key:"componentDidMount",value:function(){var e=this,t=this.state;t.listings,t.selectedRegion,wp.data.subscribe(function(){e._handleSubscribe()})}},{key:"render",value:function(){var e=this,t=this.state,i=t.filtered,n=t.selectedMarket,r={visibility:this._isVisible()?"visible":"hidden"};return wp.element.createElement("div",{style:r},wp.element.createElement("select",{value:n,onChange:function(t){return e._handleMarketChange(t)}},wp.element.createElement("option",{value:"all"},"fr-FR"==this.lang?"Tous les quartiers":"All Neighbourhoods"),i.map(function(e){return wp.element.createElement("option",{value:e.listing_slug},e.title)})),wp.element.createElement("span",{className:"arrow"},wp.element.createElement("svg",{width:"11px",height:"14px",viewBox:"0 0 11 14",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},wp.element.createElement("defs",null,wp.element.createElement("rect",{id:"path-1",x:"0",y:"0",width:"11",height:"16"})),wp.element.createElement("g",{id:"Design-System",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"Filter/Tag",transform:"translate(-157.000000, -17.000000)"},wp.element.createElement("g",{id:"Tag"},wp.element.createElement("g",{id:"Icon",transform:"translate(157.000000, 16.000000)"},wp.element.createElement("mask",{id:"mask-2",fill:"white"},wp.element.createElement("use",{xlinkHref:"#path-1"})),wp.element.createElement("g",{id:"Container"}),wp.element.createElement("path",{d:"M5.48151878,1.9375 C5.75000423,1.9375 5.96765469,2.15515046 5.96765469,2.42363591 L5.96753887,13.3235 L9.91968518,9.3733005 C10.1000491,9.1929366 10.3924767,9.1929366 10.5728406,9.3733005 C10.7532045,9.55366439 10.7532045,9.84609205 10.5728406,10.0264559 L6.05257379,14.5467228 C5.71761227,14.8816843 5.18939794,14.9056101 4.82682888,14.6185002 L4.71191834,14.5123782 L4.71191834,14.5123782 L0.517924785,10.3183847 C0.328076903,10.1285368 0.328076903,9.82073255 0.517924785,9.63088466 C0.707772668,9.44103678 1.0155769,9.44103678 1.20542479,9.63088466 L4.99453887,13.4205 L4.99538287,2.42363591 C4.99538287,2.15515046 5.21303333,1.9375 5.48151878,1.9375 Z",i
2d:"Path",fill:"#002745",mask:"url(#mask-2)"}))))))))}}])}(t);wp.element.render(wp.element.createElement(r,null),e)}}!function(e){var t="fcr-map-plugin/store",i=function(){return function(e,t){return t&&O(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function t(i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this._modal=i,this._space={min:0,max:3e4},this._usage=[],this._onlyFutureDevelopments=!1,this._tabPressed=!1,this._btnClose=this._modal.find(".btn--close"),this._btnClear=this._modal.find(".btn--clear"),this._btnSubmit=this._modal.find(".btn--submit"),this._usageFilter=this._modal.find(".fcr-filter-usage").find('input[type="checkbox"]'),this._onlyFutureDevelopmentsFilter=e("#fcr-filter-future-developments__checkbox"),this._filterSpace=new L(e("#fcr-filter-space")),this._setup()},[{key:"_submit",value:function(e){wp.data.dispatch(t).setFilterBySpaceMin(this._filterSpace.min),wp.data.dispatch(t).setFilterBySpaceMax(this._filterSpace.max),wp.data.dispatch(t).setFilterByUsage(this._usage),wp.data.dispatch(t).setFilterByOnlyFutureDevelopments(this._onlyFutureDevelopments),this.onClose()}},{key:"_clear",value:function(){this._usage=[],this._filterSpace.resetMinMax(),this._onlyFutureDevelopments=!1,this._usageFilter.each(function(t,i){var n=e(i);n.attr("name"),n.prop("checked",!1)}),this._onlyFutureDevelopmentsFilter.prop("checked",this._onlyFutureDevelopments)}},{key:"_updateFromInitialState",value:function(){var i=this,n=wp.data.select(t);this._space={min:n.getFilterBySpaceMin(),max:n.getFilterBySpaceMax()},this._usage=n.getFilterByUsage(),this._onlyFutureDevelopments=n.getFilterByOnlyFutureDevelopments(),this._filterSpace.setMinMax(this._space.min,this._space.max),this._usageFilter.each(function(t,n){var r=e(n),o=r.attr("name");r.prop("checked",i._usage.includes(o))}),this._onlyFutureDevelopmentsFilter.prop("checked",this._onlyFutureDevelopments)}},{key:"_setupFutureDevelopments",value:function(){var e=this;this._onlyFutureDevelopmentsFilter.click(function(t){e._onlyFutureDevelopmentsFilter.is(":checked")?e._onlyFutureDevelopments=!0:e._onlyFutureDevelopmentsFilter.is(":not(:checked)")&&(e._onlyFutureDevelopments=!1)})}},{key:"_setupUsage",value:function(){var t=this;this._usageFilter.each(function(i,n){var r=e(n);r.click(function(e){var i=r.attr("name");r.is(":checked")?t._usage.push(i):r.is(":not(:checked)")&&(t._usage=t._usage.filter(function(e){return e!==i}))})})}},{key:"_setup",value:function(){var t=this;this._setupUsage(),this._setupFutureDevelopments(),this._btnClose.click(function(e){return t.onClose()}),this._btnClear.click(function(e){return t._clear(e)}),this._btnSubmit.click(function(e){return t._submit(e)}),e(document).on("keydown",function(e){var i=e.keyCode||e.which;t._tabPressed=9==i}),e(document).on("keyup",function(e){t._tabPressed=!1}),e(document).on("focusout",function(e){t._tabPressed&&t._handleFocusOut(e)})}},{key:"_handleFocusOut",value:function(t){var i=e(t.target).data("tabindex")+1;i&&this._modal.find("[data-tabindex="+i+"]").focus()}},{key:"onOpen",value:function(){e("html, body").css("overflow","hidden"),this._updateFromInitialState(),I.show("modal")}},{key:"onClose",value:function(){e("html, body").css("overflow","auto"),I.close("modal")}}])}();if(e("#modal"),e(".btn--modal")){var n=new i(e("#modal"));I.init({onShow:function(e){return n.onOpen()},onClose:function(e){return n.onClose()}})}}(jQuery),jQuery(document).ready(function(){var e;/(trident|msie)/i.test(navigator.userAgent)&&document.getElementById&&window.addEventListener&&window.addEventListener("hashchange",function(){var e,t=location.hash.substring(1);/^[A-z0-9_-]+$/.test(t)&&(e=document.getElementById(t))&&(/^(?:a|select|input|button|textarea)$/i.test(e.tagName)||(e.tabIndex=-1),e.focus())},!1),function(e){e(".header-mainnav__item-link-haschildren");var t=e(".header"),i=e(".header-mainnav"),n=e("body"),r="header-mainnav__item-link--active",o="header-mainnav__item-link--current";function s(){e(".header-mobile__list").removeClass("header-mobile__list--active"),e(".header-mobile__subsection").removeClass("header-mobile__subsection--active"),e(".header-mobile__menu-logo").removeClass("header-mobile__menu-logo--active"),e(".header-mobile__submenu").removeClass("header-mobile__submenu--active")}e(".header-mobile__item-link-haschildren").on("click",function(t){t.preventDefault();
2var i=e(this).data("id"),n=e("#".concat(i)),r=n.find("li:first-child a");e(".header-mobile__list").addClass("header-mobile__list--active"),n.addClass("header-mobile__subsection--active"),e(".header-mobile__back").addClass("header-mobile__back--active"),r.focus(),e(".header-mobile__menu-logo").addClass("header-mobile__menu-logo--active")}),e(".header-mobile__close").on("click",function(t){t.preventDefault(),e("#header-mobile-back").removeClass("header-mobile__back--active"),s()}),e("#header-mobile-back").on("click",function(t){t.preventDefault(),e(this).removeClass("header-mobile__back--active"),s()}),e("#header-mobile-open").on("click",function(t){t.preventDefault(),e(this).addClass("header-mobile__open--active").attr("aria-expanded",!0),e(".header-mobile__close").addClass("header-mobile__close--active").attr("aria-expanded",!0).focus(),e(".header-mobile").addClass("header-mobile--active")}),e("#header-mobile-close").on("click",function(t){t.preventDefault(),e(this).removeClass("header-mobile__close--active").attr("aria-expanded",!1),e(".header-mobile__open").removeClass("header-mobile__open--active").attr("aria-expanded",!1).focus(),e(".header-mobile").removeClass("header-mobile--active")}),e(window).on("resize",function(){var a=e(window).outerWidth();a>1200?(e("#header-mobile-back").removeClass("header-mobile__back--active"),e(".header-mobile").removeClass("header-mobile--active"),e(".header-mobile__close").removeClass("header-mobile__close--active"),e(".header-mobile__open").removeClass("header-mobile__open--active"),s()):a<=1200&&(n.removeClass("no-scroll"),t.removeClass("header--active"),i.removeClass("header-mainnav--active"),e(".".concat(r)).removeClass(r),e(".".concat(o)).removeClass(o))})}(jQuery),(e=jQuery)(".accordion__trigger--enabled").on("click",function(t){t.preventDefault();var i=e(this),n=i.attr("aria-controls"),r=i.parents(".accordion__container").find("#".concat(n)),o=i.parent(),s=i.parents(".list__container-list--item");i.hasClass("accordion__trigger--closed")?(o.addClass("open-title"),i.removeClass("accordion__trigger--closed").addClass("accordion__trigger--open").attr("aria-expanded",!0),r.addClass("accordion__content--open"),s.toggleClass("fcr-divider")):(e(".open-title").removeClass("open-title"),i.removeClass("accordion__trigger--open").addClass("accordion__trigger--closed").attr("aria-expanded",!1),r.removeClass("accordion__content--open"),s.toggleClass("fcr-divider"))}),function(e){var i=e(".grid-to-carousel");i&&i.each(function(n){var r=e(this),o=i[n],s=new(t())(o,{contain:!0,pageDots:!1,watchCSS:!0,percentPosition:!1,imagesLoaded:!0,cellAlign:"left",cellSelector:".fcr-person-block"});if(e(window).width()>768){var a=s.element.children.length-1;r.find(".total-slide").html(a)}else{var l=s.cells.length;r.find(".total-slide").html(l)}var c=1;r.find(".current-slide").html(c),s.on("change",function(){c=s.selectedIndex+1,r.find(".current-slide").html(c)})})}(jQuery),function(e){var i=document.querySelector(".image-carousel-block");if(i){var n={imagesLoaded:!0,contain:!0,pageDots:!1,watchCSS:!0,cellAlign:"left",percentPosition:!1,cellSelector:".image-carousel-cell",draggable:!0,on:{ready:function(){var t=e(i).find(".flickity-button-icon");e.each(t,function(t,i){e(i).attr("aria-hidden","true")})}}},r=new(t())(i,n),o=r.cells.length,s=1;e(".slide-counter .total-slide").html(o),e(".slide-counter .current-slide").html(s),r.on("change",function(){s=r.selectedIndex+1,e(".slide-counter .current-slide").html(s)}),e(window).load(function(){window.dispatchEvent(new Event("resize"))})}}(jQuery),function(e){var t=e(".accordion");t.length&&e.each(t,function(t,i){var n=e(i).find(".accordion-row");e.each(n,function(t,i){var n=e(i);if(n.hasClass("accordion-row--updated")){var r=n.find("h3, .h4");r.find("button").on("click",function(){r.toggleClass("active").siblings("div").toggleClass("active"),r.hasClass("active")?e(this).attr("aria-expanded",!0).attr("aria-pressed",!0):e(this).attr("aria-expanded",!1).attr("aria-pressed",!1)})}else n.find("h3").on("click",function(){e(this).toggleClass("active").siblings("div").toggleClass("active")})})})}(jQuery),n(jQuery),l(jQuery,".carousel"),l(jQuery,".hero__carousel",{fade:!0}),l(jQuery,".featured-neighbourhood-carousel"),c(jQuery),function(e){var t=e("form.search-widget"),i=e("button.search-submit"),n=e(".search-widget__input"),r=function(){t.hasClass("active")||t.addClass("active")},o=function(){t.hasClass("active")&&t.removeClass("active")};i.on("focusin mouseover",function(){r()}),i.on("focusout mouseout",function(){o()}),n.on("focusin mouseover",function(){r()}),n.on("focusout mouseout",function(){o()})}(jQuery),function(e){var t=e(".fcr-alert-bar");if(t.length){var i=t.find(".fcr-alert-bar__close"),n=t.find(".row"),r=t.outerHeight();t.css({position:"fixed"}),e("body").css({paddingTop:r}),i.on("click",function(){r=t.outerHeight(),n.animate({opacity:0}
2,250),t.animate({height:"-=".concat(r),padding:0},500,function(){t.remove()}),e("body").animate({paddingTop:"-=".concat(r)},500)}),e(window).on("resize",function(){r=t.outerHeight(),e("body").css({paddingTop:r})})}}(jQuery),function(e){var t=e(".wpml-ls");if(t.length&&t.length>0){var i=t.find(".wpml-ls-item");e.each(i,function(t,i){e(i).hasClass("wpml-ls-current-language")&&e(i).find("a.wpml-ls-link").attr("aria-selected",!0)})}}(jQuery),$(),Q(),jQuery(["data-modal"]).length>0&&I.init({openTrigger:"data-custom-open",closeTrigger:"data-custom-close"})})}()}();

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.