i&&(I="bevel"),"bevel"===I&&(w>2&&(I="flipbevel"),w100)y=v.mult(-1);else{var k=w*m.add(v).mag()/m.sub(v).mag();y._perp()._mult(k*(S?-1:1))}this.addCurrentVertex(l,y,0,0,f),this.addCurrentVertex(l,y.mult(-1),0,0,f)}else if("bevel"===I||"fakeround"===I){var R=-Math.sqrt(w*w-1),D=S?R:0,N=S?0:R;if(p&&this.addCurrentVertex(l,m,D,N,f),"fakeround"===I)for(var P=Math.round(180*x/Math.PI/20),O=1;O2*h){var j=l.add(d.sub(l)._mult(h/B)._round());this.updateDistance(l,j),this.addCurrentVertex(j,v,0,0,f),l=j}}}}},Ls.prototype.addCurrentVertex=function(e,t,n,r,i,o){void 0===o&&(o=!1);var a=t.y*r-t.x,s=-t.y-t.x*r;this.addHalfVertex(e,t.x+t.y*n,t.y-t.x*n,o,!1,n,i),this.addHalfVertex(e,a,s,o,!0,-r,i),this.distance>Os/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(e,t,n,r,i,o))},Ls.prototype.addHalfVertex=function(e,t,n,r,i,o,a){var s=.5*(this.lineClips?this.scaledDistance*(Os-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e.x<<1)+(r?1:0),(e.y<<1)+(i?1:0),Math.round(63*t)+128,Math.round(63*n)+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},Ls.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Ls.prototype.updateDistance=function(e,t){this.distance+=e.dist(t),this.updateScaledDistance()},zr("LineBucket",Ls,{omit:["layers","patternFeatures"]});var Ms=new wi({"line-cap":new vi(ke.layout_line["line-cap"]),"line-join":new gi(ke.layout_line["line-join"]),"line-miter-limit":new vi(ke.layout_line["line-miter-limit"]),"line-round-limit":new vi(ke.layout_line["line-round-limit"]),"line-sort-key":new gi(ke.layout_line["line-sort-key"])}),Fs={paint:new wi({"line-opacity":new gi(ke.paint_line["line-opacity"]),"line-color":new gi(ke.paint_line["line-color"]),"line-translate":new vi(ke.paint_line["line-translate"]),"line-translate-anchor":new vi(ke.paint_line["line-translate-anchor"]),"line-width":new gi(ke.paint_line["line-width"]),"line-gap-width":new gi(ke.paint_line["line-gap-width"]),"line-offset":new gi(ke.paint_line["line-offset"]),"line-blur":new gi(ke.paint_line["line-blur"]),"line-dasharray":new _i(ke.paint_line["line-dasharray"]),"line-pattern":new yi(ke.paint_line["line-pattern"]),"line-gradient":new bi(ke.paint_line["line-gradient"])}),layout:Ms},zs=new(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.possiblyEvaluate=function(t,n){return n=new si(Math.floor(n.zoom),{now:n.now,fadeDuration:n.fadeDuration,zoomHistory:n.zoomHistory,transition:n.transition}),e.prototype.possiblyEvaluate.call(this,t,n)},t.prototype.evaluate=function(t,n,r,i){return n=f({},n,{zoom:Math.floor(n.zoom)}),e.prototype.evaluate.call(this,t,n,r,i)},t}(gi))(Fs.paint.properties["line-width"].specification);zs.useIntegerZoom=!0;var Bs=function(e){function t(t){e.call(this,t,Fs),this.gradientVersion=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._handleSpecialPaintPropertyUpdate=function(e){"line-gradient"===e&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof qt,this.gradientVersion=(this.gradientVersion+1)%s)},t.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},t.prototype.recalculate=function(t,n){e.prototype.recalculate.call(this,t,n),this.paint._values["line-floorwidth"]=zs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)},t.prototype.createBucket=function(e){return new Ls(e)},t.prototype.queryRadius=function(e){var t=e,n=js(ta("line-width",this,t),ta("line-gap-width",this,t)),r=ta("line-offset",this,t);return n/2+Math.abs(r)+na(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(e,t,n,r,o,a,s){var u=ra(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),c=s/2*js(this.paint.get("line-width").evaluate(t,n),this.paint.get("line-gap-width").evaluate(t,n)),l=this.paint.get("line-offset").evaluate(t,n);return l&&(r=function(e,t){for(var n=[],r=new i(0,0),o=0;o=3)for(var o=0;o0?t+2*e:e}var Us=Ai([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Vs=Ai([{name:"a_projected_pos",components:3,type:"Float32"}],4),qs=(Ai([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Ai([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Hs=(Ai([{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"}]),Ai([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Gs=Ai([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Ws(e,t,n){return e.sections.forEach((function(e){e.text=function(e,t,n){var r=t.layout.get("text-transform").evaluate(n,{});return"uppercase"===r?e=e.toLocaleUpperCase():"lowercase"===r&&(e=e.toLocaleLowerCase()),ai.applyArabicShaping&&(e=ai.applyArabicShaping(e)),e}(e.text,t,n)})),e}Ai([{name:"triangle",components:3,type:"Uint16"}]),Ai([{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"}]),Ai([{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"}]),Ai([{type:"Float32",name:"offsetX"}]),Ai([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Ks={"!":"\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"},Ys=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,l=-7,h=n?i-1:0,f=n?-1:1,p=e[t+h];for(h+=f,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+e[t+h],h+=f,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+h],h+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=c}return(p?-1:1)*a*Math.pow(2,o-r)},Zs=function(e,t,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(t*u-1)*Math.pow(2,i),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&s,p+=d,s/=256,i-=8);for(a=a<0;e[n+p]=255&a,p+=d,a/=256,c-=8);e[n+p-d]|=128*m},Xs=Qs;function Qs(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}Qs.Varint=0,Qs.Fixed64=1,Qs.Bytes=2,Qs.Fixed32=5;var Js="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function $s(e){return e.type===Qs.Bytes?e.readVarint()+e.pos:e.pos+1}function eu(e,t,n){return n?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function tu(e,t,n){var r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=e;i--)n.buf[i+r]=n.buf[i]}function nu(e,t){for(var n=0;n>>8,e[n+2]=t>>>16,e[n+3]=t>>>24}function pu(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function du(e,t,n){1===e&&n.readMessage(mu,t)}function mu(e,t,n){if(3===e){var r=n.readMessage(vu,{}),i=r.width,o=r.height,a=r.left,s=r.top,u=r.advance;t.push({id:r.id,bitmap:new ya({width:i+6,height:o+6},r.bitmap),metrics:{width:i,height:o,left:a,top:s,advance:u}})}}function vu(e,t,n){1===e?t.id=n.readVarint():2===e?t.bitmap=n.readBytes():3===e?t.width=n.readVarint():4===e?t.height=n.readVarint():5===e?t.left=n.readSVarint():6===e?t.top=n.readSVarint():7===e&&(t.advance=n.readVarint())}function gu(e){for(var t=0,n=0,r=0,i=e;r=0;f--){var p=a[f];if(!(h.w>p.w||h.h>p.h)){if(h.x=p.x,h.y=p.y,u=Math.max(u,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===p.w&&h.h===p.h){var d=a.pop();f>3,o=this.pos;this.type=7&r,e(i,t,this),this.pos===o&&this.skip(r)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=hu(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=pu(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=hu(this.buf,this.pos)+4294967296*hu(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=hu(this.buf,this.pos)+4294967296*pu(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=Ys(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Ys(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,n,r=this.buf;return t=127&(n=r[this.pos++]),n<128?t:(t|=(127&(n=r[this.pos++]))<<7,n<128?t:(t|=(127&(n=r[this.pos++]))<<14,n<128?t:(t|=(127&(n=r[this.pos++]))<<21,n<128?t:function(e,t,n){var r,i,o=n.buf;if(r=(112&(i=o[n.pos++]))>>4,i<128)return eu(e,r,t);if(r|=(127&(i=o[n.pos++]))<<3,i<128)return eu(e,r,t);if(r|=(127&(i=o[n.pos++]))<<10,i<128)return eu(e,r,t);if(r|=(127&(i=o[n.pos++]))<<17,i<128)return eu(e,r,t);if(r|=(127&(i=o[n.pos++]))<<24,i<128)return eu(e,r,t);if(r|=(1&(i=o[n.pos++]))<<31,i<128)return eu(e,r,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(n=r[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&Js?function(e,t,n){return Js.decode(e.subarray(t,n))}(this.buf,t,e):function(e,t,n){for(var r="",i=t;i239?4:u>223?3:u>191?2:1;if(i+l>n)break;1===l?u<128&&(c=u):2===l?128==(192&(o=e[i+1]))&&(c=(31&u)<<6|63&o)<=127&&(c=null):3===l?(a=e[i+2],128==(192&(o=e[i+1]))&&128==(192&a)&&((c=(15&u)<<12|(63&o)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===l&&(a=e[i+2],s=e[i+3],128==(192&(o=e[i+1]))&&128==(192&a)&&128==(192&s)&&((c=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,l=1):c>65535&&(c-=65536,r+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),r+=String.fromCharCode(c),i+=l}return r}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==Qs.Bytes)return e.push(this.readVarint(t));var n=$s(this);for(e=e||[];this.pos127;);else if(t===Qs.Bytes)this.pos=this.readVarint()+this.pos;else if(t===Qs.Fixed32)this.pos+=4;else{if(t!==Qs.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t268435455||e<0?function(e,t){var n,r;if(e>=0?(n=e%4294967296|0,r=e/4294967296|0):(r=~(-e/4294967296),4294967295^(n=~(-e%4294967296))?n=n+1|0:(n=0,r=r+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,n){n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,n.buf[n.pos]=127&(e>>>=7)}(n,0,t),function(e,t){var n=(7&e)<<4;t.buf[t.pos++]|=n|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(r,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,n){for(var r,i,o=0;o55295&&r<57344){if(!i){r>56319||o+1===t.length?(e[n++]=239,e[n++]=191,e[n++]=189):i=r;continue}if(r<56320){e[n++]=239,e[n++]=191,e[n++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&(e[n++]=239,e[n++]=191,e[n++]=189,i=null);r<128?e[n++]=r:(r<2048?e[n++]=r>>6|192:(r<65536?e[n++]=r>>12|224:(e[n++]=r>>18|240,e[n++]=r>>12&63|128),e[n++]=r>>6&63|128),e[n++]=63&r|128)}return n}(this.buf,e,this.pos);var n=this.pos-t;n>=128&&tu(t,n,this),this.pos=t-1,this.writeVarint(n),this.pos+=n},writeFloat:function(e){this.realloc(4),Zs(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Zs(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var n=0;n=128&&tu(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(e,t,n){this.writeTag(e,Qs.Bytes),this.writeRawMessage(t,n)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,nu,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,ru,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,au,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,iu,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,ou,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,su,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,uu,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,cu,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,lu,t)},writeBytesField:function(e,t){this.writeTag(e,Qs.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,Qs.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,Qs.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,Qs.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,Qs.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,Qs.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,Qs.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,Qs.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,Qs.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,Qs.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};var yu=function(e,t){var n=t.pixelRatio,r=t.version,i=t.stretchX,o=t.stretchY,a=t.content;this.paddedRect=e,this.pixelRatio=n,this.stretchX=i,this.stretchY=o,this.content=a,this.version=r},_u={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};_u.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},_u.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},_u.tlbr.get=function(){return this.tl.concat(this.br)},_u.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(yu.prototype,_u);var bu=function(e,t){var n={},r={};this.haveRenderCallbacks=[];var i=[];this.addImages(e,n,i),this.addImages(t,r,i);var o=gu(i),a=new _a({width:o.w||1,height:o.h||1});for(var s in e){var u=e[s],c=n[s].paddedRect;_a.copy(u.data,a,{x:0,y:0},{x:c.x+1,y:c.y+1},u.data)}for(var l in t){var h=t[l],f=r[l].paddedRect,p=f.x+1,d=f.y+1,m=h.data.width,v=h.data.height;_a.copy(h.data,a,{x:0,y:0},{x:p,y:d},h.data),_a.copy(h.data,a,{x:0,y:v-1},{x:p,y:d-1},{width:m,height:1}),_a.copy(h.data,a,{x:0,y:0},{x:p,y:d+v},{width:m,height:1}),_a.copy(h.data,a,{x:m-1,y:0},{x:p-1,y:d},{width:1,height:v}),_a.copy(h.data,a,{x:0,y:0},{x:p+m,y:d},{width:1,height:v})}this.image=a,this.iconPositions=n,this.patternPositions=r};bu.prototype.addImages=function(e,t,n){for(var r in e){var i=e[r],o={x:0,y:0,w:i.data.width+2,h:i.data.height+2};n.push(o),t[r]=new yu(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(r)}},bu.prototype.patchUpdatedImages=function(e,t){for(var n in e.dispatchRenderCallbacks(this.haveRenderCallbacks),e.updatedImages)this.patchUpdatedImage(this.iconPositions[n],e.getImage(n),t),this.patchUpdatedImage(this.patternPositions[n],e.getImage(n),t)},bu.prototype.patchUpdatedImage=function(e,t,n){if(e&&t&&e.version!==t.version){e.version=t.version;var r=e.tl;n.update(t.data,void 0,{x:r[0],y:r[1]})}},zr("ImagePosition",yu),zr("ImageAtlas",bu);var wu={horizontal:1,vertical:2,horizontalOnly:3},xu=function(){this.scale=1,this.fontStack="",this.imageName=null};xu.forText=function(e,t){var n=new xu;return n.scale=e||1,n.fontStack=t,n},xu.forImage=function(e){var t=new xu;return t.imageName=e,t};var Eu=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function Su(e,t,n,r,i,o,a,s,u,c,l,h,f,p,d,m){var v,g=Eu.fromFeature(e,i);h===wu.vertical&&g.verticalizePunctuation();var y=ai.processBidirectionalText,_=ai.processStyledBidirectionalText;if(y&&1===g.sections.length){v=[];for(var b=0,w=y(g.toString(),Du(g,c,o,t,r,p,d));b0&&z>T&&(T=z)}else{var B=n[C.fontStack],j=B&&B[k];if(j&&j.rect)N=j.rect,D=j.metrics;else{var U=t[C.fontStack],V=U&&U[k];if(!V)continue;D=V.metrics}R=24*(w-C.scale)}L?(e.verticalizable=!0,S.push({glyph:k,imageName:P,x:f,y:p+R,vertical:L,scale:C.scale,fontStack:C.fontStack,sectionIndex:I,metrics:D,rect:N}),f+=O*C.scale+c):(S.push({glyph:k,imageName:P,x:f,y:p+R,vertical:L,scale:C.scale,fontStack:C.fontStack,sectionIndex:I,metrics:D,rect:N}),f+=D.advance*C.scale+c)}0!==S.length&&(d=Math.max(f-c,d),Pu(S,0,S.length-1,v,T)),f=0;var q=o*w+T;E.lineOffset=Math.max(T,x),p+=q,m=Math.max(q,m),++g}else p+=o,++g}var H,G=p- -17,W=Nu(a),K=W.horizontalAlign,Y=W.verticalAlign;(function(e,t,n,r,i,o,a,s,u){var c,l=(t-n)*i;c=o!==a?-s*r- -17:(-r*u+.5)*a;for(var h=0,f=e;h=0&&r>=e&&Tu[this.text.charCodeAt(r)];r--)n--;this.text=this.text.substring(e,n),this.sectionIndex=this.sectionIndex.slice(e,n)},Eu.prototype.substring=function(e,t){var n=new Eu;return n.text=this.text.substring(e,t),n.sectionIndex=this.sectionIndex.slice(e,t),n.sections=this.sections,n},Eu.prototype.toString=function(){return this.text},Eu.prototype.getMaxScale=function(){var e=this;return this.sectionIndex.reduce((function(t,n){return Math.max(t,e.sections[n].scale)}),0)},Eu.prototype.addTextSection=function(e,t){this.text+=e.text,this.sections.push(xu.forText(e.scale,e.fontStack||t));for(var n=this.sections.length-1,r=0;r=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var Tu={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Au={};function Cu(e,t,n,r,i,o){if(t.imageName){var a=r[t.imageName];return a?a.displaySize[0]*t.scale*24/o+i:0}var s=n[t.fontStack],u=s&&s[e];return u?u.metrics.advance*t.scale+i:0}function Iu(e,t,n,r){var i=Math.pow(e-t,2);return r?e=0,h=0,f=0;f-n/2;){if(--a<0)return!1;s-=e[a].dist(o),o=e[a]}s+=e[a].dist(e[a+1]),a++;for(var u=[],c=0;s