text: (window.webpackJsonp=window.webpackJsonp||[]).push([[1],{2456:function(t,e,n){"use strict";var r=n(2535),i=n(2484),o=n(2485),a=n(2536),s=n(2497),u=n(2513),l=n(2807),c=n(2622),h=n(2695);function p(t,e,n){var r=new h.a(3);return r[0]=t,r[1]=e,r[2]=n,r}function f(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}d=new h.a(3),h.a!=Float32Array&&(d[0]=0,d[1]=0,d[2]=0),m=d;var d,m,y=[0,0,0],v=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(i.a)(this,e),t=Object(a.a)(this,Object(s.a)(e).call(this,3)),Array.isArray(n)&&1===arguments.length?t.copy(n):t.set(n,r,o),t}return Object(u.a)(e,t),Object(o.a)(e,[{key:"angle",value:function(t){return function(t,e){var n=p(t[0],t[1],t[2]),r=p(e[0],e[1],e[2]);f(n,n),f(r,r);var i=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}(n,r);return i>1?0:i<-1?Math.PI:Math.acos(i)}(this,t)}},{key:"cross",value:function(t){return function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a}(this,this,t),this.check()}},{key:"rotateX",value:function(t){var e=t.radians,n=t.origin;return function(t,e,n,r){var i=[],o=[];i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2]}(this,this,void 0===n?y:n,e),this.check()}},{key:"rotateY",value:function(t){var e=t.radians,n=t.origin;return function(t,e,n,r){var i=[],o=[];i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2]}(this,this,void 0===n?y:n,e),this.check()}},{key:"rotateZ",value:function(t){var e=t.radians,n=t.origin;return function(t,e,n,r){var i=[],o=[];i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2]}(this,this,void 0===n?y:n,e),this.check()}},{key:"operation",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return t.apply(void 0,[this,this].concat(n)),this.check()}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(t){return this[2]=Object(c.a)(t)}}]),e}(l.a),g=n(2572),_=n(2514),x=n.n(_),b=n(2515),w=n.n(b),E=n(2516),S=n.n(E),T=n(2570),k=n.n(T),M=n(2571),A=n.n(M),P=n(2855),z=n.n(P),I=n(2694);n.d(e,"l",(function(){return R})),n.d(e,"i",(function(){return B})),n.d(e,"g",(function(){return F})),n.d(e,"j",(function(){return j})),n.d(e,"b",(function(){return V})),n.d(e,"a",(function(){return N})),n.d(e,"f",(function(){return U})),n.d(e,"e",(function(){return q})),n.d(e,"d",(function(){return Z})),n.d(e,"c",(function(){return G})),n.d(e,"k",(function(){return X})),n.d(e,"h",(function(){return W}));var C=Math.PI,L=C/4,O=C/180,D=180/C;function R(t){return Math.pow(2,t)}function B(t){return Math.log2(t)}function F(t,e){var n=Object(r.a)(t,2),i=n[0],o=n[1]*O;return[(e*=512)*(i*O+C)/(2*C),e*(C-Math.log(Math.tan(L+.5*o)))/(2*C)]}function j(t,e){var n=Object(r.a)(t,2),i=n[0],o=n[1],a=i/(e*=512)*(2*C)-C,s=2*(Math.atan(Math.exp(C-o/e*(2*C)))-L);return[a*D,s*D]}function V(t){var e=t.latitude;return Object(I.a)(Number.isFinite(e)),B(4003e4*Math.cos(e*O))-9}function N(t){var e=t.latitude,n=t.longitude,r=t.zoom,i=t.scale,o=t.highPrecision,a=void 0!==o&&o;i=void 0!==i?i:R(r),Object(I.a)(Number.isFinite(e)&&Number.isFinite(n)&&Number.isFinite(i));var s={},u=512*i,l=Math.cos(e*O),c=u/360,h=c/l,p=u/4003e4/l;if(s.pixelsPerMeter=[p,p,p],s.metersPerPixel=[1/p,1/p,1/p],s.pixelsPerDegree=[c,h,p],s.degreesPerPixel=[1/c,1/h,1/p],a){var f=O*Math.tan(e*O)/l,d=c*f/2,m=u/4003e4*f,y=m/h*p;s.pixelsPerDegree2=[0,d,m],s.pixelsPerMeter2=[y,0,y]}return s}function U(t){var e=t.longitude,n=t.latitude,r=t.zoom,i=t.scale,o=t.meterOffset,a=t.distanceScales,s=void 0===a?null:a,u=F([e,n],i=void 0!==i?i:R(r)),l=new v(u[0],u[1],0);if(o){s=s||N({latitude:n,longitude:e,scale:i});var c=new v(o).scale(s.pixelsPerMeter).scale([1,-1,1]);l.add(c)}return l}function q(t){var e=t.height,n=t.pitch,r=t.bearing,i=t.altitude,o=t.center,a=void 0===o?null:o,s=t.flipY,u=void 0!==s&&s,l=Object(g.a)();return S()(l,l,[0,0,-i]),w()(l,l,[1,1,1/e]),k()(l,l,-n*O),A()(l,l,r*O),u&&w()(l,l,[1,-1,1]),a&&S()(l,l,new v(a).negate()),l}function Z(t){var e=t.width,n=t.height,r=t.altitude,i=void 0===r?1.5:r,o=t.pitch,a=void 0===o?0:o,s=t.farZMultiplier,u=void 0===s?1:s,l=a*O,c=Math.atan(.5/i),h=Math.sin(c)*i/Math.sin(Math.PI/2-l-c),p=Math.cos(Math.PI/2-l)*h+i;return{fov:2*Math.atan(n/2/i),aspect:e/n,focalDistance:i,near:.1,far:p*u}}function G(t){var e=t.width,n=t.height,r=t.pitch,i=t.altitude,o=t.farZMultiplier,a=Z({width:e,height:n,altitude:i,pitch:r,farZMultiplier:void 0===o?10:o}),s=a.fov,u=a.aspect,l=a.near,c=a.far;return x()([],s,u,l,c)}function X(t,e){var n=Object(r.a)(t,3),i=n[0],o=n[1],a=n[2],s=void 0===a?0:a;return Object(I.a)(Number.isFinite(i)&&Number.isFinite(o)&&Number.isFinite(s)),Object(g.d)(e,[i,o,s,1])}function W(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=Object(r.a)(t,3),o=i[0],a=i[1],s=i[2];if(Object(I.a)(Number.isFinite(o)&&Number.isFinite(a)),Number.isFinite(s)){var u=Object(g.d)(e,[o,a,s,1]);return u}var l=Object(g.d)(e,[o,a,0,1]),c=Object(g.d)(e,[o,a,1,1]),h=l[2],p=c[2],f=h===p?0:((n||0)-h)/(p-h);return z()([],l,c,f)}},2457:function(t,e,n){"use strict";n.r(e);var r=n(2493);n.d(e,"default",(function(){return r.a})),n.d(e,"WebMercatorViewport",(function(){return r.a}));var i=n(2623);n.d(e,"fitBounds",(function(){return i.a}));var o=n(2697);n.d(e,"normalizeViewportProps",(function(){return o.a}));var a=n(2808);n.d(e,"flyToViewport",(function(){return a.a}));var s=n(2456);n.d(e,"lngLatToWorld",(function(){return s.g})),n.d(e,"worldToLngLat",(function(){return s.j})),n.d(e,"worldToPixels",(function(){return s.k})),n.d(e,"pixelsToWorld",(function(){return s.h})),n.d(e,"getMeterZoom",(function(){return s.b})),n.d(e,"getDistanceScales",(function(){return s.a})),n.d(e,"getWorldPosition",(function(){return s.f})),n.d(e,"getViewMatrix",(function(){return s.e})),n.d(e,"getProjectionMatrix",(function(){return s.c})),n.d(e,"getProjectionParameters",(function(){return s.d})),n.d(e,"PerspectiveMercatorViewport",(function(){return r.a})),n.d(e,"getUncenteredViewMatrix",(function(){return s.e})),n.d(e,"projectFlat",(function(){return s.g})),n.d(e,"unprojectFlat",(function(){return s.j}))},2472:function(t,e,n){"use strict";n.r(e);var r=n(1),i=n(0),o=n.n(i);function a(t){return!(!t||!t["@@__IMMUTABLE_MAP__@@"])}function s(t,e){var n=t.get("sources"),r=e.get("sources"),i=[],o=[],a=[],s=n.keySeq().toArray(),u=r.keySeq().toArray(),l=!0,c=!1,h=void 0;try{for(var p,f=s[Symbol.iterator]();!(l=(p=f.next()).done);l=!0){var d=p.value,m=r.get(d);m?!m.equals(n.get(d))&&o.push({id:d,source:r.get(d)}):a.push({id:d,source:n.get(d)})}}catch(t){c=!0,h=t}finally{try{l||null==f.return||f.return()}finally{if(c)throw h}}var y=!0,v=!1,g=void 0;try{for(var _,x=u[Symbol.iterator]();!(y=(_=x.next()).done);y=!0){var b=_.value;n.get(b)||i.push({id:b,source:r.get(b)})}}catch(t){v=!0,g=t}finally{try{y||null==x.return||x.return()}finally{if(v)throw g}}return{enter:i,update:o,exit:a}}function u(t,e){var n=t.get("layers"),r=e.get("layers"),i=[],o=[],a={},s={};r.forEach((function(t,e){var n=t.get("id"),i=r.get(e+1);s[n]={layer:t,id:n,before:i?i.get("id"):null,enter:!0}})),n.forEach((function(t,e){var r=t.get("id"),i=n.get(e+1);a[r]={layer:t,id:r,before:i?i.get("id"):null},s[r]?s[r].enter=!1:o.push(a[r])}));var u=!0,l=!1,c=void 0;try{for(var h,p=r.reverse()[Symbol.iterator]();!(u=(h=p.next()).done);u=!0){var f=h.value.get("id");a[f]&&a[f].layer.equals(s[f].layer)&&a[f].before===s[f].before||i.push(s[f])}}catch(t){l=!0,c=t}finally{try{u||null==p.return||p.return()}finally{if(l)throw c}}return{updates:i,exiting:o}}function l(t,e,n){function r(t){return t.map((function(){return!0})).delete("layers").delete("sources").toJS()}var i=t&&r(t)||{},o=r(e);if(t&&(a=Object.keys(i),l=Object.keys(o),a.length===l.length&&!l.some((function(n){return t.get(n)!==e.get(n)})))){var a,l,h=function(t,e){return{sourcesDiff:s(t,e),layersDiff:u(t,e)}}(t,e),p=h.sourcesDiff,f=h.layersDiff;(function(t,e){var n=t.map((function(t){return t.id})),r=e.filter((function(t){return n.includes(t.get("source"))}));if(r.size)throw new Error("You must remove any layers associated with sources you are removing: ".concat(r.map((function(t){return t.get("id")})).toJS().join("")))})(p.exit,e.get("layers")),function(t,e,n,r){if(r.updates.some((function(t){return t.layer.get("ref")})))return void t.setStyle(e.toJS());var i=!0,o=!1,a=void 0;try{for(var s,u,l=n.enter[Symbol.iterator]();!(i=(s=l.next()).done);i=!0)u=s.value,t.addSource(u.id,u.source.toJS())}catch(t){o=!0,a=t}finally{try{i||null==l.return||l.return()}finally{if(o)throw a}}var h=!0,p=!1,f=void 0;try{for(var d,m,y=n.update[Symbol.iterator]();!(h=(d=y.next()).done);h=!0)m=d.value,c(t,m)}catch(t){p=!0,f=t}finally{try{h||null==y.return||y.return()}finally{if(p)throw f}}var v=!0,g=!1,_=void 0;try{for(var x,b,w=r.exiting[Symbol.iterator]();!(v=(x=w.next()).done);v=!0)b=x.value,t.style.getLayer(b.id)&&t.removeLayer(b.id)}catch(t){g=!0,_=t}finally{try{v||null==w.return||w.return()}finally{if(g)throw _}}var E=!0,S=!1,T=void 0;try{for(var k,M,A=r.updates[Symbol.iterator]();!(E=(k=A.next()).done);E=!0)(M=k.value).enter||t.removeLayer(M.id),t.addLayer(M.layer.toJS(),M.before)}catch(t){S=!0,T=t}finally{try{E||null==A.return||A.return()}finally{if(S)throw T}}var P=!0,z=!1,I=void 0;try{for(var C,L,O=n.exit[Symbol.iterator]();!(P=(C=O.next()).done);P=!0)L=C.value,t.removeSource(L.id)}catch(t){z=!0,I=t}finally{try{P||null==O.return||O.return()}finally{if(z)throw I}}}(n,e,p,f)}else n.setStyle(e.toJS())}function c(t,e){var n=e.source.toJS();if("geojson"===n.type){var r=t.getSource(e.id);if("geojson"===r.type){var i=r.workerOptions,o=i.geojsonVtOptions.extent/512;if(!(void 0!==n.maxzoom&&n.maxzoom!==i.geojsonVtOptions.maxZoom||void 0!==n.buffer&&n.buffer!==i.geojsonVtOptions.buffer/o||void 0!==n.tolerance&&n.tolerance!==i.geojsonVtOptions.tolerance/o||void 0!==n.cluster&&n.cluster!==i.cluster||void 0!==n.clusterRadius&&n.clusterRadius!==i.superclusterOptions.radius/o||void 0!==n.clusterMaxZoom&&n.clusterMaxZoom!==i.superclusterOptions.maxZoom))return void r.setData(n.data)}}t.removeSource(e.id),t.addSource(e.id,n)}var h=n(2484),p=n(2485),f=n(2536),d=n(2497),m=n(2513),y=n(266),v=n(2535),g="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var _,x;_=new g(4),g!=Float32Array&&(_[0]=0,_[1]=0,_[2]=0,_[3]=0),x=_;function b(t,e){var n=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}([],e,t);return function(t,e,n){t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n}(n,n,1/n[3]),n}function w(t,e){var n=t%e;return n<0?e+n:n}function E(t,e,n){return n*e+(1-n)*t}function S(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],p=e[10],f=e[11],d=e[12],m=e[13],y=e[14],v=e[15],g=n*s-r*a,_=n*u-i*a,x=n*l-o*a,b=r*u-i*s,w=r*l-o*s,E=i*l-o*u,S=c*m-h*d,T=c*y-p*d,k=c*v-f*d,M=h*y-p*m,A=h*v-f*m,P=p*v-f*y,z=g*P-_*A+x*M+b*k-w*T+E*S;return z?(z=1/z,t[0]=(s*P-u*A+l*M)*z,t[1]=(i*A-r*P-o*M)*z,t[2]=(m*E-y*w+v*b)*z,t[3]=(p*w-h*E-f*b)*z,t[4]=(u*k-a*P-l*T)*z,t[5]=(n*P-i*k+o*T)*z,t[6]=(y*x-d*E-v*_)*z,t[7]=(c*E-p*x+f*_)*z,t[8]=(a*A-s*k+l*S)*z,t[9]=(r*k-n*A-o*S)*z,t[10]=(d*w-m*x+v*g)*z,t[11]=(h*x-c*w-f*g)*z,t[12]=(s*T-a*M-u*S)*z,t[13]=(n*M-r*T+i*S)*z,t[14]=(m*_-d*b-y*g)*z,t[15]=(c*b-h*_+p*g)*z,t):null}function T(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],m=e[12],y=e[13],v=e[14],g=e[15],_=n[0],x=n[1],b=n[2],w=n[3];return t[0]=_*r+x*s+b*h+w*m,t[1]=_*i+x*u+b*p+w*y,t[2]=_*o+x*l+b*f+w*v,t[3]=_*a+x*c+b*d+w*g,_=n[4],x=n[5],b=n[6],w=n[7],t[4]=_*r+x*s+b*h+w*m,t[5]=_*i+x*u+b*p+w*y,t[6]=_*o+x*l+b*f+w*v,t[7]=_*a+x*c+b*d+w*g,_=n[8],x=n[9],b=n[10],w=n[11],t[8]=_*r+x*s+b*h+w*m,t[9]=_*i+x*u+b*p+w*y,t[10]=_*o+x*l+b*f+w*v,t[11]=_*a+x*c+b*d+w*g,_=n[12],x=n[13],b=n[14],w=n[15],t[12]=_*r+x*s+b*h+w*m,t[13]=_*i+x*u+b*p+w*y,t[14]=_*o+x*l+b*f+w*v,t[15]=_*a+x*c+b*d+w*g,t}function k(t,e,n){var r,i,o,a,s,u,l,c,h,p,f,d,m=n[0],y=n[1],v=n[2];return e===t?(t[12]=e[0]*m+e[4]*y+e[8]*v+e[12],t[13]=e[1]*m+e[5]*y+e[9]*v+e[13],t[14]=e[2]*m+e[6]*y+e[10]*v+e[14],t[15]=e[3]*m+e[7]*y+e[11]*v+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=l,t[7]=c,t[8]=h,t[9]=p,t[10]=f,t[11]=d,t[12]=r*m+s*y+h*v+e[12],t[13]=i*m+u*y+p*v+e[13],t[14]=o*m+l*y+f*v+e[14],t[15]=a*m+c*y+d*v+e[15]),t}function M(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function A(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],l=t[7],c=t[8],h=t[9],p=t[10],f=t[11],d=t[12],m=t[13],y=t[14],v=t[15],g=e[0],_=e[1],x=e[2],b=e[3],w=e[4],E=e[5],S=e[6],T=e[7],k=e[8],M=e[9],A=e[10],P=e[11],z=e[12],I=e[13],C=e[14],L=e[15];return Math.abs(n-g)<=1e-6*Math.max(1,Math.abs(n),Math.abs(g))&&Math.abs(r-_)<=1e-6*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(i-x)<=1e-6*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-b)<=1e-6*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(a-w)<=1e-6*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(s-E)<=1e-6*Math.max(1,Math.abs(s),Math.abs(E))&&Math.abs(u-S)<=1e-6*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(l-T)<=1e-6*Math.max(1,Math.abs(l),Math.abs(T))&&Math.abs(c-k)<=1e-6*Math.max(1,Math.abs(c),Math.abs(k))&&Math.abs(h-M)<=1e-6*Math.max(1,Math.abs(h),Math.abs(M))&&Math.abs(p-A)<=1e-6*Math.max(1,Math.abs(p),Math.abs(A))&&Math.abs(f-P)<=1e-6*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(d-z)<=1e-6*Math.max(1,Math.abs(d),Math.abs(z))&&Math.abs(m-I)<=1e-6*Math.max(1,Math.abs(m),Math.abs(I))&&Math.abs(y-C)<=1e-6*Math.max(1,Math.abs(y),Math.abs(C))&&Math.abs(v-L)<=1e-6*Math.max(1,Math.abs(v),Math.abs(L))}function P(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function z(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function I(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function C(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}var L=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t};!function(){var t=function(){var t=new g(2);return g!=Float32Array&&(t[0]=0,t[1]=0),t}()}();!function(){var t=function(){var t=new g(3);return g!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}()}();function O(t,e){if(!t)throw new Error(e||"viewport-mercator-project: assertion failed.")}var D=Math.PI,R=D/4,B=D/180,F=180/D;function j(t){return Math.pow(2,t)}function V(t){return Math.log2(t)}function N(t,e){var n=Object(v.a)(t,2),r=n[0],i=n[1];O(Number.isFinite(r)&&Number.isFinite(e)),O(Number.isFinite(i)&&i>=-90&&i<=90,"invalid latitude");var o=i*B;return[(e*=512)*(r*B+D)/(2*D),e*(D-Math.log(Math.tan(R+.5*o)))/(2*D)]}function U(t,e){var n=Object(v.a)(t,2),r=n[0],i=n[1],o=r/(e*=512)*(2*D)-D,a=2*(Math.atan(Math.exp(D-i/e*(2*D)))-R);return[o*F,a*F]}function q(t){var e=t.latitude,n=t.longitude,r=t.zoom,i=t.scale,o=t.highPrecision,a=void 0!==o&&o;i=void 0!==i?i:j(r),O(Number.isFinite(e)&&Number.isFinite(n)&&Number.isFinite(i));var s={},u=512*i,l=Math.cos(e*B),c=u/360,h=c/l,p=u/4003e4/l;if(s.pixelsPerMeter=[p,-p,p],s.metersPerPixel=[1/p,-1/p,1/p],s.pixelsPerDegree=[c,-h,p],s.degreesPerPixel=[1/c,-1/h,1/p],a){var f=B*Math.tan(e*B)/l,d=c*f/2,m=u/4003e4*f,y=m/h*p;s.pixelsPerDegree2=[0,-d,m],s.pixelsPerMeter2=[y,0,y]}return s}function Z(t){var e=t.height,n=t.pitch,r=t.bearing,i=t.altitude,o=t.center,a=void 0===o?null:o,s=t.flipY,u=void 0!==s&&s,l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return k(l,l,[0,0,-i]),M(l,l,[1,1,1/e]),function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],l=e[8],c=e[9],h=e[10],p=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+l*r,t[5]=a*i+c*r,t[6]=s*i+h*r,t[7]=u*i+p*r,t[8]=l*i-o*r,t[9]=c*i-a*r,t[10]=h*i-s*r,t[11]=p*i-u*r}(l,l,-n*B),function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],l=e[4],c=e[5],h=e[6],p=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+l*r,t[1]=a*i+c*r,t[2]=s*i+h*r,t[3]=u*i+p*r,t[4]=l*i-o*r,t[5]=c*i-a*r,t[6]=h*i-s*r,t[7]=p*i-u*r}(l,l,r*B),u&&M(l,l,[1,-1,1]),a&&k(l,l,function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}([],a)),l}function G(t){var e=t.width,n=t.height,r=t.pitch,i=function(t){var e=t.width,n=t.height,r=t.altitude,i=void 0===r?1.5:r,o=t.pitch,a=void 0===o?0:o,s=t.nearZMultiplier,u=void 0===s?1:s,l=t.farZMultiplier,c=void 0===l?1:l,h=a*B,p=Math.atan(.5/i),f=Math.sin(p)*i/Math.sin(Math.PI/2-h-p),d=Math.cos(Math.PI/2-h)*f+i;return{fov:2*Math.atan(n/2/i),aspect:e/n,focalDistance:i,near:u,far:d*c}}({width:e,height:n,altitude:t.altitude,pitch:r,nearZMultiplier:t.nearZMultiplier,farZMultiplier:t.farZMultiplier});return function(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}([],i.fov,i.aspect,i.near,i.far)}function X(t,e){var n=Object(v.a)(t,3),r=n[0],i=n[1],o=n[2],a=void 0===o?0:o;return O(Number.isFinite(r)&&Number.isFinite(i)&&Number.isFinite(a)),b(e,[r,i,a,1])}function W(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Object(v.a)(t,3),i=r[0],o=r[1],a=r[2];if(O(Number.isFinite(i)&&Number.isFinite(o),"invalid pixel coordinate"),Number.isFinite(a)){var s=b(e,[i,o,a,1]);return s}var u=b(e,[i,o,0,1]),l=b(e,[i,o,1,1]),c=u[2],h=l[2],p=c===h?0:((n||0)-c)/(h-c);return C([],u,l,p)}var H=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function Y(t){var e=t.width,n=t.height,r=t.bounds,i=t.minExtent,o=void 0===i?0:i,a=t.maxZoom,s=void 0===a?24:a,u=t.padding,l=void 0===u?0:u,c=t.offset,h=void 0===c?[0,0]:c,p=Object(v.a)(r,2),f=Object(v.a)(p[0],2),d=f[0],m=f[1],y=Object(v.a)(p[1],2),g=y[0],_=y[1];if(Number.isFinite(l)){l={top:l,bottom:l,left:l,right:l}}else O(Number.isFinite(l.top)&&Number.isFinite(l.bottom)&&Number.isFinite(l.left)&&Number.isFinite(l.right));var x=new K({width:e,height:n,longitude:0,latitude:0,zoom:0}),b=x.project([d,_]),w=x.project([g,m]),E=[Math.max(Math.abs(w[0]-b[0]),o),Math.max(Math.abs(w[1]-b[1]),o)],S=[e-l.left-l.right-2*Math.abs(h[0]),n-l.top-l.bottom-2*Math.abs(h[1])];O(S[0]>0&&S[1]>0);var T=S[0]/E[0],k=S[1]/E[1],M=(l.right-l.left)/2/T,A=(l.bottom-l.top)/2/k,P=[(w[0]+b[0])/2+M,(w[1]+b[1])/2+A],z=x.unproject(P),I=x.zoom+Math.log2(Math.abs(Math.min(T,k)));return{longitude:z[0],latitude:z[1],zoom:Math.min(I,s)}}var K=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.width,i=n.height,o=n.latitude,a=void 0===o?0:o,s=n.longitude,u=void 0===s?0:s,l=n.zoom,c=void 0===l?0:l,p=n.pitch,m=void 0===p?0:p,v=n.bearing,g=void 0===v?0:v,_=n.altitude,x=void 0===_?1.5:_,b=n.nearZMultiplier,w=n.farZMultiplier;Object(h.a)(this,e),r=r||1,i=i||1;var E=j(c);x=Math.max(.75,x);var S=N([u,a],E);S[2]=0;var T=G({width:r,height:i,pitch:m,bearing:g,altitude:x,nearZMultiplier:b||1/i,farZMultiplier:w||1.01}),k=Z({height:i,center:S,pitch:m,bearing:g,altitude:x,flipY:!0});return(t=Object(f.a)(this,Object(d.a)(e).call(this,{width:r,height:i,viewMatrix:k,projectionMatrix:T}))).latitude=a,t.longitude=u,t.zoom=c,t.pitch=m,t.bearing=g,t.altitude=x,t.scale=E,t.center=S,t.pixelsPerMeter=q(Object(y.a)(Object(y.a)(t))).pixelsPerMeter[2],Object.freeze(Object(y.a)(Object(y.a)(t))),t}return Object(m.a)(e,t),Object(p.a)(e,[{key:"projectFlat",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return N(t,e)}},{key:"unprojectFlat",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return U(t,e)}},{key:"getMapCenterByLngLatPosition",value:function(t){var e=t.lngLat,n=W(t.pos,this.pixelUnprojectionMatrix),r=P([],N(e,this.scale),function(t,e){return t[0]=-e[0],t[1]=-e[1],t}([],n));return U(P([],this.center,r),this.scale)}},{key:"getLocationAtPoint",value:function(t){var e=t.lngLat,n=t.pos;return this.getMapCenterByLngLatPosition({lngLat:e,pos:n})}},{key:"fitBounds",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.width,i=this.height,o=Y(Object.assign({width:r,height:i,bounds:t},n)),a=o.longitude,s=o.latitude,u=o.zoom;return new e({width:r,height:i,longitude:a,latitude:s,zoom:u})}}]),e}(function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width,r=e.height,i=e.viewMatrix,o=void 0===i?H:i,a=e.projectionMatrix,s=void 0===a?H:a;Object(h.a)(this,t),this.width=n||1,this.height=r||1,this.scale=1,this.pixelsPerMeter=1,this.viewMatrix=o,this.projectionMatrix=s;var u=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];T(u,u,this.projectionMatrix),T(u,u,this.viewMatrix),this.viewProjectionMatrix=u;var l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];M(l,l,[this.width/2,-this.height/2,1]),k(l,l,[1,-1,0]),T(l,l,this.viewProjectionMatrix);var c=S([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],l);if(!c)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=l,this.pixelUnprojectionMatrix=c,this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}return Object(p.a)(t,[{key:"equals",value:function(e){return e instanceof t&&(e.width===this.width&&e.height===this.height&&A(e.projectionMatrix,this.projectionMatrix)&&A(e.viewMatrix,this.viewMatrix))}},{key:"project",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.topLeft,r=void 0===n||n,i=this.projectPosition(t),o=X(i,this.pixelProjectionMatrix),a=Object(v.a)(o,2),s=a[0],u=a[1],l=r?u:this.height-u;return 2===t.length?[s,l]:[s,l,o[2]]}},{key:"unproject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.topLeft,r=void 0===n||n,i=e.targetZ,o=Object(v.a)(t,3),a=o[0],s=o[1],u=o[2],l=r?s:this.height-s,c=i&&i*this.pixelsPerMeter,h=W([a,l,u],this.pixelUnprojectionMatrix,c),p=this.unprojectPosition(h),f=Object(v.a)(p,3),d=f[0],m=f[1],y=f[2];return Number.isFinite(u)?[d,m,y]:Number.isFinite(i)?[d,m,i]:[d,m]}},{key:"projectPosition",value:function(t){var e=this.projectFlat(t),n=Object(v.a)(e,2);return[n[0],n[1],(t[2]||0)*this.pixelsPerMeter]}},{key:"unprojectPosition",value:function(t){var e=this.unprojectFlat(t),n=Object(v.a)(e,2);return[n[0],n[1],(t[2]||0)/this.pixelsPerMeter]}},{key:"projectFlat",value:function(t){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return t}},{key:"unprojectFlat",value:function(t){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return t}}]),t}()),J=n(2841),$=n(2842);function Q(t,e){if(!t)throw new Error(e||"react-map-gl: assertion failed.")}function tt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function et(t,e){if(n=t,!(null!=(r=e)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function nt(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}var rt={minZoom:0,maxZoom:24,minPitch:0,maxPitch:60},it=0,ot=0,at=1.5;function st(t,e,n){return t<e?e:t>n?n:t}var ut=function(){function t(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=e.width,r=e.height,o=e.latitude,a=e.longitude,s=e.zoom,u=e.bearing,l=void 0===u?ot:u,c=e.pitch,h=void 0===c?it:c,p=e.altitude,f=void 0===p?at:p,d=e.maxZoom,m=void 0===d?rt.maxZoom:d,y=e.minZoom,v=void 0===y?rt.minZoom:y,g=e.maxPitch,_=void 0===g?rt.maxPitch:g,x=e.minPitch,b=void 0===x?rt.minPitch:x,w=e.transitionDuration,E=e.transitionEasing,S=e.transitionInterpolator,T=e.transitionInterruption,k=e.startPanLngLat,M=e.startZoomLngLat,A=e.startBearing,P=e.startPitch,z=e.startZoom;et(this,t),Q(i(n),"`width` must be supplied"),Q(i(r),"`height` must be supplied"),Q(i(a),"`longitude` must be supplied"),Q(i(o),"`latitude` must be supplied"),Q(i(s),"`zoom` must be supplied"),this._viewportProps=this._applyConstraints({width:n,height:r,latitude:o,longitude:a,zoom:s,bearing:l,pitch:h,altitude:f,maxZoom:m,minZoom:v,maxPitch:_,minPitch:b,transitionDuration:w,transitionEasing:E,transitionInterpolator:S,transitionInterruption:T}),this._interactiveState={startPanLngLat:k,startZoomLngLat:M,startBearing:A,startPitch:P,startZoom:z}}var e,n,r,i=Number.isFinite;return e=t,(n=[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(t){var e=t.pos;return this._getUpdatedMapState({startPanLngLat:this._unproject(e)})}},{key:"pan",value:function(t){var e=t.pos,n=t.startPos,r=this._interactiveState.startPanLngLat||this._unproject(n);if(!r)return this;var i=tt(this._calculateNewLngLat({startPanLngLat:r,pos:e}),2),o=i[0],a=i[1];return this._getUpdatedMapState({longitude:o,latitude:a})}},{key:"panEnd",value:function(){return this._getUpdatedMapState({startPanLngLat:null})}},{key:"rotateStart",value:function(t){return t.pos,this._getUpdatedMapState({startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(t){var e=t.deltaScaleX,n=void 0===e?0:e,r=t.deltaScaleY,o=void 0===r?0:r,a=this._interactiveState,s=a.startBearing,u=a.startPitch;if(!i(s)||!i(u))return this;var l=this._calculateNewPitchAndBearing({deltaScaleX:n,deltaScaleY:o,startBearing:s,startPitch:u}),c=l.pitch,h=l.bearing;return this._getUpdatedMapState({bearing:h,pitch:c})}},{key:"rotateEnd",value:function(){return this._getUpdatedMapState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(t){var e=t.pos;return this._getUpdatedMapState({startZoomLngLat:this._unproject(e),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(t){var e=t.pos,n=t.startPos,r=t.scale;Q(0<r,"`scale` must be a positive number");var o=this._interactiveState,a=o.startZoom,s=o.startZoomLngLat;i(a)||(a=this._viewportProps.zoom,s=this._unproject(n)||this._unproject(e)),Q(s,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var u=this._calculateNewZoom({scale:r,startZoom:a}),l=tt(new K(Object.assign({},this._viewportProps,{zoom:u})).getLocationAtPoint({lngLat:s,pos:e}),2),c=l[0],h=l[1];return this._getUpdatedMapState({zoom:u,longitude:c,latitude:h})}},{key:"zoomEnd",value:function(){return this._getUpdatedMapState({startZoomLngLat:null,startZoom:null})}},{key:"_getUpdatedMapState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(t){var e=t.maxZoom,n=t.minZoom,r=t.zoom;t.zoom=st(r,n,e);var i=t.maxPitch,o=t.minPitch,a=t.pitch;return t.pitch=st(a,o,i),Object.assign(t,function(t){var e=t.width,n=t.height,r=t.longitude,i=t.latitude,o=t.zoom,a=t.pitch,s=void 0===a?0:a,u=t.bearing,l=void 0===u?0:u;(r<-180||r>180)&&(r=w(r+180,360)-180),(l<-180||l>180)&&(l=w(l+180,360)-180);var c=new K({width:e,height:n,longitude:r,latitude:i,zoom:o}),h=c.project([r,85.05113])[1],p=c.project([r,-85.05113])[1],f=0;return p-h<n&&(o+=Math.log2(n/(p-h)),h=(c=new K({width:e,height:n,longitude:r,latitude:i,zoom:o})).project([r,85.05113])[1],p=c.project([r,-85.05113])[1]),h>0?f=h:p<n&&(f=p-n),f&&(i=c.unproject([e/2,n/2+f])[1]),{width:e,height:n,longitude:r,latitude:i,zoom:o,pitch:s,bearing:l}}(t)),t}},{key:"_unproject",value:function(t){var e=new K(this._viewportProps);return t&&e.unproject(t)}},{key:"_calculateNewLngLat",value:function(t){var e=t.startPanLngLat,n=t.pos;return new K(this._viewportProps).getMapCenterByLngLatPosition({lngLat:e,pos:n})}},{key:"_calculateNewZoom",value:function(t){var e=t.scale,n=t.startZoom,r=this._viewportProps,i=r.maxZoom,o=r.minZoom;return st(n+Math.log2(e),o,i)}},{key:"_calculateNewPitchAndBearing",value:function(t){var e=t.deltaScaleX,n=t.deltaScaleY,r=t.startBearing,i=t.startPitch;n=st(n,-1,1);var o=this._viewportProps,a=o.minPitch,s=o.maxPitch,u=i;return 0<n?u=i+n*(s-i):0>n&&(u=i-n*(a-i)),{pitch:u,bearing:r+180*e}}}])&&nt(e.prototype,n),r&&nt(e,r),t}();function lt(t){return t[0].toLowerCase()+t.slice(1)}function ct(t){return(ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ht(t,e){if(n=t,!(null!=(r=e)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function pt(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}function ft(t,e,n){return e&&pt(t.prototype,e),n&&pt(t,n),t}function dt(t,e){return(dt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function mt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var yt=$.a?n(2844):null,vt="A valid API access token is required to use Mapbox data";function gt(){}var _t=Object.assign({},J.a.propTypes,{mapStyle:o.a.oneOfType([o.a.string,o.a.object]),preventStyleDiffing:o.a.bool,disableTokenWarning:o.a.bool,visible:o.a.bool,visibilityConstraints:o.a.object}),xt=Object.assign({},J.a.defaultProps,{mapStyle:"mapbox://styles/mapbox/light-v8",preventStyleDiffing:!1,visible:!0}),bt={viewport:o.a.instanceOf(K)},wt=function(t){function e(t){var n;return ht(this,e),(n=function(t,e){return!e||"object"!==ct(e)&&"function"!=typeof e?mt(t):e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t)))._queryParams={},e.supported()||(n.componentDidMount=gt,n.componentWillReceiveProps=gt,n.componentDidUpdate=gt,n.componentWillUnmount=gt),n.state={accessTokenInvalid:!1},n.getMap=n.getMap.bind(mt(n)),n.queryRenderedFeatures=n.queryRenderedFeatures.bind(mt(n)),n._updateMapSize=n._updateMapSize.bind(mt(n)),n._updateMapStyle=n._updateMapStyle.bind(mt(n)),n._mapboxMapLoaded=n._mapboxMapLoaded.bind(mt(n)),n._mapboxMapError=n._mapboxMapError.bind(mt(n)),n._renderNoTokenWarning=n._renderNoTokenWarning.bind(mt(n)),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&dt(t,e)}(e,t),ft(e,null,[{key:"supported",value:function(){return yt&&yt.supported()}}]),ft(e,[{key:"getChildContext",value:function(){return{viewport:new K(this.props)}}},{key:"componentDidMount",value:function(){var t=this.props.mapStyle;this._mapbox=new J.a(Object.assign({},this.props,{mapboxgl:yt,container:this._mapboxMap,onError:this._mapboxMapError,mapStyle:a(t)?t.toJS():t})),this._map=this._mapbox.getMap()}},{key:"componentWillReceiveProps",value:function(t){this._mapbox.setProps(t),this._updateMapStyle(this.props,t),this.setState({width:this.props.width,height:this.props.height})}},{key:"componentDidUpdate",value:function(){this._updateMapSize(this.state,this.props)}},{key:"componentWillUnmount",value:function(){this._mapbox.finalize(),this._mapbox=null,this._map=null}},{key:"getMap",value:function(){return this._map}},{key:"queryRenderedFeatures",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return this._map.queryRenderedFeatures(t,e)}},{key:"_updateMapSize",value:function(t,e){(t.width!==e.width||t.height!==e.height)&&this._map.resize()}},{key:"_updateMapStyle",value:function(t,e){var n=e.mapStyle,r=t.mapStyle;n!==r&&(a(n)?this.props.preventStyleDiffing?this._map.setStyle(n.toJS()):l(r,n,this._map):this._map.setStyle(n))}},{key:"_mapboxMapLoaded",value:function(t){this._mapboxMap=t}},{key:"_mapboxMapError",value:function(t){401!==(t.error&&t.error.status||t.status)||this.state.accessTokenInvalid||(console.error(vt),this.setState({accessTokenInvalid:!0}))}},{key:"_renderNoTokenWarning",value:function(){return this.state.accessTokenInvalid&&!this.props.disableTokenWarning?Object(r.createElement)("div",{key:"warning",id:"no-token-warning",style:{position:"absolute",left:0,top:0}},[Object(r.createElement)("h3",{key:"header"},vt),Object(r.createElement)("div",{key:"text"},"For information on setting up your basemap, read"),Object(r.createElement)("a",{key:"link",href:"https://uber.github.io/react-map-gl/#/Documentation/getting-started/about-mapbox-tokens"},"Note on Map Tokens")]):null}},{key:"render",value:function(){var t=this.props,e=t.className,n=t.width,i=t.height,o=t.style,a=t.visibilityConstraints,s=Object.assign({},o,{width:n,height:i,position:"relative"}),u=this.props.visible&&function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:rt;for(var n in e){var r=n.slice(0,3),i=lt(n.slice(3));if("min"===r&&t[i]<e[n])return!1;if("max"===r&&t[i]>e[n])return!1}return!0}(this.props.viewState||this.props,a),l=Object.assign({},o,{width:n,height:i,visibility:u?"visible":"hidden"});return Object(r.createElement)("div",{key:"map-container",style:s,children:[Object(r.createElement)("div",{key:"map-mapbox",ref:this._mapboxMapLoaded,style:l,className:e}),Object(r.createElement)("div",{key:"map-overlays",className:"overlays",style:{position:"absolute",left:0,top:0,width:n,height:i,overflow:"hidden"},children:this.props.children}),this._renderNoTokenWarning()]})}}]),e}(r.PureComponent);wt.displayName="StaticMap",wt.propTypes=_t,wt.defaultProps=xt,wt.childContextTypes=bt;var Et={};function St(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&void 0!==t.length}function Tt(t,e){if(St(t)&&St(e)){if(t===e)return!0;if(t.length!==e.length)return!1;for(var n=0;n<t.length;++n)if(!Tt(t[n],e[n]))return!1;return!0}return Math.abs(t-e)<=Et.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}function kt(t,e){if(n=t,!(null!=(r=e)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Mt(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}Et.EPSILON=1e-12,Et.debug=!0,Et.precision=4,Et.printTypes=!1,Et.printDegrees=!1,Et.printRowMajor=!0;var At=function(){function t(){kt(this,t)}return e=t,(n=[{key:"arePropsEqual",value:function(t,e){var n=!0,r=!1,i=void 0;try{for(var o,a,s=(this.propNames||[])[Symbol.iterator]();!(n=(o=s.next()).done);n=!0)if(!Tt(t[a=o.value],e[a]))return!1}catch(t){r=!0,i=t}finally{try{n||null==s.return||s.return()}finally{if(r)throw i}}return!0}},{key:"initializeProps",value:function(t,e){return{start:t,end:e}}},{key:"interpolateProps",value:function(){Q(!1,"interpolateProps is not implemented")}}])&&Mt(e.prototype,n),r&&Mt(e,r),t;var e,n,r}(),Pt=["longitude","latitude","zoom"],zt={curve:1.414,speed:1.2};function It(t,e,n){var r=(n=Object.assign({},zt,n)).curve,i=t.zoom,o=[t.longitude,t.latitude],a=j(i),s=e.zoom,u=[e.longitude,e.latitude],l=j(s-i),c=N(o,a),h=N(u,a),p=L([],h,c),f=Math.max(t.width,t.height),d=f/l,m=I(p),y=Math.max(m,.01),v=r*r,g=(d*d-f*f+v*v*y*y)/(2*f*v*y),_=(d*d-f*f-v*v*y*y)/(2*d*v*y),x=Math.log(Math.sqrt(g*g+1)-g),b=Math.log(Math.sqrt(_*_+1)-_);return{startZoom:i,startCenterXY:c,uDelta:p,w0:f,u1:m,S:(b-x)/r,rho:r,rho2:v,r0:x,r1:b}}var Ct={longitude:1,bearing:1};function Lt(t,e,n){return Array.isArray(t)?t.map((function(t,r){return Lt(t,e[r],n)})):n*e+(1-n)*t}function Ot(t){return Number.isFinite(t)||Array.isArray(t)}function Dt(t,e,n){return function(t){return Ct[t]}(t)&&180<Math.abs(n-e)&&(n=0>n?n+360:n-360),n}function Rt(t){return(Rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Bt(t,e){if(n=t,!(null!=(r=e)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Ft(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}function jt(t,e){return!e||"object"!==Rt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Vt(t,e){return(Vt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Nt=["longitude","latitude","zoom","bearing","pitch"],Ut=["latitude","longitude","zoom","width","height"],qt=["bearing","pitch"],Zt=function(t){function e(){var t;return Bt(this,e),(t=jt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this))).propNames=Nt,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Vt(t,e)}(e,t),n=e,(r=[{key:"initializeProps",value:function(t,e){for(var n={},r={},i=0;i<Ut.length;i++){var o=Ut[i],a=t[o],s=e[o];Q(Ot(a)&&Ot(s),"".concat(o," must be supplied for transition")),n[o]=a,r[o]=Dt(o,a,s)}for(var u=0;u<qt.length;u++){var l=qt[u],c=t[l]||0,h=e[l]||0;n[l]=c,r[l]=Dt(l,c,h)}return{start:n,end:r}}},{key:"interpolateProps",value:function(t,e,n){for(var r,i=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i={},o=It(t,e,r),a=o.startZoom,s=o.startCenterXY,u=o.uDelta,l=o.w0,c=o.u1,h=o.S,p=o.rho,f=o.rho2,d=o.r0;if(c<.01){for(var m=0;m<Pt.length;m++){var y=Pt[m],v=t[y],g=e[y];i[y]=E(v,g,n)}return i}var _=n*h,x=Math.cosh(d)/Math.cosh(d+p*_),b=l*((Math.cosh(d)*Math.tanh(d+p*_)-Math.sinh(d))/f)/c,w=1/x,S=a+V(w),T=z([],u,b);P(T,T,s),z(T,T,w);var k=U(T,j(S));return i.longitude=k[0],i.latitude=k[1],i.zoom=S,i}(t,e,n),o=0;o<qt.length;o++)i[r=qt[o]]=Lt(t[r],e[r],n);return i}}])&&Ft(n.prototype,r),i&&Ft(n,i),e;var n,r,i}(At);function Gt(t){return(Gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Xt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Wt(t,e){if(n=t,!(null!=(r=e)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Ht(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}function Yt(t,e){return!e||"object"!==Gt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Kt(t,e){return(Kt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Jt=["longitude","latitude","zoom","bearing","pitch"],$t=function(t){function e(){var t,n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return Wt(this,e),t=Yt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this)),Array.isArray(n)&&(n={transitionProps:n}),t.propNames=n.transitionProps||Jt,t.around=n.around,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Kt(t,e)}(e,t),n=e,(r=[{key:"initializeProps",value:function(t,e){var n={},r={};this.around&&Object.assign(r,e,{around:this.around,aroundLngLat:new K(e).unproject(this.around)});var i=!0,o=!1,a=void 0;try{for(var s,u=this.propNames[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var l=s.value,c=t[l],h=e[l];Q(Ot(c)&&Ot(h),"".concat(l," must be supplied for transition")),n[l]=c,r[l]=Dt(l,c,h)}}catch(t){o=!0,a=t}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}return{start:n,end:r}}},{key:"interpolateProps",value:function(t,e,n){var r={},i=!0,o=!1,a=void 0;try{for(var s,u,l=this.propNames[Symbol.iterator]();!(i=(s=l.next()).done);i=!0)r[u=s.value]=Lt(t[u],e[u],n)}catch(t){o=!0,a=t}finally{try{i||null==l.return||l.return()}finally{if(o)throw a}}if(e.around){var c=Xt(new K(Object.assign({},e,r)).getMapCenterByLngLatPosition({lngLat:e.aroundLngLat,pos:e.around}),2),h=c[0],p=c[1];r.longitude=h,r.latitude=p}return r}}])&&Ht(n.prototype,r),i&&Ht(n,i),e;var n,r,i}(At);function Qt(t,e){if(n=t,!(null!=(r=e)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function te(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}var ee=function(){},ne={BREAK:1,SNAP_TO_END:2,IGNORE:3},re={transitionDuration:0,transitionEasing:function(t){return t},transitionInterpolator:new $t,transitionInterruption:ne.BREAK,onTransitionStart:ee,onTransitionInterrupt:ee,onTransitionEnd:ee},ie={animation:null,propsInTransition:null,startProps:null,endProps:null},oe=function(){function t(e){Qt(this,t),this.props=e,this.state=ie,this._onTransitionFrame=this._onTransitionFrame.bind(this)}return e=t,(n=[{key:"getViewportInTransition",value:function(){return this.state.propsInTransition}},{key:"processViewportChange",value:function(t){var e=!1,n=this.props;if(this.props=t,this._shouldIgnoreViewportChange(n,t))return e;var r=this._isTransitionInProgress();if(this._isTransitionEnabled(t)){var i=Object.assign({},n,this.state.interruption===ne.SNAP_TO_END?this.state.endProps:this.state.propsInTransition);r&&n.onTransitionInterrupt(),t.onTransitionStart(),this._triggerTransition(i,t),e=!0}else r&&(n.onTransitionInterrupt(),this._endTransition());return e}},{key:"_isTransitionInProgress",value:function(){return!!this.state.propsInTransition}},{key:"_isTransitionEnabled",value:function(t){return 0<t.transitionDuration&&!!t.transitionInterpolator}},{key:"_isUpdateDueToCurrentTransition",value:function(t){return!!this.state.propsInTransition&&this.state.interpolator.arePropsEqual(t,this.state.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(t,e){return this._isTransitionInProgress()?this.state.interruption===ne.IGNORE||this._isUpdateDueToCurrentTransition(e):!this._isTransitionEnabled(e)||e.transitionInterpolator.arePropsEqual(t,e)}},{key:"_triggerTransition",value:function(t,e){Q(this._isTransitionEnabled(e),"Transition is not enabled"),cancelAnimationFrame(this.state.animation);var n=e.transitionInterpolator.initializeProps(t,e);this.state={duration:e.transitionDuration,easing:e.transitionEasing,interpolator:e.transitionInterpolator,interruption:e.transitionInterruption,startTime:Date.now(),startProps:n.start,endProps:n.end,animation:null,propsInTransition:{}},this._onTransitionFrame()}},{key:"_onTransitionFrame",value:function(){this.state.animation=requestAnimationFrame(this._onTransitionFrame),this._updateViewport()}},{key:"_endTransition",value:function(){cancelAnimationFrame(this.state.animation),this.state=ie}},{key:"_updateViewport",value:function(){var t=Date.now(),e=this.state,n=e.startTime,r=e.duration,i=e.easing,o=e.interpolator,a=e.startProps,s=e.endProps,u=!1,l=(t-n)/r;1<=l&&(l=1,u=!0),l=i(l);var c=o.interpolateProps(a,s,l),h=new ut(Object.assign({},this.props,c));this.state.propsInTransition=h.getViewportProps();var p=this.props.onViewportChange||this.props.onChangeViewport;p&&p(this.state.propsInTransition),this.props.onViewStateChange&&this.props.onViewStateChange({viewState:this.state.propsInTransition}),u&&(this._endTransition(),this.props.onTransitionEnd())}}])&&te(e.prototype,n),r&&te(e,r),t;var e,n,r}();oe.defaultProps=re;var ae=n(2673);function se(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function ue(t,e){if(n=t,!(null!=(r=e)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function le(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}var ce={transitionDuration:0},he={transitionDuration:300,transitionEasing:function(t){return t},transitionInterpolator:new $t,transitionInterruption:ne.BREAK},pe=["wheel"],fe=["panstart","panmove","panend"],de=["pinchstart","pinchmove","pinchend"],me=["doubletap"],ye=["keydown"],ve=function(){function t(){ue(this,t),this._state={isDragging:!1},this.events=[],this.handleEvent=this.handleEvent.bind(this)}var e,n,r,i=Math.abs;return e=t,(n=[{key:"handleEvent",value:function(t){switch(this.mapState=this.getMapState(),t.type){case"panstart":return this._onPanStart(t);case"panmove":return this._onPan(t);case"panend":return this._onPanEnd(t);case"pinchstart":return this._onPinchStart(t);case"pinchmove":return this._onPinch(t);case"pinchend":return this._onPinchEnd(t);case"doubletap":return this._onDoubleTap(t);case"wheel":return this._onWheel(t);case"keydown":return this._onKeyDown(t);default:return!1}}},{key:"getCenter",value:function(t){var e=t.offsetCenter;return[e.x,e.y]}},{key:"isFunctionKeyPressed",value:function(t){var e=t.srcEvent;return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}},{key:"setState",value:function(t){Object.assign(this._state,t),this.onStateChange&&this.onStateChange(this._state)}},{key:"updateViewport",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r=this.mapState?this.mapState.getViewportProps():{},i=Object.assign({},t.getViewportProps(),e),o=Object.keys(i).some((function(t){return r[t]!==i[t]}));o&&this.onViewStateChange&&this.onViewStateChange({viewState:i}),o&&this.onViewportChange&&this.onViewportChange(i),this.setState(Object.assign({},t.getInteractiveState(),n))}},{key:"getMapState",value:function(t){return new ut(Object.assign({},this.mapStateProps,this._state,t))}},{key:"setOptions",value:function(t){var e=t.onChangeViewport,n=t.touchZoomRotate,r=void 0===n||n,i=t.onViewStateChange,o=t.onViewportChange,a=t.onStateChange,s=void 0===a?this.onStateChange:a,u=t.eventManager,l=void 0===u?this.eventManager:u,c=t.scrollZoom,h=void 0===c||c,p=t.dragPan,f=void 0===p||p,d=t.dragRotate,m=void 0===d||d,y=t.doubleClickZoom,v=void 0===y||y,g=t.touchZoom,_=t.touchRotate,x=t.keyboard,b=void 0===x||x;this.onViewStateChange=i,this.onViewportChange=o||e,this.onStateChange=s,this.mapStateProps&&this.mapStateProps.height!==t.height&&this.updateViewport(new ut(t)),this.mapStateProps=t,this.eventManager!==l&&(this.eventManager=l,this._events={},this.toggleEvents(this.events,!0));var w=!(!this.onViewStateChange&&!this.onViewportChange);this.toggleEvents(pe,w&&h),this.toggleEvents(fe,w&&(f||m)),this.toggleEvents(de,w&&r),this.toggleEvents(me,w&&v),this.toggleEvents(ye,w&&b),this.scrollZoom=h,this.dragPan=f,this.dragRotate=m,this.doubleClickZoom=v,this.touchZoom=r&&(void 0===g||g),this.touchRotate=r&&void 0!==_&&_,this.keyboard=b}},{key:"toggleEvents",value:function(t,e){var n=this;this.eventManager&&t.forEach((function(t){n._events[t]!==e&&(n._events[t]=e,e?n.eventManager.on(t,n.handleEvent):n.eventManager.off(t,n.handleEvent))}))}},{key:"_onPanStart",value:function(t){var e=this.getCenter(t),n=this.mapState.panStart({pos:e}).rotateStart({pos:e});return this.updateViewport(n,ce,{isDragging:!0})}},{key:"_onPan",value:function(t){return this.isFunctionKeyPressed(t)||t.rightButton?this._onPanRotate(t):this._onPanMove(t)}},{key:"_onPanEnd",value:function(){var t=this.mapState.panEnd().rotateEnd();return this.updateViewport(t,null,{isDragging:!1})}},{key:"_onPanMove",value:function(t){if(!this.dragPan)return!1;var e=this.getCenter(t),n=this.mapState.pan({pos:e});return this.updateViewport(n,ce,{isDragging:!0})}},{key:"_onPanRotate",value:function(t){if(!this.dragRotate)return!1;var e=t.deltaX,n=t.deltaY,r=se(this.getCenter(t),2)[1],o=r-n,a=this.mapState.getViewportProps(),s=a.width,u=a.height,l=0;0<n?i(u-o)>5&&(l=n/(o-u)*1.2):0>n&&o>5&&(l=1-r/o),l=Math.min(1,Math.max(-1,l));var c=this.mapState.rotate({deltaScaleX:e/s,deltaScaleY:l});return this.updateViewport(c,ce,{isDragging:!0})}},{key:"_onWheel",value:function(t){if(!this.scrollZoom)return!1;t.srcEvent.preventDefault();var e=this.getCenter(t),n=t.delta,r=2/(1+Math.exp(-i(.01*n)));0>n&&0!==r&&(r=1/r);var o=this.mapState.zoom({pos:e,scale:r});return this.updateViewport(o,ce)}},{key:"_onPinchStart",value:function(t){var e=this.getCenter(t),n=this.mapState.zoomStart({pos:e}).rotateStart({pos:e});return this._state.startPinchRotation=t.rotation,this.updateViewport(n,ce,{isDragging:!0})}},{key:"_onPinch",value:function(t){if(!this.touchZoom&&!this.touchRotate)return!1;var e=this.mapState;if(this.touchZoom){var n=t.scale,r=this.getCenter(t);e=e.zoom({pos:r,scale:n})}if(this.touchRotate){var i=t.rotation,o=this._state.startPinchRotation;e=e.rotate({deltaScaleX:-(i-o)/180})}return this.updateViewport(e,ce,{isDragging:!0})}},{key:"_onPinchEnd",value:function(){var t=this.mapState.zoomEnd().rotateEnd();return this._state.startPinchRotation=0,this.updateViewport(t,null,{isDragging:!1})}},{key:"_onDoubleTap",value:function(t){if(!this.doubleClickZoom)return!1;var e=this.getCenter(t),n=this.isFunctionKeyPressed(t),r=this.mapState.zoom({pos:e,scale:n?.5:2});return this.updateViewport(r,Object.assign({},he,{transitionInterpolator:new $t({around:e})}))}},{key:"_onKeyDown",value:function(t){if(!this.keyboard)return!1;var e,n=this.isFunctionKeyPressed(t),r=this.mapStateProps;switch(t.srcEvent.keyCode){case 189:e=n?this.getMapState({zoom:r.zoom-2}):this.getMapState({zoom:r.zoom-1});break;case 187:e=n?this.getMapState({zoom:r.zoom+2}):this.getMapState({zoom:r.zoom+1});break;case 37:e=n?this.getMapState({bearing:r.bearing-15}):this.mapState.pan({pos:[100,0],startPos:[0,0]});break;case 39:e=n?this.getMapState({bearing:r.bearing+15}):this.mapState.pan({pos:[-100,0],startPos:[0,0]});break;case 38:e=n?this.getMapState({pitch:r.pitch+10}):this.mapState.pan({pos:[0,100],startPos:[0,0]});break;case 40:e=n?this.getMapState({pitch:r.pitch-10}):this.mapState.pan({pos:[0,-100],startPos:[0,0]});break;default:return!1}return this.updateViewport(e,he)}}])&&le(e.prototype,n),r&&le(e,r),t}(),ge={GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer"},_e=[{old:"onChangeViewport",new:"onViewportChange"},{old:"perspectiveEnabled",new:"dragRotate"},{old:"onHoverFeatures",new:"onHover"},{old:"onClickFeatures",new:"onClick"},{old:"touchZoomRotate",new:"touchZoom, touchRotate"}];function xe(t){return"react-map-gl: `".concat(t,"` is deprecated and will be removed in a later version.")}function be(t){return"Use `".concat(t,"` instead.")}function we(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};_e.forEach((function(e){if(t.hasOwnProperty(e.old)){var n=xe(e.old);e.new&&(n="".concat(n," ").concat(be(e.new))),console.warn(n)}}))}function Ee(t){return(Ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Se(t,e){if(n=t,!(null!=(r=e)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Te(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}function ke(t,e,n){return e&&Te(t.prototype,e),n&&Te(t,n),t}function Me(t,e){return(Me=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ae(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var Pe=Object.assign({},wt.propTypes,{maxZoom:o.a.number,minZoom:o.a.number,maxPitch:o.a.number,minPitch:o.a.number,onViewStateChange:o.a.func,onViewportChange:o.a.func,transitionDuration:o.a.number,transitionInterpolator:o.a.object,transitionInterruption:o.a.number,transitionEasing:o.a.func,onTransitionStart:o.a.func,onTransitionInterrupt:o.a.func,onTransitionEnd:o.a.func,scrollZoom:o.a.bool,dragPan:o.a.bool,dragRotate:o.a.bool,doubleClickZoom:o.a.bool,touchZoom:o.a.bool,touchRotate:o.a.bool,keyboard:o.a.bool,onHover:o.a.func,onClick:o.a.func,onContextMenu:o.a.func,touchAction:o.a.string,clickRadius:o.a.number,getCursor:o.a.func,mapControls:o.a.shape({events:o.a.arrayOf(o.a.string),handleEvent:o.a.func})}),ze=Object.assign({},wt.defaultProps,rt,oe.defaultProps,{onViewStateChange:null,onViewportChange:null,onClick:null,onHover:null,onContextMenu:function(t){return t.preventDefault()},scrollZoom:!0,dragPan:!0,dragRotate:!0,doubleClickZoom:!0,touchAction:"none",clickRadius:0,getCursor:function(t){var e=t.isDragging,n=t.isHovering;return e?ge.GRABBING:n?ge.POINTER:ge.GRAB}}),Ie={viewport:o.a.instanceOf(K),isDragging:o.a.bool,eventManager:o.a.object},Ce=function(t){function e(t){var n;return Se(this,e),n=function(t,e){return!e||"object"!==Ee(e)&&"function"!=typeof e?Ae(t):e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t)),we(t),n.state={isDragging:!1,isHovering:!1},n._mapControls=t.mapControls||new ve,n._eventManager=new ae.EventManager(null,{legacyBlockScroll:!1,touchAction:t.touchAction}),n._updateQueryParams(t.mapStyle),n.getMap=n.getMap.bind(Ae(n)),n.queryRenderedFeatures=n.queryRenderedFeatures.bind(Ae(n)),n._getFeatures=n._getFeatures.bind(Ae(n)),n._updateQueryParams=n._updateQueryParams.bind(Ae(n)),n._onInteractiveStateChange=n._onInteractiveStateChange.bind(Ae(n)),n._getPos=n._getPos.bind(Ae(n)),n._eventCanvasLoaded=n._eventCanvasLoaded.bind(Ae(n)),n._staticMapLoaded=n._staticMapLoaded.bind(Ae(n)),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Me(t,e)}(e,t),ke(e,null,[{key:"supported",value:function(){return wt.supported()}}]),ke(e,[{key:"getChildContext",value:function(){return{viewport:new K(this.props),isDragging:this.state.isDragging,eventManager:this._eventManager}}},{key:"componentDidMount",value:function(){var t=this._eventManager;t.on({mousemove:this._onMouseMove.bind(this),click:this._onMouseClick.bind(this),contextmenu:this._onContextMenu.bind(this)}),this._mapControls.setOptions(Object.assign({},this.props,this.props.viewState,{onStateChange:this._onInteractiveStateChange,eventManager:t})),this._transitionManager=new oe(this.props)}},{key:"componentWillUpdate",value:function(t){this.props.mapStyle!==t.mapStyle&&this._updateQueryParams(t.mapStyle);var e=Object.assign({},t,t.viewState);this._mapControls.setOptions(e),this._transitionManager.processViewportChange(e)}},{key:"getMap",value:function(){return this._map?this._map.getMap():null}},{key:"queryRenderedFeatures",value:function(t,e){return this._map.queryRenderedFeatures(t,e)}},{key:"_getFeatures",value:function(t){var e,n=t.pos,r=t.radius;if(r){var i=r,o=[[n[0]-i,n[1]+i],[n[0]+i,n[1]-i]];e=this._map.queryRenderedFeatures(o,this._queryParams)}else e=this._map.queryRenderedFeatures(n,this._queryParams);return e}},{key:"_updateQueryParams",value:function(t){var e=function(t){var e=null;return a(t)&&t.has("layers")?e=t.get("layers").filter((function(t){return t.get("interactive")})).map((function(t){return t.get("id")})).toJS():Array.isArray(t.layers)&&(e=t.layers.filter((function(t){return t.interactive})).map((function(t){return t.id}))),e}(t);this._queryParams={layers:e}}},{key:"_onInteractiveStateChange",value:function(t){var e=t.isDragging,n=void 0!==e&&e;n!==this.state.isDragging&&this.setState({isDragging:n})}},{key:"_getPos",value:function(t){var e=t.offsetCenter;return[e.x,e.y]}},{key:"_onMouseMove",value:function(t){if(!this.state.isDragging){var e=this._getPos(t),n=this._getFeatures({pos:e,radius:this.props.clickRadius}),r=n&&0<n.length;if(r!==this.state.isHovering&&this.setState({isHovering:r}),this.props.onHover){var i=new K(this.props);t.lngLat=i.unproject(e),t.features=n,this.props.onHover(t)}}}},{key:"_onMouseClick",value:function(t){if(this.props.onClick){var e=this._getPos(t),n=new K(this.props);t.lngLat=n.unproject(e),t.features=this._getFeatures({pos:e,radius:this.props.clickRadius}),this.props.onClick(t)}}},{key:"_onContextMenu",value:function(t){this.props.onContextMenu&&this.props.onContextMenu(t)}},{key:"_eventCanvasLoaded",value:function(t){this._eventManager.setElement(t)}},{key:"_staticMapLoaded",value:function(t){this._map=t}},{key:"render",value:function(){var t=this.props,e={width:t.width,height:t.height,position:"relative",cursor:(0,t.getCursor)(this.state)};return Object(r.createElement)("div",{key:"map-controls",ref:this._eventCanvasLoaded,style:e},Object(r.createElement)(wt,Object.assign({},this.props,this._transitionManager&&this._transitionManager.getViewportInTransition(),{ref:this._staticMapLoaded,children:this.props.children})))}}]),e}(r.PureComponent);function Le(t){return(Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Oe(t,e){if(n=t,!(null!=(r=e)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function De(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}function Re(t,e){return(Re=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Be(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}Ce.displayName="InteractiveMap",Ce.propTypes=Pe,Ce.defaultProps=ze,Ce.childContextTypes=Ie;var Fe={captureScroll:o.a.bool,captureDrag:o.a.bool,captureClick:o.a.bool,captureDoubleClick:o.a.bool},je={viewport:o.a.instanceOf(K),isDragging:o.a.bool,eventManager:o.a.object},Ve=function(t){function e(t){var n;return Oe(this,e),(n=function(t,e){return!e||"object"!==Le(e)&&"function"!=typeof e?Be(t):e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t)))._events=null,n._onContainerLoad=n._onContainerLoad.bind(Be(n)),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Re(t,e)}(e,t),n=e,(r=[{key:"_onContainerLoad",value:function(t){var e=this.context.eventManager;if(e){var n=this._events;n&&(e.off(n),n=null),t&&(n={wheel:this._onScroll.bind(this),panstart:this._onDrag.bind(this),click:this._onClick.bind(this),dblclick:this._onDoubleClick.bind(this)},e.on(n,t)),this._events=n}}},{key:"_onScroll",value:function(t){this.props.captureScroll&&t.stopPropagation()}},{key:"_onDrag",value:function(t){this.props.captureDrag&&t.stopPropagation()}},{key:"_onClick",value:function(t){this.props.captureClick&&t.stopPropagation()}},{key:"_onDoubleClick",value:function(t){this.props.captureDoubleClick&&t.stopPropagation()}},{key:"render",value:function(){return null}}])&&De(n.prototype,r),i&&De(n,i),e;var n,r,i}(r.Component);function Ne(t){return(Ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ue(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function qe(t,e){if(n=t,!(null!=(r=e)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Ze(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}function Ge(t,e){return!e||"object"!==Ne(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Xe(t,e){return(Xe=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}Ve.propTypes=Fe,Ve.defaultProps={captureScroll:!1,captureDrag:!0,captureClick:!0,captureDoubleClick:!0},Ve.contextTypes=je;var We=Object.assign({},Ve.propTypes,{className:o.a.string,longitude:o.a.number.isRequired,latitude:o.a.number.isRequired,offsetLeft:o.a.number,offsetTop:o.a.number}),He=Object.assign({},Ve.defaultProps,{className:"",offsetLeft:0,offsetTop:0}),Ye=function(t){function e(){return qe(this,e),Ge(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Xe(t,e)}(e,t),n=e,(i=[{key:"render",value:function(){var t=this.props,e=t.className,n=t.longitude,i=t.latitude,o=t.offsetLeft,a=t.offsetTop,s=Ue(this.context.viewport.project([n,i]),2),u=s[0],l=s[1];return Object(r.createElement)("div",{className:"mapboxgl-marker ".concat(e),ref:this._onContainerLoad,style:{position:"absolute",left:u+o,top:l+a},children:this.props.children})}}])&&Ze(n.prototype,i),o&&Ze(n,o),e;var n,i,o}(Ve);Ye.displayName="Marker",Ye.propTypes=We,Ye.defaultProps=He;var Ke={top:{x:.5,y:0},"top-left":{x:0,y:0},"top-right":{x:1,y:0},bottom:{x:.5,y:1},"bottom-left":{x:0,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5}};function Je(t){return(Je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function $e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Qe(t,e){if(n=t,!(null!=(r=e)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function tn(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}function en(t,e){return(en=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function nn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var rn=Object.assign({},Ve.propTypes,{className:o.a.string,longitude:o.a.number.isRequired,latitude:o.a.number.isRequired,offsetLeft:o.a.number,offsetTop:o.a.number,tipSize:o.a.number,closeButton:o.a.bool,closeOnClick:o.a.bool,anchor:o.a.oneOf(Object.keys(Ke)),dynamicPosition:o.a.bool,onClose:o.a.func}),on=Object.assign({},Ve.defaultProps,{className:"",offsetLeft:0,offsetTop:0,tipSize:10,anchor:"bottom",dynamicPosition:!0,closeButton:!0,closeOnClick:!0,onClose:function(){}}),an=function(t){function e(t){var n;return Qe(this,e),(n=function(t,e){return!e||"object"!==Je(e)&&"function"!=typeof e?nn(t):e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t)))._getPosition=n._getPosition.bind(nn(n)),n._onClose=n._onClose.bind(nn(n)),n._contentLoaded=n._contentLoaded.bind(nn(n)),n._renderTip=n._renderTip.bind(nn(n)),n._renderContent=n._renderContent.bind(nn(n)),n._closeOnClick=!1,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&en(t,e)}(e,t),n=e,(i=[{key:"componentDidMount",value:function(){this.forceUpdate()}},{key:"_getPosition",value:function(t,e){var n=this.context.viewport,r=this.props,i=r.anchor,o=r.dynamicPosition,a=r.tipSize;return this._content&&o?function(t){var e=t.x,n=t.y,r=t.width,i=t.height,o=t.selfWidth,a=t.selfHeight,s=t.anchor,u=t.padding,l=void 0===u?0:u,c=Ke[s],h=c.x,p=c.y,f=n-p*a,d=f+a;if(f<l)for(;f<l&&p>=.5;)p-=.5,f+=.5*a;else if(d>i-l)for(;d>i-l&&p<=.5;)p+=.5,d-=.5*a;var m=e-h*o,y=m+o,v=.5;if(.5===p&&(h=Math.floor(h),v=1),m<l)for(;m<l&&h>=v;)h-=v,m+=v*o;else if(y>r-l)for(;y>r-l&&h<=1-v;)h+=v,y-=v*o;return Object.keys(Ke).find((function(t){var e=Ke[t];return e.x===h&&e.y===p}))}({x:t,y:e,anchor:i,padding:a,width:n.width,height:n.height,selfWidth:this._content.clientWidth,selfHeight:this._content.clientHeight}):i}},{key:"_onClick",value:function(t){this.props.captureClick&&t.stopPropagation(),(this.props.closeOnClick||this._closeOnClick)&&this.props.onClose()}},{key:"_onClose",value:function(){this._closeOnClick=!0}},{key:"_contentLoaded",value:function(t){this._content=t}},{key:"_renderTip",value:function(){var t=this.props.tipSize;return Object(r.createElement)("div",{key:"tip",className:"mapboxgl-popup-tip",style:{borderWidth:t}})}},{key:"_renderContent",value:function(){var t=this.props,e=t.closeButton,n=t.children;return Object(r.createElement)("div",{key:"content",ref:this._contentLoaded,className:"mapboxgl-popup-content"},[e&&Object(r.createElement)("button",{key:"close-button",className:"mapboxgl-popup-close-button",type:"button",onClick:this._onClose},"×"),n])}},{key:"render",value:function(){var t=this.props,e=t.className,n=t.longitude,i=t.latitude,o=t.offsetLeft,a=t.offsetTop,s=$e(this.context.viewport.project([n,i]),2),u=s[0],l=s[1],c=this._getPosition(u,l),h=Ke[c],p={position:"absolute",left:u+o,top:l+a,transform:"translate(".concat(100*-h.x,"%, ").concat(100*-h.y,"%)")};return Object(r.createElement)("div",{className:"mapboxgl-popup mapboxgl-popup-anchor-".concat(c," ").concat(e),style:p,ref:this._onContainerLoad},[this._renderTip(),this._renderContent()])}}])&&tn(n.prototype,i),o&&tn(n,o),e;var n,i,o}(Ve);function sn(t){return(sn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function un(t,e){if(n=t,!(null!=(r=e)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function ln(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}function cn(t,e){return(cn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function hn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}an.displayName="Popup",an.propTypes=rn,an.defaultProps=on;var pn=Object.assign({},oe.defaultProps,{transitionDuration:300}),fn=Object.assign({},Ve.propTypes,{className:o.a.string,onViewStateChange:o.a.func,onViewportChange:o.a.func,showCompass:o.a.bool,showZoom:o.a.bool}),dn=Object.assign({},Ve.defaultProps,{className:"",onViewStateChange:function(){},onViewportChange:function(){},showCompass:!0,showZoom:!0}),mn=function(t){function e(t){var n;return un(this,e),n=function(t,e){return!e||"object"!==sn(e)&&"function"!=typeof e?hn(t):e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t)),we(t),n._updateViewport=n._updateViewport.bind(hn(n)),n._onZoomIn=n._onZoomIn.bind(hn(n)),n._onZoomOut=n._onZoomOut.bind(hn(n)),n._onResetNorth=n._onResetNorth.bind(hn(n)),n._renderCompass=n._renderCompass.bind(hn(n)),n._renderButton=n._renderButton.bind(hn(n)),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&cn(t,e)}(e,t),n=e,(i=[{key:"shouldComponentUpdate",value:function(t,e,n){return this.context.viewport.bearing!==n.viewport.bearing}},{key:"_updateViewport",value:function(t){var e=this.context.viewport,n=new ut(Object.assign({},e,t)),r=Object.assign({},n.getViewportProps(),pn);this.props.onViewStateChange({viewState:r}),(this.props.onChangeViewport||this.props.onViewportChange)(r)}},{key:"_onZoomIn",value:function(){this._updateViewport({zoom:this.context.viewport.zoom+1})}},{key:"_onZoomOut",value:function(){this._updateViewport({zoom:this.context.viewport.zoom-1})}},{key:"_onResetNorth",value:function(){this._updateViewport({bearing:0,pitch:0})}},{key:"_renderCompass",value:function(){var t=this.context.viewport.bearing;return Object(r.createElement)("span",{className:"mapboxgl-ctrl-compass-arrow",style:{transform:"rotate(".concat(t,"deg)")}})}},{key:"_renderButton",value:function(t,e,n,i){return Object(r.createElement)("button",{key:t,className:"mapboxgl-ctrl-icon mapboxgl-ctrl-".concat(t),type:"button",title:e,onClick:n,children:i})}},{key:"render",value:function(){var t=this.props,e=t.className,n=t.showCompass,i=t.showZoom;return Object(r.createElement)("div",{className:"mapboxgl-ctrl mapboxgl-ctrl-group ".concat(e),ref:this._onContainerLoad},[i&&this._renderButton("zoom-in","Zoom In",this._onZoomIn),i&&this._renderButton("zoom-out","Zoom Out",this._onZoomOut),n&&this._renderButton("compass","Reset North",this._onResetNorth,this._renderCompass())])}}])&&ln(n.prototype,i),o&&ln(n,o),e;var n,i,o}(Ve);mn.displayName="NavigationControl",mn.propTypes=fn,mn.defaultProps=dn;var yn=n(2849);function vn(t){return(vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gn(t,e){if(n=t,!(null!=(r=e)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function _n(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}function xn(t,e){return(xn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function bn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var wn=Object.assign({},Ve.propTypes,{redraw:o.a.func.isRequired}),En=function(t){function e(t){var n;return gn(this,e),(n=function(t,e){return!e||"object"!==vn(e)&&"function"!=typeof e?bn(t):e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t)))._redraw=n._redraw.bind(bn(n)),n._canvasLoaded=n._canvasLoaded.bind(bn(n)),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&xn(t,e)}(e,t),n=e,(i=[{key:"componentDidMount",value:function(){this._redraw()}},{key:"componentDidUpdate",value:function(){this._redraw()}},{key:"_redraw",value:function(){var t=yn.window.devicePixelRatio||1,e=this._canvas.getContext("2d");e.save(),e.scale(t,t);var n=this.context,r=n.viewport,i=n.isDragging;this.props.redraw({width:r.width,height:r.height,ctx:e,isDragging:i,project:r.project.bind(r),unproject:r.unproject.bind(r)}),e.restore()}},{key:"_canvasLoaded",value:function(t){this._canvas=t,this._onContainerLoad(t)}},{key:"render",value:function(){var t=yn.window.devicePixelRatio||1,e=this.context.viewport,n=e.width,i=e.height;return Object(r.createElement)("canvas",{ref:this._canvasLoaded,width:n*t,height:i*t,style:{width:"".concat(n,"px"),height:"".concat(i,"px"),position:"absolute",left:0,top:0}})}}])&&_n(n.prototype,i),o&&_n(n,o),e;var n,i,o}(Ve);function Sn(t){return(Sn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Tn(t,e){if(n=t,!(null!=(r=e)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function kn(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}function Mn(t,e){return!e||"object"!==Sn(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function An(t,e){return(An=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}En.displayName="CanvasOverlay",En.propTypes=wn,En.defaultProps={captureScroll:!1,captureDrag:!1,captureClick:!1,captureDoubleClick:!1};var Pn=Object.assign({},Ve.propTypes,{redraw:o.a.func.isRequired,style:o.a.object}),zn=function(t){function e(){return Tn(this,e),Mn(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&An(t,e)}(e,t),n=e,(i=[{key:"render",value:function(){var t=this.context,e=t.viewport,n=t.isDragging,i=Object.assign({position:"absolute",left:0,top:0,width:e.width,height:e.height},this.props.style);return Object(r.createElement)("div",{ref:this._onContainerLoad,style:i},this.props.redraw({width:e.width,height:e.height,isDragging:n,project:e.project.bind(e),unproject:e.unproject.bind(e)}))}}])&&kn(n.prototype,i),o&&kn(n,o),e;var n,i,o}(Ve);function In(t){return(In="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Cn(t,e){if(n=t,!(null!=(r=e)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Ln(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}function On(t,e){return!e||"object"!==In(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Dn(t,e){return(Dn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}zn.displayName="HTMLOverlay",zn.propTypes=Pn,zn.defaultProps={captureScroll:!1,captureDrag:!1,captureClick:!1,captureDoubleClick:!1};var Rn=Object.assign({},Ve.propTypes,{redraw:o.a.func.isRequired,style:o.a.object}),Bn=function(t){function e(){return Cn(this,e),On(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Dn(t,e)}(e,t),n=e,(i=[{key:"render",value:function(){var t=this.context,e=t.viewport,n=t.isDragging,i=Object.assign({position:"absolute",left:0,top:0},this.props.style);return Object(r.createElement)("svg",{width:e.width,height:e.height,ref:this._onContainerLoad,style:i},this.props.redraw({width:e.width,height:e.height,isDragging:n,project:e.project.bind(e),unproject:e.unproject.bind(e)}))}}])&&Ln(n.prototype,i),o&&Ln(n,o),e;var n,i,o}(Ve);Bn.displayName="SVGOverlay",Bn.propTypes=Rn,Bn.defaultProps={captureScroll:!1,captureDrag:!1,captureClick:!1,captureDoubleClick:!1},n.d(e,"experimental",(function(){return Fn})),n.d(e,"default",(function(){return Ce})),n.d(e,"InteractiveMap",(function(){return Ce})),n.d(e,"StaticMap",(function(){return wt})),n.d(e,"BaseControl",(function(){return Ve})),n.d(e,"Marker",(function(){return Ye})),n.d(e,"Popup",(function(){return an})),n.d(e,"NavigationControl",(function(){return mn})),n.d(e,"CanvasOverlay",(function(){return En})),n.d(e,"HTMLOverlay",(function(){return zn})),n.d(e,"SVGOverlay",(function(){return Bn})),n.d(e,"TRANSITION_EVENTS",(function(){return ne})),n.d(e,"TransitionInterpolator",(function(){return At})),n.d(e,"LinearInterpolator",(function(){return $t})),n.d(e,"FlyToInterpolator",(function(){return Zt}));var Fn={MapControls:ve}},2484:function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,"a",(function(){return r}))},2485:function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}n.d(e,"a",(function(){return i}))},2493:function(t,e,n){"use strict";var r=n(2484),i=n(2485),o=n(2536),a=n(2497),s=n(2513),u=n(266),l=n(2535),c=n(2622),h=n(2572),p=n(2456),f=n(2515),d=n.n(f),m=n(2516),y=n.n(m),v=n(2517),g=n.n(v),_=n(2624),x=n.n(_),b=Object(h.a)(),w=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width,i=e.height,o=e.viewMatrix,a=void 0===o?b:o,s=e.projectionMatrix,u=void 0===s?b:s;Object(r.a)(this,t),this.width=n||1,this.height=i||1,this.scale=1,this.viewMatrix=a,this.projectionMatrix=u;var l=Object(h.a)();g()(l,l,this.projectionMatrix),g()(l,l,this.viewMatrix),this.viewProjectionMatrix=l;var c=Object(h.a)();d()(c,c,[this.width/2,-this.height/2,1]),y()(c,c,[1,-1,0]),g()(c,c,this.viewProjectionMatrix);var p=x()(Object(h.a)(),c);if(!p)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=c,this.pixelUnprojectionMatrix=p,this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}return Object(i.a)(t,[{key:"equals",value:function(e){return e instanceof t&&(e.width===this.width&&e.height===this.height&&Object(c.c)(e.projectionMatrix,this.projectionMatrix)&&Object(c.c)(e.viewMatrix,this.viewMatrix))}},{key:"project",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.topLeft,r=void 0===n||n,i=Object(l.a)(t,3),o=i[0],a=i[1],s=i[2],u=this.projectFlat([o,a]),c=Object(l.a)(u,2),h=c[0],f=c[1],d=Object(p.k)([h,f,s],this.pixelProjectionMatrix),m=Object(l.a)(d,2),y=m[0],v=m[1],g=r?v:this.height-v;return 2===t.length?[y,g]:[y,g,d[2]]}},{key:"unproject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.topLeft,r=void 0===n||n,i=e.targetZ,o=Object(l.a)(t,3),a=o[0],s=o[1],u=o[2],c=r?s:this.height-s,h=Object(p.h)([a,c,u],this.pixelUnprojectionMatrix,i),f=this.unprojectFlat(h),d=Object(l.a)(f,2),m=d[0],y=d[1];return Number.isFinite(u)?[m,y,h[2]]:Number.isFinite(i)?[m,y,i]:[m,y]}},{key:"projectFlat",value:function(t){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return t}},{key:"unprojectFlat",value:function(t){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return t}}]),t}(),E=n(2623),S=n(2692),T=n.n(S),k=n(2693),M=n.n(k);n.d(e,"a",(function(){return A}));var A=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.width,s=n.height,l=n.latitude,c=void 0===l?0:l,h=n.longitude,f=void 0===h?0:h,d=n.zoom,m=void 0===d?0:d,y=n.pitch,v=void 0===y?0:y,g=n.bearing,_=void 0===g?0:g,x=n.altitude,b=void 0===x?1.5:x,w=n.farZMultiplier,E=void 0===w?10:w;Object(r.a)(this,e),i=i||1,s=s||1;var S=Object(p.l)(m);b=Math.max(.75,b);var T=Object(p.f)({longitude:f,latitude:c,scale:S}),k=Object(p.c)({width:i,height:s,pitch:v,bearing:_,altitude:b,farZMultiplier:E}),M=Object(p.e)({height:s,center:T,pitch:v,bearing:_,altitude:b,flipY:!0});return(t=Object(o.a)(this,Object(a.a)(e).call(this,{width:i,height:s,viewMatrix:M,projectionMatrix:k}))).latitude=c,t.longitude=f,t.zoom=m,t.pitch=v,t.bearing=_,t.altitude=b,t.scale=S,t.center=T,Object.freeze(Object(u.a)(Object(u.a)(t))),t}return Object(s.a)(e,t),Object(i.a)(e,[{key:"projectFlat",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(p.g)(t,e)}},{key:"unprojectFlat",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(p.j)(t,e)}},{key:"getMapCenterByLngLatPosition",value:function(t){var e=t.lngLat,n=t.pos,r=Object(p.h)(n,this.pixelUnprojectionMatrix),i=Object(p.g)(e,this.scale),o=T()([],i,M()([],r)),a=T()([],this.center,o);return Object(p.j)(a,this.scale)}},{key:"getLocationAtPoint",value:function(t){var e=t.lngLat,n=t.pos;return this.getMapCenterByLngLatPosition({lngLat:e,pos:n})}},{key:"fitBounds",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.width,i=this.height,o=Object(E.a)(Object.assign({width:r,height:i,bounds:t},n)),a=o.longitude,s=o.latitude,u=o.zoom;return new e({width:r,height:i,longitude:a,latitude:s,zoom:u})}}]),e}(w)},2497:function(t,e,n){"use strict";function r(t){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}n.d(e,"a",(function(){return r}))},2513:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(2621);function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Object(r.a)(t,e)}},2514:function(t,e){t.exports=function(t,e,n,r,i){var o=1/Math.tan(e/2),a=1/(r-i);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+r)*a,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*r*a,t[15]=0,t}},2515:function(t,e){t.exports=function(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},2516:function(t,e){t.exports=function(t,e,n){var r,i,o,a,s,u,l,c,h,p,f,d,m=n[0],y=n[1],v=n[2];e===t?(t[12]=e[0]*m+e[4]*y+e[8]*v+e[12],t[13]=e[1]*m+e[5]*y+e[9]*v+e[13],t[14]=e[2]*m+e[6]*y+e[10]*v+e[14],t[15]=e[3]*m+e[7]*y+e[11]*v+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=l,t[7]=c,t[8]=h,t[9]=p,t[10]=f,t[11]=d,t[12]=r*m+s*y+h*v+e[12],t[13]=i*m+u*y+p*v+e[13],t[14]=o*m+l*y+f*v+e[14],t[15]=a*m+c*y+d*v+e[15]);return t}},2517:function(t,e){t.exports=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],m=e[12],y=e[13],v=e[14],g=e[15],_=n[0],x=n[1],b=n[2],w=n[3];return t[0]=_*r+x*s+b*h+w*m,t[1]=_*i+x*u+b*p+w*y,t[2]=_*o+x*l+b*f+w*v,t[3]=_*a+x*c+b*d+w*g,_=n[4],x=n[5],b=n[6],w=n[7],t[4]=_*r+x*s+b*h+w*m,t[5]=_*i+x*u+b*p+w*y,t[6]=_*o+x*l+b*f+w*v,t[7]=_*a+x*c+b*d+w*g,_=n[8],x=n[9],b=n[10],w=n[11],t[8]=_*r+x*s+b*h+w*m,t[9]=_*i+x*u+b*p+w*y,t[10]=_*o+x*l+b*f+w*v,t[11]=_*a+x*c+b*d+w*g,_=n[12],x=n[13],b=n[14],w=n[15],t[12]=_*r+x*s+b*h+w*m,t[13]=_*i+x*u+b*p+w*y,t[14]=_*o+x*l+b*f+w*v,t[15]=_*a+x*c+b*d+w*g,t}},2535:function(t,e,n){"use strict";function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}n.d(e,"a",(function(){return r}))},2536:function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(266);function o(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?Object(i.a)(t):e}n.d(e,"a",(function(){return o}))},2543:function(t,e){t.exports=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}},2570:function(t,e){t.exports=function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],l=e[8],c=e[9],h=e[10],p=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t[4]=o*i+l*r,t[5]=a*i+c*r,t[6]=s*i+h*r,t[7]=u*i+p*r,t[8]=l*i-o*r,t[9]=c*i-a*r,t[10]=h*i-s*r,t[11]=p*i-u*r,t}},2571:function(t,e){t.exports=function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],l=e[4],c=e[5],h=e[6],p=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t[0]=o*i+l*r,t[1]=a*i+c*r,t[2]=s*i+h*r,t[3]=u*i+p*r,t[4]=l*i-o*r,t[5]=c*i-a*r,t[6]=h*i-s*r,t[7]=p*i-u*r,t}},2572:function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"d",(function(){return u})),n.d(e,"c",(function(){return l})),n.d(e,"b",(function(){return c}));var r=n(2696),i=n.n(r),o=n(2543),a=n.n(o);function s(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function u(t,e){var n=a()([],e,t);return i()(n,n,1/n[3]),n}function l(t,e){var n=t%e;return n<0?e+n:n}function c(t,e,n){return n*e+(1-n)*t}},2621:function(t,e,n){"use strict";function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}n.d(e,"a",(function(){return r}))},2622:function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i})),n.d(e,"d",(function(){return a})),n.d(e,"c",(function(){return u}));var r={};function i(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function o(t){return Math.round(t/r.EPSILON)*r.EPSILON}function a(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.precision,i=void 0===n?r.precision||4:n;return t=o(t),parseFloat(t.toPrecision(i))}function s(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&void 0!==t.length}function u(t,e){if(s(t)&&s(e)){if(t===e)return!0;if(t.length!==e.length)return!1;for(var n=0;n<t.length;++n)if(!u(t[n],e[n]))return!1;return!0}return Math.abs(t-e)<=r.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}r.EPSILON=1e-12,r.debug=!0,r.precision=4,r.printTypes=!1,r.printDegrees=!1,r.printRowMajor=!0},2623:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(2535),i=n(2493),o=n(2694);function a(t){var e=t.width,n=t.height,a=t.bounds,s=t.padding,u=void 0===s?0:s,l=t.offset,c=void 0===l?[0,0]:l,h=Object(r.a)(a,2),p=Object(r.a)(h[0],2),f=p[0],d=p[1],m=Object(r.a)(h[1],2),y=m[0],v=m[1];if(Number.isFinite(u)){u={top:u,bottom:u,left:u,right:u}}else Object(o.a)(Number.isFinite(u.top)&&Number.isFinite(u.bottom)&&Number.isFinite(u.left)&&Number.isFinite(u.right));var g=new i.a({width:e,height:n,longitude:0,latitude:0,zoom:0}),_=g.project([f,v]),x=g.project([y,d]),b=[Math.abs(x[0]-_[0]),Math.abs(x[1]-_[1])],w=[e-u.left-u.right-2*Math.abs(c[0]),n-u.top-u.bottom-2*Math.abs(c[1])];Object(o.a)(w[0]>0&&w[1]>0);var E=w[0]/b[0],S=w[1]/b[1],T=(u.right-u.left)/2/E,k=(u.bottom-u.top)/2/S,M=[(x[0]+_[0])/2+T,(x[1]+_[1])/2+k],A=g.unproject(M),P=g.zoom+Math.log2(Math.abs(Math.min(E,S)));return{longitude:A[0],latitude:A[1],zoom:P}}},2624:function(t,e){t.exports=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],p=e[10],f=e[11],d=e[12],m=e[13],y=e[14],v=e[15],g=n*s-r*a,_=n*u-i*a,x=n*l-o*a,b=r*u-i*s,w=r*l-o*s,E=i*l-o*u,S=c*m-h*d,T=c*y-p*d,k=c*v-f*d,M=h*y-p*m,A=h*v-f*m,P=p*v-f*y,z=g*P-_*A+x*M+b*k-w*T+E*S;if(!z)return null;return z=1/z,t[0]=(s*P-u*A+l*M)*z,t[1]=(i*A-r*P-o*M)*z,t[2]=(m*E-y*w+v*b)*z,t[3]=(p*w-h*E-f*b)*z,t[4]=(u*k-a*P-l*T)*z,t[5]=(n*P-i*k+o*T)*z,t[6]=(y*x-d*E-v*_)*z,t[7]=(c*E-p*x+f*_)*z,t[8]=(a*A-s*k+l*S)*z,t[9]=(r*k-n*A-o*S)*z,t[10]=(d*w-m*x+v*g)*z,t[11]=(h*x-c*w-f*g)*z,t[12]=(s*T-a*M-u*S)*z,t[13]=(n*M-r*T+i*S)*z,t[14]=(m*_-d*b-y*g)*z,t[15]=(c*b-h*_+p*g)*z,t}},2673:function(t,e,n){"use strict";n.r(e);var r=n(2845),i={mousedown:1,mousemove:2,mouseup:4};var o,a,s=void 0;r.a&&(s=n(2847)),s&&(o=s.PointerEventInput,a=o.prototype.handler,o.prototype.handler=function(t){var e=this.store;t.button>0&&(function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return!0;return!1}(e,(function(e){return e.pointerId===t.pointerId}))||e.push(t)),a.call(this,t)},s.MouseInput.prototype.handler=function(t){var e=i[t.type];1&e&&t.button>=0&&(this.pressed=!0),2&e&&0===t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))});var u=s?s.Manager:function(t){var e={},n=function(){return e};return e.get=function(){return null},e.set=n,e.on=n,e.off=n,e.destroy=n,e.emit=n,e},l=s,c=l?[[l.Rotate,{enable:!1}],[l.Pinch,{enable:!1}],[l.Swipe,{enable:!1}],[l.Pan,{threshold:0,enable:!1}],[l.Press,{enable:!1}],[l.Tap,{event:"doubletap",taps:2,enable:!1}],[l.Tap,{enable:!1}]]:null,h={rotate:["pinch"]},p={doubletap:["tap"]},f={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},d=["keydown","keyup"],m=["mousedown","mousemove","mouseup","mouseleave"],y=["wheel","mousewheel","DOMMouseScroll"],v={tap:"tap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},g={click:"tap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseleave:"pointerleave"},_=n(2848),x=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function b(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var w=-1!==_.a.indexOf("firefox"),E=y,S=function(){function t(e,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};b(this,t),this.element=e,this.callback=n,this.options=Object.assign({enable:!0},i),this.events=E.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach((function(t){return e.addEventListener(t,r.handleEvent)}))}return x(t,[{key:"destroy",value:function(){var t=this;this.events.forEach((function(e){return t.element.removeEventListener(e,t.handleEvent)}))}},{key:"enableEventType",value:function(t,e){"wheel"===t&&(this.options.enable=e)}},{key:"handleEvent",value:function(t){if(this.options.enable){this.options.legacyBlockScroll&&t.preventDefault();var e=t.deltaY;_.b.WheelEvent&&(w&&t.deltaMode===_.b.WheelEvent.DOM_DELTA_PIXEL&&(e/=_.b.devicePixelRatio),t.deltaMode===_.b.WheelEvent.DOM_DELTA_LINE&&(e*=40));var n={x:t.clientX,y:t.clientY};0!==e&&e%4.000244140625==0&&(e=Math.floor(e/4.000244140625)),t.shiftKey&&e&&(e*=.25),this._onWheel(t,-e,n)}}},{key:"_onWheel",value:function(t,e,n){this.callback({type:"wheel",center:n,delta:e,srcEvent:t,pointerType:"mouse",target:t.target})}}]),t}(),T=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function k(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var M=m,A=function(){function t(e,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k(this,t),this.element=e,this.callback=n,this.pressed=!1,this.options=Object.assign({enable:!0},i),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.events=M.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach((function(t){return e.addEventListener(t,r.handleEvent)}))}return T(t,[{key:"destroy",value:function(){var t=this;this.events.forEach((function(e){return t.element.removeEventListener(e,t.handleEvent)}))}},{key:"enableEventType",value:function(t,e){"pointermove"===t&&(this.enableMoveEvent=e),"pointerleave"===t&&(this.enableLeaveEvent=e)}},{key:"handleEvent",value:function(t){if(this.enableLeaveEvent&&"mouseleave"===t.type&&this.callback({type:"pointerleave",srcEvent:t,pointerType:"mouse",target:t.target}),this.enableMoveEvent)switch(t.type){case"mousedown":t.button>=0&&(this.pressed=!0);break;case"mousemove":0===t.which&&(this.pressed=!1),this.pressed||this.callback({type:"pointermove",srcEvent:t,pointerType:"mouse",target:t.target});break;case"mouseup":this.pressed=!1}}}]),t}(),P=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function z(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var I=d,C=function(){function t(e,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};z(this,t),this.element=e,this.callback=n,this.options=Object.assign({enable:!0},i),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=I.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),e.tabIndex=1,e.style.outline="none",this.events.forEach((function(t){return e.addEventListener(t,r.handleEvent)}))}return P(t,[{key:"destroy",value:function(){var t=this;this.events.forEach((function(e){return t.element.removeEventListener(e,t.handleEvent)}))}},{key:"enableEventType",value:function(t,e){"keydown"===t&&(this.enableDownEvent=e),"keyup"===t&&(this.enableUpEvent=e)}},{key:"handleEvent",value:function(t){var e=t.target||t.srcElement;"INPUT"===e.tagName&&"text"===e.type||"TEXTAREA"===e.tagName||(this.enableDownEvent&&"keydown"===t.type&&this.callback({type:"keydown",srcEvent:t,key:t.key,target:t.target}),this.enableUpEvent&&"keyup"===t.type&&this.callback({type:"keyup",srcEvent:t,key:t.key,target:t.target}))}}]),t}(),L=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function O(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var D=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};O(this,t),this.element=e,this.callback=n,this.options=Object.assign({enable:!0},r),this.handleEvent=this.handleEvent.bind(this),e.addEventListener("contextmenu",this.handleEvent)}return L(t,[{key:"destroy",value:function(){this.element.removeEventListener("contextmenu",this.handleEvent)}},{key:"handleEvent",value:function(t){this.callback({type:"contextmenu",center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:"mouse",target:t.target}),this.options.rightButton&&t.preventDefault()}}]),t}(),R={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4};var B=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function F(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var j={events:null,recognizers:null,Manager:u,rightButton:!1,touchAction:"none",legacyBlockScroll:!0},V=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};F(this,t),this.options=Object.assign({},j,n),this.eventHandlers=[],this._onBasicInput=this._onBasicInput.bind(this),this._onOtherEvent=this._onOtherEvent.bind(this),this.setElement(e);var r=n.events;r&&this.on(r)}return B(t,[{key:"setElement",value:function(t){var e=this;if(this.element&&this.destroy(),this.element=t,t){var n=this.options,r=n.Manager;this.manager=new r(t,{touchAction:n.touchAction,recognizers:n.recognizers||c}).on("hammer.input",this._onBasicInput),n.recognizers||Object.keys(h).forEach((function(t){var n=e.manager.get(t);n&&h[t].forEach((function(t){n.recognizeWith(t)}))})),this.wheelInput=new S(t,this._onOtherEvent,{enable:!1,legacyBlockScroll:n.legacyBlockScroll}),this.moveInput=new A(t,this._onOtherEvent,{enable:!1}),this.keyInput=new C(t,this._onOtherEvent,{enable:!1}),this.contextmenuInput=new D(t,this._onOtherEvent,{rightButton:n.rightButton}),this.eventHandlers.forEach((function(t){var n=t.recognizerName,r=t.eventAlias,i=t.wrappedHandler;e._toggleRecognizer(n,!0),e.manager.on(r,i)}))}}},{key:"destroy",value:function(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}},{key:"on",value:function(t,e,n){if("string"==typeof t)this._addEventHandler(t,e,n);else for(var r in n=e,t)this._addEventHandler(r,t[r],n)}},{key:"off",value:function(t,e){if("string"==typeof t)this._removeEventHandler(t,e);else for(var n in t)this._removeEventHandler(n,t[n])}},{key:"_toggleRecognizer",value:function(t,e){var n=this.manager;if(n){var r=n.get(t);if(r){r.set({enable:e});var i=p[t];i&&!this.options.recognizers&&i.forEach((function(r){var i=n.get(r);e?i.requireFailure(t):i.dropRequireFailure(t)}))}this.wheelInput.enableEventType(t,e),this.moveInput.enableEventType(t,e),this.keyInput.enableEventType(t,e)}}},{key:"_addEventHandler",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=this.manager,i=this.eventHandlers,o=this._wrapEventHandler(t,e,n),a=g[t]||t,s=v[a]||a;this._toggleRecognizer(s,!0);var u=i.filter((function(t){return t.eventAlias===a&&t.srcElement!==n&&(!t.srcElement||t.srcElement.contains(n))}));i.push({event:t,eventAlias:a,recognizerName:s,srcElement:n,handler:e,wrappedHandler:o}),u.forEach((function(t){return r.off(a,t.wrappedHandler)})),r&&r.on(a,o),u.forEach((function(t){return r.on(a,t.wrappedHandler)}))}},{key:"_removeEventHandler",value:function(t,e){for(var n=this.manager,r=this.eventHandlers,i=!1,o=r.length;o--;){var a=r[o];a.event===t&&a.handler===e&&(n&&n.off(a.eventAlias,a.wrappedHandler),r.splice(o,1),i=!0)}if(i){var s=g[t]||t,u=v[s]||s;r.find((function(t){return t.recognizerName===u}))||this._toggleRecognizer(u,!1)}}},{key:"_wrapEventHandler",value:function(t,e,n){var r=this;return function(i){var o=i.mjolnirEvent;(o||(o=r._normalizeEvent(i),i.mjolnirEvent=o),o.handled&&o.handled!==n)||(!n||n.contains(i.srcEvent.target))&&e(Object.assign({},o,{type:t,stopPropagation:function(){o.handled||(o.handled=n)}}))}}},{key:"_normalizeEvent",value:function(t){var e=this.element;return Object.assign({},t,function(t){var e=R[t.srcEvent.type];if(!e)return null;var n=t.srcEvent,r=n.buttons,i=n.button,o=n.which,a=!1,s=!1,u=!1;return 4===e||2===e&&!Number.isFinite(r)?(a=1===o,s=2===o,u=3===o):2===e?(a=Boolean(1&r),s=Boolean(4&r),u=Boolean(2&r)):1===e&&(a=0===i,s=1===i,u=2===i),{leftButton:a,middleButton:s,rightButton:u}}(t),function(t,e){var n=t.srcEvent;if(!t.center&&!Number.isFinite(n.clientX))return null;var r=t.center||{x:n.clientX,y:n.clientY},i=e.getBoundingClientRect(),o=i.width/e.offsetWidth,a=i.height/e.offsetHeight;return{center:r,offsetCenter:{x:(r.x-i.left-e.clientLeft)/o,y:(r.y-i.top-e.clientTop)/a}}}(t,e),{handled:!1,rootElement:e})}},{key:"_onBasicInput",value:function(t){var e=t.srcEvent,n=f[e.type];n&&this.manager.emit(n,t)}},{key:"_onOtherEvent",value:function(t){this.manager.emit(t.type,t)}}]),t}();n.d(e,"EventManager",(function(){return V}))},2692:function(t,e){t.exports=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}},2693:function(t,e){t.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t}},2694:function(t,e,n){"use strict";function r(t){if(!t)throw new Error("viewport-mercator-project: assertion failed.")}n.d(e,"a",(function(){return r}))},2695:function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return o}));var r=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array,o=Math.random;Math.PI;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},2696:function(t,e){t.exports=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}},2697:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(2493),i=n(2572);function o(t){var e=t.width,n=t.height,o=t.longitude,a=t.latitude,s=t.zoom,u=t.pitch,l=void 0===u?0:u,c=t.bearing,h=void 0===c?0:c;(o<-180||o>180)&&(o=Object(i.c)(o+180,360)-180),(h<-180||h>180)&&(h=Object(i.c)(h+180,360)-180);var p=new r.a({width:e,height:n,longitude:o,latitude:a,zoom:s}),f=p.project([o,85.05113])[1],d=p.project([o,-85.05113])[1],m=0;return d-f<n&&(s+=Math.log2(n/(d-f)),f=(p=new r.a({width:e,height:n,longitude:o,latitude:a,zoom:s})).project([o,85.05113])[1],d=p.project([o,-85.05113])[1]),f>0?m=f:d<n&&(m=d-n),m&&(a=p.unproject([e/2,n/2+m])[1]),{width:e,height:n,longitude:o,latitude:a,zoom:s,pitch:l,bearing:h}}},2807:function(t,e,n){"use strict";var r=n(2484),i=n(2485),o=n(2536),a=n(2497),s=n(2513),u=n(2621);function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function c(t,e,n){return(c=l()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&Object(u.a)(i,n.prototype),i}).apply(null,arguments)}function h(t){var e="function"==typeof Map?new Map:void 0;return(h=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return c(t,arguments,Object(a.a)(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Object(u.a)(r,t)})(t)}var p=n(2622),f=function(t){function e(){return Object(r.a)(this,e),Object(o.a)(this,Object(a.a)(e).apply(this,arguments))}return Object(s.a)(e,t),Object(i.a)(e,[{key:"clone",value:function(){return(new this.constructor).copy(this).check()}},{key:"copy",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=t[e];return this.check()}},{key:"set",value:function(){for(var t=0;t<this.ELEMENTS;++t)this[t]=(t<0||arguments.length<=t?void 0:arguments[t])||0;return this.check()}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)this[n]=t[n+e];return this.check()}},{key:"toString",value:function(){return this.formatString(p.b)}},{key:"formatString",value:function(t){for(var e="",n=0;n<this.ELEMENTS;++n)e+=(n>0?", ":"")+Object(p.d)(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}},{key:"toArray",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)t[e+n]=this[n];return t}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"equals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(!Object(p.c)(this[e],t[e]))return!1;return!0}},{key:"exactEquals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}},{key:"negate",value:function(){for(var t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}},{key:"inverse",value:function(){for(var t=0;t<this.ELEMENTS;++t)this[t]=1/this[t];return this.check()}},{key:"lerp",value:function(t,e,n){void 0===n&&(n=e,e=t,t=this);for(var r=0;r<this.ELEMENTS;++r){var i=t[r];this[r]=i+n*(e[r]-i)}return this.check()}},{key:"min",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}},{key:"max",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}},{key:"clamp",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),e[n]);return this.check()}},{key:"validate",value:function(){for(var t=this.length===this.ELEMENTS,e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}},{key:"check",value:function(){if(p.b.debug&&!this.validate(this))throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"sub",value:function(t){return this.subtract(t)}},{key:"setScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}},{key:"addScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}},{key:"subScalar",value:function(t){return this.addScalar(-t)}},{key:"multiplyScalar",value:function(t){return this.scale(t)}},{key:"divideScalar",value:function(t){return this.scale(1/t)}},{key:"clampScalar",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),e);return this.check()}}]),e}(h(Array));n.d(e,"a",(function(){return m}));var d=function(t,e){if(!t)throw new Error(e)},m=function(t){function e(){return Object(r.a)(this,e),Object(o.a)(this,Object(a.a)(e).apply(this,arguments))}return Object(s.a)(e,t),Object(i.a)(e,[{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"lengthSquared",value:function(){for(var t=0,e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}},{key:"distance",value:function(t){return Math.sqrt(this.distanceSquared(t))}},{key:"distanceSquared",value:function(t){for(var e=0,n=0;n<this.ELEMENTS;++n){var r=this[n]-t[n];e+=r*r}return Object(p.a)(e)}},{key:"dot",value:function(t){for(var e=0,n=0;n<this.ELEMENTS;++n)e+=this[n]*t[n];return Object(p.a)(e)}},{key:"normalize",value:function(){var t=this.magnitude();if(0!==t)for(var e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}},{key:"add",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0;r<e.length;r++)for(var i=e[r],o=0;o<this.ELEMENTS;++o)this[o]+=i[o];return this.check()}},{key:"subtract",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0;r<e.length;r++)for(var i=e[r],o=0;o<this.ELEMENTS;++o)this[o]-=i[o];return this.check()}},{key:"multiply",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0;r<e.length;r++)for(var i=e[r],o=0;o<this.ELEMENTS;++o)this[o]*=i[o];return this.check()}},{key:"divide",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0;r<e.length;r++)for(var i=e[r],o=0;o<this.ELEMENTS;++o)this[o]/=i[o];return this.check()}},{key:"scale",value:function(t){if(Array.isArray(t))return this.multiply(t);for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"scaleAndAdd",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=this[n]*e+t[n];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(t){return this.distance(t)}},{key:"distanceToSquared",value:function(t){return this.distanceSquared(t)}},{key:"getComponent",value:function(t){return d(t>=0&&t<this.ELEMENTS,"index is out of range"),Object(p.a)(this[t])}},{key:"setComponent",value:function(t,e){return d(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}},{key:"addVectors",value:function(t,e){return this.copy(t).add(e)}},{key:"subVectors",value:function(t,e){return this.copy(t).subtract(e)}},{key:"multiplyVectors",value:function(t,e){return this.copy(t).multiply(e)}},{key:"addScaledVector",value:function(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}},{key:"x",get:function(){return this[0]},set:function(t){return this[0]=Object(p.a)(t)}},{key:"y",get:function(){return this[1]},set:function(t){return this[1]=Object(p.a)(t)}}]),e}(f)},2808:function(t,e,n){"use strict";var r=n(2484),i=n(2485),o=n(2536),a=n(2497),s=n(2513),u=n(2807),l=n(2695);c=new l.a(2),l.a!=Float32Array&&(c[0]=0,c[1]=0),h=c;var c,h,p=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object(r.a)(this,e),t=Object(o.a)(this,Object(a.a)(e).call(this,2)),Array.isArray(n)&&1===arguments.length?t.copy(n):t.set(n,i),t}return Object(s.a)(e,t),Object(i.a)(e,[{key:"cross",value:function(t){return function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];t[0]=t[1]=0,t[2]=r}(this,this,t),this.check()}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"operation",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return t.apply(void 0,[this,this].concat(n)),this.check()}},{key:"ELEMENTS",get:function(){return 2}}]),e}(u.a),f=n(2572),d=n(2456);n.d(e,"a",(function(){return y}));var m=["longitude","latitude","zoom"];function y(t,e,n){var r={},i=t.zoom,o=[t.longitude,t.latitude],a=Object(d.l)(i),s=e.zoom,u=[e.longitude,e.latitude],l=Object(d.l)(s-i),c=new p(Object(d.g)(o,a)),h=new p(Object(d.g)(u,a)).subtract(c),y=Math.max(t.width,t.height),v=y/l,g=Math.sqrt(h.x*h.x+h.y*h.y);if(Math.abs(g)<.01){for(var _=0;_<m.length;_++){var x=m[_],b=t[x],w=e[x];r[x]=Object(f.b)(b,w,n)}return r}var E=1.414*1.414,S=(v*v-y*y+E*E*g*g)/(2*y*E*g),T=(v*v-y*y-E*E*g*g)/(2*v*E*g),k=Math.log(Math.sqrt(S*S+1)-S),M=n*((Math.log(Math.sqrt(T*T+1)-T)-k)/1.414),A=Math.cosh(k)/Math.cosh(k+1.414*M),P=y*((Math.cosh(k)*Math.tanh(k+1.414*M)-Math.sinh(k))/E)/g,z=1/A,I=i+Object(d.i)(z),C=Object(d.j)(c.add(h.scale(P)).scale(z),Object(d.l)(I));return r.longitude=C[0],r.latitude=C[1],r.zoom=I,r}},2841:function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return h}));var r=n(0),i=n.n(r);function o(t,e){if(n=t,!(null!=(r=e)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function a(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}function s(){}var u={container:i.a.object,mapboxApiAccessToken:i.a.string,attributionControl:i.a.bool,preserveDrawingBuffer:i.a.bool,onLoad:i.a.func,onError:i.a.func,reuseMaps:i.a.bool,reuseMap:i.a.bool,transformRequest:i.a.func,mapStyle:i.a.string,visible:i.a.bool,width:i.a.number,height:i.a.number,viewState:i.a.object,longitude:i.a.number,latitude:i.a.number,zoom:i.a.number,bearing:i.a.number,pitch:i.a.number,altitude:i.a.number,mapOptions:i.a.object},l={mapboxApiAccessToken:function(){var e=null;if("undefined"!=typeof window&&window.location){var n=window.location.search.match(/access_token=([^&\/]*)/);e=n&&n[1]}return e||void 0===t||(e=e||t.env.MapboxAccessToken||t.env.REACT_APP_MAPBOX_ACCESS_TOKEN),e||null}(),preserveDrawingBuffer:!1,attributionControl:!0,preventStyleDiffing:!1,onLoad:s,onError:s,reuseMaps:!1,reuseMap:!1,transformRequest:null,mapStyle:"mapbox://styles/mapbox/light-v8",visible:!0,bearing:0,pitch:0,altitude:1.5,width:0,height:0,mapOptions:{}};function c(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"component";t.debug&&i.a.checkPropTypes(u,t,"prop",e)}var h=function(){function t(e){if(o(this,t),!e.mapboxgl)throw new Error("Mapbox not available");!t.initialized&&console.debug&&(t.initialized=!0,console.debug("react-map-gl: ".concat("3.3.9"," using mapbox-gl v").concat(e.mapboxgl.version)),this._checkStyleSheet(e.mapboxgl.version)),this.props={},this._initialize(e)}return e=t,(n=[{key:"finalize",value:function(){return this._destroy(),this}},{key:"setProps",value:function(t){return this._update(this.props,t),this}},{key:"resize",value:function(){return this._map.resize(),this}},{key:"getMap",value:function(){return this._map}},{key:"_create",value:function(e){if((e.reuseMaps||e.reuseMap)&&t.savedMap){this._map=this.map=t.savedMap;var n=this._map.getContainer(),r=e.container;for(r.classList.add("mapboxgl-map");0<n.childNodes.length;)r.appendChild(n.childNodes[0]);this._map._container=r,t.savedMap=null,e.mapStyle&&this._map.setStyle(e.mapStyle),e.onLoad()}else{var i={container:e.container||document.body,center:[0,0],zoom:8,pitch:0,bearing:0,maxZoom:24,style:e.mapStyle,interactive:!1,attributionControl:e.attributionControl,preserveDrawingBuffer:e.preserveDrawingBuffer};e.transformRequest&&(i.transformRequest=e.transformRequest),this._map=this.map=new e.mapboxgl.Map(Object.assign({},i,e.mapOptions)),this.map.once("load",e.onLoad),this.map.on("error",e.onError)}return this}},{key:"_destroy",value:function(){this._map&&(t.savedMap?this._map.remove():t.savedMap=this._map,this._map=null)}},{key:"_initialize",value:function(t){c(t=Object.assign({},l,t),"Mapbox"),this.accessToken=t.mapboxApiAccessToken||l.mapboxApiAccessToken,t.mapboxgl&&(this.accessToken?t.mapboxgl.accessToken=this.accessToken:t.mapboxgl.accessToken="no-token"),this._create(t);var e=this.map.getCanvas();e&&(e.style.outline="none"),this._updateMapViewport({},t),this._updateMapSize({},t),this.props=t}},{key:"_update",value:function(t,e){this._map&&(c(e=Object.assign({},this.props,e),"Mapbox"),this._updateMapViewport(t,e),this._updateMapSize(t,e),this.props=e)}},{key:"_updateMapSize",value:function(t,e){(t.width!==e.width||t.height!==e.height)&&this._map.resize()}},{key:"_updateMapViewport",value:function(t,e){var n=this._getViewState(t),r=this._getViewState(e);(r.latitude!==n.latitude||r.longitude!==n.longitude||r.zoom!==n.zoom||r.pitch!==n.pitch||r.bearing!==n.bearing||r.altitude!==n.altitude)&&(this._map.jumpTo(this._getMapboxViewStateProps(e)),r.altitude!==n.altitude&&(this._map.transform.altitude=r.altitude))}},{key:"_getViewState",value:function(t){var e=t.viewState||t,n=e.longitude,r=e.latitude,i=e.zoom,o=e.pitch,a=void 0===o?0:o,s=e.bearing,u=void 0===s?0:s,l=e.altitude;return{longitude:n,latitude:r,zoom:i,pitch:a,bearing:u,altitude:void 0===l?1.5:l}}},{key:"_checkStyleSheet",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"0.47.0";if("undefined"!=typeof document)try{var e=document.createElement("div");e.className="mapboxgl-map",e.style.display="none",document.body.append(e);var n="static"!==window.getComputedStyle(e).position;if(!n){var r=document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("type","text/css"),r.setAttribute("href","https://api.tiles.mapbox.com/mapbox-gl-js/v".concat(t,"/mapbox-gl.css")),document.head.append(r)}}catch(t){}}},{key:"_getMapboxViewStateProps",value:function(t){var e=this._getViewState(t);return{center:[e.longitude,e.latitude],zoom:e.zoom,bearing:e.bearing,pitch:e.pitch,width:t.width,height:t.height}}}])&&a(e.prototype,n),r&&a(e,r),t;var e,n,r}();h.propTypes=u,h.defaultProps=l}).call(this,n(454))},2842:function(t,e,n){"use strict";(function(t){var r=n(2843);function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=!("object"===(void 0===t?"undefined":i(t))&&"[object process]"==t+""&&!t.browser)||r.a;e.a=o}).call(this,n(454))},2843:function(t,e,n){"use strict";(function(t){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}e.a=!("undefined"==typeof window||"object"!==n(window.process)||"renderer"!==window.process.type)||void 0!==t&&"object"===n(t.versions)&&t.versions.electron||!!("object"===("undefined"==typeof navigator?"undefined":n(navigator))&&"string"==typeof navigator.userAgent&&0<=navigator.userAgent.indexOf("Electron"))}).call(this,n(454))},2844:function(t,e){var n,r;n=this,r=function(){"use strict";var t,e,n;function r(r,i){if(t)if(e){var o="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",a={};t(a),(n=i(a)).workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"}))}else e=i;else t=i}return r(0,(function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n=r;function r(t,e,n,r){this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=n,this.p2y=r}r.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},r.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},r.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},r.prototype.solveCurveX=function(t,e){var n,r,i,o,a;for(void 0===e&&(e=1e-6),i=t,a=0;a<8;a++){if(o=this.sampleCurveX(i)-t,Math.abs(o)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=o/s}if((i=t)<(n=0))return n;if(i>(r=1))return r;for(;n<r;){if(o=this.sampleCurveX(i),Math.abs(o-t)<e)return i;t>o?n=i:r=i,i=.5*(r-n)+n}return i},r.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var i=function(t,e,n){this.column=t,this.row=e,this.zoom=n};i.prototype.clone=function(){return new i(this.column,this.row,this.zoom)},i.prototype.zoomTo=function(t){return this.clone()._zoomTo(t)},i.prototype.sub=function(t){return this.clone()._sub(t)},i.prototype._zoomTo=function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this},i.prototype._sub=function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this};var o=a;function a(t,e){this.x=t,this.y=e}function s(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!s(t[n],e[n]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==e){if("object"!=typeof e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var r in t)if(!s(t[r],e[r]))return!1;return!0}return t===e}function u(t,e,r,i){var o=new n(t,e,r,i);return function(t){return o.solve(t)}}a.prototype={clone:function(){return new a(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,n=t.y-this.y;return e*e+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,n=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=n,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),n=Math.sin(t),r=e*this.x-n*this.y,i=n*this.x+e*this.y;return this.x=r,this.y=i,this},_rotateAround:function(t,e){var n=Math.cos(t),r=Math.sin(t),i=e.x+n*(this.x-e.x)-r*(this.y-e.y),o=e.y+r*(this.x-e.x)+n*(this.y-e.y);return this.x=i,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(t){return t instanceof a?t:Array.isArray(t)?new a(t[0],t[1]):t};var l=u(.25,.1,.25,1);function c(t,e,n){return Math.min(n,Math.max(e,t))}function h(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];for(var r=0,i=e;r<i.length;r+=1){var o=i[r];for(var a in o)t[a]=o[a]}return t}var p=1;function f(){return p++}function d(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function m(t,e){return-1!==t.indexOf(e,t.length-e.length)}function y(t,e,n){var r={};for(var i in t)r[i]=e.call(n||this,t[i],i,t);return r}function v(t,e,n){var r={};for(var i in t)e.call(n||this,t[i],i,t)&&(r[i]=t[i]);return r}function g(t){return Array.isArray(t)?t.map(g):"object"==typeof t&&t?y(t,g):t}var _={};function x(t){_[t]||("undefined"!=typeof console&&console.warn(t),_[t]=!0)}function b(t,e,n){return(n.y-t.y)*(e.x-t.x)>(e.y-t.y)*(n.x-t.x)}function w(t){for(var e=0,n=0,r=t.length,i=r-1,o=void 0,a=void 0;n<r;i=n++)o=t[n],e+=((a=t[i]).x-o.x)*(o.y+a.y);return e}var E=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),S=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,T=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,k={now:E,frame:function(t){var e=S(t);return{cancel:function(){return T(e)}}},getImageData:function(t){var e=self.document.createElement("canvas"),n=e.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return e.width=t.width,e.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(0,0,t.width,t.height)},resolveURL:function(t){var e=self.document.createElement("a");return e.href=t,e.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},supportsWebp:!1};if(self.document){var M=self.document.createElement("img");M.onload=function(){k.supportsWebp=!0},M.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="}var A={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(A);var P=function(t){function e(e,n,r){t.call(this,e),this.status=n,this.url=r,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error);function z(t){var e=new self.XMLHttpRequest;for(var n in e.open(t.method||"GET",t.url,!0),t.headers)e.setRequestHeader(n,t.headers[n]);return e.withCredentials="include"===t.credentials,e}var I=function(t,e){var n=z(t);return n.responseType="arraybuffer",n.onerror=function(){e(new Error(n.statusText))},n.onload=function(){var r=n.response;if(0===r.byteLength&&200===n.status)return e(new Error("http status 200 returned without content."));(n.status>=200&&n.status<300||0===n.status)&&n.response?e(null,{data:r,cacheControl:n.getResponseHeader("Cache-Control"),expires:n.getResponseHeader("Expires")}):e(new P(n.statusText,n.status,t.url))},n.send(),{cancel:function(){return n.abort()}}};function C(t,e,n){n[t]&&-1!==n[t].indexOf(e)||(n[t]=n[t]||[],n[t].push(e))}function L(t,e,n){if(n&&n[t]){var r=n[t].indexOf(e);-1!==r&&n[t].splice(r,1)}}var O=function(t,e){void 0===e&&(e={}),h(this,e),this.type=t},D=function(t){function e(e,n){void 0===n&&(n={}),t.call(this,"error",h({error:e},n))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(O),R=function(){};R.prototype.on=function(t,e){return this._listeners=this._listeners||{},C(t,e,this._listeners),this},R.prototype.off=function(t,e){return L(t,e,this._listeners),L(t,e,this._oneTimeListeners),this},R.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},C(t,e,this._oneTimeListeners),this},R.prototype.fire=function(t){"string"==typeof t&&(t=new O(t,arguments[1]||{}));var e=t.type;if(this.listens(e)){t.target=this;for(var n=0,r=this._listeners&&this._listeners[e]?this._listeners[e].slice():[];n<r.length;n+=1)r[n].call(this,t);for(var i=0,o=this._oneTimeListeners&&this._oneTimeListeners[e]?this._oneTimeListeners[e].slice():[];i<o.length;i+=1){var a=o[i];L(e,a,this._oneTimeListeners),a.call(this,t)}var s=this._eventedParent;s&&(h(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),s.fire(t))}else t instanceof D&&console.error(t.error);return this},R.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},R.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var B={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-z-order":{type:"enum",values:{"viewport-y":{},source:{}},default:"viewport-y",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"string",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Heatmap"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}}},F=function(t,e,n,r){this.message=(t?t+": ":"")+n,r&&(this.identifier=r),null!=e&&e.__line__&&(this.line=e.__line__)};function j(t){var e=t.key,n=t.value;return n?[new F(e,n,"constants have been deprecated as of v8")]:[]}function V(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];for(var r=0,i=e;r<i.length;r+=1){var o=i[r];for(var a in o)t[a]=o[a]}return t}function N(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function U(t){return Array.isArray(t)?t.map(U):N(t)}var q=function(t){function e(e,n){t.call(this,n),this.message=n,this.key=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),Z=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var n=0,r=e;n<r.length;n+=1){var i=r[n],o=i[0],a=i[1];this.bindings[o]=a}};Z.prototype.concat=function(t){return new Z(this,t)},Z.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},Z.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var G={kind:"null"},X={kind:"number"},W={kind:"string"},H={kind:"boolean"},Y={kind:"color"},K={kind:"object"},J={kind:"value"},$={kind:"collator"},Q={kind:"formatted"};function tt(t,e){return{kind:"array",itemType:t,N:e}}function et(t){if("array"===t.kind){var e=et(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var nt=[G,X,W,H,Y,Q,K,tt(J)];function rt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!rt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var n=0,r=nt;n<r.length;n+=1)if(!rt(r[n],e))return null}return"Expected "+et(t)+" but found "+et(e)+" instead."}var it=e((function(t,e){var n={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 r(t){return(t=Math.round(t))<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function o(t){return"%"===t[t.length-1]?r(parseFloat(t)/100*255):r(parseInt(t))}function a(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(parseFloat(t))}function s(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}try{e.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in n)return n[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=i.indexOf("("),l=i.indexOf(")");if(-1!==u&&l+1===i.length){var c=i.substr(0,u),h=i.substr(u+1,l-(u+1)).split(","),p=1;switch(c){case"rgba":if(4!==h.length)return null;p=a(h.pop());case"rgb":return 3!==h.length?null:[o(h[0]),o(h[1]),o(h[2]),p];case"hsla":if(4!==h.length)return null;p=a(h.pop());case"hsl":if(3!==h.length)return null;var f=(parseFloat(h[0])%360+360)%360/360,d=a(h[1]),m=a(h[2]),y=m<=.5?m*(d+1):m+d-m*d,v=2*m-y;return[r(255*s(v,y,f+1/3)),r(255*s(v,y,f)),r(255*s(v,y,f-1/3)),p];default:return null}}return null}}catch(t){}})).parseCSSColor,ot=function(t,e,n,r){void 0===r&&(r=1),this.r=t,this.g=e,this.b=n,this.a=r};ot.parse=function(t){if(t){if(t instanceof ot)return t;if("string"==typeof t){var e=it(t);if(e)return new ot(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},ot.prototype.toString=function(){var t=this.toArray(),e=t[0],n=t[1],r=t[2],i=t[3];return"rgba("+Math.round(e)+","+Math.round(n)+","+Math.round(r)+","+i+")"},ot.prototype.toArray=function(){var t=this.r,e=this.g,n=this.b,r=this.a;return 0===r?[0,0,0,0]:[255*t/r,255*e/r,255*n/r,r]},ot.black=new ot(0,0,0,1),ot.white=new ot(1,1,1,1),ot.transparent=new ot(0,0,0,0),ot.red=new ot(1,0,0,1);var at=function(t,e,n){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};at.prototype.compare=function(t,e){return this.collator.compare(t,e)},at.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var st=function(t,e,n){this.text=t,this.scale=e,this.fontStack=n},ut=function(t){this.sections=t};function lt(t,e,n,r){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof n&&n>=0&&n<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:"Invalid rgba value ["+[t,e,n,r].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof r?[t,e,n,r]:[t,e,n]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ct(t){if(null===t)return G;if("string"==typeof t)return W;if("boolean"==typeof t)return H;if("number"==typeof t)return X;if(t instanceof ot)return Y;if(t instanceof at)return $;if(t instanceof ut)return Q;if(Array.isArray(t)){for(var e,n=t.length,r=0,i=t;r<i.length;r+=1){var o=ct(i[r]);if(e){if(e===o)continue;e=J;break}e=o}return tt(e||J,n)}return K}function ht(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof ot||t instanceof ut?t.toString():JSON.stringify(t)}ut.fromString=function(t){return new ut([new st(t,null,null)])},ut.prototype.toString=function(){return this.sections.map((function(t){return t.text})).join("")},ut.prototype.serialize=function(){for(var t=["format"],e=0,n=this.sections;e<n.length;e+=1){var r=n[e];t.push(r.text);var i={};r.fontStack&&(i["text-font"]=["literal",r.fontStack.split(",")]),r.scale&&(i["font-scale"]=r.scale),t.push(i)}return t};var pt=function(t,e){this.type=t,this.value=e};pt.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!function t(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 ot)return!0;if(e instanceof at)return!0;if(e instanceof ut)return!0;if(Array.isArray(e)){for(var n=0,r=e;n<r.length;n+=1)if(!t(r[n]))return!1;return!0}if("object"==typeof e){for(var i in e)if(!t(e[i]))return!1;return!0}return!1}(t[1]))return e.error("invalid value");var n=t[1],r=ct(n),i=e.expectedType;return"array"!==r.kind||0!==r.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(r=i),new pt(r,n)},pt.prototype.evaluate=function(){return this.value},pt.prototype.eachChild=function(){},pt.prototype.possibleOutputs=function(){return[this.value]},pt.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof ot?["rgba"].concat(this.value.toArray()):this.value instanceof ut?this.value.serialize():this.value};var ft=function(t){this.name="ExpressionEvaluationError",this.message=t};ft.prototype.toJSON=function(){return this.message};var dt={string:W,number:X,boolean:H,object:K},mt=function(t,e){this.type=t,this.args=e};mt.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var n,r=1,i=t[0];if("array"===i){var o,a;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in dt)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=dt[s],r++}else o=J;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],r++}n=tt(o,a)}else n=dt[i];for(var u=[];r<t.length;r++){var l=e.parse(t[r],r,J);if(!l)return null;u.push(l)}return new mt(n,u)},mt.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var n=this.args[e].evaluate(t);if(!rt(this.type,ct(n)))return n;if(e===this.args.length-1)throw new ft("Expected value to be of type "+et(this.type)+", but found "+et(ct(n))+" instead.")}return null},mt.prototype.eachChild=function(t){this.args.forEach(t)},mt.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.args.map((function(t){return t.possibleOutputs()})));var t},mt.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var n=t.itemType;if("string"===n.kind||"number"===n.kind||"boolean"===n.kind){e.push(n.kind);var r=t.N;("number"==typeof r||this.args.length>1)&&e.push(r)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var yt=function(t){this.type=Q,this.sections=t};yt.parse=function(t,e){if(t.length<3)return e.error("Expected at least two arguments.");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");for(var n=[],r=1;r<t.length-1;r+=2){var i=e.parse(t[r],1,J);if(!i)return null;var o=i.type.kind;if("string"!==o&&"value"!==o&&"null"!==o)return e.error("Formatted text type must be 'string', 'value', or 'null'.");var a=t[r+1];if("object"!=typeof a||Array.isArray(a))return e.error("Format options argument must be an object.");var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,X)))return null;var u=null;if(a["text-font"]&&!(u=e.parse(a["text-font"],1,tt(W))))return null;n.push({text:i,scale:s,font:u})}return new yt(n)},yt.prototype.evaluate=function(t){return new ut(this.sections.map((function(e){return new st(ht(e.text.evaluate(t)),e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null)})))},yt.prototype.eachChild=function(t){for(var e=0,n=this.sections;e<n.length;e+=1){var r=n[e];t(r.text),r.scale&&t(r.scale),r.font&&t(r.font)}},yt.prototype.possibleOutputs=function(){return[void 0]},yt.prototype.serialize=function(){for(var t=["format"],e=0,n=this.sections;e<n.length;e+=1){var r=n[e];t.push(r.text.serialize());var i={};r.scale&&(i["font-scale"]=r.scale.serialize()),r.font&&(i["text-font"]=r.font.serialize()),t.push(i)}return t};var vt={"to-boolean":H,"to-color":Y,"to-number":X,"to-string":W},gt=function(t,e){this.type=t,this.args=e};gt.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var n=t[0];if(("to-boolean"===n||"to-string"===n)&&2!==t.length)return e.error("Expected one argument.");for(var r=vt[n],i=[],o=1;o<t.length;o++){var a=e.parse(t[o],o,J);if(!a)return null;i.push(a)}return new gt(r,i)},gt.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,n,r=0,i=this.args;r<i.length;r+=1){if(n=null,(e=i[r].evaluate(t))instanceof ot)return e;if("string"==typeof e){var o=t.parseColor(e);if(o)return o}else if(Array.isArray(e)&&!(n=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":lt(e[0],e[1],e[2],e[3])))return new ot(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ft(n||"Could not parse color from value '"+("string"==typeof e?e:JSON.stringify(e))+"'")}if("number"===this.type.kind){for(var a=null,s=0,u=this.args;s<u.length;s+=1){if(null===(a=u[s].evaluate(t)))return 0;var l=Number(a);if(!isNaN(l))return l}throw new ft("Could not convert "+JSON.stringify(a)+" to number.")}return"formatted"===this.type.kind?ut.fromString(ht(this.args[0].evaluate(t))):ht(this.args[0].evaluate(t))},gt.prototype.eachChild=function(t){this.args.forEach(t)},gt.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.args.map((function(t){return t.possibleOutputs()})));var t},gt.prototype.serialize=function(){if("formatted"===this.type.kind)return new yt([{text:this.args[0],scale:null,font:null}]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var _t=["Unknown","Point","LineString","Polygon"],xt=function(){this.globals=null,this.feature=null,this.featureState=null,this._parseColorCache={}};xt.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},xt.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?_t[this.feature.type]:this.feature.type:null},xt.prototype.properties=function(){return this.feature&&this.feature.properties||{}},xt.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=ot.parse(t)),e};var bt=function(t,e,n,r){this.name=t,this.type=e,this._evaluate=n,this.args=r};bt.prototype.evaluate=function(t){return this._evaluate(t,this.args)},bt.prototype.eachChild=function(t){this.args.forEach(t)},bt.prototype.possibleOutputs=function(){return[void 0]},bt.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},bt.parse=function(t,e){var n=t[0],r=bt.definitions[n];if(!r)return e.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0);for(var i=Array.isArray(r)?r[0]:r.type,o=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,a=o.filter((function(e){var n=e[0];return!Array.isArray(n)||n.length===t.length-1})),s=null,u=0,l=a;u<l.length;u+=1){var c=l[u],h=c[0],p=c[1];s=new Mt(e.registry,e.path,null,e.scope);for(var f=[],d=!1,m=1;m<t.length;m++){var y=t[m],v=Array.isArray(h)?h[m-1]:h.type,g=s.parse(y,1+f.length,v);if(!g){d=!0;break}f.push(g)}if(!d)if(Array.isArray(h)&&h.length!==f.length)s.error("Expected "+h.length+" arguments, but found "+f.length+" instead.");else{for(var _=0;_<f.length;_++){var x=Array.isArray(h)?h[_]:h.type,b=f[_];s.concat(_+1).checkSubtype(x,b.type)}if(0===s.errors.length)return new bt(n,i,p,f)}}if(1===a.length)e.errors.push.apply(e.errors,s.errors);else{for(var w=(a.length?a:o).map((function(t){var e;return e=t[0],Array.isArray(e)?"("+e.map(et).join(", ")+")":"("+et(e.type)+"...)"})).join(" | "),E=[],S=1;S<t.length;S++){var T=e.parse(t[S],1+E.length);if(!T)return null;E.push(et(T.type))}e.error("Expected arguments of type "+w+", but found ("+E.join(", ")+") instead.")}return null},bt.register=function(t,e){for(var n in bt.definitions=e,e)t[n]=bt};var wt=function(t,e,n){this.type=$,this.locale=n,this.caseSensitive=t,this.diacriticSensitive=e};function Et(t){if(t instanceof bt){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}var e=!0;return t.eachChild((function(t){e&&!Et(t)&&(e=!1)})),e}function St(t){if(t instanceof bt&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!St(t)&&(e=!1)})),e}function Tt(t,e){if(t instanceof bt&&e.indexOf(t.name)>=0)return!1;var n=!0;return t.eachChild((function(t){n&&!Tt(t,e)&&(n=!1)})),n}wt.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var n=t[1];if("object"!=typeof n||Array.isArray(n))return e.error("Collator options argument must be an object.");var r=e.parse(void 0!==n["case-sensitive"]&&n["case-sensitive"],1,H);if(!r)return null;var i=e.parse(void 0!==n["diacritic-sensitive"]&&n["diacritic-sensitive"],1,H);if(!i)return null;var o=null;return n.locale&&!(o=e.parse(n.locale,1,W))?null:new wt(r,i,o)},wt.prototype.evaluate=function(t){return new at(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},wt.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},wt.prototype.possibleOutputs=function(){return[void 0]},wt.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var kt=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};kt.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var n=t[1];return e.scope.has(n)?new kt(n,e.scope.get(n)):e.error('Unknown variable "'+n+'". Make sure "'+n+'" has been bound in an enclosing "let" expression before using it.',1)},kt.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},kt.prototype.eachChild=function(){},kt.prototype.possibleOutputs=function(){return[void 0]},kt.prototype.serialize=function(){return["var",this.name]};var Mt=function(t,e,n,r,i){void 0===e&&(e=[]),void 0===r&&(r=new Z),void 0===i&&(i=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=r,this.errors=i,this.expectedType=n};function At(t,e){for(var n,r,i=0,o=t.length-1,a=0;i<=o;){if(n=t[a=Math.floor((i+o)/2)],r=t[a+1],e===n||e>n&&e<r)return a;if(n<e)i=a+1;else{if(!(n>e))throw new ft("Input is not a number.");o=a-1}}return Math.max(a-1,0)}Mt.prototype.parse=function(t,e,n,r,i){return void 0===i&&(i={}),e?this.concat(e,n,r)._parse(t,i):this._parse(t,i)},Mt.prototype._parse=function(t,e){function n(t,e,n){return"assert"===n?new mt(e,[t]):"coerce"===n?new gt(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var r=t[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found "+typeof r+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[r];if(i){var o=i.parse(t,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=n(o,a,e.typeAnnotation||"coerce");else o=n(o,a,e.typeAnnotation||"assert")}if(!(o instanceof pt)&&function t(e){if(e instanceof kt)return t(e.boundExpression);if(e instanceof bt&&"error"===e.name)return!1;if(e instanceof wt)return!1;var n=e instanceof gt||e instanceof mt,r=!0;return e.eachChild((function(e){r=n?r&&t(e):r&&e instanceof pt})),!!r&&Et(e)&&Tt(e,["zoom","heatmap-density","line-progress","is-supported-script"])}(o)){var u=new xt;try{o=new pt(o.type,o.evaluate(u))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},Mt.prototype.concat=function(t,e,n){var r="number"==typeof t?this.path.concat(t):this.path,i=n?this.scope.concat(n):this.scope;return new Mt(this.registry,r,e||null,i,this.errors)},Mt.prototype.error=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];var r=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new q(r,t))},Mt.prototype.checkSubtype=function(t,e){var n=rt(t,e);return n&&this.error(n),n};var Pt=function(t,e,n){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var r=0,i=n;r<i.length;r+=1){var o=i[r],a=o[0],s=o[1];this.labels.push(a),this.outputs.push(s)}};function zt(t,e,n){return t*(1-n)+e*n}Pt.parse=function(t,e){var n=t[1],r=t.slice(2);if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(n=e.parse(n,1,X)))return null;var i=[],o=null;e.expectedType&&"value"!==e.expectedType.kind&&(o=e.expectedType),r.unshift(-1/0);for(var a=0;a<r.length;a+=2){var s=r[a],u=r[a+1],l=a+1,c=a+2;if("number"!=typeof s)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(i.length&&i[i.length-1][0]>=s)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var h=e.parse(u,c,o);if(!h)return null;o=o||h.type,i.push([s,h])}return new Pt(o,n,i)},Pt.prototype.evaluate=function(t){var e=this.labels,n=this.outputs;if(1===e.length)return n[0].evaluate(t);var r=this.input.evaluate(t);if(r<=e[0])return n[0].evaluate(t);var i=e.length;return r>=e[i-1]?n[i-1].evaluate(t):n[At(e,r)].evaluate(t)},Pt.prototype.eachChild=function(t){t(this.input);for(var e=0,n=this.outputs;e<n.length;e+=1)t(n[e])},Pt.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.outputs.map((function(t){return t.possibleOutputs()})));var t},Pt.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var It=Object.freeze({number:zt,color:function(t,e,n){return new ot(zt(t.r,e.r,n),zt(t.g,e.g,n),zt(t.b,e.b,n),zt(t.a,e.a,n))},array:function(t,e,n){return t.map((function(t,r){return zt(t,e[r],n)}))}}),Ct=6/29,Lt=3*Ct*Ct,Ot=Math.PI/180,Dt=180/Math.PI;function Rt(t){return t>.008856451679035631?Math.pow(t,1/3):t/Lt+4/29}function Bt(t){return t>Ct?t*t*t:Lt*(t-4/29)}function Ft(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function jt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Vt(t){var e=jt(t.r),n=jt(t.g),r=jt(t.b),i=Rt((.4124564*e+.3575761*n+.1804375*r)/.95047),o=Rt((.2126729*e+.7151522*n+.072175*r)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-Rt((.0193339*e+.119192*n+.9503041*r)/1.08883)),alpha:t.a}}function Nt(t){var e=(t.l+16)/116,n=isNaN(t.a)?e:e+t.a/500,r=isNaN(t.b)?e:e-t.b/200;return e=1*Bt(e),n=.95047*Bt(n),r=1.08883*Bt(r),new ot(Ft(3.2404542*n-1.5371385*e-.4985314*r),Ft(-.969266*n+1.8760108*e+.041556*r),Ft(.0556434*n-.2040259*e+1.0572252*r),t.alpha)}var Ut={forward:Vt,reverse:Nt,interpolate:function(t,e,n){return{l:zt(t.l,e.l,n),a:zt(t.a,e.a,n),b:zt(t.b,e.b,n),alpha:zt(t.alpha,e.alpha,n)}}},qt={forward:function(t){var e=Vt(t),n=e.l,r=e.a,i=e.b,o=Math.atan2(i,r)*Dt;return{h:o<0?o+360:o,c:Math.sqrt(r*r+i*i),l:n,alpha:t.a}},reverse:function(t){var e=t.h*Ot,n=t.c;return Nt({l:t.l,a:Math.cos(e)*n,b:Math.sin(e)*n,alpha:t.alpha})},interpolate:function(t,e,n){return{h:function(t,e,n){var r=e-t;return t+n*(r>180||r<-180?r-360*Math.round(r/360):r)}(t.h,e.h,n),c:zt(t.c,e.c,n),l:zt(t.l,e.l,n),alpha:zt(t.alpha,e.alpha,n)}}},Zt=Object.freeze({lab:Ut,hcl:qt}),Gt=function(t,e,n,r,i){this.type=t,this.operator=e,this.interpolation=n,this.input=r,this.labels=[],this.outputs=[];for(var o=0,a=i;o<a.length;o+=1){var s=a[o],u=s[0],l=s[1];this.labels.push(u),this.outputs.push(l)}};function Xt(t,e,n,r){var i=r-n,o=t-n;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}Gt.interpolationFactor=function(t,e,r,i){var o=0;if("exponential"===t.name)o=Xt(e,t.base,r,i);else if("linear"===t.name)o=Xt(e,1,r,i);else if("cubic-bezier"===t.name){var a=t.controlPoints;o=new n(a[0],a[1],a[2],a[3]).solve(Xt(e,1,r,i))}return o},Gt.parse=function(t,e){var n=t[0],r=t[1],i=t[2],o=t.slice(3);if(!Array.isArray(r)||0===r.length)return e.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){var a=r[1];if("number"!=typeof a)return e.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:a}}else{if("cubic-bezier"!==r[0])return e.error("Unknown interpolation type "+String(r[0]),1,0);var s=r.slice(1);if(4!==s.length||s.some((function(t){return"number"!=typeof t||t<0||t>1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,X)))return null;var u=[],l=null;"interpolate-hcl"===n||"interpolate-lab"===n?l=Y:e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var c=0;c<o.length;c+=2){var h=o[c],p=o[c+1],f=c+3,d=c+4;if("number"!=typeof h)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(u.length&&u[u.length-1][0]>=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var m=e.parse(p,d,l);if(!m)return null;l=l||m.type,u.push([h,m])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new Gt(l,n,r,i,u):e.error("Type "+et(l)+" is not interpolatable.")},Gt.prototype.evaluate=function(t){var e=this.labels,n=this.outputs;if(1===e.length)return n[0].evaluate(t);var r=this.input.evaluate(t);if(r<=e[0])return n[0].evaluate(t);var i=e.length;if(r>=e[i-1])return n[i-1].evaluate(t);var o=At(e,r),a=e[o],s=e[o+1],u=Gt.interpolationFactor(this.interpolation,r,a,s),l=n[o].evaluate(t),c=n[o+1].evaluate(t);return"interpolate"===this.operator?It[this.type.kind.toLowerCase()](l,c,u):"interpolate-hcl"===this.operator?qt.reverse(qt.interpolate(qt.forward(l),qt.forward(c),u)):Ut.reverse(Ut.interpolate(Ut.forward(l),Ut.forward(c),u))},Gt.prototype.eachChild=function(t){t(this.input);for(var e=0,n=this.outputs;e<n.length;e+=1)t(n[e])},Gt.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.outputs.map((function(t){return t.possibleOutputs()})));var t},Gt.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],n=0;n<this.labels.length;n++)e.push(this.labels[n],this.outputs[n].serialize());return e};var Wt=function(t,e){this.type=t,this.args=e};Wt.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var n=null,r=e.expectedType;r&&"value"!==r.kind&&(n=r);for(var i=[],o=0,a=t.slice(1);o<a.length;o+=1){var s=a[o],u=e.parse(s,1+i.length,n,void 0,{typeAnnotation:"omit"});if(!u)return null;n=n||u.type,i.push(u)}var l=r&&i.some((function(t){return rt(r,t.type)}));return new Wt(l?J:n,i)},Wt.prototype.evaluate=function(t){for(var e=null,n=0,r=this.args;n<r.length&&null===(e=r[n].evaluate(t));n+=1);return e},Wt.prototype.eachChild=function(t){this.args.forEach(t)},Wt.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.args.map((function(t){return t.possibleOutputs()})));var t},Wt.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Ht=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};Ht.prototype.evaluate=function(t){return this.result.evaluate(t)},Ht.prototype.eachChild=function(t){for(var e=0,n=this.bindings;e<n.length;e+=1)t(n[e][1]);t(this.result)},Ht.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var n=[],r=1;r<t.length-1;r+=2){var i=t[r];if("string"!=typeof i)return e.error("Expected string, but found "+typeof i+" instead.",r);if(/[^a-zA-Z0-9_]/.test(i))return e.error("Variable names must contain only alphanumeric characters or '_'.",r);var o=e.parse(t[r+1],r+1);if(!o)return null;n.push([i,o])}var a=e.parse(t[t.length-1],t.length-1,e.expectedType,n);return a?new Ht(n,a):null},Ht.prototype.possibleOutputs=function(){return this.result.possibleOutputs()},Ht.prototype.serialize=function(){for(var t=["let"],e=0,n=this.bindings;e<n.length;e+=1){var r=n[e],i=r[0],o=r[1];t.push(i,o.serialize())}return t.push(this.result.serialize()),t};var Yt=function(t,e,n){this.type=t,this.index=e,this.input=n};Yt.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var n=e.parse(t[1],1,X),r=e.parse(t[2],2,tt(e.expectedType||J));if(!n||!r)return null;var i=r.type;return new Yt(i.itemType,n,r)},Yt.prototype.evaluate=function(t){var e=this.index.evaluate(t),n=this.input.evaluate(t);if(e<0)throw new ft("Array index out of bounds: "+e+" < 0.");if(e>=n.length)throw new ft("Array index out of bounds: "+e+" > "+(n.length-1)+".");if(e!==Math.floor(e))throw new ft("Array index must be an integer, but found "+e+" instead.");return n[e]},Yt.prototype.eachChild=function(t){t(this.index),t(this.input)},Yt.prototype.possibleOutputs=function(){return[void 0]},Yt.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Kt=function(t,e,n,r,i,o){this.inputType=t,this.type=e,this.input=n,this.cases=r,this.outputs=i,this.otherwise=o};Kt.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var n,r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var i={},o=[],a=2;a<t.length-1;a+=2){var s=t[a],u=t[a+1];Array.isArray(s)||(s=[s]);var l=e.concat(a);if(0===s.length)return l.error("Expected at least one branch label.");for(var c=0,h=s;c<h.length;c+=1){var p=h[c];if("number"!=typeof p&&"string"!=typeof p)return l.error("Branch labels must be numbers or strings.");if("number"==typeof p&&Math.abs(p)>Number.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof p&&Math.floor(p)!==p)return l.error("Numeric branch labels must be integer values.");if(n){if(l.checkSubtype(n,ct(p)))return null}else n=ct(p);if(void 0!==i[String(p)])return l.error("Branch labels must be unique.");i[String(p)]=o.length}var f=e.parse(u,a,r);if(!f)return null;r=r||f.type,o.push(f)}var d=e.parse(t[1],1,J);if(!d)return null;var m=e.parse(t[t.length-1],t.length-1,r);return m?"value"!==d.type.kind&&e.concat(1).checkSubtype(n,d.type)?null:new Kt(n,r,d,i,o,m):null},Kt.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(ct(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Kt.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Kt.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.outputs.map((function(t){return t.possibleOutputs()}))).concat(this.otherwise.possibleOutputs());var t},Kt.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],n=[],r={},i=0,o=Object.keys(this.cases).sort();i<o.length;i+=1){var a=o[i],s=r[t.cases[a]];void 0===s?(r[t.cases[a]]=n.length,n.push([t.cases[a],[a]])):n[s][1].push(a)}for(var u=function(e){return"number"===t.inputType.kind?Number(e):e},l=0,c=n;l<c.length;l+=1){var h=c[l],p=h[0],f=h[1];1===f.length?e.push(u(f[0])):e.push(f.map(u)),e.push(t.outputs[p].serialize())}return e.push(this.otherwise.serialize()),e};var Jt=function(t,e,n){this.type=t,this.branches=e,this.otherwise=n};function $t(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Qt(t,e,n,r){return 0===r.compare(e,n)}function te(t,e,n){var r="=="!==t&&"!="!==t;return function(){function i(t,e,n){this.type=H,this.lhs=t,this.rhs=e,this.collator=n,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return i.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var n=t[0],o=e.parse(t[1],1,J);if(!o)return null;if(!$t(n,o.type))return e.concat(1).error('"'+n+"\" comparisons are not supported for type '"+et(o.type)+"'.");var a=e.parse(t[2],2,J);if(!a)return null;if(!$t(n,a.type))return e.concat(2).error('"'+n+"\" comparisons are not supported for type '"+et(a.type)+"'.");if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '"+et(o.type)+"' and '"+et(a.type)+"'.");r&&("value"===o.type.kind&&"value"!==a.type.kind?o=new mt(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new mt(o.type,[a])));var s=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,$)))return null}return new i(o,a,s)},i.prototype.evaluate=function(i){var o=this.lhs.evaluate(i),a=this.rhs.evaluate(i);if(r&&this.hasUntypedArgument){var s=ct(o),u=ct(a);if(s.kind!==u.kind||"string"!==s.kind&&"number"!==s.kind)throw new ft('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+u.kind+") instead.")}if(this.collator&&!r&&this.hasUntypedArgument){var l=ct(o),c=ct(a);if("string"!==l.kind||"string"!==c.kind)return e(i,o,a)}return this.collator?n(i,o,a,this.collator.evaluate(i)):e(i,o,a)},i.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},i.prototype.possibleOutputs=function(){return[!0,!1]},i.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},i}()}Jt.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var r=[],i=1;i<t.length-1;i+=2){var o=e.parse(t[i],i,H);if(!o)return null;var a=e.parse(t[i+1],i+1,n);if(!a)return null;r.push([o,a]),n=n||a.type}var s=e.parse(t[t.length-1],t.length-1,n);return s?new Jt(n,r,s):null},Jt.prototype.evaluate=function(t){for(var e=0,n=this.branches;e<n.length;e+=1){var r=n[e],i=r[0],o=r[1];if(i.evaluate(t))return o.evaluate(t)}return this.otherwise.evaluate(t)},Jt.prototype.eachChild=function(t){for(var e=0,n=this.branches;e<n.length;e+=1){var r=n[e],i=r[0],o=r[1];t(i),t(o)}t(this.otherwise)},Jt.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.branches.map((function(t){return t[0],t[1].possibleOutputs()}))).concat(this.otherwise.possibleOutputs());var t},Jt.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var ee=te("==",(function(t,e,n){return e===n}),Qt),ne=te("!=",(function(t,e,n){return e!==n}),(function(t,e,n,r){return!Qt(0,e,n,r)})),re=te("<",(function(t,e,n){return e<n}),(function(t,e,n,r){return r.compare(e,n)<0})),ie=te(">",(function(t,e,n){return e>n}),(function(t,e,n,r){return r.compare(e,n)>0})),oe=te("<=",(function(t,e,n){return e<=n}),(function(t,e,n,r){return r.compare(e,n)<=0})),ae=te(">=",(function(t,e,n){return e>=n}),(function(t,e,n,r){return r.compare(e,n)>=0})),se=function(t){this.type=X,this.input=t};se.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var n=e.parse(t[1],1);return n?"array"!==n.type.kind&&"string"!==n.type.kind&&"value"!==n.type.kind?e.error("Expected argument of type string or array, but found "+et(n.type)+" instead."):new se(n):null},se.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ft("Expected value to be of type string or array, but found "+et(ct(e))+" instead.")},se.prototype.eachChild=function(t){t(this.input)},se.prototype.possibleOutputs=function(){return[void 0]},se.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var ue={"==":ee,"!=":ne,">":ie,"<":re,">=":ae,"<=":oe,array:mt,at:Yt,boolean:mt,case:Jt,coalesce:Wt,collator:wt,format:yt,interpolate:Gt,"interpolate-hcl":Gt,"interpolate-lab":Gt,length:se,let:Ht,literal:pt,match:Kt,number:mt,object:mt,step:Pt,string:mt,"to-boolean":gt,"to-color":gt,"to-number":gt,"to-string":gt,var:kt};function le(t,e){var n=e[0],r=e[1],i=e[2],o=e[3];n=n.evaluate(t),r=r.evaluate(t),i=i.evaluate(t);var a=o?o.evaluate(t):1,s=lt(n,r,i,a);if(s)throw new ft(s);return new ot(n/255*a,r/255*a,i/255*a,a)}function ce(t,e){return t in e}function he(t,e){var n=e[t];return void 0===n?null:n}function pe(t){return{type:t}}function fe(t){return{result:"success",value:t}}function de(t){return{result:"error",value:t}}function me(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function ye(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function ve(t){return!!t.expression&&t.expression.interpolated}function ge(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function _e(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function xe(t){return t}function be(t,e,n){return void 0!==t?t:void 0!==e?e:void 0!==n?n:void 0}function we(t,e,n,r,i){return be(typeof n===i?r[n]:void 0,t.default,e.default)}function Ee(t,e,n){if("number"!==ge(n))return be(t.default,e.default);var r=t.stops.length;if(1===r)return t.stops[0][1];if(n<=t.stops[0][0])return t.stops[0][1];if(n>=t.stops[r-1][0])return t.stops[r-1][1];var i=ke(t.stops,n);return t.stops[i][1]}function Se(t,e,n){var r=void 0!==t.base?t.base:1;if("number"!==ge(n))return be(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(n<=t.stops[0][0])return t.stops[0][1];if(n>=t.stops[i-1][0])return t.stops[i-1][1];var o=ke(t.stops,n),a=function(t,e,n,r){var i=r-n,o=t-n;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(n,r,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],l=It[e.type]||xe;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=Zt[t.colorSpace];l=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var n=s.evaluate.apply(void 0,t),r=u.evaluate.apply(void 0,t);if(void 0!==n&&void 0!==r)return l(n,r,a)}}:l(s,u,a)}function Te(t,e,n){return"color"===e.type?n=ot.parse(n):"formatted"===e.type?n=ut.fromString(n.toString()):ge(n)===e.type||"enum"===e.type&&e.values[n]||(n=void 0),be(n,t.default,e.default)}function ke(t,e){for(var n,r,i=0,o=t.length-1,a=0;i<=o;){if(n=t[a=Math.floor((i+o)/2)][0],r=t[a+1][0],e===n||e>n&&e<r)return a;n<e?i=a+1:n>e&&(o=a-1)}return Math.max(a-1,0)}bt.register(ue,{error:[{kind:"error"},[W],function(t,e){var n=e[0];throw new ft(n.evaluate(t))}],typeof:[W,[J],function(t,e){return et(ct(e[0].evaluate(t)))}],"to-rgba":[tt(X,4),[Y],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Y,[X,X,X],le],rgba:[Y,[X,X,X,X],le],has:{type:H,overloads:[[[W],function(t,e){return ce(e[0].evaluate(t),t.properties())}],[[W,K],function(t,e){var n=e[0],r=e[1];return ce(n.evaluate(t),r.evaluate(t))}]]},get:{type:J,overloads:[[[W],function(t,e){return he(e[0].evaluate(t),t.properties())}],[[W,K],function(t,e){var n=e[0],r=e[1];return he(n.evaluate(t),r.evaluate(t))}]]},"feature-state":[J,[W],function(t,e){return he(e[0].evaluate(t),t.featureState||{})}],properties:[K,[],function(t){return t.properties()}],"geometry-type":[W,[],function(t){return t.geometryType()}],id:[J,[],function(t){return t.id()}],zoom:[X,[],function(t){return t.globals.zoom}],"heatmap-density":[X,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[X,[],function(t){return t.globals.lineProgress||0}],"+":[X,pe(X),function(t,e){for(var n=0,r=0,i=e;r<i.length;r+=1)n+=i[r].evaluate(t);return n}],"*":[X,pe(X),function(t,e){for(var n=1,r=0,i=e;r<i.length;r+=1)n*=i[r].evaluate(t);return n}],"-":{type:X,overloads:[[[X,X],function(t,e){var n=e[0],r=e[1];return n.evaluate(t)-r.evaluate(t)}],[[X],function(t,e){return-e[0].evaluate(t)}]]},"/":[X,[X,X],function(t,e){var n=e[0],r=e[1];return n.evaluate(t)/r.evaluate(t)}],"%":[X,[X,X],function(t,e){var n=e[0],r=e[1];return n.evaluate(t)%r.evaluate(t)}],ln2:[X,[],function(){return Math.LN2}],pi:[X,[],function(){return Math.PI}],e:[X,[],function(){return Math.E}],"^":[X,[X,X],function(t,e){var n=e[0],r=e[1];return Math.pow(n.evaluate(t),r.evaluate(t))}],sqrt:[X,[X],function(t,e){var n=e[0];return Math.sqrt(n.evaluate(t))}],log10:[X,[X],function(t,e){var n=e[0];return Math.log(n.evaluate(t))/Math.LN10}],ln:[X,[X],function(t,e){var n=e[0];return Math.log(n.evaluate(t))}],log2:[X,[X],function(t,e){var n=e[0];return Math.log(n.evaluate(t))/Math.LN2}],sin:[X,[X],function(t,e){var n=e[0];return Math.sin(n.evaluate(t))}],cos:[X,[X],function(t,e){var n=e[0];return Math.cos(n.evaluate(t))}],tan:[X,[X],function(t,e){var n=e[0];return Math.tan(n.evaluate(t))}],asin:[X,[X],function(t,e){var n=e[0];return Math.asin(n.evaluate(t))}],acos:[X,[X],function(t,e){var n=e[0];return Math.acos(n.evaluate(t))}],atan:[X,[X],function(t,e){var n=e[0];return Math.atan(n.evaluate(t))}],min:[X,pe(X),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[X,pe(X),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[X,[X],function(t,e){var n=e[0];return Math.abs(n.evaluate(t))}],round:[X,[X],function(t,e){var n=e[0].evaluate(t);return n<0?-Math.round(-n):Math.round(n)}],floor:[X,[X],function(t,e){var n=e[0];return Math.floor(n.evaluate(t))}],ceil:[X,[X],function(t,e){var n=e[0];return Math.ceil(n.evaluate(t))}],"filter-==":[H,[W,J],function(t,e){var n=e[0],r=e[1];return t.properties()[n.value]===r.value}],"filter-id-==":[H,[J],function(t,e){var n=e[0];return t.id()===n.value}],"filter-type-==":[H,[W],function(t,e){var n=e[0];return t.geometryType()===n.value}],"filter-<":[H,[W,J],function(t,e){var n=e[0],r=e[1],i=t.properties()[n.value],o=r.value;return typeof i==typeof o&&i<o}],"filter-id-<":[H,[J],function(t,e){var n=e[0],r=t.id(),i=n.value;return typeof r==typeof i&&r<i}],"filter->":[H,[W,J],function(t,e){var n=e[0],r=e[1],i=t.properties()[n.value],o=r.value;return typeof i==typeof o&&i>o}],"filter-id->":[H,[J],function(t,e){var n=e[0],r=t.id(),i=n.value;return typeof r==typeof i&&r>i}],"filter-<=":[H,[W,J],function(t,e){var n=e[0],r=e[1],i=t.properties()[n.value],o=r.value;return typeof i==typeof o&&i<=o}],"filter-id-<=":[H,[J],function(t,e){var n=e[0],r=t.id(),i=n.value;return typeof r==typeof i&&r<=i}],"filter->=":[H,[W,J],function(t,e){var n=e[0],r=e[1],i=t.properties()[n.value],o=r.value;return typeof i==typeof o&&i>=o}],"filter-id->=":[H,[J],function(t,e){var n=e[0],r=t.id(),i=n.value;return typeof r==typeof i&&r>=i}],"filter-has":[H,[J],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[H,[],function(t){return null!==t.id()}],"filter-type-in":[H,[tt(W)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[H,[tt(J)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[H,[W,tt(J)],function(t,e){var n=e[0];return e[1].value.indexOf(t.properties()[n.value])>=0}],"filter-in-large":[H,[W,tt(J)],function(t,e){var n=e[0],r=e[1];return function(t,e,n,r){for(;n<=r;){var i=n+r>>1;if(e[i]===t)return!0;e[i]>t?r=i-1:n=i+1}return!1}(t.properties()[n.value],r.value,0,r.value.length-1)}],all:{type:H,overloads:[[[H,H],function(t,e){var n=e[0],r=e[1];return n.evaluate(t)&&r.evaluate(t)}],[pe(H),function(t,e){for(var n=0,r=e;n<r.length;n+=1)if(!r[n].evaluate(t))return!1;return!0}]]},any:{type:H,overloads:[[[H,H],function(t,e){var n=e[0],r=e[1];return n.evaluate(t)||r.evaluate(t)}],[pe(H),function(t,e){for(var n=0,r=e;n<r.length;n+=1)if(r[n].evaluate(t))return!0;return!1}]]},"!":[H,[H],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[H,[W],function(t,e){var n=e[0],r=t.globals&&t.globals.isSupportedScript;return!r||r(n.evaluate(t))}],upcase:[W,[W],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[W,[W],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[W,pe(J),function(t,e){return e.map((function(e){return ht(e.evaluate(t))})).join("")}],"resolved-locale":[W,[$],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var Me=function(t,e){var n;this.expression=t,this._warningHistory={},this._evaluator=new xt,this._defaultValue="color"===(n=e).type&&_e(n.default)?new ot(0,0,0,0):"color"===n.type?ot.parse(n.default)||null:void 0===n.default?null:n.default,this._enumValues="enum"===e.type?e.values:null};function Ae(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in ue}function Pe(t,e){var n=new Mt(ue,[],function(t){var e={color:Y,string:W,number:X,enum:W,boolean:H,formatted:Q};return"array"===t.type?tt(e[t.value]||J,t.length):e[t.type]}(e)),r=n.parse(t,void 0,void 0,void 0,"string"===e.type?{typeAnnotation:"coerce"}:void 0);return r?fe(new Me(r,e)):de(n.errors)}Me.prototype.evaluateWithoutErrorHandling=function(t,e,n){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=n,this.expression.evaluate(this._evaluator)},Me.prototype.evaluate=function(t,e,n){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=n||null;try{var r=this.expression.evaluate(this._evaluator);if(null==r)return this._defaultValue;if(this._enumValues&&!(r in this._enumValues))throw new ft("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(r)+" instead.");return r}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var ze=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!St(e.expression)};ze.prototype.evaluateWithoutErrorHandling=function(t,e,n){return this._styleExpression.evaluateWithoutErrorHandling(t,e,n)},ze.prototype.evaluate=function(t,e,n){return this._styleExpression.evaluate(t,e,n)};var Ie=function(t,e,n){this.kind=t,this.zoomStops=n.labels,this._styleExpression=e,this.isStateDependent="camera"!==t&&!St(e.expression),n instanceof Gt&&(this._interpolationType=n.interpolation)};function Ce(t,e){if("error"===(t=Pe(t,e)).result)return t;var n=t.value.expression,r=Et(n);if(!r&&!me(e))return de([new q("","data expressions not supported")]);var i=Tt(n,["zoom"]);if(!i&&!ye(e))return de([new q("","zoom expressions not supported")]);var o=function t(e){var n=null;if(e instanceof Ht)n=t(e.result);else if(e instanceof Wt)for(var r=0,i=e.args;r<i.length;r+=1){var o=i[r];if(n=t(o))break}else(e instanceof Pt||e instanceof Gt)&&e.input instanceof bt&&"zoom"===e.input.name&&(n=e);return n instanceof q?n:(e.eachChild((function(e){var r=t(e);r instanceof q?n=r:!n&&r?n=new q("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):n&&r&&n!==r&&(n=new q("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),n)}(n);return o||i?o instanceof q?de([o]):o instanceof Gt&&!ve(e)?de([new q("",'"interpolate" expressions cannot be used with this property')]):fe(o?new Ie(r?"camera":"composite",t.value,o):new ze(r?"constant":"source",t.value)):de([new q("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Ie.prototype.evaluateWithoutErrorHandling=function(t,e,n){return this._styleExpression.evaluateWithoutErrorHandling(t,e,n)},Ie.prototype.evaluate=function(t,e,n){return this._styleExpression.evaluate(t,e,n)},Ie.prototype.interpolationFactor=function(t,e,n){return this._interpolationType?Gt.interpolationFactor(this._interpolationType,t,e,n):0};var Le=function(t,e){this._parameters=t,this._specification=e,V(this,function t(e,n){var r,i,o,a="color"===n.type,s=e.stops&&"object"==typeof e.stops[0][0],u=s||void 0!==e.property,l=s||!u,c=e.type||(ve(n)?"exponential":"interval");if(a&&((e=V({},e)).stops&&(e.stops=e.stops.map((function(t){return[t[0],ot.parse(t[1])]}))),e.default?e.default=ot.parse(e.default):e.default=ot.parse(n.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!Zt[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===c)r=Se;else if("interval"===c)r=Ee;else if("categorical"===c){r=we,i=Object.create(null);for(var h=0,p=e.stops;h<p.length;h+=1){var f=p[h];i[f[0]]=f[1]}o=typeof e.stops[0][0]}else{if("identity"!==c)throw new Error('Unknown function type "'+c+'"');r=Te}if(s){for(var d={},m=[],y=0;y<e.stops.length;y++){var v=e.stops[y],g=v[0].zoom;void 0===d[g]&&(d[g]={zoom:g,type:e.type,property:e.property,default:e.default,stops:[]},m.push(g)),d[g].stops.push([v[0].value,v[1]])}for(var _=[],x=0,b=m;x<b.length;x+=1){var w=b[x];_.push([d[w].zoom,t(d[w],n)])}return{kind:"composite",interpolationFactor:Gt.interpolationFactor.bind(void 0,{name:"linear"}),zoomStops:_.map((function(t){return t[0]})),evaluate:function(t,r){var i=t.zoom;return Se({stops:_,base:e.base},n,i).evaluate(i,r)}}}return l?{kind:"camera",interpolationFactor:"exponential"===c?Gt.interpolationFactor.bind(void 0,{name:"exponential",base:void 0!==e.base?e.base:1}):function(){return 0},zoomStops:e.stops.map((function(t){return t[0]})),evaluate:function(t){var a=t.zoom;return r(e,n,a,i,o)}}:{kind:"source",evaluate:function(t,a){var s=a&&a.properties?a.properties[e.property]:void 0;return void 0===s?be(e.default,n.default):r(e,n,s,i,o)}}}(this._parameters,this._specification))};function Oe(t,e){if(_e(t))return new Le(t,e);if(Ae(t)){var n=Ce(t,e);if("error"===n.result)throw new Error(n.value.map((function(t){return t.key+": "+t.message})).join(", "));return n.value}var r=t;return"string"==typeof t&&"color"===e.type&&(r=ot.parse(t)),{kind:"constant",evaluate:function(){return r}}}function De(t){var e=t.key,n=t.value,r=t.valueSpec||{},i=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=[],u=ge(n);if("object"!==u)return[new F(e,n,"object expected, "+u+" found")];for(var l in n){var c=l.split(".")[0],h=r[c]||r["*"],p=void 0;if(i[c])p=i[c];else if(r[c])p=an;else if(i["*"])p=i["*"];else{if(!r["*"]){s.push(new F(e,n[l],'unknown property "'+l+'"'));continue}p=an}s=s.concat(p({key:(e?e+".":e)+l,value:n[l],valueSpec:h,style:o,styleSpec:a,object:n,objectKey:l},n))}for(var f in r)i[f]||r[f].required&&void 0===r[f].default&&void 0===n[f]&&s.push(new F(e,n,'missing required property "'+f+'"'));return s}function Re(t){var e=t.value,n=t.valueSpec,r=t.style,i=t.styleSpec,o=t.key,a=t.arrayElementValidator||an;if("array"!==ge(e))return[new F(o,e,"array expected, "+ge(e)+" found")];if(n.length&&e.length!==n.length)return[new F(o,e,"array length "+n.length+" expected, length "+e.length+" found")];if(n["min-length"]&&e.length<n["min-length"])return[new F(o,e,"array length at least "+n["min-length"]+" expected, length "+e.length+" found")];var s={type:n.value};i.$version<7&&(s.function=n.function),"object"===ge(n.value)&&(s=n.value);for(var u=[],l=0;l<e.length;l++)u=u.concat(a({array:e,arrayIndex:l,value:e[l],valueSpec:s,style:r,styleSpec:i,key:o+"["+l+"]"}));return u}function Be(t){var e=t.key,n=t.value,r=t.valueSpec,i=ge(n);return"number"!==i?[new F(e,n,"number expected, "+i+" found")]:"minimum"in r&&n<r.minimum?[new F(e,n,n+" is less than the minimum value "+r.minimum)]:"maximum"in r&&n>r.maximum?[new F(e,n,n+" is greater than the maximum value "+r.maximum)]:[]}function Fe(t){var e,n,r,i=t.valueSpec,o=N(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,l="array"===ge(t.value.stops)&&"array"===ge(t.value.stops[0])&&"object"===ge(t.value.stops[0][0]),c=De({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 F(t.key,t.value,'identity function may not have a "stops" property')];var e=[],n=t.value;return e=e.concat(Re({key:t.key,value:n,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===ge(n)&&0===n.length&&e.push(new F(t.key,n,"array must have at least one stop")),e},default:function(t){return an({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&c.push(new F(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||c.push(new F(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!ve(t.valueSpec)&&c.push(new F(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!me(t.valueSpec)?c.push(new F(t.key,t.value,"property functions not supported")):s&&!ye(t.valueSpec)&&c.push(new F(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!l||void 0!==t.value.property||c.push(new F(t.key,t.value,'"property" property is required')),c;function h(t){var e=[],o=t.value,s=t.key;if("array"!==ge(o))return[new F(s,o,"array expected, "+ge(o)+" found")];if(2!==o.length)return[new F(s,o,"array length 2 expected, length "+o.length+" found")];if(l){if("object"!==ge(o[0]))return[new F(s,o,"object expected, "+ge(o[0])+" found")];if(void 0===o[0].zoom)return[new F(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new F(s,o,"object stop key must have value")];if(r&&r>N(o[0].zoom))return[new F(s,o[0].zoom,"stop zoom values must appear in ascending order")];N(o[0].zoom)!==r&&(r=N(o[0].zoom),n=void 0,a={}),e=e.concat(De({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Be,value:p}}))}else e=e.concat(p({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return e.concat(an({key:s+"[1]",value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function p(t,r){var s=ge(t.value),u=N(t.value),l=null!==t.value?t.value:r;if(e){if(s!==e)return[new F(t.key,l,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new F(t.key,l,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var c="number expected, "+s+" found";return me(i)&&void 0===o&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new F(t.key,l,c)]}return"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===s&&void 0!==n&&u<n?[new F(t.key,l,"stop domain values must appear in ascending order")]:(n=u,"categorical"===o&&u in a?[new F(t.key,l,"stop domain values must be unique")]:(a[u]=!0,[])):[new F(t.key,l,"integer expected, found "+u)]}}function je(t){var e=("property"===t.expressionContext?Ce:Pe)(U(t.value),t.valueSpec);return"error"===e.result?e.value.map((function(e){return new F(""+t.key+e.key,t.value,e.message)})):"property"===t.expressionContext&&"text-font"===t.propertyKey&&-1!==e.value._styleExpression.expression.possibleOutputs().indexOf(void 0)?[new F(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')]:"property"!==t.expressionContext||"layout"!==t.propertyType||St(e.value._styleExpression.expression)?[]:[new F(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')]}function Ve(t){var e=t.key,n=t.value,r=t.valueSpec,i=[];return Array.isArray(r.values)?-1===r.values.indexOf(N(n))&&i.push(new F(e,n,"expected one of ["+r.values.join(", ")+"], "+JSON.stringify(n)+" found")):-1===Object.keys(r.values).indexOf(N(n))&&i.push(new F(e,n,"expected one of ["+Object.keys(r.values).join(", ")+"], "+JSON.stringify(n)+" found")),i}function Ne(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,n=t.slice(1);e<n.length;e+=1){var r=n[e];if(!Ne(r)&&"boolean"!=typeof r)return!1}return!0;default:return!0}}Le.deserialize=function(t){return new Le(t._parameters,t._specification)},Le.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var Ue={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function qe(t){if(null==t)return function(){return!0};Ne(t)||(t=Ge(t));var e=Pe(t,Ue);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return function(t,n){return e.value.evaluate(t,n)}}function Ze(t,e){return t<e?-1:t>e?1:0}function Ge(t){if(!t)return!0;var e,n=t[0];return t.length<=1?"any"!==n:"=="===n?Xe(t[1],t[2],"=="):"!="===n?Ye(Xe(t[1],t[2],"==")):"<"===n||">"===n||"<="===n||">="===n?Xe(t[1],t[2],n):"any"===n?(e=t.slice(1),["any"].concat(e.map(Ge))):"all"===n?["all"].concat(t.slice(1).map(Ge)):"none"===n?["all"].concat(t.slice(1).map(Ge).map(Ye)):"in"===n?We(t[1],t.slice(2)):"!in"===n?Ye(We(t[1],t.slice(2))):"has"===n?He(t[1]):"!has"!==n||Ye(He(t[1]))}function Xe(t,e,n){switch(t){case"$type":return["filter-type-"+n,e];case"$id":return["filter-id-"+n,e];default:return["filter-"+n,t,e]}}function We(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(Ze)]]:["filter-in-small",t,["literal",e]]}}function He(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Ye(t){return["!",t]}function Ke(t){return Ne(U(t.value))?je(V({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var n=e.value,r=e.key;if("array"!==ge(n))return[new F(r,n,"array expected, "+ge(n)+" found")];var i,o=e.styleSpec,a=[];if(n.length<1)return[new F(r,n,"filter array must have at least 1 element")];switch(a=a.concat(Ve({key:r+"[0]",value:n[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),N(n[0])){case"<":case"<=":case">":case">=":n.length>=2&&"$type"===N(n[1])&&a.push(new F(r,n,'"$type" cannot be use with operator "'+n[0]+'"'));case"==":case"!=":3!==n.length&&a.push(new F(r,n,'filter array for operator "'+n[0]+'" must have 3 elements'));case"in":case"!in":n.length>=2&&"string"!==(i=ge(n[1]))&&a.push(new F(r+"[1]",n[1],"string expected, "+i+" found"));for(var s=2;s<n.length;s++)i=ge(n[s]),"$type"===N(n[1])?a=a.concat(Ve({key:r+"["+s+"]",value:n[s],valueSpec:o.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==i&&"number"!==i&&"boolean"!==i&&a.push(new F(r+"["+s+"]",n[s],"string, number, or boolean expected, "+i+" found"));break;case"any":case"all":case"none":for(var u=1;u<n.length;u++)a=a.concat(t({key:r+"["+u+"]",value:n[u],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":i=ge(n[1]),2!==n.length?a.push(new F(r,n,'filter array for "'+n[0]+'" operator must have 2 elements')):"string"!==i&&a.push(new F(r+"[1]",n[1],"string expected, "+i+" found"))}return a}(t)}function Je(t,e){var n=t.key,r=t.style,i=t.styleSpec,o=t.value,a=t.objectKey,s=i[e+"_"+t.layerType];if(!s)return[];var u=a.match(/^(.*)-transition$/);if("paint"===e&&u&&s[u[1]]&&s[u[1]].transition)return an({key:n,value:o,valueSpec:i.transition,style:r,styleSpec:i});var l,c=t.valueSpec||s[a];if(!c)return[new F(n,o,'unknown property "'+a+'"')];if("string"===ge(o)&&me(c)&&!c.tokens&&(l=/^{([^}]+)}$/.exec(o)))return[new F(n,o,'"'+a+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(l[1])+" }`.")];var h=[];return"symbol"===t.layerType&&("text-field"===a&&r&&!r.glyphs&&h.push(new F(n,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&_e(U(o))&&"identity"===N(o.type)&&h.push(new F(n,o,'"text-font" does not support identity functions'))),h.concat(an({key:t.key,value:o,valueSpec:c,style:r,styleSpec:i,expressionContext:"property",propertyType:e,propertyKey:a}))}function $e(t){return Je(t,"paint")}function Qe(t){return Je(t,"layout")}function tn(t){var e=[],n=t.value,r=t.key,i=t.style,o=t.styleSpec;n.type||n.ref||e.push(new F(r,n,'either "type" or "ref" is required'));var a,s=N(n.type),u=N(n.ref);if(n.id)for(var l=N(n.id),c=0;c<t.arrayIndex;c++){var h=i.layers[c];N(h.id)===l&&e.push(new F(r,n.id,'duplicate layer id "'+n.id+'", previously used at line '+h.id.__line__))}if("ref"in n)["type","source","source-layer","filter","layout"].forEach((function(t){t in n&&e.push(new F(r,n[t],'"'+t+'" is prohibited for ref layers'))})),i.layers.forEach((function(t){N(t.id)===u&&(a=t)})),a?a.ref?e.push(new F(r,n.ref,"ref cannot reference another ref layer")):s=N(a.type):e.push(new F(r,n.ref,'ref layer "'+u+'" not found'));else if("background"!==s)if(n.source){var p=i.sources&&i.sources[n.source],f=p&&N(p.type);p?"vector"===f&&"raster"===s?e.push(new F(r,n.source,'layer "'+n.id+'" requires a raster source')):"raster"===f&&"raster"!==s?e.push(new F(r,n.source,'layer "'+n.id+'" requires a vector source')):"vector"!==f||n["source-layer"]?"raster-dem"===f&&"hillshade"!==s?e.push(new F(r,n.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!n.paint||!n.paint["line-gradient"]||"geojson"===f&&p.lineMetrics||e.push(new F(r,n,'layer "'+n.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new F(r,n,'layer "'+n.id+'" must specify a "source-layer"')):e.push(new F(r,n.source,'source "'+n.source+'" not found'))}else e.push(new F(r,n,'missing required property "source"'));return e=e.concat(De({key:r,value:n,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return an({key:r+".type",value:n.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:n,objectKey:"type"})},filter:Ke,layout:function(t){return De({layer:n,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Qe(V({layerType:s},t))}}})},paint:function(t){return De({layer:n,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return $e(V({layerType:s},t))}}})}}}))}function en(t){var e=t.value,n=t.key,r=t.styleSpec,i=t.style;if(!e.type)return[new F(n,e,'"type" is required')];var o=N(e.type),a=[];switch(o){case"vector":case"raster":case"raster-dem":if(a=a.concat(De({key:n,value:e,valueSpec:r["source_"+o.replace("-","_")],style:t.style,styleSpec:r})),"url"in e)for(var s in e)["type","url","tileSize"].indexOf(s)<0&&a.push(new F(n+"."+s,e[s],'a source with a "url" property may not include a "'+s+'" property'));return a;case"geojson":return De({key:n,value:e,valueSpec:r.source_geojson,style:i,styleSpec:r});case"video":return De({key:n,value:e,valueSpec:r.source_video,style:i,styleSpec:r});case"image":return De({key:n,value:e,valueSpec:r.source_image,style:i,styleSpec:r});case"canvas":return a.push(new F(n,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")),a;default:return Ve({key:n+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,styleSpec:r})}}function nn(t){var e=t.value,n=t.styleSpec,r=n.light,i=t.style,o=[],a=ge(e);if(void 0===e)return o;if("object"!==a)return o.concat([new F("light",e,"object expected, "+a+" found")]);for(var s in e){var u=s.match(/^(.*)-transition$/);o=u&&r[u[1]]&&r[u[1]].transition?o.concat(an({key:s,value:e[s],valueSpec:n.transition,style:i,styleSpec:n})):r[s]?o.concat(an({key:s,value:e[s],valueSpec:r[s],style:i,styleSpec:n})):o.concat([new F(s,e[s],'unknown property "'+s+'"')])}return o}function rn(t){var e=t.value,n=t.key,r=ge(e);return"string"!==r?[new F(n,e,"string expected, "+r+" found")]:[]}var on={"*":function(){return[]},array:Re,boolean:function(t){var e=t.value,n=t.key,r=ge(e);return"boolean"!==r?[new F(n,e,"boolean expected, "+r+" found")]:[]},number:Be,color:function(t){var e=t.key,n=t.value,r=ge(n);return"string"!==r?[new F(e,n,"color expected, "+r+" found")]:null===it(n)?[new F(e,n,'color expected, "'+n+'" found')]:[]},constants:j,enum:Ve,filter:Ke,function:Fe,layer:tn,object:De,source:en,light:nn,string:rn,formatted:function(t){return 0===rn(t).length?[]:je(t)}};function an(t){var e=t.value,n=t.valueSpec,r=t.styleSpec;return n.expression&&_e(N(e))?Fe(t):n.expression&&Ae(U(e))?je(t):n.type&&on[n.type]?on[n.type](t):De(V({},t,{valueSpec:n.type?r[n.type]:n}))}function sn(t){var e=t.value,n=t.key,r=rn(t);return r.length?r:(-1===e.indexOf("{fontstack}")&&r.push(new F(n,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&r.push(new F(n,e,'"glyphs" url must include a "{range}" token')),r)}function un(t,e){e=e||B;var n=[];return n=n.concat(an({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:sn,"*":function(){return[]}}})),t.constants&&(n=n.concat(j({key:"constants",value:t.constants,style:t,styleSpec:e}))),ln(n)}function ln(t){return[].concat(t).sort((function(t,e){return t.line-e.line}))}function cn(t){return function(){return ln(t.apply(this,arguments))}}un.source=cn(en),un.light=cn(nn),un.layer=cn(tn),un.filter=cn(Ke),un.paintProperty=cn($e),un.layoutProperty=cn(Qe);var hn=un,pn=un.light,fn=un.paintProperty,dn=un.layoutProperty;function mn(t,e){var n=!1;if(e&&e.length)for(var r=0,i=e;r<i.length;r+=1){var o=i[r];t.fire(new D(new Error(o.message))),n=!0}return n}var yn=vn;function vn(t,e,n){var r=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var i=new Int32Array(this.arrayBuffer);t=i[0],e=i[1],n=i[2],this.d=e+2*n;for(var o=0;o<this.d*this.d;o++){var a=i[3+o],s=i[3+o+1];r.push(a===s?null:i.subarray(a,s))}var u=i[3+r.length],l=i[3+r.length+1];this.keys=i.subarray(u,l),this.bboxes=i.subarray(l),this.insert=this._insertReadonly}else{this.d=e+2*n;for(var c=0;c<this.d*this.d;c++)r.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=n,this.scale=e/t,this.uid=0;var h=n/e*t;this.min=-h,this.max=t+h}vn.prototype.insert=function(t,e,n,r,i){this._forEachCell(e,n,r,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(n),this.bboxes.push(r),this.bboxes.push(i)},vn.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},vn.prototype._insertCell=function(t,e,n,r,i,o){this.cells[i].push(o)},vn.prototype.query=function(t,e,n,r){var i=this.min,o=this.max;if(t<=i&&e<=i&&o<=n&&o<=r)return Array.prototype.slice.call(this.keys);var a=[];return this._forEachCell(t,e,n,r,this._queryCell,a,{}),a},vn.prototype._queryCell=function(t,e,n,r,i,o,a){var s=this.cells[i];if(null!==s)for(var u=this.keys,l=this.bboxes,c=0;c<s.length;c++){var h=s[c];if(void 0===a[h]){var p=4*h;t<=l[p+2]&&e<=l[p+3]&&n>=l[p+0]&&r>=l[p+1]?(a[h]=!0,o.push(u[h])):a[h]=!1}}},vn.prototype._forEachCell=function(t,e,n,r,i,o,a){for(var s=this._convertToCellCoord(t),u=this._convertToCellCoord(e),l=this._convertToCellCoord(n),c=this._convertToCellCoord(r),h=s;h<=l;h++)for(var p=u;p<=c;p++){var f=this.d*p+h;if(i.call(this,t,e,n,r,f,o,a))return}},vn.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},vn.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,n=0,r=0;r<this.cells.length;r++)n+=this.cells[r].length;var i=new Int32Array(e+n+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;for(var o=e,a=0;a<t.length;a++){var s=t[a];i[3+a]=o,i.set(s,o),o+=s.length}return i[3+t.length]=o,i.set(this.keys,o),o+=this.keys.length,i[3+t.length+1]=o,i.set(this.bboxes,o),o+=this.bboxes.length,i.buffer};var gn=self.ImageData,_n={};function xn(t,e,n){void 0===n&&(n={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),_n[t]={klass:e,omit:n.omit||[],shallow:n.shallow||[]}}for(var bn in xn("Object",Object),yn.serialize=function(t,e){var n=t.toArrayBuffer();return e&&e.push(n),{buffer:n}},yn.deserialize=function(t){return new yn(t.buffer)},xn("Grid",yn),xn("Color",ot),xn("Error",Error),xn("StylePropertyFunction",Le),xn("StyleExpression",Me,{omit:["_evaluator"]}),xn("ZoomDependentExpression",Ie),xn("ZoomConstantExpression",ze),xn("CompoundExpression",bt,{omit:["_evaluate"]}),ue)ue[bn]._classRegistryKey||xn("Expression_"+bn,ue[bn]);function wn(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(t instanceof ArrayBuffer)return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var n=t;return e&&e.push(n.buffer),n}if(t instanceof gn)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var r=[],i=0,o=t;i<o.length;i+=1){var a=o[i];r.push(wn(a,e))}return r}if("object"==typeof t){var s=t.constructor,u=s._classRegistryKey;if(!u)throw new Error("can't serialize object of unregistered class");var l=s.serialize?s.serialize(t,e):{};if(!s.serialize){for(var c in t)if(t.hasOwnProperty(c)&&!(_n[u].omit.indexOf(c)>=0)){var h=t[c];l[c]=_n[u].shallow.indexOf(c)>=0?h:wn(h,e)}t instanceof Error&&(l.message=t.message)}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==u&&(l.$name=u),l}throw new Error("can't serialize object of type "+typeof t)}function En(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof ArrayBuffer||ArrayBuffer.isView(t)||t instanceof gn)return t;if(Array.isArray(t))return t.map(En);if("object"==typeof t){var e=t.$name||"Object",n=_n[e].klass;if(!n)throw new Error("can't deserialize unregistered class "+e);if(n.deserialize)return n.deserialize(t);for(var r=Object.create(n.prototype),i=0,o=Object.keys(t);i<o.length;i+=1){var a=o[i];if("$name"!==a){var s=t[a];r[a]=_n[e].shallow.indexOf(a)>=0?s:En(s)}}return r}throw new Error("can't deserialize object of type "+typeof t)}var Sn=function(){this.first=!0};Sn.prototype.update=function(t,e){var n=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=n,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=n,!0):(this.lastFloorZoom>n?(this.lastIntegerZoom=n+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<n&&(this.lastIntegerZoom=n,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=n,!0))};var Tn={"Latin-1 Supplement":function(t){return t>=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function kn(t){for(var e=0,n=t;e<n.length;e+=1)if(An(n[e].charCodeAt(0)))return!0;return!1}function Mn(t){return!(Tn.Arabic(t)||Tn["Arabic Supplement"](t)||Tn["Arabic Extended-A"](t)||Tn["Arabic Presentation Forms-A"](t)||Tn["Arabic Presentation Forms-B"](t))}function An(t){return!(746!==t&&747!==t&&(t<4352||!(Tn["Bopomofo Extended"](t)||Tn.Bopomofo(t)||Tn["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Tn["CJK Compatibility Ideographs"](t)||Tn["CJK Compatibility"](t)||Tn["CJK Radicals Supplement"](t)||Tn["CJK Strokes"](t)||!(!Tn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Tn["CJK Unified Ideographs Extension A"](t)||Tn["CJK Unified Ideographs"](t)||Tn["Enclosed CJK Letters and Months"](t)||Tn["Hangul Compatibility Jamo"](t)||Tn["Hangul Jamo Extended-A"](t)||Tn["Hangul Jamo Extended-B"](t)||Tn["Hangul Jamo"](t)||Tn["Hangul Syllables"](t)||Tn.Hiragana(t)||Tn["Ideographic Description Characters"](t)||Tn.Kanbun(t)||Tn["Kangxi Radicals"](t)||Tn["Katakana Phonetic Extensions"](t)||Tn.Katakana(t)&&12540!==t||!(!Tn["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Tn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Tn["Unified Canadian Aboriginal Syllabics"](t)||Tn["Unified Canadian Aboriginal Syllabics Extended"](t)||Tn["Vertical Forms"](t)||Tn["Yijing Hexagram Symbols"](t)||Tn["Yi Syllables"](t)||Tn["Yi Radicals"](t))))}function Pn(t){return!(An(t)||function(t){return!!(Tn["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Tn["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||Tn["Letterlike Symbols"](t)||Tn["Number Forms"](t)||Tn["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||Tn["Control Pictures"](t)&&9251!==t||Tn["Optical Character Recognition"](t)||Tn["Enclosed Alphanumerics"](t)||Tn["Geometric Shapes"](t)||Tn["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Tn["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Tn["CJK Symbols and Punctuation"](t)||Tn.Katakana(t)||Tn["Private Use Area"](t)||Tn["CJK Compatibility Forms"](t)||Tn["Small Form Variants"](t)||Tn["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function zn(t,e){return!(!e&&(t>=1424&&t<=2303||Tn["Arabic Presentation Forms-A"](t)||Tn["Arabic Presentation Forms-B"](t))||t>=2304&&t<=3583||t>=3840&&t<=4255||Tn.Khmer(t))}var In,Cn=!1,Ln=null,On=!1,Dn=new R,Rn={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return On||null!=Rn.applyArabicShaping}},Bn=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Sn,this.transition={})};Bn.prototype.isSupportedScript=function(t){return function(t,e){for(var n=0,r=t;n<r.length;n+=1)if(!zn(r[n].charCodeAt(0),e))return!1;return!0}(t,Rn.isLoaded())},Bn.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Bn.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),n=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*n}:{fromScale:.5,toScale:1,t:1-(1-n)*e}};var Fn=function(t,e){this.property=t,this.value=e,this.expression=Oe(void 0===e?t.specification.default:e,t.specification)};Fn.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Fn.prototype.possiblyEvaluate=function(t){return this.property.possiblyEvaluate(this,t)};var jn=function(t){this.property=t,this.value=new Fn(t,void 0)};jn.prototype.transitioned=function(t,e){return new Nn(this.property,this.value,e,h({},t.transition,this.transition),t.now)},jn.prototype.untransitioned=function(){return new Nn(this.property,this.value,null,{},0)};var Vn=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};Vn.prototype.getValue=function(t){return g(this._values[t].value.value)},Vn.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new jn(this._values[t].property)),this._values[t].value=new Fn(this._values[t].property,null===e?void 0:g(e))},Vn.prototype.getTransition=function(t){return g(this._values[t].transition)},Vn.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new jn(this._values[t].property)),this._values[t].transition=g(e)||void 0},Vn.prototype.serialize=function(){for(var t={},e=0,n=Object.keys(this._values);e<n.length;e+=1){var r=n[e],i=this.getValue(r);void 0!==i&&(t[r]=i);var o=this.getTransition(r);void 0!==o&&(t[r+"-transition"]=o)}return t},Vn.prototype.transitioned=function(t,e){for(var n=new Un(this._properties),r=0,i=Object.keys(this._values);r<i.length;r+=1){var o=i[r];n._values[o]=this._values[o].transitioned(t,e._values[o])}return n},Vn.prototype.untransitioned=function(){for(var t=new Un(this._properties),e=0,n=Object.keys(this._values);e<n.length;e+=1){var r=n[e];t._values[r]=this._values[r].untransitioned()}return t};var Nn=function(t,e,n,r,i){this.property=t,this.value=e,this.begin=i+r.delay||0,this.end=this.begin+r.duration||0,t.specification.transition&&(r.delay||r.duration)&&(this.prior=n)};Nn.prototype.possiblyEvaluate=function(t){var e=t.now||0,n=this.value.possiblyEvaluate(t),r=this.prior;if(r){if(e>this.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(e<this.begin)return r.possiblyEvaluate(t);var i=(e-this.begin)/(this.end-this.begin);return this.property.interpolate(r.possiblyEvaluate(t),n,function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(t<.5?n:3*(t-e)+n-.75)}(i))}return n};var Un=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};Un.prototype.possiblyEvaluate=function(t){for(var e=new Gn(this._properties),n=0,r=Object.keys(this._values);n<r.length;n+=1){var i=r[n];e._values[i]=this._values[i].possiblyEvaluate(t)}return e},Un.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1){var n=e[t];if(this._values[n].prior)return!0}return!1};var qn=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};qn.prototype.getValue=function(t){return g(this._values[t].value)},qn.prototype.setValue=function(t,e){this._values[t]=new Fn(this._values[t].property,null===e?void 0:g(e))},qn.prototype.serialize=function(){for(var t={},e=0,n=Object.keys(this._values);e<n.length;e+=1){var r=n[e],i=this.getValue(r);void 0!==i&&(t[r]=i)}return t},qn.prototype.possiblyEvaluate=function(t){for(var e=new Gn(this._properties),n=0,r=Object.keys(this._values);n<r.length;n+=1){var i=r[n];e._values[i]=this._values[i].possiblyEvaluate(t)}return e};var Zn=function(t,e,n){this.property=t,this.value=e,this.parameters=n};Zn.prototype.isConstant=function(){return"constant"===this.value.kind},Zn.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},Zn.prototype.evaluate=function(t,e){return this.property.evaluate(this.value,this.parameters,t,e)};var Gn=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};Gn.prototype.get=function(t){return this._values[t]};var Xn=function(t){this.specification=t};Xn.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},Xn.prototype.interpolate=function(t,e,n){var r=It[this.specification.type];return r?r(t,e,n):t};var Wn=function(t){this.specification=t};Wn.prototype.possiblyEvaluate=function(t,e){return"constant"===t.expression.kind||"camera"===t.expression.kind?new Zn(this,{kind:"constant",value:t.expression.evaluate(e)},e):new Zn(this,t.expression,e)},Wn.prototype.interpolate=function(t,e,n){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new Zn(this,{kind:"constant",value:void 0},t.parameters);var r=It[this.specification.type];return r?new Zn(this,{kind:"constant",value:r(t.value.value,e.value.value,n)},t.parameters):t},Wn.prototype.evaluate=function(t,e,n,r){return"constant"===t.kind?t.value:t.evaluate(e,n,r)};var Hn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(t,e){if(void 0===t.value)return new Zn(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var n=t.expression.evaluate(e),r=this._calculate(n,n,n,e);return new Zn(this,{kind:"constant",value:r},e)}if("camera"===t.expression.kind){var i=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new Zn(this,{kind:"constant",value:i},e)}return new Zn(this,t.expression,e)},e.prototype.evaluate=function(t,e,n,r){if("source"===t.kind){var i=t.evaluate(e,n,r);return this._calculate(i,i,i,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},n,r),t.evaluate({zoom:Math.floor(e.zoom)},n,r),t.evaluate({zoom:Math.floor(e.zoom)+1},n,r),e):t.value},e.prototype._calculate=function(t,e,n,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:n,to:e}},e.prototype.interpolate=function(t){return t},e}(Wn),Yn=function(t){this.specification=t};Yn.prototype.possiblyEvaluate=function(t,e){if(void 0!==t.value){if("constant"===t.expression.kind){var n=t.expression.evaluate(e);return this._calculate(n,n,n,e)}return this._calculate(t.expression.evaluate(new Bn(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Bn(Math.floor(e.zoom),e)),t.expression.evaluate(new Bn(Math.floor(e.zoom+1),e)),e)}},Yn.prototype._calculate=function(t,e,n,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:n,to:e}},Yn.prototype.interpolate=function(t){return t};var Kn=function(t){this.specification=t};Kn.prototype.possiblyEvaluate=function(t,e){return!!t.expression.evaluate(e)},Kn.prototype.interpolate=function(){return!1};var Jn=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},t){var n=t[e],r=this.defaultPropertyValues[e]=new Fn(n,void 0),i=this.defaultTransitionablePropertyValues[e]=new jn(n);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=r.possiblyEvaluate({})}};xn("DataDrivenProperty",Wn),xn("DataConstantProperty",Xn),xn("CrossFadedDataDrivenProperty",Hn),xn("CrossFadedProperty",Yn),xn("ColorRampProperty",Kn);var $n=function(t){function e(e,n){if(t.call(this),this.id=e.id,this.type=e.type,this.visibility="visible",this._featureFilter=function(){return!0},"custom"!==e.type&&(e=e,this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),n.layout&&(this._unevaluatedLayout=new qn(n.layout)),n.paint)){for(var r in this._transitionablePaint=new Vn(n.paint),e.paint)this.setPaintProperty(r,e.paint[r],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned()}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,n){if(null!=e){var r="layers."+this.id+".layout."+t;if(this._validate(dn,r,t,e,n))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility="none"===e?e:"visible"},e.prototype.getPaintProperty=function(t){return m(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,n){if(null!=e){var r="layers."+this.id+".paint."+t;if(this._validate(fn,r,t,e,n))return!1}if(m(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var i=this._transitionablePaint._values[t],o="cross-faded-data-driven"===i.property.specification["property-type"]&&!i.value.value&&e,a=this._transitionablePaint._values[t].value.isDataDriven();this._transitionablePaint.setValue(t,e);var s=this._transitionablePaint._values[t].value.isDataDriven();return this._handleSpecialPaintPropertyUpdate(t),s||a||o},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t)),this.paint=this._transitioningPaint.possiblyEvaluate(t)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return"none"===this.visibility&&(t.layout=t.layout||{},t.layout.visibility="none"),v(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,n,r,i){return(!i||!1!==i.validate)&&mn(this,t.call(hn,{key:e,layerType:this.type,objectKey:n,value:r,styleSpec:B,style:{glyphs:!0,sprite:!0}}))},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof Zn&&me(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(R),Qn={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},tr=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},er=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function nr(t,e){void 0===e&&(e=1);var n=0,r=0;return{members:t.map((function(t){var i,o=(i=t.type,Qn[i].BYTES_PER_ELEMENT),a=n=rr(n,Math.max(e,o)),s=t.components||1;return r=Math.max(r,o),n+=o*s,{name:t.name,type:t.type,components:s,offset:a}})),size:rr(n,Math.max(r,e)),alignment:e}}function rr(t,e){return Math.ceil(t/e)*e}er.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},er.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},er.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},er.prototype.clear=function(){this.length=0},er.prototype.resize=function(t){this.reserve(t),this.length=t},er.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},er.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var ir=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var n=this.length;this.resize(n+1);var r=2*n;return this.int16[r+0]=t,this.int16[r+1]=e,n},e.prototype.emplace=function(t,e,n){var r=2*t;return this.int16[r+0]=e,this.int16[r+1]=n,t},e}(er);ir.prototype.bytesPerElement=4,xn("StructArrayLayout2i4",ir);var or=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r){var i=this.length;this.resize(i+1);var o=4*i;return this.int16[o+0]=t,this.int16[o+1]=e,this.int16[o+2]=n,this.int16[o+3]=r,i},e.prototype.emplace=function(t,e,n,r,i){var o=4*t;return this.int16[o+0]=e,this.int16[o+1]=n,this.int16[o+2]=r,this.int16[o+3]=i,t},e}(er);or.prototype.bytesPerElement=8,xn("StructArrayLayout4i8",or);var ar=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r,i,o){var a=this.length;this.resize(a+1);var s=6*a;return this.int16[s+0]=t,this.int16[s+1]=e,this.int16[s+2]=n,this.int16[s+3]=r,this.int16[s+4]=i,this.int16[s+5]=o,a},e.prototype.emplace=function(t,e,n,r,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=n,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(er);ar.prototype.bytesPerElement=12,xn("StructArrayLayout2i4i12",ar);var sr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r,i,o,a,s){var u=this.length;this.resize(u+1);var l=6*u,c=12*u;return this.int16[l+0]=t,this.int16[l+1]=e,this.int16[l+2]=n,this.int16[l+3]=r,this.uint8[c+8]=i,this.uint8[c+9]=o,this.uint8[c+10]=a,this.uint8[c+11]=s,u},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u){var l=6*t,c=12*t;return this.int16[l+0]=e,this.int16[l+1]=n,this.int16[l+2]=r,this.int16[l+3]=i,this.uint8[c+8]=o,this.uint8[c+9]=a,this.uint8[c+10]=s,this.uint8[c+11]=u,t},e}(er);sr.prototype.bytesPerElement=12,xn("StructArrayLayout4i4ub12",sr);var ur=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r,i,o,a,s){var u=this.length;this.resize(u+1);var l=8*u;return this.uint16[l+0]=t,this.uint16[l+1]=e,this.uint16[l+2]=n,this.uint16[l+3]=r,this.uint16[l+4]=i,this.uint16[l+5]=o,this.uint16[l+6]=a,this.uint16[l+7]=s,u},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u){var l=8*t;return this.uint16[l+0]=e,this.uint16[l+1]=n,this.uint16[l+2]=r,this.uint16[l+3]=i,this.uint16[l+4]=o,this.uint16[l+5]=a,this.uint16[l+6]=s,this.uint16[l+7]=u,t},e}(er);ur.prototype.bytesPerElement=16,xn("StructArrayLayout8ui16",ur);var lr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r,i,o,a,s){var u=this.length;this.resize(u+1);var l=8*u;return this.int16[l+0]=t,this.int16[l+1]=e,this.int16[l+2]=n,this.int16[l+3]=r,this.uint16[l+4]=i,this.uint16[l+5]=o,this.uint16[l+6]=a,this.uint16[l+7]=s,u},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u){var l=8*t;return this.int16[l+0]=e,this.int16[l+1]=n,this.int16[l+2]=r,this.int16[l+3]=i,this.uint16[l+4]=o,this.uint16[l+5]=a,this.uint16[l+6]=s,this.uint16[l+7]=u,t},e}(er);lr.prototype.bytesPerElement=16,xn("StructArrayLayout4i4ui16",lr);var cr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n){var r=this.length;this.resize(r+1);var i=3*r;return this.float32[i+0]=t,this.float32[i+1]=e,this.float32[i+2]=n,r},e.prototype.emplace=function(t,e,n,r){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=n,this.float32[i+2]=r,t},e}(er);cr.prototype.bytesPerElement=12,xn("StructArrayLayout3f12",cr);var hr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;this.resize(e+1);var n=1*e;return this.uint32[n+0]=t,e},e.prototype.emplace=function(t,e){var n=1*t;return this.uint32[n+0]=e,t},e}(er);hr.prototype.bytesPerElement=4,xn("StructArrayLayout1ul4",hr);var pr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r,i,o,a,s,u,l,c){var h=this.length;this.resize(h+1);var p=12*h,f=6*h;return this.int16[p+0]=t,this.int16[p+1]=e,this.int16[p+2]=n,this.int16[p+3]=r,this.int16[p+4]=i,this.int16[p+5]=o,this.uint32[f+3]=a,this.uint16[p+8]=s,this.uint16[p+9]=u,this.int16[p+10]=l,this.int16[p+11]=c,h},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u,l,c,h){var p=12*t,f=6*t;return this.int16[p+0]=e,this.int16[p+1]=n,this.int16[p+2]=r,this.int16[p+3]=i,this.int16[p+4]=o,this.int16[p+5]=a,this.uint32[f+3]=s,this.uint16[p+8]=u,this.uint16[p+9]=l,this.int16[p+10]=c,this.int16[p+11]=h,t},e}(er);pr.prototype.bytesPerElement=24,xn("StructArrayLayout6i1ul2ui2i24",pr);var fr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r,i,o){var a=this.length;this.resize(a+1);var s=6*a;return this.int16[s+0]=t,this.int16[s+1]=e,this.int16[s+2]=n,this.int16[s+3]=r,this.int16[s+4]=i,this.int16[s+5]=o,a},e.prototype.emplace=function(t,e,n,r,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=n,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(er);fr.prototype.bytesPerElement=12,xn("StructArrayLayout2i2i2i12",fr);var dr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var n=this.length;this.resize(n+1);var r=4*n;return this.uint8[r+0]=t,this.uint8[r+1]=e,n},e.prototype.emplace=function(t,e,n){var r=4*t;return this.uint8[r+0]=e,this.uint8[r+1]=n,t},e}(er);dr.prototype.bytesPerElement=4,xn("StructArrayLayout2ub4",dr);var mr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r,i,o,a,s,u,l,c,h,p,f){var d=this.length;this.resize(d+1);var m=20*d,y=10*d,v=40*d;return this.int16[m+0]=t,this.int16[m+1]=e,this.uint16[m+2]=n,this.uint16[m+3]=r,this.uint32[y+2]=i,this.uint32[y+3]=o,this.uint32[y+4]=a,this.uint16[m+10]=s,this.uint16[m+11]=u,this.uint16[m+12]=l,this.float32[y+7]=c,this.float32[y+8]=h,this.uint8[v+36]=p,this.uint8[v+37]=f,d},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u,l,c,h,p,f,d){var m=20*t,y=10*t,v=40*t;return this.int16[m+0]=e,this.int16[m+1]=n,this.uint16[m+2]=r,this.uint16[m+3]=i,this.uint32[y+2]=o,this.uint32[y+3]=a,this.uint32[y+4]=s,this.uint16[m+10]=u,this.uint16[m+11]=l,this.uint16[m+12]=c,this.float32[y+7]=h,this.float32[y+8]=p,this.uint8[v+36]=f,this.uint8[v+37]=d,t},e}(er);mr.prototype.bytesPerElement=40,xn("StructArrayLayout2i2ui3ul3ui2f2ub40",mr);var yr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r,i,o,a,s,u,l,c,h,p,f){var d=this.length;this.resize(d+1);var m=16*d,y=8*d;return this.int16[m+0]=t,this.int16[m+1]=e,this.int16[m+2]=n,this.int16[m+3]=r,this.uint16[m+4]=i,this.uint16[m+5]=o,this.uint16[m+6]=a,this.uint16[m+7]=s,this.uint16[m+8]=u,this.uint16[m+9]=l,this.uint16[m+10]=c,this.uint16[m+11]=h,this.uint16[m+12]=p,this.uint32[y+7]=f,d},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u,l,c,h,p,f,d){var m=16*t,y=8*t;return this.int16[m+0]=e,this.int16[m+1]=n,this.int16[m+2]=r,this.int16[m+3]=i,this.uint16[m+4]=o,this.uint16[m+5]=a,this.uint16[m+6]=s,this.uint16[m+7]=u,this.uint16[m+8]=l,this.uint16[m+9]=c,this.uint16[m+10]=h,this.uint16[m+11]=p,this.uint16[m+12]=f,this.uint32[y+7]=d,t},e}(er);yr.prototype.bytesPerElement=32,xn("StructArrayLayout4i9ui1ul32",yr);var vr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;this.resize(e+1);var n=1*e;return this.float32[n+0]=t,e},e.prototype.emplace=function(t,e){var n=1*t;return this.float32[n+0]=e,t},e}(er);vr.prototype.bytesPerElement=4,xn("StructArrayLayout1f4",vr);var gr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n){var r=this.length;this.resize(r+1);var i=3*r;return this.int16[i+0]=t,this.int16[i+1]=e,this.int16[i+2]=n,r},e.prototype.emplace=function(t,e,n,r){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=n,this.int16[i+2]=r,t},e}(er);gr.prototype.bytesPerElement=6,xn("StructArrayLayout3i6",gr);var _r=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n){var r=this.length;this.resize(r+1);var i=2*r,o=4*r;return this.uint32[i+0]=t,this.uint16[o+2]=e,this.uint16[o+3]=n,r},e.prototype.emplace=function(t,e,n,r){var i=2*t,o=4*t;return this.uint32[i+0]=e,this.uint16[o+2]=n,this.uint16[o+3]=r,t},e}(er);_r.prototype.bytesPerElement=8,xn("StructArrayLayout1ul2ui8",_r);var xr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n){var r=this.length;this.resize(r+1);var i=3*r;return this.uint16[i+0]=t,this.uint16[i+1]=e,this.uint16[i+2]=n,r},e.prototype.emplace=function(t,e,n,r){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=n,this.uint16[i+2]=r,t},e}(er);xr.prototype.bytesPerElement=6,xn("StructArrayLayout3ui6",xr);var br=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var n=this.length;this.resize(n+1);var r=2*n;return this.uint16[r+0]=t,this.uint16[r+1]=e,n},e.prototype.emplace=function(t,e,n){var r=2*t;return this.uint16[r+0]=e,this.uint16[r+1]=n,t},e}(er);br.prototype.bytesPerElement=4,xn("StructArrayLayout2ui4",br);var wr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;this.resize(e+1);var n=1*e;return this.uint16[n+0]=t,e},e.prototype.emplace=function(t,e){var n=1*t;return this.uint16[n+0]=e,t},e}(er);wr.prototype.bytesPerElement=2,xn("StructArrayLayout1ui2",wr);var Er=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var n=this.length;this.resize(n+1);var r=2*n;return this.float32[r+0]=t,this.float32[r+1]=e,n},e.prototype.emplace=function(t,e,n){var r=2*t;return this.float32[r+0]=e,this.float32[r+1]=n,t},e}(er);Er.prototype.bytesPerElement=8,xn("StructArrayLayout2f8",Er);var Sr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r){var i=this.length;this.resize(i+1);var o=4*i;return this.float32[o+0]=t,this.float32[o+1]=e,this.float32[o+2]=n,this.float32[o+3]=r,i},e.prototype.emplace=function(t,e,n,r,i){var o=4*t;return this.float32[o+0]=e,this.float32[o+1]=n,this.float32[o+2]=r,this.float32[o+3]=i,t},e}(er);Sr.prototype.bytesPerElement=16,xn("StructArrayLayout4f16",Sr);var Tr=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},radius:{configurable:!0},signedDistanceFromAnchor:{configurable:!0},anchorPoint:{configurable:!0}};return n.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorPointX.set=function(t){this._structArray.int16[this._pos2+0]=t},n.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},n.anchorPointY.set=function(t){this._structArray.int16[this._pos2+1]=t},n.x1.get=function(){return this._structArray.int16[this._pos2+2]},n.x1.set=function(t){this._structArray.int16[this._pos2+2]=t},n.y1.get=function(){return this._structArray.int16[this._pos2+3]},n.y1.set=function(t){this._structArray.int16[this._pos2+3]=t},n.x2.get=function(){return this._structArray.int16[this._pos2+4]},n.x2.set=function(t){this._structArray.int16[this._pos2+4]=t},n.y2.get=function(){return this._structArray.int16[this._pos2+5]},n.y2.set=function(t){this._structArray.int16[this._pos2+5]=t},n.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.featureIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},n.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},n.radius.get=function(){return this._structArray.int16[this._pos2+10]},n.radius.set=function(t){this._structArray.int16[this._pos2+10]=t},n.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},n.signedDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+11]=t},n.anchorPoint.get=function(){return new o(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,n),e}(tr);Tr.prototype.size=24;var kr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Tr(this,t)},e}(pr);xn("CollisionBoxArray",kr);var Mr=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},hidden:{configurable:!0}};return n.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},n.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},n.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},n.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},n.glyphStartIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},n.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},n.numGlyphs.set=function(t){this._structArray.uint16[this._pos2+3]=t},n.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},n.vertexStartIndex.set=function(t){this._structArray.uint32[this._pos4+2]=t},n.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.lineStartIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},n.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},n.lineLength.set=function(t){this._structArray.uint32[this._pos4+4]=t},n.segment.get=function(){return this._structArray.uint16[this._pos2+10]},n.segment.set=function(t){this._structArray.uint16[this._pos2+10]=t},n.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},n.lowerSize.set=function(t){this._structArray.uint16[this._pos2+11]=t},n.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},n.upperSize.set=function(t){this._structArray.uint16[this._pos2+12]=t},n.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},n.lineOffsetX.set=function(t){this._structArray.float32[this._pos4+7]=t},n.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},n.lineOffsetY.set=function(t){this._structArray.float32[this._pos4+8]=t},n.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},n.writingMode.set=function(t){this._structArray.uint8[this._pos1+36]=t},n.hidden.get=function(){return this._structArray.uint8[this._pos1+37]},n.hidden.set=function(t){this._structArray.uint8[this._pos1+37]=t},Object.defineProperties(e.prototype,n),e}(tr);Mr.prototype.size=40;var Ar=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Mr(this,t)},e}(mr);xn("PlacedSymbolArray",Ar);var Pr=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={anchorX:{configurable:!0},anchorY:{configurable:!0},horizontalPlacedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},crossTileID:{configurable:!0}};return n.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},n.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},n.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},n.horizontalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},n.horizontalPlacedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+2]=t},n.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},n.verticalPlacedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+3]=t},n.key.get=function(){return this._structArray.uint16[this._pos2+4]},n.key.set=function(t){this._structArray.uint16[this._pos2+4]=t},n.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+5]},n.textBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+5]=t},n.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+6]},n.textBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+6]=t},n.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+7]},n.iconBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+7]=t},n.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+8]},n.iconBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},n.featureIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.featureIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},n.numGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+10]},n.numGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+10]=t},n.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+11]},n.numVerticalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+11]=t},n.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+12]},n.numIconVertices.set=function(t){this._structArray.uint16[this._pos2+12]=t},n.crossTileID.get=function(){return this._structArray.uint32[this._pos4+7]},n.crossTileID.set=function(t){this._structArray.uint32[this._pos4+7]=t},Object.defineProperties(e.prototype,n),e}(tr);Pr.prototype.size=32;var zr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Pr(this,t)},e}(yr);xn("SymbolInstanceArray",zr);var Ir=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={offsetX:{configurable:!0}};return n.offsetX.get=function(){return this._structArray.float32[this._pos4+0]},n.offsetX.set=function(t){this._structArray.float32[this._pos4+0]=t},Object.defineProperties(e.prototype,n),e}(tr);Ir.prototype.size=4;var Cr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e.prototype.get=function(t){return new Ir(this,t)},e}(vr);xn("GlyphOffsetArray",Cr);var Lr=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={x:{configurable:!0},y:{configurable:!0},tileUnitDistanceFromAnchor:{configurable:!0}};return n.x.get=function(){return this._structArray.int16[this._pos2+0]},n.x.set=function(t){this._structArray.int16[this._pos2+0]=t},n.y.get=function(){return this._structArray.int16[this._pos2+1]},n.y.set=function(t){this._structArray.int16[this._pos2+1]=t},n.tileUnitDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+2]},n.tileUnitDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+2]=t},Object.defineProperties(e.prototype,n),e}(tr);Lr.prototype.size=6;var Or=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e.prototype.get=function(t){return new Lr(this,t)},e}(gr);xn("SymbolLineVertexArray",Or);var Dr=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return n.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},n.featureIndex.set=function(t){this._structArray.uint32[this._pos4+0]=t},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},n.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},n.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+3]=t},Object.defineProperties(e.prototype,n),e}(tr);Dr.prototype.size=8;var Rr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Dr(this,t)},e}(_r);xn("FeatureIndexArray",Rr);var Br=nr([{name:"a_pos",components:2,type:"Int16"}],4),Fr=Br.members,jr=(Br.size,Br.alignment,function(t){void 0===t&&(t=[]),this.segments=t});jr.prototype.prepareSegment=function(t,e,n){var r=this.segments[this.segments.length-1];return t>jr.MAX_VERTEX_ARRAY_LENGTH&&x("Max vertices per segment is "+jr.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!r||r.vertexLength+t>jr.MAX_VERTEX_ARRAY_LENGTH)&&(r={vertexOffset:e.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},this.segments.push(r)),r},jr.prototype.get=function(){return this.segments},jr.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var n=e[t];for(var r in n.vaos)n.vaos[r].destroy()}},jr.simpleSegment=function(t,e,n,r){return new jr([{vertexOffset:t,primitiveOffset:e,vertexLength:n,primitiveLength:r,vaos:{}}])},jr.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,xn("SegmentVector",jr);var Vr=function(t,e){return 256*(t=c(Math.floor(t),0,255))+c(Math.floor(e),0,255)},Nr=function(){this.ids=[],this.positions=[],this.indexed=!1};function Ur(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}Nr.prototype.add=function(t,e,n,r){this.ids.push(t),this.positions.push(e,n,r)},Nr.prototype.getPositions=function(t){for(var e=0,n=this.ids.length-1;e<n;){var r=e+n>>1;this.ids[r]>=t?n=r:e=r+1}for(var i=[];this.ids[e]===t;){var o=this.positions[3*e],a=this.positions[3*e+1],s=this.positions[3*e+2];i.push({index:o,start:a,end:s}),e++}return i},Nr.serialize=function(t,e){var n=new Float64Array(t.ids),r=new Uint32Array(t.positions);return function t(e,n,r,i){if(!(r>=i)){for(var o=e[r+i>>1],a=r-1,s=i+1;;){do{a++}while(e[a]<o);do{s--}while(e[s]>o);if(a>=s)break;Ur(e,a,s),Ur(n,3*a,3*s),Ur(n,3*a+1,3*s+1),Ur(n,3*a+2,3*s+2)}t(e,n,r,s),t(e,n,s+1,i)}}(n,r,0,n.length-1),e.push(n.buffer,r.buffer),{ids:n,positions:r}},Nr.deserialize=function(t){var e=new Nr;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e},xn("FeaturePositionMap",Nr);var qr=function(t,e){this.gl=t.gl,this.location=e},Zr=function(t){function e(e,n){t.call(this,e,n),this.current=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))},e}(qr),Gr=function(t){function e(e,n){t.call(this,e,n),this.current=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},e}(qr),Xr=function(t){function e(e,n){t.call(this,e,n),this.current=[0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))},e}(qr),Wr=function(t){function e(e,n){t.call(this,e,n),this.current=[0,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))},e}(qr),Hr=function(t){function e(e,n){t.call(this,e,n),this.current=[0,0,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))},e}(qr),Yr=function(t){function e(e,n){t.call(this,e,n),this.current=ot.transparent}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))},e}(qr),Kr=new Float32Array(16),Jr=function(t){function e(e,n){t.call(this,e,n),this.current=Kr}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}},e}(qr);function $r(t){return[Vr(255*t.r,255*t.g),Vr(255*t.b,255*t.a)]}var Qr=function(t,e,n){this.value=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t})),this.type=n,this.maxValue=-1/0};Qr.prototype.defines=function(){return this.names.map((function(t){return"#define HAS_UNIFORM_u_"+t}))},Qr.prototype.setConstantPatternPositions=function(){},Qr.prototype.populatePaintArray=function(){},Qr.prototype.updatePaintArray=function(){},Qr.prototype.upload=function(){},Qr.prototype.destroy=function(){},Qr.prototype.setUniforms=function(t,e,n,r){e.set(r.constantOr(this.value))},Qr.prototype.getBinding=function(t,e){return"color"===this.type?new Yr(t,e):new Gr(t,e)},Qr.serialize=function(t){var e=t.value,n=t.names,r=t.type;return{value:wn(e),names:n,type:r}},Qr.deserialize=function(t){var e=t.value,n=t.names,r=t.type;return new Qr(En(e),n,r)};var ti=function(t,e,n){this.value=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t})),this.type=n,this.maxValue=-1/0,this.patternPositions={patternTo:null,patternFrom:null}};ti.prototype.defines=function(){return this.names.map((function(t){return"#define HAS_UNIFORM_u_"+t}))},ti.prototype.populatePaintArray=function(){},ti.prototype.updatePaintArray=function(){},ti.prototype.upload=function(){},ti.prototype.destroy=function(){},ti.prototype.setConstantPatternPositions=function(t,e){this.patternPositions.patternTo=t.tlbr,this.patternPositions.patternFrom=e.tlbr},ti.prototype.setUniforms=function(t,e,n,r,i){var o=this.patternPositions;"u_pattern_to"===i&&o.patternTo&&e.set(o.patternTo),"u_pattern_from"===i&&o.patternFrom&&e.set(o.patternFrom)},ti.prototype.getBinding=function(t,e){return new Hr(t,e)};var ei=function(t,e,n,r){this.expression=t,this.names=e,this.type=n,this.uniformNames=this.names.map((function(t){return"a_"+t})),this.maxValue=-1/0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===n?2:1,offset:0}})),this.paintVertexArray=new r};ei.prototype.defines=function(){return[]},ei.prototype.setConstantPatternPositions=function(){},ei.prototype.populatePaintArray=function(t,e){var n=this.paintVertexArray,r=n.length;n.reserve(t);var i=this.expression.evaluate(new Bn(0),e,{});if("color"===this.type)for(var o=$r(i),a=r;a<t;a++)n.emplaceBack(o[0],o[1]);else{for(var s=r;s<t;s++)n.emplaceBack(i);this.maxValue=Math.max(this.maxValue,i)}},ei.prototype.updatePaintArray=function(t,e,n,r){var i=this.paintVertexArray,o=this.expression.evaluate({zoom:0},n,r);if("color"===this.type)for(var a=$r(o),s=t;s<e;s++)i.emplace(s,a[0],a[1]);else{for(var u=t;u<e;u++)i.emplace(u,o);this.maxValue=Math.max(this.maxValue,o)}},ei.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},ei.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},ei.prototype.setUniforms=function(t,e){e.set(0)},ei.prototype.getBinding=function(t,e){return new Gr(t,e)};var ni=function(t,e,n,r,i,o){this.expression=t,this.names=e,this.uniformNames=this.names.map((function(t){return"a_"+t+"_t"})),this.type=n,this.useIntegerZoom=r,this.zoom=i,this.maxValue=-1/0;var a=o;this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===n?4:2,offset:0}})),this.paintVertexArray=new a};ni.prototype.defines=function(){return[]},ni.prototype.setConstantPatternPositions=function(){},ni.prototype.populatePaintArray=function(t,e){var n=this.paintVertexArray,r=n.length;n.reserve(t);var i=this.expression.evaluate(new Bn(this.zoom),e,{}),o=this.expression.evaluate(new Bn(this.zoom+1),e,{});if("color"===this.type)for(var a=$r(i),s=$r(o),u=r;u<t;u++)n.emplaceBack(a[0],a[1],s[0],s[1]);else{for(var l=r;l<t;l++)n.emplaceBack(i,o);this.maxValue=Math.max(this.maxValue,i,o)}},ni.prototype.updatePaintArray=function(t,e,n,r){var i=this.paintVertexArray,o=this.expression.evaluate({zoom:this.zoom},n,r),a=this.expression.evaluate({zoom:this.zoom+1},n,r);if("color"===this.type)for(var s=$r(o),u=$r(a),l=t;l<e;l++)i.emplace(l,s[0],s[1],u[0],u[1]);else{for(var c=t;c<e;c++)i.emplace(c,o,a);this.maxValue=Math.max(this.maxValue,o,a)}},ni.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},ni.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},ni.prototype.interpolationFactor=function(t){return this.useIntegerZoom?this.expression.interpolationFactor(Math.floor(t),this.zoom,this.zoom+1):this.expression.interpolationFactor(t,this.zoom,this.zoom+1)},ni.prototype.setUniforms=function(t,e,n){e.set(this.interpolationFactor(n.zoom))},ni.prototype.getBinding=function(t,e){return new Gr(t,e)};var ri=function(t,e,n,r,i,o,a){this.expression=t,this.names=e,this.type=n,this.uniformNames=this.names.map((function(t){return"a_"+t+"_t"})),this.useIntegerZoom=r,this.zoom=i,this.maxValue=-1/0,this.layerId=a,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Uint16",components:4,offset:0}})),this.zoomInPaintVertexArray=new o,this.zoomOutPaintVertexArray=new o};ri.prototype.defines=function(){return[]},ri.prototype.setConstantPatternPositions=function(){},ri.prototype.populatePaintArray=function(t,e,n){var r=this.zoomInPaintVertexArray,i=this.zoomOutPaintVertexArray,o=this.layerId,a=r.length;if(r.reserve(t),i.reserve(t),n&&e.patterns&&e.patterns[o]){var s=e.patterns[o],u=s.min,l=s.mid,c=s.max,h=n[u],p=n[l],f=n[c];if(!h||!p||!f)return;for(var d=a;d<t;d++)r.emplaceBack(p.tl[0],p.tl[1],p.br[0],p.br[1],h.tl[0],h.tl[1],h.br[0],h.br[1]),i.emplaceBack(p.tl[0],p.tl[1],p.br[0],p.br[1],f.tl[0],f.tl[1],f.br[0],f.br[1])}},ri.prototype.updatePaintArray=function(t,e,n,r,i){var o=this.zoomInPaintVertexArray,a=this.zoomOutPaintVertexArray,s=this.layerId;if(i&&n.patterns&&n.patterns[s]){var u=n.patterns[s],l=u.min,c=u.mid,h=u.max,p=i[l],f=i[c],d=i[h];if(!p||!f||!d)return;for(var m=t;m<e;m++)o.emplace(m,f.tl[0],f.tl[1],f.br[0],f.br[1],p.tl[0],p.tl[1],p.br[0],p.br[1]),a.emplace(m,f.tl[0],f.tl[1],f.br[0],f.br[1],d.tl[0],d.tl[1],d.br[0],d.br[1])}},ri.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},ri.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()},ri.prototype.setUniforms=function(t,e){e.set(0)},ri.prototype.getBinding=function(t,e){return new Gr(t,e)};var ii=function(){this.binders={},this.cacheKey="",this._buffers=[],this._featureMap=new Nr,this._bufferOffset=0};ii.createDynamic=function(t,e,n){var r=new ii,i=[];for(var o in t.paint._values)if(n(o)){var a=t.paint.get(o);if(a instanceof Zn&&me(a.property.specification)){var s=ai(o,t.type),u=a.property.specification.type,l=a.property.useIntegerZoom;if("cross-faded"===a.property.specification["property-type"]||"cross-faded-data-driven"===a.property.specification["property-type"])if("constant"===a.value.kind)r.binders[o]=new ti(a.value.value,s,u),i.push("/u_"+o);else{var c=si(o,u,"source");r.binders[o]=new ri(a.value,s,u,l,e,c,t.id),i.push("/a_"+o)}else if("constant"===a.value.kind)r.binders[o]=new Qr(a.value.value,s,u),i.push("/u_"+o);else if("source"===a.value.kind){var h=si(o,u,"source");r.binders[o]=new ei(a.value,s,u,h),i.push("/a_"+o)}else{var p=si(o,u,"composite");r.binders[o]=new ni(a.value,s,u,l,e,p),i.push("/z_"+o)}}}return r.cacheKey=i.sort().join(""),r},ii.prototype.populatePaintArrays=function(t,e,n,r){for(var i in this.binders)this.binders[i].populatePaintArray(t,e,r);void 0!==e.id&&this._featureMap.add(+e.id,n,this._bufferOffset,t),this._bufferOffset=t},ii.prototype.setConstantPatternPositions=function(t,e){for(var n in this.binders)this.binders[n].setConstantPatternPositions(t,e)},ii.prototype.updatePaintArrays=function(t,e,n,r){var i=!1;for(var o in t)for(var a=0,s=this._featureMap.getPositions(+o);a<s.length;a+=1){var u=s[a],l=e.feature(u.index);for(var c in this.binders){var h=this.binders[c];if(!(h instanceof Qr||h instanceof ti)&&!0===h.expression.isStateDependent){var p=n.paint.get(c);h.expression=p.value,h.updatePaintArray(u.start,u.end,l,t[o],r),i=!0}}}return i},ii.prototype.defines=function(){var t=[];for(var e in this.binders)t.push.apply(t,this.binders[e].defines());return t},ii.prototype.getPaintVertexBuffers=function(){return this._buffers},ii.prototype.getUniforms=function(t,e){var n={};for(var r in this.binders)for(var i=this.binders[r],o=0,a=i.uniformNames;o<a.length;o+=1){var s=a[o];n[s]=i.getBinding(t,e[s])}return n},ii.prototype.setUniforms=function(t,e,n,r){for(var i in this.binders)for(var o=this.binders[i],a=0,s=o.uniformNames;a<s.length;a+=1){var u=s[a];o.setUniforms(t,e[u],r,n.get(i),u)}},ii.prototype.updatePatternPaintBuffers=function(t){var e=[];for(var n in this.binders){var r=this.binders[n];if(r instanceof ri){var i=2===t.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;i&&e.push(i)}else(r instanceof ei||r instanceof ni)&&r.paintVertexBuffer&&e.push(r.paintVertexBuffer)}this._buffers=e},ii.prototype.upload=function(t){for(var e in this.binders)this.binders[e].upload(t);var n=[];for(var r in this.binders){var i=this.binders[r];(i instanceof ei||i instanceof ni)&&i.paintVertexBuffer&&n.push(i.paintVertexBuffer)}this._buffers=n},ii.prototype.destroy=function(){for(var t in this.binders)this.binders[t].destroy()};var oi=function(t,e,n,r){void 0===r&&(r=function(){return!0}),this.programConfigurations={};for(var i=0,o=e;i<o.length;i+=1){var a=o[i];this.programConfigurations[a.id]=ii.createDynamic(a,n,r),this.programConfigurations[a.id].layoutAttributes=t}this.needsUpload=!1};function ai(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from"],"fill-pattern":["pattern_to","pattern_from"],"fill-extrusion-pattern":["pattern_to","pattern_from"]}[t]||[t.replace(e+"-","").replace(/-/g,"_")]}function si(t,e,n){var r={color:{source:Er,composite:Sr},number:{source:vr,composite:Er}},i=function(t){return{"line-pattern":{source:ur,composite:ur},"fill-pattern":{source:ur,composite:ur},"fill-extrusion-pattern":{source:ur,composite:ur}}[t]}(t);return i&&i[n]||r[e][n]}oi.prototype.populatePaintArrays=function(t,e,n,r){for(var i in this.programConfigurations)this.programConfigurations[i].populatePaintArrays(t,e,n,r);this.needsUpload=!0},oi.prototype.updatePaintArrays=function(t,e,n,r){for(var i=0,o=n;i<o.length;i+=1){var a=o[i];this.needsUpload=this.programConfigurations[a.id].updatePaintArrays(t,e,a,r)||this.needsUpload}},oi.prototype.get=function(t){return this.programConfigurations[t]},oi.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},oi.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},xn("ConstantBinder",Qr),xn("CrossFadedConstantBinder",ti),xn("SourceExpressionBinder",ei),xn("CrossFadedCompositeBinder",ri),xn("CompositeExpressionBinder",ni),xn("ProgramConfiguration",ii,{omit:["_buffers"]}),xn("ProgramConfigurationSet",oi);var ui=8192,li={min:-1*Math.pow(2,15),max:Math.pow(2,15)-1};function ci(t){for(var e=ui/t.extent,n=t.loadGeometry(),r=0;r<n.length;r++)for(var i=n[r],o=0;o<i.length;o++){var a=i[o];a.x=Math.round(a.x*e),a.y=Math.round(a.y*e),(a.x<li.min||a.x>li.max||a.y<li.min||a.y>li.max)&&x("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return n}function hi(t,e,n,r,i){t.emplaceBack(2*e+(r+1)/2,2*n+(i+1)/2)}var pi=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new ir,this.indexArray=new xr,this.segments=new jr,this.programConfigurations=new oi(Fr,t.layers,t.zoom)};function fi(t,e,n){for(var r=0;r<t.length;r++){var i=t[r];if(wi(i,e))return!0;if(_i(e,i,n))return!0}return!1}function di(t,e){if(1===t.length&&1===t[0].length)return bi(e,t[0][0]);for(var n=0;n<e.length;n++)for(var r=e[n],i=0;i<r.length;i++)if(bi(t,r[i]))return!0;for(var o=0;o<t.length;o++){for(var a=t[o],s=0;s<a.length;s++)if(bi(e,a[s]))return!0;for(var u=0;u<e.length;u++)if(vi(a,e[u]))return!0}return!1}function mi(t,e,n){for(var r=0;r<e.length;r++)for(var i=e[r],o=0;o<t.length;o++){var a=t[o];if(a.length>=3)for(var s=0;s<i.length;s++)if(wi(a,i[s]))return!0;if(yi(a,i,n))return!0}return!1}function yi(t,e,n){if(t.length>1){if(vi(t,e))return!0;for(var r=0;r<e.length;r++)if(_i(e[r],t,n))return!0}for(var i=0;i<t.length;i++)if(_i(t[i],e,n))return!0;return!1}function vi(t,e){if(0===t.length||0===e.length)return!1;for(var n=0;n<t.length-1;n++)for(var r=t[n],i=t[n+1],o=0;o<e.length-1;o++)if(gi(r,i,e[o],e[o+1]))return!0;return!1}function gi(t,e,n,r){return b(t,n,r)!==b(e,n,r)&&b(t,e,n)!==b(t,e,r)}function _i(t,e,n){var r=n*n;if(1===e.length)return t.distSqr(e[0])<r;for(var i=1;i<e.length;i++)if(xi(t,e[i-1],e[i])<r)return!0;return!1}function xi(t,e,n){var r=e.distSqr(n);if(0===r)return t.distSqr(e);var i=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/r;return i<0?t.distSqr(e):i>1?t.distSqr(n):t.distSqr(n.sub(e)._mult(i)._add(e))}function bi(t,e){for(var n,r,i,o=!1,a=0;a<t.length;a++)for(var s=0,u=(n=t[a]).length-1;s<n.length;u=s++)r=n[s],i=n[u],r.y>e.y!=i.y>e.y&&e.x<(i.x-r.x)*(e.y-r.y)/(i.y-r.y)+r.x&&(o=!o);return o}function wi(t,e){for(var n=!1,r=0,i=t.length-1;r<t.length;i=r++){var o=t[r],a=t[i];o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(n=!n)}return n}function Ei(t,e,n){var r=e.paint.get(t).value;return"constant"===r.kind?r.value:n.programConfigurations.get(e.id).binders[t].maxValue}function Si(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ti(t,e,n,r,i){if(!e[0]&&!e[1])return t;var a=o.convert(e);"viewport"===n&&a._rotate(-r);for(var s=[],u=0;u<t.length;u++){for(var l=t[u],c=[],h=0;h<l.length;h++)c.push(l[h].sub(a._mult(i)));s.push(c)}return s}pi.prototype.populate=function(t,e){for(var n=0,r=t;n<r.length;n+=1){var i=r[n],o=i.feature,a=i.index,s=i.sourceLayerIndex;if(this.layers[0]._featureFilter(new Bn(this.zoom),o)){var u=ci(o);this.addFeature(o,u,a),e.featureIndex.insert(o,u,a,s,this.index)}}},pi.prototype.update=function(t,e,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n)},pi.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},pi.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},pi.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Fr),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},pi.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},pi.prototype.addFeature=function(t,e,n){for(var r=0,i=e;r<i.length;r+=1)for(var o=0,a=i[r];o<a.length;o+=1){var s=a[o],u=s.x,l=s.y;if(!(u<0||u>=ui||l<0||l>=ui)){var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),h=c.vertexLength;hi(this.layoutVertexArray,u,l,-1,-1),hi(this.layoutVertexArray,u,l,1,-1),hi(this.layoutVertexArray,u,l,1,1),hi(this.layoutVertexArray,u,l,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),c.vertexLength+=4,c.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,{})},xn("CircleBucket",pi,{omit:["layers"]});var ki={paint:new Jn({"circle-radius":new Wn(B.paint_circle["circle-radius"]),"circle-color":new Wn(B.paint_circle["circle-color"]),"circle-blur":new Wn(B.paint_circle["circle-blur"]),"circle-opacity":new Wn(B.paint_circle["circle-opacity"]),"circle-translate":new Xn(B.paint_circle["circle-translate"]),"circle-translate-anchor":new Xn(B.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Xn(B.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Xn(B.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Wn(B.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Wn(B.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Wn(B.paint_circle["circle-stroke-opacity"])})},Mi="undefined"!=typeof Float32Array?Float32Array:Array;function Ai(){var t=new Mi(9);return Mi!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function Pi(){var t=new Mi(3);return Mi!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function zi(t){var e=t[0],n=t[1],r=t[2];return Math.sqrt(e*e+n*n+r*r)}function Ii(t,e,n){var r=new Mi(3);return r[0]=t,r[1]=e,r[2]=n,r}Math.PI;var Ci,Li=zi,Oi=(Ci=Pi(),function(t,e,n,r,i,o){var a,s=void 0;for(e||(e=3),n||(n=0),a=r?Math.min(r*e+n,t.length):t.length,s=n;s<a;s+=e)Ci[0]=t[s],Ci[1]=t[s+1],Ci[2]=t[s+2],i(Ci,Ci,o),t[s]=Ci[0],t[s+1]=Ci[1],t[s+2]=Ci[2];return t});function Di(){var t=new Mi(4);return Mi!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Ri(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a),t}function Bi(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}var Fi=function(){var t=Di();return function(e,n,r,i,o,a){var s,u=void 0;for(n||(n=4),r||(r=0),s=i?Math.min(i*n+r,e.length):e.length,u=r;u<s;u+=n)t[0]=e[u],t[1]=e[u+1],t[2]=e[u+2],t[3]=e[u+3],o(t,t,a),e[u]=t[0],e[u+1]=t[1],e[u+2]=t[2],e[u+3]=t[3];return e}}();function ji(){var t=new Mi(4);return Mi!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}Pi(),Ii(1,0,0),Ii(0,1,0),ji(),ji(),Ai(),function(){var t;t=new Mi(2),Mi!=Float32Array&&(t[0]=0,t[1]=0)}();var Vi=function(t){function e(e){t.call(this,e,ki)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new pi(t)},e.prototype.queryRadius=function(t){var e=t;return Ei("circle-radius",this,e)+Ei("circle-stroke-width",this,e)+Si(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,r,i,o,a,s){for(var u=Ti(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),l=this.paint.get("circle-radius").evaluate(e,n)+this.paint.get("circle-stroke-width").evaluate(e,n),c="map"===this.paint.get("circle-pitch-alignment"),h=c?u:function(t,e,n){return t.map((function(t){return t.map((function(t){return Ni(t,e,n)}))}))}(u,s,o),p=c?l*a:l,f=0,d=r;f<d.length;f+=1)for(var m=0,y=d[f];m<y.length;m+=1){var v=y[m],g=c?v:Ni(v,s,o),_=p,x=Bi([],[v.x,v.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?_*=x[3]/o.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(_*=o.cameraToCenterDistance/x[3]),fi(h,g,_))return!0}return!1},e}($n);function Ni(t,e,n){var r=Bi([],[t.x,t.y,0,1],e);return new o((r[0]/r[3]+1)*n.width*.5,(r[1]/r[3]+1)*n.height*.5)}var Ui=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(pi);function qi(t,e,n,r){var i=e.width,o=e.height;if(r){if(r.length!==i*o*n)throw new RangeError("mismatched image size")}else r=new Uint8Array(i*o*n);return t.width=i,t.height=o,t.data=r,t}function Zi(t,e,n){var r=e.width,i=e.height;if(r!==t.width||i!==t.height){var o=qi({},{width:r,height:i},n);Gi(t,o,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,r),height:Math.min(t.height,i)},n),t.width=r,t.height=i,t.data=o.data}}function Gi(t,e,n,r,i,o){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||r.x>e.width-i.width||r.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,u=0;u<i.height;u++)for(var l=((n.y+u)*t.width+n.x)*o,c=((r.y+u)*e.width+r.x)*o,h=0;h<i.width*o;h++)s[c+h]=a[l+h];return e}xn("HeatmapBucket",Ui,{omit:["layers"]});var Xi=function(t,e){qi(this,t,1,e)};Xi.prototype.resize=function(t){Zi(this,t,1)},Xi.prototype.clone=function(){return new Xi({width:this.width,height:this.height},new Uint8Array(this.data))},Xi.copy=function(t,e,n,r,i){Gi(t,e,n,r,i,1)};var Wi=function(t,e){qi(this,t,4,e)};Wi.prototype.resize=function(t){Zi(this,t,4)},Wi.prototype.clone=function(){return new Wi({width:this.width,height:this.height},new Uint8Array(this.data))},Wi.copy=function(t,e,n,r,i){Gi(t,e,n,r,i,4)},xn("AlphaImage",Xi),xn("RGBAImage",Wi);var Hi={paint:new Jn({"heatmap-radius":new Wn(B.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Wn(B.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Xn(B.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Kn(B.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Xn(B.paint_heatmap["heatmap-opacity"])})};function Yi(t,e){for(var n=new Uint8Array(1024),r={},i=0,o=0;i<256;i++,o+=4){r[e]=i/255;var a=t.evaluate(r);n[o+0]=Math.floor(255*a.r/a.a),n[o+1]=Math.floor(255*a.g/a.a),n[o+2]=Math.floor(255*a.b/a.a),n[o+3]=Math.floor(255*a.a)}return new Wi({width:256,height:1},n)}var Ki=function(t){function e(e){t.call(this,e,Hi),this._updateColorRamp()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Ui(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){var t=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=Yi(t,"heatmapDensity"),this.colorRampTexture=null},e.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},e}($n),Ji={paint:new Jn({"hillshade-illumination-direction":new Xn(B.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Xn(B.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Xn(B.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Xn(B.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Xn(B.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Xn(B.paint_hillshade["hillshade-accent-color"])})},$i=function(t){function e(e){t.call(this,e,Ji)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}($n),Qi=nr([{name:"a_pos",components:2,type:"Int16"}],4),to=Qi.members,eo=(Qi.size,Qi.alignment,ro),no=ro;function ro(t,e,n){n=n||2;var r,i,o,a,s,u,l,c=e&&e.length,h=c?e[0]*n:t.length,p=io(t,0,h,n,!0),f=[];if(!p)return f;if(c&&(p=function(t,e,n,r){var i,o,a,s=[];for(i=0,o=e.length;i<o;i++)(a=io(t,e[i]*r,i<o-1?e[i+1]*r:t.length,r,!1))===a.next&&(a.steiner=!0),s.push(mo(a));for(s.sort(ho),i=0;i<s.length;i++)po(s[i],n),n=oo(n,n.next);return n}(t,e,p,n)),t.length>80*n){r=o=t[0],i=a=t[1];for(var d=n;d<h;d+=n)(s=t[d])<r&&(r=s),(u=t[d+1])<i&&(i=u),s>o&&(o=s),u>a&&(a=u);l=0!==(l=Math.max(o-r,a-i))?1/l:0}return ao(p,f,n,r,i,l),f}function io(t,e,n,r,i){var o,a;if(i===ko(t,e,n,r)>0)for(o=e;o<n;o+=r)a=Eo(o,t[o],t[o+1],a);else for(o=n-r;o>=e;o-=r)a=Eo(o,t[o],t[o+1],a);return a&&_o(a,a.next)&&(So(a),a=a.next),a}function oo(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!_o(r,r.next)&&0!==go(r.prev,r,r.next))r=r.next;else{if(So(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function ao(t,e,n,r,i,o,a){if(t){!a&&o&&function(t,e,n,r){var i=t;do{null===i.z&&(i.z=fo(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,a,s,u,l=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,s=0,e=0;e<l&&(s++,r=r.nextZ);e++);for(u=l;s>0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(a>1)}(i)}(t,r,i,o);for(var s,u,l=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?uo(t,r,i,o):so(t))e.push(s.i/n),e.push(t.i/n),e.push(u.i/n),So(t),t=u.next,l=u.next;else if((t=u)===l){a?1===a?ao(t=lo(t,e,n),e,n,r,i,o,2):2===a&&co(t,e,n,r,i,o):ao(oo(t),e,n,r,i,o,1);break}}}function so(t){var e=t.prev,n=t,r=t.next;if(go(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(yo(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&go(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function uo(t,e,n,r){var i=t.prev,o=t,a=t.next;if(go(i,o,a)>=0)return!1;for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,u=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,l=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=fo(s,u,e,n,r),p=fo(l,c,e,n,r),f=t.prevZ,d=t.nextZ;f&&f.z>=h&&d&&d.z<=p;){if(f!==t.prev&&f!==t.next&&yo(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&go(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,d!==t.prev&&d!==t.next&&yo(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&go(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;f&&f.z>=h;){if(f!==t.prev&&f!==t.next&&yo(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&go(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;d&&d.z<=p;){if(d!==t.prev&&d!==t.next&&yo(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&go(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function lo(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!_o(i,o)&&xo(i,r,r.next,o)&&bo(i,o)&&bo(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),So(r),So(r.next),r=t=o),r=r.next}while(r!==t);return r}function co(t,e,n,r,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&vo(a,s)){var u=wo(a,s);return a=oo(a,a.next),u=oo(u,u.next),ao(a,e,n,r,i,o),void ao(u,e,n,r,i,o)}s=s.next}a=a.next}while(a!==t)}function ho(t,e){return t.x-e.x}function po(t,e){if(e=function(t,e){var n,r=e,i=t.x,o=t.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!n)return null;if(i===a)return n.prev;var u,l=n,c=n.x,h=n.y,p=1/0;for(r=n.next;r!==l;)i>=r.x&&r.x>=c&&i!==r.x&&yo(o<h?i:a,o,c,h,o<h?a:i,o,r.x,r.y)&&((u=Math.abs(o-r.y)/(i-r.x))<p||u===p&&r.x>n.x)&&bo(r,t)&&(n=r,p=u),r=r.next;return n}(t,e)){var n=wo(e,t);oo(n,n.next)}}function fo(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function mo(t){var e=t,n=t;do{e.x<n.x&&(n=e),e=e.next}while(e!==t);return n}function yo(t,e,n,r,i,o,a,s){return(i-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(r-s)-(n-a)*(e-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function vo(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&xo(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&bo(t,e)&&bo(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)}function go(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function _o(t,e){return t.x===e.x&&t.y===e.y}function xo(t,e,n,r){return!!(_o(t,e)&&_o(n,r)||_o(t,r)&&_o(n,e))||go(t,e,n)>0!=go(t,e,r)>0&&go(n,r,t)>0!=go(n,r,e)>0}function bo(t,e){return go(t.prev,t,t.next)<0?go(t,e,t.next)>=0&&go(t,t.prev,e)>=0:go(t,e,t.prev)<0||go(t,t.next,e)<0}function wo(t,e){var n=new To(t.i,t.x,t.y),r=new To(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Eo(t,e,n,r){var i=new To(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function So(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function To(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ko(t,e,n,r){for(var i=0,o=e,a=n-r;o<n;o+=r)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}ro.deviation=function(t,e,n,r){var i=e&&e.length,o=i?e[0]*n:t.length,a=Math.abs(ko(t,0,o,n));if(i)for(var s=0,u=e.length;s<u;s++){var l=e[s]*n,c=s<u-1?e[s+1]*n:t.length;a-=Math.abs(ko(t,l,c,n))}var h=0;for(s=0;s<r.length;s+=3){var p=r[s]*n,f=r[s+1]*n,d=r[s+2]*n;h+=Math.abs((t[p]-t[d])*(t[f+1]-t[p+1])-(t[p]-t[f])*(t[d+1]-t[p+1]))}return 0===a&&0===h?0:Math.abs((h-a)/a)},ro.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var a=0;a<e;a++)n.vertices.push(t[i][o][a]);i>0&&(r+=t[i-1].length,n.holes.push(r))}return n},eo.default=no;var Mo=e((function(t,e){t.exports=function(){function t(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function e(t,e){return t<e?-1:t>e?1:0}return function(n,r,i,o,a){!function e(n,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=r-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(u-s/2<0?-1:1);e(n,r,Math.max(i,Math.floor(r-u*c/s+h)),Math.min(o,Math.floor(r+(s-u)*c/s+h)),a)}var p=n[r],f=i,d=o;for(t(n,i,r),a(n[o],p)>0&&t(n,i,o);f<d;){for(t(n,f,d),f++,d--;a(n[f],p)<0;)f++;for(;a(n[d],p)>0;)d--}0===a(n[i],p)?t(n,i,d):t(n,++d,o),d<=r&&(i=d+1),r<=d&&(o=d-1)}}(n,r,i||0,o||n.length-1,a||e)}}()}));function Ao(t,e){var n=t.length;if(n<=1)return[t];for(var r,i,o=[],a=0;a<n;a++){var s=w(t[a]);0!==s&&(t[a].area=Math.abs(s),void 0===i&&(i=s<0),i===s<0?(r&&o.push(r),r=[t[a]]):r.push(t[a]))}if(r&&o.push(r),e>1)for(var u=0;u<o.length;u++)o[u].length<=e||(Mo(o[u],e,1,o[u].length-1,Po),o[u]=o[u].slice(0,e));return o}function Po(t,e){return e.area-t.area}function zo(t,e,n){for(var r=n.patternDependencies,i=!1,o=0,a=e;o<a.length;o+=1){var s=a[o].paint.get(t+"-pattern");s.isConstant()||(i=!0);var u=s.constantOr(null);u&&(i=!0,r[u.to]=!0,r[u.from]=!0)}return i}function Io(t,e,n,r,i){for(var o=i.patternDependencies,a=0,s=e;a<s.length;a+=1){var u=s[a],l=u.paint.get(t+"-pattern").value;if("constant"!==l.kind){var c=l.evaluate({zoom:r-1},n,{}),h=l.evaluate({zoom:r},n,{}),p=l.evaluate({zoom:r+1},n,{});o[c]=!0,o[h]=!0,o[p]=!0,n.patterns[u.id]={min:c,mid:h,max:p}}}return n}var Co=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new ir,this.indexArray=new xr,this.indexArray2=new br,this.programConfigurations=new oi(to,t.layers,t.zoom),this.segments=new jr,this.segments2=new jr};Co.prototype.populate=function(t,e){this.features=[],this.hasPattern=zo("fill",this.layers,e);for(var n=0,r=t;n<r.length;n+=1){var i=r[n],o=i.feature,a=i.index,s=i.sourceLayerIndex;if(this.layers[0]._featureFilter(new Bn(this.zoom),o)){var u=ci(o),l={sourceLayerIndex:s,index:a,geometry:u,properties:o.properties,type:o.type,patterns:{}};void 0!==o.id&&(l.id=o.id),this.hasPattern?this.features.push(Io("fill",this.layers,l,this.zoom,e)):this.addFeature(l,u,a,{}),e.featureIndex.insert(o,u,a,s,this.index)}}},Co.prototype.update=function(t,e,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n)},Co.prototype.addFeatures=function(t,e){for(var n=0,r=this.features;n<r.length;n+=1){var i=r[n],o=i.geometry;this.addFeature(i,o,i.index,e)}},Co.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Co.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Co.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,to),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},Co.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},Co.prototype.addFeature=function(t,e,n,r){for(var i=0,o=Ao(e,500);i<o.length;i+=1){for(var a=o[i],s=0,u=0,l=a;u<l.length;u+=1)s+=l[u].length;for(var c=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray),h=c.vertexLength,p=[],f=[],d=0,m=a;d<m.length;d+=1){var y=m[d];if(0!==y.length){y!==a[0]&&f.push(p.length/2);var v=this.segments2.prepareSegment(y.length,this.layoutVertexArray,this.indexArray2),g=v.vertexLength;this.layoutVertexArray.emplaceBack(y[0].x,y[0].y),this.indexArray2.emplaceBack(g+y.length-1,g),p.push(y[0].x),p.push(y[0].y);for(var _=1;_<y.length;_++)this.layoutVertexArray.emplaceBack(y[_].x,y[_].y),this.indexArray2.emplaceBack(g+_-1,g+_),p.push(y[_].x),p.push(y[_].y);v.vertexLength+=y.length,v.primitiveLength+=y.length}}for(var x=eo(p,f),b=0;b<x.length;b+=3)this.indexArray.emplaceBack(h+x[b],h+x[b+1],h+x[b+2]);c.vertexLength+=s,c.primitiveLength+=x.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,r)},xn("FillBucket",Co,{omit:["layers","features"]});var Lo={paint:new Jn({"fill-antialias":new Xn(B.paint_fill["fill-antialias"]),"fill-opacity":new Wn(B.paint_fill["fill-opacity"]),"fill-color":new Wn(B.paint_fill["fill-color"]),"fill-outline-color":new Wn(B.paint_fill["fill-outline-color"]),"fill-translate":new Xn(B.paint_fill["fill-translate"]),"fill-translate-anchor":new Xn(B.paint_fill["fill-translate-anchor"]),"fill-pattern":new Hn(B.paint_fill["fill-pattern"])})},Oo=function(t){function e(e){t.call(this,e,Lo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e);var n=this.paint._values["fill-outline-color"];"constant"===n.value.kind&&void 0===n.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},e.prototype.createBucket=function(t){return new Co(t)},e.prototype.queryRadius=function(){return Si(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,r,i,o,a){return di(Ti(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,a),r)},e}($n),Do=nr([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Ro=Do.members,Bo=(Do.size,Do.alignment,Math.pow(2,13));function Fo(t,e,n,r,i,o,a,s){t.emplaceBack(e,n,2*Math.floor(r*Bo)+a,i*Bo*2,o*Bo*2,Math.round(s))}var jo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new ar,this.indexArray=new xr,this.programConfigurations=new oi(Ro,t.layers,t.zoom),this.segments=new jr};function Vo(t,e){return t.x===e.x&&(t.x<0||t.x>ui)||t.y===e.y&&(t.y<0||t.y>ui)}function No(t){return t.every((function(t){return t.x<0}))||t.every((function(t){return t.x>ui}))||t.every((function(t){return t.y<0}))||t.every((function(t){return t.y>ui}))}jo.prototype.populate=function(t,e){this.features=[],this.hasPattern=zo("fill-extrusion",this.layers,e);for(var n=0,r=t;n<r.length;n+=1){var i=r[n],o=i.feature,a=i.index,s=i.sourceLayerIndex;if(this.layers[0]._featureFilter(new Bn(this.zoom),o)){var u=ci(o),l={sourceLayerIndex:s,index:a,geometry:u,properties:o.properties,type:o.type,patterns:{}};void 0!==o.id&&(l.id=o.id),this.hasPattern?this.features.push(Io("fill-extrusion",this.layers,l,this.zoom,e)):this.addFeature(l,u,a,{}),e.featureIndex.insert(o,u,a,s,this.index)}}},jo.prototype.addFeatures=function(t,e){for(var n=0,r=this.features;n<r.length;n+=1){var i=r[n],o=i.geometry;this.addFeature(i,o,i.index,e)}},jo.prototype.update=function(t,e,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n)},jo.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},jo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},jo.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ro),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},jo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},jo.prototype.addFeature=function(t,e,n,r){for(var i=0,o=Ao(e,500);i<o.length;i+=1){for(var a=o[i],s=0,u=0,l=a;u<l.length;u+=1)s+=l[u].length;for(var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),h=0,p=a;h<p.length;h+=1){var f=p[h];if(0!==f.length&&!No(f))for(var d=0,m=0;m<f.length;m++){var y=f[m];if(m>=1){var v=f[m-1];if(!Vo(y,v)){c.vertexLength+4>jr.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var g=y.sub(v)._perp()._unit(),_=v.dist(y);d+_>32768&&(d=0),Fo(this.layoutVertexArray,y.x,y.y,g.x,g.y,0,0,d),Fo(this.layoutVertexArray,y.x,y.y,g.x,g.y,0,1,d),d+=_,Fo(this.layoutVertexArray,v.x,v.y,g.x,g.y,0,0,d),Fo(this.layoutVertexArray,v.x,v.y,g.x,g.y,0,1,d);var x=c.vertexLength;this.indexArray.emplaceBack(x,x+2,x+1),this.indexArray.emplaceBack(x+1,x+2,x+3),c.vertexLength+=4,c.primitiveLength+=2}}}}c.vertexLength+s>jr.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray));for(var b=[],w=[],E=c.vertexLength,S=0,T=a;S<T.length;S+=1){var k=T[S];if(0!==k.length){k!==a[0]&&w.push(b.length/2);for(var M=0;M<k.length;M++){var A=k[M];Fo(this.layoutVertexArray,A.x,A.y,0,0,1,1,0),b.push(A.x),b.push(A.y)}}}for(var P=eo(b,w),z=0;z<P.length;z+=3)this.indexArray.emplaceBack(E+P[z],E+P[z+2],E+P[z+1]);c.primitiveLength+=P.length/3,c.vertexLength+=s}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,r)},xn("FillExtrusionBucket",jo,{omit:["layers","features"]});var Uo={paint:new Jn({"fill-extrusion-opacity":new Xn(B["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Wn(B["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Xn(B["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Xn(B["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Hn(B["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Wn(B["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Wn(B["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Xn(B["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},qo=function(t){function e(e){t.call(this,e,Uo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new jo(t)},e.prototype.queryRadius=function(){return Si(this.paint.get("fill-extrusion-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,r,i,o,a){return di(Ti(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),o.angle,a),r)},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("fill-extrusion-opacity")&&"none"!==this.visibility},e.prototype.resize=function(){this.viewportFrame&&(this.viewportFrame.destroy(),this.viewportFrame=null)},e}($n),Zo=nr([{name:"a_pos_normal",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),Go=Zo.members,Xo=(Zo.size,Zo.alignment,Wo);function Wo(t,e,n,r,i){this.properties={},this.extent=n,this.type=0,this._pbf=t,this._geometry=-1,this._keys=r,this._values=i,t.readFields(Ho,this,e)}function Ho(t,e,n){1==t?e.id=n.readVarint():2==t?function(t,e){for(var n=t.readVarint()+t.pos;t.pos<n;){var r=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[r]=i}}(n,e):3==t?e.type=n.readVarint():4==t&&(e._geometry=n.pos)}function Yo(t){for(var e,n,r=0,i=0,o=t.length,a=o-1;i<o;a=i++)e=t[i],r+=((n=t[a]).x-e.x)*(e.y+n.y);return r}Wo.types=["Unknown","Point","LineString","Polygon"],Wo.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,n=t.readVarint()+t.pos,r=1,i=0,a=0,s=0,u=[];t.pos<n;){if(i<=0){var l=t.readVarint();r=7&l,i=l>>3}if(i--,1===r||2===r)a+=t.readSVarint(),s+=t.readSVarint(),1===r&&(e&&u.push(e),e=[]),e.push(new o(a,s));else{if(7!==r)throw new Error("unknown command "+r);e&&e.push(e[0].clone())}}return e&&u.push(e),u},Wo.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,n=1,r=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,l=-1/0;t.pos<e;){if(r<=0){var c=t.readVarint();n=7&c,r=c>>3}if(r--,1===n||2===n)(i+=t.readSVarint())<a&&(a=i),i>s&&(s=i),(o+=t.readSVarint())<u&&(u=o),o>l&&(l=o);else if(7!==n)throw new Error("unknown command "+n)}return[a,u,s,l]},Wo.prototype.toGeoJSON=function(t,e,n){var r,i,o=this.extent*Math.pow(2,n),a=this.extent*t,s=this.extent*e,u=this.loadGeometry(),l=Wo.types[this.type];function c(t){for(var e=0;e<t.length;e++){var n=t[e],r=180-360*(n.y+s)/o;t[e]=[360*(n.x+a)/o-180,360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(r=0;r<u.length;r++)h[r]=u[r][0];c(u=h);break;case 2:for(r=0;r<u.length;r++)c(u[r]);break;case 3:for(u=function(t){var e=t.length;if(e<=1)return[t];for(var n,r,i=[],o=0;o<e;o++){var a=Yo(t[o]);0!==a&&(void 0===r&&(r=a<0),r===a<0?(n&&i.push(n),n=[t[o]]):n.push(t[o]))}return n&&i.push(n),i}(u),r=0;r<u.length;r++)for(i=0;i<u[r].length;i++)c(u[r][i])}1===u.length?u=u[0]:l="Multi"+l;var p={type:"Feature",geometry:{type:l,coordinates:u},properties:this.properties};return"id"in this&&(p.id=this.id),p};var Ko=Jo;function Jo(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields($o,this,e),this.length=this._features.length}function $o(t,e,n){15===t?e.version=n.readVarint():1===t?e.name=n.readString():5===t?e.extent=n.readVarint():2===t?e._features.push(n.pos):3===t?e._keys.push(n.readString()):4===t&&e._values.push(function(t){for(var e=null,n=t.readVarint()+t.pos;t.pos<n;){var r=t.readVarint()>>3;e=1===r?t.readString():2===r?t.readFloat():3===r?t.readDouble():4===r?t.readVarint64():5===r?t.readVarint():6===r?t.readSVarint():7===r?t.readBoolean():null}return e}(n))}function Qo(t,e,n){if(3===t){var r=new Ko(n,n.readVarint()+n.pos);r.length&&(e[r.name]=r)}}Jo.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new Xo(this._pbf,e,this.extent,this._keys,this._values)};var ta={VectorTile:function(t,e){this.layers=t.readFields(Qo,{},e)},VectorTileFeature:Xo,VectorTileLayer:Ko},ea=ta.VectorTileFeature.types,na=Math.cos(Math.PI/180*37.5),ra=Math.pow(2,14)/.5;function ia(t,e,n,r,i,o,a){t.emplaceBack(e.x,e.y,r?1:0,i?1:-1,Math.round(63*n.x)+128,Math.round(63*n.y)+128,1+(0===o?0:o<0?-1:1)|(.5*a&63)<<2,.5*a>>6)}var oa=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.features=[],this.hasPattern=!1,this.layoutVertexArray=new sr,this.indexArray=new xr,this.programConfigurations=new oi(Go,t.layers,t.zoom),this.segments=new jr};function aa(t,e){return(t/e.tileTotal*(e.end-e.start)+e.start)*(ra-1)}oa.prototype.populate=function(t,e){this.features=[],this.hasPattern=zo("line",this.layers,e);for(var n=0,r=t;n<r.length;n+=1){var i=r[n],o=i.feature,a=i.index,s=i.sourceLayerIndex;if(this.layers[0]._featureFilter(new Bn(this.zoom),o)){var u=ci(o),l={sourceLayerIndex:s,index:a,geometry:u,properties:o.properties,type:o.type,patterns:{}};void 0!==o.id&&(l.id=o.id),this.hasPattern?this.features.push(Io("line",this.layers,l,this.zoom,e)):this.addFeature(l,u,a,{}),e.featureIndex.insert(o,u,a,s,this.index)}}},oa.prototype.update=function(t,e,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n)},oa.prototype.addFeatures=function(t,e){for(var n=0,r=this.features;n<r.length;n+=1){var i=r[n],o=i.geometry;this.addFeature(i,o,i.index,e)}},oa.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},oa.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},oa.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Go),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},oa.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},oa.prototype.addFeature=function(t,e,n,r){for(var i=this.layers[0].layout,o=i.get("line-join").evaluate(t,{}),a=i.get("line-cap"),s=i.get("line-miter-limit"),u=i.get("line-round-limit"),l=0,c=e;l<c.length;l+=1){var h=c[l];this.addLine(h,t,o,a,s,u,n,r)}},oa.prototype.addLine=function(t,e,n,r,i,o,a,s){var u=null;e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end")&&(u={start:e.properties.mapbox_clip_start,end:e.properties.mapbox_clip_end,tileTotal:void 0});for(var l="Polygon"===ea[e.type],c=t.length;c>=2&&t[c-1].equals(t[c-2]);)c--;for(var h=0;h<c-1&&t[h].equals(t[h+1]);)h++;if(!(c<(l?3:2))){u&&(u.tileTotal=function(t,e,n){for(var r,i,o=0,a=e;a<n-1;a++)r=t[a],i=t[a+1],o+=r.dist(i);return o}(t,h,c)),"bevel"===n&&(i=1.05);var p=ui/(512*this.overscaling)*15,f=t[h],d=this.segments.prepareSegment(10*c,this.layoutVertexArray,this.indexArray);this.distance=0;var m,y,v,g=r,_=l?"butt":r,x=!0,b=void 0,w=void 0,E=void 0,S=void 0;this.e1=this.e2=this.e3=-1,l&&(m=t[c-2],S=f.sub(m)._unit()._perp());for(var T=h;T<c;T++)if(!(w=l&&T===c-1?t[h+1]:t[T+1])||!t[T].equals(w)){S&&(E=S),m&&(b=m),m=t[T],S=w?w.sub(m)._unit()._perp():E;var k=(E=E||S).add(S);0===k.x&&0===k.y||k._unit();var M=k.x*S.x+k.y*S.y,A=0!==M?1/M:1/0,P=M<na&&b&&w;if(P&&T>h){var z=m.dist(b);if(z>2*p){var I=m.sub(m.sub(b)._mult(p/z)._round());this.distance+=I.dist(b),this.addCurrentVertex(I,this.distance,E.mult(1),0,0,!1,d,u),b=I}}var C=b&&w,L=C?n:w?g:_;if(C&&"round"===L&&(A<o?L="miter":A<=2&&(L="fakeround")),"miter"===L&&A>i&&(L="bevel"),"bevel"===L&&(A>2&&(L="flipbevel"),A<i&&(L="miter")),b&&(this.distance+=m.dist(b)),"miter"===L)k._mult(A),this.addCurrentVertex(m,this.distance,k,0,0,!1,d,u);else if("flipbevel"===L){if(A>100)k=S.clone().mult(-1);else{var O=E.x*S.y-E.y*S.x>0?-1:1,D=A*E.add(S).mag()/E.sub(S).mag();k._perp()._mult(D*O)}this.addCurrentVertex(m,this.distance,k,0,0,!1,d,u),this.addCurrentVertex(m,this.distance,k.mult(-1),0,0,!1,d,u)}else if("bevel"===L||"fakeround"===L){var R=E.x*S.y-E.y*S.x>0,B=-Math.sqrt(A*A-1);if(R?(v=0,y=B):(y=0,v=B),x||this.addCurrentVertex(m,this.distance,E,y,v,!1,d,u),"fakeround"===L){for(var F=Math.floor(8*(.5-(M-.5))),j=void 0,V=0;V<F;V++)j=S.mult((V+1)/(F+1))._add(E)._unit(),this.addPieSliceVertex(m,this.distance,j,R,d,u);this.addPieSliceVertex(m,this.distance,k,R,d,u);for(var N=F-1;N>=0;N--)j=E.mult((N+1)/(F+1))._add(S)._unit(),this.addPieSliceVertex(m,this.distance,j,R,d,u)}w&&this.addCurrentVertex(m,this.distance,S,-y,-v,!1,d,u)}else"butt"===L?(x||this.addCurrentVertex(m,this.distance,E,0,0,!1,d,u),w&&this.addCurrentVertex(m,this.distance,S,0,0,!1,d,u)):"square"===L?(x||(this.addCurrentVertex(m,this.distance,E,1,1,!1,d,u),this.e1=this.e2=-1),w&&this.addCurrentVertex(m,this.distance,S,-1,-1,!1,d,u)):"round"===L&&(x||(this.addCurrentVertex(m,this.distance,E,0,0,!1,d,u),this.addCurrentVertex(m,this.distance,E,1,1,!0,d,u),this.e1=this.e2=-1),w&&(this.addCurrentVertex(m,this.distance,S,-1,-1,!0,d,u),this.addCurrentVertex(m,this.distance,S,0,0,!1,d,u)));if(P&&T<c-1){var U=m.dist(w);if(U>2*p){var q=m.add(w.sub(m)._mult(p/U)._round());this.distance+=q.dist(m),this.addCurrentVertex(q,this.distance,S.mult(1),0,0,!1,d,u),m=q}}x=!1}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,s)}},oa.prototype.addCurrentVertex=function(t,e,n,r,i,o,a,s){var u,l=this.layoutVertexArray,c=this.indexArray;s&&(e=aa(e,s)),u=n.clone(),r&&u._sub(n.perp()._mult(r)),ia(l,t,u,o,!1,r,e),this.e3=a.vertexLength++,this.e1>=0&&this.e2>=0&&(c.emplaceBack(this.e1,this.e2,this.e3),a.primitiveLength++),this.e1=this.e2,this.e2=this.e3,u=n.mult(-1),i&&u._sub(n.perp()._mult(i)),ia(l,t,u,o,!0,-i,e),this.e3=a.vertexLength++,this.e1>=0&&this.e2>=0&&(c.emplaceBack(this.e1,this.e2,this.e3),a.primitiveLength++),this.e1=this.e2,this.e2=this.e3,e>ra/2&&!s&&(this.distance=0,this.addCurrentVertex(t,this.distance,n,r,i,o,a))},oa.prototype.addPieSliceVertex=function(t,e,n,r,i,o){n=n.mult(r?-1:1);var a=this.layoutVertexArray,s=this.indexArray;o&&(e=aa(e,o)),ia(a,t,n,!1,r,0,e),this.e3=i.vertexLength++,this.e1>=0&&this.e2>=0&&(s.emplaceBack(this.e1,this.e2,this.e3),i.primitiveLength++),r?this.e2=this.e3:this.e1=this.e3},xn("LineBucket",oa,{omit:["layers","features"]});var sa=new Jn({"line-cap":new Xn(B.layout_line["line-cap"]),"line-join":new Wn(B.layout_line["line-join"]),"line-miter-limit":new Xn(B.layout_line["line-miter-limit"]),"line-round-limit":new Xn(B.layout_line["line-round-limit"])}),ua={paint:new Jn({"line-opacity":new Wn(B.paint_line["line-opacity"]),"line-color":new Wn(B.paint_line["line-color"]),"line-translate":new Xn(B.paint_line["line-translate"]),"line-translate-anchor":new Xn(B.paint_line["line-translate-anchor"]),"line-width":new Wn(B.paint_line["line-width"]),"line-gap-width":new Wn(B.paint_line["line-gap-width"]),"line-offset":new Wn(B.paint_line["line-offset"]),"line-blur":new Wn(B.paint_line["line-blur"]),"line-dasharray":new Yn(B.paint_line["line-dasharray"]),"line-pattern":new Hn(B.paint_line["line-pattern"]),"line-gradient":new Kn(B.paint_line["line-gradient"])}),layout:sa},la=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,n){return n=new Bn(Math.floor(n.zoom),{now:n.now,fadeDuration:n.fadeDuration,zoomHistory:n.zoomHistory,transition:n.transition}),t.prototype.possiblyEvaluate.call(this,e,n)},e.prototype.evaluate=function(e,n,r,i){return n=h({},n,{zoom:Math.floor(n.zoom)}),t.prototype.evaluate.call(this,e,n,r,i)},e}(Wn))(ua.paint.properties["line-width"].specification);la.useIntegerZoom=!0;var ca=function(t){function e(e){t.call(this,e,ua)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},e.prototype._updateGradient=function(){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=Yi(t,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e),this.paint._values["line-floorwidth"]=la.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new oa(t)},e.prototype.queryRadius=function(t){var e=t,n=ha(Ei("line-width",this,e),Ei("line-gap-width",this,e)),r=Ei("line-offset",this,e);return n/2+Math.abs(r)+Si(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,r,i,a,s){var u=Ti(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),l=s/2*ha(this.paint.get("line-width").evaluate(e,n),this.paint.get("line-gap-width").evaluate(e,n)),c=this.paint.get("line-offset").evaluate(e,n);return c&&(r=function(t,e){for(var n=[],r=new o(0,0),i=0;i<t.length;i++){for(var a=t[i],s=[],u=0;u<a.length;u++){var l=a[u-1],c=a[u],h=a[u+1],p=0===u?r:c.sub(l)._unit()._perp(),f=u===a.length-1?r:h.sub(c)._unit()._perp(),d=p._add(f)._unit(),m=d.x*f.x+d.y*f.y;d._mult(1/m),s.push(d._mult(e)._add(c))}n.push(s)}return n}(r,c*s)),mi(u,r,l)},e}($n);function ha(t,e){return e>0?e+2*t:t}var pa=nr([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}]),fa=nr([{name:"a_projected_pos",components:3,type:"Float32"}],4),da=(nr([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),nr([{name:"a_placed",components:2,type:"Uint8"}],4)),ma=(nr([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),nr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),ya=nr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);function va(t,e,n){return t.sections.forEach((function(t){t.text=function(t,e,n){var r=e.layout.get("text-transform").evaluate(n,{});return"uppercase"===r?t=t.toLocaleUpperCase():"lowercase"===r&&(t=t.toLocaleLowerCase()),Rn.applyArabicShaping&&(t=Rn.applyArabicShaping(t)),t}(t.text,e,n)})),t}nr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"hidden"}]),nr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"horizontalPlacedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint32",name:"crossTileID"}]),nr([{type:"Float32",name:"offsetX"}]),nr([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var ga={"!":"︕","#":"＃",$:"＄","%":"％","&":"＆","(":"︵",")":"︶","*":"＊","+":"＋",",":"︐","-":"︲",".":"・","/":"／",":":"︓",";":"︔","<":"︿","=":"＝",">":"﹀","?":"︖","@":"＠","[":"﹇","\\":"＼","]":"﹈","^":"＾",_:"︳","`":"｀","{":"︷","|":"―","}":"︸","~":"～","¢":"￠","£":"￡","¥":"￥","¦":"￤","¬":"￢","¯":"￣","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"￦","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","！":"︕","（":"︵","）":"︶","，":"︐","－":"︲","．":"・","：":"︓","；":"︔","＜":"︿","＞":"﹀","？":"︖","［":"﹇","］":"﹈","＿":"︳","｛":"︷","｜":"―","｝":"︸","｟":"︵","｠":"︶","｡":"︒","｢":"﹁","｣":"﹂"},_a=function(t){function e(e,n,r,i){t.call(this,e,n),this.angle=r,void 0!==i&&(this.segment=i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(o);function xa(t,e){var n=e.expression;if("constant"===n.kind)return{functionType:"constant",layoutSize:n.evaluate(new Bn(t+1))};if("source"===n.kind)return{functionType:"source"};for(var r=n.zoomStops,i=0;i<r.length&&r[i]<=t;)i++;for(var o=i=Math.max(0,i-1);o<r.length&&r[o]<t+1;)o++;o=Math.min(r.length-1,o);var a={min:r[i],max:r[o]};return"composite"===n.kind?{functionType:"composite",zoomRange:a,propertyValue:e.value}:{functionType:"camera",layoutSize:n.evaluate(new Bn(t+1)),zoomRange:a,sizeRange:{min:n.evaluate(new Bn(a.min)),max:n.evaluate(new Bn(a.max))},propertyValue:e.value}}xn("Anchor",_a);var ba=ta.VectorTileFeature.types,wa=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Ea(t,e,n,r,i,o,a,s){t.emplaceBack(e,n,Math.round(32*r),Math.round(32*i),o,a,s?s[0]:0,s?s[1]:0)}function Sa(t,e,n){t.emplaceBack(e.x,e.y,n),t.emplaceBack(e.x,e.y,n),t.emplaceBack(e.x,e.y,n),t.emplaceBack(e.x,e.y,n)}var Ta=function(t){this.layoutVertexArray=new lr,this.indexArray=new xr,this.programConfigurations=t,this.segments=new jr,this.dynamicLayoutVertexArray=new cr,this.opacityVertexArray=new hr,this.placedSymbolArray=new Ar};Ta.prototype.upload=function(t,e,n,r){n&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,pa.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,fa.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,wa,!0),this.opacityVertexBuffer.itemSize=1),(n||r)&&this.programConfigurations.upload(t)},Ta.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},xn("SymbolBuffers",Ta);var ka=function(t,e,n){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new n,this.segments=new jr,this.collisionVertexArray=new dr};ka.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,da.members,!0)},ka.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},xn("CollisionBuffers",ka);var Ma=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1;var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=xa(this.zoom,e["text-size"]),this.iconSizeData=xa(this.zoom,e["icon-size"]);var n=this.layers[0].layout,r="viewport-y"===n.get("symbol-z-order");this.sortFeaturesByY=r&&(n.get("text-allow-overlap")||n.get("icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement")),this.sourceID=t.sourceID};Ma.prototype.createArrays=function(){this.text=new Ta(new oi(pa.members,this.layers,this.zoom,(function(t){return/^text/.test(t)}))),this.icon=new Ta(new oi(pa.members,this.layers,this.zoom,(function(t){return/^icon/.test(t)}))),this.collisionBox=new ka(fr,ma.members,br),this.collisionCircle=new ka(fr,ya.members,xr),this.glyphOffsetArray=new Cr,this.lineVertexArray=new Or,this.symbolInstances=new zr},Ma.prototype.calculateGlyphDependencies=function(t,e,n,r){for(var i=0;i<t.length;i++)if(e[t.charCodeAt(i)]=!0,n&&r){var o=ga[t.charAt(i)];o&&(e[o.charCodeAt(0)]=!0)}},Ma.prototype.populate=function(t,e){var n=this.layers[0],r=n.layout,i=r.get("text-font"),o=r.get("text-field"),a=r.get("icon-image"),s=("constant"!==o.value.kind||o.value.value.toString().length>0)&&("constant"!==i.value.kind||i.value.value.length>0),u="constant"!==a.value.kind||a.value.value&&a.value.value.length>0;if(this.features=[],s||u){for(var l=e.iconDependencies,c=e.glyphDependencies,h=new Bn(this.zoom),p=0,f=t;p<f.length;p+=1){var d=f[p],m=d.feature,y=d.index,v=d.sourceLayerIndex;if(n._featureFilter(h,m)){var g=void 0;if(s){var _=n.getValueAndResolveTokens("text-field",m);g=va(_ instanceof ut?_:ut.fromString(_),n,m)}var x=void 0;if(u&&(x=n.getValueAndResolveTokens("icon-image",m)),g||x){var b={text:g,icon:x,index:y,sourceLayerIndex:v,geometry:ci(m),properties:m.properties,type:ba[m.type]};if(void 0!==m.id&&(b.id=m.id),this.features.push(b),x&&(l[x]=!0),g)for(var w=i.evaluate(m,{}).join(","),E="map"===r.get("text-rotation-alignment")&&"point"!==r.get("symbol-placement"),S=0,T=g.sections;S<T.length;S+=1){var k=T[S],M=kn(g.toString()),A=k.fontStack||w,P=c[A]=c[A]||{};this.calculateGlyphDependencies(k.text,P,E,M)}}}}"line"===r.get("symbol-placement")&&(this.features=function(t){var e={},n={},r=[],i=0;function o(e){r.push(t[e]),i++}function a(t,e,i){var o=n[t];return delete n[t],n[e]=o,r[o].geometry[0].pop(),r[o].geometry[0]=r[o].geometry[0].concat(i[0]),o}function s(t,n,i){var o=e[n];return delete e[n],e[t]=o,r[o].geometry[0].shift(),r[o].geometry[0]=i[0].concat(r[o].geometry[0]),o}function u(t,e,n){var r=n?e[0][e[0].length-1]:e[0][0];return t+":"+r.x+":"+r.y}for(var l=0;l<t.length;l++){var c=t[l],h=c.geometry,p=c.text?c.text.toString():null;if(p){var f=u(p,h),d=u(p,h,!0);if(f in n&&d in e&&n[f]!==e[d]){var m=s(f,d,h),y=a(f,d,r[m].geometry);delete e[f],delete n[d],n[u(p,r[y].geometry,!0)]=y,r[m].geometry=null}else f in n?a(f,d,h):d in e?s(f,d,h):(o(l),e[f]=i-1,n[d]=i-1)}else o(l)}return r.filter((function(t){return t.geometry}))}(this.features))}},Ma.prototype.update=function(t,e,n){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,n),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,n))},Ma.prototype.isEmpty=function(){return 0===this.symbolInstances.length},Ma.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Ma.prototype.upload=function(t){this.uploaded||(this.collisionBox.upload(t),this.collisionCircle.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},Ma.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.collisionBox.destroy(),this.collisionCircle.destroy()},Ma.prototype.addToLineVertexArray=function(t,e){var n=this.lineVertexArray.length;if(void 0!==t.segment){for(var r=t.dist(e[t.segment+1]),i=t.dist(e[t.segment]),o={},a=t.segment+1;a<e.length;a++)o[a]={x:e[a].x,y:e[a].y,tileUnitDistanceFromAnchor:r},a<e.length-1&&(r+=e[a+1].dist(e[a]));for(var s=t.segment||0;s>=0;s--)o[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var u=0;u<e.length;u++){var l=o[u];this.lineVertexArray.emplaceBack(l.x,l.y,l.tileUnitDistanceFromAnchor)}}return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}},Ma.prototype.addSymbols=function(t,e,n,r,i,o,a,s,u,l){for(var c=t.indexArray,h=t.layoutVertexArray,p=t.dynamicLayoutVertexArray,f=t.segments.prepareSegment(4*e.length,t.layoutVertexArray,t.indexArray),d=this.glyphOffsetArray.length,m=f.vertexLength,y=0,v=e;y<v.length;y+=1){var g=v[y],_=g.tl,x=g.tr,b=g.bl,w=g.br,E=g.tex,S=f.vertexLength,T=g.glyphOffset[1];Ea(h,s.x,s.y,_.x,T+_.y,E.x,E.y,n),Ea(h,s.x,s.y,x.x,T+x.y,E.x+E.w,E.y,n),Ea(h,s.x,s.y,b.x,T+b.y,E.x,E.y+E.h,n),Ea(h,s.x,s.y,w.x,T+w.y,E.x+E.w,E.y+E.h,n),Sa(p,s,0),c.emplaceBack(S,S+1,S+2),c.emplaceBack(S+1,S+2,S+3),f.vertexLength+=4,f.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(g.glyphOffset[0])}t.placedSymbolArray.emplaceBack(s.x,s.y,d,this.glyphOffsetArray.length-d,m,u,l,s.segment,n?n[0]:0,n?n[1]:0,r[0],r[1],a,!1),t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,o,o.index,{})},Ma.prototype._addCollisionDebugVertex=function(t,e,n,r,i,o){return e.emplaceBack(0,0),t.emplaceBack(n.x,n.y,r,i,Math.round(o.x),Math.round(o.y))},Ma.prototype.addCollisionDebugVertices=function(t,e,n,r,i,a,s,u){var l=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),c=l.vertexLength,h=i.layoutVertexArray,p=i.collisionVertexArray,f=s.anchorX,d=s.anchorY;if(this._addCollisionDebugVertex(h,p,a,f,d,new o(t,e)),this._addCollisionDebugVertex(h,p,a,f,d,new o(n,e)),this._addCollisionDebugVertex(h,p,a,f,d,new o(n,r)),this._addCollisionDebugVertex(h,p,a,f,d,new o(t,r)),l.vertexLength+=4,u){var m=i.indexArray;m.emplaceBack(c,c+1,c+2),m.emplaceBack(c,c+2,c+3),l.primitiveLength+=2}else{var y=i.indexArray;y.emplaceBack(c,c+1),y.emplaceBack(c+1,c+2),y.emplaceBack(c+2,c+3),y.emplaceBack(c+3,c),l.primitiveLength+=4}},Ma.prototype.addDebugCollisionBoxes=function(t,e,n){for(var r=t;r<e;r++){var i=this.collisionBoxArray.get(r),o=i.x1,a=i.y1,s=i.x2,u=i.y2,l=i.radius>0;this.addCollisionDebugVertices(o,a,s,u,l?this.collisionCircle:this.collisionBox,i.anchorPoint,n,l)}},Ma.prototype.generateCollisionDebugBuffers=function(){for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e)}},Ma.prototype._deserializeCollisionBoxesForSymbol=function(t,e,n,r,i){for(var o={},a=e;a<n;a++){var s=t.get(a);if(0===s.radius){o.textBox={x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2,anchorPointX:s.anchorPointX,anchorPointY:s.anchorPointY},o.textFeatureIndex=s.featureIndex;break}o.textCircles||(o.textCircles=[],o.textFeatureIndex=s.featureIndex),o.textCircles.push(s.anchorPointX,s.anchorPointY,s.radius,s.signedDistanceFromAnchor,1)}for(var u=r;u<i;u++){var l=t.get(u);if(0===l.radius){o.iconBox={x1:l.x1,y1:l.y1,x2:l.x2,y2:l.y2,anchorPointX:l.anchorPointX,anchorPointY:l.anchorPointY},o.iconFeatureIndex=l.featureIndex;break}}return o},Ma.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var n=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,n.textBoxStartIndex,n.textBoxEndIndex,n.iconBoxStartIndex,n.iconBoxEndIndex))}},Ma.prototype.hasTextData=function(){return this.text.segments.get().length>0},Ma.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Ma.prototype.hasCollisionBoxData=function(){return this.collisionBox.segments.get().length>0},Ma.prototype.hasCollisionCircleData=function(){return this.collisionCircle.segments.get().length>0},Ma.prototype.addIndicesForPlacedTextSymbol=function(t){for(var e=this.text.placedSymbolArray.get(t),n=e.vertexStartIndex+4*e.numGlyphs,r=e.vertexStartIndex;r<n;r+=4)this.text.indexArray.emplaceBack(r,r+1,r+2),this.text.indexArray.emplaceBack(r+1,r+2,r+3)},Ma.prototype.sortFeatures=function(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&(this.sortedAngle=t,!(this.text.segments.get().length>1||this.icon.segments.get().length>1))){for(var e=[],n=0;n<this.symbolInstances.length;n++)e.push(n);for(var r=Math.sin(t),i=Math.cos(t),o=[],a=[],s=0;s<this.symbolInstances.length;s++){var u=this.symbolInstances.get(s);o.push(0|Math.round(r*u.anchorX+i*u.anchorY)),a.push(u.featureIndex)}e.sort((function(t,e){return o[t]-o[e]||a[e]-a[t]})),this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var l=0,c=e;l<c.length;l+=1){var h=c[l],p=this.symbolInstances.get(h);this.featureSortOrder.push(p.featureIndex),p.horizontalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedTextSymbol(p.horizontalPlacedTextSymbolIndex),p.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedTextSymbol(p.verticalPlacedTextSymbolIndex);var f=this.icon.placedSymbolArray.get(h);if(f.numGlyphs){var d=f.vertexStartIndex;this.icon.indexArray.emplaceBack(d,d+1,d+2),this.icon.indexArray.emplaceBack(d+1,d+2,d+3)}}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},xn("SymbolBucket",Ma,{omit:["layers","collisionBoxArray","features","compareText"]}),Ma.MAX_GLYPHS=65535,Ma.addDynamicAttributes=Sa;var Aa=new Jn({"symbol-placement":new Xn(B.layout_symbol["symbol-placement"]),"symbol-spacing":new Xn(B.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Xn(B.layout_symbol["symbol-avoid-edges"]),"symbol-z-order":new Xn(B.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Xn(B.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Xn(B.layout_symbol["icon-ignore-placement"]),"icon-optional":new Xn(B.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Xn(B.layout_symbol["icon-rotation-alignment"]),"icon-size":new Wn(B.layout_symbol["icon-size"]),"icon-text-fit":new Xn(B.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Xn(B.layout_symbol["icon-text-fit-padding"]),"icon-image":new Wn(B.layout_symbol["icon-image"]),"icon-rotate":new Wn(B.layout_symbol["icon-rotate"]),"icon-padding":new Xn(B.layout_symbol["icon-padding"]),"icon-keep-upright":new Xn(B.layout_symbol["icon-keep-upright"]),"icon-offset":new Wn(B.layout_symbol["icon-offset"]),"icon-anchor":new Wn(B.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Xn(B.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Xn(B.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Xn(B.layout_symbol["text-rotation-alignment"]),"text-field":new Wn(B.layout_symbol["text-field"]),"text-font":new Wn(B.layout_symbol["text-font"]),"text-size":new Wn(B.layout_symbol["text-size"]),"text-max-width":new Wn(B.layout_symbol["text-max-width"]),"text-line-height":new Xn(B.layout_symbol["text-line-height"]),"text-letter-spacing":new Wn(B.layout_symbol["text-letter-spacing"]),"text-justify":new Wn(B.layout_symbol["text-justify"]),"text-anchor":new Wn(B.layout_symbol["text-anchor"]),"text-max-angle":new Xn(B.layout_symbol["text-max-angle"]),"text-rotate":new Wn(B.layout_symbol["text-rotate"]),"text-padding":new Xn(B.layout_symbol["text-padding"]),"text-keep-upright":new Xn(B.layout_symbol["text-keep-upright"]),"text-transform":new Wn(B.layout_symbol["text-transform"]),"text-offset":new Wn(B.layout_symbol["text-offset"]),"text-allow-overlap":new Xn(B.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Xn(B.layout_symbol["text-ignore-placement"]),"text-optional":new Xn(B.layout_symbol["text-optional"])}),Pa={paint:new Jn({"icon-opacity":new Wn(B.paint_symbol["icon-opacity"]),"icon-color":new Wn(B.paint_symbol["icon-color"]),"icon-halo-color":new Wn(B.paint_symbol["icon-halo-color"]),"icon-halo-width":new Wn(B.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Wn(B.paint_symbol["icon-halo-blur"]),"icon-translate":new Xn(B.paint_symbol["icon-translate"]),"icon-translate-anchor":new Xn(B.paint_symbol["icon-translate-anchor"]),"text-opacity":new Wn(B.paint_symbol["text-opacity"]),"text-color":new Wn(B.paint_symbol["text-color"]),"text-halo-color":new Wn(B.paint_symbol["text-halo-color"]),"text-halo-width":new Wn(B.paint_symbol["text-halo-width"]),"text-halo-blur":new Wn(B.paint_symbol["text-halo-blur"]),"text-translate":new Xn(B.paint_symbol["text-translate"]),"text-translate-anchor":new Xn(B.paint_symbol["text-translate-anchor"])}),layout:Aa},za=function(t){function e(e){t.call(this,e,Pa)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="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"))},e.prototype.getValueAndResolveTokens=function(t,e){var n,r=this.layout.get(t).evaluate(e,{}),i=this._unevaluatedLayout._values[t];return i.isDataDriven()||Ae(i.value)?r:(n=e.properties,r.replace(/{([^{}]+)}/g,(function(t,e){return e in n?String(n[e]):""})))},e.prototype.createBucket=function(t){return new Ma(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e}($n),Ia={paint:new Jn({"background-color":new Xn(B.paint_background["background-color"]),"background-pattern":new Yn(B.paint_background["background-pattern"]),"background-opacity":new Xn(B.paint_background["background-opacity"])})},Ca=function(t){function e(e){t.call(this,e,Ia)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}($n),La={paint:new Jn({"raster-opacity":new Xn(B.paint_raster["raster-opacity"]),"raster-hue-rotate":new Xn(B.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Xn(B.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Xn(B.paint_raster["raster-brightness-max"]),"raster-saturation":new Xn(B.paint_raster["raster-saturation"]),"raster-contrast":new Xn(B.paint_raster["raster-contrast"]),"raster-resampling":new Xn(B.paint_raster["raster-resampling"]),"raster-fade-duration":new Xn(B.paint_raster["raster-fade-duration"])})},Oa=function(t){function e(e){t.call(this,e,La)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}($n),Da=function(t){function e(e){t.call(this,e,{}),this.implementation=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender||"3d"===this.implementation.renderingMode},e.prototype.recalculate=function(){},e.prototype.updateTransitions=function(){},e.prototype.hasTransition=function(){},e.prototype.serialize=function(){},e.prototype.resize=function(){this.viewportFrame&&(this.viewportFrame.destroy(),this.viewportFrame=null)},e.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},e.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t)},e}($n),Ra={circle:Vi,heatmap:Ki,hillshade:$i,fill:Oo,"fill-extrusion":qo,line:ca,symbol:za,background:Ca,raster:Oa};function Ba(t){for(var e=0,n=0,r=0,i=t;r<i.length;r+=1){var o=i[r];e+=o.w*o.h,n=Math.max(n,o.w)}t.sort((function(t,e){return e.h-t.h}));for(var a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),n),h:1/0}],s=0,u=0,l=0,c=t;l<c.length;l+=1)for(var h=c[l],p=a.length-1;p>=0;p--){var f=a[p];if(!(h.w>f.w||h.h>f.h)){if(h.x=f.x,h.y=f.y,u=Math.max(u,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===f.w&&h.h===f.h){var d=a.pop();p<a.length&&(a[p]=d)}else h.h===f.h?(f.x+=h.w,f.w-=h.w):h.w===f.w?(f.y+=h.h,f.h-=h.h):(a.push({x:f.x+h.w,y:f.y,w:f.w-h.w,h:h.h}),f.y+=h.h,f.h-=h.h);break}}return{w:s,h:u,fill:e/(s*u)||0}}var Fa=function(t,e){var n=e.pixelRatio;this.paddedRect=t,this.pixelRatio=n},ja={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};ja.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},ja.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},ja.tlbr.get=function(){return this.tl.concat(this.br)},ja.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Fa.prototype,ja);var Va=function(t,e){var n={},r={},i=[];for(var o in t){var a=t[o],s={x:0,y:0,w:a.data.width+2,h:a.data.height+2};i.push(s),n[o]=new Fa(s,a)}for(var u in e){var l=e[u],c={x:0,y:0,w:l.data.width+2,h:l.data.height+2};i.push(c),r[u]=new Fa(c,l)}var h=Ba(i),p=h.w,f=h.h,d=new Wi({width:p||1,height:f||1});for(var m in t){var y=t[m],v=n[m].paddedRect;Wi.copy(y.data,d,{x:0,y:0},{x:v.x+1,y:v.y+1},y.data)}for(var g in e){var _=e[g],x=r[g].paddedRect,b=x.x+1,w=x.y+1,E=_.data.width,S=_.data.height;Wi.copy(_.data,d,{x:0,y:0},{x:b,y:w},_.data),Wi.copy(_.data,d,{x:0,y:S-1},{x:b,y:w-1},{width:E,height:1}),Wi.copy(_.data,d,{x:0,y:0},{x:b,y:w+S},{width:E,height:1}),Wi.copy(_.data,d,{x:E-1,y:0},{x:b-1,y:w},{width:1,height:S}),Wi.copy(_.data,d,{x:0,y:0},{x:b+E,y:w},{width:1,height:S})}this.image=d,this.iconPositions=n,this.patternPositions=r};xn("ImagePosition",Fa),xn("ImageAtlas",Va);var Na=self.HTMLImageElement,Ua=self.HTMLCanvasElement,qa=self.HTMLVideoElement,Za=self.ImageData,Ga=function(t,e,n,r){this.context=t,this.format=n,this.texture=t.gl.createTexture(),this.update(e,r)};Ga.prototype.update=function(t,e){var n=t.width,r=t.height,i=!this.size||this.size[0]!==n||this.size[1]!==r,o=this.context,a=o.gl;this.useMipmap=Boolean(e&&e.useMipmap),a.bindTexture(a.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1),o.pixelStoreUnpackPremultiplyAlpha.set(this.format===a.RGBA&&(!e||!1!==e.premultiply)),i?(this.size=[n,r],t instanceof Na||t instanceof Ua||t instanceof qa||t instanceof Za?a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,a.UNSIGNED_BYTE,t):a.texImage2D(a.TEXTURE_2D,0,this.format,n,r,0,this.format,a.UNSIGNED_BYTE,t.data)):t instanceof Na||t instanceof Ua||t instanceof qa||t instanceof Za?a.texSubImage2D(a.TEXTURE_2D,0,0,0,a.RGBA,a.UNSIGNED_BYTE,t):a.texSubImage2D(a.TEXTURE_2D,0,0,0,n,r,a.RGBA,a.UNSIGNED_BYTE,t.data),this.useMipmap&&this.isSizePowerOfTwo()&&a.generateMipmap(a.TEXTURE_2D)},Ga.prototype.bind=function(t,e,n){var r=this.context.gl;r.bindTexture(r.TEXTURE_2D,this.texture),n!==r.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(n=r.LINEAR),t!==this.filter&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,n||t),this.filter=t),e!==this.wrap&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,e),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,e),this.wrap=e)},Ga.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},Ga.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var Xa=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,l=u>>1,c=-7,h=n?i-1:0,p=n?-1:1,f=t[e+h];for(h+=p,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=p,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+t[e+h],h+=p,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=l}return(f?-1:1)*a*Math.pow(2,o-r)},Wa=function(t,e,n,r,i,o){var a,s,u,l=8*o-i-1,c=(1<<l)-1,h=c>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,d=r?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?p/u:p*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[n+f]=255&s,f+=d,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;t[n+f]=255&a,f+=d,a/=256,l-=8);t[n+f-d]|=128*m},Ha=Ya;function Ya(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}function Ka(t){return t.type===Ya.Bytes?t.readVarint()+t.pos:t.pos+1}function Ja(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function $a(t,e,n){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=t;i--)n.buf[i+r]=n.buf[i]}function Qa(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function ts(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function es(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function ns(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function rs(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function is(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function os(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function as(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function ss(t,e){for(var n=0;n<t.length;n++)e.writeSFixed64(t[n])}function us(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function ls(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function cs(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function hs(t,e,n){1===t&&n.readMessage(ps,e)}function ps(t,e,n){if(3===t){var r=n.readMessage(fs,{}),i=r.id,o=r.bitmap,a=r.width,s=r.height,u=r.left,l=r.top,c=r.advance;e.push({id:i,bitmap:new Xi({width:a+6,height:s+6},o),metrics:{width:a,height:s,left:u,top:l,advance:c}})}}function fs(t,e,n){1===t?e.id=n.readVarint():2===t?e.bitmap=n.readBytes():3===t?e.width=n.readVarint():4===t?e.height=n.readVarint():5===t?e.left=n.readSVarint():6===t?e.top=n.readSVarint():7===t&&(e.advance=n.readVarint())}Ya.Varint=0,Ya.Fixed64=1,Ya.Bytes=2,Ya.Fixed32=5,Ya.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos<n;){var r=this.readVarint(),i=r>>3,o=this.pos;this.type=7&r,t(i,e,this),this.pos===o&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=us(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=cs(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=us(this.buf,this.pos)+4294967296*us(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=us(this.buf,this.pos)+4294967296*cs(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Xa(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Xa(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,n,r=this.buf;return e=127&(n=r[this.pos++]),n<128?e:(e|=(127&(n=r[this.pos++]))<<7,n<128?e:(e|=(127&(n=r[this.pos++]))<<14,n<128?e:(e|=(127&(n=r[this.pos++]))<<21,n<128?e:function(t,e,n){var r,i,o=n.buf;if(r=(112&(i=o[n.pos++]))>>4,i<128)return Ja(t,r,e);if(r|=(127&(i=o[n.pos++]))<<3,i<128)return Ja(t,r,e);if(r|=(127&(i=o[n.pos++]))<<10,i<128)return Ja(t,r,e);if(r|=(127&(i=o[n.pos++]))<<17,i<128)return Ja(t,r,e);if(r|=(127&(i=o[n.pos++]))<<24,i<128)return Ja(t,r,e);if(r|=(1&(i=o[n.pos++]))<<31,i<128)return Ja(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=function(t,e,n){for(var r="",i=e;i<n;){var o,a,s,u=t[i],l=null,c=u>239?4:u>223?3:u>191?2:1;if(i+c>n)break;1===c?u<128&&(l=u):2===c?128==(192&(o=t[i+1]))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===c?(o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&((l=(15&u)<<12|(63&o)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===c&&(o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,c=1):l>65535&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),r+=String.fromCharCode(l),i+=c}return r}(this.buf,this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){var n=Ka(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){var e=Ka(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){var e=Ka(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){var e=Ka(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){var e=Ka(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){var e=Ka(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){var e=Ka(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){var e=Ka(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){var e=Ka(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Ya.Varint)for(;this.buf[this.pos++]>127;);else if(e===Ya.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Ya.Fixed32)this.pos+=4;else{if(e!==Ya.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var n=new Uint8Array(e);n.set(this.buf),this.buf=n,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),ls(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),ls(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),ls(this.buf,-1&t,this.pos),ls(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),ls(this.buf,-1&t,this.pos),ls(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var n,r;if(t>=0?(n=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,r=r+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos]=127&t}(n,0,e),function(t,e){var n=(7&t)<<4;e.buf[e.pos++]|=n|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(r,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,n){for(var r,i,o=0;o<e.length;o++){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){r>56319||o+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):i=r;continue}if(r<56320){t[n++]=239,t[n++]=191,t[n++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&(t[n++]=239,t[n++]=191,t[n++]=189,i=null);r<128?t[n++]=r:(r<2048?t[n++]=r>>6|192:(r<65536?t[n++]=r>>12|224:(t[n++]=r>>18|240,t[n++]=r>>12&63|128),t[n++]=r>>6&63|128),t[n++]=63&r|128)}return n}(this.buf,t,this.pos);var n=this.pos-e;n>=128&&$a(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),Wa(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Wa(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var n=0;n<e;n++)this.buf[this.pos++]=t[n]},writeRawMessage:function(t,e){this.pos++;var n=this.pos;t(e,this);var r=this.pos-n;r>=128&&$a(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,n){this.writeTag(t,Ya.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){this.writeMessage(t,Qa,e)},writePackedSVarint:function(t,e){this.writeMessage(t,ts,e)},writePackedBoolean:function(t,e){this.writeMessage(t,rs,e)},writePackedFloat:function(t,e){this.writeMessage(t,es,e)},writePackedDouble:function(t,e){this.writeMessage(t,ns,e)},writePackedFixed32:function(t,e){this.writeMessage(t,is,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,os,e)},writePackedFixed64:function(t,e){this.writeMessage(t,as,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,ss,e)},writeBytesField:function(t,e){this.writeTag(t,Ya.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Ya.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Ya.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Ya.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Ya.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Ya.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Ya.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Ya.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Ya.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Ya.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var ds=function(t,e,n){this.target=t,this.parent=e,this.mapId=n,this.callbacks={},this.callbackID=0,d(["receive"],this),this.target.addEventListener("message",this.receive,!1)};function ms(t,e,n){var r=2*Math.PI*6378137/256/Math.pow(2,n);return[t*r-2*Math.PI*6378137/2,e*r-2*Math.PI*6378137/2]}ds.prototype.send=function(t,e,n,r){var i=n?this.mapId+":"+this.callbackID++:null;n&&(this.callbacks[i]=n);var o=[];this.target.postMessage({targetMapId:r,sourceMapId:this.mapId,type:t,id:String(i),data:wn(e,o)},o)},ds.prototype.receive=function(t){var e,n=this,r=t.data,i=r.id;if(!r.targetMapId||this.mapId===r.targetMapId){var o=function(t,e){var r=[];n.target.postMessage({sourceMapId:n.mapId,type:"<response>",id:String(i),error:t?wn(t):null,data:wn(e,r)},r)};if("<response>"===r.type)e=this.callbacks[r.id],delete this.callbacks[r.id],e&&r.error?e(En(r.error)):e&&e(null,En(r.data));else if(void 0!==r.id&&this.parent[r.type])this.parent[r.type](r.sourceMapId,En(r.data),o);else if(void 0!==r.id&&this.parent.getWorkerSource){var a=r.type.split("."),s=En(r.data);this.parent.getWorkerSource(r.sourceMapId,a[0],s.source)[a[1]](s,o)}else this.parent[r.type](En(r.data))}},ds.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1)};var ys=function(t,e,n){this.z=t,this.x=e,this.y=n,this.key=_s(0,t,e,n)};ys.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},ys.prototype.url=function(t,e){var n,r,i,o,a,s=(n=this.x,r=this.y,i=this.z,o=ms(256*n,256*(r=Math.pow(2,i)-r-1),i),a=ms(256*(n+1),256*(r+1),i),o[0]+","+o[1]+","+a[0]+","+a[1]),u=function(t,e,n){for(var r,i="",o=t;o>0;o--)i+=(e&(r=1<<o-1)?1:0)+(n&r?2:0);return i}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",u).replace("{bbox-epsg-3857}",s)};var vs=function(t,e){this.wrap=t,this.canonical=e,this.key=_s(t,e.z,e.x,e.y)},gs=function(t,e,n,r,i){this.overscaledZ=t,this.wrap=e,this.canonical=new ys(n,+r,+i),this.key=_s(e,t,r,i)};function _s(t,e,n,r){(t*=2)<0&&(t=-1*t-1);var i=1<<e;return 32*(i*i*t+i*r+n)+e}gs.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},gs.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new gs(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new gs(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},gs.prototype.isChildOf=function(t){var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},gs.prototype.children=function(t){if(this.overscaledZ>=t)return[new gs(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,n=2*this.canonical.x,r=2*this.canonical.y;return[new gs(e,this.wrap,e,n,r),new gs(e,this.wrap,e,n+1,r),new gs(e,this.wrap,e,n,r+1),new gs(e,this.wrap,e,n+1,r+1)]},gs.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},gs.prototype.wrapped=function(){return new gs(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},gs.prototype.unwrapTo=function(t){return new gs(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},gs.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},gs.prototype.toUnwrapped=function(){return new vs(this.wrap,this.canonical)},gs.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},gs.prototype.toCoordinate=function(){return new i(this.canonical.x+Math.pow(2,this.wrap),this.canonical.y,this.canonical.z)},xn("CanonicalTileID",ys),xn("OverscaledTileID",gs,{omit:["posMatrix"]});var xs=function(t,e,n){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(n&&"mapbox"!==n&&"terrarium"!==n)return x('"'+n+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');var r=this.dim=e.height;this.border=Math.max(Math.ceil(e.height/2),1),this.stride=this.dim+2*this.border,this.data=new Int32Array(this.stride*this.stride);for(var i=e.data,o="terrarium"===n?this._unpackTerrarium:this._unpackMapbox,a=0;a<r;a++)for(var s=0;s<r;s++){var u=4*(a*r+s);this.set(s,a,o(i[u],i[u+1],i[u+2]))}for(var l=0;l<r;l++)this.set(-1,l,this.get(0,l)),this.set(r,l,this.get(r-1,l)),this.set(l,-1,this.get(l,0)),this.set(l,r,this.get(l,r-1));this.set(-1,-1,this.get(0,0)),this.set(r,-1,this.get(r-1,0)),this.set(-1,r,this.get(0,r-1)),this.set(r,r,this.get(r-1,r-1))};xs.prototype.set=function(t,e,n){this.data[this._idx(t,e)]=n+65536},xs.prototype.get=function(t,e){return this.data[this._idx(t,e)]-65536},xs.prototype._idx=function(t,e){if(t<-this.border||t>=this.dim+this.border||e<-this.border||e>=this.dim+this.border)throw new RangeError("out of range source coordinates for DEM data");return(e+this.border)*this.stride+(t+this.border)},xs.prototype._unpackMapbox=function(t,e,n){return(256*t*256+256*e+n)/10-1e4},xs.prototype._unpackTerrarium=function(t,e,n){return 256*t+e+n/256-32768},xs.prototype.getPixels=function(){return new Wi({width:this.dim+2*this.border,height:this.dim+2*this.border},new Uint8Array(this.data.buffer))},xs.prototype.backfillBorder=function(t,e,n){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var r=e*this.dim,i=e*this.dim+this.dim,o=n*this.dim,a=n*this.dim+this.dim;switch(e){case-1:r=i-1;break;case 1:i=r+1}switch(n){case-1:o=a-1;break;case 1:a=o+1}for(var s=c(r,-this.border,this.dim+this.border),u=c(i,-this.border,this.dim+this.border),l=c(o,-this.border,this.dim+this.border),h=c(a,-this.border,this.dim+this.border),p=-e*this.dim,f=-n*this.dim,d=l;d<h;d++)for(var m=s;m<u;m++)this.set(m,d,t.get(m+p,d+f))},xn("DEMData",xs);var bs=nr([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),ws=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var n=t[e];this._stringToNumber[n]=e,this._numberToString[e]=n}};ws.prototype.encode=function(t){return this._stringToNumber[t]},ws.prototype.decode=function(t){return this._numberToString[t]};var Es=function(t,e,n,r){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=n,t._y=r,this.properties=t.properties,null!=t.id&&(this.id=t.id)},Ss={geometry:{configurable:!0}};Ss.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},Ss.geometry.set=function(t){this._geometry=t},Es.prototype.toJSON=function(){var t={geometry:this.geometry};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t},Object.defineProperties(Es.prototype,Ss);var Ts=function(){this.state={},this.stateChanges={}};Ts.prototype.updateState=function(t,e,n){var r=String(e);this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][r]=this.stateChanges[t][r]||{},h(this.stateChanges[t][r],n)},Ts.prototype.getState=function(t,e){var n=String(e),r=this.state[t]||{},i=this.stateChanges[t]||{};return h({},r[n],i[n])},Ts.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},Ts.prototype.coalesceChanges=function(t,e){var n={};for(var r in this.stateChanges){this.state[r]=this.state[r]||{};var i={};for(var o in this.stateChanges[r])this.state[r][o]||(this.state[r][o]={}),h(this.state[r][o],this.stateChanges[r][o]),i[o]=this.state[r][o];n[r]=i}if(this.stateChanges={},0!==Object.keys(n).length)for(var a in t)t[a].setFeatureState(n,e)};var ks=function(t,e,n){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=e||new yn(ui,16,0),this.featureIndexArray=n||new Rr};function Ms(t,e){return e-t}ks.prototype.insert=function(t,e,n,r,i){var o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,r,i);for(var a=0;a<e.length;a++){for(var s=e[a],u=[1/0,1/0,-1/0,-1/0],l=0;l<s.length;l++){var c=s[l];u[0]=Math.min(u[0],c.x),u[1]=Math.min(u[1],c.y),u[2]=Math.max(u[2],c.x),u[3]=Math.max(u[3],c.y)}u[0]<ui&&u[1]<ui&&u[2]>=0&&u[3]>=0&&this.grid.insert(o,u[0],u[1],u[2],u[3])}},ks.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new ta.VectorTile(new Ha(this.rawTileData)).layers,this.sourceLayerCoder=new ws(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},ks.prototype.query=function(t,e,n){var r=this;this.loadVTLayers();for(var i=t.params||{},o=ui/t.tileSize/t.scale,a=qe(i.filter),s=t.queryGeometry,u=t.queryPadding*o,l=1/0,c=1/0,h=-1/0,p=-1/0,f=0;f<s.length;f++)for(var d=s[f],m=0;m<d.length;m++){var y=d[m];l=Math.min(l,y.x),c=Math.min(c,y.y),h=Math.max(h,y.x),p=Math.max(p,y.y)}var v=this.grid.query(l-u,c-u,h+u,p+u);v.sort(Ms);for(var g,_={},x=function(u){var l=v[u];if(l!==g){g=l;var c=r.featureIndexArray.get(l),h=null;r.loadMatchingFeature(_,c.bucketIndex,c.sourceLayerIndex,c.featureIndex,a,i.layers,e,(function(e,i){h||(h=ci(e));var a={};return e.id&&(a=n.getState(i.sourceLayer||"_geojsonTileLayer",e.id)),i.queryIntersectsFeature(s,e,a,h,r.z,t.transform,o,t.posMatrix)}))}},b=0;b<v.length;b++)x(b);return _},ks.prototype.loadMatchingFeature=function(t,e,n,r,i,o,a,s){var u=this.bucketLayerIDs[e];if(!o||function(t,e){for(var n=0;n<t.length;n++)if(e.indexOf(t[n])>=0)return!0;return!1}(o,u)){var l=this.sourceLayerCoder.decode(n),c=this.vtLayers[l].feature(r);if(i(new Bn(this.tileID.overscaledZ),c))for(var h=0;h<u.length;h++){var p=u[h];if(!(o&&o.indexOf(p)<0)){var f=a[p];if(f&&(!s||s(c,f))){var d=new Es(c,this.z,this.x,this.y);d.layer=f.serialize();var m=t[p];void 0===m&&(m=t[p]=[]),m.push({featureIndex:r,feature:d})}}}}},ks.prototype.lookupSymbolFeatures=function(t,e,n,r,i,o){var a={};this.loadVTLayers();for(var s=qe(r),u=0,l=t;u<l.length;u+=1){var c=l[u];this.loadMatchingFeature(a,e,n,c,s,i,o)}return a},ks.prototype.hasLayer=function(t){for(var e=0,n=this.bucketLayerIDs;e<n.length;e+=1)for(var r=0,i=n[e];r<i.length;r+=1)if(t===i[r])return!0;return!1},xn("FeatureIndex",ks,{omit:["rawTileData","sourceLayerCoder"]});var As=function(t,e){this.tileID=t,this.uid=f(),this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.expiredRequestCount=0,this.state="loading"};As.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<k.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)},As.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},As.prototype.loadVectorData=function(t,e,n){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var r in 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=function(t,e){var n={};if(!e)return n;for(var r=0,i=t;r<i.length;r+=1){var o=i[r],a=o.layerIds.map((function(t){return e.getLayer(t)})).filter(Boolean);if(0!==a.length){o.layers=a,o.stateDependentLayers=a.filter((function(t){return t.isStateDependent()}));for(var s=0,u=a;s<u.length;s+=1)n[u[s].id]=o}}return n}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var i=this.buckets[r];if(i instanceof Ma){if(this.hasSymbolBuckets=!0,!n)break;i.justReloaded=!0}}for(var o in this.queryPadding=0,this.buckets){var a=this.buckets[o];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(o).queryRadius(a))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new kr},As.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},As.prototype.unloadDEMData=function(){this.dem=null,this.neighboringTiles=null,this.state="unloaded"},As.prototype.getBucket=function(t){return this.buckets[t.id]},As.prototype.upload=function(t){for(var e in this.buckets){var n=this.buckets[e];n.uploadPending()&&n.upload(t)}var r=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Ga(t,this.imageAtlas.image,r.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Ga(t,this.glyphAtlasImage,r.ALPHA),this.glyphAtlasImage=null)},As.prototype.queryRenderedFeatures=function(t,e,n,r,i,o,a,s){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:n,scale:r,tileSize:this.tileSize,posMatrix:s,transform:o,params:i,queryPadding:this.queryPadding*a},t,e):{}},As.prototype.querySourceFeatures=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData){var n=this.latestFeatureIndex.loadVTLayers(),r=e?e.sourceLayer:"",i=n._geojsonTileLayer||n[r];if(i)for(var o=qe(e&&e.filter),a=this.tileID.canonical,s=a.z,u=a.x,l=a.y,c={z:s,x:u,y:l},h=0;h<i.length;h++){var p=i.feature(h);if(o(new Bn(this.tileID.overscaledZ),p)){var f=new Es(p,s,u,l);f.tile=c,t.push(f)}}}},As.prototype.clearMask=function(){this.segments&&(this.segments.destroy(),delete this.segments),this.maskedBoundsBuffer&&(this.maskedBoundsBuffer.destroy(),delete this.maskedBoundsBuffer),this.maskedIndexBuffer&&(this.maskedIndexBuffer.destroy(),delete this.maskedIndexBuffer)},As.prototype.setMask=function(t,e){if(!s(this.mask,t)&&(this.mask=t,this.clearMask(),!s(t,{0:!0}))){var n=new or,r=new xr;this.segments=new jr,this.segments.prepareSegment(0,n,r);for(var i=Object.keys(t),a=0;a<i.length;a++){var u=t[i[a]],l=ui>>u.z,c=new o(u.x*l,u.y*l),h=new o(c.x+l,c.y+l),p=this.segments.prepareSegment(4,n,r);n.emplaceBack(c.x,c.y,c.x,c.y),n.emplaceBack(h.x,c.y,h.x,c.y),n.emplaceBack(c.x,h.y,c.x,h.y),n.emplaceBack(h.x,h.y,h.x,h.y);var f=p.vertexLength;r.emplaceBack(f,f+1,f+2),r.emplaceBack(f+1,f+2,f+3),p.vertexLength+=4,p.primitiveLength+=2}this.maskedBoundsBuffer=e.createVertexBuffer(n,bs.members),this.maskedIndexBuffer=e.createIndexBuffer(r)}},As.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},As.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},As.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var n=function(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,n,r,i){var o=r||i;return e[n]=!o||o.toLowerCase(),""})),e["max-age"]){var n=parseInt(e["max-age"],10);isNaN(n)?delete e["max-age"]:e["max-age"]=n}return e}(t.cacheControl);n["max-age"]&&(this.expirationTime=Date.now()+1e3*n["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var r=Date.now(),i=!1;if(this.expirationTime>r)i=!1;else if(e)if(this.expirationTime<e)i=!0;else{var o=this.expirationTime-e;o?this.expirationTime=r+Math.max(o,3e4):i=!0}else i=!0;i?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},As.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)},As.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var n=this.latestFeatureIndex.loadVTLayers();for(var r in this.buckets){var i=this.buckets[r],o=i.layers[0].sourceLayer||"_geojsonTileLayer",a=n[o],s=t[o];a&&s&&0!==Object.keys(s).length&&(i.update(s,a,this.imageAtlas&&this.imageAtlas.patternPositions||{}),e&&e.style&&(this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(r).queryRadius(i))))}}},As.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},As.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<k.now()},As.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},As.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=k.now()+t};var Ps={horizontal:1,vertical:2,horizontalOnly:3},zs=function(){this.text="",this.sectionIndex=[],this.sections=[]};zs.fromFeature=function(t,e){for(var n=new zs,r=0;r<t.sections.length;r++){var i=t.sections[r];n.sections.push({scale:i.scale||1,fontStack:i.fontStack||e}),n.text+=i.text;for(var o=0;o<i.text.length;o++)n.sectionIndex.push(r)}return n},zs.prototype.length=function(){return this.text.length},zs.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},zs.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},zs.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",n=0;n<t.length;n++){var r=t.charCodeAt(n+1)||null,i=t.charCodeAt(n-1)||null;r&&Pn(r)&&!ga[t[n+1]]||i&&Pn(i)&&!ga[t[n-1]]||!ga[t[n]]?e+=t[n]:e+=ga[t[n]]}return e}(this.text)},zs.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&Is[this.text.charCodeAt(e)];e++)t++;for(var n=this.text.length,r=this.text.length-1;r>=0&&r>=t&&Is[this.text.charCodeAt(r)];r--)n--;this.text=this.text.substring(t,n),this.sectionIndex=this.sectionIndex.slice(t,n)},zs.prototype.substring=function(t,e){var n=new zs;return n.text=this.text.substring(t,e),n.sectionIndex=this.sectionIndex.slice(t,e),n.sections=this.sections,n},zs.prototype.toString=function(){return this.text},zs.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,n){return Math.max(e,t.sections[n].scale)}),0)};var Is={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Cs={};function Ls(t,e,n,r){var i=Math.pow(t-e,2);return r?t<e?i/2:2*i:i+Math.abs(n)*n}function Os(t,e){var n=0;return 10===t&&(n-=1e4),40!==t&&65288!==t||(n+=50),41!==e&&65289!==e||(n+=50),n}function Ds(t,e,n,r,i,o){for(var a=null,s=Ls(e,n,i,o),u=0,l=r;u<l.length;u+=1){var c=l[u],h=Ls(e-c.x,n,i,o)+c.badness;h<=s&&(a=c,s=h)}return{index:t,x:e,priorBreak:a,badness:s}}function Rs(t,e,n,r){if(!n)return[];if(!t)return[];for(var i,o=[],a=function(t,e,n,r){for(var i=0,o=0;o<t.length();o++){var a=t.getSection(o),s=r[a.fontStack],u=s&&s[t.getCharCode(o)];u&&(i+=u.metrics.advance*a.scale+e)}return i/Math.max(1,Math.ceil(i/n))}(t,e,n,r),s=0,u=0;u<t.length();u++){var l=t.getSection(u),c=t.getCharCode(u),h=r[l.fontStack],p=h&&h[c];p&&!Is[c]&&(s+=p.metrics.advance*l.scale+e),u<t.length()-1&&(Cs[c]||!((i=c)<11904)&&(Tn["Bopomofo Extended"](i)||Tn.Bopomofo(i)||Tn["CJK Compatibility Forms"](i)||Tn["CJK Compatibility Ideographs"](i)||Tn["CJK Compatibility"](i)||Tn["CJK Radicals Supplement"](i)||Tn["CJK Strokes"](i)||Tn["CJK Symbols and Punctuation"](i)||Tn["CJK Unified Ideographs Extension A"](i)||Tn["CJK Unified Ideographs"](i)||Tn["Enclosed CJK Letters and Months"](i)||Tn["Halfwidth and Fullwidth Forms"](i)||Tn.Hiragana(i)||Tn["Ideographic Description Characters"](i)||Tn["Kangxi Radicals"](i)||Tn["Katakana Phonetic Extensions"](i)||Tn.Katakana(i)||Tn["Vertical Forms"](i)||Tn["Yi Radicals"](i)||Tn["Yi Syllables"](i)))&&o.push(Ds(u+1,s,a,o,Os(c,t.getCharCode(u+1)),!1))}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(Ds(t.length(),s,a,o,0,!0))}function Bs(t){var e=.5,n=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":n=1;break;case"top":case"top-right":case"top-left":n=0}return{horizontalAlign:e,verticalAlign:n}}function Fs(t,e,n,r,i){if(i){var o=t[r],a=e[o.fontStack],s=a&&a[o.glyph];if(s)for(var u=s.metrics.advance*o.scale,l=(t[r].x+u)*i,c=n;c<=r;c++)t[c].x-=l}}Cs[10]=!0,Cs[32]=!0,Cs[38]=!0,Cs[40]=!0,Cs[41]=!0,Cs[43]=!0,Cs[45]=!0,Cs[47]=!0,Cs[173]=!0,Cs[183]=!0,Cs[8203]=!0,Cs[8208]=!0,Cs[8211]=!0,Cs[8231]=!0,t.createCommonjsModule=e,t.Point=o,t.window=self,t.browser=k,t.uuid=function(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()},t.validateUuid=function(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)},t.storageAvailable=function(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}},t.warnOnce=x,t.postData=function(t,e,n){var r=z(h(t,{method:"POST"}));return r.onerror=function(){n(new Error(r.statusText))},r.onload=function(){r.status>=200&&r.status<300?n(null,r.response):n(new P(r.statusText,r.status,t.url))},r.send(e),{cancel:function(){return r.abort()}}},t.getJSON=function(t,e){var n=z(t);return n.setRequestHeader("Accept","application/json"),n.onerror=function(){e(new Error(n.statusText))},n.onload=function(){if((n.status>=200&&n.status<300||0===n.status)&&n.response){var r;try{r=JSON.parse(n.response)}catch(t){return e(t)}e(null,r)}else 401===n.status&&t.url.match(/mapbox.com/)?e(new P(n.statusText+": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens",n.status,t.url)):e(new P(n.statusText,n.status,t.url))},n.send(),{cancel:function(){return n.abort()}}},t.getImage=function(t,e){return I(t,(function(t,n){if(t)e(t);else if(n){var r=new self.Image,i=self.URL||self.webkitURL;r.onload=function(){e(null,r),i.revokeObjectURL(r.src)},r.onerror=function(){return e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var o=new self.Blob([new Uint8Array(n.data)],{type:"image/png"});r.cacheControl=n.cacheControl,r.expires=n.expires,r.src=n.data.byteLength?i.createObjectURL(o):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}}))},t.ResourceType=A,t.RGBAImage=Wi,t.potpack=Ba,t.ImagePosition=Fa,t.Texture=Ga,t.getArrayBuffer=I,t.parseGlyphPBF=function(t){return new Ha(t).readFields(hs,[])},t.isChar=Tn,t.asyncAll=function(t,e,n){if(!t.length)return n(null,[]);var r=t.length,i=new Array(t.length),o=null;t.forEach((function(t,a){e(t,(function(t,e){t&&(o=t),i[a]=e,0==--r&&n(o,i)}))}))},t.AlphaImage=Xi,t.styleSpec=B,t.endsWith=m,t.extend=h,t.sphericalToCartesian=function(t){var e=t[0],n=t[1],r=t[2];return n+=90,n*=Math.PI/180,r*=Math.PI/180,{x:e*Math.cos(n)*Math.sin(r),y:e*Math.sin(n)*Math.sin(r),z:e*Math.cos(r)}},t.Evented=R,t.validateStyle=hn,t.validateLight=pn,t.emitValidationErrors=mn,t.Color=ot,t.number=zt,t.Properties=Jn,t.Transitionable=Vn,t.Transitioning=Un,t.PossiblyEvaluated=Gn,t.DataConstantProperty=Xn,t.uniqueId=f,t.Actor=ds,t.pick=function(t,e){for(var n={},r=0;r<e.length;r++){var i=e[r];i in t&&(n[i]=t[i])}return n},t.wrap=function(t,e,n){var r=n-e,i=((t-e)%r+r)%r+e;return i===e?n:i},t.clamp=c,t.Event=O,t.ErrorEvent=D,t.OverscaledTileID=gs,t.EXTENT=ui,t.getCoordinatesCenter=function(t){for(var e=1/0,n=1/0,r=-1/0,o=-1/0,a=0;a<t.length;a++)e=Math.min(e,t[a].column),n=Math.min(n,t[a].row),r=Math.max(r,t[a].column),o=Math.max(o,t[a].row);var s=r-e,u=o-n,l=Math.max(s,u),c=Math.max(0,Math.floor(-Math.log(l)/Math.LN2));return new i((e+r)/2,(n+o)/2,0).zoomTo(c)},t.CanonicalTileID=ys,t.StructArrayLayout4i8=or,t.rasterBoundsAttributes=bs,t.SegmentVector=jr,t.getVideo=function(t,e){var n,r,i=self.document.createElement("video");i.muted=!0,i.onloadstart=function(){e(null,i)};for(var o=0;o<t.length;o++){var a=self.document.createElement("source");n=t[o],r=void 0,(r=self.document.createElement("a")).href=n,(r.protocol!==self.document.location.protocol||r.host!==self.document.location.host)&&(i.crossOrigin="Anonymous"),a.src=t[o],i.appendChild(a)}return{cancel:function(){}}},t.ValidationError=F,t.bindAll=d,t.isEqual=s,t.Tile=As,t.Coordinate=i,t.keysDifference=function(t,e){var n=[];for(var r in t)r in e||n.push(r);return n},t.SourceFeatureState=Ts,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.create=function(){var t=new Mi(16);return Mi!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.invert=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],p=e[10],f=e[11],d=e[12],m=e[13],y=e[14],v=e[15],g=n*s-r*a,_=n*u-i*a,x=n*l-o*a,b=r*u-i*s,w=r*l-o*s,E=i*l-o*u,S=c*m-h*d,T=c*y-p*d,k=c*v-f*d,M=h*y-p*m,A=h*v-f*m,P=p*v-f*y,z=g*P-_*A+x*M+b*k-w*T+E*S;return z?(z=1/z,t[0]=(s*P-u*A+l*M)*z,t[1]=(i*A-r*P-o*M)*z,t[2]=(m*E-y*w+v*b)*z,t[3]=(p*w-h*E-f*b)*z,t[4]=(u*k-a*P-l*T)*z,t[5]=(n*P-i*k+o*T)*z,t[6]=(y*x-d*E-v*_)*z,t[7]=(c*E-p*x+f*_)*z,t[8]=(a*A-s*k+l*S)*z,t[9]=(r*k-n*A-o*S)*z,t[10]=(d*w-m*x+v*g)*z,t[11]=(h*x-c*w-f*g)*z,t[12]=(s*T-a*M-u*S)*z,t[13]=(n*M-r*T+i*S)*z,t[14]=(m*_-d*b-y*g)*z,t[15]=(c*b-h*_+p*g)*z,t):null},t.multiply=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],m=e[12],y=e[13],v=e[14],g=e[15],_=n[0],x=n[1],b=n[2],w=n[3];return t[0]=_*r+x*s+b*h+w*m,t[1]=_*i+x*u+b*p+w*y,t[2]=_*o+x*l+b*f+w*v,t[3]=_*a+x*c+b*d+w*g,_=n[4],x=n[5],b=n[6],w=n[7],t[4]=_*r+x*s+b*h+w*m,t[5]=_*i+x*u+b*p+w*y,t[6]=_*o+x*l+b*f+w*v,t[7]=_*a+x*c+b*d+w*g,_=n[8],x=n[9],b=n[10],w=n[11],t[8]=_*r+x*s+b*h+w*m,t[9]=_*i+x*u+b*p+w*y,t[10]=_*o+x*l+b*f+w*v,t[11]=_*a+x*c+b*d+w*g,_=n[12],x=n[13],b=n[14],w=n[15],t[12]=_*r+x*s+b*h+w*m,t[13]=_*i+x*u+b*p+w*y,t[14]=_*o+x*l+b*f+w*v,t[15]=_*a+x*c+b*d+w*g,t},t.translate=function(t,e,n){var r=n[0],i=n[1],o=n[2],a=void 0,s=void 0,u=void 0,l=void 0,c=void 0,h=void 0,p=void 0,f=void 0,d=void 0,m=void 0,y=void 0,v=void 0;return e===t?(t[12]=e[0]*r+e[4]*i+e[8]*o+e[12],t[13]=e[1]*r+e[5]*i+e[9]*o+e[13],t[14]=e[2]*r+e[6]*i+e[10]*o+e[14],t[15]=e[3]*r+e[7]*i+e[11]*o+e[15]):(a=e[0],s=e[1],u=e[2],l=e[3],c=e[4],h=e[5],p=e[6],f=e[7],d=e[8],m=e[9],y=e[10],v=e[11],t[0]=a,t[1]=s,t[2]=u,t[3]=l,t[4]=c,t[5]=h,t[6]=p,t[7]=f,t[8]=d,t[9]=m,t[10]=y,t[11]=v,t[12]=a*r+c*i+d*o+e[12],t[13]=s*r+h*i+m*o+e[13],t[14]=u*r+p*i+y*o+e[14],t[15]=l*r+f*i+v*o+e[15]),t},t.scale=function(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.rotateX=function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],l=e[8],c=e[9],h=e[10],p=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+l*r,t[5]=a*i+c*r,t[6]=s*i+h*r,t[7]=u*i+p*r,t[8]=l*i-o*r,t[9]=c*i-a*r,t[10]=h*i-s*r,t[11]=p*i-u*r,t},t.rotateZ=function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],l=e[4],c=e[5],h=e[6],p=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+l*r,t[1]=a*i+c*r,t[2]=s*i+h*r,t[3]=u*i+p*r,t[4]=l*i-o*r,t[5]=c*i-a*r,t[6]=h*i-s*r,t[7]=p*i-u*r,t},t.perspective=function(t,e,n,r,i){var o=1/Math.tan(e/2),a=void 0;return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(a=1/(r-i),t[10]=(i+r)*a,t[14]=2*i*r*a):(t[10]=-1,t[14]=-2*r),t},t.ortho=function(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(a+o)*l,t[15]=1,t},t.create$1=Di,t.normalize=Ri,t.transformMat4=Bi,t.forEach=Fi,t.getSizeData=xa,t.evaluateSizeForFeature=function(t,e,n){var r=e;return"source"===t.functionType?n.lowerSize/256:"composite"===t.functionType?zt(n.lowerSize/256,n.upperSize/256,r.uSizeT):r.uSize},t.evaluateSizeForZoom=function(t,e,n){if("constant"===t.functionType)return{uSizeT:0,uSize:t.layoutSize};if("source"===t.functionType)return{uSizeT:0,uSize:0};if("camera"===t.functionType){var r=t.propertyValue,i=t.zoomRange,o=t.sizeRange,a=c(Oe(r,n.specification).interpolationFactor(e,i.min,i.max),0,1);return{uSizeT:0,uSize:o.min+a*(o.max-o.min)}}var s=t.propertyValue,u=t.zoomRange;return{uSizeT:c(Oe(s,n.specification).interpolationFactor(e,u.min,u.max),0,1),uSize:0}},t.SIZE_PACK_FACTOR=256,t.addDynamicAttributes=Sa,t.properties=Pa,t.WritingMode=Ps,t.multiPolygonIntersectsBufferedPoint=fi,t.multiPolygonIntersectsMultiPolygon=di,t.multiPolygonIntersectsBufferedMultiLine=mi,t.polygonIntersectsPolygon=function(t,e){for(var n=0;n<t.length;n++)if(wi(e,t[n]))return!0;for(var r=0;r<e.length;r++)if(wi(t,e[r]))return!0;return!!vi(t,e)},t.distToSegmentSquared=xi,t.SymbolInstanceArray=zr,t.StyleLayer=$n,t.createStyleLayer=function(t){return"custom"===t.type?new Da(t):new Ra[t.type](t)},t.clone=g,t.filterObject=v,t.mapObject=y,t.registerForPluginAvailability=function(t){return Ln?t({pluginURL:Ln,completionCallback:In}):Dn.once("pluginAvailable",t),t},t.evented=Dn,t.ZoomHistory=Sn,t.validateCustomStyleLayer=function(t){var e=[],n=t.id;return void 0===n&&e.push({message:"layers."+n+': missing required property "id"'}),void 0===t.render&&e.push({message:"layers."+n+': missing required method "render"'}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers."+n+': property "renderingMode" must be either "2d" or "3d"'}),e},t.createLayout=nr,t.ProgramConfiguration=ii,t.Uniform1i=Zr,t.Uniform1f=Gr,t.Uniform2f=Xr,t.Uniform4f=Hr,t.Uniform3f=Wr,t.UniformMatrix4f=Jr,t.create$2=Ai,t.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.create$3=Pi,t.length=zi,t.fromValues=Ii,t.normalize$1=function(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t},t.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},t.cross=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t},t.transformMat3=function(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t},t.len=Li,t.forEach$1=Oi,t.UniformColor=Yr,t.StructArrayLayout2i4=ir,t.StructArrayLayout2ui4=br,t.StructArrayLayout3ui6=xr,t.StructArrayLayout1ui2=wr,t.UnwrappedTileID=vs,t.create$4=function(){var t=new Mi(4);return Mi!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.rotate=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u+o*s,t[1]=i*u+a*s,t[2]=r*-s+o*u,t[3]=i*-s+a*u,t},t.ease=l,t.bezier=u,t.EvaluationParameters=Bn,t.setRTLTextPlugin=function(t,e){if(Cn)throw new Error("setRTLTextPlugin cannot be called multiple times.");Cn=!0,Ln=k.resolveURL(t),In=function(t){t?(Cn=!1,Ln=null,e&&e(t)):On=!0},Dn.fire(new O("pluginAvailable",{pluginURL:Ln,completionCallback:In}))},t.values=function(t){var e=[];for(var n in t)e.push(t[n]);return e},t.featureFilter=qe,t.Anchor=_a,t.GLYPH_PBF_BORDER=3,t.shapeText=function(t,e,n,r,i,o,a,s,u,l,c){var h=zs.fromFeature(t,n);c===Ps.vertical&&h.verticalizePunctuation();var p,f=[],d={positionedGlyphs:f,text:h,top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:c},m=Rn.processBidirectionalText,y=Rn.processStyledBidirectionalText;if(m&&1===h.sections.length){p=[];for(var v=0,g=m(h.toString(),Rs(h,s,r,e));v<g.length;v+=1){var _=g[v],x=new zs;x.text=_,x.sections=h.sections;for(var b=0;b<_.length;b++)x.sectionIndex.push(0);p.push(x)}}else if(y){p=[];for(var w=0,E=y(h.text,h.sectionIndex,Rs(h,s,r,e));w<E.length;w+=1){var S=E[w],T=new zs;T.text=S[0],T.sectionIndex=S[1],T.sections=h.sections,p.push(T)}}else p=function(t,e){for(var n=[],r=t.text,i=0,o=0,a=e;o<a.length;o+=1){var s=a[o];n.push(t.substring(i,s)),i=s}return i<r.length&&n.push(t.substring(i,r.length)),n}(h,Rs(h,s,r,e));return function(t,e,n,r,i,o,a,s,u){for(var l=0,c=-17,h=0,p=t.positionedGlyphs,f="right"===o?1:"left"===o?0:.5,d=0,m=n;d<m.length;d+=1){var y=m[d];y.trim();var v=y.getMaxScale();if(y.length()){for(var g=p.length,_=0;_<y.length();_++){var x=y.getSection(_),b=y.getCharCode(_),w=24*(v-x.scale),E=e[x.fontStack],S=E&&E[b];S&&(An(b)&&a!==Ps.horizontal?(p.push({glyph:b,x:l,y:w,vertical:!0,scale:x.scale,fontStack:x.fontStack}),l+=u*x.scale+s):(p.push({glyph:b,x:l,y:c+w,vertical:!1,scale:x.scale,fontStack:x.fontStack}),l+=S.metrics.advance*x.scale+s))}if(p.length!==g){var T=l-s;h=Math.max(T,h),Fs(p,e,g,p.length-1,f)}l=0,c+=r*v}else c+=r}var k=Bs(i),M=k.horizontalAlign,A=k.verticalAlign;!function(t,e,n,r,i,o,a){for(var s=(e-n)*i,u=(-r*a+.5)*o,l=0;l<t.length;l++)t[l].x+=s,t[l].y+=u}(p,f,M,A,h,r,n.length);var P=c- -17;t.top+=-A*P,t.bottom=t.top+P,t.left+=-M*h,t.right=t.left+h}(d,e,p,i,o,a,c,s,l),!!f.length&&(d.text=d.text.toString(),d)},t.shapeIcon=function(t,e,n){var r=Bs(n),i=r.horizontalAlign,o=r.verticalAlign,a=e[0],s=e[1],u=a-t.displaySize[0]*i,l=u+t.displaySize[0],c=s-t.displaySize[1]*o;return{image:t,top:c,bottom:c+t.displaySize[1],left:u,right:l}},t.allowsVerticalWritingMode=kn,t.allowsLetterSpacing=function(t){for(var e=0,n=t;e<n.length;e+=1)if(!Mn(n[e].charCodeAt(0)))return!1;return!0},t.classifyRings=Ao,t.SymbolBucket=Ma,t.register=xn,t.FeatureIndex=ks,t.CollisionBoxArray=kr,t.DictionaryCoder=ws,t.LineBucket=oa,t.FillBucket=Co,t.FillExtrusionBucket=jo,t.ImageAtlas=Va,t.mvt=ta,t.Protobuf=Ha,t.DEMData=xs,t.vectorTile=ta,t.Point$1=o,t.pbf=Ha,t.plugin=Rn})),r(0,(function(t){function e(t){var n=typeof t;if("number"===n||"boolean"===n||"string"===n||null==t)return JSON.stringify(t);if(Array.isArray(t)){for(var r="[",i=0,o=t;i<o.length;i+=1)r+=e(o[i])+",";return r+"]"}for(var a=Object.keys(t).sort(),s="{",u=0;u<a.length;u++)s+=JSON.stringify(a[u])+":"+e(t[a[u]])+",";return s+"}"}function n(n){for(var r="",i=0,o=t.refProperties;i<o.length;i+=1)r+="/"+e(n[o[i]]);return r}var r=function(t){t&&this.replace(t)};function i(t,e,n,r,i){if(void 0===e.segment)return!0;for(var o=e,a=e.segment+1,s=0;s>-n/2;){if(--a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var u=[],l=0;s<n/2;){var c=t[a-1],h=t[a],p=t[a+1];if(!p)return!1;var f=c.angleTo(h)-h.angleTo(p);for(f=Math.abs((f+3*Math.PI)%(2*Math.PI)-Math.PI),u.push({distance:s,angleDelta:f}),l+=f;s-u[0].distance>r;)l-=u.shift().angleDelta;if(l>i)return!1;a++,s+=h.dist(p)}return!0}function o(t){for(var e=0,n=0;n<t.length-1;n++)e+=t[n].dist(t[n+1]);return e}function a(t,e,n){return t?.6*e*n:0}function s(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function u(e,n,r,u,l,c){for(var h=a(r,l,c),p=s(r,u)*c,f=0,d=o(e)/2,m=0;m<e.length-1;m++){var y=e[m],v=e[m+1],g=y.dist(v);if(f+g>d){var _=(d-f)/g,x=t.number(y.x,v.x,_),b=t.number(y.y,v.y,_),w=new t.Anchor(x,b,v.angleTo(y),m);return w._round(),!h||i(e,w,p,h,n)?w:void 0}f+=g}}function l(e,n,r,u,l,c,h,p,f){var d=a(u,c,h),m=s(u,l),y=m*h,v=0===e[0].x||e[0].x===f||0===e[0].y||e[0].y===f;return n-y<n/4&&(n=y+n/4),function e(n,r,a,s,u,l,c,h,p){for(var f=l/2,d=o(n),m=0,y=r-a,v=[],g=0;g<n.length-1;g++){for(var _=n[g],x=n[g+1],b=_.dist(x),w=x.angleTo(_);y+a<m+b;){var E=((y+=a)-m)/b,S=t.number(_.x,x.x,E),T=t.number(_.y,x.y,E);if(S>=0&&S<p&&T>=0&&T<p&&y-f>=0&&y+f<=d){var k=new t.Anchor(S,T,w,g);k._round(),s&&!i(n,k,l,s,u)||v.push(k)}}m+=b}return h||v.length||c||(v=e(n,m/2,a,s,u,l,c,!0,p)),v}(e,v?n/2*p%n:(m/2+2*c)*h*p%n,n,d,r,y,v,!1,f)}r.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},r.prototype.update=function(e,r){for(var i=this,o=0,a=e;o<a.length;o+=1){var s=a[o];i._layerConfigs[s.id]=s;var u=i._layers[s.id]=t.createStyleLayer(s);u._featureFilter=t.featureFilter(u.filter)}for(var l=0,c=r;l<c.length;l+=1){var h=c[l];delete i._layerConfigs[h],delete i._layers[h]}this.familiesBySource={};for(var p=0,f=function(t){for(var e={},r=0;r<t.length;r++){var i=n(t[r]),o=e[i];o||(o=e[i]=[]),o.push(t[r])}var a=[];for(var s in e)a.push(e[s]);return a}(t.values(this._layerConfigs));p<f.length;p+=1){var d=f[p].map((function(t){return i._layers[t.id]})),m=d[0];if("none"!==m.visibility){var y=m.source||"",v=i.familiesBySource[y];v||(v=i.familiesBySource[y]={});var g=m.sourceLayer||"_geojsonTileLayer",_=v[g];_||(_=v[g]=[]),_.push(d)}}};var c=function(e,n,r,i,o,a,s,u,l,c,h,p){var f=s.top*u-l,d=s.bottom*u+l,m=s.left*u-l,y=s.right*u+l;if(this.boxStartIndex=e.length,c){var v=d-f,g=y-m;v>0&&(v=Math.max(10*u,v),this._addLineCollisionCircles(e,n,r,r.segment,g,v,i,o,a,h))}else{if(p){var _=new t.Point(m,f),x=new t.Point(y,f),b=new t.Point(m,d),w=new t.Point(y,d),E=p*Math.PI/180;_._rotate(E),x._rotate(E),b._rotate(E),w._rotate(E),m=Math.min(_.x,x.x,b.x,w.x),y=Math.max(_.x,x.x,b.x,w.x),f=Math.min(_.y,x.y,b.y,w.y),d=Math.max(_.y,x.y,b.y,w.y)}e.emplaceBack(r.x,r.y,m,f,y,d,i,o,a,0,0)}this.boxEndIndex=e.length};c.prototype._addLineCollisionCircles=function(t,e,n,r,i,o,a,s,u,l){var c=o/2,h=Math.floor(i/c)||1,p=1+.4*Math.log(l)/Math.LN2,f=Math.floor(h*p/2),d=-o/2,m=n,y=r+1,v=d,g=-i/2,_=g-i/4;do{if(--y<0){if(v>g)return;y=0;break}v-=e[y].dist(m),m=e[y]}while(v>_);for(var x=e[y].dist(e[y+1]),b=-f;b<h+f;b++){var w=b*c,E=g+w;if(w<0&&(E+=w),w>i&&(E+=w-i),!(E<v)){for(;v+x<E;){if(v+=x,++y+1>=e.length)return;x=e[y].dist(e[y+1])}var S=E-v,T=e[y],k=e[y+1].sub(T)._unit()._mult(S)._add(T)._round(),M=Math.abs(E-d)<c?0:.8*(E-d);t.emplaceBack(k.x,k.y,-o/2,-o/2,o/2,o/2,a,s,u,o/2,M)}}};var h=f,p=f;function f(t,e){if(!(this instanceof f))return new f(t,e);if(this.data=t||[],this.length=this.data.length,this.compare=e||d,this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)}function d(t,e){return t<e?-1:t>e?1:0}function m(e,n,r){void 0===n&&(n=1),void 0===r&&(r=!1);for(var i=1/0,o=1/0,a=-1/0,s=-1/0,u=e[0],l=0;l<u.length;l++){var c=u[l];(!l||c.x<i)&&(i=c.x),(!l||c.y<o)&&(o=c.y),(!l||c.x>a)&&(a=c.x),(!l||c.y>s)&&(s=c.y)}var p=a-i,f=s-o,d=Math.min(p,f),m=d/2,g=new h(null,y);if(0===d)return new t.Point(i,o);for(var _=i;_<a;_+=d)for(var x=o;x<s;x+=d)g.push(new v(_+m,x+m,m,e));for(var b=function(t){for(var e=0,n=0,r=0,i=t[0],o=0,a=i.length,s=a-1;o<a;s=o++){var u=i[o],l=i[s],c=u.x*l.y-l.x*u.y;n+=(u.x+l.x)*c,r+=(u.y+l.y)*c,e+=3*c}return new v(n/e,r/e,0,t)}(e),w=g.length;g.length;){var E=g.pop();(E.d>b.d||!b.d)&&(b=E,r&&console.log("found best %d after %d probes",Math.round(1e4*E.d)/1e4,w)),E.max-b.d<=n||(m=E.h/2,g.push(new v(E.p.x-m,E.p.y-m,m,e)),g.push(new v(E.p.x+m,E.p.y-m,m,e)),g.push(new v(E.p.x-m,E.p.y+m,m,e)),g.push(new v(E.p.x+m,E.p.y+m,m,e)),w+=4)}return r&&(console.log("num probes: "+w),console.log("best distance: "+b.d)),b.p}function y(t,e){return e.max-t.max}function v(e,n,r,i){this.p=new t.Point(e,n),this.h=r,this.d=function(e,n){for(var r=!1,i=1/0,o=0;o<n.length;o++)for(var a=n[o],s=0,u=a.length,l=u-1;s<u;l=s++){var c=a[s],h=a[l];c.y>e.y!=h.y>e.y&&e.x<(h.x-c.x)*(e.y-c.y)/(h.y-c.y)+c.x&&(r=!r),i=Math.min(i,t.distToSegmentSquared(e,c,h))}return(r?1:-1)*Math.sqrt(i)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}f.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var t=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},peek:function(){return this.data[0]},_up:function(t){for(var e=this.data,n=this.compare,r=e[t];t>0;){var i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r},_down:function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t<r;){var o=1+(t<<1),a=o+1,s=e[o];if(a<this.length&&n(e[a],s)<0&&(o=a,s=e[a]),n(s,i)>=0)break;e[t]=s,t=o}e[t]=i}},h.default=p;var g=t.createCommonjsModule((function(t){t.exports=function(t,e){var n,r,i,o,a,s,u,l;for(n=3&t.length,r=t.length-n,i=e,a=3432918353,s=461845907,l=0;l<r;)u=255&t.charCodeAt(l)|(255&t.charCodeAt(++l))<<8|(255&t.charCodeAt(++l))<<16|(255&t.charCodeAt(++l))<<24,++l,i=27492+(65535&(o=5*(65535&(i=(i^=u=(65535&(u=(u=(65535&u)*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(u=0,n){case 3:u^=(255&t.charCodeAt(l+2))<<16;case 2:u^=(255&t.charCodeAt(l+1))<<8;case 1:i^=u=(65535&(u=(u=(65535&(u^=255&t.charCodeAt(l)))*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}})),_=g,x=g,b=t.createCommonjsModule((function(t){t.exports=function(t,e){for(var n,r=t.length,i=e^r,o=0;r>=4;)n=1540483477*(65535&(n=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(n>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(n=1540483477*(65535&(n^=n>>>24))+((1540483477*(n>>>16)&65535)<<16)),r-=4,++o;switch(r){case 3:i^=(255&t.charCodeAt(o+2))<<16;case 2:i^=(255&t.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}}));function w(e,n,r,i,o,a){e.createArrays();var s=512*e.overscaling;e.tilePixelRatio=t.EXTENT/s,e.compareText={},e.iconsNeedLinear=!1;var u=e.layers[0].layout,l=e.layers[0]._unevaluatedLayout._values,c={};if("composite"===e.textSizeData.functionType){var h=e.textSizeData.zoomRange,p=h.min,f=h.max;c.compositeTextSizes=[l["text-size"].possiblyEvaluate(new t.EvaluationParameters(p)),l["text-size"].possiblyEvaluate(new t.EvaluationParameters(f))]}if("composite"===e.iconSizeData.functionType){var d=e.iconSizeData.zoomRange,m=d.min,y=d.max;c.compositeIconSizes=[l["icon-size"].possiblyEvaluate(new t.EvaluationParameters(m)),l["icon-size"].possiblyEvaluate(new t.EvaluationParameters(y))]}c.layoutTextSize=l["text-size"].possiblyEvaluate(new t.EvaluationParameters(e.zoom+1)),c.layoutIconSize=l["icon-size"].possiblyEvaluate(new t.EvaluationParameters(e.zoom+1)),c.textMaxSize=l["text-size"].possiblyEvaluate(new t.EvaluationParameters(18));for(var v=24*u.get("text-line-height"),g="map"===u.get("text-rotation-alignment")&&"point"!==u.get("symbol-placement"),_=u.get("text-keep-upright"),x=0,b=e.features;x<b.length;x+=1){var w=b[x],S=u.get("text-font").evaluate(w,{}).join(","),T=r,k={},M=w.text;if(M){var A=M.toString(),P=u.get("text-offset").evaluate(w,{}).map((function(t){return 24*t})),z=24*u.get("text-letter-spacing").evaluate(w,{}),I=t.allowsLetterSpacing(A)?z:0,C=u.get("text-anchor").evaluate(w,{}),L=u.get("text-justify").evaluate(w,{}),O="point"===u.get("symbol-placement")?24*u.get("text-max-width").evaluate(w,{}):0;k.horizontal=t.shapeText(M,n,S,O,v,C,L,I,P,24,t.WritingMode.horizontal),t.allowsVerticalWritingMode(A)&&g&&_&&(k.vertical=t.shapeText(M,n,S,O,v,C,L,I,P,24,t.WritingMode.vertical))}var D=void 0;if(w.icon){var R=i[w.icon];R&&(D=t.shapeIcon(o[w.icon],u.get("icon-offset").evaluate(w,{}),u.get("icon-anchor").evaluate(w,{})),void 0===e.sdfIcons?e.sdfIcons=R.sdf:e.sdfIcons!==R.sdf&&t.warnOnce("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),R.pixelRatio!==e.pixelRatio?e.iconsNeedLinear=!0:0!==u.get("icon-rotate").constantOr(1)&&(e.iconsNeedLinear=!0))}(k.horizontal||D)&&E(e,w,k,D,T,c)}a&&e.generateCollisionDebugBuffers()}function E(e,n,r,i,o,a){var s=a.layoutTextSize.evaluate(n,{}),h=a.layoutIconSize.evaluate(n,{}),p=a.textMaxSize.evaluate(n,{});void 0===p&&(p=s);var f=e.layers[0].layout,d=f.get("text-offset").evaluate(n,{}),y=f.get("icon-offset").evaluate(n,{}),v=s/24,g=e.tilePixelRatio*v,x=e.tilePixelRatio*p/24,b=e.tilePixelRatio*h,w=e.tilePixelRatio*f.get("symbol-spacing"),E=f.get("text-padding")*e.tilePixelRatio,M=f.get("icon-padding")*e.tilePixelRatio,A=f.get("text-max-angle")/180*Math.PI,P="map"===f.get("text-rotation-alignment")&&"point"!==f.get("symbol-placement"),z="map"===f.get("icon-rotation-alignment")&&"point"!==f.get("symbol-placement"),I=f.get("symbol-placement"),C=w/2,L=function(s,u){u.x<0||u.x>=t.EXTENT||u.y<0||u.y>=t.EXTENT||function(e,n,r,i,o,a,s,u,l,h,p,f,d,m,y,v,g,x,b,w,E){var k,M,A=e.addToLineVertexArray(n,r),P=0,z=0,I=0,C=_(i.horizontal?i.horizontal.text:""),L=[];if(i.horizontal){var O=a.layout.get("text-rotate").evaluate(b,{});k=new c(s,r,n,u,l,h,i.horizontal,p,f,d,e.overscaling,O),z+=T(e,n,i.horizontal,a,d,b,m,A,i.vertical?t.WritingMode.horizontal:t.WritingMode.horizontalOnly,L,w,E),i.vertical&&(I+=T(e,n,i.vertical,a,d,b,m,A,t.WritingMode.vertical,L,w,E))}var D=k?k.boxStartIndex:e.collisionBoxArray.length,R=k?k.boxEndIndex:e.collisionBoxArray.length;if(o){var B=function(e,n,r,i,o,a){var s,u,l,c,h=n.image,p=r.layout,f=n.top-1/h.pixelRatio,d=n.left-1/h.pixelRatio,m=n.bottom+1/h.pixelRatio,y=n.right+1/h.pixelRatio;if("none"!==p.get("icon-text-fit")&&o){var v=y-d,g=m-f,_=p.get("text-size").evaluate(a,{})/24,x=o.left*_,b=o.right*_,w=o.top*_,E=b-x,S=o.bottom*_-w,T=p.get("icon-text-fit-padding")[0],k=p.get("icon-text-fit-padding")[1],M=p.get("icon-text-fit-padding")[2],A=p.get("icon-text-fit-padding")[3],P="width"===p.get("icon-text-fit")?.5*(S-g):0,z="height"===p.get("icon-text-fit")?.5*(E-v):0,I="width"===p.get("icon-text-fit")||"both"===p.get("icon-text-fit")?E:v,C="height"===p.get("icon-text-fit")||"both"===p.get("icon-text-fit")?S:g;s=new t.Point(x+z-A,w+P-T),u=new t.Point(x+z+k+I,w+P-T),l=new t.Point(x+z+k+I,w+P+M+C),c=new t.Point(x+z-A,w+P+M+C)}else s=new t.Point(d,f),u=new t.Point(y,f),l=new t.Point(y,m),c=new t.Point(d,m);var L=r.layout.get("icon-rotate").evaluate(a,{})*Math.PI/180;if(L){var O=Math.sin(L),D=Math.cos(L),R=[D,-O,O,D];s._matMult(R),u._matMult(R),c._matMult(R),l._matMult(R)}return[{tl:s,tr:u,bl:c,br:l,tex:h.paddedRect,writingMode:void 0,glyphOffset:[0,0]}]}(0,o,a,0,i.horizontal,b),F=a.layout.get("icon-rotate").evaluate(b,{});M=new c(s,r,n,u,l,h,o,y,v,!1,e.overscaling,F),P=4*B.length;var j=e.iconSizeData,V=null;"source"===j.functionType?(V=[t.SIZE_PACK_FACTOR*a.layout.get("icon-size").evaluate(b,{})])[0]>S&&t.warnOnce(e.layerIds[0]+': Value for "icon-size" is >= 256. Reduce your "icon-size".'):"composite"===j.functionType&&((V=[t.SIZE_PACK_FACTOR*E.compositeIconSizes[0].evaluate(b,{}),t.SIZE_PACK_FACTOR*E.compositeIconSizes[1].evaluate(b,{})])[0]>S||V[1]>S)&&t.warnOnce(e.layerIds[0]+': Value for "icon-size" is >= 256. Reduce your "icon-size".'),e.addSymbols(e.icon,B,V,x,g,b,!1,n,A.lineStartIndex,A.lineLength)}var N=M?M.boxStartIndex:e.collisionBoxArray.length,U=M?M.boxEndIndex:e.collisionBoxArray.length;e.glyphOffsetArray.length>=t.SymbolBucket.MAX_GLYPHS&&t.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),e.symbolInstances.emplaceBack(n.x,n.y,L.length>0?L[0]:-1,L.length>1?L[1]:-1,C,D,R,N,U,u,z,I,P,0)}(e,u,s,r,i,e.layers[0],e.collisionBoxArray,n.index,n.sourceLayerIndex,e.index,g,E,P,d,b,M,z,y,n,o,a)};if("line"===I)for(var O=0,D=function(e,n,r,i,o){for(var a=[],s=0;s<e.length;s++)for(var u=e[s],l=void 0,c=0;c<u.length-1;c++){var h=u[c],p=u[c+1];h.x<0&&p.x<0||(h.x<0?h=new t.Point(0,h.y+(p.y-h.y)*((0-h.x)/(p.x-h.x)))._round():p.x<0&&(p=new t.Point(0,h.y+(p.y-h.y)*((0-h.x)/(p.x-h.x)))._round()),h.y<0&&p.y<0||(h.y<0?h=new t.Point(h.x+(p.x-h.x)*((0-h.y)/(p.y-h.y)),0)._round():p.y<0&&(p=new t.Point(h.x+(p.x-h.x)*((0-h.y)/(p.y-h.y)),0)._round()),h.x>=i&&p.x>=i||(h.x>=i?h=new t.Point(i,h.y+(p.y-h.y)*((i-h.x)/(p.x-h.x)))._round():p.x>=i&&(p=new t.Point(i,h.y+(p.y-h.y)*((i-h.x)/(p.x-h.x)))._round()),h.y>=o&&p.y>=o||(h.y>=o?h=new t.Point(h.x+(p.x-h.x)*((o-h.y)/(p.y-h.y)),o)._round():p.y>=o&&(p=new t.Point(h.x+(p.x-h.x)*((o-h.y)/(p.y-h.y)),o)._round()),l&&h.equals(l[l.length-1])||(l=[h],a.push(l)),l.push(p)))))}return a}(n.geometry,0,0,t.EXTENT,t.EXTENT);O<D.length;O+=1)for(var R=D[O],B=0,F=l(R,w,A,r.vertical||r.horizontal,i,24,x,e.overscaling,t.EXTENT);B<F.length;B+=1){var j=F[B],V=r.horizontal;V&&k(e,V.text,C,j)||L(R,j)}else if("line-center"===I)for(var N=0,U=n.geometry;N<U.length;N+=1){var q=U[N];if(q.length>1){var Z=u(q,A,r.vertical||r.horizontal,i,24,x);Z&&L(q,Z)}}else if("Polygon"===n.type)for(var G=0,X=t.classifyRings(n.geometry,0);G<X.length;G+=1){var W=X[G],H=m(W,16);L(W[0],new t.Anchor(H.x,H.y,0))}else if("LineString"===n.type)for(var Y=0,K=n.geometry;Y<K.length;Y+=1){var J=K[Y];L(J,new t.Anchor(J[0].x,J[0].y,0))}else if("Point"===n.type)for(var $=0,Q=n.geometry;$<Q.length;$+=1)for(var tt=0,et=Q[$];tt<et.length;tt+=1){var nt=et[tt];L([nt],new t.Anchor(nt.x,nt.y,0))}}_.murmur3=x,_.murmur2=b;var S=65535;function T(e,n,r,i,o,a,s,u,l,c,h,p){var f=function(e,n,r,i,o,a){for(var s=r.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=r.layout.get("text-offset").evaluate(o,{}).map((function(t){return 24*t})),l=n.positionedGlyphs,c=[],h=0;h<l.length;h++){var p=l[h],f=a[p.fontStack],d=f&&f[p.glyph];if(d){var m=d.rect;if(m){var y=t.GLYPH_PBF_BORDER+1,v=d.metrics.advance*p.scale/2,g=i?[p.x+v,p.y]:[0,0],_=i?[0,0]:[p.x+v+u[0],p.y+u[1]],x=(d.metrics.left-y)*p.scale-v+_[0],b=(-d.metrics.top-y)*p.scale+_[1],w=x+m.w*p.scale,E=b+m.h*p.scale,S=new t.Point(x,b),T=new t.Point(w,b),k=new t.Point(x,E),M=new t.Point(w,E);if(i&&p.vertical){var A=new t.Point(-v,v),P=-Math.PI/2,z=new t.Point(5,0);S._rotateAround(P,A)._add(z),T._rotateAround(P,A)._add(z),k._rotateAround(P,A)._add(z),M._rotateAround(P,A)._add(z)}if(s){var I=Math.sin(s),C=Math.cos(s),L=[C,-I,I,C];S._matMult(L),T._matMult(L),k._matMult(L),M._matMult(L)}c.push({tl:S,tr:T,bl:k,br:M,tex:m,writingMode:n.writingMode,glyphOffset:g})}}}return c}(0,r,i,o,a,h),d=e.textSizeData,m=null;return"source"===d.functionType?(m=[t.SIZE_PACK_FACTOR*i.layout.get("text-size").evaluate(a,{})])[0]>S&&t.warnOnce(e.layerIds[0]+': Value for "text-size" is >= 256. Reduce your "text-size".'):"composite"===d.functionType&&((m=[t.SIZE_PACK_FACTOR*p.compositeTextSizes[0].evaluate(a,{}),t.SIZE_PACK_FACTOR*p.compositeTextSizes[1].evaluate(a,{})])[0]>S||m[1]>S)&&t.warnOnce(e.layerIds[0]+': Value for "text-size" is >= 256. Reduce your "text-size".'),e.addSymbols(e.text,f,m,s,o,a,l,n,u.lineStartIndex,u.lineLength),c.push(e.text.placedSymbolArray.length-1),4*f.length}function k(t,e,n,r){var i=t.compareText;if(e in i){for(var o=i[e],a=o.length-1;a>=0;a--)if(r.dist(o[a])<n)return!0}else i[e]=[];return i[e].push(r),!1}var M=function(e){var n={},r=[];for(var i in e){var o=e[i],a=n[i]={};for(var s in o){var u=o[+s];if(u&&0!==u.bitmap.width&&0!==u.bitmap.height){var l={x:0,y:0,w:u.bitmap.width+2,h:u.bitmap.height+2};r.push(l),a[s]={rect:l,metrics:u.metrics}}}}var c=t.potpack(r),h=c.w,p=c.h,f=new t.AlphaImage({width:h||1,height:p||1});for(var d in e){var m=e[d];for(var y in m){var v=m[+y];if(v&&0!==v.bitmap.width&&0!==v.bitmap.height){var g=n[d][y].rect;t.AlphaImage.copy(v.bitmap,f,{x:0,y:0},{x:g.x+1,y:g.y+1},v.bitmap)}}}this.image=f,this.positions=n};t.register("GlyphAtlas",M);var A=function(e){this.tileID=new t.OverscaledTileID(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming};function P(e,n){for(var r=new t.EvaluationParameters(n),i=0,o=e;i<o.length;i+=1)o[i].recalculate(r)}A.prototype.parse=function(e,n,r,i){var o=this;this.status="parsing",this.data=e,this.collisionBoxArray=new t.CollisionBoxArray;var a=new t.DictionaryCoder(Object.keys(e.layers).sort()),s=new t.FeatureIndex(this.tileID);s.bucketLayerIDs=[];var u,l,c,h,p={},f={featureIndex:s,iconDependencies:{},patternDependencies:{},glyphDependencies:{}},d=n.familiesBySource[this.source];for(var m in d){var y=e.layers[m];if(y){1===y.version&&t.warnOnce('Vector tile source "'+o.source+'" layer "'+m+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var v=a.encode(m),g=[],_=0;_<y.length;_++){var x=y.feature(_);g.push({feature:x,index:_,sourceLayerIndex:v})}for(var b=0,E=d[m];b<E.length;b+=1){var S=E[b],T=S[0];T.minzoom&&o.zoom<Math.floor(T.minzoom)||T.maxzoom&&o.zoom>=T.maxzoom||"none"!==T.visibility&&(P(S,o.zoom),(p[T.id]=T.createBucket({index:s.bucketLayerIDs.length,layers:S,zoom:o.zoom,pixelRatio:o.pixelRatio,overscaling:o.overscaling,collisionBoxArray:o.collisionBoxArray,sourceLayerIndex:v,sourceID:o.source})).populate(g,f),s.bucketLayerIDs.push(S.map((function(t){return t.id}))))}}}var k=t.mapObject(f.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(k).length?r.send("getGlyphs",{uid:this.uid,stacks:k},(function(t,e){u||(u=t,l=e,I.call(o))})):l={};var A=Object.keys(f.iconDependencies);A.length?r.send("getImages",{icons:A},(function(t,e){u||(u=t,c=e,I.call(o))})):c={};var z=Object.keys(f.patternDependencies);function I(){if(u)return i(u);if(l&&c&&h){var e=new M(l),n=new t.ImageAtlas(c,h);for(var r in p){var o=p[r];o instanceof t.SymbolBucket?(P(o.layers,this.zoom),w(o,l,e.positions,c,n.iconPositions,this.showCollisionBoxes)):o.hasPattern&&(o instanceof t.LineBucket||o instanceof t.FillBucket||o instanceof t.FillExtrusionBucket)&&(P(o.layers,this.zoom),o.addFeatures(f,n.patternPositions))}this.status="done",i(null,{buckets:t.values(p).filter((function(t){return!t.isEmpty()})),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:n})}}z.length?r.send("getImages",{icons:z},(function(t,e){u||(u=t,h=e,I.call(o))})):h={},I.call(this)};var z="undefined"!=typeof performance,I={getEntriesByName:function(t){return!!(z&&performance&&performance.getEntriesByName)&&performance.getEntriesByName(t)},mark:function(t){return!!(z&&performance&&performance.mark)&&performance.mark(t)},measure:function(t,e,n){return!!(z&&performance&&performance.measure)&&performance.measure(t,e,n)},clearMarks:function(t){return!!(z&&performance&&performance.clearMarks)&&performance.clearMarks(t)},clearMeasures:function(t){return!!(z&&performance&&performance.clearMeasures)&&performance.clearMeasures(t)}},C=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},I.mark(this._marks.start)};function L(e,n){var r=t.getArrayBuffer(e.request,(function(e,r){e?n(e):r&&n(null,{vectorTile:new t.mvt.VectorTile(new t.Protobuf(r.data)),rawData:r.data,cacheControl:r.cacheControl,expires:r.expires})}));return function(){r.cancel(),n()}}C.prototype.finish=function(){I.mark(this._marks.end);var t=I.getEntriesByName(this._marks.measure);return 0===t.length&&(I.measure(this._marks.measure,this._marks.start,this._marks.end),t=I.getEntriesByName(this._marks.measure),I.clearMarks(this._marks.start),I.clearMarks(this._marks.end),I.clearMeasures(this._marks.measure)),t},I.Performance=C;var O=function(t,e,n){this.actor=t,this.layerIndex=e,this.loadVectorData=n||L,this.loading={},this.loaded={}};O.prototype.loadTile=function(e,n){var r=this,i=e.uid;this.loading||(this.loading={});var o=!!(e&&e.request&&e.request.collectResourceTiming)&&new I.Performance(e.request),a=this.loading[i]=new A(e);a.abort=this.loadVectorData(e,(function(e,s){if(delete r.loading[i],e||!s)return a.status="done",r.loaded[i]=a,n(e);var u=s.rawData,l={};s.expires&&(l.expires=s.expires),s.cacheControl&&(l.cacheControl=s.cacheControl);var c={};if(o){var h=o.finish();h&&(c.resourceTiming=JSON.parse(JSON.stringify(h)))}a.vectorTile=s.vectorTile,a.parse(s.vectorTile,r.layerIndex,r.actor,(function(e,r){if(e||!r)return n(e);n(null,t.extend({rawTileData:u.slice(0)},r,l,c))})),r.loaded=r.loaded||{},r.loaded[i]=a}))},O.prototype.reloadTile=function(t,e){var n=this.loaded,r=t.uid,i=this;if(n&&n[r]){var o=n[r];o.showCollisionBoxes=t.showCollisionBoxes;var a=function(t,n){var r=o.reloadCallback;r&&(delete o.reloadCallback,o.parse(o.vectorTile,i.layerIndex,i.actor,r)),e(t,n)};"parsing"===o.status?o.reloadCallback=a:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.actor,a):a())}},O.prototype.abortTile=function(t,e){var n=this.loading,r=t.uid;n&&n[r]&&n[r].abort&&(n[r].abort(),delete n[r]),e()},O.prototype.removeTile=function(t,e){var n=this.loaded,r=t.uid;n&&n[r]&&delete n[r],e()};var D=function(){this.loaded={}};D.prototype.loadTile=function(e,n){var r=e.uid,i=e.encoding,o=e.rawImageData,a=new t.DEMData(r,o,i);this.loaded=this.loaded||{},this.loaded[r]=a,n(null,a)},D.prototype.removeTile=function(t){var e=this.loaded,n=t.uid;e&&e[n]&&delete e[n]};var R=6378137;function B(t){var e=0;if(t&&t.length>0){e+=Math.abs(F(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(F(t[n]))}return e}function F(t){var e,n,r,i,o,a,s=0,u=t.length;if(u>2){for(a=0;a<u;a++)a===u-2?(r=u-2,i=u-1,o=0):a===u-1?(r=u-1,i=0,o=1):(r=a,i=a+1,o=a+2),e=t[r],n=t[i],s+=(j(t[o][0])-j(e[0]))*Math.sin(j(n[1]));s=s*R*R/2}return s}function j(t){return t*Math.PI/180}var V={geometry:function t(e){var n,r=0;switch(e.type){case"Polygon":return B(e.coordinates);case"MultiPolygon":for(n=0;n<e.coordinates.length;n++)r+=B(e.coordinates[n]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(n=0;n<e.geometries.length;n++)r+=t(e.geometries[n]);return r}},ring:F};function N(t,e){return function(n){return t(n,e)}}function U(t,e){e=!!e,t[0]=q(t[0],e);for(var n=1;n<t.length;n++)t[n]=q(t[n],!e);return t}function q(t,e){return function(t){return V.ring(t)>=0}(t)===e?t:t.reverse()}var Z=t.mvt.VectorTileFeature.prototype.toGeoJSON,G=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};G.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],n=0,r=this._feature.geometry;n<r.length;n+=1){var i=r[n];e.push([new t.Point(i[0],i[1])])}return e}for(var o=[],a=0,s=this._feature.geometry;a<s.length;a+=1){for(var u=[],l=0,c=s[a];l<c.length;l+=1){var h=c[l];u.push(new t.Point(h[0],h[1]))}o.push(u)}return o},G.prototype.toGeoJSON=function(t,e,n){return Z.call(this,t,e,n)};var X=function(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=e.length,this._features=e};X.prototype.feature=function(t){return new G(this._features[t])};var W=t.vectorTile.VectorTileFeature,H=Y;function Y(t,e){this.options=e||{},this.features=t,this.length=t.length}function K(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}Y.prototype.feature=function(t){return new K(this.features[t],this.options.extent)},K.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var n=0;n<e.length;n++){for(var r=e[n],i=[],o=0;o<r.length;o++)i.push(new t.Point$1(r[o][0],r[o][1]));this.geometry.push(i)}return this.geometry},K.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,n=-1/0,r=1/0,i=-1/0,o=0;o<t.length;o++)for(var a=t[o],s=0;s<a.length;s++){var u=a[s];e=Math.min(e,u.x),n=Math.max(n,u.x),r=Math.min(r,u.y),i=Math.max(i,u.y)}return[e,r,n,i]},K.prototype.toGeoJSON=W.prototype.toGeoJSON;var J=tt,$=tt,Q=H;function tt(e){var n=new t.pbf;return function(t,e){for(var n in t.layers)e.writeMessage(3,et,t.layers[n])}(e,n),n.finish()}function et(t,e){var n;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var r={keys:[],values:[],keycache:{},valuecache:{}};for(n=0;n<t.length;n++)r.feature=t.feature(n),e.writeMessage(2,nt,r);var i=r.keys;for(n=0;n<i.length;n++)e.writeStringField(3,i[n]);var o=r.values;for(n=0;n<o.length;n++)e.writeMessage(4,st,o[n])}function nt(t,e){var n=t.feature;void 0!==n.id&&e.writeVarintField(1,n.id),e.writeMessage(2,rt,t),e.writeVarintField(3,n.type),e.writeMessage(4,at,n)}function rt(t,e){var n=t.feature,r=t.keys,i=t.values,o=t.keycache,a=t.valuecache;for(var s in n.properties){var u=o[s];void 0===u&&(r.push(s),u=r.length-1,o[s]=u),e.writeVarint(u);var l=n.properties[s],c=typeof l;"string"!==c&&"boolean"!==c&&"number"!==c&&(l=JSON.stringify(l));var h=c+":"+l,p=a[h];void 0===p&&(i.push(l),p=i.length-1,a[h]=p),e.writeVarint(p)}}function it(t,e){return(e<<3)+(7&t)}function ot(t){return t<<1^t>>31}function at(t,e){for(var n=t.loadGeometry(),r=t.type,i=0,o=0,a=n.length,s=0;s<a;s++){var u=n[s],l=1;1===r&&(l=u.length),e.writeVarint(it(1,l));for(var c=3===r?u.length-1:u.length,h=0;h<c;h++){1===h&&1!==r&&e.writeVarint(it(2,c-1));var p=u[h].x-i,f=u[h].y-o;e.writeVarint(ot(p)),e.writeVarint(ot(f)),i+=p,o+=f}3===r&&e.writeVarint(it(7,1))}}function st(t,e){var n=typeof t;"string"===n?e.writeStringField(1,t):"boolean"===n?e.writeBooleanField(7,t):"number"===n&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}function ut(t,e,n,r){lt(t,n,r),lt(e,2*n,2*r),lt(e,2*n+1,2*r+1)}function lt(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function ct(t,e,n,r){var i=t-n,o=e-r;return i*i+o*o}function ht(t,e,n,r,i){return new pt(t,e,n,r,i)}function pt(t,e,n,r,i){e=e||ft,n=n||dt,i=i||Array,this.nodeSize=r||64,this.points=t,this.ids=new i(t.length),this.coords=new i(2*t.length);for(var o=0;o<t.length;o++)this.ids[o]=o,this.coords[2*o]=e(t[o]),this.coords[2*o+1]=n(t[o]);!function t(e,n,r,i,o,a){if(!(o-i<=r)){var s=Math.floor((i+o)/2);!function t(e,n,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=r-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(u-s/2<0?-1:1);t(e,n,r,Math.max(i,Math.floor(r-u*c/s+h)),Math.min(o,Math.floor(r+(s-u)*c/s+h)),a)}var p=n[2*r+a],f=i,d=o;for(ut(e,n,i,r),n[2*o+a]>p&&ut(e,n,i,o);f<d;){for(ut(e,n,f,d),f++,d--;n[2*f+a]<p;)f++;for(;n[2*d+a]>p;)d--}n[2*i+a]===p?ut(e,n,i,d):ut(e,n,++d,o),d<=r&&(i=d+1),r<=d&&(o=d-1)}}(e,n,s,i,o,a%2),t(e,n,r,i,s-1,a+1),t(e,n,r,s+1,o,a+1)}}(this.ids,this.coords,this.nodeSize,0,this.ids.length-1,0)}function ft(t){return t[0]}function dt(t){return t[1]}function mt(t){this.options=bt(Object.create(this.options),t),this.trees=new Array(this.options.maxZoom+1)}function yt(t,e,n,r,i){return{x:t,y:e,zoom:1/0,id:n,parentId:-1,numPoints:r,properties:i}}function vt(t){return{type:"Feature",id:t.id,properties:gt(t),geometry:{type:"Point",coordinates:[(r=t.x,360*(r-.5)),(e=t.y,n=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(n))/Math.PI-90)]}};var e,n,r}function gt(t){var e=t.numPoints,n=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return bt(bt({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:n})}function _t(t){return t/360+.5}function xt(t){var e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function bt(t,e){for(var n in e)t[n]=e[n];return t}function wt(t){return t.x}function Et(t){return t.y}function St(t,e,n,r,i,o){var a=i-n,s=o-r;if(0!==a||0!==s){var u=((t-n)*a+(e-r)*s)/(a*a+s*s);u>1?(n=i,r=o):u>0&&(n+=a*u,r+=s*u)}return(a=t-n)*a+(s=e-r)*s}function Tt(t,e,n,r){var i={id:void 0===t?null:t,type:e,geometry:n,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,n=t.type;if("Point"===n||"MultiPoint"===n||"LineString"===n)kt(t,e);else if("Polygon"===n||"MultiLineString"===n)for(var r=0;r<e.length;r++)kt(t,e[r]);else if("MultiPolygon"===n)for(r=0;r<e.length;r++)for(var i=0;i<e[r].length;i++)kt(t,e[r][i])}(i),i}function kt(t,e){for(var n=0;n<e.length;n+=3)t.minX=Math.min(t.minX,e[n]),t.minY=Math.min(t.minY,e[n+1]),t.maxX=Math.max(t.maxX,e[n]),t.maxY=Math.max(t.maxY,e[n+1])}function Mt(t,e,n,r){if(e.geometry){var i=e.geometry.coordinates,o=e.geometry.type,a=Math.pow(n.tolerance/((1<<n.maxZoom)*n.extent),2),s=[],u=e.id;if(n.promoteId?u=e.properties[n.promoteId]:n.generateId&&(u=r||0),"Point"===o)At(i,s);else if("MultiPoint"===o)for(var l=0;l<i.length;l++)At(i[l],s);else if("LineString"===o)Pt(i,s,a,!1);else if("MultiLineString"===o){if(n.lineMetrics){for(l=0;l<i.length;l++)s=[],Pt(i[l],s,a,!1),t.push(Tt(u,"LineString",s,e.properties));return}zt(i,s,a,!1)}else if("Polygon"===o)zt(i,s,a,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(l=0;l<e.geometry.geometries.length;l++)Mt(t,{id:u,geometry:e.geometry.geometries[l],properties:e.properties},n,r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(l=0;l<i.length;l++){var c=[];zt(i[l],c,a,!0),s.push(c)}}t.push(Tt(u,o,s,e.properties))}}function At(t,e){e.push(It(t[0])),e.push(Ct(t[1])),e.push(0)}function Pt(t,e,n,r){for(var i,o,a=0,s=0;s<t.length;s++){var u=It(t[s][0]),l=Ct(t[s][1]);e.push(u),e.push(l),e.push(0),s>0&&(a+=r?(i*l-u*o)/2:Math.sqrt(Math.pow(u-i,2)+Math.pow(l-o,2))),i=u,o=l}var c=e.length-3;e[2]=1,function t(e,n,r,i){for(var o,a=i,s=r-n>>1,u=r-n,l=e[n],c=e[n+1],h=e[r],p=e[r+1],f=n+3;f<r;f+=3){var d=St(e[f],e[f+1],l,c,h,p);if(d>a)o=f,a=d;else if(d===a){var m=Math.abs(f-s);m<u&&(o=f,u=m)}}a>i&&(o-n>3&&t(e,n,o,i),e[o+2]=a,r-o>3&&t(e,o,r,i))}(e,0,c,n),e[c+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function zt(t,e,n,r){for(var i=0;i<t.length;i++){var o=[];Pt(t[i],o,n,r),e.push(o)}}function It(t){return t/360+.5}function Ct(t){var e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function Lt(t,e,n,r,i,o,a,s){if(r/=e,o>=(n/=e)&&a<r)return t;if(a<n||o>=r)return null;for(var u=[],l=0;l<t.length;l++){var c=t[l],h=c.geometry,p=c.type,f=0===i?c.minX:c.minY,d=0===i?c.maxX:c.maxY;if(f>=n&&d<r)u.push(c);else if(!(d<n||f>=r)){var m=[];if("Point"===p||"MultiPoint"===p)Ot(h,m,n,r,i);else if("LineString"===p)Dt(h,m,n,r,i,!1,s.lineMetrics);else if("MultiLineString"===p)Bt(h,m,n,r,i,!1);else if("Polygon"===p)Bt(h,m,n,r,i,!0);else if("MultiPolygon"===p)for(var y=0;y<h.length;y++){var v=[];Bt(h[y],v,n,r,i,!0),v.length&&m.push(v)}if(m.length){if(s.lineMetrics&&"LineString"===p){for(y=0;y<m.length;y++)u.push(Tt(c.id,p,m[y],c.tags));continue}"LineString"!==p&&"MultiLineString"!==p||(1===m.length?(p="LineString",m=m[0]):p="MultiLineString"),"Point"!==p&&"MultiPoint"!==p||(p=3===m.length?"Point":"MultiPoint"),u.push(Tt(c.id,p,m,c.tags))}}}return u.length?u:null}function Ot(t,e,n,r,i){for(var o=0;o<t.length;o+=3){var a=t[o+i];a>=n&&a<=r&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function Dt(t,e,n,r,i,o,a){for(var s,u,l=Rt(t),c=0===i?jt:Vt,h=t.start,p=0;p<t.length-3;p+=3){var f=t[p],d=t[p+1],m=t[p+2],y=t[p+3],v=t[p+4],g=0===i?f:d,_=0===i?y:v,x=!1;a&&(s=Math.sqrt(Math.pow(f-y,2)+Math.pow(d-v,2))),g<n?_>=n&&(u=c(l,f,d,y,v,n),a&&(l.start=h+s*u)):g>=r?_<r&&(u=c(l,f,d,y,v,r),a&&(l.start=h+s*u)):Ft(l,f,d,m),_<n&&g>=n&&(u=c(l,f,d,y,v,n),x=!0),_>r&&g<=r&&(u=c(l,f,d,y,v,r),x=!0),!o&&x&&(a&&(l.end=h+s*u),e.push(l),l=Rt(t)),a&&(h+=s)}var b=t.length-3;f=t[b],d=t[b+1],m=t[b+2],(g=0===i?f:d)>=n&&g<=r&&Ft(l,f,d,m),b=l.length-3,o&&b>=3&&(l[b]!==l[0]||l[b+1]!==l[1])&&Ft(l,l[0],l[1],l[2]),l.length&&e.push(l)}function Rt(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function Bt(t,e,n,r,i,o){for(var a=0;a<t.length;a++)Dt(t[a],e,n,r,i,o,!1)}function Ft(t,e,n,r){t.push(e),t.push(n),t.push(r)}function jt(t,e,n,r,i,o){var a=(o-e)/(r-e);return t.push(o),t.push(n+(i-n)*a),t.push(1),a}function Vt(t,e,n,r,i,o){var a=(o-n)/(i-n);return t.push(e+(r-e)*a),t.push(o),t.push(1),a}function Nt(t,e){for(var n=[],r=0;r<t.length;r++){var i,o=t[r],a=o.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)i=Ut(o.geometry,e);else if("MultiLineString"===a||"Polygon"===a){i=[];for(var s=0;s<o.geometry.length;s++)i.push(Ut(o.geometry[s],e))}else if("MultiPolygon"===a)for(i=[],s=0;s<o.geometry.length;s++){for(var u=[],l=0;l<o.geometry[s].length;l++)u.push(Ut(o.geometry[s][l],e));i.push(u)}n.push(Tt(o.id,a,i,o.tags))}return n}function Ut(t,e){var n=[];n.size=t.size,void 0!==t.start&&(n.start=t.start,n.end=t.end);for(var r=0;r<t.length;r+=3)n.push(t[r]+e,t[r+1],t[r+2]);return n}function qt(t,e){if(t.transformed)return t;var n,r,i,o=1<<t.z,a=t.x,s=t.y;for(n=0;n<t.features.length;n++){var u=t.features[n],l=u.geometry,c=u.type;if(u.geometry=[],1===c)for(r=0;r<l.length;r+=2)u.geometry.push(Zt(l[r],l[r+1],e,o,a,s));else for(r=0;r<l.length;r++){var h=[];for(i=0;i<l[r].length;i+=2)h.push(Zt(l[r][i],l[r][i+1],e,o,a,s));u.geometry.push(h)}}return t.transformed=!0,t}function Zt(t,e,n,r,i,o){return[Math.round(n*(t*r-i)),Math.round(n*(e*r-o))]}function Gt(t,e,n,r,i){for(var o=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:n,y:r,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<t.length;s++){a.numFeatures++,Xt(a,t[s],o,i);var u=t[s].minX,l=t[s].minY,c=t[s].maxX,h=t[s].maxY;u<a.minX&&(a.minX=u),l<a.minY&&(a.minY=l),c>a.maxX&&(a.maxX=c),h>a.maxY&&(a.maxY=h)}return a}function Xt(t,e,n,r){var i=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s<i.length;s+=3)a.push(i[s]),a.push(i[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===o)Wt(a,i,t,n,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(s=0;s<i.length;s++)Wt(a,i[s],t,n,"Polygon"===o,0===s);else if("MultiPolygon"===o)for(var u=0;u<i.length;u++){var l=i[u];for(s=0;s<l.length;s++)Wt(a,l[s],t,n,!0,0===s)}if(a.length){var c=e.tags||null;if("LineString"===o&&r.lineMetrics){for(var h in c={},e.tags)c[h]=e.tags[h];c.mapbox_clip_start=i.start/i.size,c.mapbox_clip_end=i.end/i.size}var p={geometry:a,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:c};null!==e.id&&(p.id=e.id),t.features.push(p)}}function Wt(t,e,n,r,i,o){var a=r*r;if(r>0&&e.size<(i?a:r))n.numPoints+=e.length/3;else{for(var s=[],u=0;u<e.length;u+=3)(0===r||e[u+2]>a)&&(n.numSimplified++,s.push(e[u]),s.push(e[u+1])),n.numPoints++;i&&function(t,e){for(var n=0,r=0,i=t.length,o=i-2;r<i;o=r,r+=2)n+=(t[r]-t[o])*(t[r+1]+t[o+1]);if(n>0===e)for(r=0,i=t.length;r<i/2;r+=2){var a=t[r],s=t[r+1];t[r]=t[i-2-r],t[r+1]=t[i-1-r],t[i-2-r]=a,t[i-1-r]=s}}(s,o),t.push(s)}}function Ht(t,e){var n=(e=this.options=function(t,e){for(var n in e)t[n]=e[n];return t}(Object.create(this.options),e)).debug;if(n&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var r=function(t,e){var n=[];if("FeatureCollection"===t.type)for(var r=0;r<t.features.length;r++)Mt(n,t.features[r],e,r);else"Feature"===t.type?Mt(n,t,e):Mt(n,{geometry:t},e);return n}(t,e);this.tiles={},this.tileCoords=[],n&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(r=function(t,e){var n=e.buffer/e.extent,r=t,i=Lt(t,1,-1-n,n,0,-1,2,e),o=Lt(t,1,1-n,2+n,0,-1,2,e);return(i||o)&&(r=Lt(t,1,-n,1+n,0,-1,2,e)||[],i&&(r=Nt(i,1).concat(r)),o&&(r=r.concat(Nt(o,-1)))),r}(r,e)).length&&this.splitTile(r,0,0,0),n&&(r.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function Yt(t,e,n){return 32*((1<<t)*n+e)+t}function Kt(t,e){var n=t.tileID.canonical;if(!this._geoJSONIndex)return e(null,null);var r=this._geoJSONIndex.getTile(n.z,n.x,n.y);if(!r)return e(null,null);var i=new X(r.features),o=J(i);0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{vectorTile:i,rawData:o.buffer})}J.fromVectorTileJs=$,J.fromGeojsonVt=function(t,e){e=e||{};var n={};for(var r in t)n[r]=new H(t[r].features,e),n[r].name=r,n[r].version=e.version,n[r].extent=e.extent;return tt({layers:n})},J.GeoJSONWrapper=Q,pt.prototype={range:function(t,e,n,r){return function(t,e,n,r,i,o,a){for(var s,u,l=[0,t.length-1,0],c=[];l.length;){var h=l.pop(),p=l.pop(),f=l.pop();if(p-f<=a)for(var d=f;d<=p;d++)s=e[2*d],u=e[2*d+1],s>=n&&s<=i&&u>=r&&u<=o&&c.push(t[d]);else{var m=Math.floor((f+p)/2);s=e[2*m],u=e[2*m+1],s>=n&&s<=i&&u>=r&&u<=o&&c.push(t[m]);var y=(h+1)%2;(0===h?n<=s:r<=u)&&(l.push(f),l.push(m-1),l.push(y)),(0===h?i>=s:o>=u)&&(l.push(m+1),l.push(p),l.push(y))}}return c}(this.ids,this.coords,t,e,n,r,this.nodeSize)},within:function(t,e,n){return function(t,e,n,r,i,o){for(var a=[0,t.length-1,0],s=[],u=i*i;a.length;){var l=a.pop(),c=a.pop(),h=a.pop();if(c-h<=o)for(var p=h;p<=c;p++)ct(e[2*p],e[2*p+1],n,r)<=u&&s.push(t[p]);else{var f=Math.floor((h+c)/2),d=e[2*f],m=e[2*f+1];ct(d,m,n,r)<=u&&s.push(t[f]);var y=(l+1)%2;(0===l?n-i<=d:r-i<=m)&&(a.push(h),a.push(f-1),a.push(y)),(0===l?n+i>=d:r+i>=m)&&(a.push(f+1),a.push(c),a.push(y))}}return s}(this.ids,this.coords,t,e,n,this.nodeSize)}},mt.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,initial:function(){return{}},map:function(t){return t}},load:function(t){var e=this.options.log;e&&console.time("total time");var n="prepare "+t.length+" points";e&&console.time(n),this.points=t;for(var r,i,o=[],a=0;a<t.length;a++)t[a].geometry&&o.push((r=a,{x:_t((i=t[a].geometry.coordinates)[0]),y:xt(i[1]),zoom:1/0,index:r,parentId:-1}));this.trees[this.options.maxZoom+1]=ht(o,wt,Et,this.options.nodeSize,Float32Array),e&&console.timeEnd(n);for(var s=this.options.maxZoom;s>=this.options.minZoom;s--){var u=+Date.now();o=this._cluster(o,s),this.trees[s]=ht(o,wt,Et,this.options.nodeSize,Float32Array),e&&console.log("z%d: %d clusters in %dms",s,o.length,+Date.now()-u)}return e&&console.timeEnd("total time"),this},getClusters:function(t,e){var n=((t[0]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)n=-180,i=180;else if(n>i){var a=this.getClusters([n,r,180,o],e),s=this.getClusters([-180,r,i,o],e);return a.concat(s)}for(var u=this.trees[this._limitZoom(e)],l=u.range(_t(n),xt(o),_t(i),xt(r)),c=[],h=0;h<l.length;h++){var p=u.points[l[h]];c.push(p.numPoints?vt(p):this.points[p.index])}return c},getChildren:function(t){var e=t>>5,n=t%32,r="No cluster with the specified id.",i=this.trees[n];if(!i)throw new Error(r);var o=i.points[e];if(!o)throw new Error(r);for(var a=this.options.radius/(this.options.extent*Math.pow(2,n-1)),s=i.within(o.x,o.y,a),u=[],l=0;l<s.length;l++){var c=i.points[s[l]];c.parentId===t&&u.push(c.numPoints?vt(c):this.points[c.index])}if(0===u.length)throw new Error(r);return u},getLeaves:function(t,e,n){e=e||10,n=n||0;var r=[];return this._appendLeaves(r,t,e,n,0),r},getTile:function(t,e,n){var r=this.trees[this._limitZoom(t)],i=Math.pow(2,t),o=this.options.extent,a=this.options.radius/o,s=(n-a)/i,u=(n+1+a)/i,l={features:[]};return this._addTileFeatures(r.range((e-a)/i,s,(e+1+a)/i,u),r.points,e,n,i,l),0===e&&this._addTileFeatures(r.range(1-a/i,s,1,u),r.points,i,n,i,l),e===i-1&&this._addTileFeatures(r.range(0,s,a/i,u),r.points,-1,n,i,l),l.features.length?l:null},getClusterExpansionZoom:function(t){for(var e=t%32-1;e<this.options.maxZoom;){var n=this.getChildren(t);if(e++,1!==n.length)break;t=n[0].properties.cluster_id}return e},_appendLeaves:function(t,e,n,r,i){for(var o=this.getChildren(e),a=0;a<o.length;a++){var s=o[a].properties;if(s&&s.cluster?i+s.point_count<=r?i+=s.point_count:i=this._appendLeaves(t,s.cluster_id,n,r,i):i<r?i++:t.push(o[a]),t.length===n)break}return i},_addTileFeatures:function(t,e,n,r,i,o){for(var a=0;a<t.length;a++){var s=e[t[a]],u={type:1,geometry:[[Math.round(this.options.extent*(s.x*i-n)),Math.round(this.options.extent*(s.y*i-r))]],tags:s.numPoints?gt(s):this.points[s.index].properties},l=s.numPoints?s.id:this.points[s.index].id;void 0!==l&&(u.id=l),o.features.push(u)}},_limitZoom:function(t){return Math.max(this.options.minZoom,Math.min(t,this.options.maxZoom+1))},_cluster:function(t,e){for(var n=[],r=this.options.radius/(this.options.extent*Math.pow(2,e)),i=0;i<t.length;i++){var o=t[i];if(!(o.zoom<=e)){o.zoom=e;var a=this.trees[e+1],s=a.within(o.x,o.y,r),u=o.numPoints||1,l=o.x*u,c=o.y*u,h=null;this.options.reduce&&(h=this.options.initial(),this._accumulate(h,o));for(var p=(i<<5)+(e+1),f=0;f<s.length;f++){var d=a.points[s[f]];if(!(d.zoom<=e)){d.zoom=e;var m=d.numPoints||1;l+=d.x*m,c+=d.y*m,u+=m,d.parentId=p,this.options.reduce&&this._accumulate(h,d)}}1===u?n.push(o):(o.parentId=p,n.push(yt(l/u,c/u,p,u,h)))}}return n},_accumulate:function(t,e){var n=e.numPoints?e.properties:this.options.map(this.points[e.index].properties);this.options.reduce(t,n)}},Ht.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Ht.prototype.splitTile=function(t,e,n,r,i,o,a){for(var s=[t,e,n,r],u=this.options,l=u.debug;s.length;){r=s.pop(),n=s.pop(),e=s.pop(),t=s.pop();var c=1<<e,h=Yt(e,n,r),p=this.tiles[h];if(!p&&(l>1&&console.time("creation"),p=this.tiles[h]=Gt(t,e,n,r,u),this.tileCoords.push({z:e,x:n,y:r}),l)){l>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,n,r,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(p.source=t,i){if(e===u.maxZoom||e===i)continue;var d=1<<i-e;if(n!==Math.floor(o/d)||r!==Math.floor(a/d))continue}else if(e===u.indexMaxZoom||p.numPoints<=u.indexMaxPoints)continue;if(p.source=null,0!==t.length){l>1&&console.time("clipping");var m,y,v,g,_,x,b=.5*u.buffer/u.extent,w=.5-b,E=.5+b,S=1+b;m=y=v=g=null,_=Lt(t,c,n-b,n+E,0,p.minX,p.maxX,u),x=Lt(t,c,n+w,n+S,0,p.minX,p.maxX,u),t=null,_&&(m=Lt(_,c,r-b,r+E,1,p.minY,p.maxY,u),y=Lt(_,c,r+w,r+S,1,p.minY,p.maxY,u),_=null),x&&(v=Lt(x,c,r-b,r+E,1,p.minY,p.maxY,u),g=Lt(x,c,r+w,r+S,1,p.minY,p.maxY,u),x=null),l>1&&console.timeEnd("clipping"),s.push(m||[],e+1,2*n,2*r),s.push(y||[],e+1,2*n,2*r+1),s.push(v||[],e+1,2*n+1,2*r),s.push(g||[],e+1,2*n+1,2*r+1)}}},Ht.prototype.getTile=function(t,e,n){var r=this.options,i=r.extent,o=r.debug;if(t<0||t>24)return null;var a=1<<t,s=Yt(t,e=(e%a+a)%a,n);if(this.tiles[s])return qt(this.tiles[s],i);o>1&&console.log("drilling down to z%d-%d-%d",t,e,n);for(var u,l=t,c=e,h=n;!u&&l>0;)l--,c=Math.floor(c/2),h=Math.floor(h/2),u=this.tiles[Yt(l,c,h)];return u&&u.source?(o>1&&console.log("found parent tile z%d-%d-%d",l,c,h),o>1&&console.time("drilling down"),this.splitTile(u.source,l,c,h,t,e,n),o>1&&console.timeEnd("drilling down"),this.tiles[s]?qt(this.tiles[s],i):null):null};var Jt=function(e){function n(t,n,r){e.call(this,t,n,Kt),r&&(this.loadGeoJSON=r)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},n.prototype._loadData=function(){var t=this;if(this._pendingCallback&&this._pendingLoadDataParams){var e=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var r=!!(n&&n.request&&n.request.collectResourceTiming)&&new I.Performance(n.request);this.loadGeoJSON(n,(function(i,o){if(i||!o)return e(i);if("object"!=typeof o)return e(new Error("Input data is not a valid GeoJSON object."));!function t(e,n){switch(e&&e.type||null){case"FeatureCollection":return e.features=e.features.map(N(t,n)),e;case"Feature":return e.geometry=t(e.geometry,n),e;case"Polygon":case"MultiPolygon":return function(t,e){return"Polygon"===t.type?t.coordinates=U(t.coordinates,e):"MultiPolygon"===t.type&&(t.coordinates=t.coordinates.map(N(U,e))),t}(e,n);default:return e}}(o,!0);try{t._geoJSONIndex=n.cluster?(a=n.superclusterOptions,new mt(a)).load(o.features):function(t,e){return new Ht(t,e)}(o,n.geojsonVtOptions)}catch(i){return e(i)}t.loaded={};var a,s={};if(r){var u=r.finish();u&&(s.resourceTiming={},s.resourceTiming[n.source]=JSON.parse(JSON.stringify(u)))}e(null,s)}))}},n.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},n.prototype.reloadTile=function(t,n){var r=this.loaded,i=t.uid;return r&&r[i]?e.prototype.reloadTile.call(this,t,n):this.loadTile(t,n)},n.prototype.loadGeoJSON=function(e,n){if(e.request)t.getJSON(e.request,n);else{if("string"!=typeof e.data)return n(new Error("Input data is not a valid GeoJSON object."));try{return n(null,JSON.parse(e.data))}catch(t){return n(new Error("Input data is not a valid GeoJSON object."))}}},n.prototype.removeSource=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),e()},n.prototype.getClusterExpansionZoom=function(t,e){e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))},n.prototype.getClusterChildren=function(t,e){e(null,this._geoJSONIndex.getChildren(t.clusterId))},n.prototype.getClusterLeaves=function(t,e){e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))},n}(O),$t=function(e){var n=this;this.self=e,this.actor=new t.Actor(e,this),this.layerIndexes={},this.workerSourceTypes={vector:O,geojson:Jt},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,e){if(n.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');n.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=function(e){if(t.plugin.isLoaded())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=e.applyArabicShaping,t.plugin.processBidirectionalText=e.processBidirectionalText,t.plugin.processStyledBidirectionalText=e.processStyledBidirectionalText}};return $t.prototype.setLayers=function(t,e,n){this.getLayerIndex(t).replace(e),n()},$t.prototype.updateLayers=function(t,e,n){this.getLayerIndex(t).update(e.layers,e.removedIds),n()},$t.prototype.loadTile=function(t,e,n){this.getWorkerSource(t,e.type,e.source).loadTile(e,n)},$t.prototype.loadDEMTile=function(t,e,n){this.getDEMWorkerSource(t,e.source).loadTile(e,n)},$t.prototype.reloadTile=function(t,e,n){this.getWorkerSource(t,e.type,e.source).reloadTile(e,n)},$t.prototype.abortTile=function(t,e,n){this.getWorkerSource(t,e.type,e.source).abortTile(e,n)},$t.prototype.removeTile=function(t,e,n){this.getWorkerSource(t,e.type,e.source).removeTile(e,n)},$t.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},$t.prototype.removeSource=function(t,e,n){if(this.workerSources[t]&&this.workerSources[t][e.type]&&this.workerSources[t][e.type][e.source]){var r=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==r.removeSource?r.removeSource(e,n):n()}},$t.prototype.loadWorkerSource=function(t,e,n){try{this.self.importScripts(e.url),n()}catch(t){n(t.toString())}},$t.prototype.loadRTLTextPlugin=function(e,n,r){try{t.plugin.isLoaded()||(this.self.importScripts(n),r(t.plugin.isLoaded()?null:new Error("RTL Text Plugin failed to import scripts from "+n)))}catch(t){r(t.toString())}},$t.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new r),e},$t.prototype.getWorkerSource=function(t,e,n){var r=this;if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),!this.workerSources[t][e][n]){var i={send:function(e,n,i){r.actor.send(e,n,i,t)}};this.workerSources[t][e][n]=new this.workerSourceTypes[e](i,this.getLayerIndex(t))}return this.workerSources[t][e][n]},$t.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new D),this.demWorkerSources[t][e]},"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&new $t(self),$t})),r(0,(function(t){var e=t.createCommonjsModule((function(t){function e(t){return!!("undefined"!=typeof window&&"undefined"!=typeof document&&Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray&&Function.prototype&&Function.prototype.bind&&Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions&&"JSON"in window&&"parse"in JSON&&"stringify"in JSON&&function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var t,e,n=new Blob([""],{type:"text/javascript"}),r=URL.createObjectURL(n);try{e=new Worker(r),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(r),t}()&&"Uint8ClampedArray"in window&&ArrayBuffer.isView&&function(t){return void 0===n[t]&&(n[t]=function(t){var n=document.createElement("canvas"),r=Object.create(e.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,n.probablySupportsContext?n.probablySupportsContext("webgl",r)||n.probablySupportsContext("experimental-webgl",r):n.supportsContext?n.supportsContext("webgl",r)||n.supportsContext("experimental-webgl",r):n.getContext("webgl",r)||n.getContext("experimental-webgl",r)}(t)),n[t]}(t&&t.failIfMajorPerformanceCaveat))}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e);var n={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),n={create:function(e,n,r){var i=t.window.document.createElement(e);return n&&(i.className=n),r&&r.appendChild(i),i},createNS:function(e,n){return t.window.document.createElementNS(e,n)}},r=t.window.document?t.window.document.documentElement.style:null;function i(t){if(!r)return null;for(var e=0;e<t.length;e++)if(t[e]in r)return t[e];return t[0]}var o,a=i(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);n.disableDrag=function(){r&&a&&(o=r[a],r[a]="none")},n.enableDrag=function(){r&&a&&(r[a]=o)};var s=i(["transform","WebkitTransform"]);n.setTransform=function(t,e){t.style[s]=e};var u=!1;try{var l=Object.defineProperty({},"passive",{get:function(){u=!0}});t.window.addEventListener("test",l,l),t.window.removeEventListener("test",l,l)}catch(t){u=!1}n.addEventListener=function(t,e,n,r){void 0===r&&(r={}),"passive"in r&&u?t.addEventListener(e,n,r):t.addEventListener(e,n,r.capture)},n.removeEventListener=function(t,e,n,r){void 0===r&&(r={}),"passive"in r&&u?t.removeEventListener(e,n,r):t.removeEventListener(e,n,r.capture)};var c=function(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener("click",c,!0)};n.suppressClick=function(){t.window.addEventListener("click",c,!0),t.window.setTimeout((function(){t.window.removeEventListener("click",c,!0)}),0)},n.mousePos=function(e,n){var r=e.getBoundingClientRect();return n=n.touches?n.touches[0]:n,new t.Point(n.clientX-r.left-e.clientLeft,n.clientY-r.top-e.clientTop)},n.touchPos=function(e,n){for(var r=e.getBoundingClientRect(),i=[],o="touchend"===n.type?n.changedTouches:n.touches,a=0;a<o.length;a++)i.push(new t.Point(o[a].clientX-r.left-e.clientLeft,o[a].clientY-r.top-e.clientTop));return i},n.mouseButton=function(e){return void 0!==t.window.InstallTrigger&&2===e.button&&e.ctrlKey&&t.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:e.button},n.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var h={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return 0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":"https://events.mapbox.com/events/v2"},REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null},p="See https://www.mapbox.com/api-documentation/#access-tokens";function f(t,e){var n=_(h.API_URL);if(t.protocol=n.protocol,t.authority=n.authority,"/"!==n.path&&(t.path=""+n.path+t.path),!h.REQUIRE_ACCESS_TOKEN)return x(t);if(!(e=e||h.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+p);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+p);return t.params.push("access_token="+e),x(t)}function d(t){return 0===t.indexOf("mapbox:")}var m=function(t,e,n,r){var i=_(t);return d(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+n,f(i,r)):(i.path+=""+e+n,x(i))},y=/(\.(png|jpg)\d*)(?=$)/,v=function(e,n,r){if(!n||!d(n))return e;var i=_(e),o=t.browser.devicePixelRatio>=2||512===r?"@2x":"",a=t.browser.supportsWebp?".webp":"$1";return i.path=i.path.replace(y,""+o+a),function(t){for(var e=0;e<t.length;e++)0===t[e].indexOf("access_token=tk.")&&(t[e]="access_token="+(h.ACCESS_TOKEN||""))}(i.params),x(i)},g=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function _(t){var e=t.match(g);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function x(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}var b=function(){this.eventData={anonId:null,lastSuccess:null,accessToken:h.ACCESS_TOKEN},this.queue=[],this.pending=!1,this.pendingRequest=null};b.prototype.postTurnstileEvent=function(t){h.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return/(mapbox\.c)(n|om)/i.test(t)}))&&this.queueRequest(Date.now())},b.prototype.queueRequest=function(t){this.queue.push(t),this.processRequests()},b.prototype.processRequests=function(){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var n="mapbox.turnstileEventData:"+(h.ACCESS_TOKEN||""),r=t.storageAvailable("localStorage"),i=!!this.eventData.accessToken&&this.eventData.accessToken!==h.ACCESS_TOKEN;if(i&&(this.eventData.anonId=this.eventData.lastSuccess=null),(!this.eventData.anonId||!this.eventData.lastSuccess)&&r)try{var o=t.window.localStorage.getItem(n);o&&(this.eventData=JSON.parse(o))}catch(e){t.warnOnce("Unable to read from LocalStorage")}t.validateUuid(this.eventData.anonId)||(this.eventData.anonId=t.uuid(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var s=new Date(this.eventData.lastSuccess),u=new Date(a),l=(a-this.eventData.lastSuccess)/864e5;i=i||l>=1||l<-1||s.getDate()!==u.getDate()}if(!i)return this.processRequests();var c=_(h.EVENTS_URL);c.params.push("access_token="+(h.ACCESS_TOKEN||""));var p={url:x(c),headers:{"Content-Type":"text/plain"}},f=JSON.stringify([{event:"appUserTurnstile",created:new Date(a).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"0.50.0","enabled.telemetry":!1,userId:this.eventData.anonId}]);this.pendingRequest=t.postData(p,f,(function(i){if(e.pendingRequest=null,!i){if(e.eventData.lastSuccess=a,e.eventData.accessToken=h.ACCESS_TOKEN,r)try{t.window.localStorage.setItem(n,JSON.stringify(e.eventData))}catch(e){t.warnOnce("Unable to write to LocalStorage")}e.processRequests()}}))}};var w=new b,E=w.postTurnstileEvent.bind(w),S=function(){this.images={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0};S.prototype.isLoaded=function(){return this.loaded},S.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,n=this.requestors;e<n.length;e+=1){var r=n[e],i=r.ids,o=r.callback;this._notify(i,o)}this.requestors=[]}},S.prototype.getImage=function(t){return this.images[t]},S.prototype.addImage=function(t,e){this.images[t]=e},S.prototype.removeImage=function(t){delete this.images[t],delete this.patterns[t]},S.prototype.listImages=function(){return Object.keys(this.images)},S.prototype.getImages=function(t,e){var n=!0;if(!this.isLoaded())for(var r=0,i=t;r<i.length;r+=1){var o=i[r];this.images[o]||(n=!1)}this.isLoaded()||n?this._notify(t,e):this.requestors.push({ids:t,callback:e})},S.prototype._notify=function(t,e){for(var n={},r=0,i=t;r<i.length;r+=1){var o=i[r],a=this.images[o];a&&(n[o]={data:a.data.clone(),pixelRatio:a.pixelRatio,sdf:a.sdf})}e(null,n)},S.prototype.getPixelSize=function(){var t=this.atlasImage;return{width:t.width,height:t.height}},S.prototype.getPattern=function(e){var n=this.patterns[e];if(n)return n.position;var r=this.getImage(e);if(!r)return null;var i={w:r.data.width+2,h:r.data.height+2,x:0,y:0},o=new t.ImagePosition(i,r);return this.patterns[e]={bin:i,position:o},this._updatePatternAtlas(),o},S.prototype.bind=function(e){var n=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(e,this.atlasImage,n.RGBA),this.atlasTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)},S.prototype._updatePatternAtlas=function(){var e=[];for(var n in this.patterns)e.push(this.patterns[n].bin);var r=t.potpack(e),i=r.w,o=r.h,a=this.atlasImage;for(var s in a.resize({width:i||1,height:o||1}),this.patterns){var u=this.patterns[s].bin,l=u.x+1,c=u.y+1,h=this.images[s].data,p=h.width,f=h.height;t.RGBAImage.copy(h,a,{x:0,y:0},{x:l,y:c},{width:p,height:f}),t.RGBAImage.copy(h,a,{x:0,y:f-1},{x:l,y:c-1},{width:p,height:1}),t.RGBAImage.copy(h,a,{x:0,y:0},{x:l,y:c+f},{width:p,height:1}),t.RGBAImage.copy(h,a,{x:p-1,y:0},{x:l-1,y:c},{width:1,height:f}),t.RGBAImage.copy(h,a,{x:0,y:0},{x:l+p,y:c},{width:1,height:f})}this.dirty=!0};var T=M,k=1e20;function M(t,e,n,r,i,o){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=r||.25,this.fontFamily=i||"sans-serif",this.fontWeight=o||"normal",this.radius=n||8;var a=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.d=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Int16Array(a),this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function A(t,e,n,r,i,o,a){for(var s=0;s<e;s++){for(var u=0;u<n;u++)r[u]=t[u*e+s];for(P(r,i,o,a,n),u=0;u<n;u++)t[u*e+s]=i[u]}for(u=0;u<n;u++){for(s=0;s<e;s++)r[s]=t[u*e+s];for(P(r,i,o,a,e),s=0;s<e;s++)t[u*e+s]=Math.sqrt(i[s])}}function P(t,e,n,r,i){n[0]=0,r[0]=-k,r[1]=+k;for(var o=1,a=0;o<i;o++){for(var s=(t[o]+o*o-(t[n[a]]+n[a]*n[a]))/(2*o-2*n[a]);s<=r[a];)a--,s=(t[o]+o*o-(t[n[a]]+n[a]*n[a]))/(2*o-2*n[a]);n[++a]=o,r[a]=s,r[a+1]=+k}for(o=0,a=0;o<i;o++){for(;r[a+1]<o;)a++;e[o]=(o-n[a])*(o-n[a])+t[n[a]]}}M.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),n=new Uint8ClampedArray(this.size*this.size),r=0;r<this.size*this.size;r++){var i=e.data[4*r+3]/255;this.gridOuter[r]=1===i?0:0===i?k:Math.pow(Math.max(0,.5-i),2),this.gridInner[r]=1===i?k:0===i?0:Math.pow(Math.max(0,i-.5),2)}for(A(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),A(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),r=0;r<this.size*this.size;r++){var o=this.gridOuter[r]-this.gridInner[r];n[r]=Math.max(0,Math.min(255,Math.round(255-255*(o/this.radius+this.cutoff))))}return n};var z=function(t,e){this.requestTransform=t,this.localIdeographFontFamily=e,this.entries={}};z.prototype.setURL=function(t){this.url=t},z.prototype.getGlyphs=function(e,n){var r=this,i=[];for(var o in e)for(var a=0,s=e[o];a<s.length;a+=1){var u=s[a];i.push({stack:o,id:u})}t.asyncAll(i,(function(t,e){var n=t.stack,i=t.id,o=r.entries[n];o||(o=r.entries[n]={glyphs:{},requests:{}});var a=o.glyphs[i];if(void 0===a)if(a=r._tinySDF(o,n,i))e(null,{stack:n,id:i,glyph:a});else{var s=Math.floor(i/256);if(256*s>65535)e(new Error("glyphs > 65535 not supported"));else{var u=o.requests[s];u||(u=o.requests[s]=[],z.loadGlyphRange(n,s,r.url,r.requestTransform,(function(t,e){if(e)for(var n in e)o.glyphs[+n]=e[+n];for(var r=0,i=u;r<i.length;r+=1)(0,i[r])(t,e);delete o.requests[s]}))),u.push((function(t,r){t?e(t):r&&e(null,{stack:n,id:i,glyph:r[i]||null})}))}}else e(null,{stack:n,id:i,glyph:a})}),(function(t,e){if(t)n(t);else if(e){for(var r={},i=0,o=e;i<o.length;i+=1){var a=o[i],s=a.stack,u=a.id,l=a.glyph;(r[s]||(r[s]={}))[u]=l&&{id:l.id,bitmap:l.bitmap.clone(),metrics:l.metrics}}n(null,r)}}))},z.prototype._tinySDF=function(e,n,r){var i=this.localIdeographFontFamily;if(i&&(t.isChar["CJK Unified Ideographs"](r)||t.isChar["Hangul Syllables"](r))){var o=e.tinySDF;if(!o){var a="400";/bold/i.test(n)?a="900":/medium/i.test(n)?a="500":/light/i.test(n)&&(a="200"),o=e.tinySDF=new z.TinySDF(24,3,8,.25,i,a)}return{id:r,bitmap:new t.AlphaImage({width:30,height:30},o.draw(String.fromCharCode(r))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},z.loadGlyphRange=function(e,n,r,i,o){var a=256*n,s=a+255,u=i(function(t,e){if(!d(t))return t;var n=_(t);return n.path="/fonts/v1"+n.path,f(n,e)}(r).replace("{fontstack}",e).replace("{range}",a+"-"+s),t.ResourceType.Glyphs);t.getArrayBuffer(u,(function(e,n){if(e)o(e);else if(n){for(var r={},i=0,a=t.parseGlyphPBF(n.data);i<a.length;i+=1){var s=a[i];r[s.id]=s}o(null,r)}}))},z.TinySDF=T;var I=function(){this.specification=t.styleSpec.light.position};I.prototype.possiblyEvaluate=function(e,n){return t.sphericalToCartesian(e.expression.evaluate(n))},I.prototype.interpolate=function(e,n,r){return{x:t.number(e.x,n.x,r),y:t.number(e.y,n.y,r),z:t.number(e.z,n.z,r)}};var C=new t.Properties({anchor:new t.DataConstantProperty(t.styleSpec.light.anchor),position:new I,color:new t.DataConstantProperty(t.styleSpec.light.color),intensity:new t.DataConstantProperty(t.styleSpec.light.intensity)}),L=function(e){function n(n){e.call(this),this._transitionable=new t.Transitionable(C),this.setLight(n),this._transitioning=this._transitionable.untransitioned()}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.getLight=function(){return this._transitionable.serialize()},n.prototype.setLight=function(e){if(!this._validate(t.validateLight,e))for(var n in e){var r=e[n];t.endsWith(n,"-transition")?this._transitionable.setTransition(n.slice(0,-"-transition".length),r):this._transitionable.setValue(n,r)}},n.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)},n.prototype.hasTransition=function(){return this._transitioning.hasTransition()},n.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t)},n.prototype._validate=function(e,n){return t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:n,style:{glyphs:!0,sprite:!0},styleSpec:t.styleSpec})))},n}(t.Evented),O=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}};O.prototype.getDash=function(t,e){var n=t.join(",")+String(e);return this.positions[n]||(this.positions[n]=this.addDash(t,e)),this.positions[n]},O.prototype.addDash=function(e,n){var r=n?7:0,i=2*r+1;if(this.nextRow+i>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var o=0,a=0;a<e.length;a++)o+=e[a];for(var s=this.width/o,u=s/2,l=e.length%2==1,c=-r;c<=r;c++)for(var h=this.nextRow+r+c,p=this.width*h,f=l?-e[e.length-1]:0,d=e[0],m=1,y=0;y<this.width;y++){for(;d<y/s;)f=d,d+=e[m],l&&m===e.length-1&&(d+=e[0]),m++;var v=Math.abs(y-f*s),g=Math.abs(y-d*s),_=Math.min(v,g),x=m%2==1,b=void 0;if(n){var w=r?c/r*(u+1):0;if(x){var E=u-Math.abs(w);b=Math.sqrt(_*_+E*E)}else b=u-Math.sqrt(_*_+w*w)}else b=(x?1:-1)*_;this.data[3+4*(p+y)]=Math.max(0,Math.min(255,b+128))}var S={y:(this.nextRow+r+.5)/this.height,height:2*r/this.height,width:o};return this.nextRow+=i,this.dirty=!0,S},O.prototype.bind=function(t){var e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.RGBA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,this.width,this.height,0,e.RGBA,e.UNSIGNED_BYTE,this.data))};var D=function e(n,r){this.workerPool=n,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var i=this.workerPool.acquire(this.id),o=0;o<i.length;o++){var a=i[o],s=new e.Actor(a,r,this.id);s.name="Worker "+o,this.actors.push(s)}};function R(e,n,r){var i=function(e,n){if(e)return r(e);if(n){var i=t.pick(n,["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds"]);n.vector_layers&&(i.vectorLayers=n.vector_layers,i.vectorLayerIds=i.vectorLayers.map((function(t){return t.id}))),r(null,i)}};return e.url?t.getJSON(n(function(t,e){if(!d(t))return t;var n=_(t);return n.path="/v4/"+n.authority+".json",n.params.push("secure"),f(n,e)}(e.url),t.ResourceType.Source),i):t.browser.frame((function(){return i(null,e)}))}D.prototype.broadcast=function(e,n,r){r=r||function(){},t.asyncAll(this.actors,(function(t,r){t.send(e,n,r)}),r)},D.prototype.send=function(t,e,n,r){return("number"!=typeof r||isNaN(r))&&(r=this.currentActor=(this.currentActor+1)%this.actors.length),this.actors[r].send(t,e,n),r},D.prototype.remove=function(){this.actors.forEach((function(t){t.remove()})),this.actors=[],this.workerPool.release(this.id)},D.Actor=t.Actor;var B=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};B.prototype.wrap=function(){return new B(t.wrap(this.lng,-180,180),this.lat)},B.prototype.toArray=function(){return[this.lng,this.lat]},B.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},B.prototype.toBounds=function(t){var e=360*t/40075017,n=e/Math.cos(Math.PI/180*this.lat);return new F(new B(this.lng-n,this.lat-e),new B(this.lng+n,this.lat+e))},B.convert=function(t){if(t instanceof B)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new B(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new B(Number(t.lng),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var F=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};F.prototype.setNorthEast=function(t){return this._ne=t instanceof B?new B(t.lng,t.lat):B.convert(t),this},F.prototype.setSouthWest=function(t){return this._sw=t instanceof B?new B(t.lng,t.lat):B.convert(t),this},F.prototype.extend=function(t){var e,n,r=this._sw,i=this._ne;if(t instanceof B)e=t,n=t;else{if(!(t instanceof F))return Array.isArray(t)?t.every(Array.isArray)?this.extend(F.convert(t)):this.extend(B.convert(t)):this;if(e=t._sw,n=t._ne,!e||!n)return this}return r||i?(r.lng=Math.min(e.lng,r.lng),r.lat=Math.min(e.lat,r.lat),i.lng=Math.max(n.lng,i.lng),i.lat=Math.max(n.lat,i.lat)):(this._sw=new B(e.lng,e.lat),this._ne=new B(n.lng,n.lat)),this},F.prototype.getCenter=function(){return new B((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},F.prototype.getSouthWest=function(){return this._sw},F.prototype.getNorthEast=function(){return this._ne},F.prototype.getNorthWest=function(){return new B(this.getWest(),this.getNorth())},F.prototype.getSouthEast=function(){return new B(this.getEast(),this.getSouth())},F.prototype.getWest=function(){return this._sw.lng},F.prototype.getSouth=function(){return this._sw.lat},F.prototype.getEast=function(){return this._ne.lng},F.prototype.getNorth=function(){return this._ne.lat},F.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},F.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},F.prototype.isEmpty=function(){return!(this._sw&&this._ne)},F.convert=function(t){return!t||t instanceof F?t:new F(t)};var j=function(t,e,n){this.bounds=F.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=n||24};j.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},j.prototype.contains=function(t){var e=Math.floor(this.lngX(this.bounds.getWest(),t.z)),n=Math.floor(this.latY(this.bounds.getNorth(),t.z)),r=Math.ceil(this.lngX(this.bounds.getEast(),t.z)),i=Math.ceil(this.latY(this.bounds.getSouth(),t.z));return t.x>=e&&t.x<r&&t.y>=n&&t.y<i},j.prototype.lngX=function(t,e){return(t+180)*(Math.pow(2,e)/360)},j.prototype.latY=function(e,n){var r=t.clamp(Math.sin(Math.PI/180*e),-.9999,.9999),i=Math.pow(2,n)/(2*Math.PI);return Math.pow(2,n-1)+.5*Math.log((1+r)/(1-r))*-i};var V=function(e){function n(n,r,i,o){if(e.call(this),this.id=n,this.dispatcher=i,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,t.extend(this,t.pick(r,["url","scheme","tileSize"])),this._options=t.extend({type:"vector"},r),this._collectResourceTiming=r.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(o)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=R(this._options,this.map._transformRequest,(function(n,r){e._tileJSONRequest=null,n?e.fire(new t.ErrorEvent(n)):r&&(t.extend(e,r),r.bounds&&(e.tileBounds=new j(r.bounds,e.minzoom,e.maxzoom)),E(r.tiles),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},n.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},n.prototype.onAdd=function(t){this.map=t,this.load()},n.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},n.prototype.serialize=function(){return t.extend({},this._options)},n.prototype.loadTile=function(e,n){var r=v(e.tileID.canonical.url(this.tiles,this.scheme),this.url),i={request:this.map._transformRequest(r,t.ResourceType.Tile),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes};function o(t,r){return e.aborted?n(null):t&&404!==t.status?n(t):(r&&r.resourceTiming&&(e.resourceTiming=r.resourceTiming),this.map._refreshExpiredTiles&&r&&e.setExpiryData(r),e.loadVectorData(r,this.map.painter),n(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}i.request.collectResourceTiming=this._collectResourceTiming,void 0===e.workerID||"expired"===e.state?e.workerID=this.dispatcher.send("loadTile",i,o.bind(this)):"loading"===e.state?e.reloadCallback=n:this.dispatcher.send("reloadTile",i,o.bind(this),e.workerID)},n.prototype.abortTile=function(t){this.dispatcher.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0,t.workerID)},n.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0,t.workerID)},n.prototype.hasTransition=function(){return!1},n}(t.Evented),N=function(e){function n(n,r,i,o){e.call(this),this.id=n,this.dispatcher=i,this.setEventedParent(o),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.extend({},r),t.extend(this,t.pick(r,["url","scheme","tileSize"]))}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=R(this._options,this.map._transformRequest,(function(n,r){e._tileJSONRequest=null,n?e.fire(new t.ErrorEvent(n)):r&&(t.extend(e,r),r.bounds&&(e.tileBounds=new j(r.bounds,e.minzoom,e.maxzoom)),E(r.tiles),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},n.prototype.onAdd=function(t){this.map=t,this.load()},n.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},n.prototype.serialize=function(){return t.extend({},this._options)},n.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},n.prototype.loadTile=function(e,n){var r=this,i=v(e.tileID.canonical.url(this.tiles,this.scheme),this.url,this.tileSize);e.request=t.getImage(this.map._transformRequest(i,t.ResourceType.Tile),(function(i,o){if(delete e.request,e.aborted)e.state="unloaded",n(null);else if(i)e.state="errored",n(i);else if(o){r.map._refreshExpiredTiles&&e.setExpiryData(o),delete o.cacheControl,delete o.expires;var a=r.map.painter.context,s=a.gl;e.texture=r.map.painter.getTileTexture(o.width),e.texture?e.texture.update(o,{useMipmap:!0}):(e.texture=new t.Texture(a,o,s.RGBA,{useMipmap:!0}),e.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),a.extTextureFilterAnisotropic&&s.texParameterf(s.TEXTURE_2D,a.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,a.extTextureFilterAnisotropicMax)),e.state="loaded",n(null)}}))},n.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e()},n.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e()},n.prototype.hasTransition=function(){return!1},n}(t.Evented),U=function(e){function n(n,r,i,o){e.call(this,n,r,i,o),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({},r),this.encoding=r.encoding||"mapbox"}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},n.prototype.loadTile=function(e,n){var r=v(e.tileID.canonical.url(this.tiles,this.scheme),this.url,this.tileSize);e.request=t.getImage(this.map._transformRequest(r,t.ResourceType.Tile),function(r,i){if(delete e.request,e.aborted)e.state="unloaded",n(null);else if(r)e.state="errored",n(r);else if(i){this.map._refreshExpiredTiles&&e.setExpiryData(i),delete i.cacheControl,delete i.expires;var o=t.browser.getImageData(i),a={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:o,encoding:this.encoding};e.workerID&&"expired"!==e.state||(e.workerID=this.dispatcher.send("loadDEMTile",a,function(t,r){t&&(e.state="errored",n(t)),r&&(e.dem=r,e.needsHillshadePrepare=!0,e.state="loaded",n(null))}.bind(this)))}}.bind(this)),e.neighboringTiles=this._getNeighboringTiles(e.tileID)},n.prototype._getNeighboringTiles=function(e){var n=e.canonical,r=Math.pow(2,n.z),i=(n.x-1+r)%r,o=0===n.x?e.wrap-1:e.wrap,a=(n.x+1+r)%r,s=n.x+1===r?e.wrap+1:e.wrap,u={};return u[new t.OverscaledTileID(e.overscaledZ,o,n.z,i,n.y).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,n.z,a,n.y).key]={backfilled:!1},n.y>0&&(u[new t.OverscaledTileID(e.overscaledZ,o,n.z,i,n.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,e.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,n.z,a,n.y-1).key]={backfilled:!1}),n.y+1<r&&(u[new t.OverscaledTileID(e.overscaledZ,o,n.z,i,n.y+1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,e.wrap,n.z,n.x,n.y+1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,n.z,a,n.y+1).key]={backfilled:!1}),u},n.prototype.unloadTile=function(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",this.dispatcher.send("removeDEMTile",{uid:t.uid,source:this.id},void 0,t.workerID)},n}(N),q=function(e){function n(n,r,i,o){e.call(this),this.id=n,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this.dispatcher=i,this.setEventedParent(o),this._data=r.data,this._options=t.extend({},r),this._collectResourceTiming=r.collectResourceTiming,this._resourceTiming=[],void 0!==r.maxzoom&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type),r.attribution&&(this.attribution=r.attribution);var a=t.EXTENT/this.tileSize;this.workerOptions=t.extend({source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:(void 0!==r.buffer?r.buffer:128)*a,tolerance:(void 0!==r.tolerance?r.tolerance:.375)*a,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:r.lineMetrics||!1,generateId:r.generateId||!1},superclusterOptions:{maxZoom:void 0!==r.clusterMaxZoom?Math.min(r.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,extent:t.EXTENT,radius:(r.clusterRadius||50)*a,log:!1}},r.workerOptions)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(n){if(n)e.fire(new t.ErrorEvent(n));else{var r={dataType:"source",sourceDataType:"metadata"};e._collectResourceTiming&&e._resourceTiming&&e._resourceTiming.length>0&&(r.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",r))}}))},n.prototype.onAdd=function(t){this.map=t,this.load()},n.prototype.setData=function(e){var n=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)n.fire(new t.ErrorEvent(e));else{var r={dataType:"source",sourceDataType:"content"};n._collectResourceTiming&&n._resourceTiming&&n._resourceTiming.length>0&&(r.resourceTiming=n._resourceTiming,n._resourceTiming=[]),n.fire(new t.Event("data",r))}})),this},n.prototype.getClusterExpansionZoom=function(t,e){return this.dispatcher.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e,this.workerID),this},n.prototype.getClusterChildren=function(t,e){return this.dispatcher.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e,this.workerID),this},n.prototype.getClusterLeaves=function(t,e,n,r){return this.dispatcher.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:n},r,this.workerID),this},n.prototype._updateWorkerData=function(e){var n=this,r=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(r.request=this.map._transformRequest(t.browser.resolveURL(i),t.ResourceType.Source),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(i),this.workerID=this.dispatcher.send(this.type+".loadData",r,(function(t,i){n._removed||i&&i.abandoned||(n._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[n.id]&&(n._resourceTiming=i.resourceTiming[n.id].slice(0)),n.dispatcher.send(n.type+".coalesce",{source:r.source},null,n.workerID),e(t))}),this.workerID)},n.prototype.loadTile=function(e,n){var r=this,i=void 0===e.workerID?"loadTile":"reloadTile",o={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes};e.workerID=this.dispatcher.send(i,o,(function(t,o){return e.unloadVectorData(),e.aborted?n(null):t?n(t):(e.loadVectorData(o,r.map.painter,"reloadTile"===i),n(null))}),this.workerID)},n.prototype.abortTile=function(t){t.aborted=!0},n.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},null,t.workerID)},n.prototype.onRemove=function(){this._removed=!0,this.dispatcher.send("removeSource",{type:this.type,source:this.id},null,this.workerID)},n.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},n.prototype.hasTransition=function(){return!1},n}(t.Evented),Z=function(e){function n(t,n,r,i){e.call(this),this.id=t,this.dispatcher=r,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this.setEventedParent(i),this.options=n}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.load=function(e,n){var r=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._transformRequest(this.url,t.ResourceType.Image),(function(i,o){i?r.fire(new t.ErrorEvent(i)):o&&(r.image=t.browser.getImageData(o),e&&(r.coordinates=e),n&&n(),r._finishLoading())}))},n.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},n.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},n.prototype.onAdd=function(t){this.map=t,this.load()},n.prototype.setCoordinates=function(e){this.coordinates=e;var n=this.map,r=e.map((function(t){return n.transform.locationCoordinate(B.convert(t)).zoomTo(0)})),i=this.centerCoord=t.getCoordinatesCenter(r);i.column=Math.floor(i.column),i.row=Math.floor(i.row),this.tileID=new t.CanonicalTileID(i.zoom,i.column,i.row),this.minzoom=this.maxzoom=i.zoom;var o=r.map((function(e){var n=e.zoomTo(i.zoom);return new t.Point(Math.round((n.column-i.column)*t.EXTENT),Math.round((n.row-i.row)*t.EXTENT))}));return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(o[0].x,o[0].y,0,0),this._boundsArray.emplaceBack(o[1].x,o[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(o[3].x,o[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(o[2].x,o[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},n.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var e=this.map.painter.context,n=e.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,t.rasterBoundsAttributes.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(e,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[r];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},n.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null))},n.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},n.prototype.hasTransition=function(){return!1},n}(t.Evented),G=function(e){function n(t,n,r,i){e.call(this,t,n,r,i),this.roundZoom=!0,this.type="video",this.options=n}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.load=function(){var e=this,n=this.options;this.urls=[];for(var r=0,i=n.urls;r<i.length;r+=1){var o=i[r];e.urls.push(e.map._transformRequest(o,t.ResourceType.Source).url)}t.getVideo(this.urls,(function(n,r){n?e.fire(new t.ErrorEvent(n)):r&&(e.video=r,e.video.loop=!0,e.video.addEventListener("playing",(function(){e.map.triggerRepaint()})),e.map&&e.video.play(),e._finishLoading())}))},n.prototype.getVideo=function(){return this.video},n.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},n.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,n=e.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,t.rasterBoundsAttributes.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[r];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},n.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},n.prototype.hasTransition=function(){return this.video&&!this.video.paused},n}(Z),X=function(e){function n(n,r,i,o){e.call(this,n,r,i,o),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.load=function(){this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing=!1},this._finishLoading())},n.prototype.getCanvas=function(){return this.canvas},n.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},n.prototype.onRemove=function(){this.pause()},n.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var n=this.map.painter.context,r=n.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,t.rasterBoundsAttributes.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(n,this.canvas,r.RGBA,{premultiply:!0}),this.tiles){var o=this.tiles[i];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture)}}},n.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},n.prototype.hasTransition=function(){return this._playing},n.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];t<e.length;t+=1){var n=e[t];if(isNaN(n)||n<=0)return!0}return!1},n}(Z),W={vector:V,raster:N,"raster-dem":U,geojson:q,video:G,image:Z,canvas:X};function H(t,e,n,r,i){var o=i.maxPitchScaleFactor(),a=t.tilesIn(n,o);a.sort(Y);for(var s=[],u=0,l=a;u<l.length;u+=1){var c=l[u];s.push({wrappedTileID:c.tileID.wrapped().key,queryResults:c.tile.queryRenderedFeatures(e,t._state,c.queryGeometry,c.scale,r,i,o,t.transform.calculatePosMatrix(c.tileID.toUnwrapped()))})}var h=function(t){for(var e={},n={},r=0,i=t;r<i.length;r+=1){var o=i[r],a=o.queryResults,s=o.wrappedTileID,u=n[s]=n[s]||{};for(var l in a)for(var c=a[l],h=u[l]=u[l]||{},p=e[l]=e[l]||[],f=0,d=c;f<d.length;f+=1){var m=d[f];h[m.featureIndex]||(h[m.featureIndex]=!0,p.push(m.feature))}}return e}(s);for(var p in h)h[p].forEach((function(e){var n=t.getFeatureState(e.layer["source-layer"],e.id);e.source=e.layer.source,e.layer["source-layer"]&&(e.sourceLayer=e.layer["source-layer"]),e.state=n}));return h}function Y(t,e){var n=t.tileID,r=e.tileID;return n.overscaledZ-r.overscaledZ||n.canonical.y-r.canonical.y||n.wrap-r.wrap||n.canonical.x-r.canonical.x}var K=function(t,e){this.max=t,this.onRemove=e,this.reset()};K.prototype.reset=function(){for(var t in this.data)for(var e=0,n=this.data[t];e<n.length;e+=1){var r=n[e];r.timeout&&clearTimeout(r.timeout),this.onRemove(r.value)}return this.data={},this.order=[],this},K.prototype.add=function(t,e,n){var r=this,i=t.wrapped().key;void 0===this.data[i]&&(this.data[i]=[]);var o={value:e,timeout:void 0};if(void 0!==n&&(o.timeout=setTimeout((function(){r.remove(t,o)}),n)),this.data[i].push(o),this.order.push(i),this.order.length>this.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this},K.prototype.has=function(t){return t.wrapped().key in this.data},K.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},K.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},K.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},K.prototype.remove=function(t,e){if(!this.has(t))return this;var n=t.wrapped().key,r=void 0===e?0:this.data[n].indexOf(e),i=this.data[n][r];return this.data[n].splice(r,1),i.timeout&&clearTimeout(i.timeout),0===this.data[n].length&&delete this.data[n],this.onRemove(i.value),this.order.splice(this.order.indexOf(n),1),this},K.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this};var J=function(t,e,n){this.context=t;var r=t.gl;this.buffer=r.createBuffer(),this.dynamicDraw=Boolean(n),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};J.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},J.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},J.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};var $={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},Q=function(t,e,n,r){this.length=e.length,this.attributes=n,this.itemSize=e.bytesPerElement,this.dynamicDraw=r,this.context=t;var i=t.gl;this.buffer=i.createBuffer(),t.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};Q.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},Q.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},Q.prototype.enableAttributes=function(t,e){for(var n=0;n<this.attributes.length;n++){var r=this.attributes[n],i=e.attributes[r.name];void 0!==i&&t.enableVertexAttribArray(i)}},Q.prototype.setVertexAttribPointers=function(t,e,n){for(var r=0;r<this.attributes.length;r++){var i=this.attributes[r],o=e.attributes[i.name];void 0!==o&&t.vertexAttribPointer(o,i.components,t[$[i.type]],!1,this.itemSize,i.offset+this.itemSize*(n||0))}},Q.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};var tt=function(e){this.context=e,this.default=t.Color.transparent,this.current=this.default,this.dirty=!1};tt.prototype.get=function(){return this.current},tt.prototype.setDefault=function(){this.set(this.default)},tt.prototype.set=function(t){var e=this.current;t.r===e.r&&t.g===e.g&&t.b===e.b&&t.a===e.a&&!0!==this.dirty||(this.context.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)};var et=function(t){this.context=t,this.default=1,this.current=this.default,this.dirty=!1};et.prototype.get=function(){return this.current},et.prototype.setDefault=function(){this.set(this.default)},et.prototype.set=function(t){this.current===t&&!0!==this.dirty||(this.context.gl.clearDepth(t),this.current=t,this.dirty=!1)};var nt=function(t){this.context=t,this.default=0,this.current=this.default,this.dirty=!1};nt.prototype.get=function(){return this.current},nt.prototype.setDefault=function(){this.set(this.default)},nt.prototype.set=function(t){this.current===t&&!0!==this.dirty||(this.context.gl.clearStencil(t),this.current=t,this.dirty=!1)};var rt=function(t){this.context=t,this.default=[!0,!0,!0,!0],this.current=this.default,this.dirty=!1};rt.prototype.get=function(){return this.current},rt.prototype.setDefault=function(){this.set(this.default)},rt.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&!0!==this.dirty||(this.context.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)};var it=function(t){this.context=t,this.default=!0,this.current=this.default,this.dirty=!1};it.prototype.get=function(){return this.current},it.prototype.setDefault=function(){this.set(this.default)},it.prototype.set=function(t){this.current===t&&!0!==this.dirty||(this.context.gl.depthMask(t),this.current=t,this.dirty=!1)};var ot=function(t){this.context=t,this.default=255,this.current=this.default,this.dirty=!1};ot.prototype.get=function(){return this.current},ot.prototype.setDefault=function(){this.set(this.default)},ot.prototype.set=function(t){this.current===t&&!0!==this.dirty||(this.context.gl.stencilMask(t),this.current=t,this.dirty=!1)};var at=function(t){this.context=t,this.default={func:t.gl.ALWAYS,ref:0,mask:255},this.current=this.default,this.dirty=!1};at.prototype.get=function(){return this.current},at.prototype.setDefault=function(){this.set(this.default)},at.prototype.set=function(t){var e=this.current;t.func===e.func&&t.ref===e.ref&&t.mask===e.mask&&!0!==this.dirty||(this.context.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)};var st=function(t){this.context=t;var e=this.context.gl;this.default=[e.KEEP,e.KEEP,e.KEEP],this.current=this.default,this.dirty=!1};st.prototype.get=function(){return this.current},st.prototype.setDefault=function(){this.set(this.default)},st.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&!0!==this.dirty||(this.context.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)};var ut=function(t){this.context=t,this.default=!1,this.current=this.default,this.dirty=!1};ut.prototype.get=function(){return this.current},ut.prototype.setDefault=function(){this.set(this.default)},ut.prototype.set=function(t){if(this.current!==t||!0===this.dirty){var e=this.context.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}};var lt=function(t){this.context=t,this.default=[0,1],this.current=this.default,this.dirty=!1};lt.prototype.get=function(){return this.current},lt.prototype.setDefault=function(){this.set(this.default)},lt.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&!0!==this.dirty||(this.context.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)};var ct=function(t){this.context=t,this.default=!1,this.current=this.default,this.dirty=!1};ct.prototype.get=function(){return this.current},ct.prototype.setDefault=function(){this.set(this.default)},ct.prototype.set=function(t){if(this.current!==t||!0===this.dirty){var e=this.context.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}};var ht=function(t){this.context=t,this.default=t.gl.LESS,this.current=this.default,this.dirty=!1};ht.prototype.get=function(){return this.current},ht.prototype.setDefault=function(){this.set(this.default)},ht.prototype.set=function(t){this.current===t&&!0!==this.dirty||(this.context.gl.depthFunc(t),this.current=t,this.dirty=!1)};var pt=function(t){this.context=t,this.default=!1,this.current=this.default,this.dirty=!1};pt.prototype.get=function(){return this.current},pt.prototype.setDefault=function(){this.set(this.default)},pt.prototype.set=function(t){if(this.current!==t||!0===this.dirty){var e=this.context.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}};var ft=function(t){this.context=t;var e=this.context.gl;this.default=[e.ONE,e.ZERO],this.current=this.default,this.dirty=!1};ft.prototype.get=function(){return this.current},ft.prototype.setDefault=function(){this.set(this.default)},ft.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&!0!==this.dirty||(this.context.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)};var dt=function(e){this.context=e,this.default=t.Color.transparent,this.current=this.default,this.dirty=!1};dt.prototype.get=function(){return this.current},dt.prototype.setDefault=function(){this.set(this.default)},dt.prototype.set=function(t){var e=this.current;t.r===e.r&&t.g===e.g&&t.b===e.b&&t.a===e.a&&!0!==this.dirty||(this.context.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)};var mt=function(t){this.context=t,this.default=this.context.gl.FUNC_ADD,this.current=this.default,this.dirty=!1};mt.prototype.get=function(){return this.current},mt.prototype.setDefault=function(){this.set(this.default)},mt.prototype.set=function(t){t===this.current&&!0!==this.dirty||(this.context.gl.blendEquation(t),this.current=t,this.dirty=!1)};var yt=function(t){this.context=t,this.default=!1,this.current=this.default,this.dirty=!1};yt.prototype.get=function(){return this.current},yt.prototype.setDefault=function(){this.set(this.default)},yt.prototype.set=function(t){if(this.current!==t||!0===this.dirty){var e=this.context.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}};var vt=function(t){this.context=t;var e=this.context.gl;this.default=e.BACK,this.current=this.default,this.dirty=!1};vt.prototype.get=function(){return this.current},vt.prototype.setDefault=function(){this.set(this.default)},vt.prototype.set=function(t){this.current===t&&!0!==this.dirty||(this.context.gl.cullFace(t),this.current=t,this.dirty=!1)};var gt=function(t){this.context=t;var e=this.context.gl;this.default=e.CCW,this.current=this.default,this.dirty=!1};gt.prototype.get=function(){return this.current},gt.prototype.setDefault=function(){this.set(this.default)},gt.prototype.set=function(t){this.current===t&&!0!==this.dirty||(this.context.gl.frontFace(t),this.current=t,this.dirty=!1)};var _t=function(t){this.context=t,this.default=null,this.current=this.default,this.dirty=!1};_t.prototype.get=function(){return this.current},_t.prototype.setDefault=function(){this.set(this.default)},_t.prototype.set=function(t){this.current===t&&!0!==this.dirty||(this.context.gl.useProgram(t),this.current=t,this.dirty=!1)};var xt=function(t){this.context=t,this.default=t.gl.TEXTURE0,this.current=this.default,this.dirty=!1};xt.prototype.get=function(){return this.current},xt.prototype.setDefault=function(){this.set(this.default)},xt.prototype.set=function(t){this.current===t&&!0!==this.dirty||(this.context.gl.activeTexture(t),this.current=t,this.dirty=!1)};var bt=function(t){this.context=t;var e=this.context.gl;this.default=[0,0,e.drawingBufferWidth,e.drawingBufferHeight],this.current=this.default,this.dirty=!1};bt.prototype.get=function(){return this.current},bt.prototype.setDefault=function(){this.set(this.default)},bt.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&!0!==this.dirty||(this.context.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)};var wt=function(t){this.context=t,this.default=null,this.current=this.default,this.dirty=!1};wt.prototype.get=function(){return this.current},wt.prototype.setDefault=function(){this.set(this.default)},wt.prototype.set=function(t){if(this.current!==t||!0===this.dirty){var e=this.context.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}};var Et=function(t){this.context=t,this.default=null,this.current=this.default,this.dirty=!1};Et.prototype.get=function(){return this.current},Et.prototype.setDefault=function(){this.set(this.default)},Et.prototype.set=function(t){if(this.current!==t||!0===this.dirty){var e=this.context.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}};var St=function(t){this.context=t,this.default=null,this.current=this.default,this.dirty=!1};St.prototype.get=function(){return this.current},St.prototype.setDefault=function(){this.set(this.default)},St.prototype.set=function(t){if(this.current!==t||!0===this.dirty){var e=this.context.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}};var Tt=function(t){this.context=t,this.default=null,this.current=this.default,this.dirty=!1};Tt.prototype.get=function(){return this.current},Tt.prototype.setDefault=function(){this.set(this.default)},Tt.prototype.set=function(t){if(this.current!==t||!0===this.dirty){var e=this.context.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}};var kt=function(t){this.context=t,this.default=null,this.current=this.default,this.dirty=!1};kt.prototype.get=function(){return this.current},kt.prototype.setDefault=function(){this.set(this.default)},kt.prototype.set=function(t){var e=this.context.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1};var Mt=function(t){this.context=t,this.default=null,this.current=this.default,this.dirty=!1};Mt.prototype.get=function(){return this.current},Mt.prototype.setDefault=function(){this.set(this.default)},Mt.prototype.set=function(t){(this.current!==t&&this.context.extVertexArrayObject||!0===this.dirty)&&(this.context.extVertexArrayObject.bindVertexArrayOES(t),this.current=t,this.dirty=!1)};var At=function(t){this.context=t,this.default=4,this.current=this.default,this.dirty=!1};At.prototype.get=function(){return this.current},At.prototype.setDefault=function(){this.set(this.default)},At.prototype.set=function(t){if(this.current!==t||!0===this.dirty){var e=this.context.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}};var Pt=function(t){this.context=t,this.default=!1,this.current=this.default,this.dirty=!1};Pt.prototype.get=function(){return this.current},Pt.prototype.setDefault=function(){this.set(this.default)},Pt.prototype.set=function(t){if(this.current!==t||!0===this.dirty){var e=this.context.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}};var zt=function(t){this.context=t,this.default=!1,this.current=this.default,this.dirty=!1};zt.prototype.get=function(){return this.current},zt.prototype.setDefault=function(){this.set(this.default)},zt.prototype.set=function(t){if(this.current!==t||!0===this.dirty){var e=this.context.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}};var It=function(t,e){this.context=t,this.default=null,this.current=this.default,this.dirty=!1,this.parent=e};It.prototype.get=function(){return this.current};var Ct=function(t){function e(e,n){t.call(this,e,n),this.dirty=!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setDefault=function(){this.set(this.default)},e.prototype.set=function(t){if(this.dirty||this.current!==t){var e=this.context.gl;this.context.bindFramebuffer.set(this.parent),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}},e.prototype.setDirty=function(){this.dirty=!0},e}(It),Lt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setDefault=function(){this.set(this.default)},e.prototype.set=function(t){if(this.current!==t||!0===this.dirty){var e=this.context.gl;this.context.bindFramebuffer.set(this.parent),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(It),Ot=function(t,e,n){this.context=t,this.width=e,this.height=n;var r=t.gl,i=this.framebuffer=r.createFramebuffer();this.colorAttachment=new Ct(t,i),this.depthAttachment=new Lt(t,i)};Ot.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();e&&t.deleteTexture(e);var n=this.depthAttachment.get();n&&t.deleteRenderbuffer(n),t.deleteFramebuffer(this.framebuffer)};var Dt=function(t,e,n){this.func=t,this.mask=e,this.range=n};Dt.ReadOnly=!1,Dt.ReadWrite=!0,Dt.disabled=new Dt(519,Dt.ReadOnly,[0,1]);var Rt=function(t,e,n,r,i,o){this.test=t,this.ref=e,this.mask=n,this.fail=r,this.depthFail=i,this.pass=o};Rt.disabled=new Rt({func:519,mask:0},0,0,7680,7680,7680);var Bt=function(t,e,n){this.blendFunction=t,this.blendColor=e,this.mask=n};Bt.disabled=new Bt(Bt.Replace=[1,0],t.Color.transparent,[!1,!1,!1,!1]),Bt.unblended=new Bt(Bt.Replace,t.Color.transparent,[!0,!0,!0,!0]),Bt.alphaBlended=new Bt([1,771],t.Color.transparent,[!0,!0,!0,!0]);var Ft=function(t,e,n){this.enable=t,this.mode=e,this.frontFace=n};Ft.disabled=new Ft(!1,1029,2305),Ft.backCCW=new Ft(!0,1029,2305);var jt=function(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new tt(this),this.clearDepth=new et(this),this.clearStencil=new nt(this),this.colorMask=new rt(this),this.depthMask=new it(this),this.stencilMask=new ot(this),this.stencilFunc=new at(this),this.stencilOp=new st(this),this.stencilTest=new ut(this),this.depthRange=new lt(this),this.depthTest=new ct(this),this.depthFunc=new ht(this),this.blend=new pt(this),this.blendFunc=new ft(this),this.blendColor=new dt(this),this.blendEquation=new mt(this),this.cullFace=new yt(this),this.cullFaceSide=new vt(this),this.frontFace=new gt(this),this.program=new _t(this),this.activeTexture=new xt(this),this.viewport=new bt(this),this.bindFramebuffer=new wt(this),this.bindRenderbuffer=new Et(this),this.bindTexture=new St(this),this.bindVertexBuffer=new Tt(this),this.bindElementBuffer=new kt(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new Mt(this),this.pixelStoreUnpack=new At(this),this.pixelStoreUnpackPremultiplyAlpha=new Pt(this),this.pixelStoreUnpackFlipY=new zt(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=t.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&t.getExtension("OES_texture_half_float_linear")};jt.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},jt.prototype.createIndexBuffer=function(t,e){return new J(this,t,e)},jt.prototype.createVertexBuffer=function(t,e,n){return new Q(this,t,e,n)},jt.prototype.createRenderbuffer=function(t,e,n){var r=this.gl,i=r.createRenderbuffer();return this.bindRenderbuffer.set(i),r.renderbufferStorage(r.RENDERBUFFER,t,e,n),this.bindRenderbuffer.set(null),i},jt.prototype.createFramebuffer=function(t,e){return new Ot(this,t,e)},jt.prototype.clear=function(t){var e=t.color,n=t.depth,r=this.gl,i=0;e&&(i|=r.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==n&&(i|=r.DEPTH_BUFFER_BIT,this.clearDepth.set(n),this.depthMask.set(!0)),r.clear(i)},jt.prototype.setCullFace=function(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))},jt.prototype.setDepthMode=function(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)},jt.prototype.setStencilMode=function(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)},jt.prototype.setColorMode=function(e){t.isEqual(e.blendFunction,Bt.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)},jt.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var Vt=function(e){function n(n,r,i){var o=this;e.call(this),this.id=n,this.dispatcher=i,this.on("data",(function(t){"source"===t.dataType&&"metadata"===t.sourceDataType&&(o._sourceLoaded=!0),o._sourceLoaded&&!o._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(o.reload(),o.transform&&o.update(o.transform))})),this.on("error",(function(){o._sourceErrored=!0})),this._source=function(e,n,r,i){var o=new W[n.type](e,n,r,i);if(o.id!==e)throw new Error("Expected Source id to be "+e+" instead of "+o.id);return t.bindAll(["load","abort","unload","serialize","prepare"],o),o}(n,r,i,this),this._tiles={},this._cache=new K(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._coveredTiles={},this._state=new t.SourceFeatureState}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t)},n.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t)},n.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0},n.prototype.getSource=function(){return this._source},n.prototype.pause=function(){this._paused=!0},n.prototype.resume=function(){if(this._paused){var t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform)}},n.prototype._loadTile=function(t,e){return this._source.loadTile(t,e)},n.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,(function(){}))},n.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,(function(){}))},n.prototype.serialize=function(){return this._source.serialize()},n.prototype.prepare=function(t){for(var e in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles)this._tiles[e].upload(t)},n.prototype.getIds=function(){return Object.keys(this._tiles).map(Number).sort(Ut)},n.prototype.getRenderableIds=function(e){var n=this,r=[];for(var i in n._tiles)n._isIdRenderable(+i,e)&&r.push(+i);return e?r.sort((function(e,r){var i=n._tiles[e].tileID,o=n._tiles[r].tileID,a=new t.Point(i.canonical.x,i.canonical.y)._rotate(n.transform.angle),s=new t.Point(o.canonical.x,o.canonical.y)._rotate(n.transform.angle);return i.overscaledZ-o.overscaledZ||s.y-a.y||s.x-a.x})):r.sort(Ut)},n.prototype.hasRenderableParent=function(t){var e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)},n.prototype._isIdRenderable=function(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())},n.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var t in this._cache.reset(),this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")},n.prototype._reloadTile=function(t,e){var n=this._tiles[t];n&&("loading"!==n.state&&(n.state=e),this._loadTile(n,this._tileLoaded.bind(this,n,t,e)))},n.prototype._tileLoaded=function(e,n,r,i){if(i)return e.state="errored",void(404!==i.status?this._source.fire(new t.ErrorEvent(i,{tile:e})):this.update(this.transform));e.timeAdded=t.browser.now(),"expired"===r&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(n,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new t.Event("data",{dataType:"source",tile:e,coord:e.tileID}))},n.prototype._backfillDEM=function(t){for(var e=this.getRenderableIds(),n=0;n<e.length;n++){var r=e[n];if(t.neighboringTiles&&t.neighboringTiles[r]){var i=this.getTileByID(r);o(t,i),o(i,t)}}function o(t,e){t.needsHillshadePrepare=!0;var n=e.tileID.canonical.x-t.tileID.canonical.x,r=e.tileID.canonical.y-t.tileID.canonical.y,i=Math.pow(2,t.tileID.canonical.z),o=e.tileID.key;0===n&&0===r||Math.abs(r)>1||(Math.abs(n)>1&&(1===Math.abs(n+i)?n+=i:1===Math.abs(n-i)&&(n-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,n,r),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}},n.prototype.getTile=function(t){return this.getTileByID(t.key)},n.prototype.getTileByID=function(t){return this._tiles[t]},n.prototype.getZoom=function(t){return t.zoom+t.scaleZoom(t.tileSize/this._source.tileSize)},n.prototype._retainLoadedChildren=function(t,e,n,r){for(var i in this._tiles){var o=this._tiles[i];if(!(r[i]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>n)){for(var a=o.tileID;o&&o.tileID.overscaledZ>e+1;){var s=o.tileID.scaledTo(o.tileID.overscaledZ-1);(o=this._tiles[s.key])&&o.hasData()&&(a=s)}for(var u=a;u.overscaledZ>e;)if(t[(u=u.scaledTo(u.overscaledZ-1)).key]){r[a.key]=a;break}}}},n.prototype.findLoadedParent=function(t,e){for(var n=t.overscaledZ-1;n>=e;n--){var r=t.scaledTo(n);if(!r)return;var i=String(r.key),o=this._tiles[i];if(o&&o.hasData())return o;if(this._cache.has(r))return this._cache.get(r)}},n.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),n=Math.floor(5*e),r="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._cache.setMaxSize(r)},n.prototype.handleWrapJump=function(t){var e=(t-(void 0===this._prevLng?t:this._prevLng))/360,n=Math.round(e);if(this._prevLng=t,n){var r={};for(var i in this._tiles){var o=this._tiles[i];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+n),r[o.tileID.key]=o}for(var a in this._tiles=r,this._timers)clearTimeout(this._timers[a]),delete this._timers[a];for(var s in this._tiles){var u=this._tiles[s];this._setTileReloadTimer(s,u)}}},n.prototype.update=function(e){var r=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(t){return r._source.hasTile(t)})))):i=[];var o=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(e)),a=Math.max(o-n.maxOverzooming,this._source.minzoom),s=Math.max(o+n.maxUnderzooming,this._source.minzoom),u=this._updateRetainedTiles(i,o);if(qt(this._source.type)){for(var l={},c={},h=0,p=Object.keys(u);h<p.length;h+=1){var f=p[h],d=u[f],m=r._tiles[f];if(m&&!(m.fadeEndTime&&m.fadeEndTime<=t.browser.now())){var y=r.findLoadedParent(d,a);y&&(r._addTile(y.tileID),l[y.tileID.key]=y.tileID),c[f]=d}}for(var v in this._retainLoadedChildren(c,o,s,u),l)u[v]||(r._coveredTiles[v]=!0,u[v]=l[v])}for(var g in u)r._tiles[g].clearFadeHold();for(var _=0,x=t.keysDifference(this._tiles,u);_<x.length;_+=1){var b=x[_],w=r._tiles[b];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(r.map._fadeDuration):w.hasSymbolBuckets&&!w.symbolFadeFinished()||r._removeTile(b)}}},n.prototype.releaseSymbolFadeTiles=function(){for(var t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)},n.prototype._updateRetainedTiles=function(t,e){for(var r={},i={},o=Math.max(e-n.maxOverzooming,this._source.minzoom),a=Math.max(e+n.maxUnderzooming,this._source.minzoom),s={},u=0,l=t;u<l.length;u+=1){var c=l[u],h=this._addTile(c);r[c.key]=c,h.hasData()||e<this._source.maxzoom&&(s[c.key]=c)}this._retainLoadedChildren(s,e,a,r);for(var p=0,f=t;p<f.length;p+=1){var d=f[p],m=this._tiles[d.key];if(!m.hasData()){if(e+1>this._source.maxzoom){var y=d.children(this._source.maxzoom)[0],v=this.getTile(y);if(v&&v.hasData()){r[y.key]=y;continue}}else{var g=d.children(this._source.maxzoom);if(r[g[0].key]&&r[g[1].key]&&r[g[2].key]&&r[g[3].key])continue}for(var _=m.wasRequested(),x=d.overscaledZ-1;x>=o;--x){var b=d.scaledTo(x);if(i[b.key])break;if(i[b.key]=!0,!(m=this.getTile(b))&&_&&(m=this._addTile(b)),m&&(r[b.key]=b,_=m.wasRequested(),m.hasData()))break}}}return r},n.prototype._addTile=function(e){var n=this._tiles[e.key];if(n)return n;(n=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,n),n.tileID=e,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,n)));var r=Boolean(n);return r||(n=new t.Tile(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(n,this._tileLoaded.bind(this,n,e.key,n.state))),n?(n.uses++,this._tiles[e.key]=n,r||this._source.fire(new t.Event("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n):null},n.prototype._setTileReloadTimer=function(t,e){var n=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var r=e.getExpiryTimeout();r&&(this._timers[t]=setTimeout((function(){n._reloadTile(t,"expired"),delete n._timers[t]}),r))},n.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},n.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},n.prototype.tilesIn=function(e,n){for(var r=[],i=this.getIds(),o=1/0,a=1/0,s=-1/0,u=-1/0,l=e[0].zoom,c=0;c<e.length;c++){var h=e[c];o=Math.min(o,h.column),a=Math.min(a,h.row),s=Math.max(s,h.column),u=Math.max(u,h.row)}for(var p=0;p<i.length;p++){var f=this._tiles[i[p]];if(!f.holdingForFade()){var d=f.tileID,m=Math.pow(2,this.transform.zoom-f.tileID.overscaledZ),y=n*f.queryPadding*t.EXTENT/f.tileSize/m,v=[Nt(d,new t.Coordinate(o,a,l)),Nt(d,new t.Coordinate(s,u,l))];if(v[0].x-y<t.EXTENT&&v[0].y-y<t.EXTENT&&v[1].x+y>=0&&v[1].y+y>=0){for(var g=[],_=0;_<e.length;_++)g.push(Nt(d,e[_]));r.push({tile:f,tileID:d,queryGeometry:[g],scale:m})}}}return r},n.prototype.getVisibleCoordinates=function(t){for(var e=this,n=this.getRenderableIds(t).map((function(t){return e._tiles[t].tileID})),r=0,i=n;r<i.length;r+=1){var o=i[r];o.posMatrix=e.transform.calculatePosMatrix(o.toUnwrapped())}return n},n.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(qt(this._source.type))for(var e in this._tiles){var n=this._tiles[e];if(void 0!==n.fadeEndTime&&n.fadeEndTime>=t.browser.now())return!0}return!1},n.prototype.setFeatureState=function(t,e,n){t=t||"_geojsonTileLayer",this._state.updateState(t,e,n)},n.prototype.getFeatureState=function(t,e){return t=t||"_geojsonTileLayer",this._state.getState(t,e)},n}(t.Evented);function Nt(e,n){var r=n.zoomTo(e.canonical.z);return new t.Point((r.column-(e.canonical.x+e.wrap*Math.pow(2,e.canonical.z)))*t.EXTENT,(r.row-e.canonical.y)*t.EXTENT)}function Ut(t,e){return t%32-e%32||e-t}function qt(t){return"raster"===t||"image"===t||"video"===t}function Zt(){return new t.window.Worker(Br.workerUrl)}Vt.maxOverzooming=10,Vt.maxUnderzooming=3;var Gt,Xt=function(){this.active={}};function Wt(e,n){var r={};for(var i in e)"ref"!==i&&(r[i]=e[i]);return t.refProperties.forEach((function(t){t in n&&(r[t]=n[t])})),r}function Ht(t){t=t.slice();for(var e=Object.create(null),n=0;n<t.length;n++)e[t[n].id]=t[n];for(var r=0;r<t.length;r++)"ref"in t[r]&&(t[r]=Wt(t[r],e[t[r].ref]));return t}Xt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<Xt.workerCount;)this.workers.push(new Zt);return this.active[t]=!0,this.workers.slice()},Xt.prototype.release=function(t){delete this.active[t],0===Object.keys(this.active).length&&(this.workers.forEach((function(t){t.terminate()})),this.workers=null)},Xt.workerCount=Math.max(Math.floor(t.browser.hardwareConcurrency/2),1);var Yt={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function Kt(t,e,n){n.push({command:Yt.addSource,args:[t,e[t]]})}function Jt(t,e,n){e.push({command:Yt.removeSource,args:[t]}),n[t]=!0}function $t(t,e,n,r){Jt(t,n,r),Kt(t,e,n)}function Qt(e,n,r){var i;for(i in e[r])if(e[r].hasOwnProperty(i)&&"data"!==i&&!t.isEqual(e[r][i],n[r][i]))return!1;for(i in n[r])if(n[r].hasOwnProperty(i)&&"data"!==i&&!t.isEqual(e[r][i],n[r][i]))return!1;return!0}function te(e,n,r,i,o,a){var s;for(s in n=n||{},e=e||{})e.hasOwnProperty(s)&&(t.isEqual(e[s],n[s])||r.push({command:a,args:[i,s,n[s],o]}));for(s in n)n.hasOwnProperty(s)&&!e.hasOwnProperty(s)&&(t.isEqual(e[s],n[s])||r.push({command:a,args:[i,s,n[s],o]}))}function ee(t){return t.id}function ne(t,e){return t[e.id]=e,t}var re=function(t,e,n){var r=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/n),this.yCellCount=Math.ceil(e/n);for(var o=0;o<this.xCellCount*this.yCellCount;o++)r.push([]),i.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0};re.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},re.prototype.insert=function(t,e,n,r,i){this._forEachCell(e,n,r,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(n),this.bboxes.push(r),this.bboxes.push(i)},re.prototype.insertCircle=function(t,e,n,r){this._forEachCell(e-r,n-r,e+r,n+r,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(n),this.circles.push(r)},re.prototype._insertBoxCell=function(t,e,n,r,i,o){this.boxCells[i].push(o)},re.prototype._insertCircleCell=function(t,e,n,r,i,o){this.circleCells[i].push(o)},re.prototype._query=function(t,e,n,r,i,o){if(n<0||t>this.width||r<0||e>this.height)return!i&&[];var a=[];if(t<=0&&e<=0&&this.width<=n&&this.height<=r){if(i)return!0;for(var s=0;s<this.boxKeys.length;s++)a.push({key:this.boxKeys[s],x1:this.bboxes[4*s],y1:this.bboxes[4*s+1],x2:this.bboxes[4*s+2],y2:this.bboxes[4*s+3]});for(var u=0;u<this.circleKeys.length;u++){var l=this.circles[3*u],c=this.circles[3*u+1],h=this.circles[3*u+2];a.push({key:this.circleKeys[u],x1:l-h,y1:c-h,x2:l+h,y2:c+h})}return o?a.filter(o):a}var p={hitTest:i,seenUids:{box:{},circle:{}}};return this._forEachCell(t,e,n,r,this._queryCell,a,p,o),i?a.length>0:a},re.prototype._queryCircle=function(t,e,n,r,i){var o=t-n,a=t+n,s=e-n,u=e+n;if(a<0||o>this.width||u<0||s>this.height)return!r&&[];var l=[],c={hitTest:r,circle:{x:t,y:e,radius:n},seenUids:{box:{},circle:{}}};return this._forEachCell(o,s,a,u,this._queryCellCircle,l,c,i),r?l.length>0:l},re.prototype.query=function(t,e,n,r,i){return this._query(t,e,n,r,!1,i)},re.prototype.hitTest=function(t,e,n,r,i){return this._query(t,e,n,r,!0,i)},re.prototype.hitTestCircle=function(t,e,n,r){return this._queryCircle(t,e,n,!0,r)},re.prototype._queryCell=function(t,e,n,r,i,o,a,s){var u=a.seenUids,l=this.boxCells[i];if(null!==l)for(var c=this.bboxes,h=0,p=l;h<p.length;h+=1){var f=p[h];if(!u.box[f]){u.box[f]=!0;var d=4*f;if(t<=c[d+2]&&e<=c[d+3]&&n>=c[d+0]&&r>=c[d+1]&&(!s||s(this.boxKeys[f]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[f],x1:c[d],y1:c[d+1],x2:c[d+2],y2:c[d+3]})}}}var m=this.circleCells[i];if(null!==m)for(var y=this.circles,v=0,g=m;v<g.length;v+=1){var _=g[v];if(!u.circle[_]){u.circle[_]=!0;var x=3*_;if(this._circleAndRectCollide(y[x],y[x+1],y[x+2],t,e,n,r)&&(!s||s(this.circleKeys[_]))){if(a.hitTest)return o.push(!0),!0;var b=y[x],w=y[x+1],E=y[x+2];o.push({key:this.circleKeys[_],x1:b-E,y1:w-E,x2:b+E,y2:w+E})}}}},re.prototype._queryCellCircle=function(t,e,n,r,i,o,a,s){var u=a.circle,l=a.seenUids,c=this.boxCells[i];if(null!==c)for(var h=this.bboxes,p=0,f=c;p<f.length;p+=1){var d=f[p];if(!l.box[d]){l.box[d]=!0;var m=4*d;if(this._circleAndRectCollide(u.x,u.y,u.radius,h[m+0],h[m+1],h[m+2],h[m+3])&&(!s||s(this.boxKeys[d])))return o.push(!0),!0}}var y=this.circleCells[i];if(null!==y)for(var v=this.circles,g=0,_=y;g<_.length;g+=1){var x=_[g];if(!l.circle[x]){l.circle[x]=!0;var b=3*x;if(this._circlesCollide(v[b],v[b+1],v[b+2],u.x,u.y,u.radius)&&(!s||s(this.circleKeys[x])))return o.push(!0),!0}}},re.prototype._forEachCell=function(t,e,n,r,i,o,a,s){for(var u=this._convertToXCellCoord(t),l=this._convertToYCellCoord(e),c=this._convertToXCellCoord(n),h=this._convertToYCellCoord(r),p=u;p<=c;p++)for(var f=l;f<=h;f++){var d=this.xCellCount*f+p;if(i.call(this,t,e,n,r,d,o,a,s))return}},re.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},re.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},re.prototype._circlesCollide=function(t,e,n,r,i,o){var a=r-t,s=i-e,u=n+o;return u*u>a*a+s*s},re.prototype._circleAndRectCollide=function(t,e,n,r,i,o,a){var s=(o-r)/2,u=Math.abs(t-(r+s));if(u>s+n)return!1;var l=(a-i)/2,c=Math.abs(e-(i+l));if(c>l+n)return!1;if(u<=s||c<=l)return!0;var h=u-s,p=c-l;return h*h+p*p<=n*n};var ie=t.properties.layout;function oe(e,n,r,i,o){var a=t.identity(new Float32Array(16));return n?(t.identity(a),t.scale(a,a,[1/o,1/o,1]),r||t.rotateZ(a,a,i.angle)):(t.scale(a,a,[i.width/2,-i.height/2,1]),t.translate(a,a,[1,-1,0]),t.multiply(a,a,e)),a}function ae(e,n,r,i,o){var a=t.identity(new Float32Array(16));return n?(t.multiply(a,a,e),t.scale(a,a,[o,o,1]),r||t.rotateZ(a,a,-i.angle)):(t.scale(a,a,[1,-1,1]),t.translate(a,a,[-1,-1,0]),t.scale(a,a,[2/i.width,2/i.height,1])),a}function se(e,n){var r=[e.x,e.y,0,1];ve(r,r,n);var i=r[3];return{point:new t.Point(r[0]/i,r[1]/i),signedDistanceFromCamera:i}}function ue(t,e){var n=t[0]/t[3],r=t[1]/t[3];return n>=-e[0]&&n<=e[0]&&r>=-e[1]&&r<=e[1]}function le(e,n,r,i,o,a,s,u){var l=i?e.textSizeData:e.iconSizeData,c=t.evaluateSizeForZoom(l,r.transform.zoom,ie.properties[i?"text-size":"icon-size"]),h=[256/r.width*2+1,256/r.height*2+1],p=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;p.clear();for(var f=e.lineVertexArray,d=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,m=r.transform.width/r.transform.height,y=!1,v=0;v<d.length;v++){var g=d.get(v);if(g.hidden||g.writingMode===t.WritingMode.vertical&&!y)ye(g.numGlyphs,p);else{y=!1;var _=[g.anchorX,g.anchorY,0,1];if(t.transformMat4(_,_,n),ue(_,h)){var x=.5+_[3]/r.transform.cameraToCenterDistance*.5,b=t.evaluateSizeForFeature(l,c,g),w=s?b*x:b/x,E=new t.Point(g.anchorX,g.anchorY),S=se(E,o).point,T={},k=pe(g,w,!1,u,n,o,a,e.glyphOffsetArray,f,p,S,E,T,m);y=k.useVertical,(k.notEnoughRoom||y||k.needsFlipping&&pe(g,w,!0,u,n,o,a,e.glyphOffsetArray,f,p,S,E,T,m).notEnoughRoom)&&ye(g.numGlyphs,p)}else ye(g.numGlyphs,p)}}i?e.text.dynamicLayoutVertexBuffer.updateData(p):e.icon.dynamicLayoutVertexBuffer.updateData(p)}function ce(t,e,n,r,i,o,a,s,u,l,c,h){var p=s.glyphStartIndex+s.numGlyphs,f=s.lineStartIndex,d=s.lineStartIndex+s.lineLength,m=e.getoffsetX(s.glyphStartIndex),y=e.getoffsetX(p-1),v=de(t*m,n,r,i,o,a,s.segment,f,d,u,l,c,h);if(!v)return null;var g=de(t*y,n,r,i,o,a,s.segment,f,d,u,l,c,h);return g?{first:v,last:g}:null}function he(e,n,r,i){return e===t.WritingMode.horizontal&&Math.abs(r.y-n.y)>Math.abs(r.x-n.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?n.y<r.y:n.x>r.x)?{needsFlipping:!0}:null}function pe(e,n,r,i,o,a,s,u,l,c,h,p,f,d){var m,y=n/24,v=e.lineOffsetX*n,g=e.lineOffsetY*n;if(e.numGlyphs>1){var _=e.glyphStartIndex+e.numGlyphs,x=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,w=ce(y,u,v,g,r,h,p,e,l,a,f,!1);if(!w)return{notEnoughRoom:!0};var E=se(w.first.point,s).point,S=se(w.last.point,s).point;if(i&&!r){var T=he(e.writingMode,E,S,d);if(T)return T}m=[w.first];for(var k=e.glyphStartIndex+1;k<_-1;k++)m.push(de(y*u.getoffsetX(k),v,g,r,h,p,e.segment,x,b,l,a,f,!1));m.push(w.last)}else{if(i&&!r){var M=se(p,o).point,A=e.lineStartIndex+e.segment+1,P=new t.Point(l.getx(A),l.gety(A)),z=se(P,o),I=z.signedDistanceFromCamera>0?z.point:fe(p,P,M,1,o),C=he(e.writingMode,M,I,d);if(C)return C}var L=de(y*u.getoffsetX(e.glyphStartIndex),v,g,r,h,p,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,l,a,f,!1);if(!L)return{notEnoughRoom:!0};m=[L]}for(var O=0,D=m;O<D.length;O+=1){var R=D[O];t.addDynamicAttributes(c,R.point,R.angle)}return{}}function fe(t,e,n,r,i){var o=se(t.add(t.sub(e)._unit()),i).point,a=n.sub(o);return n.add(a._mult(r/a.mag()))}function de(e,n,r,i,o,a,s,u,l,c,h,p,f){var d=i?e-n:e+n,m=d>0?1:-1,y=0;i&&(m*=-1,y=Math.PI),m<0&&(y+=Math.PI);for(var v=m>0?u+s:u+s+1,g=v,_=o,x=o,b=0,w=0,E=Math.abs(d);b+w<=E;){if((v+=m)<u||v>=l)return null;if(x=_,void 0===(_=p[v])){var S=new t.Point(c.getx(v),c.gety(v)),T=se(S,h);if(T.signedDistanceFromCamera>0)_=p[v]=T.point;else{var k=v-m;_=fe(0===b?a:new t.Point(c.getx(k),c.gety(k)),S,x,E-b+1,h)}}b+=w,w=x.dist(_)}var M=(E-b)/w,A=_.sub(x),P=A.mult(M)._add(x);return P._add(A._unit()._perp()._mult(r*m)),{point:P,angle:y+Math.atan2(_.y-x.y,_.x-x.x),tileDistance:f?{prevTileDistance:v-m===g?0:c.gettileUnitDistanceFromAnchor(v-m),lastSegmentViewportDistance:E-b}:null}}var me=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ye(t,e){for(var n=0;n<t;n++){var r=e.length;e.resize(r+4),e.float32.set(me,3*r)}}function ve(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t[3]=n[3]*r+n[7]*i+n[15],t}var ge=function(t,e,n){void 0===e&&(e=new re(t.width+200,t.height+200,25)),void 0===n&&(n=new re(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=n,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200};function _e(t,e,n){t[e+4]=n?1:0}function xe(e,n,r){return n*(t.EXTENT/(e.tileSize*Math.pow(2,r-e.tileID.overscaledZ)))}ge.prototype.placeCollisionBox=function(t,e,n,r,i){var o=this.projectAndGetPerspectiveRatio(r,t.anchorPointX,t.anchorPointY),a=n*o.perspectiveRatio,s=t.x1*a+o.point.x,u=t.y1*a+o.point.y,l=t.x2*a+o.point.x,c=t.y2*a+o.point.y;return!this.isInsideGrid(s,u,l,c)||!e&&this.grid.hitTest(s,u,l,c,i)?{box:[],offscreen:!1}:{box:[s,u,l,c],offscreen:this.isOffscreen(s,u,l,c)}},ge.prototype.approximateTileDistance=function(t,e,n,r,i){var o=i?1:r/this.pitchfactor,a=t.lastSegmentViewportDistance*n;return t.prevTileDistance+a+(o-1)*a*Math.abs(Math.sin(e))},ge.prototype.placeCollisionCircles=function(e,n,r,i,o,a,s,u,l,c,h,p,f){var d=[],m=this.projectAnchor(l,o.anchorX,o.anchorY),y=u/24,v=o.lineOffsetX*u,g=o.lineOffsetY*u,_=new t.Point(o.anchorX,o.anchorY),x=ce(y,s,v,g,!1,se(_,c).point,_,o,a,c,{},!0),b=!1,w=!1,E=!0,S=m.perspectiveRatio*i,T=1/(i*r),k=0,M=0;x&&(k=this.approximateTileDistance(x.first.tileDistance,x.first.angle,T,m.cameraDistance,p),M=this.approximateTileDistance(x.last.tileDistance,x.last.angle,T,m.cameraDistance,p));for(var A=0;A<e.length;A+=5){var P=e[A],z=e[A+1],I=e[A+2],C=e[A+3];if(!x||C<-k||C>M)_e(e,A,!1);else{var L=this.projectPoint(l,P,z),O=I*S;if(d.length>0){var D=L.x-d[d.length-4],R=L.y-d[d.length-3];if(O*O*2>D*D+R*R&&A+8<e.length){var B=e[A+8];if(B>-k&&B<M){_e(e,A,!1);continue}}}var F=A/5;d.push(L.x,L.y,O,F),_e(e,A,!0);var j=L.x-O,V=L.y-O,N=L.x+O,U=L.y+O;if(E=E&&this.isOffscreen(j,V,N,U),w=w||this.isInsideGrid(j,V,N,U),!n&&this.grid.hitTestCircle(L.x,L.y,O,f)){if(!h)return{circles:[],offscreen:!1};b=!0}}}return{circles:b||!w?[]:d,offscreen:E}},ge.prototype.queryRenderedSymbols=function(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};for(var n=[],r=1/0,i=1/0,o=-1/0,a=-1/0,s=0,u=e;s<u.length;s+=1){var l=u[s],c=new t.Point(l.x+100,l.y+100);r=Math.min(r,c.x),i=Math.min(i,c.y),o=Math.max(o,c.x),a=Math.max(a,c.y),n.push(c)}for(var h={},p={},f=0,d=this.grid.query(r,i,o,a).concat(this.ignoredGrid.query(r,i,o,a));f<d.length;f+=1){var m=d[f],y=m.key;if(void 0===h[y.bucketInstanceId]&&(h[y.bucketInstanceId]={}),!h[y.bucketInstanceId][y.featureIndex]){var v=[new t.Point(m.x1,m.y1),new t.Point(m.x2,m.y1),new t.Point(m.x2,m.y2),new t.Point(m.x1,m.y2)];t.polygonIntersectsPolygon(n,v)&&(h[y.bucketInstanceId][y.featureIndex]=!0,void 0===p[y.bucketInstanceId]&&(p[y.bucketInstanceId]=[]),p[y.bucketInstanceId].push(y.featureIndex))}}return p},ge.prototype.insertCollisionBox=function(t,e,n,r,i){var o={bucketInstanceId:n,featureIndex:r,collisionGroupID:i};(e?this.ignoredGrid:this.grid).insert(o,t[0],t[1],t[2],t[3])},ge.prototype.insertCollisionCircles=function(t,e,n,r,i){for(var o=e?this.ignoredGrid:this.grid,a={bucketInstanceId:n,featureIndex:r,collisionGroupID:i},s=0;s<t.length;s+=4)o.insertCircle(a,t[s],t[s+1],t[s+2])},ge.prototype.projectAnchor=function(t,e,n){var r=[e,n,0,1];return ve(r,r,t),{perspectiveRatio:.5+this.transform.cameraToCenterDistance/r[3]*.5,cameraDistance:r[3]}},ge.prototype.projectPoint=function(e,n,r){var i=[n,r,0,1];return ve(i,i,e),new t.Point((i[0]/i[3]+1)/2*this.transform.width+100,(-i[1]/i[3]+1)/2*this.transform.height+100)},ge.prototype.projectAndGetPerspectiveRatio=function(e,n,r){var i=[n,r,0,1];return ve(i,i,e),{point:new t.Point((i[0]/i[3]+1)/2*this.transform.width+100,(-i[1]/i[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/i[3]*.5}},ge.prototype.isOffscreen=function(t,e,n,r){return n<100||t>=this.screenRightBoundary||r<100||e>this.screenBottomBoundary},ge.prototype.isInsideGrid=function(t,e,n,r){return n>=0&&t<this.gridRightBoundary&&r>=0&&e<this.gridBottomBoundary};var be=function(t,e,n,r){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):r&&n?1:0,this.placed=n};be.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var we=function(t,e,n,r,i){this.text=new be(t?t.text:null,e,n,i),this.icon=new be(t?t.icon:null,e,r,i)};we.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var Ee=function(t,e,n){this.text=t,this.icon=e,this.skipFade=n},Se=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}};Se.prototype.get=function(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){var e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:function(t){return t.collisionGroupID===e}}}return this.collisionGroups[t]};var Te=function(t,e,n){this.transform=t.clone(),this.collisionIndex=new ge(this.transform),this.placements={},this.opacities={},this.stale=!1,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new Se(n)};function ke(t,e,n){t.emplaceBack(e?1:0,n?1:0),t.emplaceBack(e?1:0,n?1:0),t.emplaceBack(e?1:0,n?1:0),t.emplaceBack(e?1:0,n?1:0)}Te.prototype.placeLayerTile=function(e,n,r,i){var o=n.getBucket(e),a=n.latestFeatureIndex;if(o&&a&&e.id===o.layerIds[0]){var s=n.collisionBoxArray,u=o.layers[0].layout,l=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),c=n.tileSize/t.EXTENT,h=this.transform.calculatePosMatrix(n.tileID.toUnwrapped()),p=oe(h,"map"===u.get("text-pitch-alignment"),"map"===u.get("text-rotation-alignment"),this.transform,xe(n,1,this.transform.zoom)),f=oe(h,"map"===u.get("icon-pitch-alignment"),"map"===u.get("icon-rotation-alignment"),this.transform,xe(n,1,this.transform.zoom));this.retainedQueryData[o.bucketInstanceId]=new function(t,e,n,r,i){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=n,this.bucketIndex=r,this.tileID=i}(o.bucketInstanceId,a,o.sourceLayerIndex,o.index,n.tileID),this.placeLayerBucket(o,h,p,f,l,c,r,n.holdingForFade(),i,s)}},Te.prototype.placeLayerBucket=function(e,n,r,i,o,a,s,u,l,c){var h=e.layers[0].layout,p=t.evaluateSizeForZoom(e.textSizeData,this.transform.zoom,t.properties.layout.properties["text-size"]),f=h.get("text-optional"),d=h.get("icon-optional"),m=h.get("text-allow-overlap"),y=h.get("icon-allow-overlap"),v=m&&(y||!e.hasIconData()||d),g=y&&(m||!e.hasTextData()||f),_=this.collisionGroups.get(e.sourceID);!e.collisionArrays&&c&&e.deserializeCollisionBoxes(c);for(var x=0;x<e.symbolInstances.length;x++){var b=e.symbolInstances.get(x);if(!l[b.crossTileID]){if(u){this.placements[b.crossTileID]=new Ee(!1,!1,!1);continue}var w=!1,E=!1,S=!0,T=null,k=null,M=null,A=0,P=0,z=e.collisionArrays[x];z.textFeatureIndex&&(A=z.textFeatureIndex),z.textBox&&(w=(T=this.collisionIndex.placeCollisionBox(z.textBox,h.get("text-allow-overlap"),a,n,_.predicate)).box.length>0,S=S&&T.offscreen);var I=z.textCircles;if(I){var C=e.text.placedSymbolArray.get(b.horizontalPlacedTextSymbolIndex),L=t.evaluateSizeForFeature(e.textSizeData,p,C);k=this.collisionIndex.placeCollisionCircles(I,h.get("text-allow-overlap"),o,a,C,e.lineVertexArray,e.glyphOffsetArray,L,n,r,s,"map"===h.get("text-pitch-alignment"),_.predicate),w=h.get("text-allow-overlap")||k.circles.length>0,S=S&&k.offscreen}z.iconFeatureIndex&&(P=z.iconFeatureIndex),z.iconBox&&(E=(M=this.collisionIndex.placeCollisionBox(z.iconBox,h.get("icon-allow-overlap"),a,n,_.predicate)).box.length>0,S=S&&M.offscreen);var O=f||0===b.numGlyphVertices&&0===b.numVerticalGlyphVertices,D=d||0===b.numIconVertices;O||D?D?O||(E=E&&w):w=E&&w:E=w=E&&w,w&&T&&this.collisionIndex.insertCollisionBox(T.box,h.get("text-ignore-placement"),e.bucketInstanceId,A,_.ID),E&&M&&this.collisionIndex.insertCollisionBox(M.box,h.get("icon-ignore-placement"),e.bucketInstanceId,P,_.ID),w&&k&&this.collisionIndex.insertCollisionCircles(k.circles,h.get("text-ignore-placement"),e.bucketInstanceId,A,_.ID),this.placements[b.crossTileID]=new Ee(w||v,E||g,S||e.justReloaded),l[b.crossTileID]=!0}}e.justReloaded=!1},Te.prototype.commit=function(t,e){this.commitTime=e;var n=!1,r=t&&0!==this.fadeDuration?(this.commitTime-t.commitTime)/this.fadeDuration:1,i=t?t.opacities:{};for(var o in this.placements){var a=this.placements[o],s=i[o];s?(this.opacities[o]=new we(s,r,a.text,a.icon),n=n||a.text!==s.text.placed||a.icon!==s.icon.placed):(this.opacities[o]=new we(null,r,a.text,a.icon,a.skipFade),n=n||a.text||a.icon)}for(var u in i){var l=i[u];if(!this.opacities[u]){var c=new we(l,r,!1,!1);c.isHidden()||(this.opacities[u]=c,n=n||l.text.placed||l.icon.placed)}}n?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)},Te.prototype.updateLayerOpacities=function(t,e){for(var n={},r=0,i=e;r<i.length;r+=1){var o=i[r],a=o.getBucket(t);a&&o.latestFeatureIndex&&t.id===a.layerIds[0]&&this.updateBucketOpacities(a,n,o.collisionBoxArray)}},Te.prototype.updateBucketOpacities=function(t,e,n){t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasCollisionBoxData()&&t.collisionBox.collisionVertexArray.clear(),t.hasCollisionCircleData()&&t.collisionCircle.collisionVertexArray.clear();var r=t.layers[0].layout,i=new we(null,0,!1,!1,!0),o=r.get("text-allow-overlap"),a=r.get("icon-allow-overlap"),s=new we(null,0,o&&(a||!t.hasIconData()||r.get("icon-optional")),a&&(o||!t.hasTextData()||r.get("text-optional")),!0);!t.collisionArrays&&n&&(t.hasCollisionBoxData()||t.hasCollisionCircleData())&&t.deserializeCollisionBoxes(n);for(var u=0;u<t.symbolInstances.length;u++){var l=t.symbolInstances.get(u),c=e[l.crossTileID],h=this.opacities[l.crossTileID];c?h=i:h||(h=s,this.opacities[l.crossTileID]=h),e[l.crossTileID]=!0;var p=l.numGlyphVertices>0||l.numVerticalGlyphVertices>0,f=l.numIconVertices>0;if(p){for(var d=Oe(h.text),m=(l.numGlyphVertices+l.numVerticalGlyphVertices)/4,y=0;y<m;y++)t.text.opacityVertexArray.emplaceBack(d);t.text.placedSymbolArray.get(l.horizontalPlacedTextSymbolIndex).hidden=h.text.isHidden(),l.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(l.verticalPlacedTextSymbolIndex).hidden=h.text.isHidden())}if(f){for(var v=Oe(h.icon),g=0;g<l.numIconVertices/4;g++)t.icon.opacityVertexArray.emplaceBack(v);t.icon.placedSymbolArray.get(u).hidden=h.icon.isHidden()}if(t.hasCollisionBoxData()||t.hasCollisionCircleData()){var _=t.collisionArrays[u];if(_){_.textBox&&ke(t.collisionBox.collisionVertexArray,h.text.placed,!1),_.iconBox&&ke(t.collisionBox.collisionVertexArray,h.icon.placed,!1);var x=_.textCircles;if(x&&t.hasCollisionCircleData())for(var b=0;b<x.length;b+=5){var w=c||0===x[b+4];ke(t.collisionCircle.collisionVertexArray,h.text.placed,w)}}}}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.hasCollisionBoxData()&&t.collisionBox.collisionVertexBuffer&&t.collisionBox.collisionVertexBuffer.updateData(t.collisionBox.collisionVertexArray),t.hasCollisionCircleData()&&t.collisionCircle.collisionVertexBuffer&&t.collisionCircle.collisionVertexBuffer.updateData(t.collisionCircle.collisionVertexArray)},Te.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration},Te.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},Te.prototype.stillRecent=function(t){return"undefined"!==this.commitTime&&this.commitTime+this.fadeDuration>t},Te.prototype.setStale=function(){this.stale=!0};var Me=Math.pow(2,25),Ae=Math.pow(2,24),Pe=Math.pow(2,17),ze=Math.pow(2,16),Ie=Math.pow(2,9),Ce=Math.pow(2,8),Le=Math.pow(2,1);function Oe(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,n=Math.floor(127*t.opacity);return n*Me+e*Ae+n*Pe+e*ze+n*Ie+e*Ce+n*Le+e}var De=function(){this._currentTileIndex=0,this._seenCrossTileIDs={}};De.prototype.continuePlacement=function(t,e,n,r,i){for(;this._currentTileIndex<t.length;){var o=t[this._currentTileIndex];if(e.placeLayerTile(r,o,n,this._seenCrossTileIDs),this._currentTileIndex++,i())return!0}};var Re=function(t,e,n,r,i,o){this.placement=new Te(t,i,o),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=r,this._done=!1};Re.prototype.isDone=function(){return this._done},Re.prototype.continuePlacement=function(e,n,r){for(var i=this,o=t.browser.now(),a=function(){var e=t.browser.now()-o;return!i._forceFullPlacement&&e>2};this._currentPlacementIndex>=0;){var s=n[e[i._currentPlacementIndex]],u=i.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=u)&&(!s.maxzoom||s.maxzoom>u)){if(i._inProgressLayer||(i._inProgressLayer=new De),i._inProgressLayer.continuePlacement(r[s.source],i.placement,i._showCollisionBoxes,s,a))return;delete i._inProgressLayer}i._currentPlacementIndex--}this._done=!0},Re.prototype.commit=function(t,e){return this.placement.commit(t,e),this.placement};var Be=512/t.EXTENT/2,Fe=function(t,e,n){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=n;for(var r=0;r<e.length;r++){var i=e.get(r),o=i.key;this.indexedSymbolInstances[o]||(this.indexedSymbolInstances[o]=[]),this.indexedSymbolInstances[o].push({crossTileID:i.crossTileID,coord:this.getScaledCoordinates(i,t)})}};Fe.prototype.getScaledCoordinates=function(e,n){var r=n.canonical.z-this.tileID.canonical.z,i=Be/Math.pow(2,r);return{x:Math.floor((n.canonical.x*t.EXTENT+e.anchorX)*i),y:Math.floor((n.canonical.y*t.EXTENT+e.anchorY)*i)}},Fe.prototype.findMatches=function(t,e,n){for(var r=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),i=0;i<t.length;i++){var o=t.get(i);if(!o.crossTileID){var a=this.indexedSymbolInstances[o.key];if(a)for(var s=this.getScaledCoordinates(o,e),u=0,l=a;u<l.length;u+=1){var c=l[u];if(Math.abs(c.coord.x-s.x)<=r&&Math.abs(c.coord.y-s.y)<=r&&!n[c.crossTileID]){n[c.crossTileID]=!0,o.crossTileID=c.crossTileID;break}}}}};var je=function(){this.maxCrossTileID=0};je.prototype.generate=function(){return++this.maxCrossTileID};var Ve=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Ve.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var n in this.indexes){var r=this.indexes[n],i={};for(var o in r){var a=r[o];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+e),i[a.tileID.key]=a}this.indexes[n]=i}this.lng=t},Ve.prototype.addBucket=function(t,e,n){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(var r=0;r<e.symbolInstances.length;r++)e.symbolInstances.get(r).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var i=this.usedCrossTileIDs[t.overscaledZ];for(var o in this.indexes){var a=this.indexes[o];if(Number(o)>t.overscaledZ)for(var s in a){var u=a[s];u.tileID.isChildOf(t)&&u.findMatches(e.symbolInstances,t,i)}else{var l=a[t.scaledTo(Number(o)).key];l&&l.findMatches(e.symbolInstances,t,i)}}for(var c=0;c<e.symbolInstances.length;c++){var h=e.symbolInstances.get(c);h.crossTileID||(h.crossTileID=n.generate(),i[h.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new Fe(t,e.symbolInstances,e.bucketInstanceId),!0},Ve.prototype.removeBucketCrossTileIDs=function(t,e){for(var n in e.indexedSymbolInstances)for(var r=0,i=e.indexedSymbolInstances[n];r<i.length;r+=1){var o=i[r];delete this.usedCrossTileIDs[t][o.crossTileID]}},Ve.prototype.removeStaleBuckets=function(t){var e=!1;for(var n in this.indexes){var r=this.indexes[n];for(var i in r)t[r[i].bucketInstanceId]||(this.removeBucketCrossTileIDs(n,r[i]),delete r[i],e=!0)}return e};var Ne=function(){this.layerIndexes={},this.crossTileIDs=new je,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Ne.prototype.addLayer=function(t,e,n){var r=this.layerIndexes[t.id];void 0===r&&(r=this.layerIndexes[t.id]=new Ve);var i=!1,o={};r.handleWrapJump(n);for(var a=0,s=e;a<s.length;a+=1){var u=s[a],l=u.getBucket(t);l&&t.id===l.layerIds[0]&&(l.bucketInstanceId||(l.bucketInstanceId=++this.maxBucketInstanceId),r.addBucket(u.tileID,l,this.crossTileIDs)&&(i=!0),o[l.bucketInstanceId]=!0)}return r.removeStaleBuckets(o)&&(i=!0),i},Ne.prototype.pruneUnusedLayers=function(t){var e={};for(var n in t.forEach((function(t){e[t]=!0})),this.layerIndexes)e[n]||delete this.layerIndexes[n]};var Ue=function(e,n){return t.emitValidationErrors(e,n&&n.filter((function(t){return"source.canvas"!==t.identifier})))},qe=t.pick(Yt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Ze=t.pick(Yt,["setCenter","setZoom","setBearing","setPitch"]),Ge=function(e){function n(r,i){var o=this;void 0===i&&(i={}),e.call(this),this.map=r,this.dispatcher=new D((Gt||(Gt=new Xt),Gt),this),this.imageManager=new S,this.glyphManager=new z(r._transformRequest,i.localIdeographFontFamily),this.lineAtlas=new O(256,512),this.crossTileSymbolIndex=new Ne,this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ZoomHistory,this._loaded=!1,this._resetUpdates();var a=this;this._rtlTextPluginCallback=n.registerForPluginAvailability((function(t){for(var e in a.dispatcher.broadcast("loadRTLTextPlugin",t.pluginURL,t.completionCallback),a.sourceCaches)a.sourceCaches[e].reload()})),this.on("data",(function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType){var e=o.sourceCaches[t.sourceId];if(e){var n=e.getSource();if(n&&n.vectorLayerIds)for(var r in o._layers){var i=o._layers[r];i.source===n.id&&o._validateLayer(i)}}}}))}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.loadURL=function(e,n){var r=this;void 0===n&&(n={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var i="boolean"==typeof n.validate?n.validate:!d(e);e=function(t,e){if(!d(t))return t;var n=_(t);return n.path="/styles/v1"+n.path,f(n,e)}(e,n.accessToken);var o=this.map._transformRequest(e,t.ResourceType.Style);this._request=t.getJSON(o,(function(e,n){r._request=null,e?r.fire(new t.ErrorEvent(e)):n&&r._load(n,i)}))},n.prototype.loadJSON=function(e,n){var r=this;void 0===n&&(n={}),this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.browser.frame((function(){r._request=null,r._load(e,!1!==n.validate)}))},n.prototype._load=function(e,n){var r=this;if(!n||!Ue(this,t.validateStyle(e))){for(var i in this._loaded=!0,this.stylesheet=e,e.sources)r.addSource(i,e.sources[i],{validate:!1});e.sprite?this._spriteRequest=function(e,n,r){var i,o,a,s=t.browser.devicePixelRatio>1?"@2x":"",u=t.getJSON(n(m(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){u=null,a||(a=t,i=e,c())})),l=t.getImage(n(m(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){l=null,a||(a=t,o=e,c())}));function c(){if(a)r(a);else if(i&&o){var e=t.browser.getImageData(o),n={};for(var s in i){var u=i[s],l=u.width,c=u.height,h=u.x,p=u.y,f=u.sdf,d=u.pixelRatio,m=new t.RGBAImage({width:l,height:c});t.RGBAImage.copy(e,m,{x:h,y:p},{x:0,y:0},{width:l,height:c}),n[s]={data:m,pixelRatio:d,sdf:f}}r(null,n)}}return{cancel:function(){u&&(u.cancel(),u=null),l&&(l.cancel(),l=null)}}}(e.sprite,this.map._transformRequest,(function(e,n){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(n)for(var i in n)r.imageManager.addImage(i,n[i]);r.imageManager.setLoaded(!0),r.fire(new t.Event("data",{dataType:"style"}))})):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var o=Ht(this.stylesheet.layers);this._order=o.map((function(t){return t.id})),this._layers={};for(var a=0,s=o;a<s.length;a+=1){var u=s[a];(u=t.createStyleLayer(u)).setEventedParent(r,{layer:{id:u.id}}),r._layers[u.id]=u}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new L(this.stylesheet.light),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"))}},n.prototype._validateLayer=function(e){var n=this.sourceCaches[e.source];if(n){var r=e.sourceLayer;if(r){var i=n.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(r))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+r+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"')))}}},n.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},n.prototype._serializeLayers=function(t){for(var e=[],n=0,r=t;n<r.length;n+=1){var i=r[n],o=this._layers[i];"custom"!==o.type&&e.push(o.serialize())}return e},n.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(var e in this._layers)if(this._layers[e].hasTransition())return!0;return!1},n.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},n.prototype.update=function(e){if(this._loaded){if(this._changed){var n=Object.keys(this._updatedLayers),r=Object.keys(this._removedLayers);for(var i in(n.length||r.length)&&this._updateWorkerLayers(n,r),this._updatedSources){var o=this._updatedSources[i];"reload"===o?this._reloadSource(i):"clear"===o&&this._clearSource(i)}for(var a in this._updatedPaintProps)this._layers[a].updateTransitions(e);this.light.updateTransitions(e),this._resetUpdates(),this.fire(new t.Event("data",{dataType:"style"}))}for(var s in this.sourceCaches)this.sourceCaches[s].used=!1;for(var u=0,l=this._order;u<l.length;u+=1){var c=l[u],h=this._layers[c];h.recalculate(e),!h.isHidden(e.zoom)&&h.source&&(this.sourceCaches[h.source].used=!0)}this.light.recalculate(e),this.z=e.zoom}},n.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e})},n.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={}},n.prototype.setState=function(e){var n=this;if(this._checkLoaded(),Ue(this,t.validateStyle(e)))return!1;(e=t.clone(e)).layers=Ht(e.layers);var r=function(e,n){if(!e)return[{command:Yt.setStyle,args:[n]}];var r=[];try{if(!t.isEqual(e.version,n.version))return[{command:Yt.setStyle,args:[n]}];t.isEqual(e.center,n.center)||r.push({command:Yt.setCenter,args:[n.center]}),t.isEqual(e.zoom,n.zoom)||r.push({command:Yt.setZoom,args:[n.zoom]}),t.isEqual(e.bearing,n.bearing)||r.push({command:Yt.setBearing,args:[n.bearing]}),t.isEqual(e.pitch,n.pitch)||r.push({command:Yt.setPitch,args:[n.pitch]}),t.isEqual(e.sprite,n.sprite)||r.push({command:Yt.setSprite,args:[n.sprite]}),t.isEqual(e.glyphs,n.glyphs)||r.push({command:Yt.setGlyphs,args:[n.glyphs]}),t.isEqual(e.transition,n.transition)||r.push({command:Yt.setTransition,args:[n.transition]}),t.isEqual(e.light,n.light)||r.push({command:Yt.setLight,args:[n.light]});var i={},o=[];!function(e,n,r,i){var o;for(o in n=n||{},e=e||{})e.hasOwnProperty(o)&&(n.hasOwnProperty(o)||Jt(o,r,i));for(o in n)n.hasOwnProperty(o)&&(e.hasOwnProperty(o)?t.isEqual(e[o],n[o])||("geojson"===e[o].type&&"geojson"===n[o].type&&Qt(e,n,o)?r.push({command:Yt.setGeoJSONSourceData,args:[o,n[o].data]}):$t(o,n,r,i)):Kt(o,n,r))}(e.sources,n.sources,o,i);var a=[];e.layers&&e.layers.forEach((function(t){i[t.source]?r.push({command:Yt.removeLayer,args:[t.id]}):a.push(t)})),r=r.concat(o),function(e,n,r){n=n||[];var i,o,a,s,u,l,c,h=(e=e||[]).map(ee),p=n.map(ee),f=e.reduce(ne,{}),d=n.reduce(ne,{}),m=h.slice(),y=Object.create(null);for(i=0,o=0;i<h.length;i++)a=h[i],d.hasOwnProperty(a)?o++:(r.push({command:Yt.removeLayer,args:[a]}),m.splice(m.indexOf(a,o),1));for(i=0,o=0;i<p.length;i++)a=p[p.length-1-i],m[m.length-1-i]!==a&&(f.hasOwnProperty(a)?(r.push({command:Yt.removeLayer,args:[a]}),m.splice(m.lastIndexOf(a,m.length-o),1)):o++,l=m[m.length-i],r.push({command:Yt.addLayer,args:[d[a],l]}),m.splice(m.length-i,0,a),y[a]=!0);for(i=0;i<p.length;i++)if(s=f[a=p[i]],u=d[a],!y[a]&&!t.isEqual(s,u))if(t.isEqual(s.source,u.source)&&t.isEqual(s["source-layer"],u["source-layer"])&&t.isEqual(s.type,u.type)){for(c in te(s.layout,u.layout,r,a,null,Yt.setLayoutProperty),te(s.paint,u.paint,r,a,null,Yt.setPaintProperty),t.isEqual(s.filter,u.filter)||r.push({command:Yt.setFilter,args:[a,u.filter]}),t.isEqual(s.minzoom,u.minzoom)&&t.isEqual(s.maxzoom,u.maxzoom)||r.push({command:Yt.setLayerZoomRange,args:[a,u.minzoom,u.maxzoom]}),s)s.hasOwnProperty(c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?te(s[c],u[c],r,a,c.slice(6),Yt.setPaintProperty):t.isEqual(s[c],u[c])||r.push({command:Yt.setLayerProperty,args:[a,c,u[c]]}));for(c in u)u.hasOwnProperty(c)&&!s.hasOwnProperty(c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?te(s[c],u[c],r,a,c.slice(6),Yt.setPaintProperty):t.isEqual(s[c],u[c])||r.push({command:Yt.setLayerProperty,args:[a,c,u[c]]}))}else r.push({command:Yt.removeLayer,args:[a]}),l=m[m.lastIndexOf(a)+1],r.push({command:Yt.addLayer,args:[u,l]})}(a,n.layers,r)}catch(t){console.warn("Unable to compute style diff:",t),r=[{command:Yt.setStyle,args:[n]}]}return r}(this.serialize(),e).filter((function(t){return!(t.command in Ze)}));if(0===r.length)return!1;var i=r.filter((function(t){return!(t.command in qe)}));if(i.length>0)throw new Error("Unimplemented: "+i.map((function(t){return t.command})).join(", ")+".");return r.forEach((function(t){"setTransition"!==t.command&&n[t.command].apply(n,t.args)})),this.stylesheet=e,!0},n.prototype.addImage=function(e,n){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,n),this.fire(new t.Event("data",{dataType:"style"}))},n.prototype.getImage=function(t){return this.imageManager.getImage(t)},n.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this.fire(new t.Event("data",{dataType:"style"}))},n.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},n.prototype.addSource=function(e,n,r){var i=this;if(this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!n.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(n).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,n,null,r))){this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);var o=this.sourceCaches[e]=new Vt(e,n,this.dispatcher);o.style=this,o.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:o.serialize(),sourceId:e}})),o.onAdd(this.map),this._changed=!0}},n.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var n in this._layers)if(this._layers[n].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+n+'" is using it.')));var r=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],r.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),r.setEventedParent(null),r.clearTiles(),r.onRemove&&r.onRemove(this.map),this._changed=!0},n.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},n.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},n.prototype.addLayer=function(e,n,r){this._checkLoaded();var i=e.id;if(this.getLayer(i))this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var o;if("custom"===e.type){if(Ue(this,t.validateCustomStyleLayer(e)))return;o=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(i,e.source),e=t.clone(e),e=t.extend(e,{source:i})),this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},r))return;o=t.createStyleLayer(e),this._validateLayer(o),o.setEventedParent(this,{layer:{id:i}})}var a=n?this._order.indexOf(n):this._order.length;if(n&&-1===a)this.fire(new t.ErrorEvent(new Error('Layer with id "'+n+'" does not exist on this map.')));else{if(this._order.splice(a,0,i),this._layerOrderChanged=!0,this._layers[i]=o,this._removedLayers[i]&&o.source&&"custom"!==o.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map)}}},n.prototype.moveLayer=function(e,n){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==n){var r=this._order.indexOf(e);this._order.splice(r,1);var i=n?this._order.indexOf(n):this._order.length;n&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+n+'" does not exist on this map.'))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},n.prototype.removeLayer=function(e){this._checkLoaded();var n=this._layers[e];if(n){n.setEventedParent(null);var r=this._order.indexOf(e);this._order.splice(r,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=n,delete this._layers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],n.onRemove&&n.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},n.prototype.getLayer=function(t){return this._layers[t]},n.prototype.setLayerZoomRange=function(e,n,r){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===n&&i.maxzoom===r||(null!=n&&(i.minzoom=n),null!=r&&(i.maxzoom=r),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},n.prototype.setFilter=function(e,n){this._checkLoaded();var r=this.getLayer(e);if(r){if(!t.isEqual(r.filter,n))return null==n?(r.filter=void 0,void this._updateLayer(r)):void(this._validate(t.validateStyle.filter,"layers."+r.id+".filter",n)||(r.filter=t.clone(n),this._updateLayer(r)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},n.prototype.getFilter=function(e){return t.clone(this.getLayer(e).filter)},n.prototype.setLayoutProperty=function(e,n,r){this._checkLoaded();var i=this.getLayer(e);i?t.isEqual(i.getLayoutProperty(n),r)||(i.setLayoutProperty(n,r),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},n.prototype.getLayoutProperty=function(t,e){return this.getLayer(t).getLayoutProperty(e)},n.prototype.setPaintProperty=function(e,n,r){this._checkLoaded();var i=this.getLayer(e);i?t.isEqual(i.getPaintProperty(n),r)||(i.setPaintProperty(n,r)&&this._updateLayer(i),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},n.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},n.prototype.setFeatureState=function(e,n){this._checkLoaded();var r=e.source,i=e.sourceLayer,o=this.sourceCaches[r],a=parseInt(e.id,10);void 0!==o?"vector"!==o.getSource().type||i?isNaN(a)||a<0?this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided and non-negative."))):o.setFeatureState(i,a,n):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types."))):this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},n.prototype.getFeatureState=function(e){this._checkLoaded();var n=e.source,r=e.sourceLayer,i=this.sourceCaches[n],o=parseInt(e.id,10);if(void 0!==i)if("vector"!==i.getSource().type||r){if(!(isNaN(o)||o<0))return i.getFeatureState(r,o);this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided and non-negative.")))}else this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},n.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},n.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},n.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},n.prototype._flattenRenderedFeatures=function(t){for(var e=[],n=this._order.length-1;n>=0;n--)for(var r=this._order[n],i=0,o=t;i<o.length;i+=1){var a=o[i][r];if(a)for(var s=0,u=a;s<u.length;s+=1){var l=u[s];e.push(l)}}return e},n.prototype.queryRenderedFeatures=function(e,n,r){n&&n.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",n.filter);var i={};if(n&&n.layers){if(!Array.isArray(n.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var o=0,a=n.layers;o<a.length;o+=1){var s=a[o],u=this._layers[s];if(!u)return this.fire(new t.ErrorEvent(new Error("The layer '"+s+"' does not exist in the map's style and cannot be queried for features."))),[];i[u.source]=!0}}var l=[],c=e.map((function(t){return r.pointCoordinate(t)}));for(var h in this.sourceCaches)n.layers&&!i[h]||l.push(H(this.sourceCaches[h],this._layers,c,n,r));return this.placement&&l.push(function(t,e,n,r,i,o){for(var a={},s=i.queryRenderedSymbols(n),u=[],l=0,c=Object.keys(s).map(Number);l<c.length;l+=1){var h=c[l];u.push(o[h])}u.sort(Y);for(var p=function(){var e=d[f],n=e.featureIndex.lookupSymbolFeatures(s[e.bucketInstanceId],e.bucketIndex,e.sourceLayerIndex,r.filter,r.layers,t);for(var i in n){var o=a[i]=a[i]||[],u=n[i];u.sort((function(t,n){var r=e.featureSortOrder;if(r){var i=r.indexOf(t.featureIndex);return r.indexOf(n.featureIndex)-i}return n.featureIndex-t.featureIndex}));for(var l=0,c=u;l<c.length;l+=1){var h=c[l];o.push(h.feature)}}},f=0,d=u;f<d.length;f+=1)p();var m=function(n){a[n].forEach((function(r){var i=t[n],o=e[i.source].getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=o}))};for(var y in a)m(y);return a}(this._layers,this.sourceCaches,e,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenRenderedFeatures(l)},n.prototype.querySourceFeatures=function(e,n){n&&n.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",n.filter);var r=this.sourceCaches[e];return r?function(t,e){for(var n=t.getRenderableIds().map((function(e){return t.getTileByID(e)})),r=[],i={},o=0;o<n.length;o++){var a=n[o],s=a.tileID.canonical.key;i[s]||(i[s]=!0,a.querySourceFeatures(r,e))}return r}(r,n):[]},n.prototype.addSourceType=function(t,e,r){return n.getSourceType(t)?r(new Error('A source type called "'+t+'" already exists.')):(n.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},r):r(null,null))},n.prototype.getLight=function(){return this.light.getLight()},n.prototype.setLight=function(e){this._checkLoaded();var n=this.light.getLight(),r=!1;for(var i in e)if(!t.isEqual(e[i],n[i])){r=!0;break}if(r){var o={now:t.browser.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e),this.light.updateTransitions(o)}},n.prototype._validate=function(e,n,r,i,o){return(!o||!1!==o.validate)&&Ue(this,e.call(t.validateStyle,t.extend({key:n,style:this.serialize(),value:r,styleSpec:t.styleSpec},i)))},n.prototype._remove=function(){for(var e in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),t.evented.off("pluginAvailable",this._rtlTextPluginCallback),this.sourceCaches)this.sourceCaches[e].clearTiles();this.dispatcher.remove()},n.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles()},n.prototype._reloadSource=function(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()},n.prototype._updateSources=function(t){for(var e in this.sourceCaches)this.sourceCaches[e].update(t)},n.prototype._generateCollisionBoxes=function(){for(var t in this.sourceCaches)this._reloadSource(t)},n.prototype._updatePlacement=function(e,n,r,i){for(var o=!1,a=!1,s={},u=0,l=this._order;u<l.length;u+=1){var c=l[u],h=this._layers[c];if("symbol"===h.type){if(!s[h.source]){var p=this.sourceCaches[h.source];s[h.source]=p.getRenderableIds(!0).map((function(t){return p.getTileByID(t)})).sort((function(t,e){return e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)}))}var f=this.crossTileSymbolIndex.addLayer(h,s[h.source],e.center.lng);o=o||f}}this.crossTileSymbolIndex.pruneUnusedLayers(this._order);var d=this._layerOrderChanged;if((d||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now()))&&(this.pauseablePlacement=new Re(e,this._order,d,n,r,i),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,s),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(this.placement,t.browser.now()),a=!0),o&&this.pauseablePlacement.placement.setStale()),a||o)for(var m=0,y=this._order;m<y.length;m+=1){var v=y[m],g=this._layers[v];"symbol"===g.type&&this.placement.updateLayerOpacities(g,s[g.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.browser.now())},n.prototype._releaseSymbolFadeTiles=function(){for(var t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()},n.prototype.getImages=function(t,e,n){this.imageManager.getImages(e.icons,n)},n.prototype.getGlyphs=function(t,e,n){this.glyphManager.getGlyphs(e.stacks,n)},n}(t.Evented);Ge.getSourceType=function(t){return W[t]},Ge.setSourceType=function(t,e){W[t]=e},Ge.registerForPluginAvailability=t.registerForPluginAvailability;var Xe=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),We={prelude:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n\n// Unpack a pair of values that have been packed into a single float.\n// The packed values are assumed to be 8-bit unsigned integers, and are\n// packed like so:\n// packedValue = floor(input[0]) * 256 + input[1],\nvec2 unpack_float(const float packedValue) {\n    int packedIntValue = int(packedValue);\n    int v0 = packedIntValue / 256;\n    return vec2(v0, packedIntValue - v0 * 256);\n}\n\nvec2 unpack_opacity(const float packedOpacity) {\n    int intOpacity = int(packedOpacity) / 2;\n    return vec2(float(intOpacity) / 127.0, mod(packedOpacity, 2.0));\n}\n\n// To minimize the number of attributes needed, we encode a 4-component\n// color into a pair of floats (i.e. a vec2) as follows:\n// [ floor(color.r * 255) * 256 + color.g * 255,\n//   floor(color.b * 255) * 256 + color.g * 255 ]\nvec4 decode_color(const vec2 encodedColor) {\n    return vec4(\n        unpack_float(encodedColor[0]) / 255.0,\n        unpack_float(encodedColor[1]) / 255.0\n    );\n}\n\n// Unpack a pair of paint values and interpolate between them.\nfloat unpack_mix_vec2(const vec2 packedValue, const float t) {\n    return mix(packedValue[0], packedValue[1], t);\n}\n\n// Unpack a pair of paint values and interpolate between them.\nvec4 unpack_mix_color(const vec4 packedColors, const float t) {\n    vec4 minColor = decode_color(vec2(packedColors[0], packedColors[1]));\n    vec4 maxColor = decode_color(vec2(packedColors[2], packedColors[3]));\n    return mix(minColor, maxColor, t);\n}\n\n// The offset depends on how many pixels are between the world origin and the edge of the tile:\n// vec2 offset = mod(pixel_coord, size)\n//\n// At high zoom levels there are a ton of pixels between the world origin and the edge of the tile.\n// The glsl spec only guarantees 16 bits of precision for highp floats. We need more than that.\n//\n// The pixel_coord is passed in as two 16 bit values:\n// pixel_coord_upper = floor(pixel_coord / 2^16)\n// pixel_coord_lower = mod(pixel_coord, 2^16)\n//\n// The offset is calculated in a series of steps that should preserve this precision:\nvec2 get_pattern_pos(const vec2 pixel_coord_upper, const vec2 pixel_coord_lower,\n    const vec2 pattern_size, const float tile_units_to_pixels, const vec2 pos) {\n\n    vec2 offset = mod(mod(mod(pixel_coord_upper, pattern_size) * 256.0, pattern_size) * 256.0 + pixel_coord_lower, pattern_size);\n    return (tile_units_to_pixels * pos + offset) / pattern_size;\n}\n"},background:{fragmentSource:"uniform vec4 u_color;\nuniform float u_opacity;\n\nvoid main() {\n    gl_FragColor = u_color * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},backgroundPattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\nuniform float u_opacity;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n    vec2 imagecoord = mod(v_pos_a, 1.0);\n    vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n    vec4 color1 = texture2D(u_image, pos);\n\n    vec2 imagecoord_b = mod(v_pos_b, 1.0);\n    vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n    vec4 color2 = texture2D(u_image, pos2);\n\n    gl_FragColor = mix(color1, color2, u_mix) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n    v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n    v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n}\n"},circle:{fragmentSource:"#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\n\nvarying vec3 v_data;\n\nvoid 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\n\n    vec2 extrude = v_data.xy;\n    float extrude_length = length(extrude);\n\n    lowp float antialiasblur = v_data.z;\n    float antialiased_blur = -max(blur, antialiasblur);\n\n    float opacity_t = smoothstep(0.0, antialiased_blur, extrude_length - 1.0);\n\n    float color_t = stroke_width < 0.01 ? 0.0 : smoothstep(\n        antialiased_blur,\n        0.0,\n        extrude_length - radius / (radius + stroke_width)\n    );\n\n    gl_FragColor = opacity_t * mix(color * opacity, stroke_color * stroke_opacity, color_t);\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform bool u_scale_with_map;\nuniform bool u_pitch_with_map;\nuniform vec2 u_extrude_scale;\nuniform highp float u_camera_to_center_distance;\n\nattribute vec2 a_pos;\n\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\n\nvarying vec3 v_data;\n\nvoid main(void) {\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\n\n    // unencode the extrusion vector that we snuck into the a_pos vector\n    vec2 extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\n\n    // multiply a_pos by 0.5, since we had it * 2 in order to sneak\n    // in extrusion data\n    vec2 circle_center = floor(a_pos * 0.5);\n    if (u_pitch_with_map) {\n        vec2 corner_position = circle_center;\n        if (u_scale_with_map) {\n            corner_position += extrude * (radius + stroke_width) * u_extrude_scale;\n        } else {\n            // Pitching the circle with the map effectively scales it with the map\n            // To counteract the effect for pitch-scale: viewport, we rescale the\n            // whole circle based on the pitch scaling effect at its central point\n            vec4 projected_center = u_matrix * vec4(circle_center, 0, 1);\n            corner_position += extrude * (radius + stroke_width) * u_extrude_scale * (projected_center.w / u_camera_to_center_distance);\n        }\n\n        gl_Position = u_matrix * vec4(corner_position, 0, 1);\n    } else {\n        gl_Position = u_matrix * vec4(circle_center, 0, 1);\n\n        if (u_scale_with_map) {\n            gl_Position.xy += extrude * (radius + stroke_width) * u_extrude_scale * u_camera_to_center_distance;\n        } else {\n            gl_Position.xy += extrude * (radius + stroke_width) * u_extrude_scale * gl_Position.w;\n        }\n    }\n\n    // This is a minimum blur distance that serves as a faux-antialiasing for\n    // the circle. since blur is a ratio of the circle's size and the intent is\n    // to keep the blur at roughly 1px, the two are inversely related.\n    lowp float antialiasblur = 1.0 / DEVICE_PIXEL_RATIO / (radius + stroke_width);\n\n    v_data = vec3(extrude.x, extrude.y, antialiasblur);\n}\n"},clippingMask:{fragmentSource:"void main() {\n    gl_FragColor = vec4(1.0);\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},heatmap:{fragmentSource:"#pragma mapbox: define highp float weight\n\nuniform highp float u_intensity;\nvarying vec2 v_extrude;\n\n// Gaussian kernel coefficient: 1 / sqrt(2 * PI)\n#define GAUSS_COEF 0.3989422804014327\n\nvoid main() {\n    #pragma mapbox: initialize highp float weight\n\n    // Kernel density estimation with a Gaussian kernel of size 5x5\n    float d = -0.5 * 3.0 * 3.0 * dot(v_extrude, v_extrude);\n    float val = weight * u_intensity * GAUSS_COEF * exp(d);\n\n    gl_FragColor = vec4(val, 1.0, 1.0, 1.0);\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\n\nuniform mat4 u_matrix;\nuniform float u_extrude_scale;\nuniform float u_opacity;\nuniform float u_intensity;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_extrude;\n\n// Effective \"0\" in the kernel density texture to adjust the kernel size to;\n// this empirically chosen number minimizes artifacts on overlapping kernels\n// for typical heatmap cases (assuming clustered source)\nconst highp float ZERO = 1.0 / 255.0 / 16.0;\n\n// Gaussian kernel coefficient: 1 / sqrt(2 * PI)\n#define GAUSS_COEF 0.3989422804014327\n\nvoid main(void) {\n    #pragma mapbox: initialize highp float weight\n    #pragma mapbox: initialize mediump float radius\n\n    // unencode the extrusion vector that we snuck into the a_pos vector\n    vec2 unscaled_extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\n\n    // This 'extrude' comes in ranging from [-1, -1], to [1, 1].  We'll use\n    // it to produce the vertices of a square mesh framing the point feature\n    // we're adding to the kernel density texture.  We'll also pass it as\n    // a varying, so that the fragment shader can determine the distance of\n    // each fragment from the point feature.\n    // Before we do so, we need to scale it up sufficiently so that the\n    // kernel falls effectively to zero at the edge of the mesh.\n    // That is, we want to know S such that\n    // weight * u_intensity * GAUSS_COEF * exp(-0.5 * 3.0^2 * S^2) == ZERO\n    // Which solves to:\n    // S = sqrt(-2.0 * log(ZERO / (weight * u_intensity * GAUSS_COEF))) / 3.0\n    float S = sqrt(-2.0 * log(ZERO / weight / u_intensity / GAUSS_COEF)) / 3.0;\n\n    // Pass the varying in units of radius\n    v_extrude = S * unscaled_extrude;\n\n    // Scale by radius and the zoom-based scale factor to produce actual\n    // mesh position\n    vec2 extrude = v_extrude * radius * u_extrude_scale;\n\n    // multiply a_pos by 0.5, since we had it * 2 in order to sneak\n    // in extrusion data\n    vec4 pos = vec4(floor(a_pos * 0.5) + extrude, 0, 1);\n\n    gl_Position = u_matrix * pos;\n}\n"},heatmapTexture:{fragmentSource:"uniform sampler2D u_image;\nuniform sampler2D u_color_ramp;\nuniform float u_opacity;\nvarying vec2 v_pos;\n\nvoid main() {\n    float t = texture2D(u_image, v_pos).r;\n    vec4 color = texture2D(u_color_ramp, vec2(t, 0.5));\n    gl_FragColor = color * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(0.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\n\nvoid main() {\n    gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1);\n\n    v_pos.x = a_pos.x;\n    v_pos.y = 1.0 - a_pos.y;\n}\n"},collisionBox:{fragmentSource:"\nvarying float v_placed;\nvarying float v_notUsed;\n\nvoid main() {\n\n    float alpha = 0.5;\n\n    // Red = collision, hide label\n    gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n\n    // Blue = no collision, label is showing\n    if (v_placed > 0.5) {\n        gl_FragColor = vec4(0.0, 0.0, 1.0, 0.5) * alpha;\n    }\n\n    if (v_notUsed > 0.5) {\n        // This box not used, fade it out\n        gl_FragColor *= .1;\n    }\n}",vertexSource:"attribute vec2 a_pos;\nattribute vec2 a_anchor_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_placed;\n\nuniform mat4 u_matrix;\nuniform vec2 u_extrude_scale;\nuniform float u_camera_to_center_distance;\n\nvarying float v_placed;\nvarying float v_notUsed;\n\nvoid main() {\n    vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1);\n    highp float camera_to_anchor_distance = projectedPoint.w;\n    highp float collision_perspective_ratio = clamp(\n        0.5 + 0.5 * (u_camera_to_center_distance / camera_to_anchor_distance),\n        0.0, // Prevents oversized near-field boxes in pitched/overzoomed tiles\n        4.0);\n\n    gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);\n    gl_Position.xy += a_extrude * u_extrude_scale * gl_Position.w * collision_perspective_ratio;\n\n    v_placed = a_placed.x;\n    v_notUsed = a_placed.y;\n}\n"},collisionCircle:{fragmentSource:"uniform float u_overscale_factor;\n\nvarying float v_placed;\nvarying float v_notUsed;\nvarying float v_radius;\nvarying vec2 v_extrude;\nvarying vec2 v_extrude_scale;\n\nvoid main() {\n    float alpha = 0.5;\n\n    // Red = collision, hide label\n    vec4 color = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n\n    // Blue = no collision, label is showing\n    if (v_placed > 0.5) {\n        color = vec4(0.0, 0.0, 1.0, 0.5) * alpha;\n    }\n\n    if (v_notUsed > 0.5) {\n        // This box not used, fade it out\n        color *= .2;\n    }\n\n    float extrude_scale_length = length(v_extrude_scale);\n    float extrude_length = length(v_extrude) * extrude_scale_length;\n    float stroke_width = 15.0 * extrude_scale_length / u_overscale_factor;\n    float radius = v_radius * extrude_scale_length;\n\n    float distance_to_edge = abs(extrude_length - radius);\n    float opacity_t = smoothstep(-stroke_width, 0.0, -distance_to_edge);\n\n    gl_FragColor = opacity_t * color;\n}\n",vertexSource:"attribute vec2 a_pos;\nattribute vec2 a_anchor_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_placed;\n\nuniform mat4 u_matrix;\nuniform vec2 u_extrude_scale;\nuniform float u_camera_to_center_distance;\n\nvarying float v_placed;\nvarying float v_notUsed;\nvarying float v_radius;\n\nvarying vec2 v_extrude;\nvarying vec2 v_extrude_scale;\n\nvoid main() {\n    vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1);\n    highp float camera_to_anchor_distance = projectedPoint.w;\n    highp float collision_perspective_ratio = clamp(\n        0.5 + 0.5 * (u_camera_to_center_distance / camera_to_anchor_distance),\n        0.0, // Prevents oversized near-field circles in pitched/overzoomed tiles\n        4.0);\n\n    gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);\n\n    highp float padding_factor = 1.2; // Pad the vertices slightly to make room for anti-alias blur\n    gl_Position.xy += a_extrude * u_extrude_scale * padding_factor * gl_Position.w * collision_perspective_ratio;\n\n    v_placed = a_placed.x;\n    v_notUsed = a_placed.y;\n    v_radius = abs(a_extrude.y); // We don't pitch the circles, so both units of the extrusion vector are equal in magnitude to the radius\n\n    v_extrude = a_extrude * padding_factor;\n    v_extrude_scale = u_extrude_scale * u_camera_to_center_distance * collision_perspective_ratio;\n}\n"},debug:{fragmentSource:"uniform highp vec4 u_color;\n\nvoid main() {\n    gl_FragColor = u_color;\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},fill:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n    #pragma mapbox: initialize highp vec4 color\n    #pragma mapbox: initialize lowp float opacity\n\n    gl_FragColor = color * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n    #pragma mapbox: initialize highp vec4 color\n    #pragma mapbox: initialize lowp float opacity\n\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},fillOutline:{fragmentSource:"#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n    #pragma mapbox: initialize highp vec4 outline_color\n    #pragma mapbox: initialize lowp float opacity\n\n    float dist = length(v_pos - gl_FragCoord.xy);\n    float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n    gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n    #pragma mapbox: initialize highp vec4 outline_color\n    #pragma mapbox: initialize lowp float opacity\n\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n    v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillOutlinePattern:{fragmentSource:"\nuniform vec2 u_texsize;\nuniform sampler2D u_image;\nuniform float u_fade;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n\nvoid main() {\n    #pragma mapbox: initialize lowp float opacity\n    #pragma mapbox: initialize mediump vec4 pattern_from\n    #pragma mapbox: initialize mediump vec4 pattern_to\n\n    vec2 pattern_tl_a = pattern_from.xy;\n    vec2 pattern_br_a = pattern_from.zw;\n    vec2 pattern_tl_b = pattern_to.xy;\n    vec2 pattern_br_b = pattern_to.zw;\n\n    vec2 imagecoord = mod(v_pos_a, 1.0);\n    vec2 pos = mix(pattern_tl_a / u_texsize, pattern_br_a / u_texsize, imagecoord);\n    vec4 color1 = texture2D(u_image, pos);\n\n    vec2 imagecoord_b = mod(v_pos_b, 1.0);\n    vec2 pos2 = mix(pattern_tl_b / u_texsize, pattern_br_b / u_texsize, imagecoord_b);\n    vec4 color2 = texture2D(u_image, pos2);\n\n    // find distance to outline for alpha interpolation\n\n    float dist = length(v_pos - gl_FragCoord.xy);\n    float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n\n\n    gl_FragColor = mix(color1, color2, u_fade) * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform vec4 u_scale;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n\nvoid main() {\n    #pragma mapbox: initialize lowp float opacity\n    #pragma mapbox: initialize mediump vec4 pattern_from\n    #pragma mapbox: initialize mediump vec4 pattern_to\n\n    vec2 pattern_tl_a = pattern_from.xy;\n    vec2 pattern_br_a = pattern_from.zw;\n    vec2 pattern_tl_b = pattern_to.xy;\n    vec2 pattern_br_b = pattern_to.zw;\n\n    float pixelRatio = u_scale.x;\n    float tileRatio = u_scale.y;\n    float fromScale = u_scale.z;\n    float toScale = u_scale.w;\n\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n    vec2 display_size_a = vec2((pattern_br_a.x - pattern_tl_a.x) / pixelRatio, (pattern_br_a.y - pattern_tl_a.y) / pixelRatio);\n    vec2 display_size_b = vec2((pattern_br_b.x - pattern_tl_b.x) / pixelRatio, (pattern_br_b.y - pattern_tl_b.y) / pixelRatio);\n\n    v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, fromScale * display_size_a, tileRatio, a_pos);\n    v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, toScale * display_size_b, tileRatio, a_pos);\n\n    v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillPattern:{fragmentSource:"uniform vec2 u_texsize;\nuniform float u_fade;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n\nvoid main() {\n    #pragma mapbox: initialize lowp float opacity\n    #pragma mapbox: initialize mediump vec4 pattern_from\n    #pragma mapbox: initialize mediump vec4 pattern_to\n\n    vec2 pattern_tl_a = pattern_from.xy;\n    vec2 pattern_br_a = pattern_from.zw;\n    vec2 pattern_tl_b = pattern_to.xy;\n    vec2 pattern_br_b = pattern_to.zw;\n\n    vec2 imagecoord = mod(v_pos_a, 1.0);\n    vec2 pos = mix(pattern_tl_a / u_texsize, pattern_br_a / u_texsize, imagecoord);\n    vec4 color1 = texture2D(u_image, pos);\n\n    vec2 imagecoord_b = mod(v_pos_b, 1.0);\n    vec2 pos2 = mix(pattern_tl_b / u_texsize, pattern_br_b / u_texsize, imagecoord_b);\n    vec4 color2 = texture2D(u_image, pos2);\n\n    gl_FragColor = mix(color1, color2, u_fade) * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform vec4 u_scale;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n\nvoid main() {\n    #pragma mapbox: initialize lowp float opacity\n    #pragma mapbox: initialize mediump vec4 pattern_from\n    #pragma mapbox: initialize mediump vec4 pattern_to\n\n    vec2 pattern_tl_a = pattern_from.xy;\n    vec2 pattern_br_a = pattern_from.zw;\n    vec2 pattern_tl_b = pattern_to.xy;\n    vec2 pattern_br_b = pattern_to.zw;\n\n    float pixelRatio = u_scale.x;\n    float tileZoomRatio = u_scale.y;\n    float fromScale = u_scale.z;\n    float toScale = u_scale.w;\n\n    vec2 display_size_a = vec2((pattern_br_a.x - pattern_tl_a.x) / pixelRatio, (pattern_br_a.y - pattern_tl_a.y) / pixelRatio);\n    vec2 display_size_b = vec2((pattern_br_b.x - pattern_tl_b.x) / pixelRatio, (pattern_br_b.y - pattern_tl_b.y) / pixelRatio);\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n    v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, fromScale * display_size_a, tileZoomRatio, a_pos);\n    v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, toScale * display_size_b, tileZoomRatio, a_pos);\n}\n"},fillExtrusion:{fragmentSource:"varying vec4 v_color;\n\nvoid main() {\n    gl_FragColor = v_color;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\nuniform float u_vertical_gradient;\n\nattribute vec2 a_pos;\nattribute vec4 a_normal_ed;\n\nvarying vec4 v_color;\n\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n\n#pragma mapbox: define highp vec4 color\n\nvoid main() {\n    #pragma mapbox: initialize highp float base\n    #pragma mapbox: initialize highp float height\n    #pragma mapbox: initialize highp vec4 color\n\n    vec3 normal = a_normal_ed.xyz;\n\n    base = max(0.0, base);\n    height = max(0.0, height);\n\n    float t = mod(normal.x, 2.0);\n\n    gl_Position = u_matrix * vec4(a_pos, t > 0.0 ? height : base, 1);\n\n    // Relative luminance (how dark/bright is the surface color?)\n    float colorvalue = color.r * 0.2126 + color.g * 0.7152 + color.b * 0.0722;\n\n    v_color = vec4(0.0, 0.0, 0.0, 1.0);\n\n    // Add slight ambient lighting so no extrusions are totally black\n    vec4 ambientlight = vec4(0.03, 0.03, 0.03, 1.0);\n    color += ambientlight;\n\n    // Calculate cos(theta), where theta is the angle between surface normal and diffuse light ray\n    float directional = clamp(dot(normal / 16384.0, u_lightpos), 0.0, 1.0);\n\n    // Adjust directional so that\n    // the range of values for highlight/shading is narrower\n    // with lower light intensity\n    // and with lighter/brighter surface colors\n    directional = mix((1.0 - u_lightintensity), max((1.0 - colorvalue + u_lightintensity), 1.0), directional);\n\n    // Add gradient along z axis of side surfaces\n    if (normal.y != 0.0) {\n        // This avoids another branching statement, but multiplies by a constant of 0.84 if no vertical gradient,\n        // and otherwise calculates the gradient based on base + height\n        directional *= (\n            (1.0 - u_vertical_gradient) +\n            (u_vertical_gradient * clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0)));\n    }\n\n    // Assign final color based on surface + ambient light color, diffuse light directional, and light color\n    // with lower bounds adjusted to hue of light\n    // so that shading is tinted with the complementary (opposite) color to the light color\n    v_color.r += clamp(color.r * directional * u_lightcolor.r, mix(0.0, 0.3, 1.0 - u_lightcolor.r), 1.0);\n    v_color.g += clamp(color.g * directional * u_lightcolor.g, mix(0.0, 0.3, 1.0 - u_lightcolor.g), 1.0);\n    v_color.b += clamp(color.b * directional * u_lightcolor.b, mix(0.0, 0.3, 1.0 - u_lightcolor.b), 1.0);\n}\n"},fillExtrusionPattern:{fragmentSource:"uniform vec2 u_texsize;\nuniform float u_fade;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n\nvoid main() {\n    #pragma mapbox: initialize lowp float base\n    #pragma mapbox: initialize lowp float height\n    #pragma mapbox: initialize mediump vec4 pattern_from\n    #pragma mapbox: initialize mediump vec4 pattern_to\n\n    vec2 pattern_tl_a = pattern_from.xy;\n    vec2 pattern_br_a = pattern_from.zw;\n    vec2 pattern_tl_b = pattern_to.xy;\n    vec2 pattern_br_b = pattern_to.zw;\n\n    vec2 imagecoord = mod(v_pos_a, 1.0);\n    vec2 pos = mix(pattern_tl_a / u_texsize, pattern_br_a / u_texsize, imagecoord);\n    vec4 color1 = texture2D(u_image, pos);\n\n    vec2 imagecoord_b = mod(v_pos_b, 1.0);\n    vec2 pos2 = mix(pattern_tl_b / u_texsize, pattern_br_b / u_texsize, imagecoord_b);\n    vec4 color2 = texture2D(u_image, pos2);\n\n    vec4 mixedColor = mix(color1, color2, u_fade);\n\n    gl_FragColor = mixedColor * v_lighting;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_height_factor;\nuniform vec4 u_scale;\nuniform float u_vertical_gradient;\n\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec4 a_normal_ed;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n\nvoid main() {\n    #pragma mapbox: initialize lowp float base\n    #pragma mapbox: initialize lowp float height\n    #pragma mapbox: initialize mediump vec4 pattern_from\n    #pragma mapbox: initialize mediump vec4 pattern_to\n\n    vec2 pattern_tl_a = pattern_from.xy;\n    vec2 pattern_br_a = pattern_from.zw;\n    vec2 pattern_tl_b = pattern_to.xy;\n    vec2 pattern_br_b = pattern_to.zw;\n\n    float pixelRatio = u_scale.x;\n    float tileRatio = u_scale.y;\n    float fromScale = u_scale.z;\n    float toScale = u_scale.w;\n\n    vec3 normal = a_normal_ed.xyz;\n    float edgedistance = a_normal_ed.w;\n\n    vec2 display_size_a = vec2((pattern_br_a.x - pattern_tl_a.x) / pixelRatio, (pattern_br_a.y - pattern_tl_a.y) / pixelRatio);\n    vec2 display_size_b = vec2((pattern_br_b.x - pattern_tl_b.x) / pixelRatio, (pattern_br_b.y - pattern_tl_b.y) / pixelRatio);\n\n    base = max(0.0, base);\n    height = max(0.0, height);\n\n    float t = mod(normal.x, 2.0);\n    float z = t > 0.0 ? height : base;\n\n    gl_Position = u_matrix * vec4(a_pos, z, 1);\n\n    vec2 pos = normal.x == 1.0 && normal.y == 0.0 && normal.z == 16384.0\n        ? a_pos // extrusion top\n        : vec2(edgedistance, z * u_height_factor); // extrusion side\n\n    v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, fromScale * display_size_a, tileRatio, pos);\n    v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, toScale * display_size_b, tileRatio, pos);\n\n    v_lighting = vec4(0.0, 0.0, 0.0, 1.0);\n    float directional = clamp(dot(normal / 16383.0, u_lightpos), 0.0, 1.0);\n    directional = mix((1.0 - u_lightintensity), max((0.5 + u_lightintensity), 1.0), directional);\n\n    if (normal.y != 0.0) {\n        // This avoids another branching statement, but multiplies by a constant of 0.84 if no vertical gradient,\n        // and otherwise calculates the gradient based on base + height\n        directional *= (\n            (1.0 - u_vertical_gradient) +\n            (u_vertical_gradient * clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0)));\n    }\n\n    v_lighting.rgb += clamp(directional * u_lightcolor, mix(vec3(0.0), vec3(0.3), 1.0 - u_lightcolor), vec3(1.0));\n}\n"},extrusionTexture:{fragmentSource:"uniform sampler2D u_image;\nuniform float u_opacity;\nvarying vec2 v_pos;\n\nvoid main() {\n    gl_FragColor = texture2D(u_image, v_pos) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(0.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\n\nvoid main() {\n    gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1);\n\n    v_pos.x = a_pos.x;\n    v_pos.y = 1.0 - a_pos.y;\n}\n"},hillshadePrepare:{fragmentSource:"#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D u_image;\nvarying vec2 v_pos;\nuniform vec2 u_dimension;\nuniform float u_zoom;\nuniform float u_maxzoom;\n\nfloat getElevation(vec2 coord, float bias) {\n    // Convert encoded elevation value to meters\n    vec4 data = texture2D(u_image, coord) * 255.0;\n    return (data.r + data.g * 256.0 + data.b * 256.0 * 256.0) / 4.0;\n}\n\nvoid main() {\n    vec2 epsilon = 1.0 / u_dimension;\n\n    // queried pixels:\n    // +-----------+\n    // |   |   |   |\n    // | a | b | c |\n    // |   |   |   |\n    // +-----------+\n    // |   |   |   |\n    // | d | e | f |\n    // |   |   |   |\n    // +-----------+\n    // |   |   |   |\n    // | g | h | i |\n    // |   |   |   |\n    // +-----------+\n\n    float a = getElevation(v_pos + vec2(-epsilon.x, -epsilon.y), 0.0);\n    float b = getElevation(v_pos + vec2(0, -epsilon.y), 0.0);\n    float c = getElevation(v_pos + vec2(epsilon.x, -epsilon.y), 0.0);\n    float d = getElevation(v_pos + vec2(-epsilon.x, 0), 0.0);\n    float e = getElevation(v_pos, 0.0);\n    float f = getElevation(v_pos + vec2(epsilon.x, 0), 0.0);\n    float g = getElevation(v_pos + vec2(-epsilon.x, epsilon.y), 0.0);\n    float h = getElevation(v_pos + vec2(0, epsilon.y), 0.0);\n    float i = getElevation(v_pos + vec2(epsilon.x, epsilon.y), 0.0);\n\n    // here we divide the x and y slopes by 8 * pixel size\n    // where pixel size (aka meters/pixel) is:\n    // circumference of the world / (pixels per tile * number of tiles)\n    // which is equivalent to: 8 * 40075016.6855785 / (512 * pow(2, u_zoom))\n    // which can be reduced to: pow(2, 19.25619978527 - u_zoom)\n    // we want to vertically exaggerate the hillshading though, because otherwise\n    // it is barely noticeable at low zooms. to do this, we multiply this by some\n    // scale factor pow(2, (u_zoom - u_maxzoom) * a) where a is an arbitrary value\n    // Here we use a=0.3 which works out to the expression below. see \n    // nickidlugash's awesome breakdown for more info\n    // https://github.com/mapbox/mapbox-gl-js/pull/5286#discussion_r148419556\n    float exaggeration = u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;\n\n    vec2 deriv = vec2(\n        (c + f + f + i) - (a + d + d + g),\n        (g + h + h + i) - (a + b + b + c)\n    ) /  pow(2.0, (u_zoom - u_maxzoom) * exaggeration + 19.2562 - u_zoom);\n\n    gl_FragColor = clamp(vec4(\n        deriv.x / 2.0 + 0.5,\n        deriv.y / 2.0 + 0.5,\n        1.0,\n        1.0), 0.0, 1.0);\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos;\n\nvoid main() {\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n    v_pos = (a_texture_pos / 8192.0) / 2.0 + 0.25;\n}\n"},hillshade:{fragmentSource:"uniform sampler2D u_image;\nvarying vec2 v_pos;\n\nuniform vec2 u_latrange;\nuniform vec2 u_light;\nuniform vec4 u_shadow;\nuniform vec4 u_highlight;\nuniform vec4 u_accent;\n\n#define PI 3.141592653589793\n\nvoid main() {\n    vec4 pixel = texture2D(u_image, v_pos);\n\n    vec2 deriv = ((pixel.rg * 2.0) - 1.0);\n\n    // We divide the slope by a scale factor based on the cosin of the pixel's approximate latitude\n    // to account for mercator projection distortion. see #4807 for details\n    float scaleFactor = cos(radians((u_latrange[0] - u_latrange[1]) * (1.0 - v_pos.y) + u_latrange[1]));\n    // We also multiply the slope by an arbitrary z-factor of 1.25\n    float slope = atan(1.25 * length(deriv) / scaleFactor);\n    float aspect = deriv.x != 0.0 ? atan(deriv.y, -deriv.x) : PI / 2.0 * (deriv.y > 0.0 ? 1.0 : -1.0);\n\n    float intensity = u_light.x;\n    // We add PI to make this property match the global light object, which adds PI/2 to the light's azimuthal\n    // position property to account for 0deg corresponding to north/the top of the viewport in the style spec\n    // and the original shader was written to accept (-illuminationDirection - 90) as the azimuthal.\n    float azimuth = u_light.y + PI;\n\n    // We scale the slope exponentially based on intensity, using a calculation similar to\n    // the exponential interpolation function in the style spec:\n    // https://github.com/mapbox/mapbox-gl-js/blob/master/src/style-spec/expression/definitions/interpolate.js#L217-L228\n    // so that higher intensity values create more opaque hillshading.\n    float base = 1.875 - intensity * 1.75;\n    float maxValue = 0.5 * PI;\n    float scaledSlope = intensity != 0.5 ? ((pow(base, slope) - 1.0) / (pow(base, maxValue) - 1.0)) * maxValue : slope;\n\n    // The accent color is calculated with the cosine of the slope while the shade color is calculated with the sine\n    // so that the accent color's rate of change eases in while the shade color's eases out.\n    float accent = cos(scaledSlope);\n    // We multiply both the accent and shade color by a clamped intensity value\n    // so that intensities >= 0.5 do not additionally affect the color values\n    // while intensity values < 0.5 make the overall color more transparent.\n    vec4 accent_color = (1.0 - accent) * u_accent * clamp(intensity * 2.0, 0.0, 1.0);\n    float shade = abs(mod((aspect + azimuth) / PI + 0.5, 2.0) - 1.0);\n    vec4 shade_color = mix(u_shadow, u_highlight, shade) * sin(scaledSlope) * clamp(intensity * 2.0, 0.0, 1.0);\n    gl_FragColor = accent_color * (1.0 - shade_color.a) + shade_color;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos;\n\nvoid main() {\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n    v_pos = a_texture_pos / 8192.0;\n}\n"},line:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_width2;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\n\nvoid main() {\n    #pragma mapbox: initialize highp vec4 color\n    #pragma mapbox: initialize lowp float blur\n    #pragma mapbox: initialize lowp float opacity\n\n    // Calculate the distance of the pixel from the line in pixels.\n    float dist = length(v_normal) * v_width2.s;\n\n    // Calculate the antialiasing fade factor. This is either when fading in\n    // the line in case of an offset line (v_width2.t) or when fading out\n    // (v_width2.s)\n    float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n    float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n    gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_gamma_scale;\nvarying highp float v_linesofar;\n\n#pragma mapbox: define highp vec4 color\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\nvoid main() {\n    #pragma mapbox: initialize highp vec4 color\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\n    vec2 a_extrude = a_data.xy - 128.0;\n    float a_direction = mod(a_data.z, 4.0) - 1.0;\n\n    v_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * 2.0;\n\n    vec2 pos = a_pos_normal.xy;\n\n    // x is 1 if it's a round cap, 0 otherwise\n    // y is 1 if the normal points up, and -1 if it points down\n    mediump vec2 normal = a_pos_normal.zw;\n    v_normal = normal;\n\n    // these transformations used to be applied in the JS and native code bases.\n    // moved them into the shader for clarity and simplicity.\n    gapwidth = gapwidth / 2.0;\n    float halfwidth = width / 2.0;\n    offset = -1.0 * offset;\n\n    float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n    float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING);\n\n    // Scale the extrusion vector down to a normal and then up by the line width\n    // of this vertex.\n    mediump vec2 dist = outset * a_extrude * scale;\n\n    // Calculate the offset when drawing a line that is to the side of the actual line.\n    // We do this by creating a vector that points towards the extrude, but rotate\n    // it when we're drawing round end points (a_direction = -1 or 1) since their\n    // extrude vector points in another direction.\n    mediump float u = 0.5 * a_direction;\n    mediump float t = 1.0 - abs(u);\n    mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n    vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n    gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n    // calculate how much the perspective view squishes or stretches the extrude\n    float extrude_length_without_perspective = length(dist);\n    float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n    v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n    v_width2 = vec2(outset, inset);\n}\n"},lineGradient:{fragmentSource:"\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nuniform sampler2D u_image;\n\nvarying vec2 v_width2;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\nvarying highp float v_lineprogress;\n\nvoid main() {\n    #pragma mapbox: initialize lowp float blur\n    #pragma mapbox: initialize lowp float opacity\n\n    // Calculate the distance of the pixel from the line in pixels.\n    float dist = length(v_normal) * v_width2.s;\n\n    // Calculate the antialiasing fade factor. This is either when fading in\n    // the line in case of an offset line (v_width2.t) or when fading out\n    // (v_width2.s)\n    float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n    float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n    // For gradient lines, v_lineprogress is the ratio along the entire line,\n    // scaled to [0, 2^15), and the gradient ramp is stored in a texture.\n    vec4 color = texture2D(u_image, vec2(v_lineprogress, 0.5));\n\n    gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"\n// the attribute conveying progress along a line is scaled to [0, 2^15)\n#define MAX_LINE_DISTANCE 32767.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_gamma_scale;\nvarying highp float v_lineprogress;\n\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\nvoid main() {\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\n    vec2 a_extrude = a_data.xy - 128.0;\n    float a_direction = mod(a_data.z, 4.0) - 1.0;\n\n    v_lineprogress = (floor(a_data.z / 4.0) + a_data.w * 64.0) * 2.0 / MAX_LINE_DISTANCE;\n\n    vec2 pos = a_pos_normal.xy;\n\n    // x is 1 if it's a round cap, 0 otherwise\n    // y is 1 if the normal points up, and -1 if it points down\n    mediump vec2 normal = a_pos_normal.zw;\n    v_normal = normal;\n\n    // these transformations used to be applied in the JS and native code bases.\n    // moved them into the shader for clarity and simplicity.\n    gapwidth = gapwidth / 2.0;\n    float halfwidth = width / 2.0;\n    offset = -1.0 * offset;\n\n    float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n    float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING);\n\n    // Scale the extrusion vector down to a normal and then up by the line width\n    // of this vertex.\n    mediump vec2 dist = outset * a_extrude * scale;\n\n    // Calculate the offset when drawing a line that is to the side of the actual line.\n    // We do this by creating a vector that points towards the extrude, but rotate\n    // it when we're drawing round end points (a_direction = -1 or 1) since their\n    // extrude vector points in another direction.\n    mediump float u = 0.5 * a_direction;\n    mediump float t = 1.0 - abs(u);\n    mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n    vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n    gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n    // calculate how much the perspective view squishes or stretches the extrude\n    float extrude_length_without_perspective = length(dist);\n    float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n    v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n    v_width2 = vec2(outset, inset);\n}\n"},linePattern:{fragmentSource:"uniform vec2 u_texsize;\nuniform float u_fade;\nuniform mediump vec4 u_scale;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n    #pragma mapbox: initialize mediump vec4 pattern_from\n    #pragma mapbox: initialize mediump vec4 pattern_to\n\n    #pragma mapbox: initialize lowp float blur\n    #pragma mapbox: initialize lowp float opacity\n\n    vec2 pattern_tl_a = pattern_from.xy;\n    vec2 pattern_br_a = pattern_from.zw;\n    vec2 pattern_tl_b = pattern_to.xy;\n    vec2 pattern_br_b = pattern_to.zw;\n\n    float pixelRatio = u_scale.x;\n    float tileZoomRatio = u_scale.y;\n    float fromScale = u_scale.z;\n    float toScale = u_scale.w;\n\n    vec2 display_size_a = vec2((pattern_br_a.x - pattern_tl_a.x) / pixelRatio, (pattern_br_a.y - pattern_tl_a.y) / pixelRatio);\n    vec2 display_size_b = vec2((pattern_br_b.x - pattern_tl_b.x) / pixelRatio, (pattern_br_b.y - pattern_tl_b.y) / pixelRatio);\n\n    vec2 pattern_size_a = vec2(display_size_a.x * fromScale / tileZoomRatio, display_size_a.y);\n    vec2 pattern_size_b = vec2(display_size_b.x * toScale / tileZoomRatio, display_size_b.y);\n\n    // Calculate the distance of the pixel from the line in pixels.\n    float dist = length(v_normal) * v_width2.s;\n\n    // Calculate the antialiasing fade factor. This is either when fading in\n    // the line in case of an offset line (v_width2.t) or when fading out\n    // (v_width2.s)\n    float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n    float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n    float x_a = mod(v_linesofar / pattern_size_a.x, 1.0);\n    float x_b = mod(v_linesofar / pattern_size_b.x, 1.0);\n\n    // v_normal.y is 0 at the midpoint of the line, -1 at the lower edge, 1 at the upper edge\n    // we clamp the line width outset to be between 0 and half the pattern height plus padding (2.0)\n    // to ensure we don't sample outside the designated symbol on the sprite sheet.\n    // 0.5 is added to shift the component to be bounded between 0 and 1 for interpolation of\n    // the texture coordinate\n    float y_a = 0.5 + (v_normal.y * clamp(v_width2.s, 0.0, (pattern_size_a.y + 2.0) / 2.0) / pattern_size_a.y);\n    float y_b = 0.5 + (v_normal.y * clamp(v_width2.s, 0.0, (pattern_size_b.y + 2.0) / 2.0) / pattern_size_b.y);\n    vec2 pos_a = mix(pattern_tl_a / u_texsize, pattern_br_a / u_texsize, vec2(x_a, y_a));\n    vec2 pos_b = mix(pattern_tl_b / u_texsize, pattern_br_b / u_texsize, vec2(x_b, y_b));\n\n    vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n    gl_FragColor = color * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform vec2 u_gl_units_to_pixels;\nuniform mediump float u_ratio;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n\nvoid main() {\n    #pragma mapbox: initialize lowp float blur\n    #pragma mapbox: initialize lowp float opacity\n    #pragma mapbox: initialize lowp float offset\n    #pragma mapbox: initialize mediump float gapwidth\n    #pragma mapbox: initialize mediump float width\n    #pragma mapbox: initialize mediump vec4 pattern_from\n    #pragma mapbox: initialize mediump vec4 pattern_to\n\n    vec2 a_extrude = a_data.xy - 128.0;\n    float a_direction = mod(a_data.z, 4.0) - 1.0;\n    float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n    // float tileRatio = u_scale.y;\n    vec2 pos = a_pos_normal.xy;\n\n    // x is 1 if it's a round cap, 0 otherwise\n    // y is 1 if the normal points up, and -1 if it points down\n    mediump vec2 normal = a_pos_normal.zw;\n    v_normal = normal;\n\n    // these transformations used to be applied in the JS and native code bases.\n    // moved them into the shader for clarity and simplicity.\n    gapwidth = gapwidth / 2.0;\n    float halfwidth = width / 2.0;\n    offset = -1.0 * offset;\n\n    float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n    float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING);\n\n    // Scale the extrusion vector down to a normal and then up by the line width\n    // of this vertex.\n    mediump vec2 dist = outset * a_extrude * scale;\n\n    // Calculate the offset when drawing a line that is to the side of the actual line.\n    // We do this by creating a vector that points towards the extrude, but rotate\n    // it when we're drawing round end points (a_direction = -1 or 1) since their\n    // extrude vector points in another direction.\n    mediump float u = 0.5 * a_direction;\n    mediump float t = 1.0 - abs(u);\n    mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n    vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n    gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n    // calculate how much the perspective view squishes or stretches the extrude\n    float extrude_length_without_perspective = length(dist);\n    float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n    v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n    v_linesofar = a_linesofar;\n    v_width2 = vec2(outset, inset);\n}\n"},lineSDF:{fragmentSource:"\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n\nvoid main() {\n    #pragma mapbox: initialize highp vec4 color\n    #pragma mapbox: initialize lowp float blur\n    #pragma mapbox: initialize lowp float opacity\n    #pragma mapbox: initialize mediump float width\n    #pragma mapbox: initialize lowp float floorwidth\n\n    // Calculate the distance of the pixel from the line in pixels.\n    float dist = length(v_normal) * v_width2.s;\n\n    // Calculate the antialiasing fade factor. This is either when fading in\n    // the line in case of an offset line (v_width2.t) or when fading out\n    // (v_width2.s)\n    float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n    float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n    float sdfdist_a = texture2D(u_image, v_tex_a).a;\n    float sdfdist_b = texture2D(u_image, v_tex_b).a;\n    float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n    alpha *= smoothstep(0.5 - u_sdfgamma / floorwidth, 0.5 + u_sdfgamma / floorwidth, sdfdist);\n\n    gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\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 lowp float floorwidth\n\nvoid main() {\n    #pragma mapbox: initialize highp vec4 color\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 lowp float floorwidth\n\n    vec2 a_extrude = a_data.xy - 128.0;\n    float a_direction = mod(a_data.z, 4.0) - 1.0;\n    float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n    vec2 pos = a_pos_normal.xy;\n\n    // x is 1 if it's a round cap, 0 otherwise\n    // y is 1 if the normal points up, and -1 if it points down\n    mediump vec2 normal = a_pos_normal.zw;\n    v_normal = normal;\n\n    // these transformations used to be applied in the JS and native code bases.\n    // moved them into the shader for clarity and simplicity.\n    gapwidth = gapwidth / 2.0;\n    float halfwidth = width / 2.0;\n    offset = -1.0 * offset;\n\n    float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n    float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING);\n\n    // Scale the extrusion vector down to a normal and then up by the line width\n    // of this vertex.\n    mediump vec2 dist =outset * a_extrude * scale;\n\n    // Calculate the offset when drawing a line that is to the side of the actual line.\n    // We do this by creating a vector that points towards the extrude, but rotate\n    // it when we're drawing round end points (a_direction = -1 or 1) since their\n    // extrude vector points in another direction.\n    mediump float u = 0.5 * a_direction;\n    mediump float t = 1.0 - abs(u);\n    mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n    vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n    gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n    // calculate how much the perspective view squishes or stretches the extrude\n    float extrude_length_without_perspective = length(dist);\n    float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n    v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n    v_tex_a = vec2(a_linesofar * u_patternscale_a.x / floorwidth, normal.y * u_patternscale_a.y + u_tex_y_a);\n    v_tex_b = vec2(a_linesofar * u_patternscale_b.x / floorwidth, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n    v_width2 = vec2(outset, inset);\n}\n"},raster:{fragmentSource:"uniform float u_fade_t;\nuniform float u_opacity;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n    // read and cross-fade colors from the main and parent tiles\n    vec4 color0 = texture2D(u_image0, v_pos0);\n    vec4 color1 = texture2D(u_image1, v_pos1);\n    if (color0.a > 0.0) {\n        color0.rgb = color0.rgb / color0.a;\n    }\n    if (color1.a > 0.0) {\n        color1.rgb = color1.rgb / color1.a;\n    }\n    vec4 color = mix(color0, color1, u_fade_t);\n    color.a *= u_opacity;\n    vec3 rgb = color.rgb;\n\n    // spin\n    rgb = vec3(\n        dot(rgb, u_spin_weights.xyz),\n        dot(rgb, u_spin_weights.zxy),\n        dot(rgb, u_spin_weights.yzx));\n\n    // saturation\n    float average = (color.r + color.g + color.b) / 3.0;\n    rgb += (average - rgb) * u_saturation_factor;\n\n    // contrast\n    rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n    // brightness\n    vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n    vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n    gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb) * color.a, color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n    // We are using Int16 for texture position coordinates to give us enough precision for\n    // fractional coordinates. We use 8192 to scale the texture coordinates in the buffer\n    // as an arbitrarily high number to preserve adequate precision when rendering.\n    // This is also the same value as the EXTENT we are using for our tile buffer pos coordinates,\n    // so math for modifying either is consistent.\n    v_pos0 = (((a_texture_pos / 8192.0) - 0.5) / u_buffer_scale ) + 0.5;\n    v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},symbolIcon:{fragmentSource:"uniform sampler2D u_texture;\n\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_tex;\nvarying float v_fade_opacity;\n\nvoid main() {\n    #pragma mapbox: initialize lowp float opacity\n\n    lowp float alpha = opacity * v_fade_opacity;\n    gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"const float PI = 3.141592653589793;\n\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec3 a_projected_pos;\nattribute float a_fade_opacity;\n\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\nuniform highp float u_camera_to_center_distance;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform float u_fade_change;\n\n#pragma mapbox: define lowp float opacity\n\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_gl_coord_matrix;\n\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying float v_fade_opacity;\n\nvoid main() {\n    #pragma mapbox: initialize lowp float opacity\n\n    vec2 a_pos = a_pos_offset.xy;\n    vec2 a_offset = a_pos_offset.zw;\n\n    vec2 a_tex = a_data.xy;\n    vec2 a_size = a_data.zw;\n\n    highp float segment_angle = -a_projected_pos[2];\n\n    float size;\n    if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n        size = mix(a_size[0], a_size[1], u_size_t) / 256.0;\n    } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n        size = a_size[0] / 256.0;\n    } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\n        size = u_size;\n    } else {\n        size = u_size;\n    }\n\n    vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n    highp float camera_to_anchor_distance = projectedPoint.w;\n    // See comments in symbol_sdf.vertex\n    highp float distance_ratio = u_pitch_with_map ?\n        camera_to_anchor_distance / u_camera_to_center_distance :\n        u_camera_to_center_distance / camera_to_anchor_distance;\n    highp float perspective_ratio = clamp(\n            0.5 + 0.5 * distance_ratio,\n            0.0, // Prevents oversized near-field symbols in pitched/overzoomed tiles\n            4.0);\n\n    size *= perspective_ratio;\n\n    float fontScale = u_is_text ? size / 24.0 : size;\n\n    highp float symbol_rotation = 0.0;\n    if (u_rotate_symbol) {\n        // See comments in symbol_sdf.vertex\n        vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n        vec2 a = projectedPoint.xy / projectedPoint.w;\n        vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n        symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n    }\n\n    highp float angle_sin = sin(segment_angle + symbol_rotation);\n    highp float angle_cos = cos(segment_angle + symbol_rotation);\n    mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n    vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n    gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 32.0 * fontScale), 0.0, 1.0);\n\n    v_tex = a_tex / u_texsize;\n    vec2 fade_opacity = unpack_opacity(a_fade_opacity);\n    float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change;\n    v_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change));\n}\n"},symbolSDF:{fragmentSource:"#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105/DEVICE_PIXEL_RATIO\n\nuniform bool u_is_halo;\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\nuniform sampler2D u_texture;\nuniform highp float u_gamma_scale;\nuniform bool u_is_text;\n\nvarying vec2 v_data0;\nvarying vec3 v_data1;\n\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\n    vec2 tex = v_data0.xy;\n    float gamma_scale = v_data1.x;\n    float size = v_data1.y;\n    float fade_opacity = v_data1[2];\n\n    float fontScale = u_is_text ? size / 24.0 : size;\n\n    lowp vec4 color = fill_color;\n    highp float gamma = EDGE_GAMMA / (fontScale * u_gamma_scale);\n    lowp float buff = (256.0 - 64.0) / 256.0;\n    if (u_is_halo) {\n        color = halo_color;\n        gamma = (halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (fontScale * u_gamma_scale);\n        buff = (6.0 - halo_width / fontScale) / SDF_PX;\n    }\n\n    lowp float dist = texture2D(u_texture, tex).a;\n    highp float gamma_scaled = gamma * gamma_scale;\n    highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);\n\n    gl_FragColor = color * (alpha * opacity * fade_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"const float PI = 3.141592653589793;\n\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec3 a_projected_pos;\nattribute float a_fade_opacity;\n\n// contents of a_size vary based on the type of property value\n// used for {text,icon}-size.\n// For constants, a_size is disabled.\n// For source functions, we bind only one value per vertex: the value of {text,icon}-size evaluated for the current feature.\n// For composite functions:\n// [ text-size(lowerZoomStop, feature),\n//   text-size(upperZoomStop, feature) ]\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\n\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\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_gl_coord_matrix;\n\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform highp float u_camera_to_center_distance;\nuniform float u_fade_change;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_data0;\nvarying vec3 v_data1;\n\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\n    vec2 a_pos = a_pos_offset.xy;\n    vec2 a_offset = a_pos_offset.zw;\n\n    vec2 a_tex = a_data.xy;\n    vec2 a_size = a_data.zw;\n\n    highp float segment_angle = -a_projected_pos[2];\n    float size;\n\n    if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n        size = mix(a_size[0], a_size[1], u_size_t) / 256.0;\n    } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n        size = a_size[0] / 256.0;\n    } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\n        size = u_size;\n    } else {\n        size = u_size;\n    }\n\n    vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n    highp float camera_to_anchor_distance = projectedPoint.w;\n    // If the label is pitched with the map, layout is done in pitched space,\n    // which makes labels in the distance smaller relative to viewport space.\n    // We counteract part of that effect by multiplying by the perspective ratio.\n    // If the label isn't pitched with the map, we do layout in viewport space,\n    // which makes labels in the distance larger relative to the features around\n    // them. We counteract part of that effect by dividing by the perspective ratio.\n    highp float distance_ratio = u_pitch_with_map ?\n        camera_to_anchor_distance / u_camera_to_center_distance :\n        u_camera_to_center_distance / camera_to_anchor_distance;\n    highp float perspective_ratio = clamp(\n        0.5 + 0.5 * distance_ratio,\n        0.0, // Prevents oversized near-field symbols in pitched/overzoomed tiles\n        4.0);\n\n    size *= perspective_ratio;\n\n    float fontScale = u_is_text ? size / 24.0 : size;\n\n    highp float symbol_rotation = 0.0;\n    if (u_rotate_symbol) {\n        // Point labels with 'rotation-alignment: map' are horizontal with respect to tile units\n        // To figure out that angle in projected space, we draw a short horizontal line in tile\n        // space, project it, and measure its angle in projected space.\n        vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n        vec2 a = projectedPoint.xy / projectedPoint.w;\n        vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n        symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n    }\n\n    highp float angle_sin = sin(segment_angle + symbol_rotation);\n    highp float angle_cos = cos(segment_angle + symbol_rotation);\n    mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n    vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n    gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 32.0 * fontScale), 0.0, 1.0);\n    float gamma_scale = gl_Position.w;\n\n    vec2 tex = a_tex / u_texsize;\n    vec2 fade_opacity = unpack_opacity(a_fade_opacity);\n    float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change;\n    float interpolated_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change));\n\n    v_data0 = vec2(tex.x, tex.y);\n    v_data1 = vec3(gamma_scale, size, interpolated_fade_opacity);\n}\n"}},He=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,Ye=function(t){var e=We[t],n={};e.fragmentSource=e.fragmentSource.replace(He,(function(t,e,r,i,o){return n[o]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nvarying "+r+" "+i+" "+o+";\n#else\nuniform "+r+" "+i+" u_"+o+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+o+"\n    "+r+" "+i+" "+o+" = u_"+o+";\n#endif\n"})),e.vertexSource=e.vertexSource.replace(He,(function(t,e,r,i,o){var a="float"===i?"vec2":"vec4",s=o.match(/color/)?"color":a;return n[o]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float a_"+o+"_t;\nattribute "+r+" "+a+" a_"+o+";\nvarying "+r+" "+i+" "+o+";\n#else\nuniform "+r+" "+i+" u_"+o+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+o+"\n    "+o+" = a_"+o+";\n#else\n    "+r+" "+i+" "+o+" = u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n    "+o+" = unpack_mix_"+s+"(a_"+o+", a_"+o+"_t);\n#else\n    "+r+" "+i+" "+o+" = u_"+o+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float a_"+o+"_t;\nattribute "+r+" "+a+" a_"+o+";\n#else\nuniform "+r+" "+i+" u_"+o+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+o+"\n    "+r+" "+i+" "+o+" = a_"+o+";\n#else\n    "+r+" "+i+" "+o+" = u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n    "+r+" "+i+" "+o+" = unpack_mix_"+s+"(a_"+o+", a_"+o+"_t);\n#else\n    "+r+" "+i+" "+o+" = u_"+o+";\n#endif\n"}))};for(var Ke in We)Ye(Ke);var Je=We,$e=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};$e.prototype.bind=function(t,e,n,r,i,o,a,s){this.context=t;for(var u=this.boundPaintVertexBuffers.length!==r.length,l=0;!u&&l<r.length;l++)this.boundPaintVertexBuffers[l]!==r[l]&&(u=!0);var c=!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==n||u||this.boundIndexBuffer!==i||this.boundVertexOffset!==o||this.boundDynamicVertexBuffer!==a||this.boundDynamicVertexBuffer2!==s;!t.extVertexArrayObject||c?this.freshBind(e,n,r,i,o,a,s):(t.bindVertexArrayOES.set(this.vao),a&&a.bind(),i&&i.dynamicDraw&&i.bind(),s&&s.bind())},$e.prototype.freshBind=function(t,e,n,r,i,o,a){var s,u=t.numAttributes,l=this.context,c=l.gl;if(l.extVertexArrayObject)this.vao&&this.destroy(),this.vao=l.extVertexArrayObject.createVertexArrayOES(),l.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=n,this.boundIndexBuffer=r,this.boundVertexOffset=i,this.boundDynamicVertexBuffer=o,this.boundDynamicVertexBuffer2=a;else{s=l.currentNumAttributes||0;for(var h=u;h<s;h++)c.disableVertexAttribArray(h)}e.enableAttributes(c,t);for(var p=0,f=n;p<f.length;p+=1)f[p].enableAttributes(c,t);o&&o.enableAttributes(c,t),a&&a.enableAttributes(c,t),e.bind(),e.setVertexAttribPointers(c,t,i);for(var d=0,m=n;d<m.length;d+=1){var y=m[d];y.bind(),y.setVertexAttribPointers(c,t,i)}o&&(o.bind(),o.setVertexAttribPointers(c,t,i)),r&&r.bind(),a&&(a.bind(),a.setVertexAttribPointers(c,t,i)),l.currentNumAttributes=u},$e.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var Qe=function(e,n,r,i,o){var a=e.gl;this.program=a.createProgram();var s=r.defines().concat("#define DEVICE_PIXEL_RATIO "+t.browser.devicePixelRatio.toFixed(1));o&&s.push("#define OVERDRAW_INSPECTOR;");var u=s.concat(Je.prelude.fragmentSource,n.fragmentSource).join("\n"),l=s.concat(Je.prelude.vertexSource,n.vertexSource).join("\n"),c=a.createShader(a.FRAGMENT_SHADER);a.shaderSource(c,u),a.compileShader(c),a.attachShader(this.program,c);var h=a.createShader(a.VERTEX_SHADER);a.shaderSource(h,l),a.compileShader(h),a.attachShader(this.program,h);for(var p=r.layoutAttributes||[],f=0;f<p.length;f++)a.bindAttribLocation(this.program,f,p[f].name);a.linkProgram(this.program),this.numAttributes=a.getProgramParameter(this.program,a.ACTIVE_ATTRIBUTES),this.attributes={};for(var d={},m=0;m<this.numAttributes;m++){var y=a.getActiveAttrib(this.program,m);y&&(this.attributes[y.name]=a.getAttribLocation(this.program,y.name))}for(var v=a.getProgramParameter(this.program,a.ACTIVE_UNIFORMS),g=0;g<v;g++){var _=a.getActiveUniform(this.program,g);_&&(d[_.name]=a.getUniformLocation(this.program,_.name))}this.fixedUniforms=i(e,d),this.binderUniforms=r.getUniforms(e,d)};function tn(e,n,r){var i=1/xe(r,1,n.transform.tileZoom),o=Math.pow(2,r.tileID.overscaledZ),a=r.tileSize*Math.pow(2,n.transform.tileZoom)/o,s=a*(r.tileID.canonical.x+r.tileID.wrap*o),u=a*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[t.browser.devicePixelRatio,i,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[s>>16,u>>16],u_pixel_coord_lower:[65535&s,65535&u]}}Qe.prototype.draw=function(t,e,n,r,i,o,a,s,u,l,c,h,p,f,d,m){var y,v=t.gl;for(var g in t.program.set(this.program),t.setDepthMode(n),t.setStencilMode(r),t.setColorMode(i),t.setCullFace(o),this.fixedUniforms)this.fixedUniforms[g].set(a[g]);f&&f.setUniforms(t,this.binderUniforms,h,{zoom:p});for(var _=(y={},y[v.LINES]=2,y[v.TRIANGLES]=3,y[v.LINE_STRIP]=1,y)[e],x=0,b=c.get();x<b.length;x+=1){var w=b[x],E=w.vaos||(w.vaos={});(E[s]||(E[s]=new $e)).bind(t,this,u,f?f.getPaintVertexBuffers():[],l,w.vertexOffset,d,m),v.drawElements(e,w.primitiveLength*_,v.UNSIGNED_SHORT,w.primitiveOffset*_*2)}};var en=function(e,n,r){var i=n.style.light,o=i.properties.get("position"),a=[o.x,o.y,o.z],s=t.create$2();"viewport"===i.properties.get("anchor")&&t.fromRotation(s,-n.transform.angle),t.transformMat3(a,a,s);var u=i.properties.get("color");return{u_matrix:e,u_lightpos:a,u_lightintensity:i.properties.get("intensity"),u_lightcolor:[u.r,u.g,u.b],u_vertical_gradient:+r}},nn=function(e,n,r,i,o,a){return t.extend(en(e,n,r),tn(o,n,a),{u_height_factor:-Math.pow(2,i.overscaledZ)/a.tileSize/8})},rn=function(e,n,r){var i=t.create();t.ortho(i,0,e.width,e.height,0,0,1);var o=e.context.gl;return{u_matrix:i,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:r,u_opacity:n}},on=function(t){return{u_matrix:t}},an=function(e,n,r,i){return t.extend(on(e),tn(r,n,i))},sn=function(t,e){return{u_matrix:t,u_world:e}},un=function(e,n,r,i,o){return t.extend(an(e,n,r,i),{u_world:o})},ln=function(t,e,n,r){var i,o,a=t.transform;if("map"===r.paint.get("circle-pitch-alignment")){var s=xe(n,1,a.zoom);i=!0,o=[s,s]}else i=!1,o=a.pixelsToGLUnits;return{u_camera_to_center_distance:a.cameraToCenterDistance,u_scale_with_map:+("map"===r.paint.get("circle-pitch-scale")),u_matrix:t.translatePosMatrix(e.posMatrix,n,r.paint.get("circle-translate"),r.paint.get("circle-translate-anchor")),u_pitch_with_map:+i,u_extrude_scale:o}},cn=function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,n.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,n.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,n.u_overscale_factor)}},hn=function(t,e,n){var r=xe(n,1,e.zoom),i=Math.pow(2,e.zoom-n.tileID.overscaledZ),o=n.tileID.overscaleFactor();return{u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:r,u_extrude_scale:[e.pixelsToGLUnits[0]/(r*i),e.pixelsToGLUnits[1]/(r*i)],u_overscale_factor:o}},pn=function(t,e){return{u_matrix:t,u_color:e}},fn=function(t){return{u_matrix:t}},dn=function(t,e,n,r){return{u_matrix:t,u_extrude_scale:xe(e,1,n),u_intensity:r}},mn=function(e,n,r){var i=r.paint.get("hillshade-shadow-color"),o=r.paint.get("hillshade-highlight-color"),a=r.paint.get("hillshade-accent-color"),s=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);return"viewport"===r.paint.get("hillshade-illumination-anchor")&&(s-=e.transform.angle),{u_matrix:e.transform.calculatePosMatrix(n.tileID.toUnwrapped(),!0),u_image:0,u_latrange:function(e,n){var r=n.toCoordinate(),i=new t.Coordinate(r.column,r.row+1,r.zoom);return[e.transform.coordinateLocation(r).lat,e.transform.coordinateLocation(i).lat]}(e,n.tileID),u_light:[r.paint.get("hillshade-exaggeration"),s],u_shadow:i,u_highlight:o,u_accent:a}},yn=function(t,e,n){var r=t.transform;return{u_matrix:bn(t,e,n),u_ratio:1/xe(e,1,r.zoom),u_gl_units_to_pixels:[1/r.pixelsToGLUnits[0],1/r.pixelsToGLUnits[1]]}},vn=function(e,n,r){return t.extend(yn(e,n,r),{u_image:0})},gn=function(e,n,r,i){var o=e.transform,a=xn(n,o);return{u_matrix:bn(e,n,r),u_texsize:n.imageAtlasTexture.size,u_ratio:1/xe(n,1,o.zoom),u_image:0,u_scale:[t.browser.devicePixelRatio,a,i.fromScale,i.toScale],u_fade:i.t,u_gl_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},_n=function(e,n,r,i,o){var a=e.transform,s=e.lineAtlas,u=xn(n,a),l="round"===r.layout.get("line-cap"),c=s.getDash(i.from,l),h=s.getDash(i.to,l),p=c.width*o.fromScale,f=h.width*o.toScale;return t.extend(yn(e,n,r),{u_patternscale_a:[u/p,-c.height/2],u_patternscale_b:[u/f,-h.height/2],u_sdfgamma:s.width/(256*Math.min(p,f)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:c.y,u_tex_y_b:h.y,u_mix:o.t})};function xn(t,e){return 1/xe(t,1,e.tileZoom)}function bn(t,e,n){return t.translatePosMatrix(e.tileID.posMatrix,e,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}var wn=function(t,e,n,r,i){return{u_matrix:t,u_tl_parent:e,u_scale_parent:n,u_buffer_scale:1,u_fade_t:r.mix,u_opacity:r.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:(a=i.paint.get("raster-saturation"),a>0?1-1/(1.001-a):-a),u_contrast_factor:(o=i.paint.get("raster-contrast"),o>0?1/(1-o):1+o),u_spin_weights:function(t){t*=Math.PI/180;var e=Math.sin(t),n=Math.cos(t);return[(2*n+1)/3,(-Math.sqrt(3)*e-n+1)/3,(Math.sqrt(3)*e-n+1)/3]}(i.paint.get("raster-hue-rotate"))};var o,a},En=function(t,e,n,r,i,o,a,s,u,l){var c=i.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:c.width/c.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:a,u_gl_coord_matrix:s,u_is_text:+u,u_pitch_with_map:+r,u_texsize:l,u_texture:0}},Sn=function(e,n,r,i,o,a,s,u,l,c,h){var p=o.transform;return t.extend(En(e,n,r,i,o,a,s,u,l,c),{u_gamma_scale:i?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_is_halo:+h})},Tn=function(t,e,n){return{u_matrix:t,u_opacity:e,u_color:n}},kn=function(e,n,r,i,o,a){return t.extend(function(t,e,n,r){var i=n.imageManager.getPattern(t.from),o=n.imageManager.getPattern(t.to),a=n.imageManager.getPixelSize(),s=a.width,u=a.height,l=Math.pow(2,r.tileID.overscaledZ),c=r.tileSize*Math.pow(2,n.transform.tileZoom)/l,h=c*(r.tileID.canonical.x+r.tileID.wrap*l),p=c*r.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[s,u],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/xe(r,1,n.transform.tileZoom),u_pixel_coord_upper:[h>>16,p>>16],u_pixel_coord_lower:[65535&h,65535&p]}}(i,a,r,o),{u_matrix:e,u_opacity:n})},Mn={fillExtrusion:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_lightpos:new t.Uniform3f(e,n.u_lightpos),u_lightintensity:new t.Uniform1f(e,n.u_lightintensity),u_lightcolor:new t.Uniform3f(e,n.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,n.u_vertical_gradient)}},fillExtrusionPattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_lightpos:new t.Uniform3f(e,n.u_lightpos),u_lightintensity:new t.Uniform1f(e,n.u_lightintensity),u_lightcolor:new t.Uniform3f(e,n.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,n.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,n.u_height_factor),u_image:new t.Uniform1i(e,n.u_image),u_texsize:new t.Uniform2f(e,n.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,n.u_pixel_coord_lower),u_scale:new t.Uniform4f(e,n.u_scale),u_fade:new t.Uniform1f(e,n.u_fade)}},extrusionTexture:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_world:new t.Uniform2f(e,n.u_world),u_image:new t.Uniform1i(e,n.u_image),u_opacity:new t.Uniform1f(e,n.u_opacity)}},fill:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},fillPattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_image:new t.Uniform1i(e,n.u_image),u_texsize:new t.Uniform2f(e,n.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,n.u_pixel_coord_lower),u_scale:new t.Uniform4f(e,n.u_scale),u_fade:new t.Uniform1f(e,n.u_fade)}},fillOutline:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_world:new t.Uniform2f(e,n.u_world)}},fillOutlinePattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_world:new t.Uniform2f(e,n.u_world),u_image:new t.Uniform1i(e,n.u_image),u_texsize:new t.Uniform2f(e,n.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,n.u_pixel_coord_lower),u_scale:new t.Uniform4f(e,n.u_scale),u_fade:new t.Uniform1f(e,n.u_fade)}},circle:function(e,n){return{u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,n.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,n.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,n.u_extrude_scale),u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},collisionBox:cn,collisionCircle:cn,debug:function(e,n){return{u_color:new t.UniformColor(e,n.u_color),u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},clippingMask:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},heatmap:function(e,n){return{u_extrude_scale:new t.Uniform1f(e,n.u_extrude_scale),u_intensity:new t.Uniform1f(e,n.u_intensity),u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},heatmapTexture:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_world:new t.Uniform2f(e,n.u_world),u_image:new t.Uniform1i(e,n.u_image),u_color_ramp:new t.Uniform1i(e,n.u_color_ramp),u_opacity:new t.Uniform1f(e,n.u_opacity)}},hillshade:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_image:new t.Uniform1i(e,n.u_image),u_latrange:new t.Uniform2f(e,n.u_latrange),u_light:new t.Uniform2f(e,n.u_light),u_shadow:new t.UniformColor(e,n.u_shadow),u_highlight:new t.UniformColor(e,n.u_highlight),u_accent:new t.UniformColor(e,n.u_accent)}},hillshadePrepare:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_image:new t.Uniform1i(e,n.u_image),u_dimension:new t.Uniform2f(e,n.u_dimension),u_zoom:new t.Uniform1f(e,n.u_zoom),u_maxzoom:new t.Uniform1f(e,n.u_maxzoom)}},line:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_ratio:new t.Uniform1f(e,n.u_ratio),u_gl_units_to_pixels:new t.Uniform2f(e,n.u_gl_units_to_pixels)}},lineGradient:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_ratio:new t.Uniform1f(e,n.u_ratio),u_gl_units_to_pixels:new t.Uniform2f(e,n.u_gl_units_to_pixels),u_image:new t.Uniform1i(e,n.u_image)}},linePattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_texsize:new t.Uniform2f(e,n.u_texsize),u_ratio:new t.Uniform1f(e,n.u_ratio),u_image:new t.Uniform1i(e,n.u_image),u_gl_units_to_pixels:new t.Uniform2f(e,n.u_gl_units_to_pixels),u_scale:new t.Uniform4f(e,n.u_scale),u_fade:new t.Uniform1f(e,n.u_fade)}},lineSDF:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_ratio:new t.Uniform1f(e,n.u_ratio),u_gl_units_to_pixels:new t.Uniform2f(e,n.u_gl_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,n.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,n.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,n.u_sdfgamma),u_image:new t.Uniform1i(e,n.u_image),u_tex_y_a:new t.Uniform1f(e,n.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,n.u_tex_y_b),u_mix:new t.Uniform1f(e,n.u_mix)}},raster:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_tl_parent:new t.Uniform2f(e,n.u_tl_parent),u_scale_parent:new t.Uniform1f(e,n.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,n.u_buffer_scale),u_fade_t:new t.Uniform1f(e,n.u_fade_t),u_opacity:new t.Uniform1f(e,n.u_opacity),u_image0:new t.Uniform1i(e,n.u_image0),u_image1:new t.Uniform1i(e,n.u_image1),u_brightness_low:new t.Uniform1f(e,n.u_brightness_low),u_brightness_high:new t.Uniform1f(e,n.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,n.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,n.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,n.u_spin_weights)}},symbolIcon:function(e,n){return{u_is_size_zoom_constant:new t.Uniform1i(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,n.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,n.u_size_t),u_size:new t.Uniform1f(e,n.u_size),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,n.u_pitch),u_rotate_symbol:new t.Uniform1i(e,n.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,n.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,n.u_fade_change),u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,n.u_label_plane_matrix),u_gl_coord_matrix:new t.UniformMatrix4f(e,n.u_gl_coord_matrix),u_is_text:new t.Uniform1f(e,n.u_is_text),u_pitch_with_map:new t.Uniform1i(e,n.u_pitch_with_map),u_texsize:new t.Uniform2f(e,n.u_texsize),u_texture:new t.Uniform1i(e,n.u_texture)}},symbolSDF:function(e,n){return{u_is_size_zoom_constant:new t.Uniform1i(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,n.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,n.u_size_t),u_size:new t.Uniform1f(e,n.u_size),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,n.u_pitch),u_rotate_symbol:new t.Uniform1i(e,n.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,n.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,n.u_fade_change),u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,n.u_label_plane_matrix),u_gl_coord_matrix:new t.UniformMatrix4f(e,n.u_gl_coord_matrix),u_is_text:new t.Uniform1f(e,n.u_is_text),u_pitch_with_map:new t.Uniform1i(e,n.u_pitch_with_map),u_texsize:new t.Uniform2f(e,n.u_texsize),u_texture:new t.Uniform1i(e,n.u_texture),u_gamma_scale:new t.Uniform1f(e,n.u_gamma_scale),u_is_halo:new t.Uniform1f(e,n.u_is_halo)}},background:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_opacity:new t.Uniform1f(e,n.u_opacity),u_color:new t.UniformColor(e,n.u_color)}},backgroundPattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_opacity:new t.Uniform1f(e,n.u_opacity),u_image:new t.Uniform1i(e,n.u_image),u_pattern_tl_a:new t.Uniform2f(e,n.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,n.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,n.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,n.u_pattern_br_b),u_texsize:new t.Uniform2f(e,n.u_texsize),u_mix:new t.Uniform1f(e,n.u_mix),u_pattern_size_a:new t.Uniform2f(e,n.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,n.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,n.u_scale_a),u_scale_b:new t.Uniform1f(e,n.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,n.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,n.u_tile_units_to_pixels)}}};function An(e,n){for(var r=e.sort((function(t,e){return t.tileID.isLessThan(e.tileID)?-1:e.tileID.isLessThan(t.tileID)?1:0})),i=0;i<r.length;i++){var o={},a=r[i],s=r.slice(i+1);Pn(a.tileID.wrapped(),a.tileID,s,new t.OverscaledTileID(0,a.tileID.wrap+1,0,0,0),o),a.setMask(o,n)}}function Pn(e,n,r,i,o){for(var a=0;a<r.length;a++){var s=r[a];if(i.isLessThan(s.tileID))break;if(n.key===s.tileID.key)return;if(s.tileID.isChildOf(n)){for(var u=n.children(1/0),l=0;l<u.length;l++)Pn(e,u[l],r.slice(a),i,o);return}}var c=n.overscaledZ-e.overscaledZ,h=new t.CanonicalTileID(c,n.canonical.x-(e.canonical.x<<c),n.canonical.y-(e.canonical.y<<c));o[h.key]=o[h.key]||h}function zn(t,e,n,r,i){for(var o=t.context,a=o.gl,s=i?t.useProgram("collisionCircle"):t.useProgram("collisionBox"),u=0;u<r.length;u++){var l=r[u],c=e.getTile(l),h=c.getBucket(n);if(h){var p=i?h.collisionCircle:h.collisionBox;p&&s.draw(o,i?a.TRIANGLES:a.LINES,Dt.disabled,Rt.disabled,t.colorModeForRenderPass(),Ft.disabled,hn(l.posMatrix,t.transform,c),n.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,null,t.transform.zoom,null,null,p.collisionVertexBuffer)}}}var In=t.identity(new Float32Array(16)),Cn=t.properties.layout;function Ln(e,n,r,i,o,a,s,u,l,c,h,p){for(var f,d,m=e.context,y=m.gl,v=e.transform,g="map"===u,_="map"===l,x=g&&"point"!==r.layout.get("symbol-placement"),b=g&&!_&&!x,w=_?e.depthModeForSublayer(0,Dt.ReadOnly):Dt.disabled,E=0,S=i;E<S.length;E+=1){var T=S[E],k=n.getTile(T),M=k.getBucket(r);if(M){var A=o?M.text:M.icon;if(A&&A.segments.get().length){var P=A.programConfigurations.get(r.id),z=o||M.sdfIcons,I=o?M.textSizeData:M.iconSizeData;f||(f=e.useProgram(z?"symbolSDF":"symbolIcon",P),d=t.evaluateSizeForZoom(I,v.zoom,Cn.properties[o?"text-size":"icon-size"])),m.activeTexture.set(y.TEXTURE0);var C=void 0;if(o)k.glyphAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),C=k.glyphAtlasTexture.size;else{var L=1!==r.layout.get("icon-size").constantOr(0)||M.iconsNeedLinear,O=_||0!==v.pitch;k.imageAtlasTexture.bind(z||e.options.rotating||e.options.zooming||L||O?y.LINEAR:y.NEAREST,y.CLAMP_TO_EDGE),C=k.imageAtlasTexture.size}var D=xe(k,1,e.transform.zoom),R=oe(T.posMatrix,_,g,e.transform,D),B=ae(T.posMatrix,_,g,e.transform,D);x&&le(M,T.posMatrix,e,o,R,B,_,c);var F=e.translatePosMatrix(T.posMatrix,k,a,s),j=x?In:R,V=e.translatePosMatrix(B,k,a,s,!0),N=void 0;if(z){var U=0!==r.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1);N=Sn(I.functionType,d,b,_,e,F,j,V,o,C,!0),U&&On(A,r,e,f,w,h,p,N),N.u_is_halo=0}else N=En(I.functionType,d,b,_,e,F,j,V,o,C);On(A,r,e,f,w,h,p,N)}}}}function On(t,e,n,r,i,o,a,s){var u=n.context,l=u.gl;r.draw(u,l.TRIANGLES,i,o,a,Ft.disabled,s,e.id,t.layoutVertexBuffer,t.indexBuffer,t.segments,e.paint,n.transform.zoom,t.programConfigurations.get(e.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function Dn(t,e,n,r,i,o,a){var s,u,l,c,h,p=t.context.gl,f=n.paint.get("fill-pattern"),d=f&&f.constantOr(1),m=n.getCrossfadeParameters();a?(u=d&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=p.LINES):(u=d?"fillPattern":"fill",s=p.TRIANGLES);for(var y=0,v=r;y<v.length;y+=1){var g=v[y],_=e.getTile(g);if(!d||_.patternsLoaded()){var x=_.getBucket(n);if(x){var b=x.programConfigurations.get(n.id),w=t.useProgram(u,b);d&&(t.context.activeTexture.set(p.TEXTURE0),_.imageAtlasTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),b.updatePatternPaintBuffers(m));var E=f.constantOr(null);if(E&&_.imageAtlas){var S=_.imageAtlas.patternPositions[E.to],T=_.imageAtlas.patternPositions[E.from];S&&T&&b.setConstantPatternPositions(S,T)}var k=t.translatePosMatrix(g.posMatrix,_,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(a){c=x.indexBuffer2,h=x.segments2;var M=[p.drawingBufferWidth,p.drawingBufferHeight];l="fillOutlinePattern"===u&&d?un(k,t,m,_,M):sn(k,M)}else c=x.indexBuffer,h=x.segments,l=d?an(k,t,m,_):on(k);w.draw(t.context,s,i,t.stencilModeForClipping(g),o,Ft.disabled,l,n.id,x.layoutVertexBuffer,c,h,n.paint,t.transform.zoom,b)}}}}function Rn(e,n){var r=e.context,i=r.gl,o=n.viewportFrame;if(e.depthRboNeedsClear&&e.setupOffscreenDepthRenderbuffer(),!o){var a=new t.Texture(r,{width:e.width,height:e.height,data:null},i.RGBA);a.bind(i.LINEAR,i.CLAMP_TO_EDGE),(o=n.viewportFrame=r.createFramebuffer(e.width,e.height)).colorAttachment.set(a.texture)}r.bindFramebuffer.set(o.framebuffer),o.depthAttachment.set(e.depthRbo),e.depthRboNeedsClear&&(r.clear({depth:1}),e.depthRboNeedsClear=!1),r.clear({color:t.Color.transparent}),r.setStencilMode(Rt.disabled),r.setDepthMode(new Dt(i.LEQUAL,Dt.ReadWrite,[0,1])),r.setColorMode(e.colorModeForRenderPass())}function Bn(t,e,n){var r=e.viewportFrame;if(r){var i=t.context,o=i.gl;i.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,r.colorAttachment.get()),t.useProgram("extrusionTexture").draw(i,o.TRIANGLES,Dt.disabled,Rt.disabled,t.colorModeForRenderPass(),Ft.disabled,rn(t,n,0),e.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,e.paint,t.transform.zoom)}}function Fn(t,e,n,r,i,o){var a=t.context,s=a.gl,u=e.fbo;if(u){var l=t.useProgram("hillshade");a.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,u.colorAttachment.get());var c=mn(t,e,n);e.maskedBoundsBuffer&&e.maskedIndexBuffer&&e.segments?l.draw(a,s.TRIANGLES,r,i,o,Ft.disabled,c,n.id,e.maskedBoundsBuffer,e.maskedIndexBuffer,e.segments):l.draw(a,s.TRIANGLES,r,i,o,Ft.disabled,c,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}}function jn(e,n,r,i,o,a,s){var u=e.context,l=u.gl;if(n.dem&&n.dem.data){var c=n.dem.dim,h=n.dem.getPixels();if(u.activeTexture.set(l.TEXTURE1),u.pixelStoreUnpackPremultiplyAlpha.set(!1),n.demTexture=n.demTexture||e.getTileTexture(n.tileSize),n.demTexture){var p=n.demTexture;p.update(h,{premultiply:!1}),p.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else n.demTexture=new t.Texture(u,h,l.RGBA,{premultiply:!1}),n.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);u.activeTexture.set(l.TEXTURE0);var f=n.fbo;if(!f){var d=new t.Texture(u,{width:c,height:c,data:null},l.RGBA);d.bind(l.LINEAR,l.CLAMP_TO_EDGE),(f=n.fbo=u.createFramebuffer(c,c)).colorAttachment.set(d.texture)}u.bindFramebuffer.set(f.framebuffer),u.viewport.set([0,0,c,c]),e.useProgram("hillshadePrepare").draw(u,l.TRIANGLES,o,a,s,Ft.disabled,function(e,n){var r=e.dem.dim,i=t.create();return t.ortho(i,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(i,i,[0,-t.EXTENT,0]),{u_matrix:i,u_image:1,u_dimension:[2*r,2*r],u_zoom:e.tileID.overscaledZ,u_maxzoom:n}}(n,i),r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),n.needsHillshadePrepare=!1}}function Vn(e,n,r,i,o){var a=i.paint.get("raster-fade-duration");if(a>0){var s=t.browser.now(),u=(s-e.timeAdded)/a,l=n?(s-n.timeAdded)/a:-1,c=r.getSource(),h=o.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),p=!n||Math.abs(n.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),f=p&&e.refreshedUponExpiration?1:t.clamp(p?u:1-l,0,1);return e.refreshedUponExpiration&&u>=1&&(e.refreshedUponExpiration=!1),n?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return{opacity:1,mix:0}}function Nn(e,n,r){var i=e.context,o=i.gl,a=r.posMatrix,s=e.useProgram("debug"),u=Dt.disabled,l=Rt.disabled,c=e.colorModeForRenderPass(),h="$debug";s.draw(i,o.LINE_STRIP,u,l,c,Ft.disabled,pn(a,t.Color.red),h,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);for(var p=function(t,e,n,r){r=r||1;var i,o,a,s,u,l,c,h,p=[];for(i=0,o=t.length;i<o;i++)if(u=Un[t[i]]){for(h=null,a=0,s=u[1].length;a<s;a+=2)-1===u[1][a]&&-1===u[1][a+1]?h=null:(l=e+u[1][a]*r,c=200-u[1][a+1]*r,h&&p.push(h.x,h.y,l,c),h={x:l,y:c});e+=u[0]*r}return p}(r.toString(),50,0,5),f=new t.StructArrayLayout2i4,d=new t.StructArrayLayout2ui4,m=0;m<p.length;m+=2)f.emplaceBack(p[m],p[m+1]),d.emplaceBack(m,m+1);for(var y=i.createVertexBuffer(f,Xe.members),v=i.createIndexBuffer(d),g=t.SegmentVector.simpleSegment(0,0,f.length/2,f.length/2),_=n.getTile(r).tileSize,x=t.EXTENT/(Math.pow(2,e.transform.zoom-r.overscaledZ)*_),b=[[-1,-1],[-1,1],[1,-1],[1,1]],w=0;w<b.length;w++){var E=b[w];s.draw(i,o.LINES,u,l,c,Ft.disabled,pn(t.translate([],a,[x*E[0],x*E[1],0]),t.Color.white),h,y,v,g)}s.draw(i,o.LINES,u,l,c,Ft.disabled,pn(a,t.Color.black),h,y,v,g)}var Un={" ":[16,[]],"!":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'"':[16,[4,21,4,14,-1,-1,12,21,12,14]],"#":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],"%":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],"&":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],"'":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],"(":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],")":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],"*":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],"+":[26,[13,18,13,0,-1,-1,4,9,22,9]],",":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"-":[26,[4,9,22,9]],".":[10,[5,2,4,1,5,0,6,1,5,2]],"/":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],":":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],";":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"<":[24,[20,18,4,9,20,0]],"=":[26,[4,12,22,12,-1,-1,4,6,22,6]],">":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]},qn={symbol:function(t,e,n,r){if("translucent"===t.renderPass){var i=Rt.disabled,o=t.colorModeForRenderPass();0!==n.paint.get("icon-opacity").constantOr(1)&&Ln(t,e,n,r,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),i,o),0!==n.paint.get("text-opacity").constantOr(1)&&Ln(t,e,n,r,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),i,o),e.map.showCollisionBoxes&&function(t,e,n,r){zn(t,e,n,r,!1),zn(t,e,n,r,!0)}(t,e,n,r)}},circle:function(t,e,n,r){if("translucent"===t.renderPass){var i=n.paint.get("circle-opacity"),o=n.paint.get("circle-stroke-width"),a=n.paint.get("circle-stroke-opacity");if(0!==i.constantOr(1)||0!==o.constantOr(1)&&0!==a.constantOr(1))for(var s=t.context,u=s.gl,l=t.depthModeForSublayer(0,Dt.ReadOnly),c=Rt.disabled,h=t.colorModeForRenderPass(),p=0;p<r.length;p++){var f=r[p],d=e.getTile(f),m=d.getBucket(n);if(m){var y=m.programConfigurations.get(n.id);t.useProgram("circle",y).draw(s,u.TRIANGLES,l,c,h,Ft.disabled,ln(t,f,d,n),n.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,n.paint,t.transform.zoom,y)}}}},heatmap:function(e,n,r,i){if(0!==r.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){var o=e.context,a=o.gl,s=e.depthModeForSublayer(0,Dt.ReadOnly),u=Rt.disabled,l=new Bt([a.ONE,a.ONE],t.Color.transparent,[!0,!0,!0,!0]);!function(t,e,n){var r=t.gl;t.activeTexture.set(r.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var i=n.heatmapFbo;if(i)r.bindTexture(r.TEXTURE_2D,i.colorAttachment.get()),t.bindFramebuffer.set(i.framebuffer);else{var o=r.createTexture();r.bindTexture(r.TEXTURE_2D,o),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),i=n.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4),function t(e,n,r,i){var o=e.gl;o.texImage2D(o.TEXTURE_2D,0,o.RGBA,n.width/4,n.height/4,0,o.RGBA,e.extTextureHalfFloat?e.extTextureHalfFloat.HALF_FLOAT_OES:o.UNSIGNED_BYTE,null),i.colorAttachment.set(r),e.extTextureHalfFloat&&o.checkFramebufferStatus(o.FRAMEBUFFER)!==o.FRAMEBUFFER_COMPLETE&&(e.extTextureHalfFloat=null,i.colorAttachment.setDirty(),t(e,n,r,i))}(t,e,o,i)}}(o,e,r),o.clear({color:t.Color.transparent});for(var c=0;c<i.length;c++){var h=i[c];if(!n.hasRenderableParent(h)){var p=n.getTile(h),f=p.getBucket(r);if(f){var d=f.programConfigurations.get(r.id),m=e.useProgram("heatmap",d),y=e.transform.zoom;m.draw(o,a.TRIANGLES,s,u,l,Ft.disabled,dn(h.posMatrix,p,y,r.paint.get("heatmap-intensity")),r.id,f.layoutVertexBuffer,f.indexBuffer,f.segments,r.paint,e.transform.zoom,d)}}}o.viewport.set([0,0,e.width,e.height])}else"translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,n){var r=e.context,i=r.gl,o=n.heatmapFbo;if(o){r.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,o.colorAttachment.get()),r.activeTexture.set(i.TEXTURE1);var a=n.colorRampTexture;a||(a=n.colorRampTexture=new t.Texture(r,n.colorRamp,i.RGBA)),a.bind(i.LINEAR,i.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(r,i.TRIANGLES,Dt.disabled,Rt.disabled,e.colorModeForRenderPass(),Ft.disabled,function(e,n,r,i){var o=t.create();t.ortho(o,0,e.width,e.height,0,0,1);var a=e.context.gl;return{u_matrix:o,u_world:[a.drawingBufferWidth,a.drawingBufferHeight],u_image:r,u_color_ramp:i,u_opacity:n.paint.get("heatmap-opacity")}}(e,n,0,1),n.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,n.paint,e.transform.zoom)}}(e,r))},line:function(e,n,r,i){if("translucent"===e.renderPass){var o=r.paint.get("line-opacity"),a=r.paint.get("line-width");if(0!==o.constantOr(1)&&0!==a.constantOr(1)){var s=e.depthModeForSublayer(0,Dt.ReadOnly),u=e.colorModeForRenderPass(),l=r.paint.get("line-dasharray"),c=r.paint.get("line-pattern"),h=c.constantOr(1),p=r.paint.get("line-gradient"),f=r.getCrossfadeParameters(),d=l?"lineSDF":h?"linePattern":p?"lineGradient":"line",m=e.context,y=m.gl,v=!0;if(p){m.activeTexture.set(y.TEXTURE0);var g=r.gradientTexture;if(!r.gradient)return;g||(g=r.gradientTexture=new t.Texture(m,r.gradient,y.RGBA)),g.bind(y.LINEAR,y.CLAMP_TO_EDGE)}for(var _=0,x=i;_<x.length;_+=1){var b=x[_],w=n.getTile(b);if(!h||w.patternsLoaded()){var E=w.getBucket(r);if(E){var S=E.programConfigurations.get(r.id),T=e.context.program.get(),k=e.useProgram(d,S),M=v||k.program!==T,A=c.constantOr(null);if(A&&w.imageAtlas){var P=w.imageAtlas.patternPositions[A.to],z=w.imageAtlas.patternPositions[A.from];P&&z&&S.setConstantPatternPositions(P,z)}var I=l?_n(e,w,r,l,f):h?gn(e,w,r,f):p?vn(e,w,r):yn(e,w,r);l&&(M||e.lineAtlas.dirty)?(m.activeTexture.set(y.TEXTURE0),e.lineAtlas.bind(m)):h&&(m.activeTexture.set(y.TEXTURE0),w.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),S.updatePatternPaintBuffers(f)),k.draw(m,y.TRIANGLES,s,e.stencilModeForClipping(b),u,Ft.disabled,I,r.id,E.layoutVertexBuffer,E.indexBuffer,E.segments,r.paint,e.transform.zoom,S),v=!1}}}}}},fill:function(e,n,r,i){var o=r.paint.get("fill-color"),a=r.paint.get("fill-opacity");if(0!==a.constantOr(1)){var s=e.colorModeForRenderPass(),u=r.paint.get("fill-pattern").constantOr(1)||1!==o.constantOr(t.Color.transparent).a||1!==a.constantOr(0)?"translucent":"opaque";e.renderPass===u&&Dn(e,n,r,i,e.depthModeForSublayer(1,"opaque"===e.renderPass?Dt.ReadWrite:Dt.ReadOnly),s,!1),"translucent"===e.renderPass&&r.paint.get("fill-antialias")&&Dn(e,n,r,i,e.depthModeForSublayer(r.getPaintProperty("fill-outline-color")?2:0,Dt.ReadOnly),s,!0)}},"fill-extrusion":function(t,e,n,r){0!==n.paint.get("fill-extrusion-opacity")&&("offscreen"===t.renderPass?(Rn(t,n),function(t,e,n,r,i,o,a){for(var s=t.context,u=s.gl,l=n.paint.get("fill-extrusion-pattern"),c=l.constantOr(1),h=n.getCrossfadeParameters(),p=0,f=r;p<f.length;p+=1){var d=f[p],m=e.getTile(d),y=m.getBucket(n);if(y){var v=y.programConfigurations.get(n.id),g=t.useProgram(c?"fillExtrusionPattern":"fillExtrusion",v);c&&(t.context.activeTexture.set(u.TEXTURE0),m.imageAtlasTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),v.updatePatternPaintBuffers(h));var _=l.constantOr(null);if(_&&m.imageAtlas){var x=m.imageAtlas.patternPositions[_.to],b=m.imageAtlas.patternPositions[_.from];x&&b&&v.setConstantPatternPositions(x,b)}var w=t.translatePosMatrix(d.posMatrix,m,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),E=n.paint.get("fill-extrusion-vertical-gradient"),S=c?nn(w,t,E,d,h,m):en(w,t,E);g.draw(s,s.gl.TRIANGLES,i,o,a,Ft.backCCW,S,n.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,n.paint,t.transform.zoom,v)}}}(t,e,n,r,new Dt(t.context.gl.LEQUAL,Dt.ReadWrite,[0,1]),Rt.disabled,t.colorModeForRenderPass())):"translucent"===t.renderPass&&Bn(t,n,n.paint.get("fill-extrusion-opacity")))},hillshade:function(t,e,n,r){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var i=t.context,o=e.getSource().maxzoom,a=t.depthModeForSublayer(0,Dt.ReadOnly),s=Rt.disabled,u=t.colorModeForRenderPass(),l=0,c=r;l<c.length;l+=1){var h=c[l],p=e.getTile(h);p.needsHillshadePrepare&&"offscreen"===t.renderPass?jn(t,p,n,o,a,s,u):"translucent"===t.renderPass&&Fn(t,p,n,a,s,u)}i.viewport.set([0,0,t.width,t.height])}},raster:function(t,e,n,r){if("translucent"===t.renderPass&&0!==n.paint.get("raster-opacity"))for(var i=t.context,o=i.gl,a=e.getSource(),s=t.useProgram("raster"),u=Rt.disabled,l=t.colorModeForRenderPass(),c=r.length&&r[0].overscaledZ,h=0,p=r;h<p.length;h+=1){var f=p[h],d=t.depthModeForSublayer(f.overscaledZ-c,1===n.paint.get("raster-opacity")?Dt.ReadWrite:Dt.ReadOnly,o.LESS),m=e.getTile(f),y=t.transform.calculatePosMatrix(f.toUnwrapped(),!0);m.registerFadeDuration(n.paint.get("raster-fade-duration"));var v=e.findLoadedParent(f,0),g=Vn(m,v,e,n,t.transform),_=void 0,x=void 0,b="nearest"===n.paint.get("raster-resampling")?o.NEAREST:o.LINEAR;i.activeTexture.set(o.TEXTURE0),m.texture.bind(b,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),i.activeTexture.set(o.TEXTURE1),v?(v.texture.bind(b,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),_=Math.pow(2,v.tileID.overscaledZ-m.tileID.overscaledZ),x=[m.tileID.canonical.x*_%1,m.tileID.canonical.y*_%1]):m.texture.bind(b,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST);var w=wn(y,x||[0,0],_||1,g,n);a instanceof Z?s.draw(i,o.TRIANGLES,d,u,l,Ft.disabled,w,n.id,a.boundsBuffer,t.quadTriangleIndexBuffer,a.boundsSegments):m.maskedBoundsBuffer&&m.maskedIndexBuffer&&m.segments?s.draw(i,o.TRIANGLES,d,u,l,Ft.disabled,w,n.id,m.maskedBoundsBuffer,m.maskedIndexBuffer,m.segments,n.paint,t.transform.zoom):s.draw(i,o.TRIANGLES,d,u,l,Ft.disabled,w,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}},background:function(t,e,n){var r=n.paint.get("background-color"),i=n.paint.get("background-opacity");if(0!==i){var o=t.context,a=o.gl,s=t.transform,u=s.tileSize,l=n.paint.get("background-pattern");if(!t.isPatternMissing(l)){var c=l||1!==r.a||1!==i?"translucent":"opaque";if(t.renderPass===c){var h=Rt.disabled,p=t.depthModeForSublayer(0,"opaque"===c?Dt.ReadWrite:Dt.ReadOnly),f=t.colorModeForRenderPass(),d=t.useProgram(l?"backgroundPattern":"background"),m=s.coveringTiles({tileSize:u});l&&(o.activeTexture.set(a.TEXTURE0),t.imageManager.bind(t.context));for(var y=n.getCrossfadeParameters(),v=0,g=m;v<g.length;v+=1){var _=g[v],x=t.transform.calculatePosMatrix(_.toUnwrapped()),b=l?kn(x,i,t,l,{tileID:_,tileSize:u},y):Tn(x,i,r);d.draw(o,a.TRIANGLES,p,h,f,Ft.disabled,b,n.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}}}},debug:function(t,e,n){for(var r=0;r<n.length;r++)Nn(t,e,n[r])},custom:function(t,e,n){var r=t.context,i=n.implementation;if("offscreen"===t.renderPass){var o=i.prerender;o&&(t.setCustomLayerDefaults(),o.call(i,r.gl,t.transform.customLayerMatrix()),r.setDirty(),t.setBaseState()),"3d"===i.renderingMode&&(t.setCustomLayerDefaults(),Rn(t,n),i.render(r.gl,t.transform.customLayerMatrix()),r.setDirty(),t.setBaseState())}else"translucent"===t.renderPass&&("3d"===i.renderingMode?Bn(t,n,1):(t.setCustomLayerDefaults(),r.setStencilMode(Rt.disabled),r.setDepthMode(Dt.disabled),i.render(r.gl,t.transform.customLayerMatrix()),r.setDirty(),t.setBaseState(),r.bindFramebuffer.set(null)))}},Zn=function(e,n){this.context=new jt(e),this.transform=n,this._tileTextures={},this.setup(),this.numSublayers=Vt.maxUnderzooming+Vt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.depthRboNeedsClear=!0,this.emptyProgramConfiguration=new t.ProgramConfiguration,this.crossTileSymbolIndex=new Ne};function Gn(t,e){if(t.row>e.row){var n=t;t=e,e=n}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function Xn(t,e,n,r,i){var o=Math.max(n,Math.floor(e.y0)),a=Math.min(r,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx<e.x1:t.x1-e.dy/t.dy*t.dx<e.x0){var s=t;t=e,e=s}for(var u=t.dx/t.dy,l=e.dx/e.dy,c=t.dx>0,h=e.dx<0,p=o;p<a;p++){var f=u*Math.max(0,Math.min(t.dy,p+c-t.y0))+t.x0,d=l*Math.max(0,Math.min(e.dy,p+h-e.y0))+e.x0;i(Math.floor(d),Math.ceil(f),p)}}function Wn(t,e,n,r,i,o){var a,s=Gn(t,e),u=Gn(e,n),l=Gn(n,t);s.dy>u.dy&&(a=s,s=u,u=a),s.dy>l.dy&&(a=s,s=l,l=a),u.dy>l.dy&&(a=u,u=l,l=a),s.dy&&Xn(l,s,r,i,o),u.dy&&Xn(l,u,r,i,o)}Zn.prototype.resize=function(e,n){var r=this.context.gl;if(this.width=e*t.browser.devicePixelRatio,this.height=n*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var i=0,o=this.style._order;i<o.length;i+=1){var a=o[i];this.style._layers[a].resize()}this.depthRbo&&(r.deleteRenderbuffer(this.depthRbo),this.depthRbo=null)},Zn.prototype.setup=function(){var e=this.context,n=new t.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(t.EXTENT,0),n.emplaceBack(0,t.EXTENT),n.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=e.createVertexBuffer(n,Xe.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);var r=new t.StructArrayLayout2i4;r.emplaceBack(0,0),r.emplaceBack(t.EXTENT,0),r.emplaceBack(0,t.EXTENT),r.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=e.createVertexBuffer(r,Xe.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);var i=new t.StructArrayLayout4i8;i.emplaceBack(0,0,0,0),i.emplaceBack(t.EXTENT,0,t.EXTENT,0),i.emplaceBack(0,t.EXTENT,0,t.EXTENT),i.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=e.createVertexBuffer(i,t.rasterBoundsAttributes.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);var o=new t.StructArrayLayout2i4;o.emplaceBack(0,0),o.emplaceBack(1,0),o.emplaceBack(0,1),o.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(o,Xe.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);var a=new t.StructArrayLayout1ui2;a.emplaceBack(0),a.emplaceBack(1),a.emplaceBack(3),a.emplaceBack(2),a.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(a);var s=new t.StructArrayLayout3ui6;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(s);var u=this.context.gl;this.stencilClearMode=new Rt({func:u.ALWAYS,mask:0},0,255,u.ZERO,u.ZERO,u.ZERO)},Zn.prototype.clearStencil=function(){var e=this.context,n=e.gl,r=t.create();t.ortho(r,0,this.width,this.height,0,0,1),t.scale(r,r,[n.drawingBufferWidth,n.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,n.TRIANGLES,Dt.disabled,this.stencilClearMode,Bt.disabled,Ft.disabled,fn(r),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},Zn.prototype._renderTileClippingMasks=function(t){var e=this.context,n=e.gl;e.setColorMode(Bt.disabled),e.setDepthMode(Dt.disabled);var r=this.useProgram("clippingMask"),i=1;this._tileClippingMaskIDs={};for(var o=0,a=t;o<a.length;o+=1){var s=a[o],u=this._tileClippingMaskIDs[s.key]=i++;r.draw(e,n.TRIANGLES,Dt.disabled,new Rt({func:n.ALWAYS,mask:0},u,255,n.KEEP,n.KEEP,n.REPLACE),Bt.disabled,Ft.disabled,fn(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}},Zn.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Rt({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},Zn.prototype.colorModeForRenderPass=function(){var e=this.context.gl;return this._showOverdrawInspector?new Bt([e.CONSTANT_COLOR,e.ONE],new t.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?Bt.unblended:Bt.alphaBlended},Zn.prototype.depthModeForSublayer=function(t,e,n){var r=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon,i=r-1+this.depthRange;return new Dt(n||this.context.gl.LEQUAL,e,[i,r])},Zn.prototype.render=function(e,n){this.style=e,this.options=n,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(t.browser.now());var r=this.style._order,i=this.style.sourceCaches;for(var o in i){var a=i[o];a.used&&a.prepare(this.context)}var s,u={},l={},c={};for(var h in i){var p=i[h];u[h]=p.getVisibleCoordinates(),l[h]=u[h].slice().reverse(),c[h]=p.getVisibleCoordinates(!0).reverse()}for(var f in i){var d=i[f],m=d.getSource();if("raster"===m.type||"raster-dem"===m.type){for(var y=[],v=0,g=u[f];v<g.length;v+=1){var _=g[v];y.push(d.getTile(_))}An(y,this.context)}}this.renderPass="offscreen",this.depthRboNeedsClear=!0;for(var x=0,b=r;x<b.length;x+=1){var w=b[x],E=this.style._layers[w];if(E.hasOffscreenPass()&&!E.isHidden(this.transform.zoom)){var S=l[E.source];("custom"===E.type||S.length)&&this.renderLayer(this,i[E.source],E,S)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:n.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this._showOverdrawInspector=n.showOverdrawInspector,this.depthRange=(e._order.length+2)*this.numSublayers*this.depthEpsilon,this.renderPass="opaque",this.currentLayer=r.length-1;this.currentLayer>=0;this.currentLayer--){var T=this.style._layers[r[this.currentLayer]],k=i[T.source],M=u[T.source];T.source!==s&&k&&(this.clearStencil(),k.getSource().isTileClipped&&this._renderTileClippingMasks(M)),this.renderLayer(this,k,T,M),s=T.source}for(this.renderPass="translucent",this.currentLayer=0,s=null;this.currentLayer<r.length;this.currentLayer++){var A=this.style._layers[r[this.currentLayer]],P=i[A.source],z=("symbol"===A.type?c:l)[A.source];A.source!==s&&P&&(this.clearStencil(),P.getSource().isTileClipped&&this._renderTileClippingMasks(u[A.source])),this.renderLayer(this,P,A,z),s=A.source}if(this.options.showTileBoundaries)for(var I in i){qn.debug(this,i[I],u[I]);break}this.setCustomLayerDefaults()},Zn.prototype.setupOffscreenDepthRenderbuffer=function(){var t=this.context;this.depthRbo||(this.depthRbo=t.createRenderbuffer(t.gl.DEPTH_COMPONENT16,this.width,this.height))},Zn.prototype.renderLayer=function(t,e,n,r){n.isHidden(this.transform.zoom)||("background"===n.type||"custom"===n.type||r.length)&&(this.id=n.id,qn[n.type](t,e,n,r))},Zn.prototype.translatePosMatrix=function(e,n,r,i,o){if(!r[0]&&!r[1])return e;var a=o?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(a){var s=Math.sin(a),u=Math.cos(a);r=[r[0]*u-r[1]*s,r[0]*s+r[1]*u]}var l=[o?r[0]:xe(n,r[0],this.transform.zoom),o?r[1]:xe(n,r[1],this.transform.zoom),0],c=new Float32Array(16);return t.translate(c,e,l),c},Zn.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},Zn.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},Zn.prototype.isPatternMissing=function(t){if(!t)return!1;var e=this.imageManager.getPattern(t.from),n=this.imageManager.getPattern(t.to);return!e||!n},Zn.prototype.useProgram=function(t,e){void 0===e&&(e=this.emptyProgramConfiguration),this.cache=this.cache||{};var n=""+t+(e.cacheKey||"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[n]||(this.cache[n]=new Qe(this.context,Je[t],e,Mn[t],this._showOverdrawInspector)),this.cache[n]},Zn.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Zn.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)};var Hn=function(t,e,n){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===n||n,this._minZoom=t||0,this._maxZoom=e||22,this.setMaxBounds(),this.width=0,this.height=0,this._center=new B(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._posMatrixCache={},this._alignedPosMatrixCache={}},Yn={minZoom:{configurable:!0},maxZoom:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerPoint:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},unmodified:{configurable:!0},x:{configurable:!0},y:{configurable:!0},point:{configurable:!0}};Hn.prototype.clone=function(){var t=new Hn(this._minZoom,this._maxZoom,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._calcMatrices(),t},Yn.minZoom.get=function(){return this._minZoom},Yn.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},Yn.maxZoom.get=function(){return this._maxZoom},Yn.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},Yn.renderWorldCopies.get=function(){return this._renderWorldCopies},Yn.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},Yn.worldSize.get=function(){return this.tileSize*this.scale},Yn.centerPoint.get=function(){return this.size._div(2)},Yn.size.get=function(){return new t.Point(this.width,this.height)},Yn.bearing.get=function(){return-this.angle/Math.PI*180},Yn.bearing.set=function(e){var n=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=t.create$4(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Yn.pitch.get=function(){return this._pitch/Math.PI*180},Yn.pitch.set=function(e){var n=t.clamp(e,0,60)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())},Yn.fov.get=function(){return this._fov/Math.PI*180},Yn.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},Yn.zoom.get=function(){return this._zoom},Yn.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},Yn.center.get=function(){return this._center},Yn.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},Hn.prototype.coveringZoomLevel=function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},Hn.prototype.getVisibleUnwrappedCoordinates=function(e){var n=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var r=this.pointCoordinate(new t.Point(0,0),0),i=this.pointCoordinate(new t.Point(this.width,0),0),o=this.pointCoordinate(new t.Point(this.width,this.height),0),a=this.pointCoordinate(new t.Point(0,this.height),0),s=Math.floor(Math.min(r.column,i.column,o.column,a.column)),u=Math.floor(Math.max(r.column,i.column,o.column,a.column)),l=s-1;l<=u+1;l++)0!==l&&n.push(new t.UnwrappedTileID(l,e));return n},Hn.prototype.coveringTiles=function(e){var n=this.coveringZoomLevel(e),r=n;if(void 0!==e.minzoom&&n<e.minzoom)return[];void 0!==e.maxzoom&&n>e.maxzoom&&(n=e.maxzoom);var i=this.pointCoordinate(this.centerPoint,n),o=new t.Point(i.column-.5,i.row-.5);return function(e,n,r,i){void 0===i&&(i=!0);var o=1<<e,a={};function s(n,s,u){var l,c,h,p;if(u>=0&&u<=o)for(l=n;l<s;l++)c=Math.floor(l/o),h=(l%o+o)%o,0!==c&&!0!==i||(p=new t.OverscaledTileID(r,c,e,h,u),a[p.key]=p)}return Wn(n[0],n[1],n[2],0,o,s),Wn(n[2],n[3],n[0],0,o,s),Object.keys(a).map((function(t){return a[t]}))}(n,[this.pointCoordinate(new t.Point(0,0),n),this.pointCoordinate(new t.Point(this.width,0),n),this.pointCoordinate(new t.Point(this.width,this.height),n),this.pointCoordinate(new t.Point(0,this.height),n)],e.reparseOverscaled?r:n,this._renderWorldCopies).sort((function(t,e){return o.dist(t.canonical)-o.dist(e.canonical)}))},Hn.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},Yn.unmodified.get=function(){return this._unmodified},Hn.prototype.zoomScale=function(t){return Math.pow(2,t)},Hn.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},Hn.prototype.project=function(e){return new t.Point(this.lngX(e.lng),this.latY(e.lat))},Hn.prototype.unproject=function(t){return new B(this.xLng(t.x),this.yLat(t.y))},Yn.x.get=function(){return this.lngX(this.center.lng)},Yn.y.get=function(){return this.latY(this.center.lat)},Yn.point.get=function(){return new t.Point(this.x,this.y)},Hn.prototype.lngX=function(t){return(180+t)*this.worldSize/360},Hn.prototype.latY=function(e){return e=t.clamp(e,-this.maxValidLatitude,this.maxValidLatitude),(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))*this.worldSize/360},Hn.prototype.xLng=function(t){return 360*t/this.worldSize-180},Hn.prototype.yLat=function(t){var e=180-360*t/this.worldSize;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90},Hn.prototype.setLocationAtPoint=function(t,e){var n=this.pointCoordinate(e)._sub(this.pointCoordinate(this.centerPoint));this.center=this.coordinateLocation(this.locationCoordinate(t)._sub(n)),this._renderWorldCopies&&(this.center=this.center.wrap())},Hn.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},Hn.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},Hn.prototype.locationCoordinate=function(e){return new t.Coordinate(this.lngX(e.lng)/this.tileSize,this.latY(e.lat)/this.tileSize,this.zoom).zoomTo(this.tileZoom)},Hn.prototype.coordinateLocation=function(t){var e=t.zoomTo(this.zoom);return new B(this.xLng(e.column*this.tileSize),this.yLat(e.row*this.tileSize))},Hn.prototype.pointCoordinate=function(e,n){void 0===n&&(n=this.tileZoom);var r=[e.x,e.y,0,1],i=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(i,i,this.pixelMatrixInverse);var o=r[3],a=i[3],s=r[0]/o,u=i[0]/a,l=r[1]/o,c=i[1]/a,h=r[2]/o,p=i[2]/a,f=h===p?0:(0-h)/(p-h);return new t.Coordinate(t.number(s,u,f)/this.tileSize,t.number(l,c,f)/this.tileSize,this.zoom)._zoomTo(n)},Hn.prototype.coordinatePoint=function(e){var n=e.zoomTo(this.zoom),r=[n.column*this.tileSize,n.row*this.tileSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},Hn.prototype.getBounds=function(){return(new F).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},Hn.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new F([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Hn.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Hn.prototype.calculatePosMatrix=function(e,n){void 0===n&&(n=!1);var r=e.key,i=n?this._alignedPosMatrixCache:this._posMatrixCache;if(i[r])return i[r];var o=e.canonical,a=this.worldSize/this.zoomScale(o.z),s=o.x+Math.pow(2,o.z)*e.wrap,u=t.identity(new Float64Array(16));return t.translate(u,u,[s*a,o.y*a,0]),t.scale(u,u,[a/t.EXTENT,a/t.EXTENT,1]),t.multiply(u,n?this.alignedProjMatrix:this.projMatrix,u),i[r]=new Float32Array(u),i[r]},Hn.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Hn.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,n,r,i,o=-90,a=90,s=-180,u=180,l=this.size,c=this._unmodified;if(this.latRange){var h=this.latRange;o=this.latY(h[1]),e=(a=this.latY(h[0]))-o<l.y?l.y/(a-o):0}if(this.lngRange){var p=this.lngRange;s=this.lngX(p[0]),n=(u=this.lngX(p[1]))-s<l.x?l.x/(u-s):0}var f=Math.max(n||0,e||0);if(f)return this.center=this.unproject(new t.Point(n?(u+s)/2:this.x,e?(a+o)/2:this.y)),this.zoom+=this.scaleZoom(f),this._unmodified=c,void(this._constraining=!1);if(this.latRange){var d=this.y,m=l.y/2;d-m<o&&(i=o+m),d+m>a&&(i=a-m)}if(this.lngRange){var y=this.x,v=l.x/2;y-v<s&&(r=s+v),y+v>u&&(r=u-v)}void 0===r&&void 0===i||(this.center=this.unproject(new t.Point(void 0!==r?r:this.x,void 0!==i?i:this.y))),this._unmodified=c,this._constraining=!1}},Hn.prototype._calcMatrices=function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var e=this._fov/2,n=Math.PI/2+this._pitch,r=Math.sin(e)*this.cameraToCenterDistance/Math.sin(Math.PI-n-e),i=this.x,o=this.y,a=1.01*(Math.cos(Math.PI/2-this._pitch)*r+this.cameraToCenterDistance),s=new Float64Array(16);t.perspective(s,this._fov,this.width/this.height,1,a),t.scale(s,s,[1,-1,1]),t.translate(s,s,[0,0,-this.cameraToCenterDistance]),t.rotateX(s,s,this._pitch),t.rotateZ(s,s,this.angle),t.translate(s,s,[-i,-o,0]),this.mercatorMatrix=t.scale([],s,[this.worldSize,this.worldSize,this.worldSize]);var u=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));t.scale(s,s,[1,1,u,1]),this.projMatrix=s;var l=this.width%2/2,c=this.height%2/2,h=Math.cos(this.angle),p=Math.sin(this.angle),f=i-Math.round(i)+h*l+p*c,d=o-Math.round(o)+h*c+p*l,m=new Float64Array(s);if(t.translate(m,m,[f>.5?f-1:f,d>.5?d-1:d,0]),this.alignedProjMatrix=m,s=t.create(),t.scale(s,s,[this.width/2,-this.height/2,1]),t.translate(s,s,[1,-1,0]),this.pixelMatrix=t.multiply(new Float64Array(16),s,this.projMatrix),!(s=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=s,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Hn.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)).zoomTo(this.zoom),n=[e.column*this.tileSize,e.row*this.tileSize,0,1];return t.transformMat4(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance},Object.defineProperties(Hn.prototype,Yn);var Kn=function(){var e,n,r,i;t.bindAll(["_onHashChange","_updateHash"],this),this._updateHash=(e=this._updateHashUnthrottled.bind(this),n=!1,r=0,i=function(){r=0,n&&(e(),r=setTimeout(i,300),n=!1)},function(){return n=!0,r||i(),r})};Kn.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},Kn.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},Kn.prototype.getHashString=function(t){var e=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,r=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),i=Math.pow(10,r),o=Math.round(e.lng*i)/i,a=Math.round(e.lat*i)/i,s=this._map.getBearing(),u=this._map.getPitch(),l="";return l+=t?"#/"+o+"/"+a+"/"+n:"#"+n+"/"+a+"/"+o,(s||u)&&(l+="/"+Math.round(10*s)/10),u&&(l+="/"+Math.round(u)),l},Kn.prototype._onHashChange=function(){var e=t.window.location.hash.replace("#","").split("/");return e.length>=3&&(this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:+(e[3]||0),pitch:+(e[4]||0)}),!0)},Kn.prototype._updateHashUnthrottled=function(){var e=this.getHashString();t.window.history.replaceState(t.window.history.state,"",e)};var Jn=function(e){function r(r,i,o,a){void 0===a&&(a={});var s=n.mousePos(i.getCanvasContainer(),o),u=i.unproject(s);e.call(this,r,t.extend({point:s,lngLat:u,originalEvent:o},a)),this._defaultPrevented=!1,this.target=i}e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r;var i={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,i),r}(t.Event),$n=function(e){function r(r,i,o){var a=n.touchPos(i.getCanvasContainer(),o),s=a.map((function(t){return i.unproject(t)})),u=a.reduce((function(t,e,n,r){return t.add(e.div(r.length))}),new t.Point(0,0)),l=i.unproject(u);e.call(this,r,{points:a,point:u,lngLats:s,lngLat:l,originalEvent:o}),this._defaultPrevented=!1}e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r;var i={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,i),r}(t.Event),Qn=function(t){function e(e,n,r){t.call(this,e,{originalEvent:r}),this._defaultPrevented=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,n),e}(t.Event),tr=function(e){this._map=e,this._el=e.getCanvasContainer(),this._delta=0,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};tr.prototype.isEnabled=function(){return!!this._enabled},tr.prototype.isActive=function(){return!!this._active},tr.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},tr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},tr.prototype.onWheel=function(e){if(this.isEnabled()){var n=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,r=t.browser.now(),i=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==n&&n%4.000244140625==0?this._type="wheel":0!==n&&Math.abs(n)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),e.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=e,this._delta-=n,this.isActive()||this._start(e)),e.preventDefault()}},tr.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this.isActive()||this._start(t)},tr.prototype._start=function(e){if(this._delta){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),this._active=!0,this._map.fire(new t.Event("movestart",{originalEvent:e})),this._map.fire(new t.Event("zoomstart",{originalEvent:e})),this._finishTimeout&&clearTimeout(this._finishTimeout);var r=n.mousePos(this._el,e);this._around=B.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(r)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame))}},tr.prototype._onScrollFrame=function(){var e=this;if(this._frameId=null,this.isActive()){var n=this._map.transform;if(0!==this._delta){var r="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?1/450:.01,i=2/(1+Math.exp(-Math.abs(this._delta*r)));this._delta<0&&0!==i&&(i=1/i);var o="number"==typeof this._targetZoom?n.zoomScale(this._targetZoom):n.scale;this._targetZoom=Math.min(n.maxZoom,Math.max(n.minZoom,n.scaleZoom(o*i))),"wheel"===this._type&&(this._startZoom=n.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var a="number"==typeof this._targetZoom?this._targetZoom:n.zoom,s=this._startZoom,u=this._easing,l=!1;if("wheel"===this._type&&s&&u){var c=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),h=u(c);n.zoom=t.number(s,a,h),c<1?this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame)):l=!0}else n.zoom=a,l=!0;n.setLocationAtPoint(this._around,this._aroundPoint),this._map.fire(new t.Event("move",{originalEvent:this._lastWheelEvent})),this._map.fire(new t.Event("zoom",{originalEvent:this._lastWheelEvent})),l&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._map.fire(new t.Event("zoomend",{originalEvent:e._lastWheelEvent})),e._map.fire(new t.Event("moveend",{originalEvent:e._lastWheelEvent})),delete e._targetZoom}),200))}},tr.prototype._smoothOutEasing=function(e){var n=t.ease;if(this._prevEase){var r=this._prevEase,i=(t.browser.now()-r.start)/r.duration,o=r.easing(i+.01)-r.easing(i),a=.27/Math.sqrt(o*o+1e-4)*.01,s=Math.sqrt(.0729-a*a);n=t.bezier(a,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:n},n};var er=function(e,n){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=n.clickTolerance||1,t.bindAll(["_onMouseMove","_onMouseUp","_onKeyDown"],this)};er.prototype.isEnabled=function(){return!!this._enabled},er.prototype.isActive=function(){return!!this._active},er.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},er.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},er.prototype.onMouseDown=function(e){this.isEnabled()&&e.shiftKey&&0===e.button&&(t.window.document.addEventListener("mousemove",this._onMouseMove,!1),t.window.document.addEventListener("keydown",this._onKeyDown,!1),t.window.document.addEventListener("mouseup",this._onMouseUp,!1),n.disableDrag(),this._startPos=this._lastPos=n.mousePos(this._el,e),this._active=!0)},er.prototype._onMouseMove=function(t){var e=n.mousePos(this._el,t);if(!(this._lastPos.equals(e)||!this._box&&e.dist(this._startPos)<this._clickTolerance)){var r=this._startPos;this._lastPos=e,this._box||(this._box=n.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var i=Math.min(r.x,e.x),o=Math.max(r.x,e.x),a=Math.min(r.y,e.y),s=Math.max(r.y,e.y);n.setTransform(this._box,"translate("+i+"px,"+a+"px)"),this._box.style.width=o-i+"px",this._box.style.height=s-a+"px"}},er.prototype._onMouseUp=function(e){if(0===e.button){var r=this._startPos,i=n.mousePos(this._el,e);this._finish(),n.suppressClick(),r.x===i.x&&r.y===i.y?this._fireEvent("boxzoomcancel",e):this._map.fitScreenCoordinates(r,i,this._map.getBearing(),{linear:!0}).fire(new t.Event("boxzoomend",{originalEvent:e}))}},er.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},er.prototype._finish=function(){this._active=!1,t.window.document.removeEventListener("mousemove",this._onMouseMove,!1),t.window.document.removeEventListener("keydown",this._onKeyDown,!1),t.window.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(n.remove(this._box),this._box=null),n.enableDrag(),delete this._startPos,delete this._lastPos},er.prototype._fireEvent=function(e,n){return this._map.fire(new t.Event(e,{originalEvent:n}))};var nr=t.bezier(0,0,.25,1),rr=function(e,n){this._map=e,this._el=n.element||e.getCanvasContainer(),this._state="disabled",this._button=n.button||"right",this._bearingSnap=n.bearingSnap||0,this._pitchWithRotate=!1!==n.pitchWithRotate,t.bindAll(["onMouseDown","_onMouseMove","_onMouseUp","_onBlur","_onDragFrame"],this)};rr.prototype.isEnabled=function(){return"disabled"!==this._state},rr.prototype.isActive=function(){return"active"===this._state},rr.prototype.enable=function(){this.isEnabled()||(this._state="enabled")},rr.prototype.disable=function(){if(this.isEnabled())switch(this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend"),this._pitchWithRotate&&this._fireEvent("pitchend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},rr.prototype.onMouseDown=function(e){if("enabled"===this._state){if("right"===this._button){if(this._eventButton=n.mouseButton(e),this._eventButton!==(e.ctrlKey?0:2))return}else{if(e.ctrlKey||0!==n.mouseButton(e))return;this._eventButton=0}n.disableDrag(),t.window.document.addEventListener("mousemove",this._onMouseMove,{capture:!0}),t.window.document.addEventListener("mouseup",this._onMouseUp),t.window.addEventListener("blur",this._onBlur),this._state="pending",this._inertia=[[t.browser.now(),this._map.getBearing()]],this._startPos=this._lastPos=n.mousePos(this._el,e),this._center=this._map.transform.centerPoint,e.preventDefault()}},rr.prototype._onMouseMove=function(t){var e=n.mousePos(this._el,t);this._lastPos.equals(e)||(this._lastMoveEvent=t,this._lastPos=e,"pending"===this._state&&(this._state="active",this._fireEvent("rotatestart",t),this._fireEvent("movestart",t),this._pitchWithRotate&&this._fireEvent("pitchstart",t)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)))},rr.prototype._onDragFrame=function(){this._frameId=null;var e=this._lastMoveEvent;if(e){var n=this._map.transform,r=this._startPos,i=this._lastPos,o=.8*(r.x-i.x),a=-.5*(r.y-i.y),s=n.bearing-o,u=n.pitch-a,l=this._inertia,c=l[l.length-1];this._drainInertiaBuffer(),l.push([t.browser.now(),this._map._normalizeBearing(s,c[1])]),n.bearing=s,this._pitchWithRotate&&(this._fireEvent("pitch",e),n.pitch=u),this._fireEvent("rotate",e),this._fireEvent("move",e),delete this._lastMoveEvent,this._startPos=this._lastPos}},rr.prototype._onMouseUp=function(t){if(n.mouseButton(t)===this._eventButton)switch(this._state){case"active":this._state="enabled",n.suppressClick(),this._unbind(),this._deactivate(),this._inertialRotate(t);break;case"pending":this._state="enabled",this._unbind()}},rr.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend",t),this._pitchWithRotate&&this._fireEvent("pitchend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind()}},rr.prototype._unbind=function(){t.window.document.removeEventListener("mousemove",this._onMouseMove,{capture:!0}),t.window.document.removeEventListener("mouseup",this._onMouseUp),t.window.removeEventListener("blur",this._onBlur),n.enableDrag()},rr.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._lastPos},rr.prototype._inertialRotate=function(t){var e=this;this._fireEvent("rotateend",t),this._drainInertiaBuffer();var n=this._map,r=n.getBearing(),i=this._inertia,o=function(){Math.abs(r)<e._bearingSnap?n.resetNorth({noMoveStart:!0},{originalEvent:t}):e._fireEvent("moveend",t),e._pitchWithRotate&&e._fireEvent("pitchend",t)};if(i.length<2)o();else{var a=i[0],s=i[i.length-1],u=i[i.length-2],l=n._normalizeBearing(r,u[1]),c=s[1]-a[1],h=c<0?-1:1,p=(s[0]-a[0])/1e3;if(0!==c&&0!==p){var f=Math.abs(c*(.25/p));f>180&&(f=180);var d=f/180;l+=h*f*(d/2),Math.abs(n._normalizeBearing(l,0))<this._bearingSnap&&(l=n._normalizeBearing(0,l)),n.rotateTo(l,{duration:1e3*d,easing:nr,noMoveStart:!0},{originalEvent:t})}else o()}},rr.prototype._fireEvent=function(e,n){return this._map.fire(new t.Event(e,n?{originalEvent:n}:{}))},rr.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,n=t.browser.now();e.length>0&&n-e[0][0]>160;)e.shift()};var ir=t.bezier(0,0,.3,1),or=function(e,n){this._map=e,this._el=e.getCanvasContainer(),this._state="disabled",this._clickTolerance=n.clickTolerance||1,t.bindAll(["_onMove","_onMouseUp","_onTouchEnd","_onBlur","_onDragFrame"],this)};or.prototype.isEnabled=function(){return"disabled"!==this._state},or.prototype.isActive=function(){return"active"===this._state},or.prototype.enable=function(){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._state="enabled")},or.prototype.disable=function(){if(this.isEnabled())switch(this._el.classList.remove("mapboxgl-touch-drag-pan"),this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("dragend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},or.prototype.onMouseDown=function(e){"enabled"===this._state&&(e.ctrlKey||0!==n.mouseButton(e)||(n.addEventListener(t.window.document,"mousemove",this._onMove,{capture:!0}),n.addEventListener(t.window.document,"mouseup",this._onMouseUp),this._start(e)))},or.prototype.onTouchStart=function(e){"enabled"===this._state&&(e.touches.length>1||(n.addEventListener(t.window.document,"touchmove",this._onMove,{capture:!0,passive:!1}),n.addEventListener(t.window.document,"touchend",this._onTouchEnd),this._start(e)))},or.prototype._start=function(e){t.window.addEventListener("blur",this._onBlur),this._state="pending",this._startPos=this._mouseDownPos=this._lastPos=n.mousePos(this._el,e),this._inertia=[[t.browser.now(),this._startPos]]},or.prototype._onMove=function(e){e.preventDefault();var r=n.mousePos(this._el,e);this._lastPos.equals(r)||"pending"===this._state&&r.dist(this._mouseDownPos)<this._clickTolerance||(this._lastMoveEvent=e,this._lastPos=r,this._drainInertiaBuffer(),this._inertia.push([t.browser.now(),this._lastPos]),"pending"===this._state&&(this._state="active",this._fireEvent("dragstart",e),this._fireEvent("movestart",e)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)))},or.prototype._onDragFrame=function(){this._frameId=null;var t=this._lastMoveEvent;if(t){var e=this._map.transform;e.setLocationAtPoint(e.pointLocation(this._startPos),this._lastPos),this._fireEvent("drag",t),this._fireEvent("move",t),this._startPos=this._lastPos,delete this._lastMoveEvent}},or.prototype._onMouseUp=function(t){if(0===n.mouseButton(t))switch(this._state){case"active":this._state="enabled",n.suppressClick(),this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind()}},or.prototype._onTouchEnd=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind()}},or.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("dragend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind()}},or.prototype._unbind=function(){n.removeEventListener(t.window.document,"touchmove",this._onMove,{capture:!0,passive:!1}),n.removeEventListener(t.window.document,"touchend",this._onTouchEnd),n.removeEventListener(t.window.document,"mousemove",this._onMove,{capture:!0}),n.removeEventListener(t.window.document,"mouseup",this._onMouseUp),n.removeEventListener(t.window,"blur",this._onBlur)},or.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._mouseDownPos,delete this._lastPos},or.prototype._inertialPan=function(t){this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=this._inertia;if(e.length<2)this._fireEvent("moveend",t);else{var n=e[e.length-1],r=e[0],i=n[1].sub(r[1]),o=(n[0]-r[0])/1e3;if(0===o||n[1].equals(r[1]))this._fireEvent("moveend",t);else{var a=i.mult(.3/o),s=a.mag();s>1400&&(s=1400,a._unit()._mult(s));var u=s/750,l=a.mult(-u/2);this._map.panBy(l,{duration:1e3*u,easing:ir,noMoveStart:!0},{originalEvent:t})}}},or.prototype._fireEvent=function(e,n){return this._map.fire(new t.Event(e,n?{originalEvent:n}:{}))},or.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,n=t.browser.now();e.length>0&&n-e[0][0]>160;)e.shift()};var ar=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onKeyDown"],this)};function sr(t){return t*(2-t)}ar.prototype.isEnabled=function(){return!!this._enabled},ar.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},ar.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},ar.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,n=0,r=0,i=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),i=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),i=1);break;case 38:t.shiftKey?r=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?r=-1:(o=1,t.preventDefault());break;default:return}var a=this._map,s=a.getZoom(),u={duration:300,delayEndEvents:500,easing:sr,zoom:e?Math.round(s)+e*(t.shiftKey?2:1):s,bearing:a.getBearing()+15*n,pitch:a.getPitch()+10*r,offset:[100*-i,100*-o],center:a.getCenter()};a.easeTo(u,{originalEvent:t})}};var ur=function(e){this._map=e,t.bindAll(["_onDblClick","_onZoomEnd"],this)};ur.prototype.isEnabled=function(){return!!this._enabled},ur.prototype.isActive=function(){return!!this._active},ur.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},ur.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},ur.prototype.onTouchStart=function(t){var e=this;this.isEnabled()&&(t.points.length>1||(this._tapped?(clearTimeout(this._tapped),this._tapped=null,this._zoom(t)):this._tapped=setTimeout((function(){e._tapped=null}),300)))},ur.prototype.onDblClick=function(t){this.isEnabled()&&(t.originalEvent.preventDefault(),this._zoom(t))},ur.prototype._zoom=function(t){this._active=!0,this._map.on("zoomend",this._onZoomEnd),this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)},ur.prototype._onZoomEnd=function(){this._active=!1,this._map.off("zoomend",this._onZoomEnd)};var lr=t.bezier(0,0,.15,1),cr=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onMove","_onEnd","_onTouchFrame"],this)};cr.prototype.isEnabled=function(){return!!this._enabled},cr.prototype.enable=function(t){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)},cr.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._enabled=!1)},cr.prototype.disableRotation=function(){this._rotationDisabled=!0},cr.prototype.enableRotation=function(){this._rotationDisabled=!1},cr.prototype.onStart=function(e){if(this.isEnabled()&&2===e.touches.length){var r=n.mousePos(this._el,e.touches[0]),i=n.mousePos(this._el,e.touches[1]),o=r.add(i).div(2);this._startVec=r.sub(i),this._startAround=this._map.transform.pointLocation(o),this._gestureIntent=void 0,this._inertia=[],n.addEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),n.addEventListener(t.window.document,"touchend",this._onEnd)}},cr.prototype._getTouchEventData=function(t){var e=n.mousePos(this._el,t.touches[0]),r=n.mousePos(this._el,t.touches[1]),i=e.sub(r);return{vec:i,center:e.add(r).div(2),scale:i.mag()/this._startVec.mag(),bearing:this._rotationDisabled?0:180*i.angleWith(this._startVec)/Math.PI}},cr.prototype._onMove=function(e){if(2===e.touches.length){var n=this._getTouchEventData(e),r=n.vec,i=n.scale,o=n.bearing;if(!this._gestureIntent){var a=Math.abs(1-i)>.15;Math.abs(o)>10?this._gestureIntent="rotate":a&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._map.fire(new t.Event(this._gestureIntent+"start",{originalEvent:e})),this._map.fire(new t.Event("movestart",{originalEvent:e})),this._startVec=r)}this._lastTouchEvent=e,this._frameId||(this._frameId=this._map._requestRenderFrame(this._onTouchFrame)),e.preventDefault()}},cr.prototype._onTouchFrame=function(){this._frameId=null;var e=this._gestureIntent;if(e){var n=this._map.transform;this._startScale||(this._startScale=n.scale,this._startBearing=n.bearing);var r=this._getTouchEventData(this._lastTouchEvent),i=r.center,o=r.bearing,a=r.scale,s=n.pointLocation(i),u=n.locationPoint(s);"rotate"===e&&(n.bearing=this._startBearing+o),n.zoom=n.scaleZoom(this._startScale*a),n.setLocationAtPoint(this._startAround,u),this._map.fire(new t.Event(e,{originalEvent:this._lastTouchEvent})),this._map.fire(new t.Event("move",{originalEvent:this._lastTouchEvent})),this._drainInertiaBuffer(),this._inertia.push([t.browser.now(),a,i])}},cr.prototype._onEnd=function(e){n.removeEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),n.removeEventListener(t.window.document,"touchend",this._onEnd);var r=this._gestureIntent,i=this._startScale;if(this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._gestureIntent,delete this._startScale,delete this._startBearing,delete this._lastTouchEvent,r){this._map.fire(new t.Event(r+"end",{originalEvent:e})),this._drainInertiaBuffer();var o=this._inertia,a=this._map;if(o.length<2)a.snapToNorth({},{originalEvent:e});else{var s=o[o.length-1],u=o[0],l=a.transform.scaleZoom(i*s[1]),c=a.transform.scaleZoom(i*u[1]),h=l-c,p=(s[0]-u[0])/1e3,f=s[2];if(0!==p&&l!==c){var d=.15*h/p;Math.abs(d)>2.5&&(d=d>0?2.5:-2.5);var m=1e3*Math.abs(d/(12*.15)),y=l+d*m/2e3;y<0&&(y=0),a.easeTo({zoom:y,duration:m,easing:lr,around:this._aroundCenter?a.getCenter():a.unproject(f),noMoveStart:!0},{originalEvent:e})}else a.snapToNorth({},{originalEvent:e})}}},cr.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,n=t.browser.now();e.length>2&&n-e[0][0]>160;)e.shift()};var hr={scrollZoom:tr,boxZoom:er,dragRotate:rr,dragPan:or,keyboard:ar,doubleClickZoom:ur,touchZoomRotate:cr},pr=function(e){function n(n,r){e.call(this),this._moving=!1,this._zooming=!1,this.transform=n,this._bearingSnap=r.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.getCenter=function(){return this.transform.center},n.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},n.prototype.panBy=function(e,n,r){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},n),r)},n.prototype.panTo=function(e,n,r){return this.easeTo(t.extend({center:e},n),r)},n.prototype.getZoom=function(){return this.transform.zoom},n.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},n.prototype.zoomTo=function(e,n,r){return this.easeTo(t.extend({zoom:e},n),r)},n.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},n.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},n.prototype.getBearing=function(){return this.transform.bearing},n.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},n.prototype.rotateTo=function(e,n,r){return this.easeTo(t.extend({bearing:e},n),r)},n.prototype.resetNorth=function(e,n){return this.rotateTo(0,t.extend({duration:1e3},e),n),this},n.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},n.prototype.getPitch=function(){return this.transform.pitch},n.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},n.prototype.cameraForBounds=function(t,e){return t=F.convert(t),this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),0,e)},n.prototype._cameraForBoxAndBearing=function(e,n,r,i){if("number"==typeof(i=t.extend({padding:{top:0,bottom:0,right:0,left:0},offset:[0,0],maxZoom:this.transform.maxZoom},i)).padding){var o=i.padding;i.padding={top:o,bottom:o,right:o,left:o}}if(t.isEqual(Object.keys(i.padding).sort((function(t,e){return t<e?-1:t>e?1:0})),["bottom","left","right","top"])){var a=[(i.padding.left-i.padding.right)/2,(i.padding.top-i.padding.bottom)/2],s=Math.min(i.padding.right,i.padding.left),u=Math.min(i.padding.top,i.padding.bottom);i.offset=[i.offset[0]+a[0],i.offset[1]+a[1]];var l=this.transform,c=l.project(B.convert(e)),h=l.project(B.convert(n)),p=c.rotate(-r*Math.PI/180),f=h.rotate(-r*Math.PI/180),d=new t.Point(Math.max(p.x,f.x),Math.max(p.y,f.y)),m=new t.Point(Math.min(p.x,f.x),Math.min(p.y,f.y)),y=t.Point.convert(i.offset),v=d.sub(m),g=(l.width-2*s-2*Math.abs(y.x))/v.x,_=(l.height-2*u-2*Math.abs(y.y))/v.y;if(!(_<0||g<0))return i.center=l.unproject(c.add(h).div(2)),i.zoom=Math.min(l.scaleZoom(l.scale*Math.min(g,_)),i.maxZoom),i.bearing=r,i;t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}else t.warnOnce("options.padding must be a positive number, or an Object with keys 'bottom', 'left', 'right', 'top'")},n.prototype.fitBounds=function(t,e,n){return this._fitInternal(this.cameraForBounds(t,e),e,n)},n.prototype.fitScreenCoordinates=function(e,n,r,i,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(n)),r,i),i,o)},n.prototype._fitInternal=function(e,n,r){return e?(n=t.extend(e,n)).linear?this.easeTo(n,r):this.flyTo(n,r):this},n.prototype.jumpTo=function(e,n){this.stop();var r=this.transform,i=!1,o=!1,a=!1;return"zoom"in e&&r.zoom!==+e.zoom&&(i=!0,r.zoom=+e.zoom),void 0!==e.center&&(r.center=B.convert(e.center)),"bearing"in e&&r.bearing!==+e.bearing&&(o=!0,r.bearing=+e.bearing),"pitch"in e&&r.pitch!==+e.pitch&&(a=!0,r.pitch=+e.pitch),this.fire(new t.Event("movestart",n)).fire(new t.Event("move",n)),i&&this.fire(new t.Event("zoomstart",n)).fire(new t.Event("zoom",n)).fire(new t.Event("zoomend",n)),o&&this.fire(new t.Event("rotatestart",n)).fire(new t.Event("rotate",n)).fire(new t.Event("rotateend",n)),a&&this.fire(new t.Event("pitchstart",n)).fire(new t.Event("pitch",n)).fire(new t.Event("pitchend",n)),this.fire(new t.Event("moveend",n))},n.prototype.easeTo=function(e,n){var r=this;this.stop(),!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate&&(e.duration=0);var i=this.transform,o=this.getZoom(),a=this.getBearing(),s=this.getPitch(),u="zoom"in e?+e.zoom:o,l="bearing"in e?this._normalizeBearing(e.bearing,a):a,c="pitch"in e?+e.pitch:s,h=i.centerPoint.add(t.Point.convert(e.offset)),p=i.pointLocation(h),f=B.convert(e.center||p);this._normalizeCenter(f);var d,m,y=i.project(p),v=i.project(f).sub(y),g=i.zoomScale(u-o);return e.around&&(d=B.convert(e.around),m=i.locationPoint(d)),this._zooming=u!==o,this._rotating=a!==l,this._pitching=c!==s,this._prepareEase(n,e.noMoveStart),clearTimeout(this._easeEndTimeoutID),this._ease((function(e){if(r._zooming&&(i.zoom=t.number(o,u,e)),r._rotating&&(i.bearing=t.number(a,l,e)),r._pitching&&(i.pitch=t.number(s,c,e)),d)i.setLocationAtPoint(d,m);else{var p=i.zoomScale(i.zoom-o),f=u>o?Math.min(2,g):Math.max(.5,g),_=Math.pow(f,1-e),x=i.unproject(y.add(v.mult(e*_)).mult(p));i.setLocationAtPoint(i.renderWorldCopies?x.wrap():x,h)}r._fireMoveEvents(n)}),(function(){e.delayEndEvents?r._easeEndTimeoutID=setTimeout((function(){return r._afterEase(n)}),e.delayEndEvents):r._afterEase(n)}),e),this},n.prototype._prepareEase=function(e,n){this._moving=!0,n||this.fire(new t.Event("movestart",e)),this._zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&this.fire(new t.Event("pitchstart",e))},n.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},n.prototype._afterEase=function(e){var n=this._zooming,r=this._rotating,i=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,n&&this.fire(new t.Event("zoomend",e)),r&&this.fire(new t.Event("rotateend",e)),i&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))},n.prototype.flyTo=function(e,n){var r=this;this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var i=this.transform,o=this.getZoom(),a=this.getBearing(),s=this.getPitch(),u="zoom"in e?t.clamp(+e.zoom,i.minZoom,i.maxZoom):o,l="bearing"in e?this._normalizeBearing(e.bearing,a):a,c="pitch"in e?+e.pitch:s,h=i.zoomScale(u-o),p=i.centerPoint.add(t.Point.convert(e.offset)),f=i.pointLocation(p),d=B.convert(e.center||f);this._normalizeCenter(d);var m=i.project(f),y=i.project(d).sub(m),v=e.curve,g=Math.max(i.width,i.height),_=g/h,x=y.mag();if("minZoom"in e){var b=t.clamp(Math.min(e.minZoom,o,u),i.minZoom,i.maxZoom),w=g/i.zoomScale(b-o);v=Math.sqrt(w/x*2)}var E=v*v;function S(t){var e=(_*_-g*g+(t?-1:1)*E*E*x*x)/(2*(t?_:g)*E*x);return Math.log(Math.sqrt(e*e+1)-e)}function T(t){return(Math.exp(t)-Math.exp(-t))/2}function k(t){return(Math.exp(t)+Math.exp(-t))/2}var M=S(0),A=function(t){return k(M)/k(M+v*t)},P=function(t){return g*((k(M)*(T(e=M+v*t)/k(e))-T(M))/E)/x;var e},z=(S(1)-M)/v;if(Math.abs(x)<1e-6||!isFinite(z)){if(Math.abs(g-_)<1e-6)return this.easeTo(e,n);var I=_<g?-1:1;z=Math.abs(Math.log(_/g))/v,P=function(){return 0},A=function(t){return Math.exp(I*v*t)}}if("duration"in e)e.duration=+e.duration;else{var C="screenSpeed"in e?+e.screenSpeed/v:+e.speed;e.duration=1e3*z/C}return e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=a!==l,this._pitching=c!==s,this._prepareEase(n,!1),this._ease((function(e){var h=e*z,f=1/A(h);i.zoom=1===e?u:o+i.scaleZoom(f),r._rotating&&(i.bearing=t.number(a,l,e)),r._pitching&&(i.pitch=t.number(s,c,e));var v=1===e?d:i.unproject(m.add(y.mult(P(h))).mult(f));i.setLocationAtPoint(i.renderWorldCopies?v.wrap():v,p),r._fireMoveEvents(n)}),(function(){return r._afterEase(n)}),e),this},n.prototype.isEasing=function(){return!!this._easeFrameId},n.prototype.stop=function(){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var t=this._onEaseEnd;delete this._onEaseEnd,t.call(this)}return this},n.prototype._ease=function(e,n,r){!1===r.animate||0===r.duration?(e(1),n()):(this._easeStart=t.browser.now(),this._easeOptions=r,this._onEaseFrame=e,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},n.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},n.prototype._normalizeBearing=function(e,n){e=t.wrap(e,-180,180);var r=Math.abs(e-n);return Math.abs(e-360-n)<r&&(e-=360),Math.abs(e+360-n)<r&&(e+=360),e},n.prototype._normalizeCenter=function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var n=t.lng-e.center.lng;t.lng+=n>180?-360:n<-180?360:0}},n}(t.Evented),fr=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};fr.prototype.getDefaultPosition=function(){return"bottom-right"},fr.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},fr.prototype.onRemove=function(){n.remove(this._container),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0},fr.prototype._updateEditLink=function(){var t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));var e=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:h.ACCESS_TOKEN}];if(t){var n=e.reduce((function(t,n,r){return n.value&&(t+=n.key+"="+n.value+(r<e.length-1?"&":"")),t}),"?");t.href="https://www.mapbox.com/feedback/"+n+(this._map._hash?this._map._hash.getHashString(!0):"")}},fr.prototype._updateData=function(t){t&&"metadata"===t.sourceDataType&&(this._updateAttributions(),this._updateEditLink())},fr.prototype._updateAttributions=function(){if(this._map.style){var t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){var e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}var n=this._map.style.sourceCaches;for(var r in n){var i=n[r].getSource();i.attribution&&t.indexOf(i.attribution)<0&&t.push(i.attribution)}t.sort((function(t,e){return t.length-e.length})),(t=t.filter((function(e,n){for(var r=n+1;r<t.length;r++)if(t[r].indexOf(e)>=0)return!1;return!0}))).length?(this._container.innerHTML=t.join(" | "),this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null}},fr.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var dr=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};dr.prototype.onAdd=function(t){this._map=t,this._container=n.create("div","mapboxgl-ctrl");var e=n.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.href="https://www.mapbox.com/",e.setAttribute("aria-label","Mapbox logo"),e.setAttribute("rel","noopener"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},dr.prototype.onRemove=function(){n.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},dr.prototype.getDefaultPosition=function(){return"bottom-left"},dr.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},dr.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},dr.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var mr=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};mr.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},mr.prototype.remove=function(t){for(var e=this._currentlyRunning,n=0,r=e?this._queue.concat(e):this._queue;n<r.length;n+=1){var i=r[n];if(i.id===t)return void(i.cancelled=!0)}},mr.prototype.run=function(){var t=this._currentlyRunning=this._queue;this._queue=[];for(var e=0,n=t;e<n.length;e+=1){var r=n[e];if(!r.cancelled&&(r.callback(),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},mr.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var yr=t.window.HTMLImageElement,vr=t.window.HTMLElement,gr={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:22,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,clickTolerance:3,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,transformRequest:null,fadeDuration:300,crossSourceCollisions:!0},_r=function(r){function i(e){var i=this;if(null!=(e=t.extend({},gr,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than minZoom");var o=new Hn(e.minZoom,e.maxZoom,e.renderWorldCopies);r.call(this,o,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new mr,this._controls=[];var a=e.transformRequest;if(this._transformRequest=a?function(t,e){return a(t,e)||{url:t}}:function(t){return{url:t}},"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof vr))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return i._update(!1)})),this.on("zoom",(function(){return i._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1)),function(t,e){var r=t.getCanvasContainer(),i=null,o=!1,a=null;for(var s in hr)t[s]=new hr[s](t,e),e.interactive&&e[s]&&t[s].enable(e[s]);n.addEventListener(r,"mouseout",(function(e){t.fire(new Jn("mouseout",t,e))})),n.addEventListener(r,"mousedown",(function(i){o=!0,a=n.mousePos(r,i);var s=new Jn("mousedown",t,i);t.fire(s),s.defaultPrevented||(e.interactive&&!t.doubleClickZoom.isActive()&&t.stop(),t.boxZoom.onMouseDown(i),t.boxZoom.isActive()||t.dragPan.isActive()||t.dragRotate.onMouseDown(i),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onMouseDown(i))})),n.addEventListener(r,"mouseup",(function(e){var n=t.dragRotate.isActive();i&&!n&&t.fire(new Jn("contextmenu",t,i)),i=null,o=!1,t.fire(new Jn("mouseup",t,e))})),n.addEventListener(r,"mousemove",(function(e){if(!t.dragPan.isActive()&&!t.dragRotate.isActive()){for(var n=e.target;n&&n!==r;)n=n.parentNode;n===r&&t.fire(new Jn("mousemove",t,e))}})),n.addEventListener(r,"mouseover",(function(e){for(var n=e.target;n&&n!==r;)n=n.parentNode;n===r&&t.fire(new Jn("mouseover",t,e))})),n.addEventListener(r,"touchstart",(function(n){var r=new $n("touchstart",t,n);t.fire(r),r.defaultPrevented||(e.interactive&&t.stop(),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onTouchStart(n),t.touchZoomRotate.onStart(n),t.doubleClickZoom.onTouchStart(r))}),{passive:!1}),n.addEventListener(r,"touchmove",(function(e){t.fire(new $n("touchmove",t,e))}),{passive:!1}),n.addEventListener(r,"touchend",(function(e){t.fire(new $n("touchend",t,e))})),n.addEventListener(r,"touchcancel",(function(e){t.fire(new $n("touchcancel",t,e))})),n.addEventListener(r,"click",(function(i){var o=n.mousePos(r,i);(o.equals(a)||o.dist(a)<e.clickTolerance)&&t.fire(new Jn("click",t,i))})),n.addEventListener(r,"dblclick",(function(e){var n=new Jn("dblclick",t,e);t.fire(n),n.defaultPrevented||t.doubleClickZoom.onDblClick(n)})),n.addEventListener(r,"contextmenu",(function(e){var n=t.dragRotate.isActive();o||n?o&&(i=e):t.fire(new Jn("contextmenu",t,e)),e.preventDefault()})),n.addEventListener(r,"wheel",(function(n){e.interactive&&t.stop();var r=new Qn("wheel",t,n);t.fire(r),r.defaultPrevented||t.scrollZoom.onWheel(n)}),{passive:!1})}(this,e),this._hash=e.hash&&(new Kn).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),this.resize(),e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new fr({customAttribution:e.customAttribution})),this.addControl(new dr,e.logoPosition),this.on("style.load",(function(){i.transform.unmodified&&i.jumpTo(i.style.stylesheet)})),this.on("data",(function(e){i._update("style"===e.dataType),i.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){i.fire(new t.Event(e.dataType+"dataloading",e))}))}r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i;var o={showTileBoundaries:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0}};return i.prototype.addControl=function(e,n){if(void 0===n&&e.getDefaultPosition&&(n=e.getDefaultPosition()),void 0===n&&(n="top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var r=e.onAdd(this);this._controls.push(e);var i=this._controlPositions[n];return-1!==n.indexOf("bottom")?i.insertBefore(r,i.firstChild):i.appendChild(r),this},i.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var n=this._controls.indexOf(e);return n>-1&&this._controls.splice(n,1),e.onRemove(this),this},i.prototype.resize=function(e){var n=this._containerDimensions(),r=n[0],i=n[1];return this._resizeCanvas(r,i),this.transform.resize(r,i),this.painter.resize(r,i),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e)).fire(new t.Event("resize",e)).fire(new t.Event("moveend",e)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(t){return this.transform.setMaxBounds(F.convert(t)),this._update()},i.prototype.setMinZoom=function(t){if((t=null==t?0:t)>=0&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between 0 and the current maxZoom, inclusive")},i.prototype.getMinZoom=function(){return this.transform.minZoom},i.prototype.setMaxZoom=function(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.project=function(t){return this.transform.locationPoint(B.convert(t))},i.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},i.prototype.isMoving=function(){return this._moving||this.dragPan.isActive()||this.dragRotate.isActive()||this.scrollZoom.isActive()},i.prototype.isZooming=function(){return this._zooming||this.scrollZoom.isActive()},i.prototype.isRotating=function(){return this._rotating||this.dragRotate.isActive()},i.prototype.on=function(t,e,n){var i,o=this;if(void 0===n)return r.prototype.on.call(this,t,e);var a=function(){if("mouseenter"===t||"mouseover"===t){var r=!1;return{layer:e,listener:n,delegates:{mousemove:function(i){var a=o.getLayer(e)?o.queryRenderedFeatures(i.point,{layers:[e]}):[];a.length?r||(r=!0,n.call(o,new Jn(t,o,i.originalEvent,{features:a}))):r=!1},mouseout:function(){r=!1}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return{layer:e,listener:n,delegates:{mousemove:function(r){(o.getLayer(e)?o.queryRenderedFeatures(r.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,n.call(o,new Jn(t,o,r.originalEvent)))},mouseout:function(e){a&&(a=!1,n.call(o,new Jn(t,o,e.originalEvent)))}}}}return{layer:e,listener:n,delegates:(i={},i[t]=function(t){var r=o.getLayer(e)?o.queryRenderedFeatures(t.point,{layers:[e]}):[];r.length&&(t.features=r,n.call(o,t),delete t.features)},i)}}();for(var s in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(a),a.delegates)o.on(s,a.delegates[s]);return this},i.prototype.off=function(t,e,n){if(void 0===n)return r.prototype.off.call(this,t,e);if(this._delegatedListeners&&this._delegatedListeners[t])for(var i=this._delegatedListeners[t],o=0;o<i.length;o++){var a=i[o];if(a.layer===e&&a.listener===n){for(var s in a.delegates)this.off(s,a.delegates[s]);return i.splice(o,1),this}}return this},i.prototype.queryRenderedFeatures=function(e,n){if(!this.style)return[];var r;if(void 0!==n||void 0===e||e instanceof t.Point||Array.isArray(e)||(n=e,e=void 0),n=n||{},(e=e||[[0,0],[this.transform.width,this.transform.height]])instanceof t.Point||"number"==typeof e[0])r=[t.Point.convert(e)];else{var i=t.Point.convert(e[0]),o=t.Point.convert(e[1]);r=[i,new t.Point(o.x,i.y),o,new t.Point(i.x,o.y),i]}return this.style.queryRenderedFeatures(r,n,this.transform)},i.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},i.prototype.setStyle=function(e,n){if((!n||!1!==n.diff&&!n.localIdeographFontFamily)&&this.style&&e&&"object"==typeof e)try{return this.style.setState(e)&&this._update(!0),this}catch(e){t.warnOnce("Unable to perform style diff: "+(e.message||e.error||e)+".  Rebuilding the style from scratch.")}return this.style&&(this.style.setEventedParent(null),this.style._remove()),e?(this.style=new Ge(this,n||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof e?this.style.loadURL(e):this.style.loadJSON(e),this):(delete this.style,this)},i.prototype.getStyle=function(){if(this.style)return this.style.serialize()},i.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")},i.prototype.addSource=function(t,e){return this.style.addSource(t,e),this._update(!0)},i.prototype.isSourceLoaded=function(e){var n=this.style&&this.style.sourceCaches[e];if(void 0!==n)return n.loaded();this.fire(new t.ErrorEvent(new Error("There is no source with ID '"+e+"'")))},i.prototype.areTilesLoaded=function(){var t=this.style&&this.style.sourceCaches;for(var e in t){var n=t[e]._tiles;for(var r in n){var i=n[r];if("loaded"!==i.state&&"errored"!==i.state)return!1}}return!0},i.prototype.addSourceType=function(t,e,n){return this.style.addSourceType(t,e,n)},i.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0)},i.prototype.getSource=function(t){return this.style.getSource(t)},i.prototype.addImage=function(e,n,r){void 0===r&&(r={});var i=r.pixelRatio;void 0===i&&(i=1);var o=r.sdf;if(void 0===o&&(o=!1),n instanceof yr){var a=t.browser.getImageData(n),s=a.width,u=a.height,l=a.data;this.style.addImage(e,{data:new t.RGBAImage({width:s,height:u},l),pixelRatio:i,sdf:o})}else{if(void 0===n.width||void 0===n.height)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var c=n.width,h=n.height,p=n.data;this.style.addImage(e,{data:new t.RGBAImage({width:c,height:h},new Uint8Array(p)),pixelRatio:i,sdf:o})}},i.prototype.hasImage=function(e){return e?!!this.style.getImage(e):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)},i.prototype.removeImage=function(t){this.style.removeImage(t)},i.prototype.loadImage=function(e,n){t.getImage(this._transformRequest(e,t.ResourceType.Image),n)},i.prototype.listImages=function(){return this.style.listImages()},i.prototype.addLayer=function(t,e){return this.style.addLayer(t,e),this._update(!0)},i.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0)},i.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0)},i.prototype.getLayer=function(t){return this.style.getLayer(t)},i.prototype.setFilter=function(t,e){return this.style.setFilter(t,e),this._update(!0)},i.prototype.setLayerZoomRange=function(t,e,n){return this.style.setLayerZoomRange(t,e,n),this._update(!0)},i.prototype.getFilter=function(t){return this.style.getFilter(t)},i.prototype.setPaintProperty=function(t,e,n){return this.style.setPaintProperty(t,e,n),this._update(!0)},i.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},i.prototype.setLayoutProperty=function(t,e,n){return this.style.setLayoutProperty(t,e,n),this._update(!0)},i.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},i.prototype.setLight=function(t){return this.style.setLight(t),this._update(!0)},i.prototype.getLight=function(){return this.style.getLight()},i.prototype.setFeatureState=function(t,e){return this.style.setFeatureState(t,e),this._update()},i.prototype.getFeatureState=function(t){return this.style.getFeatureState(t)},i.prototype.getContainer=function(){return this._container},i.prototype.getCanvasContainer=function(){return this._canvasContainer},i.prototype.getCanvas=function(){return this._canvas},i.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]},i.prototype._detectMissingCSS=function(){"rgb(250, 128, 114)"!==t.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&t.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},i.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSCanary=n.create("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();var e=this._canvasContainer=n.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=n.create("canvas","mapboxgl-canvas",e),this._canvas.style.position="absolute",this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map");var r=this._containerDimensions();this._resizeCanvas(r[0],r[1]);var i=this._controlContainer=n.create("div","mapboxgl-control-container",t),o=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(t){o[t]=n.create("div","mapboxgl-ctrl-"+t,i)}))},i.prototype._resizeCanvas=function(e,n){var r=t.window.devicePixelRatio||1;this._canvas.width=r*e,this._canvas.height=r*n,this._canvas.style.width=e+"px",this._canvas.style.height=n+"px"},i.prototype._setupPainter=function(){var n=t.extend({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer},e.webGLContextAttributes),r=this._canvas.getContext("webgl",n)||this._canvas.getContext("experimental-webgl",n);r?this.painter=new Zn(r,this.transform):this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")))},i.prototype._contextLost=function(e){e.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:e}))},i.prototype._contextRestored=function(e){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:e}))},i.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},i.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this},i.prototype._requestRenderFrame=function(t){return this._update(),this._renderTaskQueue.add(t)},i.prototype._cancelRenderFrame=function(t){this._renderTaskQueue.remove(t)},i.prototype._render=function(){this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run();var e=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var n=this.transform.zoom,r=t.browser.now();this.style.zoomHistory.update(n,r);var i=new t.EvaluationParameters(n,{now:r,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),o=i.crossFadingFactor();1===o&&o===this._crossFadingFactor||(e=!0,this._crossFadingFactor=o),this.style.update(i)}return this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),fadeDuration:this._fadeDuration}),this.fire(new t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&(this.style.hasTransitions()||e)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),(this._sourcesDirty||this._repaint||this._styleDirty||this._placementDirty)&&this.triggerRepaint(),this},i.prototype.remove=function(){this._hash&&this._hash.remove(),this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.setStyle(null),void 0!==t.window&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1));for(var e=0,n=this._controls;e<n.length;e+=1)n[e].onRemove(this);this._controls=[];var r=this.painter.context.gl.getExtension("WEBGL_lose_context");r&&r.loseContext(),xr(this._canvasContainer),xr(this._controlContainer),xr(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this.fire(new t.Event("remove"))},i.prototype.triggerRepaint=function(){var e=this;this.style&&!this._frame&&(this._frame=t.browser.frame((function(){e._frame=null,e._render()})))},i.prototype._onWindowOnline=function(){this._update()},i.prototype._onWindowResize=function(){this._trackResize&&this.resize()._update()},o.showTileBoundaries.get=function(){return!!this._showTileBoundaries},o.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},o.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},o.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())},o.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},o.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},o.repaint.get=function(){return!!this._repaint},o.repaint.set=function(t){this._repaint=t,this._update()},o.vertices.get=function(){return!!this._vertices},o.vertices.set=function(t){this._vertices=t,this._update()},Object.defineProperties(i.prototype,o),i}(pr);function xr(t){t.parentNode&&t.parentNode.removeChild(t)}var br={showCompass:!0,showZoom:!0},wr=function(e){var r=this;this.options=t.extend({},br,e),this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this.options.showZoom&&(this._zoomInButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-in","Zoom In",(function(){return r._map.zoomIn()})),this._zoomOutButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-out","Zoom Out",(function(){return r._map.zoomOut()}))),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-compass","Reset North",(function(){return r._map.resetNorth()})),this._compassArrow=n.create("span","mapboxgl-ctrl-compass-arrow",this._compass))};function Er(t,e,n){if(t=new B(t.lng,t.lat),e){var r=new B(t.lng-360,t.lat),i=new B(t.lng+360,t.lat),o=n.locationPoint(t).distSqr(e);n.locationPoint(r).distSqr(e)<o?t=r:n.locationPoint(i).distSqr(e)<o&&(t=i)}for(;Math.abs(t.lng-n.center.lng)>180;){var a=n.locationPoint(t);if(a.x>=0&&a.y>=0&&a.x<=n.width&&a.y<=n.height)break;t.lng>n.center.lng?t.lng-=360:t.lng+=360}return t}wr.prototype._rotateCompassArrow=function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t},wr.prototype.onAdd=function(t){return this._map=t,this.options.showCompass&&(this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new rr(t,{button:"left",element:this._compass}),n.addEventListener(this._compass,"mousedown",this._handler.onMouseDown),this._handler.enable()),this._container},wr.prototype.onRemove=function(){n.remove(this._container),this.options.showCompass&&(this._map.off("rotate",this._rotateCompassArrow),n.removeEventListener(this._compass,"mousedown",this._handler.onMouseDown),this._handler.disable(),delete this._handler),delete this._map},wr.prototype._createButton=function(t,e,r){var i=n.create("button",t,this._container);return i.type="button",i.setAttribute("aria-label",e),i.addEventListener("click",r),i};var Sr={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Tr(t,e,n){var r=t.classList;for(var i in Sr)r.remove("mapboxgl-"+n+"-anchor-"+i);r.add("mapboxgl-"+n+"-anchor-"+e)}var kr,Mr=function(e){function r(r){if(e.call(this),(arguments[0]instanceof t.window.HTMLElement||2===arguments.length)&&(r=t.extend({element:r},arguments[1])),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick"],this),this._anchor=r&&r.anchor||"center",this._color=r&&r.color||"#3FB1CE",this._draggable=r&&r.draggable||!1,this._state="inactive",r&&r.element)this._element=r.element,this._offset=t.Point.convert(r&&r.offset||[0,0]);else{this._defaultMarker=!0,this._element=n.create("div");var i=n.createNS("http://www.w3.org/2000/svg","svg");i.setAttributeNS(null,"height","41px"),i.setAttributeNS(null,"width","27px"),i.setAttributeNS(null,"viewBox","0 0 27 41");var o=n.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"stroke","none"),o.setAttributeNS(null,"stroke-width","1"),o.setAttributeNS(null,"fill","none"),o.setAttributeNS(null,"fill-rule","evenodd");var a=n.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"fill-rule","nonzero");var s=n.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"transform","translate(3.0, 29.0)"),s.setAttributeNS(null,"fill","#000000");for(var u=0,l=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];u<l.length;u+=1){var c=l[u],h=n.createNS("http://www.w3.org/2000/svg","ellipse");h.setAttributeNS(null,"opacity","0.04"),h.setAttributeNS(null,"cx","10.5"),h.setAttributeNS(null,"cy","5.80029008"),h.setAttributeNS(null,"rx",c.rx),h.setAttributeNS(null,"ry",c.ry),s.appendChild(h)}var p=n.createNS("http://www.w3.org/2000/svg","g");p.setAttributeNS(null,"fill",this._color);var f=n.createNS("http://www.w3.org/2000/svg","path");f.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),p.appendChild(f);var d=n.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"opacity","0.25"),d.setAttributeNS(null,"fill","#000000");var m=n.createNS("http://www.w3.org/2000/svg","path");m.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),d.appendChild(m);var y=n.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"transform","translate(6.0, 7.0)"),y.setAttributeNS(null,"fill","#FFFFFF");var v=n.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"transform","translate(8.0, 8.0)");var g=n.createNS("http://www.w3.org/2000/svg","circle");g.setAttributeNS(null,"fill","#000000"),g.setAttributeNS(null,"opacity","0.25"),g.setAttributeNS(null,"cx","5.5"),g.setAttributeNS(null,"cy","5.5"),g.setAttributeNS(null,"r","5.4999962");var _=n.createNS("http://www.w3.org/2000/svg","circle");_.setAttributeNS(null,"fill","#FFFFFF"),_.setAttributeNS(null,"cx","5.5"),_.setAttributeNS(null,"cy","5.5"),_.setAttributeNS(null,"r","5.4999962"),v.appendChild(g),v.appendChild(_),a.appendChild(s),a.appendChild(p),a.appendChild(d),a.appendChild(y),a.appendChild(v),i.appendChild(a),this._element.appendChild(i),this._offset=t.Point.convert(r&&r.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._popup=null}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},r.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),delete this._map),n.remove(this._element),this._popup&&this._popup.remove(),this},r.prototype.getLngLat=function(){return this._lngLat},r.prototype.setLngLat=function(t){return this._lngLat=B.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},r.prototype.getElement=function(){return this._element},r.prototype.setPopup=function(t){if(this._popup&&(this._popup.remove(),this._popup=null),t){if(!("offset"in t.options)){var e=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat)}return this},r.prototype._onMapClick=function(t){var e=t.originalEvent.target,n=this._element;this._popup&&(e===n||n.contains(e))&&this.togglePopup()},r.prototype.getPopup=function(){return this._popup},r.prototype.togglePopup=function(){var t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this},r.prototype._update=function(t){this._map&&(this._map.transform.renderWorldCopies&&(this._lngLat=Er(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset),t&&"moveend"!==t.type||(this._pos=this._pos.round()),n.setTransform(this._element,Sr[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px)"),Tr(this._element,this._anchor,"marker"))},r.prototype.getOffset=function(){return this._offset},r.prototype.setOffset=function(e){return this._offset=t.Point.convert(e),this._update(),this},r.prototype._onMove=function(e){this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag"))},r.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},r.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},r.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},r.prototype.isDraggable=function(){return this._draggable},r}(t.Evented),Ar={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showUserLocation:!0},Pr=function(e){function r(n){e.call(this),this.options=t.extend({},Ar,n),t.bindAll(["_onSuccess","_onError","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.onAdd=function(e){var r;return this._map=e,this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),r=this._setupUI,void 0!==kr?r(kr):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){kr="denied"!==t.state,r(kr)})):(kr=!!t.window.navigator.geolocation,r(kr)),this._container},r.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),n.remove(this._container),this._map=void 0},r.prototype._onSuccess=function(e){if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()},r.prototype._updateCamera=function(t){var e=new B(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy;this._map.fitBounds(e.toBounds(n),this.options.fitBoundsOptions,{geolocateSource:!0})},r.prototype._updateMarker=function(t){t?this._userLocationDotMarker.setLngLat([t.coords.longitude,t.coords.latitude]).addTo(this._map):this._userLocationDotMarker.remove()},r.prototype._onError=function(e){if(this.options.trackUserLocation)if(1===e.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"),void 0!==this._geolocationWatchID&&this._clearWatch();else 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")}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()},r.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},r.prototype._setupUI=function(e){var r=this;!1!==e?(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=n.create("button","mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.setAttribute("aria-label","Geolocate"),this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=n.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Mr(this._dotElement),this.options.trackUserLocation&&(this._watchState="OFF")),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){e.geolocateSource||"ACTIVE_LOCK"!==r._watchState||(r._watchState="BACKGROUND",r._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),r._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),r.fire(new t.Event("trackuserlocationend")))}))):t.warnOnce("Geolocation support is not available, the GeolocateControl will not be visible.")},r.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":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 t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}"OFF"===this._watchState&&void 0!==this._geolocationWatchID?this._clearWatch():void 0===this._geolocationWatchID&&(this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,this.options.positionOptions))}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},r.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},r}(t.Evented),zr={maxWidth:100,unit:"metric"},Ir=function(e){this.options=t.extend({},zr,e),t.bindAll(["_onMove","setUnit"],this)};function Cr(t,e,n){var r,i,o,a,s,u,l=n&&n.maxWidth||100,c=t._container.clientHeight/2,h=(r=t.unproject([0,c]),i=t.unproject([l,c]),o=Math.PI/180,a=r.lat*o,s=i.lat*o,u=Math.sin(a)*Math.sin(s)+Math.cos(a)*Math.cos(s)*Math.cos((i.lng-r.lng)*o),6371e3*Math.acos(Math.min(u,1)));if(n&&"imperial"===n.unit){var p=3.2808*h;p>5280?Lr(e,l,p/5280,"mi"):Lr(e,l,p,"ft")}else n&&"nautical"===n.unit?Lr(e,l,h/1852,"nm"):Lr(e,l,h,"m")}function Lr(t,e,n,r){var i,o,a,s=(i=n,(o=Math.pow(10,(""+Math.floor(i)).length-1))*(a=(a=i/o)>=10?10:a>=5?5:a>=3?3:a>=2?2:1)),u=s/n;"m"===r&&s>=1e3&&(s/=1e3,r="km"),t.style.width=e*u+"px",t.innerHTML=s+r}Ir.prototype.getDefaultPosition=function(){return"bottom-left"},Ir.prototype._onMove=function(){Cr(this._map,this._container,this.options)},Ir.prototype.onAdd=function(t){return this._map=t,this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Ir.prototype.onRemove=function(){n.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Ir.prototype.setUnit=function(t){this.options.unit=t,Cr(this._map,this._container,this.options)};var Or=function(){this._fullscreen=!1,t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange"),this._className="mapboxgl-ctrl"};Or.prototype.onAdd=function(e){return this._map=e,this._mapContainer=this._map.getContainer(),this._container=n.create("div",this._className+" mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._container.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._container},Or.prototype.onRemove=function(){n.remove(this._container),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Or.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Or.prototype._setupUI=function(){var e=this._fullscreenButton=n.create("button",this._className+"-icon "+this._className+"-fullscreen",this._container);e.setAttribute("aria-label","Toggle fullscreen"),e.type="button",this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Or.prototype._isFullscreen=function(){return this._fullscreen},Or.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._mapContainer!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle(this._className+"-shrink"),this._fullscreenButton.classList.toggle(this._className+"-fullscreen"))},Or.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._mapContainer.requestFullscreen?this._mapContainer.requestFullscreen():this._mapContainer.mozRequestFullScreen?this._mapContainer.mozRequestFullScreen():this._mapContainer.msRequestFullscreen?this._mapContainer.msRequestFullscreen():this._mapContainer.webkitRequestFullscreen&&this._mapContainer.webkitRequestFullscreen()};var Dr={closeButton:!0,closeOnClick:!0,className:""},Rr=function(e){function r(n){e.call(this),this.options=t.extend(Object.create(Dr),n),t.bindAll(["_update","_onClickClose"],this)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.addTo=function(e){return this._map=e,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this.fire(new t.Event("open")),this},r.prototype.isOpen=function(){return!!this._map},r.prototype.remove=function(){return this._content&&n.remove(this._content),this._container&&(n.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire(new t.Event("close")),this},r.prototype.getLngLat=function(){return this._lngLat},r.prototype.setLngLat=function(t){return this._lngLat=B.convert(t),this._pos=null,this._update(),this},r.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},r.prototype.setHTML=function(e){var n,r=t.window.document.createDocumentFragment(),i=t.window.document.createElement("body");for(i.innerHTML=e;n=i.firstChild;)r.appendChild(n);return this.setDOMContent(r)},r.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},r.prototype._createContent=function(){this._content&&n.remove(this._content),this._content=n.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=n.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClickClose))},r.prototype._update=function(){var e=this;if(this._map&&this._lngLat&&this._content){this._container||(this._container=n.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=n.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return e._container.classList.add(t)}))),this._map.transform.renderWorldCopies&&(this._lngLat=Er(this._lngLat,this._pos,this._map.transform));var r=this._pos=this._map.project(this._lngLat),i=this.options.anchor,o=function e(n){if(n){if("number"==typeof n){var r=Math.round(Math.sqrt(.5*Math.pow(n,2)));return{center:new t.Point(0,0),top:new t.Point(0,n),"top-left":new t.Point(r,r),"top-right":new t.Point(-r,r),bottom:new t.Point(0,-n),"bottom-left":new t.Point(r,-r),"bottom-right":new t.Point(-r,-r),left:new t.Point(n,0),right:new t.Point(-n,0)}}if(n instanceof t.Point||Array.isArray(n)){var i=t.Point.convert(n);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:t.Point.convert(n.center||[0,0]),top:t.Point.convert(n.top||[0,0]),"top-left":t.Point.convert(n["top-left"]||[0,0]),"top-right":t.Point.convert(n["top-right"]||[0,0]),bottom:t.Point.convert(n.bottom||[0,0]),"bottom-left":t.Point.convert(n["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(n["bottom-right"]||[0,0]),left:t.Point.convert(n.left||[0,0]),right:t.Point.convert(n.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!i){var a,s=this._container.offsetWidth,u=this._container.offsetHeight;a=r.y+o.bottom.y<u?["top"]:r.y>this._map.transform.height-u?["bottom"]:[],r.x<s/2?a.push("left"):r.x>this._map.transform.width-s/2&&a.push("right"),i=0===a.length?"bottom":a.join("-")}var l=r.add(o[i]).round();n.setTransform(this._container,Sr[i]+" translate("+l.x+"px,"+l.y+"px)"),Tr(this._container,i,"popup")}},r.prototype._onClickClose=function(){this.remove()},r}(t.Evented),Br={version:"0.50.0",supported:e,setRTLTextPlugin:t.setRTLTextPlugin,Map:_r,NavigationControl:wr,GeolocateControl:Pr,AttributionControl:fr,ScaleControl:Ir,FullscreenControl:Or,Popup:Rr,Marker:Mr,Style:Ge,LngLat:B,LngLatBounds:F,Point:t.Point,Evented:t.Evented,config:h,get accessToken(){return h.ACCESS_TOKEN},set accessToken(t){h.ACCESS_TOKEN=t},get workerCount(){return Xt.workerCount},set workerCount(t){Xt.workerCount=t},workerUrl:""};return Br})),n},"object"==typeof e&&void 0!==t?t.exports=r():"function"==typeof define&&define.amd?define(r):n.mapboxgl=r()},2845:function(t,e,n){"use strict";(function(t){var r=n(2846),i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=!("object"===(void 0===t?"undefined":i(t))&&"[object process]"===String(t)&&!t.browser)||r.a;e.a=o}).call(this,n(454))},2846:function(t,e,n){"use strict";(function(t){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.a="undefined"!=typeof window&&"object"===n(window.process)&&"renderer"===window.process.type||!(void 0===t||"object"!==n(t.versions)||!Boolean(t.versions.electron))||"object"===("undefined"==typeof navigator?"undefined":n(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>=0}).call(this,n(454))},2847:function(t,e,n){var r;
  /*! Hammer.JS - v2.0.7 - 2016-04-22
   * http://hammerjs.github.io/
   *
   * Copyright (c) 2016 Jorik Tangelder;
   * Licensed under the MIT license */!function(i,o,a,s){"use strict";var u,l=["","webkit","Moz","MS","ms","o"],c=o.createElement("div"),h=Math.round,p=Math.abs,f=Date.now;function d(t,e,n){return setTimeout(b(t,n),e)}function m(t,e,n){return!!Array.isArray(t)&&(y(t,n[e],n),!0)}function y(t,e,n){var r;if(t)if(t.forEach)t.forEach(e,n);else if(void 0!==t.length)for(r=0;r<t.length;)e.call(n,t[r],r,t),r++;else for(r in t)t.hasOwnProperty(r)&&e.call(n,t[r],r,t)}function v(t,e,n){var r="DEPRECATED METHOD: "+e+"\n"+n+" AT \n";return function(){var e=new Error("get-stack-trace"),n=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=i.console&&(i.console.warn||i.console.log);return o&&o.call(i.console,r,n),t.apply(this,arguments)}}u="function"!=typeof Object.assign?function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)r.hasOwnProperty(i)&&(e[i]=r[i])}return e}:Object.assign;var g=v((function(t,e,n){for(var r=Object.keys(e),i=0;i<r.length;)(!n||n&&void 0===t[r[i]])&&(t[r[i]]=e[r[i]]),i++;return t}),"extend","Use `assign`."),_=v((function(t,e){return g(t,e,!0)}),"merge","Use `assign`.");function x(t,e,n){var r,i=e.prototype;(r=t.prototype=Object.create(i)).constructor=t,r._super=i,n&&u(r,n)}function b(t,e){return function(){return t.apply(e,arguments)}}function w(t,e){return"function"==typeof t?t.apply(e&&e[0]||void 0,e):t}function E(t,e){return void 0===t?e:t}function S(t,e,n){y(A(e),(function(e){t.addEventListener(e,n,!1)}))}function T(t,e,n){y(A(e),(function(e){t.removeEventListener(e,n,!1)}))}function k(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function M(t,e){return t.indexOf(e)>-1}function A(t){return t.trim().split(/\s+/g)}function P(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var r=0;r<t.length;){if(n&&t[r][n]==e||!n&&t[r]===e)return r;r++}return-1}function z(t){return Array.prototype.slice.call(t,0)}function I(t,e,n){for(var r=[],i=[],o=0;o<t.length;){var a=e?t[o][e]:t[o];P(i,a)<0&&r.push(t[o]),i[o]=a,o++}return n&&(r=e?r.sort((function(t,n){return t[e]>n[e]})):r.sort()),r}function C(t,e){for(var n,r,i=e[0].toUpperCase()+e.slice(1),o=0;o<l.length;){if((r=(n=l[o])?n+i:e)in t)return r;o++}}var L=1;function O(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||i}var D="ontouchstart"in i,R=void 0!==C(i,"PointerEvent"),B=D&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),F=["x","y"],j=["clientX","clientY"];function V(t,e){var n=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){w(t.options.enable,[t])&&n.handler(e)},this.init()}function N(t,e,n){var r=n.pointers.length,i=n.changedPointers.length,o=1&e&&r-i==0,a=12&e&&r-i==0;n.isFirst=!!o,n.isFinal=!!a,o&&(t.session={}),n.eventType=e,function(t,e){var n=t.session,r=e.pointers,i=r.length;n.firstInput||(n.firstInput=U(e));i>1&&!n.firstMultiple?n.firstMultiple=U(e):1===i&&(n.firstMultiple=!1);var o=n.firstInput,a=n.firstMultiple,s=a?a.center:o.center,u=e.center=q(r);e.timeStamp=f(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=W(s,u),e.distance=X(s,u),function(t,e){var n=e.center,r=t.offsetDelta||{},i=t.prevDelta||{},o=t.prevInput||{};1!==e.eventType&&4!==o.eventType||(i=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=t.offsetDelta={x:n.x,y:n.y});e.deltaX=i.x+(n.x-r.x),e.deltaY=i.y+(n.y-r.y)}(n,e),e.offsetDirection=G(e.deltaX,e.deltaY);var l=Z(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=l.x,e.overallVelocityY=l.y,e.overallVelocity=p(l.x)>p(l.y)?l.x:l.y,e.scale=a?(c=a.pointers,h=r,X(h[0],h[1],j)/X(c[0],c[1],j)):1,e.rotation=a?function(t,e){return W(e[1],e[0],j)+W(t[1],t[0],j)}(a.pointers,r):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,function(t,e){var n,r,i,o,a=t.lastInterval||e,s=e.timeStamp-a.timeStamp;if(8!=e.eventType&&(s>25||void 0===a.velocity)){var u=e.deltaX-a.deltaX,l=e.deltaY-a.deltaY,c=Z(s,u,l);r=c.x,i=c.y,n=p(c.x)>p(c.y)?c.x:c.y,o=G(u,l),t.lastInterval=e}else n=a.velocity,r=a.velocityX,i=a.velocityY,o=a.direction;e.velocity=n,e.velocityX=r,e.velocityY=i,e.direction=o}(n,e);var c,h;var d=t.element;k(e.srcEvent.target,d)&&(d=e.srcEvent.target);e.target=d}(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function U(t){for(var e=[],n=0;n<t.pointers.length;)e[n]={clientX:h(t.pointers[n].clientX),clientY:h(t.pointers[n].clientY)},n++;return{timeStamp:f(),pointers:e,center:q(e),deltaX:t.deltaX,deltaY:t.deltaY}}function q(t){var e=t.length;if(1===e)return{x:h(t[0].clientX),y:h(t[0].clientY)};for(var n=0,r=0,i=0;i<e;)n+=t[i].clientX,r+=t[i].clientY,i++;return{x:h(n/e),y:h(r/e)}}function Z(t,e,n){return{x:e/t||0,y:n/t||0}}function G(t,e){return t===e?1:p(t)>=p(e)?t<0?2:4:e<0?8:16}function X(t,e,n){n||(n=F);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return Math.sqrt(r*r+i*i)}function W(t,e,n){n||(n=F);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return 180*Math.atan2(i,r)/Math.PI}V.prototype={handler:function(){},init:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(O(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&T(this.element,this.evEl,this.domHandler),this.evTarget&&T(this.target,this.evTarget,this.domHandler),this.evWin&&T(O(this.element),this.evWin,this.domHandler)}};var H={mousedown:1,mousemove:2,mouseup:4};function Y(){this.evEl="mousedown",this.evWin="mousemove mouseup",this.pressed=!1,V.apply(this,arguments)}x(Y,V,{handler:function(t){var e=H[t.type];1&e&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}});var K={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},J={2:"touch",3:"pen",4:"mouse",5:"kinect"},$="pointerdown",Q="pointermove pointerup pointercancel";function tt(){this.evEl=$,this.evWin=Q,V.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}i.MSPointerEvent&&!i.PointerEvent&&($="MSPointerDown",Q="MSPointerMove MSPointerUp MSPointerCancel"),x(tt,V,{handler:function(t){var e=this.store,n=!1,r=t.type.toLowerCase().replace("ms",""),i=K[r],o=J[t.pointerType]||t.pointerType,a="touch"==o,s=P(e,t.pointerId,"pointerId");1&i&&(0===t.button||a)?s<0&&(e.push(t),s=e.length-1):12&i&&(n=!0),s<0||(e[s]=t,this.callback(this.manager,i,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),n&&e.splice(s,1))}});var et={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function nt(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,V.apply(this,arguments)}function rt(t,e){var n=z(t.touches),r=z(t.changedTouches);return 12&e&&(n=I(n.concat(r),"identifier",!0)),[n,r]}x(nt,V,{handler:function(t){var e=et[t.type];if(1===e&&(this.started=!0),this.started){var n=rt.call(this,t,e);12&e&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:t})}}});var it={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function ot(){this.evTarget="touchstart touchmove touchend touchcancel",this.targetIds={},V.apply(this,arguments)}function at(t,e){var n=z(t.touches),r=this.targetIds;if(3&e&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=z(t.changedTouches),s=[],u=this.target;if(o=n.filter((function(t){return k(t.target,u)})),1===e)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<a.length;)r[a[i].identifier]&&s.push(a[i]),12&e&&delete r[a[i].identifier],i++;return s.length?[I(o.concat(s),"identifier",!0),s]:void 0}x(ot,V,{handler:function(t){var e=it[t.type],n=at.call(this,t,e);n&&this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:t})}});function st(){V.apply(this,arguments);var t=b(this.handler,this);this.touch=new ot(this.manager,t),this.mouse=new Y(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function ut(t,e){1&t?(this.primaryTouch=e.changedPointers[0].identifier,lt.call(this,e)):12&t&&lt.call(this,e)}function lt(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var n={x:e.clientX,y:e.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout((function(){var t=r.indexOf(n);t>-1&&r.splice(t,1)}),2500)}}function ct(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(e-i.x),a=Math.abs(n-i.y);if(o<=25&&a<=25)return!0}return!1}x(st,V,{handler:function(t,e,n){var r="touch"==n.pointerType,i="mouse"==n.pointerType;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)ut.call(this,e,n);else if(i&&ct.call(this,n))return;this.callback(t,e,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var ht=C(c.style,"touchAction"),pt=void 0!==ht,ft=function(){if(!pt)return!1;var t={},e=i.CSS&&i.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(n){t[n]=!e||i.CSS.supports("touch-action",n)})),t}();function dt(t,e){this.manager=t,this.set(e)}dt.prototype={set:function(t){"compute"==t&&(t=this.compute()),pt&&this.manager.element.style&&ft[t]&&(this.manager.element.style[ht]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return y(this.manager.recognizers,(function(e){w(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(M(t,"none"))return"none";var e=M(t,"pan-x"),n=M(t,"pan-y");if(e&&n)return"none";if(e||n)return e?"pan-x":"pan-y";if(M(t,"manipulation"))return"manipulation";return"auto"}(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var r=this.actions,i=M(r,"none")&&!ft.none,o=M(r,"pan-y")&&!ft["pan-y"],a=M(r,"pan-x")&&!ft["pan-x"];if(i){var s=1===t.pointers.length,u=t.distance<2,l=t.deltaTime<250;if(s&&u&&l)return}if(!a||!o)return i||o&&6&n||a&&24&n?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};function mt(t){this.options=u({},this.defaults,t||{}),this.id=L++,this.manager=null,this.options.enable=E(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function yt(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}function vt(t){return 16==t?"down":8==t?"up":2==t?"left":4==t?"right":""}function gt(t,e){var n=e.manager;return n?n.get(t):t}function _t(){mt.apply(this,arguments)}function xt(){_t.apply(this,arguments),this.pX=null,this.pY=null}function bt(){_t.apply(this,arguments)}function wt(){mt.apply(this,arguments),this._timer=null,this._input=null}function Et(){_t.apply(this,arguments)}function St(){_t.apply(this,arguments)}function Tt(){mt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function kt(t,e){return(e=e||{}).recognizers=E(e.recognizers,kt.defaults.preset),new Mt(t,e)}mt.prototype={defaults:{},set:function(t){return u(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(m(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=gt(t,this)).id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return m(t,"dropRecognizeWith",this)?this:(t=gt(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(m(t,"requireFailure",this))return this;var e=this.requireFail;return-1===P(e,t=gt(t,this))&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(m(t,"dropRequireFailure",this))return this;t=gt(t,this);var e=P(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,n=this.state;function r(n){e.manager.emit(n,t)}n<8&&r(e.options.event+yt(n)),r(e.options.event),t.additionalEvent&&r(t.additionalEvent),n>=8&&r(e.options.event+yt(n))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(33&this.requireFail[t].state))return!1;t++}return!0},recognize:function(t){var e=u({},t);if(!w(this.options.enable,[this,e]))return this.reset(),void(this.state=32);56&this.state&&(this.state=1),this.state=this.process(e),30&this.state&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},x(_t,mt,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,n=t.eventType,r=6&e,i=this.attrTest(t);return r&&(8&n||!i)?16|e:r||i?4&n?8|e:2&e?4|e:2:32}}),x(xt,_t,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var t=this.options.direction,e=[];return 6&t&&e.push("pan-y"),24&t&&e.push("pan-x"),e},directionTest:function(t){var e=this.options,n=!0,r=t.distance,i=t.direction,o=t.deltaX,a=t.deltaY;return i&e.direction||(6&e.direction?(i=0===o?1:o<0?2:4,n=o!=this.pX,r=Math.abs(t.deltaX)):(i=0===a?1:a<0?8:16,n=a!=this.pY,r=Math.abs(t.deltaY))),t.direction=i,n&&r>e.threshold&&i&e.direction},attrTest:function(t){return _t.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=vt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),x(bt,_t,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),x(wt,mt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,r=t.distance<e.threshold,i=t.deltaTime>e.time;if(this._input=t,!r||!n||12&t.eventType&&!i)this.reset();else if(1&t.eventType)this.reset(),this._timer=d((function(){this.state=8,this.tryEmit()}),e.time,this);else if(4&t.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}}),x(Et,_t,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),x(St,_t,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return xt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return 30&n?e=t.overallVelocity:6&n?e=t.overallVelocityX:24&n&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&p(e)>this.options.velocity&&4&t.eventType},emit:function(t){var e=vt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),x(Tt,mt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return["manipulation"]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,r=t.distance<e.threshold,i=t.deltaTime<e.time;if(this.reset(),1&t.eventType&&0===this.count)return this.failTimeout();if(r&&i&&n){if(4!=t.eventType)return this.failTimeout();var o=!this.pTime||t.timeStamp-this.pTime<e.interval,a=!this.pCenter||X(this.pCenter,t.center)<e.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,a&&o?this.count+=1:this.count=1,this._input=t,0===this.count%e.taps)return this.hasRequireFailures()?(this._timer=d((function(){this.state=8,this.tryEmit()}),e.interval,this),2):8}return 32},failTimeout:function(){return this._timer=d((function(){this.state=32}),this.options.interval,this),32},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),kt.VERSION="2.0.7",kt.defaults={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[[Et,{enable:!1}],[bt,{enable:!1},["rotate"]],[St,{direction:6}],[xt,{direction:6},["swipe"]],[Tt],[Tt,{event:"doubletap",taps:2},["tap"]],[wt]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Mt(t,e){var n;this.options=u({},kt.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new((n=this).options.inputClass||(R?tt:B?ot:D?st:Y))(n,N),this.touchAction=new dt(this,this.options.touchAction),At(this,!0),y(this.options.recognizers,(function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])}),this)}function At(t,e){var n,r=t.element;r.style&&(y(t.options.cssProps,(function(i,o){n=C(r.style,o),e?(t.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=t.oldCssProps[n]||""})),e||(t.oldCssProps={}))}Mt.prototype={set:function(t){return u(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var e=this.session;if(!e.stopped){var n;this.touchAction.preventDefaults(t);var r=this.recognizers,i=e.curRecognizer;(!i||i&&8&i.state)&&(i=e.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===e.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(t),!i&&14&n.state&&(i=e.curRecognizer=n),o++}},get:function(t){if(t instanceof mt)return t;for(var e=this.recognizers,n=0;n<e.length;n++)if(e[n].options.event==t)return e[n];return null},add:function(t){if(m(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(m(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,n=P(e,t);-1!==n&&(e.splice(n,1),this.touchAction.update())}return this},on:function(t,e){if(void 0!==t&&void 0!==e){var n=this.handlers;return y(A(t),(function(t){n[t]=n[t]||[],n[t].push(e)})),this}},off:function(t,e){if(void 0!==t){var n=this.handlers;return y(A(t),(function(t){e?n[t]&&n[t].splice(P(n[t],e),1):delete n[t]})),this}},emit:function(t,e){this.options.domEvents&&function(t,e){var n=o.createEvent("Event");n.initEvent(t,!0,!0),n.gesture=e,e.target.dispatchEvent(n)}(t,e);var n=this.handlers[t]&&this.handlers[t].slice();if(n&&n.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](e),r++}},destroy:function(){this.element&&At(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},u(kt,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:32,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:24,DIRECTION_ALL:30,Manager:Mt,Input:V,TouchAction:dt,TouchInput:ot,MouseInput:Y,PointerEventInput:tt,TouchMouseInput:st,SingleTouchInput:nt,Recognizer:mt,AttrRecognizer:_t,Tap:Tt,Pan:xt,Swipe:St,Pinch:bt,Rotate:Et,Press:wt,on:S,off:T,each:y,merge:_,extend:g,assign:u,inherit:x,bindFn:b,prefixed:C}),(void 0!==i?i:"undefined"!=typeof self?self:{}).Hammer=kt,void 0===(r=function(){return kt}.call(e,n,e,t))||(t.exports=r)}(window,document)},2848:function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i}));var r="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",i="undefined"!=typeof window?window:t;void 0!==t||window,"undefined"!=typeof document&&document}).call(this,n(35))},2849:function(t,e,n){(function(e){t.exports={window:"undefined"==typeof window?e:window,global:void 0===e?window:e,document:"undefined"==typeof document?{}:document}}).call(this,n(35))},2855:function(t,e){t.exports=function(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}}}]);