=e[2]||t[1]<=e[1]||t[3]>=e[3])}function we(t,e){var r=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,i=Math.pow(2,e.z);return[Math.round(r*i*8192),Math.round(n*i*8192)]}function Ee(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function Te(t,e){for(var r,n,i,o,a,s,u,l=!1,c=0,p=e.length;c0&&s<0||a<0&&s>0}function Ae(t,e,r){for(var n=0,i=r;nr[2]){var i=.5*n,o=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===o&&(o=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=o}xe(e,t)}function Le(t,e,r,n){for(var i=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],a=[],s=0,u=t;s=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Ne(t,e)&&(r=!1)})),r}ze.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(oe(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;ne))throw new le("Input is not a number.");o=a-1}return 0}Ue.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)},Ue.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new pe(e,[t]):"coerce"===r?new me(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&&"resolvedImage"!==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 ue)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof Fe)return t(e.boundExpression);if(e instanceof ve&&"error"===e.name)return!1;if(e instanceof _e)return!1;if(e instanceof ze)return!1;var r=e instanceof me||e instanceof pe,n=!0;return e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof ue})),!!n&&Oe(e)&&Ne(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var u=new ge;try{o=new ue(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 this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},Ue.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 Ue(this.registry,n,e||null,i,this.errors)},Ue.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 Rt(n,t))},Ue.prototype.checkSubtype=function(t,e){var r=Xt(t,e);return r&&this.error(r),r};var Ve=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 c=e.parse(s,l,i);if(!c)return null;i=i||c.type,n.push([a,c])}return new Ve(i,r,n)},Ve.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[je(e,n)].evaluate(t)},Ve.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 We=Object.freeze({__proto__:null,number:qe,color:function(t,e,r){return new $t(qe(t.r,e.r,r),qe(t.g,e.g,r),qe(t.b,e.b,r),qe(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return qe(t,e[n],r)}))}}),Ge=6/29*3*(6/29),Ze=Math.PI/180,He=180/Math.PI;function Ye(t){return t>.008856451679035631?Math.pow(t,1/3):t/Ge+4/29}function Xe(t){return t>6/29?t*t*t:Ge*(t-4/29)}function Ke(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Je(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Qe(t){var e=Je(t.r),r=Je(t.g),n=Je(t.b),i=Ye((.4124564*e+.3575761*r+.1804375*n)/.95047),o=Ye((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-Ye((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function $e(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=1*Xe(e),r=.95047*Xe(r),n=1.08883*Xe(n),new $t(Ke(3.2404542*r-1.5371385*e-.4985314*n),Ke(-.969266*r+1.8760108*e+.041556*n),Ke(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function tr(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var er={forward:Qe,reverse:$e,interpolate:function(t,e,r){return{l:qe(t.l,e.l,r),a:qe(t.a,e.a,r),b:qe(t.b,e.b,r),alpha:qe(t.alpha,e.alpha,r)}}},rr={forward:function(t){var e=Qe(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*He;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*Ze,r=t.c;return $e({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:tr(t.h,e.h,r),c:qe(t.c,e.c,r),l:qe(t.l,e.l,r),alpha:qe(t.alpha,e.alpha,r)}}},nr=Object.freeze({__proto__:null,lab:er,hcl:rr}),ir=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,Bt)))return null;var u=[],l=null;"interpolate-hcl"===r||"interpolate-lab"===r?l=Ut:e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var c=0;c=p)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var m=e.parse(h,d,l);if(!m)return null;l=l||m.type,u.push([p,m])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new ir(l,r,n,i,u):e.error("Type "+Ht(l)+" is not interpolatable.")},ir.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=je(e,n),a=ir.interpolationFactor(this.interpolation,n,e[o],e[o+1]),s=r[o].evaluate(t),u=r[o+1].evaluate(t);return"interpolate"===this.operator?We[this.type.kind.toLowerCase()](s,u,a):"interpolate-hcl"===this.operator?rr.reverse(rr.interpolate(rr.forward(s),rr.forward(u),a)):er.reverse(er.interpolate(er.forward(s),er.forward(u),a))},ir.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new le("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new le("Array index must be an integer, but found "+e+" instead.");return r[e]},ur.prototype.eachChild=function(t){t(this.index),t(this.input)},ur.prototype.outputDefined=function(){return!1},ur.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var lr=function(t,e){this.type=Ft,this.needle=t,this.haystack=e};lr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Vt),n=e.parse(t[2],2,Vt);return r&&n?Kt(r.type,[Ft,Nt,Bt,Ot,Vt])?new lr(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Ht(r.type)+" instead"):null},lr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!Jt(e,["boolean","string","number","null"]))throw new le("Expected first argument to be of type boolean, string, number or null, but found "+Ht(ae(e))+" instead.");if(!Jt(r,["string","array"]))throw new le("Expected second argument to be of type array or string, but found "+Ht(ae(r))+" instead.");return r.indexOf(e)>=0},lr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},lr.prototype.outputDefined=function(){return!0},lr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var cr=function(t,e,r){this.type=Bt,this.needle=t,this.haystack=e,this.fromIndex=r};cr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Vt),n=e.parse(t[2],2,Vt);if(!r||!n)return null;if(!Kt(r.type,[Ft,Nt,Bt,Ot,Vt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Ht(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Bt);return i?new cr(r,n,i):null}return new cr(r,n)},cr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!Jt(e,["boolean","string","number","null"]))throw new le("Expected first argument to be of type boolean, string, number or null, but found "+Ht(ae(e))+" instead.");if(!Jt(r,["string","array"]))throw new le("Expected second argument to be of type array or string, but found "+Ht(ae(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},cr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},cr.prototype.outputDefined=function(){return!1},cr.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var pr=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};pr.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,ae(h)))return null}else r=ae(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 d=e.parse(t[1],1,Vt);if(!d)return null;var m=e.parse(t[t.length-1],t.length-1,n);return m?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new pr(r,n,d,i,o,m):null},pr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(ae(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},pr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},pr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},pr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,o=Object.keys(this.cases).sort();i=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Vt),n=e.parse(t[2],2,Bt);if(!r||!n)return null;if(!Kt(r.type,[Zt(Vt),Nt,Vt]))return e.error("Expected first argument to be of type array or string, but found "+Ht(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Bt);return i?new fr(r.type,r,n,i):null}return new fr(r.type,r,n)},fr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!Jt(e,["string","array"]))throw new le("Expected first argument to be of type array or string, but found "+Ht(ae(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},fr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},fr.prototype.outputDefined=function(){return!1},fr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var gr=yr("==",(function(t,e,r){return e===r}),mr),vr=yr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!mr(0,e,r,n)})),_r=yr("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),br=yr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),wr=yr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),Er=function(t,e,r,n,i){this.type=Nt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};Er.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Bt);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,Nt)))return null;var o=null;if(n.currency&&!(o=e.parse(n.currency,1,Nt)))return null;var a=null;if(n["min-fraction-digits"]&&!(a=e.parse(n["min-fraction-digits"],1,Bt)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Bt))?null:new Er(r,i,o,a,s)},Er.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))},Er.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)},Er.prototype.outputDefined=function(){return!1},Er.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 Tr=function(t){this.type=Bt,this.input=t};Tr.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 "+Ht(r.type)+" instead."):new Tr(r):null},Tr.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 le("Expected value to be of type string or array, but found "+Ht(ae(e))+" instead.")},Tr.prototype.eachChild=function(t){t(this.input)},Tr.prototype.outputDefined=function(){return!1},Tr.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Sr={"==":gr,"!=":vr,">":xr,"<":_r,">=":wr,"<=":br,array:pe,at:ur,boolean:pe,case:hr,coalesce:ar,collator:_e,format:he,image:fe,in:lr,"index-of":cr,interpolate:ir,"interpolate-hcl":ir,"interpolate-lab":ir,length:Tr,let:sr,literal:ue,match:pr,number:pe,"number-format":Er,object:pe,slice:fr,step:Ve,string:pe,"to-boolean":me,"to-color":me,"to-number":me,"to-string":me,var:Fe,within:ze};function Cr(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=ie(r,n,i,a);if(s)throw new le(s);return new $t(r/255*a,n/255*a,i/255*a,a)}function Ar(t,e){return t in e}function Ir(t,e){var r=e[t];return void 0===r?null:r}function kr(t){return{type:t}}function Pr(t){return{result:"success",value:t}}function Mr(t){return{result:"error",value:t}}function Dr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Lr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Rr(t){return!!t.expression&&t.expression.interpolated}function zr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Or(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Br(t){return t}function Nr(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Fr(t,e,r,n,i){return Nr(typeof r===i?n[r]:void 0,t.default,e.default)}function Ur(t,e,r){if("number"!==zr(r))return Nr(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=je(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function jr(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==zr(r))return Nr(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=je(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=We[e.type]||Br;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=nr[t.colorSpace];l=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var 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 Vr(t,e,r){return"color"===e.type?r=$t.parse(r):"formatted"===e.type?r=re.fromString(r.toString()):"resolvedImage"===e.type?r=ne.fromString(r.toString()):zr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Nr(r,t.default,e.default)}ve.register(Sr,{error:[{kind:"error"},[Nt],function(t,e){throw new le(e[0].evaluate(t))}],typeof:[Nt,[Vt],function(t,e){return Ht(ae(e[0].evaluate(t)))}],"to-rgba":[Zt(Bt,4),[Ut],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Ut,[Bt,Bt,Bt],Cr],rgba:[Ut,[Bt,Bt,Bt,Bt],Cr],has:{type:Ft,overloads:[[[Nt],function(t,e){return Ar(e[0].evaluate(t),t.properties())}],[[Nt,jt],function(t,e){var r=e[1];return Ar(e[0].evaluate(t),r.evaluate(t))}]]},get:{type:Vt,overloads:[[[Nt],function(t,e){return Ir(e[0].evaluate(t),t.properties())}],[[Nt,jt],function(t,e){var r=e[1];return Ir(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[Vt,[Nt],function(t,e){return Ir(e[0].evaluate(t),t.featureState||{})}],properties:[jt,[],function(t){return t.properties()}],"geometry-type":[Nt,[],function(t){return t.geometryType()}],id:[Vt,[],function(t){return t.id()}],zoom:[Bt,[],function(t){return t.globals.zoom}],"heatmap-density":[Bt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Bt,[],function(t){return t.globals.lineProgress||0}],accumulated:[Vt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Bt,kr(Bt),function(t,e){for(var r=0,n=0,i=e;n":[Ft,[Nt,Vt],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->":[Ft,[Vt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[Ft,[Nt,Vt],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-<=":[Ft,[Vt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[Ft,[Nt,Vt],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->=":[Ft,[Vt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[Ft,[Vt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Ft,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Ft,[Zt(Nt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Ft,[Zt(Vt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Ft,[Nt,Zt(Vt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Ft,[Nt,Zt(Vt)],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:Ft,overloads:[[[Ft,Ft],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[kr(Ft),function(t,e){for(var r=0,n=e;r0&&"string"==typeof t[0]&&t[0]in Sr}function Gr(t,e){var r=new Ue(Sr,[],e?function(t){var e={color:Ut,string:Nt,number:Bt,enum:Nt,boolean:Ft,formatted:Wt,resolvedImage:Gt};return"array"===t.type?Zt(e[t.value]||Vt,t.length):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?Pr(new qr(n,e)):Mr(r.errors)}qr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)},qr.prototype.evaluate=function(t,e,r,n,i,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new le("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Zr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Be(e.expression)};Zr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)},Zr.prototype.evaluate=function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)};var Hr=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Be(e.expression),this.interpolationType=n};function Yr(t,e){if("error"===(t=Gr(t,e)).result)return t;var r=t.value.expression,n=Oe(r);if(!n&&!Dr(e))return Mr([new Rt("","data expressions not supported")]);var i=Ne(r,["zoom"]);if(!i&&!Lr(e))return Mr([new Rt("","zoom expressions not supported")]);var o=function t(e){var r=null;if(e instanceof sr)r=t(e.result);else if(e instanceof ar)for(var n=0,i=e.args;nn.maximum?[new kt(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function $r(t){var e,r,n,i=t.valueSpec,o=Dt(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,l="array"===zr(t.value.stops)&&"array"===zr(t.value.stops[0])&&"object"===zr(t.value.stops[0][0]),c=Kr({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 kt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(Jr({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:p})),"array"===zr(r)&&0===r.length&&e.push(new kt(t.key,r,"array must have at least one stop")),e},default:function(t){return wn({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&c.push(new kt(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||c.push(new kt(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!Rr(t.valueSpec)&&c.push(new kt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!Dr(t.valueSpec)?c.push(new kt(t.key,t.value,"property functions not supported")):s&&!Lr(t.valueSpec)&&c.push(new kt(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!l||void 0!==t.value.property||c.push(new kt(t.key,t.value,'"property" property is required')),c;function p(t){var e=[],o=t.value,s=t.key;if("array"!==zr(o))return[new kt(s,o,"array expected, "+zr(o)+" found")];if(2!==o.length)return[new kt(s,o,"array length 2 expected, length "+o.length+" found")];if(l){if("object"!==zr(o[0]))return[new kt(s,o,"object expected, "+zr(o[0])+" found")];if(void 0===o[0].zoom)return[new kt(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new kt(s,o,"object stop key must have value")];if(n&&n>Dt(o[0].zoom))return[new kt(s,o[0].zoom,"stop zoom values must appear in ascending order")];Dt(o[0].zoom)!==n&&(n=Dt(o[0].zoom),r=void 0,a={}),e=e.concat(Kr({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Qr,value:h}}))}else e=e.concat(h({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return Wr(Lt(o[1]))?e.concat([new kt(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(wn({key:s+"[1]",value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function h(t,n){var s=zr(t.value),u=Dt(t.value),l=null!==t.value?t.value:n;if(e){if(s!==e)return[new kt(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 kt(t.key,l,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var c="number expected, "+s+" found";return Dr(i)&&void 0===o&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new kt(t.key,l,c)]}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":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));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 sn(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?un(t[1],t[2],"=="):"!="===r?pn(un(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?un(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(sn))):"all"===r?["all"].concat(t.slice(1).map(sn)):"none"===r?["all"].concat(t.slice(1).map(sn).map(pn)):"in"===r?ln(t[1],t.slice(2)):"!in"===r?pn(ln(t[1],t.slice(2))):"has"===r?cn(t[1]):"!has"===r?pn(cn(t[1])):"within"!==r||t}function un(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 ln(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(an)]]:["filter-in-small",t,["literal",e]]}}function cn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function pn(t){return["!",t]}function hn(t){return rn(Lt(t.value))?tn(Mt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==zr(r))return[new kt(n,r,"array expected, "+zr(r)+" found")];var i,o=e.styleSpec,a=[];if(r.length<1)return[new kt(n,r,"filter array must have at least 1 element")];switch(a=a.concat(en({key:n+"[0]",value:r[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),Dt(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Dt(r[1])&&a.push(new kt(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new kt(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=zr(r[1]))&&a.push(new kt(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s=c[f+0]&&n>=c[f+1])?(a[h]=!0,o.push(l[h])):a[h]=!1}}},Ln.prototype._forEachCell=function(t,e,r,n,i,o,a,s){for(var u=this._convertToCellCoord(t),l=this._convertToCellCoord(e),c=this._convertToCellCoord(r),p=this._convertToCellCoord(n),h=u;h<=c;h++)for(var f=l;f<=p;f++){var d=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,d,o,a,s))return}},Ln.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Ln.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Ln.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,n=0;n=0)){var c=t[l];u[l]=On[s].shallow.indexOf(l)>=0?c:jn(c,e)}t instanceof Error&&(u.message=t.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==s&&(u.$name=s),u}throw new Error("can't serialize object of type "+typeof t)}function Vn(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||Fn(t)||Un(t)||ArrayBuffer.isView(t)||t instanceof Rn)return t;if(Array.isArray(t))return t.map(Vn);if("object"==typeof t){var e=t.$name||"Object",r=On[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:Vn(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var qn=function(){this.first=!0};qn.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 Gn(t){for(var e=0,r=t;e=65097&&t<=65103)||Wn["CJK Compatibility Ideographs"](t)||Wn["CJK Compatibility"](t)||Wn["CJK Radicals Supplement"](t)||Wn["CJK Strokes"](t)||!(!Wn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Wn["CJK Unified Ideographs Extension A"](t)||Wn["CJK Unified Ideographs"](t)||Wn["Enclosed CJK Letters and Months"](t)||Wn["Hangul Compatibility Jamo"](t)||Wn["Hangul Jamo Extended-A"](t)||Wn["Hangul Jamo Extended-B"](t)||Wn["Hangul Jamo"](t)||Wn["Hangul Syllables"](t)||Wn.Hiragana(t)||Wn["Ideographic Description Characters"](t)||Wn.Kanbun(t)||Wn["Kangxi Radicals"](t)||Wn["Katakana Phonetic Extensions"](t)||Wn.Katakana(t)&&12540!==t||!(!Wn["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)||!(!Wn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Wn["Unified Canadian Aboriginal Syllabics"](t)||Wn["Unified Canadian Aboriginal Syllabics Extended"](t)||Wn["Vertical Forms"](t)||Wn["Yijing Hexagram Symbols"](t)||Wn["Yi Syllables"](t)||Wn["Yi Radicals"](t))))}function Hn(t){return!(Zn(t)||function(t){return!!(Wn["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Wn["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)||Wn["Letterlike Symbols"](t)||Wn["Number Forms"](t)||Wn["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)||Wn["Control Pictures"](t)&&9251!==t||Wn["Optical Character Recognition"](t)||Wn["Enclosed Alphanumerics"](t)||Wn["Geometric Shapes"](t)||Wn["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Wn["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Wn["CJK Symbols and Punctuation"](t)||Wn.Katakana(t)||Wn["Private Use Area"](t)||Wn["CJK Compatibility Forms"](t)||Wn["Small Form Variants"](t)||Wn["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 Yn(t){return t>=1424&&t<=2303||Wn["Arabic Presentation Forms-A"](t)||Wn["Arabic Presentation Forms-B"](t)}function Xn(t,e){return!(!e&&Yn(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Wn.Khmer(t))}function Kn(t){for(var e=0,r=t;e-1&&(Qn="error"),Jn&&Jn(t)};function ei(){ri.fire(new St("pluginStateChange",{pluginStatus:Qn,pluginURL:$n}))}var ri=new At,ni=function(){return Qn},ii=function(){if("deferred"!==Qn||!$n)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Qn="loading",ei(),$n&&xt({url:$n},(function(t){t?ti(t):(Qn="loaded",ei())}))},oi={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===Qn||null!=oi.applyArabicShaping},isLoading:function(){return"loading"===Qn},setState:function(t){Qn=t.pluginStatus,$n=t.pluginURL},isParsed:function(){return null!=oi.applyArabicShaping&&null!=oi.processBidirectionalText&&null!=oi.processStyledBidirectionalText},getPluginURL:function(){return $n}},ai=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 qn,this.transition={})};ai.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 si=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Or(t))return new Xr(t,e);if(Wr(t)){var r=Yr(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=$t.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};si.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},si.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var ui=function(t){this.property=t,this.value=new si(t,void 0)};ui.prototype.transitioned=function(t,e){return new ci(this.property,this.value,e,h({},t.transition,this.transition),t.now)},ui.prototype.untransitioned=function(){return new ci(this.property,this.value,null,{},0)};var li=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};li.prototype.getValue=function(t){return b(this._values[t].value.value)},li.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new ui(this._values[t].property)),this._values[t].value=new si(this._values[t].property,null===e?void 0:b(e))},li.prototype.getTransition=function(t){return b(this._values[t].transition)},li.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new ui(this._values[t].property)),this._values[t].transition=b(e)||void 0},li.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);ethis.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(a))}return i};var pi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};pi.prototype.possiblyEvaluate=function(t,e,r){for(var n=new di(this._properties),i=0,o=Object.keys(this._values);in.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(yi),vi=function(t){this.specification=t};vi.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new ai(Math.floor(e.zoom-1),e)),t.expression.evaluate(new ai(Math.floor(e.zoom),e)),t.expression.evaluate(new ai(Math.floor(e.zoom+1),e)),e)}},vi.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},vi.prototype.interpolate=function(t){return t};var _i=function(t){this.specification=t};_i.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},_i.prototype.interpolate=function(){return!1};var xi=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 si(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new ui(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};Bn("DataDrivenProperty",yi),Bn("DataConstantProperty",mi),Bn("CrossFadedDataDrivenProperty",gi),Bn("CrossFadedProperty",vi),Bn("ColorRampProperty",_i);var bi=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(this.metadata=(e=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 hi(r.layout)),r.paint)){for(var n in this._transitionablePaint=new li(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(),this.paint=new di(r.paint)}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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){void 0===r&&(r={}),null!=e&&this._validate(Pn,"layers."+this.id+".layout."+t,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return v(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&&this._validate(kn,"layers."+this.id+".paint."+t,t,e,r))return!1;if(v(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var n=this._transitionablePaint._values[t],i="cross-faded-data-driven"===n.property.specification["property-type"],o=n.value.isDataDriven(),a=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||o||i||this._handleOverridablePaintPropertyUpdate(t,a,s)},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,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},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),x(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)&&Mn(this,t.call(An,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:It,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof fi&&Dr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(At),wi={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ei=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Ti=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Si(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var i=wi[t.type].BYTES_PER_ELEMENT,o=r=Ci(r,Math.max(e,i)),a=t.components||1;return n=Math.max(n,i),r+=i*a,{name:t.name,type:t.type,components:a,offset:o}})),size:Ci(r,Math.max(n,e)),alignment:e}}function Ci(t,e){return Math.ceil(t/e)*e}Ti.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Ti.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},Ti.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Ti.prototype.clear=function(){this.length=0},Ti.prototype.resize=function(t){this.reserve(t),this.length=t},Ti.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},Ti.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Ai=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(Ti);Ai.prototype.bytesPerElement=4,Bn("StructArrayLayout2i4",Ai);var Ii=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(Ti);Ii.prototype.bytesPerElement=8,Bn("StructArrayLayout4i8",Ii);var ki=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(Ti);ki.prototype.bytesPerElement=12,Bn("StructArrayLayout2i4i12",ki);var Pi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(Ti);Pi.prototype.bytesPerElement=8,Bn("StructArrayLayout2i4ub8",Pi);var Mi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(Ti);Mi.prototype.bytesPerElement=8,Bn("StructArrayLayout2f8",Mi);var Di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,u,l){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,o,a,s,u,l)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,c){var p=10*t;return this.uint16[p+0]=e,this.uint16[p+1]=r,this.uint16[p+2]=n,this.uint16[p+3]=i,this.uint16[p+4]=o,this.uint16[p+5]=a,this.uint16[p+6]=s,this.uint16[p+7]=u,this.uint16[p+8]=l,this.uint16[p+9]=c,t},e}(Ti);Di.prototype.bytesPerElement=20,Bn("StructArrayLayout10ui20",Di);var Li=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,u,l,c,p){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,n,i,o,a,s,u,l,c,p)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,c,p,h){var f=12*t;return this.int16[f+0]=e,this.int16[f+1]=r,this.int16[f+2]=n,this.int16[f+3]=i,this.uint16[f+4]=o,this.uint16[f+5]=a,this.uint16[f+6]=s,this.uint16[f+7]=u,this.int16[f+8]=l,this.int16[f+9]=c,this.int16[f+10]=p,this.int16[f+11]=h,t},e}(Ti);Li.prototype.bytesPerElement=24,Bn("StructArrayLayout4i4ui4i24",Li);var Ri=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(Ti);Ri.prototype.bytesPerElement=12,Bn("StructArrayLayout3f12",Ri);var zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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){return this.uint32[1*t+0]=e,t},e}(Ti);zi.prototype.bytesPerElement=4,Bn("StructArrayLayout1ul4",zi);var Oi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,n,i,o,a,s,u)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l){var c=10*t,p=5*t;return this.int16[c+0]=e,this.int16[c+1]=r,this.int16[c+2]=n,this.int16[c+3]=i,this.int16[c+4]=o,this.int16[c+5]=a,this.uint32[p+3]=s,this.uint16[c+8]=u,this.uint16[c+9]=l,t},e}(Ti);Oi.prototype.bytesPerElement=20,Bn("StructArrayLayout6i1ul2ui20",Oi);var Bi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(Ti);Bi.prototype.bytesPerElement=12,Bn("StructArrayLayout2i2i2i12",Bi);var Ni=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i)},e.prototype.emplace=function(t,e,r,n,i,o){var a=4*t,s=8*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.int16[s+6]=i,this.int16[s+7]=o,t},e}(Ti);Ni.prototype.bytesPerElement=16,Bn("StructArrayLayout2f1f2i16",Ni);var Fi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(Ti);Fi.prototype.bytesPerElement=12,Bn("StructArrayLayout2ub2f12",Fi);var Ui=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(Ti);Ui.prototype.bytesPerElement=6,Bn("StructArrayLayout3ui6",Ui);var ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,c,p,h,f,d,m,y){var g=this.length;return this.resize(g+1),this.emplace(g,t,e,r,n,i,o,a,s,u,l,c,p,h,f,d,m,y)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,c,p,h,f,d,m,y,g){var v=24*t,_=12*t,x=48*t;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[_+2]=o,this.uint32[_+3]=a,this.uint32[_+4]=s,this.uint16[v+10]=u,this.uint16[v+11]=l,this.uint16[v+12]=c,this.float32[_+7]=p,this.float32[_+8]=h,this.uint8[x+36]=f,this.uint8[x+37]=d,this.uint8[x+38]=m,this.uint32[_+10]=y,this.int16[v+22]=g,t},e}(Ti);ji.prototype.bytesPerElement=48,Bn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ji);var Vi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,c,p,h,f,d,m,y,g,v,_,x,b,w,E,T,S,C,A){var I=this.length;return this.resize(I+1),this.emplace(I,t,e,r,n,i,o,a,s,u,l,c,p,h,f,d,m,y,g,v,_,x,b,w,E,T,S,C,A)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,c,p,h,f,d,m,y,g,v,_,x,b,w,E,T,S,C,A,I){var k=34*t,P=17*t;return this.int16[k+0]=e,this.int16[k+1]=r,this.int16[k+2]=n,this.int16[k+3]=i,this.int16[k+4]=o,this.int16[k+5]=a,this.int16[k+6]=s,this.int16[k+7]=u,this.uint16[k+8]=l,this.uint16[k+9]=c,this.uint16[k+10]=p,this.uint16[k+11]=h,this.uint16[k+12]=f,this.uint16[k+13]=d,this.uint16[k+14]=m,this.uint16[k+15]=y,this.uint16[k+16]=g,this.uint16[k+17]=v,this.uint16[k+18]=_,this.uint16[k+19]=x,this.uint16[k+20]=b,this.uint16[k+21]=w,this.uint16[k+22]=E,this.uint32[P+12]=T,this.float32[P+13]=S,this.float32[P+14]=C,this.float32[P+15]=A,this.float32[P+16]=I,t},e}(Ti);Vi.prototype.bytesPerElement=68,Bn("StructArrayLayout8i15ui1ul4f68",Vi);var qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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){return this.float32[1*t+0]=e,t},e}(Ti);qi.prototype.bytesPerElement=4,Bn("StructArrayLayout1f4",qi);var Wi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(Ti);Wi.prototype.bytesPerElement=6,Bn("StructArrayLayout3i6",Wi);var Gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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=4*t;return this.uint32[2*t+0]=e,this.uint16[i+2]=r,this.uint16[i+3]=n,t},e}(Ti);Gi.prototype.bytesPerElement=8,Bn("StructArrayLayout1ul2ui8",Gi);var Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(Ti);Zi.prototype.bytesPerElement=4,Bn("StructArrayLayout2ui4",Zi);var Hi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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){return this.uint16[1*t+0]=e,t},e}(Ti);Hi.prototype.bytesPerElement=2,Bn("StructArrayLayout1ui2",Hi);var Yi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(Ti);Yi.prototype.bytesPerElement=16,Bn("StructArrayLayout4f16",Yi);var Xi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={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},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Ei);Xi.prototype.size=20;var Ki=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Xi(this,t)},e}(Oi);Bn("CollisionBoxArray",Ki);var Ji=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},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},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(Ei);Ji.prototype.size=48;var Qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Ji(this,t)},e}(ji);Bn("PlacedSymbolArray",Qi);var $i=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(Ei);$i.prototype.size=68;var to=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new $i(this,t)},e}(Vi);Bn("SymbolInstanceArray",to);var eo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(qi);Bn("GlyphOffsetArray",eo);var ro=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(Wi);Bn("SymbolLineVertexArray",ro);var no=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(Ei);no.prototype.size=8;var io=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new no(this,t)},e}(Gi);Bn("FeatureIndexArray",io);var oo=Si([{name:"a_pos",components:2,type:"Int16"}],4).members,ao=function(t){void 0===t&&(t=[]),this.segments=t};function so(t,e){return 256*(t=c(Math.floor(t),0,255))+c(Math.floor(e),0,255)}ao.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>ao.MAX_VERTEX_ARRAY_LENGTH&&E("Max vertices per segment is "+ao.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>ao.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},ao.prototype.get=function(){return this.segments},ao.prototype.destroy=function(){for(var t=0,e=this.segments;t>>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}})),co=e((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}})),po=lo,ho=co;po.murmur3=lo,po.murmur2=ho;var fo=function(){this.ids=[],this.positions=[],this.indexed=!1};fo.prototype.add=function(t,e,r,n){this.ids.push(yo(t)),this.positions.push(e,r,n)},fo.prototype.getPositions=function(t){for(var e=yo(t),r=0,n=this.ids.length-1;r>1;this.ids[i]>=e?n=i:r=i+1}for(var o=[];this.ids[r]===e;)o.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return o},fo.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,i){for(;n>1],a=n-1,s=i+1;;){do{a++}while(e[a]o);if(a>=s)break;go(e,a,s),go(r,3*a,3*s),go(r,3*a+1,3*s+1),go(r,3*a+2,3*s+2)}s-na.x+1||ua.y+1)&&E("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function Uo(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Fo(t):[]}}function jo(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var Vo=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 Ai,this.indexArray=new Ui,this.segments=new ao,this.programConfigurations=new Ro(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function qo(t,e){for(var r=0;r1){if(Ho(t,e))return!0;for(var n=0;n1?r:r.sub(e)._mult(i)._add(e))}function Jo(t,e){for(var r,n,i,o=!1,a=0;ae.y!=(i=r[u]).y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(o=!o);return o}function Qo(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 $o(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=T(t,e,r[0]);return o!==T(t,e,r[1])||o!==T(t,e,r[2])||o!==T(t,e,r[3])}function ta(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function ea(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ra(t,e,r,n,o){if(!e[0]&&!e[1])return t;var a=i.convert(e)._mult(o);"viewport"===r&&a._rotate(-n);for(var s=[],u=0;u=8192||c<0||c>=8192)){var p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),h=p.vertexLength;jo(this.layoutVertexArray,l,c,-1,-1),jo(this.layoutVertexArray,l,c,1,-1),jo(this.layoutVertexArray,l,c,1,1),jo(this.layoutVertexArray,l,c,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),p.vertexLength+=4,p.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},Bn("CircleBucket",Vo,{omit:["layers"]});var na=new xi({"circle-sort-key":new yi(It.layout_circle["circle-sort-key"])}),ia={paint:new xi({"circle-radius":new yi(It.paint_circle["circle-radius"]),"circle-color":new yi(It.paint_circle["circle-color"]),"circle-blur":new yi(It.paint_circle["circle-blur"]),"circle-opacity":new yi(It.paint_circle["circle-opacity"]),"circle-translate":new mi(It.paint_circle["circle-translate"]),"circle-translate-anchor":new mi(It.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new mi(It.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new mi(It.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new yi(It.paint_circle["circle-stroke-width"]),"circle-stroke-color":new yi(It.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new yi(It.paint_circle["circle-stroke-opacity"])}),layout:na},oa="undefined"!=typeof Float32Array?Float32Array:Array;function aa(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function sa(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],p=e[8],h=e[9],f=e[10],d=e[11],m=e[12],y=e[13],g=e[14],v=e[15],_=r[0],x=r[1],b=r[2],w=r[3];return t[0]=_*n+x*s+b*p+w*m,t[1]=_*i+x*u+b*h+w*y,t[2]=_*o+x*l+b*f+w*g,t[3]=_*a+x*c+b*d+w*v,t[4]=(_=r[4])*n+(x=r[5])*s+(b=r[6])*p+(w=r[7])*m,t[5]=_*i+x*u+b*h+w*y,t[6]=_*o+x*l+b*f+w*g,t[7]=_*a+x*c+b*d+w*v,t[8]=(_=r[8])*n+(x=r[9])*s+(b=r[10])*p+(w=r[11])*m,t[9]=_*i+x*u+b*h+w*y,t[10]=_*o+x*l+b*f+w*g,t[11]=_*a+x*c+b*d+w*v,t[12]=(_=r[12])*n+(x=r[13])*s+(b=r[14])*p+(w=r[15])*m,t[13]=_*i+x*u+b*h+w*y,t[14]=_*o+x*l+b*f+w*g,t[15]=_*a+x*c+b*d+w*v,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)});var ua,la=sa;function ca(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}ua=new oa(3),oa!=Float32Array&&(ua[0]=0,ua[1]=0,ua[2]=0),function(){var t=new oa(4);oa!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var pa=(function(){var t=new oa(2);oa!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,ia)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Vo(t)},e.prototype.queryRadius=function(t){var e=t;return ta("circle-radius",this,e)+ta("circle-stroke-width",this,e)+ea(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a,s){for(var u=ra(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),c="map"===this.paint.get("circle-pitch-alignment"),p=c?u:function(t,e){return t.map((function(t){return ha(t,e)}))}(u,s),h=c?l*a:l,f=0,d=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 d=r;do&&(o=s),u>a&&(a=u);l=0!==(l=Math.max(o-n,a-i))?1/l:0}return Pa(h,f,r,n,i,l),f}function Ia(t,e,r,n,i){var o,a;if(i===Qa(t,e,r,n)>0)for(o=e;o=e;o-=n)a=Xa(o,t[o],t[o+1],a);return a&&qa(a,a.next)&&(Ka(a),a=a.next),a}function ka(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!qa(n,n.next)&&0!==Va(n.prev,n,n.next))n=n.next;else{if(Ka(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function Pa(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=Na(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?Da(t,n,i,o):Ma(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),Ka(t),t=u.next,l=u.next;else if((t=u)===l){a?1===a?Pa(t=La(ka(t),e,r),e,r,n,i,o,2):2===a&&Ra(t,e,r,n,i,o):Pa(ka(t),e,r,n,i,o,1);break}}}function Ma(t){var e=t.prev,r=t,n=t.next;if(Va(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Ua(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&Va(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Da(t,e,r,n){var i=t.prev,o=t,a=t.next;if(Va(i,o,a)>=0)return!1;for(var s=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,u=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,l=Na(i.x=l&&h&&h.z<=c;){if(p!==t.prev&&p!==t.next&&Ua(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Va(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,h!==t.prev&&h!==t.next&&Ua(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&Va(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(;p&&p.z>=l;){if(p!==t.prev&&p!==t.next&&Ua(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Va(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;h&&h.z<=c;){if(h!==t.prev&&h!==t.next&&Ua(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&Va(h.prev,h,h.next)>=0)return!1;h=h.nextZ}return!0}function La(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!qa(i,o)&&Wa(i,n,n.next,o)&&Ha(i,o)&&Ha(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),Ka(n),Ka(n.next),n=t=o),n=n.next}while(n!==t);return ka(n)}function Ra(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&ja(a,s)){var u=Ya(a,s);return a=ka(a,a.next),u=ka(u,u.next),Pa(a,e,r,n,i,o),void Pa(u,e,r,n,i,o)}s=s.next}a=a.next}while(a!==t)}function za(t,e){return t.x-e.x}function Oa(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>=c&&i!==n.x&&Ua(or.x||n.x===r.x&&Ba(r,n)))&&(r=n,h=u)),n=n.next}while(n!==l);return r}(t,e)){var r=Ya(e,t);ka(e,e.next),ka(r,r.next)}}function Ba(t,e){return Va(t.prev,t,e.prev)<0&&Va(e.next,t,t.next)<0}function Na(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 Fa(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 ja(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&&Wa(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Ha(t,e)&&Ha(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)&&(Va(t.prev,t,e.prev)||Va(t,e.prev,e))||qa(t,e)&&Va(t.prev,t,t.next)>0&&Va(e.prev,e,e.next)>0)}function Va(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function qa(t,e){return t.x===e.x&&t.y===e.y}function Wa(t,e,r,n){var i=Za(Va(t,e,r)),o=Za(Va(t,e,n)),a=Za(Va(r,n,t)),s=Za(Va(r,n,e));return i!==o&&a!==s||!(0!==i||!Ga(t,r,e))||!(0!==o||!Ga(t,n,e))||!(0!==a||!Ga(r,t,n))||!(0!==s||!Ga(r,e,n))}function Ga(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 Za(t){return t>0?1:t<0?-1:0}function Ha(t,e){return Va(t.prev,t,t.next)<0?Va(t,e,t.next)>=0&&Va(t,t.prev,e)>=0:Va(t,e,t.prev)<0||Va(t,t.next,e)<0}function Ya(t,e){var r=new Ja(t.i,t.x,t.y),n=new Ja(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 Xa(t,e,r,n){var i=new Ja(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 Ka(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 Ja(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 Qa(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),c=.5*Math.sqrt(u*l*(a-l)/a)*(s-a/2<0?-1:1);t(e,r,Math.max(n,Math.floor(r-s*l/a+c)),Math.min(i,Math.floor(r+(a-s)*l/a+c)),o)}var p=e[r],h=n,f=i;for(ts(e,n,r),o(e[i],p)>0&&ts(e,n,i);h0;)f--}0===o(e[n],p)?ts(e,n,f):ts(e,++f,i),f<=r&&(n=f+1),r<=f&&(i=f-1)}}(t,e,r||0,n||t.length-1,i||es)}function ts(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function es(t,e){return te?1:0}function rs(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,o=[],a=0;a1)for(var u=0;u0&&r.holes.push(n+=t[i-1].length)}return r},Sa.default=Ca;var as=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 Ai,this.indexArray=new Ui,this.indexArray2=new Zi,this.programConfigurations=new Ro(t.layers,t.zoom),this.segments=new ao,this.segments2=new ao,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};as.prototype.populate=function(t,e,r){this.hasPattern=is("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],o=0,a=t;o>3}if(o--,1===n||2===n)a+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&u.push(e),e=[]),e.push(new i(a,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&u.push(e),u},hs.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]},hs.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=hs.types[this.type];function c(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 vs(t,e,r){if(3===t){var n=new ms(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}ys.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 ps(this._pbf,e,this.extent,this._keys,this._values)};var _s={VectorTile:function(t,e){this.layers=t.readFields(vs,{},e)},VectorTileFeature:ps,VectorTileLayer:ms},xs=_s.VectorTileFeature.types,bs=Math.pow(2,13);function ws(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,2*Math.floor(n*bs)+a,i*bs*2,o*bs*2,Math.round(s))}var Es=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 ki,this.indexArray=new Ui,this.programConfigurations=new Ro(t.layers,t.zoom),this.segments=new ao,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Ts(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}Es.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=is("fill-extrusion",this.layers,e);for(var n=0,i=t;n8192}))||D.every((function(t){return t.y<0}))||D.every((function(t){return t.y>8192}))))for(var m=0,y=0;y=1){var v=d[y-1];if(!Ts(g,v)){p.vertexLength+4>ao.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var _=g.sub(v)._perp()._unit(),x=v.dist(g);m+x>32768&&(m=0),ws(this.layoutVertexArray,g.x,g.y,_.x,_.y,0,0,m),ws(this.layoutVertexArray,g.x,g.y,_.x,_.y,0,1,m),ws(this.layoutVertexArray,v.x,v.y,_.x,_.y,0,0,m+=x),ws(this.layoutVertexArray,v.x,v.y,_.x,_.y,0,1,m);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+u>ao.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray)),"Polygon"===xs[t.type]){for(var w=[],E=[],T=p.vertexLength,S=0,C=s;S=2&&t[u-1].equals(t[u-2]);)u--;for(var l=0;l0;if(E&&g>l){var S=c.dist(f);if(S>2*p){var C=c.sub(c.sub(f)._mult(p/S)._round());this.updateDistance(f,C),this.addCurrentVertex(C,m,0,0,h),f=C}}var A=f&&d,I=A?r:s?"butt":n;if(A&&"round"===I&&(bi&&(I="bevel"),"bevel"===I&&(b>2&&(I="flipbevel"),b100)v=y.mult(-1);else{var k=b*m.add(y).mag()/m.sub(y).mag();v._perp()._mult(k*(T?-1:1))}this.addCurrentVertex(c,v,0,0,h),this.addCurrentVertex(c,v.mult(-1),0,0,h)}else if("bevel"===I||"fakeround"===I){var P=-Math.sqrt(b*b-1),M=T?P:0,D=T?0:P;if(f&&this.addCurrentVertex(c,m,M,D,h),"fakeround"===I)for(var L=Math.round(180*w/Math.PI/20),R=1;R2*p){var U=c.add(d.sub(c)._mult(p/F)._round());this.updateDistance(c,U),this.addCurrentVertex(U,y,0,0,h),c=U}}}}},Rs.prototype.addCurrentVertex=function(t,e,r,n,i,o){void 0===o&&(o=!1);var a=e.y*n-e.x,s=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,o,!1,r,i),this.addHalfVertex(t,a,s,o,!0,-n,i),this.distance>Ls/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,o))},Rs.prototype.addHalfVertex=function(t,e,r,n,i,o,a){var s=.5*(this.lineClips?this.scaledDistance*(Ls-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t.x<<1)+(n?1:0),(t.y<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===o?0:o<0?-1:1)|(63&s)<<2,s>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var u=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),a.primitiveLength++),i?this.e2=u:this.e1=u},Rs.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Rs.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Bn("LineBucket",Rs,{omit:["layers","patternFeatures"]});var zs=new xi({"line-cap":new mi(It.layout_line["line-cap"]),"line-join":new yi(It.layout_line["line-join"]),"line-miter-limit":new mi(It.layout_line["line-miter-limit"]),"line-round-limit":new mi(It.layout_line["line-round-limit"]),"line-sort-key":new yi(It.layout_line["line-sort-key"])}),Os={paint:new xi({"line-opacity":new yi(It.paint_line["line-opacity"]),"line-color":new yi(It.paint_line["line-color"]),"line-translate":new mi(It.paint_line["line-translate"]),"line-translate-anchor":new mi(It.paint_line["line-translate-anchor"]),"line-width":new yi(It.paint_line["line-width"]),"line-gap-width":new yi(It.paint_line["line-gap-width"]),"line-offset":new yi(It.paint_line["line-offset"]),"line-blur":new yi(It.paint_line["line-blur"]),"line-dasharray":new vi(It.paint_line["line-dasharray"]),"line-pattern":new gi(It.paint_line["line-pattern"]),"line-gradient":new _i(It.paint_line["line-gradient"])}),layout:zs},Bs=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new ai(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=h({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(yi))(Os.paint.properties["line-width"].specification);Bs.useIntegerZoom=!0;var Ns=function(t){function e(e){t.call(this,e,Os),this.gradientVersion=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Ve,this.gradientVersion=(this.gradientVersion+1)%s)},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=Bs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Rs(t)},e.prototype.queryRadius=function(t){var e=t,r=Fs(ta("line-width",this,e),ta("line-gap-width",this,e)),n=ta("line-offset",this,e);return r/2+Math.abs(n)+ea(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,o,a,s){var u=ra(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),l=s/2*Fs(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),c=this.paint.get("line-offset").evaluate(e,r);return c&&(n=function(t,e){for(var r=[],n=new i(0,0),o=0;o=3)for(var o=0;o0?e+2*t:t}var Us=Si([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),js=Si([{name:"a_projected_pos",components:3,type:"Float32"}],4),Vs=(Si([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Si([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),qs=(Si([{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"}]),Si([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Ws=Si([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Gs(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()),oi.applyArabicShaping&&(t=oi.applyArabicShaping(t)),t}(t.text,e,r)})),t}Si([{name:"triangle",components:3,type:"Uint16"}]),Si([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Si([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Si([{type:"Float32",name:"offsetX"}]),Si([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Zs={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"},Hs=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,c=-7,p=r?i-1:0,h=r?-1:1,f=t[e+p];for(p+=h,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+p],p+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+p],p+=h,c-=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,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+p>=1?h/u:h*Math.pow(2,1-p))*u>=2&&(a++,u/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(e*u-1)*Math.pow(2,i),a+=p):(s=e*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(a=a<0;t[r+f]=255&a,f+=d,a/=256,l-=8);t[r+f-d]|=128*m},Xs=Ks;function Ks(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Ks.Varint=0,Ks.Fixed64=1,Ks.Bytes=2,Ks.Fixed32=5;var Js="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Qs(t){return t.type===Ks.Bytes?t.readVarint()+t.pos:t.pos+1}function $s(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function tu(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 eu(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function hu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function fu(t,e,r){1===t&&r.readMessage(du,e)}function du(t,e,r){if(3===t){var n=r.readMessage(mu,{}),i=n.width,o=n.height,a=n.left,s=n.top,u=n.advance;e.push({id:n.id,bitmap:new ga({width:i+6,height:o+6},n.bitmap),metrics:{width:i,height:o,left:a,top:s,advance:u}})}}function mu(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}function yu(t){for(var e=0,r=0,n=0,i=t;n=0;h--){var f=a[h];if(!(p.w>f.w||p.h>f.h)){if(p.x=f.x,p.y=f.y,u=Math.max(u,p.y+p.h),s=Math.max(s,p.x+p.w),p.w===f.w&&p.h===f.h){var d=a.pop();h>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=cu(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=hu(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=cu(this.buf,this.pos)+4294967296*cu(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=cu(this.buf,this.pos)+4294967296*hu(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Hs(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Hs(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(n=(112&(i=o[r.pos++]))>>4,i<128)return $s(t,n,e);if(n|=(127&(i=o[r.pos++]))<<3,i<128)return $s(t,n,e);if(n|=(127&(i=o[r.pos++]))<<10,i<128)return $s(t,n,e);if(n|=(127&(i=o[r.pos++]))<<17,i<128)return $s(t,n,e);if(n|=(127&(i=o[r.pos++]))<<24,i<128)return $s(t,n,e);if(n|=(1&(i=o[r.pos++]))<<31,i<128)return $s(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=this.pos;return this.pos=t,t-e>=12&&Js?function(t,e,r){return Js.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var n="",i=e;i239?4:u>223?3:u>191?2:1;if(i+c>r)break;1===c?u<128&&(l=u):2===c?128==(192&(o=t[i+1]))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===c?(a=t[i+2],128==(192&(o=t[i+1]))&&128==(192&a)&&((l=(15&u)<<12|(63&o)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===c&&(a=t[i+2],s=t[i+3],128==(192&(o=t[i+1]))&&128==(192&a)&&128==(192&s)&&((l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,c=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),i+=c}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Ks.Bytes)return t.push(this.readVarint(e));var r=Qs(this);for(t=t||[];this.pos127;);else if(e===Ks.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Ks.Fixed32)this.pos+=4;else{if(e!==Ks.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;if(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)),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,r.buf[r.pos]=127&(t>>>=7)}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(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&&tu(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&&tu(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Ks.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,eu,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,ru,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,ou,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,nu,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,iu,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,au,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,su,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,uu,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,lu,e)},writeBytesField:function(t,e){this.writeTag(t,Ks.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Ks.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Ks.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Ks.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Ks.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Ks.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Ks.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Ks.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Ks.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Ks.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var gu=function(t,e){var r=e.pixelRatio,n=e.version,i=e.stretchX,o=e.stretchY,a=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=o,this.content=a,this.version=n},vu={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};vu.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},vu.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},vu.tlbr.get=function(){return this.tl.concat(this.br)},vu.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(gu.prototype,vu);var _u=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var o=yu(i),a=new va({width:o.w||1,height:o.h||1});for(var s in t){var u=t[s],l=r[s].paddedRect;va.copy(u.data,a,{x:0,y:0},{x:l.x+1,y:l.y+1},u.data)}for(var c in e){var p=e[c],h=n[c].paddedRect,f=h.x+1,d=h.y+1,m=p.data.width,y=p.data.height;va.copy(p.data,a,{x:0,y:0},{x:f,y:d},p.data),va.copy(p.data,a,{x:0,y:y-1},{x:f,y:d-1},{width:m,height:1}),va.copy(p.data,a,{x:0,y:0},{x:f,y:d+y},{width:m,height:1}),va.copy(p.data,a,{x:m-1,y:0},{x:f-1,y:d},{width:1,height:y}),va.copy(p.data,a,{x:0,y:0},{x:f+m,y:d},{width:1,height:y})}this.image=a,this.iconPositions=r,this.patternPositions=n};_u.prototype.addImages=function(t,e,r){for(var n in t){var i=t[n],o={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(o),e[n]=new gu(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},_u.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)},_u.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl;r.update(e.data,void 0,{x:n[0],y:n[1]})}},Bn("ImagePosition",gu),Bn("ImageAtlas",_u);var xu={horizontal:1,vertical:2,horizontalOnly:3},bu=function(){this.scale=1,this.fontStack="",this.imageName=null};bu.forText=function(t,e){var r=new bu;return r.scale=t||1,r.fontStack=e,r},bu.forImage=function(t){var e=new bu;return e.imageName=t,e};var wu=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function Eu(t,e,r,n,i,o,a,s,u,l,c,p,h,f,d,m){var y,g=wu.fromFeature(t,i);p===xu.vertical&&g.verticalizePunctuation();var v=oi.processBidirectionalText,_=oi.processStyledBidirectionalText;if(v&&1===g.sections.length){y=[];for(var x=0,b=v(g.toString(),Pu(g,l,o,e,n,f,d));x0&&N>S&&(S=N)}else{var F=r[A.fontStack],U=F&&F[k];if(U&&U.rect)D=U.rect,M=U.metrics;else{var j=e[A.fontStack],V=j&&j[k];if(!V)continue;M=V.metrics}P=24*(b-A.scale)}z?(t.verticalizable=!0,T.push({glyph:k,imageName:L,x:h,y:f+P,vertical:z,scale:A.scale,fontStack:A.fontStack,sectionIndex:I,metrics:M,rect:D}),h+=R*A.scale+l):(T.push({glyph:k,imageName:L,x:h,y:f+P,vertical:z,scale:A.scale,fontStack:A.fontStack,sectionIndex:I,metrics:M,rect:D}),h+=M.advance*A.scale+l)}0!==T.length&&(d=Math.max(h-l,d),Du(T,0,T.length-1,y,S)),h=0;var q=o*b+S;E.lineOffset=Math.max(S,w),f+=q,m=Math.max(q,m),++g}else f+=o,++g}var W,G=f- -17,Z=Mu(a),H=Z.horizontalAlign,Y=Z.verticalAlign;(function(t,e,r,n,i,o,a,s,u){var l,c=(e-r)*i;l=o!==a?-s*n- -17:(-n*u+.5)*a;for(var p=0,h=t;p=0&&n>=t&&Tu[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},wu.prototype.substring=function(t,e){var r=new wu;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},wu.prototype.toString=function(){return this.text},wu.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},wu.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(bu.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var Tu={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Su={};function Cu(t,e,r,n,i,o){if(e.imageName){var a=n[e.imageName];return a?a.displaySize[0]*e.scale*24/o+i:0}var s=r[e.fontStack],u=s&&s[t];return u?u.metrics.advance*e.scale+i:0}function Au(t,e,r,n){var i=Math.pow(t-e,2);return n?t=0,p=0,h=0;h-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(p)}return!0}function Uu(t){for(var e=0,r=0;rl){var d=(l-u)/f,m=qe(p.x,h.x,d),y=qe(p.y,h.y,d),g=new Ru(m,y,h.angleTo(p),c);return g._round(),!a||Fu(t,g,s,a,e)?g:void 0}u+=f}}function Wu(t,e,r,n,i,o,a,s,u){var l=ju(n,o,a),c=Vu(n,i),p=c*a,h=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return e-p=0&&b=0&&w=0&&f+c<=p){var E=new Ru(b,w,_,m);E._round(),i&&!Fu(e,E,a,i,o)||d.push(E)}}h+=v}return u||d.length||s||(d=t(e,h/2,n,i,o,a,s,!0,l)),d}(t,h?e/2*s%e:(c/2+2*o)*a*s%e,e,l,r,p,h,!1,u)}function Gu(t,e,r,n,o){for(var a=[],s=0;s=n&&h.x>=n||(p.x>=n?p=new i(n,p.y+(n-p.x)/(h.x-p.x)*(h.y-p.y))._round():h.x>=n&&(h=new i(n,p.y+(n-p.x)/(h.x-p.x)*(h.y-p.y))._round()),p.y>=o&&h.y>=o||(p.y>=o?p=new i(p.x+(o-p.y)/(h.y-p.y)*(h.x-p.x),o)._round():h.y>=o&&(h=new i(p.x+(o-p.y)/(h.y-p.y)*(h.x-p.x),o)._round()),l&&p.equals(l[l.length-1])||a.push(l=[p]),l.push(h)))))}return a}function Zu(t,e,r,n){var o=[],a=t.image,s=a.pixelRatio,u=a.paddedRect.w-2,l=a.paddedRect.h-2,c=t.right-t.left,p=t.bottom-t.top,h=a.stretchX||[[0,u]],f=a.stretchY||[[0,l]],d=function(t,e){return t+e[1]-e[0]},m=h.reduce(d,0),y=f.reduce(d,0),g=u-m,v=l-y,_=0,x=m,b=0,w=y,E=0,T=g,S=0,C=v;if(a.content&&n){var A=a.content;_=Hu(h,0,A[0]),b=Hu(f,0,A[1]),x=Hu(h,A[0],A[2]),w=Hu(f,A[1],A[3]),E=A[0]-_,S=A[1]-b,T=A[2]-A[0]-x,C=A[3]-A[1]-w}var I=function(n,o,u,l){var h=Xu(n.stretch-_,x,c,t.left),f=Ku(n.fixed-E,T,n.stretch,m),d=Xu(o.stretch-b,w,p,t.top),g=Ku(o.fixed-S,C,o.stretch,y),v=Xu(u.stretch-_,x,c,t.left),A=Ku(u.fixed-E,T,u.stretch,m),I=Xu(l.stretch-b,w,p,t.top),k=Ku(l.fixed-S,C,l.stretch,y),P=new i(h,d),M=new i(v,d),D=new i(v,I),L=new i(h,I),R=new i(f/s,g/s),z=new i(A/s,k/s),O=e*Math.PI/180;if(O){var B=Math.sin(O),N=Math.cos(O),F=[N,-B,B,N];P._matMult(F),M._matMult(F),L._matMult(F),D._matMult(F)}var U=n.stretch+n.fixed,j=o.stretch+o.fixed;return{tl:P,tr:M,bl:L,br:D,tex:{x:a.paddedRect.x+1+U,y:a.paddedRect.y+1+j,w:u.stretch+u.fixed-U,h:l.stretch+l.fixed-j},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:R,pixelOffsetBR:z,minFontScaleX:T/s/c,minFontScaleY:C/s/p,isSDF:r}};if(n&&(a.stretchX||a.stretchY))for(var k=Yu(h,g,m),P=Yu(f,v,y),M=0;M0&&(d=Math.max(10,d),this.circleDiameter=d)}else{var m=a.top*s-u,y=a.bottom*s+u,g=a.left*s-u,v=a.right*s+u,_=a.collisionPadding;if(_&&(g-=_[0]*s,m-=_[1]*s,v+=_[2]*s,y+=_[3]*s),c){var x=new i(g,m),b=new i(v,m),w=new i(g,y),E=new i(v,y),T=c*Math.PI/180;x._rotate(T),b._rotate(T),w._rotate(T),E._rotate(T),g=Math.min(x.x,b.x,w.x,E.x),v=Math.max(x.x,b.x,w.x,E.x),m=Math.min(x.y,b.y,w.y,E.y),y=Math.max(x.y,b.y,w.y,E.y)}t.emplaceBack(e.x,e.y,g,m,v,y,r,n,o)}this.boxEndIndex=t.length},Qu=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=$u),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function $u(t,e){return te?1:0}function tl(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,o=1/0,a=-1/0,s=-1/0,u=t[0],l=0;la)&&(a=c.x),(!l||c.y>s)&&(s=c.y)}var p=Math.min(a-n,s-o),h=p/2,f=new Qu([],el);if(0===p)return new i(n,o);for(var d=n;dy.d||!y.d)&&(y=v,r&&console.log("found best %d after %d probes",Math.round(1e4*v.d)/1e4,g)),v.max-y.d<=e||(f.push(new rl(v.p.x-(h=v.h/2),v.p.y-h,h,t)),f.push(new rl(v.p.x+h,v.p.y-h,h,t)),f.push(new rl(v.p.x-h,v.p.y+h,h,t)),f.push(new rl(v.p.x+h,v.p.y+h,h,t)),g+=4)}return r&&(console.log("num probes: "+g),console.log("best distance: "+y.d)),y.p}function el(t,e){return e.max-t.max}function rl(t,e,r,n){this.p=new i(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,i=0;it.y!=c.y>t.y&&t.x<(c.x-l.x)*(t.y-l.y)/(c.y-l.y)+l.x&&(r=!r),n=Math.min(n,Ko(t,l,c))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}Qu.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},Qu.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}},Qu.prototype.peek=function(){return this.data[0]},Qu.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},Qu.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 nl=Number.POSITIVE_INFINITY;function il(t,e){return e[1]!==nl?function(t,e,r){var n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,i]}(t,e[0],e[1]):function(t,e){var r=0,n=0;e<0&&(e=0);var i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(t,e[0])}function ol(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function al(t,e,r,n,o,a,s,u,l,c,p,h,f,d,m){var y=function(t,e,r,n,o,a,s,u){for(var l=n.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,c=[],p=0,h=e.positionedLines;p32640&&E(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===g.kind&&((v=[128*d.compositeTextSizes[0].evaluate(s,{},m),128*d.compositeTextSizes[1].evaluate(s,{},m)])[0]>32640||v[1]>32640)&&E(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,y,v,u,a,s,c,e,l.lineStartIndex,l.lineLength,f,m);for(var _=0,x=p;_=0;a--)if(n.dist(o[a])0)&&("constant"!==o.value.kind||o.value.value.length>0),l="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,c=i.get("symbol-sort-key");if(this.features=[],u||l){for(var p=e.iconDependencies,h=e.glyphDependencies,f=e.availableImages,d=new ai(this.zoom),m=0,y=t;m=0;for(var D=0,L=T.sections;D=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},yl.prototype.hasIconData=function(){return this.icon.segments.get().length>0},yl.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},yl.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},yl.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},yl.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i1||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.addIndicesForPlacedSymbol(e.text,t)})),i.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,i.verticalPlacedTextSymbolIndex),i.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.placedIconSymbolIndex),i.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Bn("SymbolBucket",yl,{omit:["layers","collisionBoxArray","features","compareText"]}),yl.MAX_GLYPHS=65535,yl.addDynamicAttributes=hl;var gl=new xi({"symbol-placement":new mi(It.layout_symbol["symbol-placement"]),"symbol-spacing":new mi(It.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new mi(It.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new yi(It.layout_symbol["symbol-sort-key"]),"symbol-z-order":new mi(It.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new mi(It.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new mi(It.layout_symbol["icon-ignore-placement"]),"icon-optional":new mi(It.layout_symbol["icon-optional"]),"icon-rotation-alignment":new mi(It.layout_symbol["icon-rotation-alignment"]),"icon-size":new yi(It.layout_symbol["icon-size"]),"icon-text-fit":new mi(It.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new mi(It.layout_symbol["icon-text-fit-padding"]),"icon-image":new yi(It.layout_symbol["icon-image"]),"icon-rotate":new yi(It.layout_symbol["icon-rotate"]),"icon-padding":new mi(It.layout_symbol["icon-padding"]),"icon-keep-upright":new mi(It.layout_symbol["icon-keep-upright"]),"icon-offset":new yi(It.layout_symbol["icon-offset"]),"icon-anchor":new yi(It.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new mi(It.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new mi(It.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new mi(It.layout_symbol["text-rotation-alignment"]),"text-field":new yi(It.layout_symbol["text-field"]),"text-font":new yi(It.layout_symbol["text-font"]),"text-size":new yi(It.layout_symbol["text-size"]),"text-max-width":new yi(It.layout_symbol["text-max-width"]),"text-line-height":new mi(It.layout_symbol["text-line-height"]),"text-letter-spacing":new yi(It.layout_symbol["text-letter-spacing"]),"text-justify":new yi(It.layout_symbol["text-justify"]),"text-radial-offset":new yi(It.layout_symbol["text-radial-offset"]),"text-variable-anchor":new mi(It.layout_symbol["text-variable-anchor"]),"text-anchor":new yi(It.layout_symbol["text-anchor"]),"text-max-angle":new mi(It.layout_symbol["text-max-angle"]),"text-writing-mode":new mi(It.layout_symbol["text-writing-mode"]),"text-rotate":new yi(It.layout_symbol["text-rotate"]),"text-padding":new mi(It.layout_symbol["text-padding"]),"text-keep-upright":new mi(It.layout_symbol["text-keep-upright"]),"text-transform":new yi(It.layout_symbol["text-transform"]),"text-offset":new yi(It.layout_symbol["text-offset"]),"text-allow-overlap":new mi(It.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new mi(It.layout_symbol["text-ignore-placement"]),"text-optional":new mi(It.layout_symbol["text-optional"])}),vl={paint:new xi({"icon-opacity":new yi(It.paint_symbol["icon-opacity"]),"icon-color":new yi(It.paint_symbol["icon-color"]),"icon-halo-color":new yi(It.paint_symbol["icon-halo-color"]),"icon-halo-width":new yi(It.paint_symbol["icon-halo-width"]),"icon-halo-blur":new yi(It.paint_symbol["icon-halo-blur"]),"icon-translate":new mi(It.paint_symbol["icon-translate"]),"icon-translate-anchor":new mi(It.paint_symbol["icon-translate-anchor"]),"text-opacity":new yi(It.paint_symbol["text-opacity"]),"text-color":new yi(It.paint_symbol["text-color"],{runtimeType:Ut,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new yi(It.paint_symbol["text-halo-color"]),"text-halo-width":new yi(It.paint_symbol["text-halo-width"]),"text-halo-blur":new yi(It.paint_symbol["text-halo-blur"]),"text-translate":new mi(It.paint_symbol["text-translate"]),"text-translate-anchor":new mi(It.paint_symbol["text-translate-anchor"])}),layout:gl},_l=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Ot,this.defaultValue=t};_l.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},_l.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},_l.prototype.outputDefined=function(){return!1},_l.prototype.serialize=function(){return null},Bn("FormatSectionOverride",_l,{omit:["defaultValue"]});var xl=function(t){function e(e){t.call(this,e,vl)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],o=0,a=n;o",targetMapId:n,sourceMapId:o.mapId})}}},Rl.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 C()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Rl.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Rl.prototype.processTask=function(t,e){var r=this;if(""===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(Vn(e.error)):n(null,Vn(e.data)))}else{var i=!1,o=k(this.globalScope)?void 0:[],a=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"",sourceMapId:r.mapId,error:e?jn(e):null,data:jn(n,o)},o)}:function(t){i=!0},s=null,u=Vn(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,u,a);else if(this.parent.getWorkerSource){var l=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,l[0],u.source)[l[1]](u,a)}else a(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Rl.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Ol=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Ol.prototype.setNorthEast=function(t){return this._ne=t instanceof Bl?new Bl(t.lng,t.lat):Bl.convert(t),this},Ol.prototype.setSouthWest=function(t){return this._sw=t instanceof Bl?new Bl(t.lng,t.lat):Bl.convert(t),this},Ol.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof Bl)e=t,r=t;else{if(!(t instanceof Ol))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(Ol.convert(t)):this.extend(Bl.convert(t)):this;if(r=t._ne,!(e=t._sw)||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Bl(e.lng,e.lat),this._ne=new Bl(r.lng,r.lat)),this},Ol.prototype.getCenter=function(){return new Bl((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Ol.prototype.getSouthWest=function(){return this._sw},Ol.prototype.getNorthEast=function(){return this._ne},Ol.prototype.getNorthWest=function(){return new Bl(this.getWest(),this.getNorth())},Ol.prototype.getSouthEast=function(){return new Bl(this.getEast(),this.getSouth())},Ol.prototype.getWest=function(){return this._sw.lng},Ol.prototype.getSouth=function(){return this._sw.lat},Ol.prototype.getEast=function(){return this._ne.lng},Ol.prototype.getNorth=function(){return this._ne.lat},Ol.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Ol.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Ol.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Ol.prototype.contains=function(t){var e=Bl.convert(t),r=e.lng,n=e.lat,i=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&i},Ol.convert=function(t){return!t||t instanceof Ol?t:new Ol(t)};var Bl=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Bl.prototype.wrap=function(){return new Bl(p(this.lng,-180,180),this.lat)},Bl.prototype.toArray=function(){return[this.lng,this.lat]},Bl.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Bl.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(i,1))},Bl.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 Ol(new Bl(this.lng-r,this.lat-e),new Bl(this.lng+r,this.lat+e))},Bl.convert=function(t){if(t instanceof Bl)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Bl(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Bl(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 Nl=2*Math.PI*6371008.8;function Fl(t){return Nl*Math.cos(t*Math.PI/180)}function Ul(t){return(180+t)/360}function jl(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Vl(t,e){return t/Fl(e)}function ql(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var Wl=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};Wl.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Bl.convert(t);return new Wl(Ul(r.lng),jl(r.lat),Vl(e,r.lat))},Wl.prototype.toLngLat=function(){return new Bl(360*this.x-180,ql(this.y))},Wl.prototype.toAltitude=function(){return this.z*Fl(ql(this.y))},Wl.prototype.meterInMercatorCoordinateUnits=function(){return 1/Nl*(t=ql(this.y),1/Math.cos(t*Math.PI/180));var t};var Gl=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Yl(0,t,t,e,r)};Gl.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Gl.prototype.url=function(t,e){var r,n,i,o,a,s=(n=this.y,i=this.z,o=zl(256*(r=this.x),256*(n=Math.pow(2,i)-n-1),i),a=zl(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 Hl(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Hl(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Hl.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?Yl(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Yl(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},Hl.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},Hl.prototype.children=function(t){if(this.overscaledZ>=t)return[new Hl(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 Hl(e,this.wrap,e,r,n),new Hl(e,this.wrap,e,r+1,n),new Hl(e,this.wrap,e,r,n+1),new Hl(e,this.wrap,e,r+1,n+1)]},Hl.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=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)},Xl.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Xl.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Xl.prototype.getPixels=function(){return new va({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Xl.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;l=0&&c[3]>=0&&s.insert(a,c[0],c[1],c[2],c[3])}},tc.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new _s.VectorTile(new Xs(this.rawTileData)).layers,this.sourceLayerCoder=new Kl(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},tc.prototype.query=function(t,e,r,n){var o=this;this.loadVTLayers();for(var a=t.params||{},s=8192/t.tileSize/t.scale,u=on(a.filter),l=t.queryGeometry,c=t.queryPadding*s,p=rc(l),h=this.grid.query(p.minX-c,p.minY-c,p.maxX+c,p.maxY+c),f=rc(t.cameraQueryGeometry),d=0,m=this.grid3D.query(f.minX-c,f.minY-c,f.maxX+c,f.maxY+c,(function(e,r,n,o){return function(t,e,r,n,o){for(var a=0,s=t;a=u.x&&o>=u.y)return!0}var l=[new i(e,r),new i(e,o),new i(n,o),new i(n,r)];if(t.length>2)for(var c=0,p=l;c=0)return!0;return!1}(o,p)){var f=this.sourceLayerCoder.decode(r),d=this.vtLayers[f].feature(n);if(i.needGeometry){var m=Uo(d,!0);if(!i.filter(new ai(this.tileID.overscaledZ),m,this.tileID.canonical))return}else if(!i.filter(new ai(this.tileID.overscaledZ),d))return;for(var y=this.getId(d,f),g=0;gn)i=!1;else if(e)if(this.expirationTimeut&&(t.getActor().send("enforceCacheSizeLimit",st),ht=0)},t.clamp=c,t.clearTileCache=function(t){var e=a.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=Gu,t.clone=function(t){var e=new oa(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=b,t.clone$2=function(t){var e=new oa(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=Ws,t.config=F,t.create=function(){var t=new oa(16);return oa!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new oa(9);return oa!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new oa(4);return oa!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Gr,t.createLayout=Si,t.createStyleLayer=function(t){return"custom"===t.type?new Sl(t):new Cl[t.type](t)},t.cross=function(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2];return t[0]=i*u-o*s,t[1]=o*a-n*u,t[2]=n*s-i*a,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0;n=F.MAX_PARALLEL_IMAGE_REQUESTS){var n={requestParameters:e,callback:r,cancelled:!1,cancel:function(){this.cancelled=!0}};return mt.push(n),n}yt++;var i=!1,o=function(){if(!i)for(i=!0,yt--;mt.length&&yt0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t},t.number=qe,t.offscreenCanvasSupported=ft,t.ortho=function(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(a+o)*l,t[15]=1,t},t.parseGlyphPBF=function(t){return new Xs(t).readFields(fu,[])},t.pbf=Xs,t.performSymbolLayout=function(t,e,r,n,i,o,a){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var s=t.layers[0].layout,u=t.layers[0]._unevaluatedLayout._values,l={};if("composite"===t.textSizeData.kind){var c=t.textSizeData,p=c.maxZoom;l.compositeTextSizes=[u["text-size"].possiblyEvaluate(new ai(c.minZoom),a),u["text-size"].possiblyEvaluate(new ai(p),a)]}if("composite"===t.iconSizeData.kind){var h=t.iconSizeData,f=h.maxZoom;l.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new ai(h.minZoom),a),u["icon-size"].possiblyEvaluate(new ai(f),a)]}l.layoutTextSize=u["text-size"].possiblyEvaluate(new ai(t.zoom+1),a),l.layoutIconSize=u["icon-size"].possiblyEvaluate(new ai(t.zoom+1),a),l.textMaxSize=u["text-size"].possiblyEvaluate(new ai(18));for(var d=24*s.get("text-line-height"),m="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement"),y=s.get("text-keep-upright"),g=s.get("text-size"),v=function(){var o=x[_],u=s.get("text-font").evaluate(o,{},a).join(","),c=g.evaluate(o,{},a),p=l.layoutTextSize.evaluate(o,{},a),h=l.layoutIconSize.evaluate(o,{},a),f={horizontal:{},vertical:void 0},v=o.text,b=[0,0];if(v){var w=v.toString(),T=24*s.get("text-letter-spacing").evaluate(o,{},a),S=function(t){for(var e=0,r=t;e=8192||p.y<0||p.y>=8192||function(t,e,r,n,i,o,a,s,u,l,c,p,h,f,d,m,y,g,v,_,x,b,w,T,S){var C,A,I,k,P,M=t.addToLineVertexArray(e,r),D=0,L=0,R=0,z=0,O=-1,B=-1,N={},F=po(""),U=0,j=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(U=(C=s.layout.get("text-offset").evaluate(x,{},T).map((function(t){return 24*t})))[0],j=C[1]):(U=24*s.layout.get("text-radial-offset").evaluate(x,{},T),j=nl),t.allowVerticalPlacement&&n.vertical){var V=s.layout.get("text-rotate").evaluate(x,{},T)+90;k=new Ju(u,e,l,c,p,n.vertical,h,f,d,V),a&&(P=new Ju(u,e,l,c,p,a,y,g,d,V))}if(i){var q=s.layout.get("icon-rotate").evaluate(x,{}),W="none"!==s.layout.get("icon-text-fit"),G=Zu(i,q,w,W),Z=a?Zu(a,q,w,W):void 0;I=new Ju(u,e,l,c,p,i,y,g,!1,q),D=4*G.length;var H=t.iconSizeData,Y=null;"source"===H.kind?(Y=[128*s.layout.get("icon-size").evaluate(x,{})])[0]>32640&&E(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===H.kind&&((Y=[128*b.compositeIconSizes[0].evaluate(x,{},T),128*b.compositeIconSizes[1].evaluate(x,{},T)])[0]>32640||Y[1]>32640)&&E(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,G,Y,_,v,x,!1,e,M.lineStartIndex,M.lineLength,-1,T),O=t.icon.placedSymbolArray.length-1,Z&&(L=4*Z.length,t.addSymbols(t.icon,Z,Y,_,v,x,xu.vertical,e,M.lineStartIndex,M.lineLength,-1,T),B=t.icon.placedSymbolArray.length-1)}for(var X in n.horizontal){var K=n.horizontal[X];if(!A){F=po(K.text);var J=s.layout.get("text-rotate").evaluate(x,{},T);A=new Ju(u,e,l,c,p,K,h,f,d,J)}var Q=1===K.positionedLines.length;if(R+=al(t,e,K,o,s,d,x,m,M,n.vertical?xu.horizontal:xu.horizontalOnly,Q?Object.keys(n.horizontal):[X],N,O,b,T),Q)break}n.vertical&&(z+=al(t,e,n.vertical,o,s,d,x,m,M,xu.vertical,["vertical"],N,B,b,T));var $=A?A.boxStartIndex:t.collisionBoxArray.length,tt=A?A.boxEndIndex:t.collisionBoxArray.length,et=k?k.boxStartIndex:t.collisionBoxArray.length,rt=k?k.boxEndIndex:t.collisionBoxArray.length,nt=I?I.boxStartIndex:t.collisionBoxArray.length,it=I?I.boxEndIndex:t.collisionBoxArray.length,ot=P?P.boxStartIndex:t.collisionBoxArray.length,at=P?P.boxEndIndex:t.collisionBoxArray.length,st=-1,ut=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};st=ut(A,st),st=ut(k,st),st=ut(I,st);var lt=(st=ut(P,st))>-1?1:0;lt&&(st*=S/24),t.glyphOffsetArray.length>=yl.MAX_GLYPHS&&E("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==x.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,x.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,N.right>=0?N.right:-1,N.center>=0?N.center:-1,N.left>=0?N.left:-1,N.vertical||-1,O,B,F,$,tt,et,rt,nt,it,ot,at,l,R,z,D,L,lt,0,h,U,j,st)}(t,p,s,r,n,i,h,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,g,b,S,u,_,w,C,d,e,o,l,c,a)};if("line"===A)for(var M=0,D=Gu(e.geometry,0,0,8192,8192);M1){var U=qu(F,T,r.vertical||m,n,24,v);U&&P(F,U)}}else if("Polygon"===e.type)for(var j=0,V=rs(e.geometry,0);j=I.maxzoom||"none"!==I.visibility&&(a(A,this.zoom,n),(m[I.id]=I.createBucket({index:c.bucketLayerIDs.length,layers:A,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:x,sourceID:this.source})).populate(b,y,this.tileID.canonical),c.bucketLayerIDs.push(A.map((function(t){return t.id}))))}}}var k=t.mapObject(y.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(k).length?o.send("getGlyphs",{uid:this.uid,stacks:k},(function(t,e){p||(p=t,h=e,D.call(u))})):h={};var P=Object.keys(y.iconDependencies);P.length?o.send("getImages",{icons:P,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){p||(p=t,f=e,D.call(u))})):f={};var M=Object.keys(y.patternDependencies);function D(){if(p)return s(p);if(h&&f&&d){var e=new i(h),r=new t.ImageAtlas(f,d);for(var o in m){var u=m[o];u instanceof t.SymbolBucket?(a(u.layers,this.zoom,n),t.performSymbolLayout(u,h,e.positions,f,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):u.hasPattern&&(u instanceof t.LineBucket||u instanceof t.FillBucket||u instanceof t.FillExtrusionBucket)&&(a(u.layers,this.zoom,n),u.addFeatures(y,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:t.values(m).filter((function(t){return!t.isEmpty()})),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?h:null,iconMap:this.returnDependencies?f:null,glyphPositions:this.returnDependencies?e.positions:null})}}M.length?o.send("getImages",{icons:M,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){p||(p=t,d=e,D.call(u))})):d={},D.call(this)};var u=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||s,this.loading={},this.loaded={}};u.prototype.loadTile=function(e,r){var n=this,i=e.uid;this.loading||(this.loading={});var a=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[i]=new o(e);s.abort=this.loadVectorData(e,(function(e,o){if(delete n.loading[i],e||!o)return s.status="done",n.loaded[i]=s,r(e);var u=o.rawData,l={};o.expires&&(l.expires=o.expires),o.cacheControl&&(l.cacheControl=o.cacheControl);var c={};if(a){var p=a.finish();p&&(c.resourceTiming=JSON.parse(JSON.stringify(p)))}s.vectorTile=o.vectorTile,s.parse(o.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:u.slice(0)},n,l,c))})),n.loaded=n.loaded||{},n.loaded[i]=s}))},u.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,o=this;if(n&&n[i]){var a=n[i];a.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var i=a.reloadCallback;i&&(delete a.reloadCallback,a.parse(a.vectorTile,o.layerIndex,r.availableImages,o.actor,i)),e(t,n)};"parsing"===a.status?a.reloadCallback=s:"done"===a.status&&(a.vectorTile?a.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},u.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()},u.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var l=t.window.ImageBitmap,c=function(){this.loaded={}};function p(t,e){if(0!==t.length){h(t[0],e);for(var r=1;r