var mapboxgl=function(){"use strict";var t=e;function e(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n}e.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},e.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},e.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},e.prototype.solveCurveX=function(t,e){var r,n,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)(n=1))return n;for(;ro?r=i:n=i,i=.5*(n-r)+r}return i},e.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var r=n;function n(t,e){this.x=t,this.y=e}function i(t,e,r){return Math.min(r,Math.max(e,t))}function o(t){var e=[];for(var r in t)e.push(t[r]);return e}function a(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function u(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function l(t,e){return-1!==t.indexOf(e,t.length-e.length)}function p(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function c(t){return Array.isArray(t)?t.map(c):"object"==typeof t&&t?p(t,c):t}n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),o=e.y+n*(this.x-e.x)+r*(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}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t};var h={};function f(t){h[t]||("undefined"!=typeof console&&console.warn(t),h[t]=!0)}function y(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function d(t){for(var e=0,r=0,n=t.length,i=n-1,o=void 0,a=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var o=n||i;return e[r]=!o||o.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}function v(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var g=b,x=3;function b(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var i=new Int32Array(this.arrayBuffer);t=i[0],e=i[1],r=i[2],this.d=e+2*r;for(var o=0;o=p[f+0]&&n>=p[f+1])?(a[h]=!0,o.push(l[h])):a[h]=!1}}},b.prototype._forEachCell=function(t,e,r,n,i,o,a,s){for(var u=this._convertToCellCoord(t),l=this._convertToCellCoord(e),p=this._convertToCellCoord(r),c=this._convertToCellCoord(n),h=u;h<=p;h++)for(var f=l;f<=c;f++){var y=this.d*f+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(f),this._convertFromCellCoord(h+1),this._convertFromCellCoord(f+1)))&&i.call(this,t,e,r,n,y,o,a,s))return}},b.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},b.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},b.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=x+this.cells.length+1+1,r=0,n=0;n255?255:t}function i(t){return t<0?0:t>1?1:t}function o(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function a(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in r)return r[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 p=i.substr(0,u),c=i.substr(u+1,l-(u+1)).split(","),h=1;switch(p){case"rgba":if(4!==c.length)return null;h=a(c.pop());case"rgb":return 3!==c.length?null:[o(c[0]),o(c[1]),o(c[2]),h];case"hsla":if(4!==c.length)return null;h=a(c.pop());case"hsl":if(3!==c.length)return null;var f=(parseFloat(c[0])%360+360)%360/360,y=a(c[1]),d=a(c[2]),m=d<=.5?d*(y+1):d+y-d*y,v=2*d-m;return[n(255*s(v,m,f+1/3)),n(255*s(v,m,f)),n(255*s(v,m,f-1/3)),h];default:return null}}return null}}catch(t){}})).parseCSSColor,k=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};function S(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var D=[I,M,P,C,B,F,V,O(T)];function j(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!j(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 r=0,n=D;r=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function Z(t){if(null===t)return I;if("string"==typeof t)return P;if("boolean"==typeof t)return C;if("number"==typeof t)return M;if(t instanceof k)return B;if(t instanceof q)return E;if(t instanceof R)return F;if(Array.isArray(t)){for(var e,r=t.length,n=0,i=t;n2){var s=t[1];if("string"!=typeof s||!(s in X)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=X[s],n++}else o=T;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],n++}r=O(o,a)}else r=X[i];for(var u=[];n1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var H=function(t){this.type=F,this.sections=t};H.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 r=[],n=1;n4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":N(e[0],e[1],e[2],e[3])))return new k(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new G(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,u=this.args;s=0)return!1;var r=!0;return t.eachChild((function(t){r&&!ot(t,e)&&(r=!1)})),r}rt.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var n=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,C);if(!n)return null;var i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,C);if(!i)return null;var o=null;return r.locale&&!(o=e.parse(r.locale,1,P))?null:new rt(n,i,o)},rt.prototype.evaluate=function(t){return new q(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},rt.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},rt.prototype.possibleOutputs=function(){return[void 0]},rt.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 at=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};at.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var r=t[1];return e.scope.has(r)?new at(r,e.scope.get(r)):e.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},at.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},at.prototype.eachChild=function(){},at.prototype.possibleOutputs=function(){return[void 0]},at.prototype.serialize=function(){return["var",this.name]};var st=function(t,e,r,n,i){void 0===e&&(e=[]),void 0===n&&(n=new z),void 0===i&&(i=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=n,this.errors=i,this.expectedType=r};function ut(t,e){for(var r,n,i=t.length-1,o=0,a=i,s=0;o<=a;)if(r=t[s=Math.floor((o+a)/2)],n=t[s+1],r<=e){if(s===i||ee))throw new G("Input is not a number.");a=s-1}return 0}st.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},st.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new Y(e,[t]):"coerce"===r?new $(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 n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];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=r(o,a,e.typeAnnotation||"coerce");else o=r(o,a,e.typeAnnotation||"assert")}if(!(o instanceof K)&&function t(e){if(e instanceof at)return t(e.boundExpression);if(e instanceof et&&"error"===e.name)return!1;if(e instanceof rt)return!1;var r=e instanceof $||e instanceof Y;var n=!0;e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof K}));if(!n)return!1;return nt(e)&&ot(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var u=new tt;try{o=new K(o.type,o.evaluate(u))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+n+'". 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.")},st.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new st(this.registry,n,e||null,i,this.errors)},st.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new A(n,t))},st.prototype.checkSubtype=function(t,e){var r=j(t,e);return r&&this.error(r),r};var lt=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var p=e.parse(s,l,i);if(!p)return null;i=i||p.type,n.push([a,p])}return new lt(i,r,n)},lt.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[ut(e,n)].evaluate(t)},lt.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var ct=Object.freeze({number:pt,color:function(t,e,r){return new k(pt(t.r,e.r,r),pt(t.g,e.g,r),pt(t.b,e.b,r),pt(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return pt(t,e[n],r)}))}}),ht=.95047,ft=1,yt=1.08883,dt=4/29,mt=6/29,vt=3*mt*mt,gt=mt*mt*mt,xt=Math.PI/180,bt=180/Math.PI;function _t(t){return t>gt?Math.pow(t,1/3):t/vt+dt}function wt(t){return t>mt?t*t*t:vt*(t-dt)}function kt(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function St(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function At(t){var e=St(t.r),r=St(t.g),n=St(t.b),i=_t((.4124564*e+.3575761*r+.1804375*n)/ht),o=_t((.2126729*e+.7151522*r+.072175*n)/ft);return{l:116*o-16,a:500*(i-o),b:200*(o-_t((.0193339*e+.119192*r+.9503041*n)/yt)),alpha:t.a}}function zt(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=ft*wt(e),r=ht*wt(r),n=yt*wt(n),new k(kt(3.2404542*r-1.5371385*e-.4985314*n),kt(-.969266*r+1.8760108*e+.041556*n),kt(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function It(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var Mt={forward:At,reverse:zt,interpolate:function(t,e,r){return{l:pt(t.l,e.l,r),a:pt(t.a,e.a,r),b:pt(t.b,e.b,r),alpha:pt(t.alpha,e.alpha,r)}}},Pt={forward:function(t){var e=At(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*bt;return{h:o<0?o+360:o,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*xt,r=t.c;return zt({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:It(t.h,e.h,r),c:pt(t.c,e.c,r),l:pt(t.l,e.l,r),alpha:pt(t.alpha,e.alpha,r)}}},Ct=Object.freeze({lab:Mt,hcl:Pt}),Bt=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var o=0,a=i;o1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={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,M)))return null;var u=[],l=null;"interpolate-hcl"===r||"interpolate-lab"===r?l=B:e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var p=0;p=c)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var d=e.parse(h,y,l);if(!d)return null;l=l||d.type,u.push([c,d])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new Bt(l,r,n,i,u):e.error("Type "+L(l)+" is not interpolatable.")},Bt.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var o=ut(e,n),a=e[o],s=e[o+1],u=Bt.interpolationFactor(this.interpolation,n,a,s),l=r[o].evaluate(t),p=r[o+1].evaluate(t);return"interpolate"===this.operator?ct[this.type.kind.toLowerCase()](l,p,u):"interpolate-hcl"===this.operator?Pt.reverse(Pt.interpolate(Pt.forward(l),Pt.forward(p),u)):Mt.reverse(Mt.interpolate(Mt.forward(l),Mt.forward(p),u))},Bt.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new G("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new G("Array index must be an integer, but found "+e+" instead.");return r[e]},Ft.prototype.eachChild=function(t){t(this.index),t(this.input)},Ft.prototype.possibleOutputs=function(){return[void 0]},Ft.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Ot=function(t,e,r,n,i,o){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=o};Ot.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 r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},o=[],a=2;aNumber.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return l.error("Numeric branch labels must be integer values.");if(r){if(l.checkSubtype(r,Z(h)))return null}else r=Z(h);if(void 0!==i[String(h)])return l.error("Branch labels must be unique.");i[String(h)]=o.length}var f=e.parse(u,a,n);if(!f)return null;n=n||f.type,o.push(f)}var y=e.parse(t[1],1,T);if(!y)return null;var d=e.parse(t[t.length-1],t.length-1,n);return d?"value"!==y.type.kind&&e.concat(1).checkSubtype(r,y.type)?null:new Ot(r,n,y,i,o,d):null},Ot.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(Z(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Ot.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Ot.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map((function(t){return t.possibleOutputs()}))).concat(this.otherwise.possibleOutputs())},Ot.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,o=Object.keys(this.cases).sort();i",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),Jt=qt("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Kt=qt(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),Gt=function(t,e,r,n,i){this.type=P,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};Gt.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,M);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,P)))return null;var o=null;if(n.currency&&!(o=e.parse(n.currency,1,P)))return null;var a=null;if(n["min-fraction-digits"]&&!(a=e.parse(n["min-fraction-digits"],1,M)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,M))?null:new Gt(r,i,o,a,s)},Gt.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},Gt.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},Gt.prototype.possibleOutputs=function(){return[void 0]},Gt.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Xt=function(t){this.type=M,this.input=t};Xt.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+L(r.type)+" instead."):new Xt(r):null},Xt.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 G("Expected value to be of type string or array, but found "+L(Z(e))+" instead.")},Xt.prototype.eachChild=function(t){t(this.input)},Xt.prototype.possibleOutputs=function(){return[void 0]},Xt.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Yt={"==":Ut,"!=":Rt,">":Zt,"<":Nt,">=":Kt,"<=":Jt,array:Y,at:Ft,boolean:Y,case:Lt,coalesce:Tt,collator:rt,format:H,interpolate:Bt,"interpolate-hcl":Bt,"interpolate-lab":Bt,length:Xt,let:Et,literal:K,match:Ot,number:Y,"number-format":Gt,object:Y,step:lt,string:Y,"to-boolean":$,"to-color":$,"to-number":$,"to-string":$,var:at};function Ht(t,e){var r=e[0],n=e[1],i=e[2],o=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var a=o?o.evaluate(t):1,s=N(r,n,i,a);if(s)throw new G(s);return new k(r/255*a,n/255*a,i/255*a,a)}function Wt(t,e){return t in e}function $t(t,e){var r=e[t];return void 0===r?null:r}function Qt(t){return{type:t}}function te(t){return{result:"success",value:t}}function ee(t){return{result:"error",value:t}}function re(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function ne(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function ie(t){return!!t.expression&&t.expression.interpolated}function oe(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function ae(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function se(t){return t}function ue(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function le(t,e,r,n,i){return ue(typeof r===i?n[r]:void 0,t.default,e.default)}function pe(t,e,r){if("number"!==oe(r))return ue(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var i=ut(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function ce(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==oe(r))return ue(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var o=ut(t.stops.map((function(t){return t[0]})),r),a=function(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],l=ct[e.type]||se;if(t.colorSpace&&"rgb"!==t.colorSpace){var p=Ct[t.colorSpace];l=function(t,e){return p.reverse(p.interpolate(p.forward(t),p.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=u.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return l(r,n,a)}}:l(s,u,a)}function he(t,e,r){return"color"===e.type?r=k.parse(r):"formatted"===e.type?r=R.fromString(r.toString()):oe(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),ue(r,t.default,e.default)}et.register(Yt,{error:[{kind:"error"},[P],function(t,e){var r=e[0];throw new G(r.evaluate(t))}],typeof:[P,[T],function(t,e){return L(Z(e[0].evaluate(t)))}],"to-rgba":[O(M,4),[B],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[B,[M,M,M],Ht],rgba:[B,[M,M,M,M],Ht],has:{type:C,overloads:[[[P],function(t,e){return Wt(e[0].evaluate(t),t.properties())}],[[P,V],function(t,e){var r=e[0],n=e[1];return Wt(r.evaluate(t),n.evaluate(t))}]]},get:{type:T,overloads:[[[P],function(t,e){return $t(e[0].evaluate(t),t.properties())}],[[P,V],function(t,e){var r=e[0],n=e[1];return $t(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[T,[P],function(t,e){return $t(e[0].evaluate(t),t.featureState||{})}],properties:[V,[],function(t){return t.properties()}],"geometry-type":[P,[],function(t){return t.geometryType()}],id:[T,[],function(t){return t.id()}],zoom:[M,[],function(t){return t.globals.zoom}],"heatmap-density":[M,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[M,[],function(t){return t.globals.lineProgress||0}],accumulated:[T,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[M,Qt(M),function(t,e){for(var r=0,n=0,i=e;n":[C,[P,T],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>o}],"filter-id->":[C,[T],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[C,[P,T],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i<=o}],"filter-id-<=":[C,[T],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[C,[P,T],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>=o}],"filter-id->=":[C,[T],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[C,[T],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[C,[],function(t){return null!==t.id()}],"filter-type-in":[C,[O(P)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[C,[O(T)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[C,[P,O(T)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[C,[P,O(T)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:C,overloads:[[[C,C],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[Qt(C),function(t,e){for(var r=0,n=e;r0&&"string"==typeof t[0]&&t[0]in Yt}function de(t,e){var r=new st(Yt,[],e?function(t){var e={color:B,string:P,number:M,enum:P,boolean:C,formatted:F};if("array"===t.type)return O(e[t.value]||T,t.length);return e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?te(new fe(n,e)):ee(r.errors)}fe.prototype.evaluateWithoutErrorHandling=function(t,e,r,n){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.formattedSection=n,this.expression.evaluate(this._evaluator)},fe.prototype.evaluate=function(t,e,r,n){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.formattedSection=n||null;try{var i=this.expression.evaluate(this._evaluator);if(null==i)return this._defaultValue;if(this._enumValues&&!(i in this._enumValues))throw new G("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(i)+" instead.");return i}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var me=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!it(e.expression)};me.prototype.evaluateWithoutErrorHandling=function(t,e,r,n){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n)},me.prototype.evaluate=function(t,e,r,n){return this._styleExpression.evaluate(t,e,r,n)};var ve=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!it(e.expression),this.interpolationType=n};function ge(t,e){if("error"===(t=de(t,e)).result)return t;var r=t.value.expression,n=nt(r);if(!n&&!re(e))return ee([new A("","data expressions not supported")]);var i=ot(r,["zoom"]);if(!i&&!ne(e))return ee([new A("","zoom expressions not supported")]);var o=function t(e){var r=null;if(e instanceof Et)r=t(e.result);else if(e instanceof Tt)for(var n=0,i=e.args;n=0)){var c=t[p];l[p]=_e[u].shallow.indexOf(p)>=0?c:Se(c,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 Ae(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 be)return t;if(Array.isArray(t))return t.map(Ae);if("object"==typeof t){var e=t.$name||"Object",r=_e[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),i=0,o=Object.keys(t);i=0?s:Ae(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var ze=function(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback()})};ze.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){t._triggered=!1,t._callback()}),0))};var Ie=function(t,e,r){var n;this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},n=this,["receive","process"].forEach((function(t){n[t]&&(n[t]=n[t].bind(n))})),this.invoker=new ze(this.process),this.target.addEventListener("message",this.receive,!1)};Ie.prototype.send=function(t,e,r,n){var i=this,o=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[o]=r);var a=[];return this.target.postMessage({id:o,type:t,hasCallback:!!r,targetMapId:n,sourceMapId:this.mapId,data:Se(e,a)},a),{cancel:function(){r&&delete i.callbacks[o],i.target.postMessage({id:o,type:"",targetMapId:n,sourceMapId:i.mapId})}}},Ie.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()},Ie.prototype.process=function(){var t=this;if(this.taskQueue.length){var e=this.taskQueue.shift(),r=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),r)if(""===r.type){var n=this.callbacks[e];delete this.callbacks[e],n&&(r.error?n(Ae(r.error)):n(null,Ae(r.data)))}else{var i=!1,o=r.hasCallback?function(r,n){i=!0,delete t.cancelCallbacks[e];var o=[];t.target.postMessage({id:e,type:"",sourceMapId:t.mapId,error:r?Se(r):null,data:Se(n,o)},o)}:function(t){i=!0},a=null,s=Ae(r.data);if(this.parent[r.type])a=this.parent[r.type](r.sourceMapId,s,o);else if(this.parent.getWorkerSource){var u=r.type.split(".");a=this.parent.getWorkerSource(r.sourceMapId,u[0],s.source)[u[1]](s,o)}else o(new Error("Could not find function "+r.type));!i&&a&&a.cancel&&(this.cancelCallbacks[e]=a.cancel)}}},Ie.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1)};var Me={$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"},clusterProperties:{type:"*"},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:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"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:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"},{"!":"text-variable-anchor"}],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:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum: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"},"number-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:"Feature data"},accumulated:{group:"Feature data"},"+":{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_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"}},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,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"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"}},"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"}}},Pe=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Ce(t){var e=t.key,r=t.value;return r?[new Pe(e,r,"constants have been deprecated as of v8")]:[]}function Be(t){return t instanceof Number||t instanceof String||t instanceof Boolean}function Ve(t){return Be(t)?t.valueOf():t}function Te(t){if(Array.isArray(t))return t.map(Te);if(t instanceof Object&&!Be(t)){var e={};for(var r in t)e[r]=Te(t[r]);return e}return Ve(t)}function Ee(t){var e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=[],u=oe(r);if("object"!==u)return[new Pe(e,r,"object expected, "+u+" found")];for(var l in r){var p=l.split(".")[0],c=n[p]||n["*"],h=void 0;if(i[p])h=i[p];else if(n[p])h=ir;else if(i["*"])h=i["*"];else{if(!n["*"]){s.push(new Pe(e,r[l],'unknown property "'+l+'"'));continue}h=ir}s=s.concat(h({key:(e?e+".":e)+l,value:r[l],valueSpec:c,style:o,styleSpec:a,object:r,objectKey:l},r))}for(var f in n)i[f]||n[f].required&&void 0===n[f].default&&void 0===r[f]&&s.push(new Pe(e,r,'missing required property "'+f+'"'));return s}function Fe(t){var e=t.value,r=t.valueSpec,n=t.style,i=t.styleSpec,o=t.key,a=t.arrayElementValidator||ir;if("array"!==oe(e))return[new Pe(o,e,"array expected, "+oe(e)+" found")];if(r.length&&e.length!==r.length)return[new Pe(o,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.lengthn.maximum?[new Pe(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function Le(t){var e,r,n,i=t.valueSpec,o=Ve(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,l="array"===oe(t.value.stops)&&"array"===oe(t.value.stops[0])&&"object"===oe(t.value.stops[0][0]),p=Ee({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 Pe(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;e=e.concat(Fe({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:c})),"array"===oe(r)&&0===r.length&&e.push(new Pe(t.key,r,"array must have at least one stop"));return e},default:function(t){return ir({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&p.push(new Pe(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||p.push(new Pe(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!ie(t.valueSpec)&&p.push(new Pe(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!re(t.valueSpec)?p.push(new Pe(t.key,t.value,"property functions not supported")):s&&!ne(t.valueSpec)&&p.push(new Pe(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!l||void 0!==t.value.property||p.push(new Pe(t.key,t.value,'"property" property is required')),p;function c(t){var e=[],o=t.value,s=t.key;if("array"!==oe(o))return[new Pe(s,o,"array expected, "+oe(o)+" found")];if(2!==o.length)return[new Pe(s,o,"array length 2 expected, length "+o.length+" found")];if(l){if("object"!==oe(o[0]))return[new Pe(s,o,"object expected, "+oe(o[0])+" found")];if(void 0===o[0].zoom)return[new Pe(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new Pe(s,o,"object stop key must have value")];if(n&&n>Ve(o[0].zoom))return[new Pe(s,o[0].zoom,"stop zoom values must appear in ascending order")];Ve(o[0].zoom)!==n&&(n=Ve(o[0].zoom),r=void 0,a={}),e=e.concat(Ee({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Oe,value:h}}))}else e=e.concat(h({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return ye(Te(o[1]))?e.concat([new Pe(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(ir({key:s+"[1]",value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function h(t,n){var s=oe(t.value),u=Ve(t.value),l=null!==t.value?t.value:n;if(e){if(s!==e)return[new Pe(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 Pe(t.key,l,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var p="number expected, "+s+" found";return re(i)&&void 0===o&&(p+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Pe(t.key,l,p)]}return"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===s&&void 0!==r&&u=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,r=t.slice(1);ee?1:0}function Ze(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?Je(t[1],t[2],"=="):"!="===r?Xe(Je(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?Je(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(Ze))):"all"===r?["all"].concat(t.slice(1).map(Ze)):"none"===r?["all"].concat(t.slice(1).map(Ze).map(Xe)):"in"===r?Ke(t[1],t.slice(2)):"!in"===r?Xe(Ke(t[1],t.slice(2))):"has"===r?Ge(t[1]):"!has"!==r||Xe(Ge(t[1]))}function Je(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function Ke(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(Ne)]]:["filter-in-small",t,["literal",e]]}}function Ge(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Xe(t){return["!",t]}function Ye(t){return qe(Te(t.value))?De(S({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value;var n=e.key;if("array"!==oe(r))return[new Pe(n,r,"array expected, "+oe(r)+" found")];var i=e.styleSpec;var o;var a=[];if(r.length<1)return[new Pe(n,r,"filter array must have at least 1 element")];a=a.concat(je({key:n+"[0]",value:r[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec}));switch(Ve(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Ve(r[1])&&a.push(new Pe(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new Pe(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(o=oe(r[1]))&&a.push(new Pe(n+"[1]",r[1],"string expected, "+o+" found"));for(var s=2;s0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},fr.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var yr=ar,dr=yr.paintProperty,mr=yr.layoutProperty;var vr=function(){this.first=!0};vr.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom=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 xr(t){for(var e=0,r=t;e=65097&&t<=65103)||(!!gr["CJK Compatibility Ideographs"](t)||(!!gr["CJK Compatibility"](t)||(!!gr["CJK Radicals Supplement"](t)||(!!gr["CJK Strokes"](t)||(!(!gr["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||(!!gr["CJK Unified Ideographs Extension A"](t)||(!!gr["CJK Unified Ideographs"](t)||(!!gr["Enclosed CJK Letters and Months"](t)||(!!gr["Hangul Compatibility Jamo"](t)||(!!gr["Hangul Jamo Extended-A"](t)||(!!gr["Hangul Jamo Extended-B"](t)||(!!gr["Hangul Jamo"](t)||(!!gr["Hangul Syllables"](t)||(!!gr.Hiragana(t)||(!!gr["Ideographic Description Characters"](t)||(!!gr.Kanbun(t)||(!!gr["Kangxi Radicals"](t)||(!!gr["Katakana Phonetic Extensions"](t)||(!(!gr.Katakana(t)||12540===t)||(!(!gr["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)||(!(!gr["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(!!gr["Unified Canadian Aboriginal Syllabics"](t)||(!!gr["Unified Canadian Aboriginal Syllabics Extended"](t)||(!!gr["Vertical Forms"](t)||(!!gr["Yijing Hexagram Symbols"](t)||(!!gr["Yi Syllables"](t)||!!gr["Yi Radicals"](t))))))))))))))))))))))))))))))}function wr(t){return!(_r(t)||function(t){return!(!gr["Latin-1 Supplement"](t)||167!==t&&169!==t&&174!==t&&177!==t&&188!==t&&189!==t&&190!==t&&215!==t&&247!==t)||(!(!gr["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)||(!!gr["Letterlike Symbols"](t)||(!!gr["Number Forms"](t)||(!(!gr["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))||(!(!gr["Control Pictures"](t)||9251===t)||(!!gr["Optical Character Recognition"](t)||(!!gr["Enclosed Alphanumerics"](t)||(!!gr["Geometric Shapes"](t)||(!(!gr["Miscellaneous Symbols"](t)||t>=9754&&t<=9759)||(!(!gr["Miscellaneous Symbols and Arrows"](t)||!(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243))||(!!gr["CJK Symbols and Punctuation"](t)||(!!gr.Katakana(t)||(!!gr["Private Use Area"](t)||(!!gr["CJK Compatibility Forms"](t)||(!!gr["Small Form Variants"](t)||(!!gr["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 kr(t,e){return!(!e&&(t>=1424&&t<=2303||gr["Arabic Presentation Forms-A"](t)||gr["Arabic Presentation Forms-B"](t)))&&!(t>=2304&&t<=3583||t>=3840&&t<=4255||gr.Khmer(t))}self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date);var Sr={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return null!=Sr.applyArabicShaping}},Ar=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 vr,this.transition={})};Ar.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;rthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var zr=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(ae(t))return new xe(t,e);if(ye(t)){var r=ge(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=k.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};zr.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},zr.prototype.possiblyEvaluate=function(t){return this.property.possiblyEvaluate(this,t)};var Ir=function(t){this.property=t,this.value=new zr(t,void 0)};Ir.prototype.transitioned=function(t,e){return new Pr(this.property,this.value,e,a({},t.transition,this.transition),t.now)},Ir.prototype.untransitioned=function(){return new Pr(this.property,this.value,null,{},0)};var Mr=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};Mr.prototype.getValue=function(t){return c(this._values[t].value.value)},Mr.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Ir(this._values[t].property)),this._values[t].value=new zr(this._values[t].property,null===e?void 0:c(e))},Mr.prototype.getTransition=function(t){return c(this._values[t].transition)},Mr.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Ir(this._values[t].property)),this._values[t].transition=c(e)||void 0},Mr.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);ethis.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(e=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(i))}return r};var Cr=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};Cr.prototype.possiblyEvaluate=function(t){for(var e=new Tr(this._properties),r=0,n=Object.keys(this._values);rn.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(Fr),Lr=function(t){this.specification=t};Lr.prototype.possiblyEvaluate=function(t,e){if(void 0!==t.value){if("constant"===t.expression.kind){var r=t.expression.evaluate(e);return this._calculate(r,r,r,e)}return this._calculate(t.expression.evaluate(new Ar(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Ar(Math.floor(e.zoom),e)),t.expression.evaluate(new Ar(Math.floor(e.zoom+1),e)),e)}},Lr.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},Lr.prototype.interpolate=function(t){return t};var Dr=function(t){this.specification=t};Dr.prototype.possiblyEvaluate=function(t,e){return!!t.expression.evaluate(e)},Dr.prototype.interpolate=function(){return!1};var jr=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new zr(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new Ir(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};we("DataDrivenProperty",Fr),we("DataConstantProperty",Er),we("CrossFadedDataDrivenProperty",Or),we("CrossFadedProperty",Lr),we("ColorRampProperty",Dr);var qr=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,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),r.layout&&(this._unevaluatedLayout=new Br(r.layout)),r.paint)){for(var n in this._transitionablePaint=new Mr(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{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,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".layout."+t;if(this._validate(mr,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e},e.prototype.getPaintProperty=function(t){return l(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(dr,n,t,e,r))return!1}if(l(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"],a=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var u=this._transitionablePaint._values[t].value;return u.isDataDriven()||a||o||this._handleOverridablePaintPropertyUpdate(t,s,u)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&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 this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),function(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}(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,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&function(t,e){var r=!1;if(e&&e.length)for(var n=0,i=e;nthis.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)}},Nr.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};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._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(Nr);Kr.prototype.bytesPerElement=4,we("StructArrayLayout2i4",Kr);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,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=4*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,t},e}(Nr);Gr.prototype.bytesPerElement=8,we("StructArrayLayout4i8",Gr);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.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(Nr);Xr.prototype.bytesPerElement=12,we("StructArrayLayout2i4i12",Xr);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)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=4*t,u=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[u+4]=n,this.uint8[u+5]=i,this.uint8[u+6]=o,this.uint8[u+7]=a,t},e}(Nr);Yr.prototype.bytesPerElement=8,we("StructArrayLayout2i4ub8",Yr);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.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,o,a,s)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u){var l=8*t;return this.uint16[l+0]=e,this.uint16[l+1]=r,this.uint16[l+2]=n,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}(Nr);Hr.prototype.bytesPerElement=16,we("StructArrayLayout8ui16",Hr);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.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,o,a,s)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u){var l=8*t;return this.int16[l+0]=e,this.int16[l+1]=r,this.int16[l+2]=n,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}(Nr);Wr.prototype.bytesPerElement=16,we("StructArrayLayout4i4ui16",Wr);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.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}(Nr);$r.prototype.bytesPerElement=12,we("StructArrayLayout3f12",$r);var Qr=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;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint32[r+0]=e,t},e}(Nr);Qr.prototype.bytesPerElement=4,we("StructArrayLayout1ul4",Qr);var tn=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,r,n,i,o,a,s,u,l,p){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,o,a,s,u,l,p)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,p,c){var h=12*t,f=6*t;return this.int16[h+0]=e,this.int16[h+1]=r,this.int16[h+2]=n,this.int16[h+3]=i,this.int16[h+4]=o,this.int16[h+5]=a,this.uint32[f+3]=s,this.uint16[h+8]=u,this.uint16[h+9]=l,this.int16[h+10]=p,this.int16[h+11]=c,t},e}(Nr);tn.prototype.bytesPerElement=24,we("StructArrayLayout6i1ul2ui2i24",tn);var en=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,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(Nr);en.prototype.bytesPerElement=12,we("StructArrayLayout2i2i2i12",en);var rn=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,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[a+1]=n,this.float32[a+2]=i,t},e}(Nr);rn.prototype.bytesPerElement=12,we("StructArrayLayout2ub2f12",rn);var nn=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,r,n,i,o,a,s,u,l,p,c,h,f,y,d){var m=this.length;return this.resize(m+1),this.emplace(m,t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m){var v=22*t,g=11*t,x=44*t;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[g+2]=o,this.uint32[g+3]=a,this.uint32[g+4]=s,this.uint16[v+10]=u,this.uint16[v+11]=l,this.uint16[v+12]=p,this.float32[g+7]=c,this.float32[g+8]=h,this.uint8[x+36]=f,this.uint8[x+37]=y,this.uint8[x+38]=d,this.uint32[g+10]=m,t},e}(Nr);nn.prototype.bytesPerElement=44,we("StructArrayLayout2i2ui3ul3ui2f3ub1ul44",nn);var on=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,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m,v,g,x){var b=this.length;return this.resize(b+1),this.emplace(b,t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m,v,g,x)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m,v,g,x,b){var _=24*t,w=12*t;return this.int16[_+0]=e,this.int16[_+1]=r,this.int16[_+2]=n,this.int16[_+3]=i,this.int16[_+4]=o,this.int16[_+5]=a,this.uint16[_+6]=s,this.uint16[_+7]=u,this.uint16[_+8]=l,this.uint16[_+9]=p,this.uint16[_+10]=c,this.uint16[_+11]=h,this.uint16[_+12]=f,this.uint16[_+13]=y,this.uint16[_+14]=d,this.uint16[_+15]=m,this.uint16[_+16]=v,this.uint32[w+9]=g,this.float32[w+10]=x,this.float32[w+11]=b,t},e}(Nr);on.prototype.bytesPerElement=48,we("StructArrayLayout6i11ui1ul2f48",on);var an=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;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.float32[r+0]=e,t},e}(Nr);an.prototype.bytesPerElement=4,we("StructArrayLayout1f4",an);var sn=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,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}(Nr);sn.prototype.bytesPerElement=6,we("StructArrayLayout3i6",sn);var un=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,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=2*t,o=4*t;return this.uint32[i+0]=e,this.uint16[o+2]=r,this.uint16[o+3]=n,t},e}(Nr);un.prototype.bytesPerElement=8,we("StructArrayLayout1ul2ui8",un);var ln=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,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}(Nr);ln.prototype.bytesPerElement=6,we("StructArrayLayout3ui6",ln);var pn=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 r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(Nr);pn.prototype.bytesPerElement=4,we("StructArrayLayout2ui4",pn);var cn=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;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint16[r+0]=e,t},e}(Nr);cn.prototype.bytesPerElement=2,we("StructArrayLayout1ui2",cn);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._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(Nr);hn.prototype.bytesPerElement=8,we("StructArrayLayout2f8",hn);var fn=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,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=4*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.float32[o+3]=i,t},e}(Nr);fn.prototype.bytesPerElement=16,we("StructArrayLayout4f16",fn);var yn=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 r(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,n),e}(Rr);yn.prototype.size=24;var dn=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 yn(this,t)},e}(tn);we("CollisionBoxArray",dn);var mn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.glyphStartIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.numGlyphs.set=function(t){this._structArray.uint16[this._pos2+3]=t},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.vertexStartIndex.set=function(t){this._structArray.uint32[this._pos4+2]=t},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineStartIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.lineLength.set=function(t){this._structArray.uint32[this._pos4+4]=t},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.segment.set=function(t){this._structArray.uint16[this._pos2+10]=t},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.lowerSize.set=function(t){this._structArray.uint16[this._pos2+11]=t},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.upperSize.set=function(t){this._structArray.uint16[this._pos2+12]=t},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetX.set=function(t){this._structArray.float32[this._pos4+7]=t},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.lineOffsetY.set=function(t){this._structArray.float32[this._pos4+8]=t},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.writingMode.set=function(t){this._structArray.uint8[this._pos1+36]=t},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},Object.defineProperties(e.prototype,r),e}(Rr);mn.prototype.size=44;var vn=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 mn(this,t)},e}(nn);we("PlacedSymbolArray",vn);var gn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},radialTextOffset:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.rightJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+2]=t},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.centerJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+3]=t},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.leftJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+4]=t},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.verticalPlacedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+5]=t},r.key.get=function(){return this._structArray.uint16[this._pos2+6]},r.key.set=function(t){this._structArray.uint16[this._pos2+6]=t},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+7]},r.textBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+7]=t},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.verticalTextBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+10]=t},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.iconBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+11]=t},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+12]=t},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.featureIndex.set=function(t){this._structArray.uint16[this._pos2+13]=t},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+14]},r.numHorizontalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+14]=t},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+15]},r.numVerticalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+15]=t},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+16]},r.numIconVertices.set=function(t){this._structArray.uint16[this._pos2+16]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+9]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+9]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+10]},r.textBoxScale.set=function(t){this._structArray.float32[this._pos4+10]=t},r.radialTextOffset.get=function(){return this._structArray.float32[this._pos4+11]},r.radialTextOffset.set=function(t){this._structArray.float32[this._pos4+11]=t},Object.defineProperties(e.prototype,r),e}(Rr);gn.prototype.size=48;var xn=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 gn(this,t)},e}(on);we("SymbolInstanceArray",xn);var bn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={offsetX:{configurable:!0}};return r.offsetX.get=function(){return this._structArray.float32[this._pos4+0]},r.offsetX.set=function(t){this._structArray.float32[this._pos4+0]=t},Object.defineProperties(e.prototype,r),e}(Rr);bn.prototype.size=4;var _n=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 bn(this,t)},e}(an);we("GlyphOffsetArray",_n);var wn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={x:{configurable:!0},y:{configurable:!0},tileUnitDistanceFromAnchor:{configurable:!0}};return r.x.get=function(){return this._structArray.int16[this._pos2+0]},r.x.set=function(t){this._structArray.int16[this._pos2+0]=t},r.y.get=function(){return this._structArray.int16[this._pos2+1]},r.y.set=function(t){this._structArray.int16[this._pos2+1]=t},r.tileUnitDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+2]},r.tileUnitDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+2]=t},Object.defineProperties(e.prototype,r),e}(Rr);wn.prototype.size=6;var kn=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 wn(this,t)},e}(sn);we("SymbolLineVertexArray",kn);var Sn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.featureIndex.set=function(t){this._structArray.uint32[this._pos4+0]=t},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+3]=t},Object.defineProperties(e.prototype,r),e}(Rr);Sn.prototype.size=8;var An=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 Sn(this,t)},e}(un);we("FeatureIndexArray",An);var zn=Zr([{name:"a_pos",components:2,type:"Int16"}],4).members,In=function(t){void 0===t&&(t=[]),this.segments=t};function Mn(t,e){return 256*(t=i(Math.floor(t),0,255))+(e=i(Math.floor(e),0,255))}In.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>In.MAX_VERTEX_ARRAY_LENGTH&&f("Max vertices per segment is "+In.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>In.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},In.prototype.get=function(){return this.segments},In.prototype.destroy=function(){for(var t=0,e=this.segments;t>1;this.ids[n]>=t?r=n:e=n+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},Pn.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,i){if(n>=i)return;var o=e[n+i>>1];var a=n-1;var s=i+1;for(;;){do{a++}while(e[a]o);if(a>=s)break;Cn(e,a,s),Cn(r,3*a,3*s),Cn(r,3*a+1,3*s+1),Cn(r,3*a+2,3*s+2)}t(e,r,n,s);t(e,r,s+1,i)}(r,n,0,r.length-1),e.push(r.buffer,n.buffer),{ids:r,positions:n}},Pn.deserialize=function(t){var e=new Pn;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e},we("FeaturePositionMap",Pn);var Bn=function(t,e){this.gl=t.gl,this.location=e},Vn=(function(t){function e(e,r){t.call(this,e,r),this.current=0}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))}}(Bn),function(t){function e(e,r){t.call(this,e,r),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}(Bn)),Tn=(function(t){function e(e,r){t.call(this,e,r),this.current=[0,0]}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]))}}(Bn),function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0]}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]))}}(Bn),function(t){function e(e,r){t.call(this,e,r),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}(Bn)),En=function(t){function e(e,r){t.call(this,e,r),this.current=k.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}(Bn),Fn=new Float32Array(16);!function(t){function e(e,r){t.call(this,e,r),this.current=Fn}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}}}(Bn);function On(t){return[Mn(255*t.r,255*t.g),Mn(255*t.b,255*t.a)]}var Ln=function(t,e,r){this.value=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t})),this.type=r,this.maxValue=-1/0};Ln.prototype.defines=function(){return this.names.map((function(t){return"#define HAS_UNIFORM_u_"+t}))},Ln.prototype.setConstantPatternPositions=function(){},Ln.prototype.populatePaintArray=function(){},Ln.prototype.updatePaintArray=function(){},Ln.prototype.upload=function(){},Ln.prototype.destroy=function(){},Ln.prototype.setUniforms=function(t,e,r,n){e.set(n.constantOr(this.value))},Ln.prototype.getBinding=function(t,e){return"color"===this.type?new En(t,e):new Vn(t,e)},Ln.serialize=function(t){var e=t.value,r=t.names,n=t.type;return{value:Se(e),names:r,type:n}},Ln.deserialize=function(t){var e=t.value,r=t.names,n=t.type;return new Ln(Ae(e),r,n)};var Dn=function(t,e,r){this.value=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t})),this.type=r,this.maxValue=-1/0,this.patternPositions={patternTo:null,patternFrom:null}};Dn.prototype.defines=function(){return this.names.map((function(t){return"#define HAS_UNIFORM_u_"+t}))},Dn.prototype.populatePaintArray=function(){},Dn.prototype.updatePaintArray=function(){},Dn.prototype.upload=function(){},Dn.prototype.destroy=function(){},Dn.prototype.setConstantPatternPositions=function(t,e){this.patternPositions.patternTo=t.tlbr,this.patternPositions.patternFrom=e.tlbr},Dn.prototype.setUniforms=function(t,e,r,n,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)},Dn.prototype.getBinding=function(t,e){return new Tn(t,e)};var jn=function(t,e,r,n){this.expression=t,this.names=e,this.type=r,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"===r?2:1,offset:0}})),this.paintVertexArray=new n};jn.prototype.defines=function(){return[]},jn.prototype.setConstantPatternPositions=function(){},jn.prototype.populatePaintArray=function(t,e,r,n){var i=this.paintVertexArray,o=i.length;i.reserve(t);var a=this.expression.evaluate(new Ar(0),e,{},n);if("color"===this.type)for(var s=On(a),u=o;uXn.max||s.yXn.max)&&(f("Geometry exceeds allowed extent, reduce your vector tile buffer size"),s.x=i(s.x,Xn.min,Xn.max),s.y=i(s.y,Xn.min,Xn.max))}return r}function Hn(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var Wn=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 Kr,this.indexArray=new ln,this.segments=new In,this.programConfigurations=new Nn(zn,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function $n(t,e){for(var r=0;r1){if(ri(t,e))return!0;for(var n=0;n1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function ai(t,e){for(var r,n,i,o=!1,a=0;ae.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(o=!o);return o}function si(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function ui(t,e,r){var n=r[0],i=r[2];if(t.xi.x&&e.x>i.x||t.yi.y&&e.y>i.y)return!1;var o=y(t,e,r[0]);return o!==y(t,e,r[1])||o!==y(t,e,r[2])||o!==y(t,e,r[3])}function li(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).binders[t].maxValue}function pi(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ci(t,e,n,i,o){if(!e[0]&&!e[1])return t;var a=r.convert(e)._mult(o);"viewport"===n&&a._rotate(-i);for(var s=[],u=0;u=Kn||l<0||l>=Kn)){var p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),c=p.vertexLength;Hn(this.layoutVertexArray,u,l,-1,-1),Hn(this.layoutVertexArray,u,l,1,-1),Hn(this.layoutVertexArray,u,l,1,1),Hn(this.layoutVertexArray,u,l,-1,1),this.indexArray.emplaceBack(c,c+1,c+2),this.indexArray.emplaceBack(c,c+3,c+2),p.vertexLength+=4,p.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{})},we("CircleBucket",Wn,{omit:["layers"]});var hi=new jr({"circle-sort-key":new Fr(Me.layout_circle["circle-sort-key"])}),fi={paint:new jr({"circle-radius":new Fr(Me.paint_circle["circle-radius"]),"circle-color":new Fr(Me.paint_circle["circle-color"]),"circle-blur":new Fr(Me.paint_circle["circle-blur"]),"circle-opacity":new Fr(Me.paint_circle["circle-opacity"]),"circle-translate":new Er(Me.paint_circle["circle-translate"]),"circle-translate-anchor":new Er(Me.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Er(Me.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Er(Me.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Fr(Me.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Fr(Me.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Fr(Me.paint_circle["circle-stroke-opacity"])}),layout:hi},yi="undefined"!=typeof Float32Array?Float32Array:Array;function di(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});mi=new yi(4),yi!=Float32Array&&(mi[0]=0,mi[1]=0,mi[2]=0,mi[3]=0),vi=mi;var mi,vi,gi=function(t){function e(e){t.call(this,e,fi)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Wn(t)},e.prototype.queryRadius=function(t){var e=t;return li("circle-radius",this,e)+li("circle-stroke-width",this,e)+pi(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a,s){for(var u=ci(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),l=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),p="map"===this.paint.get("circle-pitch-alignment"),c=p?u:function(t,e){return t.map((function(t){return xi(t,e)}))}(u,s),h=p?l*a:l,f=0,y=n;ft.width||i.height>t.height||r.x>t.width-i.width||r.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||n.x>e.width-i.width||n.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;u80*r){n=o=t[0],i=a=t[1];for(var y=r;yo&&(o=s),u>a&&(a=u);l=0!==(l=Math.max(o-n,a-i))?1/l:0}return Li(h,f,r,n,i,l),f}function Fi(t,e,r,n,i){var o,a;if(i===oo(t,e,r,n)>0)for(o=e;o=e;o-=n)a=ro(o,t[o],t[o+1],a);return a&&Hi(a,a.next)&&(no(a),a=a.next),a}function Oi(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!Hi(n,n.next)&&0!==Yi(n.prev,n,n.next))n=n.next;else{if(no(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function Li(t,e,r,n,i,o,a){if(t){!a&&o&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=Ji(i.x,i.y,e,r,n)),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,r,n,i,o,a,s,u,l=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e0||u>0&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,l*=2}while(a>1)}(i)}(t,n,i,o);for(var s,u,l=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?ji(t,n,i,o):Di(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),no(t),t=u.next,l=u.next;else if((t=u)===l){a?1===a?Li(t=qi(Oi(t),e,r),e,r,n,i,o,2):2===a&&Ui(t,e,r,n,i,o):Li(Oi(t),e,r,n,i,o,1);break}}}function Di(t){var e=t.prev,r=t,n=t.next;if(Yi(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Gi(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&Yi(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function ji(t,e,r,n){var i=t.prev,o=t,a=t.next;if(Yi(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,p=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,c=Ji(s,u,e,r,n),h=Ji(l,p,e,r,n),f=t.prevZ,y=t.nextZ;f&&f.z>=c&&y&&y.z<=h;){if(f!==t.prev&&f!==t.next&&Gi(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Yi(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,y!==t.prev&&y!==t.next&&Gi(i.x,i.y,o.x,o.y,a.x,a.y,y.x,y.y)&&Yi(y.prev,y,y.next)>=0)return!1;y=y.nextZ}for(;f&&f.z>=c;){if(f!==t.prev&&f!==t.next&&Gi(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Yi(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;y&&y.z<=h;){if(y!==t.prev&&y!==t.next&&Gi(i.x,i.y,o.x,o.y,a.x,a.y,y.x,y.y)&&Yi(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function qi(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!Hi(i,o)&&Wi(i,n,n.next,o)&&to(i,o)&&to(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),no(n),no(n.next),n=t=o),n=n.next}while(n!==t);return Oi(n)}function Ui(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Xi(a,s)){var u=eo(a,s);return a=Oi(a,a.next),u=Oi(u,u.next),Li(a,e,r,n,i,o),void Li(u,e,r,n,i,o)}s=s.next}a=a.next}while(a!==t)}function Ri(t,e){return t.x-e.x}function Ni(t,e){if(e=function(t,e){var r,n=e,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=p&&i!==n.x&&Gi(or.x||n.x===r.x&&Zi(r,n)))&&(r=n,h=u)),n=n.next}while(n!==l);return r}(t,e)){var r=eo(e,t);Oi(r,r.next)}}function Zi(t,e){return Yi(t.prev,t,e.prev)<0&&Yi(e.next,t,t.next)<0}function Ji(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Ki(t){var e=t,r=t;do{(e.x=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function Xi(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Wi(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(to(t,e)&&to(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(Yi(t.prev,t,e.prev)||Yi(t,e.prev,e))||Hi(t,e)&&Yi(t.prev,t,t.next)>0&&Yi(e.prev,e,e.next)>0)}function Yi(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Hi(t,e){return t.x===e.x&&t.y===e.y}function Wi(t,e,r,n){var i=Qi(Yi(t,e,r)),o=Qi(Yi(t,e,n)),a=Qi(Yi(r,n,t)),s=Qi(Yi(r,n,e));return i!==o&&a!==s||(!(0!==i||!$i(t,r,e))||(!(0!==o||!$i(t,n,e))||(!(0!==a||!$i(r,t,n))||!(0!==s||!$i(r,e,n)))))}function $i(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Qi(t){return t>0?1:t<0?-1:0}function to(t,e){return Yi(t.prev,t,t.next)<0?Yi(t,e,t.next)>=0&&Yi(t,t.prev,e)>=0:Yi(t,e,t.prev)<0||Yi(t,t.next,e)<0}function eo(t,e){var r=new io(t.i,t.x,t.y),n=new io(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function ro(t,e,r,n){var i=new io(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function no(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 io(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function oo(t,e,r,n){for(var i=0,o=e,a=r-n;on;){if(i-n>600){var a=i-n+1,s=r-n+1,u=Math.log(a),l=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*l*(a-l)/a)*(s-a/2<0?-1:1),c=Math.max(n,Math.floor(r-s*l/a+p)),h=Math.min(i,Math.floor(r+(a-s)*l/a+p));t(e,r,c,h,o)}var f=e[r],y=n,d=i;for(so(e,n,r),o(e[i],f)>0&&so(e,n,i);y0;)d--}0===o(e[n],f)?so(e,n,d):so(e,++d,i),d<=r&&(n=d+1),r<=d&&(i=d-1)}}(t,e,r||0,n||t.length-1,i||uo)}function so(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function uo(t,e){return te?1:0}function lo(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,o=[],a=0;a1)for(var u=0;u0&&(n+=t[i-1].length,r.holes.push(n))}return r},Vi.default=Ti;var fo=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.patternFeatures=[],this.layoutVertexArray=new Kr,this.indexArray=new ln,this.indexArray2=new pn,this.programConfigurations=new Nn(Bi,t.layers,t.zoom),this.segments=new In,this.segments2=new In,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};fo.prototype.populate=function(t,e){this.hasPattern=co("fill",this.layers,e);for(var r=this.layers[0].layout.get("fill-sort-key"),n=[],i=0,o=t;i>3}if(o--,1===i||2===i)a+=t.readSVarint(),s+=t.readSVarint(),1===i&&(e&&u.push(e),e=[]),e.push(new r(a,s));else{if(7!==i)throw new Error("unknown command "+i);e&&e.push(e[0].clone())}}return e&&u.push(e),u},bo.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,l=-1/0;t.pos>3}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(o+=t.readSVarint())l&&(l=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,u,s,l]},bo.prototype.toGeoJSON=function(t,e,r){var n,i,o=this.extent*Math.pow(2,r),a=this.extent*t,s=this.extent*e,u=this.loadGeometry(),l=bo.types[this.type];function p(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}function zo(t,e,r){if(3===t){var n=new ko(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}So.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 Io={VectorTile:function(t,e){this.layers=t.readFields(zo,{},e)},VectorTileFeature:xo,VectorTileLayer:ko},Mo=Io.VectorTileFeature.types,Po=Math.pow(2,13);function Co(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,2*Math.floor(n*Po)+a,i*Po*2,o*Po*2,Math.round(s))}var Bo=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 Xr,this.indexArray=new ln,this.programConfigurations=new Nn(go,t.layers,t.zoom),this.segments=new In,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Vo(t,e){return t.x===e.x&&(t.x<0||t.x>Kn)||t.y===e.y&&(t.y<0||t.y>Kn)}function To(t){return t.every((function(t){return t.x<0}))||t.every((function(t){return t.x>Kn}))||t.every((function(t){return t.y<0}))||t.every((function(t){return t.y>Kn}))}Bo.prototype.populate=function(t,e){this.features=[],this.hasPattern=co("fill-extrusion",this.layers,e);for(var r=0,n=t;r=1){var v=f[d-1];if(!Vo(m,v)){p.vertexLength+4>In.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var g=m.sub(v)._perp()._unit(),x=v.dist(m);y+x>32768&&(y=0),Co(this.layoutVertexArray,m.x,m.y,g.x,g.y,0,0,y),Co(this.layoutVertexArray,m.x,m.y,g.x,g.y,0,1,y),y+=x,Co(this.layoutVertexArray,v.x,v.y,g.x,g.y,0,0,y),Co(this.layoutVertexArray,v.x,v.y,g.x,g.y,0,1,y);var b=p.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),p.vertexLength+=4,p.primitiveLength+=2}}}}if(p.vertexLength+s>In.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray)),"Polygon"===Mo[t.type]){for(var _=[],w=[],k=p.vertexLength,S=0,A=a;S=2&&t[p-1].equals(t[p-2]);)p--;for(var c=0;c0;if(A&&x>c){var I=h.dist(d);if(I>2*f){var M=h.sub(h.sub(d)._mult(f/I)._round());this.updateDistance(d,M),this.addCurrentVertex(M,v,0,0,y),d=M}}var P=d&&m,C=P?r:l?"butt":n;if(P&&"round"===C&&(ki&&(C="bevel"),"bevel"===C&&(k>2&&(C="flipbevel"),k100)b=g.mult(-1);else{var B=k*v.add(g).mag()/v.sub(g).mag();b._perp()._mult(B*(z?-1:1))}this.addCurrentVertex(h,b,0,0,y),this.addCurrentVertex(h,b.mult(-1),0,0,y)}else if("bevel"===C||"fakeround"===C){var V=-Math.sqrt(k*k-1),T=z?V:0,E=z?0:V;if(d&&this.addCurrentVertex(h,v,T,E,y),"fakeround"===C)for(var F=Math.round(180*S/Math.PI/20),O=1;O2*f){var R=h.add(m.sub(h)._mult(f/U)._round());this.updateDistance(h,R),this.addCurrentVertex(R,g,0,0,y),h=R}}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,s)}},Ro.prototype.addCurrentVertex=function(t,e,r,n,i,o){void 0===o&&(o=!1);var a=e.x+e.y*r,s=e.y-e.x*r,u=-e.x+e.y*n,l=-e.y-e.x*n;this.addHalfVertex(t,a,s,o,!1,r,i),this.addHalfVertex(t,u,l,o,!0,-n,i),this.distance>Uo/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,o))},Ro.prototype.addHalfVertex=function(t,e,r,n,i,o,a){var s=t.x,u=t.y,l=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(u<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===o?0:o<0?-1:1)|(63&l)<<2,l>>6);var p=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,p),a.primitiveLength++),i?this.e2=p:this.e1=p},Ro.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(Uo-1):this.distance},we("LineBucket",Ro,{omit:["layers","patternFeatures"]});var No=new jr({"line-cap":new Er(Me.layout_line["line-cap"]),"line-join":new Fr(Me.layout_line["line-join"]),"line-miter-limit":new Er(Me.layout_line["line-miter-limit"]),"line-round-limit":new Er(Me.layout_line["line-round-limit"]),"line-sort-key":new Fr(Me.layout_line["line-sort-key"])}),Zo={paint:new jr({"line-opacity":new Fr(Me.paint_line["line-opacity"]),"line-color":new Fr(Me.paint_line["line-color"]),"line-translate":new Er(Me.paint_line["line-translate"]),"line-translate-anchor":new Er(Me.paint_line["line-translate-anchor"]),"line-width":new Fr(Me.paint_line["line-width"]),"line-gap-width":new Fr(Me.paint_line["line-gap-width"]),"line-offset":new Fr(Me.paint_line["line-offset"]),"line-blur":new Fr(Me.paint_line["line-blur"]),"line-dasharray":new Lr(Me.paint_line["line-dasharray"]),"line-pattern":new Or(Me.paint_line["line-pattern"]),"line-gradient":new Dr(Me.paint_line["line-gradient"])}),layout:No},Jo=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,r){return r=new Ar(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=a({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(Fr))(Zo.paint.properties["line-width"].specification);Jo.useIntegerZoom=!0;var Ko=function(t){function e(e){t.call(this,e,Zo)}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=Ii(t,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e),this.paint._values["line-floorwidth"]=Jo.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Ro(t)},e.prototype.queryRadius=function(t){var e=t,r=Go(li("line-width",this,e),li("line-gap-width",this,e)),n=li("line-offset",this,e);return r/2+Math.abs(n)+pi(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,i,o,a,s){var u=ci(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),l=s/2*Go(this.paint.get("line-width").evaluate(e,n),this.paint.get("line-gap-width").evaluate(e,n)),p=this.paint.get("line-offset").evaluate(e,n);return p&&(i=function(t,e){for(var n=[],i=new r(0,0),o=0;o=3)for(var o=0;o0?e+2*t:t}var Xo=Zr([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}]),Yo=Zr([{name:"a_projected_pos",components:3,type:"Float32"}],4),Ho=(Zr([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Zr([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Wo=(Zr([{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"}]),Zr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),$o=Zr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);Zr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"}]),Zr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"radialTextOffset"}]),Zr([{type:"Float32",name:"offsetX"}]),Zr([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);function Qo(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),Sr.applyArabicShaping&&(t=Sr.applyArabicShaping(t)),t}(t.text,e,r)})),t}var ta={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var ea=24,ra={horizontal:1,vertical:2,horizontalOnly:3},na=function(){this.text="",this.sectionIndex=[],this.sections=[]};function ia(t,e,r,n,i,o,a,s,u,l,p){var c,h=na.fromFeature(t,r);l===ra.vertical&&h.verticalizePunctuation();var f=Sr.processBidirectionalText,y=Sr.processStyledBidirectionalText;if(f&&1===h.sections.length){c=[];for(var d=0,m=f(h.toString(),pa(h,s,n,e));d=0&&n>=t&&oa[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},na.prototype.substring=function(t,e){var r=new na;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},na.prototype.toString=function(){return this.text},na.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)};var oa={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},aa={};function sa(t,e,r,n){var i=Math.pow(t-e,2);return n?t=0,u=0,l=0;l0)&&("constant"!==i.value.kind||i.value.value.length>0),u="constant"!==a.value.kind||a.value.value&&a.value.value.length>0,l=n.get("symbol-sort-key");if(this.features=[],s||u){for(var p=e.iconDependencies,c=e.glyphDependencies,h=new Ar(this.zoom),f=0,y=t;f=0;for(var z=0,I=x.sections;z=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;u0;this.addCollisionDebugVertices(o,a,s,u,l?this.collisionCircle:this.collisionBox,i.anchorPoint,r,l)}},wa.prototype.generateCollisionDebugBuffers=function(){for(var t=0;t0},wa.prototype.hasIconData=function(){return this.icon.segments.get().length>0},wa.prototype.hasCollisionBoxData=function(){return this.collisionBox.segments.get().length>0},wa.prototype.hasCollisionCircleData=function(){return this.collisionCircle.segments.get().length>0},wa.prototype.addIndicesForPlacedTextSymbol=function(t){for(var e=this.text.placedSymbolArray.get(t),r=e.vertexStartIndex+4*e.numGlyphs,n=e.vertexStartIndex;n1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r=0&&n.indexOf(t)===r&&e.addIndicesForPlacedTextSymbol(t)})),o.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedTextSymbol(o.verticalPlacedTextSymbolIndex);var a=this.icon.placedSymbolArray.get(i);if(a.numGlyphs){var s=a.vertexStartIndex;this.icon.indexArray.emplaceBack(s,s+1,s+2),this.icon.indexArray.emplaceBack(s+1,s+2,s+3)}}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},we("SymbolBucket",wa,{omit:["layers","collisionBoxArray","features","compareText"]}),wa.MAX_GLYPHS=65535,wa.addDynamicAttributes=xa;var ka=new jr({"symbol-placement":new Er(Me.layout_symbol["symbol-placement"]),"symbol-spacing":new Er(Me.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Er(Me.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Fr(Me.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Er(Me.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Er(Me.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Er(Me.layout_symbol["icon-ignore-placement"]),"icon-optional":new Er(Me.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Er(Me.layout_symbol["icon-rotation-alignment"]),"icon-size":new Fr(Me.layout_symbol["icon-size"]),"icon-text-fit":new Er(Me.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Er(Me.layout_symbol["icon-text-fit-padding"]),"icon-image":new Fr(Me.layout_symbol["icon-image"]),"icon-rotate":new Fr(Me.layout_symbol["icon-rotate"]),"icon-padding":new Er(Me.layout_symbol["icon-padding"]),"icon-keep-upright":new Er(Me.layout_symbol["icon-keep-upright"]),"icon-offset":new Fr(Me.layout_symbol["icon-offset"]),"icon-anchor":new Fr(Me.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Er(Me.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Er(Me.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Er(Me.layout_symbol["text-rotation-alignment"]),"text-field":new Fr(Me.layout_symbol["text-field"]),"text-font":new Fr(Me.layout_symbol["text-font"]),"text-size":new Fr(Me.layout_symbol["text-size"]),"text-max-width":new Fr(Me.layout_symbol["text-max-width"]),"text-line-height":new Er(Me.layout_symbol["text-line-height"]),"text-letter-spacing":new Fr(Me.layout_symbol["text-letter-spacing"]),"text-justify":new Fr(Me.layout_symbol["text-justify"]),"text-radial-offset":new Fr(Me.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Er(Me.layout_symbol["text-variable-anchor"]),"text-anchor":new Fr(Me.layout_symbol["text-anchor"]),"text-max-angle":new Er(Me.layout_symbol["text-max-angle"]),"text-writing-mode":new Er(Me.layout_symbol["text-writing-mode"]),"text-rotate":new Fr(Me.layout_symbol["text-rotate"]),"text-padding":new Er(Me.layout_symbol["text-padding"]),"text-keep-upright":new Er(Me.layout_symbol["text-keep-upright"]),"text-transform":new Fr(Me.layout_symbol["text-transform"]),"text-offset":new Fr(Me.layout_symbol["text-offset"]),"text-allow-overlap":new Er(Me.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Er(Me.layout_symbol["text-ignore-placement"]),"text-optional":new Er(Me.layout_symbol["text-optional"])}),Sa={paint:new jr({"icon-opacity":new Fr(Me.paint_symbol["icon-opacity"]),"icon-color":new Fr(Me.paint_symbol["icon-color"]),"icon-halo-color":new Fr(Me.paint_symbol["icon-halo-color"]),"icon-halo-width":new Fr(Me.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Fr(Me.paint_symbol["icon-halo-blur"]),"icon-translate":new Er(Me.paint_symbol["icon-translate"]),"icon-translate-anchor":new Er(Me.paint_symbol["icon-translate-anchor"]),"text-opacity":new Fr(Me.paint_symbol["text-opacity"]),"text-color":new Fr(Me.paint_symbol["text-color"],{runtimeType:B,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new Fr(Me.paint_symbol["text-halo-color"]),"text-halo-width":new Fr(Me.paint_symbol["text-halo-width"]),"text-halo-blur":new Fr(Me.paint_symbol["text-halo-blur"]),"text-translate":new Er(Me.paint_symbol["text-translate"]),"text-translate-anchor":new Er(Me.paint_symbol["text-translate-anchor"])}),layout:ka},Aa=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:I,this.defaultValue=t};Aa.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},Aa.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},Aa.prototype.possibleOutputs=function(){return[void 0]},Aa.prototype.serialize=function(){return null},we("FormatSectionOverride",Aa,{omit:["defaultValue"]});var za=function(t){function e(e){t.call(this,e,Sa)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e){if(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")),"point"===this.layout.get("symbol-placement")){var r=this.layout.get("text-writing-mode");if(r){for(var n=[],i=0,o=r;i=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){f("Unable to write to LocalStorage")}},Ha.prototype.processRequests=function(t){},Ha.prototype.postEvent=function(t,e,r,n){var i=this;if(qa.EVENTS_URL){var o=function(t){var e=t.match(Xa);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("&"):[]}}(qa.EVENTS_URL);o.params.push("access_token="+(n||qa.ACCESS_TOKEN||""));var s,u,l={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.3.2",skuId:"01",userId:this.anonId},p=e?a(l,e):l,c={url:(s=o,u=s.params.length?"?"+s.params.join("&"):"",s.protocol+"://"+s.authority+s.path+u),headers:{"Content-Type":"text/plain"},body:JSON.stringify([p])};this.pendingRequest=hs(c,(function(t){i.pendingRequest=null,r(t),i.saveEventData(),i.processRequests(n)}))}},Ha.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var Wa,$a=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(qa.EVENTS_URL&&n||qa.ACCESS_TOKEN&&t.some((function(t){return Ja(t)||Ga(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),u(this.anonId)||(this.anonId=s()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}(Ha),Qa=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postTurnstileEvent=function(t,e){qa.EVENTS_URL&&qa.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return Ja(t)||Ga(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=Ya(qa.ACCESS_TOKEN),n=r?r.u:qa.ACCESS_TOKEN,i=n!==this.eventData.tokenU;u(this.anonId)||(this.anonId=s(),i=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),l=new Date(o),p=(o-this.eventData.lastSuccess)/864e5;i=i||p>=1||p<-1||a.getDate()!==l.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=o,e.eventData.tokenU=n)}),t)}},e}(Ha)),ts=(Qa.postTurnstileEvent.bind(Qa),new $a),es=(ts.postMapLoadEvent.bind(ts),"mapbox-tiles"),rs=42e4;function ns(t,e,r){if(self.caches){var n={status:e.status,statusText:e.statusText,headers:new self.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var i=m(e.headers.get("Cache-Control")||"");if(!i["no-store"])i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-rDate.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i)})).catch(e)})).catch(e)}"function"==typeof Object.freeze&&Object.freeze({Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"});var as=function(t){function e(e,r,n){401===r&&Ga(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,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 ss(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}var us=ss()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===self.location.protocol?self.parent:self).location.href};function ls(t,e){var r,n=new self.AbortController,i=new self.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:us(),signal:n.signal}),o=!1,a=!1,s=(r=i.url).indexOf("sku=")>0&&Ga(r);"json"===t.type&&i.headers.set("Accept","application/json");var u=function(r,n,o){if(!a){if(r&&"SecurityError"!==r.message&&f(r),n&&o)return l(n);var u=Date.now();self.fetch(i).then((function(r){if(r.ok){var n=s?r.clone():null;return l(r,n,u)}return e(new as(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},l=function(r,n,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){a||(n&&s&&ns(i,n,s),o=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){return e(new Error(t.message))}))};return s?os(i,u):u(null,null),{cancel:function(){a=!0,o||n.abort()}}}var ps=function(t,e){if(r=t.url,!(/^file:/.test(r)||/^file:/.test(us())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return ls(t,e);if(ss()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e)}var r;return function(t,e){var r=new self.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new as(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},cs=function(t,e){return ps(a(t,{type:"arrayBuffer"}),e)},hs=function(t,e){return ps(a(t,{method:"POST"}),e)},fs=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,p=-7,c=r?i-1:0,h=r?-1:1,f=t[e+c];for(c+=h,o=f&(1<<-p)-1,f>>=-p,p+=s;p>0;o=256*o+t[e+c],c+=h,p-=8);for(a=o&(1<<-p)-1,o>>=-p,p+=n;p>0;a=256*a+t[e+c],c+=h,p-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=l}return(f?-1:1)*a*Math.pow(2,o-n)},ys=function(t,e,r,n,i,o){var a,s,u,l=8*o-i-1,p=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,y=n?1:-1,d=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=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+c>=1?h/u:h*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=p?(s=0,a=p):a+c>=1?(s=(e*u-1)*Math.pow(2,i),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=y,s/=256,i-=8);for(a=a<0;t[r+f]=255&a,f+=y,a/=256,l-=8);t[r+f-y]|=128*d},ds=ms;function ms(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}ms.Varint=0,ms.Fixed64=1,ms.Bytes=2,ms.Fixed32=5;function vs(t){return t.type===ms.Bytes?t.readVarint()+t.pos:t.pos+1}function gs(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function xs(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function bs(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Bs(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}ms.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Ps(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Bs(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Ps(this.buf,this.pos)+4294967296*Ps(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Ps(this.buf,this.pos)+4294967296*Bs(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=fs(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=fs(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,o=r.buf;if(i=o[r.pos++],n=(112&i)>>4,i<128)return gs(t,n,e);if(i=o[r.pos++],n|=(127&i)<<3,i<128)return gs(t,n,e);if(i=o[r.pos++],n|=(127&i)<<10,i<128)return gs(t,n,e);if(i=o[r.pos++],n|=(127&i)<<17,i<128)return gs(t,n,e);if(i=o[r.pos++],n|=(127&i)<<24,i<128)return gs(t,n,e);if(i=o[r.pos++],n|=(1&i)<<31,i<128)return gs(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[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,r){var n="",i=e;for(;i239?4:u>223?3:u>191?2:1;if(i+p>r)break;1===p?u<128&&(l=u):2===p?128==(192&(o=t[i+1]))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===p?(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===p&&(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,p=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),i+=p}return n}(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){if(this.type!==ms.Bytes)return t.push(this.readVarint(e));var r=vs(this);for(t=t||[];this.pos127;);else if(e===ms.Bytes)this.pos=this.readVarint()+this.pos;else if(e===ms.Fixed32)this.pos+=4;else{if(e!==ms.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;e268435455||t<0?function(t,e){var r,n;t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;if(e.buf[e.pos++]|=r|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(n,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,r){for(var n,i,o=0;o55295&&n<57344){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&xs(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),ys(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),ys(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&xs(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,ms.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,bs,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,_s,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Ss,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,ws,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,ks,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,As,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,zs,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Is,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Ms,e)},writeBytesField:function(t,e){this.writeTag(t,ms.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,ms.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,ms.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,ms.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,ms.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,ms.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,ms.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,ms.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,ms.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,ms.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Vs=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Ls.prototype.wrap=function(){return new Ls((t=this.lng,(i=((t-(e=-180))%(n=(r=180)-e)+n)%n+e)===e?r:i),this.lat);var t,e,r,n,i},Ls.prototype.toArray=function(){return[this.lng,this.lat]},Ls.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Ls.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new Os(new Ls(this.lng-r,this.lat-e),new Ls(this.lng+r,this.lat+e))},Ls.convert=function(t){if(t instanceof Ls)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Ls(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Ls(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var Ds=2*Math.PI*6378137;function js(t){return Ds*Math.cos(t*Math.PI/180)}function qs(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}var Us=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};Us.fromLngLat=function(t,e){void 0===e&&(e=0);var r,n=Ls.convert(t);return new Us((180+n.lng)/360,(r=n.lat,(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),function(t,e){return t/js(e)}(e,n.lat))},Us.prototype.toLngLat=function(){return new Ls(360*this.x-180,qs(this.y))},Us.prototype.toAltitude=function(){return t=this.z,e=this.y,t*js(qs(e));var t,e},Us.prototype.meterInMercatorCoordinateUnits=function(){return 1/Ds*(t=qs(this.y),1/Math.cos(t*Math.PI/180));var t};var Rs=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Js(0,t,e,r)};Rs.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Rs.prototype.url=function(t,e){var r,n,i,o,a,s=(r=this.x,n=this.y,i=this.z,o=Fs(256*r,256*(n=Math.pow(2,i)-n-1),i),a=Fs(256*(r+1),256*(n+1),i),o[0]+","+o[1]+","+a[0]+","+a[1]),u=function(t,e,r){for(var n,i="",o=t;o>0;o--)i+=(e&(n=1<this.canonical.z?new Zs(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Zs(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Zs.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e},Zs.prototype.children=function(t){if(this.overscaledZ>=t)return[new Zs(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new Zs(e,this.wrap,e,r,n),new Zs(e,this.wrap,e,r+1,n),new Zs(e,this.wrap,e,r,n+1),new Zs(e,this.wrap,e,r+1,n+1)]},Zs.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y-r/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;sn;)l-=u.shift().angleDelta;if(l>i)return!1;a++,s+=c.dist(h)}return!0}function Hs(t){for(var e=0,r=0;rl){var y=(l-u)/f,d=pt(c.x,h.x,y),m=pt(c.y,h.y,y),v=new fa(d,m,h.angleTo(c),p);return v._round(),!a||Ys(t,v,s,a,e)?v:void 0}u+=f}}function tu(t,e,r,n,i,o,a,s,u){var l=Ws(n,o,a),p=$s(n,i),c=p*a,h=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return e-c=0&&_=0&&w=0&&f+p<=c){var k=new fa(_,w,x,d);k._round(),i&&!Ys(e,k,a,i,o)||y.push(k)}}h+=g}u||y.length||s||(y=t(e,h/2,n,i,o,a,s,!0,l));return y}(t,h?e/2*s%e:(p/2+2*o)*a*s%e,e,l,r,c,h,!1,u)}Ks.prototype.insert=function(t,e,r,n,i,o){var a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);for(var s=o?this.grid3D:this.grid,u=0;u=0&&p[3]>=0&&s.insert(a,p[0],p[1],p[2],p[3])}},Ks.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Io.VectorTile(new ds(this.rawTileData)).layers,this.sourceLayerCoder=new Vs(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Ks.prototype.query=function(t,e,n){var i=this;this.loadVTLayers();for(var o=t.params||{},a=Kn/t.tileSize/t.scale,s=Re(o.filter),u=t.queryGeometry,l=t.queryPadding*a,p=Gs(u),c=this.grid.query(p.minX-l,p.minY-l,p.maxX+l,p.maxY+l),h=Gs(t.cameraQueryGeometry),f=this.grid3D.query(h.minX-l,h.minY-l,h.maxX+l,h.maxY+l,(function(e,n,i,o){return function(t,e,n,i,o){for(var a=0,s=t;a=u.x&&o>=u.y)return!0}var l=[new r(e,n),new r(e,o),new r(i,o),new r(i,n)];if(t.length>2)for(var p=0,c=l;p=0)return!0;return!1}(o,u)){var l=this.sourceLayerCoder.decode(r),p=this.vtLayers[l].feature(n);if(i(new Ar(this.tileID.overscaledZ),p))for(var c=0;c0&&(v=Math.max(10*u,v),this._addLineCollisionCircles(t,e,n,n.segment,g,v,i,o,a,c))}else{if(h){var x=new r(d,f),b=new r(m,f),_=new r(d,y),w=new r(m,y),k=h*Math.PI/180;x._rotate(k),b._rotate(k),_._rotate(k),w._rotate(k),d=Math.min(x.x,b.x,_.x,w.x),m=Math.max(x.x,b.x,_.x,w.x),f=Math.min(x.y,b.y,_.y,w.y),y=Math.max(x.y,b.y,_.y,w.y)}t.emplaceBack(n.x,n.y,d,f,m,y,i,o,a,0,0)}this.boxEndIndex=t.length};ru.prototype._addLineCollisionCircles=function(t,e,r,n,i,o,a,s,u,l){var p=o/2,c=Math.floor(i/p)||1,h=1+.4*Math.log(l)/Math.LN2,f=Math.floor(c*h/2),y=-o/2,d=r,m=n+1,v=y,g=-i/2,x=g-i/4;do{if(--m<0){if(v>g)return;m=0;break}v-=e[m].dist(d),d=e[m]}while(v>x);for(var b=e[m].dist(e[m+1]),_=-f;_i&&(k+=w-i),!(k=e.length)return;b=e[m].dist(e[m+1])}var S=k-v,A=e[m],z=e[m+1].sub(A)._unit()._mult(S)._add(A)._round(),I=Math.abs(k-y)0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function iu(t,e){return te?1:0}function ou(t,e,n){void 0===e&&(e=1),void 0===n&&(n=!1);for(var i=1/0,o=1/0,a=-1/0,s=-1/0,u=t[0],l=0;la)&&(a=p.x),(!l||p.y>s)&&(s=p.y)}var c=a-i,h=s-o,f=Math.min(c,h),y=f/2,d=new nu([],au);if(0===f)return new r(i,o);for(var m=i;mg.d||!g.d)&&(g=b,n&&console.log("found best %d after %d probes",Math.round(1e4*b.d)/1e4,x)),b.max-g.d<=e||(y=b.h/2,d.push(new su(b.p.x-y,b.p.y-y,y,t)),d.push(new su(b.p.x+y,b.p.y-y,y,t)),d.push(new su(b.p.x-y,b.p.y+y,y,t)),d.push(new su(b.p.x+y,b.p.y+y,y,t)),x+=4)}return n&&(console.log("num probes: "+x),console.log("best distance: "+g.d)),g.p}function au(t,e){return e.max-t.max}function su(t,e,n,i){this.p=new r(t,e),this.h=n,this.d=function(t,e){for(var r=!1,n=1/0,i=0;it.y!=p.y>t.y&&t.x<(p.x-l.x)*(t.y-l.y)/(p.y-l.y)+l.x&&(r=!r),n=Math.min(n,oi(t,l,p))}return(r?1:-1)*Math.sqrt(n)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}nu.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},nu.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},nu.prototype.peek=function(){return this.data[0]},nu.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,o=e[i];if(r(n,o)>=0)break;e[t]=o,t=i}e[t]=n},nu.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=a,t=o}e[t]=i};var uu=_((function(t){t.exports=function(t,e){var r,n,i,o,a,s,u,l;for(r=3&t.length,n=t.length-r,i=e,a=3432918353,s=461845907,l=0;l>>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,r){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}})),lu=_((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,o=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++o;switch(n){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}})),pu=uu,cu=uu,hu=lu;pu.murmur3=cu,pu.murmur2=hu;var fu=7;function yu(t,e,n,i,o,a){t.createArrays();var s=512*t.overscaling;t.tilePixelRatio=Kn/s,t.compareText={},t.iconsNeedLinear=!1;var u=t.layers[0].layout,l=t.layers[0]._unevaluatedLayout._values,p={};if("composite"===t.textSizeData.kind){var c=t.textSizeData,h=c.minZoom,y=c.maxZoom;p.compositeTextSizes=[l["text-size"].possiblyEvaluate(new Ar(h)),l["text-size"].possiblyEvaluate(new Ar(y))]}if("composite"===t.iconSizeData.kind){var d=t.iconSizeData,m=d.minZoom,v=d.maxZoom;p.compositeIconSizes=[l["icon-size"].possiblyEvaluate(new Ar(m)),l["icon-size"].possiblyEvaluate(new Ar(v))]}p.layoutTextSize=l["text-size"].possiblyEvaluate(new Ar(t.zoom+1)),p.layoutIconSize=l["icon-size"].possiblyEvaluate(new Ar(t.zoom+1)),p.textMaxSize=l["text-size"].possiblyEvaluate(new Ar(18));for(var g=u.get("text-line-height")*ea,x="map"===u.get("text-rotation-alignment")&&"point"!==u.get("symbol-placement"),b=u.get("text-keep-upright"),_=function(){var a=k[w],s=u.get("text-font").evaluate(a,{}).join(","),l=n,c={horizontal:{},vertical:void 0},h=a.text,y=[0,0];if(h){var d=h.toString(),m=u.get("text-letter-spacing").evaluate(a,{})*ea,v=function(t){for(var e=0,r=t;e=Kn||l.y<0||l.y>=Kn||function(t,e,n,i,o,a,s,u,l,p,c,h,y,d,m,v,g,x,b,_,w){var k,S,A,z=t.addToLineVertexArray(e,n),I=0,M=0,P=0,C={},B=pu(""),V=(a.layout.get("text-radial-offset").evaluate(b,{})||0)*ea;if(t.allowVerticalPlacement&&i.vertical){var T=a.layout.get("text-rotate").evaluate(b,{})+90,E=i.vertical;A=new ru(s,n,e,u,l,p,E,c,h,y,t.overscaling,T)}for(var F in i.horizontal){var O=i.horizontal[F];if(!k){B=pu(O.text);var L=a.layout.get("text-rotate").evaluate(b,{});k=new ru(s,n,e,u,l,p,O,c,h,y,t.overscaling,L)}var D=1===O.lineCount;if(M+=vu(t,e,O,a,y,b,d,z,i.vertical?ra.horizontal:ra.horizontalOnly,D?Object.keys(i.horizontal):[F],C,_,w),D)break}i.vertical&&(P+=vu(t,e,i.vertical,a,y,b,d,z,ra.vertical,["vertical"],C,_,w));var j=k?k.boxStartIndex:t.collisionBoxArray.length,q=k?k.boxEndIndex:t.collisionBoxArray.length,U=A?A.boxStartIndex:t.collisionBoxArray.length,R=A?A.boxEndIndex:t.collisionBoxArray.length;if(o){var N=function(t,e,n,i,o,a){var s,u,l,p,c=e.image,h=n.layout,f=e.top-1/c.pixelRatio,y=e.left-1/c.pixelRatio,d=e.bottom+1/c.pixelRatio,m=e.right+1/c.pixelRatio;if("none"!==h.get("icon-text-fit")&&o){var v=m-y,g=d-f,x=h.get("text-size").evaluate(a,{})/24,b=o.left*x,_=o.right*x,w=o.top*x,k=_-b,S=o.bottom*x-w,A=h.get("icon-text-fit-padding")[0],z=h.get("icon-text-fit-padding")[1],I=h.get("icon-text-fit-padding")[2],M=h.get("icon-text-fit-padding")[3],P="width"===h.get("icon-text-fit")?.5*(S-g):0,C="height"===h.get("icon-text-fit")?.5*(k-v):0,B="width"===h.get("icon-text-fit")||"both"===h.get("icon-text-fit")?k:v,V="height"===h.get("icon-text-fit")||"both"===h.get("icon-text-fit")?S:g;s=new r(b+C-M,w+P-A),u=new r(b+C+z+B,w+P-A),l=new r(b+C+z+B,w+P+I+V),p=new r(b+C-M,w+P+I+V)}else s=new r(y,f),u=new r(m,f),l=new r(m,d),p=new r(y,d);var T=n.layout.get("icon-rotate").evaluate(a,{})*Math.PI/180;if(T){var E=Math.sin(T),F=Math.cos(T),O=[F,-E,E,F];s._matMult(O),u._matMult(O),p._matMult(O),l._matMult(O)}return[{tl:s,tr:u,bl:p,br:l,tex:c.paddedRect,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0}]}(0,o,a,0,gu(i.horizontal),b),Z=a.layout.get("icon-rotate").evaluate(b,{});S=new ru(s,n,e,u,l,p,o,m,v,!1,t.overscaling,Z),I=4*N.length;var J=t.iconSizeData,K=null;"source"===J.kind?(K=[ya*a.layout.get("icon-size").evaluate(b,{})])[0]>mu&&f(t.layerIds[0]+': Value for "icon-size" is >= 256. Reduce your "icon-size".'):"composite"===J.kind&&((K=[ya*w.compositeIconSizes[0].evaluate(b,{}),ya*w.compositeIconSizes[1].evaluate(b,{})])[0]>mu||K[1]>mu)&&f(t.layerIds[0]+': Value for "icon-size" is >= 256. Reduce your "icon-size".'),t.addSymbols(t.icon,N,K,x,g,b,!1,e,z.lineStartIndex,z.lineLength)}var G=S?S.boxStartIndex:t.collisionBoxArray.length,X=S?S.boxEndIndex:t.collisionBoxArray.length;t.glyphOffsetArray.length>=wa.MAX_GLYPHS&&f("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907");t.symbolInstances.emplaceBack(e.x,e.y,C.right>=0?C.right:-1,C.center>=0?C.center:-1,C.left>=0?C.left:-1,C.vertical||-1,B,j,q,U,R,G,X,u,M,P,I,0,c,V)}(t,l,u,n,i,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,m,b,k,s,g,_,S,h,e,o,a)};if("line"===A)for(var M=0,P=function(t,e,n,i,o){for(var a=[],s=0;s=i&&h.x>=i||(c.x>=i?c=new r(i,c.y+(h.y-c.y)*((i-c.x)/(h.x-c.x)))._round():h.x>=i&&(h=new r(i,c.y+(h.y-c.y)*((i-c.x)/(h.x-c.x)))._round()),c.y>=o&&h.y>=o||(c.y>=o?c=new r(c.x+(h.x-c.x)*((o-c.y)/(h.y-c.y)),o)._round():h.y>=o&&(h=new r(c.x+(h.x-c.x)*((o-c.y)/(h.y-c.y)),o)._round()),l&&c.equals(l[l.length-1])||(l=[c],a.push(l)),l.push(h)))))}return a}(e.geometry,0,0,Kn,Kn);M1){var j=Qs(D,w,n.vertical||y,i,24,v);j&&I(D,j)}}else if("Polygon"===e.type)for(var q=0,U=lo(e.geometry,0);qmu&&f(t.layerIds[0]+': Value for "text-size" is >= 256. Reduce your "text-size".'):"composite"===m.kind&&((v=[ya*y.compositeTextSizes[0].evaluate(a,{}),ya*y.compositeTextSizes[1].evaluate(a,{})])[0]>mu||v[1]>mu)&&f(t.layerIds[0]+': Value for "text-size" is >= 256. Reduce your "text-size".'),t.addSymbols(t.text,d,v,s,o,a,l,e,u.lineStartIndex,u.lineLength);for(var g=0,x=p;g=0;a--)if(n.dist(o[a])=0;h--){var f=a[h];if(!(c.w>f.w||c.h>f.h)){if(c.x=f.x,c.y=f.y,u=Math.max(u,c.y+c.h),s=Math.max(s,c.x+c.w),c.w===f.w&&c.h===f.h){var y=a.pop();h=z.maxzoom))if("none"!==z.visibility)zu(A,this.zoom),(y[z.id]=z.createBucket({index:s.bucketLayerIDs.length,layers:A,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:x,sourceID:this.source})).populate(b,d),s.bucketLayerIDs.push(A.map((function(t){return t.id})))}}}var I=p(d.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(I).length?r.send("getGlyphs",{uid:this.uid,stacks:I},(function(t,e){u||(u=t,l=e,C.call(i))})):l={};var M=Object.keys(d.iconDependencies);M.length?r.send("getImages",{icons:M},(function(t,e){u||(u=t,c=e,C.call(i))})):c={};var P=Object.keys(d.patternDependencies);function C(){if(u)return n(u);if(l&&c&&h){var t=new Su(l),e=new ku(c,h);for(var r in y){var i=y[r];i instanceof wa?(zu(i.layers,this.zoom),yu(i,l,t.positions,c,e.iconPositions,this.showCollisionBoxes)):i.hasPattern&&(i instanceof Ro||i instanceof fo||i instanceof Bo)&&(zu(i.layers,this.zoom),i.addFeatures(d,e.patternPositions))}this.status="done",n(null,{buckets:o(y).filter((function(t){return!t.isEmpty()})),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:e,glyphMap:this.returnDependencies?l:null,iconMap:this.returnDependencies?c:null,glyphPositions:this.returnDependencies?t.positions:null})}}P.length?r.send("getImages",{icons:P},(function(t,e){u||(u=t,h=e,C.call(i))})):h={},C.call(this)};var Iu="undefined"!=typeof performance,Mu={getEntriesByName:function(t){return!!(Iu&&performance&&performance.getEntriesByName)&&performance.getEntriesByName(t)},mark:function(t){return!!(Iu&&performance&&performance.mark)&&performance.mark(t)},measure:function(t,e,r){return!!(Iu&&performance&&performance.measure)&&performance.measure(t,e,r)},clearMarks:function(t){return!!(Iu&&performance&&performance.clearMarks)&&performance.clearMarks(t)},clearMeasures:function(t){return!!(Iu&&performance&&performance.clearMeasures)&&performance.clearMeasures(t)}},Pu=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},Mu.mark(this._marks.start)};function Cu(t,e){var r=cs(t.request,(function(t,r,n,i){t?e(t):r&&e(null,{vectorTile:new Io.VectorTile(new ds(r)),rawData:r,cacheControl:n,expires:i})}));return function(){r.cancel(),e()}}Pu.prototype.finish=function(){Mu.mark(this._marks.end);var t=Mu.getEntriesByName(this._marks.measure);return 0===t.length&&(Mu.measure(this._marks.measure,this._marks.start,this._marks.end),t=Mu.getEntriesByName(this._marks.measure),Mu.clearMarks(this._marks.start),Mu.clearMarks(this._marks.end),Mu.clearMeasures(this._marks.measure)),t},Mu.Performance=Pu;var Bu=function(t,e,r){this.actor=t,this.layerIndex=e,this.loadVectorData=r||Cu,this.loading={},this.loaded={}};Bu.prototype.loadTile=function(t,e){var r=this,n=t.uid;this.loading||(this.loading={});var i=!!(t&&t.request&&t.request.collectResourceTiming)&&new Mu.Performance(t.request),o=this.loading[n]=new Au(t);o.abort=this.loadVectorData(t,(function(t,s){if(delete r.loading[n],t||!s)return o.status="done",r.loaded[n]=o,e(t);var u=s.rawData,l={};s.expires&&(l.expires=s.expires),s.cacheControl&&(l.cacheControl=s.cacheControl);var p={};if(i){var c=i.finish();c&&(p.resourceTiming=JSON.parse(JSON.stringify(c)))}o.vectorTile=s.vectorTile,o.parse(s.vectorTile,r.layerIndex,r.actor,(function(t,r){if(t||!r)return e(t);e(null,a({rawTileData:u.slice(0)},r,l,p))})),r.loaded=r.loaded||{},r.loaded[n]=o}))},Bu.prototype.reloadTile=function(t,e){var r=this.loaded,n=t.uid,i=this;if(r&&r[n]){var o=r[n];o.showCollisionBoxes=t.showCollisionBoxes;var a=function(t,r){var n=o.reloadCallback;n&&(delete o.reloadCallback,o.parse(o.vectorTile,i.layerIndex,i.actor,n)),e(t,r)};"parsing"===o.status?o.reloadCallback=a:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.actor,a):a())}},Bu.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},Bu.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var Vu=function(t,e,r){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return f('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');var n=this.dim=e.height;this.stride=this.dim+2,this.data=new Int32Array(this.stride*this.stride);for(var i=e.data,o="terrarium"===r?this._unpackTerrarium:this._unpackMapbox,a=0;a=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},Vu.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Vu.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Vu.prototype.getPixels=function(){return new Ai({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Vu.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,o=r*this.dim,a=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:o=a-1;break;case 1:a=o+1}for(var s=-e*this.dim,u=-r*this.dim,l=o;l0){e+=Math.abs(Ou(t[0]));for(var r=1;r2){for(a=0;a=0}(t)===e?t:t.reverse()}var Nu=Io.VectorTileFeature.prototype.toGeoJSON,Zu=function(t){this._feature=t,this.extent=Kn,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))};Zu.prototype.loadGeometry=function(){if(1===this._feature.type){for(var t=[],e=0,n=this._feature.geometry;e>31}function al(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,o=0,a=r.length,s=0;s>1;!function t(e,r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,l=Math.log(s),p=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*p*(s-p)/s)*(u-s/2<0?-1:1),h=Math.max(i,Math.floor(n-u*p/s+c)),f=Math.min(o,Math.floor(n+(s-u)*p/s+c));t(e,r,n,h,f,a)}var y=r[2*n+a],d=i,m=o;for(ll(e,r,i,n),r[2*o+a]>y&&ll(e,r,i,o);dy;)m--}r[2*i+a]===y?ll(e,r,i,m):ll(e,r,++m,o),m<=n&&(i=m+1),n<=m&&(o=m-1)}}(t,e,a,n,i,o%2),ul(t,e,r,n,a-1,o+1),ul(t,e,r,a+1,i,o+1)}}function ll(t,e,r,n){pl(t,r,n),pl(e,2*r,2*n),pl(e,2*r+1,2*n+1)}function pl(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function cl(t,e,r,n){var i=t-r,o=e-n;return i*i+o*o}Hu.fromVectorTileJs=Wu,Hu.fromGeojsonVt=$u,Hu.GeoJSONWrapper=Qu;var hl=function(t){return t[0]},fl=function(t){return t[1]},yl=function(t,e,r,n,i){void 0===e&&(e=hl),void 0===r&&(r=fl),void 0===n&&(n=64),void 0===i&&(i=Float64Array),this.nodeSize=n,this.points=t;for(var o=t.length<65536?Uint16Array:Uint32Array,a=this.ids=new o(t.length),s=this.coords=new i(2*t.length),u=0;u=r&&s<=i&&u>=n&&u<=o&&p.push(t[y]);else{var d=Math.floor((f+h)/2);s=e[2*d],u=e[2*d+1],s>=r&&s<=i&&u>=n&&u<=o&&p.push(t[d]);var m=(c+1)%2;(0===c?r<=s:n<=u)&&(l.push(f),l.push(d-1),l.push(m)),(0===c?i>=s:o>=u)&&(l.push(d+1),l.push(h),l.push(m))}}return p}(this.ids,this.coords,t,e,r,n,this.nodeSize)},yl.prototype.within=function(t,e,r){return function(t,e,r,n,i,o){for(var a=[0,t.length-1,0],s=[],u=i*i;a.length;){var l=a.pop(),p=a.pop(),c=a.pop();if(p-c<=o)for(var h=c;h<=p;h++)cl(e[2*h],e[2*h+1],r,n)<=u&&s.push(t[h]);else{var f=Math.floor((c+p)/2),y=e[2*f],d=e[2*f+1];cl(y,d,r,n)<=u&&s.push(t[f]);var m=(l+1)%2;(0===l?r-i<=y:n-i<=d)&&(a.push(c),a.push(f-1),a.push(m)),(0===l?r+i>=y:n+i>=d)&&(a.push(f+1),a.push(p),a.push(m))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var dl={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,map:function(t){return t}},ml=function(t){this.options=kl(Object.create(dl),t),this.trees=new Array(this.options.maxZoom+1)};function vl(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function gl(t,e){var r=t.geometry.coordinates,n=r[0],i=r[1];return{x:_l(n),y:wl(i),zoom:1/0,index:e,parentId:-1}}function xl(t){return{type:"Feature",id:t.id,properties:bl(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function bl(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return kl(kl({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function _l(t){return t/360+.5}function wl(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function kl(t,e){for(var r in e)t[r]=e[r];return t}function Sl(t){return t.x}function Al(t){return t.y}function zl(t,e,r,n,i,o){var a=i-r,s=o-n;if(0!==a||0!==s){var u=((t-r)*a+(e-n)*s)/(a*a+s*s);u>1?(r=i,n=o):u>0&&(r+=a*u,n+=s*u)}return(a=t-r)*a+(s=e-n)*s}function Il(t,e,r,n){var i={id:void 0===t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)Ml(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(a+=n?(i*l-u*o)/2:Math.sqrt(Math.pow(u-i,2)+Math.pow(l-o,2))),i=u,o=l}var p=e.length-3;e[2]=1,function t(e,r,n,i){for(var o,a=i,s=n-r>>1,u=n-r,l=e[r],p=e[r+1],c=e[n],h=e[n+1],f=r+3;fa)o=f,a=y;else if(y===a){var d=Math.abs(f-s);di&&(o-r>3&&t(e,r,o,i),e[o+2]=a,n-o>3&&t(e,o,n,i))}(e,0,p,r),e[p+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function Vl(t,e,r,n){for(var i=0;i1?1:r}function Fl(t,e,r,n,i,o,a,s){if(n/=e,o>=(r/=e)&&a=n)return null;for(var u=[],l=0;l=r&&y=n)){var d=[];if("Point"===h||"MultiPoint"===h)Ol(c,d,r,n,i);else if("LineString"===h)Ll(c,d,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===h)jl(c,d,r,n,i,!1);else if("Polygon"===h)jl(c,d,r,n,i,!0);else if("MultiPolygon"===h)for(var m=0;m=r&&a<=n&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function Ll(t,e,r,n,i,o,a){for(var s,u,l=Dl(t),p=0===i?Ul:Rl,c=t.start,h=0;hr&&(u=p(l,f,y,m,v,r),a&&(l.start=c+s*u)):g>n?x=r&&(u=p(l,f,y,m,v,r),b=!0),x>n&&g<=n&&(u=p(l,f,y,m,v,n),b=!0),!o&&b&&(a&&(l.end=c+s*u),e.push(l),l=Dl(t)),a&&(c+=s)}var _=t.length-3;f=t[_],y=t[_+1],d=t[_+2],(g=0===i?f:y)>=r&&g<=n&&ql(l,f,y,d),_=l.length-3,o&&_>=3&&(l[_]!==l[0]||l[_+1]!==l[1])&&ql(l,l[0],l[1],l[2]),l.length&&e.push(l)}function Dl(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function jl(t,e,r,n,i,o){for(var a=0;aa.maxX&&(a.maxX=p),c>a.maxY&&(a.maxY=c)}return a}function Xl(t,e,r,n){var i=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s0&&e.size<(i?a:n))r.numPoints+=e.length/3;else{for(var s=[],u=0;ua)&&(r.numSimplified++,s.push(e[u]),s.push(e[u+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,o=i-2;n0===e)for(n=0,i=t.length;n24)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 n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n=n;l--){var p=+Date.now();s=this._cluster(s,l),this.trees[l]=new yl(s,Sl,Al,o,Float32Array),r&&console.log("z%d: %d clusters in %dms",l,s.length,+Date.now()-p)}return r&&console.timeEnd("total time"),this},ml.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=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)r=-180,i=180;else if(r>i){var a=this.getClusters([r,n,180,o],e),s=this.getClusters([-180,n,i,o],e);return a.concat(s)}for(var u=this.trees[this._limitZoom(e)],l=[],p=0,c=u.range(_l(r),wl(o),_l(i),wl(n));p>5,r=t%32,n="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(n);var o=i.points[e];if(!o)throw new Error(n);for(var a=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=[],u=0,l=i.within(o.x,o.y,a);u1?this._map(l,!0):null,m=(u<<5)+(e+1),v=0,g=c;v1&&console.time("creation"),h=this.tiles[c]=Gl(t,e,r,n,u),this.tileCoords.push({z:e,x:r,y:n}),l)){l>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,h.numFeatures,h.numPoints,h.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(h.source=t,i){if(e===u.maxZoom||e===i)continue;var y=1<1&&console.time("clipping");var d,m,v,g,x,b,_=.5*u.buffer/u.extent,w=.5-_,k=.5+_,S=1+_;d=m=v=g=null,x=Fl(t,p,r-_,r+k,0,h.minX,h.maxX,u),b=Fl(t,p,r+w,r+S,0,h.minX,h.maxX,u),t=null,x&&(d=Fl(x,p,n-_,n+k,1,h.minY,h.maxY,u),m=Fl(x,p,n+w,n+S,1,h.minY,h.maxY,u),x=null),b&&(v=Fl(b,p,n-_,n+k,1,h.minY,h.maxY,u),g=Fl(b,p,n+w,n+S,1,h.minY,h.maxY,u),b=null),l>1&&console.timeEnd("clipping"),s.push(d||[],e+1,2*r,2*n),s.push(m||[],e+1,2*r,2*n+1),s.push(v||[],e+1,2*r+1,2*n),s.push(g||[],e+1,2*r+1,2*n+1)}}},Hl.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,o=n.debug;if(t<0||t>24)return null;var a=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var u,l=t,p=e,c=r;!u&&l>0;)l--,p=Math.floor(p/2),c=Math.floor(c/2),u=this.tiles[Wl(l,p,c)];return u&&u.source?(o>1&&console.log("found parent tile z%d-%d-%d",l,p,c),o>1&&console.time("drilling down"),this.splitTile(u.source,l,p,c,t,e,r),o>1&&console.timeEnd("drilling down"),this.tiles[s]?Jl(this.tiles[s],i):null):null};var Ql=function(t){function e(e,r,n){t.call(this,e,r,$l),n&&(this.loadGeoJSON=n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.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())},e.prototype._loadData=function(){var t=this;if(this._pendingCallback&&this._pendingLoadDataParams){var e=this._pendingCallback,r=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var n=!!(r&&r.request&&r.request.collectResourceTiming)&&new Mu.Performance(r.request);this.loadGeoJSON(r,(function(i,o){if(i||!o)return e(i);if("object"!=typeof o)return e(new Error("Input data given to '"+r.source+"' is not a valid GeoJSON object."));ju(o,!0);try{t._geoJSONIndex=r.cluster?new ml(function(t){var e=t.superclusterOptions,r=t.clusterProperties;if(!r||!e)return e;for(var n={},i={},o={accumulated:null,zoom:0},a={properties:null},s=Object.keys(r),u=0,l=s;u